Commit Graph
110 Commits
Author SHA1 Message Date
bowenliang123 5f2fc9a265 release: v0.38.1 2026-08-29 12:23:41 +08:00
bowenliang123 1c45bc2bab release: v0.38.0 2026-08-29 10:35:10 +08:00
bowenliang123 de4d6f327a build: kill previous watch instance when starting pnpm watch
Track the tsdown watcher pid in .tmp/watch.pid; a new watch kills the
previous instance first and the pid file is cleaned up on exit.
2026-08-29 00:46:32 +08:00
bowenliang123 6d17588a56 release: v0.37.0 2026-08-28 22:32:46 +08:00
bowenliang123 1dab8dcdbf build: track the 0.1.2 client module graph
Drop the deleted `@deepseek-ai/dsh-client-runtime` from dsh.client.inject
and remove the preloaded-client-externals channel that died with it; mirror
0.1.2's platform module table (+ dsh-client-store) in the client bundle's
purity gate; widen the dsh peer ranges to >=0.1.0-rc.7 so 0.1.2 prereleases
resolve; pin the devDependency types to the newest published surface
(0.1.1-rc.2); the bundle smoke's fake ctx now honors inject callbacks.
2026-08-28 22:32:31 +08:00
bowenliang123 06d1a5df7c release: v0.36.0 2026-08-28 10:17:15 +08:00
bowenliang123 ef97842129 release: v0.35.0 2026-08-28 03:11:27 +08:00
bowenliang123 0330a94ccd release: v0.34.1 2026-08-28 00:40:25 +08:00
Bowen Liang 53209a14df release: v0.34.0 2026-08-26 23:28:18 +08:00
bowenliang123 0803b9a741 chore: bump version to 0.33.1 2026-08-26 12:17:34 +08:00
bowenliang123 57999941f5 fix(docs): update test command in AGENTS.md for coverage execution 2026-08-26 11:30:38 +08:00
Bowen Liang 6c56230f08 chore: bump version to 0.33.0 2026-08-26 08:38:10 +08:00
Bowen Liang f106b720ac test: rebuild the suite at source level with 100% per-file coverage gates
The old suite exercised the built lib/ bundle, so v8 remapped almost
nothing (8% src coverage) and every run needed a build first. The new
suite imports src/ directly under two vitest projects (node for
host/shared, jsdom for client), rendering real React 18 trees against
the real dictionaries and ui-primitives, with faithful in-memory
harness faces (cordis inject/effect, locale chain, slots, sessions
provide) instead of plugin mocks.

- 43 fine-grained, stateless, single-module spec files (606 tests)
  forked across workers: ~2.5s wall, no build step
