@restregular/dsh-powerup 0.6.1 → 0.8.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/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # Power-Up
2
2
 
3
3
  Small, opt-in upgrades for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness).
4
- The upgrades include a **right-click action menu in the Trajectory view**, an
5
- optional **stop reason for background jobs**, and an in-place **plugin installer**.
4
+ The upgrades include a **right-click action menu in the Trajectory view**, a
5
+ **copyable step reference** that an agent can resolve back into the raw session
6
+ data, an optional **stop reason for background jobs**, an in-place
7
+ **plugin installer**, and a **sidebar launcher** that turns the left sidebar's
8
+ panel list into an adaptive icon grid with drag sorting and folders.
6
9
 
7
10
  ## Install
8
11
 
@@ -21,6 +24,8 @@ Right-click a trajectory record:
21
24
  - **Quote in composer** — insert that quote into the current input box.
22
25
  - **Open record details** — open the host's record inspector.
23
26
  - **Fork from here** — fork the session at that record (inclusive).
27
+ - **Copy step reference** — copy `dsh-step:<session-id>/<step-id>`; the
28
+ `powerup_step_read` tool turns that string back into the raw session data.
24
29
  - **Copy session ID**.
25
30
 
26
31
  Right-click empty space in the ledger:
@@ -55,6 +60,59 @@ and is not clipped by any slot's stacking context; its colors come only from
55
60
 
56
61
  `↑` / `↓` move, `Home` / `End` jump, `Enter` runs, `Esc` closes.
57
62
 
63
+ ### Step references
64
+
65
+ **Copy step reference** copies a single line such as
66
+ `dsh-step:session-1a2b…/turn.0.step.3`. The reference carries the session id
67
+ plus a stable step id:
68
+
69
+ | Step id | Copied from | Resolves to |
70
+ | --- | --- | --- |
71
+ | `turn.<turn>.step.<step>` | an assistant row | every raw event between `step/start` and `step/end` |
72
+ | `call.<call-id>` | a tool row | that tool call and its `tool/result` |
73
+ | `seq.<n>` | any other raw-event row | that single event |
74
+ | `index.<n>` | a synthetic row | nothing — the menu disables the action |
75
+
76
+ Paste the line into the session and the agent can call
77
+ **`powerup_step_read`**, a read-only Host tool registered while both `tools` and
78
+ `sessionQuery` are composed:
79
+
80
+ ```json
81
+ { "ref": "dsh-step:session-1a2b…/turn.0.step.3", "requests": false }
82
+ ```
83
+
84
+ It returns the raw events as JSON. Optional arguments: `before` / `after` add up
85
+ to 50 neighboring events on each side, and `requests: true` also includes the
86
+ `request/header` snapshots (the full system prompt and tool schemas), which are
87
+ omitted by default because they are large. The tool is workspace-agnostic: it
88
+ reads the session named in the reference through `ctx.sessionQuery`, so an agent
89
+ can open a step in a session it never had to locate on disk.
90
+
91
+ ### Sidebar launcher
92
+
93
+ The left sidebar's global panel buttons (Conversation, Files, Plugins, and the
94
+ entries other plugins add) become an icon grid instead of a one-per-row list:
95
+
96
+ - **Columns follow the width.** The list is an `auto-fill` grid of
97
+ `minmax(58px, 1fr)` cells, so widening the sidebar adds columns and narrowing
98
+ it removes them — there is no fixed column count to break.
99
+ - **Icons above labels.** Each tile stacks a 20px icon over an 11px caption, one
100
+ line with an ellipsis when the label is long.
101
+ - **Drag to sort.** Press and drag a tile; a ghost follows the pointer and a
102
+ thin accent line marks the insertion point. Order is stored per browser.
103
+ - **Drop onto a tile's middle to build a folder.** Dropping on the middle of
104
+ another icon folds both into a folder tile (like a Windows Start menu folder);
105
+ dropping on a folder adds to it; dropping a folder onto an icon or another
106
+ folder merges them. Click a folder and the contained icons appear in a flyout
107
+ anchored to the tile, scaling in from its edge. Inside the flyout: click an
108
+ entry to open that panel, `×` removes it from the folder, click the title to
109
+ rename the folder, and **Ungroup** returns every member to the grid.
110
+ - **Collapsed sidebar stays native.** When the sidebar collapses to its 56px
111
+ rail there are no labels to stack, so the launcher steps aside and the host's
112
+ rail rendering takes over untouched.
113
+ - The grid can be switched off on the Power-Up page; order and folders survive
114
+ the switch and are kept in `localStorage`.
115
+
58
116
  ## Install a plugin
