# 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
Vendored Packages
This directory contains source-vendored copies of the Cordis framework and its foundation libraries. They are copied into this monorepo instead of being depended on via npm, so that the harness fully owns its framework layer (auditable, patchable, pinned).
All vendored packages use the @deepseek-ai scope (cordis → @deepseek-ai/cordis, @cordisjs/plugin-<x> → @deepseek-ai/cordis-plugin-<x>). The manifest table records upstream versions and source commits; each package manifest carries its Harness release version and publication metadata. References to vendored packages use workspace:~, so local builds resolve the workspace packages and published ranges permit patch updates within the same minor version. Upstream MIT LICENSE files are preserved in each package directory.
This file covers the manifest, the local-modification log, and the procedure for updating an existing vendored package. To add a new one, see the cookbook guide: docs/cookbook/adding-a-vendored-package.md.
Manifest
| Directory | npm name | Upstream name | Version | Upstream repo | Commit |
|---|---|---|---|---|---|
cosmokit/ |
@deepseek-ai/cosmokit |
cosmokit |
1.8.1 | https://github.com/shigma/cosmokit | 02e691c5aa7f37f6e0b1cee7ee8f4a21c2e34507 |
schemastery/ |
@deepseek-ai/schemastery |
schemastery |
3.18.0 | https://github.com/shigma/schemastery (packages/core) |
cf0b7e5481d0e31d10cdc30bc45c09366c332f27 |
cordis/ |
@deepseek-ai/cordis |
cordis |
4.0.0-rc.12 | https://github.com/cordiverse/cordis (packages/core) |
01b396240ce47cf2779c40af9bc445bb748fe112 |
loader/ |
@deepseek-ai/cordis-plugin-loader |
@cordisjs/plugin-loader |
1.0.0-rc.9 | https://github.com/cordiverse/cordis (packages/loader) |
01b396240ce47cf2779c40af9bc445bb748fe112 |
include/ |
@deepseek-ai/cordis-plugin-include |
@cordisjs/plugin-include |
1.2.0 | https://github.com/cordiverse/cordis (packages/include) |
01b396240ce47cf2779c40af9bc445bb748fe112 |
group/ |
@deepseek-ai/cordis-plugin-group |
@cordisjs/plugin-group |
1.0.0 | https://github.com/cordiverse/cordis (packages/group) |
01b396240ce47cf2779c40af9bc445bb748fe112 |
timer/ |
@deepseek-ai/cordis-plugin-timer |
@cordisjs/plugin-timer |
1.1.4 | https://github.com/cordiverse/cordis (packages/timer) |
01b396240ce47cf2779c40af9bc445bb748fe112 |
hmr/ |
@deepseek-ai/cordis-plugin-hmr |
@cordisjs/plugin-hmr |
1.0.15 | https://github.com/cordiverse/cordis (packages/hmr) |
ed8a7755c26a27a72064a21dea036ad1d1d6833c |
logger-console/ |
@deepseek-ai/cordis-plugin-logger-console |
@cordisjs/plugin-logger-console |
1.0.0 | https://github.com/cordiverse/cordis (packages/logger-console) |
01b396240ce47cf2779c40af9bc445bb748fe112 |
element/ |
@deepseek-ai/cordis-element |
@cordisjs/element |
0.3.0 | https://github.com/cordiverse/element | 14acf617dc60b644ff27d3ae518df86b0fe1377b |
fetch-file/ |
@deepseek-ai/cordis-fetch-file |
@cordisjs/fetch-file |
1.0.3 | https://github.com/cordiverse/fetch-file | d8c5985df2b3b32a842bc7e04d7f6da5a5d8c0ed |
http/ |
@deepseek-ai/cordis-plugin-http |
@cordisjs/plugin-http |
1.5.1 | https://github.com/cordiverse/http (packages/core) |
c70ee9c2b7b9085e904979e1a90b39f4c89a9804 |
satori-element/ |
@deepseek-ai/satori-element |
@satorijs/element |
4.0.0-alpha.0 | https://github.com/satorijs/satori (packages/element) |
662c3daff128b4b610ebbc393bac388679e60010 |
plugin-im-core/ |
@deepseek-ai/cordis-plugin-im-core |
@satorijs/core |
5.0.0-alpha.0 | https://github.com/satorijs/satori (packages/core) |
662c3daff128b4b610ebbc393bac388679e60010 |
plugin-im-adapter-lark/ |
@deepseek-ai/cordis-plugin-im-adapter-lark |
@satorijs/adapter-lark |
4.0.0-alpha.0 | https://github.com/satorijs/satori (adapters/lark, source rewritten; see local modifications) |
662c3daff128b4b610ebbc393bac388679e60010 |
plugin-im-adapter-qq/ |
@deepseek-ai/cordis-plugin-im-adapter-qq |
@satorijs/adapter-qq |
5.0.0-alpha.0 | https://github.com/satorijs/satori (adapters/qq, re-ported: its src/ at the pin is bot/, internal/, http.ts, message.ts, types.ts, utils.ts, ws.ts; see V35 and the sync caveat there) |
662c3daff128b4b610ebbc393bac388679e60010 |
plugin-im-markdown/ |
@deepseek-ai/cordis-plugin-im-markdown |
@satorijs/markdown |
4.0.0-alpha.0 | https://github.com/satorijs/satori (packages/element, split from src/markdown.ts; see V68) |
662c3daff128b4b610ebbc393bac388679e60010 |
Third-party dependencies of the vendored packages stay on npm: @standard-schema/spec, yaml, chokidar, picomatch, @babel/code-frame, supports-color, node-addon-require-builtin, undici, file-type, mime-types, path-to-regexp, path-to-regexp-typed, protobufjs, and the markdown parser closure of plugin-im-markdown (mdast-util-from-markdown, mdast-util-gfm, micromark-extension-gfm).
Intentionally not vendored (verified unused by this set): reggol, @cordisjs/utils, @cordisjs/unyaml (dev-time YAML import hook only).
Local modifications
Keep this log exhaustive — every divergence from upstream must be listed. Each entry has a stable ID: remove an entry when its divergence no longer exists, and never renumber or reuse IDs. The next new entry is V119.
-
V1 ·
hmr/src/index.ts: removed the./locales/en-US.yml/./locales/zh-CN.ymlimports, the.i18n({...})call on theConfigschema, and thesrc/locales/directory. Rationale: those imports require a runtime YAML loader hook (@cordisjs/unyaml) that we do not vendor; the i18n texts only localize config descriptions. -
V2 · All
package.jsonfiles: regenerated for Harness releases with scoped names, release versions, publication metadata, precise bundled-runtime andlib/types/**/*.d.ts/.d.ts.mapfile entries, source exports where applicable, and declaration metadata pointing atlib/types. References within the vendored set useworkspace:~. HMR declaresesbuildas a direct dev dependency for its importedBuildFailuretype, Loader requiresnode-addon-require-builtin@^0.1.4to match published app runtimes, and Include declaresyaml@^2.9.0instead of upstream's^2.9.1so the workspace installs one copy ofyaml. -
V3 · All
tsconfig.jsonfiles: regenerated to extend the repo-roottsconfig.base.json, emit TypeScript intermediates tolib/types, and declare project references. -
V4 · Vendored TypeScript source internal specifiers: changed local relative imports/exports from upstream's specifier shape to explicit
.tsspecifiers so TypeScript rewrites emitted JS to.jswhile declarations keep explicit, NodeNext-safe.tsspecifiers. This includesloader/src/config/isolate.tsusingdeclare module './entry.ts'. Core's upstream source already uses explicit.tsspecifiers. Type-only dependencies useimport typeor inlinetypemodifiers so ESM output does not retain erased interfaces. -
V5 ·
schemastery/tsdown.config.ts,logger-console/tsdown.config.ts,fetch-file/tsdown.config.ts,loader/tsdown.config.tsandplugin-im-core/tsdown.config.ts: ours, not upstream files — per-package build-shape overrides (dual ESM+CJS output; separate node/browser entries; Loader's single self-contained entry; andplugin-im-core's two entries, the runtimelib/index.jsand thelib/testing.jstestkit behind its./testingsubpath) for the repo-root tsdown build. They read the JS emitted underlib/typesand then write the publish runtime entries underlib/. Like the regenerated tsconfigs, they are not part of the upstream sync surface. -
V6 ·
cordis/src/fiber.tslifecycle hardening: locally closes three reentrant disposal gaps. An effect's owner-list wrapper is registered before its setup body runs, so an unload begun from inside setup awaits setup and every collected cleanup; synchronous setup failure removes the wrapper and rolls back collected cleanup. Async cleanup stays owner-visible until quiescence, and Cordis's internal effect composition joins an already-running cleanup while repeated public disposer calls retain their upstream single-shot result. Effect creation is rejected while the owner isUNLOADING(whilePENDINGandLOADINGremain legal), preventing cleanup-time registrations from escaping the unload snapshot. Child fibers register and receive their parent-owned disposer beforeinternal/pluginpublication, resolve dependency declarations added by that notification before activation, drain effects attached while pending, and contain teardown-notification failures per observer so one callback cannot starve peers or interrupt ownership cleanup. -
V7 · JSDoc enrichment: added
@param/@returnstags and contract documentation (disposal semantics, waterfall veto, bail conditions, error cases) across the public plugin-author surface —Context(class, statics, theisolate()rule that isolated scopes never fall back to an injected view, and theContextinterface properties incl.[Context.root]), module re-exports, shared utility helpers,EventsService,Fiber,ValidationErrorand its path helpers,RegistryService,ReflectService,Serviceand its intercept-metadata members,LoggerServiceand theirdeclare module './context.ts'overloads. The upstream line comment onreflect.ts's exportedlocate()is rewritten as JSDoc. Loader documentation coversloader/src/{index,internal,config/entry,config/group,config/isolate,config/tree,config/utils}.ts, including entry ownership, tree mutation methods, the!!jsdiscriminator, entry option validation, source positions andModuleNotFoundError. The upstreamEventsService.dispatch()deprecation annotation is omitted: DSH enumerates callbacks to contain each observer failure independently, which the typed dispatch methods do not provide. Timer retains its local class and helper summaries; its README is local documentation because the upstream package has none. Cosmokit and Schemastery add summaries to their exported helpers, types and namespaces, logger-console to its exporters and config namespace, and HMR to its build-failure logger inhmr/src/error.ts. Comment-only; no code changes. Motivation: the website API-reference generator renders these docs and hard-errors on undocumented members. Retire this entry when the enrichment is upstreamed. -
V9 ·
hmr/src/index.tsmodule-watcher readiness and native paths: realpath the existing watch base, classify framework modules and attach listeners before reporting readiness, and compare config paths using both canonical and configured spellings. This preserves Node module-cache identity across Windows short-name paths and filesystem aliases. The main watcher usesignoreInitial: trueso startup reads do not trigger another refresh; exact profile patch watching is owned bypackages/boot/hmr/src/watch-config.ts. The Include change listener logs a rejectedInclude.refresh()instead of leaving the rejection unhandled; the rejection reports unsaved runtime changes while Include keeps its running tree. Covered bypackages/boot/hmr/tests/watch-config.spec.tsandscripts/cordis-vendor-hmr-include.spec.ts. -
V10 · Vendored Node-compatible TypeScript: marked erased imports explicitly across
cordis,loader,include,hmr, andschemasteryso Node's native TypeScript transform does not request types as runtime exports. Schemastery's source uses an ESM default export and its package declarestype: module. Conditional exports select.mjsfor import and.cjsfor require; without them, concurrent imports under module-hook hosts reach the CJS entry and can race its require of ESM Cosmokit (ERR_REQUIRE_ESM_RACE_CONDITION). -
V11 · Include patch and YAML exports:
include/src/index.tsexports upstreamapplyPatchesasapplyEntryPatcheswith itsPatchResulttype, sodsh --dump-configcomposes entries with the same algorithm that mounting uses. It also exportsparseEntryYaml,stringifyEntryYamlandentryYamlErrorPositionover the!!jsYAML dialect, using theyamloptions with which_read()parses Include's own file, so every DSH reader and writer of Include-dialect YAML uses Include's parser.parseEntryYamlthrows the first parse error or warning, such as an unknown tag or an alias without a preceding anchor (V30), adds line positions to alias errors soentryYamlErrorPositionreads them, and returnsundefinedfor an empty document;stringifyEntryYamlalways writes withaliasDuplicateObjects: false, matching the previousnoRefsoutput, and offers no option to emit aliases, while Include's own writer keeps upstream's options. Covered bypackages/boot/app-boot/tests/config-reload.spec.ts,scripts/cordis-entry-commit.spec.tsandscripts/cordis-entry-yaml.spec.ts. -
V14 · Include persistence results:
include/src/index.tskeeps an error for unsaved journal changes.flush()retries pending writes and rejects while changes remain unsaved;stop()returns the same result and always stops the child tree; a later successful flush clears previous errors. A failedrefresh()can also reject while runtime changes remain unsaved. Patch-owned changes route to the parent Include, so callers that need them persisted must flush that parent too. The constructor omits upstream'sctx.hmr.watch(this.filename, () => this.refresh())registration because neither HMR provider exposeswatch(); both find each Include by scanning loader entries for itsfilenameand callrefresh(). Ordinary Fiber teardown keeps its error containment. Covered byscripts/cordis-include-journal.spec.tsandpackages/host/directory-picker-auto/tests/loader-composition.spec.ts. -
V15 · Configuration access across Core, Loader, Include and HMR: rc.11 Core owns raw
Fiber.config,internal/config(fiber, next),internal/commitand awaitedinternal/update(config, next). Root-fiber candidate resolution remains available without a plugin schema. LocalrawConfig,resolveConfig(candidate)andeffectiveConfigaccessors retain the DSH consumer API. Fiber caches the object passed to activation or a successful update that keeps the instance; candidate resolution is pure, failed or superseded updates cannot replace the cache, and volatile updates retain references. Loader resolves only entry roots and excludes Group/Include tree carriers, so nested!!jsexpressions wait for their own injections. Include retains its tree-carrier marker and public patch exports, and HMR transfers raw config through the accessors. Covered byscripts/cordis-config-access.spec.ts,scripts/cordis-core-lifecycle.spec.tsand the boot/HMR suites. -
V16 ·
cordis/package.jsonpublishessrc: addedsrcto thefileslist, joining the other eight vendored packages. Cordis declares"./src/*": "./src/*"in its exports, so a tarball withoutsrcpublishes an export map pointing at absent files; the release change judgement also readsfilesto decide whether a diff reaches the payload, and a package whose only published paths are build output has no tracked path to match. -
V17 ·
@deepseek-airescope: every vendored manifestname, every internal dependency entry among the vendored set, and every module specifier that reaches them use the scoped names in the manifest table'snpm namecolumn. Directory names, version numbers, and dependency ranges are unchanged, and no upstream runtime identifier is renamed —Symbol.for('schemastery')and Schemastery'svendor:metadata field keep their upstream values. Re-apply withpnpm run rescope-vendor --applyafter a sync; the table's two name columns are the mapping, restated for consumers in docs/rescope.md. -
V22 · Volatile config across
cosmokit,schemastery,cordis, andloader: Cosmokit supplies immutable references and framework-owned commits;deepEqualtreats two references as equal, propagates strict comparison into arrays, compares every array slot with holes treated as undefined, handles cycles conservatively, compares URLs by normalized href, and compares other opaque objects by identity in strict mode. Schemastery adds.volatile(), optional/default inference, placement validation without eager lazy-schema expansion (a lazy inner is validated once when built), metadata-free serialized node compatibility, serialized metadata, reference-aware simplification, unsupported volatile values reported asValidationErrorwith their path, and.default()accepting the raw input typePartial<S>because a volatile field makes the output type carry references. Loader's save path callssimplifywith its schema receiver (unparse.call), an independent fix for the unbound-thiscall. Cordis exports consumer types without changing Fiber lifecycle. Loader compares raw options strictly inEntry.update; for a config-only change on an active fiber it calls the pureequalExceptVolatilefunction inconfig/diff.ts, which narrows the Standard Schema to Schemastery'sSchematype (a new type-only@deepseek-ai/schemasterydependency ofloader) and recursively skips fixed volatile paths using schema metadata without executing config hooks or validation. Missing or null object nodes compare using their declared defaults, including nodes without volatile descendants; schema backedges retain raw comparison. Entry passes its actual schema and preserves ordinary context and custom-update lifecycles. For a volatile-only change,Entry._commitVolatiletakes the canonical fiberentry.fiber.ctx.fiber(Entry.fiberholds the registry wrapper), re-parses the raw config throughFiber.resolveConfig(), compares ordinary effective values, commits references and emits the instance-localloader/volatile-updatedeclared inloader/src/index.ts; a changed ordinary effective value falls back to the ordinary remount, and an invalid candidate is logged while the raw config stays retained for the next activation. Cosmokit provides reference enumeration and commits, andsimplifyis called with its schema receiver. The package READMEs document these additions; schema tests live inscripts/volatile-config.spec.ts, Loader runtime and real-file tests inscripts/loader-volatile-update.spec.ts, and code replacement tests in the HMR module suite. -
V23 ·
loader/src/config/entry.tsmodule identity: retains each entry's raw import result asmoduleNamespace, before plugin export normalization. HMR matches that object to Node's cached module namespace and updates it after a successful reload.EntryTree.import()keeps its existing arguments and return value;loader/README.mddocuments the additive field. -
V24 ·
timer/locale/{en,zh}.jsondisplay metadata: local English and Chinese titles and descriptions for the Settings plugin inventory.timer/package.jsonexports and publishes these locale resources. -
V25 · Loader lifecycle adaptations: before a combined context/config update, Loader refreshes dependencies locally, which prevents activation against stale isolation bindings; disabled-entry updates await disposal. Failed fibers require an explicit update after correcting their input or dependencies. Core retains the effect hardening in V6; rc.11 owns dependency teardown ordering and superseded-activation handling.
-
V26 ·
loader/src/config/tree.tscross-tree moves: backports cordiverse/cordis#271, merged afterv4.0.0-rc.12. WhenEntryTree.update()moves an entry into a group of another tree, the entry and the same-tree members of its group move their store registrations to the target tree, and the move is rejected before either tree changes when the target tree already holds one of their ids. The source tree receives a removal and the target tree a creation, withoutlegacyorfrom. Upstream atv4.0.0-rc.12keeps the entry registered in the source tree and the target receives an update withlegacy, so the Include journal writes a partial row and reconciling the target file creates a second Entry. Retire this entry when the vendored Loader includes the upstream fix. Covered byscripts/cordis-include-journal.spec.ts. -
V27 ·
loader/src/config/utils.tsexplicit ids with::validateOptions()accepts ids containingEntryTree.sep, soEntryTree.create(),EntryTree.update()and group reconciliation admit them; upstream rejects them with anid must not containissue.validateOptions()keeps its upstreamsepparameter. Generated bundles from@deepseek-ai/dsh-creation-recommendationsprefix their row ids with<package name>:, and installed profiles already contain such rows.resolve()still splits ids on:, so these entries cannot be addressed by nested path. Covered byscripts/cordis-entry-commit.spec.ts,scripts/cordis-loader-rc9.spec.tsandpackages/extensions/creation-recommendations/tests/loader-composition.spec.ts. -
V30 ·
include/src/index.tsunresolved aliases: backports cordiverse/cordis#354 (c9fe179ce5ac484620a387a1697409cb007d4178), merged afterv4.0.0-rc.12._read()reports each alias without a preceding anchor as aBAD_ALIASYAMLParseErrorwith its position, distinguishing an unknown anchor from one written after the alias; at the tag,document.toJS()throws an unlocatedReferenceErroroutsideConfigFileError.unresolvedAliases()matches the upstream commit verbatim. Retire this entry when the vendored Include includes #354. Covered byscripts/cordis-loader-rc9.spec.tsandscripts/cordis-entry-yaml.spec.ts. -
V31 · IM package set in
vendor/: five packages come from the Satori pin recorded in the manifest —satori-element/,plugin-im-core/,plugin-im-adapter-lark/,plugin-im-adapter-qq/andplugin-im-markdown/— with independently pinnedelement,httpandfetch-filedependencies. Their upstream sources are replaced wholesale (V32–V35, V68), so no upstream IM source is copied verbatim: the platform routes, wire envelopes, protobuf/JSON gateway formats and the token endpoints carry over, the rendering pipeline does not. Service names, events andsatori:URLs keep their upstream names. -
V32 ·
satori-element/is the element vocabulary: upstream factories and aliases, the globalJSXdeclaration and the blanket re-export ofcordis-elementare replaced by a typedElementMap/VariantMap/Element<K>overlay over the unchanged runtime (vocabulary.ts), the block/inline category and tier table (elements.ts), the typedhfactory with an automatic JSX runtime (factory.ts),normalize()(root<message>, flow-container wrapping, envelope and content-model validation;normalize.ts),variantsOf()/variantKey()(variants.ts), and the plain projectiontoText()(text.ts). The markdown parser isplugin-im-markdown's (V68), not this package's. Plain strings are literal text — markup is parsed only by an explicitfromMarkdown()call. -
V33 ·
plugin-im-core/is the IM engine: upstreammessage.ts(MessageEncoder), theMethods/features/supports(name)surface, the component service and the protocol dependency are gone.protocol.tsholds the public types (Login,User,Status,Meta,WebSocket,ChatRef,Target,UserRef,MessageRef,InboundMessage, theButtonEventaugmentation). A mode renders what its registry registers — the tag plus the variants its handler declares — and adapters say nothing about a chat.mode.tsholdsdefineModeand theLimitKeytable,registry.ts,fallback.tsandtransform.tsthe transform engine and the core fallback table,degradation.tsthe priced mode score,directives.tstheprefer-streamable-mode/prefer-expressive-modecontent directives,resource.tstheResourceRefwalk and the LRU resource cache (bounded concurrency, single upload per cache key),stream.tsthe stream scheduler with itspatch/edit/appenddrivers,errors.tsthe platform taxonomy (PlatformErrorkinds, retry hints,published) andtesting.tswithtesting/the offline testkit (FakeAdapter, the shared corpus, conformance, goldens).bot.tssplits the publicBotfrom the implementerAdapter: one pipeline (normalize→transform→prepare→serialize→sendPayload) for every adapter, mode resolution per publication, retries,PartialSendError,edit/delete/streamover the same handle, and the awaitedsatori/receiveintake gate.session.tskeeps the slimSessionenvelope with itsonClickcallback registry, andinternal.tsserves thesatori:routes plus the/_api/:nameand/_tmp/:idpassthroughs. -
V34 ·
plugin-im-adapter-lark/is rewritten for the protocols above:config.tsis the Schemastery schema (platformselects the OpenAPI host and the reported platform;cardStreaming,callbacks,allowAtAlland the long-connection limits),api/client.tsthe typed REST client (message create/reply/update/patch/delete/get/list, chat get, image and file upload, resource download, reactions) over an injected transport,api/token.tsthe tenant token with a 30-minute refresh window and a single-flight refresh,api/events.tsthe schema-2.0 event envelopes and theLarkReferrercontract.errors.tsmaps the platform code table ontoPlatformErrorwith thepublishedverdict, and230075stays alimitso the stream scheduler resolves a refused edit by recall-and-resend.ws.tsis the protobuf long connection (gateway handshake, fragment reassembly, heartbeats, ACK only after intake, immediate answer forcard.action.trigger),bot.tsthe adapter shell,modes/post.tsandmodes/card.tsthe two modes with their escapers,prepare.tsthe upload stage,send.tsthe create/reply/edit/recall routes anddecode.tsthe inbound decoder and the chat-kind mapping. -
V35 ·
plugin-im-adapter-qq/is ported for the protocols above:config.tsis the Schemastery schema with two explicit decisions —transport: 'ws' | 'none'(a REST-only client never opens a gateway session) andpassive.seqBasestarting at 2, becausemsg_seqis deduplicated per(msg_id, msg_seq)and koishi's adapter starts at 1 — plus configurablebaseUrlandtokenUrl.token.tscaches the app access token, refreshes atexpires_in − 60 s, refreshes single-flight and keeps serving a still-valid token when a refresh fails.api.tsis the typed v2 REST client (gateway, group/C2C messages, files, recall, interaction acknowledgement, C2Cstream_messages) with self-describinggroup:<openid>/user:<openid>addressing.errors.tsmaps the platform code table, the304…quota family and the HTTP-status fallbacks ontoPlatformError.passive.tsowns the passive-reply windows and the per-eventmsg_seqbudget, and reports the replies a stream may still spend.modes/text.ts,modes/markdown.tsandkeyboard.tsrender the twomsg_typebodies and the custom keyboard,prepare.tsuploads media,send.tspublishes with the passive bookkeeping and the dedupe retry,stream.tsthe C2Cappenddriver,ws.tsthe JSON gateway state machine anddecode.tsthe inbound decoder plus the chat-lifecycle events. Upstream'ssrc/at the pin is a different file set (bot/,internal/,http.ts,message.ts,types.ts,utils.ts,ws.ts), so a sync must port the upstream changes into these modules instead of copying the directory over them. -
V36 · Retained Feishu API subset:
plugin-im-adapter-lark/src/types/retains theauth.ts,im.tsandcontact.tsAPI families fromadapters/lark/src/types/at the Satori pin, plus the transitive closure of shared declarations inindex.tsthat those families and the handwritten adapter sources reference, with explicit.tsandtypeimport specifiers (V4). Packagesrcpublication includes these files, so the subset ships in the tarball. -
V37 · IM dependencies and build integration: HTTP uses the repository's
undici@8.12.4;fetch-fileusesmime-types@^3.0.2/@types/mime-types@^3.0.1and keeps separate node/browser runtime builds;plugin-im-markdowndeclares the markdown parser closure. The vendored manifests reference each other withworkspace:~, and every vendored tsconfig extends the repo-roottsconfig.base.jsonand compiles under its strict settings — the upstream nullability, catch and function-variance relaxations are not carried over. HTTP serializes WebSocket headers as an entry object, and adapters send multipart bodies through theundiciFormDataclass (V42). -
V38 · Awaited intake in
plugin-im-core/src/{index,bot}.ts: the awaitedsatori/receiveevent andBot.receive().dispatch()stays synchronous; the Feishu WebSocket receiver awaits intake consumers before sending a success ACK, then publishes ordinary observer events. An intake rejection withholds the ACK without discarding the caller's durable state. -
V39 · Connection ownership in
plugin-im-coreand the adapters: each run owns its cancellation, retry timers, sockets, initialization, heartbeat, token refresh and event-processing promises. Stop aborts setup and connections, cancels timers, closes late sockets, clears fragments and awaits tracked work; concurrent starts retain only the latest controller. Initial retry exhaustion marks the bot offline, an established connection keeps supervised reconnects, and an initialization failure can never mark the bot online. Token refresh logs no credentials and closes the connection on failure so supervision can reauthenticate. -
V40 · Platform wire validation and limits: the Lark long connection validates the selected envelope and application identity, ignores unselected event families, and bounds frame bytes, fragment counts, partial messages and outstanding intake operations through configuration; fragments expire, identical duplicate segments do not advance completion, and conflicting segments are rejected. The QQ gateway validates every frame, serializes dispatches in arrival order while heartbeats stay independent, and treats a missing
HEARTBEAT_ACKas a half-open socket. Both clients answer a platform-declared failure with a typed error carrying the platform code. -
V41 · Lark media and reactions: Uploads go through the image and file routes and require a platform key; a media message is sent once with a caller-owned
uuidand an authorized reply target.createReaction()adds one catalogue emoji (a repeated create is harmless) anddeleteReaction()reads the message's reactions first and deletes only the one this application owns, because the platform deletes by reaction identity rather than by emoji. -
V42 · Multipart bodies in
http/src/index.ts: aFormDatabuilt by Node's global class is rebuilt in theundicipackage's own class before dispatch, andencodeRequestrecognizes either class.undici@8.12.4is a different implementation from the fetch built into Node, so itsfetchcoerced a foreignFormDatato a string: every multipart request went out as[object FormData]withcontent-type: text/plain, and Feishu answered234001 Invalid request paramfor each image or file upload. Covered byscripts/vendor-http.spec.ts, which drives one multipart request against a loopback server. -
V43 · Mode selection, content directives and the mode score in
plugin-im-core: no configuration knob and no caller picks a mode; an adapter declares its modes and their order (Adapter.modeOrder) andBot.send/Bot.renderresolve one per publication — every candidate mode is transformed once and the one losing the least wins, the declared order breaking a tie. Two content directives narrow the candidates: a root-level<meta name="prefer-streamable-mode" value="true" />keeps only modes with a stream driver (implied byBot.stream, which also keeps the mode fixed for the whole stream), andprefer-expressive-modekeeps the broadest mode by counting theelement.*keys it renders natively. Losing content is priced rather than counted (media, mentions and mid-message structure cost more than inline formatting, a dropped element always costs most, a folded panel costs nothing), so losing bold never weighs as much as losing a picture, and a mode can override one price or forbid a loss.RenderResultreports the resolved mode. -
V44 ·
<fallback>replaced the capability layer as the way content adapts to a platform:@deepseek-ai/satori-elementgained thefallbackelement (each direct child is one ranked candidate, a JSX fragment counting as one) and its internalcasenode,normalizeturns candidates intocasechildren normalized as content of the element the<fallback>stands in, and renderers now write alternatives instead of asking what a platform supports.RenderEngine.renderpicks the first candidate whose whole subtree is native, else the last candidate with the usual lowering, records the choice inRenderReport.fallbacks(and charges a later candidate indegradationScore), so<fallback><title>…</title><h3>…</h3></fallback>names both the expressive and the plain spelling of one message. Nothing in the engine consults per-chat state: a mode renders what its registry registers, a declared variant included. -
V45 · The IM capability layer is gone, not deprecated:
plugin-im-core/src/capabilities.ts(ChatFacts,FactCache,LearnedFact,Support,Level,Capabilities, theelement.*/message.*/limit.*key vocabulary,evaluateCapabilities,mergeCapabilities),Bot.supports/support/capabilities,Adapter.facts,Mode.operations,HandlerOptions.available,PlatformError.factsandRenderContext.caps/supportswere removed together with the Lark chat probe (facts.ts) and the QQ passive-window facts. What a platform allows is now the platform's answer at the moment of the call: a refusal rejects with the classifiedPlatformError, and content that must degrade says so with<fallback>.LimitKeymoved tomode.ts, a mode owns its element budget inassemble/check, andMessageStream.abort()reports whether a recall removed the published message. The IM consumers (@deepseek-ai/dsh-imand its plugins) stopped querying capabilities: a renderer reads the stream strategy it was handed and writes alternatives. -
V46 ·
button[type=input]and the Lark card mode: the "a click sends this text as the user" button variant isinputthroughout the vocabulary (ElementMap.button,VariantMap, the core fallback, the QQ keyboard'saction.type 2encoding). The Lark card mode does not render it: a card button can only answer with a callback, so the variant stays undeclared and the core fallback renders the label plus the text. -
V47 · Stream diagnostics in
plugin-im-core/src/stream.ts: an intermediate state that cannot be rendered, a refused open and a refused tick are dropped as before — close renders again and reports — but each now logs once through the host logger inside its owntry/catch, so a turn that publishes nothing says why instead of looking like a stream with nothing to say, and diagnostics never break a stream. The card mode declares theactionvariant of<button>under the samecallbacksswitch, which is what keeps a summary turn's stop button live. -
V48 ·
plugin-im-core/src/bot.tsstatus setter reads thebotsregistry without an inject:set statusannouncedlogin-updatedthroughthis.ctx.bots, butbotsis a mixin of thesatoriservice, so a fiber that no longer injects that service — the teardown of a failed boot — threwcannot get property "bots" without injectfromBot.offline()and buried the real startup error. It now readsthis.ctx.get('satori')?.bots, which answersundefinedwithout the inject. -
V49 ·
plugin-im-adapter-qq/src/bot.tsgateway host rewrite:gatewayUrl()replaced theapi.sgroup.qq.comsubstring of theGET /gatewayanswer with the configured REST host. In sandbox that answer is alreadywss://sandbox.api.sgroup.qq.com/websocket, and the substring occurs insidesandbox.api.…, so the result waswss://sandbox.sandbox.api.sgroup.qq.com/websocket— no DNS name answers it and every socket closed with 1006, leavingsandbox: trueunusable. The rewrite now parses both URLs and assignshostonly when it differs, so a host the endpoint chose for itself stays as served. Covered bytests/bot.spec.ts. -
V50 ·
plugin-im-adapter-qqfull-mode group messages: a bot with 接收所有消息 switched on receives every group message asGROUP_MESSAGE_CREATEinstead ofGROUP_AT_MESSAGE_CREATE, sodecodeDispatchpublished nothing for@-mentions in that group. The event now decodes through the same path, with two differences the platform dictates: the body keeps the<@…>mention in place, andmentionsnever carries the bot itself, so the bot's ownunion_openid— whichREADYdoes not report — is read once fromGET /users/@me(QQBot.ensureIdentity,QqApi.getSelf). Only a body that mentions the bot ismentions.self, so background chatter stays unaddressed; a failed identity read is reported and leaves the message unaddressed rather than guessing. Covered bytests/decode.spec.ts. -
V51 ·
plugin-im-adapter-qqrenders code as code: the markdown mode registered neithercodenorpre, so an inline span lost its backticks and a code block arrived as an escaped paragraph — indentation and blank lines collapsed, and every#,*and|carried a backslash. Both tags are native now:codebecomes a backtick span andprea fenced block whose body is a newQqNodekind,verbatim, whichassemblecopies into the content without escaping, collapsing or the\u200Bpadding that keeps blank lines alive. A table the core fallback can lay out as a monospace grid follows the same path, so a narrow table reaches the chat as an aligned fenced grid — QQ markdown renders no tables of its own. Covered bytests/markdown.spec.tsand the mode goldens. -
V52 ·
plugin-im-adapter-qqstreaming chunk body, mode and stream identity:stream_messagesnames a chunk's textcontent_raw, not thecontentof an ordinary send; it takes the whole state withinput_mode: 'replace', as its own examples do; and its first answer returns the streamed message's identity inid— there is nostream_msg_idfield. The adapter sentcontent, a hand-computed suffix withinput_mode: 'append', and readanswer.stream_msg_id, and none of the three mistakes shows in the status: a chunk with no text is still accepted, and a live 单聊 stream answeredremain_msg_len: 0for a message that had just taken five characters, which turned every later append into ashapeviolation.sendChunknow sends the full state withreplaceand takes the stream id from the first answer'sid, andassertRoomreads a zeroremain_msg_lenas "not measured" rather than as "no room", so the platform's own refusal decides. Verified against the live 单聊 stream that previously broke. Covered bytests/stream.spec.ts. -
V53 ·
plugin-im-coreopens a stream in the broadest streamable mode:Bot.stream()resolved its mode withpreferredModeId()— the first declared mode that has a driver. An adapter whose cheapest mode also streams therefore spent the whole turn in it (textbeforemarkdownon QQ), and because a streamed message fixes itscontent_typeat the first chunk and can never switch, a streamed answer lost every emphasis, code block and link while the same answer sent once kept them.streamMode()resolves the same question the content directives ask —prefer-streamable-modenarrows the pool to the modes with a driver,prefer-expressive-modetakes the broadest of those — which needs no content, because breadth is a property of the mode registry.preferredModeId()remains only as the stand-in mode for aMessageRefthis bot did not send. Covered byvendor/plugin-im-core/tests/bot.spec.ts. -
V54 ·
plugin-im-adapter-qqmarkdown mode composes a fence inside a list item or a quote:mapRunskeeps a verbatim node out of the text run so nothing collapses the blank lines of a code block, which also kept it out of the prefix a list item or a block quote puts on every line it owns. A<pre>inside either was emitted mid-line (- 第二项```), so the fence never opened, and the container's own marker ended up glued to the closing fence (```>), swallowing every following block into that code block.flattenRunsflattens rendered children into lines first — text runs formatted, code lines untouched — and the two handlers prefix every line;mapRunskeeps its other callers. Covered bytests/markdown.spec.ts`. -
V55 ·
plugin-im-adapter-larkkeeps code spans verbatim and leaves= …text alone: card markdown escaped every<of user text as<, inline code spans included, and neutralised any line that started with=. The platform decodes no entity inside code — a card showedResult<DsResponse, DsResponse>— and does not consume a backslash before=—= 104 B, align 8arrived as\= 104 B, align 8.cardCodeSpannow leaves its body verbatim likecardFence(a span cannot open a tag, and the entity would only reach the reader), andescapeCardBlockStartneutralises=only on a line that is nothing but=(a setext underline), so ordinary text keeps both characters. Covered bytests/card.spec.ts. -
V56 ·
plugin-im-adapter-qqmarkdown escaper defuses block markers instead of escaping them: the escaper wrote\#,\-and1\.ahead of a line-start marker, which only works if the platform honours CommonMark backslash escapes. QQ does for\*but not for these: a stress answer reached the chat with1\.and\#generalshowing the backslash, every numbered heading of it included. Inline metacharacters keep their backslash (* _ ~, backtick, brackets, angle brackets); a block marker (a list item, a heading, a quote, a rule) now takes a leading U+200B instead, which is invisible and keeps the marker from being read at line start at all. Covered bytests/markdown.spec.tsand the refreshed corpus goldens. -
V57 ·
plugin-im-adapter-larknames the failures behind a rejected intake frame: the long connection logs one line per frame it could not acknowledge, and the rejection it catches is anAggregateErrorover that frame's listeners whose own message is empty — every line therefore read… retry: AggregateErrorand named no listener, leaving one intake failure indistinguishable from the next.describeIntakeFailureunwraps it: each aggregated failure arrives with itsnameand itscode(ImErrorcarriespersistence,access,capacity, …), which is what says whether admission failed in intake, in a session flush or in a renderer. The ACK behaviour is unchanged and stays covered bytests/ws.spec.ts. -
V58 ·
plugin-im-coresettles a stream it cannot recall instead of failing the turn:Scheduler.resendrecalled the streamed message and, when the platform refused the delete, threwStreamLimitError— so the last chunk was never sent withinput_state: 10and the chat showed that message as generating forever. QQ refuses everyDELETEof a streamed message (40061001), which made this the normal outcome as soon as an answer re-parsed mid-stream: a**bold**that completes changes the escaped prefix of a state, so the next state cannot be appended. A stream that cannot be recalled is now closed on the state it already shows, and the final state follows as a fresh message;limitFailsettles the same way before it throws. Covered byvendor/plugin-im-core/tests/stream.spec.tsand the QQ adapter'stests/stream.spec.ts. -
V59 ·
plugin-im-coreprices a moved element:degradationScorechargeddegraded,fallbacksanddropped, but an element a mode lifted out of the message body (RenderReport.moved) was free. A platform whose plain-text body has no image syntax therefore tied with the mode that keeps the picture inline, and the declared order decided it — so every answer mixing text with a picture was split into text, picture, text. A moved element now costsCOST_PLAINeach, which resolves such content to the mode that can keep it: content that interleaves nothing (a picture on its own, or text alone) still ties and keeps the cheaper declared order. -
V60 ·
plugin-im-adapter-qqembeds a picture in the markdown body: theimghandler published every picture as its ownmsg_type: 7message, so a mixed answer reached the chat as three messages and spent three passive replies. QQ's markdown rendersinline — both pixel dimensions are required,0pxmeaning the source size — and fetches the source itself, so the markdown mode now keeps the picture in its own body:assembleleaves a placeholder andserializefills it with the uploadedqqbot-media://reference (prepareuploads it for the chat, so a public URL and a local file take one path). The text mode keeps the media message, and the picture stays inside its sentence rather than taking a paragraph of its own. Covered bytests/markdown.spec.tsand the refreshed markdown goldens. -
V61 ·
plugin-im-adapter-larkhands a card's pictures back as images: a card shows its pictures byimage_key, and the decoder turned each one into the[image]text reference only, so a card's picture was never a media element —im_read_imageon such a message answered "no media element" while the card text showed nothing but a placeholder.walkCardnow collects the keys (with a picture's alternative text as itsalt),interactiveNodesemits a realimgwhosesrcissatori:<platform>/<selfId>/images/<image_key>, andLarkBotserves that route through the newLarkApi.getImage(GET /im/v1/images/{image_key}). The platform hands such a key only to the application that sent the picture: another application's card answers234008 The app is not the resource sender, so the card's text stays the part every reader gets. Covered bytests/card.spec.ts. -
V62 ·
plugin-im-corecloses a spent streaming window in place:Scheduler.finishtreated an elapsedbudget.untilas a reason toresend— recall the streamed message and publish the final state as a fresh one. What expires on the platform is streaming mode, not the message: the Lark driver's owntickalready publishes a full update withstreaming_mode: falseonce the 10-minute window has passed, andclosepublishes exactly that, so the card stays editable. A turn that outlived the window therefore replaced a card the reader was watching with a new message: a stopped turn's answer and its "stopped" footer arrived as a fresh bubble while the card was recalled. The window now only decides the fallback —closeis attempted first, and a refusal from the platform stillresends with the same budget violation. Covered byvendor/plugin-im-core/tests/stream.spec.ts. -
V63 ·
plugin-im-adapter-larkedits a card message instead of streaming a CardKit entity:LarkBot.streamDriver('card')answers the coreeditdriver, so a card is oneinteractivemessage whose card JSON is replaced withPATCH /im/v1/messages/{message_id};createCardStreamDriver,streamingCard,cardKitOpsand the entity branch ofeditMessagePayloadwere no longer reached from this adapter (V64 deletes them). CardKit streaming bought nothing here — a card republished whole on every state never uses incremental rendering — and cost: streaming mode closes ten minutes after it is switched on and reopens only by re-enabling it, it refuses card callbacks that update the card, and it makes the card unforwardable. Measured against the live platform: one message accepted 420 edits (120 + 300, none refused), and the only cap is 5 QPS for that message, whichCARD_STREAM_INTERVAL(200 ms) stays under. The post mode keeps the same driver with its own 20-edit limit. Covered byvendor/plugin-im-adapter-lark/tests/{bot,card,stream}.spec.ts. -
V64 ·
plugin-im-adapter-larkreads the entries of a merged forward:LarkApi.getMessagereturneditems[0]and dropped the rest of the answer, butGET /im/v1/messages/{message_id}on amerge_forwardreturns the entries after the container, each naming it inupper_message_id— so a forwarded conversation reached the model as the bare[forward]reference the event carries and nothing could ever read past it.getMessagenow returns every item,LarkBot.getMessagehands them todecodeMessage, anddecode.tsfills<forward id>with one line per entry (sender: content, abrbetween entries, blocks a forward cannot hold inline — a quote, a table — reduced to their text). An event still decodes the reference alone because the platform pushes no entry with it; how a nested forward and an entry's pictures are handled is V66. Covered byvendor/plugin-im-adapter-lark/tests/{decode,bot}.spec.ts. -
V65 ·
plugin-im-adapter-larkdeletes the CardKit entity path:api/cardkit.tsandstream.tsare gone, together with the card mode'sdiff(CardPatch,CardKitOp,diffCards,diffList,diffComponent,fingerprint),streamingCard,CARD_STREAMING_CONFIG,maxPatchOps, thecard-entitypart kind, the entity branch ofeditMessagePayload, and thecardshandle on the bot. A card is oneinteractivemessage whose content is replaced byPATCH /im/v1/messages/{id}, so the mode declarespatch: never,partKindOfanswerscard-inlinefor every card, andCARD_STREAM_INTERVALsurvives as the edit cadence (200 ms against the platform's 5 QPS per message);cardStreaming: falsenow only selects the bufferedfinalstrategy. Covered byvendor/plugin-im-adapter-lark/tests/{bot,card,send,stream}.spec.ts. Theapi/client.tsmodule doc no longer points at that route map. Theconfig.tsdescriptions follow that behaviour:cardStreamingsays "edit the card message in place while states stream" (withfalsebuffering the states into one finalPATCH, and a stream falling back topost), andallowAtAllsays theallvariant is declared unless it is explicitlyfalse, which renders@所有人as text. Both also dropped the capability-probe wording of the deleted fact layer. -
V66 ·
plugin-im-adapter-larkserves a forward's pictures through its container and expands a forward of a forward: two facts measured against live messages, both of which V64 got wrong. First,/messages/{id}/resources/{key}answers234003 File not in msgfor an entry's own id and200for the same key through the container the read was made for — so V64's per-entrysatori:URL pointed at a resource nothing serves;forwardNodenow addresses every entry by the container, which is also what makesim_read_imageof a picture inside a forward work. Second, a forward of a forward comes back in the same answer as the whole tree — the inner container, then its entries — with every message naming its parent inupper_message_idand an entry appearing once per place it sits; V64 emitted only the direct children and turned the inner container into a bare[forward]with no identity.forwardNodenow walks the answer in the platform's own order, tracks each entry's depth from the instance of its parent that precedes it, renders a nested container as a[合并转发 #id]line and indents its entries under it (capped byFORWARD_INDENT_LIMIT). Measured on a three-level forward of 18 items. Covered byvendor/plugin-im-adapter-lark/tests/decode.spec.ts. -
V67 ·
plugin-im-adapter-larkserializes card text with the mdast writer:card-markdown.tsescaped literal text with a hand-written character loop and rebuilt code spans and fences itself.escapeCardText,cardCodeSpanandcardFencenow go throughmdast-util-to-markdown(withmdast-util-gfm), so metacharacters, line-start block markers, code-span delimiter length and fence length follow CommonMark instead of an owned table, and a<that cannot open a tag stays literal. The<and entity-looking&of text keep the entity forms the platform documents (<,&), andnormalizeCardMarkdownno longer escapes<at all: the platform decodes no entity inside a code span, so the old final pass reached the reader as<for text such as`cat <name>`. Both packages were already transitive dependencies of the tree. Covered byvendor/plugin-im-adapter-lark/tests/card.spec.ts. -
V68 ·
<markdown>is a plugin element, and anappendstream publishes only settled blocks:normalize()expanded<markdown>before mode resolution, so the conversion never knew what it was rendering for. Anappendstream (QQ C2Cstream_messages) keeps every character it was sent, while a growing document re-parses as it grows —**abis literal text the QQ mode escapes to\*\*ab,**abc**is bold, an open fence is closed by the renderer, a paragraph becomes a table or a setext heading — so the next state no longer extended the published prefix, intermediate publication stopped, and QQ's refused recall left a half message with the answer resent below it (V58).satori-elementno longer parses markdown:normalizekeeps<markdown content>as one element (text children joined intocontent),toTextprojects its source, and the parser closure (mdast-util-from-markdown,mdast-util-gfm,micromark-extension-gfm) moved to the newplugin-im-markdown, whoseconvert.tsholds the unchanged mapping. That plugin is an ordinary Cordis plugin, not a service:applyregisters a handler for themarkdowntag onSatori.elements(ElementContributions, installed throughctx.effect, so unloading withdraws it), and exportsmarkdown(content)for building the element.plugin-im-corenames no markdown: the render engine takes handlers from the mode registry first and from the contributions second (RenderBase.contributions,HandlerLookup), so a contributed tag renders like a registered one in every mode — a mode that registers the tag itself keeps its own handler — and without the plugin the core fallback publishes the source as literal text.RenderContextgainedtransform(content), which renders content in place of the current element without a degradation entry, andstream({ strategy, final }of the state being rendered,StreamPhase);StreamHost.rendertakesfinalandBot.streampasses the phase down, skipping an intermediate state whose body renders no node instead of opening the stream empty. The plugin renders onlysettledMarkdown(the source before the last top-level block) for the<markdown>that ends the message in an intermediateappendstate; final states andpatch/editstreams render the whole source. The Lark adapter importsfromMarkdownfrom the new package for inboundmdnodes; a markdown block's stable id now includes the<markdown>element's path (message/markdown[0]>/…), which changes cardelement_ids.dsh-im-bundlemounts the plugin asim-markdown. Covered byvendor/plugin-im-markdown/tests/{convert,element}.spec.ts, the QQ adapter'stests/stream.spec.tsand the corpus goldens. -
V69 · A card callback answers with the listener's toast:
ButtonEvent(satori-element/src/vocabulary.ts) gained the optionalrespond(answer: ButtonAnswer), whereButtonAnsweris{ toast?: { type: 'info' | 'success' | 'warning' | 'error'; content } }.plugin-im-adapter-lark/src/ws.tsno longer answerscard.action.triggerwith{}before intake:answerCardActiondecodes the click, attachesrespondtosession.buttonand runs intake, and answers the frame exactly once — with{ toast }when a listener callsrespond, else{}when intake settles orcallbackAnswerMs(new config field, default 1500 ms, at most 2500 ms; the platform drops an answer after 3 s) elapses from arrival, whichever comes first.respondresolves after the answer frame was written, because the platform may revert a card update made before the callback was answered; a second call, or a call after the deadline, sends nothing. A failed intake still answers{}and is logged as before. The QQ adapter sets norespond. Covered byvendor/plugin-im-adapter-lark/tests/ws.spec.ts. A listener that answers only after asynchronous work callsButtonEvent.defer()during intake, so the frame is not answered{}as soon as intake settles; the deadline still bounds it. -
V70 · Button presentation attributes in
satori-elementand the Lark card mode: everybuttontype takes the optionalButtonStyleattributes —size(tiny | small | medium | large),width(default | fill | <px number>),icon(a platform icon token),confirm({ title, text }),tip,disabledTipandvariant(the exact Lark button type:default | primary | danger | text | primary_text | danger_text | primary_filled | danger_filled | laser) — andbutton-grouptakeswidth(auto | fill) andalign(left | center | right).normalizerejects a value outside those sets, a non-positive width, an empty icon or tip and an incompleteconfirm, as it does for the required attributes. The card mode serializes them as the Lark button fieldssize,width(<n>pxfor a number),icon: { tag: 'standard_icon', token },hover_tips,disabled_tipsandconfirm(plain-text title and text);varianttakes precedence over the unchangedtheme→typemap. Abutton-groupwithwidth="fill"gives every columnwidth: 'weighted', weight: 1and its buttons a defaultwidth: 'fill', andalignbecomes thecolumn_sethorizontal_align; without attributes both serialize as before. The core fallback keeps the new attributes when it lowersbutton.theme, and other modes ignore them. Covered byvendor/plugin-im-adapter-lark/tests/card.spec.ts,vendor/satori-element/tests/normalize.spec.tsandvendor/plugin-im-core/tests/fallback.spec.ts. A button whose label is blank (whitespace only, or no children) renders an ideographic space instead of its action id, which is an internal routing key. -
V71 ·
Bot.handleOfinplugin-im-core: a public method rebuilds a one-partMessageHandlefrom aMessageRefand the mode the message was published in, so a message this bot published in an earlier process can be edited (or deleted) after a restart. It validates the mode id and claims no content. Consumer: the toC deployment's interactive cards, which edit a card message on a click that arrives after a restart. -
V72 · Hard limits checked on every send; unknown Lark codes keep the platform text:
Botrunsmode.check()on each draft of a plainsend/edit(streams already did) and refuses a violating draft before any request withPlatformError('limit', …, { published: 'no' }), so a card over 200 elements or 30 KB is never sent. The Larkclassifykeeps the platform's own message (and the code) for a code its table does not know, instead of the generic "the platform rejected the request" (230099 carries "element exceeds the limit" only in its text). -
V73 · Form controls in
satori-elementandplugin-im-core:<form>,<input>,<select>and<option>are T1 tags (categorycontrol; content modelsflow,empty,options,phrasing; requiredform.name,input.name,option.value, while aselectnames a channel — anidthat reports its pick, anamethat feeds its form, or both), with the variantsinput.checkbox(a platform's own checkbox component),select.multiple(a multi-value picker) andbutton.submit(<button type="submit">, which submits the<form>it stands in — the QQ keyboard's label fallback covers every button type, so asubmitone renders like an action).normalizevalidates each control's mode, bounds and value type and keepsselectchildren tooption;toTextprojects a form as the labels and options a reader would have used ([Title],☑ I agree,[选择: A / B]); the core fallback table lowersformto its children,input/selectto that text while reportinginteraction-dropped, and stripsbutton.submittobutton[type=action], so the click survives and only the submitted values are lost. A<select>with anidreports its pick throughonSelect: the newSelectEvent(id, values, data, referrer, time,respond/defer) and the newinteraction/selectevent, routed byCallbackRegistry.registerSelect/dispatchSelect(buttons and selects are separate keyspaces, so one id may carry both); a select without one is a form field only, and the engine collects no callback for it. A submit click stays aButtonEvent, whose new optionalvaluescarries the form's controls keyed byname.TransformResult.actionsbecame akind-taggedInteractionActionunion so the send stage registers anonSelectlike anonClick, andselectjoined the engine's structural-container rule (optionchildren). Covered byvendor/satori-element/tests/{normalize,text,variants}.spec.tsandvendor/plugin-im-core/tests/{registry,fallback,session,bot,stream,testing}.spec.ts. -
V74 ·
plugin-im-adapter-larkrenders form controls and routes their interactions: the card mode encodes<form>as the platformformcontainer,<input>asinput(multiline/passwordthroughinput_type) orcheckerfortype="checkbox",<select>asselect_static/multi_select_staticwithoptionsandinitial_option/selected_values(fromvalue, or from an<option selected>when the select declares none), and<button type="submit">as a button withform_action_type: 'submit'. A select carries the{ v4: { id, data } }callback behavior unlesscallbacks: false— it still renders and still feeds its form, it just sends no event of its own; amultipleselect carries it too (the platform treats every interactive component as reporting its own click), and inside a form the settled value also rides in the submit'saction.form_value[<name>]. An<input>gets a behavior only fortype="checkbox", wherecheckeris the one form control that reports every toggle (action.tag: 'checker',action.checked); a text field has none and reaches the code only through the submit'sform_value. A control with neither an enclosing<form>nor a callback of its own is reporteddropped, because nothing about it can come back.cardActionSessiondecodesaction.tag:select_static(and amulti_select_statictag, which another card builder may still emit) becomes aninteraction/selectsession withoption/optionsasvalues,checkerbecomes aninteraction/checksession withchecked, any other action keeps producinginteraction/button, andaction.form_valueis decoded intoButtonEvent.values(strings, booleans and string arrays; numbers as strings).@deepseek-ai/dsh-imre-emits the new interaction asim/selectunder the same admission rule as a click. Covered byvendor/plugin-im-adapter-lark/tests/{card,ws}.spec.ts, the refreshed card/post goldens, andpackages/experimental/im/tests/outputs.spec.ts. -
V75 ·
interaction/checkroutes a checkbox toggle (satori-element,plugin-im-core,plugin-im-adapter-lark,dsh-im):inputgainedidandonChange(CheckEvent: id, checked, data, referrer, time,respond/defer) and lost its requiredname— a control names its channel withname(form key),id(toggle callback) or both, andnormalizerejectsonChangeon anything buttype="checkbox"(the element table no longer listsnameas a requiredinputattribute — the alternative channel is checked there instead).CallbackRegistrygained a third keyspace (registerCheck/getCheck/dispatchCheck, so one id may carry a click, a pick and a toggle),InteractionActiona'check'kind, andSessionEvent.check/Session.checkthe event the bot routes. The card mode gives a checkbox with an id the{ v4: { id } }behavior: the platform's 勾选器回调示例 reportsaction.tag: 'checker'andaction.checkedon every toggle, unlike a text input.cardActionSessiondecodescheckerintointeraction/check,dsh-imre-emits it asim/check(ImCheckEvent), andplugin/im-cardmints a token for<input type="checkbox" onChange>and answersim/check. Covered byvendor/plugin-im-core/tests/session.spec.ts,vendor/plugin-im-adapter-lark/tests/{card,ws}.spec.ts,packages/experimental/im/tests/outputs.spec.tsandplugin/im-card/test/{service,runtime}.test.ts. -
V76 ·
plugin-im-corebounds a resource fetch by bytes:createResourceFetcher(ctx, policy)takes an optionalResourceFetchPolicywithmaxBytesand refuses an over-limit resource with the newResourceTooLargeError— from the declaredcontent-lengthfirst, then chunk by chunk while the body is read, so the bytes past the limit are never buffered. Without a policy the fetcher reads the body in one call, exactly as upstream. Rationale: the inbound media of a message is downloaded on behalf of whoever wrote that message, anddsh-im'smedia.admitAscompared the size only afterarrayBuffer()had the whole body in memory, so one chat member decided how much this process allocates.dsh-impassesmedia.maxBytesinto the fetch and reports the refusal as the sametoo-largeoutcome it already had. Covered byvendor/plugin-im-core/tests/resource.spec.tsandpackages/experimental/im/tests/media.spec.ts. -
V77 ·
plugin-im-adapter-larkandplugin-im-adapter-qqleave a cancelled publication unknown:classifykeeps the cancellationfatal— a cancel is never retried — but reportspublished: 'unknown'instead of'no', honouring apublishedthe thrown error itself carries. Rationale: afetchrejected withAbortErrorcovers both "the request never left" and "the platform answered and the response body was cancelled", and the file-destined verdict'no'madedsh-imreportfailed, whose guidance lets the model send the same content again — a duplicate when the first one was published. The pre-request cancellation in each adapter'sapi/token.tsstill reports'no', because no request exists there. Covered byvendor/plugin-im-adapter-lark/tests/errors.spec.tsandvendor/plugin-im-adapter-qq/tests/errors.spec.ts. -
V78 ·
plugin-im-corereports a prepare-stage failure as unpublished:Bot.sendruns the pipeline (normalize → transform → prepare → serialize) insideunpublished(), which classifies a pipeline failure and marks itpublished: 'no', passing an already classified refusal through and keepingStrictRenderError(andPartialSendError, which cannot arise there) unchanged. Rationale: onlypublishcalledclassifyError, so a failed resource fetch or upload — where no platform message can exist — reacheddsh-imas an unknown outcome. Covered byvendor/plugin-im-core/tests/bot.spec.ts. -
V79 ·
plugin-im-coredoes not cache afile:resource across publications:preparekeeps a platform key only for a source that is not afile:URL (isMutableSource), while still deduplicating one upload per source within a singleprepare()call. Rationale: the cache key issha256(src),file:names local bytes that change without their URL changing, and a platform key usually has no expiry, so a second publication of an edited path re-sent the earlier bytes. Covered byvendor/plugin-im-core/tests/bot.spec.ts. -
V80 ·
plugin-im-markdowncarries the whole element vocabulary from markdown:convert.tsruns mdast → hast (mdast-util-to-hast, raw HTML kept) →hast-util-raw(parse5: it pairs tags, decodes entities and tolerates sloppy HTML) → Satori elements, and the last step is driven by the vocabulary —resolveTagaskstagAliases/isTag,elementInfodecides the content model and the required attributes, so**x**,<strong>x</strong>,<u>x</u>,<spoiler>x</spoiler>,<at user_id="ou_x">张三</at>,<span color="red">x</span>,<details>and every other registered element take one path. Only the content categories (inline, block, media) are authorable: an interactive control (button,input,select,form), a renderer directive (fallback,case) or an inbound wrapper (raw,forward) keeps its children as text, so markdown cannot hand a reader a control the sender never sent. Two mdast rewrites run before the HTML stage: a self-closing tag whose element holds no children (<at id=ou_x />) is closed explicitly, because HTML reads the slash as nothing and nests the rest of the line inside that element, and footnote markers/definitions become the literal[^label]plus their blocks instead of GFM's<sup>reference and end-of-document list. Placement follows the vocabulary too: a block element on a line of its own becomes that block (<small>…</small>, viasoleBlock), while the same element inside a sentence keeps its text, becausenormalizerefuses a whole message for one block standing in phrasing content, and a list item outside its list degrades the same way.package.jsonaddsmdast-util-to-hast,hast-util-rawpinned~9.1.1(9.2.0 declaresparse5@^8and calls the tokenizer's removedflushCharacters, so it throws) and@types/hast. Covered byvendor/plugin-im-markdown/tests/convert.spec.ts. -
V81 ·
plugin-im-coreandplugin-im-adapter-larkread a chat's members:protocol.tsgainsMembersPage,Botgains the optionalmembers?(chat, cursor?, limit?)read hook besidegetMessage/getMessageList(an adapter without it leaves the operationunavailable), and the Lark adapter answers it fromGET /im/v1/chats/{chat_id}/members(api/client.ts#getChatMembers,open_idaddressing, page size capped at the platform's 100, a member reported without an id skipped because nothing can address it). Rationale: a mention addresses a platform user id, and a model that saw only names had no way to obtain one. Covered byvendor/plugin-im-adapter-lark/tests/bot.spec.ts. -
V82 ·
plugin-im-adapter-larkwrites link labels with entities instead of backslashes:card-markdown.ts#linkLabelescapes the characters that end a label or open a tag (& < > [ ] \`* _ ~) as the numeric entities the platform decodes in markdown text, andtextMarkdownuses it for a bare URL and for text inside a link label. Rationale: the GFM text serializer escapes the:of URL-shaped text so plain text cannot become an autolink, but a card shows that backslash to the reader (autolink https\://example.com/b, 2026-11-11, a real card), and a label is never autolinked. Covered byvendor/plugin-im-adapter-lark/tests/card.spec.ts. -
V83 ·
plugin-im-corelets the caller pin a fetch to the admitted URL and bound it:ResourceFetchPolicygainsredirect(RequestInit.redirect, forwarded toctx.http.get) andtimeout, a deadline of the whole fetch, body included: the fetcher joinsAbortSignal.timeout(timeout)with the caller's signal, hands it toctx.http.getand races every body read against it, and rejects with the newResourceTimeoutErrorwhen it passes. The transport's owntimeoutis not used for it, becausectx.httpclears that timer as soon as the response headers arrive.dsh-impassesredirect: 'error'andmedia.timeoutMsfor inbound media. Rationale:dsh-imadmitted a source by classifying the address its host resolves to, then the fetch followed a 302 to127.0.0.1or169.254.169.254, so a chat member's picture reached an address the policy had refused; and nothing bounded the download at all, so a slowly trickled body held the chat's arrival order open. Thesatori:hook answers its own 3xx and ignoresredirect, so internal platform resources are unaffected. Covered byvendor/plugin-im-core/tests/resource.spec.tsandpackages/experimental/im/tests/media.spec.ts. -
V84 ·
plugin-im-corereports the result of one publication onsend: the event is declared'send'(bot: Bot, result: SendResult)and emitted asctx.emit('send', this, result); upstream (pin662c3daf,packages/core/src/index.ts:64) declares'send'(session: Session)and emits the adapter session. Rationale:dsh-imstores the bot's own publication — the platform message ids, the content tree and the chat it went to — and aSessioncarries noMessageHandle. Consumers depend on the vendored signature:@deepseek-ai/dsh-imlistensctx.on('send', (bot, result) => …), readsresult.handle.parts[0]andresult.handle.target, and derives the own message'smessage/seqfrom them, so a sync that restores the upstream signature silently breaks own-message storage and every receipt that names a message. Covered byvendor/plugin-im-core/tests/bot.spec.tsandpackages/experimental/im/tests/intake.spec.ts. -
V85 ·
plugin-im-markdownkeeps the breaks beside inline formatting, resolves only own aliases and reads the everyone id:convert.ts#pushTextkeeps a newline at either end of a text run as a<br>unlesstrimLineEdgesfinds a neighbour that already ends the line (a<br>, a block element, the container edge);resolveTagaccepts an alias only whenObject.hasOwn(tagAliases, name);attrsOfturns anatof typeuserwhose id isallorhereinto that mention type. Rationale:first\n**second**\nthirdbecamefirstsecondthirdbecause the split's empty pieces were filtered with the breaks they stood for;<constructor>resolved to the inheritedObjectand threw inisContent, so an inbound post holding it could not be decoded or acknowledged; and<at user_id="all">reached the modes as ausermention, past theallvariantallowAtAll: falsewithholds. Covered byvendor/plugin-im-markdown/tests/convert.spec.ts. -
V86 ·
plugin-im-adapter-larknever mentions everyone for ausermention and sanitizesmention.idin post mode:shared.ts#mentionMarkdown(post) andcard-markdown.ts#cardMention(card) strip characters outside[\w-]frommention.idbefore checkingisEveryoneId, and render ausermention whose id isallorhereas its literal@namelabel. Rationale: Feishu readsuser_id="all"/<at id=all>as @everyone, and a mode decides whether a mention is allowed from itstype, soallowAtAll: false, which withholds only theallvariant, let ausermention carrying that id reach the platform as @everyone; post mode also interpolated rawmention.idinto<at user_id="…">, so a non-identifier character such as"broke the tag attribute or bypassedisEveryoneId(all").plugin-im-markdownnow also reads<at user_id="all">as theallmention. Covered byvendor/plugin-im-adapter-lark/tests/post.spec.ts,card.spec.tsandvendor/plugin-im-markdown/tests/convert.spec.ts. -
V87 ·
plugin-im-adapter-larkstreams internalsatori:resource routes instead of bufferingarrayBuffer():api/client.tsaddsdownloadStream,getResourceStreamandgetImageStream(returning the upstreamResponseafter status validation without reading its body), andbot.ts's/messages/:messageId/resources/:fileKeyand/images/:imageKeyinternal routes return those responses directly. Rationale:getResourceandgetImagecalledresponse.arrayBuffer()and rebuilt a freshResponsewith onlycontent-type, socreateResourceFetcher'smaxBytescheck (V76) neither sawcontent-lengthnor cancelled the stream before the whole upstream file had already been buffered in process memory. Covered byvendor/plugin-im-adapter-lark/tests/bot.spec.ts. -
V88 ·
plugin-im-coreforwardsinit.signalacrosssatori:internal routes and 3xx redirects:Satori'shttp/fetchhook passesinit.signalinto theRequesthanded tohandleInternalRoute, raceshandleInternalRouteagainstinit.signal(cancelling any late response body), and preservessignalwhen following an internal 3xxlocation. Rationale: withoutsignalon the internalRequest, a resource route such as Lark's/messages/:messageId/resources/:fileKeysaw an inertrequest.signal, socreateResourceFetcher'stimeout(V83) or caller cancellation never aborted a stalled upstream fetch before headers arrived. Covered byvendor/plugin-im-core/tests/resource.spec.tsandvendor/plugin-im-adapter-lark/tests/bot.spec.ts. -
V89 ·
plugin-im-adapter-larkandplugin-im-adapter-qqobserve mid-flight caller cancellation inAccessToken.get:AccessToken.get(signal)races the sharedrefresh()promise againstsignal(cleaning up the abort listener on settle) and rejects the cancelled caller withPlatformError('fatal', …, { published: 'no' })without aborting the shared token refresh for concurrent callers. Rationale:get(signal)previously checkedsignal?.abortedonly on entry, sosend.operationTimeoutMsor caller cancellation waited out a hung token endpoint, and throwing a rawAbortErrorfromsignal.reasonwould lose the pre-requestpublished: 'no'guarantee (V77). Covered byvendor/plugin-im-adapter-lark/tests/bot.spec.tsandvendor/plugin-im-adapter-qq/tests/token.spec.ts. -
V90 ·
plugin-im-adapter-larkresolves explicitTarget.threadids to a reply anchor instead of falling back to chat-levelcreateMessage:replyPlanandsendMessagePayloadvalidate non-empty chat-scopedTarget.threadstrings, reuse a matchingLarkReferrer(threadId,rootId, ormessageIdin the same chat) orctx.previous[0]'s thread root when available, and otherwise resolveom_…roots viaGET /im/v1/messages/{id}oromt_…threads viaGET /im/v1/messages?container_id_type=thread&sort_type=ByCreateTimeAsc&page_size=1(verifyingchat_idand classifying pre-send read failures withpublished: 'no') before posting toPOST /im/v1/messages/{anchor}/replywithreply_in_thread: true. Rationale: Feishu'screateMessagehas nothread_idparameter, soTarget.thread: 'omt_…'without a matching referrer previously created an unthreaded chat message or replied to an unrelated referrer's thread. Covered byvendor/plugin-im-adapter-lark/tests/send.spec.tsandpackages/experimental/im/tests/send.spec.ts. -
V91 · Satori PR #416 protocol placement and ecosystem metadata: the protocol module is part of
plugin-im-core(src/protocol.ts), not a package of its own, with independently pinnedelement,http, andfetch-filedependencies; the package set itself is V31's. Local source imports and type-only specifiers follow V4 and V17. The core ecosystem metadata usesimand@deepseek-ai/cordis-plugin-im-*; runtime service names, events, andsatori:URLs retain their upstream names. README code examples use the scoped imports. Package READMEs are copied only where upstream supplies a package README; root Satori documentation is not duplicated into packages. Element comes from its independent repository: npm 0.3.0 metadata still points to an older WebUI commit with an incompatible export API. -
V92 · Core rc.12 compatibility in
httpandplugin-im-core:http/src/index.tsmerges caller intercepts through[Service.mergeIntercept]and resolves them via[Service.resolveIntercept]()instead of rc.11's[Service.resolveConfig];plugin-im-core/src/session.tsreadsbot.ctx[Context.root]instead ofbot.ctx.root. Retire this entry when both packages synchronize against Core rc.12. -
V93 ·
plugin-im-coreretries unknown-outcome sends only when the adapter guarantees idempotency:Adapter.idempotentSend?(target, ctx)lets an adapter report whethersendPayloadcarries platform deduplication (LarkBotchecksoptions.idempotencyKey,QQBotchecksoptions.idempotencyKeyplus an active passive ticket viaPassiveManager.canClaim);Bot.withRetryretriesretryable/rate-limiterrors only whenclassified.published === 'no'oridempotentistrue, so an un-deduplicated QQ active send never duplicates on a lost response. Also inplugin-im-adapter-lark/src/send.ts,replyPlanfalls through toresolveReplyMessageIdwhen a quoted message's stored referrer lacks thread metadata instead of rejecting before platform verification. Covered byvendor/plugin-im-core/tests/bot.spec.ts,vendor/plugin-im-adapter-qq/tests/send.spec.ts, andvendor/plugin-im-adapter-lark/tests/send.spec.ts. -
V94 ·
plugin-im-coreobserves pending body reads whenabortablesees an already-aborted signal:resource.ts#abortableattachesvoid pending.catch(() => {})before returningPromise.reject(signal.reason)whensignal.abortedis already true, so an in-flightreader.read()orresponse.arrayBuffer()rejected by the abort cannot escape as anunhandledRejection(which triggersapp-bootfail-loud exit). Covered byvendor/plugin-im-core/tests/resource.spec.ts. -
V95 ·
plugin-im-coreforwards the scheduler lifecycle signal inStreamTickContext.options:Scheduler.contextmerges{ ...this.options, signal }intooptionssocreateEditDriver.open(which passesctx.optionstoadapter.sendPayload) receives the scheduler'sAbortSignalandstream.abort()/dispose()cancels an in-flight initial publish. Covered byvendor/plugin-im-core/tests/stream.spec.ts. -
V96 ·
plugin-im-coreguardsScheduler.retryon initialopenwithpublished === 'no' || idempotentSend:StreamHost.idempotentSend?(ctx)delegates toAdapter.idempotentSend, andScheduler.retryskips retryingpublished !== 'no'ondriver.openunlessidempotentSendreturnstrue(re-checking after backoff sleep, preserving any earlierpublished: 'unknown'across retries includingStreamLimitError, documenting both inScheduler.retry's JSDoc, and preventingtick()from falling back tohost.send()when an earlier open attempt waspublished: 'unknown'). Covered byvendor/plugin-im-core/tests/stream.spec.ts. -
V97 ·
plugin-im-coreaccumulatespublished: 'unknown'acrossBot.withRetryattempts: if any retry attempt throwspublished: 'unknown',Bot.withRetrypreservespublished: 'unknown'on the final thrownPlatformErroreven if a subsequent attempt fails withpublished: 'no', so callers never treat an uncertain send as definitely unpublished. Covered byvendor/plugin-im-core/tests/bot.spec.ts. -
V98 ·
plugin-im-coreincludesResourceMetainresourceCacheKey:resourceCacheKeyandprepare()includemeta.name,meta.mime,meta.duration,meta.width, andmeta.heightin the cache and in-flight deduplication key, so identical-bytedata:URLs with different filenames or metadata do not reuse another file's platformfile_key. Covered byvendor/plugin-im-core/tests/resource.spec.ts. -
V99 ·
plugin-im-coreclearsScheduler._handleafter a confirmed recall and recordsStreamAbortError.recalled:Scheduler.recallclearsthis._handletoundefinedwhenhost.recallreturnstrue(andMessageStream.handledocuments this lifecycle, whileStreamLimitError.handlekeeps the recalled handle for diagnostics), andStreamAbortErrorcarriesrecalled: booleansoImSenderdistinguishes a recalled stream (failed) from one whose message remains in the chat (partial). Covered byvendor/plugin-im-core/tests/stream.spec.tsandpackages/experimental/im/tests/send.spec.ts. -
V100 ·
plugin-im-coreandplugin-im-adapter-larkreport platformthreadandreferreronSentPart:SentPartgains optionalthreadandreferrerfields, and Lark'ssendMessagePayloadpopulates them fromanswer.thread_id,answer.root_id,target.chat.type, and the sentmessage_idsodsh-impersists newly created threads and their reply context on own messages. Covered byvendor/plugin-im-adapter-lark/tests/send.spec.tsandpackages/experimental/im/tests/intake.spec.ts. -
V101 ·
plugin-im-adapter-qqkeeps its gatewaycloselistener acrossWsClientBaseabort:QQWsClient.acceptdetachescloseinside theclosehandler itself rather than insidecleanup, so non-resumable close codes (4006/4007) still rundropSession()afterWsClientBase's earlierclosehandler abortsconnection.signal. Covered byvendor/plugin-im-adapter-qq/tests/ws.spec.ts. -
V102 ·
plugin-im-adapter-qqadvances the resumeseqcursor only afterbot.receivepersists:QQWsClientadvancesthis.seqonly afterdispatch()completes without error; ifbot.receive()rejects it aborts the per-connectionAbortControllersynchronously (preventing already-queued frames from advancingthis.seqbefore the asynccloseevent) and closes the socket (3000) soWsClientBasereconnects andRESUMEs from the last persisted sequence number (while decode failures still log and keep the socket up). Covered byvendor/plugin-im-adapter-qq/tests/ws.spec.ts. -
V103 ·
plugin-im-coreinvalidatescreateEditDriver's published cache wheneditPayloadfails:createEditDriver'sedit()helper deleteshandlefrompublishedin itscatchblock so a subsequentclose()with the earlier payload still writes back to the platform instead of skipping on a stale cache hit. Covered byvendor/plugin-im-core/tests/stream.spec.ts. -
V104 ·
plugin-im-core,plugin-im-adapter-lark, andplugin-im-adapter-qquse valid WHATWG clientWebSocket.close()codes: client-initiated abnormal closes (WsClientBase,LarkWsClient,QQWsClient) pass3000instead of1011or1008, becauseundici.WebSocketthrowsInvalidAccessErrorfor client close codes outside1000and3000–4999. Covered byvendor/plugin-im-adapter-qq/tests/ws.spec.tsandvendor/plugin-im-adapter-lark/tests/ws.spec.ts. -
V105 ·
plugin-im-adapter-qqandplugin-im-adapter-larkmark all token-acquisition failures aspublished: 'no':AccessToken.refresh()andcancelledTokenError()in both adapters (plus QQ'sbot.tstoken poster status check) ensure transport errors, HTTP 4xx/429/5xx responses (preservingkind,retryAfterMs,cause, andbody), empty token responses, and rethrownPlatformError/LarkApiErrorfailures carrypublished: 'no'so callers can safely retry with platform backoff or recordfailedrather thanuncertain. Covered byvendor/plugin-im-adapter-qq/tests/token.spec.tsandvendor/plugin-im-adapter-lark/tests/bot.spec.ts. -
V106 ·
plugin-im-corere-evaluatesidempotentSendacrossBot.withRetryattempts:Bot.sendpasses() => this.adapterHooks.idempotentSend?.(target, ctx) ?? falseintoBot.withRetry(whose unusedtargetparameter is removed), andwithRetrychecks it both before and after backoff sleep (requiringisIdempotent()once any prior attempt returnedpublished: 'unknown', even if a later attempt returnedpublished: 'no') so an expiring time-bounded deduplication window aborts the retry aspublished: 'unknown'. Covered byvendor/plugin-im-core/tests/bot.spec.ts. -
V107 ·
plugin-im-adapter-qqexempts live ticketed windows from passive LRU eviction:PassiveManager.shrink()only evicts entries withtickets.size === 0when enforcingmax(andPassiveManagerOptions.max/DEFAULT_MAX_WINDOWSdocument this soft bound) so an in-flight retry's(msg_id, msg_seq)dedupe ticket is retained until its window expires. Covered byvendor/plugin-im-adapter-qq/tests/passive.spec.ts. -
V108 ·
plugin-im-adapter-qqandplugin-im-adapter-larkmatch structuralResponseLikeinresponseOf:responseOf()in both adapters'errors.tscheckstypeof status === 'number' && typeof headers?.get === 'function'instead ofinstanceof Response, becausectx.httpusesundici.fetchwhoseResponseis not an instance of globalResponse. Covered byvendor/plugin-im-adapter-qq/tests/token.spec.tsandvendor/plugin-im-adapter-lark/tests/errors.spec.ts. -
V109 ·
plugin-im-coreandplugin-im-adapter-larkforwardAbortSignalthrougheditPayloadand bound abort-close:Adapter.editPayload,EditDriverAdapter.editPayload,createEditDriver(tick/close),Bot.applyEdit, and Lark'seditMessagePayloadforwardsignaltoupdateMessage/patchMessage, andScheduler.abort()bounds its best-effortdriver.closewithAbortSignal.timeout(STREAM_ABORT_CLOSE_TIMEOUT_MS). Covered byvendor/plugin-im-core/tests/stream.spec.ts. -
V110 ·
plugin-im-coredetaches the callerAbortSignallistener when a stream settles:Schedulerkeeps a reference to itsabortlistener and removes it inclose(),fail(), andabort(), preventing settled streams from accumulating on a long-livedAbortSignal. Covered byvendor/plugin-im-core/tests/stream.spec.ts. -
V111 ·
plugin-im-adapter-qqsends heartbeat sequence numbers indper the QQ gateway protocol:QQWsClient.heartbeat()sends{ op: Opcode.HEARTBEAT, d: this.seq ?? null }instead of{ op: Opcode.HEARTBEAT, s: this.seq }(upstreamadapters/qq/src/ws.tssendss, contradicting its ownHEARTBEATpayload typed: numberand causing strict gateways to omitHEARTBEAT_ACK). Covered byvendor/plugin-im-adapter-qq/tests/ws.spec.ts. -
V112 ·
httpcombines callerconfig.signalviaAbortSignal.anyinstead of an unbounded listener:Http[Service.invoke]fusesconfig.signalwith the per-request timeoutcontroller.signalusingAbortSignal.any([config.signal, controller.signal])so repeated requests sharing a long-livedAbortSignaldo not accumulate strong closure listeners while still supporting response-body cancellation. -
V113 ·
plugin-im-coreandplugin-im-adapter-qqpreservemessage_scene.ext.msg_idxasInboundMessage.aliases:InboundMessagegains optionalaliases?: string[], and QQ'smessageSession()recordsmessage_scene.ext.msg_idxthere while keepingpayload.idasmessage.id(for event dedupe and passive replymsg_id), allowingdsh-imto resolveref_msg_idxquotes back to the stored original message. Covered byvendor/plugin-im-adapter-qq/tests/decode.spec.tsandpackages/experimental/im/tests/intake.spec.ts. -
V114 ·
plugin-im-adapter-larkwraps card callback answers in{ code: 200, data }:LarkWsClient.answerCardAction()wraps the JSON business body ({}or{ toast }) as base64 in{ code: 200, data: Buffer.from(JSON.stringify(body)).toString('base64') }to match the Lark WebSocketcard.action.triggerresponse envelope (upstream satori's ws does not return card callback answers). Covered byvendor/plugin-im-adapter-lark/tests/ws.spec.ts. -
V115 ·
plugin-im-adapter-larkmarks HTTP 200 responses missingdataaspublished: 'unknown':LarkApi.answer()passespublished: 'unknown'onLarkApiErrorwhen an HTTP 200 envelope omitsdata, matchingrequiredKey()sodsh-imrecordsuncertaininstead offailed. Covered byvendor/plugin-im-adapter-lark/tests/send.spec.ts. -
V116 ·
plugin-im-coreandplugin-im-adapter-qqpreserveext_info.ref_idxonSentPart.aliases:SentPartgains optionalaliases?: string[], and QQ'ssendMessagePayload()recordsanswer.ext_info?.ref_idxthere while keepinganswer.idaspart.id, sodsh-imcan resolve quotes against the bot's own published QQ messages. Covered byvendor/plugin-im-adapter-qq/tests/send.spec.tsandpackages/experimental/im/tests/intake.spec.ts. -
V117 ·
plugin-im-adapter-larkuses null-prototype lookup tables inprepare.ts:DOCUMENT_MIME,DOCUMENT_EXTENSION, andIMAGE_NAMEuseObject.create(null)so filenames or MIME strings matchingObject.prototypekeys (constructor,__proto__) fall back to'stream'instead of inheriting prototype values. Covered byvendor/plugin-im-adapter-lark/tests/prepare.spec.ts. -
V118 ·
fetch-fileabortsfileTypeFromStreamsniffing oninit.signal:fetchFile()checksinit.signal?.abortedbefore and after sniffing, racesfileTypeFromStreamagainstinit.signal, destroys the underlying read stream on abort, and rethrows abort errors instead of mapping them to 500, soBot.send()timeouts are not hung by blocked local files. Covered byvendor/fetch-file/tests/node.spec.ts. -
V119 ·
plugin-im-adapter-larksets a non-emptynameon form submit buttons (and guards empty form names): Feishu Card JSON 2.0 rejects clicking aform_action_type: 'submit'button without a non-emptynamewith client error200530(Empty form name).serializeButtonnow emitsname: button.idalongsideform_action_type: 'submit'(using the card-uniqueelement_idfinalized byfinalize), andserializeComponentfalls back tocomponent.idif aform'snameis empty. Covered byvendor/plugin-im-adapter-lark/tests/card.spec.tsand the refreshedform/everythingcard goldens. -
V120 ·
plugin-im-coreandplugin-im-adapter-larkdecode inbound reaction events withoutchat_idand normalize app operators:SessionEvent.reaction.message.chatis optional andSessionexposes areactiongetter, because Feishu'sim.message.reaction.created_v1/deleted_v1payloads carrymessage_idwithoutchat_id.LarkBot'sreactionSessions()emitsreaction-added/reaction-removedeven whenchat_idis absent (lettingdsh-imresolve the stored message by id) and normalizesoperator_type === 'app'matchingbot.config.appIdtobot.selfIdso downstream filters can skip self-reactions. Covered byvendor/plugin-im-adapter-lark/tests/decode.spec.tsandpackages/experimental/im/tests/outputs.spec.ts.
Resolver adaptations
Relative to the resolver source in Cordis v4.0.0-rc.12:
- Web build imports:
loader/src/resolve.tsandloader/src/config/tree.tsuse default imports for Node builtin modules to support the Web shell's browser externalization. The shell supplies its own module loader. - Package-scope cache keys:
loader/src/resolve.tsnormalizes directory paths withpath.resolve()before finding the package scope. A root config and a nested config in the same package therefore share the same cached resolver promise and helper-file write. Covered byscripts/cordis-loader-resolve.spec.ts.
Sync procedure
To update a vendored package from upstream:
- In the upstream repository listed in the manifest, check out the release tag or commit to sync and note its full commit SHA.
- Copy the package's
src/(andbin.js,README.md,LICENSEif changed) over the vendored directory. - Re-apply the local modifications listed above (or drop them if upstream made them unnecessary — update the log either way).
- Update the version and commit hash in the manifest table.
- Run
pnpm install && pnpm run test && pnpm run buildat the repo root.