- v8 thresholds at 100/100/100/100 per file over src/**
- host specs drive the real projection definitions (init/apply/view)
  plus one full cordis + SessionStore + SessionProjectionRegistry
  integration; the framework's snapshotJsonValue pins the
  projection-cache precondition on every intermediate fold state
- oxlint's src ruleset now covers tests/** as well
- typecheck covers the tests via tsconfig.tests.json
2026-08-26 00:58:39 +08:00
Bowen Liang 9a64d2ab48 Add vitest coverage command with HTML report
Introduce `pnpm run coverage` to run vitest with v8 instrumentation,
generate a browsable HTML report under ./coverage/, and gate it from
git. Scope coverage to the src tree only: lib/ is the tsdown build
artifact and has no executable surface to cover. Exclusions are
limited to pure type modules (ambient .d.ts, src/shared/types.ts,
src/host/compat.ts) so the summary reflects runnable code.
2026-08-25 21:13:38 +08:00
Bowen Liang 5aca062963 chore: switch npm run to pnpm run in scripts and comments 2026-08-25 19:55:15 +08:00
bowenliang123 8531298303 chore: bump version to 0.32.0 2026-08-25 15:20:46 +08:00
bowenliang123 7e522ea342 chore: bump version to 0.31.1 2026-08-25 12:52:09 +08:00
Bowen Liang 796e4f7a54 chore: bump version to 0.31.0 2026-08-24 22:08:10 +08:00
bowenliang123 46e52d136c chore: bump version to 0.30.3 2026-08-24 18:24:56 +08:00
bowenliang123 9db79ca69d chore: bump version to 0.30.2 2026-08-24 18:12:35 +08:00
bowenliang123 0d052f243c chore: bump version to 0.30.1 2026-08-24 18:10:23 +08:00
bowenliang123 1e1dc14cd1 chore: bump version to 0.30.0 2026-08-24 17:19:41 +08:00
Bowen Liang cd3b9ae146 chore: bump version to 0.29.1 2026-08-24 04:01:48 +08:00
Bowen Liang ef5166675a chore: bump version to 0.29.0 2026-08-24 03:50:38 +08:00
Bowen Liang 0219d8045f feat: per-user settings namespace with default trend granularity preference
Register the dsh-context settings namespace on the Host (dsh-settings seam,
schemastery schema, optional composition) and claim its Plugin configuration
card in the browser (settings.plugin.item, keyed by namespace). The card
edits the default trend granularity the Context tab opens with; in-chart
toggling stays mount-local and never writes back.

Degrades cleanly: no settings provider -> no registration, no card, step
default; remote browser (memory mode) -> unavailable scope, no card.
2026-08-24 03:36:57 +08:00
Bowen Liang ae3e4cc0e3 chore: bump version to 0.28.0 2026-08-24 03:12:31 +08:00
Bowen Liang f1fa552876 chore: bump version to 0.27.0 2026-08-24 00:18:26 +08:00
Bowen Liang c4153d525c chore: bump version to 0.26.1 2026-08-23 23:37:28 +08:00
Bowen Liang 9af89c6668 chore: bump version to 0.26.0 2026-08-23 23:04:12 +08:00
bowenliang123 c2fb81eaaa chore: bump version to 0.25.3 2026-08-23 05:14:04 +08:00
bowenliang123 70496e77c9 chore: bump version to 0.25.2 2026-08-23 05:11:36 +08:00
bowenliang123 57ff90dfc3 chore: unify the repo on TypeScript — tests, vitest config, and the social-preview generator move from .mjs to .ts
vitest (esbuild) and Node 24 type stripping run the .ts files directly;
helper imports go extensionless like src. Typecheck stays scoped to src/
as before.
2026-08-23 05:11:27 +08:00
bowenliang123 4b8d00ee03 chore: bump version to 0.25.1 2026-08-23 05:05:31 +08:00
bowenliang123 eb9ff049f8 fix: exclude sourcemaps from the npm tarball (enumerate shipped files like official dsh packages) 2026-08-23 05:04:52 +08:00
bowenliang123 c4e242b5b1 chore: bump version to 0.25.0 2026-08-23 04:57:47 +08:00
bowenliang123 c40a919e60 chore: bump version to 0.24.1 2026-08-22 18:08:42 +08:00
bowenliang123 9859f4702a chore: bump version to 0.24.0 2026-08-22 16:31:55 +08:00
bowenliang123 641322a351 chore: bump version to 0.23.0 2026-08-22 04:34:10 +08:00
bowenliang123 f6ec9434d9 chore: bump version to 0.22.2 2026-08-22 03:28:03 +08:00
bowenliang123 cccad03224 chore: bump version to 0.22.1 2026-08-22 03:17:30 +08:00
bowenliang123 8692c31162 build: adopt the official lint stack (oxlint + tsgolint, type-aware)
Mirror dsh's own lint setup (oxlint 1.76.0 pinned exact, oxlint-tsgolint
7.0.2001 with options.typeAware, correctness category off, hand-picked
rule list; jsPlugins: eslint-plugin-sonarjs + @stylistic/eslint-plugin
with the official style profile: indent 2, semi never, single quotes,
comma-dangle multiline, max-len 140). Scope mirrors official too: src TS
only, generated/bundled output (lib, *.js, *.mjs, *.config.ts) ignored.

Wiring: pnpm run lint / lint:fix scripts, plus a Lint step in the
release workflow between Build and Test.

Fixes applied (runtime behavior unchanged; verified against dsh
0.1.0-rc.7 and 0.1.1-rc.2 wire shapes, see below):

- autofix pass: arrow-parens, comma-dangle, eol-last, indent, quotes
- restrict-plus-operands: 31 string+number concatenations -> template
  literals (restrict-template-expressions allows numbers)
- no-unused-vars: drop unused imports/destructured names
- no-unnecessary-type-conversion: drop redundant String() where the
  field is already string-typed
- no-unsafe-*: type the fetch-json boundary in latestVersion, narrow
  unknown before spread/cast instead of trusting any
- no-unnecessary-condition, three honest categories:
  * boundary sanitizers (services.timelineOf/headersOf, RawBlocks,
    headers.recordOf) now read through Record<string, unknown> instead
    of casting first, so the defensive checks are type-meaningful again
  * post-sanitize consumers (contextView/headline/assemble/browser)
    drop the fallback-empty-array on collections the sanitizer
    guarantees
  * array-index-undefined gaps (fold turn attach, headers dedupe) use
    .at() so the past-the-end guard is real to the type system
- no-non-null-assertion: stackedBar reserve carries the checked max
- no-floating-promises: void the fire-and-forget version check
- intentional-contract suppressions with rationale: react.ts keeps its
  injected require (closure-factory loader contract)
- type-honest hardening kept deliberately: MessageSource.sections
  entries stay nullable (foreign plugins author snapshot sources) and
  isInjection still rejects a null source — foreign message payloads
  must never crash the fold

Cross-version audit (0.1.0-rc.7 vs 0.1.1-rc.2, message parsing focus):
- core/session types.ts: only additive optional interrupted on
  assistant/message (unread by us); every event payload we fold
  (request/header, request/context, tool/call, tool/result,
  user/message, assistant/message, compaction/*) is byte-identical
- llm types.ts / message.ts / content.ts block shapes: identical
- token-meter estimate.ts: identical, and official has NO null-entry
  guards on content blocks — our removed guards match official trust,
  our retained fallback-empty-string / typeof reads stay a leniency
  superset
- deriveEventMessage (core/session surface.ts): identical
- ui-conversation chat-nodes contract: unchanged; our client reads are
  minimally-typed unknowns by design
- tool/call callId is a branded string in both versions, so the
  narrowed typeof guard drops only an impossible coercion
2026-08-22 03:10:41 +08:00
bowenliang123 1a8a240d43 fix(deps): zod is a required peer, not optional
The host half value-imports zod (Config schema, timeline/headers wire
validators) and the build keeps it external, so a profile install without
zod would fail at plugin load. optional:true would silence the one
warning that catches that. react and dsh-client-ui-primitives stay
optional: only the browser half uses them and the module table provides
them there.
2026-08-22 02:39:51 +08:00
bowenliang123 598a2e06fa refactor(client): move styles to a real stylesheet through the official CSS channel
- tsdown.config.ts gains the three CSS virtual loaders mirrored verbatim
  from packages/client/tsdown.client.ts: .module.css (lightningcss-hashed
  class map + tagged injection), .css?inline (compiled text), and plain
  .css (unhashed tagged injection), each registered as a watch dependency
- src/client/styles.ts (223 rules as a string array) becomes
  src/client/styles.css — real stylesheet authoring, minified by
  lightningcss at build (client bundle 134.8 -> 130.3 kB)
- injection now happens at factory materialization with the official tag
  shape (data-plugin + data-plugin-css + dedupe guard), replacing the
  hand-rolled ctx.effect; the HMR receiver owns removal by data-plugin,
  so the hmr spec pins that lifecycle instead of fiber disposal
- Decision: class names keep the flat lc-* namespace (the anti-collision
  discipline, per the research note) instead of per-component hashed
  modules — the stylesheet's rules are interconnected across components
  (parent:hover child, shared state classes) and 241 test selectors read
  literal classes off the built bundle, which a content hash would make
  unknowable; the hashed .module.css channel is mirrored and available
  for future self-contained components
- globals.d.ts declares the *.css / *.module.css module shapes for the
  strict typecheck
2026-08-22 02:39:19 +08:00
bowenliang123 49f1439dae test: migrate to vitest, split the monolithic client spec into modules
- vitest is the runner (matches the official harness); the two bare-node
  scripts and the manual repro become 13 spec files under tests/
- the 1637-line client.test.mjs splits into focused modules (chart /
  browser / linkage / composition-link / tool-chip-bridge /
  browser-autoload / images / modal / resilience), each booting a fresh
  view bed from tests/helpers/viewBed.mjs — the stateful fake-React
  harness, fake ctx, fixtures, and tree walkers now live in one place
- tests/hmr-safety.client.spec.mjs (jsdom lane, @vitest-environment):
  fiber dispose removes every registration — locale dicts, slot rows,
  trigger source, provide contribution, and the plugin-owned style tag
- host spec gains the same dispose-removes-registrations pin for the two
  session-projection units
- the real-React jsdom mount (was npm run repro, broken since the tsdown
  switch by its own string surgery) now runs the bundle verbatim through
  __ModuleLoader__ and is part of the suite; fixed two latent harness
  bugs along the way: the slot-register capture was overwritten by the
  later overlay registration, and the granularity query needed scoping
  to the trend row (the events card reuses the pill-button classes)
- bundle evaluation in all specs runs the artifact verbatim via the
  boot handoff — no string surgery, decoupled from bundler layout
- scripts.test is now typecheck + vitest run; scripts.repro is gone
2026-08-22 02:33:28 +08:00
bowenliang123 9905006ef8 feat(host): publish type declarations for the host contract
- tsdown host config now emits lib/index.d.ts (Config zod schema,
  timeline/header/snapshot wire types, plugin entry surface)
- package.json gains top-level "types" and a types condition on the
  "." export, mirroring the official exports shape
- the d.ts inlines the type-only dsh-session-projection wire layer as
  ambient module declarations, so consumers typecheck without extra
  installs; verified with a synthetic consumer (tsc nodenext, full lib
  check) — remaining upstream d.ts lib requirements unchanged
- ./client keeps no types condition: its surface is the CJS
  module.exports handoff consumed by the browser loader, not TS
  importers (the official client bundle config is likewise dts:false)
2026-08-22 02:16:55 +08:00
bowenliang123 021db5f2a2 build: migrate tsup to tsdown, mirroring the official client-bundle preset
- banner/intro/footer three-part closure-factory wrap (verbatim from
  packages/client/tsdown.client.ts), intro now owns var module/exports
- deps.neverBundle/alwaysBundle guards: host keeps production deps
  external, client keeps only module-table specifiers external
- bundle purity gate: any non-requested @deepseek-ai/* value import is
  a build error (INLINE_SAFE / vendored-library / generated-remote
  allowances mirrored)
- NODE_ENV + import.meta.env defines for inlined node-idiom deps
- client sourcemap on, matching the official artifact contract
- client smoke test now runs the bundle verbatim through the
  __ModuleLoader__ handoff instead of slicing the factory body by
  exact output strings (decoupled from bundler layout)
2026-08-22 02:14:44 +08:00
bowenliang123 798d902c4d chore: bump version to 0.22.0 2026-08-22 01:43:37 +08:00
bowenliang123 bfb99a4827 chore: bump version to 0.21.1 2026-08-21 23:15:22 +08:00
bowenliang123 0a028ace6f chore: bump version to 0.21.0 2026-08-21 20:41:18 +08:00
bowenliang123 57f7ca013d chore: move zod from dependencies to peerDependencies (optional)
zod is already a dependency of @deepseek-ai/dsh-session-projection,
so the host dsh environment always provides it. Moving it to
peerDependencies avoids duplicate zod installations and lets the
plugin resolve the same zod instance as the framework.

- dependencies: remove zod (now empty)
- peerDependencies: add zod ^4.4.3
- peerDependenciesMeta: mark zod as optional
- tsup.config.ts: update comment to reflect peer dep status
- version: bump 0.20.0 -> 0.20.1
2026-08-21 18:00:41 +08:00