@nomadop/session-watcher-dsh 0.10.0 → 0.10.2

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.
@@ -7,7 +7,7 @@ description: Use when the user asks what a Session Watcher metric means (br, mf,
7
7
 
8
8
  When the user asks about a metric:
9
9
 
10
- 1. Call `watcher_status`. Read `br`, `u` (the arm it puts the session on), the lamp and the wallet clock's `phase` from the reply's `reading`; a false `reading.reliable` means the session is still measuring, so say that instead of quoting values. `mf`, `pp`, `wall` and `sweet / valley` are not in `reading`: point the user at where the host shows them, in Claude Code the dashboard at the URL the reply carries, in DSH the Session Watcher tab. `mf` is the hero chart's movable reading; the others are landmarks with no numeric readout.
10
+ 1. Call `watcher_status`. Read `br`, `u` (the arm it puts the session on), the lamp and the wallet clock's `phase` from the reply's `reading`; a false `reading.reliable` means the session is still measuring, so say that instead of quoting values. `mf`, `pp`, `wall` and `sweet / valley` are not in `reading`: point the user at where the host shows them, in Claude Code the dashboard at the URL the reply carries, in DSH the SW Meter tab. `mf` is the hero chart's movable reading; the others are landmarks with no numeric readout.
11
11
  2. Explain the requested metric in plain language.
12
12
  3. Contextualize against the flat-valley / AM-GM bound where relevant.
13
13
 
@@ -13,6 +13,8 @@ Prepare a handoff package so the next session can resume without re-reading what
13
13
 
14
14
  - **The call fails** — an error instead of that shape, whatever its cause. Stop this run: report to the user that the turn skeleton could not be captured; do not produce or submit notes, and do not go on to `prepare_handoff`.
15
15
 
16
+ - A successful reply freezes the run: perform steps 2–7 using the returned metadata and existing context. Unverified facts remain in Blockers / risks; resolving them belongs to next_task.
17
+
16
18
  2. **Produce turn notes** you MUST follow [`NOTES.md`](NOTES.md) exactly for what each note says. Write them inline — do not delegate to a subagent.
17
19
 
18
20
  3. **Submit notes** via the `submit_turn_notes` tool with `snapshot_id`. The tool reads `notes_path` itself.
@@ -24,20 +26,16 @@ Prepare a handoff package so the next session can resume without re-reading what
24
26
  - **`invalid_snapshot`** — the capture's source identity or required metadata is invalid, including a transcript that cannot be read. Stop: report to the user.
25
27
  - **`storage_unavailable`** (`retryable: true`) — store temporarily unavailable. Stop: report to the user; they may re-run the skill when ready.
26
28
 
27
- 4. **Fetch bucket data** via the `get_bucket_summary` tool.
28
-
29
- If `metrics.br < 0.05` AND few turns: note "Context is still light — handoff may not be necessary yet, but proceeding as requested."
29
+ 4. **Fetch bucket data** via the `get_bucket_summary` tool and complete any explicitly requested runtime handoff actions before this call. Call `get_bucket_summary` once per handoff.
30
30
 
31
31
  5. **Select paths to keep.** The kept set is what the next task must have in hand before it can act. Candidates are the bucket summary plus any path this segment used that the bucket lacks. For each candidate, name the act of `next_task` that opens it; a candidate with no such act is not kept, whatever this segment did with it.
32
32
  - The repo outlives the context reset and the conversation does not, so a file the next session can read on demand is kept only where that first act needs it in hand: the file the task edits, the test that guards it, the artifact under discussion.
33
33
  - A blob under review is read by its reviewer, so what the next task needs is the review's return and the sources it cites.
34
- - Read each candidate's `tokens` from the bucket summary and total them before prepare. Where one path carries more than half that total, state which act needs all of it, or keep its `symbols` alone.
34
+ - Use the returned `tokens` to estimate the kept total. Where one path carries more than half that total, state which act needs all of it, or keep its `symbols` alone. Unavailable or symbol-only costs may remain unknown, `prepare_handoff` returns the final total.
35
35
 
36
36
  Always: `userOverride` decides that path; a `keep:` list in the arguments is kept verbatim; symbols come from `activeSymbols` into `paths_to_keep[].symbols`; memories, `CONTEXT.md`, `CLAUDE.md` stay off the list.
37
37
 
38
- Before prepare, tell the user the kept total, each kept path with the act that opens it, and every edited or repeatedly read bucket path left out.
39
-
40
- 6. **Select skills** — `skills_to_keep`: only skills actively guiding the workflow or required by next_task. Skip one-shot completed skills. Never include `sw-load` — it drives the load flow itself and is always invoked automatically. If the user's `keep:` list includes skill names, use those directly.
38
+ 6. **Select skills** — `skills_to_keep`: only skills actively guiding the workflow or required by next_task. Skip one-shot completed skills. Never include `sw-load` — it drives the load flow itself. If the user's `keep:` list includes skill names, use those directly.
41
39
 
42
40
  7. **Write the summary** you MUST following [`SUMMARY.md`](SUMMARY.md) exactly. Redact secrets as `[REDACTED]`
43
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomadop/session-watcher-dsh",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Session Watcher as a DeepSeek Harness host plugin",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -15,10 +15,13 @@
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
+ "engines": {
19
+ "dsh": ">=0.2.2-rc.1"
20
+ },
18
21
  "peerDependencies": {
19
- "@deepseek-ai/dsh-compaction": ">=0.2.0-rc.1",
20
- "@deepseek-ai/dsh-llm": ">=0.2.0-rc.1",
21
- "@deepseek-ai/dsh-tools": ">=0.2.0-rc.1"
22
+ "@deepseek-ai/dsh-compaction": ">=0.2.2-rc.1",
23
+ "@deepseek-ai/dsh-llm": ">=0.2.2-rc.1",
24
+ "@deepseek-ai/dsh-tools": ">=0.2.2-rc.1"
22
25
  },
23
26
  "dsh": {
24
27
  "client": {
@@ -1,45 +0,0 @@
1
- ---
2
- name: sw-load
3
- description: "Use when the user provides a handoff token, asks to resume or continue previous work, the host's handoff notice announces a handoff, or you are about to call load_handoff."
4
- ---
5
-
6
- # Session Watcher Load Handoff
7
-
8
- Restore a previous session's handoff package into context so work can resume.
9
-
10
- ## Steps
11
-
12
- 1. **Load the handoff.** Resolve a token from the skill `args`, from the user's message, or from the host's own handoff notice, which names pending handoffs by token: the Claude Code SessionStart hook's additionalContext, or the message DSH injects when the agent starts or resumes. Then call the `load_handoff` tool, whose schema carries the three ways in.
13
-
14
- A token you were handed is the one path that proceeds without asking. Any other way in — a free-text match, an auto-match, or several tokens offered at once — means listing what came back with each one's age and task preview and letting the user pick before you go on. Nothing found → tell the user the token is expired or invalid, and ask for direction.
15
-
16
- 2. **Read the kept paths.** Relative paths resolve against CWD, then `project_dir`.
17
-
18
- One strategy per entry, the first row that applies:
19
-
20
- | Entry has | Read at load |
21
- |---|---|
22
- | `lines` | each range |
23
- | `resolvedSymbols` | the `(lines a-b)` each string carries |
24
- | neither | the file's first 40 lines; with `symbols`, also `grep -n` each name in the file to place the entry points |
25
-
26
- Each read is the host's file-reading tool over a line range of the kept file. Each call names one file. Issue every read for every entry in one message — each further turn re-reads the whole accumulated context.
27
-
28
- Unresolvable path → tell the user, skip. Empty `paths_to_keep` → ask the user what they are working on.
29
-
30
- 3. **Place the summary in its lineage.** `lineage` runs oldest to newest, one headline per lineage member; the injected page holds the newest turns and is already in context. From the page, list the turns whose `A:` note bears on the next task, by their `S{k}:{T}` address. When a headline bears on the next task and the page does not reach that member, call `turn_page` with that member's label as `before`. That list is what step 5 reports.
31
-
32
- 4. **Load the kept skills** — invoke each name in `skills_to_keep` through the host's skill tool. A skill named only in the summary text is invoked after the user agrees.
33
-
34
- 5. **Present, then hold.** One `git status --short && git log -1 --oneline`, then write, from the kept paths and that output:
35
- - Objective, one line
36
- - Working state — each claim the summary makes about the current state, set against what the kept paths and the git output show: matches, differs (say how), or reaches neither (say unverified)
37
- - Next task and its entry points — the `neither` entries with where their symbols sit, and the turns step 3 named
38
- - Blockers and risks
39
- - The kept paths now in context and the load token you used
40
-
41
- Then stop and wait for the user to confirm or correct it. The next task's first act begins after the reply.
42
-
43
- ### Completion criterion
44
-
45
- Done when the kept paths are in context, the state is presented in the shape step 5 gives, and the user has replied confirming or correcting it.