Commit Graph
74 Commits
Author SHA1 Message Date
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
bowenliang123 52fbb1bfa7 chore: bump version to 0.20.0 2026-08-21 17:01:32 +08:00
bowenliang123 dec8b16e62 chore: shorten homepage link 2026-08-21 14:05:13 +08:00
Bowen Liang 85076ae10c chore: bump version to 0.19.2
Lower @deepseek-ai/dsh-client-ui-primitives, @deepseek-ai/dsh-session and
@deepseek-ai/dsh-session-projection peer and dev deps from ^0.1.0-rc.8 to
^0.1.0-rc.7 so the package declares compatibility with the DSH Community
Market desktop runtime (currently @deepseek-ai/dsh 0.1.0-rc.7).
2026-08-20 23:38:48 +08:00
Bowen Liang aa768c76a1 chore: bump version to 0.19.1 2026-08-20 22:44:29 +08:00
Bowen Liang ad5433bf34 chore: bump version to 0.19.0 2026-08-20 21:59:11 +08:00
bowenliang123 b34b24b971 build: add watch script for tsup 2026-08-20 17:06:26 +08:00
bowenliang123 54fadb8b83 chore: bump version to 0.18.0 2026-08-20 16:16:53 +08:00
bowenliang123 dab80c6232 build: switch to tsup and declare harness runtime deps as peers
Replace the hand-rolled esbuild script (scripts/build.mjs) with a single
tsup config that already existed but never ran: tsup re-bundles the config
into a temp .mjs, so import.meta.url pointed at the temp dir and the
package.json read failed, silently leaving no entries. Read the manifest
from process.cwd() instead. The host half now keeps @deepseek-ai/dsh-session
external (resolving to the harness's single runtime instance) instead of
inlining it; the client half keeps the __ModuleLoader__.load wrap.

Align deps with the official dsh convention: runtime harness packages
(cordis, dsh-session, client-ui-primitives, react) move to peerDependencies
with dev mirrors (client-only ones optional); zod stays a dependency;
exact rc pins become caret ranges (^0.1.0-rc.8) so rc9/0.2 releases don't
break installs. Drop the esbuild devDependency (tsup brings its own) and
add tsup itself.
2026-08-20 16:09:16 +08:00
Bowen Liang 19731afd86 chore: bump version to 0.17.0 2026-08-20 05:02:43 +08:00
Bowen Liang 9aad20a20e chore: bump version to 0.16.0 2026-08-20 01:29:37 +08:00
Bowen Liang c535c3b7bc chore: align @deepseek-ai/dsh-* devDeps with dsh 0.1.0-rc.8
Bump @deepseek-ai/dsh-session, dsh-session-projection, dsh-client-ui-primitives
to 0.1.0-rc.8 to match the released @deepseek-ai/dsh@0.1.0-rc.8 contract.

Drop @deepseek-ai/dsh-token-meter: only referenced in comments, never
imported. Runtime occupancy is read from the official 'contextPressure'
projection key registered by dsh itself; pricing is computed locally in
src/host/pricing.ts.

@deepseek-ai/cordis stays at ^4.0.1 (already matches dsh 0.1.0-rc.8).
2026-08-20 00:59:23 +08:00
Bowen Liang e06178795a chore: bump version to 0.15.0 2026-08-19 19:57:00 +08:00
Bowen Liang 9e3434d093 chore: move playwright-core to devDependencies 2026-08-19 19:56:45 +08:00
bowenliang123 15a822d237 doc: refresh social preview with updated context-overview screenshot
Add docs/social-preview/ template + Node.js generator (playwright-core,
2x render + high-quality downsample) and register npm run social-preview.
2026-08-19 17:37:29 +08:00
bowenliang123 485da5486e chore: bump version to 0.14.0 2026-08-19 15:54:03 +08:00
Bowen Liang 3cf7a94c90 chore: bump version to 0.13.0
Add the dsh-plugin-checker job to the release workflow, verifying the
plugin manifest, installability, and bundle layer before publishing.
2026-08-19 00:13:50 +08:00
Bowen Liang 02c2d3765b chore: move the register command into a scripts/register.sh script 2026-08-18 21:23:12 +08:00
Bowen Liang 8c24125153 chore: bump version to 0.12.2 2026-08-18 20:53:37 +08:00
Bowen Liang 2dab549f98 fix: remove the husky pre-commit check to comply with DeepSeek Harness Desktop's plugin install verification requirements 2026-08-18 20:52:24 +08:00
bowenliang123 1e4efc4e3e chore(release): bump version to 0.12.1 2026-08-18 15:28:53 +08:00
bowenliang123 fb3c79212c chore: add register npm script for dsh web plugin 2026-08-18 11:11:30 +08:00
Bowen Liang cf286766bc chore: bump version to 0.12.0 2026-08-18 04:27:36 +08:00
Bowen Liang 81b9ecd7f0 context browser 1 2026-08-18 02:34:58 +08:00
Bowen Liang c229fd1d9b chore(deps): bump @deepseek-ai/dsh-* dev deps from 0.1.0-rc.6 to 0.1.0-rc.7 2026-08-17 21:31:57 +08:00
bowenliang123 8b990ed08e chore: bump version to 0.11.2 2026-08-17 16:51:48 +08:00
bowenliang123 4ae0e2f560 chore: bump version to 0.11.1 2026-08-17 16:12:45 +08:00
bowenliang123 e34e03d1bd chore: bump version to 0.11.0 2026-08-17 15:58:09 +08:00
bowenliang123 66edd1dee9 docs: update project description 2026-08-17 14:49:18 +08:00
bowenliang123 ec108bb7a7 chore: bump version to 0.10.3 2026-08-17 11:39:06 +08:00
bowenliang123 19733b9a4d chore: bump version to 0.10.2 2026-08-17 07:01:55 +08:00
bowenliang123 a4deb93e21 chore: bump version to 0.10.1 2026-08-17 00:14:18 +08:00
bowenliang123 1c6fe29021 chore: bump version to 0.10.0 2026-08-16 23:40:42 +08:00
bowenliang123 23a8cb40f3 doc: fix the social image on readme and the description for pacakge 2026-08-16 22:47:40 +08:00
bowenliang123 008018a66f docs: refresh README with the /context command and a new hero shot
- Hero image is now a real capture of the /context centered dialog
  (docs/context-command.png).
- Intro rewritten around the two surfaces: the Context tab and the
  client-owned /context command (no model traffic, no message history).
- New "Use it" section documenting the command's invocation, closing
  interactions, and the deferred composer-token consumption.
- package.json description updated to match.
2026-08-16 22:45:06 +08:00
bowenliang123 38dbd2ad92 refactor(ui): move the context tab onto the harness's React stack
All view components are now tsx JSX function components instead of
hand-rolled h() factories; the bundle externalizes the framework seed words
(react, @deepseek-ai/dsh-client-ui-primitives) so the loader module table
resolves the single shared framework instance at runtime.

Reuses shared ui-primitives where a clean fit exists (injection and
model-switch event glyphs -> IconPlusOutline16/IconBranchOutline16); the
bespoke data-viz chrome (charts, shared-hover tooltip) intentionally stays
custom but continues to draw the shared --dsw-alias-* tokens.

esbuild uses the classic JSX transform, so the emitted createElement trees
are isomorphic to the previous h() calls and the element-parsing tests, the
chart-render assertions, and the real-React repro all stay green unchanged.
Adds @deepseek-ai/dsh-client-ui-primitives as a type devDep and documents the
framework-reuse findings in docs/redesign.md §8.
2026-08-16 03:51:00 +08:00
bowenliang123 6bebd495e9 feat: route context timeline through the harness session-projection pipeline
Replace the custom /dsh-context RPC channel + 2s client polling with a native
contextTimeline session-projection unit: the host registers one pure
init/apply/view unit on ctx.sessionProjections (framework-driven, persisted by
the projection cache, streamed via session/projection push frames), and the
client reads the finished value through the framework standard
useProjection seat. Deletes the client stale-while-revalidate cache and the
local service type stubs; grows the modern shelf registration (locale) and
adds the published @deepseek-ai/* types as devDeps plus zod as the single
runtime dependency (wire schema, kept external in the host bundle).

Fixes tool-result node attribution to read the durable source.callId /
content toolCallId instead of the never-present block.callId (tool labels had
silently never rendered).

Retention is tightened to trim by whole turn-runs deterministically (bounded
state, no 1200<->1500 oscillation under incremental folding).

Tests now drive the projection unit directly (host) and feed the view through
a useProjection stub (client); all chart/render assertions preserved. Adds
docs/redesign.md (review + target architecture, phases 0-3 landed) and
docs/CLIENT_SURFACE.md (client-side audit).
2026-08-16 03:25:01 +08:00