59
117
 
60
118
  Open the built-in **Plugins** page. Every third-party card under **Installed
@@ -119,6 +177,14 @@ fiber is unloaded. The panel closes; refresh the page when the install finishes.
119
177
  the mark gets the full grid, so the chevrons and the amber baseline never
120
178
  collide with a border. The reference line artwork is
121
179
  `design/sidebar-icon.svg`; the runtime copy lives in `client.js`.
180
+ - **The step reference is plain coordinates plus one Host reader.** The Client
181
+ copies only `dsh-step:<session-id>/<step-id>` — no data, no URL, no port — so
182
+ the line survives restarts and can be pasted into any agent. The Host half
183
+ registers `powerup_step_read` when `tools` and `sessionQuery` are composed,
184
+ resolves the step through `sessionQuery.readSession` (raw events, ascending
185
+ seq), and returns the matching event window as JSON. A nested `run_code`
186
+ sub-call has no raw `tool/call` event of its own, so it falls back to the step
187
+ that owns it. Nothing is written to disk and no public route is added.
122
188
  - **No imports from Harness Client packages.** The menu is plain React + CSS and
123
189
  observes the trajectory package's own `data-*` contracts. If those attributes
124
190
  change, row-specific actions degrade gracefully; session-level actions in the
@@ -130,6 +196,18 @@ fiber is unloaded. The panel closes; refresh the page when the install finishes.
130
196
  The typed reason goes to `POST /dsh-powerup/api/job-kill`, which calls the
131
197
  registry's `kill(id, session, reason)` — the same admission the built-in
132
198
  Remote uses, with the reason settlement merges into the job's `detail` line.
199
+ - **The launcher upgrades the host list in place.** It never re-renders the
200
+ host's own panel rows: it marks the `<nav>`, applies grid/tile CSS, appends
201
+ synthetic folder tiles, hides the rows that moved into a folder with an
202
+ inline `display` (React rewrites `className` when the active panel changes and
203
+ would drop an added class), and sorts with the grid's `order` property. A
204
+ `MutationObserver` re-applies that after every host render, and the module
205
+ falls back to the native rail whenever the wide layout disappears.
206
+ - **Launcher state is tiny and self-healing.** `dsh-powerup:launcher:v1` stores
207
+ only an order array plus group records. `normalizeLauncherState` drops panels
208
+ that no longer exist (unregistered or unpinned), appends new ones in host
209
+ order, and dissolves empty folders, so plugin changes never wedge the layout
210
+ or lose the settings of the panels that remain.
133
211
  - **The install entry uses the built-in page's contracts.** The Plugins page has
134
212
  no per-card slot, so the overlay injects one button into every
135
213
  `[data-plugin-group="bundles"] [data-plugin-package]` card and re-asserts it
@@ -187,12 +265,15 @@ fiber is unloaded. The panel closes; refresh the page when the install finishes.
187
265
  ## Development
188
266
 
189
267
  ```bash
190
- node test/smoke.mjs
268
+ npm test
191
269
  ```
192
270
 
193
- The smoke test loads the real Client module with React/browser doubles, applies
194
- it to a fake slot context, and checks registrations, icons, helpers, theme
195
- tokens, the stop-reason mapping and Host route, and the manifest.
271
+ `node test/smoke.mjs` loads the real Client module with React/browser doubles,
272
+ applies it to a fake slot context, and checks registrations, icons, helpers,
273
+ theme tokens, the step-reference copy path, the stop-reason mapping, the Host
274
+ routes, and the manifest. `node test/host.mjs` exercises the step-reference codec
275
+ and resolver plus the `powerup_step_read` tool against a fake `sessionQuery` and
276
+ a raw event log.
196
277
 
197
278
  ## License
198
279