All notable changes to Dor Tools will be documented in this file.
The format is based on Keep a Changelog.
[Unreleased]
[0.1.0] - 2026-12-02
The first release to npm, as @dor-tools/api, @dor-tools/scaffold, and @dor-tools/suite.
This repository holds api (the OSC 367 Tool protocol), scaffold (helpers for building a Tool), and suite (the file, code, and folder Tools). It was split from the Dormouse repository, with its history, on 2026-12-02; references such as diffplug/dormouse#1987 in older commits point there.
- Add
scaffold(@dor-tools/scaffold): the capability server, save relay, and page theme every Tool needs, moved out ofsuiteunder Tool-neutral names. - A Tool now gets its
dehydratestate back only as therehydratequery parameter of its page's first request, after a reap and after a document navigation alike: the payload object, plus"fragment"when a link named a heading.apiaddsREHYDRATE_PARAM,REHYDRATE_PARAM_LIMIT,rehydrateUrl, andwithoutRehydrateParam. The parameter's encoded value is at most 4,096 characters, anddehydrateSequencethrows on a state that would pass it. - Remove
DEHYDRATE_ENVfromapiandrehydrateFromDorfromscaffold: Dormouse no longer setsDORMOUSE_DEHYDRATEand no longer hasdor tool --rehydrate. A Tool with no page gets no state back. - The folder Tool reopens its view after a document navigation's Back or Forward, not only after a reap.
- Every OSC 367 limit counts UTF-8 bytes, not UTF-16 units, in the encoders and the parsers alike: the 4,096 payload, and the 2,048 of
serve'spathandsaveandopen'spathandfragment. - Each
servereplaces the last whole: a field left out returns to its default, so a Tool restates itssavepath anddehydrateevery time. Aservewithoutportleaves the page where it is, and one withoutkeykeeps the key. serverequires"v": 1, as every other verb does: one without it is not an announcement.serveSequencealready wrote it.openreplacespreviewanddispositionwithplace("preview","self", or"new", the default;"self"interrupts the sending Tool and puts the target in its pane) andtrusted(default false), and takes afragmentwith anyplace. Settrustedonly for a file the user picked in the Tool's page: Dormouse asks before opening an untrusted target as a page that runs its own script, a preview included. The folder Tool marks its pickstrusted; the Markdown editor's links do not.ToolOpenandopenSequencechange to match.- Remove
persistfromserve(andServeOptionsandToolAnnounce). A Tool that must not be stopped announces withoutdehydrate: true; one that opted in withdraws by announcing again without it, or withdehydrate: falsealone when it has no port. - The
rehydrateparameter's value is unpadded base64url of the JSON's UTF-8 bytes, no longer percent-encoded JSON, so its length is four thirds of the JSON's bytes in any language:REHYDRATE_PARAM_LIMITstays 4,096 characters, which is 3,072 bytes of JSON.readRehydrateParamreplacesreadDehydrated, returning thestateand thefragment; anything else reads as nothing held. - The host builds the
rehydrateobject itself:"v": 1, thestatethe Tool wrote and nothing else from itsdehydrate, and thefragmentanopennamed. Past the limit it drops the state and keeps the fragment.ToolDehydratecarries the state alone. - A
dehydratewithoutstate,{"v":1}, means the Tool kept nothing: it ends the host's wait and holds nothing.dehydrateSequence()with no argument writes it, and the built-in viewers write it where they wrotefalse, which is now an ordinary state. - A
servepathorsavewhose query names arehydrateparameter is ignored, andserveSequencethrows on one: the host's first load could not tell the Tool's from its own.