dsh-timeback 0.0.0-stage → 0.6.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/ACKNOWLEDGEMENTS.md +32 -0
- package/LICENSE +21 -0
- package/README.md +329 -2
- package/client.js +3044 -0
- package/cordis.patch.yml +23 -0
- package/docs/DETAIL.md +1 -0
- package/docs/LICENSES-AND-PUBLISHING.md +125 -0
- package/docs/MARKET.md +109 -0
- package/docs/PUBLISHING.md +180 -0
- package/docs/preview.svg +30 -0
- package/icon.svg +6 -0
- package/index.js +579 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +70 -4
- package/src/git-runner.js +162 -0
- package/src/notes.js +252 -0
- package/src/registry.js +383 -0
- package/src/service.js +1040 -0
- package/src/snapshots.js +577 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Acknowledgements
|
|
2
|
+
|
|
3
|
+
Timeback is an **original implementation**. It shares no source code, tests,
|
|
4
|
+
locale strings, README prose, screenshots or icons with the projects below;
|
|
5
|
+
their UX and engineering approach informed the design. Ideas and workflows are
|
|
6
|
+
not copyrightable expression, so no license obligation attaches to this
|
|
7
|
+
relationship — the table is kept as honest attribution and as a map for readers
|
|
8
|
+
who want to compare implementations.
|
|
9
|
+
|
|
10
|
+
If code is ever adapted from one of these projects, this file must be updated
|
|
11
|
+
with the exact notice and license text, and the adapted files must carry the
|
|
12
|
+
upstream copyright line.
|
|
13
|
+
|
|
14
|
+
| Project | License | Relationship |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| [PerryLink/dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Apache-2.0 | Ideas only: three-state checkpointing, capture-before-mutating-tool, guarded restore transaction, safety snapshot before rewind |
|
|
17
|
+
| [GeoSyntax/dsh-plugin-time-machine](https://github.com/GeoSyntax/dsh-plugin-time-machine) | MIT | Ideas only: coordinated session + workspace checkpoints, restore preview, branch as a DAG edge |
|
|
18
|
+
| [Unintendedz/dsh-conversation-tree](https://github.com/Unintendedz/dsh-conversation-tree) · [orchivo/dsh-conversation-tree](https://github.com/orchivo/dsh-conversation-tree) | MIT | Ideas only: immutable child sessions per branch point, sidebar tree browsing |
|
|
19
|
+
| [Serenity-2026/dsh-treecom](https://github.com/Serenity-2026/dsh-treecom) | MIT | Ideas only: one visible conversation plus a tree panel |
|
|
20
|
+
| [dsh-plugins/dsh-session-tree](https://github.com/dsh-plugins/dsh-session-tree) · [lulaalu/dsh-session-tree](https://github.com/lulaalu/dsh-session-tree) | MIT | Ideas only: branch-from-message model, host/client split |
|
|
21
|
+
| [ANHANP/dsh-branch-tree](https://github.com/ANHANP/dsh-branch-tree) · [YB313/dsh-branch-tree](https://github.com/YB313/dsh-branch-tree) | MIT | Ideas only: persistent tree drawer per Session |
|
|
22
|
+
| [SpookySandwich/dsh-plugin-message-edit](https://github.com/SpookySandwich/dsh-plugin-message-edit) | MIT | Ideas only: version tree entry points |
|
|
23
|
+
| [liangmianya/dsh-synapse](https://github.com/liangmianya/dsh-synapse) | MIT | Ideas only: card-based pannable/zoomable conversation map, lane layout, cubic connectors, selected-card detail panel. Timeback's canvas is an original card/lane implementation with turn-level checkpoint cards; no Synapse code or assets were copied |
|
|
24
|
+
| [helibeiqi/dsh-time-travel](https://github.com/helibeiqi/dsh-time-travel) | MIT | Ideas only: tool side-effect snapshots |
|
|
25
|
+
| [EmptyVessel-000/dsh-file-history](https://github.com/EmptyVessel-000/dsh-file-history) · [lire1131/dsh-undo-savepoint](https://github.com/lire1131/dsh-undo-savepoint) | MIT | Ideas only: file rollback UX |
|
|
26
|
+
| [@deepseek-ai/dsh-workspace-changes](https://github.com/deepseek-ai/deepseek-harness) | MIT (part of DeepSeek Harness) | Engineering reference: git plumbing for per-turn work-tree trees, subprocess sandboxing, turn hooks. Timeback's `src/snapshots.js` and `src/git-runner.js` are independently written, and additionally use a persistent private object store, `refs/timeback/*`, and a checkout-index restore path that package does not implement |
|
|
27
|
+
|
|
28
|
+
The DeepSeek Harness runtime itself is MIT-licensed. "DeepSeek", "DeepSeek
|
|
29
|
+
Harness" and related marks belong to their owners; this is an unofficial
|
|
30
|
+
community plugin and is not affiliated with or endorsed by DeepSeek.
|
|
31
|
+
"TimeBack" is a brand used by unrelated applications; this package is
|
|
32
|
+
`dsh-timeback` and is not related to them.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ppmchen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,330 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-timeback (时间回溯)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A DeepSeek Harness plugin that combines two things the built-in UI keeps apart:
|
|
4
|
+
|
|
5
|
+
1. **A conversation tree** — branch a conversation at any completed turn; the old
|
|
6
|
+
history stays intact.
|
|
7
|
+
2. **Workspace snapshots tied to the conversation** — after you enable recording
|
|
8
|
+
for a workspace, every turn records the state of the work tree, so a rewind
|
|
9
|
+
also restores the files the agent had at that point.
|
|
10
|
+
3. **A Markdown notes board** — cards carry free-text (Markdown) notes, and a
|
|
11
|
+
global notes page holds analysis/decisions from the user or the session; a
|
|
12
|
+
rewind restores the board to the state it had at that checkpoint.
|
|
13
|
+
|
|
14
|
+
Recording is **opt-in per workspace and off by default**. The switch is a
|
|
15
|
+
**workspace-level flag stored against the workspace directory**: enabling a
|
|
16
|
+
directory covers the Sessions in it **and its subdirectories** (a nested
|
|
17
|
+
workspace inherits it, so a rewind never misses files). A subdirectory can be
|
|
18
|
+
turned off individually: unchecking it stores an override and it stays off even
|
|
19
|
+
while the parent keeps recording; the panel lists such opt-outs with a
|
|
20
|
+
“restore inherited” button. This keeps unrelated workspaces (a home directory, a
|
|
21
|
+
dataset folder) untouched.
|
|
22
|
+
|
|
23
|
+
You can set it in three workspace-level places:
|
|
24
|
+
|
|
25
|
+
1. **Workspace menu** — the Workspace's “⋯” / right-click menu has
|
|
26
|
+
“时间回溯:开启/关闭此工作区记录”.
|
|
27
|
+
2. **New Session row** — right after “Add workspace…” creates a Workspace and
|
|
28
|
+
opens its blank Session, a “时间回溯记录” checkbox appears in that row (next to
|
|
29
|
+
the Workspace/preset controls), so the flag can be chosen at creation time.
|
|
30
|
+
3. **Timeback panel** — the “记录此工作区并保存文件快照” switch (same flag).
|
|
31
|
+
|
|
32
|
+
DSH's “Add workspace…” directory chooser is a single-slot dialog supplied by the
|
|
33
|
+
directory-picker package; a third-party plugin cannot add a field inside it
|
|
34
|
+
without replacing that picker, so the checkbox appears in the same creation flow
|
|
35
|
+
immediately after the Workspace exists, and in the Workspace's own menu for later
|
|
36
|
+
changes.
|
|
37
|
+
|
|
38
|
+
The result: when the agent does something wrong, go back to the turn before the
|
|
39
|
+
mistake, get the files back, and continue in a branch that only carries the
|
|
40
|
+
conversation up to that turn. Wrong turns stay on the old branch, out of context.
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
before a mistake rewind from the Timeback panel
|
|
44
|
+
┌──────────────────────────────────────────┐
|
|
45
|
+
conversation: A ─ B ─ C ─ D │ A ─ B ─ C ─ D (old branch, kept) │
|
|
46
|
+
files: s0 s1 s2 s3 │ └─ C′ (new branch, context A─C)│
|
|
47
|
+
│ files restored to s2 │
|
|
48
|
+
└──────────────────────────────────────────┘
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Where it appears
|
|
52
|
+
|
|
53
|
+
- **Notes board** — its own right-sidebar tab (open it from the Timeback panel
|
|
54
|
+
header or the sidebar guide): a global Markdown board for hand-written notes
|
|
55
|
+
and for notes written by the session through `timeback_note`.
|
|
56
|
+
- **Card notes** — every canvas card has a 📝 button; the Markdown note shows on
|
|
57
|
+
the card and in the detail pane.
|
|
58
|
+
- **Workspace menu / New Session row**: the workspace-level recording switch
|
|
59
|
+
(see above).
|
|
60
|
+
- **Right sidebar → timeback tab**: the same recording switch, plus a
|
|
61
|
+
**card-based conversation map**: every turn is a card, cards of one branch run
|
|
62
|
+
left-to-right in their own coloured lane, forked branches start from the fork
|
|
63
|
+
turn with cubic connectors, and the current root→Session path is highlighted.
|
|
64
|
+
Drag empty space to pan, wheel or toolbar buttons to zoom, **适应** fits the map
|
|
65
|
+
to the viewport; click a card to open its checkpoint detail (before/after
|
|
66
|
+
snapshots, changed-file counts, “回到这里 / 仅恢复文件 / 仅分支”) below the map.
|
|
67
|
+
**Double-click a card or its lane name to jump back to that conversation**,
|
|
68
|
+
**drag cards anywhere** to arrange them (the canvas grows; near a border the
|
|
69
|
+
view pans gently — time-based and depth-damped, at most ~55 px/s — so a card
|
|
70
|
+
can be dropped far outside the current view without flying off; branch names
|
|
71
|
+
live inside the cards; positions are remembered per branch
|
|
72
|
+
family, **复位** restores the automatic layout; **⤢** expands the canvas
|
|
73
|
+
height). Every branchable card has
|
|
74
|
+
**⑂ 分支** (fork at the checkpoint without touching files) and **✕ 删后续**
|
|
75
|
+
(delete everything after the node, see below). A **Tree / List** toggle keeps
|
|
76
|
+
the flat list view for long histories.
|
|
77
|
+
- **Three ways in**: the composer row pill “⏱ 时间回溯”, the clock button in the
|
|
78
|
+
conversation header, and the guide entry in the right sidebar. All three open
|
|
79
|
+
the panel; the panel's first card is the per-workspace recording switch.
|
|
80
|
+
- **Model tools**: `timeback_tree`, `timeback_checkpoint`, `timeback_rewind`, so the
|
|
81
|
+
agent can inspect its own checkpoints and self-correct when asked.
|
|
82
|
+
- The map is a pannable/zoomable canvas of cards: a lane per branch Session, one
|
|
83
|
+
card per turn (`T1`, `T2`, …) or branch-start marker, cubic connectors along a
|
|
84
|
+
branch and from the fork turn to the child branch, per-lane colours, and
|
|
85
|
+
current-path highlight. Manual checkpoints are folded into their turn card
|
|
86
|
+
(shown in the detail panel). Cards can be dragged (positions persist in the
|
|
87
|
+
browser per root Session) and double-clicked to return to their conversation.
|
|
88
|
+
Histories longer than 120 turns are truncated in the map and point at the List
|
|
89
|
+
view. The interaction model is inspired by the community conversation-map
|
|
90
|
+
plugins (see ACKNOWLEDGEMENTS); the implementation is original and depends on
|
|
91
|
+
no third-party canvas/layout library.
|
|
92
|
+
- **Panel behavior**: after a rewind the panel shows a “打开新分支” / “Open new branch”
|
|
93
|
+
button (it does not switch the view by itself), and a “用安全快照恢复” / “Restore
|
|
94
|
+
the safety snapshot” button that undoes the restore.
|
|
95
|
+
|
|
96
|
+
## Install
|
|
97
|
+
|
|
98
|
+
Pick the profile you actually use (`web` for `dsh web`/browser, `desktop` for the
|
|
99
|
+
desktop app):
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# From npm (after the package is published)
|
|
103
|
+
dsh plugin --profile web add dsh-timeback
|
|
104
|
+
|
|
105
|
+
# Straight from GitHub (no npm release needed)
|
|
106
|
+
dsh plugin --profile web add github:<owner>/dsh-timeback
|
|
107
|
+
dsh plugin --profile web add github:<owner>/dsh-timeback#v0.5.9
|
|
108
|
+
|
|
109
|
+
# From a local checkout or a packed tarball
|
|
110
|
+
dsh plugin --profile web add /path/to/timeback
|
|
111
|
+
npm pack && dsh plugin --profile web add ./dsh-timeback-0.5.9.tgz
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Or in the Web GUI: **Plugins → Add plugin → local directory**. After installation
|
|
115
|
+
restart `dsh web` (or the desktop app), hard-refresh the page, and open a new
|
|
116
|
+
session: the Host plugin row is `timeback`, and the panel build marker should
|
|
117
|
+
match `package.json` (e.g. `0.5.10+hero`). Recording is **off by default** — enable
|
|
118
|
+
it for a workspace first.
|
|
119
|
+
|
|
120
|
+
Publishing this repository (GitHub → npm → plugin market) is documented step by
|
|
121
|
+
step in [docs/PUBLISHING.md](docs/PUBLISHING.md); the self-hosted index, awesome
|
|
122
|
+
catalog PR and community directory steps are in [docs/MARKET.md](docs/MARKET.md).
|
|
123
|
+
License and marketplace-index details are in
|
|
124
|
+
[docs/LICENSES-AND-PUBLISHING.md](docs/LICENSES-AND-PUBLISHING.md).
|
|
125
|
+
|
|
126
|
+
## Delete after a node (prune)
|
|
127
|
+
|
|
128
|
+
Every branchable card has a danger **✕ 删后续** action; after a normal rewind the
|
|
129
|
+
result banner also offers **删除旧会话之后的记录**. Both perform the same
|
|
130
|
+
transaction:
|
|
131
|
+
|
|
132
|
+
1. fork a new branch at the selected checkpoint (and restore its file snapshot,
|
|
133
|
+
unless branch-only was requested);
|
|
134
|
+
2. archive the old session, plus every branch that was forked *after* that
|
|
135
|
+
checkpoint and all of their descendants;
|
|
136
|
+
3. hide archived sessions from the map.
|
|
137
|
+
|
|
138
|
+
DSH session logs are **append-only**, so a conversation cannot be physically
|
|
139
|
+
truncated. “Delete after” is therefore truncation-by-branch plus archival; the
|
|
140
|
+
archived sessions stay recoverable from the DSH sidebar archive list (unarchive
|
|
141
|
+
one and it can appear in the map again). The map reads the workspace archive set,
|
|
142
|
+
so archiving or unarchiving a session through DSH is reflected immediately.
|
|
143
|
+
|
|
144
|
+
## How a rewind works
|
|
145
|
+
|
|
146
|
+
- At every turn boundary **in an enabled workspace** the Host records a
|
|
147
|
+
**checkpoint**: the inclusive Session event sequence (the conversation
|
|
148
|
+
position) plus a complete snapshot of the work tree. Before-turn and
|
|
149
|
+
after-turn snapshots are both kept.
|
|
150
|
+
- **Rewind** asks the Session controller to fork the conversation at the
|
|
151
|
+
checkpoint's sequence — an append-only log is never rewritten, so the old
|
|
152
|
+
branch remains — and then restores the work tree from the checkpoint's snapshot.
|
|
153
|
+
Restore rewrites only differing paths, restores deleted files and modes,
|
|
154
|
+
recreates symlinks, and (by default) deletes files created after that point.
|
|
155
|
+
- Before touching any file it records a **safety snapshot**, so the rewind itself
|
|
156
|
+
can be undone.
|
|
157
|
+
- Branching only (`branch-only`) and file-only restore (`files-only`) are also
|
|
158
|
+
available.
|
|
159
|
+
- Each checkpoint also stores the **notes-board version** it saw, and a rewind
|
|
160
|
+
restores that Markdown state too (the old board versions stay in history).
|
|
161
|
+
|
|
162
|
+
The enabled-workspace list and checkpoints are stored in a JSON registry under
|
|
163
|
+
`<DSH_HOME>/timeback/`. Snapshots are stored in a **private git object store per
|
|
164
|
+
workspace** under `<DSH_HOME>/timeback/repos/<hash>/`. The workspace's own `.git` directory, index,
|
|
165
|
+
commits and refs are never read or written. `node_modules/`, virtualenvs and
|
|
166
|
+
caches are excluded by default (configurable), keeping snapshots small and fast.
|
|
167
|
+
|
|
168
|
+
## Notes board (记录板)
|
|
169
|
+
|
|
170
|
+
- Open it from the Timeback panel header (**📋 记录板**) or the right-sidebar
|
|
171
|
+
guide. It is a **global** page: one board for the whole profile, independent of
|
|
172
|
+
workspaces and sessions.
|
|
173
|
+
- **Manual notes**: New note → title + Markdown body; edit/delete any entry;
|
|
174
|
+
preview before saving.
|
|
175
|
+
- **Session notes**: the model writes through the `timeback_note` tool
|
|
176
|
+
(`list` / `create` / `update` / `delete`); entries show their source
|
|
177
|
+
(`我` / `会话`).
|
|
178
|
+
- **Card notes**: the 📝 button on a canvas card opens a Markdown editor for
|
|
179
|
+
that card; the note appears on the card and in the detail pane. Session-start
|
|
180
|
+
cards store their note on the session.
|
|
181
|
+
- **Rewind rolls the board back**: checkpoints capture the board version; a
|
|
182
|
+
rewind restores the board entries to what existed at that point. Every
|
|
183
|
+
mutation is kept in `notes-history/` so older versions stay restorable.
|
|
184
|
+
|
|
185
|
+
## Using it
|
|
186
|
+
|
|
187
|
+
1. Enable recording **for the workspace**: tick the “时间回溯记录” checkbox when the
|
|
188
|
+
new Workspace's Session opens, use the Workspace's “⋯” menu, or tick
|
|
189
|
+
**记录此工作区并保存文件快照** in the Timeback panel. Only enabled workspaces
|
|
190
|
+
record; switching it off stops every Session in that workspace while keeping
|
|
191
|
+
existing checkpoints rewindable.
|
|
192
|
+
2. Work normally; each following turn in that workspace adds a checkpoint row.
|
|
193
|
+
3. Notice a mistake.
|
|
194
|
+
4. Find the turn **before** the mistake → **回到这里** (rewind): a new branch is
|
|
195
|
+
created, the files are restored, and the panel offers **打开新分支** to switch
|
|
196
|
+
to it.
|
|
197
|
+
5. Continue in the new branch. The old branch is still listed in the tree for
|
|
198
|
+
comparison.
|
|
199
|
+
6. Need to save a known-good point in the middle of a turn? **手动检查点**
|
|
200
|
+
(`timeback_checkpoint`). In the default `capture: workspace` mode this also
|
|
201
|
+
requires the workspace switch to be on; with the plugin configured as
|
|
202
|
+
`capture: off` it stays available as an explicit action.
|
|
203
|
+
|
|
204
|
+
## Configuration
|
|
205
|
+
|
|
206
|
+
Set fields in the bundle row's `config` (profile `cordis.patch.yml` override):
|
|
207
|
+
|
|
208
|
+
| Field | Default | Meaning |
|
|
209
|
+
|---|---|---|
|
|
210
|
+
| `dataDir` | `<DSH_HOME>/timeback` | Snapshot repositories and the checkpoint registry |
|
|
211
|
+
| `capture` | `workspace` | `workspace`: only workspaces enabled from the panel record; `all`: every workspace records automatically; `off`: no automatic recording (manual checkpoints still work) |
|
|
212
|
+
| `exclude` | dependency/cache directories | Extra gitignore-style patterns kept out of snapshots |
|
|
213
|
+
| `timeoutMs` | `30000` | Deadline for one git command |
|
|
214
|
+
| `maxCheckpoints` | `400` | Retained checkpoints per Session (oldest are forgotten) |
|
|
215
|
+
| `restoreDeletesExtra` | `true` | Delete files created after the target checkpoint on restore |
|
|
216
|
+
| `maxFiles` | `20000` | Refuse snapshots of a workspace with more files (first-snapshot guard) |
|
|
217
|
+
| `probeTimeoutMs` | `8000` | Deadline for that size probe |
|
|
218
|
+
| `routePath` | `/timeback` | HTTP mount path for the panel API |
|
|
219
|
+
|
|
220
|
+
The data directory resolves to `<DSH_HOME>/timeback` when `DSH_HOME` is set,
|
|
221
|
+
otherwise to the directory beside the profile's `profiles/` folder (so
|
|
222
|
+
recreating a profile from a template does not orphan snapshots). Registry files
|
|
223
|
+
are `0600` inside a `0700` directory.
|
|
224
|
+
|
|
225
|
+
### Huge workspaces
|
|
226
|
+
|
|
227
|
+
Before the first snapshot of an **enabled** workspace, timeback runs
|
|
228
|
+
`git add --dry-run` to count what would be stored. More than `maxFiles` files (or a probe that cannot
|
|
229
|
+
finish in `probeTimeoutMs`) blocks snapshots for that workspace for the life of
|
|
230
|
+
the Host process, with the reason shown in the panel. This is what stops a
|
|
231
|
+
session whose working directory is your home directory from snapshotting
|
|
232
|
+
gigabytes by accident. Raise `maxFiles`, add `exclude` patterns, or change the
|
|
233
|
+
Session's working directory, then reload the plugin (config changes remount it).
|
|
234
|
+
|
|
235
|
+
## Model tools
|
|
236
|
+
|
|
237
|
+
| Tool | Purpose |
|
|
238
|
+
|---|---|
|
|
239
|
+
| `timeback_tree` | List the current Session's branch tree and checkpoints, plus whether the workspace is enabled for recording (ids, turns, changed-file counts, snapshot availability) |
|
|
240
|
+
| `timeback_checkpoint` | Create a manual checkpoint (conversation position + workspace snapshot). In `capture: workspace` mode this requires the workspace to be enabled; with `capture: off` it stays available as an explicit action |
|
|
241
|
+
| `timeback_rewind` | Rewind: `branch-and-files` (default), `branch-only`, or `files-only` |
|
|
242
|
+
| `timeback_workspace` | `list` / `enable` / `disable` the recording switch for one workspace (or the current one). It is a user-only privacy decision: the agent may only change it after an explicit request |
|
|
243
|
+
| `timeback_note` | Read/write the global Markdown notes board (`list`, `create`, `update`, `delete`); rewinds restore the board with the conversation |
|
|
244
|
+
|
|
245
|
+
## Limitations
|
|
246
|
+
|
|
247
|
+
- The recording flag is stored against the **workspace directory path**, not a
|
|
248
|
+
DSH Workspace id: deleting a Workspace keeps its directory flag, renaming or
|
|
249
|
+
moving a directory requires enabling the new path, and a Session whose working
|
|
250
|
+
directory leaves the enabled tree stops recording.
|
|
251
|
+
- Automatic recording is **off until enabled per workspace**. The model cannot
|
|
252
|
+
enable a workspace (it is a user-only privacy decision); it can only report
|
|
253
|
+
that recording is off.
|
|
254
|
+
- Snapshots are per **turn**, not per tool call. A rewind inside a turn restores
|
|
255
|
+
the turn's boundary state.
|
|
256
|
+
- Sessions that were never captured (created before installation, in a workspace
|
|
257
|
+
that was never enabled, or with `capture: off`) have conversation positions but
|
|
258
|
+
no file snapshots; they can still be branched if a checkpoint exists.
|
|
259
|
+
- Branches made by *other* tools (the built-in chat branch action, other
|
|
260
|
+
plugins) are ordinary Sessions without a timeback parent edge, so the tree lists
|
|
261
|
+
them as separate roots until a timeback rewind creates the relation.
|
|
262
|
+
- Restoring deletes files created after the checkpoint by default. Files matching
|
|
263
|
+
the exclude patterns are never snapshotted, so they are not restored either.
|
|
264
|
+
- Snapshot data grows with the number of turns and changed files; git
|
|
265
|
+
content-addressing deduplicates unchanged content. Old checkpoints are dropped
|
|
266
|
+
from the registry at `maxCheckpoints`, but git objects are not garbage-collected
|
|
267
|
+
by this version.
|
|
268
|
+
- Only top-level Sessions are recorded; subagent Sessions are skipped.
|
|
269
|
+
- A rewind while a turn is running is refused. A rewind does not stop shells or
|
|
270
|
+
jobs the old branch started.
|
|
271
|
+
- Restore writes files directly through the Host (not through the agent's
|
|
272
|
+
sandbox/approval path); treat the panel as a trusted owner action.
|
|
273
|
+
- Restore never deletes untracked or ignored content to make room: a non-empty
|
|
274
|
+
directory blocking a restored file is reported as a failed path instead.
|
|
275
|
+
Nested repositories appear as gitlinks and are left untouched.
|
|
276
|
+
- `.gitattributes` text/eol conversions can make a restored file differ from the
|
|
277
|
+
bytes captured when the attribute forces conversion; binary files are exact.
|
|
278
|
+
- Snapshot directories are `0700`, but a snapshot can still contain secrets that
|
|
279
|
+
were inside the workspace; exclude such paths if the profile is shared.
|
|
280
|
+
- Two Host processes sharing one `dataDir` are not coordinated; run one Host per
|
|
281
|
+
data directory.
|
|
282
|
+
|
|
283
|
+
## Verification status
|
|
284
|
+
|
|
285
|
+
- Host + client tests (48 cases, `npm test`) cover snapshot/restore semantics
|
|
286
|
+
(add/edit/delete/symlink/mode, delete-extra policy, nested repositories,
|
|
287
|
+
file↔directory collisions, refusal to delete untracked content blocking a
|
|
288
|
+
restore, excludes, missing trees), registry persistence/trimming, and a
|
|
289
|
+
Host-plugin integration run that mounts `apply()` on a fake context and drives
|
|
290
|
+
real turn events, HTTP routes, model tools, file restores and branch
|
|
291
|
+
registration, and the opt-in workspace flow (nothing recorded before the switch
|
|
292
|
+
is ticked, checkpoints start after enabling, disabling stops new checkpoints
|
|
293
|
+
while keeping old ones), the Markdown notes board (versioned store, card notes,
|
|
294
|
+
checkpoint board-version capture, and a rewind restoring the board to the
|
|
295
|
+
checkpoint state). A separate client-contract test loads `client.js`
|
|
296
|
+
through the Web module-loader protocol and checks the tab type, panel/header/
|
|
297
|
+
composer/New-Session/workspace-menu registrations and zh/en dictionaries
|
|
298
|
+
without a browser, and render the card canvas (two lanes, fork curve, current
|
|
299
|
+
path highlight, lane labels) plus the selected-card detail actions from real
|
|
300
|
+
payload shapes, the double-click jump, the quick branch request body, and
|
|
301
|
+
drag-position persistence, and the delete-after flow (branch reuse + archive +
|
|
302
|
+
hidden-from-map), the global board page (listing, Markdown render, create
|
|
303
|
+
request), the card-note editor and Markdown helpers.
|
|
304
|
+
- Installed into the Web profile and exercised through the Host routes
|
|
305
|
+
(`/timeback/api/health`, `/timeback/api/tree`, `/timeback/api/action`) against a
|
|
306
|
+
real Session; the branch child Session is created through the Session
|
|
307
|
+
controller and appears in the Session list.
|
|
308
|
+
- Installed live: the Host plugin's `timeback_tree`/`timeback_checkpoint` tools
|
|
309
|
+
are visible to the agent, the tree/health/action routes are reachable, git runs
|
|
310
|
+
through the Host subprocess capability, and the huge-workspace guard refused a
|
|
311
|
+
real `/home/kali` snapshot after the configured probe deadline instead of
|
|
312
|
+
writing anything.
|
|
313
|
+
- **Not verified live:** visual rendering of the panel/header button (no browser
|
|
314
|
+
control in this environment), and a real `sessionController.fork` rewind while
|
|
315
|
+
this Agent runs (a live turn is refused by design; the fork call is verified
|
|
316
|
+
against the installed controller source and exercised with a test double).
|
|
317
|
+
Slot registration, module syntax and locale/icon files were checked instead.
|
|
318
|
+
- An independent UI/UX review of the browser half was run and its findings were
|
|
319
|
+
applied (confirm text names the checkpoint and the deletion effect, busy and
|
|
320
|
+
sticky feedback states, “branch only” reachable on snapshot rows, disabled
|
|
321
|
+
reasons, stale-data guard on session switch, persisted capture-failure reason,
|
|
322
|
+
truncation indicators, localized checkpoint labels). Rendering itself remains
|
|
323
|
+
unverified here.
|
|
324
|
+
See docs/LICENSES-AND-PUBLISHING.md for the license/publishing research record.
|
|
325
|
+
|
|
326
|
+
## License
|
|
327
|
+
|
|
328
|
+
MIT. See [LICENSE](LICENSE) and [ACKNOWLEDGEMENTS.md](ACKNOWLEDGEMENTS.md)
|
|
329
|
+
(related community plugins and the DSH engineering reference — all permissive,
|
|
330
|
+
no code copied).
|