dsh-edge-office 0.0.8 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,51 @@
1
+ # Changelog
2
+
3
+ All notable changes to `dsh-edge-office`. Versions follow fine-grained, one-per-task releases starting at `0.0.0`.
4
+
5
+ ## 0.1.0 — first usable release
6
+
7
+ - Full gate: 12 tests green, `git diff --check` clean, pack contents verified.
8
+ - Documentation set complete: README (EN/ZH), COMPATIBILITY, INTEGRATION, CONTRIBUTING.
9
+ - Decision layer for an editable Univer sidebar is ready: URL builder + edit gate + narrow-sidebar CSS slice.
10
+
11
+ ## 0.0.9 — integration guide
12
+
13
+ - Add `INTEGRATION.md` (decision layer scope, DSH native sidebar wiring, honest boundaries).
14
+ - Refresh README to current status; drop stale `pnpm-lock.yaml` from the failed peer install.
15
+
16
+ ## 0.0.8 — change C
17
+
18
+ - Add `sidebar-edit-controls.ts`: CSS snippet + style-tag injector keeping the edit opt-in reachable in a narrow iframe.
19
+
20
+ ## 0.0.7 — changes A/B
21
+
22
+ - Add `editable-viewer-url.ts`: `buildEditableViewerUrl` (A), `readMode`/`readEditable`/`trunkEditableNow` (B).
23
+ - Zero-dependency build via Node 22 `stripTypeScriptTypes`.
24
+
25
+ ## 0.0.6 — skills reference
26
+
27
+ - Import upstream v0.6.2 `skills/` (12 skills) as `upstream-skills/` reference.
28
+
29
+ ## 0.0.5 — docs reference
30
+
31
+ - Import upstream v0.6.2 `docs/` (21 files) as `upstream-docs/` reference.
32
+
33
+ ## 0.0.4 — compatibility tests
34
+
35
+ - Add self-contained `compatibility.test.mjs` (4 assertions, no external deps).
36
+
37
+ ## 0.0.3 — compatibility declaration
38
+
39
+ - Add `peerDependencies` covering DSH 0.2.0-rc.1 – 0.2.3-alpha.4, no `engines.dsh`; add `COMPATIBILITY.md`.
40
+
41
+ ## 0.0.2 — package metadata
42
+
43
+ - Add `exports` map and `README.zh-CN.md`.
44
+
45
+ ## 0.0.1 — release tooling
46
+
47
+ - Add GitHub Actions check (build + pack dry-run) and `CONTRIBUTING.md` with release discipline.
48
+
49
+ ## 0.0.0 — scaffold
50
+
51
+ - Initial package skeleton, LICENSE, README, `prepack` + `publishConfig` pinned to npmjs.
package/INTEGRATION.md ADDED
@@ -0,0 +1,64 @@
1
+ # Integration guide
2
+
3
+ `dsh-edge-office` ships the **decision layer** of an editable Univer sidebar: it does not bundle the Univer editor itself. This document explains what it provides, how to wire it into a real DSH host, and where its boundary is.
4
+
5
+ ## What this package provides
6
+
7
+ | Export | Purpose | Upstream origin (v0.6.2) |
8
+ | --- | --- | --- |
9
+ | `buildEditableViewerUrl(options)` | Build the viewer URL that makes the sidebar trunk editable (`mode=embedded&scope=trunk&editable=true`) | `src/host/provider/gateway-univer-service.ts:585-587` |
10
+ | `readMode`, `readEditable`, `trunkEditableNow` | Decode the URL and reproduce the edit gate | `src/viewer-app/core/config.ts:140-164`, `src/viewer-app/ui/app.tsx:781-786` |
11
+ | `SIDEBAR_EDIT_CONTROLS_CSS`, `sidebarEditControlsStyleTag()` | Keep the edit opt-in reachable in a narrow sidebar iframe | `src/client/styles/worktree.ts`, `src/viewer-app/ui/app-view.tsx:786-795` |
12
+
13
+ All are zero-dependency pure functions in TypeScript, compiled to `lib/` at pack time with Node 22's `module.stripTypeScriptTypes()`.
14
+
15
+ ## How DSH sidebars work (verified)
16
+
17
+ DSH's own sidebar plugins (e.g. `dsh-brief-sidebar`) register a **browser-side React tab**:
18
+
19
+ 1. `ctx.sidebarRightTabs.register({ id, kind, title, guide })` — define the tab type.
20
+ 2. `sidebar.right.pane.tab` keyed by `id` — render the tab body.
21
+ 3. Both services are acquired through deferred `ctx.inject`, never a root `ctx.get`.
22
+
23
+ The Univer editor, however, is a **separate web app** served by the collaboration gateway (`/univer-viewer/` on port 9080 by default). So a sidebar tab that shows an editable document still needs an `<iframe>` whose `src` is the URL built by `buildEditableViewerUrl`.
24
+
25
+ ## Wiring it up
26
+
27
+ ```js
28
+ import { buildEditableViewerUrl, sidebarEditControlsStyleTag } from "dsh-edge-office";
29
+
30
+ const src = buildEditableViewerUrl({
31
+ viewerBase: "http://127.0.0.1:9080/univer-viewer",
32
+ fileKey: gatewayFileKey, // opaque gateway file key from the host state route
33
+ editable: true, // the deliberate opt-in for the sidebar
34
+ sessionId: dshSessionId, // appended by the host state route
35
+ });
36
+
37
+ // Render inside the tab body:
38
+ // <iframe src={src} />
39
+ //
40
+ // Inject the CSS INTO the viewer document (outer CSS cannot cross the iframe
41
+ // boundary): append sidebarEditControlsStyleTag() to the viewer's <head> via
42
+ // the viewer build, or a same-origin injected-style hook.
43
+ ```
44
+
45
+ The host state route should append `sessionId` only after authorizing the resource, as the upstream does (`src/host/webServer/routes/state.ts:34`).
46
+
47
+ ## Edit gate semantics
48
+
49
+ - `mode=embedded` + `editable=true` → trunk is editable even when a worktree is pending (this is the sidebar case).
50
+ - `editable=false` → explicitly read-only.
51
+ - no `editable` param → editable only when no pending worktrees, or after `trunkEditingOptIn`.
52
+
53
+ The confirmation dialog (`startTrunkEdit` in upstream) is a **host-side** concern and is not bypassed by this package: passing `editable=true` is the deliberate opt-in signal from the host that already asked for confirmation.
54
+
55
+ ## Boundaries / what is NOT included
56
+
57
+ - No Univer SDK, gateway, worker, or viewer binary — those remain upstream (`dream-num/dsh-univer-office` v0.6.2, 100+ private `@univerjs-pro/*` packages).
58
+ - No PPTD ↔ pptx bridge; SlideStudio decks are not editable through this package.
59
+ - The CSS snippet targets the upstream viewer's DOM hooks (`[data-edit-control]`, `[data-univer-viewer-topbar]`). If the viewer markup changes, the selectors must be updated here.
60
+ - Visual verification of the narrow-sidebar layout requires a real running viewer; the tests here assert the generated CSS text and URL parameters, not pixels.
61
+
62
+ ## Compatibility
63
+
64
+ See `COMPATIBILITY.md`. Declared peer range covers DSH `0.2.0-rc.1` – `0.2.3-alpha.4`; no `engines.dsh` gate.
package/README.md CHANGED
@@ -1,16 +1,25 @@
1
1
  # dsh-edge-office
