Compare commits

...
Author SHA1 Message Date
imccyu 841f76d3c5 Merge pull request #9462 from deepseek-harness/worktree-release-dsh-0.2.3-alpha.3
release(dsh): 0.2.3-alpha.3
2026-11-28 19:40:37 +08:00
imccyu bb64ccbbf1 release(dsh): 0.2.3-alpha.3 2026-11-28 19:21:12 +08:00
imccyu 30fd3b4fae Merge pull request #9460 from deepseek-harness/worktree-release-vendor-0.2.3-alpha.3
release(vendor): prepare cordis 4.2.0-alpha.2 family for DSH 0.2.3-alpha.3
2026-11-28 19:00:29 +08:00
imccyu d26338f662 release(vendor): cordis 4.2.0-alpha.2, cosmokit 1.10.0-alpha.2, element 0.3.1-alpha.2, fetch-file 1.0.4-alpha.2, group 1.2.0-alpha.2, hmr 1.2.0-alpha.2, http 1.6.1-alpha.2, im/adapter-lark 4.0.1-alpha.2, im/adapter-qq 4.0.1-alpha.2, im/core 5.0.1-alpha.2, im/element 4.0.1-alpha.2, im/markdown 4.0.1-alpha.2, include 1.2.0-alpha.2, loader 1.2.0-alpha.2, logger-console 1.2.0-alpha.2, schemastery 3.20.0-alpha.2, timer 1.3.0-alpha.2 2026-11-28 18:54:19 +08:00
imccyu dd5516e9b6 Merge pull request #9459 from deepseek-harness/fix/vendor-bump-central-tag
fix(release): read vendor versions at the last Cordis release tag
2026-11-28 18:36:45 +08:00
imccyu ce1f41c8e1 test(release): brace the manifest helper in the vendor baseline spec 2026-11-28 18:29:01 +08:00
imccyu 94d186500a fix(release): read vendor versions at the last Cordis release tag
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.
2026-11-28 18:14:55 +08:00
imccyu da0bb41b49 feat(client): load three Client packages as immediately dynamic plugins (#9451)
* 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`.
2026-11-28 02:49:13 +08:00
imccyu 9d746af29f 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`.
2026-11-28 02:28:52 +08:00
imccyu e84374f19b 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.
2026-11-28 02:28:52 +08:00
imccyu 30dac4237f 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.
2026-11-28 02:28:52 +08:00
imccyu 6480899de0 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.
2026-11-28 02:28:52 +08:00
imccyu 23ad15c40a 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.
2026-11-28 02:12:08 +08:00
imccyu 7c9145b285 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.
2026-11-28 02:09:55 +08:00
imccyu 1018cdd66d 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.
2026-11-28 02:09:33 +08:00
imccyu e1cb605559 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.
2026-11-28 02:08:37 +08:00
imccyu c42a704a75 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.
2026-11-28 02:08:37 +08:00
imccyu 5b24bd5258 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.
2026-11-28 02:08:16 +08:00
imccyu 588f5a57d8 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).
2026-11-28 02:08:16 +08:00
imccyu d626538a9d 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.
2026-11-28 02:06:24 +08:00
Yudong Han c72724b42e feat(office): add experimental office preview by frame forwarding bundle (#8441)
* 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
2026-11-27 16:10:38 +00:00
涂轶翔 1a518941d1 Merge pull request #9192 from deepseek-harness/feat/program-call-current-subcall
feat(ui-tool): show current subcall for run_code
2026-11-27 21:02:40 +08:00
_Kerman 88e9fa20cd Merge pull request #3221 from deepseek-harness/xtr/todo-update-reminder
feat(todo): remind agents to reconcile stale task lists
2026-11-27 20:49:46 +08:00
Yixiang Tu 6655120e59 feat(ui-tool): show the current sub-call under a collapsed running program call
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.
2026-11-27 20:39:30 +08:00
_Kerman dbd710a9de docs(todo): clarify reminder guidance in Chinese 2026-11-27 20:05:47 +08:00
_Kerman bbb2dadeef test(todo): isolate reminder loader lifecycles 2026-11-27 20:05:34 +08:00
_Kerman ad9c7144d2 feat(todo): remind agents to reconcile stale task lists 2026-11-27 19:38:53 +08:00
imccyuandimccyu e255853b03 perf(client-ui-stats): fold and publish wide PTC runs linearly (#9420)
* 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>
2026-11-27 19:28:33 +08:00
LegGasai cd27df8e39 Merge pull request #9393 from deepseek-harness/fix/account-login-keeps-default-model
fix(session-controller): keep the selected account model when signing in again
2026-11-27 19:25:07 +08:00
涂轶翔 8b04316918 feat(ui-tool): fold run_code subcalls (#8834)
* 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.
2026-11-27 19:21:49 +08:00
Magolor 9d2a72ff0f feat(session): archive idle SQLite Sessions and add on-demand store compaction (#9362)
* feat(session): archive idle SQLite Sessions and add on-demand store compaction

* fix(session): preserve derived views on v2-to-v3 upgrade and harden cold restore races

* feat(session): default coldAfterDays to 30 and skip set-aside unreadable segments

* fix(session): clear cancelled warm entries and recheck cold state under write lease

* refactor(session): keep compactStorage internal to dsh-session-persistence-sqlite
2026-11-27 10:43:52 +00:00
Magolor 798ac35ff1 fix(timeline): refine report cards, child links, zoom scale, and playback controls (#9374)
* fix(timeline): refine report cards, child links, zoom scale, and playback controls

* fix(timeline): address review comments on readable zoom floor, compact padding, retry badge, and ISO duration

* fix(timeline): keep task detail action button label and make only overview playback icon-only

* fix(timeline): constrain child report card width inside grid container
2026-11-27 10:10:11 +00:00
LegGasai 04558189ba docs(ui-settings-account): describe the default model a login keeps
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
2026-11-27 17:53:35 +08:00
LegGasai 181e7bdf1b fix(session-controller): keep the selected account model when signing in again
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
2026-11-27 17:53:35 +08:00
Turtle 2099 1cb8a494dc Merge pull request #9396 from deepseek-harness/turtle/fix-adapter-exception-88ce99756095
fix(llm-pi-ai): report invalid tool arguments as a retryable INVALID_TOOL_ARGUMENTS failure
2026-11-27 16:56:51 +08:00
315d12af70 feat(subagent): choose a default Subagent model on the Plugins page (#9373)
* feat(subagent): choose a default Subagent model on the Plugins page

Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>

* fix(subagent): align the default model picker and document its context notice

Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>

* fix(subagent): refresh generated catalogs and page golden for the default model picker

Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>

* fix(subagent): drop the unreachable catalog load from the enable toggle

Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>

* fix(subagent): apply the default model to tools that configure only an effort

Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>

* fix(client): use the settings menu for the default subagent model

Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>

* fix(subagent): do not tell the model which route is the default

Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>

* fix(subagent): describe explicit model selection without naming a default

---------

Co-authored-by: Turtle <turtle1999@deepseek.com>
Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>
Co-authored-by: Dudu-0223 <fsyo0223@gmail.com>
2026-11-27 16:46:36 +08:00
Jiawei Song 653699f835 Merge pull request #9411 from deepseek-harness/plugin-compat-drop-plugin-cache
ci(plugin-compat): fetch the sample plugins on every run instead of caching them
2026-11-27 16:39:22 +08:00
Dudu-0223 6a4ee478d7 perf(client): optimize PTC definition complexity for Chat and Trajectory (#9387)
* perf(client): 让 PTC 嵌套分发折叠保持线性

客户端折叠会话历史时,updateDispatch 对每个 tool/ptc-dispatch-start 与
tool/ptc-dispatch 事件都用 findIndex 查找子调用、复制父调用的整个子节点
数组,并把全部父子关系复制进新的 Map。单个父调用下 n 个子调用因此是
O(n²):一个约 5 万事件、最大扇出约 2 万的 PTC 会话折叠要 8.9 秒,打开
会话时主线程被同步阻塞。

ToolState 改为按 parent/child id 索引的 DispatchTree,updateDispatch 就地
写入内层 Map(替换幂等、首次挂载定序),发布时 projectBlock 再物化数组,
发布出的工具调用树仍是不共享数组的不可变值。

conversation-fold 基准新增 ptc-dispatch-fan-out 用例:2 个根调用各结算
10,000 个嵌套子调用,参考机预期 100 ms(CI 预算 250 ms)。旧实现同一形状
在编译 worker 中耗时 9,295 ms,新实现 51–81 ms。

Refs #9385

* perf(client): 让 Trajectory 的 PTC 分发折叠保持线性

默认启用的 Trajectory Tool Definition 与修复前的 Chat 实现同构:每个
tool/ptc-dispatch[-start] 事件都 indexOf 查找子调用并复制调用 Map,首次挂载
时还复制子节点 Map、父节点 Map 和兄弟列表;根 tool/result 再复制调用 Map,
每次发布重建整棵投影树。Assembler 无论目标是否激活都会更新已注册的
Definition,所以即使只打开 Chat,2 个根调用各 10,000 个子调用的窗口也要
12,228 ms。

ToolState 改为持有就地更新的 DispatchTree(调用 Map、首次挂载顺序的子调用
id 列表、父节点 Map),每个事件 O(1);projectCall 增加按存储块、中断点和
子调用引用缓存的投影,未变化子树复用已发布对象,发布值不与树共享引用。

conversation-fold 的 ptc-dispatch-fan-out 用例在 worker 中注册 Trajectory
Tool Definition 与视图,并分别断言 Chat 与 Trajectory 目标的子调用数和
250 ms 预算。回退 Trajectory 实现时该用例超过 60 秒 worker 时限;修复后
Chat 63–72 ms,Trajectory 60–64 ms。

Refs #9385

* perf(client): 收紧 PTC 分发折叠的状态更新

按评审意见收紧 Chat 与 Trajectory 的 Tool Definition:

- updateDispatch 与 Trajectory 根 result 分支原地修改后返回同一 State,
  不再浅拷贝;start() 仍新建 State。ToolState 与 DispatchTree 去掉
  readonly,JSDoc 引用 Assembler 的 update() 规则,原因链接 Agent Note。
- 删除 Trajectory 的投影缓存及其身份用例,projectCall 与 master 一致,
  每次发布新建投影树。
- 基准两个目标共用一个预算常量,去掉 trajectoryViewDefinition 的类型断言。
- Agent Note 合并修复前后表格并更新为本次实测;统一负向对照数据,
  说明两种树布局的取舍,注明返回同一 State 参考了 #9400。

编译 worker 2×10,000:master 29,176 / 22,483 ms,修复后 58–63 / 53–59 ms
(激活 Chat / Trajectory);只回退 Chat 时门禁测得 9,073 ms 并失败。

Refs #9385
2026-11-27 16:12:10 +08:00
3a0d5f0d0b fix(repeat-tool-reminder): stop reminding repeated subagent and job waits (#9195)
* 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>
2026-11-27 08:05:18 +00:00
Ruilin Geng b461a2c636 Merge pull request #7854 from deepseek-harness/feat/connectors-custom-mcp
feat(connectors): 在“连接器”标签页中添加和管理自定义 MCP 服务器
2026-11-27 08:02:09 +00:00
Dudu-0223 3ae1e44e80 fix(cua-macos): select applications that run from a code-signing copy (#9107)
* 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.
2026-11-27 07:32:17 +00:00
Turtle 51bca0643d Merge pull request #9368 from deepseek-harness/turtle/guideline-gate-rule-13180ad62600
docs(core-guidelines): add G.3 gating new rules whose violations a script can detect
2026-11-27 15:22:17 +08:00
Turtle 1fea5c4fc2 test(snapshots): keep the recovered reply independent of the failed attempt 2026-11-27 15:20:11 +08:00
Yudong Han e66b99b8c2 Merge pull request #9404 from deepseek-harness/refactor/desktop-host-launch-options
refactor(desktop): 集中 Host 启动选项并限定接收器的 Windows 编译宏
2026-11-27 15:16:28 +08:00
gengruilin c4bd90e20d test(ui-primitives): read the risk confirmation stylesheet from src/client
Master moved the platform library sources under src/client (7ae7a10563d),
so the spec's old path failed with ENOENT on Linux and Windows coverage.
2026-11-27 15:13:25 +08:00
Jiawei Song ff59acff90 Merge pull request #9386 from deepseek-harness/fix/plugin-compat-types-runner
ci(plugin-compat): run the declarations typecheck on the lint job's runner tier
2026-11-27 15:09:07 +08:00
yudshj f32796704b test(desktop): set the platform in the welcome login fixture 2026-11-27 14:59:42 +08:00
Jiawei Song 32c74749bd Merge pull request #9395 from deepseek-harness/plugin-compat/sample-2026-11-27-45951537304-1
chore(plugin-compat): refresh the community sample to 2026-11-27
2026-11-27 14:46:36 +08:00
Kexin Liu 663956e5ad Merge pull request #9347 from deepseek-harness/feat/side-conversation-source
feat(session): record a side conversation's source as parentSession and classify consumers by origin
2026-11-27 14:46:22 +08:00
yudshj 81098d1cdc refactor(desktop): configure Host launch options at construction 2026-11-27 14:45:09 +08:00
Turtle cea924c583 refactor(llm): keep INVALID_TOOL_ARGUMENTS out of the plugin entry exports 2026-11-27 14:42:30 +08:00
yudshj cbf20d6c93 build(desktop): scope the Windows API target to the frame receiver 2026-11-27 14:41:16 +08:00
Yudong Hanandimccyu f7cb4926dc feat(frame-forwarding): video-frame forwarding support (#8440)
* 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>
2026-11-27 06:39:04 +00:00
Turtle dad92aacba Merge pull request #9381 from deepseek-harness/turtle/allow-weaker-sandbox-noop-1ddd226eeb92
feat(sandbox): accept a weaker sandbox_permissions request as a no-op
2026-11-27 14:30:47 +08:00
liukx0205 9a2a471137 docs: regenerate the persistence catalog for the parentSession description 2026-11-27 14:30:29 +08:00
liukx0205 7c96f353f6 test(session-controller): share the attaching Workspace stub between fork Workspace cases 2026-11-27 14:30:29 +08:00
liukx0205 7f4125dff6 fix(session): lead breadcrumbs and fork Workspaces through side sources
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.
2026-11-27 14:30:29 +08:00
liukx0205 26f6eee9ee test(session-log-export): cover exporting a side conversation with its own subagents 2026-11-27 14:30:29 +08:00
liukx0205 325d9448c5 fix(session): follow only subagent creators in IM chat inheritance and descendant logs
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.
2026-11-27 14:30:29 +08:00
liukx0205 ecdcb1bc12 feat(session): record a side conversation's source as parentSession and classify consumers by origin
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.
2026-11-27 14:30:29 +08:00
Turtle 50669559f5 fix(llm-pi-ai): report invalid tool arguments as a retryable INVALID_TOOL_ARGUMENTS failure
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
2026-11-27 14:23:41 +08:00
Jiawei Song 25bd1d5144 Merge pull request #9389 from deepseek-harness/plugin-compat-sample-refresh
feat(plugin-compat): refresh the community sample weekly
2026-11-27 14:21:28 +08:00
imccyu bbe9022868 Merge pull request #9363 from deepseek-harness/feat/client-platform-rows-layout
refactor(client): move platform library sources under src/client
2026-11-27 13:55:31 +08:00
imccyu 3174e692ab refactor(client): re-export platform libraries from the package root
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
2026-11-27 13:17:47 +08:00
imccyu 92bec1f0bf refactor(client): move platform library sources under src/client
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
2026-11-27 13:17:47 +08:00
涂轶翔 1e1f19dddb Merge pull request #9132 from deepseek-harness/fix/cua-copy
fix(cua): 完善自动电脑操作相关界面文案与实验性提示
2026-11-27 13:08:57 +08:00
Turtle b0ece668f9 refactor(sandbox): derive the weaker-mode no-op from WIDER_MODES
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
2026-11-27 13:00:40 +08:00
Turtle 2cc4d25bba feat(sandbox): accept a weaker sandbox_permissions request as a no-op
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
2026-11-27 12:50:32 +08:00
Yixiang Tu 46b37ce64d docs: regenerate event graphs and CUA README pairing after rebase 2026-11-27 12:13:14 +08:00
Yixiang Tu 4b290afda6 docs(ui-plugin-manager): name error in the install failure JSDoc 2026-11-27 12:13:12 +08:00
Yixiang Tu 8c1e598b1e refactor(ui-plugin-manager): keep the Host's management error whole
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.
2026-11-27 12:13:12 +08:00
Yixiang Tu 042024d946 fix(cua): drop the Windows administrator privileges warning 2026-11-27 12:13:08 +08:00
Yixiang Tu 39bdf49ea9 fix(cua): point the PTC recommendation to Settings → Agent presets
Plain-text hint in all eight locales, using each locale's Settings and Agent presets labels.
2026-11-27 12:12:51 +08:00
Yixiang Tu 0443300f4c revert(cua): drop the PTC mode link to Settings
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.
2026-11-27 12:12:49 +08:00
Yixiang Tu 6bac0e3e41 test(web): expect the Computer Use bundle's own platforms on unsupported Hosts
The Linux branch of the bundle-platform e2e checks the real Computer Use bundle, which declares darwin and win32, not the synthetic fixture's freebsd.
2026-11-27 12:12:47 +08:00
Yixiang Tu c878796e5e fix(cua): settle platform-refusal tests and the pending Windows lookup
- 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.
2026-11-27 12:12:47 +08:00
Yixiang Tu 949afbfe5c fix(cua): address review findings on permission notices and platform copy
- 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.
2026-11-27 12:12:47 +08:00
Yixiang Tu b938f4fb4e revert: keep activation guidance when enabling from the bundle detail page
Detail-page suppression changed guidance for every bundle (voice input, connector accounts); it will be revisited as a Plugin Manager-wide decision.
2026-11-27 12:12:45 +08:00
Yixiang Tu 29cc55c76f fix(ui-plugin-manager): skip activation popup when enabling from bundle detail page 2026-11-27 12:12:43 +08:00
Yixiang Tu 9104db2aa8 feat(cua): link PTC mode recommendation to Settings Agent presets 2026-11-27 12:12:41 +08:00
Yixiang Tu 72257d2bb2 fix(cua): unify helper-unavailable notice box and primary-ink warning titles 2026-11-27 12:12:40 +08:00
Yixiang Tu 49b2d29be5 feat(cua): overhaul Windows permission panel warnings and guidance 2026-11-27 12:12:40 +08:00
Yixiang Tu 093abb685c fix(cua): simplify locked desktop setup message 2026-11-27 12:12:38 +08:00
Yixiang Tu 7127aebd5d fix(cua): refine notice styling, permission errors, and supported platform copy 2026-11-27 12:12:38 +08:00
Yixiang Tu 8892e8ed80 fix(cua): polish computer-use UI copy and experimental notice 2026-11-27 12:12:36 +08:00
Turtle 218ed6cf8c docs(core-guidelines): simplify G.3 wording 2026-11-27 11:59:08 +08:00
LegGasai 9c232b0b57 Merge pull request #9317 from deepseek-harness/worktree/forge-review-comment-color-ff518c
feat(forge): open a commit's changes from the review page activity and darken comment text
2026-11-27 11:57:41 +08:00
Turtle 886df47b21 docs(core-guidelines): state that G.3 initial lists are written once and review rejects added entries 2026-11-27 11:34:39 +08:00
Turtle 9f291d4df6 docs(core-guidelines): add G.3 gating new rules whose violations a script can detect
Refs #9367
2026-11-27 11:34:39 +08:00
gengruilin 0428d36e56 feat(ui-plugin-manager): show a contributed tab's own page under a crumb
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.
2026-11-27 11:34:31 +08:00
LegGasai 88cf8a40bf fix(forge): start a Shift run of commits at the one commit shown
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.
2026-11-27 11:29:47 +08:00
Dudu-0223andDudu-0223 17ba32e798 fix(cua-windows): keep accessibility reads when elements disappear mid-traversal (#9208)
* 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>
2026-11-27 03:22:51 +00:00
Turtle 39f8753817 Merge pull request #9310 from deepseek-harness/turtle/add-prompt-guideline-a609ce20b38f
docs(core-guidelines): add P.1 keeping tool guidance in tool descriptions
2026-11-27 11:19:21 +08:00
CreatixChu 61e4577b73 Merge pull request #9324 from deepseek-harness/fix/macos-toggle-mouse-buttons
修复 macOS 系统输入下按住左键时无法按右键的问题
2026-11-27 11:16:01 +08:00
Turtle edd1f4ad64 Merge pull request #9360 from deepseek-harness/turtle/diagnose-wg-websocket-f21ed379448e
feat(cli): leave heap diagnostics when a source launch runs out of memory
2026-11-27 11:12:21 +08:00
imccyu e2e0af8159 build(deps): upgrade the client to React 19 (#9217)
* 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
2026-11-27 02:45:21 +08:00
Yudong Hanandimccyu 5cff6056ba feat(desktop): add shared texture interface and transport (#8439)
* 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>
2026-11-27 02:15:04 +08:00
Jiawei Song 36e6d3531a Merge pull request #8719 from deepseek-harness/community-plugin-compatibility-ci
ci(plugin-compat): analyze pull requests and publish the report
2026-11-27 01:10:21 +08:00
Turtle acf8daa08e docs(development): warn that heap diagnostics contain credentials
Refs #9359
2026-11-27 00:55:35 +08:00
Turtle 0daacca2ed feat(cli): leave heap diagnostics when a source launch runs out of memory
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
2026-11-27 00:44:30 +08:00
Jiawei Song baee151ff9 Merge pull request #8443 from deepseek-harness/community-plugin-compatibility
feat(plugin-compat): assess community plugin compatibility from emitted declarations
2026-11-27 00:22:01 +08:00
Turtle 74cf97c265 Merge pull request #8882 from deepseek-harness/turtle/scoped-tool-registries
refactor(tools)!: compose tool registries under scoped roots
2026-11-27 00:11:09 +08:00
Yudong Han a863267b29 Merge pull request #9303 from deepseek-harness/fix/kit-linux-glibc-engine
fix(office): 升级 LibreOffice Kit 0.2.4,Linux 发行产物选用其 glibc 原生引擎
2026-11-26 23:34:00 +08:00
yudshj 92e65be447 fix(office): upgrade LibreOffice Kit to 0.2.4 and select its glibc engines on Linux
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.
2026-11-26 23:15:45 +08:00
imccyu 5b0daea245 Merge pull request #9353 from deepseek-harness/fix/flaky-github-ready-review
test(web): wait for startup restoration before GitHub webhook delivery
2026-11-26 21:49:25 +08:00
imccyu 4ec03d746d Merge pull request #9350 from deepseek-harness/fix/stats-prepend-test-order
test(client-ui-stats): publish an older page after its loader settles
2026-11-26 21:20:56 +08:00
Turtle f6eedf94f0 Merge pull request #9339 from deepseek-harness/turtle/env-runner-handle-da70f65f0ea2
refactor(environment)!: pass the environment handle to each runner call
2026-11-26 20:33:00 +08:00
Xu Hanxiang 1817906656 Merge pull request #9122 from deepseek-harness/fix/stats-prepend-scroll
fix(experimental): stats view tab scroll position
2026-11-26 20:23:07 +08:00
imccyu 0dfd6191d8 Merge pull request #9346 from deepseek-harness/fix/control-row-resize-loop
fix(ui-conversation): keep composer resize handling out of ResizeObserver loops
2026-11-26 20:12:42 +08:00
imccyu fe394cc0b4 fix(ui-conversation): keep composer resize handling out of ResizeObserver loops
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
2026-11-26 19:59:06 +08:00
winewill a22f351c54 Merge pull request #9223 from deepseek-harness/feat/desktop-channel-convergence
feat(desktop): converge update channels on stable and decouple target publication
2026-11-26 19:58:56 +08:00
Kexin Liu 28a2442748 Merge pull request #9209 from deepseek-harness/feat/sqlite-event-rows
feat(session)!: store SQLite events as rows with derived tables
2026-11-26 19:45:02 +08:00
Turtle 4c52bb7458 docs(environment): drop the repeated handle sentence from define 2026-11-26 19:42:00 +08:00
imccyu e857c1d84f fix(client): keep client code and tests compatible with React (#9333)
* 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
2026-11-26 19:30:43 +08:00
Turtle 61060fc11d refactor(environment)!: pass the environment handle to each runner call
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
2026-11-26 19:24:13 +08:00
Chinesezjc 3d7bf50162 Merge pull request #9318 from deepseek-harness/fix/weighted-approval-app-read
fix(ci): use the Actions token for approval reads and comments
2026-11-26 18:34:13 +08:00
imccyu 4c6f538edc perf(client): stop forcing layout when a Session mounts quotes and View tabs (#9328)
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
2026-11-26 18:18:03 +08:00
Turtle a88b3d4e30 Merge pull request #9330 from deepseek-harness/turtle/fix-plugin-toggle-bounce-04ebade055b5
fix(ui-plugin-manager): keep a plugin switch busy until the page shows its new state
2026-11-26 18:14:24 +08:00
Kexin Liu da3ba0f245 feat(agent-loop): recover inbox claims before step start (#9145)
* 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.
2026-11-26 18:10:58 +08:00
Chinesezjc 9e891d50a4 Merge branch 'master' into fix/weighted-approval-app-read 2026-11-26 18:10:23 +08:00
creatixchu 170b9e5280 fix(cua-macos): preserve unowned mouse holds during button chords 2026-11-26 18:05:16 +08:00
winewill 97e2dc0886 fix(desktop): scope inactive channel store per instance and clarify website installer TODO 2026-11-26 18:00:06 +08:00
Turtle 2099 3f5fdd5a2f Merge pull request #7840 from deepseek-harness/turtle/remote-tool-executor-d0d21ac6d7e4
feat(experimental): add provider-contributed execution environments
2026-11-26 17:53:25 +08:00
Turtle 308ecaf1c2 fix(ui-plugin-manager): keep a switch busy until the re-read shows its new state 2026-11-26 17:44:46 +08:00
LegGasai 3f400c788f Merge pull request #8951 from deepseek-harness/worktree/fix-saved-api-key-editing
fix(ui-settings-models): clarify saved API key replacement
2026-11-26 17:30:40 +08:00
LegGasai 759b17b5d7 Merge remote-tracking branch 'origin/master' into worktree/forge-review-comment-color-ff518c 2026-11-26 17:24:44 +08:00
LegGasai abac0caba4 Merge pull request #9320 from deepseek-harness/fix/forge-base-worktree-path
test(ci): fix the local head spec's Windows path assertion and coverage gap
2026-11-26 17:22:39 +08:00
imccyu 4abf91ec04 perf(client): stop forcing layout when a Session mounts quotes and View tabs
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
2026-11-26 17:17:46 +08:00
LegGasai cb7bc14179 Merge remote-tracking branch 'origin/master' into worktree/fix-saved-api-key-editing
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.
2026-11-26 17:14:49 +08:00
LegGasai 8b010dc2b0 Merge branch 'master' into fix/forge-base-worktree-path 2026-11-26 17:07:51 +08:00
winewill 11362bad7c fix(desktop): refine version slot registration, audit outputs, and bundled dsh header 2026-11-26 17:05:30 +08:00
LegGasai 4ca99b72b4 Merge pull request #8894 from deepseek-harness/feat/models-settings-layout
feat(ui-settings-models): fold model rows and split the provider editor into sections
2026-11-26 17:01:56 +08:00
Chinesezjc 26b87b086d Merge branch 'master' into fix/weighted-approval-app-read 2026-11-26 17:00:07 +08:00
imccyu 700edb5ced fix(web): space consecutive Markdown images with CSS only (#9188)
* 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.
2026-11-26 16:58:35 +08:00
creatixchu 7461135850 fix(cua-macos): allow overlapping system mouse button holds 2026-11-26 16:58:13 +08:00
LegGasai 5ad9433816 Merge remote-tracking branch 'origin/master' into feat/models-settings-layout
# Conflicts:
#	packages/client/ui-primitives/README.i18n.yaml
2026-11-26 16:46:18 +08:00
Ziya a9c0a1f496 Merge pull request #9171 from deepseek-harness/feat/recommend-connectors
feat(plugin-recommendations): 个性化推荐加入官方连接器,可在卡片上安装并启用
2026-11-26 00:44:31 -08:00
Dudu-0223 93d9ded727 feat(llm): 在 DeepSeek 推理请求头中标记子代理和直接父会话 (#9298)
* 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
2026-11-26 16:39:30 +08:00
LegGasai fdd1be2a76 test(forge): cover a listed worktree directory that another repository took over
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.
2026-11-26 16:38:35 +08:00
LegGasai af62652cec test(forge): expect Git's spelling of a listed worktree directory
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.
2026-11-26 16:02:40 +08:00
Chinesezjc 85c7db4812 docs(ci): clarify machine review credential initialization 2026-11-26 15:41:53 +08:00
Chinesezjc b4a15f0c34 fix(ci): reserve the machine approval credential for native reviews 2026-11-26 15:41:27 +08:00
Chinesezjc 4b0d1aba81 fix(ci): allow the approval job token to maintain issue comments 2026-11-26 15:32:58 +08:00
Chinesezjc 1c93d8915f Merge pull request #8577 from deepseek-harness/feat/schedule-source-model
feat(schedule): submit Source observations to automation tasks
2026-11-26 15:31:32 +08:00
CreatixChu e8905b269b Merge pull request #9066 from deepseek-harness/feat/windows-app-consent
feat(cua-windows): 支持按应用跨会话授权
2026-11-26 15:27:35 +08:00
winewill 29c09b141c docs(desktop): add manual installed-upgrade testing guide 2026-11-26 15:22:20 +08:00
imccyu 28dfa06cca feat(client): load package-local chunk dependencies (#9286)
* 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
2026-11-26 15:21:49 +08:00
LegGasai 1fffe9986d docs(forge): record the README pairs after the activity changes 2026-11-26 15:20:33 +08:00
LegGasai 25cda981b1 feat(forge): open one commit's changes from its line in the review page activity
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.
2026-11-26 15:20:14 +08:00
LegGasai 04a1fce565 fix(forge): show activity comment text in the page's primary ink
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.
2026-11-26 15:20:14 +08:00
LegGasai 7b7eda62af Merge pull request #9199 from deepseek-harness/worktree/forge-subsession-changes-2a8785
feat(forge): show other branches and their worktrees in the local changes view
2026-11-26 15:12:43 +08:00
CreatixChu b819c9f9da docs(notes): record the permission-controller model and key choices for CUA attributes 2026-11-26 15:12:11 +08:00
Turtle f66341724f docs(core-guidelines): scope P.1 to static sections and cross-call habits
Refs #9309
2026-11-26 15:03:48 +08:00
CreatixChu d4c4fcefb3 Merge remote-tracking branch 'origin/master' into codex/pr-9066 2026-11-26 15:02:34 +08:00
CreatixChu 147489c7b6 fix(cua-windows): label explicit executable selections by product name
Explicit path selection reads ProductName from the executable version resource instead of FileDescription; the file name remains the fallback.
2026-11-26 14:55:33 +08:00
Turtle 5af407667d docs(core-guidelines): add P.1 keeping tool guidance in tool descriptions
Refs #9309
2026-11-26 14:50:52 +08:00
LegGasai 9b4df76c66 feat(forge): compare another branch with the Session's own HEAD by default
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.
2026-11-26 14:45:59 +08:00
Magolor 870c1d5c7e fix(session): list Sessions again after a damaged database is recovered
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.
2026-11-26 14:44:53 +08:00
CreatixChu c071e1f7de fix(cua-windows): hash only the helper exe and build attributes without LINQ
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.
2026-11-26 14:31:04 +08:00
winewill 0ec3ee7428 docs(desktop): add channel convergence upgrade guide and refine CI publishing docs 2026-11-26 14:23:39 +08:00
winewill e0a55aff10 fix(desktop): address review feedback on channel publishing, reload headers, and unused fields 2026-11-26 14:23:38 +08:00
winewill 42cac85266 chore(desktop): remove unused installed-update manual qualification suite 2026-11-26 14:23:37 +08:00
Magolor 295666619f perf(session): use 16 KiB pages to reduce the padding around large values
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.
2026-11-26 14:22:03 +08:00
Chinesezjc 606f8c508f Merge pull request #8722 from deepseek-harness/ci/weighted-approval-review
feat(ci): approve weighted pull requests instead of gating CI
2026-11-26 14:19:33 +08:00
LegGasai a7b7b88a2c Merge pull request #9300 from deepseek-harness/fix/plugin-sync-notice-layout
fix(plugin-manager): show page failures in a card with a one-line retry
2026-11-26 14:11:43 +08:00
Chinesezjc 203ffa5ab9 test(ci): assert the approval credential description without an unsafe matcher 2026-11-26 14:02:31 +08:00
LegGasai a69613bcb3 feat(forge): show other branches by branch, in their worktrees, and keep the local changes row
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.
2026-11-26 14:00:39 +08:00
Ruilin Geng 69be60151e Merge pull request #9141 from deepseek-harness/refactor/mcp-manager-server-rows
feat(mcp-manager): declare a managed server as its own row beside the servers dictionary
2026-11-26 13:57:05 +08:00
gengruilin d1c116fb74 feat(client-ui-connectors): draw custom MCP server rows like connector rows
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.
2026-11-26 13:43:08 +08:00
Magolor febabea5cf refactor(session)!: report a locked database on every platform instead of replacing it
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.
2026-11-26 13:35:24 +08:00
Magolor f2ab8c2f7b fix(session): report why a database could not be moved aside, never the internal tag
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.
2026-11-26 13:01:58 +08:00
LegGasai 77f8685a5d fix(client-modules): write a repeated load attempt once in import failures
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
2026-11-26 12:57:34 +08:00
Turtle 8992c053bd Merge pull request #9059 from deepseek-harness/turtle/docs-registry-pattern-8980806414b1
docs(core-guidelines): add B.2 registry rule for independent config entries
2026-11-26 12:53:58 +08:00
Magolor 555d242441 fix(session): assert each platform's real behaviour when a locked database cannot move
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.
2026-11-26 12:42:30 +08:00
_Kerman d8fca6dd50 Merge pull request #9092 from deepseek-harness/xtr/ptc-inspect-tool-result-prompt
feat(ptc): tell the model what inspecting a tool result shows
2026-11-26 12:33:44 +08:00
ZiyaZhang 2850ff90f9 refactor(plugin-recommendations): take the official connectors from a generated catalog
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.
2026-11-25 20:22:09 -08:00
Magolor 354e9ae8f5 fix(session): keep a locked database in place when Windows refuses to move it
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.
2026-11-26 12:19:30 +08:00
_Kerman 4f87aa6b34 fix(ptc): describe read output as line-numbered content
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.
2026-11-26 12:12:45 +08:00
_Kerman aed92f10cc feat(ptc): tell the model what inspecting a tool result shows
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.
2026-11-26 12:12:44 +08:00
gengruilin 1b759b9de1 fix(mcp-manager): refuse a server row's enabled field in the row schema
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
2026-11-26 12:11:29 +08:00
LegGasai bbe41ee844 fix(plugin-manager): show page failures in a card with a one-line retry
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
2026-11-26 12:10:29 +08:00
CreatixChu 792a98c346 Merge remote-tracking branch 'origin/master' into codex/pr-9066
# Conflicts:
#	scripts/client-bundle-css.spec.ts
2026-11-26 11:59:40 +08:00
CreatixChu c30fa66dd1 feat(cua): match application consent by permission attributes
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.
2026-11-26 11:59:04 +08:00
imccyu 4bac127c40 Merge pull request #8553 from deepseek-harness/turtle/fix-table-scroll-gap-d958d804793a
fix(ui-chat): start wide table scroll at the message column
2026-11-26 11:57:33 +08:00
Magolor 0e56ff698b fix(session): recover an unusable database, keep planner statistics, and carry over damaged frames
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.
2026-11-26 11:52:53 +08:00
std4453 5520c951f4 Merge pull request #8223 from deepseek-harness/turtle/fix-fork-session-placement-62a998af479a
fix(ui-workspace): place Manual forks above their source and account them in their Workspace first
2026-11-26 11:43:31 +08:00
imccyu 67ccd52835 Merge pull request #9285 from deepseek-harness/client-isolation-scoped-css-and-media
fix(client): keep plugin styles, theme reads, and media queries working under client isolation
2026-11-26 11:37:35 +08:00
imccyu 180143989c Merge pull request #9281 from deepseek-harness/fix/flaky-stats-paged-history
test(web): load earlier history without scrolling to the control
2026-11-26 11:08:24 +08:00
imccyu c846d72c31 Merge pull request #9279 from deepseek-harness/fix/flaky-subagent-summary
test(web): wait for the ended Turn before expanding a subagent card
2026-11-26 11:08:02 +08:00
imccyu 2f33712337 Merge pull request #9277 from deepseek-harness/fix/flaky-agent-team-viewport
test(web): wait for the dock probe to settle before pressing the panel toggle
2026-11-26 11:07:23 +08:00
imccyu 9750bf937e Merge pull request #9276 from deepseek-harness/fix/flaky-forge-panel-other
test(web): open the unarchived Session only after its row stops refusing to open
2026-11-26 11:06:41 +08:00
imccyu c03a2a355c Merge pull request #9274 from deepseek-harness/fix/flaky-forge-session-bash
test(forge-session): bound the waits for lookup bindings by the lookup deadline
2026-11-26 11:06:22 +08:00
imccyu 6c61bb38e4 Merge pull request #9257 from deepseek-harness/fix/flaky-mention-path
test(web): wait for the reloaded mention bubble before polling its chips
2026-11-26 11:05:46 +08:00
imccyu 0c3667edc0 Merge pull request #9243 from deepseek-harness/fix/flaky-cua-mcp
test(cua-mcp): observe program process exit through a private endpoint, not a reusable PID
2026-11-26 11:05:15 +08:00
imccyu 7b97808fc5 Merge pull request #9229 from deepseek-harness/fix/flaky-browser-use-mcp
test(browser-use-runtime): observe MCP fixture exit through a private endpoint, not a reusable PID
2026-11-26 11:04:57 +08:00
winewill 630dddd1e1 test(desktop): update default builder publish channel assertion in macos-signature 2026-11-26 09:58:07 +08:00
imccyu 8bc9a4bd45 test(forge-session): bound the waits for lookup bindings by the lookup deadline
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.
2026-11-26 02:51:22 +08:00
imccyu c27bd4bc01 test(web): wait for the reloaded mention bubble before polling its chips
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
2026-11-26 02:51:14 +08:00
gengruilin b11ef6e464 feat(client-ui-connectors): offer "Add MCP server" in the Connectors tab's actions slot
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.
2026-11-26 02:25:30 +08:00
imccyu 0ee1a83765 test(web): load earlier history without scrolling to the control
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.
2026-11-26 02:22:41 +08:00
imccyu 78f4af9488 test(web): wait for the ended Turn before expanding a subagent card
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.
2026-11-26 02:18:06 +08:00
imccyu e09e660045 Merge pull request #9238 from deepseek-harness/fix/flaky-remote-connection
test(web): open Settings only after the first Session list lands
2026-11-26 02:17:27 +08:00
imccyu 96886ab17c Merge pull request #9236 from deepseek-harness/fix/flaky-ptc-runtime-cancel
test(ptc-runtime-node): observe hot-loop readiness without the child's control pipe
2026-11-26 02:13:38 +08:00
imccyu 477be0b309 Merge pull request #9246 from deepseek-harness/fix/flaky-sidebar-right-drag
test(web): wait for the docked hosts to rest before the chorded tab drag
2026-11-26 02:12:46 +08:00
imccyu f619878179 Merge pull request #9259 from deepseek-harness/fix/flaky-plugin-market-repo-cache
test(plugin-market): keep network failure words out of repository fixture paths
2026-11-26 02:12:00 +08:00
imccyu aae8c18592 Merge pull request #9263 from deepseek-harness/fix/flaky-session-panel-layout
test(web): seek the Session panel motion on its own timeline instead of counting frames
2026-11-26 02:11:12 +08:00
imccyu 590cb384b4 Merge pull request #9266 from deepseek-harness/fix/flaky-client-bundle-css
test(client): escape generated CSS Modules class names in selector expectations
2026-11-26 02:10:34 +08:00
imccyu ba5c12a9ba Merge pull request #9251 from deepseek-harness/fix/flaky-sidechat
test(web): wait for the editable main composer before typing /side
2026-11-26 02:09:18 +08:00
imccyu b7957076ef Merge pull request #9264 from deepseek-harness/fix/flaky-forge-panel-stages
test(web): wait for the local changes reread after a write instead of a one-second poll
2026-11-26 02:08:57 +08:00
imccyu 8753b08312 test(web): open the unarchived Session only after its row stops refusing to open
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
2026-11-26 02:08:51 +08:00
imccyu fe90bf2caf test(web): wait for the dock probe to settle before pressing the panel toggle
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
2026-11-26 02:07:44 +08:00
imccyu 3d60528091 test(plugin-market): keep network failure words out of repository fixture paths
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
2026-11-26 01:48:06 +08:00
imccyu 2ec45edd31 test(web): open Settings only after the first Session list lands
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
2026-11-26 01:47:47 +08:00
imccyu 3e94d58fd7 Merge pull request #9258 from deepseek-harness/fix/flaky-fold-blank-matrix
test(web): measure fold gaps from painted and reserved row boxes
2026-11-26 01:43:19 +08:00
imccyu aff6333d8d test(client): escape generated CSS Modules class names in selector expectations
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
2026-11-26 01:34:29 +08:00
imccyu 958d724be8 test(web): wait for the local changes reread after a write instead of a one-second poll
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
2026-11-26 01:25:43 +08:00
imccyu 7d09685b68 test(web): seek the Session panel motion on its own timeline instead of counting frames
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
2026-11-26 01:24:12 +08:00
imccyu 5e78665cae test(web): measure fold gaps from painted and reserved row boxes
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.
2026-11-26 01:17:41 +08:00
imccyu fe892a7007 Merge pull request #9247 from deepseek-harness/fix/flaky-shell-command-details
test(web): settle the command scrollport before releasing a drag selection
2026-11-26 01:17:19 +08:00
imccyu c6b8b9d371 Merge pull request #9235 from deepseek-harness/fix/flaky-session-drag-scroll
test(web): aim the session drag drop at a row center instead of a fixed point
2026-11-26 01:16:26 +08:00
imccyu 3a8191b22d Merge pull request #9232 from deepseek-harness/fix/flaky-oxlint-contract
test(lint): copy the Oxlint contract repository from the Git index
2026-11-26 01:16:11 +08:00
imccyu 4444eea735 test(web): wait for the docked hosts to rest before the chorded tab drag
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
2026-11-26 01:15:17 +08:00
imccyu 4af7306acc test(web): wait for the editable main composer before typing /side
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
2026-11-26 00:58:35 +08:00
imccyu 3c428b0a5f test(web): settle the command scrollport before releasing a drag selection
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
2026-11-26 00:54:25 +08:00
imccyu abbbf099ba test(web): aim the session drag drop at a row center instead of a fixed point
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
2026-11-26 00:34:05 +08:00
imccyu ec62bb7169 test(ptc-runtime-node): observe hot-loop readiness without the child's control pipe
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.
2026-11-26 00:32:56 +08:00
imccyu c1093c65a1 test(lint): copy the Oxlint contract repository from the Git index
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
2026-11-26 00:32:27 +08:00
gengruilin 720075b06e feat(mcp-manager): declare a managed server as its own row beside the servers dictionary
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
2026-11-26 00:31:25 +08:00
imccyu 516c2e94c1 Merge pull request #9227 from deepseek-harness/fix/agent-team-compact-detail-timeout
test(web): poll the panel offset after the wheel instead of racing scrollend
2026-11-25 23:22:54 +08:00
imccyu d4fa52d7b8 test(web): poll the panel offset after the wheel instead of racing scrollend
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
2026-11-25 21:48:01 +08:00
imccyu 64ac8d1a5b fix(client): realm-independent JSON and shallowEqual checks, and owner-held cross-package styles (#9181)
* 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.
2026-11-25 21:33:04 +08:00
imccyu 67dddc0dc6 Merge pull request #9216 from deepseek-harness/fix/react-18-19-compat
fix(web): keep client code compatible with React
2026-11-25 20:50:27 +08:00
ZiyaZhang fab54d83ea fix(plugin-recommendations): keep connector cards truthful after repeated failures
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.
2026-11-25 04:10:08 -08:00
Magolor 6da7ed3f6e refactor(session): keep the SQLite store's SQL in versioned .sql resources
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.
2026-11-25 18:47:26 +08:00
winewill b1dabaf034 docs(desktop): document channel convergence, decoupled publishing, and settings v1 2026-11-25 18:28:49 +08:00
winewill c91cec036b chore(desktop): sync preflight types, provider config check, and client slot catalog 2026-11-25 18:28:48 +08:00
winewill 4414d6291a feat(ui-settings-general): hide channel selector until 5-click version confirmation 2026-11-25 18:11:58 +08:00
winewill 9f64b72129 feat(desktop): migrate settings to v1, lock un-unlocked channel to stable, and send feed headers 2026-11-25 18:11:58 +08:00
imccyu 7b4340ecd9 fix(client): adopt document portal hooks and realm-independent DOM checks in business plugins (#9170)
* 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.
2026-11-25 18:04:18 +08:00
Chinesezjc 58bea7183b docs(ci): distinguish secret name forwarding from value storage 2026-11-25 18:01:20 +08:00
Chinesezjc 1b8b42fa54 fix(ci): pass only the environment secret name to the reusable job 2026-11-25 18:00:09 +08:00
Chinesezjc b544b3d7ff docs(ci): specify approval environment setup and pilot verification 2026-11-25 17:59:22 +08:00
Chinesezjc 799da26c32 fix(ci): read the approval token from the protected environment 2026-11-25 17:54:17 +08:00
Magolor aeb1cfbfcf fix(session): carry over the readable events of a damaged frame
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.
2026-11-25 17:48:54 +08:00
Chinesezjc f7b143959f test(ci): share weighted approval routing assertions 2026-11-25 17:40:12 +08:00
gengruilin 3049befbcf fix(client-ui-connectors): label the second connection choice "URL"
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".
2026-11-25 17:37:29 +08:00
Turtle 42e16d663f Merge pull request #9165 from deepseek-harness/turtle/default-mock-llm-185de0078cad
feat(webworker-preview): start the Preview on a keyless mock model
2026-11-25 17:32:27 +08:00
Chinesezjc 7ccf814fcb fix(ci): re-evaluate weighted approval on scoring events 2026-11-25 17:31:24 +08:00
winewill 36770db9ce ci(desktop): default packaging to stable and use channel checkboxes in publish workflows 2026-11-25 17:29:58 +08:00
winewill 6a5078a885 feat(desktop-publisher): decouple target channels from packaged channel 2026-11-25 17:29:57 +08:00
Magolor cbc6457226 feat(session)!: store SQLite events as rows with derived tables
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.
2026-11-25 17:23:45 +08:00
gengruilin 90d4cc6ba8 fix(ui-primitives): wrap an unbroken path or command in a risk confirmation
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.
2026-11-25 17:11:46 +08:00
Dudu-0223 55692642ad fix(web): align subagent composer actions with main sessions (#9055)
* fix(web): align subagent composer actions with main sessions

* docs(ui-subagent): clarify the Stop button in Chinese
2026-11-25 09:04:36 +00:00
LegGasai 0057f19a78 test(forge): cover a detached HEAD's bases, a late related listing, and the head picker end to end 2026-11-25 16:58:32 +08:00
std4453 08f71eb52a Merge pull request #8406 from deepseek-harness/turtle/unify-toolcall-ui-32fb131525fb
feat(ui): align retry and delivery rows with tool rows
2026-11-25 16:49:13 +08:00
LegGasai 6ca566d943 test(forge): give the review page's changes fixture the related checkouts read 2026-11-25 16:47:44 +08:00
LegGasai 047ce90c65 feat(forge): show related Sessions' checkouts and other branches in the local changes view
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.
2026-11-25 16:43:17 +08:00
CreatixChu 7bf62fbf9b fix(cua-windows): retain baseline identity with explicit app aliases 2026-11-25 16:41:27 +08:00
Yifffan 7e9d392ee2 Merge pull request #8918 from deepseek-harness/turtle/macos-fullscreen-solid-dbcd9c3fdd42
feat(ui-layout): use the solid web sidebar fill in macOS fullscreen
2026-11-25 16:37:12 +08:00
Turtleandstd4453 fc1c6dd227 fix(ui-workspace): place Manual forks directly above their source
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>
2026-11-25 16:33:26 +08:00
LegGasai 39c086c7d5 fix(ui-settings-models): show no hint below a cleared API key
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.
2026-11-25 16:24:56 +08:00
LegGasai f3557fa9da fix(ui-settings-models): read a cleared API key as a field without a saved key
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.
2026-11-25 16:11:04 +08:00
LegGasai f535813467 feat(forge): stage, unstage, and restore files in the local changes view (#9166)
* 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
2026-11-25 08:04:39 +00:00
CreatixChu f30ec1cd3c fix(cua-windows): restore synchronous running app listing 2026-11-25 15:30:08 +08:00
Kexin Liu 2db4cd0cbc Merge pull request #9105 from deepseek-harness/turtle/side-origin-hidden-31b8f95819bd
feat(sidechat): record side origin and hide side conversations from the left Sidebar
2026-11-25 15:29:23 +08:00
CreatixChu cda435753e fix(cua-windows): preserve access to path-selected windows 2026-11-25 15:21:05 +08:00
Turtle 97d68a06ce refactor(webworker-packer): share the composed-row override between patches 2026-11-25 15:16:00 +08:00
Turtle 03439d43c7 feat(webworker-preview): start the Preview on a keyless mock model
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
2026-11-25 15:16:00 +08:00
Turtle 2099 d3d7307b92 Merge pull request #8662 from deepseek-harness/turtle/dev-desktop-home-47628c18e486
feat(desktop): default development Desktop to ~/.dsh
2026-11-25 07:14:43 +00:00
LegGasai 0c5e64abb1 fix(ui-settings-models): show a saved API key read-only with replace and clear actions
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.
2026-11-25 15:11:37 +08:00
MicroBlock dc6a0bfc7e fix(adapter-qq): name platform failures, answer clicks, render mentions (#9190)
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
2026-11-25 07:11:03 +00:00
Xu Hanxiang 7355ddbb7d Merge pull request #8966 from deepseek-harness/feat/liveshare-share-reconnect
feat(liveshare): 限制断线重试并支持原链接立即重连
2026-11-25 07:07:23 +00:00
CreatixChu 7145636bbd fix(cua): preserve saved app details when reusing consent 2026-11-25 15:05:03 +08:00
TurtleandKexin Liu 3b2fbed8c6 docs: regenerate the API and event catalogs
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
2026-11-25 15:03:16 +08:00
TurtleandKexin Liu babec62818 test(session-controller): type the preflight probe as a rejecting stat
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
2026-11-25 15:03:16 +08:00
TurtleandKexin Liu 8f8cba06d7 docs(session): state the released SQLite reader's rejection of a side header
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>
2026-11-25 15:03:16 +08:00
Turtle 71234cc1f9 fix(session-controller): refuse side forks of subagents and viewer-set origins before any work
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.
2026-11-25 15:03:16 +08:00
477adb30df fix(session-controller): keep subagent and side Sessions out of the search result limit
Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
2026-11-25 15:03:16 +08:00
7b178a4298 fix(session-controller): satisfy lint on fork origin check and refresh jsdoc snapshot
Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
2026-11-25 15:03:16 +08:00
16b99d167e fix(sidechat): open a side child whose Workspace attachment failed
Co-authored-by: Dudu-0223 <290591114+Dudu-0223@users.noreply.github.com>
Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
2026-11-25 15:03:16 +08:00
01f8ec78d1 feat(sidechat): record side origin and hide side conversations
/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>
2026-11-25 15:03:16 +08:00
Kexin Liu 584a962898 Merge pull request #8375 from deepseek-harness/feat/shared-side-conversations
feat(web): optional side conversations in the right Sidebar
2026-11-25 15:03:11 +08:00
LegGasai efe4ce746c Merge remote-tracking branch 'origin/master' into worktree/fix-saved-api-key-editing 2026-11-25 14:47:13 +08:00
Turtle 81b1839aaa chore(sidechat): regenerate the client slot catalog 2026-11-25 14:44:50 +08:00
15a10f911c fix(sidechat): show the side tab's display title like the Session panel
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>
2026-11-25 14:44:50 +08:00
Turtle 59e3f8fd3a fix(sidechat): mark the side tab as a sidebar chat and address review findings
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.
2026-11-25 14:44:50 +08:00
Turtle df9dd87c0e refactor(sidechat): drop an unreachable disposal guard and reuse the bound translator
The /side command is removed before the control is disposed, so fork never
runs on a disposed control. The tab title reuses the bound translator.
2026-11-25 14:44:50 +08:00
liukx0205 1d916f72f6 feat(sidechat): fork /side at the latest completed Turn like the ordinary fork
/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.
2026-11-25 14:44:50 +08:00
liukx0205 24c86d459f fix(sidechat): decline /side from a subagent conversation
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
2026-11-25 14:44:50 +08:00
liukx0205 33a1f7838e fix(sidechat): fork on every /side and accept a window with older pages
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.
2026-11-25 14:44:50 +08:00
liukx0205 f843b0ce85 fix(sidechat): require a started Turn before /side forks
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.
2026-11-25 14:44:50 +08:00
liukx0205 e340e40c5b test(sidechat): cover the package and document it
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.
2026-11-25 14:44:50 +08:00
liukx0205 f47eedc58c fix(sidechat): retain the child with its conversation facet
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.
2026-11-25 14:44:50 +08:00
liukx0205 656036e2c9 fix(sidechat): keep /side consumable and align with the release version
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.
2026-11-25 14:44:50 +08:00
liukx0205 e11fd0c567 feat(sidechat): fork /side at the newest event on screen
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.
2026-11-25 14:44:50 +08:00
liukx0205 09a85dbac5 feat(web): optional side conversations in the right Sidebar
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.
2026-11-25 14:44:50 +08:00
LegGasai 1df55fe910 Merge remote-tracking branch 'origin/master' into feat/models-settings-layout 2026-11-25 14:25:37 +08:00
Chinesezjc 77a5347e9d Merge pull request #9180 from deepseek-harness/ci/remove-environment-marker-probe
ci(probe): remove the temporary environment marker attribution probe
2026-11-25 14:22:50 +08:00
LegGasai a7a17d687c feat(ui-settings-models): report a refused save at the field that caused it
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.
2026-11-25 14:14:11 +08:00
Chinesezjc 7bdd695d65 ci(probe): remove the temporary environment marker attribution probe
The workflow only supported the three live runs recorded in #9005 and is not
referenced by any other workflow, script, or configuration.
2026-11-25 14:09:37 +08:00
CreatixChu 70eff03284 Merge pull request #9173 from deepseek-harness/turtle/fix-git-add-slow-77485ec18f43
fix(workspace-changes): give up a git command after 3 s instead of 30 s
2026-11-25 14:08:34 +08:00
Chinesezjc 839affcaf5 Merge pull request #9005 from deepseek-harness/ci/env-probe-8722-abc
ci(probe): add temporary manual environment marker attribution probe
2026-11-25 14:02:44 +08:00
ZiyaZhang 45d04ebe04 feat(plugin-recommendations): offer the connector card when an enabled connector lacks its account
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.
2026-11-24 21:54:21 -08:00
winewill aec47cad4f Merge pull request #9001 from deepseek-harness/turtle/fix-title-menu-dismiss-eb463486e617
fix(web): highlight a sidebar row only for a menu that row opened
2026-11-25 13:38:07 +08:00
Shigma 1e278067cc Merge pull request #9120 from deepseek-harness/fix/chat-block-spacing
fix(web): give message bubbles below process rows the block gap
2026-11-25 13:34:18 +08:00
Turtle 65ac3cfaf5 Merge pull request #9175 from deepseek-harness/turtle/revert-8674-29e8b8c91c40
revert: merge short SQLite frames inside the append transaction (#8674)
2026-11-25 13:24:36 +08:00
Ruilin Geng 1973f61547 Merge pull request #8938 from deepseek-harness/fix/mcp-session-expiry-recovery
fix(mcp-client): reconnect after the server forgets the Streamable HTTP session
2026-11-25 13:13:42 +08:00
TurtleandCreatixChu d6bb7edd5d docs(workspace-changes): re-record README translation pairing
Co-authored-by: CreatixChu <142372241+CreatixChu@users.noreply.github.com>
2026-11-25 13:02:28 +08:00
imccyu 3b21ac7972 Merge pull request #9174 from deepseek-harness/revert-8520-turtle/fix-image-margin-7d168ef652f5
Revert "fix(web): space consecutive Markdown images like paragraphs"
2026-11-25 12:58:11 +08:00
6fd18391a2 revert: merge short SQLite frames inside the append transaction (#8674)
This reverts merge commit 0a25695c87697f04af906a01e4c259048937d421.

Co-authored-by: Kexin Liu <69756503+liukx0205@users.noreply.github.com>
Co-authored-by: Magolor <25860372+Magolor@users.noreply.github.com>
2026-11-25 12:58:09 +08:00
Turtle 373769c622 Merge pull request #9168 from deepseek-harness/turtle/add-preview-fixture-rule-578e68ea890f
docs(agents): require PR preview showcase to show changed rendering
2026-11-25 12:58:00 +08:00
imccyu e46259e5cb Revert "fix(web): space consecutive Markdown images like paragraphs" 2026-11-25 12:57:38 +08:00
TurtleandCreatixChu fe3065735f docs(upgrade-guide): record the workspace-changes timeout default
Co-authored-by: CreatixChu <142372241+CreatixChu@users.noreply.github.com>
2026-11-25 12:51:22 +08:00
Turtle e029911eba Merge pull request #8520 from deepseek-harness/turtle/fix-image-margin-7d168ef652f5
fix(web): space consecutive Markdown images like paragraphs
2026-11-25 12:47:01 +08:00
TurtleandCreatixChu 2b1d214907 docs(workspace-changes): drop inaccurate tool wait bound
Co-authored-by: CreatixChu <142372241+CreatixChu@users.noreply.github.com>
2026-11-25 12:42:09 +08:00
TurtleandCreatixChu 07cc469c10 fix(workspace-changes): give up a git command after 3 s instead of 30 s
Co-authored-by: CreatixChu <142372241+CreatixChu@users.noreply.github.com>
2026-11-25 12:39:56 +08:00
Turtle 2ee08e0abd docs(agents): move preview showcase rule to root AGENTS.md
Refs #9167
2026-11-25 12:35:06 +08:00
LegGasai 3fef3cd8bc Merge pull request #9116 from deepseek-harness/fix/npm-zod-single-install
fix(deps): install one zod copy from npm
2026-11-25 12:29:11 +08:00
gengruilin 2ceacb8ad6 feat(client-ui-connectors): keep custom MCP servers as MCP server rows of the profile patch
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.
2026-11-25 12:29:08 +08:00
LegGasai cc2d601b8b fix(deps): keep the exact zod pin
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
2026-11-25 12:16:22 +08:00
Turtle 9dee11e36b docs(ui): limit preview showcase rule to Session content
Refs #9167
2026-11-25 12:07:35 +08:00
ZiyaZhang 00e4adcaa1 feat(plugin-recommendations): recommend official connectors and install them from the card
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.
2026-11-24 20:02:56 -08:00
f9bbfe07ff test(webworker-runtime): add a wide table sample Session to the preview workspace
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
2026-11-25 12:01:50 +08:00
imccyu 0583056ecf Merge pull request #9164 from deepseek-harness/fix/source-qr-login
fix(remote-connection): restore QR sign-in on source launches
2026-11-25 11:59:24 +08:00
CreatixChu a73e152055 fix(cua-windows): share application consent by Shell AUMID 2026-11-25 11:58:26 +08:00
Turtle 82ddef3dd8 docs(ui): require PR preview showcase to show changed rendering
Refs #9167
2026-11-25 11:55:24 +08:00
Turtle 4d9935b5bc Merge pull request #7960 from deepseek-harness/turtle/plugin-refresh-progress-12b7cea43c60
feat(plugin-manager): show refresh progress beside the Refresh button
2026-11-25 11:43:51 +08:00
EricMoin 7ab433338c fix(remote-connection): redeem QR logins on source launches 2026-11-25 11:43:32 +08:00
Turtle 8641460aa3 Merge pull request #8639 from deepseek-harness/turtle/plugin-update-builds-86f822edb704
fix(plugin-manager): allow blocked build scripts when updating a plugin
2026-11-25 11:33:33 +08:00
Turtle 3f69e246c1 feat(plugin-manager): count refresh checks on the Refresh button 2026-11-25 11:26:12 +08:00
Turtle 29d2f63066 fix(plugin-manager): wait for a running check and announce refresh progress
A refresh now waits for a version check another action started, reuses
the existing list-reading text, and marks the toolbar note as a status.
2026-11-25 11:26:09 +08:00
Turtle 882f93a09a feat(plugin-manager): show refresh progress beside the Refresh button
A manual refresh now names its step in the toolbar note: loading the
plugin list, then checking for updates with the current and total count.
2026-11-25 11:26:07 +08:00
CreatixChu 4cba2b6679 fix(cua): align Windows permission lists with macOS 2026-11-25 11:13:38 +08:00
CreatixChu e3544c62e1 test(client): parse escaped CSS module selectors 2026-11-25 11:13:38 +08:00
CreatixChu 9cd13bcba3 test(cua-windows): cover provider grant review policy 2026-11-25 11:13:38 +08:00
CreatixChu f141903d1a test(cua): assert icon requests without unsafe mock returns 2026-11-25 11:13:38 +08:00
CreatixChu 5ecfd7b347 fix(cua): restore application icon interface 2026-11-25 11:13:37 +08:00
CreatixChu 50eaf7e7f6 fix(cua): reuse shared application approval presentation 2026-11-25 11:13:37 +08:00
CreatixChu b9e473cf62 test(cua): cover saved identities and unreadable helper artifacts 2026-11-25 11:13:37 +08:00
CreatixChu 8e8e90a5e5 fix(cua): refresh saved app permissions before native metadata 2026-11-25 11:13:36 +08:00
CreatixChu 596b9f4846 fix(cua-windows): scope app consent to verified Windows identities 2026-11-25 11:13:35 +08:00
creatixchu ba5051f9e2 feat(cua-windows): 支持按应用跨会话授权 2026-11-25 11:13:35 +08:00
imccyu 8439d8530f Merge pull request #9140 from deepseek-harness/ui-responsive-document-hooks
feat(ui-renderer): provide mount-bound document portal and viewport hooks
2026-11-25 03:24:52 +08:00
imccyu a937361bb8 refactor(ui-renderer): keep whole-viewport selection local 2026-11-25 02:55:58 +08:00
imccyu 1f1590430e refactor(ui-renderer): bind document hooks to the application mount 2026-11-25 02:55:56 +08:00
imccyu b6fb171069 feat(ui-responsive): add document portal and viewport hooks 2026-11-25 02:54:28 +08:00
imccyu 897ab671f6 feat(ui-renderer): scope opted-in package styles on existing slot roots (#9033)
* 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.
2026-11-25 02:52:49 +08:00
imccyu 2fc9df3000 Merge pull request #8803 from deepseek-harness/client-isolation-switch
feat(client): run opt-in package scripts in dedicated iframe Realms
2026-11-25 00:29:12 +08:00
TurtleandYifffan 8d867d8020 fix(web): keep hard breaks and narrow columns in Markdown image rows
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
2026-11-25 00:16:47 +08:00
TurtleandYifffan cd1cc61042 fix(web): space consecutive Markdown images like paragraphs
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
2026-11-25 00:16:38 +08:00
imccyu 56acc26908 revert(web): restore full URLs for pull and merge request links (#8423) (#9138)
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.
2026-11-25 00:09:10 +08:00
imccyu 18bc130853 revert(web): restore full URLs for pull and merge request links (#8423)
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.
2026-11-24 23:06:16 +08:00
Ruilin Geng 857aad48ea Merge pull request #9118 from deepseek-harness/fix/connector-titles-linear-icon
fix(connector): 连接器名称去掉“插件”二字,Linear 图标改用白色圆底上的官方标志
2026-11-24 23:03:28 +08:00
imccyu e020f1e180 refactor(client-modules): install the Realm registry from its plugin
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.
2026-11-24 21:35:27 +08:00
imccyu 3bb1b55790 refactor(client-modules): keep one iframe per resident package
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.
2026-11-24 21:35:26 +08:00
imccyu b9d469efc2 refactor(client-modules): choose script placement when a package loads
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.
2026-11-24 21:35:25 +08:00
imccyu c813f27703 refactor(client-modules): pin script Realm placement until page reload
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.
2026-11-24 21:34:47 +08:00
imccyu 86fa13e2d8 docs(client): clarify when startup waits for Realm providers 2026-11-24 21:34:46 +08:00
imccyu f5d022c58e feat(client): run script-isolated package bundles in iframe Realms
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
2026-11-24 21:33:52 +08:00
e455040384 docs(core-guidelines): add B.2 registry rule for independent config entries
Co-authored-by: LegGasai <75920107+LegGasai@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
Co-authored-by: shigma <33423008+shigma@users.noreply.github.com>
2026-11-24 21:15:19 +08:00
imccyu 1c3c02b9b6 fix(app-boot)!: load bundle plugin rows from the packages their bundles select (#9038)
* 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.
2026-11-24 21:14:36 +08:00
Turtle a933d645bb Merge pull request #9129 from deepseek-harness/turtle/ban-polling-agent-loop-560bec0114a7
docs(core-guidelines): ban loops that poll Agent state
2026-11-24 21:04:45 +08:00
Turtle 9da5579ed7 docs(core-guidelines): clarify B.1 cleanup and append alternatives 2026-11-24 20:51:11 +08:00
gengruilin ef850884df fix(mcp-client): keep the expired connection open for the reconnect delay
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
2026-11-24 20:39:22 +08:00
Turtle 9e7ac0ea21 docs(core-guidelines): ban loops that poll Agent state
Refs #9128
2026-11-24 20:36:01 +08:00
Turtle cdbfa8bb1c Merge pull request #6542 from deepseek-harness/plugin-filter-all-locales
feat(web): add plugin references and cross-language plugin filtering
2026-11-24 20:11:33 +08:00
9e2f9fea4b refactor(ui-primitives): keep the inspect scope as a plain data attribute
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
2026-11-24 20:10:12 +08:00
68c2c2dca2 refactor(ui-conversation): import slot contract types at the top of slots.ts
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
2026-11-24 19:43:31 +08:00
Shigma 37ab5fda39 fix(web): keep the actions-row gap between folded question replies 2026-11-24 19:19:10 +08:00
Shigma 926f719b8a fix(web): key the folded question reply gap without :has() 2026-11-24 19:14:17 +08:00
Shigma e258b8cc83 fix(web): give message bubbles below process rows the block gap 2026-11-24 18:59:16 +08:00
1e521a2861 test(ui-sidebar): keep the reduced-motion helper for the fullscreen fade spec
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
2026-11-24 18:46:25 +08:00
LegGasai dfe4bfa821 fix(deps): declare zod wherever a dependency requires it as a peer
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
2026-11-24 18:45:47 +08:00
b897727be4 fix(ui-layout): fade the fullscreen fill without a stacking context
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>
2026-11-24 18:45:19 +08:00
3f7967bf71 test(web): register fullscreen regression in host compiler
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
2026-11-24 18:45:19 +08:00
cc87340206 fix(ui-layout): fade macOS fullscreen sidebar materials
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
2026-11-24 18:45:19 +08:00
eb5ae56b0a feat(ui-layout): use the solid web sidebar fill in macOS fullscreen
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>
2026-11-24 18:45:19 +08:00
Yifffan dc62cf787d Merge pull request #9109 from deepseek-harness/settings-slot-separators
fix(client): 修复通用设置 slot 注册项之间的分割线
2026-11-24 18:41:55 +08:00
5127dd5df0 refactor(ui-conversation): address View focus by kind and export the inspect scope
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
2026-11-24 18:34:26 +08:00
LegGasai 7230977ac0 fix(deps): install one zod copy from npm
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
2026-11-24 18:26:44 +08:00
Turtleandwinewill a4fada83d2 fix(web): highlight a sidebar row only for a menu that row opened
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>
2026-11-24 18:11:12 +08:00
Jiawei Song 934abdbfe7 Merge pull request #9019 from deepseek-harness/feat/sdk-mcp-manager
feat(sdk): mount the MCP manager in the SDK profile
2026-11-24 18:07:48 +08:00
LegGasai 5ac3b81a81 Merge pull request #9048 from deepseek-harness/feat/llm-pi-ai-deployment-provider-rows
feat(llm-pi-ai): add provider rows for deployment-supplied routes
2026-11-24 18:04:32 +08:00
Xu Hanxiang b5f68db74c Merge pull request #8454 from deepseek-harness/feat/liveshare-registration-check
feat(liveshare): 发布探测改用 owner-registration-check 端点
2026-11-24 09:58:21 +00:00
Chinesezjc 5d41ead1c5 test(ptc): report diagnostics on protocol classification mismatch 2026-11-24 17:50:51 +08:00
sjw1231 9382d70537 refactor(sdk): bound the initialize startup wait with a generic startupWaitMs
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.
2026-11-24 17:46:59 +08:00
LegGasai f75c2333c3 Merge remote-tracking branch 'origin/master' into feat/llm-pi-ai-deployment-provider-rows
# Conflicts:
#	docs/capability-seams.i18n.yaml
2026-11-24 17:43:42 +08:00
LegGasai b9ccc94b06 test(forge-session): bound the wait for the bindings that follow a program
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.
2026-11-24 17:41:16 +08:00
Chinesezjc 616623c723 test(schedule): reject oversized observations before queued delivery 2026-11-24 17:39:33 +08:00
Chinesezjc d92749e685 fix(schedule): bound encoded Source observations before delivery 2026-11-24 17:37:29 +08:00
c5b48f0d81 fix(ui-chat): show the retry attempt count in parentheses after the title
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
2026-11-24 17:37:05 +08:00
72882d06fc feat(ui): align retry and delivery rows with tool rows
Co-authored-by: Yifffan <133629972+Yifffan@users.noreply.github.com>
Co-authored-by: std4453 <13191718+std4453@users.noreply.github.com>
Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com>
2026-11-24 17:37:05 +08:00
gengruilin cef6fbecd4 docs(connector): redraw the Connectors and Linear previews
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.
2026-11-24 17:29:55 +08:00
gengruilin caca770c23 fix(linear): draw the Linear icon as the logomark on a white disc
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.
2026-11-24 17:29:55 +08:00
LegGasai 68f4a5a911 Merge pull request #9052 from deepseek-harness/worktree/wizardly-shirley-53d903
feat(read-aloud): read replies aloud with segment-paced synthesis
2026-11-24 17:29:33 +08:00
gengruilin 98152040cb fix(connector): drop the word "plugin" from the connector titles
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.
2026-11-24 17:29:32 +08:00
Turtle 689c8619fe Merge pull request #9102 from deepseek-harness/turtle/web-prompt-snapshot-c3d1a7662d3a
ci(preview): show the Web blank-Session catalog on the snapshot diff page
2026-11-24 17:10:35 +08:00
Yif 7aaf9d042e fix(client): draw general settings dividers between registrations 2026-11-24 16:56:33 +08:00
imccyu 8eb8ed7678 Merge pull request #9074 from deepseek-harness/page-input-hooks
feat(client): add ui-responsive standard props for media queries and mobile devices
2026-11-24 16:56:31 +08:00
Turtle 52ae8dc6cd ci(preview): show the Web blank-Session catalog on the snapshot diff page
Refs #9101
2026-11-24 16:43:25 +08:00
LegGasai e1c570927c fix(read-aloud): keep amounts of money out of inline formulas
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.
2026-11-24 16:35:18 +08:00
Turtle 706184f936 Merge pull request #9095 from deepseek-harness/turtle/surface-error-reasons-c2e8a7ef999a
fix: include the underlying reason in wrapped Remote failure messages
2026-11-24 16:17:51 +08:00
gengruilin e4f9506d5f fix(mcp-client): send a call rejected for its session again after reconnecting
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
2026-11-24 16:09:48 +08:00
Shigma 17ed03bbfb Merge pull request #9089 from deepseek-harness/refactor/vendor-im-layout
refactor(vendor): move the IM packages under vendor/im and classify local modifications
2026-11-24 16:09:19 +08:00
Chinesezjc 8dd29c058e Merge branch 'master' into feat/schedule-source-model 2026-11-24 16:04:58 +08:00
Turtle ccf9eab830 fix: include the underlying reason in wrapped Remote failure messages
Refs #9094
2026-11-24 16:02:39 +08:00
Shigma e6e9b5dc87 fix(vendor): drop the redundant nested tree list and document both vendor trees 2026-11-24 15:54:40 +08:00
Turtle f64af1654d Merge pull request #9071 from deepseek-harness/turtle/tweak-step-label-e25ccadda163
fix(ui-chat): show completed work while a running step group thinks
2026-11-24 15:51:21 +08:00
Shigma f34ba82f3f fix(vendor): cover vendor/im in the remaining package discovery and docs 2026-11-24 15:34:08 +08:00
Shigma e34f7bb7ee docs(vendor): drop the former V references from the modification logs 2026-11-24 15:24:51 +08:00
Dudu-0223 43aa93ed54 Merge pull request #9006 from deepseek-harness/feat/subagent-model-activation
feat(subagent): select local child models through maintenance restoration
2026-11-24 15:15:35 +08:00
Shigma ac1cef9aaa Merge pull request #9082 from deepseek-harness/fix/forge-glyph-alignment
fix(forge): align change request arrows and crosses with the top-left node
2026-11-24 15:15:28 +08:00
Shigma 56a26edd29 refactor(vendor): move the IM packages under vendor/im and classify local modifications 2026-11-24 15:15:17 +08:00
Chinesezjc 7c5a6988ec refactor(schedule): omit unused timestamp from timer wakeups 2026-11-24 15:15:07 +08:00
Shigma e7a4e5eece Merge pull request #9078 from deepseek-harness/chore/vendor-http-1.6.0
chore(cordis): sync vendored http to @cordisjs/http 1.6.0
2026-11-24 15:12:11 +08:00
Turtle 1b3c860263 Merge pull request #9069 from deepseek-harness/turtle/copy-session-id-c9838679be5c
feat(web): offer Copy Session ID in the Session Header menu
2026-11-24 15:06:56 +08:00
LegGasai 70091d14e0 feat(read-aloud): match the speaker glyph to its row and open the details with a feature preview
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.
2026-11-24 15:06:17 +08:00
Shigma 5b62e1f6cf fix(forge): align change request arrows and crosses with the top-left node 2026-11-24 15:00:49 +08:00
Shigma e3e6d7dcd3 test(cordis): drop the upstream http name from the spec summary 2026-11-24 14:58:08 +08:00
sjw1231 2143702108 docs: regenerate the module graph for the SDK server's MCP manager dependency 2026-11-24 14:55:29 +08:00
sjw1231 2da97e9f3a fix(sdk): close the runtime when the MCP wait overflows and expect the SDK manager row
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.
2026-11-24 14:49:12 +08:00
Dudu-0223 d7961599b8 refactor(llm): rename isModelListed to isModelInCatalog
The method reports whether a provider's current catalog contains a model; the new name states where the model is looked up.
2026-11-24 14:49:02 +08:00
Dudu-0223 750c57f21a fix(llm): check catalog membership through the llm service
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.
2026-11-24 14:49:02 +08:00
Dudu-0223 e65f956950 fix(subagent): harden child model selection after review
- 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.
2026-11-24 14:49:02 +08:00
Dudu-0223 28eff4efd0 feat(web): select models for continuable subagents
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.
2026-11-24 14:49:02 +08:00
Dudu-0223 219a05fe0d feat(subagent): select cold child models through maintenance restoration
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.
2026-11-24 14:49:02 +08:00
Dudu-0223 04a735f556 feat(subagent): persist model choices outside descriptors 2026-11-24 14:49:02 +08:00
LegGasai eae8f05f43 feat(ui-settings-models): show a pi-ai provider row as a pi-ai route
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.
2026-11-24 14:41:37 +08:00
LegGasai 72ad2d1d63 feat(llm-pi-ai): leave the Models page and settings as they are for provider rows
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.
2026-11-24 14:41:37 +08:00
LegGasai 56a4108722 feat(llm-pi-ai): add provider rows for routes that another layer supplies
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.
2026-11-24 14:41:37 +08:00
Shigma 5840375a69 docs(rescope): re-record the http row translation pairing 2026-11-24 14:40:15 +08:00
sjw1231 3e0f80c608 test(sdk): refresh the mcp-manager snapshot for the document tool rename
Master renamed the Office tools to `document_*`, which changes the skill catalog the snapshot records. The MCP tools and calls are unchanged.
2026-11-24 14:35:45 +08:00
Chinesezjc d34e319bc3 fix(schedule): allow Source submission during caller cleanup 2026-11-24 14:27:31 +08:00
Shigma 3cb1933c85 chore(cordis): sync vendored http to @cordisjs/http 1.6.0 2026-11-24 14:25:19 +08:00
LegGasai 8430c2d939 feat(read-aloud): choose the voice and hear a sample in the bundle details
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.
2026-11-24 14:24:12 +08:00
LegGasai 0826753829 feat(read-aloud): read replies aloud with segment-paced synthesis
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.
2026-11-24 14:24:12 +08:00
sjw1231 995069644c Merge remote-tracking branch 'origin/master' into feat/sdk-mcp-manager
# Conflicts:
#	docs/persistence-schema.json
#	packages/bundle/sdk-app/README.i18n.yaml
2026-11-24 14:23:33 +08:00
sjw1231 2501b2c24b feat(sdk): let each client request the MCP startup wait in initialize
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.
2026-11-24 14:20:30 +08:00
Turtleandimccyu d6a89840ff fix(ui-chat): show completed work while a running step group thinks
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>
2026-11-24 14:00:51 +08:00
Yudong Han fe0255f72f Merge pull request #9024 from deepseek-harness/feat/office-render-renderer-option
feat(document): office_render 改名为 document_render 并支持 renderer 选择渲染后端,PDF 优先用 Poppler
2026-11-24 14:00:51 +08:00
42f1bc67de test(web): prove header Copy Session ID withdraws on dispose
Co-authored-by: tianyicui <53024+tianyicui@users.noreply.github.com>
Co-authored-by: CreatixChu <142372241+CreatixChu@users.noreply.github.com>
Co-authored-by: mektpoy <31686206+mektpoy@users.noreply.github.com>
2026-11-24 13:52:20 +08:00
Chinesezjc 8541997b28 docs(schedule): include disposed callers in submission failures 2026-11-24 13:45:50 +08:00
e7c8cd527c feat(web): offer Copy Session ID in the Session Header menu
Refs #9068

Co-authored-by: tianyicui <53024+tianyicui@users.noreply.github.com>
Co-authored-by: CreatixChu <142372241+CreatixChu@users.noreply.github.com>
Co-authored-by: mektpoy <31686206+mektpoy@users.noreply.github.com>
2026-11-24 13:43:43 +08:00
Chinesezjc 0bf0afd778 Merge master into feat/schedule-source-model and clarify Source submission 2026-11-24 13:43:22 +08:00
yudshj 22ce7e423e test(python): align packaged Office skill snapshots with the shipped description 2026-11-24 13:28:19 +08:00
Yifffan c20de51e12 Merge pull request #9035 from deepseek-harness/general-settings-sections
feat(client): group General settings into cards
2026-11-24 13:23:14 +08:00
sjw1231 679d9214c2 feat(sdk): hold initialize until MCP servers finish their first attempt
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.
2026-11-24 13:19:03 +08:00
yudshj 9acd1158b5 fix(office-kit): report a missing Poppler executable as unavailable
Keep every other executable-lookup failure as its own error so a provider fault is not reported as a missing installation.
2026-11-24 13:17:06 +08:00
yudshj 5cb2df5be6 refactor(office-kit): drop redundant render guards
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.
2026-11-24 13:17:06 +08:00
yudshj 8909bf19fc refactor(office-kit): check PDF page limits after rendering
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.
2026-11-24 13:17:06 +08:00
yudshj b86e7bf3b7 test(snapshot): align recorded skill text and shipped tool catalogs with the document 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.
2026-11-24 13:17:06 +08:00
yudshj 2873dceba6 test(snapshot): refresh recorded sessions for the document tool names
Regenerate the office, sdk, and web snapshots on Linux for the renamed tools, including the recorded scripts and loader fixtures.
2026-11-24 13:17:06 +08:00
yudshj 284670f1eb refactor(office): rename the Office tools to document_*
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
2026-11-24 13:17:05 +08:00
yudshj b302da83c8 feat(office-kit): render PDFs with Poppler before LibreOffice
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
2026-11-24 13:17:05 +08:00
Ruilin Geng 6423b8d39a Merge pull request #7692 from deepseek-harness/feat/connectors-hub
feat(connectors): 新增实验性“连接器”标签页,在插件页列出并安装官方连接器
2026-11-24 13:05:01 +08:00
Turtle 6f62ce2e39 docs(plugin-manager): document failedChange parameters 2026-11-24 12:54:37 +08:00
Turtle 20bd44c844 fix(plugin-manager): scroll long update outcomes and skip approval after disposal 2026-11-24 12:54:37 +08:00
Turtle 993eb22b5f fix(plugin-manager): save update approvals before removing the installed version 2026-11-24 12:54:37 +08:00
Turtle e0012d693e fix(plugin-manager): refuse stale update approvals before removal 2026-11-24 12:54:37 +08:00
Turtle 2111ad892a fix(plugin-manager): allow blocked build scripts when updating a plugin 2026-11-24 12:54:37 +08:00
Turtle 9cc2df524f Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
2026-11-24 12:47:27 +08:00
LegGasai 9d2a5ee9d3 Merge remote-tracking branch 'origin/master' into feat/models-settings-layout 2026-11-24 12:31:56 +08:00
_Kerman 085b5cbe11 Merge pull request #9040 from deepseek-harness/turtle/wrap-time-context-a5c9580e13f4
fix(time-context): wrap the time reading in <system-reminder>
2026-11-24 12:13:54 +08:00
Yif 4c3b508f94 test(client): cover group ordering comparator 2026-11-24 12:00:52 +08:00
gengruilin 08fc687f85 fix(client-ui-connectors): count credential references in every value the MCP manager expands
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.
2026-11-24 11:49:41 +08:00
LegGasai d96a7026c9 feat(ci): check whitespace in each pull request's changes (#9049)
* 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.
2026-11-24 03:43:21 +00:00
LegGasai 6af477e788 Merge pull request #8775 from deepseek-harness/revert-8771-fix/files-api-multipart-bytes
Revert "fix(llm): keep a cancelled Files upload from ending the runtime"
2026-11-24 11:16:19 +08:00
LegGasai b301dfa086 fix(ui-settings-models): keep a failed model fetch in view while the list is folded
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.
2026-11-24 11:06:11 +08:00
LegGasai 18e5eaef80 Merge pull request #8423 from deepseek-harness/feat/forge-change-request-links
feat(web): show PR and MR links as references and open them in code review
2026-11-24 03:05:45 +00:00
LegGasai 508e0029d8 test(llm): keep the Files upload cancel regression spec
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.
2026-11-24 11:00:06 +08:00
Turtleandkermanx cfb4ba4236 docs(upgrade-guide): record the time-context reminder frame
Co-authored-by: kermanx <63178754+kermanx@users.noreply.github.com>
2026-11-24 10:57:46 +08:00
LegGasai c6b24fee94 Merge remote-tracking branch 'origin/master' into revert-8771-fix/files-api-multipart-bytes 2026-11-24 10:57:30 +08:00
LegGasai f82e0b3024 Merge remote-tracking branch 'origin/master' into worktree/fix-saved-api-key-editing 2026-11-24 10:51:30 +08:00
Turtleandkermanx 1f44b874a4 fix(time-context): wrap the time reading in <system-reminder>
Fixes #9039

Co-authored-by: kermanx <63178754+kermanx@users.noreply.github.com>
2026-11-24 10:45:49 +08:00
Yif 5d6a742de7 test(web): follow grouped settings in caption and narrow-width checks 2026-11-24 02:44:52 +08:00
Yif 58fa61401d fix(client): hide empty groups exactly and refresh grouped expectations 2026-11-24 02:24:14 +08:00
Yif 016274e4af fix(client): keep group separators with latest general styles 2026-11-24 01:54:08 +08:00
Yif 38e5df82ea fix(client): place link opening before shortcuts 2026-11-24 01:46:28 +08:00
Yif 39b877a981 fix(client): show update channel before current version 2026-11-24 01:46:28 +08:00
Yif ae2f8f51f1 fix(client): finalize chat order and sentence-case upload label 2026-11-24 01:46:28 +08:00
Yif c4597118ee refactor(client): align chat preferences and recommendation order 2026-11-24 01:46:28 +08:00
Yif a69c4efd26 feat(client): group general settings and expose group slots 2026-11-24 01:46:28 +08:00
Shigma 75f08dba22 Merge pull request #6291 from deepseek-harness/feat/im-automation
feat(im): add experimental IM automation
2026-11-24 01:19:13 +08:00
Shigma f3d9d454b5 test(im): cover reaction, drop, thread, and recovery branches and keep entry exports to types 2026-11-24 00:38:24 +08:00
imccyu 76afdbefc8 Merge pull request #9031 from deepseek-harness/list-all-children-study
feat(ui-renderer)!: expose a DOM root for each rendered list item
2026-11-24 00:35:17 +08:00
imccyu 2cacb13ed9 Merge pull request #9029 from deepseek-harness/session/drop-time-context-feedback-sync-reads
refactor(time-context): read browser time zones only from the projection
2026-11-24 00:32:55 +08:00
imccyu 0dbb76ef49 fix(ui-primitives): preserve menu groups across list registrations
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.
2026-11-24 00:22:22 +08:00
gengruilin ddef34a176 fix(client-ui-connectors): guard the Back hover style and stub the generated Remote for specs
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.
2026-11-24 00:09:00 +08:00
imccyu 59007058be Merge pull request #9032 from deepseek-harness/perf/verify-package-dependencies-skip-typecheck
perf(ci): reduce verify-package-dependencies typecheck
2026-11-24 00:04:55 +08:00
Shigma 7677a2161a chore(im): align experimental IM package versions with the 0.2.3-alpha.2 release 2026-11-24 00:02:43 +08:00
imccyu 22cc784439 feat(ui-renderer)!: expose a DOM root for each rendered list item
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.
2026-11-23 23:57:08 +08:00
imccyu ba5795bad8 perf(ci): stop verify-package-dependencies from re-running the type check
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
2026-11-23 23:56:51 +08:00
Shigma b66dcaf59a test(im): mount session projections for tool specs and satisfy lint rules 2026-11-23 23:39:13 +08:00
Shigma 675efe39eb Merge remote-tracking branch 'origin/master' into feat/im-automation
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/subsystems/filesystem.i18n.yaml
#	docs/subsystems/filesystem.md
#	docs/subsystems/filesystem.zh.md
#	docs/tool-catalog.i18n.yaml
#	packages/experimental/README.i18n.yaml
#	packages/extensions/cordis-host-runner/src/api-catalog.ts
#	packages/fs/fs-local/src/index.ts
#	packages/fs/fs-local/tests/filesystem.spec.ts
#	packages/fs/fs-sandbox/tests/fs-sandbox.spec.ts
#	packages/fs/fs/README.i18n.yaml
#	packages/fs/fs/README.md
#	packages/fs/fs/README.zh.md
#	packages/fs/fs/src/index.ts
#	packages/fs/fs/src/types.ts
#	packages/preset/agent-preset/skills/dsh-doc/references/packages.md
#	packages/ssh/fs-ssh/README.i18n.yaml
#	packages/ssh/fs-ssh/README.md
#	packages/ssh/fs-ssh/README.zh.md
#	packages/ssh/fs-ssh/src/index.ts
#	packages/ssh/fs-ssh/tests/provider.spec.ts
#	packages/ssh/ssh/src/helper.ts
#	packages/ssh/ssh/src/schemas.ts
#	packages/ssh/ssh/tests/helper-runtime.spec.ts
#	scripts/experimental-package-policy.ts
2026-11-23 23:33:33 +08:00
Shigma 3e8f36b888 Merge pull request #9027 from deepseek-harness/feat/fs-write-bytes
feat(fs): write exact bytes through the filesystem seam
2026-11-23 23:19:50 +08:00
gengruilin c64b298196 feat(client-ui-connectors): switch installed connectors on the Connectors tab
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.
2026-11-23 23:06:50 +08:00
Shigma 4e4a0f1bc2 fix(fs): bound ssh byte writes before sending and drop the derived byte count 2026-11-23 22:59:33 +08:00
Shigma 0808eb8248 feat(fs): write exact bytes through the filesystem seam 2026-11-23 22:39:20 +08:00
imccyu f21039b254 refactor(time-context): read browser time zones only from the projection
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.
2026-11-23 22:34:41 +08:00
imccyu 5ea2d61901 Merge pull request #9020 from deepseek-harness/feat/factory-content-roots
feat(ui-renderer)!: expose rendered Factory and local replacement roots
2026-11-23 22:14:51 +08:00
imccyu cb9a4a8a6d test(ui-renderer): cover Factory roots and document selector migration 2026-11-23 22:01:40 +08:00
imccyu 8cf079a9bd feat(ui-renderer)!: expose rendered Factory and local replacement roots
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.
2026-11-23 22:01:40 +08:00
imccyuanddsh-ci-bot eef35daa69 docs(agent-preset): keep the dsh-doc practices read within the pruner budget (#9013)
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>
2026-11-23 22:01:25 +08:00
涂轶翔 f9652b8b4f Merge pull request #8919 from deepseek-harness/feat/system-update-sections-ui
feat(client): present incremental system messages by section
2026-11-23 21:32:36 +08:00
sjw1231 e998a2dbb7 feat(sdk): mount the MCP manager in the SDK profile
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.
2026-11-23 20:12:53 +08:00
imccyu 36b5d06fbb Merge pull request #9009 from deepseek-harness/test/bench-phase-retry
ci(bench): re-run a failed benchmark phase once
2026-11-23 20:11:16 +08:00
Xu Hanxiang edc5a1e932 Merge pull request #8907 from deepseek-harness/feat/session-log-batch-records
feat(telemetry): report one Session-log record per delivery batch
2026-11-23 11:59:13 +00:00
Xu Hanxiang 3b1c29ece0 Merge pull request #8566 from deepseek-harness/feat/liveshare-browser-login
feat(liveshare): 属主统一通过浏览器授权,由宿主轮询取码
2026-11-23 19:55:17 +08:00
dsh-ci-bot 67cc466476 docs(agent-preset): keep the dsh-doc practices read within the pruner budget
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.
2026-11-23 19:53:28 +08:00
Jiawei Song 11af1f910b Merge pull request #8565 from deepseek-harness/ci/sdk-desktop-context-parity
ci(sdk): compare the SDK profile and Desktop standard preset model context
2026-11-23 19:15:30 +08:00
Turtle b287998e9b Merge pull request #8781 from deepseek-harness/docs/plugin-progress-bars
docs: require progress bars for long-running plugin operations
2026-11-23 19:10:41 +08:00
Turtle e30b0919fd docs: place progress feedback in plugin UI practices 2026-11-23 19:09:14 +08:00
gengruilin bb7201ec2d test(web): add, test, and remove a custom MCP server on the Connectors tab
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.
2026-11-23 18:28:29 +08:00
gengruilin ff4801a02c feat(client-ui-connectors): manage custom MCP servers on the Connectors tab
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.
2026-11-23 18:28:12 +08:00
gengruilin 3aa26f9404 feat(ui-connector-account): render one account through the connector.account Factory
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.
2026-11-23 18:27:37 +08:00
gengruilin 1a9844db0f feat(mcp-account): register an MCP account without a bundle package
`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.
2026-11-23 18:27:21 +08:00
gengruilin bf02f7e1fb feat(config-editor): insert, remove, and edit rows of the profile patch
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
2026-11-25 04:48:56 +08:00
07ad3a4dc5 perf(session): merge short SQLite frames inside the append transaction (#8674)
* 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>
2026-11-23 18:09:42 +08:00
fz 9133e31a29 Merge pull request #8965 from deepseek-harness/fix/cli-version-natural-exit
fix(cli): exit naturally instead of calling process.exit on CLI completion
2026-11-23 18:06:16 +08:00
sjw1231 b8f78f12ed docs(notes): describe the current SDK/Desktop comparison in the apply_patch note
The comparison now covers the SDK profile and the Desktop standard
preset's first model request; PTC execution is no longer compared.
2026-11-23 18:01:02 +08:00
sjw1231 cfda9eed61 Merge remote-tracking branch 'origin/master' into ci/sdk-desktop-context-parity
# Conflicts:
#	.agents/notes/implemented/feature/2026-10-29-shipped-fs-mutation-defaults.i18n.yaml
#	.agents/notes/implemented/feature/2026-10-29-shipped-fs-mutation-defaults.md
#	.agents/notes/implemented/feature/2026-10-29-shipped-fs-mutation-defaults.zh.md
2026-11-23 17:54:49 +08:00
Jiawei Song 7c6e48035c Merge pull request #8994 from deepseek-harness/feat/re-enable-apply-patch
feat(fs): default apply_patch to the edit switch in every shipped composition
2026-11-23 17:45:33 +08:00
imccyu 19be4e2e8b Merge pull request #8973 from deepseek-harness/feat/hoc-children-outlet
feat(ui-renderer)!: expose HOC children outlets
2026-11-23 17:32:57 +08:00
sjw1231 ea1f4521e8 test(sdk): record the agent preset registry row as an intended difference
#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.
2026-11-23 17:31:05 +08:00
sjw1231 ce2eb02c66 Merge remote-tracking branch 'origin/master' into ci/sdk-desktop-context-parity 2026-11-23 17:27:00 +08:00
sjw1231 beb365a3be docs(fs): name the shipped presets that offer apply_patch in the tool catalog
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.
2026-11-23 17:26:36 +08:00
Chinesezjc bd00ad4a67 ci(probe): select protected and control modes with literal marker assertions
Refs #6719
2026-11-23 17:20:44 +08:00
LegGasai 03fbc5b092 feat(ui-settings-models): mark a draggable model row with six dots on hover
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`.
2026-11-23 17:18:47 +08:00
Chinesezjc 976cac1312 ci(probe): add manual environment marker attribution probe
Refs #6719
2026-11-23 17:14:39 +08:00
sjw1231 f2a4386601 test(sdk): carry a preset group's disabled state to its members
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.
2026-11-23 17:02:59 +08:00
sjw1231 3d2dae07f0 test(sdk): compare the order of the first request's sequences
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.
2026-11-23 16:54:45 +08:00
Dudu-0223 02282f5d8d fix(headless): 保留 preset 配置,修复会话恢复和子代理轮次清理 (#8981)
* 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.
2026-11-23 16:53:18 +08:00
gengruilin 546b7121a5 feat(client-ui-connectors): list the Connectors bundle under Experimental plugins
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.
2026-11-23 16:51:20 +08:00
sjw1231 4aff040ac3 test(sdk): compare SDK rows outside the Desktop preset against Desktop host rows
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.
2026-11-23 16:51:20 +08:00
LegGasai 6cceb00ce3 Merge pull request #8897 from deepseek-harness/feat/workspace-directory-links-outside-root
feat(workspace-files): browse directory links that resolve outside the workspace
2026-11-23 16:47:03 +08:00
LegGasai e995f24c38 Merge pull request #8703 from deepseek-harness/feat/sandbox-policy-git
feat(sandbox-policy-git): grant a linked worktree's Git directory to the Session that works in it
2026-11-23 16:43:47 +08:00
gengruilin b961ea967a feat(client-ui-connectors): list DingTalk on the Connectors tab
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.
2026-11-23 16:41:17 +08:00
CreatixChu 7255725f49 Merge pull request #8987 from deepseek-harness/feat/cua-default-mode-picker
refactor(cua): 从自动电脑操作详情页移除会话模式设置
2026-11-23 16:40:43 +08:00
LegGasai 3731cd9319 test(workspace-files): cover directory link cycles in listing and search
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
2026-11-23 16:32:39 +08:00
LegGasai fcc03abc9f Merge remote-tracking branch 'origin/master' into feat/sandbox-policy-git 2026-11-23 16:29:45 +08:00
LegGasai 99a5edebdd Merge remote-tracking branch 'origin/master' into feat/sandbox-policy-git 2026-11-23 16:27:39 +08:00
LegGasai da9cfe2287 Merge pull request #8934 from deepseek-harness/feat/forge-review-activity
feat(forge): edit hosts, list GitLab merge requests for review, and add activity, comments, and auto-merge
2026-11-23 16:25:00 +08:00
LegGasai ae342316e9 test(forge): read the review detail bar's height once the narrowed page has settled
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.
2026-11-23 16:13:10 +08:00
LegGasai 858efa428b Merge remote-tracking branch 'origin/master' into feat/workspace-directory-links-outside-root 2026-11-23 16:09:17 +08:00
LegGasai 3e41462bf7 fix(forge): follow the client style rules for full-round corners and hover selectors
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.
2026-11-23 15:57:18 +08:00
LegGasai 6cadb01157 Merge pull request #8062 from deepseek-harness/worktree/asr-transcribe-api-649cb4
feat(voice-input): recognize speech with DeepSeek cloud ASR through the DeepSeek account or API key
2026-11-23 15:48:52 +08:00
creatixchu ca84a558ec refactor(cua): remove session mode settings from the permission panel 2026-11-23 15:37:14 +08:00
MicroBlock e94f6b9c9e Merge remote-tracking branch 'origin/master' into feat/im-automation 2026-11-23 15:34:33 +08:00
fz ece60ba9c7 fix(cli): drain event loop instead of calling process.exit on CLI completion 2026-11-23 15:32:34 +08:00
LegGasai 240a73c3ee Merge remote-tracking branch 'origin/master' into feat/forge-review-activity 2026-11-23 15:31:21 +08:00
LegGasai 0bae2bafb9 Merge commit '7a52e43675aac1473790dc5c6c96ea12605753c7' into worktree/asr-transcribe-api-649cb4 2026-11-23 15:30:17 +08:00
imccyu 348558376c fix(ui-renderer): preserve the supplying slot across HOC forwarding
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.
2026-11-23 15:14:27 +08:00
imccyu db80535277 feat(ui-renderer)!: expose HOC children outlets
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.
2026-11-23 15:14:24 +08:00
LegGasai 722f073cda docs(forge): add the upgrade guide for the review lists' repository host and sign-in command
`forgePanel.reviewLists` takes a repository with its host, and `ForgeReviewHost` gains the required `signIn`.
2026-11-23 15:13:39 +08:00
LegGasai b1163de5a1 fix(forge): name the automatic merge one way in German and Portuguese
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".
2026-11-23 15:13:38 +08:00
LegGasai 7c4c53fb65 fix(forge-gitlab): select a reviewed merge request by the user's own review state
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.
2026-11-23 15:13:36 +08:00
imccyu 305d558028 refactor(cordis): register Host inspect providers in cordis-host-runner (#8989)
* 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
2026-11-23 15:09:25 +08:00
LegGasai a81cb51dc0 fix(voice-input): register the cloud provider and recalibrate the npm layout budget
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
2026-11-23 15:04:05 +08:00
sjw1231 4e20f87dea docs(skills): remind authors and reviewers to keep the SDK and Desktop standard context aligned
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.
2026-11-23 14:53:51 +08:00
gengruilin 79f7762460 chore(client-ui-connectors): align the package version with 0.2.3-alpha.2 2026-11-23 14:52:08 +08:00
Yudong Han 3f16b69a5f Merge pull request #8936 from deepseek-harness/turtle/fix-subagent-highlight-2a1842873c71
fix(ui-workspace): keep the parent row selected while viewing a subagent Session
2026-11-23 14:45:14 +08:00
sjw1231 b682d28762 docs(fs): record apply_patch following edit in its own Agent Note
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.
2026-11-23 14:38:44 +08:00
imccyu 49607d7838 docs(module-graph): regenerate for the cordis-host-runner app-boot edge 2026-11-23 14:38:15 +08:00
imccyu 0f6b7f2449 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.
2026-11-23 14:38:15 +08:00
sjw1231 20aa08ba0b test(sdk): drop the cordis_inspect parity exceptions that #8991 resolves
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.
2026-11-23 14:37:25 +08:00
sjw1231 58fa14c6a8 Merge remote-tracking branch 'origin/master' into ci/sdk-desktop-context-parity
# Conflicts:
#	apps/cli/tests/profiles/sdk/desktop-tools.expected.e2e.ts
#	apps/cli/tests/profiles/sdk/tool-parity.ts
2026-11-23 14:34:39 +08:00
Shigma 21b0b03af3 Merge pull request #8964 from deepseek-harness/fix/stat-panel-scroll-anchor
fix(client): keep composer stat panels anchored while the transcript streams
2026-11-23 14:19:51 +08:00
sjw1231 b383eb8c75 Merge remote-tracking branch 'origin/master' into feat/re-enable-apply-patch
# Conflicts:
#	docs/tool-catalog.i18n.yaml
#	snapshots/sdk/legacy-context.patch.yml
2026-11-23 14:18:06 +08:00
LegGasai 4c448ec8c3 Merge remote-tracking branch 'origin/master' into feat/forge-review-activity 2026-11-23 14:17:45 +08:00
sjw1231 ddf0222076 test(snapshots): refresh the ptc and Creator Web recordings for apply_patch
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.
2026-11-23 14:16:30 +08:00
Jiawei Song 32f0362ebd Merge pull request #8991 from deepseek-harness/fix/sdk-cordis-inspect
feat(sdk): SDK profile 提供 cordis_inspect 运行时检查工具
2026-11-23 14:10:22 +08:00
LegGasai 57add5ffc4 docs(forge): move the viewer list rows upgrade guide to v0.2.3-alpha.2
Master released 0.2.3-alpha.2, so a guide this branch adds belongs in that version's directory.
2026-11-23 14:10:22 +08:00
Ruilin Geng 3684679873 Merge pull request #8862 from deepseek-harness/feat/feishu-cli-download
feat(cli-account): prepare step for CLI and skills downloads
2026-11-23 14:05:55 +08:00
creatixchu 73adae1bcf fix(cua): reserve the dropdown width while loading presets 2026-11-23 13:55:06 +08:00
sjw1231 5f20c2f19d fix(sdk): let the Python advanced patch reuse the bundle's Cordis rows
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.
2026-11-23 13:54:23 +08:00
sjw1231 e0c79d0cd1 feat(fs): default apply_patch to the edit switch
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.
2026-11-23 13:54:01 +08:00
LegGasai e69c67eeed Merge remote-tracking branch 'origin/master' into feat/forge-review-activity 2026-11-23 13:52:43 +08:00
creatixchu 29ac23b86c docs(cua): identify the permission locale namespace 2026-11-23 13:51:36 +08:00
creatixchu 7a9d1b7235 fix(cua): localize preset names independently and distinguish roster failures 2026-11-23 13:50:12 +08:00
creatixchu 685d18e783 test(web): isolate Windows inventory emulation from profile writes 2026-11-23 13:43:56 +08:00
creatixchu 13670bfbde test(web): verify the preset write through the Host settings service 2026-11-23 13:42:59 +08:00
creatixchu bd202c98d4 test(web): check the saved mode and observe the toggle after setup 2026-11-23 13:40:28 +08:00
sjw1231 0168b0f88d feat(sdk): expose cordis_inspect in the SDK profile
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.
2026-11-23 13:39:06 +08:00
creatixchu 819f81e4a1 test(cua): cover an unavailable deployment default 2026-11-23 13:37:13 +08:00
creatixchu 71556f540b fix(cua): read the deployment default from the preset roster 2026-11-23 13:36:16 +08:00
creatixchu eb4d217011 test(cua): cover unavailable presets and keyboard dismissal 2026-11-23 13:32:39 +08:00
sjw1231 ed03eb53eb feat(fs): enable apply_patch in the ptc and cordis presets and the PTC overlay
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.
2026-11-23 13:32:34 +08:00
sjw1231 01138b2ce0 fix(fs): re-enable apply_patch in dsh-base and the standard preset
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.
2026-11-23 13:32:22 +08:00
creatixchu ee1c8f5dc9 feat(cua): choose the default session mode from a menu 2026-11-23 13:30:45 +08:00
LegGasai 6fe50791ed Merge commit '1cfc9279aa1dd58d953f00132914ca2bcd41b968' into feat/sandbox-policy-git
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	packages/experimental/README.i18n.yaml
#	packages/preset/agent-preset/skills/dsh-doc/references/packages.md
2026-11-23 13:23:47 +08:00
LegGasai a480ce65c0 Merge commit 'd37a3dda9b7c3739cc69870c29ab356a97625650' into worktree/asr-transcribe-api-649cb4
# Conflicts:
#	packages/experimental/voice-input-bundle/package.json
2026-11-23 13:13:03 +08:00
涂轶翔 bbc97c8a39 Merge pull request #8833 from deepseek-harness/fix/cua-zh-name
fix(cua): 中文界面将 Computer Use 称为“自动电脑操作”
2026-11-23 13:08:11 +08:00
Yixiang Tu a0d57ee4eb feat(cua-bundle): redesign feature preview SVGs with platform-agnostic multi-window layout 2026-11-23 11:45:51 +08:00
Yixiang Tu afa0120e4b fix(cua): polish Chinese UI copy for 自动电脑操作 2026-11-23 11:45:51 +08:00
Yixiang Tu fcc3f10d89 fix(cua): name Computer Use 自动电脑操作 in Chinese UI copy 2026-11-23 11:45:51 +08:00
CreatixChu b444f8cd9b Merge pull request #8970 from deepseek-harness/feat/windows-uia-show-diff
feat(cua): 用 UI Automation 通知显示 Windows 窗口变化
2026-11-23 10:35:59 +08:00
creatixchu b82e359cff fix(cua-windows): 关闭连接时异步观察 UIA 退订结果 2026-11-23 10:18:46 +08:00
creatixchu b3514c6b60 feat(cua-windows): 限制差分通知条数并说明返回当前树的原因 2026-11-23 10:08:03 +08:00
creatixchu 0ebce4fa57 test(cua-windows): 使用无返回值的取消回调 2026-11-23 10:08:03 +08:00
creatixchu 91f339cbf4 fix(cua-windows): 取消读取后重建通知基线并在退订失败时完成关闭 2026-11-23 10:08:03 +08:00
creatixchu 943c2920db docs(cua): 将平台行为说明归到对应提供方 2026-11-23 10:08:03 +08:00
creatixchu 2758d26aba feat(cua): 展示 Windows 窗口的 UI Automation 变更通知 2026-11-23 10:08:03 +08:00
imccyu 689b8cd418 Merge pull request #8915 from deepseek-harness/session/fold-run-results-on-commit
refactor(subagent,headless): replace Session event-array reads with per-event folds and a projection
2026-11-22 23:07:42 +08:00
CreatixChu c21963852c Merge pull request #8953 from deepseek-harness/fix/macos-show-focus
optimze show performance
2026-11-22 20:42:18 +08:00
creatixchu 9048c8a0a9 fix(cua-macos): use the request deadline for window restoration 2026-11-22 20:30:26 +08:00
creatixchu f1ce374d19 fix(cua-macos): finish stage grouping when the app needs activation 2026-11-22 20:08:04 +08:00
creatixchu 3b15229a3b test(cua-macos): release auxiliary windows before testing ordinary stage groups 2026-11-22 19:57:59 +08:00
creatixchu 2f30f1f95d fix(cua-macos): observe stage transitions before declaring a focus interruption 2026-11-22 19:54:35 +08:00
creatixchu c293df2a9b fix(cua-macos): recheck the original window before moving a stage pile 2026-11-22 19:51:43 +08:00
creatixchu 4abb6140a1 test(cua-windows): align the fixture with shared show guidance 2026-11-22 19:46:09 +08:00
creatixchu 07a083b75d fix(cua-macos): prefer a stage pile containing only the selected app 2026-11-22 19:43:50 +08:00
creatixchu 728785f273 fix(cua-macos): wait for the stage pile and its grouping animation 2026-11-22 19:39:16 +08:00
creatixchu f34cef9cf2 fix(cua-macos): resolve the system Stage Manager for show requests 2026-11-22 19:35:41 +08:00
creatixchu 35088108fe fix(cua-macos): add shelved windows to the active Stage Manager group 2026-11-22 19:33:47 +08:00
creatixchu a0890dd5b8 fix(cua-macos): recheck visibility before sending a reopen event 2026-11-22 18:33:42 +08:00
creatixchu d0c15ee785 docs(cua): keep shared show guidance scoped to app and window 2026-11-22 18:29:38 +08:00
creatixchu 6029315116 fix(cua-macos): reopen the running app when its last window closes 2026-11-22 18:29:36 +08:00
creatixchu df92919ab2 docs(cua-macos): move show upgrade guide to current version 2026-11-22 18:29:36 +08:00
creatixchu cc4b05df8b fix(cua-macos): respect a focus change during handoff 2026-11-22 18:29:36 +08:00
creatixchu dfe4bb373d refactor(cua-macos): scope window restoration state to one request 2026-11-22 18:29:36 +08:00
creatixchu 73bf0cd886 fix(cua-macos): isolate focus restoration on the native worker 2026-11-22 18:29:36 +08:00
creatixchu 5c88698a45 test(cua-macos): exercise temporary focus and allow background restoration to settle 2026-11-22 18:29:36 +08:00
creatixchu eed0c0db8a fix(cua-macos): restore minimized windows and hand keyboard focus back 2026-11-22 18:29:36 +08:00
creatixchu 88e7550491 fix(cua-macos): explain why background window restoration failed 2026-11-22 18:29:34 +08:00
creatixchu 71593137e9 docs(cua): keep platform-specific show behavior in macOS guidance 2026-11-22 18:29:32 +08:00
creatixchu 82337e9b79 fix(cua-macos): preserve keyboard focus on show 2026-11-22 18:29:15 +08:00
fz 6c448d39ff docs(cli): describe the completed version invocation 2026-11-22 18:21:09 +08:00
CreatixChu 39be562c1d Merge pull request #8795 from deepseek-harness/feat/cua-ax-show-diff
feat(cua): 按需返回 macOS AX 树差分
2026-11-22 18:08:19 +08:00
creatixchu c06c5d0900 test(cua): sync the Windows provider prompt for showDiff 2026-11-22 17:51:13 +08:00
creatixchu c6b08be4c1 docs(cua): keep shared showDiff descriptions platform-neutral 2026-11-22 17:51:13 +08:00
creatixchu d64954d4fb fix(cua): preserve exact UTF-8 row contents on replay 2026-11-22 17:51:13 +08:00
creatixchu 1d736c540d test(cua): cover nested insertion runs and menu disclosure resets 2026-11-22 17:51:13 +08:00
creatixchu 01d007491d feat(cua): share a position anchor across inserted branches 2026-11-22 17:51:13 +08:00
creatixchu 368f2457a5 feat(cua): make numbered AX differences reconstruct the ordered tree 2026-11-22 17:51:11 +08:00
creatixchu abcf26c265 test(web): record the additional AX read in the CUA program card 2026-11-22 17:51:10 +08:00
creatixchu 11cfadc64c test(cua): refresh scoped prompts and match rendered subcalls to the recording 2026-11-22 17:51:10 +08:00
creatixchu 73c3de812d fix(cua): retain visible focus in incomplete numbered reads 2026-11-22 17:51:10 +08:00
creatixchu af616d2e67 test(cua): replay held input and AX differences together 2026-11-22 17:51:10 +08:00
creatixchu c5d5bdf2ea Merge remote-tracking branch 'origin/master' into feat/cua-ax-show-diff 2026-11-22 17:51:10 +08:00
CreatixChu 11ac7973fd Merge pull request #8949 from deepseek-harness/perf/macos-list-actions
feat(cua-macos): 统一控件动作枚举、参数说明与写入校验
2026-11-22 17:49:21 +08:00
fz c8f38d5b5e fix(cli): exit naturally after printing the version 2026-11-22 17:45:45 +08:00
creatixchu 4882e296e2 fix(cua-macos): describe combo box and stepper values 2026-11-22 17:37:27 +08:00
creatixchu ed38ef6211 fix(cua-macos): list only action names the dispatcher can resolve 2026-11-22 17:37:25 +08:00
creatixchu b948ff5735 refactor(cua-macos): use the same field names for AX schemas and binding 2026-11-22 17:37:24 +08:00
creatixchu 8defac984e feat(cua-macos): share setter definitions across discovery, schema and dispatch 2026-11-22 17:37:24 +08:00
creatixchu f3dda44027 fix(cua-macos): align listed setters with action parameter schemas 2026-11-22 17:37:22 +08:00
creatixchu 81583fc9dc fix(cua): preserve the nonempty list of request validators 2026-11-22 17:37:02 +08:00
creatixchu 886129bd78 refactor(cua): narrow the public action discovery API 2026-11-22 17:37:02 +08:00
creatixchu 93d9767df5 docs(cua-macos): show both action list signatures in model guidance 2026-11-22 17:36:37 +08:00
creatixchu d2772b6ffe test(cua): record detailed actions in the native session replay 2026-11-22 17:36:37 +08:00
creatixchu 20d6551df6 test(cua-macos): observe enablement changes on retained elements 2026-11-22 17:36:36 +08:00
creatixchu 0ef562ca20 test(cua-macos): compare action disclosure with a live AX inventory 2026-11-22 17:36:36 +08:00
creatixchu f933cad1aa feat(cua-macos): disclose element actions and live setter arguments 2026-11-22 17:36:34 +08:00
creatixchu 8755ddc143 perf(cua-macos): decode only the selected window for action lookup 2026-11-22 17:36:02 +08:00
Huo Yaoyuan 14677d27f7 feat(cua): align application discovery and add app.launch (#8913)
* refactor(cua): unify application discovery records and identities

* feat(cua-windows): implement application search

* Remove sentinel PID and check

* feat(cua): list all applications for empty discovery queries

* getState should use findApps

* Update guidance

* Use neutral accessibility terminology

* Update tests

* Add app.launch

* Update README

* fix(cua): resolve typed lint errors in tests

* Align getState with previous behavior

* Update findApps on Windows to return installed only

* Remove PID tracking

* Remove redundant PID usage

* Update launch behavior

* Fix comment

* Update app identity guidance
2026-11-22 17:33:33 +08:00
MicroBlock d0a354fca9 Merge remote-tracking branch 'origin/feat/im-automation' into merge/im-automation
# Conflicts:
#	vendor/README.md
2026-11-22 16:50:53 +08:00
Shigma 584fc960c2 docs(client): keep anchor-derived panel insets linear 2026-11-22 16:21:23 +08:00
Shigma 081affb313 fix(client): keep composer stat panels anchored while the transcript streams 2026-11-22 15:33:37 +08:00
MicroBlock 785652c0fc im: accept an explicit reply referrer on ImSendOptions; it replaces the quote's or thread's referrer on the target 2026-11-22 14:43:04 +08:00
gengruilin cfe3319a70 fix(cli-account): reset the unprepared account once nothing is missing
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
2026-11-22 14:06:34 +08:00
LegGasai ad37028b17 docs(voice-input): add the cloud-default upgrade guide and refresh the bundle README
Refs #8059
2026-11-22 13:17:42 +08:00
LegGasai f89a521c3a refactor(voice-input): read the bounded recognition response through stream iteration
Refs #8059
2026-11-22 13:03:40 +08:00
LegGasai 9c8cf4ab0a fix(ui-settings-models): clarify saved API key replacement 2026-11-22 13:02:08 +08:00
LegGasai 9ba1b3437b fix(voice-input): describe API-key cloud recognition in the voice bundle summary
Refs #8059
2026-11-22 12:57:12 +08:00
LegGasai be489c4fc7 refactor(voice-input): recognize cloud speech through ctx.deepseekAuth and /v1/tools/asr
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
2026-11-22 12:53:52 +08:00
LegGasai 00deef7873 Merge commit 'b4b75a83899c1d5ff1a3b60404c3f5f7424a3f77' into worktree/asr-transcribe-api-649cb4
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/subsystems/credentials.md
#	docs/subsystems/credentials.zh.md
#	packages/account/deepseek-account/README.i18n.yaml
#	packages/account/deepseek-account/README.md
#	packages/account/deepseek-account/README.zh.md
#	packages/client/ui-settings-account/README.i18n.yaml
#	packages/client/ui-settings-account/src/client/index.ts
#	packages/client/ui-settings-account/tests/access-revocation.client.spec.ts
#	packages/experimental/client-ui-voice-input/README.i18n.yaml
#	packages/experimental/client-ui-voice-input/src/client/VoiceSetupDialog.tsx
#	packages/experimental/voice-input-bundle/package.json
#	packages/extensions/tool-cordis/src/api-catalog.ts
#	packages/web/web-search-deepseek/README.i18n.yaml
#	packages/web/web-search-deepseek/README.md
#	packages/web/web-search-deepseek/README.zh.md
#	scripts/experimental-package-policy.ts
2026-11-22 12:27:17 +08:00
MicroBlock 5b410d2546 im: add im/before-send rewrite waterfall, export key and operation helpers, drop the stop-button route 2026-11-22 05:00:56 +08:00
gengruilin 930997545c feat(cli-account): prepare step for CLI and skills downloads
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
2026-11-21 16:58:36 +08:00
gengruilin afad4cd500 fix(mcp-client): reconnect after the server forgets the Streamable HTTP session
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
2026-11-21 15:42:00 +08:00
Turtleandyudshj 525d631020 refactor(ui-workspace): name the selected-row helper after its result
Co-authored-by: yudshj <16971372+yudshj@users.noreply.github.com>
2026-11-21 15:13:11 +08:00
Turtleandyudshj fa63faa0df fix(ui-workspace): keep the parent row selected while viewing a subagent Session
Co-authored-by: yudshj <16971372+yudshj@users.noreply.github.com>
2026-11-21 14:58:00 +08:00
LegGasai dc4883ea65 Merge remote-tracking branch 'origin/master' into feat/forge-review-activity
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
2026-11-21 14:57:27 +08:00
MicroBlock b73ac58149 Merge remote-tracking branch 'origin/master' into feat/im-automation 2026-11-20 22:35:07 +08:00
Turtle 8092dc2621 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
#	packages/boot/plugin-manager/package.json
2026-11-20 21:53:03 +08:00
Yixiang Tu 531616b37d fix(client): address review findings on per-source system updates
- 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.
2026-11-20 21:16:46 +08:00
Turtle e021412a98 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
2026-11-20 20:48:38 +08:00
Yixiang Tu 99aefb9fd4 fix(ui-trajectory): omit the delivery note for initial and rebuilt prompts
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.
2026-11-20 18:56:14 +08:00
Yixiang Tu 35e2eac90e feat(ui-trajectory): present system updates as Update, System Prompt, and Tools
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.
2026-11-20 18:56:14 +08:00
Yixiang Tu 2ce48b180c feat(client): present incremental system messages by section
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.
2026-11-20 18:56:14 +08:00
Turtle 329986fc24 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
2026-11-20 18:42:10 +08:00
creatixchu 961828671c test(cua): include the observed field value in the focus expectation 2026-11-20 17:26:53 +08:00
creatixchu a97ec467fa fix(cua): keep focus-dependent selection metadata out of diff rows 2026-11-20 17:25:40 +08:00
creatixchu ab05467e29 fix(cua): match adjacent moves and separate focus from AX row changes 2026-11-20 17:22:10 +08:00
creatixchu d0626683c3 test(cua): assert the Windows error code and message independently 2026-11-20 17:19:48 +08:00
creatixchu ceb0d163a6 test(cua): verify compact changes through native reads and recorded sessions 2026-11-20 17:17:43 +08:00
sjw1231 88074595f2 test(sdk): match JSON-escaped paths and code-unit tool order in the parity observer
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.
2026-11-20 17:16:42 +08:00
creatixchu e9c211ca2f feat(cua): reset numbered trees on full reads and expose focus separately 2026-11-20 17:14:38 +08:00
MicroBlock e5347f6889 fix(lark): set non-empty name on form submit buttons (Feishu 200530) 2026-11-20 17:08:55 +08:00
creatixchu 413843ff59 feat(cua): render numbered AX changes and removed ID ranges 2026-11-20 17:08:02 +08:00
creatixchu 89743cd2a1 Merge remote-tracking branch 'origin/master' into feat/cua-ax-show-diff
# Conflicts:
#	packages/experimental/cua-macos/README.i18n.yaml
#	packages/experimental/cua-macos/native/README.i18n.yaml
#	packages/experimental/cua-macos/src/guidance.ts
#	packages/experimental/cua-windows/README.i18n.yaml
#	packages/experimental/cua/README.i18n.yaml
#	packages/experimental/cua/tests/api.spec.ts
2026-11-20 16:55:58 +08:00
LegGasai 292efc07ff Merge remote-tracking branch 'origin/master' into feat/forge-review-activity 2026-11-20 16:18:05 +08:00
LegGasai 3c076d74ff fix(workspace-files): judge a directory's descent from the backend's spelling
`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
2026-11-20 16:10:31 +08:00
LegGasai ae3f20a8cc fix(forge): span the request-review line across its block on the Code review page
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.
2026-11-20 15:57:00 +08:00
Chinesezjc 62cf3da4d0 fix(review): refresh machine approval after a delegated review is dismissed 2026-11-20 15:55:18 +08:00
MicroBlock 9b989161cd feat(im): include quote-from and quote-text attributes in im-message XML 2026-11-20 15:54:26 +08:00
Chinesezjc 1dddea58e5 test(review): share delegation fixtures and isolate machine publication cases 2026-11-20 15:47:57 +08:00
Chinesezjc b3e38f8104 docs(review): keep legacy publisher requirements in active guidance 2026-11-20 15:42:34 +08:00
Chinesezjc 4f40e68900 docs(review): distinguish native approvals from singleton team enforcement 2026-11-20 15:38:37 +08:00
Chinesezjc 97d03fdd11 fix(review): restrict machine writes to the selected pull request 2026-11-20 15:38:07 +08:00
Chinesezjc 28da47a09d docs(review): verify native team enforcement before retiring status 2026-11-20 15:27:54 +08:00
sjw1231 f30cc23eb2 test(sdk): compare only the native SDK profile with the Desktop standard preset
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.
2026-11-20 15:22:49 +08:00
Chinesezjc ca00b2073f docs(review): describe the machine approval pilot and cutover criteria 2026-11-20 15:22:31 +08:00
Chinesezjc 61e0f9f5d0 feat(ci): pilot machine-user approvals alongside the required status 2026-11-20 15:20:58 +08:00
sjw1231 97e3dbcd9b Merge remote-tracking branch 'origin/master' into ci/sdk-desktop-context-parity 2026-11-20 15:14:53 +08:00
LegGasai 6d2e0ea408 feat(workspace-files): browse directory links that resolve outside the workspace
`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
2026-11-20 14:51:36 +08:00
LegGasai 8541804c62 Merge commit '2be782f485ee233d3f6db0d397458ee9a8d5539d' into feat/sandbox-policy-git 2026-11-20 13:53:05 +08:00
LegGasai 44cf4df49c fix(sandbox-policy-git): bind the grant to its directory and Agent, and refuse pointer files the Session can write
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.
2026-11-20 13:38:57 +08:00
LegGasai 6a870ae6a8 docs(sandbox-policy-git): title the plugin "链接工作树的 Git 沙箱策略" in Chinese 2026-11-20 13:01:34 +08:00
LegGasai 76cf07cf72 fix(forge-gitlab): read one merge request per status query by default
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.
2026-11-20 12:53:03 +08:00
LegGasai e89dc1d564 Merge commit '1a451ffe2ed7774132e38e8c3e39e35b4e602450' into feat/sandbox-policy-git
# Conflicts:
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/worktree/README.i18n.yaml
#	packages/experimental/worktree/README.md
#	packages/experimental/worktree/README.zh.md
2026-11-20 12:46:59 +08:00
LegGasai 49d1474b7a feat(ui-settings-models): fold model rows to text and split the editor into sections
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.
2026-11-20 12:41:43 +08:00
LegGasai 658aeed863 feat(forge): keep the review detail's link actions visible, add the automatic merge, and draw a loading skeleton
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.
2026-11-20 11:49:59 +08:00
LegGasai e155ff1da6 feat(forge): declare a change request's automatic merge
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.
2026-11-20 11:01:46 +08:00
gengruilin 4488e61c6e feat(feishu): download lark-cli in the account check when it is missing
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.
2026-11-20 01:30:37 +08:00
Turtle 7324e9b67d Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-schema.json
2026-11-20 00:16:16 +08:00
LegGasai 4f600dbef6 feat(forge): show a change request's activity on the Code review page and add comments from it
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.
2026-11-19 21:51:22 +08:00
Turtle 26b5cb1ead Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
2026-11-19 21:22:53 +08:00
LegGasai 21b35a3b38 feat(forge): declare the activity read and the comment action of a change request
`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`.
2026-11-19 21:09:30 +08:00
LegGasai 6e94624bc9 feat(forge): list GitLab merge requests on the Code review page and redraw its list card
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.
2026-11-19 21:03:30 +08:00
gengruilin 4955f3a631 refactor(client-ui-connectors): rename the Connectors tab package
`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.
2026-11-19 21:02:50 +08:00
LegGasai ebe6fbb3b4 Merge remote-tracking branch 'origin/master' into feat/forge-host-settings
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/subsystems/forge.md
#	docs/subsystems/forge.zh.md
#	packages/experimental/client-ui-forge/README.i18n.yaml
#	packages/experimental/client-ui-forge/README.md
#	packages/experimental/client-ui-forge/README.zh.md
#	packages/experimental/client-ui-forge/src/index.ts
#	packages/experimental/forge-github/README.i18n.yaml
#	packages/experimental/forge-github/tests/plugin.spec.ts
#	packages/experimental/forge/README.i18n.yaml
#	packages/experimental/forge/src/index.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-19 20:13:46 +08:00
sjw1231 76eeb1db2d test(sdk): drop parity exceptions resolved by the plan mode and dsh-doc fixes
#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.
2026-11-19 18:44:32 +08:00
sjw1231 46ba73fba6 Merge remote-tracking branch 'origin/master' into ci/sdk-desktop-context-parity 2026-11-19 18:42:17 +08:00
creatixchu 3ae60f4291 test(cua): exercise late cancellation on the shared helper socket 2026-11-19 17:02:46 +08:00
creatixchu f2a56f54aa test(cua): refresh the MCP profile reference for showDiff 2026-11-19 17:01:07 +08:00
creatixchu edec931669 fix(cua): discard interrupted AX observations and preserve Windows connections 2026-11-19 17:00:04 +08:00
creatixchu a6b67424a6 test(cua): record AX difference requests and native verification 2026-11-19 15:21:54 +08:00
creatixchu e6b57d369f feat(cua): support opt-in macOS accessibility tree differences 2026-11-19 15:16:08 +08:00
gengruilin 86382c21e6 feat(connectors): list Tencent Meeting on the Connectors tab
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.
2026-11-19 15:02:00 +08:00
Turtle 3497665b50 docs: require progress bars for long-running plugin operations 2026-11-19 14:44:33 +08:00
gengruilin d2059d2c7a refactor(connectors): fold the Connectors bundle and its tab into one package
`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.
2026-11-19 14:38:53 +08:00
MicroBlock e1c798cc33 feat(im): surface inbound reactions as im/reaction events 2026-11-19 14:26:57 +08:00
gengruilin aedea2d846 refactor(connectors): drop the inline switch, card filter, and master switch from the Connectors tab
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.
2026-11-19 13:44:09 +08:00
LegGasai 8c5ea0e638 feat(forge): edit the hosts of the GitHub and GitLab providers on the Plugins page
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.
2026-11-19 13:07:21 +08:00
Turtle 316f76c1de Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
2026-11-19 12:52:20 +08:00
LegGasai 9fa57698cf Revert "fix(llm): keep a cancelled Files upload from ending the runtime" 2026-11-19 12:27:03 +08:00
sjw1231 f779da6d86 test(sdk): compare the top-level Agent context with Team on
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.
2026-11-19 11:43:59 +08:00
sjw1231 f60498c710 Merge remote-tracking branch 'origin/master' into ci/sdk-desktop-context-parity 2026-11-19 11:38:04 +08:00
Chinesezjc dd902b04fa docs(notes): replace repository URLs with issue references
The repository-reference gate rejects organization URLs in maintained
files; the note now names issue #6719 without linking the repository.
2026-11-18 16:26:26 +08:00
MicroBlock ae2e42658a chore(vendor): align im-markdown metadata with Satori and drop Feishu codegen script 2026-11-18 16:26:10 +08:00
Chinesezjc d1644459fc feat(ci): approve weighted pull requests instead of gating CI
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.
2026-11-18 16:12:00 +08:00
LegGasai 3743b5b4ed Merge remote-tracking branch 'origin/master' into feat/sandbox-policy-git 2026-11-18 15:45:02 +08:00
MicroBlock 43a78deb69 Merge remote-tracking branch 'origin/feat/im-automation' into feat/im-automation 2026-11-18 15:21:19 +08:00
MicroBlock d55b531176 Revert "fix(connection): announce the launch URL a surface without a browser credential needs"
This reverts commit eeb09ded7a9894ac21a2776a1e5372c8ddcadd7f.
2026-11-18 15:21:06 +08:00
Chinesezjc 8ccb8ad8f4 test(schedule): close provider admission during queued callback shutdown 2026-11-18 15:07:16 +08:00
Chinesezjc a8fa269e67 test(schedule): align Source header with retired cwd tools 2026-11-18 15:02:20 +08:00
Turtle c32bf604d9 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	packages/client/tsdown.client.ts
#	scripts/client-bundle-purity.spec.ts
2026-11-18 13:28:22 +08:00
LegGasai e48e9096f4 test(forge): offer a worktree from a linked checkout when the worktree service is mounted
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.
2026-11-18 13:23:48 +08:00
LegGasai 3773e1fb5d test(sandbox-policy-git): pin the grant for Agents announced as resume, clear, and compact
A grant is never stored with the Session, so an Agent announced for a resumed,
cleared, or compacted Session must receive it again at creation.
2026-11-18 13:19:42 +08:00
LegGasai 1b499cf413 Merge remote-tracking branch 'origin/feat/session-workspace-root-consumers' into feat/sandbox-policy-git 2026-11-18 13:05:47 +08:00
LegGasai f718cffd4d Merge branch 'feat/session-workspace-root-consumers' into feat/sandbox-policy-git
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.
2026-11-18 13:05:33 +08:00
MicroBlock aa7777778d fix(connection): announce the launch URL a surface without a browser credential needs
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.
2026-11-18 13:00:46 +08:00
Chinesezjc 5491c35d28 refactor(schedule): withdraw residual shared Controller test setup changes 2026-11-18 12:26:51 +08:00
Chinesezjc d31033227b test(schedule): isolate time consumer shutdown from provider disposal 2026-11-18 12:24:04 +08:00
Chinesezjc d1ea5ba784 test(schedule): report bounded Controller recovery state on failure 2026-11-18 12:10:29 +08:00
Chinesezjc ab36a8e0e1 fix(schedule): capture producer-scoped submission services 2026-11-18 11:46:59 +08:00
Chinesezjc 1f482b5dbb docs(schedule): refresh configuration declaration references 2026-11-18 11:41:21 +08:00
LegGasai 9734c86e62 feat(sandbox-policy-git): grant a linked worktree's repository Git directory to the Session working in it
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.
2026-11-18 11:36:29 +08:00
Chinesezjc 42f4edcefd docs(schedule): correct source example types and refresh event references 2026-11-18 11:31:58 +08:00
Chinesezjc d292a5abb3 fix(schedule): type persisted source fixture events explicitly 2026-11-18 11:15:52 +08:00
Chinesezjc 5fab3c4a21 fix(schedule): type direct source fixture observations explicitly 2026-11-18 11:10:25 +08:00
Chinesezjc 8a23d8ac22 fix(schedule): keep source fixtures compatible with native type stripping 2026-11-18 10:59:37 +08:00
Chinesezjc f310549029 refactor(schedule): replace source connections with direct submission 2026-11-18 10:50:37 +08:00
MicroBlock 2f442ff103 chore(tool-cordis): regenerate api-catalog for async ImSessionHost.agent 2026-11-18 06:04:43 +08:00
MicroBlock f167347705 docs(im): clarify key-only retryability after uncommitted reset advance in agent() JSDoc 2026-11-18 06:04:25 +08:00
MicroBlock 5e9197b739 fix(im): await serial and agents.open in ImSessionHost.agent() for require-await lint 2026-11-18 06:03:55 +08:00
MicroBlock 762b599ecf docs(im): clarify retry semantics for retired SessionId vs uncommitted reset in agent() JSDoc 2026-11-18 05:40:21 +08:00
MicroBlock 400aa0cd78 docs(im): document ImSessions.agent() serialization and unavailable rejection semantics 2026-11-18 05:16:48 +08:00
MicroBlock 6e5c162681 fix(im): reject already-retired SessionId in agent() with unavailable 2026-11-18 05:16:23 +08:00
MicroBlock b445b7986b fix(im): serialize ImSessionHost.agent() by key and guard against retired/resetting generations 2026-11-18 04:53:59 +08:00
MicroBlock af3fb73cae test(im): merge duplicate concurrent reset and retry tests in sessions.spec.ts 2026-11-18 04:29:13 +08:00
MicroBlock 9afd61d605 docs(im): sync JSDoc contracts for reply/io quote fallback and deliver reset rejection 2026-11-18 04:29:05 +08:00
MicroBlock 987ee266f5 test(im): exercise real unadmitted delivery admission racing reset2 2026-11-18 04:04:26 +08:00
MicroBlock c482b85f88 fix(im): throw unavailable when pending delivery retry is discarded by concurrent reset 2026-11-18 04:03:45 +08:00
MicroBlock c5e2d717db fix(im): omit evicted trigger quote in outputs and event.reply 2026-11-18 04:01:57 +08:00
MicroBlock a4d898d3a0 test(im): pass referrer arg to inboundDraft in send.spec.ts 2026-11-18 03:37:00 +08:00
MicroBlock aef00ceb92 fix(im): restore type-only Context import in index.ts 2026-11-18 03:33:41 +08:00
MicroBlock 73ca4c616c test(im): test drainAnnouncements via direct bot.send() without sender waiters 2026-11-18 03:31:20 +08:00
MicroBlock 5ac587cbfc test(im): race admit() on post-reset1 generation against concurrent reset2 2026-11-18 03:31:13 +08:00
MicroBlock 65ce0eed4a test(im-session-commands): cover expired pending receipt pruning and update retentionMs catalog doc 2026-11-18 03:31:05 +08:00
MicroBlock cf62af1108 docs(im): document same-chat stored quote validation contract 2026-11-18 03:29:27 +08:00
MicroBlock 5af01cc0ea docs(im-session-commands): match exact interrupted reply text from locale.ts 2026-11-18 03:28:27 +08:00
MicroBlock 7ac3692f26 chore(tool-cordis): regenerate api-catalog for ImIntake.drainAnnouncements 2026-11-18 03:27:59 +08:00
MicroBlock 3879f801c3 fix(im): replace Context.root send listener with plugin-scoped global listener and teardown onResult fallback 2026-11-18 03:27:40 +08:00
MicroBlock c6346badc3 fix(im): reject unstored or expired quote keys with access error 2026-11-18 03:21:05 +08:00
MicroBlock b3568da86b test(im,im-session-commands): fix typecheck errors in new test cases 2026-11-18 02:55:59 +08:00
MicroBlock 2e61a42d73 docs(im-session-commands): document interrupted reply and two-phase pending receipt lifecycle 2026-11-18 02:52:21 +08:00
MicroBlock b96b4c8443 fix(im): drain outbound announcements before closing store on teardown 2026-11-18 02:51:28 +08:00
MicroBlock 3278d6b8ef fix(im): drain un-receipted send and stream dispatches in ImSender.dispose 2026-11-18 02:49:53 +08:00
MicroBlock 59228eb876 fix(im): serialize session reset and admit by stable session key 2026-11-18 02:48:53 +08:00
MicroBlock 39922e35cc fix(im): reject cross-bot and cross-chat quotes with access error 2026-11-18 02:47:48 +08:00
MicroBlock 55173e8f2c fix(im-session-commands): roll back pending receipt on undefined passthrough and prune aged pending rows 2026-11-18 02:46:30 +08:00
gengruilin d996ea1d1b chore(connectors): align the package versions with 0.2.2-rc.4 2026-11-18 02:30:55 +08:00
MicroBlock 9a85c327af fix(im): keep send listener active until sender.dispose() drains in-flight sends 2026-11-18 02:20:27 +08:00
MicroBlock c2f504d86d fix(im-session-commands): persist pending command intent before side effects 2026-11-18 02:18:04 +08:00
MicroBlock 33e76d0e5b docs(im-session-commands): document command token boundary in README 2026-11-18 01:52:11 +08:00
MicroBlock 1cc5050f70 fix(im): rebuild retired generations on start() and recheck inside deliver() write 2026-11-18 01:51:30 +08:00
MicroBlock 0071aeb76f fix(vendor/fetch-file): honor init.signal during fileTypeFromStream sniffing 2026-11-18 01:49:50 +08:00
MicroBlock 9a4c3d2cbe docs(im): document target() source re-admission check and @throws access 2026-11-18 01:25:12 +08:00
MicroBlock bb4cc1701a test(vendor/im-core): use it.skipIf when built lib entrypoints are absent 2026-11-18 01:24:38 +08:00
MicroBlock 5208e4897b fix(im): require whitespace or end-of-text after slash command name 2026-11-18 01:23:45 +08:00
MicroBlock 98db9c4f05 test(vendor/im-core): omit undefined config arg in ctx.plugin(runtime.Satori) 2026-11-18 01:01:14 +08:00
MicroBlock 8f177c5cf5 test(vendor/im-core): type Satori import cleanly in built-entrypoint test 2026-11-18 00:59:42 +08:00
MicroBlock 0e46750c61 test(vendor/im-core): pass config arg to ctx.plugin(Satori) 2026-11-18 00:58:10 +08:00
MicroBlock e58905f8b6 docs(im): document outbound source re-admission check in README 2026-11-18 00:56:50 +08:00
MicroBlock 60335d7557 test(vendor/lark): pin prototype-key fallback in prepare.spec.ts 2026-11-18 00:56:00 +08:00
MicroBlock 75fe13c780 fix(vendor/im-core): share chunks across runtime and testing entrypoints 2026-11-18 00:55:17 +08:00
MicroBlock 4cdaee4d5e fix(im): attribute un-receipted streams to their publishing session 2026-11-18 00:29:17 +08:00
MicroBlock 40335a2e49 docs(im): restore discard() JSDoc and document hasPendingReset() in ImSessionHost 2026-11-18 00:28:27 +08:00
MicroBlock 6a0f190420 fix(im): re-verify current config.sources admission in ImSender.target() 2026-11-18 00:27:59 +08:00
MicroBlock 7e3f3865be fix(vendor/lark): use null-prototype maps in prepare.ts 2026-11-18 00:25:03 +08:00
MicroBlock b0dcdc2edb fix(im): use null-prototype maps for file extension lookups in tools 2026-11-18 00:23:53 +08:00
MicroBlock a008fd19ca test(im): reuse bot.send() SendResult in own-message alias test 2026-11-17 23:59:02 +08:00
MicroBlock 87a3f6e45e test(im): drop invalid status field from SendResult in own-message alias test 2026-11-17 23:57:32 +08:00
MicroBlock 29dcc234e9 test(im): pass ChatRef in own-message alias test 2026-11-17 23:56:07 +08:00
MicroBlock ff36403ba4 fix(im): store SentPart.aliases on own outbound messages 2026-11-17 23:53:17 +08:00
MicroBlock 944759c1dd fix(vendor/qq): record ext_info.ref_idx in SentPart.aliases 2026-11-17 23:51:14 +08:00
MicroBlock 0f6dd34c99 fix(im): reject admit() when session has an uncommitted reset receipt 2026-11-17 23:50:19 +08:00
MicroBlock e5d073adb5 docs(vendor): fix LarkApi.answer() class name in V113 2026-11-17 23:27:11 +08:00
MicroBlock 370d4df60f fix(im): drop tautological bot-key comparison in viewOf mention filter 2026-11-17 23:27:06 +08:00
MicroBlock 49c5e81e15 fix(im): keep uncommitted reset receipts across retention pruning 2026-11-17 23:26:16 +08:00
MicroBlock f0656cdafc fix(vendor/lark): mark HTTP 200 answers missing data as published: unknown 2026-11-17 23:03:13 +08:00
MicroBlock b4e4b4345b fix(im): isolate failing reset replays in ImSessionHost.recover() 2026-11-17 23:02:33 +08:00
MicroBlock f505e96138 test(im): pause save(next) to genuinely exercise recover/reset concurrency 2026-11-17 22:37:49 +08:00
MicroBlock fcda5bd526 fix(vendor/lark): wrap card callback answers in { code: 200, data } envelope 2026-11-17 22:36:45 +08:00
MicroBlock 65d2a1408f perf(im): batch retention pruning in ImSessionHost.recover() 2026-11-17 22:13:10 +08:00
MicroBlock 3da7ae4b08 test(im): await concurrent bind() in reset recovery serialization test 2026-11-17 22:13:06 +08:00
MicroBlock cde26ba59c fix(im): replay uncommitted resets through reset() serial chain in recover() 2026-11-17 22:12:02 +08:00
MicroBlock e28742560d docs(im-session-commands): mark Model Experience as indirect for passthrough commands 2026-11-17 21:49:20 +08:00
MicroBlock bdf18d0b25 fix(im): convert FS_TOO_LARGE in im_read_file to ImError('capacity') 2026-11-17 21:48:15 +08:00
MicroBlock 9d4d0112f7 fix(im): complete uncommitted reset receipts before admitting pending deliveries 2026-11-17 21:46:51 +08:00
MicroBlock eb2795af16 fix(im): escape skipped media labels and reasons in transcript 2026-11-17 21:45:40 +08:00
MicroBlock 602c56e599 test(im): pass complete ImMessageEvent in dispatcher reset test 2026-11-17 21:21:04 +08:00
MicroBlock d4c3a9410f fix(im): convert FS_TOO_LARGE in im_send_file to ImError('capacity') 2026-11-17 21:16:49 +08:00
MicroBlock 584a040b26 perf(im): batch sweep deletions with deleteMany and clarify event retention in README 2026-11-17 21:15:16 +08:00
MicroBlock 32496d00a6 fix(im): report skipped media reasons in formatted transcript 2026-11-17 21:14:33 +08:00
MicroBlock c554367e5a fix(im): resolve same-chat message alias for outbound quote id 2026-11-17 21:13:28 +08:00
MicroBlock 4d1488bd85 test(im): drop unnecessary as unknown cast in dispatcher.spec.ts 2026-11-17 21:12:29 +08:00
MicroBlock c437b553c2 test(im): cover readPlatform fallback branches for 100% coverage 2026-11-17 21:11:42 +08:00
MicroBlock c0cf22e8f0 fix(im): classify Bot read errors safely without assuming Bot.classify 2026-11-17 20:46:47 +08:00
MicroBlock 324ca9b137 fix(im): scope interaction message lookup by chat in ImOutputRegistry 2026-11-17 20:45:14 +08:00
MicroBlock 3d3a73eb85 fix(im): promote deliveredTo to ImSessions contract and document retention window 2026-11-17 20:43:31 +08:00
MicroBlock d366622d36 fix(im): convert platform read failures in readMessage and members to ImError 2026-11-17 20:41:47 +08:00
Turtle 01e3511d56 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
2026-11-17 20:31:55 +08:00
MicroBlock f2f987940e test(im): fix TS types in cross-chat alias collision test 2026-11-17 20:15:28 +08:00
MicroBlock 3dbaadd7b7 docs(im): document ImMessage.aliases in IM subsystem reference 2026-11-17 20:11:29 +08:00
MicroBlock 14e9ad0c25 fix(im): scope intake quote/alias lookups by chat and document ImHistory.get 2026-11-17 20:11:02 +08:00
MicroBlock ce41259575 fix(im): avoid re-delivering already-admitted messages after dispatcher reset 2026-11-17 20:09:23 +08:00
MicroBlock da7061cd57 fix(im): index message aliases in ImStore for cross-id quote lookup 2026-11-17 19:40:09 +08:00
MicroBlock 89799500d6 fix(vendor/qq): record message_scene.ext.msg_idx in InboundMessage.aliases 2026-11-17 19:35:13 +08:00
MicroBlock c1a26ad4c5 fix(vendor/http): combine caller signal with AbortSignal.any to avoid listener accumulation 2026-11-17 19:33:12 +08:00
MicroBlock ba6431d099 docs(im): remove stale 'button' value from draftOf @param via JSDoc 2026-11-17 19:32:09 +08:00
MicroBlock b570d41257 chore(im): drop nonexistent snapshots/im include from tsconfig.host.json 2026-11-17 19:31:45 +08:00
MicroBlock d65acee133 refactor(im-session-commands): narrow StoredCommandReceipt.reply to string 2026-11-17 19:09:37 +08:00
MicroBlock 0ece98a2a1 docs(vendor/im-core): align Scheduler.retry JSDoc with sawUnknown and StreamLimitError semantics 2026-11-17 19:08:59 +08:00
MicroBlock 76b4150037 fix(vendor/qq): send heartbeat sequence number in d field per gateway protocol 2026-11-17 19:08:14 +08:00
Chinesezjc e22e9acf63 docs(schedule): refresh controller binding translation record 2026-11-17 19:07:33 +08:00
Chinesezjc 3dcdfaec92 fix(schedule): await current controller binding before borrowing 2026-11-17 19:02:29 +08:00
MicroBlock 5315db9e62 fix(im-session-commands): join /status and /help reply lines with newlines 2026-11-17 18:45:14 +08:00
MicroBlock d5f5839fa3 fix(vendor/im-core): preserve published:unknown across StreamLimitError and block plain-send fallback on open 2026-11-17 18:44:09 +08:00
Chinesezjc e8021535ee Merge master into feat/schedule-source-model 2026-11-17 18:27:35 +08:00
Turtle e32cfc3608 fix(plugins): keep plugin mentions in sent messages and keep listBundles without arguments
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.
2026-11-17 18:23:08 +08:00
MicroBlock a21b2ec44d docs(im): document ImSendOptions.thread default and sync Cordis catalog 2026-11-17 18:19:14 +08:00
MicroBlock bb16bab1ea docs(im): align ImSendInput.thread and ImSendFileInput.quote JSDoc 2026-11-17 18:19:09 +08:00
MicroBlock 542d33ec92 docs(vendor/im): fix ResponseLike/responseOf JSDoc and cover Lark ResponseLike classify 2026-11-17 18:17:03 +08:00
MicroBlock b52f95fcd3 fix(vendor/im-core): detach caller AbortSignal listener on stream settlement 2026-11-17 18:16:01 +08:00
MicroBlock e5ba1b67a1 fix(vendor/im): forward AbortSignal through editPayload and bound abort-close 2026-11-17 18:14:56 +08:00
Chinesezjc 59c4143952 test(schedule): verify Source input file policy enforcement 2026-11-17 17:54:23 +08:00
MicroBlock c1e7c2aa7b fix(im): narrow answered ImMessage cleanly in ImSender.grant 2026-11-17 17:48:52 +08:00
MicroBlock cfb7543945 docs(im): align im_send.thread and im_send_file.quote descriptions with answered-thread default 2026-11-17 17:47:41 +08:00
MicroBlock 4a6a9aa31b docs(im): record README translation pairing hashes 2026-11-17 17:47:38 +08:00
MicroBlock bd54194feb fix(im): keep explicit thread over quoted root and unify answered-thread grant check 2026-11-17 17:46:08 +08:00
MicroBlock 80994df329 fix(vendor/im): match structural ResponseLike in responseOf for undici responses 2026-11-17 17:45:05 +08:00
MicroBlock 867efde4c2 refactor(vendor/im-core): remove unused target parameter from Bot.withRetry 2026-11-17 17:19:19 +08:00
MicroBlock 3b78681115 fix(vendor/qq): classify token endpoint errors and HTTP status in AccessToken 2026-11-17 17:19:19 +08:00
MicroBlock 666b3fef2b docs(vendor/qq): align PassiveManager.max JSDoc with ticketed-window retention 2026-11-17 17:19:19 +08:00
Turtle 778320cd96 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-schema.json
2026-11-17 17:16:39 +08:00
MicroBlock 8f57a87e9f im: place a publication in the thread its session answered in 2026-11-17 17:02:40 +08:00
MicroBlock ec3cbd1b61 fix(vendor/lark): preserve retryAfterMs, body, and HTTP 429 classification in AccessToken 2026-11-17 16:52:47 +08:00
Chinesezjc 7ec21cc960 Merge master into feat/schedule-source-model 2026-11-17 16:52:09 +08:00
MicroBlock 46e1b3be77 fix(vendor/qq): exempt live ticketed windows from passive LRU eviction 2026-11-17 16:51:52 +08:00
MicroBlock 5ad0b06e2e fix(vendor/im-core): require idempotentSend after any prior unknown attempt in Bot.withRetry 2026-11-17 16:50:06 +08:00
MicroBlock 530297c901 fix(vendor/im): drop invalid LarkApiError.response and vi reference in bot.spec.ts 2026-11-17 16:27:32 +08:00
MicroBlock bbec2c5043 fix(vendor/im-core): re-evaluate idempotentSend across Bot.withRetry attempts 2026-11-17 16:26:21 +08:00
MicroBlock 2fe42e3cf2 fix(vendor/im): mark all token acquisition failures as published:no 2026-11-17 16:25:28 +08:00
MicroBlock 54762ed1aa docs(vendor/qq): distinguish decode vs receive failure handling in gateway comment 2026-11-17 16:24:05 +08:00
MicroBlock ee283e940d fix(vendor/qq): abort per-connection signal synchronously on receive failure to stall queued frames 2026-11-17 16:23:37 +08:00
MicroBlock 8fc9993f64 fix(vendor/im): use valid WHATWG WebSocket close code 3000 instead of 1011/1008 2026-11-17 16:22:36 +08:00
Chinesezjc 79ef82f220 Merge master into feat/schedule-source-model 2026-11-17 16:20:58 +08:00
MicroBlock 0dc2ac831f fix(vendor/qq): remove close listener inside handler instead of 3rd addEventListener arg 2026-11-17 15:57:28 +08:00
MicroBlock fcd1cabe47 docs(vendor/im-core): document confirmed recall clearing MessageStream.handle 2026-11-17 15:56:08 +08:00
MicroBlock 27805d4141 fix(vendor/lark): preserve target.chat.type in SentPart.referrer.chatType 2026-11-17 15:55:41 +08:00
MicroBlock b5177d6cea fix(vendor/im-core): invalidate createEditDriver published cache on edit failure 2026-11-17 15:55:20 +08:00
MicroBlock 2064f32829 fix(vendor/qq): advance resume seq only after bot.receive persists 2026-11-17 15:54:37 +08:00
MicroBlock 2897e34d14 fix(vendor/qq): keep gateway close listener across WsClientBase abort for 4006/4007 2026-11-17 15:52:51 +08:00
Chinesezjc 446368841b test(schedule): type lifecycle report matchers 2026-11-17 15:49:00 +08:00
MicroBlock aaf01350c0 test(im): drop unused err parameter in makeStream helper 2026-11-17 15:26:54 +08:00
MicroBlock 06ed53981d fix(vendor/lark): use 'direct' instead of 'p2p' for LarkChatKind 2026-11-17 15:23:30 +08:00
MicroBlock f639b85dc6 fix(im): persist SentPart thread and referrer in ImIntake.announce 2026-11-17 15:21:33 +08:00
MicroBlock 4acf74cfb6 fix(vendor/im): report platform thread and referrer on SentPart 2026-11-17 15:20:57 +08:00
MicroBlock a48a0ef89e fix(im): settle recalled stream failures as failed and document partial stream receipts 2026-11-17 15:19:10 +08:00
MicroBlock ab102eede0 fix(vendor/im-core): clear stream handle on confirmed recall and mark StreamAbortError.recalled 2026-11-17 15:17:34 +08:00
MicroBlock edfbdc7eb6 test(im): satisfy SentPart and ImMessageKey types in send.spec.ts 2026-11-17 14:45:34 +08:00
MicroBlock 1ce7990ba1 fix(im): settle stream failure with existing handle as partial with attribution 2026-11-17 14:41:15 +08:00
MicroBlock 4af60c989a docs(im): document AbortSignal cancellation in admitMediaSource JSDoc 2026-11-17 14:38:31 +08:00
Chinesezjc 6e45438ad7 test(schedule): verify recovery after controller withdrawal 2026-11-17 14:32:59 +08:00
Chinesezjc d06e09a424 fix(schedule): release inputs after settled receiver failures 2026-11-17 14:14:34 +08:00
MicroBlock ba10d1b5eb test(vendor/im-core): remove unsupported recall from EditDriverAdapter stub 2026-11-17 13:42:18 +08:00
MicroBlock e85373e6ec test(vendor/im-core): import EditDriverAdapter type in stream.spec.ts 2026-11-17 13:39:41 +08:00
Chinesezjc 24c4f6da8c revert: remove SessionController private-owner documentation and test 2026-11-17 13:38:06 +08:00
MicroBlock 83b3e7b7d8 fix(vendor/im-core): include ResourceMeta in resourceCacheKey and inflight dedupe 2026-11-17 13:37:10 +08:00
MicroBlock 36e0a5a6d0 fix(vendor/im-core): preserve published:unknown across Bot.withRetry attempts 2026-11-17 13:36:04 +08:00
MicroBlock 4b16368d43 fix(vendor/im-core): guard initial stream open retries with published/idempotentSend 2026-11-17 13:35:15 +08:00
MicroBlock 7fe26b4ef7 fix(vendor/im-core): pass lifecycle AbortSignal in stream driver context options 2026-11-17 13:32:43 +08:00
MicroBlock 7469274648 fix(im): forward AbortSignal to admitMediaSource DNS lookup 2026-11-17 13:31:03 +08:00
Chinesezjc 78662a5ac6 revert: restore SessionController initialization 2026-11-17 13:25:11 +08:00
Chinesezjc a22f40f44c docs: refresh Schedule persistence catalog source locations 2026-11-17 13:16:32 +08:00
Chinesezjc 9a87c7ad30 test(session-controller): activate fixture dependencies before use 2026-11-17 12:32:50 +08:00
Chinesezjc 003d9ef62c docs(schedule): remove redundant source observation anchor 2026-11-17 11:48:41 +08:00
Chinesezjc 9d501755a5 fix(schedule): correct shutdown fixture types 2026-11-17 11:29:09 +08:00
Turtle 251cf16dee Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-schema.json
2026-11-17 11:21:59 +08:00
afdad7798f fix(ui-chat): start wide table scroll at the message column
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>
2026-11-17 10:14:47 +08:00
Chinesezjc b76454f96a fix(schedule): align Source fixtures and typed assertions 2026-11-17 00:24:04 +08:00
MicroBlock 7ff94d378c Merge remote-tracking branch 'origin/master' into feat/im-automation 2026-11-17 00:10:35 +08:00
MicroBlock 2fd47ff880 fix(im): forward AbortSignal through media elementAt and expanded forward reads 2026-11-17 00:10:28 +08:00
MicroBlock 6fef40d447 fix(im): continue only the finished chat on more without re-pumping failing peers 2026-11-17 00:10:24 +08:00
Chinesezjc 0a978e8572 fix(schedule): preserve Source cleanup and supported exports 2026-11-16 23:10:37 +08:00
Chinesezjc 145da2cac5 merge: reconcile Source model with current master 2026-11-16 22:05:46 +08:00
Chinesezjc e5aacabfbf fix(schedule): type source lifecycle fixtures against public APIs 2026-11-16 21:20:00 +08:00
Chinesezjc 525334ff14 fix(schedule): return a disposer from initialization effect 2026-11-16 20:56:27 +08:00
MicroBlock 5982f9c4a3 refactor(im): drop unused ImToolName export 2026-11-16 18:34:03 +08:00
MicroBlock cab060bb74 Merge remote-tracking branch 'origin/master' into feat/im-automation
# Conflicts:
#	docs/persistence-schema.json
#	docs/tool-catalog.i18n.yaml
#	package.json
#	scripts/rescope-vendor.ts
2026-11-16 18:17:50 +08:00
MicroBlock 63b8b88dea docs(im): document implicit root thread forwarding for thread-confined sessions 2026-11-16 18:14:12 +08:00
MicroBlock ab8700b4f2 fix(im): only swallow ImError('unavailable') in selfIdOf 2026-11-16 18:14:08 +08:00
MicroBlock f73fdc370b fix(im): track in-flight drain per chat in ImIntake.pump so slow chats do not block others 2026-11-16 18:14:04 +08:00
MicroBlock cd6f1bc1d4 fix(vendor/im-core): attach rejection handler to pending read when abortable sees already-aborted signal 2026-11-16 18:14:01 +08:00
MicroBlock c5effee42d fix(im): narrow ImToolHost.bot return type to { readonly selfId?: string } 2026-11-16 17:30:32 +08:00
sjw1231 82f6ae2f02 ci(sdk): compare SDK and Desktop model context beyond tool names
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).
2026-11-16 17:28:12 +08:00
MicroBlock 22748f2622 docs(im): sync generated Cordis catalog for ImMediaStore allow predicate 2026-11-16 17:24:45 +08:00
MicroBlock ab4bda565f fix(im): deduplicate threadAllow/selfIdOf helpers, refine thread guidance, and cover oversized extension 2026-11-16 17:24:41 +08:00
MicroBlock 215436581a fix(im): forward root thread id when confined session quotes root and document messageInThreads 2026-11-16 17:24:37 +08:00
b4aa63933a fix(ui-chat): keep the table spacer on the wrapper's width and clear of the turn rail
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>
2026-11-16 17:17:35 +08:00
MicroBlock 91ab904dff Merge remote-tracking branch 'origin/master' into feat/im-automation
# Conflicts:
#	docs/capability-seams.i18n.yaml
2026-11-16 17:09:31 +08:00
MicroBlock 5fa67ccca3 fix(im): promote prefetched platform-read records to pending on inbound arrival 2026-11-16 17:08:43 +08:00
MicroBlock 4b0da60241 fix(im): enforce binding.thread on media reads, bound staged filenames, filter selfId mentions, and fix JSDoc 2026-11-16 16:59:12 +08:00
MicroBlock 310545f176 fix(im): support thread allow predicate in ImMediaStore and share messageInThreads 2026-11-16 16:59:09 +08:00
Turtle 1d305d6bde Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337 2026-11-16 16:58:32 +08:00
MicroBlock 24af6cb4cb test(im): reach 100% branch coverage on send, intake, and tools 2026-11-16 16:49:44 +08:00
3787087840 fix(ui-chat): move wide tables into the empty lead before scrolling
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>
2026-11-16 16:47:22 +08:00
MicroBlock 0344e46164 test(im): fix ImMessageDraft and fakeAgent types in intake and tools specs 2026-11-16 16:34:20 +08:00
MicroBlock 416b0a7064 fix(im): narrow quote element type in ImIntake.announce 2026-11-16 16:30:24 +08:00
MicroBlock 6bffc93618 fix(im): enforce binding.thread on reads, key receipts by agent session, and bound tiny maxReadBytes 2026-11-16 16:29:21 +08:00
MicroBlock 1876d54a7e fix(im): preserve thread and referrer on announced own messages 2026-11-16 16:29:17 +08:00
MicroBlock 355a818aa4 fix(im): enforce ImBinding.thread on outbound send and stream grants 2026-11-16 16:29:13 +08:00
MicroBlock eb70739002 fix(im): remove unreachable NO_OUTPUT branch in ImOutputRegistry.begin 2026-11-16 16:07:46 +08:00
MicroBlock bca637496d fix(im): attach rejection handler before readWithin early abort 2026-11-16 16:07:42 +08:00
MicroBlock 13222bc40e test(im-session-commands): type earlyEvent as ImMessageEvent for oxlint 2026-11-16 16:00:21 +08:00
MicroBlock e0f6bde152 docs(im): document ImError.permanent for export-jsdoc check 2026-11-16 16:00:17 +08:00
MicroBlock e70bab80d0 docs(im): add @param signal JSDoc and sync generated Cordis catalog 2026-11-16 15:52:12 +08:00
MicroBlock 008cc4a40b test(im): add required self field in format line-style test 2026-11-16 15:38:49 +08:00
MicroBlock 86bcd8826f chore(im): repair pnpm-lock.yaml after merge 2026-11-16 15:33:39 +08:00
MicroBlock a0e7a75f16 Merge remote-tracking branch 'origin/master' into feat/im-automation 2026-11-16 15:32:07 +08:00
MicroBlock 0684f5a237 fix(im): skip missing-renderer warning for output none and escape line-style names 2026-11-16 15:31:48 +08:00
MicroBlock 5b60d1b6fb fix(im): bound tool-side platform reads by platformTimeoutMs and signal 2026-11-16 15:31:42 +08:00
MicroBlock 708295bc37 fix(im): abort open streams on sender dispose 2026-11-16 15:31:35 +08:00
MicroBlock 466e87e3f9 docs(im): update translation pairing record for README.md 2026-11-16 15:28:36 +08:00
Turtle bee53ca379 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337 2026-11-16 14:50:45 +08:00
MicroBlock 2ff5b318e1 test(vendor): import LarkReferrer type in Lark send spec 2026-11-16 14:39:17 +08:00
MicroBlock 982621b197 docs(im): document explicit thread anchor resolution and chat ownership check 2026-11-16 14:30:16 +08:00
MicroBlock 27ae51af2d fix(im-session-commands): settle ready before closing domain on startup failure 2026-11-16 14:29:59 +08:00
MicroBlock 81c67203e4 fix(im): await stream settlements on dispose, keep transient capacity pending, and bound platform reads 2026-11-16 14:29:15 +08:00
MicroBlock 169db789bd fix(vendor): gate unknown-outcome retries on adapter idempotency and verify quoted thread anchors 2026-11-16 14:26:54 +08:00
audit 87811f3dbf refactor(ui-plugin-manager): render a tab's bundle switch through a Factory
`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.
2026-11-16 10:59:02 +08:00
audit eb4da40805 docs(connectors): answer the review's documentation threads
- 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
2026-11-16 10:36:59 +08:00
Turtle b0f9808af3 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
2026-11-15 15:28:53 +08:00
Turtle 36ed085a21 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
2026-11-14 23:44:45 +08:00
MicroBlock 6f71f5a2ec fix(im): sync manifest versions to 0.2.2-rc.3 and cover remaining branches 2026-11-13 21:05:42 +08:00
MicroBlock d50a911f4b chore(im): merge origin/master into feat/im-automation 2026-11-13 19:59:45 +08:00
MicroBlock 7d7c2c48a3 fix(im): close startup/shutdown races, reserve receipt capacity atomically, and reuse thread referrers 2026-11-13 18:47:57 +08:00
MicroBlock 52a198aee3 fix(vendor): propagate internal route aborts, cancel token waits, and resolve Lark thread anchors 2026-11-13 18:47:38 +08:00
Chinesezjc ba318bb95e fix(schedule): cover controller initialization and launch modes 2026-11-13 18:10:13 +08:00
MicroBlock 735dd8a232 docs(im): document command receipts, adapter ordering, and catalogs 2026-11-13 17:29:37 +08:00
MicroBlock 55d6251c94 im: harden command receipts, startup receive ordering, and reset persistence 2026-11-13 17:29:24 +08:00
Chinesezjc 0d59bbe55d fix(schedule): preserve source delivery during provider unload 2026-11-13 17:17:01 +08:00
Turtle b0d5222122 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	packages/client/ui-plugin-manager/README.i18n.yaml
#	packages/client/ui-plugin-manager/package.json
#	packages/client/ui-plugin-manager/tsconfig.client.json
2026-11-13 16:33:48 +08:00
Turtle d300d96267 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	packages/client/tsdown.client.ts
2026-11-13 16:14:59 +08:00
Turtle 398f066359 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
2026-11-13 16:07:28 +08:00
MicroBlock 4e146940d9 docs(im): update READMEs, subsystem docs, and generated catalogs 2026-11-13 15:56:55 +08:00
MicroBlock f06a6be868 im: hold recovery until composition settles and make resets idempotent 2026-11-13 15:56:38 +08:00
MicroBlock ad28474489 im-adapter-lark: stream resource downloads and sanitize mention ids 2026-11-13 15:56:09 +08:00
Turtle bf73c1a8d7 docs: move the listBundles upgrade guide to v0.2.2-rc.3 2026-11-13 15:45:51 +08:00
Turtle d12220d180 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337 2026-11-13 15:44:52 +08:00
Turtle ed3f7a00b9 Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337 2026-11-13 15:20:05 +08:00
Turtle 8e1eae689e Merge remote-tracking branch 'origin/master' into turtle/fix-conflict-6542-b5f7dd515337
# Conflicts:
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
#	packages/client/tsdown.client.ts
#	packages/client/ui-plugin-manager/README.i18n.yaml
#	packages/client/ui-plugin-manager/README.md
#	packages/client/ui-plugin-manager/README.zh.md
#	packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx
#	packages/client/ui-plugin-manager/tests/components.client.spec.tsx
2026-11-13 14:17:33 +08:00
Chinesezjc 5f476b5995 refactor(schedule): unify receiver connections and time sources 2026-11-13 13:36:44 +08:00
MicroBlock df0c917276 im: tests: drop a template literal the delivery case did not need 2026-11-12 20:17:24 +08:00
MicroBlock 376f49ae59 docs: regenerate the catalog surface im_members and MembersPage added
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.
2026-11-12 20:08:09 +08:00
MicroBlock 41572219ea im: keep the ImService JSDoc on the class
The composition helper went in between the class comment and the class, which left the exported service undocumented.
2026-11-12 20:08:05 +08:00
MicroBlock 296ba4711a docs(im): bring the Chinese README along and re-record the pairings
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.
2026-11-12 19:54:13 +08:00
MicroBlock 1d99725c37 im: pin the delivery reserve against a real intent, and widen it
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.
2026-11-12 19:50:34 +08:00
MicroBlock 8271bc38ff im: dispatch nothing until the composition has settled
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.
2026-11-12 19:50:29 +08:00
MicroBlock 84cb158e03 im-bundle: give every platform request a transport deadline
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.
2026-11-12 19:50:23 +08:00
MicroBlock 0e05551bd1 im: stop paging a member roster after ten pages
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.
2026-11-12 19:50:19 +08:00
MicroBlock 31012c208c docs: list im_members in the tool catalog and its guarantee test
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.
2026-11-12 19:35:28 +08:00
MicroBlock 0089c836e7 im-adapter-lark: never mention everyone for a user mention
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.
2026-11-12 19:32:55 +08:00
MicroBlock 2a934845d1 im-markdown: keep line breaks beside inline formatting, read the everyone id as @all
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.
2026-11-12 19:32:50 +08:00
MicroBlock e64ee9e759 im: keep the deadline timers lint-clean 2026-11-12 19:23:50 +08:00
MicroBlock eff30b31a9 im: admit a satori: source only under the receiving bot, and judge embedded IPv4
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.
2026-11-12 19:23:46 +08:00
MicroBlock 541cd3420f vendor: end a resource fetch at its deadline with the body included
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.
2026-11-12 19:23:42 +08:00
MicroBlock c2fcd7e3f4 im: tests: let the recorded fetch init carry undefined options 2026-11-12 16:06:47 +08:00
MicroBlock c8b6939d1c im-bundle: record the platform deadline in the composition snapshot 2026-11-12 16:03:53 +08:00
MicroBlock c1ca9fafc3 docs: log the vendored send signature and pair the media note 2026-11-12 16:01:28 +08:00
MicroBlock 4739096f28 im: number the media of an expanded forward where the transcript shows them 2026-11-12 16:00:57 +08:00
MicroBlock 5477c1bb47 im: bound a platform read so a stuck request cannot hold a chat open 2026-11-12 15:59:47 +08:00
MicroBlock 4e1b821fcb im: reject a frame that arrives after the intake stopped 2026-11-12 15:57:42 +08:00
MicroBlock 0e0bd71085 im: confine an inbound media fetch to the admitted URL and bound it 2026-11-12 15:56:45 +08:00
MicroBlock 653a8707f7 im: refuse a media host whose lookup fails or outlives the deadline 2026-11-12 15:54:23 +08:00
MicroBlock 68bf5fc2fa im: give the tool tests the member limit the config now requires 2026-11-12 15:54:13 +08:00
Chinesezjc af12b4f41a fix(schedule): drain only active session controller users 2026-11-12 15:11:14 +08:00
MicroBlock fd9c445169 im: mention people by the id a chat lists, and render every registered element
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.
2026-11-12 14:47:10 +08:00
Chinesezjc 06acb60092 test(schedule): cover source admission and clarify delivery limits 2026-11-12 11:45:05 +08:00
turtle1999 8eb9996892 fix(plugins): keep a cited step running when the profile cannot be read
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.
2026-11-11 21:49:54 +08:00
turtle1999 2712eb8b75 refactor(plugins): register plugin references on the manager context
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.
2026-11-11 19:24:52 +08:00
turtle1999 af5ce74646 docs: move the listBundles upgrade guide to the current release
The root version is now 0.2.2-rc.1, and an added guide belongs under that release's directory.
2026-11-11 19:24:52 +08:00
turtle1999 f1e53f10a9 chore(session): record the plugin-reference message source
Re-record the same-version acknowledgement against the current persistence chain and regenerate the persistence, config, Cordis, client, module, and event catalogs.
2026-11-11 19:24:52 +08:00
turtle1999 20c5b606d7 test(plugins): compare every listed bundle when read by name
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.
2026-11-11 19:24:52 +08:00
turtle1999 c0d69b1f54 refactor(plugins): take listBundles names in an options object
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.
2026-11-11 19:24:52 +08:00
turtle1999 90fa3b2da0 docs: record the listBundles names argument in the upgrade guide
Client plugins calling the Remote without arguments now fail the gateway argument count and must pass undefined.
2026-11-11 19:24:52 +08:00
turtle1999 cb0427c41f fix(web): pass the optional listBundles argument explicitly
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.
2026-11-11 19:24:52 +08:00
turtle1999 a9c2116b13 refactor(plugins): filter listBundles by optional package names
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.
2026-11-11 19:24:51 +08:00
turtle1999 e77e8ba219 perf(plugins): read only the cited bundles for plugin 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.
2026-11-11 19:14:21 +08:00
turtle1999 278ed6abd3 fix(web): give the default trigger highlight to the first group in menu order
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.
2026-11-11 19:00:13 +08:00
turtle1999 bab3d111f4 fix(plugins): keep cited plugin context safe when profile reads fail
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.
2026-11-11 19:00:13 +08:00
turtle1999 ed2de80d4c fix(plugins): describe cited bundles from the manager's bundle list
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.
2026-11-11 19:00:13 +08:00
turtle1999 e519d9e55c docs: explain the optional plugin reference cwd
The context resolver treats an absent working directory as outside the workspace.
2026-11-11 18:49:41 +08:00
turtle1999 b589566793 docs: document the exported plugin reference API
The JSDoc gate requires parameter and return tags on every exported function.
2026-11-11 18:49:40 +08:00
turtle1999 38c2472892 fix(web): list installed bundles in the plugin @ menu
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.
2026-11-11 18:49:40 +08:00
turtle1999 90ec88f48b feat(web): reference plugins from the @ menu
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.
2026-11-11 18:49:40 +08:00
turtle1999 3d6972b49f test(web): tighten plugin row filter coverage
Assert the literal row the filter keeps, document the module's matching role, and record why the Host-side locale expansion is duplicated.
2026-11-11 18:32:21 +08:00
turtle1999 268a43c975 feat(web): match plugin row filters in all declared languages
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.
2026-11-11 18:32:20 +08:00
Chinesezjc bc41919a4f refactor(schedule): own source classes in the existing package 2026-11-11 16:04:45 +08:00
Chinesezjc 53081afea9 fix(source): expose native disposer semantics and library metadata 2026-11-11 15:08:32 +08:00
MicroBlock ae805dc70d im: cover the resolver the media policy uses by default
Every case passed its own resolver, so the default one, which is what a deployment runs, had no case at all.
2026-11-11 14:56:53 +08:00
MicroBlock 214970671a im: cover the frames a shutdown drops and the chats a platform read may reach
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.
2026-11-11 14:54:59 +08:00
MicroBlock d4e858b38b docs: correct the adapter options operators configure
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.
2026-11-11 14:50:10 +08:00
MicroBlock 6ca29c58d0 vendor: publish the licence and readme the qq adapter lacked
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.
2026-11-11 14:50:10 +08:00
MicroBlock fa911e674e vendor: classify the failures IM reports, and correct the adapter records
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.
2026-11-11 14:50:10 +08:00
MicroBlock 0e7e390882 im: keep a confirmed publication when its own message cannot be stored
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.
2026-11-11 14:50:10 +08:00
MicroBlock b3a1b1741f im: check the chat an interaction belongs to against its rule
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.
2026-11-11 14:50:09 +08:00
MicroBlock a45a95fa53 im: keep one chat's reads in arrival order and drain them before closing
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.
2026-11-11 14:50:09 +08:00
MicroBlock 5b8c53f66b im: recover stored messages once the routing plugins are mounted
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.
2026-11-11 14:50:09 +08:00
Chinesezjc 08a6bc6321 fix(source): connect through ready Schedule and drain owned input 2026-11-11 14:48:10 +08:00
MicroBlock 639cb61c5e im: refuse the media sources a received message may not fetch
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.
2026-11-11 14:47:48 +08:00
Chinesezjc 29c91140a1 test(source): record task input and verify published composition 2026-11-11 13:38:19 +08:00
Chinesezjc f5c873841f test(source): pin published exports and drain failed-test work 2026-11-11 12:51:45 +08:00
Chinesezjc 265ea2557f feat(source): compose typed source instances and deliver task input 2026-11-11 12:38:03 +08:00
MicroBlock fd06a18f41 im: wait for the stored own message in a receipt
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.
2026-11-10 17:41:43 +08:00
MicroBlock 3913f5557c im: keep the intake reads out of the store chain
`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.
2026-11-10 17:23:12 +08:00
MicroBlock d1942e17a4 vendor: bound a resource fetch by bytes
`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.
2026-11-10 17:20:59 +08:00
MicroBlock 800e71aefb im: bound the publication this host stores
`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.
2026-11-10 17:17:47 +08:00
MicroBlock 7f92db4d0a im: release the stores a failed load opened
`[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.
2026-11-10 17:16:17 +08:00
MicroBlock 2792c70268 im: refuse an interaction whose admitting source is gone
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.
2026-11-10 17:16:01 +08:00
MicroBlock 2761a3ed32 vendor: keep the preset id out of the rescope
`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.
2026-11-10 16:00:08 +08:00
MicroBlock ca358e791d docs(im): record the read limitations and the real resource rule
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.
2026-11-10 15:40:19 +08:00
MicroBlock 9bd2e0ee7e im: keep staged media paths per chat
`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.
2026-11-10 15:31:57 +08:00
MicroBlock 9b1f681be4 im: escape the transcript body
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.
2026-11-10 15:31:57 +08:00
MicroBlock 3efad4780b im: settle a delivery that can never fit instead of retrying it
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.
2026-11-10 15:31:57 +08:00
MicroBlock 5c623458bb im: keep a reset inside one serial operation
`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.
2026-11-10 15:31:56 +08:00
MicroBlock 6851493f9c im: publish a local file by its path
`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.
2026-11-10 15:08:21 +08:00
MicroBlock f3af51825a vendor: restore the upstream resource fetcher
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.
2026-11-10 15:03:33 +08:00
MicroBlock 9c661cc6f3 revert(connection): drop the open browser surface from this branch
`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.
2026-11-10 15:02:17 +08:00
LegGasai e5e5ac85df Merge remote-tracking branch 'origin/master' into worktree/asr-transcribe-api-649cb4
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/subsystems/credentials.md
#	docs/subsystems/credentials.zh.md
#	packages/client/ui-settings-account/README.i18n.yaml
#	packages/credentials/deepseek-account-platform/README.i18n.yaml
#	packages/credentials/deepseek-account-platform/README.md
#	packages/credentials/deepseek-account-platform/README.zh.md
#	packages/credentials/deepseek-account-platform/src/index.ts
#	packages/credentials/deepseek-account/README.i18n.yaml
#	packages/credentials/deepseek-account/README.md
#	packages/credentials/deepseek-account/README.zh.md
#	packages/credentials/deepseek-account/src/index.ts
#	packages/credentials/deepseek-account/tests/account.spec.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
2026-11-06 18:18:48 +08:00
MicroBlock ec116b3e39 im: keep the interaction handlers synchronous
`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.
2026-11-06 17:38:49 +08:00
LegGasai 9661945bb7 Merge remote-tracking branch 'origin/master' into worktree/asr-transcribe-api-649cb4
# Conflicts:
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	packages/preset/agent-preset/skills/dsh-doc/references/packages.md
2026-11-06 17:32:22 +08:00
LegGasai fadf0ca9f4 feat(voice-input): recognize speech with DeepSeek cloud ASR after sign-in
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
2026-11-06 17:28:46 +08:00
MicroBlock e8db542a05 docs: regenerate the IM catalog surface and record the section pairings
`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.
2026-11-06 17:18:00 +08:00
MicroBlock 21434c612d im: pin the model-visible tool surface
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.
2026-11-06 17:04:32 +08:00
MicroBlock 50a1a2c53b vendor: correct the vendored Satori source list
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.
2026-11-06 17:03:01 +08:00
MicroBlock dd863d868e vendor: publish the im-core testing entry
`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.
2026-11-06 17:02:49 +08:00
MicroBlock 079359a416 im-adapter-qq: re-record the corpus goldens for the form case
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.
2026-11-06 17:02:19 +08:00
MicroBlock f851b9cd26 im: refuse outbound resources the host would have to fetch
`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 `![](file:///…)` 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.
2026-11-06 17:02:08 +08:00
MicroBlock 551450a7b7 im: drop the unused outbound text limit
`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.
2026-11-06 16:50:36 +08:00
gengruilin 59f6a9d31a test(connectors): follow master's optional BundleInfo update field
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)
2026-11-06 03:57:49 +08:00
gengruilin 207e89bd58 fix(connectors): open an installed connector from its whole row
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.
2026-11-06 11:34:19 +08:00
MicroBlock e941154719 im-adapter-qq: keep the button label fallback total over the submit variant
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.
2026-11-05 22:14:06 +08:00
MicroBlock 4ed27252c7 Merge remote-tracking branch 'origin/feat/im-automation' into pr6291
# Conflicts:
#	vendor/README.md
2026-11-05 22:03:58 +08:00
MicroBlock 445b921270 im: route checkbox toggles as interaction/check
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.
2026-11-05 21:51:59 +08:00
MicroBlock 4764d603d3 im-adapter-lark: a multi-select is reported only by its form's submit
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.
2026-11-05 21:21:54 +08:00
Shigma 1fdb5f3c30 test(connection): obtain the open-face credential double without an unknown cast 2026-11-05 20:56:02 +08:00
Shigma 3dc8bd50f7 refactor(im): keep plugin entries to their loader exports 2026-11-05 20:56:02 +08:00
Shigma 6ecf5519d4 docs(im): rebase the message source acknowledgement on master history 2026-11-05 20:56:02 +08:00
Shigma f9249f10c0 fix(im): pin zod to the workspace version 4.6.6 2026-11-05 20:56:02 +08:00
Shigma e630c0e5e5 refactor(im): drop the experimental prefix from the IM package names 2026-11-05 20:56:02 +08:00
Shigma 572bb6bf6b docs(im): re-record bundle README translation pairing 2026-11-05 20:38:18 +08:00
Shigma 5502668680 chore(im): align package versions and published files with master 2026-11-05 20:34:09 +08:00
Shigma a5d1c10313 Merge remote-tracking branch 'origin/master' into feat/im-automation
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-changes/historical-formats/README.i18n.yaml
#	docs/persistence-changes/historical-formats/README.md
#	docs/persistence-changes/historical-formats/README.zh.md
#	docs/persistence-schema.json
#	docs/rescope.i18n.yaml
#	docs/subsystems/README.i18n.yaml
#	docs/tool-catalog.i18n.yaml
#	packages/experimental/README.i18n.yaml
#	pnpm-lock.yaml
#	scripts/run-gates.spec.ts
#	scripts/run-gates.ts
#	tsconfig.host.json
#	vendor/README.md
2026-11-05 19:58:17 +08:00
MicroBlock 96c279895c im: a select names its channel instead of requiring an id
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.
2026-11-05 19:34:14 +08:00
MicroBlock c7da6e86dd im: add form controls and the interaction/select event
<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.
2026-11-05 17:55:40 +08:00
gengruilin 01b5eff140 feat(connectors): leave the bundle off the Plugins lists until enabled
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.
2026-11-05 15:56:06 +08:00
gengruilin 71bb7c7310 feat(connectors): show a feature preview on the Connectors bundle's page
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.
2026-11-05 14:33:45 +08:00
gengruilin e966b1b2a7 feat(connectors): show brand icons and the Installed list switch in the Connectors tab
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.
2026-11-05 01:53:17 +08:00
gengruilin 37611026c2 feat(ui-plugin-manager): give contributed tabs the Installed list switch
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.
2026-11-05 01:11:42 +08:00
MicroBlock 8684ca03ca im-core: refuse a send over the mode's hard limits before any request 2026-11-04 20:56:57 +08:00
MicroBlock 54ac73cac1 im-adapter-lark: keep a blank button label blank instead of showing its action id 2026-11-04 20:33:17 +08:00
MicroBlock e6c912dea1 im-adapter-lark: let a click listener defer its answer past intake 2026-11-04 19:24:36 +08:00
MicroBlock 40ff0eb89a im-core: rebuild a message handle from its platform id 2026-11-04 19:14:52 +08:00
MicroBlock 2649a40a17 im-adapter-lark: carry Lark button size, width, icon and confirm 2026-11-04 18:36:57 +08:00
MicroBlock 99d119261d im-adapter-lark: answer card callbacks with a toast 2026-11-04 18:36:52 +08:00
MicroBlock b350c80c50 im-markdown: contribute the markdown element instead of a core service 2026-11-03 20:12:11 +08:00
MicroBlock 211e532ab6 im-markdown: expand <markdown> in the render engine and settle it for append streams 2026-11-03 18:49:25 +08:00
MicroBlock f187020531 fs: write exact bytes, and stage an attached IM file with them
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.
2026-11-03 14:26:15 +08:00
gengruilin 0ade56dc91 feat(connectors): add the experimental Connectors tab
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.
2026-11-03 01:26:36 +08:00
gengruilin c420c611b0 feat(ui-plugin-manager): leave the official connectors to the Connectors tab
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.
2026-11-03 01:26:07 +08:00
MicroBlock 084ac79773 im: admit non-image media as verbatim file attachments
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.
2026-11-02 21:40:40 +08:00
MicroBlock bc0bdac98b im-adapter-lark: serialize card text with the mdast writer
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 \&#60;name>\. Text, code spans and fences now go through mdast-util-to-markdown, and the final normalize pass leaves '<' alone.
2026-11-02 19:48:57 +08:00
MicroBlock 14ed475bc5 fix(im): serve a forward's pictures through its container and expand nested forwards
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.
2026-11-02 17:56:35 +08:00
MicroBlock 25c4b65947 docs(im-adapter-lark): drop the deleted CardKit route reference 2026-11-02 16:48:30 +08:00
MicroBlock 7826353052 refactor(im-adapter-lark): delete the CardKit entity path
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.
2026-11-02 16:40:22 +08:00
MicroBlock 47883a01dc fix(im): read the entries of a merged forward
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.
2026-11-02 16:11:36 +08:00
MicroBlock cfc15c1bc4 fix(im-adapter-lark): edit card messages instead of streaming a card entity
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.
2026-11-02 15:48:41 +08:00
MicroBlock 5be3ea0aac fix(im-core): close a spent streaming window in place
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.
2026-11-02 15:23:16 +08:00
MicroBlock b869d73ae9 im: merge master and resolve the documentation conflicts
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).
2026-11-02 14:04:28 +08:00
MicroBlock cf8c5fabc6 Merge master into feat/im-automation 2026-10-30 20:24:27 +08:00
MicroBlock 12988f414b im: tell the model whether its reply text reaches the chat
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.
2026-10-30 19:48:11 +08:00
MicroBlock 187c39a273 vendor: commit the pinned Feishu API subset and check it offline
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.
2026-10-30 19:07:41 +08:00
MicroBlock 09dd71178f docs(connection): re-record the browser-surface section pairing
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.
2026-10-30 18:00:23 +08:00
MicroBlock 12ea54eb78 im: correct the public contracts, catalogs and metadata
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.
2026-10-30 18:00:13 +08:00
MicroBlock 0b02a3fe40 im: acknowledge an oversized message and stop overtaking a failed one
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.
2026-10-30 18:00:01 +08:00
MicroBlock cba2e710cb im: reserve a stream receipt before opening the stream
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.
2026-10-30 17:59:57 +08:00
MicroBlock ce94284ba4 im: keep background work and stored identity consistent
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.
2026-10-30 17:59:41 +08:00
MicroBlock 93ba65baa9 im: recognize a card by the message, not by its placeholder text
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.
2026-10-30 16:05:15 +08:00
MicroBlock cda7a4e262 lark: hand a card's pictures back as images
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.
2026-10-30 16:05:14 +08:00
MicroBlock 7b0d61b4c1 im: read a card instead of the placeholder that stands in for it
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.
2026-10-30 15:49:17 +08:00
MicroBlock aa5470b319 connection: own the browser surface when DSH_CONNECTION_OPEN=1
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.
2026-10-30 15:43:36 +08:00
MicroBlock c9cf77d9ee im: keep a turn's material and its window inside its own conversation
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.
2026-10-29 23:38:07 +08:00
MicroBlock 202774002e im: embed pictures in the QQ markdown body, and stop stranding a stream
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 `![alt #Wpx #Hpx](…)` 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.
2026-10-29 17:25:03 +08:00
MicroBlock e3969283e5 docs(im): keep the IM Agent Notes current with the shipped plugin set
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.
2026-10-29 14:44:43 +08:00
MicroBlock fbc6e74432 docs(vendor): list the IM local modifications
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.
2026-10-29 13:14:44 +08:00
MicroBlockandShigma 3f3c12167d docs(im): record the IM decisions
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>
2026-10-29 13:14:43 +08:00
MicroBlock a9cc207901 docs(im): record the IM persistence changes
`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.
2026-10-29 13:14:43 +08:00
MicroBlock 9e978dc5c6 docs(im): regenerate the catalogs and page the IM subsystem
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.
2026-10-29 13:14:42 +08:00
MicroBlockandShigma c45f24eb32 build(im): wire the IM packages into the workspace and generators
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>
2026-10-29 13:14:42 +08:00
MicroBlockandShigma c0202b9599 feat(im): ship IM as an experimental bundle
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>
2026-10-29 13:14:41 +08:00
MicroBlock 3a1494970d feat(im): add the chat command plugin
`/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.
2026-10-29 13:14:40 +08:00
MicroBlockandShigma 63c35177bc feat(im): host IM intake, sessions and publication
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>
2026-10-29 13:14:40 +08:00
MicroBlock 290da46bd8 feat(vendor): add the QQ adapter
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.
2026-10-29 13:14:39 +08:00
MicroBlock caaebae29a feat(vendor): add the Feishu adapter
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`.
2026-10-29 13:14:38 +08:00
MicroBlock 76ed955fff feat(vendor): add the IM core engine
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.
2026-10-29 13:14:37 +08:00
MicroBlockandShigma aab268a5c6 feat(vendor): replace satori-element with the typed element vocabulary
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>
2026-10-29 13:14:37 +08:00
MicroBlock 2e0ea2c172 build(vendor): add the element, HTTP and fetch-file packages IM renders through
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

No files matched your search

+6
View File
@@ -2389,6 +2389,9 @@
"process/2026-09-23-section-keyed-translation-pairing-records.i18n.yaml": "sha256:ec07cef0e6b9628c81ae62ff772821b7dc659c07bd01a451a561b37a96f423e4",
"process/2026-09-23-section-keyed-translation-pairing-records.md": "sha256:990d5c3c0d3fbcf43327997ece13879119a1e36a9841f7797a8a2a675c932f57",
"process/2026-09-23-section-keyed-translation-pairing-records.zh.md": "sha256:befcb9915ff0020d1153d596ed85b0a09a7cac6541ec7af0ac93ab96dc62263f",
"process/2026-10-20-weighted-approval-status-gate-with-check-run-label.i18n.yaml": "sha256:138c15baa1593ffdce5222f93ceab46ad97fa9bcc2c96586b1832cd4d83cf975",
"process/2026-10-20-weighted-approval-status-gate-with-check-run-label.md": "sha256:88d3493b2236f92c5195f8e81fca2d58e2c102bcdd0a2fd8111de23197bce226",
"process/2026-10-20-weighted-approval-status-gate-with-check-run-label.zh.md": "sha256:8ea2cae25eee736d59f21ee5160184893f91b32d690d773c4d55e0df24cbe828",
"simplification/2026-06-19-drop-mutable-session-summary.i18n.yaml": "sha256:43fe5daadc1491f94a3e34595182cad1591f76b64e1f13b48811b80fd7e53b94",
"simplification/2026-06-19-drop-mutable-session-summary.md": "sha256:01647a5a14aa4e195328d4d39c6d80eb0723739e5a543115314716b280a93560",
"simplification/2026-06-19-drop-mutable-session-summary.zh.md": "sha256:22389e0c29158b1f7a5a43ed6073f8795bb87cf51c04cf83be055359cd65c9f5",
@@ -2770,6 +2773,9 @@
"testing/2026-09-12-connection-and-compaction-fixture-preconditions.i18n.yaml": "sha256:1740bca0aafb2f91dad66b870917a78ec8d50243b20f21f872cc005229231b65",
"testing/2026-09-12-connection-and-compaction-fixture-preconditions.md": "sha256:959da865d7740bfde03dcc4a5a1bd67e80c7595807e035d6499af738a6efcde4",
"testing/2026-09-12-connection-and-compaction-fixture-preconditions.zh.md": "sha256:c00055c634f579ee80e910cc89de742ce1db90e43b407356f9fdc12a7ccab66d",
"testing/2026-09-14-desktop-installed-update-materials.i18n.yaml": "sha256:f45fe477693dc4d9dc2a79537cef0c2b0cb930fecc5154e62b96645cd1a39ce8",
"testing/2026-09-14-desktop-installed-update-materials.md": "sha256:b35f7ffaa8b1e6322d0ac95253430aa5004e4ea2fc94691b604c1660c9dbbb18",
"testing/2026-09-14-desktop-installed-update-materials.zh.md": "sha256:f1ea8825dc63336ef960815681f40a1e02dccf53611893f5c425682e9ae64f48",
"testing/2026-09-26-web-conversation-clock-fixture-day.i18n.yaml": "sha256:1e57f76a30c07fd343ce22be7ea9454e5beb8cc3979b7709d2f55423b1c7d2c0",
"testing/2026-09-26-web-conversation-clock-fixture-day.md": "sha256:a918c35b1b4e69b766b02883218bd1280d161392c4ca2f359d45dbe1cbfcfce8",
"testing/2026-09-26-web-conversation-clock-fixture-day.zh.md": "sha256:910eff4bae8075dd576726ccb3bc7cfd1f8bb5a970c543e1b9c986494a09749f",
@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/archived/process/2026-10-20-weighted-approval-status-gate-with-check-run-label.md
2026-10-20-weighted-approval-status-gate-with-check-run-label.md: 35f228dbb99a0dbaf4c6af40cf0e61edd05eb3ed
2026-10-20-weighted-approval-status-gate-with-check-run-label.zh.md: 22b194cd41893499ad5b3fc33a8cbc6b4d8b9975
@@ -1,6 +1,7 @@
# Agent Note: Weighted approval keeps its commit status gate and publishes the decision label from an App
Status: implemented
Archived: 2026-11-18
English | [中文](2026-10-20-weighted-approval-status-gate-with-check-run-label.zh.md)
@@ -1,6 +1,7 @@
# Agent Note: Weighted approval 保留 commit status 门禁,并由 App 发布决策标签
Status: implemented
Archived: 2026-11-18
[English](2026-10-20-weighted-approval-status-gate-with-check-run-label.md) | 中文
@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/archived/testing/2026-09-14-desktop-installed-update-materials.md
2026-09-14-desktop-installed-update-materials.md: 7270767033f7701b483fbf4c544b0b88ee08199c
2026-09-14-desktop-installed-update-materials.zh.md: 055e1af865ab0ec8f1cc21d9601c5d33083b8a2d
@@ -1,6 +1,7 @@
# Agent Note: Isolate installed-update materials from releases and user data
Status: implemented
Archived: 2026-11-26
English | [中文](2026-09-14-desktop-installed-update-materials.zh.md)
@@ -1,6 +1,7 @@
# Agent Note: 将安装版更新物料与发布及用户数据隔离
Status: implemented
Archived: 2026-11-26
[English](2026-09-14-desktop-installed-update-materials.md) | 中文
@@ -24,8 +24,8 @@
en: 26e4b71366bebd1b
zh: 10598e12b28c586e
/agent-note-cooperative-tool-cancellation-at-the-registry-boundary/verification:
en: 983da6d0c09f5c10
zh: ca7c86117a1a4d5f
en: 4911064d1a23aaa8
zh: 59196f7291618eda
/agent-note-cooperative-tool-cancellation-at-the-registry-boundary/alternatives-considered:
en: c4d86feb135d2ac4
zh: 67c56c0bc2213949
@@ -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.
@@ -46,7 +46,7 @@ Status: implemented
## 验证
[`execution-signal-types.spec.ts`](../../../../packages/core/tools/tests/execution-signal-types.spec.ts) 证明必填的精确信号类型、观察者与工具的只读视图、环绕调度可替换但不可删除的视图,以及 `defineTool()` 推断。[`tools.spec.ts`](../../../../packages/core/tools/tests/tools.spec.ts) 覆盖进入时已中止的物化与阶段跳过、策略和包装层竞态、工具主体调用分类、调用方信号融合、错误优先级、上下文保留和完全停稳。[`tool-calls.spec.ts`](../../../../packages/core/agent-loop/tests/tool-calls.spec.ts) 与 [`contract-regressions.spec.ts`](../../../../packages/core/agent-loop/tests/contract-regressions.spec.ts) 覆盖为未调度的同批调用补齐持久化结果。[`ptc.spec.ts`](../../../../packages/core/tool-executor-ptc/tests/ptc.spec.ts) 和第一方集成测试覆盖显式转发,[`timeout-policy.spec.ts`](../../../../packages/guard/timeout-policy/tests/timeout-policy.spec.ts) 保持超时归属。
[`execution-signal-types.spec.ts`](../../../../packages/core/tools/tests/execution-signal-types.spec.ts) 证明必填的精确信号类型、观察者与工具的只读视图、环绕调度可替换但不可删除的视图,以及 `defineTool()` 推断。[`tools.spec.ts`](../../../../packages/core/tools/tests/tools.spec.ts) 覆盖进入时已中止的物化与阶段跳过、策略和包装层竞态、工具主体调用分类、调用方信号融合、错误优先级、上下文保留和完全停稳。[`tool-calls.spec.ts`](../../../../packages/core/agent-loop/tests/tool-calls.spec.ts) 与 [`contract-regressions.spec.ts`](../../../../packages/core/agent-loop/tests/contract-regressions.spec.ts) 覆盖为未调度的同批调用补齐持久化结果。[`ptc.spec.ts`](../../../../packages/core/tool-registry-ptc/tests/ptc.spec.ts) 和第一方集成测试覆盖显式转发,[`timeout-policy.spec.ts`](../../../../packages/guard/timeout-policy/tests/timeout-policy.spec.ts) 保持超时归属。
任何注册表测试都无法证明任意第三方同进程代码会观察信号或在有界时间内停止。各能力的测试仍需在拥有相应副作用的边界证明取消与完全停稳。
@@ -15,8 +15,8 @@
en: 6af228b03e5e533f
zh: 276a522af6be5d7a
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/decision/one-module-system-one-plugin-governor:
en: 5f5daec51b20db77
zh: e4d6f78fc1b4b835
en: 51df5a30c9337f22
zh: f4533cd731c86890
/agent-note-client-plugin-loading-lazy-factories-cordis-lifecycle-and-hot-reload/decision/combo-external-script-arrival-and-source-maps:
en: 04b9f0138b5d2288
zh: 2a749db57f6e7a10
@@ -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`.
@@ -34,7 +34,7 @@ Web 内核保持不依赖框架,也不 import 任何动态包实体。Modules
浏览器复刻 host 侧的分工。`dsh-client-modules`(`ClientModuleSystem`)坐上 host 侧由 Node 内部 ESM loader 占据的模块系统席位;同一份 vendored `@cordisjs/plugin-loader` 在两侧都坐治理席。二者的分界线一句话说尽:**模块系统拥有模块身份与字节——代码怎么到达、怎么登记、怎么变成导出内容;Loader 拥有插件生命周期——插件何时挂载、等待什么、如何拆除。**
`ClientModuleSystem` 是一张 lazy CJS 表。执行 bundle 只**登记**其 factory——入口调用 `window.__ModuleLoader__.load({ id, factory })`,chunk 还会提供其生成文件名——此外什么都不发生。JavaScript 模块体副作用位于 factory 闭包里,在物化时运行:物化即该 id 的首次 `require`/import,此后记忆化。Import 和 prefetch 会先递归登记已声明的动态请求,再登记消费者;随后 factory 会同步物化任何已登记但尚未物化的请求。可调用的 `require` 解析同步模块表请求;其 `require.async` 操作返回 Promise,负责加载、登记并物化一个包内 chunk。共享 tsdown 预设把源码中针对包内 chunk 的 `import()` 表达式编译到这个独立操作。受支持的产物必须自包含:入口或 chunk 不能同步 require 另一个相对 `client*.js` 产物。模块表按固定分支顺序解析:seed word → 记忆化记录 → graph row classic-script 登记 → 已登记 factory 物化 → 大声抛错。Modules factory 是自举例外:HTML facade 先物化它,构造过程再把同一 exports 直接写入记忆化表。最后这一抛是构建期纯度门禁在运行时的镜像。系统还保管逐模块簿记——owner 身份、可选且不求值的元信息函数、观测到的 require 边——并暴露 HMR(热模块替换)需要的两个动词:`prefetch(id)`(登记所请求的动态 factory 和本 row 自身的 factory;并发到达共享一个任务)与 `invalidate(id)`(推进 owner 代次并丢弃非 bootstrap 包的入口和 chunk factory 及记录,让下次到达重新加载它们)。在旧代次捕获的 chunk 请求不能填充新代次。
`ClientModuleSystem` 是一张 lazy CJS 表。执行 bundle 只**登记**其 factory——入口调用 `window.__ModuleLoader__.load({ id, factory })`,chunk 还会提供其生成文件名——此外什么都不发生。JavaScript 模块体副作用位于 factory 闭包里,在物化时运行:物化即该 id 的首次 `require`/import,此后记忆化。Import 和 prefetch 会先递归登记已声明的动态请求,再登记消费者;随后 factory 会同步物化任何已登记但尚未物化的请求。可调用的 `require` 解析同步模块表请求;其 `require.async` 操作返回 Promise,负责加载、登记并物化一个包内 chunk。共享 tsdown 预设把源码中针对包内 chunk 的 `import()` 表达式编译到这个独立操作。factory 也可以同步 require 本包已登记的 chunk;chunk 登记与请求的规则见[包内分片之间的依赖](2026-11-26-package-local-chunk-dependencies.zh.md)。模块表按固定分支顺序解析:seed word → 记忆化记录 → graph row classic-script 登记 → 已登记 factory 物化 → 大声抛错。Modules factory 是自举例外:HTML facade 先物化它,构造过程再把同一 exports 直接写入记忆化表。最后这一抛是构建期纯度门禁在运行时的镜像。系统还保管逐模块簿记——owner 身份、可选且不求值的元信息函数、观测到的 require 边——并暴露 HMR(热模块替换)需要的两个动词:`prefetch(id)`(登记所请求的动态 factory 和本 row 自身的 factory;并发到达共享一个任务)与 `invalidate(id)`(推进 owner 代次并丢弃非 bootstrap 包的入口和 chunk factory 及记录,让下次到达重新加载它们)。在旧代次捕获的 chunk 请求不能填充新代次。
vendored Loader 经其 `internal` 约定消费模块系统——唯一调用点是 `tree.import`——并拥有一切 entry 形状的事务:entry 创建、fiber 经 cordis 服务等待的激活(注入的服务未就位即保持 PENDING,服务 provide 时级联激活)、update/refresh、拆除。治理代码按 vendor 政策与 host 侧逐字节相同。浏览器化是壳 vite 配置里的编译期映射:一个 `node:module` stub 别名加若干 `process.*` define,使 `ModuleLoader.fromInternal()` 返回 undefined——这正是留给壳来填的空槽。模块系统挂载为 `ctx.modules`。
@@ -9,14 +9,14 @@
en: 77713a6c0d15207e
zh: 2dc30d4c0182d8ba
/agent-note-compiler-independent-typert-type-model/decision:
en: 9ecb064f733f9f1b
zh: 471aee71053174cd
en: ef283e9012a9484e
zh: a28d58fc8b21c51b
/agent-note-compiler-independent-typert-type-model/verification-contract:
en: c02d3f09e54f9a32
zh: c14c15ffb7316b07
en: 7059790531ffef8a
zh: cef77a95dac9ba4c
/agent-note-compiler-independent-typert-type-model/alternatives-considered:
en: fa503dcfaa6f438f
zh: 26052212a124e133
/agent-note-compiler-independent-typert-type-model/consequences:
en: e1022cf9523fb28e
zh: 01dfb764fb98de0d
en: 2dc2e12298953ac8
zh: 54666b9d1f92dccd
@@ -24,7 +24,7 @@ PackageModel recognizes Cordis services, events, `@typert object` reference obje
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.
@@ -24,7 +24,7 @@ PackageModel 识别 Cordis service、event、`@typert object` 引用对象和 `@
包产物发布仍通过 package exports 采用显式 opt-in。`WorkspaceTypertGenerator` 仅在被调用时校验所请求 face 的根目录产物协议:host face 必须通过面向用户的 subpath `package/typert` 暴露 `package/lib/typert.host.{js,d.ts}`,client face 必须通过 `package/client/typert` 暴露 `package/lib/typert.client.{js,d.ts}`;它不会修改这些 exports。后续的 [Typert Remote 设计](2026-08-02-typert-remote-method-calls.zh.md) 为根目录 build、typecheck、lint 与文档类型检查增加了全仓 Host 约定 pass。对于已 opt-in 的 Host 包,该 pass 会在消费方解析两者之前生成本地反射产物与严格的 Host-for-Client `/remote` 约定。生成的本地声明将 `TYPERT` 类型保持为 `unknown`,因此业务包不依赖注册表。
构建期的 `CordisCatalogProjector` 一次消费分析后的 `FaceModel` 与 `TypeGraph`,生成 `docs/cordis-catalog/events.md`、`docs/cordis-catalog/services.md`,以及为 `tool-cordis` 提交的静态 `SERVICE_API`、`EVENT_API` 和 `TYPE_API` catalog。`tool-cordis` 读取该静态 catalog,运行时不依赖 `ctx.typert`。[`dsh-typert-loader`](../../../../packages/typert/loader/README.zh.md) 与注册表仍是独立的运行时路径:loader 监听 Cordis Loader 配置项生命周期事件,导入显式发布的 `./typert` host 产物,并通过 `ctx.typert` 注册;两者都不是当前 `cordis_inspect` catalog 的数据源。
构建期的 `CordisCatalogProjector` 一次消费分析后的 `FaceModel` 与 `TypeGraph`,生成 `docs/cordis-catalog/events.md`、`docs/cordis-catalog/services.md`,以及为 `cordis-host-runner` 检查提供方提交的静态 `SERVICE_API`、`EVENT_API` 和 `TYPE_API` catalog。这些提供方读取该静态 catalog,运行时不依赖 `ctx.typert`。[`dsh-typert-loader`](../../../../packages/typert/loader/README.zh.md) 与注册表仍是独立的运行时路径:loader 监听 Cordis Loader 配置项生命周期事件,导入显式发布的 `./typert` host 产物,并通过 `ctx.typert` 注册;两者都不是当前 `cordis_inspect` catalog 的数据源。
## Verification contract
@@ -34,7 +34,7 @@ PackageModel 识别 Cordis service、event、`@typert object` 引用对象和 `@
边界用例固定同 face 与跨 face 的显式包导入、跨 face 命名 re-export、精确 export alias、qualified `import()` link 和全局 `@types` External 归属,并拒绝 package 自有 TypeScript 诊断、相对路径越界、`package.json#exports` 之外的引用,以及尚无模型 target 的跨 face namespace re-export。interface declaration merging 显式保留每个 authored part,无法无损表示的其他 merge 失败。
Zod emitter 对支持的节点和各类 literal 逐类执行成功与失败 parse,对不支持的节点逐类断言明确的 `TypertEmitError`。Emitter fixture 对生成的 Zod JavaScript 与 `.d.ts` 文本做快照,执行每个 schema factory,并对声明做类型检查。`dsh-typert-registry` 测试固定原子注册、首次使用物化、成功结果缓存、factory 失败后重试、查询、JSON Schema 和 effect 撤销,`dsh-typert-loader` 测试还证明延迟挂载、卸载及未完成 dynamic import 的释放行为。真实 `dsh-tools` 纵切从模型生成 contribution,经运行时注册表加载后,将其服务、事件与关联类型记录同已提交的静态 `SERVICE_API`、`EVENT_API` 和 `TYPE_API` 对照。全仓 projector 测试重新生成两份 Cordis catalog 文档与 `tool-cordis` API catalog,并要求三份文本同已提交产物逐字节一致。
Zod emitter 对支持的节点和各类 literal 逐类执行成功与失败 parse,对不支持的节点逐类断言明确的 `TypertEmitError`。Emitter fixture 对生成的 Zod JavaScript 与 `.d.ts` 文本做快照,执行每个 schema factory,并对声明做类型检查。`dsh-typert-registry` 测试固定原子注册、首次使用物化、成功结果缓存、factory 失败后重试、查询、JSON Schema 和 effect 撤销,`dsh-typert-loader` 测试还证明延迟挂载、卸载及未完成 dynamic import 的释放行为。真实 `dsh-tools` 纵切从模型生成 contribution,经运行时注册表加载后,将其服务、事件与关联类型记录同已提交的静态 `SERVICE_API`、`EVENT_API` 和 `TYPE_API` 对照。全仓 projector 测试重新生成两份 Cordis catalog 文档与 `cordis-host-runner` API catalog,并要求三份文本同已提交产物逐字节一致。
## Alternatives considered
@@ -50,6 +50,6 @@ Zod emitter 对支持的节点和各类 literal 逐类执行成功与失败 pars
新增生成目标或静态检查可复用同一 TypeGraph,业务类目也可在 PackageModel 上扩展,而无需再次解析 AST。保留计算前类型和独立 face 的代价是模型比打平后的 schema 更复杂,emitter 必须显式声明支持范围并对缺失能力失败。
包级显式 opt-in 使产物发布与 exports 由各包自行管理。仓库编排仍可为每个已 opt-in 的包运行全仓 Host 约定 pass;该 pass 仍由后续 Remote Gateway Agent Note 负责说明。静态 Cordis catalog 可从标准模型复现,同时不把 `tool-cordis` 与运行时注册表状态耦合。`ctx.typert` 只反映当前运行时中已挂载的产物;对于消费方物化后仍持有的 Zod 实例,卸载流程无法控制。
包级显式 opt-in 使产物发布与 exports 由各包自行管理。仓库编排仍可为每个已 opt-in 的包运行全仓 Host 约定 pass;该 pass 仍由后续 Remote Gateway Agent Note 负责说明。静态 Cordis catalog 可从标准模型复现,同时不把检查提供方与运行时注册表状态耦合。`ctx.typert` 只反映当前运行时中已挂载的产物;对于消费方物化后仍持有的 Zod 实例,卸载流程无法控制。
普通 Host 与 Remote 产物复用此模型,为每个端点生成一份静态方法 spec。每个参数都有从同一 checker 解析后类型模型派生的普通 `codec` 和 `strictCodec` 变体;分析过程与模型均不携带逐方法输入策略。纯 factory 返回惰性 info 实例,其直接方法索引与描述符列表共享对象;既有 Registry 保留这些描述符,而 `TYPERT_REMOTE.methods` 提供精确静态类型。[统一 Typert/Remote 元数据 note](../../proposed/architecture/2026-09-20-unified-typert-remote-metadata.zh.md)记录该交付机制及尚未完成的下游适配。声明与编译面隔离规则保持不变;独立 Program 和进程不共享对象身份。
@@ -12,11 +12,11 @@
en: a15c7c13f167e5ac
zh: a15c7c13f167e5ac
/agent-note-client-shell-layering-and-dynamic-package-boundaries/decision/layers-and-build-forms:
en: e0d6260cc782acb9
zh: 2ca2418d2b97bc03
en: 4357a7d881fdcb99
zh: d90fd396f9dd6c2c
/agent-note-client-shell-layering-and-dynamic-package-boundaries/decision/shared-module-requests:
en: 96661da17622132a
zh: dab3424093130c2f
en: d2531750bbe81189
zh: 130a16eca6e07c14
/agent-note-client-shell-layering-and-dynamic-package-boundaries/decision/parser-preloading-and-react-handoff:
en: 4b503618b271fc28
zh: e2148f44efa769d2
@@ -24,8 +24,8 @@
en: 47c332b836c2933b
zh: ed190dbb14b98911
/agent-note-client-shell-layering-and-dynamic-package-boundaries/alternatives-considered:
en: 2257178f8f474757
zh: 7da85b5899b91520
en: 265c8e910d525077
zh: 55ff5170dcc1c07c
/agent-note-client-shell-layering-and-dynamic-package-boundaries/consequences:
en: c7653b12059aebd7
zh: a79b63f28d18f8c4
en: c3237ed7ae58fc48
zh: e9c6095705490622
@@ -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)).
@@ -22,17 +22,18 @@ Client npm 依赖区段描述安装和开发关系,但不能可靠描述 bundl
| --- | --- | --- | --- |
| Web 编译壳 | `apps/web` | 拥有 `index.html`、Vite 配置、dist chunk 和静态资源 | 从已构建 package export 组装最终浏览器产物 |
| 启动内核 | `packages/client/web` | 拥有纯 DOM 启动页、模块系统接线、Cordis settle 和 renderer handoff | `clientShell` ESM 入口;无 `dsh.client` row |
| 静态装配库 | Cordis、`ui-primitives`、`ui-slots` | 提供共享模块身份和直接实体 API | Manifest `lib/index.js`,共享 import 由 Vite 组装;不是 Loader entry |
| 外壳预置模块 | React、Cordis 及选定的第三方库 | 提供共享模块身份 | 由 Vite 打包并预置进模块表;不是 Loader entry |
| 静态装配库 | `client-store` | 提供共享模块身份和直接实体 API | Manifest `lib/index.js`,共享 import 由 Vite 组装,并预置进模块表;不是 Loader entry |
| 模块自举包 | `packages/client/modules` | 提供 client 模块表及其 Cordis wrapper | 带一个普通 `lib/client.js` 的动态包;host 提前送达其 factory |
| 动态 client 包 | connection、`ui-renderer`、主题和功能插件 | 通过 Cordis service、slot 和 effect 参与应用 | 声明 `dsh.client`,产出自注册 `lib/client.js`,并保留 host graph entry |
| 动态 client 包 | connection、`ui-renderer`、主题、功能插件,以及 `ui-slots`、`ui-primitives`、`ui-dockkit` | 通过 Cordis service、slot 和 effect 参与应用;后三个包的 `/client` 实体导出是会逐步缩减的历史例外 | 声明 `dsh.client`,产出自注册 `lib/client.js`,并保留 host graph entry |
`packages/client/web` 把 Cordis 保持为 matching peer 与开发依赖,并把 modules 和静态 UI 包作为开发期编译输入。`apps/web` 消费已构建 package export,不通过 alias 读取 workspace 源码。
`packages/client/web` 把 Cordis 保持为 matching peer 与开发依赖,并把 modules 和 `client-store` 作为开发期编译输入。`apps/web` 消费已构建 package export,不通过 alias 读取 workspace 源码。
`staticLinked` 预设把 `lib/index.js` 输出为普通 ESM,保留所有裸 import 与动态 import 交给 Vite 解析、去重和拆分,并增加一个导出 `__$dsh_client_module_manifest`,其 factory 返回库自身的导出。让 factory 推迟执行库本体并没有实际收益:第三方 import 在模块加载时已经求值,外壳也在启动时登记这些库。CSS import 成为延迟求值的元信息资源。[模块元信息决定](2026-11-05-client-module-metadata.zh.md)定义资源所有权;静态库不采用动态插件的私有依赖打包策略。
`staticLinked` 预设把 `lib/index.js` 输出为普通 ESM,保留所有裸 import 与动态 import 交给 Vite 解析、去重和拆分,并增加一个导出 `__$dsh_client_module_manifest`,其 factory 返回库自身的导出。让 factory 推迟执行库本体并没有实际收益:第三方 import 在模块加载时已经求值,外壳也在启动时登记这些库。CSS import 成为延迟求值的元信息资源。[模块元信息决定](2026-11-05-client-module-metadata.zh.md)定义资源所有权;静态库不采用动态插件的私有依赖打包策略。`client-store` 使用该预设。
### 共享模块请求
动态浏览器 bundle 会隐式 external 统一基座:`PLATFORM_MODULES` 命名由外壳播种的 React、Cordis、选定的第三方库和静态 UI 身份,`PRELOADED_CLIENT_EXTERNALS` 则为必须先于 shell 启动到达的动态身份预留,当前为空。包只在精确请求基座外实体时使用 `dsh.client.external`。纯类型 import 会被擦除,不产生请求;基座外的第三方实现库保留为 bundle 私有内容。共享第三方库使用外壳声明的版本,不为单个插件协商版本;只有测量确认外壳与随包插件 bundle 的总体积减少,才将库纳入基座。
动态浏览器 bundle 会隐式 external 统一基座([共享模块表](../../../../packages/client/web/README.zh.md#the-shared-module-table)):外壳播种的 React、Cordis、选定的第三方库和 `client-store`,以及 `immediately` row 先于其他插件登记的 `ui-slots`、`ui-primitives`、`ui-dockkit`;`PRELOADED_CLIENT_EXTERNALS` 则为必须先于 shell 启动到达的动态身份预留,当前为空。包只在精确请求基座外实体时使用 `dsh.client.external`。纯类型 import 会被擦除,不产生请求;基座外的第三方实现库保留为 bundle 私有内容。共享第三方库使用外壳声明的版本,不为单个插件协商版本;只有测量确认外壳与随包插件 bundle 的总体积减少,才将库纳入基座。
请求只有两种提供方:
@@ -69,7 +70,7 @@ Theme 的 Host 贡献会前置到 index 收集顺序。head 中的 CSS 选择初
## Alternatives considered
**立即把所有 client 包改为动态插件。** `ui-primitives` 与 `ui-slots` 仍提供同步实体,且没有独立 service 或 slot 生命周期;只加 manifest 声明不会移除这些 import。
**立即把所有 client 包改为动态插件。** `ui-primitives` 与 `ui-slots` 仍提供同步实体,且没有独立 service 或 slot 生命周期;只加 manifest 声明不会移除这些 import。`ui-slots`、`ui-primitives`、`ui-dockkit` 改为带 `immediately: true` 的动态插件包,它们的实体导出仍然保留,是会逐步缩减的历史例外([决定](2026-11-27-client-packages-as-immediately-dynamic-plugins.zh.md))。
**为 modules 生成单独的 `client-static.js`。** 该包仍是动态图 row 和 Cordis 插件,只有 factory 提前到达。第二份产物会把宿主策略编码进文件名,并让同一源码产生两个运行期产品。
@@ -87,4 +88,4 @@ Theme 的 Host 贡献会前置到 index 收集顺序。head 中的 CSS 选择初
外壳消费已构建 `lib/` 产品,因此在相关 build 或 watcher 运行前,源码与浏览器产物可能漂移。仅源码 typecheck 通过不能证明实际服务的应用使用同一份代码。
两个静态 UI 库仍是明确例外。把其中任一项转换为动态包时,必须在同一变更中把全部实体消费者迁移到 service 或 slot,并从静态 seed 删除对应身份。
`client-store` 是静态链接的 Client 库,由外壳播种;store service 将是一个独立的包,而不是对这个包的转换。`ui-slots`、`ui-primitives` 和 `ui-dockkit` 是带 `immediately: true` 的动态插件包([决定](2026-11-27-client-packages-as-immediately-dynamic-plugins.zh.md))。
@@ -9,8 +9,8 @@
en: 5a39322836f06cd9
zh: 7a7ab48fe38a5788
/agent-note-package-and-update-the-electron-desktop-application/decision:
en: b4d04297a7abae71
zh: 9b770c81c2267869
en: 39ba384f2df52828
zh: 06b9c61964a99537
/agent-note-package-and-update-the-electron-desktop-application/ownership:
en: 50e16f318c5d0e1a
zh: 84b2ba8f1a6932b0
@@ -18,17 +18,17 @@
en: 4990a8ba137e28f0
zh: b12f68d30a5d18fa
/agent-note-package-and-update-the-electron-desktop-application/installation-and-resolution:
en: 29def175ab33b7d6
zh: 87e55ec28c20c7c1
en: 22cae5f50a2cc3ed
zh: e99e7e61351e983e
/agent-note-package-and-update-the-electron-desktop-application/updates-and-recovery:
en: 61a02870beb953ec
zh: 205ecce330959e9a
en: 028b8146e5fe16f2
zh: 8835acb61eee8916
/agent-note-package-and-update-the-electron-desktop-application/security-and-release-policy:
en: 5faaa53b58121311
zh: e1c3fc8d21a27d1a
/agent-note-package-and-update-the-electron-desktop-application/implementation:
en: 041a6d35ed61b149
zh: 617c6b90a6f4fa4d
en: 9d435fecbb539d57
zh: 35e24ba36e3dfca9
/agent-note-package-and-update-the-electron-desktop-application/alternatives-considered:
en: 10b1b0a8afe38def
zh: 0a4df988f72b8d11
@@ -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.
## Alternatives considered
@@ -24,7 +24,7 @@ Electron 拥有 `.dsh/profiles/desktop` 保留 profile。[内置运行时决策]
一个 Desktop 发布号同时标识 Electron 产物及其精确的 `@deepseek-ai/dsh` 与 `@deepseek-ai/dsh-desktop-host` 依赖。发布不能在构建或运行时选择不同的核心版本。因此,即使壳代码没有变化,更新 dsh 也必须产生新的 Electron 发布。
Desktop Host 为保留 profile 提供共享 Web 插件管理器,并通过启动器信息提供内置 pnpm。CLI 保留 `desktop` 名称的所有大小写变体,并拒绝针对它的启动、配置 dump 和插件管理请求。Electron 在 profile 恢复或 Host 启动前获取进程生命周期单实例锁;后续启动只会聚焦或重建主窗口,不会接触 profile 状态。
Desktop Host 为保留 profile 提供共享 Web 插件管理器,并通过启动器信息提供内置 pnpm。CLI 保留 `desktop` 名称的所有大小写变体,并拒绝针对它的启动、配置 dump 和插件管理请求。Electron 在 profile 恢复或 Host 启动前获取按其 `userData` 目录区分的进程生命周期单实例锁;使用相同 `userData` 的后续启动只会聚焦或重建主窗口,不会接触 profile 状态。`userData` 不同的应用(例如已安装应用与 `dev:desktop`)可以同时运行在同一个 profile 上。
## 归属
@@ -63,7 +63,7 @@ Desktop Host 为保留 profile 提供共享 Web 插件管理器,并通过启
共享 Web 插件管理器负责 profile 包操作。Electron 保留启动准备和原生恢复;[Web 薄壳决策](2026-09-10-desktop-web-wrapper.zh.md)负责这一职责划分。
Electron 进程生命周期锁是 Desktop 的权威所有者。profile 准备和原生恢复使用记录 Electron PID 的排他锁;存活的所有者阻止竞争操作,失效 PID 可被回收。Web 包操作使用共享插件管理器的锁。
在共享同一 `userData` 目录的 Desktop 进程之间,Electron 进程生命周期锁是权威所有者。profile 准备和原生恢复使用记录 Electron PID 的排他锁;存活的所有者阻止竞争操作,失效 PID 可被回收。Web 包操作使用共享插件管理器的锁。
核心物化、首次启动、插件安装和共享模块解析遵循[内置运行时决策](2026-09-08-desktop-bundled-runtime-and-external-plugins.zh.md)。实际 Host 启动时会组合已启用且提供 `dsh.client` 代码的桌面插件。
@@ -73,7 +73,7 @@ Electron 更新只使用一个 `electron-updater` 发布流和签名 `electron-b
[立即显示窗口参考](../../../../apps/desktop/README.zh.md)负责本地加载页、直接启动 Host 和主窗口恢复。profile 协调遵循[内置运行时决策](2026-09-08-desktop-bundled-runtime-and-external-plugins.zh.md)。
`DSH_DESKTOP_AUTO_UPDATE_ENV` 默认为测试部署,也可以选择生产部署,并同时决定目标专用的 generic-provider URL 与 COS 目标。发布自动化通过 `DOWNLOAD_TEST_ORIGIN` 提供测试 HTTPS origin,并通过 `DOWNLOAD_TEST_COS_BUCKET` 或 `DOWNLOAD_PROD_COS_BUCKET` 提供各部署的 bucket;可变的测试路由与 COS 存储身份不写入源码,部署基础设施变更时无需发布新代码,而公开的生产 origin 仍固定。打包只解析公开更新 URL、禁止 electron-builder 发布、从子进程环境中删除每个 COS 凭据字段,并且只有在 electron-builder 以及每个签名或公证 hook 成功后才写入完成记录。目标上传还必须提供所选 bucket,随后会先要求完成记录、根 dsh 版本、Desktop 版本、根据所选渠道确定的元数据、产物名称、大小与 SHA-512 全部一致,再读取所选凭据或发送数据。它先上传不可变且带版本的更新载荷与所有独立 blockmap,最后替换 electron-builder 生成的频道元数据,并且不会删除历史对象。所选渠道决定元数据名称:`stable.yml` 或 `nightly.yml`,macOS 在扩展名前加 `-mac`;版本后缀不决定渠道。NSIS 把 blockmap 嵌入已签名的可执行文件,macOS ZIP 则使用独立 blockmap;两者都让 electron-updater 在平台支持时只下载变化的数据块,而应用替换与本地 pnpm 包操作仍是两个独立操作。
`DSH_DESKTOP_AUTO_UPDATE_ENV` 默认为测试部署,也可以选择生产部署,并同时决定目标专用的 generic-provider URL 与 COS 目标。发布自动化通过 `DOWNLOAD_TEST_ORIGIN` 提供测试 HTTPS origin,并通过 `DOWNLOAD_TEST_COS_BUCKET` 或 `DOWNLOAD_PROD_COS_BUCKET` 提供各部署的 bucket;可变的测试路由与 COS 存储身份不写入源码,部署基础设施变更时无需发布新代码,而公开的生产 origin 仍固定。打包只解析公开更新 URL、禁止 electron-builder 发布、从子进程环境中删除每个 COS 凭据字段,并且只有在 electron-builder 以及每个签名或公证 hook 成功后才写入完成记录。目标上传还必须提供所选 bucket,随后会先要求完成记录、根 dsh 版本、Desktop 版本、根据所选渠道确定的元数据、产物名称、大小与 SHA-512 全部一致,再读取所选凭据或发送数据。它先上传不可变且带版本的更新载荷与所有独立 blockmap,最后替换 electron-builder 生成的频道元数据,并且不会删除历史对象。所选渠道决定元数据名称:`stable.yml` 或 `nightly.yml`,macOS 在扩展名前加 `-mac`;版本后缀不决定渠道。NSIS 把 blockmap 嵌入已签名的可执行文件,macOS ZIP 则使用独立 blockmap;两者都让 electron-updater 在平台支持时只下载变化的数据块,而应用替换与本地 pnpm 包操作仍是两个独立操作;默认 `stable` 锁定、`settings.json` 版本 `"1"`、清单来源请求头以及单包多渠道 CI 投递由[渠道收敛与解耦发布决策](2026-11-25-desktop-channel-convergence-and-decoupled-publishing.zh.md)负责。
测试发布必须从平台 dotenv 文件提供 `DOWNLOAD_TEST_RELEASE_ID`。清单和安装包共用 `dsh-desk/<release-id>/`,生产环境保留固定目录。ID 是打包更新 URL 的一部分,因此上传会拒绝不同的 ID。轮换后可通过内部分发提供新安装包,已安装客户端保留原清单地址。随机目录降低被猜中的概率,但不对持有链接者进行鉴权。[发布配置](../../../../apps/desktop/publishing/README.zh.md#upload-updates)定义生成与复用方式。
@@ -106,7 +106,7 @@ Windows 应用替换遵循[目录安装参考](../../../../apps/desktop/packagin
| 包状态 | Electron RunAsNode 执行不可变核心资源;内置 pnpm 只修改 Desktop profile 中的外部插件依赖图。 |
| 资格验证 | macOS 打包要求已配置的公司身份与公证凭据可用,在生成清单前验证每个原生运行时文件,验证完整应用签名,并要求应用和 DMG 都完成公证且通过 Gatekeeper。Windows 打包要求已配置的公开证书、SafeNet 私钥容器、Token Password 与 SignTool,并验证生成的每个签名。更新托管、跨上一版本的已安装产物测试和各平台 GUI 录制仍是发布环境门槛。 |
`dev:desktop` 会构建当前 workspace,把已构建 CLI 包、私有 Desktop Host 包及其依赖链接投影为一次性项目,使用隔离的 Harness home,打开 Main、Renderer 和 Host 调试器,并在不准备发布资源的情况下启动未打包 Electron。开发运行时为独立的插件 profile 提供工作区链接;插件管理和恢复使用与打包应用相同的流程。固定的 macOS arm64、macOS x64 与 Windows x64 打包命令会把同一目标传给运行时准备、dsh 准备和 electron-builder;每条命令还提供未封装安装器的变体,用于在生成安装器前验证发布路径。
`dev:desktop` 会构建当前 workspace,把已构建 CLI 包、私有 Desktop Host 包及其依赖链接投影为一次性项目,使用正常的 Harness home,打开 Main、Renderer 和 Host 调试器,并在不准备发布资源的情况下启动未打包 Electron。一次性项目提供工作区链接;`$DSH_HOME/profiles/desktop` 插件 profile 及其插件管理和恢复与已安装应用共享,因此工作区构建可能安装插件或写入已安装版本拒绝的数据格式。固定的 macOS arm64、macOS x64 与 Windows x64 打包命令会把同一目标传给运行时准备、dsh 准备和 electron-builder;每条命令还提供未封装安装器的变体,用于在生成安装器前验证发布路径。
## 考虑过的替代方案
@@ -6,26 +6,26 @@
en: 4f48d3f949d8e3eb
zh: 4060f4e66c36439e
/agent-note-workspace-file-service/problem:
en: 55d969715a48c9b3
zh: 755dab7523cd01c2
en: c73bcfaa20a793ca
zh: 4c8a29e8d9a59e9a
/agent-note-workspace-file-service/decision:
en: 17137a4e49e56470
zh: ed08cf3d2d7348c8
en: 99ae4bb7b6af4d98
zh: 2f71c2bcf42d423c
/agent-note-workspace-file-service/decision/package-topology:
en: 5a8d81c95c031663
zh: 5bdeebe3b5e759c9
en: d7c976eea9f0ba46
zh: d56fe8dbdca72fda
/agent-note-workspace-file-service/decision/the-workspacefiles-file-operations:
en: 434a2f6b3fab4756
zh: ea83124d00c6a79c
en: ec6c2626c837dfb4
zh: 3d5dcd982e6ec64f
/agent-note-workspace-file-service/decision/paths-on-the-wire:
en: 7b5a96adc08177bc
zh: ae4692e5e62e7de0
/agent-note-workspace-file-service/decision/file-checks-and-workspace-containment:
en: 1b588f346590a0fd
zh: 1cdac02b967b157f
en: e0e1bd03d063d306
zh: bbfe08605b3e51f9
/agent-note-workspace-file-service/decision/failures:
en: 0e419dd7bdcf38ba
zh: 6cb588a77593913c
en: 300dfdb0a6be6884
zh: 79d0ab01cdb0eb85
/agent-note-workspace-file-service/decision/configuration:
en: 796ee295af0895bd
zh: 4dfa113ed19f5f9a
@@ -39,8 +39,8 @@
en: ef015f605f7b00ab
zh: eee9c79faebf3dff
/agent-note-workspace-file-service/alternatives-considered:
en: c750d88e0e746a99
zh: 9e904ad4172fda49
en: d2b8b9fbd0c5f0cd
zh: b5064351042027b7
/agent-note-workspace-file-service/consequences:
en: 246bb7aed62f6c9b
zh: debf6d4129ee477b
@@ -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).
## Consequences
@@ -8,15 +8,15 @@ Status: implemented
Web 客户端需要从一个未必在 Host 机器上的浏览器查看会话工作区里的文件:agent 产出的文件、`read` 工具行点名的路径,之后还有文件树,以及既不小也不是文本的文件预览。唯一一个经线路读取工作区文件的端点以 `workspace-file.ts` 住在 Session Controller 上,与它毫无关系的会话生命周期为邻。它在一个总字节上限之下返回整个文件,因此大日志连一部分都看不了、二进制根本看不了;它没有 `stat`、没有列举、没有变更信号,预览不重读就无法得知 agent 已改写文件;其结果还以 Host 的 `url` 命名文件,而 Client 上没有任何东西把这种拼法当地址用。
两个约束框定了这项服务。经 `ctx.fs` 的文件读取使用 Session 组合后的文件系统后端,其读取权限可能延伸到工作区外,而目录树与变更流消费方以工作区为根。服务为普通文件保留后端的读取决策,同时执行文件类型与有界缓冲检查;`list` 与 `changes` 保留工作区包含限制。另外 `dsh-fs` 只暴露一种原始字节读取 `readBytes(target, signal, maxBytes)`,它拒绝任何比上限更长的文件:对模型整体摄入的图片是正确的,对大文件的一个窗口则毫无用处。
两个约束框定了这项服务。经 `ctx.fs` 的文件读取使用 Session 组合后的文件系统后端,其读取权限可能延伸到工作区外,而目录树与变更流消费方以工作区为根。服务为普通文件保留后端的读取决策,同时执行文件类型与有界缓冲检查;`list` 与 `changes` 对目录执行工作区检查。另外 `dsh-fs` 只暴露一种原始字节读取 `readBytes(target, signal, maxBytes)`,它拒绝任何比上限更长的文件:对模型整体摄入的图片是正确的,对大文件的一个窗口则毫无用处。
## Decision
`packages/api/workspace-files`(`@deepseek-ai/dsh-api-workspace-files`)同时拥有 Host 服务 `ctx.workspaceFiles`、`workspaceFiles` Remote 命名空间,以及将 `stat` 与 `changes` 转成[资源模型](2026-09-05-client-resource-model.zh.md)实时元数据的 Client `file` 提供者;包组织方式由[双面包组织](../../../../packages/api/workspace-files/README.zh.md)规定。文件方法从工作区根解析相对路径,但继承 Session 文件系统后端的读取权限;`list` 与 `changes` 仍限于工作区。[工作区文件读取权限](2026-09-09-workspace-file-read-authority.zh.md)拥有这一分层及其安全后果。结果以文件在文件系统执行环境中的绝对路径命名文件,内容则受页、字节窗口或整文件上限约束。字节窗口依托 `dsh-fs` 新增的 seam `FileSystem.readByteRange`,由每个提供者实现。Session Controller 不再携带任何工作区文件代码。
`packages/api/workspace-files`(`@deepseek-ai/dsh-api-workspace-files`)同时拥有 Host 服务 `ctx.workspaceFiles`、`workspaceFiles` Remote 命名空间,以及将 `stat` 与 `changes` 转成[资源模型](2026-09-05-client-resource-model.zh.md)实时元数据的 Client `file` 提供者;包组织方式由[双面包组织](../../../../packages/api/workspace-files/README.zh.md)规定。文件方法从工作区根解析相对路径,但继承 Session 文件系统后端的读取权限;`list` 与 `changes` 接受解析到工作区根内、或路径由工作区根逐级向下写出的目录。[工作区文件读取权限](2026-09-09-workspace-file-read-authority.zh.md)拥有这一分层及其安全后果,[工作区根外的目录链接](2026-11-20-workspace-directory-links-outside-root.zh.md)拥有目录规则。结果以文件在文件系统执行环境中的绝对路径命名文件,内容则受页、字节窗口或整文件上限约束。字节窗口依托 `dsh-fs` 新增的 seam `FileSystem.readByteRange`,由每个提供者实现。Session Controller 不再携带任何工作区文件代码。
### 包拓扑
[双面包组织](../../../../packages/api/workspace-files/README.zh.md)取代本记录中把 Host 与 Client 分成两个包的组织选择;这里的文件服务、分页和变更流约定保持不变。[工作区文件读取权限](2026-09-09-workspace-file-read-authority.zh.md)取代文件方法原有的工作区包含选择。Host 与 Client 分别编译在两个叶配置中,共享线路类型,Client 不导入 Host 运行时入口。
[双面包组织](../../../../packages/api/workspace-files/README.zh.md)取代本记录中把 Host 与 Client 分成两个包的组织选择;这里的文件服务、分页和变更流约定保持不变。[工作区文件读取权限](2026-09-09-workspace-file-read-authority.zh.md)取代文件方法原有的工作区包含选择,[工作区根外的目录链接](2026-11-20-workspace-directory-links-outside-root.zh.md)取代只按解析后的目标判定 `list` 或 `changes` 目录的做法。Host 与 Client 分别编译在两个叶配置中,共享线路类型,Client 不导入 Host 运行时入口。
| 面 | 包 | 文件 | 依赖 |
|---|---|---|---|
@@ -41,7 +41,7 @@ Web 客户端需要从一个未必在 Host 机器上的浏览器查看会话工
- **`read`** 返回一个行窗口 `WorkspaceFileText = WorkspaceFileStat & { offset, text, lines, eof }`;`lines` 计页内行数,使只含一个空行的页(`text: ''`、`lines: 1`)与越过文件末尾的页(`lines: 0`)可区分。`range.offset` 是 1 起算的首行,缺省 1;`range.limit` 是最多行数,缺省 `maxLines` 且不得超过。行以 `\n` 结束,末尾的 `\n` 终止最后一行而不是开启一空行;`text` 以 `\n` 连接本页各行且不带终止符;页含最后一行时 `eof` 为 true,越过末尾的 offset 返回 `eof` 为 true 的空页。切页器沿 `streamText` 前进,数过窗口前的行而不保留,把每个窗内片段先按 `maxBytes` 核准再缓冲,并在越过窗口的第一个字符处返回,因此任意大小的文件只花一页内存。页上的 `version` 与 `bytes` 来自流之前的那次 stat。
- **`readBytes`** 返回原生字节、文件元数据、偏移量和 EOF。必填选项对象未传 `range` 时,在 `maxFileBytes` 上限内完整读取;传入时,在 `maxBytes` 上限内读取有界窗口。`range: {}` 使用零偏移和配置的窗口上限;窗口可读取超过完整文件上限的文件。[二进制传输决议](2026-09-17-workspace-file-binary-transfer.zh.md)负责 Remote 响应编码。
- **`baseFile`** 独立于 `range` 选择目标解析方式:目标 `path` 必须为相对路径,从基准文件所在目录解析。Host 对两个文件执行普通文件检查,并保留后端读取权限。[Document Preview](2026-09-08-document-preview-operations.zh.md)负责内容加载与地址语义。
- **`list`** 返回 `WorkspaceDirectoryListing { path, entries, truncated }`:被列目录相对根的工作区路径(根为空串)、其直接子项按后端的稳定名序以 `{ name, type, size? }` 给出,以及 `maxEntries` 是否截断了列表。`type` 为 `file`、`directory` 或 `other`;符号链接子项报告其指向目标的类型,悬空者为 `other`。列表报告为目录的子项经其解析目标打开,Windows 目录联接亦然,此时列表以该目标命名;[目录链接列举](../../../../packages/api/workspace-files/README.zh.md)拥有该规则。dotfile 照常列出,不做任何过滤。
- **`list`** 返回 `WorkspaceDirectoryListing { path, entries, truncated }`:被列目录相对根的工作区路径(根为空串)、其直接子项按后端的稳定名序以 `{ name, type, size? }` 给出,以及 `maxEntries` 是否截断了列表。`type` 为 `file`、`directory` 或 `other`;符号链接子项报告其指向目标的类型,悬空者为 `other`。列表报告为目录的子项经其解析目标打开,Windows 目录联接亦然,此时列表在该目标位于根内时以它命名,位于根外时以其在根下的子项名称命名;[目录链接列举](../../../../packages/api/workspace-files/README.zh.md)拥有该规则。dotfile 照常列出,不做任何过滤。
- **`changes`** 产出 `WorkspaceFileWatchFrame`:在观察队列注册且工作区根解析完成后先发 `{ kind: 'ready' }`,随后为 `{ kind: 'change', change }`。载荷 `WorkspaceFileChange` 对存在的文件为 `{ absolutePath, version }`,对消失的文件为 `{ absolutePath, absent: true }`。来源是工作区根内的 `fs/observed`,不监视操作系统。首次拉取后的观察都会排队,包括根解析期间的观察;取消或插件释放会结束该代流。
### 线路上的路径
@@ -52,14 +52,14 @@ Web 客户端需要从一个未必在 Host 机器上的浏览器查看会话工
### 文件检查与工作区包含
`read`、`readBytes` 与 `stat` 共享普通文件检查,之后依赖文件系统后端的读取权限。`list` 共享路径检查,但还会检查工作区包含关系;`changes` 则把观察过滤到工作区根内。服务执行以下检查:
`read`、`readBytes` 与 `stat` 共享普通文件检查,之后依赖文件系统后端的读取权限。`list` 共享路径检查,但还会执行工作区检查;`changes` 则对被监听的目录执行该检查。服务执行以下检查:
1. **路径本身。** `lstat` 在跟随任何东西之前检查路径:缺失路径为 `not-found`;符号链接——不论指向哪里,包括指回工作区内——对文件方法为 `not-regular-file`(kind 为 `symlink`)。`list` 改为跟随末端链接并判定解析后的目标:目标经 stat 必须为目录,指向文件的链接或目标已消失的链接为 `not-directory`(kind 为 `symlink`)。空路径是 `gateway/bad-request`。
2. **`list` 的工作区包含。** 目录解析为目标,由 `ctx.fs.contains(root, target)` 判定,其中 `root` 是从所选 Session header 解析出的 `WorkspaceFileScope.workspaceRoot`。`..` 爬出或根外绝对目录为 `outside-workspace`。`changes` 对观察到的目标使用相同的后端包含判定。
2. **`list` 的工作区检查。** 目录解析为目标,在 `ctx.fs.contains(root, target)` 成立时通过,其中 `root` 是从所选 Session header 解析出的 `WorkspaceFileScope.workspaceRoot`;后端所解析路径的未解析写法由该根逐级经子项名称向下写出且不含 `..` 段时也通过。根外绝对目录,或解析到根外的 `..` 路径,为 `outside-workspace`。`changes` 对被监听的目录执行同一检查。
3. **上限。** 超过 `maxBytes` 的页或窗口,或 `read` 索要超过 `maxLines` 的行数,一律拒绝、绝不截短,因为悄悄截短的页读起来就像整页;超过 `maxEntries` 的列表被截断并如实报告。全文及关联文件读取超过 `maxFileBytes` 时被拒绝。
4. **文本。** 仅限 `read`:到页末为止不是 UTF-8 的内容、后端 8 KiB 开头样本里的 NUL 字节,或页内任何位置的 NUL 字节,都是 `not-text`;页之后的字节不检查。
路径检查之后,文件方法再对解析出的目标 `stat` 一次,因为文件可能在读取前已消失或换了种类:消失者为 `not-found`,被替换者为带新种类的 `not-regular-file`。对 `list` 而言,根外条目若类型本身已不合格,会先报告其种类而不是位置;末端链接先解析并通过包含检查,再读取其目标种类。
路径检查之后,文件方法再对解析出的目标 `stat` 一次,因为文件可能在读取前已消失或换了种类:消失者为 `not-found`,被替换者为带新种类的 `not-regular-file`。对 `list` 而言,根外条目若类型本身已不合格,会先报告其种类而不是位置;末端链接先解析并通过工作区检查,再读取其目标种类。
### 失败
@@ -68,7 +68,7 @@ Web 客户端需要从一个未必在 Host 机器上的浏览器查看会话工
| 代码 | 何时 | Details |
|---|---|---|
| `workspace-file/not-found` | 路径处无条目,或文件在过关后消失 | `{ path }` |
| `workspace-file/outside-workspace` | `list` 的目标不在工作区根内 | `{ path }` |
| `workspace-file/outside-workspace` | `list` 或被监听的目录既不解析到工作区根内,其路径也不是由工作区根向下写出 | `{ path }` |
| `workspace-file/too-large` | 一页文本或字节窗口超过 `maxBytes`,或全文读取超过 `maxFileBytes` | `{ path, limit }` |
| `workspace-file/not-text` | 到页末为止的非法 UTF-8,或样本或页内的 NUL 字节(仅 `read`) | `{ path }` |
| `workspace-file/not-regular-file` | 对非普通文件执行 `read`、`readBytes` 或 `stat` | `{ path, kind: 'directory' \| 'symlink' \| 'other' }` |
@@ -125,7 +125,7 @@ Client 导出向 `ctx.resources` 注册一个 `ResourceProvider<'file'>`,存
**在 `FileSystem` 基类里给 `readByteRange` 一个默认实现。** 基于 `readBytes` 的非抽象默认能免去测试替身一个方法,但只能靠把文件从头读到窗口末端来实现——正是上文否决的行为——或者传一个无界上限。改为抽象方法,由每个提供者与替身实现。
**工作区操作使用字符串前缀包含判定。** 把解析后的路径字符串与根比较比 `fs.contains` 简单,但 `resolve` 会取 realpath,离开根的符号链接解析到根外路径,而对未解析拼法的前缀测试会放行;对已解析拼法的前缀测试也仍需后端对"同一文件"的定义。`list` 与 `changes` 由文件系统判定包含关系。
**工作区操作使用字符串前缀包含判定。** 把解析后的路径字符串与根比较比 `fs.contains` 简单,但 `resolve` 会取 realpath,离开根的符号链接解析到根外路径,而对未解析拼法的前缀测试会放行;对已解析拼法的前缀测试也仍需后端对"同一文件"的定义。`list` 与 `changes` 由文件系统判定包含关系;按[工作区根外的目录链接](2026-11-20-workspace-directory-links-outside-root.zh.md),后端未解析写法由根向下写出的路径也可通过。
## Consequences
@@ -9,8 +9,8 @@
en: a35075e6babe3f7a
zh: 3a64ac57761e1009
/agent-note-document-preview-and-file-addresses/decision:
en: 75b40970e401f2e3
zh: 970b2cc044ea17f4
en: efed703b02c2a460
zh: 22e5a451991b96fe
/agent-note-document-preview-and-file-addresses/alternatives-considered:
en: 8e9616e954df488c
zh: 10801341ec53bbe8
@@ -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 @@ Status: implemented
Document Preview 将资源观察与内容读取分开。[资源模型](2026-09-05-client-resource-model.zh.md)只按地址共享观察:`source(address)`、`pin(address, signal)` 和提供方的 `open(address, { signal })` 均不携带消费 Session。提供方返回 `AsyncIterable<RemoteResult<ResourceProtocolMap[P]>>`;`useResource` 只暴露 `{ status, value, failure }`。持有只控制观察的启停,不控制底层文件或 Session 的生灭。内容通过普通注入的 Preview 回调读取。
[Workspace Files](../../../../packages/api/workspace-files/README.zh.md) 保留 Host 的行读取、字节窗口、有上限的全文读取和相对另一文件目录的有界读取。Client `file` 提供方只观察 `stat` 与 `changes`,`ResourceProtocolMap.file` 直接为 `WorkspaceFileStat`。Host 通过 Session 文件系统解析每条路径;文件读取继承该后端的读取权限,目录列举与变更观察仍限定于工作区。
[Workspace Files](../../../../packages/api/workspace-files/README.zh.md) 保留 Host 的行读取、字节窗口、有上限的全文读取和相对另一文件目录的有界读取。Client `file` 提供方只观察 `stat` 与 `changes`,`ResourceProtocolMap.file` 直接为 `WorkspaceFileStat`。Host 通过 Session 文件系统解析每条路径;文件读取继承该后端的读取权限,目录列举与目录监听执行 Workspace Files README 所述的工作区检查。
可读取的文件使用 `dsh-resource://file/session/<sessionId>/<path>`。路径可以相对工作区,也可以是绝对路径;编码后的绝对路径保留前导斜杠。`fileAddressFor` 始终生成这种 Session 地址。提供方与 Preview RPC 只从该地址取 Session,不取当前选择、首个持有者或 tab 所属 Session。不带 Session 的 `absolute` URI 无法读取;提供方报告 `workspace-file/unknown-workspace`。Session 授权是文件协议规则,不是额外的 Resource 身份。
@@ -9,11 +9,11 @@
en: ee5703dcce5d81c5
zh: 6c1aec04723d211b
/agent-note-workspace-file-read-authority/decision:
en: b4b88d397452d083
zh: 14069d83e001082d
en: bb8b53dcfc26d18f
zh: 201249812e65c6fe
/agent-note-workspace-file-read-authority/alternatives-considered:
en: 329e575be02d7392
zh: a78f428b36d40f59
en: 4786886538bf3e09
zh: 53d0da3e95b19173
/agent-note-workspace-file-read-authority/consequences:
en: 5596ccd54a474e24
zh: d31721c8d39b7fdc
@@ -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.
@@ -12,7 +12,7 @@ Workspace Files 同时提供文件内容与工作区导航。对所有操作应
`read`、`readBytes` 与 `stat` 继承被寻址 Session 的文件系统后端读取权限。工作区根是输入相对路径的基准,而不是读取边界;只要后端允许,就可以读取绝对路径和离开工作区的相对路径。服务仍要求普通文件、拒绝符号链接,并应用文本和字节上限。
`list` 与 `changes` 仍限于工作区,因为它们暴露工作区导航和观察,而不是读取一个具名文件。`list` 拒绝根外目录,`changes` 通过后端的工作区包含判定过滤观察。
`list` 与 `changes` 仍以工作区为根,因为它们暴露工作区导航和观察,而不是读取一个具名文件。两者接受解析到根内、或路径由根逐级向下写出的目录,并拒绝其他目录;[工作区根外的目录链接](2026-11-20-workspace-directory-links-outside-root.zh.md)拥有该规则。
带 `baseFile` 的 `readBytes` 从基准文件所在目录解析相对路径。因此,只要 Session 后端允许,`..` 路径就可以读取工作区外的 JavaScript 或 CSS。开启[开发者工具](../../../../packages/client/ui-sidebar-documentpreview/README.zh.md)时,Document Preview 把有界、静态声明的本地脚本与样式表打包进带 `sandbox="allow-scripts"` 的 HTML Blob iframe;不透明源阻止访问父应用,但浏览器保留正常网络访问。这种暴露是为渲染静态生成 HTML 而有意接受的安全取舍。
@@ -20,7 +20,7 @@ Workspace Files 同时提供文件内容与工作区导航。对所有操作应
## Alternatives considered
**把所有操作限制在工作区内。** 这会让预览采用比 Session 文件系统后端更窄的策略,阻止读取明确寻址的可读文件,并使位于外部资源旁的 HTML 无法渲染。操作本身代表工作区时,仍保留工作区包含限制。
**把所有操作限制在工作区内。** 这会让预览采用比 Session 文件系统后端更窄的策略,阻止读取明确寻址的可读文件,并使位于外部资源旁的 HTML 无法渲染。操作本身代表工作区时,仍保留工作区检查。
**允许根外读取,但阻断 iframe 的全部网络。** 更严格的 CSP 可以降低数据外传风险,但也会拒绝静态 HTML 预览有意保留的外部资源与网络行为。不透明 sandbox 保护父应用,但不承诺网络隔离。
@@ -12,11 +12,11 @@
en: d3c8181e29c1ff3b
zh: a6f15b85e58907e5
/agent-note-bounded-shared-office-conversion/alternatives-considered:
en: 73888970b0fc7f6b
zh: 9bcccf774116f849
en: 3f998467f8c6aec3
zh: b49ec2c1874ef2f5
/agent-note-bounded-shared-office-conversion/consequences:
en: c2800ff56c8f89d1
zh: 3b3710072b59c443
/agent-note-bounded-shared-office-conversion/related:
en: 2e7b1a0f01c1f617
zh: ed2abc0181ea4abe
en: 6c410bafda0ccaee
zh: 85c95c04e1e74057
@@ -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.
## Consequences
@@ -40,4 +40,4 @@ Controlled source and engine completions verify pre-read admission, content join
## Related
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.
@@ -28,7 +28,7 @@ Office 预览和显式文档检查可能请求相同转换。仅缓存已完成
**另建预热或 QA 转换器。** 独立队列重复拥有资源,无法优先调度共享前台工作。
**为唯一的 LibreOffice 实现拆分服务定义和提供方包。** 两者共同演化,没有独立的替代实现。单个 `office-kit` 包直接提供可挂载服务,避免重复维护包、依赖和发布配置。原生与 WASM 引擎选择仍由 kit 负责;若出现独立的第二种实现,再根据实际消费者提取接口。
**拆分服务定义和提供方包。** 该服务只有一种实现;其 LibreOffice Kit 转换器和 [Poppler PDF 渲染后端](2026-11-23-poppler-pdf-renderer.zh.md)都是该提供方内部的后端,共用其队列、缓存和准入,因此与服务一同演化。单个 `office-kit` 包直接提供可挂载服务,避免重复维护包、依赖和发布配置。原生与 WASM 引擎选择仍由 kit 负责;若出现独立的第二种服务实现,再根据实际消费者提取接口。
## 后果
@@ -40,4 +40,4 @@ Office 预览通过 Workspace Files 检查源文件授权与版本,再使用 `
## 相关记录
[后台调度提案](../../proposed/simplification/2026-09-17-defer-office-background-scheduling.zh.md) 质疑没有生产调用方时保留推测性优先级的必要性;本记录仍定义已实现的行为。
[后台调度提案](../../proposed/simplification/2026-09-17-defer-office-background-scheduling.zh.md) 质疑没有生产调用方时保留推测性优先级的必要性;本记录仍定义已实现的行为。[Poppler PDF 渲染后端记录](2026-11-23-poppler-pdf-renderer.zh.md)说明图片渲染如何在此队列内选择后端。
@@ -29,9 +29,12 @@
/agent-note-resolve-profile-modules-along-the-ancestor-chain-with-an-interception-layer/decision/part-1-resolution-rules/5-hook-coverage:
en: 644f6f9a6ff8d6c8
zh: 7a81f928551e9041
/agent-note-resolve-profile-modules-along-the-ancestor-chain-with-an-interception-layer/decision/part-1-resolution-rules/6-package-directories-and-module-files:
en: c85f82cb1c60360e
zh: c535f1c0ec58345e
/agent-note-resolve-profile-modules-along-the-ancestor-chain-with-an-interception-layer/decision/part-1-resolution-rules/6-rows-the-config-tree-requests:
en: c474b69fb9b029d5
zh: 033c7686f14bc587
/agent-note-resolve-profile-modules-along-the-ancestor-chain-with-an-interception-layer/decision/part-1-resolution-rules/7-package-directories-and-module-files:
en: ba52bd3dd63c641c
zh: ef7337e07e300eca
/agent-note-resolve-profile-modules-along-the-ancestor-chain-with-an-interception-layer/decision/part-2-walkthroughs:
en: 906e0d58e3c2aff3
zh: ccc3a709034865b9
@@ -48,8 +51,8 @@
en: 35f27b53d995d59f
zh: 58a47c7bfced79a0
/agent-note-resolve-profile-modules-along-the-ancestor-chain-with-an-interception-layer/decision/part-3-developer-integration-guide/1-normal-installation:
en: d0bed60317e6e3a8
zh: 5714160678adc049
en: a4e8f46669f79105
zh: a7590429589c12fb
/agent-note-resolve-profile-modules-along-the-ancestor-chain-with-an-interception-layer/decision/part-3-developer-integration-guide/2-development-mode-the-plugin-repository-is-outside-the-profile-tree:
en: 22259a568693c641
zh: d81d15671398d033
@@ -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
@@ -75,7 +75,11 @@ hook 只在 importer 位于 `$DSH_HOME/profiles/**` 或某个 linked root 之下
ESM 与 CommonJS 两个适配器调用同一个路由函数,主线程与 Harness 自有 Worker 都安装同一份 runtime resolution。实现位于 `packages/boot/app-boot/src/profile-resolution/resolver.ts`,runtime resolution 的构造位于 `packages/boot/app-boot/src/profile.ts`。
#### 6. 包目录与模块文件
#### 6. 配置树请求的行
根配置树从 profile 目录的 URL 请求它的行,其中大多数由 bundle 插入,包括 bundle 的 agent preset 里的行。对 bundle 作为行插入、并声明为自身依赖的每个插件包名,runtime resolution 记录第一个这样的 bundle。importer 是当前 profile 目录的裸包名请求,对这样的包名先于 ① 和 ② 按该 bundle 自己 import 的方式重新解析。其他 importer,包括 profile 里的文件和它的 `node_modules` 里的包,按上面的主线查找。绑定规则见 [bundle 插件行](2026-11-23-bundle-plugin-rows-load-bundle-selected-packages.zh.md)。
#### 7. 包目录与模块文件
`packageDir('pkg', parentURL)` 与 `packageDir('pkg/sub', parentURL)` 定位包目录,不加载代码,也不校验子路径。普通入口与文件请求仍由 Node 应用 `exports`、`main`、conditions 和文件存在性规则。因此,包目录查询可以成功,同时导入缺失或未导出的文件会失败。`import.meta.resolve` 可以为不存在的已导出文件返回 URL,但导入该 URL 仍然失败,这与原生 Node 一致。
@@ -129,7 +133,7 @@ ESM 与 CommonJS 两个适配器调用同一个路由函数,主线程与 Harne
`dsh plugin --profile <name> add <包名 | git spec | file:../本地检出>` 把参数转发给 pnpm,在 profile 目录内以 hoisted 布局安装。profile 的 `pnpm-workspace.yaml` 设置 `autoInstallPeers: false`,插件声明为 peer 的 dsh 包不会被装进 profile,由拦截层提供当前运行安装的那一份,插件与 dsh 共用同一个模块实例。
插件自己的第三方依赖被 hoist 到 `$DSH_HOME/profiles/<name>/node_modules`,按主线 ② 找到。与 installation 闭包同名时最近者优先,插件使用自己声明的版本。`file:` 形式把本地检出复制进 profile,随后的解析与注册表安装完全相同。
插件自己的第三方依赖被 hoist 到 `$DSH_HOME/profiles/<name>/node_modules`,按主线 ② 找到。与 installation 闭包同名时最近者优先,插件使用自己声明的版本;bundle 插入并声明的行仍然从该 bundle 解析(第一部分第 6 节)。`file:` 形式把本地检出复制进 profile,随后的解析与注册表安装完全相同。
#### 2. 开发模式:插件仓库在 profile 树外
@@ -18,5 +18,5 @@
en: aceed1aa98ed9bec
zh: b9d99a25a8b25417
/agent-note-preset-scoped-schedule-tools/testing:
en: 05080859ac790524
zh: 4b220c10da961608
en: 8d3855ea5259878e
zh: 39ca6c8adccb02cb
@@ -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.
@@ -31,4 +31,4 @@ Status: implemented
## Testing
`packages/schedule/tool-schedule/tests/tool-schedule.spec.ts` 固定这四个定义及其错误映射,包括 `refuses every call from a registered delegated child whose scope mounts the tools`;`packages/subagent/subagent/tests/schedule-tools.spec.ts` 通过工具执行器运行一个被委派的子 agent,并在没有已存任务时固定该拒绝。`apps/cli/tests/web-agent-presets.e2e.ts` 断言 `minimal` preset 的工具列表,`snapshots/web/minimal-preset/tool-schemas.expected.json` 记录其不含提醒工具 schema 的工具表。`packages/schedule/schedule/tests/subagent-ownership.spec.ts` 固定委派深度拒绝,`scripts/optional-bundles.spec.ts` 断言三个 preset 的两行委派行都不含 `toolFilter`。Web preset e2e 还检查父子工具 schema 相等,且四个提醒执行器对新建和带种子的子级均拒绝执行。`snapshots/web/subagent-fork-schedule` 通过出货 Web 组合记录带种子 fork 中的四次拒绝,并共享 standard preset 的提示和 schema 预期。
`packages/schedule/tool-schedule/tests/tool-schedule.spec.ts` 固定这四个定义及其错误映射,包括 `refuses every call from a registered delegated child whose scope mounts the tools`;`packages/subagent/subagent/tests/schedule-tools.spec.ts` 通过原生根注册表运行一个被委派的子 agent,并在没有已存任务时固定该拒绝。`apps/cli/tests/web-agent-presets.e2e.ts` 断言 `minimal` preset 的工具列表,`snapshots/web/minimal-preset/tool-schemas.expected.json` 记录其不含提醒工具 schema 的工具表。`packages/schedule/schedule/tests/subagent-ownership.spec.ts` 固定委派深度拒绝,`scripts/optional-bundles.spec.ts` 断言三个 preset 的两行委派行都不含 `toolFilter`。Web preset e2e 还检查父子工具 schema 相等,且四个提醒执行器对新建和带种子的子级均拒绝执行。`snapshots/web/subagent-fork-schedule` 通过出货 Web 组合记录带种子 fork 中的四次拒绝,并共享 standard preset 的提示和 schema 预期。
@@ -9,11 +9,11 @@
en: 32ba2b2b42e8deb5
zh: 6a6532561f81b8e2
/agent-note-offer-web-search-and-web-fetch-only-while-the-selected-provider-is-ready/decision:
en: 9bf594047ad5c864
zh: 366263d56f8a4fbf
en: f43ebe5ff75efda7
zh: b9485905c8489e53
/agent-note-offer-web-search-and-web-fetch-only-while-the-selected-provider-is-ready/alternatives-considered:
en: 6da221f6b821ea44
zh: b15774011abed7ed
en: 08d82dad90ca1425
zh: a84ef590cc32209c
/agent-note-offer-web-search-and-web-fetch-only-while-the-selected-provider-is-ready/consequences:
en: c90a122c1f33bb83
zh: 0175ca0f599d086b
en: 7df559db44019a1e
zh: 82580a6ea36834e3
@@ -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,17 +10,17 @@ Status: implemented
## Decision
web 能力 seam 的每个角色各负责逐步骤检查的一部分:
web 能力 seam 的每个角色各负责就绪检查的一部分,该检查决定 Agent 能否看到每个 Web 工具:
- **Service Definition。** `WebSearchProvider` 与 `WebFetchProvider` 有一个可选的 `ready(llmProvider)`,回答为该对话路由上的模型请求发起的操作是否有可发送的凭据。它只检查配置,不发起网络调用。`ctx.web.searchReady(llmProvider?)` 与 `ctx.web.fetchReady(llmProvider?)` 按与 `search()`、`fetch()` 相同的规则解析提供方并返回其回答。没有 `ready()` 的提供方视为就绪;选择失败时回答 true,因为对应操作会把该失败报告为结构化 `WebError`。
- **Service Provider。** 每个 DeepSeek 提供方都按其操作解析凭据的顺序检查凭据。`dsh-web-search-deepseek` 在账号路由上的会话里检查 `ctx.deepseekAuth` 是否已为其 Messages 端点配置账号登录凭据,然后检查其字面 `apiKey` 或 `apiKeyEnv` 引用。`dsh-web-deepseek-api` 的 Search 与 Fetch API 提供方解析与操作相同的方案([凭据解析](2026-10-29-web-provider-selection.zh.md)):在 YAML 中设置了单独字段的能力只检查其 `*ApiKeyEnv` 下的密钥;否则,在账号路由上且账号模型路由已挂载时,为该路由 origin 之下的端点配置的账号登录凭据算数,然后是 `deepseek-official` 路由的密钥,没有该路由时为 `DEEPSEEK_API_KEY`。`ctx.credentials.describe()` 报告其引用已配置时(没有该服务时,启动环境中存在该变量),密钥即算存在;这些存在性检查由 `ctx.deepseekAuth` 执行,其中密钥的检查经由 `dsh-credentials` 的引用函数。读取账号 token 或凭据存储失败时回答 false,因为操作会在该次读取上失败,而不会尝试下一种凭据。提供方不点名任何工具或提示词段落。
- **Consumer。** `dsh-tool-web` 注册 `web_search` 与 `web_fetch` 时各带一个[步骤激活条件](../../../../packages/core/tools/README.zh.md#conditional-tools),以该步骤模型选择的路由询问 `ctx.web.searchReady()` 与 `ctx.web.fetchReady()`。agent loop 在组装该步骤之前解析各条件,因此声明的工具、`tool:web_search` 与 `tool:web_fetch` 提示词段落、PTC 程序绑定与派发都读取同一个准入集合。
- **Consumer。** `dsh-tool-web` 在一个 [`AgentToolRegistry`](../../../../packages/core/tools/README.zh.md#per-agent-tools) 中注册 `web_search` 与 `web_fetch`,以 `agent.model.current()` 指明的路由询问 `ctx.web.searchReady()` 与 `ctx.web.fetchReady()`,再为该 Agent 添加或移除每个工具。它在以下时机检查:创建 Agent 时,创建过程会等待该检查完成;该 Agent 的会话记录模型选择、另一路由上的请求或预设变化时;已存储的凭据或账号登录状态变化时;已注册的 Web 提供方变化时。它加载时还会检查已存在的 Agent。`tool:web_search` 与 `tool:web_fetch` 提示词段落与工具一起注册,并且只有在 tool-web 已为某个 Agent 添加该工具时,才会为该 Agent 渲染。每个步骤只捕获一次工具,因此声明的工具、PTC 程序绑定与派发都读取同一组工具。
路由只决定是否先检查账号 token 再检查 API 密钥,这发生在 `deepseek-account` 路由上;API 密钥在每条路由上都算数,因此只要配置了 DeepSeek 密钥,使用其他提供方模型的对话也会获得 DeepSeek Web 工具。在 YAML 中设置了单独字段的 Search 或 Fetch API 能力不看路由,恰在其自身密钥已配置时就绪。
只看凭据是否存在:不读取 API 密钥的值,也不访问任何端点,因此错误的密钥,或不提供原生 `web_search_20250305` 服务器工具的端点,仍会让该工具保持准入。未准入某个 Web 工具的步骤也会以 `UNKNOWN_TOOL` 拒绝对它的调用,因此模型重复先前的调用也到达不了任何提供方;在模型步骤之外发起的操作在运行时解析凭据,没有凭据时以 `WEB_PROVIDER_CREDENTIAL_MISSING` 失败。
只看凭据是否存在:不读取 API 密钥的值,也不访问任何端点,因此密钥错误,或端点不提供原生 `web_search_20250305` 服务器工具时,仍会提供该工具。所属 Agent 没有某个 Web 工具的步骤也会以 `UNKNOWN_TOOL` 拒绝对它的调用,因此模型重复先前的调用也到达不了任何提供方;在模型步骤之外发起的操作在运行时解析凭据,没有凭据时以 `WEB_PROVIDER_CREDENTIAL_MISSING` 失败。
请求头记录组装后的工具,因此 agent loop(智能体循环)通过工具注册表更新宣告每次变化。路由切换、存储密钥或删除密钥都会改变下一个请求;DeepSeek 路由以延迟加载的新增方式载入重新提供的工具,不支持工具更新的路由则接收完整工具列表。
请求头记录组装后的工具,因此 agent loop(智能体循环)通过工具注册表更新宣告每次变化。路由切换、存储密钥或删除密钥都会改变检查完成后开始的第一个请求;DeepSeek 路由以延迟加载的新增方式载入重新提供的工具,不支持工具更新的路由则接收完整工具列表。
## Alternatives considered
@@ -30,7 +30,7 @@ web 能力 seam 的每个角色各负责逐步骤检查的一部分:
**从会话最近的 `request/context` 事件读取路由,而不是传入路由。** 该事件记录的是上一个请求,因此新会话的首个请求,以及模型切换后的首个请求,会按错误的路由判断,或根本没有路由可用。
**在 `dsh-tool-web` 中注册或注销 `web_search`。** 注册由同一 agent preset 的所有会话共享,而凭据取决于每个请求的路由。注销还会使点名 `web_search` 的 `toolOrder` 条目和 subagent `toolFilter` 限制失败。
**在 `dsh-tool-web` 中为整个 preset 注册或注销 `web_search`。** 注册由同一 agent preset 的所有会话共享,而凭据取决于每个请求的路由。注销还会使点名 `web_search` 的 `toolOrder` 条目和 subagent `toolFilter` 限制失败。按 Agent 提供工具的注册表保留一份共享注册,其不带作用域的视图仍列出该工具,因此这些名称保持有效。
**从组装好的请求中移除 `web_search`。** `system-prompt/assemble` 监听器可以删掉该声明及其段落,但工具仍可执行,因此模型重复先前的调用时仍会运行它,PTC 程序也仍能绑定它。提示词组装也已不再携带工具声明。
@@ -44,8 +44,10 @@ web 能力 seam 的每个角色各负责逐步骤检查的一部分:
**提供工具前探测密钥或端点。** 每个模型请求都发起一次网络请求会增加延迟与成本;用户控制的是配置本身,而不是它在那一刻是否有效。
**在每个步骤之前,通过一个需等待完成的步骤事件检查。** 这样每个步骤都能读取其确切路由与当前凭据,但 agent loop 要为这一个消费方保留一个公共的逐步骤扩展点,而且尽管检查的输入很少变化,检查仍会对每个 Agent 的每个步骤运行。这些输入大多通过事件变化,没有对应事件的输入列在「Consequences」一节中。
## Consequences
`dsh-web` 增加以下公共成员:两个提供方接口上可选的 `ready()`、`WebRuntime.searchReady()` 与 `WebRuntime.fetchReady()`。每个就绪方法都是其唯一消费方所需的最小查询,这正是[观测接口决策](../../archived/simplification/2026-07-04-drop-unconsumed-web-observation-surface.md)允许状态查询回归的方式;它们既不报告可用性,也不报告选择失败。HTTP 抓取提供方没有实现 `ready()`,因此只要选中 HTTP 抓取,`web_fetch` 就始终准入。未准入某个 Web 工具的步骤,其 PTC 程序绑定中也没有它。无法提供原生服务器工具的端点仍会让工具保持准入,并使每次调用失败。在路由不变时移除工具会改变声明的工具,并使提示词缓存失效一次;模型切换本身已经使缓存失效。其他提供方对话中的搜索与抓取由配置的 DeepSeek 密钥计费。官方路由经网关对话的部署,对 Search 与 Fetch API 会把网关的密钥发往该网关 origin 加 `/v1/tools`,对旧版 Messages 搜索则发往配置的 Messages 端点(默认是官方端点),除非该端点接受这个密钥,否则每次搜索都会失败。Search 与 Fetch API 通过模型提供方目录读取 DeepSeek 模型路由的 Loader 条目。
`dsh-web` 增加以下公共成员:两个提供方接口上可选的 `ready()`、`WebRuntime.searchReady()` 与 `WebRuntime.fetchReady()`。每个就绪方法都是其唯一消费方所需的最小查询,这正是[观测接口决策](../../archived/simplification/2026-07-04-drop-unconsumed-web-observation-surface.md)允许状态查询回归的方式;它们既不报告可用性,也不报告选择失败。HTTP 抓取提供方没有实现 `ready()`,因此只要选中 HTTP 抓取,就始终提供 `web_fetch`。所属 Agent 没有某个 Web 工具的步骤,其 PTC 程序绑定中也没有它。端点无法提供原生服务器工具时,仍会提供该工具,并使每次调用失败。在检查运行期间开始的步骤使用先前的回答,因此模型切换后的第一个步骤仍可能按先前的路由提供或省略某个工具;在没有变化事件的情况下编辑的 Web 提供方设置(例如字面密钥、密钥引用名称或选中的提供方)在该 Agent 的下一次检查时生效。跟随默认模型的空白 Web 会话,其路由也会在另一个会话保存新的默认模型时变化,且没有对应事件:第一个步骤使用针对旧路由检查得到的回答,该步骤的 `request/header` 会启动一次检查;如果新路由未就绪,该工具会在模型回答期间被撤下,因此已声明的 `web_search` 调用以 `UNKNOWN_TOOL` 失败;若该调用在检查结算之前开始,则以 `WEB_PROVIDER_CREDENTIAL_MISSING` 失败。在路由不变时移除工具会改变声明的工具,并使提示词缓存失效一次;模型切换本身已经使缓存失效。其他提供方对话中的搜索与抓取由配置的 DeepSeek 密钥计费。官方路由经网关对话的部署,对 Search 与 Fetch API 会把网关的密钥发往该网关 origin 加 `/v1/tools`,对旧版 Messages 搜索则发往配置的 Messages 端点(默认是官方端点),除非该端点接受这个密钥,否则每次搜索都会失败。Search 与 Fetch API 通过模型提供方目录读取 DeepSeek 模型路由的 Loader 条目。
单元测试分别固定每个角色:[web.spec.ts](../../../../packages/web/web/tests/web.spec.ts) 覆盖 `searchReady()` 与 `fetchReady()` 询问哪个提供方以及选择失败时的回答,[deepseek.spec.ts](../../../../packages/web/web-search-deepseek/tests/deepseek.spec.ts) 与 [credential-resolution.spec.ts](../../../../packages/web/web-deepseek-api/tests/credential-resolution.spec.ts) 覆盖 `ready()` 在账号路由与其他路由上的每种凭据情况,包括就绪判断与每次操作一致,[tool-web.spec.ts](../../../../packages/web/tool-web/tests/tool-web.spec.ts) 通过真实的提示词、工具与执行器服务解析两个工具的步骤准入,包括在撤下该工具的步骤中调用它时以 `UNKNOWN_TOOL` 拒绝。在真实组合中,发行版 headless 无密钥冒烟测试与 `web-search-unconfigured` 录制会话快照的搜索密钥引用都未设置,二者固定了搜索工具的撤下行为。快照回放提供占位 DeepSeek 密钥,因此其工具列表不依赖运行环境;借助该密钥,`pi-ai-conversation-updates` 中 pi-ai 路由上的对话保留 `web_search`。
单元测试分别固定每个角色:[web.spec.ts](../../../../packages/web/web/tests/web.spec.ts) 覆盖 `searchReady()` 与 `fetchReady()` 询问哪个提供方以及选择失败时的回答,[deepseek.spec.ts](../../../../packages/web/web-search-deepseek/tests/deepseek.spec.ts) 与 [credential-resolution.spec.ts](../../../../packages/web/web-deepseek-api/tests/credential-resolution.spec.ts) 覆盖 `ready()` 在账号路由与其他路由上的每种凭据情况,包括就绪判断与每次操作一致,[tool-web.spec.ts](../../../../packages/web/tool-web/tests/tool-web.spec.ts) 通过真实的提示词、工具与根注册表服务准备提供或撤下这两个工具的模型步骤,包括在撤下该工具的步骤中调用它时以 `UNKNOWN_TOOL` 拒绝。在真实组合中,发行版 headless 无密钥冒烟测试与 `web-search-unconfigured` 录制会话快照的搜索密钥引用都未设置,二者固定了搜索工具的撤下行为。快照回放提供占位 DeepSeek 密钥,因此其工具列表不依赖运行环境;借助该密钥,`pi-ai-conversation-updates` 中 pi-ai 路由上的对话保留 `web_search`。
@@ -9,8 +9,8 @@
en: 9f652292b62cd015
zh: 14a97b5a4884c008
/agent-note-desktop-shell-configuration-independent-of-the-host/decision:
en: e58311d3d5ebb6b6
zh: b4c791fcfde7b986
en: eb14fe1f888552dd
zh: 5414e5a108bd9bdc
/agent-note-desktop-shell-configuration-independent-of-the-host/alternatives-considered:
en: 349210f3cf5f168b
zh: 019acfc3c3d71b4b
@@ -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.
@@ -10,7 +10,7 @@ Desktop 更新和原生恢复可以在 Host 启动前或不可用时运行。依
## Decision
Electron 主进程负责 `userData/desktop/settings.json`,不依赖 Host 启动或 Cordis 求值。测试鉴权弹窗开关使用此文件;[Desktop 参考文档](../../../../apps/desktop/README.zh.md#local-desktop-settings)统一说明字段和行为。
Electron 主进程负责 `userData/desktop/settings.json`,不依赖 Host 启动或 Cordis 求值。文档 `"version": "1"`、测试鉴权弹窗开关以及更新渠道偏好与解锁标记均使用此文件;`"version": "1"` 迁移与默认 `stable` 锁定见[渠道收敛与解耦发布决策](2026-11-25-desktop-channel-convergence-and-decoupled-publishing.zh.md),字段校验与运行时行为见 [Desktop 参考文档](../../../../apps/desktop/README.zh.md#local-desktop-settings)。
配置归属按运行依赖划分:由 Electron 负责且需要在 Host 启动前或不可用时读取配置的功能,使用壳层配置。Host 插件设置,包括 Web/Desktop 共用偏好,继续使用 Cordis。仅仅展示在 Desktop 中,不构成归属壳层的理由。统一设置界面可以使用不同的存储归属。
@@ -0,0 +1,22 @@
# Bilingual-pair consistency record for 2026-10-12-im-automation-sessions.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-12-im-automation-sessions.md
/agent-note-im-integration-through-automation-sessions:
en: d6b30e7c14677e2f
zh: dd645fc940cd7735
/agent-note-im-integration-through-automation-sessions/problem:
en: 673f364e0086216d
zh: 365842270520db39
/agent-note-im-integration-through-automation-sessions/decision:
en: 6b4bea610a34a4a7
zh: ed9a350b57ad80a8
/agent-note-im-integration-through-automation-sessions/durability-and-ownership:
en: 68418aadd270de7f
zh: 69a3ec843097a1d9
/agent-note-im-integration-through-automation-sessions/alternatives-considered:
en: 450cc826c8260583
zh: 288ca53b6955a6b4
/agent-note-im-integration-through-automation-sessions/consequences:
en: bcf16d490d681bf1
zh: b0bf15e9652e2516
@@ -0,0 +1,39 @@
# 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.
@@ -0,0 +1,39 @@
# Agent Note: 通过自动化会话接入 IM
Status: implemented
[English](2026-10-12-im-automation-sessions.md) | 中文
## Problem
IM 同时包含延迟输入、多个参与者、消息引用和平台重投。一项任务可以消费多条消息,而不逐条发布答复。将每条消息作为 GUI 提示词、每条 assistant 回复作为平台答复,会把输入调度与发布耦合。
## Decision
IM 通过现有 agent 工厂、收件箱、预设和持久化 API 托管持久化会话,并由插件决定被接纳的消息进入哪个会话。agent-loop 与核心 Session 类别保持不变。[IM 服务](../../../../packages/experimental/im/README.zh.md) 接纳外部上下文并提供用于读取和发布的[显式工具](../../../../packages/experimental/im/src/tools.ts);[IM 组合包](../../../../packages/experimental/im-bundle/README.zh.md) 把服务与各适配器作为 Host 条目插入已有的 profile。
来源接纳、写权限、投递模式、模型路由、工作目录和预设均由部署显式配置:`sources` 规则决定哪些聊天可以进入宿主以及其消息如何入库,`defaultDispatch` 组合出所有未被处理且提及机器人的消息都会进入的那个会话。所有聊天共享该会话的历史,因此需要按聊天隔离历史或后台 worker 的部署,改为在 `im/message` 事件链上挂载自己的插件。
传输层使用内置的 Satori 包(`plugin-im-core`、`satori-element`、`plugin-im-adapter-lark` 与 `plugin-im-adapter-qq`)。[vendor 清单](../../../../vendor/im/README.md) 记录准确的上游版本与本地修改。生成的飞书类型声明不提交到 Git,在安装阶段从经过哈希校验的固定源码生成。
## Durability and ownership
每个托管会话由单个服务实例持有对应的活动 `Agent`。`im_sessions` 存储域记录每个托管会话的归属方、组合配置与聊天绑定,并拒绝已在 IM 存储之外存在的会话 id。`im_messages` 在向平台返回 ACK 前记录外部事件摘要与消息记录。确定性的收件箱消息 ID(`deliveryMessageId`)与 Session 日志核对保证了跨重启恢复时不会向收件箱重复写入消息。
带 `operationId` 的发送操作在发出网络请求前先向 `im_receipts` 写入 `pending` 状态,并在收到结果后更新回执。使用相同 `operationId` 重放会直接返回已记录的回执而不会重复发送。平台明确返回未发布的错误码时记录为 `failed`;响应丢失、超时或发出后崩溃则记录为 `uncertain`,绝不自动重发。
`im` 消息来源仅作为归属元数据使用(见[兼容性记录](../../../../docs/persistence-changes/2026-10-28-im-message-source.zh.md))。权限校验由运行中的 IM 服务负责,现有沙箱与审批策略继续生效。
## Alternatives considered
**通过 Host 控制器增加 GUI 客户端。** 这种方式适合文本记录镜像与类型化交互控件,但会引入自动化不需要的对话策略和输出耦合。IM 直接使用 agent 工厂,并保留现有循环。
**在 IM 与 harness 之间使用 ACP。** ACP 支持持久化程序会话,适合进程隔离。独立 IM 发布仍然需要渠道或工具路径;进程内 Cordis 组合在保留自动化语义的同时避免增加进程。
**按聊天手工配置固定会话。** 手工命名每个会话及其来源意味着每新增一个聊天都要修改配置并重启。由 `sources` 与 `defaultDispatch` 组合出的单个会话即可把访问控制保留在来源规则中,无需逐个聊天配置。
**自动重试不确定的发送。** 响应丢失时无法判断平台是否已经创建了消息。保留 `uncertain` 状态供检查可避免自动重复发送,同时允许通过新的工具调用主动重发。
## Consequences
每组 IM 存储和会话由单个主机进程负责,多主机协调需要独立设计。托管会话在首次使用后常驻内存(标记为 `ephemeral` 的临时会话除外,它们在首轮结束后释放 agent)。有限的保留期(`retentionMs`)限定了事件去重窗口,待处理消息和未决回执不会自动过期。恢复投递时扫描 Session 日志核对收件箱消息 ID 会使恢复耗时随会话历史增长。
@@ -21,8 +21,8 @@
en: ca6a5c372bb3cad1
zh: 1cd5028269b58c65
/agent-note-one-fold-motion-for-collapsing-on-the-next-message/testing:
en: 6928ea8cc28112e5
zh: e9d69605558ea102
en: 49ef4fbe86699a2a
zh: b3fa6d77415f3892
/agent-note-one-fold-motion-for-collapsing-on-the-next-message/alternatives-considered:
en: d8e1ea66e293cd93
zh: 0aaa9e693f441673
@@ -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.
## Alternatives considered
@@ -73,7 +73,7 @@ Status: implemented
## Testing
[fold-blank-matrix.e2e.ts](../../../../apps/web/tests/fold-blank-matrix.e2e.ts) 覆盖主会话 19 例与右侧栏子会话 8 例,维度包括读者位置(底部、正文中段、正文开头、步骤中间、上一轮)、输入来源(输入框、回合在写入消息前失败、另一个标签页、排队投递、steer、父消息、一次折叠多轮)、正文长短,以及 Standard 与「完成时收起」对照。布局空洞指视口顶部到输入框之间没有任何可见行的盒子覆盖的最大连续高度:落定后不超过 120 px,动画中至多 1 帧超过。探针在每次渲染机会的动画回调全部结束、绘制之前读取布局;相邻两帧的空洞即使相同,也分别计数。它按盒子计算,已经淡出但尚未收完的收起行仍算作覆盖。「到底部」的用例断言落到底部;「内容不动」的用例断言读者锚定行的屏幕位置变化不超过 2 px。正文很短的用例只断言回复到达后不再留空。
[fold-blank-matrix.e2e.ts](../../../../apps/web/tests/fold-blank-matrix.e2e.ts) 覆盖主会话 19 例与右侧栏子会话 8 例,维度包括读者位置(底部、正文中段、正文开头、步骤中间、上一轮)、输入来源(输入框、回合在写入消息前失败、另一个标签页、排队投递、steer、父消息、一次折叠多轮)、正文长短,以及 Standard 与「完成时收起」对照。布局空洞指视口顶部到输入框之间没有任何可见行的盒子覆盖的最大连续高度:落定后不超过 120 px,动画中至多 1 帧超过。探针在每次渲染机会的动画回调全部结束、绘制之前读取布局;相邻两帧的空洞即使相同,也分别计数。它按盒子计算:已经淡出但尚未收完的收起行仍覆盖它在布局中占据的空间,不论视觉位移把它画在哪里;嵌套在移动行里的行只覆盖移动行没有裁掉的部分。「到底部」的用例断言落到底部;「内容不动」的用例断言读者锚定行的屏幕位置变化不超过 2 px。正文很短的用例只断言回复到达后不再留空。
## Alternatives considered
@@ -12,8 +12,8 @@
en: a15c7c13f167e5ac
zh: 63bcc2ef60c2f344
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/decision/boot-the-same-profile-as-the-served-web-deployment:
en: 9b957e37f290abaf
zh: 06a4599c8fe449ad
en: efd95b62fb8949f9
zh: 135719b3ab2e38ae
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/decision/node-internal-module-interfaces-in-the-worker:
en: 37d8e809eaa21d25
zh: 8c7c31bd6f45c823
@@ -21,8 +21,8 @@
en: 608b24ca97ab5bca
zh: 94bb28377c856b2e
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/decision/separate-archives-for-lazily-loaded-chunks:
en: 428699f74f19e998
zh: 2e8fcdbc9616f70b
en: bb3f7f2737dddec6
zh: c514e53f6a4837ff
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/decision/watching-and-client-plugin-delivery:
en: 814c344e891f7f91
zh: a024d5e30607968b
@@ -30,8 +30,8 @@
en: 99ee505e82fa9c7c
zh: 448bc0e160424cbf
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/consequences:
en: ed424571c81bcb91
zh: 9b79bf03741c1c21
en: e369a4b3dc5ecdb3
zh: 2da4047f4a5486b8
/agent-note-boot-the-preview-worker-from-the-shipped-profile-and-fetch-lazy-chunks-on-demand/testing:
en: 532918df1acd147d
zh: e476c090d183d0a4
@@ -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`.
@@ -51,7 +52,7 @@ The Worker's structural stubs throw errors carrying `ERR_FEATURE_UNAVAILABLE_ON_
### Separate archives for lazily loaded chunks
- **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.
@@ -81,7 +82,7 @@ The Worker's structural stubs throw errors carrying `ERR_FEATURE_UNAVAILABLE_ON_
## Consequences
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.
@@ -27,6 +27,7 @@ Status: implemented
- 镜像里放一份只含清单的 `node_modules/@deepseek-ai/dsh/package.json`(原样复制 `apps/cli/package.json`),作为安装锚点,镜像 manifest 在 `installation` 里记录它。
- 镜像不带组合好的配置,也没有 `config/cordis.yml`;镜像 manifest 记录 Worker 要启动的 `profile`。
- 镜像带一份 home patch `home/cordis.patch.yml`:对运行时 `PLATFORM_ENTRY_CONFIG` 列出的每一行(`session-persistence-jsonl`),写入模板各 bundle 层合成出的配置,并在其上设置所需字段(`compression: none`)。补丁会整体替换一行的配置,所以保留合成出的字段;打包时读取的 bundle 文件就是镜像里的那些。
- 镜像预置 profile patch `home/profiles/<profile>/cordis.patch.yml`,写入 Preview 无需密钥的模型默认值:插入 [`llm-mock`](../../../../packages/experimental/llm-mock/README.zh.md) 行,把 `agent-default-model` 设为 `mock` 路由,并在 `ui-settings-models` 上设置 `credentialOnboarding: false`。App-boot 初始化 profile 时保留已有的 profile patch,ConfigEditor 写入该层,因此用户仍可在模型设置中选择并保存其他模型、添加提供方密钥。Profile 恢复流程把该 patch 移走时,这些默认值也会一并丢失。
- **Worker**
- 用镜像里 app-boot 的 `loadProfile` 从模板初始化 `home/profiles/<profile>`,写空的根 `cordis.yml`,用 `readProfilePatches` 组合。
- profileContext 按 `runProfile` 填写:name、dir、patchPath、installAnchor、startedBundles、cwd、home,overlay 列表为空,因此 Worker 与不带 `--patch` 的启动器一样只调用一次 `readProfilePatches`。
@@ -51,7 +52,7 @@ Worker 的结构化 stub 抛出带 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 的错
### 懒加载 chunk 独立归档
- **分类**:client 构建预设只以 `require.async("./client.<name>.js")` 的形式产出包内 chunk 请求,`verify-client-packages` 禁止同步 require chunk。packer 的 `lazyChunksOf` 扫描清扫后镜像里的每个页面资源(各包的 `lib/client.js` 和 `lib/client.*.js`)中的这些字面量,因此 chunk 引用的 chunk 不必从 `./client` 入口沿请求追踪也能找到。在任一条件下被某个包的 `./client` 导出指向的目标(如 `client.browser.js`)会被立即加载,留在基础镜像;其余目标移出基础镜像。请求包未发布的 chunk 会让打包失败。
- **分类**:client 构建预设只以 `require.async("./client.<name>.js")` 的形式产出异步的包内 chunk 请求,可选带上 `{ deps: [...] }` 预取提示,列出该请求需要的其他所有 chunk([分片依赖](2026-11-26-package-local-chunk-dependencies.zh.md))。packer 的 `lazyChunksOf` 扫描清扫后镜像里的每个页面资源(各包的 `lib/client.js` 和 `lib/client.*.js`)中的这些字面量,包括提示中的项,因此 chunk 引用的 chunk 不必从 `./client` 入口沿请求追踪也能找到。在任一条件下被某个包的 `./client` 导出指向的目标(如 `client.browser.js`)会被立即加载,留在基础镜像;其余目标移出基础镜像。请求包未发布的 chunk 会让打包失败。
- **归档**:每个 chunk 一个确定性 tar.gz,按压缩后归档的 SHA-256 命名为 `lazy/<sha256>.tar.gz`。基础 manifest 的 `lazy` 列表把每个 archive 记录为 `{ archive, files: [{ path, size }] }`,不记录文件 mode。不设大小阈值。
- **登记**:Worker 用 `MemoryVfs.deferArchive` 登记列出的每个文件,同时创建其父目录,并赋予 VFS 默认文件 mode;列出懒加载 archive 的镜像必须从 URL 拉取,archive 名相对这个 URL 解析。`exists`、`stat`、`readdir` 依据登记同步作答。
- **拉取**:Worker 的 `node:fs` 和 `node:fs/promises` 中读取已登记文件的异步接口会等待其 archive:`fs.promises.readFile`、`fs.promises.open`(因此每个 FileHandle 都在到达后才打开)、`fs.promises.cp` 和 `fs.createReadStream`。其中第一个调用拉取 archive、解压,校验其中恰好是登记的路径和登记的大小,再物化文件;并发读取方共用一次拉取。archive 名里的摘要不做校验。拉取失败只让等待它的读取失败;文件保持登记,下一次异步读取再次拉取。
@@ -81,7 +82,7 @@ Worker 的结构化 stub 抛出带 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 的错
## 后果
Preview 启动的组合与正式 Web 相同。不开 bundle 时,Worker 组合与正式 Web 只差 jsonl 的平台覆盖;开任一 bundle 都没有被跳过的补丁。插件页列出全部 `OPTIONAL_BUNDLES`,每个都显示标题和图标,没有元信息错误。11 个 optional bundle 逐个开启再关闭,两次都返回 `applied`;开启后它改动的每个启用行都是 active,关闭后插件列表恢复原样。启用 session-titles 会禁用 `@deepseek-ai/dsh-session-title-first-prompt-llm`(行 `session-title-llm`)并启用 `@deepseek-ai/dsh-session-title-all-prompts-llm`,与正式 Web 一致;启用 inspector-profile 后 Session Inspector 运行,NodeJS Inspector 降级启动。降级以 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 为前提,所以正常 `dsh web` 运行完整的 Inspector。
Preview 启动的组合与正式 Web 相同。不开 bundle 时,Worker 组合与正式 Web 只差 jsonl 的平台覆盖和预置 profile patch 中无需密钥的模型默认值;开任一 bundle 都没有被跳过的补丁。插件页列出全部 `OPTIONAL_BUNDLES`,每个都显示标题和图标,没有元信息错误。11 个 optional bundle 逐个开启再关闭,两次都返回 `applied`;开启后它改动的每个启用行都是 active,关闭后插件列表恢复原样。启用 session-titles 会禁用 `@deepseek-ai/dsh-session-title-first-prompt-llm`(行 `session-title-llm`)并启用 `@deepseek-ai/dsh-session-title-all-prompts-llm`,与正式 Web 一致;启用 inspector-profile 后 Session Inspector 运行,NodeJS Inspector 降级启动。降级以 `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` 为前提,所以正常 `dsh web` 运行完整的 Inspector。
体积(MiB,实测):基础镜像 9.20(打包期组合且 chunk 随启动下载时为 12.79,−28%),含 11 个 optional bundle;另有 5 个 lazy tar 共 4.45(pdf 2.88、excel 1.39、terminal 0.13、frontmatter 0.05、inspector 底部面板 0.00)。基础镜像不含懒加载 chunk,页面请求 chunk 时才拉取对应 archive。
@@ -0,0 +1,37 @@
# Bilingual-pair consistency record for 2026-10-15-desktop-shared-texture-api.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-15-desktop-shared-texture-api.md
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package:
en: de5e9439711001ae
zh: e5ac22aa5d51043d
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/problem:
en: 4adf47d0d97b0e23
zh: 12dedda00f579336
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/decision:
en: beeb92d43bbf3389
zh: 39e77f9c22210ea3
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/decision/desktop-shared-textures:
en: 9cf55a65959c002c
zh: b29f1fc65936632e
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/decision/trust-model:
en: d056763e283a5d30
zh: fd7f1bba0ce5eba6
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/decision/the-frame-forwarding-package:
en: 59b3109d10f52831
zh: f04c9bd2a730b30a
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/decision/frame-path:
en: 7ba66e63258cc160
zh: 87373d062c2dde60
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/alternatives-considered:
en: dfa341b1fe449288
zh: 475e6ab42702ba36
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/verification:
en: a98f84f310538d8b
zh: bd345d71474eb862
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/consequences:
en: b823f7ee32d12180
zh: f7338b942f03e81c
/agent-note-generic-desktop-shared-texture-api-with-a-shared-frame-forwarding-package/consequences/native-producer-sdk:
en: 9eabfbc1a83598d4
zh: d43c9db0b40942c8
@@ -0,0 +1,105 @@
# 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)
│ Packet protocol: hello / allocate / frame (+ handle) / release / message
▼
Host process — frame-forwarding receiver addon + C++ Desktop bridge (attachSink, setDeliverable)
│ credits, budget, handoff, metadata check, deliverable filter → dsh_shared_texture_sink_v2.present
▼
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.
@@ -0,0 +1,105 @@
# Agent Note: 通用 Desktop 共享纹理 API 与共享的帧转发包
Status: implemented
[English](2026-10-15-desktop-shared-texture-api.md) | 中文
## Problem
原生 Office 预览需要把 LibreOffice 进程渲染的纹理不经像素拷贝地送达 Electron renderer,这要求一个 Electron 主进程侧的导入和一个 renderer 侧的 `sharedTexture` 消费者。“Office 预览编辑”bundle 的第一版设计允许 bundle 通过 `dsh.bundle.desktop` 声明 `main`、`preload` 和 `verify` 导出:Desktop 把 bundle 的模块导入主进程,为默认 session 的每一个 frame 注册其 preload,并用 bundle 自带的校验器校验其原生载荷。这种选择只能在应用启动时做出,因此启用或关闭该 bundle 必须重启 Desktop,而启动时的选择又必须穿透 `loadProfileDirectory`、`ProfileRuntimeResolution`、`DSH_DESKTOP_STARTUP_BUNDLES`、插件管理器(`restart-required`、`desktop-only`)、包清单类型和 Web 插件列表加以钉死。任何带有该声明的已安装包都能在主进程和 session 级 preload 中运行代码;而 Electron 的 `setSharedTextureReceiver` 是 document 级单例,两个这样的 bundle 会互相覆盖。
随后的修正把帧转发变成 Desktop 的固定能力:Electron 主进程运行原生接收器(先是从 dsh runtime 内的 LibreOffice Kit 接收端 SDK 加载,后来用拷贝进 `apps/desktop` 的 Kit 源码构建),校验 producer 元数据,并应答携带 viewport、generation 和信用的 `frame-forwarding` 控制消息。于是 `apps/desktop` 带着只有 Office 预览使用的协议,其 preload 暴露的是帧转发而不是纹理,位于 Electron Main 内的接收器不能使用 libuv 且需要与 Electron 兼容的构建,而每次协议变更都要先发 Desktop 版本,Kit 版本才能使用。把 Kit 的 C++ 拷进 Desktop 让同一个协议多出第二个自称的来源;从 Kit 加载则把 Desktop 接收器的每次变更绑死在 Kit 发版上。帧转发也不属于 Office:其他 Host 插件将来也会在各自的原生进程中渲染,因此接收器、传输和 Host 服务也不能归 Office 包所有,Kit 只是多个 producer 中的一个。
Electron 决定了 Desktop 必须持有什么。`sharedTexture.importSharedTexture` 只在主进程运行,且只接受该进程本地的句柄:macOS 上是 `IOSurfaceRef`,Windows 上是 NT `HANDLE`。`sharedTexture.subtle` 导出已导入的纹理供 renderer 导入,每个引用的释放回调在使用它的 GPU 工作完成后运行。托管的 `sendSharedTexture` 最多等待 renderer 确认 1000 ms;此后 Main 释放自己的引用,忙碌更久的 renderer 会导入一个已销毁的纹理并显示空帧。Electron 没有任何 API 能从 Chromium 之外的进程接收 GPU 句柄,Node 也不能接收 Mach 消息或复制 Win32 句柄。在 macOS 上,把外部 IOSurface 带进 Main 需要 Main 里的原生代码;在两个平台上,把 Host 本地句柄送往 Main 都需要 Host 里的原生代码。
Desktop 为这个消费者新增的任何东西,同一进程中的其他代码也能触达:Host 服务能被每个 Host 插件调用,preload 对象能被文档中的每段脚本调用。同一纹理接口的两个消费者会互相抢走对方的帧,在帧转发空闲时注册的消费者会接管该接口。Office 放映还通过 `dshDesktop.window.setFullscreen` 进入窗口全屏,这是 Desktop 的私有 API,Office 以鸭子类型读取它,Main 则靠自己的记录来恢复窗口状态;每个需要全屏的插件(例如游戏)都得要同样的窗口控制。
## Decision
Desktop 持有一个内部共享纹理 API,其唯一消费者是帧转发,包括在 Host 与 Electron Main 之间建立原生通道并跨通道传递 Host 本地句柄的跳转与 ingress addon;没有任何插件在 Electron 主进程或 session 级 preload 中运行代码。[`frame-forwarding`](../../../../packages/experimental/frame-forwarding/README.zh.md) 包为所有 Host 插件持有帧转发:`frameForwarding` Host 服务和 renderer 侧视图。
### Desktop:共享纹理
插件只看到帧转发。共享纹理服务定义位于 [`@deepseek-ai/dsh-shared-texture`](../../../../packages/shared-texture/shared-texture/README.zh.md),采用独立的 Host 与 Client 编译面。其根入口(`.`)定义抽象 Host Cordis 服务 `SharedTexture`(`ctx.sharedTexture`),其 `claim()` 把 `capabilities`、`nativeSink` 和 `adapterLuid` 交给唯一的持有者,直到 `release()` 或发起认领的作用域被销毁;`./types` 入口定义不含 Cordis 依赖的 `SharedTextureClientExport`、`SharedTextureHostExport` 与 `SharedTextureLease`,供 Desktop preload 与 Client 插件共用;`./client` 入口是 Client 插件,把该桥接提供为 Client 侧的 `ctx.sharedTexture`,类型为 `SharedTextureClientExport`。web-app 挂载本包,其 Host 入口不做任何事。由于 Host 与 Client 编译面使用各自独立的 `tsconfig.{host,client}.json` 程序,Host 的 `Context` 声明不会进入 Client 程序。Desktop Main 从 Desktop Host 自己的 `types` 导出([`apps/desktop-host/src/types.ts`](../../../../apps/desktop-host/src/types.ts))导入两者经 Host 子进程通道交换的 `shared-texture` 控制消息(`capabilities` 和 `adapter-luid`)的类型;这是两者之间的私有协议,不是插件 API,hop addon 的接口留在加载它的服务旁边。两侧各自在运行时校验收到的每条消息([Main 的通道](../../../../apps/desktop/src/shared-texture/channel.ts)、[Host 的服务](../../../../apps/desktop-host/src/shared-texture.ts))。两个应用之间没有包依赖:Main 通过 TypeScript 项目引用编译这组导出。Electron Main 通过一个[入口](../../../../apps/desktop/src/shared-texture/main.ts)接入全部内容:它把 [shared-texture 通道](../../../../apps/desktop/src/shared-texture/channel.ts)挂到每个 Host 进程上,并提供窗口级和 Host 级清理;通道在 Main 的 presenter 看到请求之前校验每个控制请求,Host 进程生命周期不携带任何 shared-texture 路由。
- Desktop Host 的 [`sharedTexture` 服务](../../../../apps/desktop-host/src/shared-texture.ts)接收 Host 本地句柄,并在首次使用时加载 Main 在其能力中给出的跳转 addon([`native/shared-texture/hop.cc`](../../../../apps/desktop/native/shared-texture/hop.cc),仅依赖 Node-API 8)。macOS 和 Windows 上都由跳转向 Main 的 ingress 打开一条原生双向连接——macOS 上是一对 Mach 端口,Windows 上是双工消息命名管道并由 Main 把每帧的 Host 本地 NT 句柄复制进自己的进程——每帧的提交、送达回执和结算都走这条连接,Host 的 IPC 通道只承载 `capabilities` 和 `adapter-luid`。每条连接最多接纳 128 个未结算请求;连接丢失时所有未结算请求按 `invalidated` 结算,下一帧打开新连接。`nativeSink(timeoutMs)` 返回一个指向 `dsh_shared_texture_sink_v2`([`native/shared-texture/shared-texture-sink.h`](../../../../apps/desktop/native/shared-texture/shared-texture-sink.h))的不透明 `napi_external` 供同进程原生 addon 使用;按其他 ABI 版本构建的消费者会拒绝它。每帧携带句柄、尺寸、像素格式、元数据和只在 Host 本地生效的送达期限,不带请求标识。sink 归属当前连接:请求已离开 Host 时 `present` 返回 `DSH_SHARED_TEXTURE_PRESENT_OK`,只拒绝这一帧且 sink 仍可用时返回 `DSH_SHARED_TEXTURE_PRESENT_REJECTED`,连接已关闭或丢失时返回 `DSH_SHARED_TEXTURE_PRESENT_DISCONNECTED`,之后每一帧也都如此,消费者随即取得新的 sink。取过 `nativeSink` 的认领结束时会关闭该连接并把未结算帧按 `invalidated` 结算。`adapterLuid(timeoutMs)` 在 Windows 以外直接返回 `null` 而不询问 Main,且从不打开原生连接;Windows 上 Main 从 Chromium 合成器导出一张纹理,经 ingress addon 读出其 adapter 的 LUID,并立即释放该纹理。Main 保留这个答案直到 Chromium 的 GPU 进程退出或 Host 停止,并发查询共用一次读取,失败的读取不保留。答案是小写十六进制的 `<HighPart>:<LowPart>`,与帧转发接收器表示 adapter 的文本一致;Chromium 没有导出 Direct3D 11 合成器纹理、DXGI 读不出其 adapter 或读取被清理取消时为 `null`。
- Main 的 ingress([`native/shared-texture/ingress.cc`](../../../../apps/desktop/native/shared-texture/ingress.cc))最多排队 32 帧等待 Main 的 JavaScript 线程,超出的帧当场按未保留引用拒绝,Host 可立即复用该纹理。对每一帧获准进入的帧,Main 的 [presenter](../../../../apps/desktop/src/shared-texture/presenter.ts) 导入句柄,经 Desktop 的 IPC 把 subtle 传输连同 Host 原样的 metadata 送到产品主 frame。Main 一直持有自己的导入,直到文档报告它已持有自己的引用,再在原生通道上回复 `delivered`;忙碌的 renderer 只会推迟该回复——即使送达超时也继续保留 Host 的槽位直至结算——而不会丢失纹理。Main 在原生通道上对每次获准的呈现只结算一次:自己的释放回调和文档的释放(文档在其释放回调中发出)都到达后回复 `released`;文档、renderer、GPU 进程或 GPU 释放同步先行消失或失败时回复 `invalidated`;不保留引用的失败回复表示 Main 未保留任何引用。Main 校验 Electron 限定的像素尺寸,解析 `metadata` 的 JSON 而不解释其中的字段。
- Main 的 `capabilities` 向 Desktop Host 报告其进程身份,Desktop Host 只把是否支持及原因交给其消费者;macOS 和 Windows 上还报告跳转 addon 路径,并为发出请求的 Host 打开一个仅依赖 Node-API 8 的原生 ingress。macOS 上([`native/shared-texture/ingress-darwin.cc`](../../../../apps/desktop/native/shared-texture/ingress-darwin.cc))ingress 是 Mach 接收端口:仅当消息的 audit trailer 指向 Main 所启动的 Host 进程时才接受,用 `IOSurfaceLookupFromMachPort` 解析携带的端口,交付 Main 本地的 `IOSurfaceRef` 并向 Host 的回复端口应答,同时丢弃其他进程的消息和超长消息而继续接收 Host 的消息。Windows 上([`native/shared-texture/ingress-win32.cc`](../../../../apps/desktop/native/shared-texture/ingress-win32.cc))ingress 是单实例双工消息命名管道:读取前先核对 `GetNamedPipeClientProcessId` 为该 Host 进程并断开任何其他客户端,连接期间持有该 Host 的 `PROCESS_DUP_HANDLE | SYNCHRONIZE` 句柄,把每帧的 NT `HANDLE` 从 Host 复制进 Main;同一 addon 还为 `adapter-luid` 经 DXGI 读取 Main 本地共享纹理的 adapter LUID。ingress 与该 Host 进程同寿命:窗口级清理保留它,因此 Host 每条连接只查询一次能力,之后每一帧都直接经原生通道呈现,无需额外的 IPC 往返。显式的能力查询总会到达 Main;Chromium 改用软件合成时(例如 GPU 进程多次崩溃后),Main 报告 `gpu-compositing-disabled`。Host 发来的协议版本不符或内容畸形的消息会以错误停止 ingress 并结束连接,下一次能力查询会重新打开它。
应用 preload 仅向产品主 frame 暴露 `dshDesktop.textures`:它导入每个传输,立即向 Main 报告结果,把 `{ frame, metadata, release }` 交付给唯一的文档消费者,没有消费者时立即释放到达的纹理。共享纹理 Client 插件把 `globalThis.dshDesktop?.textures` 提供为 Client 侧的 `ctx.sharedTexture`,因此其他 Client 插件从不读取 `globalThis.dshDesktop`。Desktop 不向文档提供窗口控制:要全屏显示视图的插件经帧转发使用文档的 Fullscreen API,Electron 为文档的全屏元素让窗口全屏,现有的状态同步让窗口外观随之调整。当 renderer 或 GPU 进程退出、跨文档导航提交或窗口关闭时,Main 取消待完成的 adapter 读取、拒绝清理期间到达的帧、把已发往文档的纹理结算为 `invalidated`,并开始新的文档代次;GPU 进程退出还会让 Main 忘掉合成器 adapter,只有在 Host 进程停止或失败时才关闭 ingress。Main 从不把未观察到的引用报告为已释放。被取消、被拦截和同文档导航保留文档的纹理,文档代次让跨越 ingress 替换期间发生的 reset 的能力查询失败。
### 信任模型
Main 只信任自己启动的 Host 进程。macOS ingress 丢弃经 audit 的发送方 PID 与 Host 不同的每条消息,并继续接收 Host 的消息;Windows ingress 在读取前核对 `GetNamedPipeClientProcessId`,断开任何其他客户端,并只从该 Host 进程复制句柄。producer 永远不与 Main 通信,Host 中只有 Desktop 的跳转接触 Host 到 Main 的通道。
安全审查面对两条进程边界。Host 到 Main 的边界属于 Desktop:Host 进程中的任何代码都能绕过 `sharedTexture` 服务直接向 Main 发送消息,因此 Main 的请求校验和 ingress 的 PID 检查作为 Desktop 的一部分审计,不随帧转发变化。producer 到 Host 的边界属于帧转发,记录在其[安全语义](../../../../packages/experimental/frame-forwarding/README.zh.md#security-semantics)中。插件 API 只有 `frameForwarding`;将 `sharedTexture` 保留给独占的帧转发消费者,只让它对普通插件不受支持,而不是不可达,因此它不是安全边界。两侧共享纹理接口同一时间都只接纳一个消费者,帧转发在加载期间占用二者:其 Host 插件从加载到卸载持有 Host 的 `sharedTexture` 认领,其 Client 从启动到销毁消费 Client 的 `ctx.sharedTexture`(没有打开的通道时也是如此)。因此其他消费者会立即失败,而不会在帧转发空闲时接管任一接口。认领随发起它的作用域结束,因此未释放就被卸载的持有者无法继续占用它。
### 帧转发包
`@deepseek-ai/dsh-frame-forwarding` 为任何 producer 使用其线上协议的 Host 插件持有帧转发。
- frame-forwarding 工作区将[接收器源码](../../../../packages/experimental/frame-forwarding/native/receiver.cc)与使用其协议的插件放在一起。Desktop 打包时直接从工作区为 macOS 和 Windows 的目标架构编译接收器,并预装二进制文件和构建清单。插件 npm 包不含接收器源码和二进制文件。Desktop 主进程根据当前安装位置或开发目录确定接收器的绝对路径,通过启动参数 `--frame-receiver-path` 传给 Host。Host 通过内部服务 `desktopFrameReceiver` 提供这个路径。插件首次使用时按自身要求校验构建清单中的协议版本和握手能力,再在 Host 进程中加载模块。每个通道的监听和与 producer 的握手都在 Host 进程中完成。
- Host 的 [forwarder](../../../../packages/experimental/frame-forwarding/src/host/forwarder.ts) 持有通道及其 producer 连接([帧转发通道](2026-10-18-frame-forwarding-channels.zh.md))、帧数与字节预算,以及 viewport 确认与重放。打开通道时,它询问 `sharedTexture.capabilities()`,取得 `sharedTexture.nativeSink()`,Windows 上还在创建接收器前通过 `sharedTexture.adapterLuid()` 读取 Chromium 的 adapter;每个通道都会询问,因为 Chromium 的 GPU 进程重启后 Desktop 会重新读取 adapter。它以 `attachSink` 把 sink 挂到该通道的接收器上,呈现期限最多 30000 ms,随后随连接、viewport 和可见性变化通过 `setDeliverable` 更新可交付状态。接收器 addon 内的 C++ Desktop 桥在产生帧的线程上校验 producer 元数据、按该可交付状态过滤帧,并以 `rx`、`connectionId`、`requestId`、`frameId`、`generation`、`revision`、`width` 和 `height` 作为元数据经 `dsh_shared_texture_sink_v2` 提交匹配的帧,稳态帧不经过 Host 的 JavaScript 事件循环。`on_settled` 回调在正常释放时直接归还帧信用;`invalidated` 时先停止接收器再释放交付,并通知 forwarder 以 `lost` 关闭通道。被拒绝的提交和失败的送达向 renderer 报告 `presentation-error`;以 `DSH_SHARED_TEXTURE_PRESENT_REJECTED` 之外的结果被拒的提交会解挂该 sink,被拒绝的单帧则保留 sink;未挂载 sink 时帧以 `frame` 事件到达 JavaScript,forwarder 立即归还信用,重新获取 `nativeSink` 并挂回各打开的通道。
- Host 插件是一个 Typert Remote 服务:消费者使用 `capabilities`、`channel`、`isOpen` 和 `close`;renderer 通过 `viewport` Remote 应用 viewport,并从 `events` 流跟随通道状态。Client 插件仅在 Client `ctx.sharedTexture` 可用时提供 renderer 侧的 `frameForwarding` 服务;`connect(rx)` 返回一个接收通道,它消费 `ctx.sharedTexture`,按元数据中的 `rx` 路由纹理,把每一帧借给消费者回调,并在回调结束后释放该帧。接收通道还持有文档的全屏元素(同一时间只有一个),并向其他通道报告遮挡([帧转发通道](2026-10-18-frame-forwarding-channels.zh.md))。通道随打开它的 Cordis 作用域一起关闭。
- 每个消费者 bundle 都以同一行 `frame-forwarding` 插入帧转发,且不带 config。Loader 对每个 id 只保留一行,因此同时启用的消费者共享同一个实例及其唯一的认领,关闭其中一个消费者时,该实例和其他消费者的通道继续运行;部署方用针对该 id 的 patch 调整其上限。
### 帧路径
```
LibreOffice (Kit producer holding the channel's TX credential)
│ Packet protocol: hello / allocate / frame (+ handle) / release / message
▼
Host process — frame-forwarding receiver addon + C++ Desktop bridge (attachSink, setDeliverable)
│ credits, budget, handoff, metadata check, deliverable filter → dsh_shared_texture_sink_v2.present
▼
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
**保留 bundle 声明的 main、preload 和 verify 导出。** 这为一个消费者把主进程和 session 级 preload 的执行权交给每个已安装的 bundle,在多个 bundle 间重复一个单例 Electron API,并强制只能在启动时激活,连带穿透 app-boot、插件管理器、清单类型和 Web 插件列表的重启管线。评审中否决。
**把帧转发作为 Desktop 的固定能力留在 Electron Main。** 这是中间阶段的决定。它把只有一个插件使用的协议和绑定在 Electron 主进程的接收器留在 `apps/desktop`,把协议变更与 Desktop 发版耦合,并让 preload API 成为帧转发 API。它自身否决过的变体出于同样理由仍被否决:从 dsh runtime 内安装的 Kit 加载接收端 SDK 把每次接收器变更绑在 Kit 发版上;libuv 完成信号(`uv_async_t`)在 Node-API 的 ABI 保证之外,会迫使按 Electron 精确头文件构建。
**让 Office 包自带一个内含跳转的接收器 addon。** 帧转发服务于每个原生渲染的 Host 插件,而不只是 Office;跳转是 Desktop 共享纹理的机制,不是帧转发的。Office 自有的 addon 会被下一个消费者再拷一份,并让一个功能包成为 Mach 和 Win32 句柄传递的所有者。
**Electron 托管的 `sendSharedTexture` 和 `setSharedTextureReceiver`。** 它固定的 1000 ms 确认期限会在 renderer 主线程忙碌更久时让视图失败;即使在期限后继续持有 Main 的导入,也仍会在 renderer 的 GPU 工作完成前把 producer 的纹理归还。经真机卡顿测试后否决。
**通过扩展槽把插件的 addon 加载进 Electron Main。** 插件原生代码会在主进程中运行。在 Host 中加载它,让 Main 的原生代码固定为 Desktop 的 ingress addon。
**现在就把接收器作为预构建的 npm 平台包发布。** Desktop 打包已经在每个目标操作系统上带 C++ 工具链运行;在该包有第二个消费者之前,平台包会增加四个包、一条发布流程和 Windows 预构建 CI。推迟,而非否决。
**Desktop 不含原生代码,像素经 Host 拷贝。** 每帧要拷贝几十 MB,并失去原生预览赖以成立的共享纹理路径。它仍可作为小视口的兜底,不是本设计。
**让 producer 直接把 surface 发到 Main 的 ingress。** 这每帧省一条 Mach 消息,但要求 Main 鉴别一个不是它启动的进程,并要求消费者在启动 producer 之前拿到 Main 的端点。信任模型排除了它;重新考虑的条件是实测的跳转开销。
**全局 IOSurface 标识符(`IOSurfaceLookup`)。** 已被 Apple 弃用,且用户的任何进程都可读取。
**把接收器放在 `apps/desktop-host`。** Desktop Host 将因此背上一个协议的原生构建和服务;Desktop Host 提供共享纹理和预装接收器的位置,协议校验和 Node-API 绑定由插件维护。
**保留 `dshDesktop.window.setFullscreen`。** 它是按插件需求增设的 Desktop 窗口控制,以鸭子类型读取,并需要 Main 一侧的恢复记录。元素全屏以文档为范围,按 Escape 即可结束而无需插件代码,并让帧转发知道是哪个通道遮挡了其他通道。
**让每个消费者 bundle 各自插入一行帧转发。** 两个实例会争夺唯一的 `sharedTexture` 认领和唯一的 renderer 纹理订阅;第二个实例会报告原生渲染不可用,而第一个只服务自己的消费者。
**由 Desktop profile 自身插入帧转发。** 即使没有启用任何消费者,每个 Desktop 会话也会加载接收器并占用 Desktop 的接口,而不带 Desktop 专属行的 profile 也无法继续与 Web 共用。
**让 Office Host 插件自己在 Web 中隐藏 bundle。** 插件不需要 profile 检查:`frameForwarding` 不受支持时它报告不可用,Client 不注册 UI,现有的 PDF 和表格预览保持不变。
## Verification
Desktop 规格测试覆盖 [presenter](../../../../apps/desktop/tests/shared-texture-presenter.spec.ts)(每个 Host 一个 ingress 并在换 Host 时替换、软件合成检测、跳转 addon 路径与 ingress 端点、128 帧上限、不保留引用的 Electron 导入失败、renderer 导入结果(包括忙碌的 renderer、失败的导入和缺失的 GPU 同步 token)、先送达回复再结算回复的顺序、`reset` 在保留 ingress 的同时把已发往文档的帧结算为 `invalidated`、`dispose` 先放弃已发送的帧再关闭 ingress、ingress 失败与重开、adapter LUID 读取按 GPU 进程保留、并发查询共用、失败或被 GPU 进程退出抢先时不保留、Windows 以外返回 null,以及经通道应答的 Main 入口)、[preload 桥接](../../../../apps/desktop/tests/preload-shared-texture.spec.ts)(含导入结果报告,以及消费者和 GPU 用完之后的释放报告)、[已发送纹理的结算](../../../../apps/desktop/tests/shared-texture-transfer.spec.ts)、[shared-texture 通道](../../../../apps/desktop/tests/shared-texture-channel.spec.ts)只接受能力查询与有界 adapter 请求并携带 Host 身份路由控制、[通用 Host 进程通道](../../../../apps/desktop/tests/host-process.spec.ts)、[声明式原生包构建](../../../../apps/desktop/tests/native-package-builds.spec.ts),以及 [shared-texture addon 校验器](../../../../apps/desktop/tests/shared-texture-runtime.spec.ts)。[Desktop 原生 e2e](../../../../apps/desktop/tests/shared-texture-native.e2e.ts) 在独立的 Main 与 Host 进程间经已构建的跳转与 ingress addon 从原生 `dsh_shared_texture_sink_v2` 线程交换真实纹理,覆盖每种回复类型、无法离开 Host 的呈现不发送即被拒、报告 sink ABI 版本 2 使按其他版本构建的消费者拒绝它、Main 的 JavaScript 线程阻塞时超出 32 帧投递队列的帧当场被拒并在恢复后继续处理、忽略端点上的其他进程并继续服务已注册的 Host、发送时发现 Main 已退出或 Main 无法投递其回复时结束连接、协议版本不符或请求畸形时停止 ingress、执行跳转送达期限的同时保留槽位直至 Main 结算、关闭或 Main 退出后的重连与单次结算,以及把共享 Direct3D 11 纹理的 adapter LUID 读成 Host addon 推导出的文本、其他句柄读不出 adapter。[构建产物 preload 的 e2e](../../../../apps/desktop/tests/preload.e2e.ts) 断言 `dshDesktop.textures` 只暴露 `onFrame`,且 `dshDesktop` 不暴露窗口控制。[Desktop Host 规格测试](../../../../apps/desktop-host/tests/shared-texture.spec.ts)覆盖唯一的认领、认领随发起它的作用域结束(包括像帧转发那样在该作用域的 effect 中发起的认领)、作用域销毁前的释放不影响下一个持有者的认领、跳转连接复用以及断连时把未结算帧置为 `invalidated` 并重连、取过 `nativeSink` 的认领结束时关闭该连接而未取过的认领正常结算、`adapterLuid` 不打开原生连接即返回 Main 的读取结果或 null、拒绝不是 LUID 的读取结果、报告 Desktop 给出的原因、超时并忽略迟到的回复、无关的通道流量,以及销毁时拒绝待完成的工作。帧转发规格测试覆盖 [forwarder](../../../../packages/experimental/frame-forwarding/tests/forwarder.host.spec.ts)(每个 Windows 通道都向 Desktop 读取 adapter LUID、每个通道都向 Desktop 取当前的 `nativeSink` 且并发请求合并、sink 期限上限 30000 ms、未挂载帧到达 JavaScript 时的刷新、在发出每个 viewport 之前更新可交付状态、呈现错误与失效处理、producer 连接与交接、viewport 重放、拆除)、[Host 服务](../../../../packages/experimental/frame-forwarding/tests/service.host.spec.ts)及其认领、由打开方作用域持有的通道和 Remote、[接收器加载器](../../../../packages/experimental/frame-forwarding/tests/native.host.spec.ts)及其构建记录检查、[Client 挂载](../../../../packages/experimental/frame-forwarding/tests/mount.client.spec.ts)、[wire 适配](../../../../packages/experimental/frame-forwarding/tests/wire.client.spec.ts)(含常驻的纹理订阅与全屏持有者)和[接收通道](../../../../packages/experimental/frame-forwarding/tests/rx.client.spec.ts)。[Desktop 桥原生 e2e](../../../../packages/experimental/frame-forwarding/tests/desktop-bridge-native.e2e.ts) 驱动真实 producer 穿过已构建接收器的 C++ sink 桥,覆盖元数据投射、正常释放和处于可交付状态之外时的信用归还、送达错误、被置为失效的帧先发出通知、再停止接收器及其连接后才释放、单帧被拒时保留 sink 而连接断开时解挂 sink 让后续帧到达 JavaScript、`present` 内同步触发的回调、拒绝其他 magic 或版本 1、3 的 sink 的 ABI 检查、接收器关闭并被垃圾回收后到达的结算,以及在 Desktop 的 addon 已构建时经 DesktoLine truncated
## Consequences
插件可以在运行时安装或启用。由 Desktop 预装接收器,可以在没有 C++ 工具链的机器上启用 Office 预览;接收器的协议和原生修复随 Desktop 发版。各版本插件自行校验预装接收器,不兼容时报告不可用。稳态帧绕过 Host 的 JavaScript 事件循环;在 Host 与 Main 之间,每帧在 macOS 上开销为 Mach 消息,在 Windows 上开销为命名管道消息加 Main 执行的一次 `DuplicateHandle`,没有像素拷贝。纹理生命周期跨越三个进程:Main 自己持有并在 Electron 的 GPU 工作完成或 Host 拆除时关闭它从 Host 复制来的 Windows 句柄,Main 退出会连带结束 Host 和 producer。Windows 上由 Main 以 `PROCESS_DUP_HANDLE | SYNCHRONIZE` 打开自己启动的 Host,Host 从不打开 Main;打开失败会断开管道,`DuplicateHandle` 被拒绝会返回送达错误,而不是静默地什么都不呈现。
### Native producer SDK
原生 producer 接口仍在随 Office 集成调整。DSH 暂不向第三方发布 producer SDK:现在公开 C 头文件和静态库会让外部插件依赖仍可能变化的调用方式。待接口定型后再决定是否开放。LibreOffice Kit 通过自己的引擎接入。
@@ -0,0 +1,46 @@
# Bilingual-pair consistency record for 2026-10-18-frame-forwarding-channels.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-18-frame-forwarding-channels.md
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget:
en: 6ffcd2e12496f609
zh: 3aac5b5b6fcaf426
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/problem:
en: 41f0d6fa7045c3a2
zh: 15ee3e573127d43c
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision:
en: a15c7c13f167e5ac
zh: a15c7c13f167e5ac
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/channels-and-credentials:
en: ccf914afe119ab1e
zh: 12fbff4a5e879ca4
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/connections-and-handoff:
en: 4fdd0bed5e2a8bf9
zh: 361d50bee163c4d9
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/producers-name-only-their-own-handles:
en: 1c00e9088f93e12f
zh: 060e06ef9ebc164b
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/compatibility:
en: 0f0266faf90bd2b2
zh: 565841a9155bbfed
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/host-and-renderer:
en: 135ab5329118eadb
zh: dd5f84ac1358764b
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/hidden-and-covered-views-return-their-surfaces:
en: 216abcac1e6cd25d
zh: d19600a531086ccb
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/the-window-budget-follows-physical-memory:
en: 070fdad928fd862d
zh: 85f39b3adccc19c5
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/decision/fullscreen-belongs-to-frame-forwarding:
en: 01ca9d01aacc84d6
zh: 82b7c5cdeedb33e1
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/alternatives-considered:
en: 43089e5b5935fe17
zh: 9534aa449fbdd343
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/verification:
en: f9130f0bda61a5d7
zh: c1bf0f49f6c51908
/agent-note-frame-forwarding-channels-with-transferable-credentials-producer-local-handles-covered-views-and-a-memory-sized-budget/consequences:
en: d73bd477975a1249
zh: db4e9d5732c05513
@@ -0,0 +1,101 @@
# 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.
@@ -0,0 +1,101 @@
# Agent Note: 带可转交凭据、生产者自有句柄、被遮挡视图和按内存定额预算的帧转发通道
Status: implemented
[English](2026-10-18-frame-forwarding-channels.md) | 中文
## Problem
帧转发视图只授权一个生产者进程。Host 插件启动生产者,向其传递私有端点,再调用 `bind(viewId, pid)`;接收端只接受该 PID,不能重新绑定,生产者断开时视图随之失败。因此替换生产者意味着新的接收端、新的视图标识和新的渲染端消费者:Office 预览的 CPU 重启要重建整条路径,引擎崩溃会带走其视图,父进程还必须在子进程连接前得知其 PID。PID 也不适合作为授权身份:操作系统会复用 PID,它指代进程而非权限持有者,同一功能的后继进程也无法继承它。
一旦任何持有通道凭据的进程都能连接生产者,这样的生产者能对 Host 做什么就变得重要。在 Windows 上,生产者把每帧的 NT 句柄复制进接收端进程并发送复制后的值,接收端则把收到的任何值都当作自身的句柄。因此,带有伪造值的包会让 Host 把该句柄当作纹理打开,或在出错路径上关闭它,无论它指向 Host 中的哪个对象。这一方案还要求生产者持有 Host 的 `PROCESS_DUP_HANDLE` 权限,而在低于 Host 完整性级别的沙箱中运行的引擎拿不到该权限。
窗口内所有通道共享一个按先来先得授予的字节预算。视图被隐藏的生产者虽停止渲染,却仍保留其空闲池中的 surface 和尚在申请中的分配,于是可见视图可能排在隐藏视图之后,等待一份无人使用的预算。放映时一个视图占满屏幕,被它遮挡的视图仍在渲染无人可见的帧,帧转发也无从知道是哪个通道遮挡了其他通道。
预算还固定为 256 MiB,最多 1 GiB,与机器无关。传输 4K 帧的通道最多持有三个 3840×2160、每个 31.64 MiB 的 surface,两个这样的通道就能占满预算;在 Windows 中继路径上,每个通道还要预留三个目标纹理和两个暂存纹理,一个 4096 像素宽的放映帧超出了单次分配可占的份额。
## Decision
### 通道与凭据
接收端是一个由两半组成的逻辑通道。Host 插件调用 `frameForwarding.channel()` 得到 `{ tx, rx }`:`tx` 是不透明、可序列化的凭据,任何持有副本的进程都可出示;`rx` 是接收身份,渲染端将其传给 `frameForwarding.connect(rx)`。`close(rx)` 永久关闭通道并撤回凭据;读取该服务的 Cordis 作用域销毁时,通道也随之关闭。`bind`、`bindProducer` 和接收端永久的预期 PID 已不存在;操作系统报告的对端进程仅按物理连接用于检查数据包来源和句柄复制。凭据从不进入渲染端、日志或诊断信息。
### 连接与交接
通道同一时间只服务一个连接,状态依次为 Idle → Active(N) → Draining(N) → Idle → Active(N+1);任何状态都可进入 Closed 或 Failed。连接 ID 递增且永不复用;ready 携带 N,之后每个数据包都按其校验。N 在线时,其他候选连接以 `channel-busy` 被拒绝,N 即使停止响应也不会被抢占。N 因 goodbye、错误或进程退出而断开后,其帧、分配、预算、中继状态和已提交的 GPU 工作一直保留到各自释放。排空期间,一个通过认证的后继在自身截止时间和取消条件内等待 ready,其余候选被拒绝。帧和分配按连接区分,交付 ID 在通道内保持唯一,信用只返还给帧所属的连接,N 迟到的释放不会给 N+1 返还任何东西。完成情况未知的 GPU 工作保留其资源并报告 `drain-blocked`;不存在结束排空的超时。macOS 上每个连接拥有自己的 Mach 端口,随 ready 交付;Windows 上每个连接使用独立的管道实例;握手失败只关闭该候选连接。生产者的 `close()` 在本地发送端关闭后完成,后继的 ready 标志交接完成。
### 生产者只指名自己的句柄
握手能力 `producer-local-handles` 声明生产者指名的每个句柄都归它所有。在 Windows 上,帧携带的是生产者进程中的句柄值。管道客户端连接时,接收端根据 `GetNamedPipeClientProcessId` 以 `PROCESS_DUP_HANDLE | SYNCHRONIZE` 打开该进程,并从那里复制每一帧的值。若值不对应仍在运行的生产者的任何句柄,该连接以“sent a handle it does not own”结束,且不触碰任何 Host 句柄;已退出的生产者带走了自己的句柄,其连接以丢失结束。携带句柄的 hello 会被丢弃,生产者一侧从不解读收到的值。macOS 保留 Mach 端口传递,由内核在接收端中为端口权限命名。
### 兼容性
通道不改变通信协议的版本、常量、数据包布局或端点前缀,只增加双方都检查的 hello 能力位。当前的通信协议为版本 2,每个数据包由固定的包头加上仅含其文本字节的部分组成,并要求同样的能力。hello 声明 `transferable-tx` 和 `producer-local-handles`。ready 在 token 字段中携带连接 ID,并在此前未使用的 `ready.stride` 中回显接收端接受的能力。接收端以 `transferable-tx-required` 拒绝不带 `transferable-tx` 的生产者,以 `producer-local-handles-required` 拒绝不带 `producer-local-handles` 的生产者,并以写明双方版本的 `protocol-mismatch` 拒绝其他版本的生产者。生产者拒绝不含连接 ID 或未回显 `producer-local-handles` 的 ready,因此混合构建的任一方都不会按另一套规则发送或读取句柄值。构建记录(Kit 的 `sdk.json`、`receipt.json` 和预构建清单,以及 DSH 的 `frame-forwarding.json`)列出 `capabilities: ["transferable-tx", "producer-local-handles"]`,其加载器和校验器拒绝缺少其中任一能力的产物,因此仅版本号相同永远无法通过兼容性检查。Desktop [预装接收器](2026-10-15-desktop-shared-texture-api.zh.md)。Kit 0.2.3 引擎是协议 1 的生产者,协议 2 的接收器以 `protocol-mismatch` 拒绝它。
### Host 与渲染端
Host 按通道保存渲染端最新的视口,发送给每个新连接,并且只呈现当前连接 generation 不超过最新视口版本的帧。门控在视口发出之前就已打开,因为接收器在原生代码里判定帧,可能早于 Host 的 JavaScript 处理排在该帧之前的确认。视口请求属于接收它的连接,该连接结束时报告 `producer-changed`;超时只让该请求失败,通道保留。每个事件流订阅先收到所有通道状态的快照,随后收到带递增序号的状态和生产者错误。帧元数据在 `generation`(仍为视口版本)旁携带 `connectionId`。`FrameRx` 在生产者切换后继续交付最新帧。连接状态尚未到达的帧在通道帧上限内等待,渲染端释放更早连接的帧。原生生产者仍可通过 `dsh_frame_forwarding_submit` 按序提交帧,或通过 `dsh_frame_forwarding_submit_latest` 提交可替换的帧。`ready()` 在生产者确认最新视口后完成。
[Desktop 的结算](2026-10-15-desktop-shared-texture-api.zh.md)在文档、渲染进程或 GPU 进程先行消失时报告 `invalidated`;收到它时,桥先把通知排入队列,再停止接收器和该帧所属的连接,然后释放交付,因此其生产者不会再写入该纹理;forwarder 处理该通知后以 `lost` 关闭通道。相比之下,生产者断开则排空后交接。
### 隐藏和被遮挡的视图归还 surface
视图被隐藏或遮挡时,消费者以下一个视口版本发送 `visible: false`。生产者 SDK 的 `dsh_frame_forwarding_trim` 释放所有既未被获取也未被提交的 surface:可用的 surface、排队中的最新帧、已获批但尚未创建的分配,以及尚在申请中的分配;在 Windows 上它随后刷新生产者的 D3D11 上下文,因为 D3D11 只在下一次刷新时销毁已释放的纹理。Kit 引擎在确认不可见视口后执行收缩,使其分配回到共享预算,下一个可见帧再重新申请。
### 窗口预算随物理内存确定
默认值 `maxBytes: auto` 在第一个通道打开时解析为物理内存的一半,且不低于 256 MiB;任何预算都不超过物理内存,更大的字节数降为物理内存并在 Host 日志中警告。预算等到第一个通道才确定,因为从不加载接收器的 Host(例如浏览器 worker 部署)读不到物理内存。预算是上限而非预留:每个通道仍最多持有 `maxFrames` 个 surface,因此更大的预算让更多通道能同时持有 surface,而不会让任何一个通道变大。分配放不进预算的 producer 会等待其他通道归还 surface;其通道保持打开,它的消费方保留已显示的内容,并在内容尚未到达处绘制占位。
### 全屏归帧转发所有
接收通道通过文档的 Fullscreen API,以 `FrameRx.requestFullscreen(element)` 全屏显示其消费者的元素;消费者须在点击处理函数 await 任何东西之前调用它。同一时间只有一个通道持有全屏。其他每个通道收到 `{ active: true, holder: false }`,并将其视图视为被遮挡;全屏结束时(包括按 Escape),持有者收到 `active: false`;关闭持有全屏的通道或销毁 Client 都会退出其全屏。Desktop 自身不暴露任何窗口控制([共享纹理 API](2026-10-15-desktop-shared-texture-api.zh.md))。
每个文档视图的 Host 操作按到达顺序执行,不同视图并发执行,因此等待帧 surface 的视图只会推迟它自己后续的操作。错过 `frameTimeoutMs` 的帧,或 Kit 引擎自身报告没有空闲的帧 surface,都不会让视图失败:图块和分页预览在迟到的请求结束后重新请求其帧,放映保留其流;视图保留已保存的图块、分页预览或放映的最后一帧,在尚无内容处绘制棋盘格,并提示正在等待图形内存,直到有帧绘制出来。
## Alternatives considered
**把接收端重新绑定到后继的 PID。** 这仍以 PID 作为权限,父进程仍须在子进程连接前得知其 PID,崩溃接管也需要新的绑定调用。
**超时后抢占在线的生产者。** 停滞的生产者可能仍持有作用于通道纹理的 GPU 工作,抢占会在纹理仍被使用时把它们交给后继。只有操作系统的断开或生产者自身的关闭才开始排空。
**立即连接后继,并单独保留旧连接的帧。** 两个生产者会共用一个通道的预算和帧上限,渲染端会交错收到双方的帧。先排空保证同一时间只有一个生产者的资源和信用在途。
**像以前一样为每个生产者打开新通道。** 每次切换生产者都会替换渲染端的消费者,并丢失其视口和流式订阅。
**为通道启用新的通信协议版本。** 通道不改变数据包布局;双方都检查的能力位同样能拒绝混合构建,帧转发 README 也承诺同一版本内的线上协议只通过这类能力演进。
**通过排空归还已失效的纹理。** Desktop 无法观察这些纹理剩余的引用,后继可能写入过期文档仍在读取的纹理;只有通道关闭后释放它们才安全。
**使用前校验收到的值。** 接收端可以检查该值是否指向共享的 D3D11 纹理。但这只检查对象的类型而非归属:指向另一通道纹理或 Host 中其他共享对象的伪造值仍能通过,出错路径也仍会释放该值。
**保留生产者一侧的复制,由接收端验证。** 没有生产者的句柄表,接收端无法区分生产者复制进来的值与猜测的值;生产者也仍需持有 Host 的 `PROCESS_DUP_HANDLE` 权限,而沙箱中的引擎没有该权限。
**新增一条暂停被遮挡生产者的线上消息。** 视口的可见性已经告诉生产者停止渲染,携带由 Host 排序的版本,并通过视口重放到达每个新连接,因此单独的暂停消息与之重复。
**每通道字节上限或通道数上限。** 收缩被遮挡的视图、通道随打开它的作用域一起关闭,已能处理观察到的争用;在 Windows 中继路径上,预算公式会让较低的上限卡住 4K 放映。等测量证明需要时再做。
**让文档根元素全屏,并把放映浮层保留在 `document.body`。** 这样应用界面会一起占用全屏屏幕,其中包括需要另行处理全屏的 Windows 菜单和标题栏按钮,帧转发也无法指明是哪个视图在遮挡。
**Keyboard Lock。** 让持有者保留 Escape 适合游戏而不适合放映,等有消费者需要时再做。
**保留固定的默认预算。** 无论机器有多少内存,256 MiB 在共享纹理路径上只能容纳两路 4K 流,在中继路径上会拒绝 4096 像素宽的帧。
**物理内存的四分之一**,即 Chromium 为渲染进程 tile 内存设的上限。一半能让更多视图同时渲染,契合尽量使用机器已有资源的目标,并且仍低于 Metal 建议的工作集,约为统一内存的三分之二到五分之四。
**物理内存的 95% 或 100%。** 操作系统的图形上限更低:WDDM 允许图形使用 `min(80%, max(RAM − 16 GB, 50%))` 的系统内存,Metal 建议的工作集即上述比例。同一份内存还要容纳引擎、Chromium 和其他应用。帧转发将永远不会先拒绝:耗尽会出现在操作系统让分配失败的地方,例如 Chromium 的 GPU 进程,其退出会关闭所有通道;producer 让 Host 和 GPU 进程持有的帧内存也将不受任何约束。
**帧错过期限时让视图失败。** 分配不足通常是暂时的:隐藏、遮挡或关闭另一个视图就能释放它,而失败的视图要等用户重试。
**让所有 Office 操作走同一个 Host 队列。** 等待帧 surface 的视图会在引擎整个等待期间挡住其他所有文档的操作,打开一个文档也会让其他文档停顿。
**区分预算等待与停滞的引擎。** 接收器不会向 Host 报告尚未批准的分配,区分这种状态需要新增一项从生产者到 Host 的诊断;停止响应的引擎仍会在 `operationTimeoutMs` 到期时结束。
**按操作系统的 GPU 预算确定预算**(DXGI `QueryVideoMemoryInfo`、Metal `recommendedMaxWorkingSetSize`)。它能跟随物理内存反映不出的独立显存,但需要接收器调用各平台的原生 API 查询 GPU 预算。
## Verification
Kit 的传输测试和 DSH 的[接收器原生 e2e](../../../../packages/experimental/frame-forwarding/tests/receiver-native.e2e.ts) 用复制的凭据连接独立的生产者进程,覆盖忙碌拒绝、等待中的后继、截止时间到期、崩溃接管、跨连接复用 ID 及迟到释放、双向的混合构建拒绝(包括不具备 `producer-local-handles` 的生产者和未回显能力的 ready)、多次交接后的预算归还,以及被收缩的生产者的分配交给共享其预算的另一个通道。在 Windows 上,Kit 的测试会在生产者发送接收端句柄的值时关闭其连接,而该哨兵句柄保持有效,并显示经共享纹理和中继两条路径收缩的纹理释放其显存;串行的原生测试套件在 macOS arm64、两台 Windows x64 硬件主机和 Windows ARM64 上通过。[Kit 帧 e2e](../../../../packages/experimental/frame-forwarding/tests/kit-frames-native.e2e.ts) 把真实 Office 引擎的通道交给替代引擎,并在崩溃后交给后继;它还在两个通道上同时渲染两个引擎,并收缩不可见引擎的 surface。单元测试覆盖 Host 的视口重放和绑定连接的请求、渲染端的快照与序号处理及提前到达帧的排序,以及 [wire 适配](../../../../packages/experimental/frame-forwarding/tests/wire.client.spec.ts)与[接收通道](../../../../packages/experimental/frame-forwarding/tests/rx.client.spec.ts)的唯一全屏持有者、遮挡事件、在进入全屏尚未完成或已按 Escape 后的退出,以及关闭和销毁时的退出。[服务规格测试](../../../../packages/experimental/frame-forwarding/tests/service.host.spec.ts)覆盖 `auto` 取物理内存的一半、其 256 MiB 下限,以及超过物理内存的预算被拒绝加载。
## Consequences
生产者替换和崩溃接管保留通道、渲染端消费者和视口,且无需 PID:父进程只需交出一个字符串。代价是:协议 1 的所有接收端、生产者、引擎和构建记录必须一起升级,旧构建会被明确拒绝:Kit 0.2.2 及更早的生产者和接收端在两个方向上都无法与这些源码互通,因此 Kit、其引擎以及在打包时编译接收器的 Desktop 必须一起升级。保持连接但停滞的生产者会阻塞其通道,直到它退出或通道关闭;后继要等待 Desktop 及其消费者释放前一个生产者的帧。GPU 进程退出会关闭画面上有帧的通道,消费者须打开新通道,而不能继续使用旧通道。生产者必须让已发送的句柄保持打开,直到接收端读取该帧;提交后立即退出的生产者会连同其连接一起丢失这一帧。在低于 Host 完整性级别的沙箱中运行的引擎依然可用,因为只有 Host 打开另一进程;反过来,权限高于 Host 的 producer 无法被 Host 打开,因而无法连接,接收器会在握手时关闭它,且 Host 不记录诊断。重新可见的视图要等到分配获批后才能出第一帧,收缩只归还帧 surface,不归还引擎自身的渲染缓存。Escape 总会退出全屏;遮挡以文档为范围:文档中的全屏元素会遮挡除持有者以外的所有接收通道。在 32 GB 及以下的 Windows 机器上,物理内存的一半等于 WDDM 允许图形使用的系统内存,因此那里可能先达到操作系统的上限而非预算;独立 GPU 把帧放在其独立显存中,预算看不到这部分内存,显存用尽时 WDDM 会换页而不是失败。
@@ -12,11 +12,11 @@
en: 8ffcd355ec5e8271
zh: 2932530bf783e3f7
/agent-note-client-plugin-package-assets-served-by-url/decision/references-and-file-names:
en: 704267953c123629
zh: 860997024ad7825e
en: a97bfcd05c710f0f
zh: 3679312c92bf39ee
/agent-note-client-plugin-package-assets-served-by-url/decision/build:
en: 485013b2b6778fa2
zh: 7e5cb238bb2b8585
en: e1f52e41d5207cae
zh: a378ce36e9e4c17c
/agent-note-client-plugin-package-assets-served-by-url/decision/host-route:
en: 151b7300f5b27a9f
zh: fae9adff942c2ce8
@@ -27,8 +27,8 @@
en: eedff52d04763c50
zh: 203bfcf81242b8fe
/agent-note-client-plugin-package-assets-served-by-url/decision/gates-and-migration:
en: 1e4d83d0de2d47c9
zh: dc2c2876c73d3b1c
en: c3a4201627d742bb
zh: 03fa25c637a2a803
/agent-note-client-plugin-package-assets-served-by-url/alternatives-considered:
en: 98960e10634ee536
zh: f0fdb0b0cdf9511c
@@ -26,11 +26,11 @@ plugins/@deepseek-ai/dsh-client-ui-chat/assets/running-whale%402x-06738fa29b2f.p
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.
## Alternatives considered
@@ -26,11 +26,11 @@ plugins/@deepseek-ai/dsh-client-ui-chat/assets/running-whale%402x-06738fa29b2f.p
路径逐段先用 `encodeURIComponent` 编码,再编码 `!`、`'`、`(`、`)` 和 `*`,因此引用本身也是合法的无引号 CSS `url()`;包名原样输出。URL 和其他应用自有路由一样相对外壳文档,在任意挂载下、以及在注入的 `<style>` 文本中都能正确解析。组件不需要 hook、注入值或 service:URL 就是模块首次运行时算出的常量。
支持的扩展名是 `.svg`、`.png`、`.webp`、`.jpg` 和 `.jpeg`。client-modules 的 [`src/assets.ts`](../../../../packages/client/modules/src/assets.ts) 统一定义类型表、导出键与目标、revision、产出文件名和 URL,预设、路由和门禁都从这里读取。共享的 Client 类型根 [`scripts/types/client-assets`](../../../../scripts/types/client-assets/index.d.ts) 在 [`tsconfig.base.client.json`](../../../../tsconfig.base.client.json) 中登记,把每个扩展名声明为默认导出字符串的模块;有测试保证它与类型表一致。
支持的扩展名是 `.svg`、`.png`、`.webp`、`.jpg`、`.jpeg`、`.woff2`、`.woff`、`.ttf` 和 `.otf`。client-modules 的 [`src/assets.ts`](../../../../packages/client/modules/src/assets.ts) 统一定义类型表、导出键与目标、revision、产出文件名和 URL,预设、路由和门禁都从这里读取。共享的 Client 类型根 [`scripts/types/client-assets`](../../../../scripts/types/client-assets/index.d.ts) 在 [`tsconfig.base.client.json`](../../../../tsconfig.base.client.json) 中登记,把每个扩展名声明为默认导出字符串的模块;有测试保证它与类型表一致。
### 构建
动态浏览器 face 的 `dsh-package-asset` 插件按源码位置解析 import。以下情况构建失败:文件真实路径不在本包 `src/client/assets/` 内(他包或依赖里的图片也因此被拒绝);`exports["./assets/*"]` 不是恰好 `./lib/assets/*`;扩展名不受支持;路径段为 `node_modules` 或含 Host 路由无法提供的 `%`、`#`、`?`、`\` 或 NUL;扩展名不是小写(导入类型只声明小写扩展名)。每个文件每次构建只产出一次,并登记为监听输入。三条 CSS 管线(CSS Modules、全局样式、`?inline`)对本包 `src/` 内的样式表,经 lightningcss visitor 改写相对 `url()`;`data:`、片段、带协议、以 `/` 开头和空的 URL 保持不变,带片段或查询串的相对文件引用会让构建失败,依赖包的样式表不改写。lightningcss 不会在 `image-set()` 内部调用 `Url` visitor,因此由 `Image` visitor 按同样的规则改写这些选项。改写时先写入 lightningcss 从不转义的标识符占位,因此含括号或引号的文件名仍会变成对应的解析调用。双 face 包的 Node Client face 拒绝资源 import。浏览器 face 是 `lib/assets/` 的唯一写入方:一次性构建会删除本次没有产出的文件,watch 重建则保留它们,因为 Host 仍在提供上一代 bundle,运行它的页面会请求那些文件名。
动态浏览器 face 的 `dsh-package-asset` 插件按源码位置解析 import。以下情况构建失败:文件真实路径不在本包 `src/client/assets/` 内(他包或依赖里的图片也因此被拒绝);`exports["./assets/*"]` 不是恰好 `./lib/assets/*`;扩展名不受支持;路径段为 `node_modules` 或含 Host 路由无法提供的 `%`、`#`、`?`、`\` 或 NUL;扩展名不是小写(导入类型只声明小写扩展名)。每个文件每次构建只产出一次,并登记为监听输入。三条 CSS 管线(CSS Modules、全局样式、`?inline`)对本包 `src/` 内的样式表,经 lightningcss visitor 改写相对 `url()`;`data:`、片段、带协议、以 `/` 开头和空的 URL 保持不变,带片段或查询串的相对文件引用会让构建失败。属于某个依赖包的样式表——即样式表上方最近的、带 `name` 且不是本包的 `package.json`——同样改写:被引用的文件必须位于该依赖包内,并输出到 `lib/assets/vendor/<依赖包名>/<依赖包内路径>`,每个 `@font-face` 只保留第一个 `url()` 来源。既不属于本包 `src/`、也不属于任何依赖包的样式表不改写。lightningcss 不会在 `image-set()` 内部调用 `Url` visitor,因此由 `Image` visitor 按同样的规则改写这些选项。改写时先写入 lightningcss 从不转义的标识符占位,因此含括号或引号的文件名仍会变成对应的解析调用。双 face 包的 Node Client face 拒绝资源 import。浏览器 face 是 `lib/assets/` 的唯一写入方:一次性构建会删除本次没有产出的文件,watch 重建则保留它们,因为 Host 仍在提供上一代 bundle,运行它的页面会请求那些文件名。
### Host 路由
@@ -48,9 +48,9 @@ plugins/@deepseek-ai/dsh-client-ui-chat/assets/running-whale%402x-06738fa29b2f.p
### 门禁与迁移
[`check-workspace-constraints`](../../../../scripts/check-workspace-constraints.ts) 要求声明导出时 `files` 含 `lib/assets`。[`verify-client-packages`](../../../../scripts/verify-client-packages.ts) 要求导出目标精确匹配,只允许动态 Web Client 包声明该导出,并要求导出与包内引用(import,以及其 Client 源码所 import 的样式表中的 `url()`)双向一致。[`verify-package-dependencies`](../../../../scripts/verify-package-dependencies.ts) 把 `./assets/*` 视为非代码导出。ui-settings-account 和 ui-chat 已迁移到包资源,ui-chat 的 tsdown 插件已删除。
[`check-workspace-constraints`](../../../../scripts/check-workspace-constraints.ts) 要求声明导出时 `files` 含 `lib/assets`。[`verify-client-packages`](../../../../scripts/verify-client-packages.ts) 要求导出目标精确匹配,只允许动态 Web Client 包声明该导出,并要求导出与包内引用(import,以及其 Client 源码所 import 的本包与依赖包样式表中的 `url()`)双向一致。[`verify-package-dependencies`](../../../../scripts/verify-package-dependencies.ts) 把 `./assets/*` 视为非代码导出。ui-settings-account 和 ui-chat 已迁移到包资源,ui-chat 的 tsdown 插件已删除。
三方库自己加载的资源(PDF.js 的字体、cmap、wasm 和 worker)、插件元数据图标、详情文档图片,以及 static-linked 包,保留各自的交付方式。
三方库自己加载的文件(PDF.js 的字体、cmap、wasm 和 worker)、插件元数据图标、详情文档图片,以及 static-linked 包,保留各自的交付方式。
## Alternatives considered
@@ -9,8 +9,8 @@
en: f2c70036a57ddb41
zh: 9bbbf3dd09d486f5
/agent-note-durable-computer-use-consent-within-one-profile/decision:
en: 11622523090f5d88
zh: 1d0f8ad94645f069
en: fa65adc692d849b8
zh: 15d234ba7b791b45
/agent-note-durable-computer-use-consent-within-one-profile/alternatives-considered:
en: 2af74afa3ecaf3b9
zh: 96f7f43c5d1150df
@@ -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.
@@ -10,7 +10,7 @@ Status: implemented
## 决策
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)决定选择匹配哪些已存储记录。
每个操作使用现有文件锁,在 profile 锁内打开并读取最新存储状态,关闭域后才释放锁。原生操作和撤销使用单独的目标应用锁;原生调用期间仍可读取存储或访问其他应用。撤销先取消本进程中受影响的工作,再等待其他进程已获准执行的操作结束后提交。因此,撤销完成后不会留下仍使用旧授权的操作。应用级撤销代次和各对话的决定版本,阻止旧句柄或迟到回答恢复被撤销的访问权限。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-10-19-im-session-strategies.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-19-im-session-strategies.md
/agent-note-im-session-strategies:
en: c701e8fcc2c77418
zh: de6be36e59ef1ace
/agent-note-im-session-strategies/problem:
en: 5ce30763ab012b06
zh: 39c831cb8f64b079
/agent-note-im-session-strategies/decision:
en: 29005c64c8967565
zh: 7b07b4e21d65f2e8
/agent-note-im-session-strategies/alternatives-considered:
en: ebecd48e91907e6d
zh: 06231ece36e4ba33
/agent-note-im-session-strategies/consequences:
en: 8264424d4f0c15c9
zh: df733d9d987848ea
@@ -0,0 +1,25 @@
# Agent Note: IM session strategies
Status: implemented
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.
@@ -0,0 +1,25 @@
# Agent Note: IM 会话策略
Status: implemented
[English](2026-10-19-im-session-strategies.md) | 中文
## Problem
不同的 IM 部署对入站聊天消息如何映射到 agent 会话有不同需求。按聊天隔离的部署为每个聊天维护一个独立的持久化会话,并将耗时工作委派给后台任务;而集中处理多个聊天的部署则希望由一个共享的分派会话统一接收各聊天的消息并负责回复或委派。两种模式都需要相同的消息准入、持久化存储、发送回执与 `im_*` 授权工具。如果将单一路由模型写死在 IM 宿主中,其他路由模式就必须复制整套宿主逻辑。
## Decision
[IM 服务](../../../../packages/experimental/im/README.zh.md) 负责平台接收、持久化存储、会话托管(`ctx.im.sessions`)、消息发送(`ctx.im.send`/`stream`)与 `im_*` 工具,而消息进入哪个会话则由 `im/message` 事件链上的监听器(以及 `@deepseek-ai/dsh-experimental-im` 上可选的 `defaultDispatch` 兜底)决定。
宿主自带的兜底处理器位于 [`dispatcher.ts`](../../../../packages/experimental/im/src/dispatcher.ts):配置了 `defaultDispatch` 后,没有被任何监听器认领且提及了机器人的消息会进入全局共享的 `im:dispatcher` 会话;该会话自动将见过的每个聊天加入绑定列表,并在每条消息前附上 `<im-chat key="…" source="…" type="…" />` 头部。所有读取与发送工具均支持可选的 `chat` 参数,以便绑定了多个聊天的会话指定目标聊天。
## Alternatives considered
**在 `@deepseek-ai/dsh-experimental-im` 中写死按聊天路由。** 将 `conversation:<chatKey>` 路由硬编码进宿主会导致单次命令插件、自定义路由插件或全局共享分派会话无法复用同一套接收与会话存储。
**仅靠静态系统提示词标识来源聊天。** 分派会话绑定的聊天随新消息到达而增加;在每条投递的消息前加上 `<im-chat key="…" />` 头部,可以直接告知模型当前消息所属的聊天,而无需重写之前的轮次记录。
## Consequences
`im_sessions` 中的每个会话键都记录创建它的 `owner` 名称(默认兜底为 `dispatcher`,其他插件可自取名称),当不同 `owner` 尝试使用已有键调用 `ctx.im.sessions.ensure` 时会被拒绝。共享的 `dispatcher` 会话在单个会话内串行处理多个聊天的轮次。
@@ -9,8 +9,8 @@
en: d2edaafdd83e5974
zh: 57ce9ad368c404c2
/agent-note-ordinary-forks-have-no-durable-creator-relationship/decision:
en: aae0053e9dc3be9f
zh: bd37095fd5c43c3d
en: f5be3310dd9382f9
zh: 58414e478a4929dd
/agent-note-ordinary-forks-have-no-durable-creator-relationship/compatibility:
en: 8393e8526f927134
zh: c957cbde9dc6712d
@@ -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.
@@ -10,7 +10,7 @@ Status: implemented
## 决策
普通 fork 保留完整的选定前缀、`isSeeded`、`inheritedEventCount` 及继承结束标记,但不记录来源 ID。子代理保留直接创建者,包括 backend 复制历史的情况。`origin: subagent` 提供粗粒度分类;有效的自身区间 descriptor 单独提供继续运行身份。历史父元数据保持可读且不变。运行时 Agent 归属仍遵循[显式身份决策](2026-08-31-explicit-agent-runtime-identity.zh.md)。
普通 fork 保留完整的选定前缀、`isSeeded`、`inheritedEventCount` 及继承结束标记,但不记录来源 ID。子代理保留直接创建者,包括 backend 复制历史的情况。`origin: subagent` 提供粗粒度分类,`origin: side` 标记作为侧栏对话创建的普通 fork,后者按[侧栏对话来源决策](2026-11-26-side-conversation-source.zh.md)记录来源;有效的自身区间 descriptor 单独提供继续运行身份。历史父元数据保持可读且不变。运行时 Agent 归属仍遵循[显式身份决策](2026-08-31-explicit-agent-runtime-identity.zh.md)。
V4 reader 仅在已验证的继承区间中允许其他 Session 的投递 ID。自身区间标记仍要求当前 ID,每个活动代际的 `throughSeq` 必须早于其标记。这些检查不需要持久来源关系。
@@ -9,11 +9,11 @@
en: bb387fc89c1c578c
zh: 947456baea45cc95
/agent-note-macos-consent-shared-by-bundle-identifier/decision:
en: 7b1bbab1f95b7610
zh: 434e7a3fba81174b
en: 99766ed875d39b9b
zh: f887548b2f8f792a
/agent-note-macos-consent-shared-by-bundle-identifier/alternatives-considered:
en: 637b1fd2bafb1b28
zh: 06d882818ffaf800
/agent-note-macos-consent-shared-by-bundle-identifier/consequences:
en: 1af6d29a57ff86e2
zh: 32517607b2fc935f
en: 0c18386a48c36c2d
zh: bb3afb6cc1a13163
@@ -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.
@@ -28,6 +28,6 @@ Apple’s [PPPC configuration](https://support.apple.com/guide/deployment/privac
## Consequences
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.
@@ -12,7 +12,7 @@ Status: implemented
macOS 应用授权使用原生应用提供的、区分大小写的完整 Bundle ID。helper 将 `macos:bundle-id:` 和该标识连接后计算摘要,生成 `CuaApplicationId`。有 Bundle ID 时,安装路径、版本和签名不区分授权。否则,helper 对 `macos:executable-path:` 与规范化可执行路径计算摘要。两种身份都支持长期许可;路径身份在重启和原地更新后保持不变,另一个路径需要新的决定。会话决定和长期许可保留[profile 授权存储](2026-10-19-cua-profile-consent-storage.zh.md)规定的范围和撤销行为。
本决策取代[应用授权](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 仍需分别授权,即使用户将它们视为同一产品的不同版本。
其他程序声明相同 Bundle ID,或替换路径授权对应的可执行文件时,会继承许可,包括通过其他已授权模型工具创建或修改的程序。由于运行中的可执行路径取自应用元数据,选择检查比较的是 macOS 为应用进程登记的可执行文件,而不是内核实际运行的映像:进程实际运行的映像与登记不一致时,例如原地更新后仍在运行的应用,仍沿用登记的路径和身份。最坏后果是在应用已有数据和能力范围内,读取或控制用户未单独批准的程序。模型不能在 CUA 请求中提交授权身份,该身份由原生 helper 从实际选中的应用读取。不同 Bundle ID 仍需分别授权,即使用户将它们视为同一产品的不同版本。
撤销作用于同一标识的所有安装副本。测试覆盖未签名副本、不同标识、缺少标识时的持久路径许可、进程重启、符号链接、启动前后身份一致、多个句柄共同撤销,以及不扩大旧授权。
撤销作用于同一标识的所有安装副本。测试覆盖未签名副本、不同标识、缺少标识时的持久路径许可、应用元数据与内核进程路径不一致、进程重启、符号链接、启动前后身份一致、多个句柄共同撤销,以及不扩大旧授权。
@@ -0,0 +1,34 @@
# Bilingual-pair consistency record for 2026-10-25-im-architecture-v4.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-25-im-architecture-v4.md
/agent-note-im-architecture-in-v4:
en: 6d31353cd74e9432
zh: f3371b2adcfd5d94
/agent-note-im-architecture-in-v4/problem:
en: 024834c385990be7
zh: 7865b32d373f0484
/agent-note-im-architecture-in-v4/decision:
en: 7d8e9449618a1a9e
zh: 666b9aa64640af5c
/agent-note-im-architecture-in-v4/decision/the-host:
en: 23e9dbcc7062aefd
zh: 11e9e3a2cec281da
/agent-note-im-architecture-in-v4/decision/message-routing-and-the-default-dispatcher:
en: 05e188c631db10aa
zh: d034e4f4102fe74e
/agent-note-im-architecture-in-v4/decision/session-strategies:
en: 397eb04ae8dcffe8
zh: 5c8469820765a83b
/agent-note-im-architecture-in-v4/decision/output-renderers:
en: 7db1986c5b25cb14
zh: 623231c42979666a
/agent-note-im-architecture-in-v4/decision/platform-layer:
en: 1aec79ab90d94964
zh: b321c83decc7a8c5
/agent-note-im-architecture-in-v4/alternatives-considered:
en: 58392b3805a29cd4
zh: 9715f7c9c5b33e34
/agent-note-im-architecture-in-v4/consequences:
en: 8c14d0a1c8fc9368
zh: f7bae48c08fae040
@@ -0,0 +1,53 @@
# Agent Note: IM architecture in v4
Status: implemented
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`).
@@ -0,0 +1,53 @@
# Agent Note: v4 中的 IM 架构
Status: implemented
[English](2026-10-25-im-architecture-v4.md) | 中文
## Problem
IM 集成需要解决三个相互独立的问题:平台投递了什么以及会话拥有哪些权限、入站消息应当路由给哪个会话、以及运行中的轮次应当如何在聊天中展示。如果将会话路由与输出渲染耦合在同一个核心服务中,每次部署都会被绑定到单一路由策略与单一平台的载荷构造逻辑,且新增斜杠命令、路由策略或输出样式都必须修改核心服务。
## Decision
`@deepseek-ai/dsh-experimental-im` 是平台无关的宿主服务:负责接纳并存储平台消息、托管 agent 会话、执行聊天权限校验与发送回执记录,并跟踪轮次活动。会话路由、斜杠命令、后台任务与轮次输出渲染均由独立插件实现。
### The host
[`ImService`](../../../../packages/experimental/im/src/index.ts) 按照 [`api.ts`](../../../../packages/experimental/im/src/api.ts) 中的定义提供 `ctx.im`(`sessions`、`history`、`outputs`、`send`、`stream`、`format`、`bot`、`chat` 与 `status()`)。接收模块([`intake.ts`](../../../../packages/experimental/im/src/intake.ts))在消息记录与事件去重摘要均持久化写入 `im_messages` 后才完成 `satori/receive`,随后适配器才向平台返回 ACK。已被接收层记录的 `(bot, eventId)` 再次投递就是同一次投递:首次投递写入的记录为准,载荷与它不同时只记录一次告警;不匹配任何 `sources` 规则的聊天既不入库也不发出事件。派发循环随后对每条被接纳消息触发 `im/message` 事件链——不同聊天并行派发,同一聊天内按 `seq` 顺序串行派发——并记录处理结果。过期清理仅删除已完成的旧记录;处于待处理状态的消息与回执会一直保留,直到处理完成。
托管会话([`sessions.ts`](../../../../packages/experimental/im/src/sessions.ts))以插件定义的键寻址(默认分派器使用 `im:dispatcher`,其它插件可使用任意键),每个键对应一个活动会话,组合配置、聊天绑定、输出渲染器与自定义元数据直接保存在会话记录中。`ensure` 创建或更新会话记录,`deliver` 在写入 agent 收件箱前先持久化投递意图(`steer`、`followup` 或 `inject`)并通过核对会话日志去重,`reset` 释放当前 agent 并递增 `generation` 以生成新的 `sessionId`,`stop` 取消正在运行的轮次。出站发送统一经过 [`send.ts`](../../../../packages/experimental/im/src/send.ts),传入可选的 `operationId` 时会将发送结果记录为持久化回执(`confirmed`、`failed`、`uncertain` 或 `partial`)。
### Message routing and the default dispatcher
`im/message` 是在 [`api.ts`](../../../../packages/experimental/im/src/api.ts) 中声明的事件链。使用 `{ prepend: true }` 注册的监听器先于路由策略运行——[`session-commands`](../../../../packages/experimental/im-session-commands/src/index.ts) 位于该位置,使 `/stop`、`/clear`、`/new`、`/status`、`/help` 与透传命令在任何策略将文本转为模型输入前直接执行。路由插件按普通顺序注册,遇到不属于自己的消息时调用 `next()` 向后传递。当在 `@deepseek-ai/dsh-experimental-im` 上配置了 `defaultDispatch` 时,最内层的兜底处理器([`dispatcher.ts`](../../../../packages/experimental/im/src/dispatcher.ts))会将未被认领且提及了机器人的消息投递给一个全局共享会话(`key: 'im:dispatcher'`,`owner: 'dispatcher'`),随消息到达自动累积聊天绑定,并在每条消息前添加 `<im-chat key="…" source="…" type="…" />` 头部;未配置 `defaultDispatch` 时则返回 `ignored`。如果监听器抛出异常,消息会保持 `pending` 等待重试,因此监听器必须使用确定性的投递 id 和 `operationId`。
### Session strategies
路由由监听器决定:希望按聊天、按命令或按话题划分会话的插件自行注册到 `im/message`,并通过 `ctx.im.sessions` 托管所需会话。随附的组合包只挂载 `session-commands`,并在配置了 `defaultDispatch` 时挂载宿主自带的默认分派器;其余消息没有监听器认领。
### Output renderers
宿主将托管会话每轮的 agent 事件汇总为 `ImActivity` 快照,发出 `im/activity` 事件,并通过 `ctx.im.outputs`([`outputs.ts`](../../../../packages/experimental/im/src/outputs.ts))驱动会话 `spec.output` 指定的输出渲染器。`output: 'none'` 是默认值,托管会话仅在 agent 调用 `im_send`、`im_reply` 或 `im_send_file` 时发布内容;随附的组合包不注册任何渲染器,需要流式进度的插件自行注册,无需改动宿主。
### Platform layer
`ctx.im` 之下是内置的 Satori 包:[`plugin-im-core`](../../../../vendor/im/core/src/index.ts)(协议、按模式的元素注册表、转换与回退表、能力评估、降级计分、流式调度器与一致性测试套件)、[`satori-element`](../../../../vendor/im/element/src/index.ts)(元素类型与 GFM Markdown 转换),以及 [`plugin-im-adapter-lark`](../../../../vendor/im/adapter-lark/src/bot.ts) 和 [`plugin-im-adapter-qq`](../../../../vendor/im/adapter-qq/src/bot.ts) 平台适配器。
## Alternatives considered
**使用单一 `ctx.imSessions` 策略服务替代 `im/message` 事件链。** 由宿主调用单一策略服务会使斜杠命令插件、自定义命令插件与路由策略无法按顺序组合,并迫使平台适配器在连接前等待策略服务注入。事件链允许前置命令监听器、路由插件与默认分派会话按确定顺序协同工作。
**在宿主内部构造平台卡片载荷。** 将单一平台的卡片 JSON 构造与流式更新节奏写进 `dsh-im`,会把所有部署绑定到该平台,并使自动流式输出成为强制行为。拆分出 `im/activity` 与 `ctx.im.outputs` 后,平台无关的渲染逻辑留在注册到该注册表的插件中,同时允许 `output: 'none'` 的会话仅通过显式工具调用发言。
**默认将助手文本流式发布到聊天。** 自动把每一轮文本发到聊天中,会与通过显式调用 `im_send`/`im_reply` 决定发言内容和目标聊天的 agent 产生冲突。将 `output` 默认设为 `'none'` 可保持会话托管与轮次渲染正交。
**将 `im_*` 工具拆分到独立的 `tool-*` 包中。** 把它们从管理聊天授权与发送回执的服务包中拆出,需要维护额外的跨包内部接口来传递会话身份与权限。将 `im_*` 工具注册在宿主中,使工具与其依赖的状态管理保持在同一包内。
## Consequences
部署按需挂载 `@deepseek-ai/dsh-experimental-im`、路由插件与输出渲染器。若没有任何路由插件认领消息且未配置 `defaultDispatch`,被接纳的消息仍会完成 ACK、入库并在 `ctx.im.status()` 中记录为 `ignored`。
事件链监听器需自行保证幂等性:监听器抛错会让消息保持 `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)。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-10-25-im-storage-unit-identity.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-25-im-storage-unit-identity.md
/agent-note-im-storage-unit-identity-in-v4:
en: dfe7222b2c39ed68
zh: 437376ab9dd5fa6d
/agent-note-im-storage-unit-identity-in-v4/problem:
en: e797e295bb466f4c
zh: 6710f2fb5a6ce0f4
/agent-note-im-storage-unit-identity-in-v4/decision:
en: bb21e01ff613b3fb
zh: 8a6c7a132541ff85
/agent-note-im-storage-unit-identity-in-v4/alternatives-considered:
en: 87c050a966f70cc5
zh: 80f678f0390db637
/agent-note-im-storage-unit-identity-in-v4/consequences:
en: 491e0391ce6ee905
zh: 943510bea0b14e07
@@ -0,0 +1,41 @@
# Agent Note: IM storage unit identity in v4
Status: implemented
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:
| Domain | Unit (v4) | Owner |
|---|---|---|
| Message store: events, messages, chats | `im_messages` | `packages/experimental/im/src/state.ts` |
| Hosted sessions and pending deliveries | `im_sessions` | `packages/experimental/im/src/sessions.ts` |
| Publication receipts | `im_receipts` | `packages/experimental/im/src/send.ts` |
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`.
@@ -0,0 +1,41 @@
# Agent Note: v4 中的 IM 存储 unit 身份
Status: implemented
[English](2026-10-25-im-storage-unit-identity.md) | 中文
## Problem
如果 v4 消息存储沿用 v3 的 `im` unit 名称并将版本设为 2(表结构改为 `events`/`messages`/`chats`,而非 v3 的 `sessions`/`tasks`/`intake`/`output`),在已有 v3 home 目录上启动 v4 会在服务启动前失败:`StorageError: unit 'im': stored version 1 != expected 2`。unit 名称是其在存储介质上的身份标识,且单文档 unit 仅按精确版本号读取,因此在已有 v3 目录上复用旧 unit 名称且表结构或记录 schema 不兼容时,每次启动都会报错。
存储域层不提供就地迁移或重置机制:[`DomainSpec`](../../../../packages/storage/storage-domain/src/spec.ts) 仅包含名称、版本、布局与记录 schema,[`KvFacet`](../../../../packages/storage/storage/src/backend.ts) 仅提供 `open`/`loadAll`/`putRecord`/`deleteRecord`/`setGlobal`/`close`,不包含转换或销毁原语(见 [`packages/storage/storage-domain/README.zh.md`](../../../../packages/storage/storage-domain/README.zh.md))。此外,v3 的接收回执与会话记录对 v4 IM 各包并不可复用,v4 的消息、会话、回执与任务记录本身具有不同的数据结构。
## Decision
每个 IM 存储域使用独立的 v4 unit 名称,不再复用 v4 之前的名称:
| 存储域 | unit 名称(v4) | 所属模块 |
|---|---|---|
| 消息存储:事件、消息、聊天 | `im_messages` | `packages/experimental/im/src/state.ts` |
| 托管会话与待处理投递 | `im_sessions` | `packages/experimental/im/src/sessions.ts` |
| 发送回执 | `im_receipts` | `packages/experimental/im/src/send.ts` |
由于每个 v4 存储域均使用全新名称,各自从版本 1 开始。介质上已有的 v3 `im`、`im_conversation` 与 `im_dispatch` unit 保持原样:v4 不读取、不迁移也不删除它们,首次启动 v4 时会自动创建并使用全新的存储单元,无需人工清理步骤。运行过已移除的任务插件的部署,其 `im_tasks` 记录同样保持原样:没有任何 v4 存储域会打开该 unit。
## Alternatives considered
**声明 v1 到 v2 的迁移以丢弃 v3 状态。** `DomainSpec` 与存储后端契约均无迁移、重置或销毁钩子;引入该机制需要先在存储层增加原语(见 [`recovery: 'reset'` 提案](../../proposed/architecture/2026-07-28-storage-root-and-derived-medium-recovery.zh.md)),而在 IM 包内绕过存储后端直接操作文件会破坏存储抽象。
**保留 `im` 名称并将版本升至 2。** 单文档 unit 要求版本号精确匹配,在版本 1 的介质上以版本 2 打开每次都会因 `version-mismatch` 失败。
**保留旧名称并放宽 schema 以兼容 v3 记录。** v3 与 v4 记录代表不同的数据模型;放宽 schema 会导致 v4 将已废弃的旧路由和接收状态误读为当前记录。
**启动时自动删除 v3 unit。** 存储后端没有删除 unit 的原语,且在启动阶段自动删除用户存储文件不属于 IM 包的职责范围。
## Consequences
升级后的 `$DSH_HOME` 目录会将旧版 `im.json`、`im_conversation.json` 与 `im_dispatch.json` 原样保留在 v4 存储单元旁且不再读取。v4 IM 服务以空的消息、会话与回执存储启动。
今后若在这三个存储域内部进行兼容的 schema 变更,只需递增对应 unit 的版本号,并在旧记录符合新 schema 时声明 `compatibleVersions`。
验证:`packages/experimental/im/tests/store.spec.ts` 在预置了 v3 `im` unit(版本 1)的存储介质上启动消息存储,验证 v4 写入落在 `im_messages` 中且 v3 介质保持不变,同时验证以版本 2 打开 `im` 会因 `version-mismatch` 被拒绝。
@@ -9,8 +9,8 @@
en: 129d30508926bbc5
zh: 15feff44556fc9b7
/agent-note-office-skills-in-every-deployment-with-one-office-kit-package/decision:
en: 7d70a22025ab858e
zh: cc37cb9932e78787
en: e8f7468f6d6a9379
zh: 69a5dc67ad2195b8
/agent-note-office-skills-in-every-deployment-with-one-office-kit-package/alternatives-considered:
en: 167c52da0171028f
zh: 9c87c2370d0719df
@@ -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.
## Alternatives considered
@@ -18,9 +18,9 @@ Status: implemented
[`@deepseek-ai/dsh-office-kit`](../../../../packages/document/office-kit/README.zh.md) 负责 Kit 定位和共享转换服务。Kit 定位是提供方的内部实现,不对外导出:提供方传入自己的 `import.meta.resolve` 查找函数,原生引擎路径使用 ASAR 解包映射。定位不读取环境变量。[按需激活的 Office 工具](2026-10-31-native-office-tool.zh.md)在 Host 内执行 Kit 操作,因此任何部署都不发布 Kit CLI 路径或 Office 可执行文件变量。
Kit 缺失时降级,而不是加载失败。转换服务照常注册,以代码 `unavailable` 拒绝转换,只保留成功的 Kit 导入,并对每种不同的失败只报告一次;`office_render`、`office_convert` 和 `office_recalculate` 工具保持注册并在调用时返回该消息。
Kit 缺失时降级,而不是加载失败。转换服务照常注册,以代码 `unavailable` 拒绝转换,只保留成功的 Kit 导入,并对每种不同的失败只报告一次;`document_render`、`document_convert` 和 `document_recalculate` 工具保持注册并在调用时返回该消息。
`office-to-pdf` 改为 `office-kit`,使后续的 Kit 消费方(例如原生渲染(PR #5374)和 `tool-office` 包)从同一个包获取 Kit。LibreOffice Kit 依赖在每个清单中声明同一个精确版本,因此转换器和打包的引擎来自同一个 Kit 发行版。
`office-to-pdf` 改为 `office-kit`,使后续的 Kit 消费方(例如原生渲染(PR #5374)和 `tool-document` 包)从同一个包获取 Kit。LibreOffice Kit 依赖在每个清单中声明同一个精确版本,因此转换器和打包的引擎来自同一个 Kit 发行版。
## 考虑过的替代方案
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-10-27-im-dispatch-out-of-v1.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-27-im-dispatch-out-of-v1.md
/agent-note-rule-driven-im-dispatch-leaves-the-v1-package-set:
en: adafb8ddbbb8f339
zh: 10a63fd931bc5b1a
/agent-note-rule-driven-im-dispatch-leaves-the-v1-package-set/problem:
en: 3b7d39cd4924ad76
zh: 04ed58ef19fc57c2
/agent-note-rule-driven-im-dispatch-leaves-the-v1-package-set/decision:
en: d869683b9760a7fc
zh: 9a8cef79272a9dfe
/agent-note-rule-driven-im-dispatch-leaves-the-v1-package-set/alternatives-considered:
en: 288528e7edab6442
zh: 47f80c327a39cfe5
/agent-note-rule-driven-im-dispatch-leaves-the-v1-package-set/consequences:
en: d39bd4db7d30bd86
zh: d60b0564fa4596b3
@@ -0,0 +1,27 @@
# 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.
@@ -0,0 +1,27 @@
# Agent Note: 规则驱动的 IM 分派移出 v1 包集合
Status: implemented
[English](2026-10-27-im-dispatch-out-of-v1.md) | 中文
## Problem
`dsh-im-session-dispatch` 承载了 IM 平面的大部分复杂度:为模型编写的路由规则编译到 WebAssembly 的 QuickJS 沙箱、自己的 `im_rules` 存储 unit、把消息从分派者手中拿走的 `copy`/`cut` 路径、双向的规则通知,以及九个分派者工具与五个 worker 工具。只有一个部署使用它。`dsh-im-session-tasks` 与它以及平台线程耦合:它发布话题公告,在没有线程的平台上退化为 `#task` 消息,从第一条回复学习线程 id,并监听 `im/message` 路由话题回复,其中 `topicDelivery: rules` 模式只为分派者存在。
## Decision
规则驱动的分派者移入唯一使用它的部署插件,位于本仓库之外,规则语言与存储保持不变。在本仓库中:
- [`@deepseek-ai/dsh-experimental-im` 宿主](../../../../packages/experimental/im/src/dispatcher.ts) 增加了一个最小默认行为:配置 `defaultDispatch` 后,没有监听器处理的、找机器人的消息进入所有聊天共用的一个会话。它没有路由也没有规则;不配置时未处理的消息照旧被忽略。
- 后台工作随任务服务一同离开本仓库:没有任何任务服务随附,需要 worker 会话的插件通过 `ctx.im.sessions` 自行托管,并自行把希望 worker 收到的消息路由过去。
- 发布面向会话绑定中的某个聊天,因此绑定了多个聊天的会话会在被提问的地方作答。
## Alternatives considered
**在 v1 中保留不含 QuickJS 的分派。** 由 harness 维护的谓词语言仍需要自己的存储、通知和工具,而且仍然只有一个部署使用。
**由任务服务路由话题回复。** 哪些消息到达 worker 属于路由策略,路由属于拥有这些会话的插件;否则任务服务会在每个策略旁边再保留一个特定于平台的路由器。
## Consequences
运行过 `dsh-im-session-dispatch` 的部署改为挂载自己的插件与自己的分派预设;由于 unit 名与版本都未变化,其 `im_rules` 与 `im_tasks` 记录原样留在介质上,本仓库没有任何存储域会打开它们。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-10-28-im-fallback-alternatives-replace-capabilities.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-10-28-im-fallback-alternatives-replace-capabilities.md
/agent-note-fallback-alternatives-replaced-the-im-capability-layer:
en: 3d9781a91b72777f
zh: b8dd45d77aad30b1
/agent-note-fallback-alternatives-replaced-the-im-capability-layer/problem:
en: 0396e84086598eab
zh: d851b99cba361545
/agent-note-fallback-alternatives-replaced-the-im-capability-layer/decision:
en: d514f78ebca1f125
zh: a0b8994e4468b39a
/agent-note-fallback-alternatives-replaced-the-im-capability-layer/alternatives-considered:
en: 01dc0b64d0c2f957
zh: 278f7b33e13f4636
/agent-note-fallback-alternatives-replaced-the-im-capability-layer/consequences:
en: 2a67d6ce76d7852c
zh: d512af265f406271
@@ -0,0 +1,37 @@
# 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.
@@ -0,0 +1,37 @@
# Agent Note:`<fallback>` 备选内容取代了 IM 能力层
Status: implemented
[English](2026-10-28-im-fallback-alternatives-replace-capabilities.md) | 中文
## Problem
内置的 IM 运行时在做事之前先回答「这个平台在这个聊天里能不能做 X」。`plugin-im-core` 拥有一整层能力评估——`ChatFacts`、按 bot 的 `FactCache`、`LearnedFact`、`Support`、`element.*` / `message.*` / `limit.*` 键词汇、`evaluateCapabilities` 与 `mergeCapabilities`——每个适配器都从三个方向喂它:模式声明的操作表、适配器钩子,以及按聊天探测的结果。飞书适配器额外加了 `getChat` 探测和五条学习到的事实,QQ 适配器则把被动回复窗口也从同一条通道发布出去。
于是每个消费方都得对答案分支。`@deepseek-ai/dsh-experimental-im` 在消息事件、服务和每一轮输出的 IO 上都暴露 `caps`;summary 与 trace 渲染器发布前要问五六个键;只有 `element.button.action` 与 `interaction.button` 同时答 `native` 的地方才有停止按钮。这层评估在两个方向上都错:`unknown` 对操作必须表示「照做」,对元素却必须表示「不要渲染」,于是一个读不到聊天的探测会悄悄降级工作,而一个答 `unknown` 的探测又让管线从失败里再学一遍同样的事。平台回答之前,关于聊天的一切本来就无从得知。
## Decision
能力层被删除而不是弃用,改由内容本身携带备选。
`@deepseek-ai/satori-element` 新增 `<fallback>` 元素:每个直接子元素是一个有排序的候选,JSX fragment 整体算一个候选,所以 `<fallback><title>…</title><h3>…</h3><text>…</text></fallback>` 是一条消息的三种写法。`normalize` 把每个候选改写成内部的 `<case>`,按 `<fallback>` 所在元素的内容模型归一化,因此行内内容的 fallback 可以并入周围的行内流。`RenderEngine` 渲染整棵子树都能被其注册表原生渲染的第一个候选(标签已注册、变体已声明、结构子节点成立),否则按常规降级渲染最后一个候选;嵌套 fallback 只要自身某个候选可原生渲染就算可原生渲染。选择结果写入 `RenderReport.fallbacks`,`degradationScore` 会为更靠后的候选计费,因此能渲染作者首选的那个模式会赢得每次发布时的模式解析。引擎中没有任何一处查询按聊天的状态。
随之移除的有:`capabilities.ts`、`Bot.supports` / `support` / `capabilities`、`Adapter.facts`、`Mode.operations`、`HandlerOptions.available`、`PlatformError.facts`、`RenderContext.caps` / `supports`、飞书的 `facts.ts` 聊天探测及其学习到的事实,以及 QQ 的被动窗口事实。`LimitKey` 移到 `mode.ts` 并新增 `limit.delete.window`;一个模式能做什么,如今是注册表事实(是否注册该标签、是否声明该变体)、适配器钩子事实(`editPayload`、`deletePart`、`streamDriver`)或声明的上限。`Bot.edit` 与 `Bot.delete` 据此判断,拒绝就是平台给出的、被分类过的 `PlatformError`,而不是预测。
`MessageStream.abort()` 现在会回报撤回是否真的删掉了已发布的消息——这是渲染器无法从自己的内容里得出的唯一问题。
IM 的消费方不再查询能力。`ImOutputIO`、`ImMessageEvent` 与 `ImApi` 去掉了 `caps`;summary 渲染器根据自己打开的流的策略(`patch` / `edit` 会发布临时内容,`final` / `append` 不会)算出渲染计划,并把停止控件写成一个由操作按钮与「回复 /stop 停止」一行组成的 `<fallback>`;trace 渲染器把每段思考与每次工具调用写成一个由可折叠面板与单行摘要组成的 `<fallback>`,把元素预算留给真正有预算的模式。
## Alternatives considered
**保留这层能力评估,另加 `<fallback>`。** 两套机制会回答同一个问题并互相矛盾:渲染器可以问某个模式是否支持 `<details>`,而真正决定这一点的只有该模式自己的注册表。
**为消费方保留一份精简的同步能力描述。** 渲染器只需要三个答案(打开的是哪种流策略、撤回是否成功、按钮是否可点),每一个都已经由事件、调用本身或内容本身给出。「这个平台能做什么」的描述会重新引入让这层评估出错的猜测。
**按聊天惰性探测并缓存答案。** TTL 只是把猜测挪了位置,并没有消除它:禁言、白名单拒绝或编辑策略都可能在两次发送之间变化,而过期的 `false` 会挡住一次本来能成功的调用。
## Consequences
一次拒绝要付一个往返并作为错误浮出水面,而以前这层评估会提前拦下它。需要优雅降级的内容现在在自己的内容树里说明,于是决定权落在清楚自己在渲染什么的渲染器上,而不是一张键表里。各模式在 `assemble` 与 `check` 中自己负责元素预算;trace 渲染器不再预先折叠面板。适配器不再缓存任何关于聊天的东西,因此 bot 不需要探测、TTL 和失效处理,QQ 的被动记账只回答流驱动问的那一个问题(`remaining()`)。
语料新增了 `fallback` 用例,而 conformance 的文本保全检查会跳过 `<fallback>`:渲染哪个候选是模式的属性,因此没有哪段文本是被普遍保全的。被放弃的是「不试就知道这个聊天能不能做 X」——QQ 与飞书 `230075` 的路径以前靠它提前选择缓冲式流,现在依靠被分类为 `limit` 的错误撤回并重发。
@@ -9,11 +9,11 @@
en: 5b23962ecc835664
zh: c96ea8720ebc9419
/agent-note-on-demand-office-tools-for-rendering-conversion-and-recalculation/decision:
en: 64a4a913bc6b5a38
zh: ad3eb83aa7f32016
en: ae28f6574f8eb7b1
zh: 847b5dbb73fb79a9
/agent-note-on-demand-office-tools-for-rendering-conversion-and-recalculation/alternatives-considered:
en: f36e8534958e5a46
zh: 96a3876a26a9d9ac
en: bf3febecef30340c
zh: f925d1d6bd976a7b
/agent-note-on-demand-office-tools-for-rendering-conversion-and-recalculation/consequences:
en: 8ea5f5c493dfae3d
zh: 29d7160bd3f98512
en: 4d7153613045e027
zh: db66a7f25ccfe2e0
@@ -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.
@@ -28,7 +28,7 @@ This decision partially supersedes [progressive Office skills](2026-09-27-progre
**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.
@@ -40,8 +40,8 @@ This decision partially supersedes [progressive Office skills](2026-09-27-progre
## Consequences
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.
@@ -10,13 +10,13 @@ Status: implemented
## 决策
[`tool-office` 包](../../../../packages/document/tool-office/README.zh.md)提供三个按需激活的 Host 工具:`office_render`、`office_convert` 和 `office_recalculate`。每个工具在各自的 JSON Schema 中直接声明参数规则:`office_render` 接受文档路径、页码或幻灯片 `pages`、工作表 `sheet` 与 `range` 选择以及 `dpi`;`office_convert` 保留全部九种输出格式(Word 支持 `pdf`、`docx`、`odt`、`txt`,Excel 支持 `pdf`、`xlsx`、`ods`、`csv`,PowerPoint 支持 `pdf`、`pptx`、`odp`)以及仅用于 CSV 输出的 `sheet`(工作簿含多个工作表时必填);`office_recalculate` 接受 `xlsx` 和 `ods`。三个工具声明共约 1,813 个字符,仅在加载了 Office 技能的 Session 中付出。它们调用 [Office 套件](../../../../packages/document/office-kit/README.zh.md)服务;该服务通过 `src/locate.ts` 在 Host 进程中加载 Kit,并让每个操作经过 Office 预览所用的队列、并发上限、字节预留和缓存。工具请求使用 `foreground` 优先级,即打开的预览所属的类别,因此后台预热不会饿死它们。SDK 组合在 `office-kit` 旁挂载 `tool-office`,Web bundle 的标准和 PTC Agent 预设挂载它,minimal 预设保持其固定工具列表;Kit 缺失时三个工具仍然注册,每次调用都返回服务的 `unavailable` 消息。每个工具在每次调用时读取该服务而不是注入它,因此省略或禁用 `office-kit` 的组合仍能带着这些工具创建 Session,每次调用以 `unavailable` 失败;之后加载的服务会处理下一次调用。标准模式与 PTC 模式使用同一组注册;PTC 嵌套调用重新进入普通执行管线。
[`tool-document` 包](../../../../packages/document/tool-document/README.zh.md)提供三个按需激活的 Host 工具:`document_render`、`document_convert` 和 `document_recalculate`。每个工具在各自的 JSON Schema 中直接声明参数规则:`document_render` 接受文档路径、页码或幻灯片 `pages`、工作表 `sheet` 与 `range` 选择、`dpi` 以及可选的 `renderer`([Poppler PDF 渲染后端](2026-11-23-poppler-pdf-renderer.zh.md));`document_convert` 保留全部九种输出格式(Word 支持 `pdf`、`docx`、`odt`、`txt`,Excel 支持 `pdf`、`xlsx`、`ods`、`csv`,PowerPoint 支持 `pdf`、`pptx`、`odp`)以及仅用于 CSV 输出的 `sheet`(工作簿含多个工作表时必填);`document_recalculate` 接受 `xlsx` 和 `ods`。三个工具声明共约 1,988 个字符,仅在加载了 Office 技能的 Session 中付出。它们调用 [Office 套件](../../../../packages/document/office-kit/README.zh.md)服务;该服务通过 `src/locate.ts` 在 Host 进程中加载 Kit,并让每个操作经过 Office 预览所用的队列、并发上限、字节预留和缓存。工具请求使用 `foreground` 优先级,即打开的预览所属的类别,因此后台预热不会饿死它们。SDK 组合在 `office-kit` 旁挂载 `tool-document`,Web bundle 的标准和 PTC Agent 预设挂载它,minimal 预设保持其固定工具列表;Kit 缺失时三个工具仍然注册,每次调用都返回服务的 `unavailable` 消息。每个工具在每次调用时读取该服务而不是注入它,因此省略或禁用 `office-kit` 的组合仍能带着这些工具创建 Session,每次调用以 `unavailable` 失败;之后加载的服务会处理下一次调用。标准模式与 PTC 模式使用同一组注册;PTC 嵌套调用重新进入普通执行管线。
`office_render` 在工具结果中返回 PNG 图片;Web Client 的 Office 行只显示结果的文本块,不显示这些图片。工具在结果写入日志之前通过附件存储提交图片,因此模型可见的图片可以从 Session 日志还原,恢复和分叉会还原它们,图片卸载也适用于它们。完整结果受图片数量、单图像素与尺寸以及 PNG 总字节数约束,每项取工具配置与附件存储上限中的较小值;超出上限的选择直接失败,不会被截断。不支持图片输入的路由在渲染前即被拒绝。
`document_render` 在工具结果中返回 PNG 图片;Web Client 的 Office 行只显示结果的文本块,不显示这些图片。工具在结果写入日志之前通过附件存储提交图片,因此模型可见的图片可以从 Session 日志还原,恢复和分叉会还原它们,图片卸载也适用于它们。完整结果受图片数量、单图像素与尺寸以及 PNG 总字节数约束,每项取工具配置与附件存储上限中的较小值;超出上限的选择直接失败,不会被截断。不支持图片输入的路由在渲染前即被拒绝。
`office_convert` 和 `office_recalculate` 不写入工作区。文件系统服务有意只提供二进制读取,工作区中的二进制文件只由 shell 产生,而 shell 的沙箱和审批已经管理写入。Office 套件把每个输出保存在可配置的 `outputDirectory`(默认 `$DSH_HOME/office-kit/outputs`)下仅属主可访问的目录中,按调用方 subagent 树的根 Session 分组;输出在 `outputRetentionMs` 到期、`maxOutputStoreBytes` 需要为较新的输出腾出空间、该根 Session 卸载或提供方卸载时删除。因此 subagent 的输出在 subagent 结束后仍然保留,委派它的 agent 仍可复制。工具返回临时文件的绝对路径、格式、大小和转换器报告的页数,并指示立即用 shell 复制该文件,因为文件可能在保留期到期或需要腾出空间时被删除,且对话结束后会被删除。无法读取 Host 路径的文件系统后端(例如 SSH 工作区)会在转换前拒绝这两个工具,因为远程 shell 读不到 Host 的输出存储。macOS Seatbelt、Linux bubblewrap 和 Linux Landlock 的 shell 沙箱都允许读取 Harness 主目录,因此受限的 shell 可以把文件复制进工作区。
`document_convert` 和 `document_recalculate` 不写入工作区。文件系统服务有意只提供二进制读取,工作区中的二进制文件只由 shell 产生,而 shell 的沙箱和审批已经管理写入。Office 套件把每个输出保存在可配置的 `outputDirectory`(默认 `$DSH_HOME/office-kit/outputs`)下仅属主可访问的目录中,按调用方 subagent 树的根 Session 分组;输出在 `outputRetentionMs` 到期、`maxOutputStoreBytes` 需要为较新的输出腾出空间、该根 Session 卸载或提供方卸载时删除。因此 subagent 的输出在 subagent 结束后仍然保留,委派它的 agent 仍可复制。工具返回临时文件的绝对路径、格式、大小和转换器报告的页数,并指示立即用 shell 复制该文件,因为文件可能在保留期到期或需要腾出空间时被删除,且对话结束后会被删除。无法读取 Host 路径的文件系统后端(例如 SSH 工作区)会在转换前拒绝这两个工具,因为远程 shell 读不到 Host 的输出存储。macOS Seatbelt、Linux bubblewrap 和 Linux Landlock 的 shell 沙箱都允许读取 Harness 主目录,因此受限的 shell 可以把文件复制进工作区。
三个工具共享同一个 `when(agent)` 谓词,而不是在每次请求中常驻。当 `marked.has(agent)` 为真,或 `agent.session.requestHeader()?.tools` 已包含 `office_render`、`office_convert` 或 `office_recalculate` 时,`Agent` 激活它们;`agent/disposed` 会清除 `WeakSet<Agent>` 标记。当非错误的 `skill` 工具结果(`tools/result` 且 `!result.isError`,包括 `run_code` 内嵌套的 `skill` 调用)或直接的用户技能调用(`session/event` 中 `event.type === 'user/message'` 且 `event.data.source.kind === 'skill-invocation'`)加载了 `activationSkills`(默认为 `office`)中的技能时,`tool-office` 标记该 `Agent`。工具声明在加载技能后的下一步出现,并在该 Session 剩余时间内保持激活;激活前调用 `office_*` 工具会以 `UNKNOWN_TOOL` 失败。会话中途激活新增这些工具时,agent loop 会记录一条带 `tool-addition` 项的 `developer/message`(`source: { kind: 'tool-registry' }`):声明了 `toolUpdate`(`in-history` 或 `addition-only`)的模型保留现有请求前缀,未声明 `toolUpdate` 的模型则开启一次新的请求序列。由于标准模式的请求头本就持久化在 Session 日志中,检查 `requestHeader()` 即可在恢复、分叉和压缩后保留激活状态,无需新增 Session projection。PTC 模式下记录的请求头只声明 `run_code`,因此恢复或分叉的 PTC Session(或加载技能后、下一条原生请求头记录前发生进程崩溃)不会保留 `office_*` 绑定,直到再次加载 Office 技能;[`office` 技能](../../../../packages/skill/skill-office/README.zh.md)指示模型在 `office_render`、`office_convert` 或 `office_recalculate` 不在工具列表中时调用 `skill` 重新加载 `office`。没有技能只包装单个操作,单独的渲染、重算或转换只需加载 `office`。技能不再携带可执行文件路径,因此 `skill-office` 没有 Node、CLI 或 Kit 位置配置,`office-kit` 的 `src/locate.ts` 没有 CLI 解析器,Desktop 和各 bundle 不发布 Office 可执行文件变量,Python sidecar 的独立 Node 只保留给 Python `deepseek_harness.office` 模块使用。
三个工具不在每次请求中常驻,而是注册在 `ctx.tools` 引入的同一个 `AgentToolRegistry` 中;只有 `tool-document` 通过 `set()` 为某个 `Agent` 一并添加这三个工具后,该 `Agent` 才能看到它们。当非错误的 `skill` 工具结果(`tools/result` 且 `!result.isError`,包括 `run_code` 内嵌套的 `skill` 调用)或直接的用户技能调用(`session/event` 中 `event.type === 'user/message'` 且 `event.data.source.kind === 'skill-invocation'`)加载了 `activationSkills`(默认为 `office`)中的技能时,`tool-document` 为该 `Agent` 添加这些工具。`tool-document` 还会在 `agent/created` 时,以及插件加载时对每个已存在的 `Agent`,检查 `agent.session.requestHeader()?.tools`:若其中已包含 `document_render`、`document_convert` 或 `document_recalculate`,或改名前记录的 Session 中的旧名 `office_render`、`office_convert`、`office_recalculate` 之一,就为该 `Agent` 添加这些工具。注册表在内存中保存为每个 `Agent` 添加的工具名,并随 `Agent` 一起丢弃。工具声明在加载技能后的下一步出现,并在该 Session 剩余时间内保持激活;激活前调用 `document_*` 工具会以 `UNKNOWN_TOOL` 失败。会话中途激活新增这些工具时,agent loop 会记录一条带 `tool-addition` 项的 `developer/message`(`source: { kind: 'tool-registry' }`):声明了 `toolUpdate`(`in-history` 或 `addition-only`)的模型保留现有请求前缀,未声明 `toolUpdate` 的模型则开启一次新的请求序列。由于标准模式的请求头本就持久化在 Session 日志中,检查 `requestHeader()` 即可在恢复、分叉和压缩后保留激活状态,无需新增 Session projection。PTC 模式下记录的请求头只声明 `run_code`,因此恢复或分叉的 PTC Session(或加载技能后、下一条原生请求头记录前发生进程崩溃)不会保留 `document_*` 绑定,直到再次加载 Office 技能;[`office` 技能](../../../../packages/skill/skill-office/README.zh.md)指示模型在 `document_render`、`document_convert` 或 `document_recalculate` 不在工具列表中时调用 `skill` 重新加载 `office`。没有技能只包装单个操作,单独的渲染、重算或转换只需加载 `office`。技能不再携带可执行文件路径,因此 `skill-office` 没有 Node、CLI 或 Kit 位置配置,`office-kit` 的 `src/locate.ts` 没有 CLI 解析器,Desktop 和各 bundle 不发布 Office 可执行文件变量,Python sidecar 的独立 Node 只保留给 Python `deepseek_harness.office` 模块使用。
此决定部分取代[渐进式 Office 技能](2026-09-27-progressive-office-skills.zh.md):其操作技能、普通 shell 执行方式以及否决专用渲染工具的决定由本文取代;按照[单个 Office 技能](2026-11-06-single-office-skill.zh.md)决策,其四技能目录已由携带精简内联指导的 `office` 技能取代。
@@ -28,7 +28,7 @@ Status: implemented
**为已加载的 Office 技能新增 Session projection。** 在专用 projection 中折叠 `tools/result` 和 `user/message` 记录虽可在 PTC 恢复和分叉后还原技能激活状态,但需要新增 projection 服务、折叠规则和跨包依赖,而标准模式已由持久化的请求头记录该状态,PTC 模式只需重新加载 `office` 即可恢复。
**仅在 `Agent` 内存中记录激活状态。** 若像 `action-cards` 那样只检查 `WeakSet<Agent>`,标准模式恢复或分叉后的第一步会丢失 `office_*` 声明,因为新的 `Agent` 实例初始未标记;同时检查 `agent.session.requestHeader()?.tools` 可从已持久化的请求头保留声明。
**仅在 `Agent` 内存中记录激活状态。** 若像 `action-cards` 那样只检查 `WeakSet<Agent>`,标准模式恢复或分叉后的第一步会丢失 `document_*` 声明,因为新的 `Agent` 实例初始未标记;同时检查 `agent.session.requestHeader()?.tools` 可从已持久化的请求头保留声明。
**为每个操作保留一个技能。** 单独的渲染、重算和 PDF 导出技能会在每次单独操作前多一次 `skill` 调用,并重复工具 schema 与结果中已有的说明。
@@ -40,8 +40,8 @@ Status: implemented
## 影响
加载 Office 技能后,视觉检查只需一次 `office_render` 调用且无需清理,图片遵循 Session 的附件、卸载和回放规则。未加载 Office 技能的 Session 不消耗任何 Office 工具声明 token;加载了 Office 技能的 Session 激活约 1,813 个字符的专用 schema,支持 `toolUpdate` 的模型保留现有请求前缀,不支持 `toolUpdate` 的模型只开启一次新的请求序列。标准模式的恢复、分叉和压缩通过已记录的请求头保留工具声明,PTC 恢复或分叉以及在记录下一条请求头前崩溃的场景则通过再次加载 `office` 恢复。激活后,Office 操作在标准模式与 PTC 模式之间、在不同部署之间行为一致,各部署专用的 Node、CLI 和约束代码已经删除。
加载 Office 技能后,视觉检查只需一次 `document_render` 调用且无需清理,图片遵循 Session 的附件、卸载和回放规则。未加载 Office 技能的 Session 不消耗任何 Office 工具声明 token;加载了 Office 技能的 Session 激活约 1,988 个字符的专用 schema,支持 `toolUpdate` 的模型保留现有请求前缀,不支持 `toolUpdate` 的模型只开启一次新的请求序列。标准模式的恢复、分叉和压缩通过已记录的请求头保留工具声明,PTC 恢复或分叉以及在记录下一条请求头前崩溃的场景则通过再次加载 `office` 恢复。激活后,Office 操作在标准模式与 PTC 模式之间、在不同部署之间行为一致,各部署专用的 Node、CLI 和约束代码已经删除。
转换后的文件需要 shell 复制;没有 shell 工具的组合可以渲染,但无法交付转换后的文件,远程工作区则完全不能转换。临时输出在保留期满或根 Session 卸载后消失,恢复的 Session 需要重新转换。不提供把页面图片保存为文件。
验证包括:`tool-office.spec.ts` 覆盖三个工具的 schema、结果、参数规则、上限、失败、取消、PTC 分发和卸载,`activation.spec.ts` 覆盖技能触发激活、自定义 `activationSkills`、失败的技能调用、直接 `/office` 调用、跨恢复与分叉的 `requestHeader()` 持久化以及 PTC 重新激活;Office 套件测试覆盖输出存储的保留、淘汰、释放和清扫;Loader 组合测试在 Kit 缺失时以及 `office-kit` 条目缺失时返回 `unavailable` 消息,并在该条目加载后调用到服务;Desktop 打包 smoke 通过服务对真实 DOCX、XLSX 和 PPTX 文件执行渲染、转换和重算;录制的 headless Session 在加载 Office 技能前不声明 `office_*`,在加载后的下一步声明 `office_render`、`office_convert` 和 `office_recalculate`,其中包括一次因路由不接受图片输入而被 `office_render` 拒绝的渲染。
验证包括:`tool-document.spec.ts` 覆盖三个工具的 schema、结果、参数规则、上限、失败、取消、PTC 分发和卸载,`activation.spec.ts` 覆盖技能触发激活、自定义 `activationSkills`、失败的技能调用、直接 `/office` 调用、跨恢复与分叉的 `requestHeader()` 持久化以及 PTC 重新激活;Office 套件测试覆盖输出存储的保留、淘汰、释放和清扫;Loader 组合测试在 Kit 缺失时以及 `office-kit` 条目缺失时返回 `unavailable` 消息,并在该条目加载后调用到服务;Desktop 打包 smoke 通过服务对真实 DOCX、XLSX 和 PPTX 文件执行渲染、转换和重算;录制的 headless Session 在加载 Office 技能前不声明 `document_*`,在加载后的下一步声明 `document_render`、`document_convert` 和 `document_recalculate`,其中包括一次因路由不接受图片输入而被 `document_render` 拒绝的渲染。
@@ -0,0 +1,19 @@
# Bilingual-pair consistency record for 2026-11-02-im-file-media-admission.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write .agents/notes/implemented/architecture/2026-11-02-im-file-media-admission.md
/agent-note-im-media-admission-keeps-non-images-as-verbatim-files:
en: 717f477ade0b46d9
zh: a1be749bdfcef95e
/agent-note-im-media-admission-keeps-non-images-as-verbatim-files/problem:
en: 178f6a04fb7a0ed2
zh: fca0244178df74bf
/agent-note-im-media-admission-keeps-non-images-as-verbatim-files/decision:
en: ca514fc2df5ce15a
zh: d23baa204ab5d0cc
/agent-note-im-media-admission-keeps-non-images-as-verbatim-files/alternatives-considered:
en: ebe114e43895f8f2
zh: f28eeecf91bb46a7
/agent-note-im-media-admission-keeps-non-images-as-verbatim-files/consequences:
en: 098a547db5748ad8
zh: 037f50c170152071
@@ -0,0 +1,29 @@
# 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`.
@@ -0,0 +1,29 @@
# Agent Note:IM 媒体准入把非图片保留为原样文件
Status: implemented
[English](2026-11-02-im-file-media-admission.md) | 中文
## Problem
`@deepseek-ai/dsh-experimental-im` 会给已存消息的每个媒体元素打上稳定 id 标签(`[图片 #12.1]`、`[文件 #12.2 report.pdf]`、`[语音 #12.3 语音.opus]`),但只能准入图片这一种:`ImMediaStore.admit` 对 `file`、`audio`、`video` 一律返回 `skipped: 'unsupported'`,唯一的读取工具 `im_read_image` 同样拒绝它们。于是在聊天里发出文档、语音或视频的人,交给模型的只是一个打不开的标签——传输层、飞书解码器和 core 的资源抓取其实都已经带上字节(`<file src="satori:…/resources/<file_key>?type=file">`),只是没有人去消费。`media` 字段自己的契约本来就写着图片与文件都会下载,实现落后于它写下的行为。
## Decision
准入按载荷决定,而不是按种类决定。`ImMediaStore` 依旧抓取并按上限裁剪一个引用,随后把图片存成归一化的图片块,把其余每种元素通过 `ctx.attachments.saveFile` 原样存成持久文件。`ImFormatter.format({ media: true })` 把每个准入的文件作为 `file` 内容块追加在文本之后,请求装配因此把它投影成指名已保存只读路径的确定性 handle 文本——和浏览器附件的文件拿到的是同一种表示。
模型通过新增的 `im_read_file` 工具取回已经不在投递窗口里的文件:它把标签解析到对应元素,按原样文件准入,并通过 `ctx.fs.writeBytes` 把字节暂存到会话工作目录下的 `<tools.fileDir>/<seq>.<index>-<name>`,返回该路径与显示名、字节数、内容摘要。为此给 seam 增加了 `writeBytes`:走 `writeText` 会把字节解码并归一化,而附件存储的宿主路径在远端执行文件系统里根本不存在。`im_read_image` 保持只处理图片的契约;系统提示词指引同时点明两个工具和两种标签。
## Alternatives considered
**只加读取工具,不做提前准入。** 每条新消息能省下一次下载,但模型得为自己刚收到的东西再发一次请求——而这恰恰是图片路径不需要工具调用就能回答的请求形态。
**把文本类文件读进工具结果。** 靠媒体类型嗅探来内联文本,会引入一份格式白名单和同一份字节的第二种表示;给出路径则让模型自己的文件工具决定读多少。
**解析已存附件的宿主路径直接交给模型。** 这正是请求装配为已投递 `file` 块做的事,但它只在执行文件系统能映射宿主路径时成立——本地后端可以,远端 SSH 环境不行,而那恰恰是最需要它的部署。走 seam 暂存则在任何能写字节的提供方上成立,返回的路径模型自己的文件工具就能打开。
## Consequences
执行文件系统必须能存下这些字节:`fs-local` 通过与文本写入相同的原子暂存文件落盘,`fs-ssh` 把字节以 base64 交给辅助进程并受其单帧预算(8 MiB)限制,保留基类拒绝的提供方会让 `im_read_file` 直接失败,而不是编造一个路径。已投递的文件仍要靠宿主路径映射才有 handle 文本,因此远端 worker 只知道副本存在、按需自行暂存。暂存会多一份副本(持久附件加工作区文件),同一个 id 总是落到同一相对路径,重读只会覆盖而不会堆积。下载仍受每条消息的 `media.maxItems` 与单个元素的 `media.maxBytes` 约束,`media.download: false` 依旧只保留标签。
系统提示词段落多出一句(两种标签、两个工具),工具目录、子系统页面与两份 README 都列出 `im_read_file`。
@@ -12,8 +12,8 @@
en: d23bc3c8c3b20ac9
zh: 874c7a4dda283e89
/agent-note-add-the-hoc-slot-kind-so-plugins-can-wrap-owner-content-in-layers/decision/implementation:
en: 02ec3c2bfad692af
zh: 229a3ae12eac49a6
en: 14492f95b195917b
zh: e9ee4c438dccd225
/agent-note-add-the-hoc-slot-kind-so-plugins-can-wrap-owner-content-in-layers/decision/first-consumer:
en: 1afdf4ceeef7a3b3
zh: be01cf39850db0ca
@@ -21,5 +21,5 @@
en: b4824619c502b422
zh: 610364f2dc8cb2b7
/agent-note-add-the-hoc-slot-kind-so-plugins-can-wrap-owner-content-in-layers/consequences:
en: 6d350e8f9df1d33a
zh: 5411b39fc4cc14ce
en: 7576007507f393dc
zh: d964cc1419bb6917
@@ -42,7 +42,7 @@ Add a fifth kind: `hoc`.
| Package | Realization |
|---|---|
| `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.
@@ -42,7 +42,7 @@ Status: implemented
| 包 | 实现 |
|---|---|
| `ui-slots` | `SlotKind` 包含 `'hoc'`;`HocRenderOpts`(可选 `children` 与 `entryKey`)、`HocKeysOf`、`HocShare`;`RenderSlotFn` 为 hoc key 提供接受可选 `{ children, entryKey }` 的重载;`KindOptions` 的 hoc 分支含可选 `key`;`SlotCore.register` / `entriesOfSlot` 按 `(key 或通配, id)` 划分 hoc cell |
| `ui-renderer` | `HocOutlet` 从 `hocChainFor` 取渲染函数,该缓存按 host、存活声明与分派 key 划分,分派同一 key 的所有 outlet 共享。每个 ledger 版本它只用 `hocLayersFor` 重新选出一次该 key 的层(通配胜者加精确 key 胜者,精确 key 的层替换同 id 的通配层,按 `order` 排序),仅当这一有序列表按 entry 身份比较发生变化时才调用 `composeHocLayers` 把各层组合成一个嵌套渲染函数。每层是一个组件,在组合时固定按 scope 选定的 Entry(`StrictSessionEntry` / `SessionMaybeEntry` / `RootEntry`)、entry、slot inject 与崩溃上报,渲染时只接收 `owner` 与内一层。没有层时 outlet 直接返回宿主内容。`HocContentBoundary` 包住每层的内层内容,把其中的错误包装为 `HocContentError` 重新抛出;层的边界放行这种错误,`HocOutletBoundary` 再解开为原始错误。Entry 链以 JSX children 把 `children` 交给注册组件;非 hoc entry 收到 `undefined`。`SlotErrorBoundary` 接受 `crashed` 替换节点,层的边界在本次挂载内一直渲染该节点;层的崩溃上报传 `abdicate: false` |
| `ui-renderer` | `HocOutlet` 从 `hocChainFor` 取渲染函数,后者按 host、spec 对象、slot 名和 `entryKey` 缓存层链,同一组合的 outlet 实例共享一条层链。每个 ledger 版本它只用 `hocLayersFor` 重新选出一次该 key 的层(通配胜者加精确 key 胜者,精确 key 的层替换同 id 的通配层,按 `order` 排序),仅当这一有序列表按 entry 身份比较发生变化时才调用 `composeHocLayers` 把各层组合成一个嵌套渲染函数。每层是一个组件,在组合时固定按 scope 选定的 Entry(`StrictSessionEntry` / `SessionMaybeEntry` / `RootEntry`)、entry、slot inject 与崩溃上报,渲染时只接收 `owner` 与内一层。没有层时 outlet 直接返回宿主内容。`HocContentBoundary` 包住每层的内层内容,把其中的错误包装为 `HocContentError` 重新抛出;层的边界放行这种错误,`HocOutletBoundary` 再解开为原始错误。Entry 链以 JSX children 把 `children` 交给注册组件;非 hoc entry 收到 `undefined`。`SlotErrorBoundary` 接受 `crashed` 替换节点,层的边界在本次挂载内一直渲染该节点;层的崩溃上报传 `abdicate: false` |
| `scripts/gen-client-catalog.ts` | hoc 插槽的注册选项、渲染 `children` 的示例,以及 `wraps-owner-content` 替换风险 |
### 首个使用者
@@ -66,9 +66,9 @@ Status: implemented
- 增减一层会让其内部所有内容重新挂载,包括首页的输入框。
- 所有非 hoc 的注册组件都会收到 `children: undefined`,会覆盖同名的 owner prop。
- 每层在组件树中多一个组件和两个 error boundary;有层的 hoc 插槽另多一个 outlet 边界。
- outlet 的 `[data-slot]` 元素位于 owner 与内容之间,owner 侧选择器不能假定内容是直接子元素。
- 渲染器标记的是 slot 和[各层渲染 `children` 的位置](../../../../docs/subsystems/slots.zh.md#hoc-layers),而不是层组件自己的元素。插件不必添加自己的包装元素,但结构选择器必须考虑这些 DOM 元素。
- React 18 会在错误被重新抛出的位置重新采集组件栈,因此有层的 hoc 插槽之上的边界收到的内容错误,组件栈从 `HocOutletBoundary` 开始。
- 层如果自己在 `children` 外包错误边界,捕获到的是内部的 `HocContentError`,而不是原始的内容错误。
- frame 契约只在首页阶段成立:其他阶段根元素不参与层叠隔离,未经 portal 的 Conversation 浮层仍能盖住悬浮在中栏上方的 AppFrame 元素;首页阶段它们只在根元素内部比较层级。
- `HocOutlet` 把层组件保存在按 host、存活声明与分派 key 共享的编译缓存中,而不是 outlet 实例状态里,因此不依赖 React 保留 memo 缓存;这些组件是其内部内容的重新挂载边界,重新声明的插槽从空缓存开始。
- `HocOutlet` 把层组件保存在共享的编译缓存中,而不是 outlet 实例状态里,因此不依赖 React 保留 memo 缓存;这些组件是其内部内容的重新挂载边界。不同名称的 slot 即使复用同一个 spec 对象,也不共享层链。
- 其他 kind 仍以 [slot 体系标准](2026-07-22-slot-type-chain-implementation.zh.md) 为准;本 Note 新增第五种。
Loaded 100 of 6033 files, more files were not shown because too many files have changed in this diff. Show more