dsh-synapse 0.4.0 → 0.4.1

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.
@@ -1,104 +1,104 @@
1
- # Architecture and runtime boundaries
2
-
3
- ## Purpose
4
-
5
- `dsh-synapse` is a presentation and organization layer for DeepSeek Harness conversations. It turns existing DSH sessions, turns, and forks into a visual map without replacing the systems that own those conversations.
6
-
7
- ## Web profile integration
8
-
9
- The package contributes `cordis.patch.yml`, which inserts the `dsh-synapse` service into the DSH `web` profile. It reuses the existing DSH Web server and client runtime.
10
-
11
- The plugin:
12
-
13
- - does not start a second HTTP server;
14
- - does not create a second model or agent runtime;
15
- - does not replace DSH authentication or permission checks;
16
- - does not support non-Web profiles unless those profiles explicitly add the plugin.
17
-
18
- ## Conversation ownership
19
-
20
- DSH session logs remain the source of truth for conversation content and lifecycle. Native DSH operations own:
21
-
22
- - creating and opening sessions;
23
- - sending follow-up messages;
24
- - forking sessions;
25
- - archiving sessions;
26
- - model and tool execution;
27
- - permission and approval decisions.
28
-
29
- Synapse projects committed DSH events into cards and sends user actions back through the native DSH session bridge.
30
-
31
- ## Canvas metadata
32
-
33
- By default, Synapse stores canvas metadata at:
34
-
35
- ```text
36
- $DSH_HOME/synapse/workspaces.json
37
- ```
38
-
39
- The file contains organizational state such as workspace mapping, card layout, and fork anchors. It does not replace session logs.
40
-
41
- Consequences:
42
-
43
- - deleting the file resets canvas organization but does not delete conversations;
44
- - uninstalling the plugin keeps the file, so reinstalling restores the canvas;
45
- - older schema versions migrate when loaded;
46
- - two processes sharing the same file can still produce last-writer-wins replacement despite locking and external-change warnings.
47
-
48
- Run one `dsh web` instance for each shared profile.
49
-
50
- ## Projection model
51
-
52
- With `autoProjection` enabled, committed DSH session events are grouped by working directory and projected into the corresponding Synapse workspace.
53
-
54
- Each user question becomes a conversation card. The following assistant messages are folded into that turn, and the final assistant reply is shown as the answer. Forked sessions connect to the parent turn at the durable DSH seed boundary rather than at an arbitrary canvas coordinate.
55
-
56
- Projected card text is capped at 8000 characters. Longer messages receive a truncation marker in the card, while their complete content remains available from the conversation detail view.
57
-
58
- Projection writes are coalesced during event bursts, and live updates reuse cached Markdown and patch the active card instead of rebuilding the complete canvas. Card coordinates remain visual metadata only and never determine conversation lineage.
59
-
60
- ## Tool process folding
61
-
62
- Live events pair tool calls and results by `callId` and render them inside the related assistant reply instead of as standalone conversation cards.
63
-
64
- Legacy v3 migrations did not always have durable call IDs. Those records pair each tool call with the next tool result by order during migration.
65
-
66
- ## Browser-local state
67
-
68
- Some interaction state, such as dragged card positions and branch anchors, may be cached in browser local storage to keep the canvas responsive. Durable workspace metadata is still written through the Synapse service.
69
-
70
- Private-browsing restrictions or local-storage failures must not prevent DSH conversations from operating; they only reduce persistence of visual preferences.
71
-
72
- ## Host validation
73
-
74
- The `/synapse` endpoint always accepts `localhost` and `127.0.0.1`. Additional LAN or proxy authorities must be listed in `trustedHosts` as a host or `host:port` value.
75
-
76
- This validation is part of the Web surface and does not replace broader network access controls.
77
-
78
- ## Model and KV-cache impact
79
-
80
- Synapse reads session events only after DSH commits them. It does not add or modify:
81
-
82
- - system prompts;
83
- - user request content;
84
- - model request headers;
85
- - tool schemas or registries;
86
- - provider routing;
87
- - approval context.
88
-
89
- As a result, the plugin has no direct model-experience effect and does not invalidate an otherwise reusable KV-cache prefix.
90
-
91
- ## Operational limitations
92
-
93
- - Only the `web` profile is supported by the bundled patch.
94
- - Canvas metadata and session content have different owners and backup requirements.
95
- - A single shared metadata file is not a multi-writer database.
96
- - Browser state can be cleared independently from DSH Home data.
97
- - Historical migrations may have less precise tool-call pairing than live projection.
98
-
99
- ## Related documentation
100
-
101
- - [Chinese user guide](zh-CN/README.md)
102
- - [English user guide](en/README.md)
103
- - [Development and release guide](development.md)
104
- - [Project overview](../README.md)
1
+ # Architecture and runtime boundaries
2
+
3
+ ## Purpose
4
+
5
+ `dsh-synapse` is a presentation and organization layer for DeepSeek Harness conversations. It turns existing DSH sessions, turns, and forks into a visual map without replacing the systems that own those conversations.
6
+
7
+ ## Web profile integration
8
+
9
+ The package contributes `cordis.patch.yml`, which inserts the `dsh-synapse` service into the DSH `web` profile. It reuses the existing DSH Web server and client runtime.
10
+
11
+ The plugin:
12
+
13
+ - does not start a second HTTP server;
14
+ - does not create a second model or agent runtime;
15
+ - does not replace DSH authentication or permission checks;
16
+ - does not support non-Web profiles unless those profiles explicitly add the plugin.
17
+
18
+ ## Conversation ownership
19
+
20
+ DSH session logs remain the source of truth for conversation content and lifecycle. Native DSH operations own:
21
+
22
+ - creating and opening sessions;
23
+ - sending follow-up messages;
24
+ - forking sessions;
25
+ - archiving sessions;
26
+ - model and tool execution;
27
+ - permission and approval decisions.
28
+
29
+ Synapse projects committed DSH events into cards and sends user actions back through the native DSH session bridge.
30
+
31
+ ## Canvas metadata
32
+
33
+ By default, Synapse stores canvas metadata at:
34
+
35
+ ```text
36
+ $DSH_HOME/synapse/workspaces.json
37
+ ```
38
+
39
+ The file contains organizational state such as workspace mapping, card layout, and fork anchors. It does not replace session logs.
40
+
41
+ Consequences:
42
+
43
+ - deleting the file resets canvas organization but does not delete conversations;
44
+ - uninstalling the plugin keeps the file, so reinstalling restores the canvas;
45
+ - older schema versions migrate when loaded;
46
+ - two processes sharing the same file can still produce last-writer-wins replacement despite locking and external-change warnings.
47
+
48
+ Run one `dsh web` instance for each shared profile.
49
+
50
+ ## Projection model
51
+
52
+ With `autoProjection` enabled, committed DSH session events are grouped by working directory and projected into the corresponding Synapse workspace.
53
+
54
+ Each user question becomes a conversation card. The following assistant messages are folded into that turn, and the final assistant reply is shown as the answer. Forked sessions connect to the parent turn at the durable DSH seed boundary rather than at an arbitrary canvas coordinate.
55
+
56
+ Projected card text is capped at 8000 characters. Longer messages receive a truncation marker in the card, while their complete content remains available from the conversation detail view.
57
+
58
+ Projection writes are coalesced during event bursts, and live updates reuse cached Markdown and patch the active card instead of rebuilding the complete canvas. Card coordinates remain visual metadata only and never determine conversation lineage.
59
+
60
+ ## Tool process folding
61
+
62
+ Live events pair tool calls and results by `callId` and render them inside the related assistant reply instead of as standalone conversation cards.
63
+
64
+ Legacy v3 migrations did not always have durable call IDs. Those records pair each tool call with the next tool result by order during migration.
65
+
66
+ ## Browser-local state
67
+
68
+ Some interaction state, such as dragged card positions and branch anchors, may be cached in browser local storage to keep the canvas responsive. Durable workspace metadata is still written through the Synapse service.
69
+
70
+ Private-browsing restrictions or local-storage failures must not prevent DSH conversations from operating; they only reduce persistence of visual preferences.
71
+
72
+ ## Host validation
73
+
74
+ The `/synapse` endpoint always accepts `localhost` and `127.0.0.1`. Additional LAN or proxy authorities must be listed in `trustedHosts` as a host or `host:port` value.
75
+
76
+ This validation is part of the Web surface and does not replace broader network access controls.
77
+
78
+ ## Model and KV-cache impact
79
+
80
+ Synapse reads session events only after DSH commits them. It does not add or modify:
81
+
82
+ - system prompts;
83
+ - user request content;
84
+ - model request headers;
85
+ - tool schemas or registries;
86
+ - provider routing;
87
+ - approval context.
88
+
89
+ As a result, the plugin has no direct model-experience effect and does not invalidate an otherwise reusable KV-cache prefix.
90
+
91
+ ## Operational limitations
92
+
93
+ - Only the `web` profile is supported by the bundled patch.
94
+ - Canvas metadata and session content have different owners and backup requirements.
95
+ - A single shared metadata file is not a multi-writer database.
96
+ - Browser state can be cleared independently from DSH Home data.
97
+ - Historical migrations may have less precise tool-call pairing than live projection.
98
+
99
+ ## Related documentation
100
+
101
+ - [Chinese user guide](zh-CN/README.md)
102
+ - [English user guide](en/README.md)
103
+ - [Development and release guide](development.md)
104
+ - [Project overview](../README.md)
@@ -1,137 +1,137 @@
1
- # Development and release guide
2
-
3
- This document covers local validation, package inspection, GitHub Actions, and npm release automation for maintainers.
4
-
5
- ## Requirements
6
-
7
- - Node.js `>= 22.19.0`
8
- - pnpm through Corepack
9
- - A checkout of this repository
10
-
11
- ## Local workflow
12
-
13
- Install with the lockfile:
14
-
15
- ```powershell
16
- corepack pnpm install --frozen-lockfile
17
- ```
18
-
19
- Validate JavaScript syntax:
20
-
21
- ```powershell
22
- corepack pnpm run build
23
- ```
24
-
25
- Run the full test suite:
26
-
27
- ```powershell
28
- corepack pnpm test
29
- ```
30
-
31
- Inspect the package archive:
32
-
33
- ```powershell
34
- corepack pnpm pack
35
- npm pack --dry-run --json
36
- ```
37
-
38
- The package has no generated build output. `build` runs `node --check` over `index.js`, `client.js`, and `app.js`.
39
-
40
- ## GitHub Actions
41
-
42
- Three workflows live under `.github/workflows/`.
43
-
44
- ### Pull request tests
45
-
46
- `pr-tests.yml` runs for pull requests targeting `main` when they are opened, reopened, updated, or marked ready for review.
47
-
48
- The workflow:
49
-
50
- 1. Checks out the pull request revision.
51
- 2. Installs pnpm 10 and Node.js 22.19.0.
52
- 3. Runs `pnpm install --frozen-lockfile`.
53
- 4. Runs `pnpm run build`.
54
- 5. Runs `pnpm test`.
55
-
56
- A per-PR concurrency group cancels obsolete runs after a newer commit arrives.
57
-
58
- ### Main branch tests
59
-
60
- `main-tests.yml` runs for every push to `main`, including direct commits and merged pull requests. It executes the same frozen installation, build validation, and full test suite.
61
-
62
- ### npm publishing
63
-
64
- `npm-publish.yml` runs for pushed tags matching the broad GitHub pattern `v*.*.*`. The job then validates the tag strictly before publishing.
65
-
66
- Accepted forms include:
67
-
68
- ```text
69
- v0.4.0
70
- v0.4.0-rc1
71
- v0.4.0-rc.2
72
- ```
73
-
74
- The tag without the leading `v` must exactly equal `package.json.version`. A mismatch fails before installation or publication.
75
-
76
- | Version | Git tag | npm dist-tag |
77
- |---|---|---|
78
- | `0.4.0-rc1` | `v0.4.0-rc1` | `next` |
79
- | `0.4.0` | `v0.4.0` | `latest` |
80
-
81
- Every release tag reruns installation, build validation, and the complete test suite before calling `pnpm publish`.
82
-
83
- ## Configure npm authentication
84
-
85
- Create a GitHub Actions repository secret named `NPM_TOKEN` in the repository where the tag workflow will run:
86
-
87
- ```powershell
88
- gh secret set NPM_TOKEN --repo OWNER/dsh-synapse
89
- ```
90
-
91
- The token's npm account must have permission to create or publish the public, unscoped `dsh-synapse` package. The workflow passes the secret to the publish step as `NODE_AUTH_TOKEN`; pull request and ordinary test workflows never receive it.
92
-
93
- ## Release checklist
94
-
95
- 1. Confirm the full test suite passes on `main`.
96
- 2. Update `package.json.version` to the intended release version.
97
- 3. Commit and merge the version change.
98
- 4. Create a matching tag on that commit.
99
- 5. Push the tag.
100
- 6. Confirm the **Publish to npm** workflow passes.
101
- 7. Verify the npm dist-tag:
102
- - prerelease versions use `next`
103
- - stable versions use `latest`
104
-
105
- Example stable release:
106
-
107
- ```powershell
108
- # package.json already contains 0.4.0
109
- git tag v0.4.0
110
- git push origin v0.4.0
111
- ```
112
-
113
- Example prerelease:
114
-
115
- ```powershell
116
- # package.json already contains 0.4.0-rc1
117
- git tag v0.4.0-rc1
118
- git push origin v0.4.0-rc1
119
- ```
120
-
121
- ## Publication failure conditions
122
-
123
- The publish job stops without publishing when:
124
-
125
- - the tag is not a supported version form;
126
- - the tag and `package.json.version` differ;
127
- - frozen installation fails;
128
- - syntax validation or tests fail;
129
- - `NPM_TOKEN` is missing, expired, or lacks package permissions;
130
- - npm rejects the package name or an already-published version.
131
-
132
- ## Documentation
133
-
134
- - [Chinese user guide](zh-CN/README.md)
135
- - [English user guide](en/README.md)
136
- - [Architecture and runtime boundaries](architecture.md)
137
- - [Project overview](../README.md)
1
+ # Development and release guide
2
+
3
+ This document covers local validation, package inspection, GitHub Actions, and npm release automation for maintainers.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js `>= 22.19.0`
8
+ - pnpm through Corepack
9
+ - A checkout of this repository
10
+
11
+ ## Local workflow
12
+
13
+ Install with the lockfile:
14
+
15
+ ```powershell
16
+ corepack pnpm install --frozen-lockfile
17
+ ```
18
+
19
+ Validate JavaScript syntax:
20
+
21
+ ```powershell
22
+ corepack pnpm run build
23
+ ```
24
+
25
+ Run the full test suite:
26
+
27
+ ```powershell
28
+ corepack pnpm test
29
+ ```
30
+
31
+ Inspect the package archive:
32
+
33
+ ```powershell
34
+ corepack pnpm pack
35
+ npm pack --dry-run --json
36
+ ```
37
+
38
+ The package has no generated build output. `build` runs `node --check` over `index.js`, `client.js`, and `app.js`.
39
+
40
+ ## GitHub Actions
41
+
42
+ Three workflows live under `.github/workflows/`.
43
+
44
+ ### Pull request tests
45
+
46
+ `pr-tests.yml` runs for pull requests targeting `main` when they are opened, reopened, updated, or marked ready for review.
47
+
48
+ The workflow:
49
+
50
+ 1. Checks out the pull request revision.
51
+ 2. Installs pnpm 10 and Node.js 22.19.0.
52
+ 3. Runs `pnpm install --frozen-lockfile`.
53
+ 4. Runs `pnpm run build`.
54
+ 5. Runs `pnpm test`.
55
+
56
+ A per-PR concurrency group cancels obsolete runs after a newer commit arrives.
57
+
58
+ ### Main branch tests
59
+
60
+ `main-tests.yml` runs for every push to `main`, including direct commits and merged pull requests. It executes the same frozen installation, build validation, and full test suite.
61
+
62
+ ### npm publishing
63
+
64
+ `npm-publish.yml` runs for pushed tags matching the broad GitHub pattern `v*.*.*`. The job then validates the tag strictly before publishing.
65
+
66
+ Accepted forms include:
67
+
68
+ ```text
69
+ v0.4.0
70
+ v0.4.0-rc1
71
+ v0.4.0-rc.2
72
+ ```
73
+
74
+ The tag without the leading `v` must exactly equal `package.json.version`. A mismatch fails before installation or publication.
75
+
76
+ | Version | Git tag | npm dist-tag |
77
+ |---|---|---|
78
+ | `0.4.0-rc1` | `v0.4.0-rc1` | `next` |
79
+ | `0.4.0` | `v0.4.0` | `latest` |
80
+
81
+ Every release tag reruns installation, build validation, and the complete test suite before calling `pnpm publish`.
82
+
83
+ ## Configure npm authentication
84
+
85
+ Create a GitHub Actions repository secret named `NPM_TOKEN` in the repository where the tag workflow will run:
86
+
87
+ ```powershell
88
+ gh secret set NPM_TOKEN --repo OWNER/dsh-synapse
89
+ ```
90
+
91
+ The token's npm account must have permission to create or publish the public, unscoped `dsh-synapse` package. The workflow passes the secret to the publish step as `NODE_AUTH_TOKEN`; pull request and ordinary test workflows never receive it.
92
+
93
+ ## Release checklist
94
+
95
+ 1. Confirm the full test suite passes on `main`.
96
+ 2. Update `package.json.version` to the intended release version.
97
+ 3. Commit and merge the version change.
98
+ 4. Create a matching tag on that commit.
99
+ 5. Push the tag.
100
+ 6. Confirm the **Publish to npm** workflow passes.
101
+ 7. Verify the npm dist-tag:
102
+ - prerelease versions use `next`
103
+ - stable versions use `latest`
104
+
105
+ Example stable release:
106
+
107
+ ```powershell
108
+ # package.json already contains 0.4.0
109
+ git tag v0.4.0
110
+ git push origin v0.4.0
111
+ ```
112
+
113
+ Example prerelease:
114
+
115
+ ```powershell
116
+ # package.json already contains 0.4.0-rc1
117
+ git tag v0.4.0-rc1
118
+ git push origin v0.4.0-rc1
119
+ ```
120
+
121
+ ## Publication failure conditions
122
+
123
+ The publish job stops without publishing when:
124
+
125
+ - the tag is not a supported version form;
126
+ - the tag and `package.json.version` differ;
127
+ - frozen installation fails;
128
+ - syntax validation or tests fail;
129
+ - `NPM_TOKEN` is missing, expired, or lacks package permissions;
130
+ - npm rejects the package name or an already-published version.
131
+
132
+ ## Documentation
133
+
134
+ - [Chinese user guide](zh-CN/README.md)
135
+ - [English user guide](en/README.md)
136
+ - [Architecture and runtime boundaries](architecture.md)
137
+ - [Project overview](../README.md)