2
2
 
3
- An editable Univer sidebar for DeepSeek Harness (DSH), rebuilt as an independent project from `0.0.0` with fine-grained, per-task releases.
3
+ The **decision layer** for an editable Univer sidebar in DeepSeek Harness (DSH), rebuilt as an independent, zero-dependency package from `0.0.0` with fine-grained, per-task releases.
4
4
 
5
- > Status: **scaffold** (v0.0.0). The editable-sidebar capability is planned, not yet implemented. See [tasks.md](../../.agents/plans/univer-editable-sidebar/tasks.md) in the planning workspace for the release roadmap.
5
+ > Status: **decision layer ready** (v0.0.8). The URL builder, edit gate, and narrow-sidebar CSS slice are implemented and unit-tested. This package does **not** bundle the Univer editor — see [INTEGRATION.md](INTEGRATION.md) for how to wire it into a real host.
6
+
7
+ ## What you get
8
+
9
+ - `buildEditableViewerUrl()` — build the sidebar viewer URL with `mode=embedded&scope=trunk&editable=true`.
10
+ - `readMode` / `readEditable` / `trunkEditableNow` — reproduce the upstream edit gate.
11
+ - `SIDEBAR_EDIT_CONTROLS_CSS` / `sidebarEditControlsStyleTag()` — keep the edit opt-in visible in a narrow iframe.
12
+
13
+ All logic is extracted from upstream `dsh-univer-office` v0.6.2, stripped of its 100+ private Univer dependencies, and compiled at pack time with Node 22 (no build dependencies).
6
14
 
7
15
  ## Why a new project
8
16
 
9
- Upstream [`dsh-univer-office`](https://github.com/dream-num/dsh-univer-office) renders `.univer` documents in the DSH right sidebar, but that sidebar is read-only by design when a worktree is pending review. This project rebuilds that surface as an independent package so it can evolve with its own version line starting at `0.0.0`.
17
+ Upstream [`dsh-univer-office`](https://github.com/dream-num/dsh-univer-office) renders `.univer` documents in the DSH right sidebar, but that sidebar is read-only by design when a worktree is pending review. This project isolates the three decisions that make it editable, with its own version line starting at `0.0.0`.
10
18
 
11
- ## Compatibility
19
+ ## Docs
12
20
 
13
- Target host line: DSH `0.2.0-rc.1` – `0.2.3-alpha.4`. See `COMPATIBILITY.md` (added in a later release).
21
+ - [INTEGRATION.md](INTEGRATION.md) — how to wire the slice into DSH's native sidebar + Univer viewer, and where the boundary is.
22
+ - [COMPATIBILITY.md](COMPATIBILITY.md) — verified DSH host versions.
14
23
 
15
24
  ## License
16
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-edge-office",
3
- "version": "0.0.8",
3
+ "version": "0.1.0",
4
4
  "description": "DSH office editing edge — an editable Univer sidebar for DeepSeek Harness, rebuilt from scratch with fine-grained releases.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -15,6 +15,8 @@
15
15
  "README.md",
16
16
  "README.zh-CN.md",
17
17
  "COMPATIBILITY.md",
18
+ "INTEGRATION.md",
19
+ "CHANGELOG.md",
18
20
  "LICENSE"
19
21
  ],
20
22
  "keywords": [