dsh-claude-move 0.2.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.
- package/CHANGELOG.md +73 -0
- package/LICENSE +201 -0
- package/NOTICE +23 -0
- package/README.es.md +291 -0
- package/README.hi.md +292 -0
- package/README.md +317 -0
- package/README.pt.md +291 -0
- package/README.zh.md +311 -0
- package/THIRD_PARTY_NOTICES.md +67 -0
- package/assets/social-card.png +0 -0
- package/client/client.js +451 -0
- package/cordis.patch.yml +5 -0
- package/index.mjs +2891 -0
- package/lib/agmd-section.mjs +144 -0
- package/lib/commands-migrate.mjs +85 -0
- package/lib/context.mjs +156 -0
- package/lib/convert.mjs +725 -0
- package/lib/discovery.mjs +619 -0
- package/lib/frontmatter.mjs +58 -0
- package/lib/handoff.mjs +136 -0
- package/lib/imports-store.mjs +64 -0
- package/lib/manifest.mjs +73 -0
- package/lib/persona.mjs +37 -0
- package/lib/report.mjs +63 -0
- package/lib/settings.mjs +147 -0
- package/lib/skill-migrate.mjs +128 -0
- package/lib/skills-provider.mjs +219 -0
- package/lib/sources/claude/mapper.mjs +102 -0
- package/lib/sources/claude/parser.mjs +190 -0
- package/lib/sources/codex/mapper.mjs +120 -0
- package/lib/sources/codex/parser.mjs +451 -0
- package/lib/sources/contract.mjs +145 -0
- package/lib/sources/hermes/mapper.mjs +61 -0
- package/lib/sources/hermes/parser.mjs +152 -0
- package/lib/sources/opencode/convert.mjs +236 -0
- package/lib/sources/opencode/mapper.mjs +102 -0
- package/lib/sources/opencode/parser.mjs +266 -0
- package/lib/wizard.mjs +329 -0
- package/package.json +66 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [SemVer](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
## [0.2.1] - 2026-08-16
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Four-source migration wizard (`/move` command + `move_detect` / `move_preview` / `move_run` tools): Claude Code, Codex, OpenCode and Hermes, each with its own parser + mapper.
|
|
10
|
+
- Mapping: memories/instructions → append-only managed sections in the DSH global `AGENTS.md`; skills → real DSH skills (`SKILL.md` bundles copied verbatim, other formats converted); slash commands → registered DSH commands rebuilt from the manifest after a restart; sessions → resumable DSH sessions (phase-1 importers reused).
|
|
11
|
+
- Idempotency: every applied plan is recorded in `$DSH_HOME/claude-move/move.json` (`digest` / `targetDigest` / `appliedAt`); re-runs skip unchanged items, `force` re-applies, conflicts surface as diffs with explicit resolution (`skip` / `overwrite` / `rename` / `merge`, default skip).
|
|
12
|
+
- Approval gate: any run that would write asks `ctx.approval` first (`allowed-once` only; otherwise zero writes).
|
|
13
|
+
- New config: `requireApproval` / `codexHome` / `opencodeDataHome` / `opencodeConfigHome` / `hermesHome` / `skillsDir` / `agentsMdPath` / `moveWorkspaceMode`.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- The wizard's managed-section markers now accept path-shaped plan keys (Windows backslashes included), so `AGENTS.md` sections keyed by source paths stay idempotent.
|
|
18
|
+
- The migration manifest store resolves `$DSH_HOME` lazily per operation instead of binding it at module import (isolated tests and temporary profiles no longer share the default home).
|
|
19
|
+
- Converted skills record the source digest as `digest`, so re-runs recognize them as unchanged.
|
|
20
|
+
|
|
21
|
+
## [0.2.0] - 2026-08-15
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Chunked streaming import for transcripts over `maxTranscriptBytes` (`fs.streamText` + a streaming converter): first import creates on the first batch, grown sources append from the stored length, `force` saves a new copy; per-line secret scanning keeps working; hosts without a streaming surface keep the loud rejection (C3).
|
|
26
|
+
- Parallel project scanning (`scanConcurrency`, default 8) with unchanged determinism; `gitBranch` reuse and a three-level `scanGit` (`true` / `'branch'` / `false`) that skips `rev-parse` when the transcript already carries the branch (C1/C2).
|
|
27
|
+
- `claude_scan` output trimming (`projectsLimit` / `sessionsLimit` / `fields: 'brief'`) and a `removedBookmarks` count for deleted source files (C4/C5).
|
|
28
|
+
- Memory injection scoping (`memoryScope`): current-project-only by default (all projects fall back when the cwd has no project), `all` puts the current project first (B3).
|
|
29
|
+
- Project-level Claude skills (`<cwd>/.claude/skills`) exposed per `options.cwd`, with `path`/`metadata` candidates and `signal` support (B2).
|
|
30
|
+
- `/claude-move-reset` command + panel button + `POST /api/claude-move/reset` route: resets only the plugin cache files, imported sessions are kept (D5).
|
|
31
|
+
- Panel import jobs: `DELETE /api/claude-move/job` cancellation (panel cancel button), optional `ctx.jobs` registration for official kill/UI surfaces, and Origin/Host checks (403 for cross-origin) on state-changing routes (B5/D4/D6).
|
|
32
|
+
- Panel now opens imported sessions in place via the shell's `sessions.open`, refreshes the session list via `sessions.refresh`/`workspaces.refresh` (feature-detected, falls back to reload), shows "imported · new turns" badges, pages large indexes, and ships zh/en texts (B1/D4/D3).
|
|
33
|
+
- `resumeMode` config: `'agents'` resumes through `ctx.agents.resume` and falls back to the handoff inject (D2).
|
|
34
|
+
- `/resume-claude` exact-id fast path via the imports map + index bookmarks, and a single read of the transcript for import + handoff (A6).
|
|
35
|
+
- Tool/command descriptions are now bilingual (English primary + Chinese) (D3).
|
|
36
|
+
- **Dedicated `claudecode` workspace (default, E2)**: `workspaceMode: 'claudecode'` groups every imported session into one "claudecode" workspace rooted at `claudecodeDir` (default `$DSH_HOME/claudecode`; the only intentional write the plugin ever makes is `mkdir` there). `workspaceMode: 'per-project'` keeps the previous one-workspace-per-project behavior. The source project cwd is preserved in `imports.json` (`sourceCwd`) and recovered at prompt-assembly time (`sourceCwdSync`) so current-project memory and project `CLAUDE.md` keep resolving; `/resume-claude` handoffs state the original project directory explicitly.
|
|
37
|
+
- **Interrupted tool-call repair (issue #1)**: every declared `tool_use` now gets exactly one `tool/result` — real results are deduplicated (first wins), interrupted calls get one synthetic error result, orphan results are dropped. Counters (`repaired.synthesized/duplicateResults/orphanResults`) surface in import reports, handoffs, and the schema; `validateSessionEvents` self-checks the balance and refuses to persist any log that fails it (loud error, both full and streamed paths), so imported sessions never end up with the permanent 400 "tool_call_ids did not have response messages" failure.
|
|
38
|
+
- **Skill-candidate hardening (issue #1)**: `README.md`/`MEMORY.md` are never registered as skills; skill files without a non-empty `name`/`description` are skipped (DSH hard-requires a description and otherwise fails the whole skill load). Frontmatter scalars are now unquoted before validation.
|
|
39
|
+
- **Safety tripwire test** (`test/safety.test.mjs`): the shipped sources are statically audited — no `rm`/`unlink`/`truncate`/`writeFileSync`/`archiveSession` anywhere except the two named cache files in `resetCacheFiles`, `recursive: true` only with `mkdir`/`readdir`/`importDirectory`, and the client panel only ever requests `/api/claude-move/*`.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- The panel starts collapsed (floating button only) and shows an explicit "panel routes disabled" state when `enableWebPanel: false` (A1/A2).
|
|
44
|
+
- `imports.json` writes are serialized through an atomic write (temp + rename) and per-source in-flight locks; concurrent imports of the same file reuse the first result (A4).
|
|
45
|
+
- Re-import recovers half-created sessions (created but empty log) by appending to the same id instead of minting a suffix copy (A5).
|
|
46
|
+
- Import status annotation prefers `listSnapshots` and lazily cleans up import-map entries whose DSH session was deleted, reporting the count (B4).
|
|
47
|
+
- Claude `summary` records are reported in results and the handoff (not synthesized into compaction nodes — documented in OPTIMIZATION.md) (D1).
|
|
48
|
+
- Removed `"private": true` so `npm publish` works as documented (A3).
|
|
49
|
+
|
|
50
|
+
## [0.1.0] - 2026-08-14
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- License: the project is now licensed under the **Apache License 2.0** (previously MIT). `LICENSE` replaced, a `NOTICE` file added, SPDX identifiers added to shipped sources, and `THIRD_PARTY_NOTICES.md` now carries the full MIT text required by the vendored MIT components (which keep their own licenses).
|
|
55
|
+
- Copy-only force re-import: `force: true` now saves a fresh full copy under `import-<src>-<n>` and keeps the previous copy untouched. Imported sessions are never archived, deleted, rewritten, or hidden.
|
|
56
|
+
- Incremental sync: re-importing a transcript that grew since the last import appends only the new turns to the same DSH session (contiguous seq); a transcript modified within an already-imported turn is reported as `changedInPlace` and left untouched; a truncated source reports `sourceShrunk`.
|
|
57
|
+
- Workspace mirroring: one workspace per Claude project directory (`cwd`), with every imported session attached to its own project's workspace; attach failures now carry a `reason`.
|
|
58
|
+
- Import reporting: batch results include an `appended` counter; panel and `/claude-import-all` state explicitly that no DSH restart is needed (refresh the open Web page once instead).
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
|
|
62
|
+
- Auto-discovery of the Claude data root with streaming scan, incremental cache, project/session/git/memory/skill index, and the `claude_scan` tool.
|
|
63
|
+
- Full-fidelity history import (`import_claude`): balanced, resumable DSH sessions, per-`cwd` workspace attach, batch import, line-numbered malformed-line reporting, secret position-only warnings, permission-record accounting.
|
|
64
|
+
- Personal context: live memory injection, Claude skills provider, global + project `CLAUDE.md` prompt section, `settings.json` translation suggestions.
|
|
65
|
+
- User commands `/claude-import-all` and `/resume-claude` (handoff summary with the resume-plugin safety model).
|
|
66
|
+
- Web migration panel (`dsh.client`) with `/api/claude-move/*` JSON routes.
|
|
67
|
+
- Tool contract hardening: `claude_scan` / `import_claude` honor `exec.signal` (scan aborts per line/project; batch import aborts between files and before each persist) and throw `signal.reason` on abort.
|
|
68
|
+
- `importConcurrency` config (default 4): batch import reads + converts files concurrently, then persists in deterministic filename order (id suffix avoidance and the import map stay order-dependent and serial).
|
|
69
|
+
- `gitTimeoutMs` config (default 5000): the git subprocess timeout is no longer hardcoded.
|
|
70
|
+
- GitHub Actions CI running the full test suite on Node 22 (100/100, green).
|
|
71
|
+
- Issue templates (bug report, feature request), a social preview card (`assets/social-card.png`), and a GitHub Release for `v0.1.0`.
|
|
72
|
+
- GitHub-style README polish in all five languages: highlight pills, feature grid, quick start, data-flow diagram, emoji sections, and `dsh` / `dsh-plugin` topic badges.
|
|
73
|
+
- Documentation: five-language README, PLAN, ARCHITECTURE, COMPLIANCE, OPTIMIZATION, RELEASE, THIRD_PARTY_NOTICES.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
dsh-claude-move
|
|
2
|
+
Copyright 2026 dsh-claude-move contributors
|
|
3
|
+
|
|
4
|
+
This product is licensed to you under the Apache License, Version 2.0
|
|
5
|
+
(the "License"); you may not use this product except in compliance with
|
|
6
|
+
the License. You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
This product includes software and design patterns developed by third
|
|
11
|
+
parties under their own licenses. A full account of every reuse —
|
|
12
|
+
including the MIT license text required by the MIT-licensed components —
|
|
13
|
+
is in THIRD_PARTY_NOTICES.md, which ships alongside this NOTICE file.
|
|
14
|
+
|
|
15
|
+
Bundled components:
|
|
16
|
+
|
|
17
|
+
- lib/convert.mjs is vendored and extended from Nwflower/dsh-chat-import
|
|
18
|
+
(MIT). Portions remain under the MIT license; see the file header and
|
|
19
|
+
THIRD_PARTY_NOTICES.md.
|
|
20
|
+
- Discovery conventions and the foreign-session safety model follow
|
|
21
|
+
Demogorgon314/dsh-resume-plugin (MIT).
|
|
22
|
+
- Memory/skills injection and frontmatter parsing patterns follow
|
|
23
|
+
YYTbit/dsh-plugin-claude-bridge (MIT).
|
package/README.es.md
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# dsh-claude-move
|
|
2
|
+
|
|
3
|
+
**Conserva tu historial de Claude Code al pasarte a DeepSeek Harness.** Una sola instalación copia cada sesión, memoria, habilidad y `CLAUDE.md` de Claude a DSH como sesiones reanudables — agrupadas en un espacio de trabajo dedicado `claudecode` (un espacio de trabajo por proyecto es opcional).
|
|
4
|
+
|
|
5
|
+
`Solo copia` · `Reanudación sin interrupciones` · `Workspaces por proyecto` · `Sincronización en vivo con Claude Code`
|
|
6
|
+
|
|
7
|
+
[](https://github.com/PerryLink/dsh-claude-move/actions/workflows/test.yml)
|
|
8
|
+
[](https://www.npmjs.com/package/dsh-claude-move)
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-claude-move)
|
|
10
|
+
[](https://nodejs.org)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://github.com/topics/dsh)
|
|
13
|
+
[](https://github.com/topics/dsh-plugin)
|
|
14
|
+
[](https://github.com/PerryLink/dsh-claude-move/issues)
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
[English](README.md) | [中文](README.zh.md) | Español | [Português](README.pt.md) | [हिन्दी](README.hi.md)
|
|
19
|
+
|
|
20
|
+
> Vista previa de desarrollo (0.1.0). Hoja de ruta y diseño: [PLAN.md](PLAN.md) · historial de cambios: [CHANGELOG.md](CHANGELOG.md).
|
|
21
|
+
|
|
22
|
+
## ✨ Características
|
|
23
|
+
|
|
24
|
+
- 🔍 **Descubrimiento automático** — localiza la raíz de datos de Claude (`$CLAUDE_CONFIG_DIR`, por defecto `~/.claude`) e indexa cada proyecto/sesión (título, marcas de tiempo, recuentos), estado de directorio y git, memorias, habilidades, `CLAUDE.md` global y `settings.json` — con caché incremental que solo relee archivos modificados.
|
|
25
|
+
- 📥 **Importación de historial con fidelidad total** — sesiones DSH equilibradas y reanudables (`turn/start → step/start → user/message → assistant/message → tool/call → tool/result → step/end → turn/end`), líneas malformadas con número de línea. Las llamadas a herramientas interrumpidas se reparan para que cada `tool_use` tenga exactamente un resultado (adiós a los 400 permanentes al reanudar).
|
|
26
|
+
- 🗂 **Un espacio de trabajo `claudecode` (por defecto)** — cada sesión importada aterriza en un espacio de trabajo "claudecode" dedicado, enraizado en una carpeta nueva (`$DSH_HOME/claudecode` por defecto; lo único que el plugin crea jamás). `workspaceMode: 'per-project'` restaura la agrupación de un espacio de trabajo por proyecto.
|
|
27
|
+
- 🔁 **Solo copia e incremental** — nada se mueve, reescribe ni elimina en ningún lado. Reejecutar la importación solo añade los turnos nuevos a la misma sesión DSH; `force: true` guarda una copia completa adicional con un id nuevo.
|
|
28
|
+
- 🧠 **Contexto personal siempre actualizado** — memorias inyectadas como sección en vivo (proyecto actual primero, `memoryScope`), habilidades de Claude registradas como habilidades reales de DSH (global **y de proyecto** `.claude/skills`, se omiten documentos que no son habilidades como `README.md`), `CLAUDE.md` global + de proyecto inyectado temprano. Incluso con el espacio de trabajo `claudecode`, se recuerda el directorio del proyecto original para resolver memory/`CLAUDE.md`.
|
|
29
|
+
- ⚡ **Sincronización en vivo con Claude Code** — sigue usando Claude Code en paralelo; cada reejecución trae solo lo que cambió.
|
|
30
|
+
- 🖥 **Panel web y comandos de un paso** — `/claude-import-all`, `/resume-claude` y un panel de migración flotante con progreso.
|
|
31
|
+
- 🪄 **Asistente de migración de cuatro fuentes (0.2.1)** — un asistente `/move` más las herramientas `move_detect` / `move_preview` / `move_run` migran Claude Code, Codex, OpenCode y Hermes: memorias/instrucciones se convierten en secciones gestionadas de `AGENTS.md`, las skills en skills reales de DSH, los comandos slash en comandos de DSH y las sesiones en sesiones reanudables — con puerta de aprobación, idempotente (`move.json`) y conflictos mostrados como diff, sin adivinar.
|
|
32
|
+
- 🛡 **Seguridad primero** — archivos fuente estrictamente de solo lectura, logs de DSH append-only, secretos informados solo por posición, registros de permisos contados pero nunca importados.
|
|
33
|
+
|
|
34
|
+
## 🚀 Inicio rápido
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
# 1. Instalar
|
|
38
|
+
dsh plugin --profile web add -w github:PerryLink/dsh-claude-move
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. En cualquier sesión de DSH, ejecuta un comando:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/claude-import-all # escanear → copiar todas las sesiones de Claude → informe
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
3. Refresca una vez la página web ya abierta (el panel tiene el botón «Refrescar lista de sesiones») y pulsa cualquier sesión importada para continuar. **No hace falta reiniciar DSH** — ver [Después de importar](#-después-de-importar).
|
|
48
|
+
|
|
49
|
+
¿Prefieres control fino?
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
claude_scan # índice estructurado de todos los proyectos/sesiones
|
|
53
|
+
import_claude { path: "~/.claude/projects" } # un directorio de proyecto (recursivo)
|
|
54
|
+
import_claude { path: "all" } # todo
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 🪄 Asistente de migración de cuatro fuentes
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
/move # asistente en un paso: detectar → previsualizar → ejecutar → informar (las cuatro fuentes)
|
|
61
|
+
move_detect # escanea Claude Code / Codex / OpenCode / Hermes
|
|
62
|
+
move_preview # plan por elemento: new | unchanged | changed | conflict (con diff) | unsupported
|
|
63
|
+
move_run # ejecuta tras la puerta de aprobación; resolución: skip | overwrite | rename | merge (skip por defecto, nunca adivina)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- **Fuentes** — Claude Code (`~/.claude`), Codex (`~/.codex`), OpenCode (raíces de datos + configuración), Hermes (raíces de skills/memoria); cada fuente tiene su propio parser y mapper.
|
|
67
|
+
- **Mapeo** — memorias/instrucciones → secciones gestionadas de solo anexado en el `AGENTS.md` global de DSH (una sección marcada por elemento); skills → skills reales de DSH (bundles `SKILL.md` copiados tal cual, otros formatos convertidos); comandos slash → comandos registrados de DSH (sus prompts se reconstruyen desde `move.json` tras reiniciar); sesiones → sesiones reanudables de DSH (los mismos importadores de la fase 1).
|
|
68
|
+
- **Idempotente** — cada plan aplicado se registra en `$DSH_HOME/claude-move/move.json` (`digest` / `targetDigest` / `appliedAt`); las reejecuciones omiten lo que no cambió y `force` lo vuelve a aplicar.
|
|
69
|
+
- **Puerta de aprobación** — una ejecución que vaya a escribir algo pregunta primero a `ctx.approval`; cualquier cosa distinta de `allowed-once` significa cero escrituras.
|
|
70
|
+
|
|
71
|
+
## 🗂 Qué se migra
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
~/.claude (solo lectura)
|
|
75
|
+
├─ projects/*/*.jsonl ──→ sesiones DSH reanudables, agrupadas en un workspace "claudecode" (por defecto)
|
|
76
|
+
├─ projects/*/memory/ ──→ sección de memoria en vivo del prompt del sistema (releída por petición)
|
|
77
|
+
├─ skills/** ──→ habilidades reales de DSH
|
|
78
|
+
└─ CLAUDE.md + settings ──→ sección temprana del prompt + sugerencias de configuración (nunca auto-aplicadas)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| En Claude Code | Aterriza en DSH como |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| Transcripciones de sesión (`projects/*/*.jsonl`) | Sesiones DSH equilibradas y reanudables — mapeo fiel de `user`/`assistant`/`tool`/`thinking` con reparación de llamadas a herramientas interrumpidas — agrupadas en un **espacio de trabajo `claudecode`** (por defecto `$DSH_HOME/claudecode`) o un espacio de trabajo por proyecto (`workspaceMode: 'per-project'`) |
|
|
84
|
+
| Archivos de memoria (`projects/*/memory/*.md`) | Una sección de contexto del prompt del sistema en vivo, releída en cada petición (`feedback > project > reference > user`) — el directorio del proyecto original se recuerda incluso dentro del espacio de trabajo `claudecode` |
|
|
85
|
+
| Habilidades (`~/.claude/skills/**`) | Habilidades reales de DSH (nombres kebab-case, colisiones con sufijo, máximo 30 por defecto; se omiten `README.md`/`MEMORY.md` y los archivos sin descripción) |
|
|
86
|
+
| `CLAUDE.md` (global + por proyecto) | Una sección temprana del prompt; el archivo del proyecto gana |
|
|
87
|
+
| `settings.json` | Sugerencias de configuración de DSH con lista explícita de claves no mapeables |
|
|
88
|
+
| Estado del proyecto (directorio, rama de git y archivos modificados) | Visible en el índice de escaneo, en las insignias del panel web y en el traspaso `/resume-claude` |
|
|
89
|
+
|
|
90
|
+
## 📦 Instalación
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
# Desde GitHub
|
|
94
|
+
dsh plugin --profile web add -w github:PerryLink/dsh-claude-move
|
|
95
|
+
|
|
96
|
+
# Copia local (desarrollo)
|
|
97
|
+
dsh plugin --profile web add -w link:/path/to/dsh-claude-move
|
|
98
|
+
|
|
99
|
+
# Desde un tarball empaquetado
|
|
100
|
+
dsh plugin --profile web add -w ./dsh-claude-move-0.1.0.tgz
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
El paquete es ESM puro y no tiene paso de compilación, así que la instalación desde Git no necesita script `prepare` ni la lista `allowBuilds`. Consulta la [guía oficial de empaquetado e instalación](https://deepseek-harness.github.io/deepseek-harness/develop/basic/publish).
|
|
104
|
+
|
|
105
|
+
## 🛠 Uso
|
|
106
|
+
|
|
107
|
+
Invoca las herramientas en cualquier sesión con el plugin montado:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
claude_scan # escaneo completo (caché incremental)
|
|
111
|
+
claude_scan { path: "~/.claude/projects/<slug>" } # escaneo parcial
|
|
112
|
+
claude_scan { refresh: true } # ignora la caché y vuelve a escanear todo
|
|
113
|
+
|
|
114
|
+
import_claude { path: "~/.claude/projects/<slug>/<sessionId>.jsonl" } # una sesión
|
|
115
|
+
import_claude { path: "~/.claude/projects" } # directorio (recursivo)
|
|
116
|
+
import_claude { path: "all" } # todo
|
|
117
|
+
# Puedes volver a ejecutarlo cuando quieras: los archivos sin cambios se omiten y las transcripciones que crecieron solo añaden los turnos nuevos.
|
|
118
|
+
import_claude { path: "...", force: true } # copia completa nueva como import-<src>-<n> (la copia anterior se conserva)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Comandos (disparados por el usuario, sin turno del modelo):
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
/claude-import-all # un paso: escanear → importar todo → informe → inyectar en la sesión actual
|
|
125
|
+
/resume-claude latest # continuar la sesión de Claude más reciente
|
|
126
|
+
/resume-claude <sessionId> # por id de sesión de origen o id import-<src>
|
|
127
|
+
/resume-claude <palabra clave> # busca títulos; los múltiples resultados se listan, nunca se adivinan
|
|
128
|
+
/claude-move-reset # reinicia la caché del plugin (marcadores + mapa de importación); las sesiones importadas se conservan
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Panel web: el botón flotante **🐳 Claude 迁移** (abajo a la derecha) abre el panel — árbol de proyectos/sesiones con insignias de estado (sin importar / importado / importado-con-turnos-nuevos / origen faltante / directorio inexistente / git sucio), filtro por palabra clave, paginación, «Importar y continuar» + «Abrir sesión» + «Refrescar lista de sesiones» por sesión, importación por lotes con barra de progreso y cancelación, y botón de reinicio de caché. Los textos siguen el idioma del navegador (zh/en). Usa las rutas JSON `/api/claude-move/*` propias del plugin, registradas en el seam público `ctx.webServer`.
|
|
132
|
+
|
|
133
|
+
- **Escaneo**: devuelve un índice JSON estructurado: proyectos (slug/cwd/existencia del directorio/rama de git y archivos modificados), sesiones (título/marcas de tiempo/recuentos/líneas malformadas), memorias, habilidades, CLAUDE.md global y settings.json; cada sesión lleva `import.status` (`none`/`imported`/`source-missing`) y `import.updatesPending` cuando hay turnos nuevos sin sincronizar. `settingsSuggestions` contiene la traducción a DSH del settings.json y las claves no mapeables (ver [COMPLIANCE.md](COMPLIANCE.md)).
|
|
134
|
+
- **Importación**: mapea mensajes user/assistant/tool/thinking con fidelidad total; las llamadas a herramientas interrumpidas se reparan (exactamente un resultado por `tool_use`), y el resultado es una sesión equilibrada y reanudable, vinculada al espacio de trabajo `claudecode` (por defecto) o a su espacio de trabajo por proyecto. Los lotes se resumen archivo por archivo (`imported`/`appended`/`already-imported`/`skipped`/`failed`), las líneas malformadas llevan número de línea, los posibles secretos se informan solo por posición (archivo:línea:tipo) y los registros de permisos se cuentan pero nunca se importan. Importar nunca borra ni reescribe nada: las sesiones existentes de DSH quedan intactas, las copias importadas anteriormente se conservan y los archivos fuente de Claude nunca se escriben.
|
|
135
|
+
- **El contexto personal se aplica automáticamente** (sin acción de importación):
|
|
136
|
+
- Memorias: `projects/*/memory/*.md` se inyectan como sección dinámica, se releen en cada petición (las memorias nuevas surten efecto al instante), orden `feedback > project > reference > user`, límite de 8 KiB por defecto. Con `memoryScope: current-project` (por defecto) solo se inyectan las memorias del proyecto de la sesión actual (se recurre a todos los proyectos cuando el cwd no coincide con ninguno); `all` inyecta todo con el proyecto actual primero. Dentro del espacio de trabajo `claudecode`, el plugin resuelve el proyecto original a partir del `sourceCwd` registrado.
|
|
137
|
+
- Habilidades: `~/.claude/skills/**/SKILL.md` (más archivos planos `*.md`) y `.claude/skills/**` del proyecto actual se convierten en habilidades de DSH (nombres normalizados a kebab-case, colisiones con sufijo, máximo 30; se omiten `README.md`/`MEMORY.md` y los archivos sin descripción para que nunca rompan la carga de habilidades); DSH se encarga del catálogo y de la herramienta `skill`.
|
|
138
|
+
- Instrucciones: el `~/.claude/CLAUDE.md` global más el `.claude/CLAUDE.md` de la sesión actual se inyectan como una sección temprana (el proyecto gana; se resuelve vía `sourceCwd` dentro del espacio de trabajo `claudecode`).
|
|
139
|
+
|
|
140
|
+
## ✅ Después de importar
|
|
141
|
+
|
|
142
|
+
**No hace falta reiniciar DSH.** Las importaciones se guardan de forma duradera a través del servicio público `sessionPersistence` en cuanto terminan:
|
|
143
|
+
|
|
144
|
+
- Las listas del servidor (`session.list` / `workspace.list`, la CLI o cualquier página recién abierta) muestran de inmediato las sesiones importadas bajo el **espacio de trabajo `claudecode`** (uno por proyecto con `workspaceMode: 'per-project'`).
|
|
145
|
+
- El panel refresca él mismo la lista de sesiones de la página ya abierta (servicios de cliente del shell `sessions`/`workspaces`, detectados por capacidad) y ofrece «Abrir sesión» por cada sesión importada; en shells antiguos sin esos servicios se recurre al botón «Refrescar lista de sesiones» / recarga de página — las importaciones escriben sesiones frías directamente en el servicio de persistencia, así que no emiten el frame en vivo `host/session-added`; los grupos de espacios de trabajo sí se actualizan en vivo (`host/workspace-changed`).
|
|
146
|
+
- Las sesiones importadas pueden abrirse, leerse y reanudarse al momento — `/resume-claude`, o pulsa la sesión en la lista. El traspaso indica el directorio del proyecto original. Reejecutar la importación en cualquier momento solo añade los turnos nuevos a las mismas sesiones.
|
|
147
|
+
|
|
148
|
+
## ⚙️ Configuración
|
|
149
|
+
|
|
150
|
+
Todo opcional y reemplazable en `cordis.yml`:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
- id: claude-move
|
|
154
|
+
name: dsh-claude-move
|
|
155
|
+
config:
|
|
156
|
+
claudeHome: null # por defecto: $CLAUDE_CONFIG_DIR o ~/.claude
|
|
157
|
+
workspaceMode: claudecode # 'claudecode' (por defecto: un espacio de trabajo dedicado para todas las importaciones) | 'per-project' (un espacio de trabajo por cwd de origen)
|
|
158
|
+
claudecodeDir: null # carpeta del espacio de trabajo claudecode; por defecto $DSH_HOME/claudecode (la única carpeta que el plugin crea jamás)
|
|
159
|
+
scanGit: true # nivel de sondeo git: true completo | 'branch' sin subprocesos | false
|
|
160
|
+
gitTimeoutMs: 5000 # tiempo límite del subproceso git
|
|
161
|
+
scanConcurrency: 8 # límite de concurrencia del escaneo de proyectos
|
|
162
|
+
maxTranscriptBytes: 67108864
|
|
163
|
+
excludeProjects: [] # subcadenas de slug a omitir, p. ej. ['demo-']
|
|
164
|
+
enableMemory: true
|
|
165
|
+
memoryMaxBytes: 8192
|
|
166
|
+
memoryScope: current-project # 'current-project' solo el proyecto actual | 'all' todo, actual primero
|
|
167
|
+
enableSkills: true
|
|
168
|
+
maxSkills: 30
|
|
169
|
+
extraSkillDirs: []
|
|
170
|
+
enableInstructions: true
|
|
171
|
+
resumeMaxChars: 2048 # límite de caracteres del resumen de traspaso
|
|
172
|
+
resumeMode: inject # 'inject' resumen de traspaso | 'agents' ctx.agents.resume
|
|
173
|
+
enableWebPanel: true # registrar las rutas del panel /api/claude-move/*
|
|
174
|
+
importConcurrency: 4 # concurrencia de lectura+conversión por lote (el guardado sigue secuencial)
|
|
175
|
+
# Asistente de cuatro fuentes (0.2.1+):
|
|
176
|
+
requireApproval: true # las escrituras del asistente preguntan a ctx.approval (solo allowed-once)
|
|
177
|
+
codexHome: null # por defecto: $CODEX_HOME o ~/.codex
|
|
178
|
+
opencodeDataHome: null # por defecto: directorio de datos XDG de la plataforma/opencode
|
|
179
|
+
opencodeConfigHome: null # por defecto: directorio de configuración XDG de la plataforma/opencode
|
|
180
|
+
hermesHome: null # por defecto: $HERMES_HOME o ~/.hermes
|
|
181
|
+
skillsDir: null # destino de skills del asistente; por defecto $DSH_HOME/skills
|
|
182
|
+
agentsMdPath: null # destino de memorias/instrucciones; por defecto $DSH_HOME/AGENTS.md
|
|
183
|
+
moveWorkspaceMode: per-source # 'per-source' | 'single' agrupación de espacios de trabajo
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 🗑 Desinstalación
|
|
187
|
+
|
|
188
|
+
Quita la fila `claude-move` de los bundles del perfil y reinicia `dsh`. Las sesiones importadas permanecen en el directorio de datos de DSH; el plugin solo escribe su caché (`$DSH_HOME/claude-move/`) y la carpeta del espacio de trabajo `claudecode`, y nunca toca los datos fuente de Claude.
|
|
189
|
+
|
|
190
|
+
## 🧭 Compatibilidad
|
|
191
|
+
|
|
192
|
+
- Objetivo: `dsh 0.1.0-rc.6` (perfil web); dependencias peer fijadas a `0.1.0-rc.6`. Node `^22.19 || >=24`.
|
|
193
|
+
- Última verificación **2026-08-13** en Windows (Node 22) contra `@deepseek-ai/dsh@0.1.0-rc.6`: instalación desde cero del tarball, escaneo real (40 proyectos / 2387 sesiones), importación real por lotes 13/13 con reimportación idempotente 13/13, vínculo al espacio de trabajo y artefactos de persistencia confirmados. macOS/Linux cubiertos por la matriz CI (linux/macos/windows × Node 22).
|
|
194
|
+
- Verificado **2026-08-14** contra el checkout actual de `deepseek-harness` (perfil web, backend de sesiones JSONL+zstd, registro de espacios de trabajo real) en un home aislado: arranque web completo con el plugin montado, escaneo + importación total por las rutas del panel, creación del espacio de trabajo `claudecode` con sesiones vinculadas, anexo incremental a una sesión importada existente (seq contiguo, carga limpia), reimportación segura tras reinicio y sesiones DSH preexistentes intactas durante todo el proceso. Ninguna sesión se archiva, borra o reescribe jamás.
|
|
195
|
+
|
|
196
|
+
### Matriz de compatibilidad (solo seams públicos)
|
|
197
|
+
|
|
198
|
+
| Superficie | Uso | Respaldo cuando falta |
|
|
199
|
+
| --- | --- | --- |
|
|
200
|
+
| Servicios host (`tools` / `sessionPersistence` / `workspaceRegistry` / `commands` / `systemPrompt` / `skills` / `webServer`) | usados donde se listan | los servicios opcionales se registran reactivamente vía `internal/service`; falta de `fs` falla en voz alta |
|
|
201
|
+
| `sessionPersistence.listSnapshots` / `readFrom`, `fs.streamText`, `ctx.jobs`, `ctx.agents.resume` | detectados por capacidad | `list()` / lectura completa con rechazo en voz alta / mapa de trabajos propio / inyección del resumen |
|
|
202
|
+
| Servicios de cliente del shell (`sessions.refresh/open`, `workspaces.refresh`) | detectados en el apply del panel | recarga completa de la página |
|
|
203
|
+
| Las capacidades nuevas de la plataforma nunca son requisitos duros — el plugin siempre arranca en rc.6. | | |
|
|
204
|
+
|
|
205
|
+
## 🔐 Permisos y datos
|
|
206
|
+
|
|
207
|
+
- **Lee** `~/.claude` (transcripciones, memorias, habilidades, CLAUDE.md, settings.json) — estrictamente solo lectura — y los directorios de proyecto a los que importa (vínculo al espacio de trabajo en modo `per-project`).
|
|
208
|
+
- **Escribe** los registros de sesión de DSH mediante el servicio público `sessionPersistence` — solo create + append, nunca borra, reescribe ni archiva sesiones existentes — registros del registro de espacios de trabajo, su propia caché bajo `$DSH_HOME/claude-move/` (marcadores de escaneo + mapa de importación), y la carpeta del espacio de trabajo `claudecode` (`$DSH_HOME/claudecode` por defecto; un simple `mkdir`, nunca ninguna eliminación).
|
|
209
|
+
- **Nunca** modifica los archivos fuente de Claude, toca datos de otras aplicaciones ni accede a la red.
|
|
210
|
+
- **Ninguna credencial** se lee ni transmite; los posibles secretos en las transcripciones se informan solo por posición.
|
|
211
|
+
|
|
212
|
+
## 🛡 Límites de seguridad
|
|
213
|
+
|
|
214
|
+
- Los archivos fuente son estrictamente de solo lectura; los registros de sesión de DSH son append-only (solo `create` + `append`).
|
|
215
|
+
- Las transcripciones externas son entrada no confiable: nada de ellas se ejecuta; el contenido system/developer/thinking nunca entra en el resumen de traspaso.
|
|
216
|
+
- Sin cambios al motor de DSH, paquetes oficiales de UI ni apiproxy — solo servicios públicos (`sessionPersistence` / `workspaceRegistry` / `tools` / `commands` / `systemPrompt` / `skills` / `webServer`).
|
|
217
|
+
- Los posibles secretos se informan solo por ubicación (nunca su contenido); los registros `permission`/`permission-mode`/`queue-operation` se cuentan, no se importan.
|
|
218
|
+
|
|
219
|
+
## 🩺 Solución de problemas
|
|
220
|
+
|
|
221
|
+
- Fila sin efecto: `dsh --profile <p> --dump-config` debe imprimir `# == dsh-claude-move`; vuelve a ejecutar `dsh plugin --profile <p> add -w ...`.
|
|
222
|
+
- La web arranca pero se cuelga en silencio: los perfiles nuevos que inicializa `dsh plugin add` solo contienen `dsh-base` — añade `@deepseek-ai/dsh-web-app` a `dsh.profile.bundles`. Instalar en el perfil `web` existente no necesita nada.
|
|
223
|
+
- Rutas del panel 404: solo se sirven cuando `enableWebPanel: true` y hay un servidor web compuesto; revisa el registro de arranque por fibras FAILED.
|
|
224
|
+
- La importación falla con "transcript 过大": sube `maxTranscriptBytes` o importa ese archivo individualmente.
|
|
225
|
+
- La importación tuvo éxito pero la barra lateral no muestra la sesión nueva: la página ya estaba abierta — pulsa «Refrescar lista de sesiones» del panel (o recarga la página) una vez. Nunca hace falta reiniciar DSH.
|
|
226
|
+
- Registros: los fallos de arranque se imprimen en la consola de `dsh`; el plugin registra errores con el prefijo `[claude-move]` para problemas de espacios de trabajo/mapa de importación.
|
|
227
|
+
|
|
228
|
+
## 📚 Documentación
|
|
229
|
+
|
|
230
|
+
- [PLAN.md](PLAN.md) — conclusiones de investigación y plan de implementación.
|
|
231
|
+
- [ARCHITECTURE.md](ARCHITECTURE.md) — diagrama de arquitectura y tabla completa de mapeo de datos.
|
|
232
|
+
- [COMPLIANCE.md](COMPLIANCE.md) — auditoría cláusula por cláusula frente a las restricciones oficiales de plugins (repo y docs de deepseek-harness, [deepseek.com/harness](https://www.deepseek.com/harness/), la [documentación de desarrollo](https://deepseek-harness.github.io/deepseek-harness/develop/basic/), [Cordis](https://github.com/cordiverse/cordis) y el [paper de Cordis](https://github.com/cordiverse/paper)).
|
|
233
|
+
- [OPTIMIZATION.md](OPTIMIZATION.md) — líneas base medidas y candidatos de optimización ordenados.
|
|
234
|
+
- [RELEASE.md](RELEASE.md) — lista de verificación de release con evidencia de aceptación.
|
|
235
|
+
- [CHANGELOG.md](CHANGELOG.md) — qué cambió en cada versión.
|
|
236
|
+
|
|
237
|
+
## 🙏 Atribución (componentes open source)
|
|
238
|
+
|
|
239
|
+
Este proyecto está licenciado bajo la Apache License 2.0; los siguientes componentes bajo MIT conservan sus propias licencias (texto completo en [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)):
|
|
240
|
+
|
|
241
|
+
- Núcleo de conversión vendored de [Nwflower/dsh-chat-import](https://github.com/Nwflower/dsh-chat-import) (MIT).
|
|
242
|
+
- Convenciones de descubrimiento y modelo de seguridad de [Demogorgon314/dsh-resume-plugin](https://github.com/Demogorgon314/dsh-resume-plugin) (MIT; su `session_reader.py` tiene un origen Apache-2.0 — ver [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)).
|
|
243
|
+
- Patrones de inyección de memory/skills y análisis de frontmatter de [YYTbit/dsh-plugin-claude-bridge](https://github.com/YYTbit/dsh-plugin-claude-bridge) (MIT).
|
|
244
|
+
|
|
245
|
+
## 🧑💻 Desarrollo
|
|
246
|
+
|
|
247
|
+
```sh
|
|
248
|
+
npm install # peer deps: @deepseek-ai/cordis, @deepseek-ai/dsh-tools@0.1.0-rc.6, @deepseek-ai/schemastery
|
|
249
|
+
npm test # node --test: convert (vendored + extendido), discovery, import/report, context, settings
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
CI ejecuta la suite completa en Node 22 vía GitHub Actions ([test.yml](.github/workflows/test.yml)).
|
|
253
|
+
|
|
254
|
+
## 🧠 Model Experience
|
|
255
|
+
|
|
256
|
+
- La superficie visible al modelo son las descripciones/esquemas de las dos herramientas y sus salidas: `claude_scan` devuelve el índice estructurado, `import_claude` devuelve resúmenes por archivo con posiciones de avisos. Los resultados de las herramientas son a su vez eventos `tool/result` registrados, así que todo es reconstruible.
|
|
257
|
+
- No hay texto oculto visible al modelo; las secciones memory/CLAUDE.md están registradas en `ctx.systemPrompt` (ensamblado del prompt, reconstruible desde el registro de sesión).
|
|
258
|
+
|
|
259
|
+
## ⚠️ Limitaciones conocidas
|
|
260
|
+
|
|
261
|
+
- Los títulos vienen de `custom-title`/`ai-title`/primer prompt; los registros `summary` de Claude no se usan como títulos.
|
|
262
|
+
- Los bloques `thinking` se conservan en el registro importado como contenido `reasoning`, pero nunca entran en el resumen de traspaso.
|
|
263
|
+
- Las llamadas a herramientas interrumpidas se reparan con un resultado de error sintético (nunca se descartan), de modo que las sesiones con interrupciones a mitad de turno siguen siendo reanudables — la reparación se informa en el resultado de la importación (`repaired.synthesized`).
|
|
264
|
+
- Los registros de permisos se cuentan, no se importan; las sugerencias de presets de permisos de DSH se generan en los informes.
|
|
265
|
+
- Las transcripciones mayores que `maxTranscriptBytes` se importan por streaming en fragmentos cuando el host ofrece `fs.streamText` (memoria O(fragmento)); sin esa superficie se falla en voz alta en vez de importar parcialmente (fidelidad primero).
|
|
266
|
+
- Los registros `summary` de Claude se informan pero no se mapean a nodos de compresión DSH (ver OPTIMIZATION.md); el historial completo se importa como turnos originales.
|
|
267
|
+
- En `workspaceMode: 'per-project'`, las sesiones cuyo directorio de origen se eliminó aún se importan, pero el vínculo al espacio de trabajo falla (quedan sin agrupar; `workspace.attached: false` más un `reason` en el informe). El espacio de trabajo `claudecode` por defecto no depende del directorio de origen, así que esas sesiones se vinculan con normalidad allí.
|
|
268
|
+
- Las importaciones por lotes interrumpidas pueden reejecutarse con seguridad (idempotente, append-only): los archivos terminados se omiten y los que crecieron solo añaden los turnos nuevos.
|
|
269
|
+
- Si una transcripción fue truncada o reiniciada en su lugar (menos turnos que la importación registrada), la reimportación la omite e informa `sourceShrunk`; usa `force: true` para una copia completa nueva.
|
|
270
|
+
- El panel web es un panel flotante sin build impulsado por las rutas JSON propias del plugin; no usa el sistema interno de slots de UI del shell (se mantiene independiente de los internals no documentados de rc.6).
|
|
271
|
+
|
|
272
|
+
## 🤝 Contribuir y dar feedback
|
|
273
|
+
|
|
274
|
+
Issues y pull requests son bienvenidos — usa las plantillas provistas ([reporte de bug](.github/ISSUE_TEMPLATE/bug-report.yml), [solicitud de función](.github/ISSUE_TEMPLATE/feature-request.yml)). Las preguntas y discusiones viven en las [GitHub Discussions](https://github.com/PerryLink/dsh-claude-move/discussions) del repo. Reporta problemas de seguridad de forma privada mediante GitHub Security Advisories (repo Settings → Security; ver [SECURITY.md](SECURITY.md)).
|
|
275
|
+
|
|
276
|
+
## 💛 Colaboradores
|
|
277
|
+
|
|
278
|
+
Gracias a todos los que ayudaron a mejorar este plugin:
|
|
279
|
+
|
|
280
|
+
- [OLDnana1](https://github.com/OLDnana1) — análisis de la causa raíz de la corrupción por llamadas a herramientas interrumpidas, que hacía que las sesiones importadas devolvieran permanentemente HTTP 400 al reanudar ([#1](https://github.com/PerryLink/dsh-claude-move/issues/1)); corregido en v0.2.0.
|
|
281
|
+
- [GooodWei](https://github.com/GooodWei) — identificó que `README.md` (y cualquier `.md` sin descripción) se registraba erróneamente como skill, rompiendo toda la carga de skills de DSH ([#1](https://github.com/PerryLink/dsh-claude-move/issues/1)); corregido en v0.2.0.
|
|
282
|
+
- Los proyectos MIT upstream que este plugin reutiliza se acreditan en [Atribución](#-attribution-open-source-components) y en [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
283
|
+
|
|
284
|
+
## 🔗 Enlaces relacionados
|
|
285
|
+
|
|
286
|
+
- DeepSeek Harness: [repo](https://github.com/deepseek-ai/deepseek-harness) · [sitio](https://www.deepseek.com/harness/) · [documentación de desarrollo](https://deepseek-harness.github.io/deepseek-harness/develop/basic/)
|
|
287
|
+
- Ecosistema de plugins: [topic `dsh`](https://github.com/topics/dsh) · [topic `dsh-plugin`](https://github.com/topics/dsh-plugin) · [Discord](https://discord.gg/Ycq5dCaS4)
|
|
288
|
+
|
|
289
|
+
## 📄 Licencia
|
|
290
|
+
|
|
291
|
+
Apache License 2.0 — ver [LICENSE](LICENSE) y [NOTICE](NOTICE). Avisos de terceros (incluido el texto MIT de los componentes MIT) en [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|