diff --git a/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.i18n.yaml b/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.i18n.yaml index 2112efbc14..5661e103a9 100644 --- a/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.i18n.yaml @@ -9,17 +9,20 @@ en: 159de908b09780eb zh: 8d15ca2f15b8846a /agent-note-client-plugin-package-assets-served-by-url/decision: - en: 42d5a78134c944d5 - zh: 5118bfc6b041a67f + en: 8ffcd355ec5e8271 + zh: 2932530bf783e3f7 /agent-note-client-plugin-package-assets-served-by-url/decision/references-and-file-names: - en: 4f2daba2e01c9460 - zh: 37177d73b3842255 + en: 69ca2e4ba27b2841 + zh: cb7d7c1bec1adf7b /agent-note-client-plugin-package-assets-served-by-url/decision/build: en: 1751930093d55cea zh: 8e92e2de062edb96 /agent-note-client-plugin-package-assets-served-by-url/decision/host-route: en: 151b7300f5b27a9f zh: fae9adff942c2ce8 +/agent-note-client-plugin-package-assets-served-by-url/decision/webworker-preview: + en: 54acdc86819cee80 + zh: 28abe4517cf14182 /agent-note-client-plugin-package-assets-served-by-url/decision/changes-and-package-manifests: en: eedff52d04763c50 zh: 203bfcf81242b8fe @@ -27,11 +30,11 @@ en: 1e4d83d0de2d47c9 zh: dc2c2876c73d3b1c /agent-note-client-plugin-package-assets-served-by-url/alternatives-considered: - en: 23cca9b55c4252bd - zh: a7afb8d1dd943a8b + en: 98960e10634ee536 + zh: f0fdb0b0cdf9511c /agent-note-client-plugin-package-assets-served-by-url/consequences: - en: f2ec2d1773c3c57c - zh: cec2c0455ff26064 + en: 898262f39c0243ae + zh: e30f2161f5b669fe /agent-note-client-plugin-package-assets-served-by-url/testing: - en: b1b95226919615c6 - zh: c928aedf738d2b40 + en: d2ef6b4e95a9c6fd + zh: 7fcd77971bd20be5 diff --git a/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.md b/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.md index 3a3b2733be..9b1c8ff7be 100644 --- a/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.md +++ b/.agents/notes/implemented/architecture/2026-10-19-client-plugin-package-assets.md @@ -12,11 +12,11 @@ The embedded bytes were downloaded and parsed with the JavaScript whether or not ## Decision -A Client plugin package keeps raw images under `src/client/assets/`. The shared preset emits each referenced image under `lib/assets/` and turns the reference into a document-relative URL; the package publishes the emitted files with `"exports": { "./assets/*": "./lib/assets/*" }` and `lib/assets` in `files`; the client-modules Host serves them at `/plugins//assets/`. +A Client plugin package keeps raw images under `src/client/assets/`. The shared preset emits each referenced image under `lib/assets/` and turns the reference into a synchronous `require.asset()` call on the bundle's module loader; the package publishes the emitted files with `"exports": { "./assets/*": "./lib/assets/*" }` and `lib/assets` in `files`; the client-modules Host serves them at `/plugins//assets/`. ### References and file names -Client code imports an image (`import art from './assets/a.webp'`), and the package's own stylesheets reference one with a relative `url()`. Both compile to the same string. The emitted file name inserts the content revision, the first 12 hexadecimal digits of the SHA-1 digest of the bytes, before the extension, so one URL always names one content: +Client code imports an image (`import art from './assets/a.webp'`), and the package's own stylesheets reference one with a relative `url()`. Both compile to a `require.asset(reference)` call whose argument is the same reference; a stylesheet becomes string literals joined with those calls, which run when its injected text is built. The module system answers each call through its `resolveAsset` option, which returns the reference unchanged unless a carrier supplies one. The emitted file name inserts the content revision, the first 12 hexadecimal digits of the SHA-1 digest of the bytes, before the extension, so one URL always names one content: ```text src/client/assets/running-whale@2x.png @@ -24,7 +24,7 @@ lib/assets/running-whale@2x-06738fa29b2f.png plugins/@deepseek-ai/dsh-client-ui-chat/assets/running-whale%402x-06738fa29b2f.png ``` -Each path segment is percent-encoded 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 `