A vendor release is tagged once, with the Cordis tag. bump.ts took each
member's baseline from that member's own newest tag, so every member but
Cordis advanced its patch on each prerelease (cosmokit 1.10.0-alpha.1 ->
1.10.1-alpha.2, then 1.10.2-alpha.3). Each member's last released version
is now its manifest version at the commit of the newest vendor-cordis-v*
tag; a member absent there keeps the rule for an unreleased package.
* feat(client): publish dependency stylesheet assets from dynamic bundles
A dynamic Client bundle that imports a dependency's stylesheet, such as
katex/dist/katex.css, now publishes the files that stylesheet's relative
url() values reference under lib/assets/vendor/<dependency>/<path>, with
the same content revision and asset-route URL as the package's own
assets. Each @font-face keeps only its first url() source, so one font
file per face is published. Fonts (.woff2, .woff, .ttf, .otf) become
package-asset media types for the asset route, the WebWorker preview
copy, and the asset import declarations. verify-client-packages reads
the url() references of imported dependency stylesheets, and rejects a
bare stylesheet import that does not resolve from the package.
* feat(client): leave <request>/client to the module table at build time
The module table already resolves a `<specifier>/client` it does not hold
exactly to the `<specifier>` entry (stripClientSuffix). The dynamic build
preset now applies the same rule: coversRequest() treats
`<specifier>/client` as requested whenever `<specifier>` is a baseline,
preloaded, or dsh.client.external request, so a bundle that imports
either spelling emits a module-table require and never inlines a private
copy. The static manifest factory records `<platform module>/client`
imports the same way, and verify-client-packages reuses
stripClientSuffix: a declared `<baseline>/client` is a repeated baseline
request, and a declared `<specifier>` is live when production source
imports `<specifier>/client`.
Tests: the module table returns one exports object for require(id) and
require(id + '/client') of a row named by package (it fails without the
normalization); a Web browser test loads a hand-written prebuilt fixture
plugin that requires the package root and `/client` of ui-slots,
ui-primitives and ui-dockkit and receives the same exports with the
expected members; a dynamic bundle importing both spellings of those
three packages emits requires of both and inlines none of their modules
(it fails with a purity error without the normalization).
* fix(typert): compare merged symbols when resolving package exports
TypeScript merges a module augmentation of an interface that a module
reaches through `export *` into a clone of the original symbol, while the
module's export table keeps the original. Typert compared the two by
identity and rejected the augmented interface as "not exported" by the
package. resolveSymbol now returns the merged symbol, so the package
export and the augmented declaration match.
The new type-model case augments an interface that a package root
re-exports from another file; it fails without the change.
* feat(client): expose the /client subpath of three Client packages
ui-slots, ui-primitives and ui-dockkit gain a `./client` export and a
tsconfig path for `<package>/client`. The subpath carries the
declarations from lib/types/client/index.d.ts and, while the packages
are still statically linked, the same runtime entry as the package root,
lib/index.js; in source programs it maps to src/client/index.ts. Code
can now name the three packages through `/client` in every build face.
client-store keeps its package root as its only entry.
* feat(scripts): read SlotMap merges under both ui-slots module names
The slot catalog scan reads declare module blocks of
@deepseek-ai/dsh-client-ui-slots and of its /client subpath, which publish
one declaration file, so a slot owner may augment either name.
* refactor(client): augment ui-slots through /client
Every declare module of @deepseek-ai/dsh-client-ui-slots in repository
TypeScript now names @deepseek-ai/dsh-client-ui-slots/client; block bodies
are unchanged. The /client subpath is the module that declares SlotMap
and the standard-kit interfaces, so the augmentations land on it
directly. Produced by:
pnpm exec tsx .artifacts/codemod/client-specifiers.ts --packages ui-slots,ui-primitives,ui-dockkit \
--augmentations --write
137 specifiers in 137 files.
* refactor(client): import three Client packages through /client
Every import and export declaration, import() expression or type query,
and vi.mock-family call in repository TypeScript that names ui-slots,
ui-primitives or ui-dockkit by package root now names <package>/client;
value and type-only imports alike. Imports of client-store stay on its
package root. Produced by:
pnpm exec tsx .artifacts/codemod/client-specifiers.ts --packages ui-slots,ui-primitives,ui-dockkit \
--imports --write
1213 specifiers in 857 files.
* test(client): key bundle-test module tables by the /client specifiers
Built bundles now require ui-primitives as
@deepseek-ai/dsh-client-ui-primitives/client, so the document preview
license test and the trajectory bundle test key their stub module tables
by that specifier. client-store stays keyed by its package root.
* feat(client): load three Client packages as immediately dynamic plugins
ui-slots, ui-primitives and ui-dockkit stop being statically linked into
the Web shell. Each becomes a dynamic plugin package with
`immediately: true`, like ui-renderer: src/client/index.ts builds
lib/client.js, the ./client export, whose apply registers nothing, and
the web-app composition lists the three rows by package name, so they
register before other plugins and any bundle can require their exports.
Their /client entries still export values, a historical exception that
will be reduced over time. Dynamic bundles keep leaving the three names
to the module table without declaring them.
client-store is unchanged: it stays a staticLinked library that the Web
shell seeds, and ui-slots and ui-primitives keep importing it by package
root, which their dynamic bundles leave to the module table.
For compatibility with code outside the repository, the package root's
runtime is the hand-written Host entry src/index.js with the empty
apply, built to lib/index.js, and its types reuse the ./client
declarations, which check-workspace-constraints accepts. src/index.ts
is gone; the tsconfig path of the root already maps to the src
directory, where tsx finds index.js.
Gates follow the Host entry without a src/index.ts: the dependency and
config-catalog scans resolve ./src/index.js to its source module,
verify-cordis-config accepts a configured root that resolves under src/,
and verify-client-packages accepts a workspace PLATFORM_MODULES name
supplied by an immediately row of the same name, while a seeded
workspace module still has to use the staticLinked preset. The benchmark
workers read the workspace manifests and bundle from source the /client
subpath of each package that declares dsh.client, because its built
lib/client.js registers with a browser module loader; every other
@deepseek-ai specifier, client-store and token-meter/client included,
stays on its built entry. Generated catalogs and the lockfile are
refreshed.
* feat(scripts): require /client where the package root reuses ./client types
verify-client-packages reads every module specifier in repository
TypeScript outside vendor/ (import and export declarations, import()
expressions and types, require and vi.mock-family calls, and declare
module names) and rejects one that names the root of a workspace package
whose root `types` equal its own `./client` types, a set it reads from
the manifests: ui-slots, ui-primitives and ui-dockkit. client-store
keeps its own root declarations and stays out of the rule. In
the repository such a root resolves to the Host entry under src/, which
has neither the /client exports nor their declarations, so repository
code names these packages through <package>/client for values, types,
and augmentations; the diagnostic states why. The gate fails when no
manifest qualifies or the scan finds no augmentation, which guards
against an empty corpus.
A ui-slots spec augments SlotMap through /client and reads the merged
entry through the /client import.
* test(scripts): check external TypeScript consumers of three Client packages
verify-client-package-consumer-types, part of `pnpm run hygiene` after
the build, pins the type compatibility commitment to code outside the
repository. It installs the built workspace packages into a temporary
consumer project through node_modules and the package exports, and
compiles the fixtures in scripts/fixtures/client-package-consumer/ as
separate programs under NodeNext and Bundler resolution: package-root
imports and augmentations only, /client only, both spellings in one
file, and both spellings across two files in either order. Each program
asserts the exact merged SlotMap and GlobalStandardProps keys, the owner
types, that renderSlot accepts the augmented keys and rejects another
one, and that both import specifiers read the same interface.
A negative control compiles the mixed programs against a copy of
ui-slots whose root types forward to ./client from a separate file; they
must fail there. The fixtures resolve the packages only inside that
temporary install, so the Host program, type-aware lint, and the
repository spelling check skip them.
The hygiene aggregate in scripts/run-gates.spec.ts lists the new
client-package-consumer-types id after node-next-types.
* docs(client): record the decision on three immediately Client packages
A new Agent Note records why ui-slots, ui-primitives and ui-dockkit are
`immediately` dynamic plugin packages while client-store stays a
statically linked library, the compatibility adjustments to their
package root (the hand-written Host entry and the reused ./client
types), why the repository names them only through `/client`, the
rejected alternatives, and the two compatibility commitments with the
tests that keep them. The Client shell layering note links it and lists
client-store as the statically linked library that uses the staticLinked
preset; the notes on package assets, connector accounts and right-sidebar
docking state the dynamic form.
The upgrade guide client-packages-dynamic-plugins states the final form,
the recommended `/client` specifier, the commitments for TypeScript
consumers and built plugins, what is unsupported, and that client-store
is unchanged.
packages/client/AGENTS.md, the three packages' READMEs, the Web, modules,
renderer and Client test runtime READMEs, the Web Client and defensive
pattern references, and the benchmark instructions describe them as
dynamic plugin packages whose remaining /client value exports are a
historical exception that will be reduced over time, and keep
client-store as the static Client library the shell seeds and bundles
with Zustand and Immer; code examples name the three packages through
`/client`.
A new Agent Note records why ui-slots, ui-primitives and ui-dockkit are
`immediately` dynamic plugin packages while client-store stays a
statically linked library, the compatibility adjustments to their
package root (the hand-written Host entry and the reused ./client
types), why the repository names them only through `/client`, the
rejected alternatives, and the two compatibility commitments with the
tests that keep them. The Client shell layering note links it and lists
client-store as the statically linked library that uses the staticLinked
preset; the notes on package assets, connector accounts and right-sidebar
docking state the dynamic form.
The upgrade guide client-packages-dynamic-plugins states the final form,
the recommended `/client` specifier, the commitments for TypeScript
consumers and built plugins, what is unsupported, and that client-store
is unchanged.
packages/client/AGENTS.md, the three packages' READMEs, the Web, modules,
renderer and Client test runtime READMEs, the Web Client and defensive
pattern references, and the benchmark instructions describe them as
dynamic plugin packages whose remaining /client value exports are a
historical exception that will be reduced over time, and keep
client-store as the static Client library the shell seeds and bundles
with Zustand and Immer; code examples name the three packages through
`/client`.
verify-client-package-consumer-types, part of `pnpm run hygiene` after
the build, pins the type compatibility commitment to code outside the
repository. It installs the built workspace packages into a temporary
consumer project through node_modules and the package exports, and
compiles the fixtures in scripts/fixtures/client-package-consumer/ as
separate programs under NodeNext and Bundler resolution: package-root
imports and augmentations only, /client only, both spellings in one
file, and both spellings across two files in either order. Each program
asserts the exact merged SlotMap and GlobalStandardProps keys, the owner
types, that renderSlot accepts the augmented keys and rejects another
one, and that both import specifiers read the same interface.
A negative control compiles the mixed programs against a copy of
ui-slots whose root types forward to ./client from a separate file; they
must fail there. The fixtures resolve the packages only inside that
temporary install, so the Host program, type-aware lint, and the
repository spelling check skip them.
The hygiene aggregate in scripts/run-gates.spec.ts lists the new
client-package-consumer-types id after node-next-types.
verify-client-packages reads every module specifier in repository
TypeScript outside vendor/ (import and export declarations, import()
expressions and types, require and vi.mock-family calls, and declare
module names) and rejects one that names the root of a workspace package
whose root `types` equal its own `./client` types, a set it reads from
the manifests: ui-slots, ui-primitives and ui-dockkit. client-store
keeps its own root declarations and stays out of the rule. In
the repository such a root resolves to the Host entry under src/, which
has neither the /client exports nor their declarations, so repository
code names these packages through <package>/client for values, types,
and augmentations; the diagnostic states why. The gate fails when no
manifest qualifies or the scan finds no augmentation, which guards
against an empty corpus.
A ui-slots spec augments SlotMap through /client and reads the merged
entry through the /client import.
ui-slots, ui-primitives and ui-dockkit stop being statically linked into
the Web shell. Each becomes a dynamic plugin package with
`immediately: true`, like ui-renderer: src/client/index.ts builds
lib/client.js, the ./client export, whose apply registers nothing, and
the web-app composition lists the three rows by package name, so they
register before other plugins and any bundle can require their exports.
Their /client entries still export values, a historical exception that
will be reduced over time. Dynamic bundles keep leaving the three names
to the module table without declaring them.
client-store is unchanged: it stays a staticLinked library that the Web
shell seeds, and ui-slots and ui-primitives keep importing it by package
root, which their dynamic bundles leave to the module table.
For compatibility with code outside the repository, the package root's
runtime is the hand-written Host entry src/index.js with the empty
apply, built to lib/index.js, and its types reuse the ./client
declarations, which check-workspace-constraints accepts. src/index.ts
is gone; the tsconfig path of the root already maps to the src
directory, where tsx finds index.js.
Gates follow the Host entry without a src/index.ts: the dependency and
config-catalog scans resolve ./src/index.js to its source module,
verify-cordis-config accepts a configured root that resolves under src/,
and verify-client-packages accepts a workspace PLATFORM_MODULES name
supplied by an immediately row of the same name, while a seeded
workspace module still has to use the staticLinked preset. The benchmark
workers read the workspace manifests and bundle from source the /client
subpath of each package that declares dsh.client, because its built
lib/client.js registers with a browser module loader; every other
@deepseek-ai specifier, client-store and token-meter/client included,
stays on its built entry. Generated catalogs and the lockfile are
refreshed.
Built bundles now require ui-primitives as
@deepseek-ai/dsh-client-ui-primitives/client, so the document preview
license test and the trajectory bundle test key their stub module tables
by that specifier. client-store stays keyed by its package root.
Every import and export declaration, import() expression or type query,
and vi.mock-family call in repository TypeScript that names ui-slots,
ui-primitives or ui-dockkit by package root now names <package>/client;
value and type-only imports alike. Imports of client-store stay on its
package root. Produced by:
pnpm exec tsx .artifacts/codemod/client-specifiers.ts --packages ui-slots,ui-primitives,ui-dockkit \
--imports --write
1213 specifiers in 857 files.
Every declare module of @deepseek-ai/dsh-client-ui-slots in repository
TypeScript now names @deepseek-ai/dsh-client-ui-slots/client; block bodies
are unchanged. The /client subpath is the module that declares SlotMap
and the standard-kit interfaces, so the augmentations land on it
directly. Produced by:
pnpm exec tsx .artifacts/codemod/client-specifiers.ts --packages ui-slots,ui-primitives,ui-dockkit \
--augmentations --write
137 specifiers in 137 files.
The slot catalog scan reads declare module blocks of
@deepseek-ai/dsh-client-ui-slots and of its /client subpath, which publish
one declaration file, so a slot owner may augment either name.
ui-slots, ui-primitives and ui-dockkit gain a `./client` export and a
tsconfig path for `<package>/client`. The subpath carries the
declarations from lib/types/client/index.d.ts and, while the packages
are still statically linked, the same runtime entry as the package root,
lib/index.js; in source programs it maps to src/client/index.ts. Code
can now name the three packages through `/client` in every build face.
client-store keeps its package root as its only entry.
TypeScript merges a module augmentation of an interface that a module
reaches through `export *` into a clone of the original symbol, while the
module's export table keeps the original. Typert compared the two by
identity and rejected the augmented interface as "not exported" by the
package. resolveSymbol now returns the merged symbol, so the package
export and the augmented declaration match.
The new type-model case augments an interface that a package root
re-exports from another file; it fails without the change.
The module table already resolves a `<specifier>/client` it does not hold
exactly to the `<specifier>` entry (stripClientSuffix). The dynamic build
preset now applies the same rule: coversRequest() treats
`<specifier>/client` as requested whenever `<specifier>` is a baseline,
preloaded, or dsh.client.external request, so a bundle that imports
either spelling emits a module-table require and never inlines a private
copy. The static manifest factory records `<platform module>/client`
imports the same way, and verify-client-packages reuses
stripClientSuffix: a declared `<baseline>/client` is a repeated baseline
request, and a declared `<specifier>` is live when production source
imports `<specifier>/client`.
Tests: the module table returns one exports object for require(id) and
require(id + '/client') of a row named by package (it fails without the
normalization); a Web browser test loads a hand-written prebuilt fixture
plugin that requires the package root and `/client` of ui-slots,
ui-primitives and ui-dockkit and receives the same exports with the
expected members; a dynamic bundle importing both spellings of those
three packages emits requires of both and inlines none of their modules
(it fails with a purity error without the normalization).
A dynamic Client bundle that imports a dependency's stylesheet, such as
katex/dist/katex.css, now publishes the files that stylesheet's relative
url() values reference under lib/assets/vendor/<dependency>/<path>, with
the same content revision and asset-route URL as the package's own
assets. Each @font-face keeps only its first url() source, so one font
file per face is published. Fonts (.woff2, .woff, .ttf, .otf) become
package-asset media types for the asset route, the WebWorker preview
copy, and the asset import declarations. verify-client-packages reads
the url() references of imported dependency stylesheets, and rejects a
bare stylesheet import that does not resolve from the package.
* feat(office): add frame-forwarded preview and bundle integration
* feat(office): present document and slideshow frames with video
* test(office): simulate video frame cloning across preview sessions
* fix(frame-forwarding): preserve document proportions during resize
* fix(office-preview): resume frames after tab switches and restore margin dragging
* refactor(office-preview): share submitted geometry and simplify fixture cleanup
* refactor(office): remove obsolete viewport discard comparison
* refactor(office): take shared textures from the dsh-shared-texture services
The Office preview spec helper imported the bridge and lease types from the removed @deepseek-ai/dsh-shared-texture-client-types package, passed frame forwarding the failureSource() adapter that its Client service no longer declares, and the specs stubbed globalThis.dshDesktop, which frame forwarding no longer reads.
The helper imports the types from @deepseek-ai/dsh-shared-texture/client and drops the adapter, and the specs stop stubbing dshDesktop. The shared-texture Agent Note drops the PR citation from its NodeNext declaration check sentence, and the README model-experience registry rewords the dsh-shared-texture entry.
* fix(office-preview): take the React 19 ref types
The client moved to React 19, whose types require an initial value for `useRef` and type a DOM ref created with `null`
as `RefObject<T | null>`. Refs that start empty now pass `undefined`, the surface takes its element refs as
`RefObject<HTMLDivElement | null>`, and `RefObject` replaces the deprecated `MutableRefObject`, as the rest of the client
does.
* fix(office-preview): align the producer and receiver tests on Kit 0.2.4
* chore(office-preview): refresh the client slot catalog
* fix(office-preview): drain document releases and handle slideshow frame failures
* refactor(office): expose Kit discovery and editor opening on officeKit
* fix(office-preview): preserve slideshows across same-client event reconnects
* refactor(frame-forwarding): use single-producer channels and retain Office slide previews
* fix(plugins): show native Office preview only in Desktop
* fix(office-preview): reconcile slideshow and document lifetimes on reconnect and refresh
* fix(office-preview): simplify slideshow recovery and retain hidden fallback views
* refactor(office-preview): type document operations and detach playback before refresh
* feat(office-preview): lease documents by tab and reopen expired previews
* fix(office-preview): retire slideshow mounts without blocking channel recovery
* fix(office-preview): restore the last shown slide on channel reconnect
* fix(office-preview): preserve channel loss while waiting for the first viewport
* fix(office-preview): cancel slideshow readiness when playback stops
* test(web): exclude desktop-only bundles in plugin-config e2e
* fix(office): cancel retired viewport waits and count successful redraws
* fix(office-preview): await timed-out open cleanup on plugin disposal
A collapsed program call hides its sub-calls, so a running program showed only its
description and a count. While the program runs and its row is closed, one inert row
under it now shows the last started sub-call that has not settled. Between two
sub-calls it keeps the last one started, so the rows below do not shift on every call.
The row is removed when the program call settles or its row is opened.
* perf(client-ui-stats): add a PTC fold and publication diagnostic
One root run_code call dispatching 1,000 to 10,000 settled subcalls reports
the Statistics fold, the first and repeated Code-Mode publication, and the
live assembler window. Threshold-free, outside every CI lane.
* perf(client-ui-stats): fold tool calls into Context-private indexes
Every event copied the growing call and dispatch-start records, so one
Code-Mode root call with n nested dispatches cost O(n^2). The four
fold collections are Maps the Context mutates in place now, and update()
returns the same State.
The call list stops sorting the whole index: a Context receives its
matches in ascending seq, so insertion order is the order the table
lists.
* perf(client-ui-stats): publish only the bounded Code-Mode prefix
The Code-Mode node rebuilt every step metric, including a sort of every
dispatch, for each settle, though it publishes at most 12 rows. It now
materializes that prefix from the index, republishes the node it already
published while the prefix is unchanged, and coalesces publications to
one per frame. Targeted snapshot updates skip the rebuild when every
upserted node is the published one.
* docs(client-ui-stats): record the linear Statistics fold
Agent Note for the in-place call index, the bounded Code-Mode prefix, the
retention bound, and the publication cadence, with the measured before and
after table.
* fix(client-ui-stats): reuse the node the Assembler already holds
The Code-Mode Definition kept its own module-level WeakMap of published
nodes, keyed by State. The Assembler already stores each Context's last
published node in `context.current`, which is where the Chat Definition
reads it, so the extra cache hid state ownership for nothing.
It also missed in two reachable cases: a failed dispatch returns a fresh
State, and `callList` rebuilds every row past the step text budget as a
truncated copy, so an unchanged prefix arrived as fresh objects and the
reference comparison failed. The snapshot rebuild the cache was meant to
skip then ran anyway.
Read `context.current` instead and compare rows field by field. Edited
the publication comment to state the real cadence: the Assembler
materializes an `animation-frame` publication after three frames.
* docs(notes): correct the Statistics fold note against the code
Three statements did not match what shipped. The scalar counters the
retention bound leaves alone are `toolPairs`, `toolMs`, `toolOpen`, and
`toolMissing`, not `pairs`/`ms`/`open`/`missing`, and they are written by
the native `tool/call` and `tool/result` branches rather than by the
dispatch branch; only `tools` and `toolErrors` count every dispatch. The
retained records are the first `CALL_LIMIT` displayable dispatches, not
the first `CALL_LIMIT` dispatches, so a nested runner no longer takes a
slot. The publication cadence is three animation frames, not one.
* test(scripts): expect the Statistics diagnostic in the perf inventory
The manual `test:web:perf` inventory is pinned item by item, and the new
`client-ui-stats` entry left the expectation behind, so the required
coverage partition failed on it.
---------
Co-authored-by: imccyu <cc.yu@deepseek.com>
* feat(ui-tool): fold program sub-call lists by default
* feat(ui-tool): show a program call as one row over its source and sub-calls
A run_code or cua_run_code call renders as one collapsed row with the
program's description and its sub-call count. Opening it lists the PTC
source code row and then the sub-calls. A failed call shows its first
error line in place of the count, and an interrupted call shows that it
stopped.
A call with more than 32 sub-calls lists the first 10 and the last 10
around a row that states how many are omitted. The three numbers are
constants in ToolCallTree.
The row replaces the separate collapsed count row. A collapsed program
call mounts neither its own toolview nor its sub-calls.
* feat(ui-tool): title the program source row "Source code"
The row also heads cua_run_code programs in Standard mode, where "PTC"
names a different agent mode.
* test(web): refresh the scoped PTC round goldens for the program call row
The persistent-in-memory variant of the PTC round renders the same
program call row as the per-call variant.
* fix(ui-tool): keep the program call state whole and move the error line to the source row
A failed program call shows "Failed" after its description, the way an
interrupted call shows "Stopped". The count and both states never
shrink, so a narrow row truncates only the description. The error line
could shrink together with the description, which clipped "Stopped"
beside a long description and hid a short description beside a long
error line.
The source code row shows the first error line without its "Error: "
lead.
* feat(ui-tool): mark the program call row with a hub icon
Add the hub-outline product glyph, a central node wired to three
satellite nodes, and use it for the program call header instead of
layers-outline, which keeps its other uses.
* feat(ui-tool): reveal omitted program sub-calls 50 per side on click
Lower the sub-call list threshold to 24. The omission row becomes a
"Show more (N hidden)" button that lists up to 50 more sub-calls on each
side per activation; reopening the program call returns to the first and
last 10.
* docs(ui-tool): describe the sub-call list constants as the initial window
* feat(ui-tool): list the first 20 sub-calls and double the list per show-more click
A program call with more than 24 sub-calls now lists its first 20 followed
by the "Show more" row; each click doubles the listed count (20, 40,
80, ...) until every sub-call is listed. Reopening the program call returns
to the first 20.
* fix(ui-tool): show a failed program call's error line with its "Error: " lead
The source code row of a failed program call shows the result's first
line unchanged, like every other failed tool row. The "Error: " lead is
the tool pipeline's model-facing failure text; removing it in the card
with a pattern match edited recorded text for one tool variant only.
* feat(ui-tool): render a program call's own row through a dedicated source row
`run_code` and `cua_run_code` register `SourceCodeRow` in
`tool.call.toolview`. It shows the program and its output, with the
first error line on failure, and no description, because the program
call's header row shows it. `GenericToolCard` keeps no program-call
branch. Image labels in flattened result text move to
`formatResultImage`, which both rows use.
The two registrations add two occupant lines to the
`tool.call.toolview` slot report, so its catalog budget rises to 136.
The account settings README still said a successful login replaces a previously saved default. It now states that a saved default naming a listed account model is kept with its reasoning effort.
Refs #9392
Account login without a provider API key replaced the saved default with the first account model and its default reasoning effort. A saved default that names a listed account model is now retained with its effort; every other case is unchanged.
Fixes#9392
* fix(repeat-tool-reminder): stop reminding repeated subagent and job waits
Add a reset tool-name list whose model-direct calls end the agent's
repeat chain without counting, and list wait_agent and job_output in the
dsh base bundle.
Fixes#9194
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
* fix(repeat-tool-reminder): count failed reset-tool calls
A failed or denied wait does not observe changing state, so only a
successful reset-tool call ends the chain. The reset snapshot now waits
on a running background job.
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
* fix(base): exclude bookkeeping updates and reset on user answers
The base bundle excludes todo_write, team_task_update, and update_goal
from the repeat chain so they cannot hide a loop between repeated calls,
and resets the chain after ask_user_question.
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
* refactor(repeat-tool-reminder): rename reset to restartCountAfter
The option name now states its effect: a successful call to a listed
tool restarts the repeat count.
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
---------
Co-authored-by: Turtle <turtle1999@deepseek.com>
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
* fix(cua-macos): select applications that run from a code-signing copy
Google Chrome runs from a temporary code-signing clone, so its kernel process
path never matched the catalog executable and getApp always reported STALE_APP.
Compare the selection with live application metadata from the same source and
keep the kernel path for processes without that metadata.
* docs(cua-macos): state what the running executable check binds
Application metadata supplies the running executable path, so the selection
check compares the executable macOS registered for an application process,
not the image the kernel runs. Record that consequence in the bundle-ID
consent note, use one term for the running executable path in the note and
package README, and correct the describe comment for the launch path.
* fix(desktop): hide the Windows menu entries while the document is fullscreen
Frame forwarding offers plugins the Fullscreen API; the Application and Edit caption entries now stay hidden during fullscreen and return when it ends.
* feat(desktop): build declared native addons for development and packaging
* feat(frame-forwarding): receive native frames and submit them to the Desktop sink
* feat(frame-forwarding): route Host channels to video mounts in the Client
Keep the producer interface internal while Office integration evolves. Include channel lifecycle, receiver integration and video presentation tests.
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
* test(frame-forwarding): cover wire packet and endpoint parsing with fuzz tests
* refactor(desktop): preinstall the native frame receiver
* build(desktop): compile the preinstalled receiver from the plugin workspace
* refactor(frame-forwarding): load the preinstalled receiver inside the plugin
* refactor(desktop): pass the frame receiver path as a Host argument
---------
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
The header breadcrumb walks parentId through side conversations as the
left Sidebar's current row does, so a subagent opened from a side
conversation leads back to the listed main conversation. A fork of a
side conversation that is not attached to a Workspace itself attaches to
its source's Workspace, as a subagent's fork does. SessionHeaderMeta
documents parentSession, and the wire, Agent, and snapshot harness
comments name both relationships.
IM resolves a hosted chat and the session log export collects descendant
logs only through origin: 'subagent', as auto-review already does, so an
ordinary fork that recorded its source before the independent-forks
decision no longer inherits its source's chat or packs as a subagent log.
The side conversation README states the recorded source and the Agent
Note describes only this decision's scope.
A side fork writes its source Session as parentSession on the Host header
and parentSessionId on the Client placeholder, so the source can list its
side conversations. parentSession now means the creating Session for both
subagents and side conversations; what kind of child a Session is comes
only from origin. The three readers that took parentSession alone as
delegation now check origin: auto-review grants direct-parent instruction
authority only to a subagent's delegating parent, IM stops its hosted-chat
walk at a side conversation, and the session log export leaves side
conversations out of a Session's descendant logs. The left Sidebar resolves
the viewed Session's row through side sources as it does through subagent
creators.
Invalid completed tool arguments are a model-output failure, not a
provider protocol violation. Add the INVALID_TOOL_ARGUMENTS code, retry it
under the default normal policy and manual continuation, and report it
from the pi-ai adapter instead of MALFORMED_RESPONSE.
Refs #9361
Each of client-store, ui-slots, ui-primitives and ui-dockkit gains
src/index.ts, which only re-exports src/client/index.ts. The packages
remain staticLinked libraries: package.json, the tsconfig package-root
paths, the Web shell's PLATFORM_MODULES and seed.ts, apps/cli, and
business imports are unchanged, and the built lib/index.js keeps the same
exports.
References to the moved files follow: package tests, other packages'
tests that read or import the ./src/* subpath, the Desktop welcome page's
./src/* imports, Vitest coverage excludes, the CSS selector baseline, the
client catalog comment, the liveshare and client-ui-forge fixtures,
READMEs, Agent Notes and the plugin-artwork skill. The 48
markdown-dom-parity snapshots change only their CSS Module class hashes,
which include the file path, and the ui-dockkit stylesheet's data-path
becomes src/client/components/dockkit.module.css.
Refs #9275
Move every file under src/ of client-store, ui-slots, ui-primitives and
ui-dockkit to src/client/, the layout of every other Client package. The
files are renamed without content changes. This commit does not build on
its own: the package roots and the references to the moved files follow
in the next commit.
Refs #9275
Read the existing widening table in reverse instead of a second mode list,
so SANDBOX_MODES stays in dsh-sandbox-policy. Add recorded-session
scenarios for a weaker bash and fs request.
Refs #9379
The sandbox never narrows a call. A requested mode equal to or weaker than
the call's effective mode now runs at the effective mode without approval
instead of failing with "not strictly wider". SANDBOX_MODES moves to
dsh-sandbox; dsh-sandbox-policy re-exports it.
Refs #9379
The failed-action notice, the install failure, and RemoteAnswerError now
carry the Host's ManagementError instead of copying its code,
incompatible packages, and supported platforms into separate fields, and
managementText takes ManagementError directly. A new error detail
therefore reaches the page without another copy at each carrier.
UnsupportedBundlePlatformError keeps the platforms it receives instead of
copying them a second time.
Keeps the PR focused on copy and layout: removes the settingsNavigation service, the Agent presets section id export, and the inline link; the PTC recommendation stays as plain text.
- Update the bundle-platform and preview-boot Web e2e tests for the
supported-platform list; the bundle-platform fixture declares freebsd so
one golden matches every CI Host.
- Assert the returned platform list in the plugin manager refusal tests.
- Keep the system permissions placeholder while the Host inventory lookup
decides whether a Windows provider is enabled, instead of flashing the
macOS failure layout.
- Use the macOS German names for Accessibility and Screen Recording.
- Show the provider lookup failure in place of the native query error when
the platform is still unknown, so one notice reports the governing cause.
- Mark standing Windows desktop conditions as notes; only failures alert.
- List supported platforms with a dedicated localized separator and keep the
refusal-code comment on CODE_KEYS.
- Drop the unused UnsupportedBundlePlatformError.platform field and make its
test fail when nothing is thrown.
- Type the Agent presets section id against ui-agent-preset's export.
The form of a new custom MCP server and a server's page kept the Plugins
page's title and the Installed/Connectors tabs above the Connectors tab's
own Back button. The tabs repeated Back, and selecting Installed with a
half-filled form dropped the form without a notice.
A contributed tab can now open a page of its own. `PluginTabProps` gains
`page`, `openPage(page)`, and `closePage()`, and the navigation store the
view `tabPage`. While such a page is open, the Plugins page hides its
header and tabs and draws a crumb named by the tab's label above the
entry, which stays mounted. The crumb sits where the crumb of a bundle's,
row's, or official plugin's page sits and returns to the tab's main
content. A tab that never calls `openPage` behaves as before.
The Connectors tab derives its custom servers view from `page` and opens
the form and a server's page through `openPage`, under the keys `new` and
`server:<row id>`. Its own Back button, that button's styles, and the
`custom.back` copy are removed. A server's page starts 32px under the
crumb, as the head of the Plugins page's other detail pages does.
A commit opened from its line in the review page activity is chosen by the page
store, not by a click in the commit picker, so the picker kept its earlier
start: a Shift click then showed one commit, or ran from a commit clicked
before. The picker now starts the run at the commit shown alone.
Also reword the comment on the activity comment ink, which named sizes that its
rules do not set.
* fix(cua-windows): keep accessibility reads when elements disappear mid-traversal
A descendant that disappears during a UI Automation read becomes a [One child could not be read.] or [Child list incomplete.] row and sets hasUnreadableElements, matching the macOS provider. Only a vanished window root still fails with STALE_SNAPSHOT. Incomplete trees are returned in full under showDiff and are not used as a diff baseline.
Refs #9205
* docs(cua-windows): document partial accessibility reads on upgrade
---------
Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>
* build(deps): upgrade the client to React 19
Raise react and react-dom to ^19.3.1 in every workspace manifest and the
root @types/react and @types/react-dom to 19.3, then regenerate the
lockfile on the current master. The website keeps the React 18 optional
peer of @docsearch/react 3.8.2, whose peer range excludes React 19.
Refs #9214
* fix(client): adopt React 19-only ref types and coverage arm
These adaptations compile or cover only under React 19:
- RefObject replaces MutableRefObject, which @types/react 19 deprecates;
RefObject.current is writable only in the React 19 types.
- Tooltip excludes its React 18 element.ref arm from coverage instead of
the React 19 props arm, which now always runs, and writes an object
ref through RefObject.
- THIRD_PARTY_NOTICES.md takes the React 19.3.1 repository URL.
Refs #9214
* docs(upgrade-guide): describe the React 19 client runtime
Client plugins receive React 19 from the shared module table and compile
against React 19 types; the guide lists the runtime and type changes
plugin authors must handle and the new test-runtime peer range.
Refs #9214
* test(ui-directory-picker-browse): wait for the passive refocus after a failed pick
The browser re-parks focus on the edit zone in a passive effect after the
commit that shows the failure alert. The test asserted focus right after
the alert appeared, so on Windows CI under React 19 it could run before
the effect. It now waits for the focus.
Refs #9214
* feat(desktop): add shared texture transport and native presentation layers
* fix(desktop): keep split fixtures and generated notices self-contained
* refactor(theme): defer presentation stage token to Office layer
* refactor(desktop): move frame integration into its consumer layer
* refactor(sidebar-right): move native-layer visibility support to frame layer
The fullscreen tab-body background and the tab visibility test only serve
the frame integration that hides native layers through tab.visible, so they
belong with that consumer layer.
* refactor(desktop): keep shared textures on the renderer path
* fix(desktop): settle shared textures across GPU loss and teardown
* fix(desktop): correlate late texture arrivals and settlements by request
* test(desktop): exercise late ingress delivery after presenter reset
* fix(desktop): bound unsettled textures before handle export
* fix(desktop): retain probe handles and invalidate unsynchronized imports
* refactor(desktop): leave the fullscreen caption rule to frame forwarding
The caption-menu fullscreen rule, its test, and the README sentences describe fullscreen that frame forwarding offers to plugins. They belong with frame forwarding, not the texture transport.
* refactor(desktop): validate Host texture limits in the channel only
The Host channel already shortens deadlines to 30 seconds and refuses dimensions above 8192 before Main's presenter sees a request, and it is the presenter's only caller. Remove the repeated checks from the presenter and assert the limits where they are enforced.
* fix(desktop): drop only the surface that finds the ingress queue full
A full delivery queue ended the macOS ingress reader, so a Main JavaScript thread that stalled for 16 surfaces failed every waiting presentation and left the Host without an endpoint until its next capability query. Release that one surface and keep reading; its presentation fails at the delivery deadline. A closing delivery function still ends the reader.
* fix(desktop): reach Main through one process handle for Windows texture handles
The Windows adapter opened Main by process identifier for every export, import, and reclamation. After Main exited, the Host's disconnect cleanup reclaimed each unsettled handle with DUPLICATE_CLOSE_SOURCE, which closes the source handle even when the call fails; an identifier reassigned by then named an unrelated process. Keep one handle to Main's process until the endpoint closes, refuse to reclaim without it, and leave duplicates to Main's exit after a disconnect.
* feat(desktop): carry shared-texture frames on a native Host-Main channel
Each frame was a Node IPC request from the Host's JavaScript thread, answered by a reply and a later notification on the same channel, with the macOS surface sent separately and paired in Main by token, and the Windows handle duplicated into Main by the Host through Koffi.
The hop and ingress addons now form a two-way native channel on both platforms: a Mach port pair on macOS and a duplex message pipe on Windows. A frame's handle and description reach Main in one message, and Main returns the delivery reply and the settlement on the same channel. On Windows, Main verifies the pipe client's process and duplicates the Host's handle into its own process, so the Host opens no process and closes no remote handle. The Host IPC channel keeps only the capability and probe controls.
A frame that finds Main's 32-frame delivery queue full is refused at once and stays reusable. When the channel is lost, the hop settles every unsettled frame as invalidated. The hop also exposes its connection to other Host addons as a C function table, which the sharedTexture claim returns from nativeSink, so a native producer can submit frames without the Host's JavaScript event loop.
* refactor(desktop): drop unused parts of the shared-texture ingress
Main never closed a handle inside the Host, never read a frame's delivery deadline, and waited for the Host's pipe connection only to cover the instant before the ingress registers it. Remove reclaimFromPeer, the timeoutMs field of the frame event, and the peer event with the probe's wait for it: a probe that arrives in that instant now fails with the export error.
With frames as the only queued deliveries, the delivery function's own queue limit bounds them again.
* refactor(desktop): submit shared-texture frames through the native sink only
The Host had two entries for submitting a frame: the hop's JavaScript present, wrapped as SharedTextureService.present with promises fed by per-frame events, and the C sink for native addons. Frame forwarding, the only consumer, submits through the sink.
Remove the JavaScript entry: the hop's present function and its delivered and settled events, the service's present with its frame, presented, and settlement types, and the wrapper's request table. The hop reports only the loss of a connection to JavaScript. The sink ABI and the wire format are unchanged.
* feat(desktop): tell a refused shared-texture frame from a lost connection
Every sink refusal returned 1, so a native consumer could not tell whether to keep its sink or replace it: a frame refused at the 128-request limit and a present after Main disappeared looked the same.
present now returns DSH_SHARED_TEXTURE_PRESENT_OK (0) when the request left the Host, DSH_SHARED_TEXTURE_PRESENT_REJECTED (1) when only that frame was refused (invalid arguments or fields, the request limit, an identifier in use, or a failed send on a live connection), and DSH_SHARED_TEXTURE_PRESENT_DISCONNECTED (2) when the connection was closed or lost, including a send that found Main gone before the reader did. A sent request still returns 0 and settles through the reader when the connection ends during its send.
* refactor(desktop)!: drop frame identifiers and the wire deadline from shared-texture presentation
Each frame carried a Host-chosen identifier that the hop and Main both kept unique among unsettled frames, and a delivery deadline that Main never read. Frame forwarding tracks its own deliveries, so the identifiers only cost a string copy, a set lookup on each side, and an extra refusal reason.
The sink ABI becomes version 2: dsh_shared_texture_frame_v2 drops id and id_len, and a consumer built for version 1 refuses the version 2 sink. DSTX becomes version 3: its present header drops timeout_ms and id_length and is followed by the metadata alone, and both sides refuse other versions and nonzero reserved fields. The hop still enforces each request's delivery deadline locally and still admits at most 128 unsettled requests; Main bounds admitted frames with a count instead of an identifier set.
The native e2e labels frames through their metadata, proves that a timed-out request keeps its slot through the request limit, and forges version 2 and malformed version 3 headers.
* refactor(desktop)!: read the Windows compositor adapter in Main
To learn which adapter Chromium's compositor renders on, the Host asked Main for a probe texture, Main duplicated it into the Host and kept its own handle and hidden window until the Host released the probe, and the Host closed its duplicate after reading the adapter. The exchange needed the native connection to be open first, a probe table and late-reply cleanup on both sides, and two handle-transfer operations that nothing else used.
Main now reads the adapter itself: the ingress addon reports the LUID of a Main-local shared texture through DXGI, formatted as "<HighPart>:<LowPart>" in unpadded lowercase hexadecimal, the text Host addons derive from an adapter LUID. Main exports one compositor texture, reads its adapter, and releases the texture and its window at once. The answer is kept for the GPU process generation, which a GPU process exit or Host teardown advances; concurrent queries share one probe, a probe that finds nothing or fails is not kept, a cleanup cancels a pending probe, and a probe that a GPU process exit overtook records nothing.
SharedTextureService.probe becomes adapterLuid(timeoutMs), which resolves to that text or null, returns null outside Windows without asking Main, rejects when Desktop does not present shared textures, and no longer opens the native connection. The Host control requests are capabilities and adapter-luid; the probe and release-probe requests, the ingress exportToPeer, and the hop closeHandle are removed.
* perf(desktop): block the macOS shared-texture ingress reader until a request or stop
The macOS ingress reader woke every 100 ms to check for a stop request, so an idle Desktop woke the reader ten times a second and a close waited for the next wake-up.
The reader now waits without a timeout. stop sets the flag and then sends an empty message to the ingress port through the send right Main already holds; a full queue already wakes the reader, so a wake-up that does not fit is dropped. Once stopped, the reader destroys whatever it receives, including its own wake-up, and Host requests still pass the audit-token check unchanged.
* perf(desktop): trim per-frame work on the shared-texture path
Every frame repeated work that only the first frame of a connection or no frame needs. On macOS each request carried a new send right to the Host's reply port, which Main merged and deallocated under a lock; the hop allocated and cleared a 4 KB message per request and the ingress cleared its whole receive buffer per message; the hop copied each frame's metadata into a string, and the Windows hop allocated a message vector; Main parsed every frame's metadata as JSON only to have Electron serialize the value again; and the product preload imported textures that no consumer would read.
The first request of a macOS connection that reaches Main carries the reply port, and Main keeps it for that connection. Main drops the right when a reply cannot be delivered, as the Windows ingress disconnects the pipe, and the hop then receives a no-senders notification and settles every request as invalidated; Main discards requests that arrive on the dropped connection, and the endpoint serves the Host's next connection. Sends reuse a buffer per connection under the send lock and clear only the header fields and alignment padding, the ingress clears only the fixed message fields, and the hop passes metadata to the transport as a view of the caller's bytes.
Main forwards the metadata text, and the product preload parses it before importing the texture. A transfer with metadata that is not JSON, or one that arrives while no consumer is registered, is refused before import, so the Host sees a failed delivery and a released settlement once Main drops its own reference.
* fix(desktop): never import a handle from a closed Windows shared-texture connection
A Windows request names its texture only by a handle value inside the Host, and Main duplicates it when its reader reaches the request. When the Host closed a connection itself, it settled every unsettled request as invalidated right after closing its pipe end, and the owner could then close the handle. A request still queued in the pipe stays readable after that close, so Main could duplicate a value that already named another object and present that texture as the settled frame.
After duplicating, Main now checks that the Host's end of the pipe is still connected. The Host closes its end before it reports any settlement, so a duplicate taken while the end is open names the texture the request was sent with. Otherwise Main closes the duplicate and ends the connection, which discards the requests still queued; the endpoint then serves the Host's next connection. macOS needs no check because each request carries the IOSurface port itself.
A Windows e2e suspends Main, presents a frame, closes the connection, and replaces the texture with one that takes over its handle value before resuming Main. Without the check Main delivered that frame with the replacement texture; with it Main delivers only the frames of open connections.
* chore(desktop): state how long an ingress reply can block, and end a build script with a newline
SharedTextureIngress.reply described a non-blocking queue, but it writes the reply on the calling thread and waits up to the 100 ms reply timeout while the Host is not reading. The comment now says so, together with the connection drop that follows a reply that cannot be written in time.
native-package-builds.mjs ended without a newline.
* fix(desktop): accept every enabled GPU compositing status in the adapter probe
The probe required gpu_compositing to be exactly 'enabled', while support() accepts any 'enabled*' status, so adapterLuid returned null where capabilities reported support. Also type the e2e frame tuple to satisfy no-unsafe-return.
* chore(desktop): end native-package-builds.d.mts with a newline
* refactor(desktop)!: provide shared textures through the dsh-shared-texture plugin
Desktop Host imported its shared-texture types from the private Electron application package, frame forwarding publishes declarations that referenced it, so an installed consumer could not resolve them, and renderer plugins read the texture bridge from globalThis.dshDesktop.
@deepseek-ai/dsh-shared-texture (packages/shared-texture/shared-texture) is a Host and Client plugin package that owns the contract:
- its Host root exports the abstract Cordis service SharedTexture, registered as ctx.sharedTexture and declaring only claim(), with the claim, capability, and native-sink types; its apply does nothing, because the Loader mounts the package only to deliver the Client half;
- ./client is the Client plugin: where Desktop's product preload exposes dshDesktop.textures, it provides that bridge as the Client ctx.sharedTexture, typed SharedTextureBridge, and otherwise provides nothing;
- ./bridge carries the type-only renderer SharedTextureBridge and SharedTextureLease;
- ./protocol carries the type-only private control protocol between Desktop Main and the Desktop Host, including the hop addon types; it is not a plugin API.
web-app mounts the package, so plugins inject ctx.sharedTexture instead of reading host globals. Desktop Host's SharedTexture extends the abstract Host service. Desktop Main and the Desktop Host take the low-frequency control message types from ./protocol and each still validates every message it receives at runtime, so Desktop Host no longer depends on Desktop. Desktop drops its ./shared-texture/host, ./shared-texture/client, and ./shared-texture/internal exports. The shared-texture subsystem page describes the entry points, and the capability-seam graph lists the service.
* refactor(desktop): keep the shared-texture protocol in Desktop Host
Main and the Desktop Host now share the child-process message types from
`apps/desktop-host/src/types.ts`, imported as `@deepseek-ai/dsh-desktop-host/types`,
so the published package no longer carries a private protocol subpath. The hop
addon interfaces return to the Host module that is their only user.
The renderer vocabulary keeps one Cordis-free module, renamed from `bridge` to
`types`: `SharedTextureClientExport`, `SharedTextureHostExport`, and
`SharedTextureLease`, imported by preload and IPC modules from
`@deepseek-ai/dsh-shared-texture/types`. The module is required because the two
compiler faces declare `ctx.sharedTexture` with different types: one program
holding `src/index.ts` and `src/client/index.ts` fails with TS2717.
---------
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
pnpm dsh, start:web, and dev:web now start Node with
--heapsnapshot-near-heap-limit=1 and --report-on-fatalerror, so a Host
that exhausts its V8 heap leaves a heap snapshot and a diagnostic report
in the repository root, which Git ignores.
Refs #9359
LibreOffice Kit 0.2.4 publishes its Linux engines as linux-x64-glibc and linux-arm64-glibc, but the sidecar and Desktop packaging looked for linux-<arch>, so a Linux target always fell back to WASM even when the kit declared a native engine. DSH's Linux distributions are glibc builds, so a Linux target now selects the glibc engine for its CPU. The third-party notices accept the two Linux engine packages under the same MPL-2.0 identity rule as the other engines.
The web app and office-kit take Kit 0.2.4, the first release with those engines. Its release-age exclusions name the API and the six native engines; WASM is no longer an optional dependency of the kit and is no longer excluded.
Because DSH no longer installs WASM, packaging now requires the target's declared native engine and rejects a target without one, naming its platform and CPU, instead of selecting a WASM package that cannot be present. The Python runtime smoke derives the same glibc package name and checks that the Office sidecar holds exactly that native engine. The Office provider, subsystem, package-surface and Desktop packaging documents describe Kit 0.2.4 and the native-only rule.
Shrinking the window across the composer's compaction threshold reported
"ResizeObserver loop completed with undelivered notifications":
- observeControlRow toggled data-model-compact inside its ResizeObserver
callback. The toggle resizes the observed row and the composer seat in
the same delivery, so a later notification at the same or a shallower
depth stayed undelivered. Size notifications now measure in the next
animation frame; mutations and font loads still measure synchronously.
- The view-tab row sets its visible-tab limit from a ResizeObserver
callback. React 19 renders Sync, InputContinuous and Default lanes
together, so a synchronous store update from another observer in the
same delivery (the session panel's dock probe) rendered the fold inside
the delivery and resized the observed row. The limit update now runs in
a transition, outside those lanes, as React 18 already rendered it.
Refs #9214
* fix(client): keep client types compatible with React 18 and 19
- SlotComponent returns ReturnType<FunctionComponent>, which is
ReactNode under React 18 and ReactNode | Promise<ReactNode> under
React 19, so FC-typed components register under both.
- useInvalidFocus returns MutableRefObject<HTMLDivElement | null>, the
ref type the other hooks use for both majors.
- Submit handlers take SyntheticEvent instead of FormEvent, which
@types/react 19 deprecates.
Regenerate the Cordis inspect catalog.
Refs #9214
* test(client): accept React 18 and 19 rendering in client tests
The assertions accept both majors, so the same tests pass before and
after the React 19 dependency switch:
- a detached callback ref is checked by its first argument, which is
null in both; React 19's development build appends undefined ones;
- fake-timer advances that update state run inside act;
- the quota notice waits for the toast its own dismissal removes;
- the models refresh clears its spy after the loading frame;
- SessionProvider is checked by its props, without the legacy context
argument React 18 passes;
- the renderer cleanup test no longer requires a console.error, which
React 19 does not write inside act;
- statements that discard a rendered ReactNode use void, since React
19's ReactNode includes a promise;
- forge tests query the replaced Restore button again, edit the form
inside act, and reuse one review queue per page as the plugin does;
- the test-runtime case releases and replaces the panel source in one
step.
Refs #9214
* fix(ui-slots): apply the children render check to FC-typed components
RendersCheck infers the component props through SlotComponent, whose
return type follows React's FunctionComponent. Under React 19 an
FC-typed component returns ReactNode | Promise<ReactNode>, which the
previous `=> ReactNode` pattern missed, so an FC that declared children
without consuming renderSlot registered without the check. The type chain
now registers such a component as a negative case.
Refs #9214
* test(ui-shortcuts): wait for the recorder focus after mount
The editor enables the recorder in one commit and focuses it in a passive
effect. The mount helper waited only for the enabled button, so a test
could press keys before the focus effect ran; the editor ignores keys
outside the focused recorder. Under React 19 this left the recorder idle
in CI. The helper now waits until the recorder has focus.
Refs #9214
define(fn, options) now returns runner(handle, args, options), so one
definition serves every environment and tools that select an environment
per call no longer keep one runner per handle.
Refs #9338
Switching to a long Session forced a whole-page style recalculation per
mounted quote: each QuotePreview read scrollWidth in a layout effect,
interleaved with the folded-row hidden writes. The Session header also
read the tab row's clientWidth synchronously.
QuotePreview now relies on CSS ellipsis and opens its full-text card on
every hover, so mounting reads no layout. The header starts with every
preferred View outside and folds the rest into More from ResizeObserver
deliveries only.
Refs #9325
* feat(agent-loop): recover inbox claims before step start
* fix(acp): withdraw pending prompts at settlement
* fix(goal): withdraw stale rounds when restoring agents
* refactor(agent-loop): fold inbox claims with the queue
* fix(agent-loop): preserve the inbox wire conversion
* refactor(agent-loop): clarify inbox projection updates
* refactor(agent-loop): keep inbox recovery internal
* refactor(agent-loop): simplify inbox recovery
* refactor(agent-loop): clarify inbox claim recovery
* refactor(agent-loop): clarify when input returns to inbox
* refactor(agent-loop): let the inbox own claim return
The inbox projection groups queues and claims symmetrically and
ReactLoopInbox decides whether a failed turn returns its claim from its
own clear() and claim() calls; the loop's running phase keeps no return
flag. Resume restores the interrupted claim through an unconditional
inbox call after announce. The projection tests become a transition
table and the two Agent Notes merge into one.
* fix(agent-loop): drop inherited claims at a fork's seed cut
A cold read of a crashed parent closes its open turn as interrupted
inside the inherited prefix, so the child projected the parent's claim
and restored it into its own queue. The inbox fold now empties both
claim lists at an inherited session/end-seed; a fork keeps the parent's
queue but never the input the parent had taken out of it.
* test(agent-loop): resume a stored fork of a crashed parent without reviving its claim
* fix(compaction-basic): check model-switch pressure at pre-step so a failed switch returns the input
The switch check ran in agent/request, after step/start had settled the
claimed batch, so a Stop, a failed summary, or an exit during that
summary lost the prompt. The step's route is already fixed at
agent/pre-step, where the inbox still owns the claim; the check now
prices the selected route there and the agent/request listener is gone.
* docs: regenerate the event graph after compaction-basic left agent/request
* fix(agent): keep the model-switch notice ahead of context snapshots
With the switch compaction at pre-step, the runtime-context snapshot is
already part of the admitted batch when the notice is added, so an
appended notice landed after it. The notice now precedes the first
context snapshot, keeping the order the model saw before; the
model-switch-compaction snapshot is refreshed for the compaction events
now preceding step/start.
Switching to a long Session forced a whole-page style recalculation per
mounted quote: each QuotePreview read scrollWidth in a layout effect,
interleaved with the folded-row hidden writes. The Session header also
read the tab row's clientWidth synchronously.
QuotePreview now relies on CSS ellipsis and opens its full-text card on
every hover, so mounting reads no layout. The header starts with every
preferred View outside and folds the rest into More from ResizeObserver
deliveries only.
Refs #9325
Conflicts with the Models settings layout change on master:
- ProviderEditor keeps the read-only saved key and takes master's refused-save
marking; CustomProviderCard passes the key failure through `invalid`.
- The Chinese locale keeps master's wording; the three removed hint keys stay removed.
- Browser specs find an open card by its row name, since an open row has no
Edit button, and the ARIA outputs are refreshed on the merged tree.
* fix(web): space consecutive Markdown images with CSS only
An image paragraph (two or more previewable images and no other element)
gives each image half the paragraph gap above and below and cancels that
half at the paragraph edges with negative margins. Zero-width ::before and
::after boxes restore the edge gap when the first or last line is text, and
three sibling rules cover tables, blockquotes, and code blocks, whose
adjoining margins are below the paragraph gap.
* fix(web): cover adjacent image paragraphs, blockquote bars, and nested list items
Two adjacent image paragraphs collapsed their negative margins into one and
sat half a gap apart; the earlier one now keeps the half gap. A blockquote
that starts or ends with an image paragraph establishes its own formatting
context so its bar matches the images. Paragraphs in nested ordered lists
render inline, so they keep the plain inline layout.
* fix(web): keep blockquote bars and list-item gaps with image paragraphs
A blockquote no longer becomes a formatting root: only the side where an
image paragraph starts or ends it gets 1px of padding, so the other side's
heading, list, or code block margins still collapse outward and the bar
meets the images. The neighbor compensation now reads the paragraph gap of
its context (16px, 8px in list items), so image paragraphs in list items
keep master's distances to tables, code blocks, nested lists, and each
other while their rows stay 16px apart.
* fix(web): keep image paragraph margins inside list items
An image paragraph at the edge of a loose list item lost its negative margin
to the item's outer margins whenever another image paragraph sat across the
item boundary. List items now take the blockquote treatment: 1px of padding
on that side keeps the margin inside. The web e2e waits for every page image
before comparing media responses, and covers blockquote bars and adjacent
list items.
* fix(web): keep the gap after a blockquote that ends in a list or heading
A blockquote's last child margin collapses through it, so compensating on
the image paragraph after it double-counted a list's or heading's bottom
margin. The gap now goes on the blockquote's own bottom margin, which
collapses with whatever comes through, and the paragraph-gap variable is
declared per container (list items 8px, blockquotes 16px). The web e2e puts
an image paragraph right after a blockquote that ends in a list.
* docs(web): explain why an image paragraph splits its gap
The gap is split above and below each image because vertical-align: middle
centers an image's margin box on the line; a one-sided gap would shift a
same-line image by half the gap against the text beside it.
* feat(llm): mark DeepSeek subagent inference requests
* docs: refresh the module graph for subagent headers
* refactor(llm): register subagent headers through the DeepSeek extension registry
Add registerHeader()/headers() to ctx.deepseekLlmApiExtensions for x-dsh- request
headers. session-log-deepseek registers x-dsh-session-type and
x-dsh-subagent-parent-session-id independently of its enabled switch, and
llm-deepseek adds the registered headers without reading Sessions itself.
Remove the ./session-headers export and revert the llm-pi-ai changes.
* fix(llm): keep route credentials ahead of registered DeepSeek headers
Spread the route credential after plugin-registered x-dsh- headers so a
registration named x-dsh-auth-token cannot replace the account token, and
pin that order with an account-route regression test.
Document that the DeepSeek API defines the subagent header names, that the
parent id is supplementary, that removing session-log-deepseek also stops
the subagent headers, and that SDK subagents carry neither header.
* feat(llm): unify Harness attribution header names
The only test of a listed directory that holds no checkout of the branch needs
a line break in a directory name, so it is skipped on Windows and the branch it
covers failed the Windows coverage gate. A worktree directory replaced by
another repository reaches the same branch on every platform.
diffBases names a branch's worktree by the directory Git registered, which
separates with a slash on Windows too. The test compared it with the path that
join builds, so it failed in the Windows coverage job only.
* feat(client): load package-local chunk dependencies
Chunks of one dynamic Client package may now require each other
synchronously. A registration's deps names the chunks its factory
requires, and the module system registers them before the factory runs;
require.async takes a { deps } prefetch hint so a chunk group downloads
in one round. The dynamic preset writes both lists and moves the chunks
an entry requires into its client.js, shifting the entry source map.
Refs #9275
* fix(client): accept entry-carried chunks in the publication closure check
The dynamic Client build moves the chunks an entry requires into the
entry file and deletes their own files, so a require of such a chunk
names no published file. publint-all now accepts a ./client.<name>.js
request when a script in the same directory registers the package entry
and that chunk, using the shared chunk file-name rule.
Refs #9275
* fix(client): restart entry chunk arrival and keep entry-carried dynamic imports
- arrive() restarts from the entry script when the owner is invalidated
while the entry's registration deps download, as importChunk already
does for lazy chunks.
- A dynamic import of a chunk the entry file carries keeps Rolldown's
synchronous require: the chunk has no file left to download. A chunk
that imports the package entry dynamically now fails the build like a
static import.
- The WebWorker packer reuses CLIENT_CHUNK_FILE from client-modules
instead of its own pattern; the rule is bundled into the packer build.
Refs #9275
* refactor(client): order chunk arrival methods after importChunk
Place arriveChunk directly after importChunk so the download code it took
over from importChunk stays aligned with master, followed by arriveChunks
and requireChunk. No logic or comment changes.
Refs #9275
* fix(client): limit the entry-carried chunk exemption to factory requires
publint-all accepted any relative request for a chunk that the entry file
registers, including an ESM import that Node resolves itself. The
exemption now covers only a synchronous require inside the factory of a
__ModuleLoader__.load registration; every other relative request still
needs its published file.
Refs #9275
* fix(client): let a prefetch hint only start chunk downloads
With a hint, the hinted chunks shared the requested chunk's visited set,
so a failed dependency reached the caller without the registration chain.
Each hinted chunk now arrives with its own visited set and an ignored
failure; the requested chunk waits only for its registration deps and
wraps their failures, so a hinted chunk that no registration requires
cannot fail the request.
Refs #9275
* fix(client): wait for prefetch hint arrivals before a chunk request ends
A chunk request discarded its hinted arrivals, so after an owner
invalidation it could retry and register the new generation while a
hinted download of the dropped generation was still pending; that
download then deleted the new records. The request now waits for every
hinted arrival it started, on success, failure, and before a retry,
while still ignoring their failures.
Refs #9275
A commit's line in the Code review page's activity is a button that shows the
Changes tab with that commit chosen, through one write of the page store. The
line of a run of commits still only folds and unfolds it.
GitLab's notes name a pushed commit by an abbreviation, which the chosen commit
of a changes view cannot be, so the GitLab provider reads the commit listing for
an activity that names a commit and gives each listed commit its full name.
A comment card in the Code review page's activity renders its Markdown with the
compact variant, whose ink is the tertiary label color that reasoning text uses:
3.71:1 on the light theme. The card now gives that Markdown the primary ink and
the link color; its sizes and the variant's other consumers stay as they are.
While no base branch is chosen, a branch shown in place of the Session's
checkout was compared with the remote's default branch, as the Session's own
checkout is. A repository without a remote then had no fork point, and a
Session that had commits of its own before it delegated saw those commits in
the delegated branch's changes.
The automatic fork point of a head branch is now its merge base with the commit
the Session's own HEAD names, under the name of the Session's checked-out
branch or the abbreviated commit of a detached HEAD. The base listing leaves
that branch out, because the automatic base already stands for it. The
Session's own checkout keeps its rule.
Recovery moved the database aside but left every `.segments/*.json` routing
record in place. Each record names a Session whose row lived in the moved
database, so `list()` found a record without a row and refused with
`SESSION_STORAGE_MISSING` on every later call, permanently: not even a Session
created after the recovery could be listed, and `listStoredHeaders()` failed
with it.
`setAside()` now moves each routing record to `<hash>.json.unreadable-<stamp>`
with the bytes it names, so every record stays readable and none of them counts
as lost state. `list()` reads the directory again after the scan, because the
scan is what triggers recovery; without that the first call would still fail.
The extraction report for a missing database now says the records are kept, so a
restored database reads through them, which is what the code does.
`test: moves the routing records with a damaged database, so listing Sessions
works after recovery` writes a Session, damages the database, and asserts that
`list()` resolves and no `.json` record remains. It fails with
`SESSION_STORAGE_MISSING` when the two source files are reverted.
Also from the same review:
- `standIn`'s comment states that `time` resets per Segment, so a damaged first
frame reports the epoch.
- README documents `codec` 255 rows and the `session_segments` internal view.
- An unused `plan` helper is gone from the schema fixture.
Restore the exe-only helper identity on both the native and Host sides so service reuse matches master; different DLLs with the same apphost can reuse the running service. Expand attribute collection into explicit loops.
A large `data` value ends mid-page, leaving the rest of its last page unused.
At 4 KiB that slack is 12.8% of a 370 MB corpus store; a 16 KiB page cuts it to
12.2% and the file to 362 MB from 366 MB, without changing any row, index, or
query. Tail reads and the flagship analytical query measure the same or slightly
faster. The pragma precedes WAL, which fixes the page size at the first write.
Small stores pay a little: the same 2,000-event session is 576 KB rather than
536 KB, because each page holds more slack. That is 40 KB against 4 MB saved on
the corpus.
README records the measured size trade and why per-event compression, not the
row layout, makes the store larger than frames: recompressing the same events in
groups of 64 reaches 183.8 MB against the frame layout's 186.7 MB, but a point
read would then decode its whole group, 19x slower for the reads a live Session
makes.
The head picker of the local changes view lists the Session's own checkout and
the repository's local and remote-tracking branches, and no longer lists
delegated Sessions. A branch that a worktree of the repository has checked out
is read in that worktree with every scope; a branch that no worktree has
checked out is read from its commits in the branch scope alone. A scope names
the branch by its full ref, and each read looks the worktree up again and
confirms that a checkout of the same repository holds the branch there.
The Session panel's local changes row shows in every Git checkout, with an
empty size while the branch scope changes nothing, so the view opens from a
clean checkout.
`forgePanel.diffBases` and `forgePanel.localCommits` take the head as a branch
ref, `relatedCheckouts` is removed, and the package no longer depends on the
subagent package. The API catalog, the config catalog, and two web expected
outputs are regenerated.
A custom MCP server row was a bordered card with a "Settings" text button,
and "Add MCP server" was a small outline button. Both stood apart from the
official connector rows above them and from the Plugins page's "Add plugin"
button.
A row now has an official connector row's geometry: the default plugin icon
in the 48px icon tile, no border, the same padding and gap, and 13px
secondary lines. Its settings button is the settings icon, with the
"Settings" tooltip and the accessible name "Settings for <name>". A row
keeps its actions beside the name down to a 390px viewport and moves them
below it when the account status or a narrower viewport leaves the name
less than 160px.
"Add MCP server" is a primary button with the "Add plugin" button's height,
font size, padding, and radius.
A lock is a live writer, not damage. SQLite holds its locks as operating-system
locks that the kernel releases when a process exits, so a lock that outlives the
busy timeout belongs to a process that is still inside it. Replacing its file
does not stop that writer: it keeps appending to the moved bytes while the new
database starts empty, splitting one history across two files.
Windows made the inconsistency visible: it refuses to move a file another handle
holds open, so the replacement could never work there, and the tests had to
assert different outcomes per platform. The rule is now uniform and simpler.
- `recovery: replace` keeps its meaning for damage only: a database this build
cannot read moves to `<name>.unreadable-<timestamp>` and an empty one takes
its place, so every byte survives and Sessions stay available.
- A lock always fails with `SESSION_STORAGE_LOCKED` after the busy timeout, on
every platform, and the database is left where it is.
- A damaged file whose move fails is never replaced either: returning false
reports the storage fault instead of discarding the only copy of the bytes.
- `ReplaceReason` and the `locked` tag are gone; only damage reaches the tag.
This matches SQLite's own SQLITE_BUSY contract, LevelDB's LOCK behaviour, and
Chrome's singleton lock handling, which reports an owner it cannot prove dead
rather than breaking a live one. README, upgrade guide, and the decision record
state the rule in both languages.
When the move aside fails, the recovery rethrew the internal replacement tag
instead of the error the caller understands. A Windows open whose file a live
writer holds open therefore surfaced `ReplaceDatabase` rather than
`SESSION_STORAGE_LOCKED`.
The tag is unwrapped before it leaves the store, and the guarded path is marked
platform-conditional: POSIX moves a locked file, so a refused move happens only
on Windows under a live writer.
A failed bundle download published about 400 characters for one cause: the
loader retries the URL once and listed both attempts, each led by the URL
and followed by a reason that names the URL again, and the page-local
failure text added the `Error:` class prefix.
An import failure now writes a repeated attempt once with its count, leads
an attempt with its URL only when the reason does not name it, and drops
the module prefix of a quoted reason. Published entry failures use a plain
Error's message and keep the class name of a specific error.
Refs #9297
The Windows lock test expected the database to be moved aside, which Windows
refuses while a live writer holds the file. The open correctly reports the lock
and leaves the file in place, so the test now asserts that: no moved file, no
replacement report, and a `SESSION_STORAGE_LOCKED` failure. POSIX keeps the
move-and-replace assertion.
The move-failure handler is marked as platform-conditional: an absent journal
moves without error, and POSIX renames a file another handle holds open, so only
Windows under a live writer reaches it.
List the seven official connectors in dsh-official-bundles as
CONNECTOR_BUNDLES, and let the official bundle catalog generator embed
OFFICIAL_CONNECTOR_CATALOG beside the on-demand catalog under the same
freshness check. Plugin recommendations read that catalog instead of a
hand-copied list, so the card of a connector the profile does not hold shows
its title and description in every shipped language, not only English and
Chinese. The skill's catalog entry and the catalog it loads are unchanged.
Catalog entries type their title and description as per-language text, which
the generator has always required.
A live writer on Windows holds the database file open, so the rename that
moves a locked database aside fails. The failure escaped the recovery instead
of reporting the lock, which failed the Windows coverage job.
A failed move now reports the same lock outcome the caller already handles, so
the database stays in place rather than disappearing behind an unhandled error.
The Windows lock test asserts the platform's real behaviour: no moved file, and
a reported lock instead of a replacement.
Test-only assertions for the derived-object recovery could not run on Windows
for the same reason and are unchanged.
The direct-inspection example said it prints the file text, but read
renders <path>/<type>/<content> with line-numbered lines. Keep the
unconditional read example and correct its wording; refresh the prompt
sidecars.
The tools:sdk instructions only said to show selected values with inspect,
leaving the unchanged-result text substitution to be discovered by the
model. State it with a read example, and update the pinned system-prompt
sidecars and the package README.
A server row refused a config that carries `enabled` with a check in
`apply`, so the refusal came only when the row started: an edit that added
the field was written, the row failed to restart, and the editor restored
the file while the server reconnected once.
The row's schema now declares `enabled` as a field that accepts no value.
The Loader refuses such a row when it resolves the config, and the
configuration editor refuses such an edit before it writes, so the running
server is not touched. The refusal reads `$.enabled expected nullable but
got false`; the field's description names the row's `disabled` field.
Refs #9134
The client sync notice put its sentence, the failure list, and the retry
button in one non-wrapping row. The fixed-height button was squeezed, its
label wrapped, and the text left the button's border.
The notice is now a card: the sentence with the retry at the trailing edge,
and each failure under it as the entry id above its message. The retry keeps
its own width and moves under the sentence when both do not fit one row. The
two bundle-list read failures use the same card.
Fixes#9297
Replace the Windows known-application list with provider-reported permission attributes. Shared consent treats records sharing any attribute value as one permission object, learns observed values on match, and revokes connected records together. macOS keeps its single authorization ID. Windows discovery IDs, window association and launch waiting are unchanged.
Close the six review findings against the event-row store, add provisioned
recovery, and make the derived tables' indexes actually reachable.
Data carried over from the frame layout:
- Carry over the readable prefix of a frame recorded longer than its lines.
The frame layout served whatever prefix a read asked for, so only a sequence
with no readable line gets a row no reader decodes.
- Drop lines past a frame's recorded range: the frame layout never read them,
so reporting them as damage would fail a read that used to succeed.
- Repeat the nearest readable event's `time` in the stand-in row instead of 0,
so `session_summary.last_event_time` stays a real instant.
- Tolerate an absent version 1 trigger or index. A build that narrowed the
frame layout dropped some, and losing a trigger costs no stored event.
- Refuse a child Segment that does not start where its parent ends instead of
giving it a history the frame layout rejected.
- Set aside a frame whose Segment row is absent, which the version 1 foreign
key never checked.
Derived tables:
- Compare every declared object (table, session view, indexes, further views)
so a dropped view or index is rebuilt rather than silently missing forever.
- Analyze once when no statistics exist and `PRAGMA optimize` on close. Without
statistics SQLite scanned every result in the Segment per tool call:
`session_tools` took 2.3 s on 84,000 tool calls against 22 ms analyzed.
Recovery, new `recovery` setting defaulting to `replace`:
- An absent database becomes a new empty one.
- A lock waits the busy timeout, then the file moves to
`<name>.locked-<timestamp>` and a new empty database takes its place.
- An unreadable file moves to `<name>.unreadable-<timestamp>` the same way.
- `report` keeps the previous refusal for a storage root another process
may write. A newer schema version is never replaced under either mode.
Documentation records the recovery setting, the raw-state damage behavior, the
compression limit on JSON queries, and the statistics step. 488 tests with full
coverage on the package sources.
The GitHub composition cases waited for the push's discovery and the view's
reference lookup with vi.waitFor's default one second. Both lookups run a gh
process after the tool result that starts them; in a program the lookups
start only once the root call settles, so they run past the end of the turn.
On a loaded coverage runner the reference lookup takes longer than one second
and the case fails with only the discover record, including on runs that
already carry the GitLab case's bound.
A lookup that exceeds the composition's discoveryTimeoutMs fails without a
binding, so the waits for the bindings lookups record now take that deadline
as their bound, through one constant that also configures it; the GitLab
case's wait uses the same constant. Delaying the stand-in gh reference lookup
by 1.5 s reproduces the CI failure in both GitHub cases with the default wait
and passes with the bound.
The mention chips appear only after the client reopens the Session and the
Host answers each path's workspaceFiles/stat. The poll used Vitest's default
1 s bound for both steps, which CI load exceeds after the reload. Wait for
the user bubble first, then poll the chips within the lane's 10 s budget.
Fixes#9256
The "Add MCP server" button sat in the heading row of the custom servers
section, below the official connectors. The tab now declares a second child
slot, `connectors.actions`, and renders its entries at the end of the first
row of its list view, beside the "Official connectors" heading. The button
registers there together with the custom servers section, so a profile
without the MCP manager shows neither, and the tab renders no actions while
a server page or the form of a new server is open.
The heading row wraps: the heading breaks its text beside the actions, and
the actions move below it once its longest word no longer fits beside them,
as in Russian at a 320px viewport.
The plugin manager's page and its tab bar are unchanged.
A pointer click scrolls the history control into view first, and that reading
movement starts automatic loading. Under CI load the automatic load could
consume the final page and disable the control while Playwright retried an
intercepted click, so the click timed out. Dispatching the click keeps the
reader at the tail and leaves the manual intent as the only loader.
Fixes#9280.
The cases expanded the card as soon as its tool result rendered. The Turn end
that folds the Turn process could reach the view after the visibility check,
hiding the card's expandable row before the click.
Fixes#9278.
The archive case pressed Unarchive and clicked the Session's row at once.
Unarchiving completes on the Host after the press, and until the Session
list receives the change the row is still archived: a click on it shows
the "archived sessions cannot be opened" notice instead of opening the
Session. When the click came first, the Session never opened and the wait
for the Restore worktree notice timed out after 20 s.
The case now waits for the row to drop its not-openable description before
clicking it.
Fixes#9273
After the window grows from the drawer layout to 1100px, the app frame
switches its sidebar mode a frame late, so for that frame the Session
panel's dock probe reports room the settled layout lacks. The keyboard case
pressed the toggle right after the resize; a press in that frame either
flipped the docking preference or opened an overlay that the stale room
report closed again, and the Shared tasks heading never showed.
Wait until the app frame has left drawer mode and the Conversation body has
published its widths, then one more frame for the size observers, assert
that the probe has no room, and only then press.
Fixes#9272
The repository cache classifies a refused fetch as a network failure when
Git's output contains words such as SSL or TLS, and Git quotes the fixture
source path in its refusal. The mkdtemp suffix of the test root could spell
those words, so a denial randomly read as network. The root's random part
is now hexadecimal.
Refs #9255
The Settings onboarding coordinator mounts its first-run steps when the
first Session-list pull lands and closes a Settings panel that is already
open, even when both steps decide to show nothing. Under CI load the
Remote connection and DeepSeek onboarding browser tests opened Settings
before that pull, so the dialog vanished and the next navigation click
timed out.
Remote fixture pages now wait for startup navigation to open the default
Workspace's blank Session, and Workspace-less scaffold pages wait for the
credential onboarding step's provider-directory read, before Settings
opens. The product defect is recorded on the Issue.
Fixes#9234
lightningcss hashes the stylesheet path into [hash]_[local], and the fixtures
live under random temporary directories. About one hash in 410 begins with
a dash and a digit, which the stylesheet writes escaped (.-\35 ab_root) while
the class map holds the name itself, so the raw selector expectation failed.
The expectations now serialize the class name as CSS.escape does.
Refs #9265
The case that stages, unstages, and undoes a file of the local changes view
waited for each reread of the scope with expect.poll's default one-second
budget. After a write settles, the view reads the scope again through the
Host, which runs Git several times in the Session sandbox; under the
parallel web slices that took longer than a second and the list still
showed the files before the undo.
The case also polled a plain `git status` while the undo was in flight.
That command holds .git/index.lock while it refreshes the index, so the
Host's `git reset` could fail with "index.lock: File exists", the view
reported the undo as failed, and the index stayed staged.
The rereads now get the same 20 s budget as the first read. After the undo
the case waits for the list to show the README again, which the view reads
only after the Host answered the undo, then checks Git once, and its
`git status` runs with --no-optional-locks.
Fixes#9262
The motion case proved the panel and the transcript move over one time and
curve by sampling requestAnimationFrame frames of a 160ms animation and
requiring more than four of them, one mid-way. Under 16 browser workers per
runner the renderer's frames grow to 40-50ms and the case saw three or four.
Hold the animations the press starts on the panel, the scrollport, and the
aside layer in the task of the press, check that the same style change started
all three for 160ms, and seek them together to each sixteenth of the motion.
Every moment must show the panel's opacity and slide following the end inset,
an inset strictly between its ends, and no sideways scroll range. Playback then
resumes from the start, and the frame-rate-independent per-frame checks stay.
Fixes#9261
The fold blank matrix read every row with getBoundingClientRect. A faded closing
row carries the fold's visual translate, so its reserved layout space counted as
a gap, while a reasoning row nested in a clipped closing row reported a box that
reached past its parent and covered that space again until its own CSS
transition shrank it. Whether main/other-tab/steps saw two frames of 184 px
depended on that transition's phase against the batch's frame clock, which
shifts under CI load, although the painted pixels were identical.
A visible row now covers its painted box and a fully transparent row the box it
reserves in the layout, both clipped to their moving ancestors. A synthetic-DOM
case keeps the result independent of the nested row and keeps counting the
space a visible translated row leaves behind.
Fixes#9254.
The chorded middle-click case read the notes.txt and Files chip positions
as soon as both titles rendered. When the panel's opening slide is cut
short, the opening mark stays and the newly opened tab's host slides in
from past the right edge, so the press landed where the chip had been and
no drag started; the drop caret never appeared.
Read the chip positions only once no docked host's transform transition is
running.
Fixes#9244
The sidechat e2e waited only for the main composer surface to be visible.
Until the stored Session is restored, that surface is the read-only
workspace-picker trigger (contenteditable="false"), so fill() threw when
restoration finished after the wait under CI load. Gate the typing gestures
on contenteditable="true", as the other Web specs do.
Fixes#9249
expectWrappedCommandText read the tail coordinates as soon as the tail
entered the banner, while Chromium's drag-selection autoscroll and the
wheel were still moving it. The release point then landed on the next
command line, so the multiline case selected an extra '$ echo done'.
Wait until the scrollport rests at its end before reading the tail.
Fixes#9245
Session rows are 32px tall with a 2px margin between them, and the
drag-scroll case stops auto-scrolling at a timing-dependent offset. The fixed
drop point `listEdges().top + 200` therefore lands on the gap between two rows
in about 2 of 34 runs, where elementFromPoint returns the group section. Once
the pointer leaves the edge band nothing moves, so re-reading the same point
never recovers and the poll times out with an empty title.
Measure the first row that ends below the point on each attempt and rest on
its vertical center before reading the drop target.
Fixes#9233
The cancellation cases waited for a binding call that the program issued
immediately before a non-yielding loop. On Windows the child's control-pipe
writes complete on its event loop, so that call can stay queued behind an
unfinished earlier write forever and the case times out after 90 s. The
program now marks readiness with a synchronous file write that the test
polls before cancelling.
The private copy walked the live working tree with fs.cp while suites in the same gate created and deleted untracked mkdtemp directories inside it, so a vanished entry failed beforeAll with ENOENT. The sequential per-entry stat and chmod calls also pushed the Windows copy past the 90 s hook budget, after which afterAll removed the root under the still-running copy (ENOTEMPTY).
List the copied files from the Git index, minus files deleted in the working tree, copy them with bounded concurrency, and make afterAll wait for the copy to settle before removing it.
Fixes#9230
The manager read every server that a deployment declared from one `servers`
dictionary in its row config. A patch that sets a row's `config` replaces
the whole config of the layers before it, so no layer could add or change
one server without restating the others. A dictionary entry has no
`disabled` key, and one invalid entry fails the manager row, so no server
starts.
`@deepseek-ai/dsh-mcp-manager/server` is a second plugin of the manager
package, and one row declares one server. Its config holds `serverName`
beside the fields of one `servers` entry except `enabled`, and the row
calls `ctx.mcpManager.register()`, the call that connector plugins already
use. A patch adds a server with `insert`, edits one by its row id, and
switches one off with the row's `disabled`. A changed row restarts alone,
and an invalid row fails alone.
The `servers` dictionary, its Settings namespace, the entry field
`enabled`, and the `disabled` status are unchanged, so no stored
configuration needs a rewrite. Rows and dictionary entries share one
namespace of server names: a row that names the server of a dictionary
entry fails alone, and a dictionary write that names the server of a
running row is refused. A row whose config carries `enabled` fails,
because a registration is enabled while it exists.
Refs #9134
The compact tasks case attached its scrollend listener concurrently with the
wheel. Headless Chromium scrolls a wheel step at once and fires scroll and
scrollend in one frame, so under load the listener could attach after the
event, which does not repeat, and the unbounded evaluate held the case until
the 180s test timeout.
Fixes#9226
* fix(typert): accept plain JSON values from any realm
An isolated Client plugin builds its values in an iframe, so they inherit
that realm's Array.prototype and Object.prototype, and the identity checks
in the Remote JSON validation and the Gateway's record checks rejected them.
dsh-util-values exports hasPlainPrototype, which matches this realm's
intrinsics by identity and another realm's through their native
constructors. isRemoteJsonValue and the Gateway's event-frame and
event-request record checks use it. Objects and arrays that inherit any
other prototype stay rejected, so an inherited toJSON cannot rewrite a
validated value.
* fix(client-store): compare Maps and Sets from any realm in shallowEqual
shallowEqual delegated to zustand/shallow, which recognizes collections with
instanceof Map and instanceof Set. A selector in a script-isolated plugin
returns collections built by its iframe realm, so both checks failed and two
Maps fell through to an Object.keys comparison, where any two Maps are equal.
ui-workflow-run selects its running members as a Map, so under isolation its
"Open ..." member buttons never appeared.
shallowEqual now recognizes Maps and Sets by their Object.prototype.toString
tag and otherwise keeps the one-level semantics: Object.is for scalars and
values, Set membership, and own enumerable string keys for other objects
and arrays. A Map comparison also requires each key to exist in the other
Map, so new Map([["a", undefined]]) no longer equals
new Map([["b", undefined]]). zustand remains a development dependency for
createStore and subscribeWithSelector.
* fix(ui-sidebar): ease the sidebar width from its layout owner props
ui-sidebar eased its width under `[data-animating]:not([data-dragging])`,
attributes of ui-layout's frame. With ui-sidebar's styles isolated that
ancestor lies outside its scope, so collapse and expand lost the easing.
ui-layout now passes the same state through `SidebarOwnerProps.animating`,
true while the frame eases its tracks and false during a resize drag or a
viewport change. The sidebar marks its own root `data-sidebar-animating`
and keeps the width transition there, after the quiet-scrollbar transition
it replaces, and reduced motion still turns it off.
* fix(ui-chat): style only Chat's own DOM inside the Conversation scrollport
ui-chat laid out its frame, scroller, aside layer, back-to-bottom control,
and turn rail under `:global([data-conversation-scroll]) .x`, and set
`overscroll-behavior-y` and `overflow-anchor` on ui-conversation's
scrollport through `[data-conversation-scroll]:has(.root)`. With ui-chat's
styles isolated, neither form matched, so Chat scrolled itself inside the
shared scrollport and lost its anchoring, back-to-bottom position, and
floating controls.
Chat's rules now test the scrollport in `:is()` on its own compounds,
`.frame:is(:global([data-conversation-scroll]) *)`, with unchanged
specificity. The scrollport rules move to their owner: ui-conversation
reads `data-conversation-overscroll="none"` and
`data-conversation-scroll-anchor="none"` from an element a View marks
inside the scrollport, and Chat marks its root with them, the second only
while it follows the tail.
* fix(ui-sidebar-documentpreview): hide the body a filling navigator covers
ui-sidebar-files hid the body of any row marked
`data-files-navigator-row` while its navigator Factory filled the row.
The document preview's content row is documentpreview's DOM, so with
ui-sidebar-files' styles isolated the covered preview stayed visible and
reachable by Tab.
The preview's own stylesheet now holds those rules on its `.content` row,
reading the navigator's `data-files-navigator-mode` through the row's
`:has()`, so the preview hides its body itself in both modes. The files
page row never had a covered sibling, so ui-sidebar-files drops the rules
and the `data-files-navigator-row` mark, and its README and Factory
documentation state that the host hides the covered content.
* chore(workflow-ptc): regenerate the workflow guest for the util-values prototype checks
The guest bundles packages/util/values; its same-realm Object.prototype and Array.prototype fast paths changed the generated source.
Look the plugin up again after every card action, so a second failure of an
installation that landed no longer leaves the installable text. Keep Connect
account off a card whose last decision failed, since the connector that did
not start has no account section. Check again that the conversation is still
a live root after the Connectors tab switch, before the profile changes.
Split the README paragraph that covered the whole implementation.
The schema and every static statement of the SQLite Session store were
string literals in TypeScript, and the upgrade step from the frame layout
executed whatever the current schema constant held. They now live under
resources/sql: schema/vN.sql is the whole schema of one version and is
not edited once released, upgrade/A-to-B holds the statements of one
upgrade step, and store/ and derived/ hold the statements of the store
and of the derived-table runtime. src/sql.ts is their only reader.
Two internal views, segment_extents and session_heads, replace the SQL
fragments the store shared by string interpolation. Transaction control,
connection pragmas and the DDL generated from a derivation stay inline.
* fix(ui-renderer): let shell body-layer rules reach document portal content
The document portal wraps its children in a box-less `display: contents`
element, so the web shell's macOS `body > :not(#root)` window-drag
subtraction landed on that wrapper and no longer reached the portaled
layer. Mark the wrapper `data-document-portal` and subtract its children
in base.css, and document the wrapper and the portal's mount timing.
* fix(client): adopt document hooks and realm-independent DOM checks in plugins
Script-isolated plugins run in a hidden iframe whose `document`, `Node`,
and `Element` belong to that frame while React renders into the page.
- Replace `createPortal(..., document.body)` in business plugins with the
mounted Slot's `useDocumentPortal()` and move Escape listeners that only
serve that portaled content onto the portal's `onKeyDown[Capture]`.
- Drop or replace DOM `instanceof` checks on page objects with checks that
do not depend on the realm and behave the same without isolation.
- Recognize a pending context-menu answer by its `then` method instead of
`instanceof Promise`, so providers and the menu can sit in different realms.
* fix(client): keep the skips of replaced DOM checks for other targets
Several `instanceof` replacements asserted that an event target is an
element or a node and then called `closest()` or `contains()` on it. The
original checks skipped other targets, such as a text node, the document,
or a window, and a spec that right-clicks a text node now threw. Check
`nodeType`, `namespaceURI`, or `localName` instead, so every site keeps its
original skip while still recognizing the page's nodes from an isolated realm.
* fix(client): satisfy CI gates for the document hook adoption
- Re-record the ui-renderer README translation pair after the business
plugin section gained the portal wrapper and timing sentences.
- Drop an apostrophe from a JSX attribute comment in the plugin manager;
the app-region markup scan reads it as a string opener and misses the
`.moreHead` chrome row.
- Write the context-menu and subagent switcher outside-pointer checks as
node guards inside the condition, as the original `instanceof Node`
checks were, so no unreachable early return remains uncovered.
* refactor(client): use page DOM targets through optional calls instead of node guards
The realm-independent DOM checks wrapped event targets and focused
elements in `isNode`, `isElement`, and `isHtmlElement` helpers or inline
`nodeType`, `namespaceURI`, and `localName` tests. Treat a target as the
element it almost always is instead:
- Pass targets of document and element listeners straight to
`contains()`, which accepts any node, and treat `activeElement` as an
HTML element.
- Read element methods through `Partial<Element>` with optional calls, so
a text node or the document, which lacks the method, counts as no match,
as the original `instanceof` checks skipped it.
- Resolve "the element or its parent" lookups by falling back from
`closest?.()` to `parentElement.closest()`.
- Compare the model menu's key target with its search field, and test
inputs and iframes with `matches()`.
Two checks stay: the type filter's window-level listener skips the window
itself, which `contains()` rejects, by comparing the target with
`currentTarget`; the selected-text projection keeps its node-kind test, so
comments still project nothing and own no offsets.
Tests that fed impossible targets to the removed skips (a non-node
pointer target, a keydown from an unfocusable icon) are dropped, and the
platform overlay test now covers a focus origin removed while the overlay
is open instead of a focused SVG element.
* revert(client): keep ui-schedule and the ui-chat stat dialogs on their body portals
Restore packages/client/ui-schedule and the ui-chat stat dialogs
(stat-dialog.ts, StatsPills.tsx, TurnUsagePanel.tsx, and the
TurnTailNodeView wiring) to their master versions, together with their
unit tests and the Schedule catalog e2e assertion on the body child.
These plugins adopt the document portal in a later change.
* fix(ui-renderer): mount document portal content in the portal's own commit
The document portal renders into a wrapper element it owns. The wrapper
joins the body and takes the source's package marker from a ref on the
preceding template, so the children are attached and scoped before
their layout effects run, and the caller's effects receive mounted
nodes. Unmounting removes the wrapper; StrictMode replay appends it
again.
Callers render the portal together with the content it shows instead of
keeping an empty portal mounted: the context meter, model menu, install
registry options, font notice, Session inspector type filter, and
desktop onboarding entry.
The upgrade from the frame layout replaced a whole frame when one of its
lines was unreadable, so a read that stopped before the damaged event
failed after the upgrade although it succeeded before. A frame that
splits into its recorded lines is now carried over event by event, and
only an unreadable event gets a stand-in row.
Drop the two indexes on sessions that no statement or documented query
uses, and state the cross-build limitation of derived tables exactly.
The add-server page offered "Local command" and "Remote (URL)" as its two
connection choices. The second one takes any `http` or `https` address,
including one on this computer, so "Remote" was inaccurate. All eight
languages now label it "URL".
The opt-in SQLite Session store kept each durable write as one compressed
frame, so SQL could not see an event's sequence, type or time. It now
stores one row per event: the envelope members are columns and data is
JSON text, or one Zstandard frame when it is large. Segments use integer
ids and a segment_paths table that lists each Segment's history, so the
session_* views return a Session's events in one join, forks included.
Derived tables for model calls, tool calls, tool results and compactions
are written in the events' transaction and rebuilt from events when a
table is missing, its version changes, or its derivation was absent.
Opening a database runs ordered upgrade steps under src/migrations. The
first rewrites the frame layout (schema version 1) in place; a frame it
cannot read is set aside without blocking the other Sessions.
BREAKING CHANGE: the frameEvents setting is removed, and a database
upgraded to schema version 2 cannot be opened by earlier releases.
The description of a risk confirmation wrapped only at ordinary break
opportunities. The Connectors tab quotes a local command in it before the
command is saved or switched on, and a command path has none, so the
paragraph grew wider than the dialog: the end of the command was cut off
and the content region showed a horizontal scrollbar.
The description now sets `overflow-wrap: anywhere`, so such text wraps
inside the dialog and a very long command scrolls vertically above the
actions. Confirmations with fixed copy render as before.
The left end of the local changes header was the checked-out branch as text. It is now a searchable picker of what the view shows:
the Session's own checkout, the checkout of a Session delegated from it, or the committed content of another local or
remote-tracking branch.
- Host: a local scope may name a head. A related Session's checkout is found through that Session's records, without resuming it,
and read with the reading Session's sandbox policy; a branch is verified as an existing ref and read without a working tree.
`forgePanel.relatedCheckouts` lists the checkouts delegated Sessions work in.
- Page: `HeadMenu` beside the base branch picker, in every local scope. Another head is read-only: no stage, unstage, or restore,
no create button, and no slots or annotations of other plugins. A branch shows the `branch` scope alone. Viewed marks and quoted
comments are kept per head, and a quoted comment names the worktree or branch it is about.
In Manual order, a fork started from this browser is saved directly
above its source in every order that lists the source: its group or
Ungrouped, and the flat list. An order that already saves the child
keeps its position; a pinned source's fork leads the ordinary rows;
Last updated writes no order. The chat footer fork action now goes
through uiWorkspace.forkSession, which forwards an optional atSeq.
Forks from other clients still follow the supplementation rule, and a
new Session can briefly appear under Ungrouped before its Workspace
membership arrives; both are recorded as known limitations.
Refs #8220
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
A staged removal leaves only the environment-fallback placeholder in the
input. The environment status behind the saved key is unknown until Apply,
so the field reports none.
After Clear API key, the field shows the placeholder and environment hint of a
route without a saved key. The "Apply to clear the saved API key. Environment
authentication will be used" text is removed with its locale key.
* feat(client-ui-forge): stage, unstage, and restore files in the local changes view
The Unstaged scope of the local changes view stages and restores whole
files, and the Staged scope unstages them, each from an icon button on
the file header, the file menu, or a header button for every shown file.
A new forgePanel.localWrite Remote runs Git under the Session's sandbox
policy. Staging and restoring refuse a file whose change is not the one
the reader saw. Staging and unstaging return the index as a tree, which
the notice's Undo returns the index entries to. Restoring asks first.
The viewed mark draws as a ring, and a pane at most 380px wide shows a
file's writes under the pointer or once the keyboard reaches them.
Refs #9162
* test(client-ui-forge): give the older local diff fixtures the writable field
* docs(forge): document local writes on the subsystem page and refresh the catalogs
* test(client-ui-forge): run the local write specs on Windows
Refusals come from the recording sandbox instead of a POSIX stand-in Git,
the pathspec-magic file name is used only where the file system takes a
colon, and the batching case uses short names under the Windows path limit.
* feat(client-ui-forge): run local writes on the reader's authorization, outside the Session sandbox
A press in the changes view is the reader's own action, as archiving is for
the worktree service's removal of a checkout, so staging, unstaging, and
restoring no longer run under the Session's sandbox policy. They work in a
read-only Session and from a Session directory below the checkout's root.
ForgeLocalDiff.writable, the forgePanel/local-write-denied error, and its
notice are removed with the confinement they described. A restore passes
--no-recurse-submodules.
Refs #9162
* fix(client-ui-forge): refuse writes that reach past the chosen file
Three review findings on the local writes of the changes view:
- A deleted file whose path holds a directory is refused before anything
is written. Git takes a path for the directory and everything in it, so
staging the deletion staged those files and restoring the file deleted
them.
- A submodule is offered no restore. git restore exits with success and
leaves the commit it has checked out, so the view reported a
restoration that did not happen. ForgeDiffFile gains `submodule`, read
from the 160000 mode of the patch header.
- The file menu's rows for the writes cannot be activated while a write
is in flight or the scope is read again, as the header's buttons.
Refs #9162
* docs(forge): record why local writes carry no filter guard
* test(web): wait for the last file's text before reading its scroll position
The file navigation case read the scroll position two frames after the
last file drew. A drawn file shows a row for the lines after its last
hunk until the Host answers the read of its text; the row then leaves,
the scroll range shrinks by its 26px, and the position falls from 3347
to 3321. When the answer took longer than two frames, the case recorded
the earlier position and failed with "expected 3321 to be 3347".
The case now waits for that row to leave. With the Host's answer delayed
by 600ms the old wait fails with that message and the new wait passes.
Refs #9162
Add the experimental @deepseek-ai/dsh-llm-mock plugin, which registers a mock
provider route that answers every call with fixed text. The Preview image
seeds its profile patch with the mock row, starts new Agents on it, and keeps
the first-run API-key prompt closed. Users can still add a real provider key
in Settings > Models and select that model.
Refs #9163
A saved key is read-only text: the masked preview followed by Replace API key
and Clear API key icon buttons. Replace opens an empty, focused input. When
focus leaves the field or Enter is pressed, a draft that passes validation
returns to read-only text; a failing draft stays in the input with its error.
An emptied draft keeps the saved key, and only Clear stages its removal.
The saved-key hint and the replace-pending hint are removed.
Three defects found against the live QQ API:
- A refused request lost the platform's own code and message: every 4xx whose body carried no known code became the
status rule's anonymous sentence, so a missing 主动消息 permission (40034105), a spent passive budget (40034128) and
a refused interaction id (40034025) read alike. The client now names both in the error it raises, `classify()` keeps
that sentence for a code the table does not list, and the three verified codes joined the table.
- A click's reply carried the interaction id verbatim, which the message body refuses (only `PUT /interactions/{id}`
takes the bare id): the body now spells `INTERACTION_CREATE:<id>`, and a refusal of that field falls back to one
active send instead of leaving the click dead.
- Neither mode declared `<at>`, so a mention reached the chat as the core fallback's plain `@name` and nobody was
notified. The markdown mode writes QQ's text-chain tag for the `user` and `all` variants; the text mode keeps the
readable fallback, so a mention-bearing message resolves to markdown.
Each fix carries the spec case that pins it and the refreshed markdown goldens. Logged as I14 in vendor/im/README.md.
Fixes#9183
The compatibility record claimed no released build contained the SQLite
backend, but dsh-v0.2.3-alpha.2 published it with a strict header schema whose
origin admits only subagent; its list omits a side Session and opening one
fails before any event is read.
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
Validate fork parameters before the migration preflight reads storage, reject a
side conversation whose source is a subagent on the Host, refuse a LiveShare
viewer fork that sets an origin before an operation is reserved, and record the
side origin in the independent-forks Agent Note.
/side forks now record origin: 'side' in the child Session header. The
left Sidebar hides side-origin Sessions as it hides subagent children.
The V4 codec admits the side origin without changing the frozen V2
header codec; the persistence acknowledgement records the same-version
decision.
Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
The tab fell back to the title stored at creation, which kept its creation
locale and differed from the Session panel's display title for an untitled
child. It now reads the Session list's display title and falls back to the
localized type title.
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
Mark the tab root with data-sidebar-chat so main-composer selectors exclude it,
drop the tab type's ineffective multiple and builtin priority, guard the fork
refusal check against a missing RPC error, log a /side with no conversation on
screen, align the no-completed-turn notice with the fork shortcut wording, list
the package in the experimental table, and add a browser test.
/side omits the cut, so the Host selects the latest completed Turn as it
does for the ordinary fork; the Client no longer reads the event window. A
source without a completed Turn is refused by the Host and reported as
nothing to branch.
A side forked from a subagent would inherit the delegated approval policy
and preset through the copied log without the delegation itself, and its
tab would open beside the parent conversation. The control reports that a
subagent conversation cannot start a side conversation instead of forking.
(cherry picked from commit 59a7c5fcc585b37c5c61123153d9bcf814064fee)
# Conflicts:
# packages/experimental/client-ui-sidechat/README.i18n.yaml
# packages/experimental/client-ui-sidechat/README.md
# packages/experimental/client-ui-sidechat/README.zh.md
# packages/experimental/client-ui-sidechat/src/client/control.ts
# packages/experimental/client-ui-sidechat/tests/apply.client.spec.ts
# packages/experimental/client-ui-sidechat/tests/control.client.spec.ts
Drop the per-source in-flight guard: a second /side creates its own side
conversation instead of being swallowed. A window whose current page shows
no turn/start but has older pages lies inside a Turn, so it forks at its
newest durable event instead of reporting that there is nothing to branch.
Align the package version with the release after the master rebase.
A source whose loaded window holds no turn/start, including a blank Session
that only holds configuration events, reports that there is nothing to
branch instead of forking those events into an empty child. The cut stays
the newest durable event once the first Turn has started, as #8871 does
for the Sidebar fork.
Restore the unit tests for the control, resource provider, views and
plugin lifecycle, adapted to the /side command, so the per-file coverage
gate passes. Add the package README pair and its model-experience audit
entry for the README gates.
The side tab retains its child with facets: { conversation: true }, so the
Chat folds the event window instead of publishing an empty snapshot that
hides both the inherited history and every later message.
The command stays available so a typed /side never reaches the model as a
message; the control already declines a source with a fork in flight. The
/client entry re-exports its slot, resource and locale augmentations. The
side tab derives its phase from the retained Session's open state instead of
copying the subagent Sidebar's hero derivation. Drop the unconsumed task set
from the control. Match the root release version and list the package in the
release family.
The omitted-atSeq fork defaults to the latest completed Turn, so /side
failed with session/fork-unavailable while the first Turn was still
streaming. Pass the newest durable event seq from the retained Client
window; the Host balances a cut inside an open Turn with synthetic
closers. Without a retained window the Host default still applies.
Add @deepseek-ai/dsh-client-ui-sidechat, an experimental Client plugin that
default profiles do not install. The /side command forks the conversation at
its latest completed Turn through the ordinary Session fork and opens the
child in the right Sidebar of the Session on screen, rendered through
conversation.content with a fixed embedded Chat view. The child is an
ordinary Session listed under Ungrouped; tabs are window-local and restore
from the saved Sidebar layout.
Apply and Create were disabled while anything in the card was invalid,
and the only explanation was one line beside the actions naming the
first failure ("Model 3: ..."), often far from the field and sometimes
inside a folded row or section.
The actions now stay enabled and check the card when pressed. A refused
save writes nothing and marks every refused field where it is: the
input turns red with the reason under it, a folded model row or section
that holds one unfolds, and the keyboard moves to the first marked
field. A mark goes as soon as its field is corrected; a failure that
arises later, such as a row added without an ID, waits for the next
refused save. The create form reports a blank Provider ID, a blank API
address and an empty model list the same way. Only a failure no field
owns, such as a refused write, stays beside the actions.
The section headings also take the chevron from the icon set, after the
title: right while folded, down while unfolded, as on the model rows.
Tell the model to offer a connector's card whenever the user's request needs
its app and the model cannot reach it: the connector is not enabled, or it is
enabled but its account is not connected. The card of an enabled connector
already shows Connect account, which opens the connector's page in Plugins.
The MCP manager takes each server from its own `@deepseek-ai/dsh-mcp-manager/server` row and no longer reads a `servers` list, so the Connectors tab cannot keep custom servers in the manager's Settings namespace. The `connectors` Host service now keeps each custom server as the row `mcp-server-<name>` of the profile patch, and it lists every MCP server row of the composition, including a row that is switched off and a row that did not start.
Reading: the stream `watchServers` replaces `listServers()`. It sends the list when the browser subscribes, after each change made through the service, after `app-boot/config-reload`, and after `plugin-manager/changed`. Each server carries its row id and one of three states: on, off, or failed with the row's error. The revision a change names is a digest of the rows instead of the Settings revision. The config field `mcpManagerNamespace` and the list's `writable` flag are removed: the service needs the configuration editor, the plugin manager, credentials, and the MCP manager, and it reports the section as unavailable when one of them is absent.
Writing: `saveServer(draft, revision, id?)` inserts a new row through the configuration editor, or replaces the config of the row `id` names, after it checks the config against the row plugin's exported `Config`. A row that is switched on must run after the write; when it does not, the configuration editor restores the profile patch and the save is refused with the row's failure. A row that is off is written without starting, and a row that did not start is started with the new config, so both can be edited. Secrets are stored after the row is written, and a reference is deleted only when no other row uses it, whether that row is on or off. `removeServer(id, revision)` removes only a row the profile patch adds. `setServerEnabled(id, enabled, revision)` switches the row through `pluginManager.setPluginEnabled` and reports every outcome other than `applied` as a refusal.
OAuth: a server that is on signs out through the manager. The manager does not hold a server that is off or did not start, so the service deletes that row's grant record itself, unless another row or a registered server uses the same key. Accounts are registered for the OAuth rows that are on.
Browser: the store follows the stream instead of reading after each change and after each Settings event. A row shows why it did not start. The page of a server that is off or did not start keeps the form; only a server that is on has Test connection and the account section. Switching a local command on asks for the risk confirmation, as saving one that the save starts does, and the form no longer has an `enabled` field. When the row of an open page is removed or can no longer be read, a notice takes the page's place. The rows of the header, environment, and argument lists keep their keys while rows are added and removed.
Two style defects seen on the real page are fixed: the validation lines named a color token that does not exist and fell back to the secondary label color, and the button of a notice wrapped below a long message.
The save checks a config with `Config` of `@deepseek-ai/dsh-mcp-manager/server`, and the grant deletion builds the record key with `credentialKey` of `@deepseek-ai/dsh-credentials`, so the package declares both packages as peer dependencies. `scripts/package-dependency-policy.ts` lists the `Config` export under `PEER_REQUIRED_HOST_EXPORTS`; this policy entry needs the domain owner's confirmation.
The Web e2e asserts the row and its override in the profile patch, the stored token, the switch, and the removal of both. The READMEs, the Agent Notes that described the Settings namespace, and the generated catalogs describe the rows.
Review asked to keep zod pinned instead of loosening it to ~4.6.6, so every installation runs the reviewed version.
- The 106 manifests return to exact 4.6.6, as on master.
- dsh-connector-feishu moves from ^4.4.3 to 4.6.6.
- dsh-acp, dsh-subagent-acp, dsh-experimental-subagent-oar and dsh-session-snapshot pin zod 4.6.6, so npm places that version before the ACP SDK's zod peer can hoist a newer one.
The layout gate and its messages name the pin instead of a range.
Refs #7501
List the seven official connectors in the official-plugins skill catalog and
offer one when the user's own request needs its app. The skill's catalog
entry names only the apps whose connector a card could offer, so a task that
needs the app of an enabled connector does not load the skill.
A click on the card of a connector the profile does not hold installs it at
the DSH version through Plugin Manager, switches on the Connectors tab, and
enables it; install scripts that pnpm stopped on need a separate approval on
the card. The card of an enabled connector opens its page in Plugins to
connect the account.
* feat(ui-renderer): scope opted-in package styles on existing slot roots
Share the package style policy between slot dispatch and stylesheet installation. Preserve global themes, root identity and component state through style-only toggles, including nested Factory, HOC and list output.
* fix(dev-web): keep launcher validation independent of package sources
* refactor(ui-renderer): identify generated scope CSS as stylesheet content
* fix(client): keep panel indicators visible under style isolation
Position a shared indicator area on the Session panel toggle. Jobs, Subagents, and Forge paint their own marks without crossing package scopes.
* refactor(ui-renderer): fix each package style scope for the page
Stamp the content supplier on existing slot roots. Read its page-owned mode when registering content and writing stylesheets instead of subscribing the render tree to live policy changes.
* fix(ui-renderer): keep scoped styles with their actual package
Resolve Loader aliases against the page module table and stamp contributions from the renderer’s own module source. Let a valid package stylesheet take over a path rejected during scope preflight or by the destination.
* fix(client-modules): declare the row callback receiver-free
* refactor(ui-renderer): scope styles from their module records
* test(ui-renderer): verify module-record style scoping
* chore(ui-renderer): restore scoped slots to the PR base
* fix(ui-renderer): mark slot roots with their supplying module
* refactor(ui-renderer): bind Factory child slots once per supplier
An outlet belongs to whoever called renderSlot for it, wherever it later
renders. A Factory's child-slot methods are now kept per Factory and per
supplier: the Factory itself for its own Component and fallback locals,
the occurrence's caller for a local it selected. One caller mounting its
local in several places shares one method, and no per-mount binding or
extra occurrence context field remains.
* refactor(ui-renderer): scan a Factory's chain children once
Whether a Factory declares a chain child is recorded once per Factory
beside its per-supplier child-slot methods, instead of once per
supplier. The Factory kit assigns `renderSlot` and `renderSlotChain`
by name rather than copying whichever keys the methods object holds.
* test(client-runtime): expect data-plugin on the mounted slot root
The slot outlet names its supplier on the existing root; the test runtime registers without a package, so the two DOM snapshots gain data-plugin="".
* test(web): launch the panel indicator scenario per isolation mode
The Host reads an entry's client isolation when its plugin starts, so
updating that field on a running entry never reached the boot graph and
the scenario waited forever. Each mode now starts its own Host: the
shipped composition, and one whose overlay declares style isolation for
the panel and the two packages drawing on its toggle. Both check the
boot graph first, then run the same interaction and indicator
assertions.
This reverts commit af6d659de2858d7760acdd680d942166724ffaed, the merge of
#8423.
A bare github.com pull request or gitlab.com merge request URL streamed in
as its full URL and shrank to its owner/name#N reference only when the
reply settled, so the reply reflowed after it finished. The URL arrives
character by character, so the reference cannot be drawn before the URL is
complete. Links keep their written text again, and the Open in code review
URL menu entry, the forgePanel.recognize Remote, and the generic URL menu
adjustments that shipped with it leave with the revert.
This reverts commit af6d659de2858d7760acdd680d942166724ffaed, the merge of
#8423.
A bare github.com pull request or gitlab.com merge request URL streamed in
as its full URL and shrank to its owner/name#N reference only when the
reply settled, so the reply reflowed after it finished. The URL arrives
character by character, so the reference cannot be drawn before the URL is
complete. Links keep their written text again, and the Open in code review
URL menu entry, the forgePanel.recognize Remote, and the generic URL menu
adjustments that shipped with it leave with the revert.
Let the optional script-realm service install itself on the active page loader. Keep Main independent of Cordis and detach the registry without disturbing resident package windows.
Keep script placement independent of artifact revisions. Rebuilds and lazy chunks execute in the same package window; evict it only when the module graph releases the package or the page closes.
Stop observing the isolation option on the Host and on every incoming graph. Record the execution environment with a registered generation so its lazy chunks use the same carrier. Keep the existing Realm provider boot sequence.
Let ordinary revision-based replacements retain every materialized generation until its runtime releases it. Drop unused iframe candidates and stop fetching a removed package instead of creating a new orphaned Realm.
Publish the unstable per-entry script switch in the Host boot graph and keep opted-in bundles out of the Main Realm batches. Activate the Realm providers before isolated code, reuse a frame across its package-local chunks, and release it on replacement or teardown. Dev Web can opt entries in through a transient final overlay.
Refs #8131
* fix(app-boot)!: load bundle plugin rows from the packages their bundles select
The root config tree imports every row from the profile directory. A copy of
a built-in plugin package that a third-party plugin pins is hoisted into
<profile>/node_modules, where it replaced the package of the row that
@deepseek-ai/dsh-base inserts under the same name. The compatibility
admission then disabled that row and DSH started without its services.
createRuntimeResolution now reads the bundle layers in order and records, for
each plugin package name they insert as rows, the package in the nearest
node_modules above the inserting bundle; a bundle installed in the profile
looks no higher than the profile directory. A request whose importer is the
active profile directory itself uses that package before any copy in the
profile; every other importer keeps its lookup. A later bundle that finds
another copy adds a warning and does not change the selection. publish()
compares the selections, so a successor that differs only there is published.
A package installed into a profile no longer replaces the package of a row
that a bundle inserts; the upgrade guide describes the patch that does.
Refs #8476
* test(app-boot): expect the bundle plugin warning to name native real paths
The warning reports directories as the native real path spells them. On
Windows that expands 8.3 short names, which the JavaScript realpath keeps, so
the expected text differed under a short-named temporary directory.
Refs #8476
* fix(app-boot): select shipped peers and preset rows for bundle plugins
A bundle that declares a row's package under peerDependencies selects the
package the running installation ships, so a development bundle linked into
a profile keeps running its row from the host's package, as its own imports
do. Any other row still selects the nearest package above its bundle.
The rows an inserted row lists under config.plugins, as an agent preset
does, count as rows of the bundle that inserts it. A pinned copy in the
profile therefore no longer disables a row of a built-in preset.
Each package name is looked up once per bundle.
* fix(app-boot): bind bundle plugin rows to the bundle that declares them
A plugin row now resolves from the first bundle that inserts it and
declares the package under dependencies or optionalDependencies. The
resolution stores the package name and the bundle directory only: binding
reads one manifest per bundle and looks no package up. A request for a
bound name from the profile directory resolves again as an import of that
bundle does, from the real path of the bundle's manifest, so a source
launch keeps mapping workspace packages to their sources.
A row whose bundle declares the package as a peer, as a development
dependency, or not at all is not bound and keeps the lookup of the profile
directory. A bound row does not fall back to that lookup.
Two bundles that bind one name and reach different copies add a warning;
only such names are resolved while binding.
* fix(app-boot): read the rows of a group named without the group marker
The group plugin mounts its array configuration as rows whether or not the
row carries the `group` marker, and the compatibility admission already
visits those rows. Binding now reads them too, for `cordis:group` and
`@deepseek-ai/cordis-plugin-group`, so a bundle's row inside such a group
resolves from that bundle.
* perf(app-boot): compare bundle plugin copies only for differing ranges
Two bundles that bind one plugin package name and declare the same range
for it are taken to reach the same copy, so binding no longer resolves the
package from both. Only bundles whose declared ranges differ are compared
on disk and can record a warning. The shipped `web` profile, whose two
bundles insert 22 rows of the same names, now reads two manifests while
binding instead of making 90 file-system calls.
* feat(app-boot): print bundle plugin warnings when dsh starts a profile
`reportBundlePluginWarnings` prints each recorded warning to stderr, as
`reportSkippedBundles` does for skipped bundles, and the `dsh` launcher
calls it once after it computes the runtime resolution. A resolution
recomputed while the application runs still only records its warnings.
The supervisor closed the connection as soon as the server rejected one
request for its session. Parallel calls whose rejections had not arrived yet
then failed with an unknown outcome and were not sent again, although the
server was about to refuse each of them.
The first rejection now only schedules the reconnect. The connection stays
open for the reconnect delay, so every request the server refuses receives its
own rejection and is sent again on the new connection, and a call the server
accepted can still return its result. The timer closes the expired connection
before it opens the next one; requests still unanswered then fail once with
`MCP_CONNECTION_CLOSED` and are not sent again.
When no reconnect follows (disabled, or the attempt budget is spent) the
connection closes right after the rejection. A close report from the expired
connection does not start a second reconnect, and a tool listing it completes
during the delay does not publish `connected`.
Refs #8937
dsh-subagent-acp, dsh-experimental-subagent-oar and dsh-session-snapshot depend on @agentclientprotocol/sdk, which requires zod as a peer, without declaring zod. Installed alone they resolve one zod today, but where npm places an unprovided peer depends on the order it processes the tree.
- The three packages declare zod with the range other DSH packages use.
- verify-npm-install-layout reads every DSH manifest and rejects a package whose dependency requires zod as a peer while the package declares none, so the rule also holds outside the @deepseek-ai/dsh graph.
Refs #7501
The positioned, isolated sidebar column trapped sidebar overlays below the
centre column. Transition a registered fill color as the top background layer
instead, so the column stays unpositioned.
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
The macOS sidebar vibrancy tint, glass New Session fills, and hidden scroll
fade now apply only outside window fullscreen. In fullscreen the sidebar uses
the opaque web defaults; the windowed look is unchanged.
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
npm installs of @deepseek-ai/dsh nested one zod 4.6.6 copy in about 80 DSH packages (548-629 MB). @agentclientprotocol/sdk requires zod as a peer and dsh-acp did not declare zod, so npm hoisted the newest release for that peer before it reached any package that pins 4.6.6.
- dsh-acp declares zod, so npm places the DSH range before the peer.
- Workspace zod declarations move from exact 4.6.6 to ~4.6.6, the range Issue #7501 names. The Stagehand adapter keeps exact 4.6.6 because Stagehand 4.4.0 pins that version and receives the adapter's schemas. The lockfile still resolves one zod@4.6.6.
- verify-npm-install-layout resolves one release against an index that also holds a zod release one minor above the installed one and rejects any zod installation other than node_modules/zod.
Refs #7501
The shared context menu now publishes the instance id of the element that
opened it. Session and Workspace rows pass one id to their gesture trigger
and their button, and pin their menu state only while that id is the
opener, so the conversation title's menu for the same Session leaves the
sidebar row unchanged.
Refs #9000
Co-authored-by: winewill <324803222+winewill@users.noreply.github.com>
Review asked for one startup-wait setting instead of an MCP-specific
parameter that each similar need would repeat. The `initialize` parameter
`mcpStartupTimeoutMs` and its TypeScript and Python client options are
removed, so the protocol and both clients match master again.
`sdk-jsonrpc-server` gains `startupWaitMs` (0 by default, at most the timer
maximum). After route validation, `initialize` waits at most that long for
startup work that finishes after Loader settlement, currently MCP manager
servers in their first connection attempt, then answers and logs what is
still pending. The `sdk` profile sets it to 5000, below the TypeScript and
Python handshake timeouts.
The GitLab composition case waited for five bound merge requests with
vi.waitFor's default one second. Two of the five are bound by shell
lookups, and a lookup for a call inside a program is queued until the
program's root call settles, so in the ptc variant both lookups start
after the turn. On a loaded coverage runner they take longer than one
second and the case fails with "to have a length of 5 but got 4"; it did
so twice in a row on this branch, whose test files moved the spec into a
partition beside a much heavier one.
Slowing the stand-in glab lookups by 800 ms reproduces that failure with
the default wait and passes with the bound. The awaited state is
unchanged; the bound follows the sibling forge specs.
The Connectors bundle's preview pair lists the seven connectors under
their new titles and draws the new Linear icon. The Linear bundle's
preview pair draws the new icon.
The icon was Linear's app icon drawn to the edges of the 36x36 canvas:
an opaque dark square with three filters and two blend modes. The
other six connector icons are brand marks on a transparent canvas, and
the Plugins page shows each one in a rounded tile, where the Linear
icon appeared as a sharp-cornered dark square.
The icon is now Linear's official logomark, its path unaltered, in
Nordic Gray #222326 and 24 units across, over a white disc of radius
13.2. The disc keeps the mark readable on the dark theme, as the white
ground of the Notion icon does. The Connectors tab's copy of the file
stays byte-identical.
The seven connectors' titles named the package kind next to the app:
"飞书插件", "Feishu plugin", "Complemento de Feishu". The Plugins page
and the Connectors tab already say what their entries are, so each
title is now the app's name alone in the eight shipped languages:
飞书, 企业微信, 钉钉, 腾讯会议 and 腾讯文档 in Chinese; Feishu, WeCom,
DingTalk, Tencent Meeting and Tencent Docs in the other seven; Notion
and Linear in all eight.
The Connectors tab keeps its own copy of the 56 titles, and the copy
follows. The tab's Install and Open buttons, its switches and its
switch failure line name the connector by this title, and so does each
card's View button on the Plugins page. Sentences that say "the Feishu
plugin" stay as they are: the activation text, the model guidance, the
skills, the package descriptions and the READMEs.
The tab's unit expectations, its Web e2e spec and expected output, and
the seven connection e2e specs follow the new titles.
Two dollar signs on one line were read as an inline formula, so a reply
such as "Plan A costs $20 per month while plan B costs $35." lost the
words between them. An inline formula now follows Pandoc's rule: its
opening dollar precedes a non-space character, and its closing dollar
follows a non-space character and precedes no digit.
The Agent Note names the chat backend's fallback by what it does instead
of by a metaphor.
A server that answers a request with HTTP 404, or with HTTP 400 naming the
session, did not run that request. The supervisor reported every request in
flight at that moment as a lost connection with an unknown outcome, so the
model had to repeat a call that was known not to have run.
A tool call whose own request the server rejected is now sent once more on the
new connection. It reports `MCP_SERVER_UNAVAILABLE` and says the call was not
run when no second attempt can be made: reconnection is disabled, the next
attempt fails or outlasts `toolCallTimeoutMs`, the tool is no longer listed, or
the new session is rejected as well. Requests still waiting for an answer when
the connection closes keep failing once with `MCP_CONNECTION_CLOSED` and are
not sent again. A rejected resource request reports the same not-run failure
and is not sent again.
Refs #8937
The speaker glyph was 10.25 units tall beside row siblings of 13.5. It is
redrawn to the same extent: a taller cone and two wave arcs that span the
box.
The bundle's detail document becomes a 640x300 feature preview in English
and Chinese, as voice input has: a reply with its action row, the
read-aloud control highlighted, and the speech it becomes. The sentence on
supported languages moves from the document into the details notes.
Converting `mcp_startup_timeout_seconds` to milliseconds raised
`OverflowError` for `inf` or `1e308` before `initialize` entered its failure
path, leaving the started runtime running. The conversion now runs inside
that path, so it closes the runtime like any failed initialization.
`apps/cli/tests/profile-mcp.spec.ts` still expected only the `web` profile to
mount `mcp-manager`; it now expects the `web` and `sdk` profiles to.
Plugin entries export only what the Loader loads, so replace the
isModelListed entry function with LlmRuntime.isModelListed(provider, model)
and route session-controller and subagent catalog checks through ctx.llm.
- Report CONTINUATION_UNAVAILABLE when an agent/created listener wakes a
maintenance restoration before the choice is recorded; the release
cancels the started turn.
- Accept only catalog-listed models in subagents.selectModelByUser, using
the isModelListed check shared with session.selectModel.
- Share the client model-selectable rule and derive ModelDirectory
availability from the subagent address.
- Wait for the maintenance release before reading the child log in the
Web e2e, and fix the Chinese README sentence.
Offer the composer model control and /model for local continuable subagents,
submit through subagents.selectModelByUser, and read the child's own
modelSelection projection. Cold saves reach every open page through the
restored child's ordinary projection updates. The client layer is ported
from #6277 without its Host cold-append publication.
Restore a cold continuable child as a maintenance Activation, record the
choice through its Agent, and release it before returning instead of writing
the stored log directly. The restoration reserves no capacity slot, publishes
no subagent lifecycle events, refuses manager-routed input, and closes from
the idle phase it owns. A child with pending input is refused so that input
stays for its next execution; a child with no saved model restores through the
choice being recorded.
The Models page chose a card layout by namespace id, so a provider row,
whose namespace is its own row id, got the card for a form without a
layout: one line that names the patch file, and a disabled Save.
Settings already sends the page everything it needs to do better. A
provider row's form declares exactly the fields of an entry of the
adapter row's providers dict, because both are built from the same field
schemas, so the page recognizes the row by its form and lays its route
out as a pi-ai route at the root of the row's namespace. No interface
carries the fact, and settings, its Remote controller, and the
configuration editor are unchanged.
A key typed for a row is stored under the credential reference the row
names. A changed field goes to the configuration editor, which refuses a
row that a home patch or overlay adds; the card shows that refusal. While
the profile patch holds no override of a row, the card takes the running
config as the layer a cleared field returns to, so a row that a later
layer adds shows its models and name. A provider row waits for its key as
an ordinary row in the first-run posture, like a dict entry.
The editor is keyed by the route's settings address: when another row
starts to serve the route being edited, the draft and revision read at
the old address are dropped instead of being written to the new one.
The previous commit marked a provider row that a later layer decides as
managed: the configuration editor reported which rows a home patch or
overlay decides, settings and its Remote controller carried that to the
page, and the Models page showed such a row with a tag and a read-only
card.
The page already handles a provider row without any of that. It lists the
row's route, offers no deletion for it, and opens it with its card for a
form it has no layout for, which names the row's section of the patch file
and takes no input; the configuration editor already refuses a write to a
row that a home patch or overlay adds. So the configuration editor,
settings, its Remote controller, and the Models page go back to what they
were, and the change is confined to the adapter package.
The Web test now describes the unchanged page beside a deployment's rows,
and the adapter's test helper stores the profile patch itself instead of
through a parameter added to the settings test helper.
A patch that sets the config of the llm-pi-ai row replaces the `providers`
dict of the layers before it. A deployment's home patch and the profile
patch that the Models page writes therefore cannot both configure
providers: the home patch's dict replaces the person's, and the
configuration editor refuses every later save of that row.
A layer that adds a provider now writes a row of
`@deepseek-ai/dsh-llm-pi-ai/provider`, whose config is the route key and
the profile fields of a dict entry. The adapter row serves those rows
together with its dict. Of the declarations that name one route, the one
that comes last in the composed entry list is in effect, and the dict
takes the position of the adapter's row. The dict, stored profile patches
and the Models page's writes are unchanged.
The configuration editor reports whether a home patch or an overlay
decides the config a row runs with (`managed`), settings forwards it with
the row's plugin name on each descriptor and namespace view, and the
Models page shows a managed provider row with a tag and a card whose
controls are disabled.
Providers list their voices and the synthesis registry saves one voice
preference in its profile entry, as voice input saves its language. The
read-aloud Remote reports the voices, saves a choice, fixes the voice of a
reading when its plan is made, and speaks a Host-owned sample sentence.
The bundle details gain a voice field and a speaker that plays the sample
with the three states of the read control. The DeepSeek provider's own
voice key moves to the registry. The details text lists the supported
languages; the API detects the language itself and accepts no choice.
Add five experimental packages: the text-to-speech registry, the DeepSeek
cloud synthesizer, the read-aloud Remote that plans segments and streams
their audio, the Client action and notice, and the optional bundle, titled
语音朗读 in Chinese.
A reply is cut into segments of about thirty seconds. Each segment is one
request to /v1/tools/tts, sent only when at most fifteen seconds of the
received audio is unplayed, so stopping a reading leaves the later
segments unsent and unbilled.
The Host reduces the reply's Markdown to speech text itself and finds
formulas by their dollar delimiters; the math syntax packages are left out
because they install KaTeX into the runtime. The build embeds the Markdown
parser, whose installed browser build reads document inside a Web Worker
Host.
The previous commit held every SDK `initialize` for up to 30 seconds through
an `sdk-jsonrpc-server` config field. That wait outlasts the TypeScript
client's 10-second handshake timeout and most of the Python client's
30-second one when an MCP server hangs, so the field is removed and the wait
becomes a request parameter.
`InitializeParams.mcpStartupTimeoutMs` (0 to 2147483647) holds the answer,
after route validation, until `mcpManager.whenSettled()` reports no server in
its first connection attempt; omission or `0` answers at once. The Python
`DeepSeekHarness` sends `mcp_startup_timeout_seconds` (5 by default) and
`HarnessClient.initialize` accepts it explicitly; the TypeScript client sends
`mcpStartupTimeoutMs` only when configured. A manager with no listed server
settles at once.
Before any non-Context tool is counted, a running group without a live tool
still reads "Analyzing the request". Afterwards it shows the completed-work
summary followed by "thinking about the next step", held by the same 150 ms
live-title rule.
Fixes#9070
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
MCP manager servers mount after the manager activates, outside Loader
settlement, so an SDK client that prompts right after `initialize` reached
the model before their tools registered.
`McpServerManager.whenSettled(signal)` resolves once no listed server is
`connecting` with `attempt: 0`; any later state counts, including failures
and reconnect attempts. The SDK server awaits it after Loader settlement for
at most `mcpStartupTimeoutMs` (30 seconds by default, `0` skips the wait),
then answers `initialize` and logs the servers still connecting. Desktop and
Web readiness are unchanged.
The `mcp-manager` SDK snapshot no longer waits for the fixture before
prompting; `initialize` alone puts both MCP tools in the first request.
Let the Office kit trust the argument rules its model-facing tool already enforces, and stop validating PNG chunk structure the splitter inherently depends on.
Drop the pdfinfo size precheck so a render starts one pdfinfo and one pdftoppm per run of consecutive pages, register the Office toolviews as literal keys so the client slot catalog lists every name, and align the Office notes with the document tool names.
Replay the skill description the Office skill now ships, assert the renamed tools in the SDK and Web profile catalogs, and keep the shipped tool order alphabetical.
Rename dsh-tool-office to dsh-tool-document and office_render/convert/recalculate to document_*, keep the old names readable for pre-rename Sessions, and fix the Poppler page-count forgery, per-run pdfinfo, and real-Poppler test provider reported in review.
Refs #9015
Add a renderer option to office_render and a per-type renderer order to the Office kit. PDFs use Poppler pdfinfo/pdftoppm through piped short-lived subprocesses when available, falling back to LibreOffice only when Poppler is unavailable.
Refs #9015
The custom-server save and removal read references only from header and environment values, and only the first one of each value, while the MCP manager also expands the URL, the command, each argument, the working directory, and every reference of a value. A reference in one of those positions was not counted as used, so a removal or an edit could delete a secret an entry still referenced, and a save could store a secret under a reference another server's entry used.
* feat(ci): check whitespace in each pull request's changes
The static lane runs the pre-commit hook's git diff --check over the range
from the merge base with the base branch to the pull request head, before
dependencies are installed. Base-branch commits merged into the pull request
are outside that range.
* test(ci): match the checkout step without an untyped asymmetric matcher
expect.stringMatching returns any, which the type-aware lint rejects as an
unsafe assignment inside the expected object.
The fetch action sits in the Models heading row and stays clickable
while the section is folded, but its failure rendered inside the folded
body, so a failed fetch showed nothing. The failure now renders under
the heading row, outside the foldable body, beside the action that
asked.
A folded model row also separates its model ID from its display name
with a space, so the row's text reads as two values; the flex gap alone
spaced them on screen, and the layout is unchanged.
The spec passes with the FormData upload on the supported Node.js range and
is the check that fails when a bundled undici reintroduces the unhandled
rejection.
Determine leading separators from registrations that render menu rows, not the position of an item wrapper. Cover live registration changes in the real More menu and link list item roots from the renderer package docs.
The Back button's `:hover` rule moves into `@media (hover: hover)`, as the
`ui-theme` hover-styles spec requires of every client stylesheet.
The browser entry statically imports the package's own generated `./remote`,
which exists only in built `lib/` output. The root Vitest config now aliases
that import to a stand-in while the built file is absent, as it does for
`dsh-client-hmr`, LiveShare and `dsh-deepseek-chat-import`, so
`browser-plugin.client.spec.ts` passes on a clean checkout.
Group each selected list registration under one layout-neutral item, including a fixed only selection. Preserve registration identity and distinguish an empty component from a missing row. Adapt the affected panel, settings and toolbar consumers without changing other slot kinds.
BREAKING CHANGE: CSS selectors and DOM queries that cross a rendered list entry must account for its data-slot-item root.
The gate only needs the generated typert.host.js text to count runtime
imports, but it built WorkspaceTypertGenerator without options, so the
default checkDiagnostics pass created one TypeScript program per
contributor package and ran semantic diagnostics over each. That was
most of the gate's 252 s.
The build plugin and every other generator call site already leave
diagnostics to the repository typecheck, which covers scripts/**/*.ts
through tsconfig.host.json.
Refs #9030
An installed connector's row shows the Switch primitive in place of the
"Installed" and "Enabled" texts; the switch is on while the connector is
enabled. The tab's controller calls `pluginManager.setBundleEnabled`,
keeps the switch disabled through the read that follows the write, and
names the connector in one line under the heading when the Host refuses or
fails the change. The rest of the row still opens the connector's page,
and a missing connector keeps its Install button.
The dictionaries drop the two state entries and gain the failure line in
the eight shipped languages; the switch takes the connector's title as its
name. The tab's switch shows no account guidance or restart notice and
sends no `plugin_toggle` event: the README pair lists this as a
limitation, and the Agent Note states the row and the rejected
alternative as they now are.
The bundle preview draws switches in its four installed rows, and the unit
tests, the Web e2e, and its expected output follow the switch.
The agent/pre-step listener now derives the browser time-zone context
from the timeContext projection's zones for the latest entered turn plus
the step's proposed messages on every request.
The removed fallback walked the Session log backward with the deprecated
eventAt reader when a pre-step named a turn other than the latest
entered one. The only production emitter, the agent-loop preStep,
always passes the open turn, whose turn/start it appends before the
turn's first step, so the fallback ran only for direct test dispatches.
Remove the unit test that dispatched a pre-step with no turn/start and
point the zone-reset test at the open turn. Drop the README limitation
that described the fallback, and regenerate the config catalog for the
moved Config declaration line.
Mark the output of registered Factories and explicitly selected local components. Keep missing-definition fallbacks and default local content unwrapped. Select div or span at the definition, and keep existing menus, navigation, and scroll behavior across these roots.
BREAKING CHANGE: DOM queries and CSS that cross a rendered Factory or an explicitly replaced local position must account for its display: contents element.
The progress-bar rule moved into `practices.md` by #8781 pushed a
whole-reference read past the `thresholdChars: 8192` that
`standard.patch.yml` configures for the tool-result pruner. At the
e2e's 256-character install-path allowance the read is pruned in the
middle, and `web-agent-presets.e2e.ts` fails its whole-reference
assertion.
Compress the rule to one line and drop the blank line the move
introduced. The deployment prune threshold and the e2e path allowance
stay as they are: the document is what exceeded its budget.
Co-authored-by: dsh-ci-bot <dsh-ci-bot@users.noreply.github.com>
The SDK profile now mounts `@deepseek-ai/dsh-mcp-manager` as the same
`mcp-manager` row that Desktop composes, so servers configured on that row
and servers that installed plugins register reach the model under SDK.
The Plugins page account row stays Desktop-only because the SDK serves no
browser.
The `mcp-manager` SDK snapshot configures one server on the row and
installs the Linear connector with a saved grant, both against the HTTP
MCP fixture, and pins both tools in the first request.
The progress-bar rule moved into `practices.md` by #8781 pushed a
whole-reference read past the `thresholdChars: 8192` that
`standard.patch.yml` configures for the tool-result pruner. At the
e2e's 256-character install-path allowance the read is pruned in the
middle, and `web-agent-presets.e2e.ts` fails its whole-reference
assertion.
Compress the rule to one line and drop the blank line the move
introduced. The deployment prune threshold and the e2e path allowance
stay as they are: the document is what exceeded its budget.
One Web e2e case boots the Connectors bundle beside an HTTP MCP fixture:
it adds a remote server with a bearer token from the tab, tests the
connection from the server's page with the stored token, and removes the
server there. The Web and Host aggregate configs list the file.
The package gains a Host half. The `connectors` service lists the MCP
manager's Settings servers with secrets redacted and runs each save,
removal, and switch as one Host operation over Settings, credentials,
and the manager; a change names the revision the list read and fails
with `connectors/conflict` when Settings moved, or `connectors/refused`
at the first refused step. It registers each configured OAuth server's
account with `ctx.mcpAccounts` under `mcp:<name>`. `mcpManagerNamespace`
names the Settings namespace it edits.
The tab declares the `connectors.custom` slot below the official
connectors and holds the section's view in its own state. The browser
half registers the custom servers section there once the `connectors`
and `mcpManager` Remotes exist: the list with each server's switch and
account status, **Add MCP server** beside the heading, and a server's
page in place of the tab's lists, below **Back**. The Plugins page
package is unchanged.
The package splits into Host and Client compiler faces behind a
solution-only root, exports `./remote`, `./typert`, and `./types`, and
builds with the Host phase. The liveshare endpoint classification marks
the four Remote methods owner-only. The `connectors-tab` Web expected
output gains the section's heading, button, and empty state.
The README pairs of the package, the experimental group, and the MCP
manager, and the Agent Note, state the feature. The service joins the
subsystem page and capability-seam registries, and the generated
catalogs, the translation pairings, and the lockfile follow.
A surface outside the account's bundle page renders a registered account
by key: `section` shows the account's whole section, the same entry the
bundle page mounts, and `status` only its state dot and status line, as
in a list row. The Factory renders nothing until the Host lists the
account.
The README pair documents the Factory and its two presentations.
`McpAccountRegistration.packageName` becomes optional. An account
registered without one gets no bundle page section, tag, or activation
prompt; it shows only where a surface renders it by its `mcp:<server>`
key.
The README pair states the optional package, and the generated Host API
catalog follows the declaration.
The editor had one write, `edit()`, which replaces the config of a row
whose plugin is running. Nothing added a row to the profile patch or
removed one, and `edit()` rejects a row that is switched off or failed, so
a config that makes a row fail could not be corrected through the editor.
`insert()` appends a row to the profile patch and starts it. `remove()`
deletes a row that the profile patch inserted, together with the patch's
override items for that row, and `configuration()` marks such a row as
`inserted`. `editRow()` replaces a row's config as `edit()` does and also
accepts a row that is switched off or failed: that row stores the config
as given, and its plugin validates it at the next start. A written row
that is switched on must be active after the reconciliation. Otherwise the
file gets its prior content back, and the call rejects with the activation
diagnostic.
The four writes share the lock, the higher-layer check, the atomic write,
and the restore. `edit()` keeps its checks and changes in two cases. When
an edit resets an override to the inherited config and deletes the emptied
patch item, the comment above that item stays in the file; for the first
item it is the file header. When the reconciliation with the prior patches
rejects after a rejected write, the caller receives the rejection of its
own write, and the second rejection is logged as a warning.
The editor reads the root context in one place, so its entry in the
root-read baseline drops from 3 to 1.
Refs #9155
* perf(session): merge short SQLite frames inside the append transaction
Live writes store one to three events per frame, so compression barely
works. When the newest short frames of a Segment reach frameEvents events,
the append transaction re-encodes them as full frames. The frames_no_delete
trigger is dropped from the unreleased schema and from existing databases.
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
* perf(session): read SQLite frame payloads only for a merge
Scan only frame ranges to decide whether the trailing short frames merge,
then read their payloads. Append decoded lines one by one so a large
frame size cannot exceed the argument limit.
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
* perf(session): cap SQLite frame merges by decoded bytes
A merge skips a run of short frames whose stored or decoded text exceeds
4 MiB, bounding how long it holds the event loop and the write lock. Tests
cover merged compression, the live event path, a failure after the merge's
delete, and large events; a seeded synthetic diagnostic measures size and
append cost. Documentation drops the one-frame-per-write wording and lists
the write stop after short-frame corruption.
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
* perf(session): store short SQLite frames uncompressed until merged
A short frame below min(64 KiB, 2 MiB / frameEvents) of JSON text is stored
as text; the merge compresses it together with its neighbours. This skips a
compression on every live append that the merge would redo, and keeps any run
of such frames within the 4 MiB merge limit.
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
* perf(session): seal short SQLite frames when a writer closes
* test(session): assert the reported seal failure without an untyped matcher
---------
Co-authored-by: Turtle <turtle1999@deepseek.com>
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
Co-authored-by: Magolor <magolor@qq.com>
#8981 adds the registry to dsh-base switched off; Desktop enables it to
select each Session agent's preset, while the SDK composes its agent rows
directly.
The tool catalog note again names the Web standard, ptc, and cordis
presets beside the edit-derived default. rescope-vendor lists the catalog
and its generator as files that carry the `cordis` agent-preset id, and
its product-identifier test failed once the note stopped naming it.
A folded model row is dragged as a whole, and nothing on the row said
so. Six dots now appear at the row's start while the pointer is on it,
during the drag, and in the drag preview. The mark sits in the row's
start inset and takes no room, lets pointer events through to the row,
and is hidden from assistive technology; an unfolded or disabled row
has none.
The dots are a new shared glyph, `drag-dots-fill`, beside the existing
three-line `drag-handle-outline`.
The agent row comparison flattened cordis:group rows without their
disabled field, so the members of a disabled group still read as
enabled. Combine the group's value into each member: a disabled group
disables every member, and an expression is recorded beside the
member's own value.
Prompt sections, runtime context entries and injected messages were
keyed by name, so a reordering on one side passed although the model
reads different text. Compare the relative order of the entries both
sides share in each sequence, and of the tools, as an order layer.
* fix(headless): preserve preset selection and release closed turn state
* fix(agent-presets): report invalid preset selections and keep stored headers
Validate only agent-preset/selected records in the agentPreset projection and name the event sequence in the failure. The state and view schemas accept every header value the Session validator admits, so an empty stored header no longer fails restoration.
* fix(agent-presets): keep trusting logged preset selections
Restore the agentPreset projection, its tests, and the Agent Note consequence to their master state. Writers record non-empty preset IDs only, and Session format admission owns payload validation for stored events, so the projection does not re-validate the typed event payload.
Drop `dsh.bundle.listedByDefault: false` from the bundle manifest. The
Plugins page now shows the Connectors card under Experimental plugins and
in the More list, after the forge bundle; the bundle stays disabled until
its switch is turned on.
The Web e2e file returns the two default-hidden checks to the bundles that
still hide, adds the bundle to the expected More list, and four expected
outputs gain the card or its count. The README pair and the Agent Note
state the new listing.
The agent row comparison only read the rows the Desktop standard preset
declares, so an SDK row outside the preset was never compared. Compare
such a row with the Desktop host row of the same id, report an enabled
SDK row that neither side declares, and record the existing differences:
the primary runtime rows, HMR, the title request and the SDK transport.
Unevaluated !!js nodes compare as their source text.
DingTalk reached master, so the tab lists it third, after WeCom: its package name, its title and description in the eight shipped languages (equal to the connector's own locale metadata), and a copy of its icon.
The bundle preview draws seven rows, and the Web golden and the unit expectations follow the new list.
A link cycle lists again at each level until the platform refuses the
path, a link that leads back into the workspace is named by its resolved
position, and search finishes without entering a link. The READMEs and
the decision record state that link cycles are not detected.
Refs #8895
After the window narrows to 700 px the sidebar leaves the page a frame later; in between the detail is 420 px wide and
its bar has two rows (68 px). The case read the height once, right after the fold menu appeared, and failed on CI when
that read met the frame in between. It now polls for the one-row height.
Three full-round radii of the review page lacked `corner-shape: round`, and the unavailable merge button's hover
selector sat outside `@media (hover: hover)`; `corner-shape-styles` and `hover-styles` in ui-theme reject both.
Bind each children outlet to the slot passing it to the layer. Key compiled HOC chains by the slot name as well as the declaration and dispatch key so distinct named slots can safely reuse one spec.
Mark the exact position where each hoc layer renders its children without wrapping the layer itself. Preserve the sidebar rail animation through forwarded outlets.
BREAKING CHANGE: selectors and DOM traversal across a forwarding hoc layer must account for its named display: contents children outlet.
The activity lines called it "Auto-Merge" and "merge automático" while the merge actions and their notices call it
"Automatisches Zusammenführen" and "Mesclagem automática".
The `involved` list and its count selected reviewed merge requests with `not: { reviewStates: [UNREVIEWED,
REVIEW_STARTED] }`. GitLab 19.5.1 applies that negation to every reviewer, so a merge request the user approved was left
out while another reviewer had yet to review it. The connection now lists the states a given review can have, which
GitLab reads from the user's own reviewer entry.
* refactor(cordis): register Host inspect providers in cordis-host-runner
The first-party Host inspect providers (Service, Event, Config, Runtime,
Tool) lived in a second plugin entry, `@deepseek-ai/dsh-tool-cordis/host`,
that every host composition had to mount once beside the runner. The
runner now registers them into its own inspection registry when it mounts,
mirroring the Client runner, and `tool-cordis` keeps a single entry that
registers `cordis_inspect` per preset.
- Move the providers, the live Config projection, and the generated Host
API catalog into `cordis-host-runner`; it gains the `dsh-app-boot` and
Loader dependencies that `tool-cordis` drops.
- Remove the `./host` export, its locale files, and the
`cordis-inspect-providers` rows from the Web bundle and the snapshot
compositions.
- Document the providers in the runner README and record the removed
entry point in an upgrade guide.
* docs(module-graph): regenerate for the cordis-host-runner app-boot edge
The release family test lists every published experimental package; add
dsh-speech-to-text-deepseek. The new package and its edges push the
dual-release npm graph to 341 packages x 3332 internal edges, above the
1,134,400-unit budget, so raise MAX_RESOLUTION_WORK_UNITS to 1,420,265
(1.25x the measured 1,136,212 units) and record the new timings in the
Agent Note.
The voice bundle summary now names cloud recognition, which the recorded
plugin and recommendation catalogs repeat; update those recordings, their
expected output, and the browser assertion.
Refs #8059
dsh-pre-push-checks names the parity tests to run when a change reaches
the model context of the sdk profile or the Desktop standard preset, and
dsh-code-review asks for a recorded product reason behind a one-sided
change.
The shipped filesystem mutation defaults and apply patch file editing
notes keep their original decisions and alternatives and link the new
Apply patch follows edit note, which records the derived default, the
PTC and cordis presets offering the tool, the alternatives, and that the
PTC enablement rests on preset consistency rather than a benchmark run.
The upgrade guide no longer claims every shipped tool-fs row stated
applyPatch: false and no longer asks readers to find the derived value in
--dump-config, which renders only stated keys. Two subagent scenarios drop
an applyPatch: true pin that the derived default now supplies.
The first-party Host inspect providers (Service, Event, Config, Runtime,
Tool) lived in a second plugin entry, `@deepseek-ai/dsh-tool-cordis/host`,
that every host composition had to mount once beside the runner. The
runner now registers them into its own inspection registry when it mounts,
mirroring the Client runner, and `tool-cordis` keeps a single entry that
registers `cordis_inspect` per preset.
- Move the providers, the live Config projection, and the generated Host
API catalog into `cordis-host-runner`; it gains the `dsh-app-boot` and
Loader dependencies that `tool-cordis` drops.
- Remove the `./host` export, its locale files, and the
`cordis-inspect-providers` rows from the Web bundle and the snapshot
compositions.
- Document the providers in the runner README and record the removed
entry point in an upgrade guide.
The SDK profile now composes runtime inspection as the Desktop standard
preset does, so its tool and agent row exceptions no longer match a
difference.
The ptc and cordis presets now offer apply_patch, so the Web recordings
captured under them gain only the apply_patch guidance and run_code
binding declaration in their persisted system prompts and schemas.
The sdk-app bundle now mounts cordis-host-runner and tool-cordis, so the
Python smoke's advanced patch no longer inserts its own copies. The
composition keeps one row per id and the recorded tool set unchanged.
The upgrade guide also names the rows that remove the inspection services
along with the tool.
tool-fs.applyPatch no longer defaults to false: an explicit resolve step
takes the resolved edit value when a row leaves applyPatch unset. Agent
presets list complete plugin declarations with no shared parent, so this
decides the default in one place instead of on every shipped row; the
dsh-base row and the Web/Desktop standard, ptc, and cordis presets drop
their applyPatch lines, while the minimal preset and sdk-minimal keep the
tool off through edit: false. An explicit applyPatch still wins in both
directions.
The tool-fs unit tests cover the derived default and both overrides; the
read/write/edit guidance tests pin applyPatch: false because they assert
the three-tool text. subagent-agent-preset and the headless owner-local
expectations, whose tool-fs rows enable edit without applyPatch, are
refreshed and gain only the apply_patch section. The Agent Notes, tool-fs
README, tool and config catalogs, and the upgrade guide describe the
derived default and its effect on third-party tool-fs rows.
Mount the Cordis inspection registry, the Host inspect providers, and the
`cordis_inspect` tool in the sdk-app bundle so the SDK model receives the
same runtime inspection tool as the Desktop standard and Creator presets.
The SDK serves no browser, so its directory lists Host providers only.
Remove the standard-mode parity exception, record the SDK-only PTC
difference, keep pre-desktop SDK and Python compositions pinned, refresh
the affected SDK snapshots, and document the change.
The Web/Desktop ptc and cordis presets state applyPatch: true, and the
shipped PTC overlay no longer overrides the dsh-base tool-fs row, so every
shipped coding composition offers apply_patch beside edit: as a JSON tool
under native execution and as a run_code binding under PTC. The SDK and
Desktop PTC tool sets stay equal.
The SDK keyless smoke expects the apply_patch binding under the PTC
overlay, and the Web preset e2e asserts apply_patch in the cordis tool set
and the ptc run_code bindings. The shipped filesystem mutation defaults
Agent Note, the tool-fs README, and the tool catalog describe the new
defaults, and an upgrade guide records the change for 0.2.3-alpha.2.
Revert the temporary shipped default from #7698: the dsh-base tool-fs row
and the Web/Desktop standard preset state applyPatch: true again, matching
the shipped filesystem mutation defaults Agent Note, the tool-fs README,
and the tool catalog, which kept describing the enabled default.
The recording and test pins that held applyPatch: true while the default
was off are removed, since the default now supplies the same tool set; the
default tool lists in the SDK smoke and Web composition tests list
apply_patch again. team-default-enabled, recorded while the default was
off, is refreshed and gains only the apply_patch schema and guidance.
After a prepare step that failed or was cancelled, the published account
is the registration's `unprepared` object. A later check that found
nothing missing, because its own step succeeded or the files arrived
another way, ran `perform` with that account still published; a
`perform` that failed without publishing left it, so the page kept
reporting a missing download that was in place. The Service now
publishes the registration's first account before `perform` in that
case.
Feishu shows the retry view for a check that failed before the account
was read; it showed the checking view without a button.
Refs #8942
Move the DeepSeek cloud recognizer from the harness One-Shot endpoint to the
public /v1/tools/asr API. It is a ctx.deepseekAuth consumer that accepts the
account sign-in and the API key, tries the sign-in first, sends the WAV
unchanged, and never retries. The account service keeps master's token
origins.
speech-to-text drops the client locale, picks the first provider that can
record without preparation under auto, and reports an unlisted saved language
as auto. The voice UI explains cost, links the speech recognition guide, names
API keys beside sign-in, and blocks recording until a switch to local
recognition reaches the catalog.
Refs #8059
ctx.cliAccounts takes an optional `prepare` (phase, unprepared, ready,
run). While it is not ready, a check stages the phase and awaits `run`
before the plugin's `perform`; a failed or cancelled run publishes
`unprepared` and `perform` is not called.
- Feishu and DingTalk declare the lark-cli and dws release downloads as
their prepare step instead of running them in their own check.
- WeCom and Tencent Meeting declare the upstream skills download as
theirs, so the account check waits for the skills and the page can
cancel and retry it. The skills handle is now `installed()` /
`install(signal)`; `state`, `watch()`, and `retry()` are removed.
- `CliPathContext.ready` is replaced by `prepare.ready`.
- Feishu's skill provider invalidates the catalog once lark-cli is in
place after a listing without the entry, including after a cancelled
download that already copied the binary and after an installation made
outside the plugin's download.
Refs #8942
A remote server that restarts or drops a session rejects later requests with
HTTP 404, or with HTTP 400 naming the session. The SDK transport reports that
rejection through `client.onerror`, keeps the stale session id, and never
closes, so the supervisor stayed `connected` while every call failed.
The supervisor now treats such a rejected POST on an established connection as
a lost connection and reconnects within the configured budget. Requests in
flight fail with a message that says the session expired and are not sent
again. A refused event-stream GET alone changes nothing: the supervisor sends
one ping, and only a ping rejected for its session starts the reconnect.
Fixes#8937
- Merge an in-history update with a tool change only when both belong to
the same step; an update an earlier step presented no longer swallows
a later step's tool change.
- Change the effective prompt when the per-source instructions change,
not only the joined text, so an update without text (a clear without
a notice) presents its own record and later records stop showing the
cleared text.
- Attach the instructions in force to the node a system message
introduces, so records without a loaded request header show them.
- Keep the previous catalog for a rebuilt prompt and present only its
tool changes; say when the catalog changed only in order.
The initial and a rebuilt system prompt are sent as shown, so only a
record that presents an update explains that the model received the
instructions as incremental updates.
Replace the Diff and As sent tabs. Update, shown for every change except
the initial and a rebuilt prompt, lists the system message by source
(or a text diff without section metadata), then added and removed
tools. System Prompt shows the instructions in force combined into one
prompt with unselectable source titles; Tools shows the catalog in
force.
The shared fold marks prompts established by positional replacement
as rebuilt and reads per-source updates only for in-history appends. A
step that changes both the system prompt and the tools now yields one
combined change instead of losing the system part.
Read source.sections in the shared system prompt interpretation and
derive, per message, each source's change with its notices and, per
position, the instructions in force.
Chat shows a section-attributed in-history update at its own position
with its sources named and its body split by source. Trajectory adds an
Update tab, compares each source in the Diff tab, shows the instructions
in force in the System Prompt tab, and keeps the joined retained
messages under As sent. Messages without section metadata render as
before.
Replace the JSON string escapes of the fixture directories too, because
runtime context quotes the working directory with JSON.stringify, which
doubles Windows backslashes. Sort observed tools in code-unit order, the
order the test sorts request tool names in. Update the shipped fs mutation
defaults note, which still described a PTC tool set comparison.
`workspaceDescent` parsed the request string by its own rules, while the
filesystem backend expands a leading `~` and applies its platform's drive
and UNC rules to the same string. `list('~')` and a directory watch on `~`
were therefore accepted with no link in the workspace, as was a path on
another drive under a root spelled `//server/share`.
The check now compares the two spellings the backend resolved, the root's
and the directory's `displayPath`: absolute, home prefix expanded, no link
followed. A root spelling that is not absolute never qualifies.
Also correct two documents that still stated the earlier rule and the
reason the decision record gave for refusing a `..` segment.
Refs #8895
The line that opens the request menu sat in the menu's anchor wrapper, which is as wide as its content, so the line
highlighted only around its text while the rerun line and the check lines of the same column highlight across their
block. The wrapper now spans the block.
Drop the PTC comparison and its dependence on the example PTC overlay,
and with it the per-mode exception field. Compare runtime context values
and the other messages injected into the first request, after replacing
test paths and clock readings and running both sides in UTC, with the
Desktop user message reporting that zone as the GUI client does.
`list` and directory `changes` accept a directory whose path descends from
the workspace root by child names, so a link in the workspace that resolves
outside it lists and watches like any directory. An absolute path outside
the root and a `..` traversal stay `workspace-file/outside-workspace`.
The Sidebar file tree keeps the Host's code on a watch failure, so the
level shows the localized line for it.
Resolves#8895
Review of the plugin found five defects; each is reproduced by a new test.
- A read that finished after its Agent was disposed registered the grant
again, owned by the plugin until unload. A read now registers nothing once
`agent/disposed` was seen, a registration the unloading fiber refuses is
contained instead of rejecting a committed move, and the unload cancels and
awaits reads in flight.
- During a Host move the policy combined the entered directory with the Git
directory of the one left until the read ended. A grant now records the
directory it was read for and ends in the step that commits the move,
through a prepended `session/event` listener; a Session that publishes no
events loses it when the read of the entered directory starts.
- Matching pointer files were enough to grant their grandparent directory.
The layout now requires `HEAD`, `objects`, and `refs` in that directory,
and the plugin refuses an administration directory that lies inside a
directory the Session's policy already lets it write, unless the result is
the directory it already granted. A writable `<X>/worktrees/<name>` no
longer yields `<X>`, a configured grant of one administration directory is
no longer widened to the whole Git directory, and a bare repository under a
directory named `worktrees` cannot use its grant to obtain the parent.
- Reads take the caller's cancellation, merged with the plugin's own; a
cancelled read changes nothing and warns of nothing.
- Pointer files are read through `readBytes` with an 8192-byte cap.
Pointer files planted while a Session could write more still pass; the README
and the Agent Note state that limit.
GitLab 19.5.1 answers `detailedMergeStatus: CONFLICT` for a mergeable merge
request at every alias after the first of one status query, once the aliases
select `diffStatsSummary`; read alone, the same merge request answers
`MERGEABLE`. With the default batch of two, the second merge request of a
Session with several bound merge requests showed a conflict and no merge
action.
`statusBatchSize` now defaults to 1. A poll sends one GraphQL query per
watched merge request instead of one per two, at most
`maxConcurrentRequests` at once.
The provider editor nested three frames, kept the model list inside the
same fold as the endpoint and retry fields, and showed every model as a
pair of inputs behind a drag handle whose tooltip covered the model ID.
- An edited provider row is the editing surface itself, under its own
name; the editor no longer repeats the name, and Cancel closes it.
- The model list is its own section, unfolded by default. The endpoint,
retry policy, and a declared route's name and protocol move to a
folded "Advanced settings" section.
- A folded model row is one line of text and is dragged as a whole to
reorder; the handle and keyboard reordering are removed. Unfolding
shows the fields in two equal columns, and a newly added row starts
unfolded.
- The Cancel and Apply row stays at the page's scroll edge and carries
the notes that explain a blocked or refused save.
- The create form pairs Provider ID with the display name and the
protocol with the endpoint.
- An installed catalog route with no list of its own states that it
serves the whole built-in catalog instead of two contradicting lines;
a missing key is worded beside its dot.
The provider-card slot now renders before the editor in the setup card
and the add card, as it already did in a provider row, so the action
row ends every card.
The Code review page's detail shows Open on the code host, Copy link, and
Refresh status as three icon buttons after the merge action; a narrow detail
folds them into the More menu as before. The merge action also turns the
code host's automatic merge on, shows that it is on with its cancellation,
and names why the host would not merge.
- forge-github: snapshots carry `autoMerge` from `viewerCanEnableAutoMerge`,
`viewerCanDisableAutoMerge`, and `autoMergeRequest`; `setAutoMerge` sends
`enablePullRequestAutoMerge` with the confirmed head or
`disablePullRequestAutoMerge`. A base branch with a merge queue offers none.
- forge-gitlab: snapshots carry `autoMerge` from `autoMergeEnabled` and the
available strategies; `setAutoMerge` accepts with the strategy that waits
for every merge check, or posts `cancel_auto_merge`. Merge trains offer
none.
- client-ui-forge (Host): `forgePanel.setAutoMerge` and
`forgePanel.reviewSetAutoMerge`.
- client-ui-forge (Client): the opening actions carry the mark of the
provider's forge family and name the code host instead of the browser, on
the review page, the Session panel card, the changes view, and review
threads. While a change request, its description, or its activity is read,
a skeleton of the same layout stands in. The comment field is three lines
tall with a row that names the code host and a primary button. Where the
header is tight, labels fold and the repository name is cut before the
actions wrap.
A snapshot may carry `autoMerge`: whether the host merges the change
request by itself once its merge requirements are met, with which method,
turned on by whom, and whether the signed-in user can turn it on or off.
`ForgeProvider.setAutoMerge` is the optional action that turns it on for a
head commit or off; `ctx.forge.setAutoMerge` forwards it and polls the
change request at once.
The plugin failed at load when the lark-cli executable was absent, which is
the normal state of a source or `link:` install: pnpm denies the
@larksuite/cli install script there. The plugin now loads without the
executable and starts one account check. A check first runs the vendor
install script through ctx.subprocess, shows a cancellable downloading
step, and reports a download that does not finish as not installed with a
Retry button. The entry skill and the CLI path are offered only once the
executable is in place.
Under the description, the summary tab lists the comments, submitted
reviews, commits, and changes of state of a change request, oldest first,
with a field that adds a comment to its conversation.
- forge-github: `readActivity` reads the latest 100 timeline entries in one
GraphQL request; `addComment` posts one REST request. The close a merge
records is left out.
- forge-gitlab: `readActivity` reads the latest 100 notes through GraphQL
and the state changes through REST; system notes map by their recorded
action, and one with no kind of its own shows its sentence. `addComment`
creates one note.
- client-ui-forge (Host): `forgePanel.reviewActivity` returns null for a
provider that reads no activity; `forgePanel.reviewComment` refuses a
blank comment before the host is asked.
- client-ui-forge (Client): runs of commits fold into one line, a review
that left inline comments opens the changes tab, a long comment starts
cut short, and the field keeps its text when the host did not save the
comment. The activity is read again after a comment and when the change
request's update time or reviews change. Copy in eight languages.
`ForgeProvider` gains two optional methods: `readActivity` reads the
comments, submitted reviews, commits, and state changes of a change request,
and `addComment` adds a comment to its conversation. `ctx.forge` forwards
both; a provider without them answers `unsupported` and `failed`.
The Code review page lists the change requests of every host a provider
serves, GitHub and GitLab together, and its filter menu narrows the lists
to one host or one repository on a host.
- forge: `ChangeRequestSummary` drops `closingIssues` and
`closingIssuesTruncated`; a list row no longer names linked issues.
- forge-gitlab: the provider declares `viewer` and implements
`listForViewer`, `countForViewer`, and `readDescription` through GraphQL
`currentUser` connections. "Involving me" is the merge requests the user
reviewed or is assigned to.
- client-ui-forge (Host): each host backs off on its own failed reads, so
one failing host no longer slows the others; a repository scope names its
host and is read on that host only; a host that failed for lack of
sign-in carries the provider's sign-in command.
- client-ui-forge (Client): the list card shows the title on at most two
lines, then repository, number, author, one hint, and a short time; a
host that could not be read shows one notice after the lists with the
sign-in command and a way to the host settings; a section keeps skeleton
rows and holds back its count while a host's first read still runs. The
re-request hint is shortened in eight languages.
`packages/experimental/connectors` (`@deepseek-ai/dsh-connectors`)
becomes `packages/experimental/client-ui-connectors`
(`@deepseek-ai/dsh-client-ui-connectors`), the name form of the Client
UI packages, and its bundle patch row takes the id
`client-ui-connectors`. The name entered in Plugins → Add plugin changes
with it. The tab's slot id, its locale namespace, and the displayed
title stay `connectors` and "Connectors".
The optional and experimental bundle lists, the `apps/cli` dependency,
the Client aggregate, the explicit path aliases, the two gate
registrations, the release family expectation, the recorded
`creation-recommendations` session, the Web e2e cases, the READMEs, and
the Agent Note name the new package. The generated catalogs, the
translation pairings, and the lockfile are regenerated.
#8081 aligned the SDK plan mode text with the Desktop presets and #8772
lists dsh-doc in the SDK profile, so their three exceptions no longer
match a difference.
Tencent Meeting reached master, so the tab lists it third, after WeCom:
its package name, its title and description in the eight shipped
languages (equal to the connector's own locale metadata), and a copy of
its icon.
The bundle preview draws six rows, and the Web golden and the unit
expectations follow the new list.
`packages/experimental/connectors` (`@deepseek-ai/dsh-connectors`) replaces `connectors-bundle` and `client-ui-connectors`. Its bundle patch inserts the package's own row; the Host entry is an empty plugin and the browser entry registers the tab. The package is an ordinary Client plugin with one tsconfig, registered in the root Client aggregate, and its name is recorded in `EXPERIMENTAL_PACKAGE_NAME_EXCEPTIONS`.
The optional and experimental bundle lists, the slot catalog, the release family expectation, the README model-experience allowlist, the generated catalogs, and the Web e2e cases name the new package. The stand-in connectors of the Connectors tab e2e carry a patch row and an empty entry module, because the workspace's connector package of the same name now resolves first as the bundle layer and imports the profile's copy. A unit test calls the Host entry.
The tab lists the official connectors that master ships and uses the Plugins page's existing `install` and `openPackage` callbacks: a missing connector shows Install, and an installed one shows its state and opens its page. Installed connectors keep their cards on Installed and run whether or not the bundle is enabled.
`ui-plugin-manager`, the `official-bundles` README and index, the capability-seam and boot docs, and the Cordis catalog generators return to their master content. `CONNECTOR_BUNDLES`, the `connectors` Host Service, and the `plugins.bundle.switch` slot are removed. The Web e2e installs a missing connector through the page's dialog with Node standing in for pnpm, and the bundle preview shows the new rows.
The GitHub and GitLab rows of the Forge bundle each gain a page on the
Plugins page that lists the hosts the provider serves. Hosts are added and
removed there and saved to the profile patch, and the provider serves the
saved list without a restart. Each saved host shows whether the provider's
CLI is signed in to it, with the sign-in command to copy.
- forge: `ctx.forge.register` returns a handle whose `replace(provider)`
puts another provider of the same family in the registered one's place in
one step; `readiness` reads only the forge family and the host.
- forge-github, forge-gitlab: `hosts` is a volatile Config field that the
schema validates; a changed list replaces the registered provider.
- client-ui-forge: `forgePanel.hostReadiness`, the two row pages, and an
"Add host…" action on the review page for a link whose host no provider
serves. That state's copy is reworded in eight languages.
Run the SDK/Desktop runtime comparison a second time with
agent-team defaultEnabled on both sides, for standard and PTC, and drop
the note that excluded Team mode. Teammate scopes stay outside the
comparison.
Publish the approval decision as an approving review from the approval App
and report unmet conditions in one status comment. The workflow no longer
writes the required `weighted approval` commit status or the decision check
run, so the approval requirement can live in its own branch-ruleset group.
The App's own marked review is excluded from scoring. A draft, a blocking
change request, or a score below the threshold dismisses the App approval
and keeps the comment current.
The retired status-gate Agent Note moves to the archive; the new decision
records the separate ruleset and the App permission it requires.
The worktree service's linked-worktree grant covers the shared Git directory
of a Session opened in a linked checkout, so the panel reports no blocker
there; on Windows the plugin registers nothing and the blocker stays.
The lower branch merged master (release 0.2.2-rc.4) and made the forge
worktree blocker count the policy's additional writable roots.
- The new package's version follows the root, and the upgrade guide this
branch edits moved to `v0.2.2-rc.4` with the lower branch.
- With the worktree service mounted, a Session opened in a linked checkout
holds the grant, so the forge New worktree option is available there. The
forge panel tests expect no blocker once a Session works in its worktree,
and the source-repository policy of a restoration lists the repository's
Git directory before a registered grant; both keep the old expectation on
Windows, where the plugin registers nothing.
- The worktree and forge READMEs and the grant's Agent Note state that the
mounted grant covers the directory on macOS and Linux.
- Generated catalogs, graphs, pairing records, and the lockfile are taken
from the lower branch and regenerated.
The read-only session page is served by an origin inside this process, so its
browser has no cookie of its own; the `/api/remote.mux` upgrade that origin
forwards is admitted only for one. The page origin trades the launch token for
that cookie, and it read the token from `connection.authenticatedUrl`, which the
open-face revert dropped: the upgrade was refused, the page's connection never
opened, and a session link rendered an empty conversation.
Report the URL through the authentication registry instead: a provider may
announce `authenticatedUrl(baseUrl)`, the token provider announces the same
signed URL it contributes to the entry list, and `ctx.connection` returns the
first announcement or the clean URL. No authentication is skipped; the
credential stays inside the process that exchanges it.
A method called through the traceable proxy reads its properties against the
caller's context, so `this.authentication` resolves only for a caller that
injects `connection.authentication`; the consumer here injects `connection`
alone. The registry is captured at construction under a name no nested service
shadows, and the spec asks from such a consumer.
A Session that works in a linked worktree could not run `git add` or
`git commit` under workspace-write: the worktree's index and the repository's
objects live in the repository's Git directory, outside the Session's
workspace root, and the sandbox policy reads no Git layout.
The new plugin `@deepseek-ai/dsh-sandbox-policy-git` registers that directory
through `ctx.sandboxPolicy.registerWritableRoot`. The worktree service depends
on it and mounts it; no bundle patch and no forge file changes.
- The layout is read at Agent creation and after `next()` in the
`working-directory/access` waterfall, which every Host move and the
validation before each model request pass through. Each read replaces the
Session's registration; Agent disposal and plugin unload remove it.
- A directory qualifies only when the Git directory names it as a worktree:
the `.git` file points at `<common>/worktrees/<name>`, whose `commondir`
resolves to `<common>` and whose `gitdir` resolves back to that `.git`
file, and `<common>` neither contains the directory nor lies inside it.
- The grant is the whole Git directory. The plugin registers nothing on
Windows, where process confinement ignores additional writable directories;
its suites are excluded there.
- A read failure grants nothing, warns once per Session and directory, and
never fails the directory operation.
The worktree sandbox tests that pinned the denial now pin the commit and the
creation from a linked checkout without a manual registration. Two worktree
tests that hooked the next `fs.lstat` call hook the service's own path check.
The recorded scenario `session/worktree-commit` pins the policy context the
model sees while it works in the worktree and after it leaves.
The Host folded each canonical mention to @label in the logged message, so the transcript showed plain text instead of a plugin chip. The message now keeps the mention as written.
listBundles returns to its original no-argument signature; the name-filtered read used by plugin references, bundle versions, update, and removal is a private Host method.
Wide chat tables no longer extend left of the message column. The scroll
wrapper starts at the column's left edge and extends right to the
transcript's edge, so the scrollbar starts under the table instead of
beside an empty area. This replaces the earlier approach that moved
tables left into that area.
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
Extend the keyless SDK/Desktop parity check from tool names to tool
schemas, system prompt sections, runtime context names and the session
skill catalog of the first model request, and add a static comparison of
the agent rows each Desktop preset declares against the SDK rows of the
same id read from --dump-config.
Record every current difference in parity-exceptions.ts with a reason;
inconsistencies left unfixed name their tracking issue (#8556, #8557).
The spacer now reads the spare width as a length computed on the wrapper,
so an embedded Conversation, whose width axis uses percentages, keeps its
previous layout. A table wider than the transcript stops 16px in, right of
the turn rail. A style spec pins the compact-markdown spacer reset.
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
A four-column chat table slightly wider than the space right of the
message column was cut off while the space on its left stayed empty.
The lead before the table is now a shrinkable spacer, so the table moves
left only as far as it needs and scrolls only when wider than the
transcript.
Fixes#8552
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
`renderEnableSwitch` returned a React node from an owner prop, which the client rules forbid. The page now registers the `plugins.bundle.switch` Factory with `{ packageName, install? }` props and its navigation store, which gains the activation a switch opens; the Connectors tab renders that Factory in each row.
- list `ctx.connectors` as the key the client-ui-connectors Host entry provides
- name the connector list in the official-bundles source map
- separate Model Experience and Dev Note like the sibling READMEs
- state that a row's copy must follow the connector's own title
The generated config catalog follows the corrected description of media.timeoutMs, the cordis catalog follows the members method and classifies the vendor MembersPage type it returns, and the IM subsystem page carries the generated signature blocks of both.
The Chinese README lacked everything im_members brought: the tool row, tools.maxMembers, the im_members paragraph, the mention sentences of both tool:im guidance blocks and the mentions field of a read message. It carries them now, both sides state the member page limit and that the inbound address rule does not cover DNS rebinding, and the README and subsystem pairings are re-recorded after both sides were brought level.
DELIVERY_ENVELOPE_BYTES was an estimate no test held: the default dispatcher's intent for a message with real Feishu identifiers adds about 240 bytes, which left 16 bytes of the 256 reserved. A boundary case now admits the longest body the intake accepts and measures the intent ImDispatcher records for it, and the reserve is 512 bytes, room for a routing plugin's longer header.
Recovery waited for the first retryIntervalMs tick, a timing guess (the interval may be 1 ms) rather than a readiness signal, and a frame arriving during the load pumped every pending record at once. The intake now holds dispatch, still storing and acknowledging frames, until the Loader that composed the context has no import or lifecycle task left; a context composed by hand releases on the next macrotask.
A platform read the intake stops waiting for at platformTimeoutMs is abandoned, not cancelled, because Bot.getMessage takes no signal; the im-http row had no timeout, so such a request stayed open until the socket ended. The row now sets one, and readWithin says what it does and does not end.
tools.maxMembers bounded only the answer, so a query no member matched read the whole roster of a large chat, one platform request per page, inside one tool call. im_members now reads at most ten pages and reports more: true when it stops there.
im_members is registered unconditionally, so collectToolCatalog harvests it: the catalog spec names it, docs/tool-catalog.md is regenerated, the Chinese catalog carries the same section, and the pairing is re-recorded.
Feishu reads `user_id="all"` as @everyone, and a mode decides on a mention from its type, so a `user` mention carrying that id passed `allowAtAll: false`. Post and card now render such a mention as its `@name` label. Recorded as V84.
A newline at either end of a text run was dropped with the empty pieces a split leaves there, so `first\n**second**\nthird` became `firstsecondthird`; such a newline now stays a break unless its neighbour already ends the line (a `<br>`, a block element, the container edge). Tag aliases are looked up as own properties, so `<constructor>` no longer resolves to `Object` and throws while an inbound post is decoded. `<at user_id="all">` is the `all` mention rather than a user whose id is `all`, so `allowAtAll: false` withholds it.
A satori: resource is downloaded with the application's credentials, so it is no longer 'this deployment's own store': a received message may name only the route of the bot that received it. NAT64, 6to4 and IPv4-compatible addresses are judged by the IPv4 address they carry, and fec0::/10 is refused. The module comment, both READMEs and the subsystem page state again that the address rule does not pin the connection (DNS rebinding), and that the whole download, body included, ends at media.timeoutMs, which is now true. The dripping-body case is pinned by behaviour rather than by the options handed to the transport.
ctx.http clears its timeout timer as soon as the response headers arrive, so a server that answered at once and then dripped the body held the fetch, and with it the admission chain of the shared session, for as long as it liked. The fetcher now joins AbortSignal.timeout with the caller's signal, hands it to the transport, races every body read against it, and rejects with ResourceTimeoutError. V81 records the change; vendor/README.md ends with its newline again.
Markdown carries the content half of the element vocabulary now: `convert.ts` runs mdast -> hast ->
`hast-util-raw` (parse5) -> elements, and the last step reads `elementInfo` / `tagAliases` / `isTag` instead of
switching per construct, so `<u>`, `<spoiler>`, `<span color>`, `<details>`, `<small>`, `<at user_id="ou_x">张三</at>`
and every other registered element reach a mode.
What markdown may express is bounded by the vocabulary, not by taste: an interactive control, a renderer directive or
an inbound wrapper keeps its children as text, so a message cannot hand a reader a control its sender never sent. Two
placement rules keep a rendering in one piece — a self-closing tag whose element holds no children is closed
explicitly (HTML reads the slash as nothing and nests the rest of the line inside it), and a block element written
inside a sentence keeps its text, because `normalize` refuses the whole message for one block in phrasing content; a
lone block element on its own line becomes that block.
A mention addresses a platform user id, so `im_members` reads the chat roster (`Bot.members` over
`GET /im/v1/chats/{id}/members`, bounded by `tools.maxMembers`) and hands back the ready-to-paste markdown for each
person, while `im_read` / `im_history` report the ids a message was mentioned with. No name is ever resolved on the
send path: the model reads the roster and decides.
Verified against the platform in the test group: a post `md` node renders `<u>文本</u>` as underlined text, while a
card markdown component shows the same tag as those literal characters, which is why underlined content resolves to
the post mode (the card mode registers no `u`). Spoiler has no representation in either dialect and degrades to its
text.
listBundles now throws PluginManagerError synchronously when the profile manifest cannot be read. The plugin-reference reader wraps the call in an async function, so the resolver sees a rejection and marks the reference with an error instead of failing the model step. A real-Loader test cites a bundle with a corrupt profile manifest.
installPluginReference takes the plugin manager's Context and registers its agent/pre-step listener there with the real Agent payload, replacing the narrowed agent and host types that existed only for the unit test. The test drives the listener through a real Context and Session, and also checks that it wraps earlier listeners and stops after disposal.
Re-record the same-version acknowledgement against the current persistence chain and regenerate the persistence, config, Cordis, client, module, and event catalogs.
The equivalence check now reads each bundle of the full listing alone, covering protected and catalog-only records, and the plugin manager e2e spy forwards the listing options.
listBundles(options?: ListBundlesOptions) follows the options-object form of listVersions and inspect, so later fields do not change the signature. Client callers pass {} to read every bundle, and the upgrade guide records the new call form.
The Remote gateway requires every declared argument, so a Client call without the new optional names failed with an argument-count error and left the Plugins page and the @ menu empty. Client callers pass undefined to read every bundle, as they do for other optional Remote arguments.
listBundles takes an optional list of names and reads only those bundles, returning the same records the full listing contains. Plugin references and the single-bundle lookups behind bundle details, version lists, updates, and removal pass the one name they need, replacing the private reader added for references.
A cited step read the whole bundle list, about 0.5 ms of synchronous manifest and patch reads per bundle on the event loop. The manager's bundle reader now accepts the names to read, and the resolver passes only the bounded set it describes, so the cost follows the number of citations instead of the profile size: 19.3 ms to 0.7 ms with 40 bundles.
With several sources on one trigger, the default highlight went to whichever source answered first and stayed there, so a fast source could take Enter from the first row. The highlight now waits until every earlier group has settled, keeps a highlight parked on a group that is revalidating, and still never moves once shown. The @ reference golden now lists the Plugins group after Files and Sessions.
Allow the shared grammar subpath in the client bundle purity gate so the Web bundle builds. A failed bundle-list or inventory read now becomes a per-reference error instead of failing the step. The context omits the dependency source and error diagnostics, which can carry URL query tokens or pnpm output, and locates files for bundles the installation ships.
The @ menu offers bundles, but the Host matched Loader entries by module package, so an installed bundle was reported as not installed. The resolver now reads the manager's own bundle list per step, reports the real package path, and joins declared rows to live Loader entries by entry id. The mention grammar moves to a browser-safe ./grammar subpath shared by the Host resolver and the Web client, removing the duplicated copy.
The plugin menu resolves bundle packages rather than individual Loader entries, matching the plugin manager page and avoiding one duplicate row per module. Host context resolution is unchanged.
The composer's @ menu now lists installed plugin packages. A pick inserts a canonical dsh-plugin mention that the Host expands before the model step into bounded package metadata: installed entries, version, scope, package and manifest paths, README path, linked root, and workspace containment. Configuration values stay out of the context.
The transcript keeps the mention as a plugin chip, and the menu displays localized titles while matching every declared language.
The plugin manager's component filter resolved titles and descriptions to the active language before matching, so a row found under one language was missing under another. Rows keep the current-language display while the filter scans every localized title and description, plus row id and module name.
Update the bilingual README and re-record the translation pairing hashes.
Three paths the fourth round added had no case of their own: a frame that arrives after dispose, a chat whose platform read failed, and the platform branch of readMessage, including the chat its answer must belong to.
The bundle README and the composition comment repeated the two directions the adapter no longer has: CardKit streaming for cardStreaming, and allowAtAll enabling @all that is in fact already enabled unless it is explicitly false. Both sit directly above the configuration an operator copies.
Every other vendored package keeps its upstream MIT LICENSE, and vendor/README.md states that rule; the qq port declared MIT without the copyright notice and had no README. Both now match the shape of the lark port, including where its pin is recorded and how to sync it.
Three divergences, logged as V75-V77. A fetch rejected with AbortError covers both a request that never left and one the platform answered before the response was cancelled, and classify claimed published: 'no' for both, which dsh-im reports as failed — whose guidance lets the model send the same content again, duplicating a publication that happened. A cancellation stays fatal and now reports the publication as unknown, keeping a verdict the thrown error carries.
Only publish() classified its failures, so a resource fetch or upload that failed in the pipeline — where no platform message can exist — reached dsh-im as an unknown outcome; Bot.send classifies it now and marks it published: 'no'. prepare() cached a platform key by sha256(src), and a file: source names bytes that change without their URL changing, so a second publication of an edited path re-sent the earlier bytes; a file: source is no longer cached across publications.
The lark config descriptions still described the deleted CardKit entity path and the deleted capability probe, and both are rendered into the settings page: cardStreaming edits the card message in place (false buffers the states into one final PATCH), and allowAtAll already declares the all variant unless it is explicitly false. V28 no longer restates a package set that V29 owns, V30 and V35 attribute the markdown parser to plugin-im-markdown as V66 moved it, and the qq manifest row records the pin's real version and file layout, so a sync ports instead of overwriting the port.
The receipt waited for the send listener to store the own message; a rejection there (a full im_messages, a storage failure) reached dispatch as a failed publication and turned a confirmed send into uncertain, losing the handle the platform had just returned. The local write is now reported on its own and cannot change what the platform did.
An interaction was admitted by the chat record and the rule's users list, but not by the rule's chats list: an operator who narrowed a source left the old chat's members pressing controls the session still owns, /stop included. Inbound frames are re-admitted against the current rules on every delivery, so the controls are now too.
The platform reads of a frame run outside the store chain so a slow read delays only its own chat, but nothing kept the reads of one chat in order: a reply that had to read its quote could be overtaken by the next message, which then took the smaller seq and was dispatched first. The reads of one chat now queue behind each other while other chats stay parallel.
dispose() awaited the store chain and the running pass, but a frame still reading the platform had not reached either, so it wrote into a store that was already closed and lost its acknowledgement. It now waits for every frame it accepted.
An own publication cut down to fit maxInputBytes was measured as UTF-8 text, while the record is stored as JSON, where a newline or a quote takes two bytes and a control character six; the cut is verified against the record it produced. An inbound message is measured with the room its delivery intent needs, so one at the very edge is acknowledged instead of being stored and then refused where nothing can report it.
A pass at the end of the load ran before the plugins that listen to im/message started, so a command a previous process left pending settled as an ordinary message. Recovery now waits for the first tick of the dispatch interval, which starts after the whole composition is mounted.
A load that failed halfway also released the sender, the session records and the store while leaving the hosted agents it opened. They are released first now, because sessions.start() opens them, and the comment states the current constraint instead of the change that introduced it.
The source of an inbound media element is chosen by whoever wrote the message, not by the session that reads it: a file: element names a path of this host, and an http(s) one can name a loopback, private or link-local address whose bytes then reach the model input and the Session log on their own.
ImMediaStore now refuses both before any I/O unless media.source accepts them, and reports the refusal as a skipped item, so a download costs nothing when the deployment did not ask for it. The address rule classifies what one lookup returns and does not pin the connection to it.
The core announces a publication on its `send` event and does not await the
listener, so the record `intake.outbound` writes lands after `bot.send`
resolves. `confirmed()` read the store at that instant and reported a receipt
with no `message` and no `seq` whenever the write had not landed yet — the
receipt a model reads to quote or refer to what it just published.
`outbound` now registers its in-flight announcement by message key before its
first await, `ImIntake.announced(key)` returns that promise, and the sender
awaits it when the store has nothing yet. The service wires the two together;
without an announcement the old behaviour (whatever the store already holds)
stands.
`accept()` did everything in one serialized step: the dedupe check, admission,
and the platform reads a card, a merged forward or a quoted reply need
(`bot.getMessage`). One chain serves every chat, and `receive()` resolves only
after it — the adapter acknowledges the platform frame on that resolution — so a
slow read for one chat held the acknowledgement of every other chat's frames.
The reads and admission now run before the chain (`inspect`), and the chain
keeps what it is for: the dedupe record and the stored message, which stay
single and ordered per key. A frame that races another copy of itself may read
the platform twice; the store still keeps one record. A known event is answered
without entering the chain at all, drift report included.
`createResourceFetcher` handed back `await response.arrayBuffer()`, and `dsh-im`
compared that size with `media.maxBytes` only afterwards: the whole body was
already in memory, so a single message from a chat member decided how much this
process allocates. It now takes an optional `ResourceFetchPolicy.maxBytes`,
refuses a declared `content-length` over the limit before reading, and abandons
the body as soon as the bytes read pass it — raising the new
`ResourceTooLargeError`. Without a policy the body is read in one call, exactly
as upstream does.
`dsh-im` passes `media.maxBytes` into the fetch and keeps reporting the same
`too-large` outcome, which used to be decided after the fact.
`outbound()` stored the tree the platform published, byte for byte, without the
budget the intake applies to received messages. A publication that carries an
inline resource — a file the session sent — therefore parked a multi-megabyte
record in `im_messages`, where it stayed for the whole retention window, was
loaded at startup and had no reader: the chat already has those bytes.
An own publication over `maxInputBytes` now keeps the head of its text and drops
the content tree that carried the resource.
`[Service.init]` opened `im_messages`, then `im_sessions`, then `im_receipts`,
and only the yielded cleanup closed them. A failure after the first open — a
storage error, a domain already open — escaped before the yield, so the domain
facility kept the handle and every later reload of the same profile failed with
`already-open im_messages` even once the real cause was fixed.
The failed load now closes what it opened, in reverse order, and reports a
secondary failure instead of masking the first one.
A source removed from the configuration leaves its chats in `im_messages`, so
`chat()` still resolves one — while `source()` returns nothing. The user
allowlist was applied only `if (source !== undefined)`, so that case fell
through to "no allowlist": every member of the retired chat could still press an
old control, `/stop` included, and cancel a session it no longer belongs to.
The interaction is now refused outright, which is also what re-admitting the
chat would have to do.
`rescope-vendor --check` reported six residues on this branch. One was ours:
`vendor/plugin-im-markdown/package.json` carries the `cordis` keyword the other
vendored manifests already preserve, so the new package joins them.
The other five predate this branch and are on master as well
(`scripts/gen-tool-catalog.ts`, the catalog generated from it, and the two
`fs-observation-policy-default-off` upgrade guides): there the bare `cordis` is
an agent-preset id — "the Web `ptc` and `cordis` presets" — and rewriting it to
`@deepseek-ai/cordis` would name a preset that does not exist. The skip list
already covers that class for a dozen UI and creation-recommendation files; the
same five paths join it, still scoped to the one identifier so any other
pre-rescope token in them keeps failing the check.
The resource paragraph in this package and on the subsystem page described a
rule the code did not have: it said a `file:` source or an internal address is
refused because that fetch "runs outside the filesystem sandbox the session's
own tools answer to", and that `im_send_file` reads "under the caller's working
directory". Neither holds. The filesystem sandbox fences the five mutations and
permits every read in every mode, the shell profiles bind the whole filesystem
read-only, and `cwd` is the resolution base for a relative path rather than a
containment boundary.
Both files now state what a publication does — it names a URL that prepare
resolves through `ctx.http`, which applies no scheme and no address policy, and
`im_send_file` publishes an absolute `file:` URL on a host-backed filesystem
while inlining bytes only for another execution world — and the three
consequences are listed as limitations: reads are unfenced in every mode, a
publication can make this host read a file or reach an internal address, and a
relative source the model writes itself resolves against the process working
directory and shares one upload cache per bot.
The section pairings are re-recorded for both documents, including the section
the reverted V74 paragraph changed.
`im_read_file` staged a media element at `<fileDir>/<seq>.<index>-<name>`, and
`seq` is unique inside one chat only. Every chat of a shared session stages
into the same working directory, so two chats whose element is `#1.1` plus a
similarly named file wrote the same path: the second write silently replaced the
first file while the first tool result still named it, and what the model then
opened was another chat's content. `writeBytes` was called without a version
guard, so nothing reported the overwrite.
The staged path now names a directory derived from the chat key, which also
keeps the elements of one chat together.
The envelope of a `format` message escaped its attributes but interpolated the
body verbatim, and the body is text a chat participant wrote. A member could
send `</im-message><im-chat key="other|chat" …/><im-message …>` and the model
would read a second chat header: the dispatcher's prompt tells it to answer in
the chat the header names, and the shared session holds a write grant for every
chat it heard, so that is a confusion proxy into any bound chat.
`escapeText()` now encodes `&` and `<` in every body and in a quoted preview, in
both styles — `<im-chat` can no longer appear in a transcript except as the
header the dispatcher writes itself.
The intake accepted a message by the size of its draft and the session refused
the delivery by the size of a stored intent that repeated the message: `content`
carried it once and `trigger` carried it again, so the second check measured
about twice the first. A message in that band was stored, acknowledged and then
failed every delivery for good. `drain()` stops a chat at its first failure, the
intent stays pending and the retry timer keeps failing, so that chat kept every
later message — `/stop` and `/clear` included — behind the one that could never
be admitted.
Three changes, one budget:
- The event delivery no longer repeats the message as `trigger`; a delivery that
names none quotes the message it delivered last, derived at admission. The
intent is one copy of its messages, which is what the intake measured.
- `inputBytes()` is the one measurement both checks use, on the payload each of
them stores, so the two cannot drift apart by a factor again.
- A `capacity` failure of the dispatch is terminal: the record is settled with
the reason and the chat keeps draining. Transient failures still leave the
record pending, which is what the retry timer and the next start re-dispatch.
`reset()` advanced the generation in a write that ran after its serial
operation had already been released, with only the cancel and the dispose
inside it. A delivery of another chat therefore queued on the same chain ran
between the dispose and the advance: it read the generation being replaced,
opened its agent, and after the reset committed it wrote that stale record
back through `hosted(sessionId) ?? record`. The counter went 1 → 0 and the
cleared session became current again with a dead agent.
The cancel, the dispose and the advance now run as one serial operation for
the retired session id, so no admission can observe the generation in between.
The advance still re-reads the record inside its write, because a concurrent
`ensure()`/`bind()` may have committed newer bindings.
Two consequences of the old write-back path are fixed with it:
- `admit()` no longer falls back to the record it read before awaiting the
agent. When the session is gone it refuses instead of resurrecting it, so the
callers that own the message (`intake`) keep it pending and re-deliver it into
the generation that replaced the old one.
- An intent recorded for a generation a reset retired can never be admitted, so
it is forgotten rather than retried forever, and `deliver()` refuses when its
own intent was dropped by a reset that ran while it was recording. A delivery
whose session is merely unknown — a store this process did not load — still
stays pending, which is what recovery reports.
`im_send_file` read the whole file and inlined it as a base64 `data:` URL,
which is what V74 forced once `file:` was refused: a 10 MiB file became a
13 MiB string, held as bytes, as base64 and again in the delivery and the
stored message. With the fetcher back to its upstream shape a publication may
name a `file:` resource, so the tool now publishes the file's own URL and no
bytes travel through the message, the store or `im_messages`.
A file of another execution world (an SSH workspace) is still read through
`ctx.fs` and inlined, because this host cannot open that path; `send.maxMediaBytes`
bounds that fallback. Whether the world is this host is read from the provider
itself — `processPathFromHostPath(processPath(target))` answers only when the
backend shares the host filesystem.
The guidance sentence that claimed "publishing reads nothing of this host" is
gone: it stopped being true, and it was appended to the read-only shape, which
registers no publishing tool at all.
V74 gave `createResourceFetcher` an accepted-scheme policy and had `bot.ts`
publish with `data:`, `base64:` and `satori:` only, refusing a `file:` path or
an internal address as `RefusedContentError`. Its stated reason was that the
fetch "runs outside the filesystem sandbox the session's own tools answer to",
which does not hold: `SandboxedFileSystem` fences the five mutations and lets
every read through, and the shell profiles bind the whole filesystem read-only
(`bwrap --ro-bind / /`, Landlock `readOnly: ['/']`, Seatbelt `allow default`
plus `deny file-write*`). A session could already read any host file through
`ctx.fs` or `bash`, so the refusal removed no capability — it only forced a
local file to be inlined as base64, which the next change makes unnecessary.
The fetcher returns to its upstream shape: one argument, every scheme `ctx.http`
resolves, no policy type to keep alive.
This reverts 1d0990f4.
`DSH_CONNECTION_OPEN` disables Host authentication for every request that
passes the trust fence (`isLoopbackHostname` reads the Host header, which a
non-browser client can spoof), it changes no IM behaviour, and the pull
request describes itself as touching no client package. It is a deployment
switch a local operator wants outside this change, so the branch keeps the
diff in the working tree instead of shipping it.
This reverts 498b6168, f068df96 and 9e8b1819.
`ImOutputRegistry.select` and `check` were declared `async` without awaiting
anything, so `typescript(require-await)` failed the lint gate on this branch.
Both are synchronous re-emitters: they read the interaction, resolve the
admitted chat and emit.
Drop the needless `async`, keep the failure containment the async form had by
running them through a `guarded` wrapper that logs a throwing listener instead
of letting it escape the emit, and stop awaiting them in the tests.
Add the experimental speech-to-text-deepseek provider, which sends complete
recordings to the DeepSeek One-Shot endpoint with the signed-in account token.
speech-to-text gains automatic provider selection, a shared language preference
and classified failure codes; the voice UI offers sign-in through the new
accountSignIn Client service, and the account service releases tokens to
https://harness.deepseek.com.
Refs #8059
`pnpm run doc-sync` failed on this branch for three reasons, none of them in the
prose added here:
- `ImSelectEvent` and `ImCheckEvent` reached the event declarations with the
interaction routing work but were never added to the catalog's type-link
table, so the generator refused the `im/select` and `im/check` events as
unclassified types. Registered both against `im.md` like every other `Im*`
type.
- The generated cordis surface and the event graph therefore still lacked
`im/check`, `im/select`, `interaction/check` and `interaction/select`, and
carried stale source lines. Regenerated both.
- The `tool:im`, README and subsystem-page prose changed earlier on this branch
without re-recording the translation pairings. Re-recorded with
`verify-translation-pairing --write`; both languages already carried the same
edits.
`pnpm run doc-sync`: 43 passed, 0 failed.
Nothing pinned what the model actually reads from this package: the `tool:im`
prompt section and the seven tool schemas could change without a test noticing,
and one of the sentences had already drifted from the dispatcher prompt.
Add a `model-visible surface` spec that snapshots the schema of every registered
tool and the guidance rendered for each session shape — publishing through
tools, publishing through a registered renderer, read-only, and bound to no
chat. The `<im-chat …>` header keeps its verbatim pins in `dispatcher.spec.ts`.
The guidance also now says that publishing reads nothing of this host: an inline
image in `im_send` / `im_reply` text reaches the chat, and a local file goes
through `im_send_file`. That is the model-side half of the resource refusal.
V28 described the subset as `plugin-im-core`, `plugin-im-adapter-lark`,
`satori-protocol` and `satori-element`, but no `satori-protocol` package exists
in the tree — the protocol module ships inside `plugin-im-core`
(`src/protocol.ts`). The log's own rule is to drop an entry once its divergence
is gone, and a stale name here misdescribes what a sync has to re-apply.
Name the three packages that are actually vendored from that pin and say where
the protocol module lives.
`plugin-im-core` exports a `./testing` subpath pointing at
`lib/types/testing.js`, but the root tsdown build only bundles each package's
`lib/types/{index,startup}.js`, so the testkit module never reached `lib/` and
the `files` list did not include it: the published subpath resolved to a file
that is not in the tarball.
Give the package its own tsdown config with two entries — the runtime
`lib/index.js` and the testkit `lib/testing.js` — and point the export map and
`files` at the emitted testkit. Each entry stays self-contained
(`codeSplitting: false`), so importing the runtime never pulls the testkit.
`publint` now passes for the package instead of reporting missing `lib/` files.
The shared corpus gained a form-controls case (`<form>` with a text field, a
checkbox, a single select, a multiple select and a submit button) with the
interaction routing work, and the Lark goldens were refreshed with it. The QQ
text, markdown and markdown+keyboard goldens still recorded the pre-form corpus,
so their "matches the corpus golden" cases failed against the current head.
Re-recorded with `IM_GOLDENS=update`. The diff is the new `form` case only: QQ
degrades the controls to bracketed text and the checkbox to `☑`, sends the
submit as an `unsupported` button with its unsupport tips, and the aggregate
case picks up the same form text.
`im_send` publishes model-written markdown, and the platform upload path fetched
every resource src through `ctx.http`: the `file:` handler there reads this
host's filesystem and any http(s) target, both outside the sandbox the session's
own tools answer to. A chat participant could therefore have had the bot upload
a host file into the chat, or make the host request an internal address, by
getting `` into a message.
Publications now resolve only the resources their content carries (`data:`,
`base64:`) or the core's own `satori:` references:
`createResourceFetcher` takes an optional accepted-scheme policy, `Bot`'s
prepare passes `PUBLISHABLE_SCHEMES`, and anything else rejects with the new
`RefusedContentError` before any I/O. The default (no policy) keeps resolving
every scheme, which is what `dsh-im`'s inbound media download needs.
`ImSender` reports such a refusal as `failed` with the reason instead of blaming
the platform or claiming an uncertain outcome. A local file still reaches a chat
through `im_send_file`, which reads it under the caller's working directory and
publishes its bytes inline.
Covered by the fetcher policy and `bot.send` cases in
`vendor/plugin-im-core/tests/{resource,bot}.spec.ts` and the status mapping in
`packages/experimental/im/tests/send.spec.ts`; recorded as vendor divergence V74.
`send.maxBytes` was documented as the maximum UTF-8 bytes of one published
text part and defaulted to 30 KB, but nothing in the package read it: the
sender forwards content unchanged, and the only byte bounds in use are
`media.maxBytes`, `send.maxMediaBytes` and `tools.maxReadBytes`. An unused
limit in the operator schema promises a guarantee the host does not make, and
it survives in generated catalogs as if it were enforced.
Remove the field, its default, the README row and the generated catalog
entries, and drop it from the fixtures and the bundle composition snapshot.
Master replaced `BundleInfo.updatable` with the optional `update` field,
which is absent when a bundle cannot be updated, so the store test's
bundle fixture omits it.
(cherry picked from commit de323d7a88c86b74c86df11429451514fb201473)
An installed connector's row now behaves like a card on the Installed
list: hovering highlights the row instead of underlining the name, and
a click anywhere on the row opens the connector's page, while the
switch keeps its own clicks. A missing connector's row has no page to
open, so it no longer highlights on hover.
The keyboard's label fallback ended in attrs.text, which only the input variant carries; express it as link → input → id so a submit button renders like an action instead of failing to compile.
A checker is the one form control the platform reports by itself (action.tag: 'checker', action.checked). input gained id/onChange with CheckEvent, CallbackRegistry a third keyspace, and the card mode gives a checkbox with an id that behavior; a select keeps its behavior for a multiple pick too, and a control with neither a form nor a callback is reported dropped. dsh-im re-emits the toggle as im/check.
The platform fires a multi_select_static callback only when the form's submit button is clicked (its 回调示例 is that button's event, with the picked values in action.form_value[<name>]). The card mode therefore attaches no behavior to a multiple select, reports one outside a <form> as dropped, and the corpus keeps its multiple select inside the form.
An id makes a select report its pick through interaction/select; a name makes it a form field whose value arrives with the submit. At least one is required, and the card mode drops the callback behavior of a control with no id, so a form-only multi-select renders as a plain platform field.
<form>/<input>/<select>/<option> join the vocabulary with input.checkbox, select.multiple and button.submit; the Lark card mode encodes them as form/input/checker/select_static and decodes a pick into interaction/select while form_value lands on ButtonEvent.values. dsh-im re-emits the pick as im/select.
The Connectors bundle declares dsh.bundle.listedByDefault: false, so
neither the main list nor More shows it before it is enabled. Add
plugin enables it by name, as it does Ralph and Session search, and
switching it off hides its card again. The connectors stay off the
card lists, so none of them shows on the Plugins page either until the
bundle is enabled.
The bundle README now describes the tab's switches instead of the
earlier install buttons.
The bundle's detail document is now a one-line feature preview, a
640x300 image in English and Chinese, instead of the developer README.
It shows the Connectors tab with the official connectors' switches and
a custom MCP server; the other six locales use the English document.
Each row shows the connector's brand icon, the same file its bundle
declares, and the switch its card would show on the Installed list,
rendered by the page through renderEnableSwitch. Turning a missing
connector on installs it at the running DSH version and switches it on,
and an installed connector's name opens its page. The status button and
its four dictionary keys are gone.
A plugins.tab entry receives renderEnableSwitch(packageName, install?),
which renders the switch a bundle's card shows, with its progress and
locks. For a bundle the page does not list, turning the switch on installs
the given exact version through the install dialog and switches the bundle
on once installed. Activation guidance now opens on the tab whose switch
turned the bundle on, and its details link returns to that tab; guidance
for a bundle the install dialog switches on stays beside the Installed
list.
The filesystem seam could read bytes but never write them: writeText stores UTF-8 text only, so a consumer holding content it already had - a downloaded attachment - had no way to materialize it inside the execution world.
writeBytes stores the bytes as given through the same atomic staging file and optional intent guard as writeText, and reports the produced version and byte count with no diff basis. fs-local implements it, fs-sandbox fences it with the per-call policy, and fs-ssh carries it to the helper as base64 under that helper's single-frame budget.
im_read_file uses it: a media label resolves to a stored verbatim attachment and the tool stages the bytes at tools.fileDir under the session's working directory, returning a path the model's own file tools can open - including on a remote execution filesystem, where the attachment store's host path is unreachable.
The default-off Connectors bundle adds a Connectors tab to the Plugins page.
The tab lists the official connectors in CONNECTOR_BUNDLES with their titles
and descriptions, installs a missing one at the running DSH version through
the page's install dialog, and opens an installed one's page.
The package's Host entry provides the connectors service while the bundle is
enabled. A connector row that declares inject: [connectors] stays pending
without it, so switching the bundle off stops every connector and switching
it on resumes them, without changing each connector's own enabled state.
The bundle joins OPTIONAL_BUNDLES and EXPERIMENTAL_BUNDLES, so the Plugins
page lists one more official card and the personalized-pages skill catalog
gains its entry; the plugin manager goldens and the creation-recommendations
replay are refreshed accordingly.
CONNECTOR_BUNDLES in dsh-official-bundles names the official connector
bundles in the order the Connectors tab lists them. The Installed tab's
card lists leave them out, so the toolbar's update note does not count
them either; their detail pages still open through openBundle and a tab's
openPackage.
Images were the only media kind the IM host could hand a model: every other element (a document, a voice message, a video) stayed a label such as [文件 #12.2 report.pdf] that nothing could open, although the transport and the resource fetcher already carried its bytes.
Admission now follows the payload: an image still becomes a normalized image block, and every other kind is stored byte-for-byte through attachments.saveFile and appended by format() as a file block, which request assembly projects to the saved read-only path. The new im_read_file tool resolves any label to that same stored file and reports its path in the calling execution world, so a file stays reachable after its message left the delivered window.
The hand-written escaper also ran its '<' rule over inline code spans, where the platform decodes no entity: a path such as \cat <name>\ reached the reader as \<name>\. Text, code spans and fences now go through mdast-util-to-markdown, and the final normalize pass leaves '<' alone.
Measured against live Feishu messages: /messages/{id}/resources/{key} answers 234003 File not in msg for an entry's own id and 200 for the same key through the container the read was made for, so the per-entry satori URL of the previous commit pointed at nothing. A forward of a forward also arrives as the whole tree in one answer - the inner container, then its entries, every message naming its parent in upper_message_id - so the decoder now walks the answer in the platform order and indents a nested forward's entries under a [合并转发 #id] line. im_read by seq and im_read_image now take the same expanding read as im_read by key.
Nothing reaches it since the card mode moved to in-place message edits, and the
entity surface was the only reason for the mode's diff: api/cardkit.ts,
stream.ts, CardPatch/CardKitOp/diffCards, streamingCard, CARD_STREAMING_CONFIG,
maxPatchOps, the card-entity part kind and the entity branch of
editMessagePayload are all gone, so the mode declares patch: never and the bot
has no CardKit handle.
CARD_STREAM_INTERVAL survives as the edit cadence (200 ms against 5 QPS per
message); cardStreaming: false now only selects the buffered final strategy.
A Feishu merged forward reached the model as the bare [forward] reference: the platform returns the entries after the container in the same GET answer and the adapter kept items[0] only, so nothing downstream could ever read past the placeholder. The adapter now keeps every item, fills <forward id> with one line per entry, and the IM host re-reads a reference once - at intake, and again on im_read of a stored one - within maxInputBytes.
CardKit streaming bought nothing for this card: it is republished whole on
every state, so the platform's incremental rendering never had anything to
render. It cost plenty — streaming mode closes ten minutes after it is switched
on and cannot be extended in place, it refuses card callbacks that update the
card, and it makes the card unforwardable. A turn that outlived the window
handed the reader a second bubble.
The card mode now answers the core edit driver, so a card is one interactive
message whose card JSON is replaced with PATCH /im/v1/messages/{message_id}.
Measured against the live platform on one message: 420 edits (120 + 300), none
refused, and the only cap is 5 QPS for that message, which the card mode's
CARD_STREAM_INTERVAL (now 200 ms) stays under.
The CardKit driver and the entity path stay in the tree, unreached, until that
deletion is a commit of its own.
Scheduler.finish treated an elapsed driver budget as a reason to recall the
streamed message and publish the final state as a fresh one. What expires is
the platform's streaming mode, not the message: the Lark driver's own tick
already publishes a full update with streaming off once the 10-minute window
has passed, and close publishes that same update.
A turn that outlived the window therefore handed the reader a second bubble
and recalled the card they were watching. The window now only decides the
fallback: close is attempted first, and a platform refusal still resends with
the same budget violation.
Merge origin/master into feat/im-automation after 18 conflicting files,
all of them documentation. Source packages needed no hand resolution.
Generated references take the regenerated output, not a hand edit:
gen-doc-graphs re-rendered the event producer/consumer matrix and its
Chinese table, gen-module-graph rewrote both module-graph languages with
their pairing record, gen-persistence-catalog rewrote the persistence
catalog pair, the plugin-record catalog, the schema snapshot, and
known-event-types, and gen-tool-catalog rewrote the tool catalog.
Authored pairs were resolved by keeping both sides' facts:
- packages/experimental/README{,.zh}.md keep the three IM rows and drop
the tool-agent-team row, which master moved to the packages/team group.
- The historical-format index was refreshed by
`verify-persistence-formats --write` against the merged schema.
- `verify-translation-pairing --write` re-recorded the changed pairs
(capability-seams, subsystems README, tool catalog, experimental README).
- The tool-catalog spec expectations gained the im_* tools and follow
master's single interrupt_agent / list_agents registrations.
scripts/run-gates.spec.ts keeps the vendor-im-types gate expectation that
this branch registers.
Checks run: typecheck (5 gates), test:docs (21 gates),
verify-translation-pairing, verify-persistence-catalog, verify-module-graph,
verify-tool-catalog, verify-doc-graphs, the tool-catalog and run-gates
specs, and the IM package and vendored IM adapter suites (968 tests).
The `tool:im` section told every hosted session to answer in its own reply text,
while the default dispatcher names `none` and no renderer publishes a turn's
text: the model answered into the Session, the chat stayed silent, and the
sentence contradicted the dispatcher prompt's "answer it with im_reply". The
sentence now depends on the session's `output`: a session whose renderer is
registered is told to answer in its reply text, and every other session is told
that only `im_send`, `im_reply` and `im_send_file` reach the chat. The README
documents both blocks and when each applies.
Installing the repository ran the codegen from `postinstall`, so a cold cache
made every install and CI job download from raw.githubusercontent.com, and any
failure aborted the install. The rendered subset is now committed: install,
build and checks need no network.
`verify:vendor-im` (a hygiene gate) compares the committed files with the
digests recorded when they were generated, and re-renders them only when the
pinned sources are already cached under `.cache/vendor-im/`; a hand edit, a
stale regeneration or another upstream revision still fails. `gen:vendor-im`
keeps the download for a maintainer regenerating from a new pin and records the
new output digests in the same pin file.
The browser-surface paragraph landed in both READMEs with the connection change,
but its pairing record was not re-recorded, so the translation-pairing gate fails
on the branch. Record the section as it stands; no prose changes.
The message contract described an edit and a `button` provenance that no code
produces, the reset event documented the new record as its payload while it
emits the replaced one, the subsystem page still listed a `caps` method and chat
capabilities, and the catalog mapped forty IM type names that do not exist while
missing the ones that do. The dispatcher now exposes `restrict`, so a shared
session can be held to fewer tools, and the package's dependency edges and
locale metadata describe what the package actually does. The generated catalogs
and pairing records follow.
A message over `maxInputBytes` was refused before its event was remembered, so
the platform redelivered a message that can never be accepted; it is now
remembered with its digest and acknowledged, like a drifted redelivery, and the
log says why. A chat also stopped draining at its first dispatch that failed:
the next message of that chat must wait for the one that stays pending instead
of overtaking it. The intake contract documents both.
The platform stream was opened before the operation id was checked and the
receipt reserved, so a conflict or a full store stranded a stream nobody could
close. It is opened after the receipt is written, and the contract now says a
stream is not replayable: any existing operation id is a conflict, whatever its
content. The grants section also states what a publication without a session
means: only the chat's admission gates it, because `writable` is a property of a
binding.
The service ran three promises it never observed, and two writes rebuilt a
record from a copy taken before an await. A rejected `send`/`sweep`/button call
surfaced as an unhandled rejection, which app-boot turns into a fatal exit; each
now logs instead. `admit` and `reset` re-read the session record inside their
write, so a binding another chat committed while an admission awaited the agent
survives, and `touchChat` reads the chat counter inside the serialized job so a
queued put cannot roll it back. `readMessage` refuses a stored message whose
chat is not the one asked for, and a button click must come from a sender the
admitting source allows.
Matching the placeholder string was a guess about one platform's wording. The
message already says what it is: a card decodes to a raw interactive element, so
admission re-reads exactly those messages and leaves every other message alone.
The re-read of an already-stored message goes with it: a message the store holds
is not worth a second platform call.
A card shows its pictures by `image_key`, and the decoder flattened each one into
the `[image]` text reference, so a card's picture was never a media element and
`im_read_image` answered "no media element" for a picture the sender could see.
Walk the keys, emit a real `img` whose `src` is the card-image route, and serve
that route through `GET /im/v1/images/{image_key}`. The platform hands such a key
only to the application that sent the picture (`234008` otherwise), so a card's
own text stays the material every reader gets.
An alert card reaches an API client as `请升级至最新版本客户端,以查看内容`
with no content behind it, so a task asked to look at an alert had nothing to
read: the stored text is that placeholder, `im_read_image` reports no media, and
the turn spends its steps hunting for a message body that was never delivered.
A read with `card_msg_content_type=user_card_content` returns the card as it was
sent (`balance-alerter`, `1 条 CRITICAL`, …), which the adapter already walks into
text. Admission re-reads a placeholder message that way, and `im_read` does the
same for a card the store already holds.
A deployment behind a proxy it trusts has no second party to authenticate: the launch token and the signed cookie authenticate nobody there, and a link opened without one fails at the index with 401. Honour DSH_CONNECTION_OPEN=1 by admitting every fenced request as the owner's browser peer, serving the index without a token, and advertising the clean URL.
Four reads resolved through the wrong address, so a request could be answered
from material that had nothing to do with it.
- `im_read` resolved every reference through the store, so an id this
deployment never received was reported as absent. Read it from the platform
through `ImApi.readMessage`, and store what comes back so the next read is
local.
- A reply's quoted message arrived as a bare id — an id no reader can open.
Fill its text at admission: the store first, the platform otherwise, and keep
the id when neither can show it.
- `ImHistory.before/after` counted chat messages, so a thread's window filled
with other threads and the main timeline. Take the conversation as a `keep`
test, so the limit counts that conversation's own messages.
- A trigger the session cannot write to published the turn into the home chat.
Render nothing rather than deliver another chat's conversation there.
A picture that shared a message with text used to leave the body as its own
`msg_type: 7` message, so an answer mixing the two reached the chat as text,
picture, text — three messages and three passive replies. QQ's markdown
renders `` inline (both dimensions required, `0px` meaning
the source size) and fetches the source itself, so the markdown mode now
keeps the picture where the content put it: `assemble` leaves a placeholder
inside the sentence and `serialize` fills it with the uploaded
`qqbot-media://` reference that `prepare` already resolved for this chat, so a
public URL and a local file take one path. Which mode a message opens in
follows from pricing a moved element — `text` has to lift an inline picture
out of the body, which now costs — while a picture on its own, or text alone,
still ties and keeps the declared order.
Separately, `Scheduler.resend` recalled the streamed message and, when the
platform refused, threw without ever closing it: the last chunk never carried
`input_state: 10`, so the chat showed that message as generating forever. QQ
rejects every `DELETE` of a streamed message (`40061001`), which made this the
normal outcome as soon as an answer re-parsed mid-stream. A stream that cannot
be recalled is now closed on the state it already shows, and the final state
follows as a fresh message.
The implemented notes still described per-chat conversations, task workers,
the one-shot example and both turn renderers as shipped surface, and four of
them appended change-history preambles instead of stating what ships. Rewrite
the stale facts in place -- `defaultDispatch` instead of `config.dispatcher`,
three storage domains instead of four, no `ctx.im.caps`, and no routing,
task or renderer plugin -- drop the preambles, and record the bilingual
sidecars.
The vendor manifest row and the local-modification log record what diverges from
upstream in the IM packages, from the element vocabulary through the adapters.
The architecture, session, storage and fallback notes state why IM admits
externally authored text, hosts one shared session, reports publication
receipts and drops the capability layer.
Co-authored-by: Shigma <shigma10826@gmail.com>
`im_messages`, `im_receipts`, `im_sessions` and the `im` message source
arrive as new storage units, recorded with their schemas and the reader
compatibility review they need.
Config, tool, persistence, module-graph, capability-seam, rescope and
event-producer-consumer catalogs follow the code they are derived from, and the
IM subsystem page describes the shipped surface.
Workspace manifests, TypeScript faces and the lockfile pick up the new packages;
`gen-vendor-im-types` fetches and verifies the pinned Feishu subset during
install, and the catalog generators, workspace-constraint checks and package
README gates learn about the experimental IM packages.
Co-authored-by: Shigma <shigma10826@gmail.com>
The bundle inserts the IM host, the adapters and the command plugin as Host rows
of an existing profile, with no profile and no renderer of its own: an operator
sets `sources` and `defaultDispatch` in a user patch.
Co-authored-by: Shigma <shigma10826@gmail.com>
`/stop`, `/clear`, `/new`, `/status`, `/help` and passthrough
commands such as `/compact` run first in the waterfall, so a command never
reaches the session as model input.
Durable intake (dedupe, admission by `sources`, per-chat `seq`), the
`im/message` waterfall with its per-chat ordering and retry, hosted Agent
sessions with delivery recovery, the `im_*` tools, and outbound publication
receipts. A message that no listener handled reaches the default dispatcher,
which delivers every addressed message to the session shared by all chats.
Co-authored-by: Shigma <shigma10826@gmail.com>
The v2 REST client with self-describing addressing, the JSON gateway state
machine, the inbound decoder and chat-lifecycle events, the text and markdown
modes with their escaper and custom keyboard, the passive-reply windows with
their per-event `msg_seq` budget, and the C2C append stream driver.
The typed REST client, the CardKit entity routes, the tenant token with its
single-flight refresh, the protobuf long connection that ACKs only after intake,
and the two shipping modes: a card (CardKit patch streaming) and a post. The
generated OpenAPI subset is pinned by `scripts/vendor-im/upstream.json`.
One pipeline (normalize → transform → prepare → serialize → sendPayload) serves
every adapter; a mode renders what its registry registers, so no adapter declares
what a chat allows. The core owns the transform engine and its fallback table,
the mode score, `<fallback>` alternatives, the resource cache, the stream
scheduler with its patch/edit/append drivers, the platform error taxonomy, the
session envelope and the offline testkit.
Upstream factories, aliases and the global `JSX` declaration give way to a
typed `ElementMap`/`VariantMap` overlay, the block and inline category
table, the typed `h` factory with its automatic JSX runtime, `normalize()`,
variants, `toText()` and a real mdast + GFM `fromMarkdown()`.
Co-authored-by: Shigma <shigma10826@gmail.com>
The Satori packages IM mounts render through `element`, publish through
`http` and fetch referenced files through `fetch-file`. All three are pinned
by the vendor manifest and rescoped like the rest of `vendor/`.
2026-10-29 13:14:36 +08:00
6033 changed files with 249445 additions and 32191 deletions
@@ -46,7 +46,7 @@ This decision requires cancellation at the tool invocation boundary only. Making
## Verification
[`execution-signal-types.spec.ts`](../../../../packages/core/tools/tests/execution-signal-types.spec.ts) proves the required exact signal types, readonly observer and tool views, mutable-but-required around-dispatch view, and `defineTool()` inference. [`tools.spec.ts`](../../../../packages/core/tools/tests/tools.spec.ts) covers pre-aborted materialization, phase skipping, policy and wrapper races, body invocation classification, caller-signal fusion, error precedence, context retention, and quiescent drainage. [`tool-calls.spec.ts`](../../../../packages/core/agent-loop/tests/tool-calls.spec.ts) and [`contract-regressions.spec.ts`](../../../../packages/core/agent-loop/tests/contract-regressions.spec.ts) cover balanced durable results for undispatched siblings. [`ptc.spec.ts`](../../../../packages/core/tool-executor-ptc/tests/ptc.spec.ts) and first-party integration suites cover explicit forwarding, while [`timeout-policy.spec.ts`](../../../../packages/guard/timeout-policy/tests/timeout-policy.spec.ts) preserves timeout ownership.
[`execution-signal-types.spec.ts`](../../../../packages/core/tools/tests/execution-signal-types.spec.ts) proves the required exact signal types, readonly observer and tool views, mutable-but-required around-dispatch view, and `defineTool()` inference. [`tools.spec.ts`](../../../../packages/core/tools/tests/tools.spec.ts) covers pre-aborted materialization, phase skipping, policy and wrapper races, body invocation classification, caller-signal fusion, error precedence, context retention, and quiescent drainage. [`tool-calls.spec.ts`](../../../../packages/core/agent-loop/tests/tool-calls.spec.ts) and [`contract-regressions.spec.ts`](../../../../packages/core/agent-loop/tests/contract-regressions.spec.ts) cover balanced durable results for undispatched siblings. [`ptc.spec.ts`](../../../../packages/core/tool-registry-ptc/tests/ptc.spec.ts) and first-party integration suites cover explicit forwarding, while [`timeout-policy.spec.ts`](../../../../packages/guard/timeout-policy/tests/timeout-policy.spec.ts) preserves timeout ownership.
No registry test can prove that arbitrary third-party same-process code observes the signal or stops in bounded time. Capability tests continue to prove cancellation and quiescence at the boundary that owns each side effect.
@@ -34,7 +34,7 @@ The web kernel remains framework-free and imports no dynamic package value. Modu
The browser mirrors the host's division of labor. `dsh-client-modules` (`ClientModuleSystem`) takes the module-system seat that Node's internal ESM loader holds host-side; the same vendored `@cordisjs/plugin-loader` keeps the governance seat on both sides. The line between them in one sentence: **the module system owns module identity and bytes — how code arrives, registers, and becomes an exports; the Loader owns plugin lifecycle — when a plugin mounts, what it waits for, and how it is torn down.**
`ClientModuleSystem` is a lazy CJS table. Executing a bundle only **registers** its factory — an entry calls `window.__ModuleLoader__.load({ id, factory })`, while a chunk also supplies its generated filename — and nothing else happens. JavaScript module body side effects live inside the factory closure and run at materialization: the first `require`/import of that id, memoized after that. Import and prefetch recursively register declared dynamic requests before their consumer; a factory then materializes any registered-but-unmaterialized request synchronously. The callable `require` resolves synchronous module-table requests; its `require.async` operation returns a Promise that loads, registers, and materializes one package-local chunk. The shared tsdown preset compiles source `import()` expressions for package-local chunks to that distinct operation. The supported output is self-contained: an entry or chunk cannot synchronously require another relative `client*.js` output. The table resolves through a fixed branch order: seed word → memoized record → graph-row classic-script registration → registered-factory materialization → loud throw. The modules factory is the bootstrap exception: the HTML facade materializes it first, and construction places those same exports directly in the memoized table. That final throw is the runtime mirror of the build-time purity gate. The system also keeps per-module bookkeeping — owner identity, optional opaque metadata producers, and observed require edges — and exposes the two verbs HMR needs: `prefetch(id)` (register the requested dynamic factories and the row's own factory; concurrent arrivals share one task) and `invalidate(id)` (advance the owner generation and drop a non-bootstrap package's entry and chunk factories and records so the next arrival reloads them). A chunk request captured under an older generation cannot populate the new generation.
`ClientModuleSystem` is a lazy CJS table. Executing a bundle only **registers** its factory — an entry calls `window.__ModuleLoader__.load({ id, factory })`, while a chunk also supplies its generated filename — and nothing else happens. JavaScript module body side effects live inside the factory closure and run at materialization: the first `require`/import of that id, memoized after that. Import and prefetch recursively register declared dynamic requests before their consumer; a factory then materializes any registered-but-unmaterialized request synchronously. The callable `require` resolves synchronous module-table requests; its `require.async` operation returns a Promise that loads, registers, and materializes one package-local chunk. The shared tsdown preset compiles source `import()` expressions for package-local chunks to that distinct operation. A factory may also synchronously require a chunk of its own package that is already registered; the chunk registration and request rules are in [package-local chunk dependencies](2026-11-26-package-local-chunk-dependencies.md). The table resolves through a fixed branch order: seed word → memoized record → graph-row classic-script registration → registered-factory materialization → loud throw. The modules factory is the bootstrap exception: the HTML facade materializes it first, and construction places those same exports directly in the memoized table. That final throw is the runtime mirror of the build-time purity gate. The system also keeps per-module bookkeeping — owner identity, optional opaque metadata producers, and observed require edges — and exposes the two verbs HMR needs: `prefetch(id)` (register the requested dynamic factories and the row's own factory; concurrent arrivals share one task) and `invalidate(id)` (advance the owner generation and drop a non-bootstrap package's entry and chunk factories and records so the next arrival reloads them). A chunk request captured under an older generation cannot populate the new generation.
The vendored Loader consumes the module system through its `internal` contract — the only call site is `tree.import` — and owns everything entry-shaped: entry creation, fiber activation through cordis service waiting (PENDING until injected services exist, cascading when a service is provided), update/refresh, teardown. The governance code is byte-identical to the host side, per vendor policy. Browserization is compile-time mapping in the shell's vite config: a `node:module` stub alias plus `process.*` defines make `ModuleLoader.fromInternal()` return undefined — exactly the empty slot the shell fills. The module system mounts as `ctx.modules`.
Package artifact publication remains explicit opt-in through package exports. When invoked, `WorkspaceTypertGenerator` validates that each requested host face exposes the user-facing subpath `package/typert` from the root artifact `package/lib/typert.host.{js,d.ts}`, or that each requested client face exposes `package/client/typert` from `package/lib/typert.client.{js,d.ts}`; it never edits those exports. The later [Typert Remote design](2026-08-02-typert-remote-method-calls.md) adds a whole-workspace Host contract pass to root build, typecheck, lint, and documentation typecheck. For opted-in Host packages, that pass emits both local reflection and strict Host-for-Client `/remote` contracts before consumers resolve them. Generated local declarations keep `TYPERT` typed as `unknown`, so business packages do not depend on the registry.
At build time, `CordisCatalogProjector` consumes the analyzed `FaceModel` and `TypeGraph` once to generate `docs/cordis-catalog/events.md`, `docs/cordis-catalog/services.md`, and the static `SERVICE_API`, `EVENT_API`, and `TYPE_API` catalog committed for `tool-cordis`. `tool-cordis` reads that static catalog and has no runtime dependency on `ctx.typert`. [`dsh-typert-loader`](../../../../packages/typert/loader/README.md) and the registry remain an independent runtime path: the loader follows Cordis Loader entry lifecycle events, imports an explicitly published `./typert` host artifact, and registers it through `ctx.typert`; neither component supplies the current `cordis_inspect` catalog.
At build time, `CordisCatalogProjector` consumes the analyzed `FaceModel` and `TypeGraph` once to generate `docs/cordis-catalog/events.md`, `docs/cordis-catalog/services.md`, and the static `SERVICE_API`, `EVENT_API`, and `TYPE_API` catalog committed for the `cordis-host-runner` inspect providers. Those providers read that static catalog and have no runtime dependency on `ctx.typert`. [`dsh-typert-loader`](../../../../packages/typert/loader/README.md) and the registry remain an independent runtime path: the loader follows Cordis Loader entry lifecycle events, imports an explicitly published `./typert` host artifact, and registers it through `ctx.typert`; neither component supplies the current `cordis_inspect` catalog.
## Verification contract
@@ -34,7 +34,7 @@ For every property in `SyntaxZoo`, the TypeScript printer normalizes the source
Boundary cases pin explicit package imports within and across faces, cross-face named re-exports, exact export aliases, qualified `import()` links, and the External classification of global `@types` declarations; they reject TypeScript diagnostics originating in package-owned files, relative-path boundary crossings, references outside `package.json#exports`, and cross-face namespace re-exports without a model target. Interface declaration merging explicitly preserves every authored part; other merges that cannot be represented losslessly fail.
For each supported node kind and literal category, Zod emitter tests run both successful and failing parses; for each unsupported kind, they assert an explicit `TypertEmitError`. Emitter fixtures snapshot generated Zod JavaScript and `.d.ts` text, execute each schema factory, and typecheck the declarations. `dsh-typert-registry` tests pin atomic registration, first-use materialization, successful-result caching, retry after factory failure, queries, JSON Schema, and effect disposal; `dsh-typert-loader` tests also prove delayed mounting, unloading, and disposal while a dynamic import remains pending. A real `dsh-tools` vertical slice generates a contribution from the model, loads it through the runtime registry, and compares its service, event, and related-type records with the committed static `SERVICE_API`, `EVENT_API`, and `TYPE_API`. A full-workspace projector test regenerates the two Cordis catalog documents and the `tool-cordis` API catalog and requires all three texts to be byte-for-byte identical to the committed artifacts.
For each supported node kind and literal category, Zod emitter tests run both successful and failing parses; for each unsupported kind, they assert an explicit `TypertEmitError`. Emitter fixtures snapshot generated Zod JavaScript and `.d.ts` text, execute each schema factory, and typecheck the declarations. `dsh-typert-registry` tests pin atomic registration, first-use materialization, successful-result caching, retry after factory failure, queries, JSON Schema, and effect disposal; `dsh-typert-loader` tests also prove delayed mounting, unloading, and disposal while a dynamic import remains pending. A real `dsh-tools` vertical slice generates a contribution from the model, loads it through the runtime registry, and compares its service, event, and related-type records with the committed static `SERVICE_API`, `EVENT_API`, and `TYPE_API`. A full-workspace projector test regenerates the two Cordis catalog documents and the `cordis-host-runner` API catalog and requires all three texts to be byte-for-byte identical to the committed artifacts.
## Alternatives considered
@@ -50,6 +50,6 @@ For each supported node kind and literal category, Zod emitter tests run both su
New generation targets and static checks can reuse the same TypeGraph, and business categories can extend PackageModel without parsing the AST again. Preserving pre-evaluation types and independent faces makes the model more complex than a flattened schema; emitters must explicitly declare their supported scope and fail on missing capabilities.
Explicit package opt-in keeps artifact publication and exports under package ownership. Repository orchestration may still run the whole-workspace Host contract pass for every opted-in package; that pass remains owned by the later Remote Gateway Agent Note. The static Cordis catalogs remain reproducible from the canonical model without coupling `tool-cordis` to runtime registry state. `ctx.typert` reflects only artifacts mounted in the current runtime, and unloading does not control Zod instances that consumers retain after materializing them.
Explicit package opt-in keeps artifact publication and exports under package ownership. Repository orchestration may still run the whole-workspace Host contract pass for every opted-in package; that pass remains owned by the later Remote Gateway Agent Note. The static Cordis catalogs remain reproducible from the canonical model without coupling the inspect providers to runtime registry state. `ctx.typert` reflects only artifacts mounted in the current runtime, and unloading does not control Zod instances that consumers retain after materializing them.
Ordinary Host and Remote artifacts reuse this model to emit one static method spec per endpoint. Each parameter has normal `codec` and `strictCodec` variants derived from the same checker-resolved type model; neither analysis nor the model carries a per-method input policy. A pure factory returns a lazy info instance whose direct method index and descriptor list share objects; the existing Registry retains those descriptors, while `TYPERT_REMOTE.methods` supplies exact static types. The [unified Typert/Remote metadata note](../../proposed/architecture/2026-09-20-unified-typert-remote-metadata.md) records this delivery mechanism and the incomplete downstream adaptation. Declaration and face-isolation rules remain unchanged; separate Programs and processes do not share object identity.
@@ -22,17 +22,18 @@ Shared UI libraries still expose synchronous TypeScript and React values to many
| --- | --- | --- | --- |
| Web compilation shell | `apps/web` | Owns `index.html`, Vite configuration, dist chunks, and static assets | Assembles final browser output from built package exports |
| Startup kernel | `packages/client/web` | Owns the plain-DOM boot page, module-system wiring, Cordis settlement, and renderer handoff | `clientShell` ESM entries; no `dsh.client` row |
| Static assembly libraries | Cordis, `ui-primitives`, `ui-slots` | Supply shared module identities and direct value APIs | Manifest `lib/index.js`, shared imports assembled by Vite; not Loader entries |
| Shell-seeded modules | React, Cordis, and selected third-party libraries | Supply shared module identities | Bundled by Vite and seeded into the module table; not Loader entries |
| Static assembly library | `client-store` | Supplies a shared module identity and direct value APIs | Manifest `lib/index.js`, shared imports assembled by Vite, seeded into the module table; not a Loader entry |
| Module bootstrap | `packages/client/modules` | Supplies the client module table and its Cordis wrapper | Dynamic package with one ordinary `lib/client.js`; the host delivers its factory early |
| Dynamic client packages | connection, `ui-renderer`, theme, and feature plugins | Participate through Cordis services, slots, and effects | Declare `dsh.client`, emit self-registering `lib/client.js`, and remain host-graph entries |
| Dynamic client packages | connection, `ui-renderer`, theme, feature plugins, `ui-slots`, `ui-primitives`, and `ui-dockkit` | Participate through Cordis services, slots, and effects; the `/client` value exports of the last three are a historical exception that will be reduced over time | Declare `dsh.client`, emit self-registering `lib/client.js`, and remain host-graph entries |
`packages/client/web` keeps Cordis as matching peer and development dependencies and uses modules and static UI packages as development compilation inputs. `apps/web` consumes built package exports rather than aliases into workspace source.
`packages/client/web` keeps Cordis as matching peer and development dependencies and uses modules and `client-store` as development compilation inputs. `apps/web` consumes built package exports rather than aliases into workspace source.
The `staticLinked` preset emits `lib/index.js` as ordinary ESM that keeps every bare import and dynamic import for Vite to resolve, deduplicate, and split, and adds one export, `__$dsh_client_module_manifest`, whose factory returns the library's own exports. A factory that runs the library body later would defer nothing useful: the third-party imports already evaluate when the module loads, and the shell registers these libraries at startup. CSS imports become deferred metadata resources. The [module metadata decision](2026-11-05-client-module-metadata.md) defines resource ownership; static libraries do not adopt dynamic plugins' private-dependency bundling policy.
The `staticLinked` preset emits `lib/index.js` as ordinary ESM that keeps every bare import and dynamic import for Vite to resolve, deduplicate, and split, and adds one export, `__$dsh_client_module_manifest`, whose factory returns the library's own exports. A factory that runs the library body later would defer nothing useful: the third-party imports already evaluate when the module loads, and the shell registers these libraries at startup. CSS imports become deferred metadata resources. The [module metadata decision](2026-11-05-client-module-metadata.md) defines resource ownership; static libraries do not adopt dynamic plugins' private-dependency bundling policy.`client-store` uses the preset.
### Shared module requests
Dynamic browser bundles implicitly externalize the common baseline: `PLATFORM_MODULES` names shell-seeded React, Cordis, selected third-party libraries, and static UI identities, while `PRELOADED_CLIENT_EXTERNALS` is reserved for a dynamic identity that must arrive before shell boot and is currently empty. A package uses `dsh.client.external` only for an exact non-baseline value request. Type-only imports are erased and create no request; non-baseline third-party implementation libraries remain private bundle contents. Shared third-party libraries use the shell's declared versions without per-plugin version negotiation; promotion into the baseline requires a measured reduction across the shell and shipped plugin bundles.
Dynamic browser bundles implicitly externalize the common baseline ([shared module table](../../../../packages/client/web/README.md#the-shared-module-table)): React, Cordis, selected third-party libraries, and `client-store`, which the shell seeds, and `ui-slots`, `ui-primitives`, and `ui-dockkit`, whose `immediately` rows register before other plugins, while `PRELOADED_CLIENT_EXTERNALS` is reserved for a dynamic identity that must arrive before shell boot and is currently empty. A package uses `dsh.client.external` only for an exact non-baseline value request. Type-only imports are erased and create no request; non-baseline third-party implementation libraries remain private bundle contents. Shared third-party libraries use the shell's declared versions without per-plugin version negotiation; promotion into the baseline requires a measured reduction across the shell and shipped plugin bundles.
A request has exactly two suppliers:
@@ -69,7 +70,7 @@ Ordinary installed libraries remain `dependencies`: a dynamic build may bundle a
## Alternatives considered
**Convert every client package into a dynamic plugin immediately.**`ui-primitives` and `ui-slots` still provide synchronous values without independent service or slot lifecycles; a manifest declaration alone would not remove those imports.
**Convert every client package into a dynamic plugin immediately.**`ui-primitives` and `ui-slots` still provide synchronous values without independent service or slot lifecycles; a manifest declaration alone would not remove those imports.`ui-slots`, `ui-primitives`, and `ui-dockkit` are dynamic plugin packages with `immediately: true` instead, and their value exports remain, a historical exception that will be reduced over time ([decision](2026-11-27-client-packages-as-immediately-dynamic-plugins.md)).
**Generate a separate `client-static.js` for modules.** The package remains a dynamic graph row and Cordis plugin; only its factory arrival is early. A second artifact would encode host policy in a filename and create two runtime products from one source.
@@ -87,4 +88,4 @@ The startup protocol depends on the modules package id, and modules must remain
The shell consumes built `lib/` products, so source and browser artifacts can drift until the relevant build or watcher runs. Typechecking source alone does not prove the served application uses the same code.
The two static UI libraries remain deliberate exceptions. Converting either one to a dynamic package requires moving all value consumers to services or slots and removing its identity from the static seed in the same change.
`client-store` is the statically linked Client library, and the shell seeds it; a store service would be a separate package, not a conversion of this one. `ui-slots`, `ui-primitives`, and `ui-dockkit` are dynamic plugin packages with `immediately: true` ([decision](2026-11-27-client-packages-as-immediately-dynamic-plugins.md)).
@@ -24,7 +24,7 @@ Electron owns the reserved profile at `.dsh/profiles/desktop`. The [bundled-runt
One Desktop release number identifies the Electron artifact and its exact `@deepseek-ai/dsh` and `@deepseek-ai/dsh-desktop-host` dependencies. A release cannot select a different core version at build or runtime. Updating dsh therefore requires a new Electron release even when shell code is unchanged.
The Desktop Host exposes the shared Web plugin manager for its reserved profile and supplies bundled pnpm through launcher facts. The CLI reserves every case variant of the `desktop` name and rejects boot, config-dump, and plugin-management requests for it. Electron acquires its process-lifetime single-instance lock before profile recovery or Host startup; later launches focus or recreate the primary window without touching profile state.
The Desktop Host exposes the shared Web plugin manager for its reserved profile and supplies bundled pnpm through launcher facts. The CLI reserves every case variant of the `desktop` name and rejects boot, config-dump, and plugin-management requests for it. Electron acquires its process-lifetime single-instance lock, scoped to its `userData` directory, before profile recovery or Host startup; later launches with the same `userData` focus or recreate the primary window without touching profile state. Applications with different `userData`, such as the installed application and `dev:desktop`, can run together on one profile.
## Ownership
@@ -63,7 +63,7 @@ Update confirmations use the shell static origin because they must remain availa
The shared Web plugin manager owns profile package operations. Electron retains startup preparation and native recovery; the [Web wrapper decision](2026-09-10-desktop-web-wrapper.md) owns this separation.
The process-lifetime Electron lock is the authoritative Desktop owner. Profile preparation and native recovery use an exclusive lock recording the Electron PID; a live owner blocks a competing operation, while a stale PID can be recovered. Web package operations use the shared plugin manager’s locking.
The process-lifetime Electron lock is the authoritative owner among Desktop processes that share one `userData` directory. Profile preparation and native recovery use an exclusive lock recording the Electron PID; a live owner blocks a competing operation, while a stale PID can be recovered. Web package operations use the shared plugin manager’s locking.
Core materialization, first launch, plugin installation, and shared-module resolution follow the [bundled-runtime decision](2026-09-08-desktop-bundled-runtime-and-external-plugins.md). The actual Host composes enabled desktop plugins contributing `dsh.client` code when it starts.
@@ -73,7 +73,7 @@ Electron update uses one `electron-updater` release stream and signed `electron-
The [immediate-window reference](../../../../apps/desktop/README.md) owns the local loading page, direct Host startup, and recovery in the main window. Profile reconciliation follows the [bundled-runtime decision](2026-09-08-desktop-bundled-runtime-and-external-plugins.md).
`DSH_DESKTOP_AUTO_UPDATE_ENV` selects the test deployment by default or the production deployment for both the target-specific generic-provider URL and COS destination. Release automation supplies the test HTTPS origin through `DOWNLOAD_TEST_ORIGIN` and each deployment's bucket through `DOWNLOAD_TEST_COS_BUCKET` or `DOWNLOAD_PROD_COS_BUCKET`; keeping mutable test routing and COS storage identities out of source lets deployment infrastructure change without a code release, while the public production origin remains fixed. Packaging resolves only the public updater URL, disables electron-builder publishing, removes every COS credential field from its subprocess environment, and writes a completion record only after electron-builder and every signing or notarization hook succeeds. Target upload additionally requires the selected bucket, then requires the completion record, root dsh version, Desktop version, channel-selected metadata, artifact names, sizes, and SHA-512 values to agree before it reads the selected credentials or sends data. It uploads immutable versioned updater payloads and any separate blockmaps before replacing the channel metadata emitted by electron-builder, and it never deletes historical objects. The selected channel determines the metadata name: `stable.yml` or `nightly.yml`, with `-mac` before the extension for macOS; version suffixes do not select the channel. NSIS embeds its blockmap in the signed executable; the macOS ZIP carries a separate blockmap. Both let electron-updater download changed blocks when supported, while application replacement and the local pnpm package operation remain separate operations.
`DSH_DESKTOP_AUTO_UPDATE_ENV` selects the test deployment by default or the production deployment for both the target-specific generic-provider URL and COS destination. Release automation supplies the test HTTPS origin through `DOWNLOAD_TEST_ORIGIN` and each deployment's bucket through `DOWNLOAD_TEST_COS_BUCKET` or `DOWNLOAD_PROD_COS_BUCKET`; keeping mutable test routing and COS storage identities out of source lets deployment infrastructure change without a code release, while the public production origin remains fixed. Packaging resolves only the public updater URL, disables electron-builder publishing, removes every COS credential field from its subprocess environment, and writes a completion record only after electron-builder and every signing or notarization hook succeeds. Target upload additionally requires the selected bucket, then requires the completion record, root dsh version, Desktop version, channel-selected metadata, artifact names, sizes, and SHA-512 values to agree before it reads the selected credentials or sends data. It uploads immutable versioned updater payloads and any separate blockmaps before replacing the channel metadata emitted by electron-builder, and it never deletes historical objects. The selected channel determines the metadata name: `stable.yml` or `nightly.yml`, with `-mac` before the extension for macOS; version suffixes do not select the channel. NSIS embeds its blockmap in the signed executable; the macOS ZIP carries a separate blockmap. Both let electron-updater download changed blocks when supported, while application replacement and the local pnpm package operation remain separate operations; [channel convergence and decoupled publishing](2026-11-25-desktop-channel-convergence-and-decoupled-publishing.md) owns default `stable` locking, `settings.json` version `"1"`, feed source headers, and multi-channel CI delivery from one retained package.
Test releases require `DOWNLOAD_TEST_RELEASE_ID` from the platform dotenv file. Their feeds and binaries share `dsh-desk/<release-id>/`; production retains its fixed directories. The ID is part of the packaged update URL, so upload rejects a different ID. Internal distribution can supply a new installer after rotation; installed clients retain their existing feed. Random directories reduce guessing but provide no authorization for link holders. The [release configuration](../../../../apps/desktop/publishing/README.md#upload-updates) defines generation and reuse.
@@ -106,7 +106,7 @@ Architecture-specific builds report actual component-level compressed and instal
| Package state | Electron RunAsNode executes immutable core resources; bundled pnpm modifies only the external plugin graph in the Desktop profile. |
| Qualification | macOS packaging requires the configured company identity and notary credentials, verifies every native runtime file before inventory generation, verifies the completed application signature, and requires notarization plus Gatekeeper acceptance for both the application and DMG. Windows packaging requires the configured public certificate, SafeNet private-key container, Token Password, and SignTool, and verifies every produced signature. Update hosting, previous-version installed-artifact tests, and platform GUI recordings remain release-environment gates. |
`dev:desktop` builds the current workspace, projects the built CLI and private Desktop Host packages plus their dependency links into a disposable project, uses an isolated Harness home, opens the Main, Renderer, and Host debuggers, and starts unpackaged Electron without preparing release resources. The development runtime supplies workspace links to a separate plugin profile; plugin management and recovery use the same flow as packaged applications. Fixed macOS arm64, macOS x64, and Windows x64 package commands pass one target through runtime preparation, dsh preparation, and electron-builder; each also has an unpacked-directory variant for release-path verification before installer generation.
`dev:desktop` builds the current workspace, projects the built CLI and private Desktop Host packages plus their dependency links into a disposable project, uses the normal Harness home, opens the Main, Renderer, and Host debuggers, and starts unpackaged Electron without preparing release resources. The disposable project supplies the workspace links; the `$DSH_HOME/profiles/desktop` plugin profile, its plugin management and recovery are shared with the installed application, so a workspace build can install plugins or write data formats that the installed version rejects. Fixed macOS arm64, macOS x64, and Windows x64 package commands pass one target through runtime preparation, dsh preparation, and electron-builder; each also has an unpacked-directory variant for release-path verification before installer generation.
@@ -8,15 +8,15 @@ English | [中文](2026-09-05-workspace-files-service.zh.md)
The Web client needs to look at files inside a session's workspace from a browser that may not be on the Host machine: a file the agent produced, the path a `read` tool row names, later a file tree and previews of files that are neither small nor text. The one endpoint that read a workspace file over the wire lived on the Session Controller as `workspace-file.ts`, beside session lifecycle it had nothing to do with. It returned a whole file under one total byte cap, so a large log could not be looked at even in part and a binary could not be looked at at all; it had no `stat`, no listing, and no change signal, so a preview could not learn that the agent had rewritten the file without re-reading it; and its result named the file by a Host `url`, a spelling nothing on the Client used as an address.
Two constraints frame the service. File reads through `ctx.fs` use the Session's composed filesystem backend, whose read authority may extend outside the workspace, while directory-tree and change-feed consumers are workspace-rooted. The service preserves the backend's read decisions for regular files while enforcing file-kind and bounded-buffer checks; `list` and `changes`retain workspace containment. And `dsh-fs` exposed one raw-byte read, `readBytes(target, signal, maxBytes)`, which refuses any file longer than its cap: correct for an image the model ingests whole, useless for one window of a large file.
Two constraints frame the service. File reads through `ctx.fs` use the Session's composed filesystem backend, whose read authority may extend outside the workspace, while directory-tree and change-feed consumers are workspace-rooted. The service preserves the backend's read decisions for regular files while enforcing file-kind and bounded-buffer checks; `list` and `changes`apply a workspace check to directories. And `dsh-fs` exposed one raw-byte read, `readBytes(target, signal, maxBytes)`, which refuses any file longer than its cap: correct for an image the model ingests whole, useless for one window of a large file.
## Decision
`packages/api/workspace-files` (`@deepseek-ai/dsh-api-workspace-files`) owns the Host `ctx.workspaceFiles` service, the `workspaceFiles` Remote namespace, and the Client `file` provider that turns `stat` and `changes` into live metadata for the [resource model](2026-09-05-client-resource-model.md); [dual-face packaging](../../../../packages/api/workspace-files/README.md) governs their package organization. File methods resolve relative paths from the workspace root but inherit the Session filesystem backend's read authority; `list` and `changes`remain workspace-scoped. The [workspace file read authority](2026-09-09-workspace-file-read-authority.md) owns this split and its security consequences. Results name files by their absolute path in the filesystem's execution world, and content is bounded by page, byte window, or complete-file cap. The byte window rides on a new `dsh-fs` seam, `FileSystem.readByteRange`, implemented by every provider. The Session Controller carries no workspace-file code.
`packages/api/workspace-files` (`@deepseek-ai/dsh-api-workspace-files`) owns the Host `ctx.workspaceFiles` service, the `workspaceFiles` Remote namespace, and the Client `file` provider that turns `stat` and `changes` into live metadata for the [resource model](2026-09-05-client-resource-model.md); [dual-face packaging](../../../../packages/api/workspace-files/README.md) governs their package organization. File methods resolve relative paths from the workspace root but inherit the Session filesystem backend's read authority; `list` and `changes`accept a directory that resolves inside the workspace root or whose path descends from it. The [workspace file read authority](2026-09-09-workspace-file-read-authority.md) owns this split and its security consequences, and [directory links outside the workspace root](2026-11-20-workspace-directory-links-outside-root.md) owns the directory rule. Results name files by their absolute path in the filesystem's execution world, and content is bounded by page, byte window, or complete-file cap. The byte window rides on a new `dsh-fs` seam, `FileSystem.readByteRange`, implemented by every provider. The Session Controller carries no workspace-file code.
### Package topology
[dual-face packaging](../../../../packages/api/workspace-files/README.md) supersedes this note's choice of separate Host and Client packages; the file service, paging, and change-feed decisions here remain in force. The [workspace file read authority](2026-09-09-workspace-file-read-authority.md) supersedes the original workspace-containment choice for file methods. Host and Client compile in separate leaf configurations, share wire types, and the Client does not import the Host runtime entry.
[dual-face packaging](../../../../packages/api/workspace-files/README.md) supersedes this note's choice of separate Host and Client packages; the file service, paging, and change-feed decisions here remain in force. The [workspace file read authority](2026-09-09-workspace-file-read-authority.md) supersedes the original workspace-containment choice for file methods, and [directory links outside the workspace root](2026-11-20-workspace-directory-links-outside-root.md) supersedes judging a `list` or `changes` directory by its resolved target alone. Host and Client compile in separate leaf configurations, share wire types, and the Client does not import the Host runtime entry.
| Face | Package | Files | Depends on |
|---|---|---|---|
@@ -41,7 +41,7 @@ Every Host method takes `WorkspaceFileScope` first. The `workspaceFileScope` Gat
- **`read`** returns one window of lines, `WorkspaceFileText = WorkspaceFileStat & { offset, text, lines, eof }`; `lines` counts the page's lines, so a page holding one empty line (`text: ''`, `lines: 1`) and a page past the end (`lines: 0`) read differently. `range.offset` is the 1-based first line and defaults to 1; `range.limit` is the largest number of lines and defaults to `maxLines`, which it may not exceed. Lines end at `\n` and a final `\n` terminates the last line rather than opening an empty one; `text` joins the page's lines with `\n` and carries no terminator; `eof` is true when the page includes the last line, and an offset past the end returns an empty page with `eof` true. The pager walks `streamText`, counts the lines before the window without keeping them, admits each in-window segment against `maxBytes` before buffering it, and returns at the first character past the window, so a file of any size costs one page of memory. The `version` and `bytes` on a page are the stat's, taken before the stream.
- **`readBytes`** returns native bytes with file metadata, offset, and EOF. The required options object selects a complete read under `maxFileBytes` when `range` is absent, or a bounded window under `maxBytes` when present. `range: {}` uses offset zero and the configured window cap; windows can read files above the complete-file cap. The [binary transfer decision](2026-09-17-workspace-file-binary-transfer.md) owns the Remote response encoding.
- **`baseFile`** selects target resolution independently of `range`: the target `path` must be relative and resolves from the base file's directory. The Host applies regular-file checks to both files and preserves backend read authority. [Document Preview](2026-09-08-document-preview-operations.md) owns content loading and address semantics.
- **`list`** returns `WorkspaceDirectoryListing { path, entries, truncated }`: the listed directory as a workspace path relative to the root (empty for the root), its direct children in the backend's stable name order as `{ name, type, size? }`, and whether `maxEntries` cut the list. `type` is `file`, `directory`, or `other`; a symlink child reports the type of what it points to and a dangling one is `other`. A child the listing reports as a directory opens through its resolved target, including a Windows junction, and the listing then names that target; [directory link listing](../../../../packages/api/workspace-files/README.md) owns the rule. Dotfiles are listed; nothing is filtered.
- **`list`** returns `WorkspaceDirectoryListing { path, entries, truncated }`: the listed directory as a workspace path relative to the root (empty for the root), its direct children in the backend's stable name order as `{ name, type, size? }`, and whether `maxEntries` cut the list. `type` is `file`, `directory`, or `other`; a symlink child reports the type of what it points to and a dangling one is `other`. A child the listing reports as a directory opens through its resolved target, including a Windows junction, and the listing then names that target when it is inside the root and its child names below the root when it is outside; [directory link listing](../../../../packages/api/workspace-files/README.md) owns the rule. Dotfiles are listed; nothing is filtered.
- **`changes`** yields `WorkspaceFileWatchFrame`: `{ kind: 'ready' }` after the observation queue is registered and the workspace root resolves, followed by `{ kind: 'change', change }`. The `WorkspaceFileChange` payload is `{ absolutePath, version }` for a present file or `{ absolutePath, absent: true }` for one observed gone. Its source is `fs/observed` inside the workspace root, never an OS watcher. Observations after the first pull are queued, including during root resolution; cancellation or plugin disposal ends the generation.
### Paths on the wire
@@ -52,14 +52,14 @@ Two path vocabularies leave the service, and each method uses exactly one. `read
### File checks and workspace containment
`read`, `readBytes`, and `stat` share regular-file checks and then rely on the filesystem backend's read authority. `list` shares path inspection but also checks workspace containment, while `changes` filters observations to the workspace root. The service applies the following checks:
`read`, `readBytes`, and `stat` share regular-file checks and then rely on the filesystem backend's read authority. `list` shares path inspection but also applies the workspace check, while `changes` applies it to a watched directory. The service applies the following checks:
1. **The path itself.** `lstat` inspects the path before anything follows it: a missing path is `not-found`, and a symlink — wherever it points, including back inside the workspace — is `not-regular-file` (kind `symlink`) for the file methods. `list` instead follows a final link and judges the resolved target: the target must stat as a directory, and a link to a file or a link whose target is gone is `not-directory` (kind `symlink`). An empty path is a `gateway/bad-request`.
2. **Workspace containment for `list`.** The directory resolves to a target and `ctx.fs.contains(root, target)` decides, where `root` is the `WorkspaceFileScope.workspaceRoot` resolved from the selected Session header. A `..` traversal or an absolute directory outside the root is `outside-workspace`. `changes` applies the same backend containment predicate to observed targets.
2. **The workspace check for `list`.** The directory resolves to a target and passes when `ctx.fs.contains(root, target)` holds, where `root` is the `WorkspaceFileScope.workspaceRoot` resolved from the selected Session header, or when the path the backend resolved, in its unresolved spelling, descends from that root by child names without a `..` segment. An absolute directory outside the root, or a `..` traversal that resolves outside it, is `outside-workspace`. `changes` applies the same check to a watched directory.
3. **The caps.** A page or window above `maxBytes`, or a `read` asking for more than `maxLines`, is refused, never shortened, because a silently cut page reads as the whole page; a listing above `maxEntries` is cut and says so. Complete and related-file reads are refused above `maxFileBytes`.
4. **Text.** For `read` only: content that is not UTF-8 up to the end of the page, a NUL byte in the backend's 8 KiB opening sample, or a NUL byte anywhere in the page is `not-text`; bytes past the page are not inspected.
After path inspection the file methods `stat` the resolved target once more, because the file may have gone or changed kind before the read: a vanished file is `not-found` and a replaced one `not-regular-file` with the new kind. For `list`, an outside entry whose type already disqualifies it reports its kind before its position; a final link resolves and passes containment before its target kind is read.
After path inspection the file methods `stat` the resolved target once more, because the file may have gone or changed kind before the read: a vanished file is `not-found` and a replaced one `not-regular-file` with the new kind. For `list`, an outside entry whose type already disqualifies it reports its kind before its position; a final link resolves and passes the workspace check before its target kind is read.
### Failures
@@ -68,7 +68,7 @@ Each failure is one `RemoteError` code with typed details, declared beside the t
| Code | When | Details |
|---|---|---|
| `workspace-file/not-found` | no entry at the path, or the file vanished after the gates | `{ path }` |
| `workspace-file/outside-workspace` | a `list` target is not inside the workspace root | `{ path }` |
| `workspace-file/outside-workspace` | a `list` or watched directory neither resolves inside the workspace root nor has a path that descends from it | `{ path }` |
| `workspace-file/too-large` | a page's text or byte window exceeds `maxBytes`, or a complete read exceeds `maxFileBytes` | `{ path, limit }` |
| `workspace-file/not-text` | invalid UTF-8 up to the page's end, or a NUL byte in the sample or the page (`read` only) | `{ path }` |
| `workspace-file/not-regular-file` | `read`, `readBytes`, or `stat` on something that is not a regular file | `{ path, kind: 'directory' \| 'symlink' \| 'other' }` |
@@ -125,7 +125,7 @@ The [resource model](2026-09-05-client-resource-model.md) owns `ctx.resources`,
**A default `readByteRange` in the `FileSystem` base class.** A non-abstract default over `readBytes` would have spared the test doubles a method but could only be implemented by reading the whole file up to the window's end, the very behaviour rejected above, or by passing an unbounded cap. Abstract, with every provider and double implementing it.
**String-prefix containment for workspace operations.** Comparing resolved path strings against the root is simpler than `fs.contains`, but `resolve` realpaths, so a symlink that leaves the root resolves to a path outside it while a prefix test on the unresolved spelling passes; and a prefix test on the resolved spelling still needs the backend's notion of "same file". The filesystem decides containment for `list` and `changes`.
**String-prefix containment for workspace operations.** Comparing resolved path strings against the root is simpler than `fs.contains`, but `resolve` realpaths, so a symlink that leaves the root resolves to a path outside it while a prefix test on the unresolved spelling passes; and a prefix test on the resolved spelling still needs the backend's notion of "same file". The filesystem decides containment for `list` and `changes`; a path whose unresolved backend spelling descends from the root passes in addition, under [directory links outside the workspace root](2026-11-20-workspace-directory-links-outside-root.md).
@@ -12,7 +12,7 @@ File viewers need different loading policies and may offer several implementatio
Document Preview separates resource observation from content reads. The [resource model](2026-09-05-client-resource-model.md) shares observations by address alone: `source(address)`, `pin(address, signal)`, and provider `open(address, { signal })` carry no consuming Session. Providers return `AsyncIterable<RemoteResult<ResourceProtocolMap[P]>>`; `useResource` exposes only `{ status, value, failure }`. Holds start and stop observation, not the underlying file or Session. Content reads use ordinary injected Preview callbacks.
[Workspace Files](../../../../packages/api/workspace-files/README.md) retains Host line reads, byte windows, bounded complete reads, and bounded reads relative to another file's directory. Its Client `file` provider observes only `stat` and `changes`, with `ResourceProtocolMap.file` directly naming `WorkspaceFileStat`. The Host resolves every path through the Session filesystem; file reads inherit that backend's read authority, while directory listing and change observation stay workspace-scoped.
[Workspace Files](../../../../packages/api/workspace-files/README.md) retains Host line reads, byte windows, bounded complete reads, and bounded reads relative to another file's directory. Its Client `file` provider observes only `stat` and `changes`, with `ResourceProtocolMap.file` directly naming `WorkspaceFileStat`. The Host resolves every path through the Session filesystem; file reads inherit that backend's read authority, while directory listing and directory watching apply the workspace check that the Workspace Files README describes.
Readable files use `dsh-resource://file/session/<sessionId>/<path>`. The path may be workspace-relative or absolute; an encoded absolute path retains its leading slash. `fileAddressFor` always emits this Session-address form. The provider and Preview RPC take the Session only from that address, never from the current selection, first holder, or owning tab. A Session-less `absolute` URI cannot be read; the provider reports `workspace-file/unknown-workspace`. Session authorization is a file-protocol rule, not an additional Resource identity.
@@ -12,7 +12,7 @@ Workspace Files serves both file content and workspace navigation. Applying work
`read`, `readBytes`, and `stat` inherit the addressed Session filesystem backend's read authority. The workspace root is the base for relative input paths, not a read boundary; absolute paths and relative paths that leave the workspace are readable when the backend allows them. The service still requires regular files, refuses symlinks, and applies its text and byte caps.
`list` and `changes` remain workspace-scoped because they expose workspace navigation and observation rather than a named file read. `list` rejects a directory outside the root, and `changes` filters observations through the backend's workspace-containment predicate.
`list` and `changes` remain rooted at the workspace because they expose workspace navigation and observation rather than a named file read. Both accept a directory that resolves inside the root or whose path descends from it, and reject any other; [directory links outside the workspace root](2026-11-20-workspace-directory-links-outside-root.md) owns that rule.
`readBytes` with `baseFile` resolves a relative path from the base file's directory. A `..` path may therefore read JavaScript or CSS outside the workspace when the Session backend permits it. With [Developer tools](../../../../packages/client/ui-sidebar-documentpreview/README.md) enabled, Document Preview packages bounded, statically declared local scripts and stylesheets into an HTML Blob iframe with `sandbox="allow-scripts"`; the opaque origin blocks parent access, but the browser retains normal network access. This exposure is an intentional security trade-off for rendering static generated HTML.
@@ -20,7 +20,7 @@ The [Workspace Files service](2026-09-05-workspace-files-service.md) owns paging
## Alternatives considered
**Contain every operation within the workspace.** This gives previews a narrower policy than the Session filesystem backend, blocks explicitly addressed readable files, and prevents HTML beside external assets from rendering. Workspace containment remains where the operation itself represents the workspace.
**Contain every operation within the workspace.** This gives previews a narrower policy than the Session filesystem backend, blocks explicitly addressed readable files, and prevents HTML beside external assets from rendering. A workspace check remains where the operation itself represents the workspace.
**Permit outside reads but block all iframe networking.** A stricter CSP would reduce exfiltration risk, but it would also reject external assets and network behavior intentionally retained for the static-HTML preview. The opaque sandbox protects the parent application; it does not promise network isolation.
@@ -28,7 +28,7 @@ Foreground preview and explicit QA requests precede background work. Disabling b
**Build a second prewarm or QA converter.** Independent queues duplicate resource ownership and cannot prioritize shared foreground work.
**Separate service-definition and provider packages for the sole LibreOffice implementation.** They evolve together and have no independent alternative implementation. One `office-kit` package supplies the mountable service without duplicated package, dependency, and release configuration. Native and WASM engine selection remains inside the kit; a second independent implementation can justify extracting an interface from actual consumer needs.
**Separate service-definition and provider packages.** The service has one implementation; its LibreOffice Kit converter and the [Poppler PDF renderer](2026-11-23-poppler-pdf-renderer.md) are backends inside that provider and share its queue, cache, and admission, so they evolve together with the service. One `office-kit` package supplies the mountable service without duplicated package, dependency, and release configuration. Native and WASM engine selection remains inside the kit; a second independent implementation of the service can justify extracting an interface from actual consumer needs.
The [background scheduling proposal](../../proposed/simplification/2026-09-17-defer-office-background-scheduling.md) questions the need for speculative priority without a production caller; this note remains the authority for the implemented behavior.
The [background scheduling proposal](../../proposed/simplification/2026-09-17-defer-office-background-scheduling.md) questions the need for speculative priority without a production caller; this note remains the authority for the implemented behavior. The [Poppler PDF renderer note](2026-11-23-poppler-pdf-renderer.md) records how image rendering selects a backend inside this queue.
[后台调度提案](../../proposed/simplification/2026-09-17-defer-office-background-scheduling.zh.md) 质疑没有生产调用方时保留推测性优先级的必要性;本记录仍定义已实现的行为。[Poppler PDF 渲染后端记录](2026-11-23-poppler-pdf-renderer.zh.md)说明图片渲染如何在此队列内选择后端。
@@ -75,7 +75,11 @@ The hook participates only when the importer is under `$DSH_HOME/profiles/**` or
The ESM and CommonJS adapters call the same routing function, and the main thread and Harness-owned Workers install the same runtime resolution. The implementation lives in `packages/boot/app-boot/src/profile-resolution/resolver.ts`; runtime resolution construction lives in `packages/boot/app-boot/src/profile.ts`.
#### 6. Package directories and module files
#### 6. Rows the config tree requests
The root config tree requests its rows from the profile directory URL, and bundles insert most of those rows, including the rows of their agent presets. For each plugin package name that a bundle inserts as a row and declares as its own dependency, the runtime resolution records the first such bundle. A bare request for that name whose importer is the active profile directory resolves again as an import of that bundle does, before ① and ②. Every other importer, including a file in the profile and a package in its `node_modules`, follows the chain above. [Bundle plugin rows](2026-11-23-bundle-plugin-rows-load-bundle-selected-packages.md) owns the binding rules.
#### 7. Package directories and module files
`packageDir('pkg', parentURL)` and `packageDir('pkg/sub', parentURL)` locate the package directory without loading code or validating the subpath. Ordinary entry and file requests still ask Node to apply `exports`, `main`, conditions, and file existence. A package-directory query can therefore succeed while importing a missing or unexported file fails. `import.meta.resolve` can return a URL for an exported file that does not exist; importing that URL still fails, as in native Node.
@@ -129,7 +133,7 @@ The profile links `<profile>/node_modules/my-plugin` to the plugin's real direct
`dsh plugin --profile <name> add <package | git spec | file:../local-checkout>` forwards its argument to pnpm, which installs inside the profile directory with a hoisted layout. The profile's `pnpm-workspace.yaml` sets `autoInstallPeers: false`, so dsh packages a plugin declares as peers are not installed into the profile; the interception layer supplies the copy from the running installation, and the plugin and dsh share one module instance.
The plugin's own third-party dependencies are hoisted to `$DSH_HOME/profiles/<name>/node_modules` and found at ② on the ancestor chain. When a name collides with the installation closure, the nearest wins and the plugin uses the version it declared. The `file:` form copies the local checkout into the profile; resolution afterwards is identical to a registry installation.
The plugin's own third-party dependencies are hoisted to `$DSH_HOME/profiles/<name>/node_modules` and found at ② on the ancestor chain. When a name collides with the installation closure, the nearest wins and the plugin uses the version it declared; a row that a bundle inserts and declares still resolves from that bundle (Part 1 §6). The `file:` form copies the local checkout into the profile; resolution afterwards is identical to a registry installation.
#### 2. Development mode: the plugin repository is outside the profile tree
@@ -31,4 +31,4 @@ English | [中文](2026-09-24-preset-scoped-schedule-tools.zh.md)
## Testing
`packages/schedule/tool-schedule/tests/tool-schedule.spec.ts` pins the four definitions and their error mapping, including `refuses every call from a registered delegated child whose scope mounts the tools`, and `packages/subagent/subagent/tests/schedule-tools.spec.ts` runs a delegated child through the tool executor and pins that refusal without a stored task. `apps/cli/tests/web-agent-presets.e2e.ts` asserts the `minimal` preset's tool list, and `snapshots/web/minimal-preset/tool-schemas.expected.json` records its tool table without reminder schemas. `packages/schedule/schedule/tests/subagent-ownership.spec.ts` pins the delegation-depth refusal, and `scripts/optional-bundles.spec.ts` asserts that both delegation rows in the three presets omit `toolFilter`. The Web preset e2e also checks equal parent/child tool schemas and refusal from all four reminder executors for fresh and seeded children. `snapshots/web/subagent-fork-schedule` records all four refusals in a seeded fork through the shipped Web composition and shares the standard preset's prompt and schema pins.
`packages/schedule/tool-schedule/tests/tool-schedule.spec.ts` pins the four definitions and their error mapping, including `refuses every call from a registered delegated child whose scope mounts the tools`, and `packages/subagent/subagent/tests/schedule-tools.spec.ts` runs a delegated child through the native root registry and pins that refusal without a stored task. `apps/cli/tests/web-agent-presets.e2e.ts` asserts the `minimal` preset's tool list, and `snapshots/web/minimal-preset/tool-schemas.expected.json` records its tool table without reminder schemas. `packages/schedule/schedule/tests/subagent-ownership.spec.ts` pins the delegation-depth refusal, and `scripts/optional-bundles.spec.ts` asserts that both delegation rows in the three presets omit `toolFilter`. The Web preset e2e also checks equal parent/child tool schemas and refusal from all four reminder executors for fresh and seeded children. `snapshots/web/subagent-fork-schedule` records all four refusals in a seeded fork through the shipped Web composition and shares the standard preset's prompt and schema pins.
@@ -10,17 +10,17 @@ English | [中文](2026-09-27-web-search-offered-by-provider-readiness.zh.md)
## Decision
Each role of the web capability seam owns one part of a per-step check:
Each role of the web capability seam owns one part of the readiness check that decides whether an Agent sees each Web tool:
- **Service Definition.** `WebSearchProvider` and `WebFetchProvider` have an optional `ready(llmProvider)` that answers whether an operation made for a model request on that chat route has a credential to send. It checks configuration only and makes no network calls. `ctx.web.searchReady(llmProvider?)` and `ctx.web.fetchReady(llmProvider?)` resolve the provider with the same rules as `search()` and `fetch()` and return its answer. A provider without `ready()` counts as ready, and a selection failure answers true because the operation reports that failure as a structured `WebError`.
- **Service Provider.** Each DeepSeek provider checks its credentials in the order its operation resolves them. `dsh-web-search-deepseek` checks, in a conversation on the account route, whether `ctx.deepseekAuth` has the account sign-in configured for its Messages endpoint, and then its literal `apiKey` or its `apiKeyEnv` reference. The Search and Fetch API providers of `dsh-web-deepseek-api` resolve the same plan as the operation ([credential resolution](2026-10-29-web-provider-selection.md)): a capability with its own YAML fields checks only the key under its `*ApiKeyEnv`; otherwise, on the account route with the account model route mounted, the account sign-in configured for the endpoint under that route's origin counts, and then the key of the `deepseek-official` route, or `DEEPSEEK_API_KEY` without that route. A key counts when `ctx.credentials.describe()` reports its reference configured (without that service, when the launching environment carries it); `ctx.deepseekAuth` performs these checks, a key's through the reference helpers of `dsh-credentials`. A failed account-token or credential-store read answers false, because the operation fails on that read instead of trying the next credential. The providers name no tool or prompt section.
- **Consumer.** `dsh-tool-web` registers `web_search` and `web_fetch`with [step activation conditions](../../../../packages/core/tools/README.md#conditional-tools) that ask `ctx.web.searchReady()` and `ctx.web.fetchReady()` about the route of the step's model selection. The agent loop resolves conditions before it assembles the step, so the declared tools, the `tool:web_search` and `tool:web_fetch` prompt sections, PTC program bindings, and dispatch all read the same admitted set.
- **Consumer.** `dsh-tool-web` registers `web_search` and `web_fetch`in an [`AgentToolRegistry`](../../../../packages/core/tools/README.md#per-agent-tools), asks`ctx.web.searchReady()` and `ctx.web.fetchReady()` about the route `agent.model.current()` names, and adds or removes each tool for that Agent. It checks when the Agent is created, which waits for the check; when the Agent's Session records a model selection, a request on another route, or a preset change; when a stored credential or the account sign-in changes; when the registered Web providers change; and for Agents that exist when it loads. The `tool:web_search` and `tool:web_fetch` prompt sections are registered with the tools and render for an Agent only while tool-web has added the tool for it. A step captures its tools once, so the declared tools, PTC program bindings, and dispatch read the same tools.
The route decides only whether the account token is checked before the API key, which happens on the `deepseek-account` route; an API key counts on every route, so a conversation on another provider's model is offered the DeepSeek web tools whenever a DeepSeek key is configured. A Search or Fetch API capability with its own YAML fields ignores the route and is ready exactly when its own key is configured.
Only presence decides: no API key value is read and no endpoint is contacted, so a wrong key or an endpoint that does not serve the native `web_search_20250305` server tool keeps the tool admitted. A step that does not admit a web tool also refuses calls to it as `UNKNOWN_TOOL`, so a model that repeats an earlier call reaches no provider; an operation made outside a model step resolves its credential when it runs and fails with `WEB_PROVIDER_CREDENTIAL_MISSING` when there is none.
Only presence decides: no API key value is read and no endpoint is contacted, so a wrong key or an endpoint that does not serve the native `web_search_20250305` server tool keeps the tool offered. A step whose Agent lacks a web tool also refuses calls to it as `UNKNOWN_TOOL`, so a model that repeats an earlier call reaches no provider; an operation made outside a model step resolves its credential when it runs and fails with `WEB_PROVIDER_CREDENTIAL_MISSING` when there is none.
The request header records the assembled tools, so the agent loop announces each change through tool-registry updates. A route switch, a stored key, or a removed key changes the next request; DeepSeek routes load a returning tool as a deferred addition, and routes without tool-update support receive the complete tool list.
The request header records the assembled tools, so the agent loop announces each change through tool-registry updates. A route switch, a stored key, or a removed key changes the first request that starts after the check finishes; DeepSeek routes load a returning tool as a deferred addition, and routes without tool-update support receive the complete tool list.
## Alternatives considered
@@ -30,7 +30,7 @@ The request header records the assembled tools, so the agent loop announces each
**Read the route from the Session's latest `request/context` event instead of passing it.** That event records the previous request, so a new Session's first request and the first request after a model switch would be decided for the wrong route or for none.
**Register or unregister `web_search` in `dsh-tool-web`.** Registration is shared by every Session of an agent preset, while credentials depend on each request's route. Unregistering would also make `toolOrder` entries and subagent `toolFilter` restrictions that name `web_search` fail.
**Register or unregister `web_search` for the whole preset in `dsh-tool-web`.** Registration is shared by every Session of an agent preset, while credentials depend on each request's route. Unregistering would also make `toolOrder` entries and subagent `toolFilter` restrictions that name `web_search` fail. The per-Agent registry keeps one shared registration whose unscoped view still lists the tool, so those names stay valid.
**Remove `web_search` from the assembled request.** A `system-prompt/assemble` listener could drop the declaration and its section, but the tool would stay executable, so a model that repeats an earlier call would still run it, and PTC programs would still bind it. Prompt assembly also no longer carries tool declarations.
@@ -44,8 +44,10 @@ The request header records the assembled tools, so the agent loop announces each
**Probe the key or endpoint before offering the tool.** A network request per model request adds latency and cost; the user controls configuration, not its validity at that moment.
**Check before every step from an awaited step event.** Every step would read its exact route and current credentials, but the agent loop would keep a public per-step extension point for this one consumer, and the check would run for every Agent and step although its inputs change rarely; most of them change through an event, and the ones without one are listed under Consequences.
## Consequences
`dsh-web` gains public members: the optional `ready()` of both provider interfaces, `WebRuntime.searchReady()`, and `WebRuntime.fetchReady()`. Each readiness method is the smallest query its one consumer needs, which is how the [observation-surface decision](../../archived/simplification/2026-07-04-drop-unconsumed-web-observation-surface.md) lets a status query return; neither reports availability or selection failures. The HTTP fetch provider implements no `ready()`, so `web_fetch` stays admitted whenever HTTP fetch is selected. A step that does not admit a web tool leaves it out of PTC program bindings too. An endpoint that cannot serve the native server tool keeps the tool admitted and fails each call. Removing a tool on an unchanged route changes the declared tools and misses the prompt cache once; a model switch already invalidates it. Searches and fetches from other providers' conversations bill the configured DeepSeek key. A deployment whose official route chats through a gateway sends the gateway's key to that gateway's origin with `/v1/tools` for the Search and Fetch APIs, and to the configured Messages endpoint, the official one by default, for legacy Messages search, where each search fails unless that endpoint accepts the key. The Search and Fetch APIs read the DeepSeek model routes' Loader entries through the model provider directory.
`dsh-web` gains public members: the optional `ready()` of both provider interfaces, `WebRuntime.searchReady()`, and `WebRuntime.fetchReady()`. Each readiness method is the smallest query its one consumer needs, which is how the [observation-surface decision](../../archived/simplification/2026-07-04-drop-unconsumed-web-observation-surface.md) lets a status query return; neither reports availability or selection failures. The HTTP fetch provider implements no `ready()`, so `web_fetch` stays offered whenever HTTP fetch is selected. A step whose Agent lacks a web tool leaves it out of PTC program bindings too. An endpoint that cannot serve the native server tool keeps the tool offered and fails each call. A step that starts while a check runs uses the previous answer, so the first step after a model switch can still offer or omit a tool for the previous route; Web provider settings edited without a change event, such as a literal key, a key reference name, or the selected provider, apply at the Agent's next check. The route of a blank Web Session that follows the default model also changes without an event when another Session saves a new default: the first step uses the answer checked for the old route, that step's `request/header` starts a check, and if the new route is not ready the tool is withdrawn while the model answers, so a declared `web_search` call fails as `UNKNOWN_TOOL`, or with `WEB_PROVIDER_CREDENTIAL_MISSING` when it starts before the check settles. Removing a tool on an unchanged route changes the declared tools and misses the prompt cache once; a model switch already invalidates it. Searches and fetches from other providers' conversations bill the configured DeepSeek key. A deployment whose official route chats through a gateway sends the gateway's key to that gateway's origin with `/v1/tools` for the Search and Fetch APIs, and to the configured Messages endpoint, the official one by default, for legacy Messages search, where each search fails unless that endpoint accepts the key. The Search and Fetch APIs read the DeepSeek model routes' Loader entries through the model provider directory.
Unit tests pin each role: [web.spec.ts](../../../../packages/web/web/tests/web.spec.ts) covers which provider `searchReady()` and `fetchReady()` ask and their answer on selection failure, [deepseek.spec.ts](../../../../packages/web/web-search-deepseek/tests/deepseek.spec.ts) and [credential-resolution.spec.ts](../../../../packages/web/web-deepseek-api/tests/credential-resolution.spec.ts) cover each credential case of `ready()` on the account route and on other routes, including readiness that matches each operation, and [tool-web.spec.ts](../../../../packages/web/tool-web/tests/tool-web.spec.ts) resolves step admission of both tools through the real prompt, tool, and executor services, including the `UNKNOWN_TOOL` refusal of a call in a step that withheld the tool. In real compositions, the shipped headless keyless smoke test and the `web-search-unconfigured` recorded-session snapshot, whose search key references are unset, pin the withheld search tool. Snapshot replays supply a placeholder DeepSeek key, so their tool lists do not depend on the runner's environment; with it, the `pi-ai-conversation-updates` conversation on a pi-ai route keeps `web_search`.
Unit tests pin each role: [web.spec.ts](../../../../packages/web/web/tests/web.spec.ts) covers which provider `searchReady()` and `fetchReady()` ask and their answer on selection failure, [deepseek.spec.ts](../../../../packages/web/web-search-deepseek/tests/deepseek.spec.ts) and [credential-resolution.spec.ts](../../../../packages/web/web-deepseek-api/tests/credential-resolution.spec.ts) cover each credential case of `ready()` on the account route and on other routes, including readiness that matches each operation, and [tool-web.spec.ts](../../../../packages/web/tool-web/tests/tool-web.spec.ts) prepares model steps that offer or withhold both tools through the real prompt, tool, and root registry services, including the `UNKNOWN_TOOL` refusal of a call in a step that withheld the tool. In real compositions, the shipped headless keyless smoke test and the `web-search-unconfigured` recorded-session snapshot, whose search key references are unset, pin the withheld search tool. Snapshot replays supply a placeholder DeepSeek key, so their tool lists do not depend on the runner's environment; with it, the `pi-ai-conversation-updates` conversation on a pi-ai route keeps `web_search`.
@@ -10,7 +10,7 @@ Desktop updates and native recovery can run before the Host starts or while it i
## Decision
Electron main owns `userData/desktop/settings.json` independently of Host startup and Cordis evaluation. The test authentication popup switch uses this file; the [Desktop reference](../../../../apps/desktop/README.md#local-desktop-settings) owns its fields and behavior.
Electron main owns `userData/desktop/settings.json` independently of Host startup and Cordis evaluation. Document `"version": "1"`, the test authentication popup switch, and the update-channel preference and unlock flag use this file; [channel convergence and decoupled publishing](2026-11-25-desktop-channel-convergence-and-decoupled-publishing.md) owns `"version": "1"` migration and default `stable` locking, and the [Desktop reference](../../../../apps/desktop/README.md#local-desktop-settings) owns field validation and runtime behavior.
Ownership follows runtime dependencies: Electron-owned functions needing configuration before Host startup or while the Host is unavailable use shell configuration. Host plugin settings, including shared Web/Desktop preferences, continue to use Cordis. Displaying a setting in Desktop alone does not justify shell ownership. A unified settings interface can use separate storage owners.
# Agent Note: IM integration through automation sessions
Status: implemented
English | [中文](2026-10-12-im-automation-sessions.zh.md)
## Problem
IM combines delayed input, multiple participants, quoted messages, and platform redelivery. A task can consume several messages without publishing an answer to each one. Treating every message as a GUI prompt and every assistant response as a platform reply couples input scheduling to publication.
## Decision
IM hosts persistent sessions through the existing agent factory, inbox, presets, and persistence APIs, and lets a plugin decide which session an admitted message reaches. The agent loop and core Session categories are unchanged. The [IM service](../../../../packages/experimental/im/README.md) admits external context and provides [explicit tools](../../../../packages/experimental/im/src/tools.ts) for reading and publishing; the [IM bundle](../../../../packages/experimental/im-bundle/README.md) mounts the service and the adapters as Host rows of an existing profile.
Source admission, write grants, delivery mode, model route, working directory, and preset are explicit deployment choices: a `sources` rule decides which chats may reach the host and how their messages are stored, and `defaultDispatch` composes the single session every unhandled addressed message reaches. Every chat shares that session's history, so a deployment that needs per-chat history or background workers mounts its own plugin on the `im/message` waterfall.
The transport layer uses the vendored Satori packages (`plugin-im-core`, `satori-element`, `plugin-im-adapter-lark`, and `plugin-im-adapter-qq`). The [vendor manifest](../../../../vendor/im/README.md) documents exact upstream pins and local modifications. Generated Feishu declarations stay outside Git and are regenerated from hash-checked pinned sources during installation.
## Durability and ownership
One service instance holds the live `Agent` for each hosted session. The `im_sessions` storage domain records each hosted session with its owner, composition, and bindings, and rejects a session id that already exists outside the IM store. `im_messages` records each external event digest and message before platform ACK. A deterministic inbox message ID (`deliveryMessageId`) and a Session log check reconcile admission across restarts so redeliveries and crash recoveries do not duplicate inbox messages.
Outbound sends with an `operationId` record a `pending` receipt in `im_receipts` before network dispatch and update it with the result afterwards. Replaying the same `operationId` returns the recorded receipt without resending. A platform error code indicating nothing was published is recorded as `failed`; a lost response, timeout, or crash after dispatch is recorded as `uncertain` and is never automatically resent.
The `im` message source is attribution metadata only ([compatibility record](../../../../docs/persistence-changes/2026-10-28-im-message-source.md)). Permission decisions remain in the live IM service, and existing sandbox and approval policies continue to apply.
## Alternatives considered
**Another GUI client through Host controllers.** Suitable for transcript mirroring and typed interaction controls, but it introduces conversation policy and output coupling that automation does not need. IM uses the agent factory directly while retaining the existing loop.
**ACP between IM and the harness.** ACP supports persistent programmatic sessions and suits process separation. Independent IM publication still requires a channel or tool route; in-process Cordis composition avoids an additional process without changing automation semantics.
**Operator-configured fixed sessions per chat.** Naming each session and its sources by hand requires a configuration change and restart for every new chat. One session composed from `sources` and `defaultDispatch` keeps access control in source rules without per-chat configuration.
**Automatic retries for uncertain sends.** A lost response cannot establish whether the platform created the message. Keeping `uncertain` for inspection avoids automatic duplicates while allowing an intentional new tool call to send again.
## Consequences
One host process owns each IM store and session set; multi-host coordination requires a separate design. Hosted sessions stay resident in memory after first use (except `ephemeral` sessions, which dispose their agent after the first turn). Finite receipt retention (`retentionMs`) bounds event deduplication, while pending messages and pending receipts do not expire automatically. Scanning Session logs for inbox message IDs increases recovery cost for long session histories.
每组 IM 存储和会话由单个主机进程负责,多主机协调需要独立设计。托管会话在首次使用后常驻内存(标记为 `ephemeral` 的临时会话除外,它们在首轮结束后释放 agent)。有限的保留期(`retentionMs`)限定了事件去重窗口,待处理消息和未决回执不会自动过期。恢复投递时扫描 Session 日志核对收件箱消息 ID 会使恢复耗时随会话历史增长。
@@ -73,7 +73,7 @@ Let `start` be the scrollTop when the batch begins, `above` the height of closin
## Testing
[fold-blank-matrix.e2e.ts](../../../../apps/web/tests/fold-blank-matrix.e2e.ts) covers 19 main-Session cases and 8 right-Sidebar child cases across reader position (bottom, middle of the body, top of the body, inside the steps, previous Turn), input source (composer, Turn failing before its message is recorded, another tab, queued delivery, steer, parent message, several Turns folding at once), body length, and Standard and "On completion" controls. The layout gap is the tallest band between the scrollport top and the composer that no visible row's box covers: at most 120 px once settled, and over that for at most one animation frame. The probe reads the layout after the animation callbacks for each rendering opportunity, before paint. Identical gaps on consecutive frames count separately. It counts boxes, so a closing row that has faded but not finished shrinking still covers its space. Tail cases assert the floor landing; reader-content-still cases assert that the reader's anchor row moves at most 2 px on screen. Short-body cases assert only that no room remains after the reply arrives.
[fold-blank-matrix.e2e.ts](../../../../apps/web/tests/fold-blank-matrix.e2e.ts) covers 19 main-Session cases and 8 right-Sidebar child cases across reader position (bottom, middle of the body, top of the body, inside the steps, previous Turn), input source (composer, Turn failing before its message is recorded, another tab, queued delivery, steer, parent message, several Turns folding at once), body length, and Standard and "On completion" controls. The layout gap is the tallest band between the scrollport top and the composer that no visible row's box covers: at most 120 px once settled, and over that for at most one animation frame. The probe reads the layout after the animation callbacks for each rendering opportunity, before paint. Identical gaps on consecutive frames count separately. It counts boxes, so a closing row that has faded but not finished shrinking still covers the space it reserves in the layout, wherever its visual translate draws it; a row nested in a moving row covers only the part that row does not clip. Tail cases assert the floor landing; reader-content-still cases assert that the reader's anchor row moves at most 2 px on screen. Short-body cases assert only that no room remains after the reply arrives.
@@ -27,6 +27,7 @@ The served launch path (apps/cli, app-boot) carries no Preview-specific code; th
- The image carries a manifest-only `node_modules/@deepseek-ai/dsh/package.json` (a verbatim copy of `apps/cli/package.json`) as the installation anchor, and the image manifest names it in `installation`.
- The image carries no composed configuration and no `config/cordis.yml`; the image manifest records the `profile` the Worker boots.
- The image carries a home patch, `home/cordis.patch.yml`: for each row the runtime's `PLATFORM_ENTRY_CONFIG` names (`session-persistence-jsonl`), the config the template's bundle layers compose with the required fields over it (`compression: none`). A patch replaces a row's whole config, so the composed fields stay; the bundle files read at pack time are the ones in the image.
- The image seeds the profile patch, `home/profiles/<profile>/cordis.patch.yml`, with the Preview's keyless model defaults: it inserts the [`llm-mock`](../../../../packages/experimental/llm-mock/README.md) row, sets `agent-default-model` to the `mock` route, and sets `credentialOnboarding: false` on `ui-settings-models`. App-boot keeps an existing profile patch when it initializes the profile, and ConfigEditor writes that layer, so users can still select and save another model and add a provider key in Models settings. A profile recovery that moves the patch aside also drops these defaults.
- **Worker**
- The image's app-boot `loadProfile` initializes `home/profiles/<profile>` from the template, the Worker writes an empty root `cordis.yml`, and `readProfilePatches` composes the layers.
- profileContext is filled the way `runProfile` fills it: name, dir, patchPath, installAnchor, startedBundles, cwd, home, and an empty overlay list, so the Worker calls `readProfilePatches` once, as the launcher does without `--patch`.
- **Classification**: the client build preset emits package-local chunk requests only as `require.async("./client.<name>.js")`, and `verify-client-packages` forbids synchronous chunk requires. The packer's `lazyChunksOf` scans every page asset in the swept image (each package's `lib/client.js` and `lib/client.*.js`) for these literals, so a chunk that another chunk requests is found without following requests from the `./client` entry. A target that a package's `./client` export names under any condition (such as `client.browser.js`) loads eagerly and stays in the base image; every other target leaves it. A request for a chunk the package does not publish fails the pack.
- **Classification**: the client build preset emits asynchronous package-local chunk requests only as `require.async("./client.<name>.js")`, optionally with a `{ deps: [...] }` prefetch hint that names every other chunk the request needs ([chunk dependencies](2026-11-26-package-local-chunk-dependencies.md)). The packer's `lazyChunksOf` scans every page asset in the swept image (each package's `lib/client.js` and `lib/client.*.js`) for these literals, hint entries included, so a chunk that another chunk requests is found without following requests from the `./client` entry. A target that a package's `./client` export names under any condition (such as `client.browser.js`) loads eagerly and stays in the base image; every other target leaves it. A request for a chunk the package does not publish fails the pack.
- **Archives**: each chunk gets one deterministic tar.gz named `lazy/<sha256>.tar.gz` after the SHA-256 of the compressed archive. The base manifest's `lazy` list records each archive as `{ archive, files: [{ path, size }] }`, with no file mode. There is no size threshold.
- **Registration**: the Worker registers each listed file with `MemoryVfs.deferArchive`, which creates its parent directories and gives it the VFS default file mode; an image that lists lazy archives must be fetched from a URL, against which the archive names resolve. `exists`, `stat`, and `readdir` answer synchronously from the registration.
- **Fetch**: the asynchronous faces of the Worker's `node:fs` and `node:fs/promises` that read a registered file wait for its archive: `fs.promises.readFile`, `fs.promises.open` (so every FileHandle opens after arrival), `fs.promises.cp`, and `fs.createReadStream`. The first of them fetches the archive, inflates it, checks that it carries exactly the registered paths at the registered sizes, and materializes the files; concurrent readers share one fetch. The digest in the archive name is not verified. A failed fetch fails only the reads waiting on it; the files stay registered and the next asynchronous read fetches again.
The Preview boots the composition the served Web deployment boots. With no bundle enabled, the Worker composition differs from the served Web composition only by the jsonl platform override, and enabling any bundle skips no patch. The Plugins page lists every `OPTIONAL_BUNDLES` entry with its title and icon and no metadata error. Switching each of the 11 optional bundles on and then off returns `applied` both times; after enabling, every enabled row it changes is active, and after disabling, the plugin list returns to its prior rows. Enabling session-titles disables `@deepseek-ai/dsh-session-title-first-prompt-llm` (row `session-title-llm`) and enables `@deepseek-ai/dsh-session-title-all-prompts-llm`, as in the served Web deployment; enabling inspector-profile runs Session Inspector and starts the NodeJS Inspector degraded. Degradation requires `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`, so a served `dsh web` runs the full Inspector.
The Preview boots the composition the served Web deployment boots. With no bundle enabled, the Worker composition differs from the served Web composition only by the jsonl platform override and the seeded profile patch's keyless model defaults, and enabling any bundle skips no patch. The Plugins page lists every `OPTIONAL_BUNDLES` entry with its title and icon and no metadata error. Switching each of the 11 optional bundles on and then off returns `applied` both times; after enabling, every enabled row it changes is active, and after disabling, the plugin list returns to its prior rows. Enabling session-titles disables `@deepseek-ai/dsh-session-title-first-prompt-llm` (row `session-title-llm`) and enables `@deepseek-ai/dsh-session-title-all-prompts-llm`, as in the served Web deployment; enabling inspector-profile runs Session Inspector and starts the NodeJS Inspector degraded. Degradation requires `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`, so a served `dsh web` runs the full Inspector.
Size (MiB, measured): the base image is 9.20 (12.79 with pack-time composition and eager chunks, −28%) including 11 optional bundles, plus 5 lazy tar archives totaling 4.45 (pdf 2.88, excel 1.39, terminal 0.13, frontmatter 0.05, Inspector bottom panel 0.00). The base image contains no lazily loaded chunk, and the page fetches an archive only when it requests the chunk.
# Agent Note: Generic Desktop shared-texture API with a shared frame-forwarding package
Status: implemented
English | [中文](2026-10-15-desktop-shared-texture-api.zh.md)
## Problem
The native Office preview needs textures rendered by a LibreOffice process to reach the Electron renderer without copying pixels, which requires an Electron main-process import and a renderer-side `sharedTexture` consumer. The first design of the Office Preview and Editing bundle let a bundle declare `dsh.bundle.desktop` with `main`, `preload`, and `verify` exports: Desktop imported the bundle's module into the main process, registered its preload for every frame of the default session, and verified the bundle's native payload with the bundle's own verifier. That selection could only be made at application startup, so enabling or disabling the bundle required a Desktop restart, and the startup selection had to be pinned through `loadProfileDirectory`, `ProfileRuntimeResolution`, `DSH_DESKTOP_STARTUP_BUNDLES`, the plugin manager (`restart-required`, `desktop-only`), the package manifest types, and the Web plugin list. Any installed package carrying the declaration could run code in the main process and in a session-wide preload, and Electron's `setSharedTextureReceiver` is a document singleton, so two such bundles would have overwritten each other.
The correction that followed made frame forwarding a fixed Desktop capability: the Electron main process ran the native receiver (first loaded from the LibreOffice Kit's receiver SDK in the dsh runtime, then built from Kit sources copied into `apps/desktop`), validated producer metadata, and answered `frame-forwarding` control messages that carried viewports, generations, and credits. `apps/desktop` therefore carried protocol that only the Office preview used, its preload exposed frame forwarding rather than textures, a receiver inside Electron Main could not use libuv and needed Electron-compatible builds, and every protocol change required a Desktop release before a Kit release could use it. Copying the Kit's C++ into Desktop added a second claimed origin for one protocol; loading it from the Kit tied every Desktop receiver change to a Kit release. Frame forwarding is also not Office's: other Host plugins will render in native processes of their own, so the receiver, its transport, and its Host service cannot belong to the Office package either, and the Kit is one producer among several.
Electron fixes what Desktop must own. `sharedTexture.importSharedTexture` runs only in the main process and accepts only a handle local to that process: an `IOSurfaceRef` on macOS, an NT `HANDLE` on Windows. `sharedTexture.subtle` exports an imported texture for a renderer to import, and each reference's release callback runs after the GPU work that used it completes. The managed `sendSharedTexture` waits at most 1000 ms for the renderer's acknowledgement; when Main then releases its reference, a renderer that was busy for longer imports a destroyed texture and shows an empty frame. Electron has no API that receives a GPU handle from a process outside Chromium, and Node cannot receive Mach messages or duplicate Win32 handles. On macOS, bringing a foreign IOSurface into Main needs native code in Main; on both platforms, carrying a Host-local handle toward Main needs native code in the Host.
Whatever Desktop adds for that consumer is reachable by other code in the same process: a Host service by every Host plugin, a preload object by every script of the document. Two consumers of one texture interface would steal each other's frames, and a consumer that registers while frame forwarding is idle would take the interface over. The Office slideshow also entered window fullscreen through `dshDesktop.window.setFullscreen`, a Desktop-private API that Office read by duck typing and that Main restored by bookkeeping of its own; every plugin that needs fullscreen, for example a game, would have needed the same window control.
## Decision
Desktop owns an internal shared-texture API whose only consumer is frame forwarding, including the hop and ingress addons that open a native channel between the Host and Electron Main and carry Host-local handles across it; no plugin runs code in the Electron main process or a session-wide preload. The [`frame-forwarding`](../../../../packages/experimental/frame-forwarding/README.md) package owns frame forwarding for every Host plugin: the `frameForwarding` Host service, and the renderer-side views.
### Desktop: shared textures
Plugins see frame forwarding only. The shared-texture service definitions live in [`@deepseek-ai/dsh-shared-texture`](../../../../packages/shared-texture/shared-texture/README.md) with separate Host and Client compiler faces. Its root entry (`.`) defines the abstract Host `SharedTexture` Cordis service (`ctx.sharedTexture`), whose `claim()` grants `capabilities`, `nativeSink`, and `adapterLuid` to one holder until `release()` or the disposal of the scope that claimed; its `./types` entry defines the Cordis-free `SharedTextureClientExport`, `SharedTextureHostExport`, and `SharedTextureLease` shared by Desktop preload and the Client plugin; and its `./client` entry is the Client plugin that provides that bridge as the Client `ctx.sharedTexture`, typed `SharedTextureClientExport`. web-app mounts the package; its Host entry does nothing. Because Host and Client faces compile with separate `tsconfig.{host,client}.json` programs, the Host `Context` declaration never enters a Client program. Desktop Main takes the types of the `shared-texture` control messages (`capabilities` and `adapter-luid`) exchanged over the Host child-process channel from the Desktop Host's own `types` export ([`apps/desktop-host/src/types.ts`](../../../../apps/desktop-host/src/types.ts)), a private protocol between the two rather than a plugin API, and the hop addon's interfaces stay beside the service that loads it; each side validates every message it receives at runtime ([Main's channel](../../../../apps/desktop/src/shared-texture/channel.ts), [`apps/desktop-host/src/shared-texture.ts`](../../../../apps/desktop-host/src/shared-texture.ts)). The two apps share no package dependency; Main compiles against that export through a TypeScript project reference. Electron Main wires everything through one [entry](../../../../apps/desktop/src/shared-texture/main.ts) that attaches the [shared-texture channel](../../../../apps/desktop/src/shared-texture/channel.ts) to each Host process and supplies the window and Host cleanups; the channel validates every control request before Main's presenter sees it, and the Host-process lifecycle carries no shared-texture routing.
- The Desktop Host's [`sharedTexture` service](../../../../apps/desktop-host/src/shared-texture.ts) takes Host-local handles and loads the hop addon ([`native/shared-texture/hop.cc`](../../../../apps/desktop/native/shared-texture/hop.cc), Node-API 8 only) that Main names in its capabilities on first use. On macOS and Windows the hop opens one native two-way connection to Main's ingress — a pair of Mach ports on macOS, and a duplex message named pipe on Windows where Main duplicates each frame's Host-local NT handle into its own process — and every frame's submission, delivery reply, and settlement travel on that connection while the Host IPC channel carries only `capabilities` and `adapter-luid`. Each connection admits at most 128 unsettled requests; losing the connection settles its unsettled requests as `invalidated`, and the next frame opens a new connection. `nativeSink(timeoutMs)` returns an opaque `napi_external` pointing to `dsh_shared_texture_sink_v2` ([`native/shared-texture/shared-texture-sink.h`](../../../../apps/desktop/native/shared-texture/shared-texture-sink.h)) for same-process native addons; a consumer built for another ABI version refuses it. A frame carries its handle, size, pixel format, metadata, and a delivery deadline that applies in the Host only, and no request identifier. The sink is bound to that connection: `present` returns `DSH_SHARED_TEXTURE_PRESENT_OK` when the request left the Host, `DSH_SHARED_TEXTURE_PRESENT_REJECTED` when it refused only that frame and the sink stays usable, and `DSH_SHARED_TEXTURE_PRESENT_DISCONNECTED` once the connection was closed or lost, for every later frame too, so the consumer obtains a new sink. Ending a claim that took `nativeSink` closes that connection and settles its unsettled frames as `invalidated`. `adapterLuid(timeoutMs)` returns `null` outside Windows without asking Main and never opens the native connection; on Windows Main exports one texture from Chromium's compositor, reads its adapter's LUID through the ingress addon, and releases the texture at once. Main keeps the answer until Chromium's GPU process exits or the Host stops, shares one reading among concurrent queries, and keeps no failed reading. The answer is `<HighPart>:<LowPart>` in lowercase hexadecimal, the text frame forwarding's receiver uses for adapters, or `null` when Chromium exports no Direct3D 11 compositor texture, DXGI cannot read its adapter, or a cleanup cancelled the reading.
- Main's ingress ([`native/shared-texture/ingress.cc`](../../../../apps/desktop/native/shared-texture/ingress.cc)) queues at most 32 frames waiting for Main's JavaScript thread and refuses any frame beyond them with no reference kept, so the Host can reuse that texture at once. For each admitted frame, Main's [presenter](../../../../apps/desktop/src/shared-texture/presenter.ts) imports the handle and sends the subtle transfer with the Host's metadata unchanged to the product main frame over Desktop's IPC. Main keeps its import until the document reports its own reference, then replies `delivered` on the native channel; a busy renderer delays that reply — keeping the Host's slot past a delivery timeout until settlement — instead of losing the texture. Main settles every admitted presentation once on the native channel: it replies `released` after its own release callback and the document's release, which the document sends from its release callback, have both arrived, and `invalidated` when the document, renderer, GPU process, or GPU release synchronization failed or went away first; a failure reply with no reference kept means Main retained nothing. Main validates the pixel dimensions Electron bounds and parses `metadata` JSON without interpreting its fields.
- Main's `capabilities` reports its process identity to the Desktop Host, which passes only support and a reason to its consumer; on macOS and Windows it also reports the hop addon path and opens one native ingress (Node-API 8 only) for the requesting Host. On macOS ([`native/shared-texture/ingress-darwin.cc`](../../../../apps/desktop/native/shared-texture/ingress-darwin.cc)) the ingress is a Mach receive port: it accepts a message only when its audit trailer names the Host process Main spawned, resolves the carried port with `IOSurfaceLookupFromMachPort`, delivers the Main-local `IOSurfaceRef`, and replies to the Host's reply port, dropping messages from other processes and oversized messages while the Host's messages keep arriving. On Windows ([`native/shared-texture/ingress-win32.cc`](../../../../apps/desktop/native/shared-texture/ingress-win32.cc)) the ingress is a single-instance duplex message named pipe: it checks `GetNamedPipeClientProcessId` against that Host process before reading, disconnects any other client, holds a `PROCESS_DUP_HANDLE | SYNCHRONIZE` handle to the connected Host, and duplicates each frame's NT `HANDLE` from the Host into Main; the same addon reads, through DXGI, the adapter LUID of a Main-local shared texture for `adapter-luid`. The ingress lives as long as that Host process: window-level cleanup keeps it, so the Host queries capabilities once per connection and presents every later frame over the native channel without another IPC round trip. An explicit capability query always reaches Main, which reports `gpu-compositing-disabled` while Chromium composites in software, for example after repeated GPU process crashes. A message from the Host with another protocol version or malformed contents stops the ingress with an error, ending the connection, and the next capability query reopens it.
The application preload exposes `dshDesktop.textures` to the product main frame only: it imports each transfer, reports the result to Main at once, delivers `{ frame, metadata, release }` to the single document consumer, and releases textures that arrive without one. The shared-texture Client plugin provides `globalThis.dshDesktop?.textures` as the Client `ctx.sharedTexture`, so other Client plugins never read `globalThis.dshDesktop`. Desktop offers the document no window control: a plugin that shows a view fullscreen uses the document's Fullscreen API through frame forwarding, Electron makes the window fullscreen for the document's fullscreen element, and the existing state relay keeps window chrome in step. Main cancels a pending adapter reading, refuses frames arriving during cleanup, settles the textures sent to the document as `invalidated`, and starts a new document generation when the renderer or GPU process exits, a cross-document navigation commits, or the window closes; a GPU process exit also forgets the compositor adapter, and the ingress closes only when the Host process stops or fails. Main never reports an unobserved reference as released. Cancelled, intercepted, and same-document navigations keep the document's textures, and the document generation fails a capability query that spans a reset during ingress replacement.
### Trust model
Main trusts only the Host process it spawned. The macOS ingress drops every message whose audited sender PID differs from the Host's and keeps receiving the Host's; the Windows ingress checks `GetNamedPipeClientProcessId` before reading, disconnects any other client, and duplicates handles only from that Host process. Producers never communicate with Main, and only Desktop's hop touches the Host-to-Main channel.
Security review has two process boundaries. The Host-to-Main boundary is Desktop's: any code in the Host process can send to Main without the `sharedTexture` service, so Main's request validation and the ingress PID check are audited as part of Desktop and do not change with frame forwarding. The producer-to-Host boundary is frame forwarding's, recorded in its [security semantics](../../../../packages/experimental/frame-forwarding/README.md#security-semantics). The plugin API is `frameForwarding` alone; reserving `sharedTexture` for the exclusive frame-forwarding consumer makes it unsupported for general plugins rather than unreachable, so it is not a security boundary. Both shared-texture surfaces admit one consumer at a time, and frame forwarding takes both while it is loaded: its Host plugin holds the Host `sharedTexture` claim from load to unload, and its Client consumes Client `ctx.sharedTexture` from start to disposal, also while no channel is open. Another consumer therefore fails at once instead of taking either interface over when frame forwarding is idle. A claim ends with the scope that took it, so a holder unloaded without releasing cannot keep it.
### The frame-forwarding package
`@deepseek-ai/dsh-frame-forwarding` owns frame forwarding for any Host plugin whose producer speaks its wire protocol.
- The frame-forwarding workspace keeps the [receiver source](../../../../packages/experimental/frame-forwarding/native/receiver.cc) alongside the plugin that uses its protocol. Desktop builds it directly from the workspace for each macOS and Windows target and ships the binary and build record. The plugin’s npm package excludes the receiver sources and binary. Main resolves the addon's absolute path for the running Desktop and passes it to the Host as `--frame-receiver-path`. The Host publishes this path through its internal `desktopFrameReceiver` service. On first use the plugin checks the build record against its own protocol and handshake requirements, then loads the addon in the Host process. The listener and producer handshake for each channel run in the Host process.
- The Host [forwarder](../../../../packages/experimental/frame-forwarding/src/host/forwarder.ts) owns channels and their producer connections ([frame-forwarding channels](2026-10-18-frame-forwarding-channels.md)), the frame and byte budgets, and viewport acknowledgement and replay. When opening a channel, it asks `sharedTexture.capabilities()`, obtains `sharedTexture.nativeSink()`, and on Windows reads Chromium's adapter from `sharedTexture.adapterLuid()` before creating the receiver; every channel asks, because Desktop reads the adapter again after Chromium's GPU process restarts. It attaches the sink to the channel's receiver with `attachSink`, with a presentation deadline of at most 30000 ms, and updates the receiver's deliverable state via `setDeliverable` as connections, viewports, and visibility change. In the receiver addon, the C++ Desktop bridge validates producer metadata on the thread that produced the frame, filters frames against that deliverable state, and submits matching frames through `dsh_shared_texture_sink_v2` with `rx`, `connectionId`, `requestId`, `frameId`, `generation`, `revision`, `width`, and `height` as metadata, so steady-state frames never cross the Host's JavaScript event loop. On `on_settled`, the bridge returns the frame's credit directly when released; on `invalidated`, it stops the receiver before releasing the delivery and notifies the forwarder to close the channel as `lost`. Refused submissions and failed deliveries report `presentation-error` to the renderer; a submission refused with any result other than `DSH_SHARED_TEXTURE_PRESENT_REJECTED` detaches that sink, while a rejected frame leaves it attached; without an attached sink, frames arrive in JavaScript as `frame` events, where the forwarder returns the credit at once, requests a fresh `nativeSink`, and reattaches it to open channels.
- The Host plugin is a Typert Remote service: consumers use `capabilities`, `channel`, `isOpen`, and `close`; the renderer applies viewports through the `viewport` Remote and follows channel states from the `events` stream. The Client plugin provides the renderer-side `frameForwarding` service only when Client `ctx.sharedTexture` is available; `connect(rx)` returns a receive channel that consumes `ctx.sharedTexture`, routes textures by the `rx` in their metadata, lends each frame to a consumer callback, and releases it when the callback settles. Receive channels also hold the document's fullscreen element, one at a time, and report coverage to the others ([frame-forwarding channels](2026-10-18-frame-forwarding-channels.md)). A channel closes with the Cordis scope that opened it.
- Every consumer bundle inserts frame forwarding as the same row, `frame-forwarding`, without a config. The Loader keeps one row per id, so consumers enabled together share one instance and its one claim, and disabling one consumer leaves the instance and the other consumers' channels running; deployments tune its limits with a patch targeting that id.
### Frame path
```
LibreOffice (Kit producer holding the channel's TX credential)
Host process — Desktop shared-texture hop addon (≤ 128 unsettled; Host IPC: capabilities / adapter-luid only)
│ macOS: Mach port pair (IOSurface port + reply port) ⇄ Main ingress
│ Windows: duplex message named pipe (Host NT HANDLE; Main DuplicateHandle from Host) ⇄ Main ingress
▼
Electron Main — shared-texture ingress addon (delivery queue ≤ 32) + presenter → renderer frame
│ document import result → delivered reply, Main drops its import; both GPU releases → released
▼
Native channel reply (released or invalidated) → hop reader → bridge on_settled returns credit (invalidated stops receiver first → channel lost)
```
## Alternatives considered
**Keep the bundle-declared main, preload, and verify exports.** This hands every installed bundle main-process and session-wide preload execution for one consumer, duplicates a singleton Electron API across bundles, and forces startup-only activation with its restart plumbing through app-boot, plugin manager, manifest types, and the Web plugin list. Rejected in review.
**Keep frame forwarding in Electron Main as a fixed Desktop capability.** This was the intermediate decision. It leaves protocol only one plugin uses and a receiver bound to the Electron main process in `apps/desktop`, couples protocol changes to Desktop releases, and makes the preload API a frame-forwarding API. Its own rejected variants remain rejected for the same reasons: loading the receiver SDK from the Kit installed in the dsh runtime ties every receiver change to a Kit release; libuv completion signalling (`uv_async_t`) lies outside Node-API's ABI guarantee and would force Electron-exact builds.
**Give the Office package its own receiver addon with the hop inside it.** Frame forwarding serves every Host plugin that renders natively, not Office alone, and the hop is Desktop's shared-texture mechanism, not frame forwarding's. An Office-owned addon would have to be copied by the next consumer and would make a feature package the owner of Mach and Win32 handle transfer.
**Electron's managed `sendSharedTexture` and `setSharedTextureReceiver`.** Its fixed 1000 ms acknowledgement deadline fails a view whenever the renderer's main thread is busy longer, and keeping Main's import past the deadline still returned the producer's texture before the renderer's GPU work completed. Rejected after real-device stall tests.
**Load the plugin's addon into Electron Main through an extension slot.** Plugin native code would run in the main process. Loading it in the Host keeps Main's native code fixed to Desktop's ingress addon.
**Publish the receiver as prebuilt npm platform packages now.** Desktop packaging already runs on each target operating system with a C++ toolchain; platform packages would add four packages, a release workflow, and Windows prebuild CI before the package has a second consumer. Deferred, not rejected.
**No native code in Desktop, with pixels copied through the Host.** Each frame would copy tens of megabytes and lose the shared-texture path that motivates native preview. It remains a possible fallback for small viewports, not the design.
**Let the producer send surfaces directly to Main's ingress.** This saves one Mach message per frame but requires Main to authenticate a process it did not spawn and requires the consumer to obtain Main's endpoint before starting the producer. The trust model excludes it; measured hop cost is the condition for revisiting.
**Global IOSurface identifiers (`IOSurfaceLookup`).** Deprecated by Apple and readable by every process of the user.
**Place the receiver in `apps/desktop-host`.** The Desktop Host would then carry one protocol's native build and service; Desktop Host provides shared textures and the preinstalled receiver’s location. The plugin owns the protocol checks and Node-API bindings.
**Keep `dshDesktop.window.setFullscreen`.** It is a Desktop window control per plugin need, read by duck typing, with Main-side restore bookkeeping. Element fullscreen is document-scoped, ends on Escape without plugin code, and tells frame forwarding which channel covers the others.
**Give each consumer bundle its own frame-forwarding row.** Two instances would compete for the one `sharedTexture` claim and the one renderer texture subscription; the second would report native rendering unavailable while the first serves only its own consumer.
**Insert frame forwarding from the Desktop profile itself.** Every Desktop session would load the receiver and hold Desktop's interfaces even with no consumer enabled, and a profile without Desktop-specific rows could not stay shared with Web.
**Making the Office Host plugin itself hide the bundle in Web.** The plugin needs no profile check: without `frameForwarding` support it reports unavailable, the Client registers no UI, and the existing PDF and spreadsheet preview remains.
## Verification
Desktop specs cover the [presenter](../../../../apps/desktop/tests/shared-texture-presenter.spec.ts) (one ingress per Host and replacement for another Host, software-compositing detection, the hop addon path and ingress endpoint, the 128-frame limit, Electron import failure without keeping a reference, renderer import results including a busy renderer, a failed import, and a missing GPU sync token, delivery-before-settlement reply ordering, `reset` invalidating frames sent to the document while keeping the ingress, `dispose` closing the ingress after abandoning sent frames, ingress failure and reopening, adapter LUID readings kept for their GPU process, shared by concurrent queries, not kept when they fail or a GPU process exit overtakes them, and null outside Windows, and the Main entry answering through its channel), the [preload bridge](../../../../apps/desktop/tests/preload-shared-texture.spec.ts) including import reports and the release report after its consumer and the GPU, [sent-texture settlement](../../../../apps/desktop/tests/shared-texture-transfer.spec.ts), the [shared-texture channel](../../../../apps/desktop/tests/shared-texture-channel.spec.ts) accepting only capability and bounded adapter requests and routing control with the Host identity, [generic Host-process channels](../../../../apps/desktop/tests/host-process.spec.ts), [declared native package builds](../../../../apps/desktop/tests/native-package-builds.spec.ts), and the [shared-texture addon verifier](../../../../apps/desktop/tests/shared-texture-runtime.spec.ts). The [Desktop native e2e](../../../../apps/desktop/tests/shared-texture-native.e2e.ts) exchanges real textures between separate Main and Host processes over the built hop and ingress addons from native `dsh_shared_texture_sink_v2` threads, covers every reply kind, refuses presentations that cannot leave the Host without sending them, reports sink ABI version 2 so a consumer built for another version refuses it, rejects frames beyond the 32-frame delivery queue at once while Main's JavaScript thread is blocked and resumes afterwards, ignores another process at the endpoint while continuing to serve the registered Host, ends the connection when a send finds Main gone or Main cannot deliver its replies, stops the ingress on another protocol version or malformed requests, enforces hop delivery deadlines while keeping the slot until Main settles, reconnects and settles once on close or Main exit, and reads the adapter LUID of a shared Direct3D 11 texture as the text Host addons derive while reading none from other handles. The [built-preload e2e](../../../../apps/desktop/tests/preload.e2e.ts) asserts `dshDesktop.textures` exposes only `onFrame` and `dshDesktop` exposes no window control. [Desktop Host specs](../../../../apps/desktop-host/tests/shared-texture.spec.ts) cover the single claim, its end with the claiming scope, including a claim taken inside an effect of that scope as frame forwarding takes it, a release before the scope's disposal that leaves the next holder's claim intact, hop connection reuse and reconnection after disconnect with unsettled frames invalidated, `nativeSink` closing its connection when the claim that took it ends while claims that never took it settle normally, `adapterLuid` returning Main's reading or null without opening the native connection, refusing a reading that is not a LUID, reporting Desktop's reason, and timing out while ignoring the late reply, unrelated channel traffic, and pending work rejected on disposal. Frame-forwarding specs cover the [forwarder](../../../../packages/experimental/frame-forwarding/tests/forwarder.host.spec.ts) (every Windows channel reading the adapter LUID from Desktop, every channel asking Desktop for its current `nativeSink` with concurrent requests shared, the sink deadline capped at 30000 ms, refresh when unattached frames reach JavaScript, deliverable-state updates pushed before each viewport is sent, presentation error and invalidation handling, producer connections and handoff, viewport replay, and teardown), the [Host service](../../../../packages/experimental/frame-forwarding/tests/service.host.spec.ts) with its claim, channel ownership by the opening scope, and Remote, the [receiver loader](../../../../packages/experimental/frame-forwarding/tests/native.host.spec.ts) and its build-record check, the [Client mount](../../../../packages/experimental/frame-forwarding/tests/mount.client.spec.ts), the [wire adapter](../../../../packages/experimental/frame-forwarding/tests/wire.client.spec.ts) with its lifelong texture subscription and fullscreen holder, and [receive channels](../../../../packages/experimental/frame-forwarding/tests/rx.client.spec.ts). The [Desktop bridge native e2e](../../../../packages/experimental/frame-forwarding/tests/desktop-bridge-native.e2e.ts) drives a real producer through the built receiver's C++ sink bridge, covering metadata projection, credit return on release and outside the delivLine truncated
## Consequences
Preinstalling the receiver lets users install or enable the plugin without a C++ toolchain. Native fixes and receiver protocol updates ship with Desktop. Each plugin version checks the preinstalled receiver and reports it as unavailable if incompatible. Steady-state frames bypass the Host's JavaScript event loop; between Host and Main each frame costs Mach messages on macOS or named-pipe messages and one `DuplicateHandle` by Main on Windows, never a pixel copy. Texture lifetime spans three processes: Main owns and closes the Windows handles it duplicated from the Host once Electron's GPU work finishes or Host teardown runs, and a Main exit ends the Host and the producer with it. On Windows, Main opens the Host it spawned with `PROCESS_DUP_HANDLE | SYNCHRONIZE` while the Host never opens Main; a failed open disconnects the pipe and a denied `DuplicateHandle` replies with a delivery error rather than presenting nothing silently.
### Native producer SDK
The native producer interface is still evolving with the Office integration. DSH defers publishing a third-party producer SDK because external plugins could come to depend on C calls that still change with the engine. Reconsider publication once the producer interface has settled. LibreOffice Kit connects through its own engine.
# Agent Note: Frame-forwarding channels with transferable credentials, producer-local handles, covered views, and a memory-sized budget
Status: implemented
English | [中文](2026-10-18-frame-forwarding-channels.zh.md)
## Problem
A frame-forwarding view authorized one producer process. The Host plugin started the producer, passed it a private endpoint, and called `bind(viewId, pid)`; the receiver accepted only that PID, could not be rebound, and failed the view when the producer disconnected. Replacing a producer therefore meant a new receiver, a new view identifier, and a new renderer consumer: the Office preview's CPU restart rebuilt the whole path, a crashed engine took its view with it, and the parent had to know the child's PID before the child connected. A PID is also a poor authorization identity: the operating system reuses it, it names a process rather than a holder of authority, and a successor process of the same feature cannot inherit it.
Once any process holding a channel's credential may connect a producer, what such a producer can do to the Host matters. On Windows a producer duplicated each frame's NT handle into the receiver's process and sent the resulting value, and the receiver treated whatever value arrived as a handle of its own. A packet with a forged value therefore made the Host open that handle as a texture or, on an error path, close it, whichever Host object it named. The same scheme also required the producer to hold `PROCESS_DUP_HANDLE` on the Host, which an engine running in a sandbox below the Host's integrity level cannot obtain.
All channels of the window share one byte budget, granted first come, first served. A producer whose view was hidden stopped rendering but kept its idle pooled surfaces and its pending requests, so a visible view could wait behind a hidden one for budget nobody was using. While one view occupied the screen in a slideshow, the views it covered kept rendering frames nobody could see, and nothing told frame forwarding which channel covered the others.
The budget was also a fixed 256 MiB, at most 1 GiB, whatever the machine. A channel streaming 4K frames holds up to three 3840×2160 surfaces of 31.64 MiB each, so two such channels filled it, and on the Windows relay path, which also reserves three target textures and two staging textures per channel, a 4096-pixel-wide slideshow frame exceeded the share one allocation may take.
## Decision
### Channels and credentials
A receiver is a logical channel with two halves. The Host plugin calls `frameForwarding.channel()` and receives `{ tx, rx }`: `tx` is an opaque, serializable credential that any process holding a copy may present, and `rx` is the receive identity the renderer passes to `frameForwarding.connect(rx)`. `close(rx)` closes the channel permanently and withdraws the credential, and a channel also closes when the Cordis scope that read the service is disposed. `bind`, `bindProducer`, and the receiver's permanent expected PID no longer exist; the OS-reported peer process is checked per physical connection only for packet origin and handle duplication. The credential never reaches a renderer, a log, or a diagnostic.
### Connections and handoff
A channel serves one connection at a time and moves Idle → Active(N) → Draining(N) → Idle → Active(N+1); Closed and Failed are reachable from every state. Connection IDs increase and are never reused; ready carries N, and every later packet is checked against it. While N is connected, other candidates are refused as `channel-busy`, and N is never preempted, even when it stops responding. After N disconnects by goodbye, error, or process exit, N keeps its frames, allocations, budget, relay state, and submitted GPU work until each is released. During that drain one authenticated successor waits for ready within its own deadline and cancellation, and others are refused. Frames and allocations are keyed by connection, delivery IDs stay unique within the channel, credit returns only to the frame's own connection, and a late release of N returns nothing to N+1. GPU work whose completion is unknown keeps its resources and reports `drain-blocked`; no timeout ends a drain. On macOS each connection has its own Mach ports, delivered in ready; on Windows each connection uses its own pipe instance; a failed handshake closes only its candidate. A producer's `close()` completes once its own sender is closed, and the successor's ready completes the handoff.
### Producers name only their own handles
The hello capability `producer-local-handles` declares that every handle a producer names belongs to it. On Windows a frame carries a handle value in the producer's process. When a pipe client connects, the receiver opens that process with `PROCESS_DUP_HANDLE | SYNCHRONIZE` from `GetNamedPipeClientProcessId`, and it duplicates each frame's value from there. A value that names no handle of a live producer ends that connection as "sent a handle it does not own" without touching any Host handle; a producer that already exited took its handles with it, and its connection ends as lost. A hello that carries a handle is dropped, and the producer side never interprets a received value. macOS keeps Mach port transfer, where the kernel names the right in the receiver.
### Compatibility
Channels change no wire protocol version, constant, packet layout, or endpoint prefix; they add hello capability bits that both sides check. The current wire protocol, version 2, sends each packet as a fixed header followed by only the bytes of its text and requires the same capabilities. The hello declares `transferable-tx` and `producer-local-handles`. Ready carries the connection ID in its token field and, in `ready.stride`, unused before, echoes the capabilities the receiver accepted. A receiver refuses a producer without `transferable-tx` as `transferable-tx-required`, one without `producer-local-handles` as `producer-local-handles-required`, and a producer of another version as `protocol-mismatch`, naming both versions. A producer refuses a ready without a connection ID or without the `producer-local-handles` echo, so neither side of a mixed build sends or reads a handle value under the other rule. Build records (the Kit's `sdk.json`, `receipt.json`, and prebuild manifests, and DSH's `frame-forwarding.json`) list `capabilities: ["transferable-tx", "producer-local-handles"]`, and their loaders and verifiers reject artifacts without both, so a matching version number alone never passes a compatibility check. Desktop [preinstalls the receiver](2026-10-15-desktop-shared-texture-api.md). The Kit 0.2.3 engine is a protocol 1 producer, which the protocol 2 receiver refuses as `protocol-mismatch`.
### Host and renderer
The Host keeps the renderer's latest viewport per channel, sends it to each new connection, and presents frames only from the current connection, up to the latest viewport's version. The gate opens before the viewport is sent, because the receiver judges a frame in native code, possibly before the Host's JavaScript handles the acknowledgement that preceded it. A viewport request belongs to the connection that received it and reports `producer-changed` when that connection ends; a timeout fails the request and keeps the channel. Each event-stream subscription starts with a snapshot of every channel's state, then carries states with increasing sequence numbers and producer errors. Frame metadata carries `connectionId` beside `generation`, which remains the viewport version. A `FrameRx` streams the latest frame across producer switches. Frames whose connection state has yet to arrive wait within the channel's frame limit, and the renderer releases frames from earlier connections. Native producers can still use `dsh_frame_forwarding_submit` for ordered delivery or `dsh_frame_forwarding_submit_latest` for replaceable frames. `ready()` resolves once a producer acknowledged the latest viewport.
On `invalidated`, which [Desktop's settlement](2026-10-15-desktop-shared-texture-api.md) reports when the document, renderer, or GPU process went away first, the bridge queues the notice, then stops the receiver and the frame's connection before releasing the delivery, so its producer never writes that texture again; the forwarder closes the channel as `lost` when it handles the notice. A producer disconnect, by contrast, drains and hands over.
### Hidden and covered views return their surfaces
A consumer sends its next viewport version with `visible: false` whenever its view is hidden or covered. The producer SDK's `dsh_frame_forwarding_trim` deallocates every surface that is neither acquired nor submitted: available surfaces, the queued latest frame, granted allocations not yet created, and pending requests; on Windows it then flushes the producer's D3D11 context, because D3D11 destroys a released texture only at the next flush. The Kit engine trims after acknowledging an invisible viewport, so its allocations return to the shared budget, and its next visible frame requests them again.
### The window budget follows physical memory
`maxBytes: auto`, the default, resolves to half of physical memory and at least 256 MiB when the first channel opens; no budget exceeds physical memory, and a larger byte count is reduced to it with a Host warning. Sizing waits for the first channel because a Host that never loads the receiver, such as the browser worker deployment, cannot read physical memory. The budget is a ceiling, not a reservation: each channel still holds at most `maxFrames` surfaces, so a larger budget lets more channels hold surfaces at once without enlarging any of them. A producer whose allocation does not fit waits until other channels return surfaces; its channel stays open, and its consumer keeps what it shows and draws a placeholder where content has not arrived.
### Fullscreen belongs to frame forwarding
A receive channel shows its consumer's element fullscreen through the document's Fullscreen API with `FrameRx.requestFullscreen(element)`, which the consumer calls before its click handler awaits anything. One channel holds fullscreen at a time. Every other channel learns `{ active: true, holder: false }` and treats its view as covered; the holder learns `active: false` when the fullscreen ends, including on Escape; closing the holding channel or disposing the Client leaves its fullscreen. Desktop exposes no window control of its own ([shared-texture API](2026-10-15-desktop-shared-texture-api.md)).
Each document view runs its Host operations in arrival order, and different views run concurrently, so a view that waits for frame surfaces delays only its own later operations. A frame that misses `frameTimeoutMs`, or the Kit engine's own report that no frame surface became free, does not fail the view: tiles and page previews request their frame again once the late request settles, a slideshow keeps its stream, and the view keeps its retained tiles, page previews, or last slideshow frame, draws a checkerboard where nothing has arrived, and says that it waits for graphics memory until a frame draws.
## Alternatives considered
**Rebind the receiver to a successor's PID.** This keeps the PID as authority, still requires the parent to learn the child's PID before it connects, and needs a new bind call for crash takeover.
**Preempt a connected producer after a timeout.** A stalled producer may still own GPU work on the channel's textures, so preemption would hand those textures to a successor while they are in use. Only the operating system's disconnect or the producer's own close starts a drain.
**Connect the successor at once and keep the old connection's frames separately.** Two producers would share one channel's budget and frame limit, and the renderer would interleave their frames. Draining first keeps one producer's resources and credit in flight at a time.
**Open a new channel per producer, as before.** Every producer switch would replace the renderer's consumer and lose its viewport and stream subscription.
**Mark channels with a new wire protocol version.** Channels change no packet layout; capability bits that both sides check refuse mixed builds as well, and the frame-forwarding README promises that within a version the wire changes only by such capabilities.
**Return invalidated textures through a drain.** Desktop cannot observe their remaining references, so a successor could write a texture a stale document still reads; a closed channel is the only state in which releasing them is safe.
**Validate the received value before use.** The receiver could check that a value names a shared D3D11 texture. That checks the object's type, not its owner: a forged value naming another channel's texture or any other shared object of the Host passes, and error paths still release the value.
**Keep producer-side duplication and verify it in the receiver.** The receiver cannot tell a value the producer duplicated in from a value it guessed without the producer's handle table, and the producer would still need `PROCESS_DUP_HANDLE` on the Host, which a sandboxed engine lacks.
**A new wire message that pauses covered producers.** Viewport visibility already tells a producer to stop rendering, carries a version the Host orders, and reaches each new connection through the viewport replay, so a separate pause message would duplicate it.
**Per-channel byte caps or a channel count limit.** Trimming covered views and closing channels with the scope that opened them handle the observed contention; on the Windows relay path the budget formula would make a low cap block a 4K slideshow. Deferred until a measurement shows the need.
**Fullscreen the document element and keep the slideshow overlay on `document.body`.** The application chrome would then share the fullscreen screen, including the Windows menu and caption controls that need their own fullscreen handling, and frame forwarding could not name the covering view.
**Keyboard Lock.** Letting a holder keep Escape suits games, not slideshows, and is deferred until a consumer needs it.
**Keep a fixed default budget.** 256 MiB held two 4K streams on the shared-texture paths and refused a 4096-pixel-wide frame on the relay path, however much memory the machine had.
**A quarter of physical memory**, the ceiling Chromium sets for a renderer's tile memory. Half lets more views render at once, which suits using whatever the machine has, and still stays below the working set Metal recommends, about two thirds to four fifths of unified memory.
**95% or 100% of physical memory.** The operating systems' graphics limits are lower: WDDM lets graphics use `min(80%, max(RAM − 16 GB, 50%))` of system memory, and Metal's recommended working set is the fraction above. The same memory also holds the engines, Chromium, and other applications. Frame forwarding would never refuse first: exhaustion would surface wherever the operating system fails an allocation, for example in Chromium's GPU process, whose exit closes every channel, and nothing would bound the frame memory producers make the Host and the GPU process hold.
**Fail a view whose frame misses its deadline.** A missing allocation is usually temporary: hiding, covering, or closing another view frees it, while a failed view waits for the user to retry.
**Run every Office operation in one Host queue.** A view waiting for frame surfaces would hold every other document's operations for the engine's whole wait, and opening one document would stall the others.
**Tell a budget wait from a stalled engine.** The receiver does not report a pending grant to the Host, and distinguishing that state would require a new producer-to-Host diagnostic; an engine that stops answering still ends at `operationTimeoutMs`.
**Size the budget from the operating system's GPU budget** (DXGI `QueryVideoMemoryInfo`, Metal `recommendedMaxWorkingSetSize`). It would follow dedicated video memory, which physical memory does not show, but requires platform-specific native queries in the receiver.
## Verification
The Kit's transport tests and DSH's [receiver native e2e](../../../../packages/experimental/frame-forwarding/tests/receiver-native.e2e.ts) connect a separate producer process with a copied credential and cover busy refusal, a waiting successor, deadline expiry, crash takeover, IDs reused across connections with late releases, mixed-build refusals in both directions including a producer built without `producer-local-handles` and a ready without the echo, budget return after repeated handoffs, and a trimmed producer's allocation passing to another channel sharing its budget. On Windows the Kit's tests close the connection of a producer that sends a receiver handle's value while that sentinel handle stays valid, and show the trimmed textures' video memory freed through the shared-texture and relay paths; the serialized native suite passes on macOS arm64, two Windows x64 hardware hosts, and Windows ARM64. The [Kit frames e2e](../../../../packages/experimental/frame-forwarding/tests/kit-frames-native.e2e.ts) hands a real Office engine's channel to a replacement and, after a crash, to a successor, renders two engines on two channels at once, and trims an invisible engine's surfaces. Unit specs cover the Host's viewport replay and connection-bound requests, the renderer's snapshot and sequence handling and early-frame ordering, the [wire adapter](../../../../packages/experimental/frame-forwarding/tests/wire.client.spec.ts) and [receive channel](../../../../packages/experimental/frame-forwarding/tests/rx.client.spec.ts) with the single fullscreen holder, coverage events, exits during a pending entry or after Escape, and exits on close and disposal. The [service specs](../../../../packages/experimental/frame-forwarding/tests/service.host.spec.ts) cover `auto` at half of physical memory, its 256 MiB floor, and the refused load of a budget above physical memory.
## Consequences
Producer replacement and crash takeover keep the channel, the renderer's consumer, and the viewport, and need no PID: a parent hands over a string. In exchange, every protocol 1 receiver, producer, engine, and build record must be upgraded together, and older builds are refused explicitly: Kit 0.2.2 and earlier producers and receivers cannot interoperate with these sources in either direction, so the Kit, its engines, and Desktop, which compiles the receiver when it packages, upgrade together. A stalled producer that stays connected blocks its channel until it exits or the channel closes, and a successor waits for Desktop and its consumers to release the previous producer's frames. A GPU-process exit closes the channels that had frames on screen, and its consumer must open a new channel instead of continuing on the old one. A producer must keep a sent handle open until the receiver reads the frame, and a producer that exits right after submitting loses that frame with its connection. An engine sandboxed below the Host's integrity level keeps working, since only the Host opens the other process; conversely a producer elevated above the Host, which the Host cannot open, cannot connect, and the receiver closes it during the handshake without a Host diagnostic. A view that becomes visible again waits for an allocation grant before its first frame, and trimming returns frame surfaces only, not an engine's own renderer caches. Escape always leaves fullscreen, and coverage is per document: a fullscreen element of the document covers every receive channel except the holder's. On Windows machines with 32 GB or less, half of physical memory equals the system memory WDDM lets graphics use, so the operating system's limit can be reached there before the budget; a discrete GPU keeps frames in its dedicated memory, which the budget does not see, and WDDM pages rather than fails when that memory runs out.
握手能力 `producer-local-handles` 声明生产者指名的每个句柄都归它所有。在 Windows 上,帧携带的是生产者进程中的句柄值。管道客户端连接时,接收端根据 `GetNamedPipeClientProcessId` 以 `PROCESS_DUP_HANDLE | SYNCHRONIZE` 打开该进程,并从那里复制每一帧的值。若值不对应仍在运行的生产者的任何句柄,该连接以“sent a handle it does not own”结束,且不触碰任何 Host 句柄;已退出的生产者带走了自己的句柄,其连接以丢失结束。携带句柄的 hello 会被丢弃,生产者一侧从不解读收到的值。macOS 保留 Mach 端口传递,由内核在接收端中为端口权限命名。
Each path segment is percent-encoded with `encodeURIComponent` and then `!`, `'`, `(`, `)`, and `*`, so the reference is also a valid unquoted CSS `url()`, and the package name is emitted verbatim. The URL is relative to the shell document, like every app-owned route, so it resolves under any mount and from injected `<style>` text. Components need no hook, injected value, or service: the URL is a module constant computed when the module first runs.
The supported extensions are `.svg`, `.png`, `.webp`, `.jpg`, and `.jpeg`. [`src/assets.ts`](../../../../packages/client/modules/src/assets.ts) in client-modules owns the media-type table, the export key and target, the revision, the emitted name, and the URL, and the preset, the route, and the gates read them from there. The shared Client type root [`scripts/types/client-assets`](../../../../scripts/types/client-assets/index.d.ts), registered in [`tsconfig.base.client.json`](../../../../tsconfig.base.client.json), declares each extension as a module with a string default export; a test keeps it equal to the table.
The supported extensions are `.svg`, `.png`, `.webp`, `.jpg`,`.jpeg`, `.woff2`, `.woff`, `.ttf`, and `.otf`. [`src/assets.ts`](../../../../packages/client/modules/src/assets.ts) in client-modules owns the media-type table, the export key and target, the revision, the emitted name, and the URL, and the preset, the route, and the gates read them from there. The shared Client type root [`scripts/types/client-assets`](../../../../scripts/types/client-assets/index.d.ts), registered in [`tsconfig.base.client.json`](../../../../tsconfig.base.client.json), declares each extension as a module with a string default export; a test keeps it equal to the table.
### Build
The `dsh-package-asset` plugin of the dynamic browser face resolves an import against its source location and fails the build when the file's real path is outside the package's `src/client/assets/` (which also rejects another package's or a dependency's image), when `exports["./assets/*"]` is not exactly `./lib/assets/*`, when the extension is unsupported, when a path segment is `node_modules` or contains `%`, `#`, `?`, `\`, or NUL, which the Host route cannot serve, or when the extension is not lowercase, as the import types are. It emits each file once per build and registers it as a watch input. The three CSS pipelines (CSS Modules, global, and `?inline`) rewrite relative `url()` values through a lightningcss visitor in stylesheets inside the package's own `src/`; `data:`, fragment, scheme, `/`-prefixed, and empty URLs stay unchanged, a relative file reference with a fragment or query fails the build, and dependency stylesheets are not rewritten. lightningcss does not call its `Url` visitor inside `image-set()`, so an `Image` visitor rewrites those options with the same rule. The rewrite writes an identifier placeholder that lightningcss never escapes, so a file name with parentheses or quotes still becomes its resolver call. The Node Client face of a dual-face package rejects asset imports. The browser face is the only writer of `lib/assets/`: a one-shot build deletes files it did not emit, and a watch rebuild keeps them, because the Host still serves the previous bundle generation and pages running it request those names.
The `dsh-package-asset` plugin of the dynamic browser face resolves an import against its source location and fails the build when the file's real path is outside the package's `src/client/assets/` (which also rejects another package's or a dependency's image), when `exports["./assets/*"]` is not exactly `./lib/assets/*`, when the extension is unsupported, when a path segment is `node_modules` or contains `%`, `#`, `?`, `\`, or NUL, which the Host route cannot serve, or when the extension is not lowercase, as the import types are. It emits each file once per build and registers it as a watch input. The three CSS pipelines (CSS Modules, global, and `?inline`) rewrite relative `url()` values through a lightningcss visitor in stylesheets inside the package's own `src/`; `data:`, fragment, scheme, `/`-prefixed, and empty URLs stay unchanged, a relative file reference with a fragment or query fails the build. A stylesheet that a dependency package owns, the nearest named `package.json` above it other than the package's own, is rewritten as well: its referenced file must lie inside that dependency and is emitted under `lib/assets/vendor/<dependency name>/<path in the dependency>`, and each `@font-face` keeps only its first `url()` source. A stylesheet that neither the package's `src/` nor a dependency owns is not rewritten. lightningcss does not call its `Url` visitor inside `image-set()`, so an `Image` visitor rewrites those options with the same rule. The rewrite writes an identifier placeholder that lightningcss never escapes, so a file name with parentheses or quotes still becomes its resolver call. The Node Client face of a dual-face package rejects asset imports. The browser face is the only writer of `lib/assets/`: a one-shot build deletes files it did not emit, and a watch rebuild keeps them, because the Host still serves the previous bundle generation and pages running it request those names.
### Host route
@@ -48,9 +48,9 @@ A rebuilt image produces a new file name in a rebuilt `client.js`, which reaches
### Gates and migration
[`check-workspace-constraints`](../../../../scripts/check-workspace-constraints.ts) requires `lib/assets` in `files` when the export is declared. [`verify-client-packages`](../../../../scripts/verify-client-packages.ts) requires the exact export target, allows the export only on dynamic Web Client packages, and keeps the export and the package's references (imports, and `url()` in the stylesheets its Client sources import) consistent in both directions. [`verify-package-dependencies`](../../../../scripts/verify-package-dependencies.ts) treats `./assets/*` as a non-code export. ui-settings-account and ui-chat moved to package assets, and ui-chat's tsdown plugin is gone.
[`check-workspace-constraints`](../../../../scripts/check-workspace-constraints.ts) requires `lib/assets` in `files` when the export is declared. [`verify-client-packages`](../../../../scripts/verify-client-packages.ts) requires the exact export target, allows the export only on dynamic Web Client packages, and keeps the export and the package's references (imports, and `url()` in the package and dependency stylesheets its Client sources import) consistent in both directions. [`verify-package-dependencies`](../../../../scripts/verify-package-dependencies.ts) treats `./assets/*` as a non-code export. ui-settings-account and ui-chat moved to package assets, and ui-chat's tsdown plugin is gone.
Images that third-party libraries load themselves (PDF.js fonts, cmaps, wasm, and workers), plugin metadata icons, detail-document images, and static-linked packages keep their own delivery.
Files that third-party libraries load themselves (PDF.js fonts, cmaps, wasm, and workers), plugin metadata icons, detail-document images, and static-linked packages keep their own delivery.
@@ -10,7 +10,7 @@ Application grants stored as plugin configuration make each authorization change
## Decision
The CUA owner uses the existing domain storage service, with one domain per canonical profile directory. It stores long-term grants and conversation decisions by native application identity. Conversation IDs scope permission without turning it into permission for every conversation. The native identity policy remains owned by [bundle-ID consent](2026-10-25-cua-bundle-id-consent.md); this note replaces only that note's storage and restart-lifetime choices.
The CUA owner uses the existing domain storage service, with one domain per canonical profile directory. It stores long-term grants and conversation decisions by native application identity. Conversation IDs scope permission without turning it into permission for every conversation. The native identity policy remains owned by [bundle-ID consent](2026-10-25-cua-bundle-id-consent.md); this note replaces only that note's storage and restart-lifetime choices. [Permission attributes](2026-11-26-cua-permission-attributes.md) decide which stored records a selection matches.
Every operation opens fresh domain state while holding the profile's existing file-lock primitive and closes the domain before releasing the lock. Native dispatch and revocation use a separate lock for the selected application. Storage reads and unrelated applications remain available during a native call. Revocation cancels this process's affected work first, then commits after other processes' already-admitted operations have finished. A completed revocation therefore leaves no operation using the old authority. App-wide revocation generations and per-conversation decision revisions prevent an old handle or delayed answer from restoring revoked access.
CUA 使用现有域存储服务,每个 profile 的真实目录对应独立存储域,按本机应用身份保存长期许可和会话决定。对话 ID 限定权限范围,不把本会话许可扩展为所有对话的许可。本机身份规则仍由[Bundle ID 授权](2026-10-25-cua-bundle-id-consent.zh.md)负责,本记录仅替代其中的存储和重启后有效期选择。
CUA 使用现有域存储服务,每个 profile 的真实目录对应独立存储域,按本机应用身份保存长期许可和会话决定。对话 ID 限定权限范围,不把本会话许可扩展为所有对话的许可。本机身份规则仍由[Bundle ID 授权](2026-10-25-cua-bundle-id-consent.zh.md)负责,本记录仅替代其中的存储和重启后有效期选择。[权限属性](2026-11-26-cua-permission-attributes.zh.md)决定选择匹配哪些已存储记录。
English | [中文](2026-10-19-im-session-strategies.zh.md)
## Problem
IM deployments differ on how incoming chat messages map to agent sessions. A per-chat conversation deployment gives each chat its own persistent session and delegates long work to background tasks, whereas a multi-chat triage deployment wants one shared dispatcher session to read addressed messages across chats and reply or delegate work from there. Both models need the same message admission, durability, outbound receipts, and authorized `im_*` tools. Hard-coding a single routing model inside the IM host would force a fork of the host for any other routing model.
## Decision
The [IM service](../../../../packages/experimental/im/README.md) owns platform intake, durability, session hosting (`ctx.im.sessions`), outbound publication (`ctx.im.send`/`stream`), and the `im_*` tools, while session selection is handled by listeners on the `im/message` waterfall (and the optional built-in `defaultDispatch` fallback on `@deepseek-ai/dsh-experimental-im`).
The host's own fallback lives in [`dispatcher.ts`](../../../../packages/experimental/im/src/dispatcher.ts): with `defaultDispatch` configured, addressed messages no listener claimed reach a single shared session (`im:dispatcher`) that accumulates bindings for each chat it hears and receives a `<im-chat key="…" source="…" type="…" />` header before each message. Read and publication tools accept an optional `chat` parameter so a multi-chat session can target any chat in its bindings.
## Alternatives considered
**Hard-coding per-chat sessions in `@deepseek-ai/dsh-experimental-im`.** Baking `conversation:<chatKey>` routing into the host would prevent one-shot command plugins, custom routing plugins, or a shared dispatcher session from using the same intake and session store.
**Listing dynamically accumulated chats inside a static system prompt.** A dispatcher session's bound chats grow as new chats send messages; prefixing each delivered message with `<im-chat key="…" />` tells the model which chat sent the message without rewriting earlier turns.
## Consequences
Each session key in `im_sessions` is owned by the `owner` name that created it (`dispatcher` for the default fallback, or the name a plugin picks), and `ctx.im.sessions.ensure` rejects attempts by a different `owner` to claim an existing key. A shared dispatcher session serializes turns across all chats it serves.
不同的 IM 部署对入站聊天消息如何映射到 agent 会话有不同需求。按聊天隔离的部署为每个聊天维护一个独立的持久化会话,并将耗时工作委派给后台任务;而集中处理多个聊天的部署则希望由一个共享的分派会话统一接收各聊天的消息并负责回复或委派。两种模式都需要相同的消息准入、持久化存储、发送回执与 `im_*` 授权工具。如果将单一路由模型写死在 IM 宿主中,其他路由模式就必须复制整套宿主逻辑。
@@ -10,7 +10,7 @@ Using `parentSession` for both copied history and delegation makes an ordinary f
## Decision
Ordinary forks preserve their complete selected prefix, `isSeeded`, `inheritedEventCount`, and inherited end-seed marker, but record no source id. Subagents retain their direct creator, including when their backend copies history. `origin: subagent` supplies coarse classification; a valid own-range descriptor separately supplies continuation identity. Historical parent metadata remains readable and unchanged. Runtime Agent ownership remains governed by the [explicit identity decision](2026-08-31-explicit-agent-runtime-identity.md).
Ordinary forks preserve their complete selected prefix, `isSeeded`, `inheritedEventCount`, and inherited end-seed marker, but record no source id. Subagents retain their direct creator, including when their backend copies history. `origin: subagent` supplies coarse classification, and `origin: side` marks an ordinary fork created as a side conversation, which records its source under the [side conversation source decision](2026-11-26-side-conversation-source.md); a valid own-range descriptor separately supplies continuation identity. Historical parent metadata remains readable and unchanged. Runtime Agent ownership remains governed by the [explicit identity decision](2026-08-31-explicit-agent-runtime-identity.md).
The V4 reader permits another Session's delivery id only inside the validated inherited range. Own-range markers still require the current id, and every active-generation `throughSeq` must precede its marker. These checks do not require a persistent source relationship.
@@ -12,7 +12,7 @@ Users who install multiple versions of one application want one permission decis
macOS application consent uses the exact, case-sensitive native bundle identifier. The helper hashes `macos:bundle-id:` followed by that identifier into `CuaApplicationId`. When a bundle identifier exists, installation paths, versions and signatures do not distinguish grants. Otherwise, the helper hashes `macos:executable-path:` followed by the canonical executable path. Both identities support saved access; path identities survive restart and in-place updates, while a different path requires a new decision. Conversation decisions and saved grants retain the scopes and revocation behavior of [profile consent storage](2026-10-19-cua-profile-consent-storage.md).
This supersedes the executable/signature identity choice in [application consent](2026-09-26-cua-application-consent.md); that note still owns enforcement and human decisions. The running process path comes from the operating system. A valid runtime bundle identifier does not depend on path-query success. Missing paths omit optional grant metadata; they never substitute a cached catalog path. When both bundle identity and process path are unavailable, consent fails with the path query cause. Process identity must still be verified, and any available process path must match the selected target. Missing catalog path metadata does not block consent when the process path is available. If the runtime bundle identifier is unavailable, a reported application bundle can supply it only when its main executable matches the process path; otherwise the executable path identifies the grant. Native process, executable-location and window checks continue to bind each handle to its selected target. Launch checks reread the bundle identifier and executable path from disk; they do not fingerprint executable content. Replacing bytes at the same path while retaining the identifier or path identity therefore retains consent, including during an approval wait.
This supersedes the executable/signature identity choice in [application consent](2026-09-26-cua-application-consent.md); that note still owns enforcement and human decisions. The running executable path comes from the operating system: applications use the executable URL in their macOS application metadata, and processes without that metadata use the kernel process path. Applications such as Google Chrome can run from a temporary code-signing copy whose kernel path names the copy instead of the installed executable. A valid runtime bundle identifier does not depend on path-query success. Missing paths omit optional grant metadata; they never substitute a cached catalog path. When both the bundle identifier and the running executable path are unavailable, consent fails with the path query cause. Process identity must still be verified, and any available running executable path must match the selected target. Missing catalog path metadata does not block consent when the running executable path is available. If the runtime bundle identifier is unavailable, a reported application bundle can supply it only when its main executable matches the running executable path; otherwise that path identifies the grant. Native process, executable-location and window checks continue to bind each handle to its selected target. Launch checks reread the bundle identifier and executable path from disk; they do not fingerprint executable content. Replacing bytes at the same path while retaining the identifier or path identity therefore retains consent, including during an approval wait.
The identity prefixes separate new grants from old path/signature, process-instance and executable-content digests. Old grants remain removable but do not grant access to new bundle identities; users decide again before permission covers other installations.
Another program declaring the same bundle identifier or replacing an executable at its approved fallback path inherits consent, including a program created or changed through separately authorized model tools. The worst consequence is observing or controlling an application that the user did not approve separately, within its available data and capabilities. The model cannot supply the authorization identity through the CUA request; the native helper reads it from the selected application. Different bundle identifiers require different decisions, even when users consider them versions of one product.
Another program declaring the same bundle identifier or replacing an executable at its approved fallback path inherits consent, including a program created or changed through separately authorized model tools. Because application metadata supplies the running executable path, the selection check compares the executable that macOS registered for an application process, not the image the kernel runs: a process whose running image differs from that registration, such as an application still running after an in-place update, keeps the registered path and identity. The worst consequence is observing or controlling an application that the user did not approve separately, within its available data and capabilities. The model cannot supply the authorization identity through the CUA request; the native helper reads it from the selected application. Different bundle identifiers require different decisions, even when users consider them versions of one product.
Revocation applies to every installation sharing the identifier. Tests exercise unsigned copies, different identifiers, missing identifiers with persistent path consent, process restarts, symlink aliases, pending and running identity agreement, shared handle revocation and refusal to widen old grants.
Revocation applies to every installation sharing the identifier. Tests exercise unsigned copies, different identifiers, missing identifiers with persistent path consent, application metadata that differs from the kernel process path, process restarts, symlink aliases, pending and running identity agreement, shared handle revocation and refusal to widen old grants.
本决策取代[应用授权](2026-09-26-cua-application-consent.zh.md)中的可执行文件和签名身份选择,原记录仍负责执行检查与用户决定。运行进程的可执行路径由操作系统提供。有效的运行时 Bundle ID 不依赖路径查询成功。无法取得路径时省略授权记录中的可选路径信息,不用缓存的应用目录路径代替。Bundle ID 和实际路径均不可用时,授权失败并报告路径查询原因。进程身份仍须验证,可取得的实际路径仍须与所选目标一致。只要能取得实际进程路径,应用目录信息中缺少路径不会阻止授权。运行时无法取得 Bundle ID 时,仅在其报告的应用 bundle 主可执行文件与进程路径一致时读取该标识,否则按可执行路径识别授权。原生进程、可执行文件位置和窗口检查继续把每个句柄绑定到所选目标。启动检查从磁盘重新读取 Bundle ID 和可执行路径,但不计算可执行内容指纹。因此,在相同路径下替换内容且保留相同标识或路径身份时,许可仍会沿用,包括等待用户批准期间的替换。
本决策取代[应用授权](2026-09-26-cua-application-consent.zh.md)中的可执行文件和签名身份选择,原记录仍负责执行检查与用户决定。运行中的可执行路径由操作系统提供:应用使用其 macOS 应用元数据中的可执行文件 URL,没有应用元数据的进程使用内核报告的进程路径。Google Chrome 等应用可能从临时代码签名副本运行,内核报告的路径指向该副本,而不是已安装的可执行文件。有效的运行时 Bundle ID 不依赖路径查询成功。无法取得路径时省略授权记录中的可选路径信息,不用缓存的应用目录路径代替。Bundle ID 和运行中的可执行路径均不可用时,授权失败并报告路径查询原因。进程身份仍须验证,可取得的运行中可执行路径仍须与所选目标一致。只要能取得运行中的可执行路径,应用目录信息中缺少路径不会阻止授权。运行时无法取得 Bundle ID 时,仅在其报告的应用 bundle 主可执行文件与运行中的可执行路径一致时读取该标识,否则按该路径识别授权。原生进程、可执行文件位置和窗口检查继续把每个句柄绑定到所选目标。启动检查从磁盘重新读取 Bundle ID 和可执行路径,但不计算可执行内容指纹。因此,在相同路径下替换内容且保留相同标识或路径身份时,许可仍会沿用,包括等待用户批准期间的替换。
身份前缀将新授权与旧的路径和签名、进程实例、可执行内容摘要分开。旧授权仍可撤销,但不能授予新 Bundle ID 身份访问权限;许可覆盖其他安装副本前,需要用户重新决定。
@@ -28,6 +28,6 @@ Apple 的 [PPPC 配置](https://support.apple.com/guide/deployment/privacy-prefe
## 后果
其他程序声明相同 Bundle ID,或替换路径授权对应的可执行文件时,会继承许可,包括通过其他已授权模型工具创建或修改的程序。最坏后果是在应用已有数据和能力范围内,读取或控制用户未单独批准的程序。模型不能在 CUA 请求中提交授权身份,该身份由原生 helper 从实际选中的应用读取。不同 Bundle ID 仍需分别授权,即使用户将它们视为同一产品的不同版本。
English | [中文](2026-10-25-im-architecture-v4.zh.md)
## Problem
An IM integration has to answer three independent questions: what the platform delivered and what a session is allowed to do with it, which session should receive an incoming message, and how a running turn should be displayed in the chat. Combining routing and output rendering inside the core IM service forces every deployment onto a single routing strategy and a single platform payload builder, and requires modifying the core whenever a new slash command, routing strategy, or output format is needed.
## Decision
`@deepseek-ai/dsh-experimental-im` is a platform-neutral host: it admits and stores platform messages, hosts agent sessions, enforces chat bindings and publication receipts, and tracks turn activity. Routing, slash commands, background tasks, and turn output rendering are separate plugins.
### The host
[`ImService`](../../../../packages/experimental/im/src/index.ts) provides `ctx.im` (`sessions`, `history`, `outputs`, `send`, `stream`, `format`, `bot`, `chat`, and `status()`) as defined in [`api.ts`](../../../../packages/experimental/im/src/api.ts). Intake ([`intake.ts`](../../../../packages/experimental/im/src/intake.ts)) resolves `satori/receive` only after both the message record and the event deduplication digest are persisted in `im_messages`, and the adapter acknowledges the platform event afterwards. Redelivering a `(bot, eventId)` the intake already recorded is the same delivery, so the record the first delivery stored stands and a payload that drifted from it is logged once; messages from chats not matched by any `sources` rule are neither stored nor emitted. The dispatch loop then runs the `im/message` waterfall for each admitted message—different chats in parallel, messages within the same chat sequentially in `seq` order—and records the outcome. Retention removes only expired settled records; pending messages and pending receipts remain until resolved.
Hosted sessions ([`sessions.ts`](../../../../packages/experimental/im/src/sessions.ts)) are keyed by an owner-defined string (`im:dispatcher` for the default dispatcher, or any key a plugin picks) with one active session per key, storing the composition, bindings, output renderer, and owner metadata on the record itself. `ensure` creates or updates the record, `deliver` persists a delivery intent (`steer`, `followup`, or `inject`) and deduplicates it against the session log before inserting into the agent inbox, `reset` disposes the agent and increments `generation` to issue a new `sessionId`, and `stop` cancels a running turn. Outbound sends go through [`send.ts`](../../../../packages/experimental/im/src/send.ts), where an optional `operationId` records a durable receipt (`confirmed`, `failed`, `uncertain`, or `partial`).
### Message routing and the default dispatcher
`im/message` is a waterfall declared in [`api.ts`](../../../../packages/experimental/im/src/api.ts). Listeners registered with `{ prepend: true }` run before routing strategies—[`session-commands`](../../../../packages/experimental/im-session-commands/src/index.ts) uses this position so `/stop`, `/clear`, `/new`, `/status`, `/help`, and passthrough commands run before any strategy turns the message into model input. Routing plugins register in normal order and call `next()` when a message does not match their rules. When `defaultDispatch` is configured on `@deepseek-ai/dsh-experimental-im`, the innermost fallback ([`dispatcher.ts`](../../../../packages/experimental/im/src/dispatcher.ts)) delivers any remaining addressed message to a single shared session (`key: 'im:dispatcher'`, `owner: 'dispatcher'`), accumulating chat bindings as messages arrive and prefixing each message with `<im-chat key="…" source="…" type="…" />`; without `defaultDispatch`, the fallback returns `ignored`. If a listener throws, the message remains `pending` for retry, so listeners must pass deterministic delivery ids and `operationId` values.
### Session strategies
Routing is a listener's decision: a plugin that wants one session per chat, one session per command, or one session per topic registers on `im/message` and hosts what it needs through `ctx.im.sessions`. The shipped bundle mounts `session-commands` and, when `defaultDispatch` is configured, the host's own dispatcher; no other listener claims a message.
### Output renderers
The host aggregates agent events for each turn of a hosted session into an `ImActivity` snapshot, emits `im/activity`, and drives the renderer named by `spec.output` through `ctx.im.outputs` ([`outputs.ts`](../../../../packages/experimental/im/src/outputs.ts)). `output: 'none'` is the default, so a hosted session publishes only when the agent calls `im_send`, `im_reply`, or `im_send_file`; the shipped bundle registers no renderer, and a plugin that wants streamed progress registers one instead of changing the host.
### Platform layer
Below `ctx.im` sit the vendored Satori packages: [`plugin-im-core`](../../../../vendor/im/core/src/index.ts) (protocol, per-mode element registry, transformation and fallback table, capability evaluation, degradation scoring, stream scheduler, and test conformance kit), [`satori-element`](../../../../vendor/im/element/src/index.ts) (element types and GFM markdown conversion), and the [`plugin-im-adapter-lark`](../../../../vendor/im/adapter-lark/src/bot.ts) and [`plugin-im-adapter-qq`](../../../../vendor/im/adapter-qq/src/bot.ts) adapters.
## Alternatives considered
**A single `ctx.imSessions` strategy service instead of the `im/message` waterfall.** Requiring the host to call a single strategy service prevents command plugins, custom command handlers, and routing strategies from composing in sequence, and forces platform adapters to wait on strategy injection before connecting. A waterfall allows pre-routing command listeners, routing plugins, and the default dispatcher fallback to compose in a deterministic order.
**Building platform card payloads inside the host.** Embedding one platform's card JSON and streaming schedule inside `dsh-im` couples every deployment to that platform and makes automatic turn streaming mandatory. Separating `im/activity` and `ctx.im.outputs` keeps platform-neutral rendering in a plugin that registers on that registry while allowing `output: 'none'` sessions to publish solely through explicit tool calls.
**Streaming assistant text into the chat by default.** Automatically publishing every assistant turn conflicts with agents that use explicit `im_send`/`im_reply` calls to decide what to say and in which chat. Defaulting `output` to `'none'` keeps session hosting independent of turn rendering.
**Splitting the `im_*` tools into a separate `tool-*` package.** Splitting them from the service that owns chat grants and publication receipts required duplicate internal contracts to pass session identity and permissions across packages. Registering the `im_*` tools in the host keeps each tool alongside the state it enforces.
## Consequences
A deployment mounts `@deepseek-ai/dsh-experimental-im` together with the routing plugins and output renderers it needs. If no routing plugin matches a message and `defaultDispatch` is not configured, the message is acknowledged, stored, and recorded as `ignored` in `ctx.im.status()`.
Waterfall listeners are responsible for idempotency: because a throwing listener leaves the message `pending` for retry, plugins must supply deterministic delivery ids and `operationId` values so retries do not duplicate inbox insertions or outbound messages.
Verification: `packages/experimental/im/tests/{intake,dispatcher,sessions,send,outputs,activity,tools,store}.spec.ts` cover the host modules; `packages/experimental/im-session-commands/tests/commands.spec.ts` covers the commands plugin. See [IM storage unit identity in v4](2026-10-25-im-storage-unit-identity.md) for the three storage domain names (`im_messages`, `im_sessions`, `im_receipts`).
事件链监听器需自行保证幂等性:监听器抛错会让消息保持 `pending` 并在后续重试,因此插件必须提供确定性的投递 id 和 `operationId`,避免重试时重复写入收件箱或重复发送消息。
验证:`packages/experimental/im/tests/{intake,dispatcher,sessions,send,outputs,activity,tools,store}.spec.ts` 覆盖宿主各模块;`packages/experimental/im-session-commands/tests/commands.spec.ts` 覆盖命令插件。三个持久化存储域(`im_messages`、`im_sessions`、`im_receipts`)的命名规则见 [v4 中的 IM 存储 unit 身份](2026-10-25-im-storage-unit-identity.zh.md)。
English | [中文](2026-10-25-im-storage-unit-identity.zh.md)
## Problem
Booting v4 over an existing home fails before the service starts (`StorageError: unit 'im': stored version 1 != expected 2`) when a v4 message store reuses the v3 `im` unit name at version 2 with a different table layout (`events`/`messages`/`chats` instead of v3's `sessions`/`tasks`/`intake`/`output`). A unit name is its identity on the storage medium and a single-document unit is read at its exact version only, so reusing a v3 unit name with an incompatible layout or record schema fails on every boot over a v3 home.
The storage domain layer has no in-place migration or reset hook: [`DomainSpec`](../../../../packages/storage/storage-domain/src/spec.ts) declares a name, a version, a layout, and record schemas, and [`KvFacet`](../../../../packages/storage/storage/src/backend.ts) provides `open`/`loadAll`/`putRecord`/`deleteRecord`/`setGlobal`/`close` without a transform or destroy primitive ([`packages/storage/storage-domain/README.md`](../../../../packages/storage/storage-domain/README.md)). Moreover, v3 intake receipts and hosted sessions are not reusable by the v4 IM packages, whose admission, session, receipt, and task records have different schemas.
## Decision
Each IM storage domain uses its own v4 unit name, leaving pre-v4 unit names unused:
Because each v4 domain has a new unit name, each starts at version 1. Existing pre-v4 `im`, `im_conversation`, and `im_dispatch` units remain untouched on the storage medium: nothing in v4 reads, migrates, or deletes them, and the first v4 boot opens empty v4 stores cleanly without manual intervention. A deployment that ran the removed task plugin keeps its `im_tasks` records the same way: no v4 domain opens that unit.
## Alternatives considered
**Declare a v1-to-v2 migration that discards the v3 state.**`DomainSpec` and the storage backend contract have no migration, reset, or destroy hook; adding one would require new storage-layer primitives ([the `recovery: 'reset'` proposal](../../proposed/architecture/2026-07-28-storage-root-and-derived-medium-recovery.md)), and reaching around the storage backend from the IM package would break backend abstraction.
**Keep the `im` name and bump the version to 2.** A single-document unit is checked for an exact version match, so version 2 over a stored version 1 unit fails with `version-mismatch` on every boot.
**Keep the old unit names and loosen schemas to accept v3 records.** v3 and v4 records represent different data models; accepting v3 records under v4 schemas would misinterpret obsolete routing and intake state instead of starting clean.
**Delete the v3 units at boot.** The storage backend provides no unit-deletion primitive, and deleting user storage files automatically during service startup is outside the IM package's scope.
## Consequences
An upgraded `$DSH_HOME` retains any pre-v4 `im.json`, `im_conversation.json`, and `im_dispatch.json` files unused alongside the v4 unit files. The v4 IM service starts with fresh message, session, and receipt stores.
Any future compatible schema change within one of these three domains increments that unit's version and declares `compatibleVersions` only when existing records remain valid under the new schema.
Verification: `packages/experimental/im/tests/store.spec.ts` boots the message store over a medium seeded with a v3-shaped `im` unit at version 1, verifies that v4 writes land in `im_messages` while the v3 unit stays untouched, and verifies that opening `im` at version 2 rejects with `version-mismatch`.
@@ -18,9 +18,9 @@ The bundled Python environment ([`tool-workspace-dependencies`](../../../../pack
[`@deepseek-ai/dsh-office-kit`](../../../../packages/document/office-kit/README.md) owns Kit location and the shared conversion service. Kit location is an internal implementation of the provider and is not exported: the provider passes its own `import.meta.resolve` lookup, and native engine paths use ASAR-unpacked mapping. Location reads no environment variables. The [on-demand Office tools](2026-10-31-native-office-tool.md) run Kit operations inside the Host, so no deployment publishes Kit CLI paths or Office executable variables.
An absent Kit degrades instead of failing a load. The conversion service registers and rejects conversions with code `unavailable`, retaining only a successful Kit import and reporting each distinct failure once; the `office_render`, `office_convert`, and `office_recalculate` tools stay registered and return that message when called.
An absent Kit degrades instead of failing a load. The conversion service registers and rejects conversions with code `unavailable`, retaining only a successful Kit import and reporting each distinct failure once; the `document_render`, `document_convert`, and `document_recalculate` tools stay registered and return that message when called.
`office-to-pdf` became `office-kit` so that later Kit consumers, such as native rendering (PR #5374) and the `tool-office` package, take Kit from one package. LibreOffice Kit dependencies declare one exact version in every manifest, so the converter and packaged engine come from the same Kit release.
`office-to-pdf` became `office-kit` so that later Kit consumers, such as native rendering (PR #5374) and the `tool-document` package, take Kit from one package. LibreOffice Kit dependencies declare one exact version in every manifest, so the converter and packaged engine come from the same Kit release.
# Agent Note: Rule-driven IM dispatch leaves the v1 package set
Status: implemented
English | [中文](2026-10-27-im-dispatch-out-of-v1.zh.md)
## Problem
`dsh-im-session-dispatch` carried most of the IM plane's complexity: a QuickJS sandbox compiled to WebAssembly for model-written route rules, its own `im_rules` storage unit, a `copy`/`cut` path that took messages away from the dispatcher, rule notices in both directions, and nine dispatcher plus five worker tools. Only one deployment used it. `dsh-im-session-tasks` was coupled to it and to platform threads: it posted a topic announcement, fell back to a `#task` message on platforms without threads, learned thread ids from the first reply, and listened on `im/message` to route topic replies, with a `topicDelivery: rules` mode that existed only for the dispatcher.
## Decision
The rule-driven dispatcher moved into the one deployment plugin that uses it, outside this repository, unchanged in its rule language and storage. In this repository:
- The [`@deepseek-ai/dsh-experimental-im` host](../../../../packages/experimental/im/src/dispatcher.ts) gained a minimal default: with `defaultDispatch` configured, an addressed message no listener handles reaches one session shared by every chat. It has no routing and no rules; without the configuration an unhandled message is ignored as before.
- Background work left with it: no task service ships, so a plugin that needs worker sessions hosts them through `ctx.im.sessions` and routes the messages it wants a worker to receive.
- A publication targets a chat in its session's bindings, so a session bound to several chats answers where it was asked.
## Alternatives considered
**Keep dispatch in v1 without QuickJS.** A predicate language the harness maintains would still need its own store, notices, and tools, and would still be used by one deployment.
**Routing topic replies in the task service.** Which messages reach a worker is routing policy, and routing belongs to the plugin that owns the sessions; a task service would otherwise keep a second, platform-specific router beside every strategy.
## Consequences
A deployment that ran `dsh-im-session-dispatch` mounts its own plugin and its own dispatch presets; its `im_rules` and `im_tasks` records stay on the medium untouched because neither unit name nor version changed, and no storage domain in this repository opens them.
# Agent Note: `<fallback>` alternatives replaced the IM capability layer
Status: implemented
English | [中文](2026-10-28-im-fallback-alternatives-replace-capabilities.zh.md)
## Problem
The vendored IM runtime answered "can this platform do X in this chat" before doing it. `plugin-im-core` owned a capability layer — `ChatFacts`, a per-bot `FactCache`, `LearnedFact`, `Support`, the `element.*` / `message.*` / `limit.*` key vocabulary, `evaluateCapabilities` and `mergeCapabilities` — that every adapter fed from three sides: a mode's declared operations, the adapter hooks, and a per-chat probe. The Lark adapter added a `getChat` probe plus five learned facts, and the QQ adapter published passive-reply windows through the same channel.
Every consumer then had to branch on the answer. `@deepseek-ai/dsh-experimental-im` exposed `caps` on the message event, on the service and on each turn's output IO; the summary and trace renderers asked five or six keys before deciding what to publish; a stop button existed only where `element.button.action` and `interaction.button` both answered `native`. The layer was also wrong in both directions: `unknown` had to mean "attempt it" for operations and "do not render it" for elements, so a probe that could not read a chat silently downgraded work, and a probe that answered `unknown` made the pipeline learn the same thing again from the failure. Nothing about a chat is knowable before the platform answers.
## Decision
The capability layer is deleted, not deprecated, and content itself carries the alternatives.
`@deepseek-ai/satori-element` gains the `<fallback>` element: each direct child is one ranked candidate, and a JSX fragment counts as one candidate, so `<fallback><title>…</title><h3>…</h3><text>…</text></fallback>` names three spellings of one message. `normalize` rewrites each candidate into an internal `<case>` normalized as content of the element the `<fallback>` stands in, which lets a fallback of phrasing content join the surrounding inline run. `RenderEngine` renders the first candidate whose whole subtree its registry renders natively — tag registered, variants declared, structural children standing — and otherwise the last candidate with the usual lowering; a nested fallback counts as native when one of its own candidates is. The choice lands in `RenderReport.fallbacks` and `degradationScore` charges a later candidate, so a mode that renders the author's first choice wins the per-publication mode resolution. Nothing in the engine consults per-chat state.
Removed with it: `capabilities.ts`, `Bot.supports` / `support` / `capabilities`, `Adapter.facts`, `Mode.operations`, `HandlerOptions.available`, `PlatformError.facts`, `RenderContext.caps` / `supports`, the Lark `facts.ts` chat probe and its learned facts, and the QQ passive-window facts. `LimitKey` moved to `mode.ts` and gained `limit.delete.window`; what a mode can do is now a registry fact (does it register the tag and declare the variant), an adapter-hook fact (`editPayload`, `deletePart`, `streamDriver`) or a declared limit. `Bot.edit` and `Bot.delete` decide from those, and a refusal is the classified `PlatformError` the platform answered — never a prediction.
`MessageStream.abort()` now reports whether a recall removed the published message, which is the one question a renderer cannot answer from its own content.
The IM consumers stop querying capabilities. `ImOutputIO`, `ImMessageEvent` and `ImApi` lost `caps`; the summary renderer resolves its plan from the strategy of the stream it opened (`patch` / `edit` publish provisional content, `final` / `append` do not) and writes its stop control as a `<fallback>` of an action button and a `reply /stop` line; the trace renderer writes each reasoning and tool item as a `<fallback>` of a collapsible panel and a one-line summary, and leaves the element budget to the mode that has one.
## Alternatives considered
**Keep the layer and add `<fallback>` beside it.** Two mechanisms would answer the same question and disagree: a renderer could ask whether a mode supports `<details>` while the mode's own registry is the only thing that decides it.
**Keep a small synchronous capability description for the consumers.** The renderers only need three answers (which stream strategy was opened, whether a recall succeeded, whether a button is actionable), and each of those is already reported by the event, the call, or the content itself. A description of "what this platform can do" would reintroduce the guessing that made the layer wrong.
**Probe the chat lazily and cache the answers per chat.** TTLs move the guess, they do not remove it: a mute, a whitelist refusal or an edit policy can change between two sends, and a stale `false` then blocks a working call.
## Consequences
A refusal costs one round trip and surfaces as an error, where the layer used to pre-empt it. Content that must degrade gracefully now says so in its own tree, which puts the decision in the renderer that knows what it is rendering rather than in a key table. Modes own their element budgets in `assemble` and `check`; the trace renderer no longer pre-folds panels. Adapters no longer cache anything about a chat, so a bot needs no probe, no TTL and no invalidation, and the QQ passive bookkeeping answers only the one question the stream driver asks (`remaining()`).
The corpus gained a `fallback` case, and conformance's text-conservation check ignores a `<fallback>`: which candidate renders is a property of the mode, so no single text is conserved. What was given up is any way to answer "can this chat do X" without trying, which the QQ and Lark `230075` paths previously used to choose a buffered stream up front; they now rely on the classified `limit` error to recall and resend.
@@ -10,13 +10,13 @@ Office operation skills ran the LibreOffice Kit CLI through ordinary shell comma
## Decision
The [`tool-office` package](../../../../packages/document/tool-office/README.md) exposes `office_render`, `office_convert`, and `office_recalculate` as three on-demand Host tools. Each tool states its parameter rules in its own JSON Schema: `office_render` accepts document paths, page or slide `pages`, worksheet `sheet` and `range` selection, and `dpi`; `office_convert` accepts all nine output formats (`pdf`, `docx`, `odt`, and `txt` for Word; `pdf`, `xlsx`, `ods`, and `csv` for Excel; `pdf`, `pptx`, and `odp` for PowerPoint) plus `sheet` for CSV output (required when the workbook has several sheets); and `office_recalculate` accepts `xlsx` and `ods`. Together the three declarations total ~1,813 characters, paid only in Sessions that load an Office skill. They call the [Office kit](../../../../packages/document/office-kit/README.md) service, which loads Kit in the Host process through its `src/locate.ts` resolver and runs every operation through the queue, concurrency limits, byte reservations, and cache that Office previews use. Tool requests use `foreground` priority, the class of an open preview, so background prewarming cannot starve them. The SDK composition mounts `tool-office` beside `office-kit`, and the Web bundle's standard and PTC agent presets mount it while its minimal preset keeps its fixed roster; when Kit is missing the tools still register and every call returns the service's `unavailable` message. Each tool reads the service at each call instead of injecting it, so a composition that omits or disables `office-kit` still creates Sessions with the tools and each call fails as `unavailable`; a service loaded later serves the next call. Standard and PTC modes reach the same registrations; nested PTC calls re-enter the ordinary execution pipeline.
The [`tool-document` package](../../../../packages/document/tool-document/README.md) exposes `document_render`, `document_convert`, and `document_recalculate` as three on-demand Host tools. Each tool states its parameter rules in its own JSON Schema: `document_render` accepts document paths, page or slide `pages`, worksheet `sheet` and `range` selection, `dpi`, and an optional `renderer` ([Poppler PDF renderer](2026-11-23-poppler-pdf-renderer.md)); `document_convert` accepts all nine output formats (`pdf`, `docx`, `odt`, and `txt` for Word; `pdf`, `xlsx`, `ods`, and `csv` for Excel; `pdf`, `pptx`, and `odp` for PowerPoint) plus `sheet` for CSV output (required when the workbook has several sheets); and `document_recalculate` accepts `xlsx` and `ods`. Together the three declarations total ~1,988 characters, paid only in Sessions that load an Office skill. They call the [Office kit](../../../../packages/document/office-kit/README.md) service, which loads Kit in the Host process through its `src/locate.ts` resolver and runs every operation through the queue, concurrency limits, byte reservations, and cache that Office previews use. Tool requests use `foreground` priority, the class of an open preview, so background prewarming cannot starve them. The SDK composition mounts `tool-document` beside `office-kit`, and the Web bundle's standard and PTC agent presets mount it while its minimal preset keeps its fixed roster; when Kit is missing the tools still register and every call returns the service's `unavailable` message. Each tool reads the service at each call instead of injecting it, so a composition that omits or disables `office-kit` still creates Sessions with the tools and each call fails as `unavailable`; a service loaded later serves the next call. Standard and PTC modes reach the same registrations; nested PTC calls re-enter the ordinary execution pipeline.
`office_render` returns PNG images in the tool result; the Web Client's Office row shows only the result's text blocks and does not display the images. The tool commits the images through the attachment store before the result is logged, so the model-visible images are reconstructable from the Session log, resume and fork restore them, and image offload applies to them. The complete result is bounded by image count, per-image pixels and dimensions, and total PNG bytes, each the lower of the tool configuration and the attachment store's limits; an over-limit selection fails instead of being truncated. A route without image input is refused before rendering.
`document_render` returns PNG images in the tool result; the Web Client's Office row shows only the result's text blocks and does not display the images. The tool commits the images through the attachment store before the result is logged, so the model-visible images are reconstructable from the Session log, resume and fork restore them, and image offload applies to them. The complete result is bounded by image count, per-image pixels and dimensions, and total PNG bytes, each the lower of the tool configuration and the attachment store's limits; an over-limit selection fails instead of being truncated. A route without image input is refused before rendering.
`office_convert` and `office_recalculate` do not write into the workspace. The filesystem service intentionally provides only binary reads, and binary files in the workspace come only from the shell, whose sandbox and approvals already govern writes. The Office kit saves each output in an owner-only directory under its configurable `outputDirectory` (`$DSH_HOME/office-kit/outputs` by default), grouped by the root Session of the caller's subagent tree, and deletes it after `outputRetentionMs`, when `maxOutputStoreBytes` needs room for newer outputs, when that root Session is disposed, or when the provider unloads. A subagent's output therefore outlives the subagent, so the delegating agent can still copy it. Each tool returns the absolute temporary path, format, size, and the page count the converter reports, with the instruction to copy the file with the shell now, because it may be deleted after a retention period or to free space, and is deleted when the conversation ends. A filesystem backend that cannot read Host paths, such as an SSH workspace, refuses these two tools before converting, because a remote shell cannot read the Host output store. Shell sandboxes allow reads of the Harness home on macOS Seatbelt, Linux bubblewrap, and Linux Landlock, so a confined shell can copy the file into the workspace.
`document_convert` and `document_recalculate` do not write into the workspace. The filesystem service intentionally provides only binary reads, and binary files in the workspace come only from the shell, whose sandbox and approvals already govern writes. The Office kit saves each output in an owner-only directory under its configurable `outputDirectory` (`$DSH_HOME/office-kit/outputs` by default), grouped by the root Session of the caller's subagent tree, and deletes it after `outputRetentionMs`, when `maxOutputStoreBytes` needs room for newer outputs, when that root Session is disposed, or when the provider unloads. A subagent's output therefore outlives the subagent, so the delegating agent can still copy it. Each tool returns the absolute temporary path, format, size, and the page count the converter reports, with the instruction to copy the file with the shell now, because it may be deleted after a retention period or to free space, and is deleted when the conversation ends. A filesystem backend that cannot read Host paths, such as an SSH workspace, refuses these two tools before converting, because a remote shell cannot read the Host output store. Shell sandboxes allow reads of the Harness home on macOS Seatbelt, Linux bubblewrap, and Linux Landlock, so a confined shell can copy the file into the workspace.
The three tools share one `when(agent)` predicate instead of staying resident in every request. An `Agent` activates them when `marked.has(agent)` is true or when`agent.session.requestHeader()?.tools` already lists `office_render`, `office_convert`, or `office_recalculate`; `agent/disposed` clears the`WeakSet<Agent>`mark. `tool-office` marks the `Agent` on a non-error `skill` tool result (`tools/result` with `!result.isError`, including a nested `skill` call inside `run_code`) or a direct user skill invocation (`session/event` where `event.type === 'user/message'` and `event.data.source.kind === 'skill-invocation'`) whose skill name is in `activationSkills` (`office` by default). The declarations appear on the step after the skill loads and stay active for the rest of the Session; calling an `office_*` tool before activation fails as `UNKNOWN_TOOL`. When mid-session activation adds the tools, the agent loop records a `developer/message` (`source: { kind: 'tool-registry' }`) with `tool-addition` items: models that declare `toolUpdate` (`in-history` or `addition-only`) keep their existing request prefix, whereas models without `toolUpdate` start a new request series once. Because standard-mode request headers are already persisted in the Session log, checking `requestHeader()` preserves activation across resume, fork, and compaction without a Session projection. In PTC mode, the recorded request header declares only `run_code`, so a resumed or forked PTC Session (or a process crash between loading a skill and recording the next native request header) does not retain `office_*` bindings until an Office skill loads again; the [`office` skill](../../../../packages/skill/skill-office/README.md) instructs the model to load `office` again when `office_render`, `office_convert`, or `office_recalculate` is not in the tool list. No skill wraps a single operation, and a standalone render, recalculation, or conversion loads only `office`. The skills carry no executable paths, so `skill-office` has no Node, CLI, or Kit location configuration, `office-kit`'s `src/locate.ts` resolves no CLI, Desktop and the bundles publish no Office executable variables, and the Python sidecar's standalone Node remains only for the Python `deepseek_harness.office` module.
Instead of staying resident in every request, the three tools register in one`AgentToolRegistry` that `ctx.tools` includes; an `Agent` sees them only after `tool-document` adds all three for that`Agent`with `set()`. `tool-document` adds them on a non-error `skill` tool result (`tools/result` with `!result.isError`, including a nested `skill` call inside `run_code`) or a direct user skill invocation (`session/event` where `event.type === 'user/message'` and `event.data.source.kind === 'skill-invocation'`) whose skill name is in `activationSkills` (`office` by default). It also adds them on `agent/created`, and for each `Agent` that exists when the plugin loads, if `agent.session.requestHeader()?.tools` already lists `document_render`, `document_convert`, or `document_recalculate`, or one of their earlier names `office_render`, `office_convert`, and `office_recalculate` that Sessions recorded before the rename. The registry keeps the tool names added for each `Agent` in memory and drops them with the `Agent`. The declarations appear on the step after the skill loads and stay active for the rest of the Session; calling an `document_*` tool before activation fails as `UNKNOWN_TOOL`. When mid-session activation adds the tools, the agent loop records a `developer/message` (`source: { kind: 'tool-registry' }`) with `tool-addition` items: models that declare `toolUpdate` (`in-history` or `addition-only`) keep their existing request prefix, whereas models without `toolUpdate` start a new request series once. Because standard-mode request headers are already persisted in the Session log, checking `requestHeader()` preserves activation across resume, fork, and compaction without a Session projection. In PTC mode, the recorded request header declares only `run_code`, so a resumed or forked PTC Session (or a process crash between loading a skill and recording the next native request header) does not retain `document_*` bindings until an Office skill loads again; the [`office` skill](../../../../packages/skill/skill-office/README.md) instructs the model to load `office` again when `document_render`, `document_convert`, or `document_recalculate` is not in the tool list. No skill wraps a single operation, and a standalone render, recalculation, or conversion loads only `office`. The skills carry no executable paths, so `skill-office` has no Node, CLI, or Kit location configuration, `office-kit`'s `src/locate.ts` resolves no CLI, Desktop and the bundles publish no Office executable variables, and the Python sidecar's standalone Node remains only for the Python `deepseek_harness.office` module.
This decision partially supersedes [progressive Office skills](2026-09-27-progressive-office-skills.md): its operation skills, ordinary-shell execution, and rejection of a dedicated renderer tool are replaced here, and its four-skill catalog is replaced by the `office` skill with concise inline guidance under the [single Office skill](2026-11-06-single-office-skill.md) decision.
**Add a Session projection for loaded Office skills.** Folding `tools/result` and `user/message` records in a dedicated projection would reconstruct skill activation across PTC resume and fork, but requires a new projection service, fold rules, and cross-package dependencies for state that standard-mode request headers already record and that PTC mode recovers by reloading `office`.
**Track activation only in `Agent` memory.** Checking only `WeakSet<Agent>` (as `action-cards` does) drops the `office_*` declarations on the first step after a standard-mode resume or fork because the new `Agent` instance starts unmarked; consulting `agent.session.requestHeader()?.tools` preserves the declarations from the persisted header.
**Track activation only in `Agent` memory.** Checking only `WeakSet<Agent>` (as `action-cards` does) drops the `document_*` declarations on the first step after a standard-mode resume or fork because the new `Agent` instance starts unmarked; consulting `agent.session.requestHeader()?.tools` preserves the declarations from the persisted header.
**Keep one skill per operation.** Separate render, recalculation, and PDF export skills add a `skill` call before each standalone operation and repeat what the tool schema and results already state.
Visual inspection takes one `office_render` call after loading an Office skill and needs no cleanup, and its images follow the Session's attachment, offload, and replay rules. Sessions that do not load an Office skill pay zero Office tool-declaration tokens; Sessions that load one activate ~1,813 characters of operation-specific schemas, keeping the existing request prefix on models with `toolUpdate` and starting one new request series on models without it. Standard-mode resume, fork, and compaction retain the tools through the recorded request header, while PTC resume or fork and crashes before the next recorded header recover by loading `office` again. Office operations behave the same in standard and PTC modes and across deployments once activated, and the deployment-specific Node, CLI, and containment code is gone.
Visual inspection takes one `document_render` call after loading an Office skill and needs no cleanup, and its images follow the Session's attachment, offload, and replay rules. Sessions that do not load an Office skill pay zero Office tool-declaration tokens; Sessions that load one activate ~1,988 characters of operation-specific schemas, keeping the existing request prefix on models with `toolUpdate` and starting one new request series on models without it. Standard-mode resume, fork, and compaction retain the tools through the recorded request header, while PTC resume or fork and crashes before the next recorded header recover by loading `office` again. Office operations behave the same in standard and PTC modes and across deployments once activated, and the deployment-specific Node, CLI, and containment code is gone.
Converted files need a shell copy; compositions without a shell tool can render but cannot deliver converted files, and remote workspaces cannot convert at all. Temporary outputs disappear after retention or root Session disposal, so a resumed Session must convert again. Saving page images as files is not offered.
Verification covers the three tools' schemas, results, argument rules, limits, failures, cancellation, PTC dispatch, and disposal in `tool-office.spec.ts`, and skill-driven activation, custom `activationSkills`, failed skill calls, direct `/office` invocation, `requestHeader()` persistence across resume and fork, and PTC reactivation in `activation.spec.ts`; the output store's retention, eviction, release, and sweeping in Office kit tests; Loader compositions that return the `unavailable` message with Kit absent and with the `office-kit` row absent, then reach the service once the row loads; packaged Desktop smoke checks that render, convert, and recalculate real DOCX, XLSX, and PPTX files through the service; and recorded headless sessions that omit `office_*` before an Office skill loads and declare `office_render`, `office_convert`, and `office_recalculate` on the step after loading one, including a render that `office_render` refuses for a route without image input.
Verification covers the three tools' schemas, results, argument rules, limits, failures, cancellation, PTC dispatch, and disposal in `tool-document.spec.ts`, and skill-driven activation, custom `activationSkills`, failed skill calls, direct `/office` invocation, `requestHeader()` persistence across resume and fork, and PTC reactivation in `activation.spec.ts`; the output store's retention, eviction, release, and sweeping in Office kit tests; Loader compositions that return the `unavailable` message with Kit absent and with the `office-kit` row absent, then reach the service once the row loads; packaged Desktop smoke checks that render, convert, and recalculate real DOCX, XLSX, and PPTX files through the service; and recorded headless sessions that omit `document_*` before an Office skill loads and declare `document_render`, `document_convert`, and `document_recalculate` on the step after loading one, including a render that `document_render` refuses for a route without image input.
# Agent Note: IM media admission keeps non-images as verbatim files
Status: implemented
English | [中文](2026-11-02-im-file-media-admission.zh.md)
## Problem
`@deepseek-ai/dsh-experimental-im` labelled every media element of a stored message with a stable id (`[图片 #12.1]`, `[文件 #12.2 report.pdf]`, `[语音 #12.3 语音.opus]`) but could admit only the image kind: `ImMediaStore.admit` answered `skipped: 'unsupported'` for `file`, `audio` and `video`, and the only read tool, `im_read_image`, refused them the same way. A person who sent a document, a voice message or a video into a chat therefore handed the model a label it could not open — the transport, the Lark decoder and the core resource fetcher already carried the bytes (`<file src="satori:…/resources/<file_key>?type=file">`), and nothing consumed them. The `media` field's own contract already said images and files are downloaded, so the implementation was behind its documented behavior.
## Decision
Admission is by payload, not by kind. `ImMediaStore` fetches and bounds a reference exactly as before, then stores an image as a normalized image block and every other kind as the exact bytes of a durable verbatim file through `ctx.attachments.saveFile`. `ImFormatter.format({ media: true })` appends each admitted file as a `file` content block beside the text, so request assembly projects it to the deterministic handle text naming the saved read-only path — the same representation a browser-attached file gets.
The model reaches a file that is no longer in the delivered window through the new `im_read_file` tool: it resolves the label to its element, admits it as a verbatim file, and stages the bytes at `<tools.fileDir>/<seq>.<index>-<name>` under the session's working directory through `ctx.fs.writeBytes`, returning that path with the display name, byte length and content digest. The seam gained `writeBytes` for this: staging through `writeText` would have decoded and normalized the bytes, and the attachment store's host path is not reachable from a remote execution filesystem. `im_read_image` keeps its image-only contract; guidance names both tools and the two label shapes.
## Alternatives considered
**Add the read tool without admitting files eagerly.** Every new message would then cost one download less, but the model would have to ask for a file the sender just handed it, which is exactly the request shape the image path already answers without a tool call.
**Read text-like files into the tool result.** Sniffing a media type to inline text adds a format allowlist and a second representation of the same bytes; a path lets the model's own file tools decide how much to read.
**Resolve the stored attachment's host path and hand it to the model.** That is what the request projection does for a delivered `file` block, and it works only where the execution filesystem maps the harness host path — a local backend does, a remote SSH environment does not, which is exactly the deployment that needed this. Staging through the seam works wherever the provider can write bytes, and the path it returns is one the model's own file tools can open.
## Consequences
An execution filesystem must be able to store the bytes: `fs-local` writes them through the same atomic staging file as its text writes, `fs-ssh` carries them as base64 to the helper under that helper's single-frame budget (8 MiB), and a provider that keeps the base rejection makes `im_read_file` fail instead of inventing a path. A delivered file still depends on host-path mapping for the handle text, so a remote worker learns the copy exists there and stages it on demand. Staging costs a second copy of the element (the durable attachment plus the workspace file), and one id always stages to the same relative path, so a re-read overwrites instead of accumulating. Downloading is still bounded by `media.maxItems` per message and `media.maxBytes` per element, and `media.download: false` keeps labels only.
The prompt section grew one sentence (two label shapes, two tools), and the tool catalog, subsystem page and both READMEs list `im_read_file`.
| `ui-slots` | `SlotKind` includes `'hoc'`; `HocRenderOpts` (optional `children` and `entryKey`), `HocKeysOf`, `HocShare`; `RenderSlotFn` has a hoc-key overload taking optional `{ children, entryKey }`; `KindOptions` has a hoc branch with optional `key`; `SlotCore.register` / `entriesOfSlot` key hoc cells by `(key or wildcard, id)` |
| `ui-renderer` | `HocOutlet` takes its render function from `hocChainFor`, a cache per host, live declaration, and dispatch key that every outlet dispatching the same key shares. Once per ledger version it reselects the key's layers with `hocLayersFor` (wildcard winners plus exact-key winners, an exact-key layer replacing the wildcard layer with its id, sorted by `order`) and calls `composeHocLayers` to nest them into one render function only when that ordered list changes by entry identity. Each layer is one Component that fixes its scope-specific Entry (`StrictSessionEntry` / `SessionMaybeEntry` / `RootEntry`), entry, slot inject, and crash reporting at composition, and receives only `owner` and the next inner layer when rendering. With no layer the outlet returns the owner content directly. `HocContentBoundary` wraps each layer's inner content and rethrows its errors as `HocContentError`, which layer boundaries pass through and `HocOutletBoundary` unwraps to the original error. The Entry chain passes `children` to the registered Component as JSX children; non-hoc entries receive `undefined`. `SlotErrorBoundary` takes a `crashed` replacement node, which a layer's boundary keeps rendering for the rest of its mount; layer crash reports pass `abdicate: false` |
| `ui-renderer` | `HocOutlet` takes its render function from `hocChainFor`, which caches one chain per host, spec object, slot name, and `entryKey` across outlet instances. Once per ledger version it reselects the key's layers with `hocLayersFor` (wildcard winners plus exact-key winners, an exact-key layer replacing the wildcard layer with its id, sorted by `order`) and calls `composeHocLayers` to nest them into one render function only when that ordered list changes by entry identity. Each layer is one Component that fixes its scope-specific Entry (`StrictSessionEntry` / `SessionMaybeEntry` / `RootEntry`), entry, slot inject, and crash reporting at composition, and receives only `owner` and the next inner layer when rendering. With no layer the outlet returns the owner content directly. `HocContentBoundary` wraps each layer's inner content and rethrows its errors as `HocContentError`, which layer boundaries pass through and `HocOutletBoundary` unwraps to the original error. The Entry chain passes `children` to the registered Component as JSX children; non-hoc entries receive `undefined`. `SlotErrorBoundary` takes a `crashed` replacement node, which a layer's boundary keeps rendering for the rest of its mount; layer crash reports pass `abdicate: false` |
| `scripts/gen-client-catalog.ts` | Register options, a `children`-rendering example, and the `wraps-owner-content` replace risk for hoc slots |
### First consumer
@@ -66,9 +66,9 @@ Add a fifth kind: `hoc`.
- Adding or removing a layer remounts everything inside it, including the composer on the home.
- Every non-hoc registered Component receives `children: undefined`, which overrides any owner prop of that name.
- Each layer adds one Component and two error boundaries to the tree; each hoc slot with layers adds one outlet boundary.
- The outlet's `[data-slot]` element sits between the owner and its content, so owner selectors cannot assume the content is a direct child.
- The renderer marks the slot and [where each layer renders `children`](../../../../docs/subsystems/slots.md#hoc-layers), not the layer's own markup. Plugins need no wrapper of their own, but structural selectors must account for those DOM elements.
- React 18 recollects the component stack where an error is rethrown, so a content error reaching boundaries above a hoc slot with layers carries a component stack that starts at `HocOutletBoundary`.
- A layer that wraps its `children` in its own error boundary catches the internal `HocContentError` rather than the original content error.
- The frame contract holds only on the home: other phases leave the Conversation root out of the stacking order, so unportaled Conversation popovers still rise above AppFrame chrome that floats over the column, while on the home they stack only within the root.
- `HocOutlet` keeps its layer Components in a compile cache shared per host, live declaration, and dispatch key, not in outlet-instance state, so they do not depend on React retaining memoized values; these Components are the remount boundary of the content inside them, and a redeclared slot starts with an empty cache.
- `HocOutlet` keeps its layer Components in a shared compile cache, not in outlet-instance state, so they do not depend on React retaining memoized values; these Components are the remount boundary of the content inside them. Different slot names use separate chains even when they share a spec object.
- [The slot system standard](2026-07-22-slot-type-chain-implementation.md) remains authoritative for the other kinds; this note adds the fifth.
Loaded 100 of 6033 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.