dsh-compact-pi 0.2.3-b2 → 0.2.3-b3
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 +6 -0
- package/README.md +16 -5
- package/bin/dcp-session.ts +17 -5
- package/dist/dcp-session.mjs +318 -241
- package/dist/index.js +5 -3
- package/docs/compatibility.md +1 -1
- package/docs/help.md +14 -3
- package/docs/publishing.md +9 -9
- package/docs/testing.md +5 -4
- package/package.json +5 -3
- package/scripts/test-resume.mjs +96 -31
- package/skills/dcp-migrate-to-dsh/SKILL.md +14 -0
- package/src/dsh/import.ts +79 -0
- package/test/convert.test.ts +26 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.3-b3]
|
|
4
|
+
|
|
5
|
+
- Add `dcp-session pi2dsh-import` and the `dcp-migrate-to-dsh` skill. Import a selected Pi session directly into the DeepSeek Harness 0.2.3-alpha.2 store with its active summary, retained messages, images and archived Pi entries.
|
|
6
|
+
- Check the packaged extension on Pi 1.6.1. Run automatic and manual image compaction, session resume and bidirectional migration on native Windows and Ubuntu in CI.
|
|
7
|
+
- Make the CLI build and integration test runner work with Windows Node.js and preserve vendored source bytes across Git checkouts.
|
|
8
|
+
|
|
3
9
|
## [0.2.3-b2]
|
|
4
10
|
|
|
5
11
|
- Correct the lockfile integrity for `@aws/lambda-invoke-store@0.2.2` so a clean `npm ci` can install the development dependencies.
|
package/README.md
CHANGED
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
An installable pi extension hosting **unmodified DeepSeek Harness compaction plugins in real Cordis**. DCP adapts a defined common subset of pi and DSH; its source updater copies upstream files without rewriting imports or patching the compression algorithm.
|
|
4
4
|
|
|
5
|
-
Tested with pi 1.5.2 and 1.6.
|
|
5
|
+
Tested with pi 1.5.2 and 1.6.1. Node.js must satisfy `^24.22.3 || >=26.13.1`. DCP **0.2.3b3** uses DeepSeek Harness **0.2.3-alpha.2**. `/dcp-status` shows both versions and the upstream commit recorded in [vendor/manifest.json](vendor/manifest.json). The Git tag and npm version use the SemVer spelling `0.2.3-b3`. The source snapshot is included in the package.
|
|
6
6
|
|
|
7
7
|
## Install and use
|
|
8
8
|
|
|
9
|
+
Install from the [Pi package catalog](https://pi.dev/packages/dsh-compact-pi) via npm:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:dsh-compact-pi@latest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The explicit tag selects the currently published prerelease. To pin the GitHub release, use:
|
|
16
|
+
|
|
9
17
|
```bash
|
|
10
|
-
pi install git:github.com/HanqingTony/dsh-compact-pi@v0.2.3-
|
|
18
|
+
pi install git:github.com/HanqingTony/dsh-compact-pi@v0.2.3-b3
|
|
11
19
|
```
|
|
12
20
|
|
|
13
21
|
Restart pi or `/reload`, then `/dcp-status`. The Git tag pins this release. To follow future releases on the default branch, use `pi install git:github.com/HanqingTony/dsh-compact-pi`. Before switching from a local DCP installation, use `pi list` and `pi remove <old-source>` to remove the old package entry and avoid loading DCP twice. To install a development checkout, use `pi install /absolute/path/to/dsh-compact-pi`. For one run:
|
|
@@ -34,14 +42,14 @@ In pi 1.5.2, `pi update` alone updates **pi itself**. Use `pi update --extension
|
|
|
34
42
|
|
|
35
43
|
| Installed source | Update behavior |
|
|
36
44
|
|---|---|
|
|
37
|
-
| `git:github.com/HanqingTony/dsh-compact-pi@v0.2.3-
|
|
45
|
+
| `git:github.com/HanqingTony/dsh-compact-pi@v0.2.3-b3` | Stays on this tag until you install a different tag |
|
|
38
46
|
| `git:github.com/HanqingTony/dsh-compact-pi` | Follows the default branch (`main`), including changes between tagged releases |
|
|
39
47
|
| Local checkout | Uses local files; pi does not fetch a new release for that path |
|
|
40
48
|
|
|
41
49
|
To upgrade a pinned 0.2.2 installation, install the new tag on the machine where pi runs.
|
|
42
50
|
|
|
43
51
|
```bash
|
|
44
|
-
pi install git:github.com/HanqingTony/dsh-compact-pi@v0.2.3-
|
|
52
|
+
pi install git:github.com/HanqingTony/dsh-compact-pi@v0.2.3-b3
|
|
45
53
|
```
|
|
46
54
|
|
|
47
55
|
To follow `main` instead, replace the pinned source once, then update packages as needed:
|
|
@@ -140,7 +148,7 @@ npm run test:package # package, isolated install, copied-source rebuild, pi in
|
|
|
140
148
|
|
|
141
149
|
Differential tests compare the adapter with direct upstream Cordis plugin execution: summary input/budget, logical selected spans, prune/replace events, final surfaces, no-op/failure results, flush checkpoints and retry decisions. Runtime IDs/timestamps and host-specific seed offsets are excluded. Other tests cover real TypeBox tool schemas, usage pricing, durability, branches, Ctrl+O, cancellation, scope rejection and input rejection. Provider replies are deterministic stubs; paid live-model fidelity benchmarks are not implied.
|
|
142
150
|
|
|
143
|
-
The distributable is `dsh-compact-pi-0.2.3-
|
|
151
|
+
The distributable is `dsh-compact-pi-0.2.3-b3.tgz`. It can be installed with `npm install ./dsh-compact-pi-0.2.3-b3.tgz`, followed by `pi install /absolute/path/to/node_modules/dsh-compact-pi`. It contains the copied source closure and built extension.
|
|
144
152
|
|
|
145
153
|
See [testing](docs/testing.md), [publishing](docs/publishing.md), and [release notes](CHANGELOG.md).
|
|
146
154
|
|
|
@@ -152,9 +160,12 @@ See [usage and troubleshooting](docs/help.md) for configuration examples, migrat
|
|
|
152
160
|
dcp-session dsh2pi old.dsh.jsonl imported.pi.jsonl
|
|
153
161
|
pi --session imported.pi.jsonl
|
|
154
162
|
dcp-session pi2dsh session.pi.jsonl exported.dsh.jsonl
|
|
163
|
+
dcp-session pi2dsh-import session.pi.jsonl
|
|
155
164
|
dcp --session old.dsh.jsonl
|
|
156
165
|
```
|
|
157
166
|
|
|
167
|
+
`pi2dsh-import` adds a session to the DSH 0.2.3-alpha.2 V4 store and reports its resume ID. The packaged [dcp-migrate-to-dsh skill](skills/dcp-migrate-to-dsh/SKILL.md) can run the import from Pi or a DSH host with the converter. See [session migration help](docs/help.md#move-a-session-between-pi-and-dsh) for custom roots and skill installation.
|
|
168
|
+
|
|
158
169
|
The converter uses the DSH session format of the pinned upstream snapshot in `vendor/manifest.json`. Its pi-to-DSH export gives DSH the active branch after native context edits, compaction and DCP journal replay. The export also archives the original pi entries, including other branches and metadata, in ignorable `plugin:dcp/pi-header` and `plugin:dcp/pi-entry` records.
|
|
159
170
|
|
|
160
171
|
Importing an unchanged export restores the original pi entries. For a native DSH session, or an export whose context has since changed in DSH, the converter imports the live DSH context as a new linear pi session. Keep the source files if you want access to the original branch tree, plugin state or full event history. Pass a separate output path. Reading compressed DSH logs requires the `zstd` command.
|
package/bin/dcp-session.ts
CHANGED
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
/** CLI: convert pi and DSH session JSONL files. */
|
|
2
2
|
|
|
3
3
|
import { dshToPi, piToDsh } from '../src/dsh/convert.ts'
|
|
4
|
+
import { importPiToDsh } from '../src/dsh/import.ts'
|
|
4
5
|
|
|
5
6
|
const help = `Usage:
|
|
6
7
|
dcp-session pi2dsh <pi-session.jsonl> <out.dsh.jsonl>
|
|
8
|
+
dcp-session pi2dsh-import <pi-session.jsonl> [dsh-session-root] [--plain]
|
|
7
9
|
dcp-session dsh2pi <dsh-session.jsonl> <out.pi.jsonl>
|
|
8
10
|
dcp-session --help
|
|
9
11
|
|
|
10
12
|
pi2dsh exports the active pi context and archives the original pi entries.
|
|
13
|
+
pi2dsh-import installs that export as a new DSH session. The default root is
|
|
14
|
+
$DSH_HOME/sessions with Zstandard encoding. Use --plain only for a DSH profile
|
|
15
|
+
configured with plaintext session storage.
|
|
11
16
|
dsh2pi restores those entries from an unchanged export. For a native or
|
|
12
17
|
continued DSH session it imports the active DSH context.
|
|
13
18
|
|
|
14
19
|
Use a separate output path. DSH input may be .jsonl or .zstd (requires zstd).
|
|
15
20
|
Image references are resolved under DSH_HOME (default ~/.dsh).`
|
|
16
21
|
|
|
17
|
-
const [command, input,
|
|
22
|
+
const [command, input, ...args] = process.argv.slice(2)
|
|
18
23
|
if (command === '--help' || command === '-h') {
|
|
19
24
|
console.log(help)
|
|
20
25
|
process.exit(0)
|
|
21
26
|
}
|
|
22
|
-
|
|
27
|
+
const importing = command === 'pi2dsh-import'
|
|
28
|
+
const plain = importing && args.at(-1) === '--plain'
|
|
29
|
+
if (plain) args.pop()
|
|
30
|
+
const [output, ...extra] = args
|
|
31
|
+
const valid = importing
|
|
32
|
+
? !output?.startsWith('--')
|
|
33
|
+
: (command === 'pi2dsh' || command === 'dsh2pi') && output && extra.length === 0
|
|
34
|
+
if (!input || !valid || extra.length) {
|
|
23
35
|
console.error(help)
|
|
24
36
|
process.exit(2)
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
try {
|
|
28
40
|
const report =
|
|
29
|
-
|
|
30
|
-
? await piToDsh(input, output)
|
|
31
|
-
: await dshToPi(input, output)
|
|
41
|
+
importing ? await importPiToDsh(input, output, plain)
|
|
42
|
+
: command === 'pi2dsh' ? await piToDsh(input, output!)
|
|
43
|
+
: await dshToPi(input, output!)
|
|
32
44
|
console.log(JSON.stringify(report, null, 2))
|
|
33
45
|
} catch (error) {
|
|
34
46
|
console.error(error instanceof Error ? error.message : String(error))
|