@oisin-ee/pi-dogsled 0.33.0 → 0.34.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/README.md CHANGED
@@ -13,13 +13,13 @@ Install the binary on each Herdr host. Use the same release tag in each command.
13
13
  Binary:
14
14
 
15
15
  ```sh
16
- mise use github:oisin-ee/dogsled@v0.33.0 # x-release-please-version
16
+ mise use github:oisin-ee/dogsled@v0.34.1 # x-release-please-version
17
17
  ```
18
18
 
19
19
  Pi (extension, tools, the `todo` tool, and skill), from npm:
20
20
 
21
21
  ```sh
22
- pi install npm:@oisin-ee/pi-dogsled@0.33.0 # x-release-please-version
22
+ pi install npm:@oisin-ee/pi-dogsled@0.34.1 # x-release-please-version
23
23
  ```
24
24
 
25
25
  At session start the extension compares its version with `dogsled --version` and warns when they differ.
@@ -58,12 +58,21 @@ The bot uses `GITHUB_TOKEN`, so its release-PR updates do not start CI.
58
58
  Nothing auto-merges the release PR.
59
59
 
60
60
  When the user requests a release, merge the open release-please PR.
61
- The merge runs the full CI suite through the reusable CI workflow.
61
+ The merge runs the full CI suite on the release commit through the reusable CI workflow.
62
62
  After CI passes, the publish job creates `vX.Y.Z` at that release commit and dispatches dist.
63
63
  Dist publishes the binaries and calls the existing npm publisher.
64
64
  The publish job changes `autorelease: pending` to `autorelease: tagged` so release-please can prepare the next release.
65
65
 
66
- If CI fails before tag creation, rerun the failed jobs at the same revision.
66
+ Until its tag exists, the merged release PR stays the outstanding release.
67
+ Every run of `release-please.yml` settles it, and `scripts/release-prepare.sh` decides what the run owes.
68
+ The gate validates only the commit the run is for, so only a run for the release commit itself can tag it.
69
+
70
+ - If CI failed for a reason outside the release commit, and `main` has not moved on, dispatch `release-please.yml` on `main` to retry it.
71
+ - If `main` has moved past the release commit, the run fails and names the commit to revert.
72
+ Revert it on `main` with a `chore(release):` subject.
73
+ The next run marks its PR `autorelease: superseded`, and release-please opens a fresh release PR for the same version.
74
+ - If a tag exists but its PR still has `autorelease: pending`, the next run changes the label to `autorelease: tagged`.
75
+
67
76
  If dispatch fails after tag creation, dispatch the existing tag manually:
68
77
 
69
78
  ```sh
@@ -72,7 +81,6 @@ gh workflow run release.yml --ref vX.Y.Z -f tag=vX.Y.Z
72
81
 
73
82
  Never move an existing tag.
74
83
  A partial publication can leave conflicting assets and requires review before a retry.
75
- If dispatch failed before the label change, change the merged PR label from `autorelease: pending` to `autorelease: tagged` after dispatch succeeds.
76
84
 
77
85
  ## Web portal
78
86
 
@@ -514,7 +522,7 @@ An identity change (repository, path, or branch), a missing entry, a command err
514
522
  `--json` returns `{results,skipped,failures}`. A result names the removed path and the closed panes. A failed `teardown` command's error includes its last lines of output.
515
523
 
516
524
  Placement records repositories in `repositories.json`, independently of `worktrees.json`. Repository registrations survive the last worktree removal.
517
- Doctor also discovers repositories from the caller, live pane directories, Herdr workspaces, `repos`, and `cleanup.repositories`. It never scans the whole home directory.
525
+ Doctor also discovers repositories from the caller, live pane directories, Herdr workspaces, and `cleanup.repositories`. It never scans the whole home directory.
518
526
  An absent remembered repository produces a removable `repositories` entry. Prune and the sweep recheck absence under the registry locks, then remove only stale records.
519
527
  Existing worktree records stay. Configured paths, discovered paths, unreadable paths, and dangling symlinks remain report-only. Doctor changes no registrations.
520
528
 
@@ -593,29 +601,24 @@ reservation_load = 1.0
593
601
  reservation_ttl_ms = 90000
594
602
  remote_command = ["mise", "x", "--", "dogsled"]
595
603
 
596
- [[repos]]
597
- path = "~/dev/dogsled"
598
- origin = "git@github.com:oisin-ee/dogsled.git"
599
-
600
604
  [cleanup]
601
605
  repositories = [] # for example "~/.config/mise"; `~/` is the home directory
602
606
  ```
603
607
 
604
- Each `[[repos]]` entry stores an origin and a checkout path with a `~/` prefix.
605
- Doctor checks these paths as well as `cleanup.repositories`.
608
+ `dogsled serve` publishes every GitHub repository that your `gh` account can access, including forks.
609
+ Archived repositories are excluded. The catalogue refreshes at startup and at most once per hour.
610
+ A failed refresh retains the last good list and publishes the error.
606
611
 
607
612
  ```sh
608
- dogsled repo add # add the repository in the current directory
609
- dogsled repo add ~/dev/dogsled # add a repository by path
613
+ dogsled repo list
610
614
  dogsled repo list --json
611
- dogsled repo remove git@github.com:oisin-ee/dogsled.git
612
615
  ```
613
616
 
614
- `repo add` reads the main checkout and its `origin` remote.
615
- It refuses repositories outside the home directory and duplicate repository identities, including SSH and HTTPS variants.
616
- `repo remove` accepts an origin or a checkout path and refuses an unknown entry.
617
- Both commands preserve comments and key order in the selected configuration file.
618
- They create a missing file and write through configuration symlinks.
617
+ The portal’s New picker searches repository names and descriptions, newest pushes first.
618
+ `GET /api/repos` and `repo list --json` return `{repos, error}` from the published catalogue.
619
+ Each repository contains `slug`, `description`, `pushed_at`, and `private`.
620
+ Without a publication, readers report that the catalogue is unavailable.
621
+ Repository registration and the `repo add` and `repo remove` commands no longer exist.
619
622
 
620
623
  Host policy has no worktree hooks. A `[hooks]` table is an unknown key, so it is an error. Worktree setup and teardown belong to each repository.
621
624
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oisin-ee/pi-dogsled",
3
- "version": "0.33.0",
3
+ "version": "0.34.1",
4
4
  "description": "Pi extension for dogsled: the board, the /dogsled panel, the inbox reader, and the dogsled tools. Needs the dogsled binary of the same version.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/pi/activity.ts CHANGED
@@ -8,20 +8,49 @@ export interface ActiveTool {
8
8
  call_id: string;
9
9
  name: string;
10
10
  parent_call_id: string | null;
11
+ call?: string;
11
12
  }
12
13
  export type Payload =
13
- | { kind: "snapshot"; state: { phase: Phase; active_tools: ActiveTool[] } }
14
+ | { kind: "snapshot"; state: { phase: Phase; active_tools: ActiveTool[]; reasoning?: string } }
14
15
  | { kind: "unavailable"; reason: "resyncing" | "overflow" }
15
16
  | { kind: "closed" };
16
17
  export type ActivityEvent =
17
18
  | { type: "agent_start" | "agent_end" | "settled" | "message_end" }
18
- | { type: "block"; index: number; phase: "thinking" | "responding"; ended: boolean }
19
+ | { type: "block"; index: number; phase: "thinking" | "responding"; ended: boolean; delta?: string }
19
20
  | { type: "tool_start"; tool: ActiveTool }
20
21
  | { type: "tool_end"; id: string };
21
22
 
23
+ /** The same call-line rule is used by the transcript reader in src/activity.rs. */
24
+ export function callLine(name: string, arguments_: unknown): string {
25
+ let args = arguments_;
26
+ if (typeof args === "string") {
27
+ try {
28
+ args = JSON.parse(args);
29
+ } catch {
30
+ // Non-JSON strings remain literal arguments in the fallback display.
31
+ }
32
+ }
33
+ if (record(args)) {
34
+ const command = args["command"] ?? args["cmd"];
35
+ if (typeof command === "string") return `$ ${command}`;
36
+ const path = args["path"] ?? args["file_path"];
37
+ if (typeof path === "string") return `${name.toLowerCase()} ${path}`;
38
+ }
39
+ return `${name} ${JSON.stringify(args) ?? "null"}`;
40
+ }
41
+
42
+ /** Newest UTF-8 bytes, without splitting a character. */
43
+ function tail(value: string, max: number): string {
44
+ const bytes = Buffer.from(value);
45
+ let start = Math.max(0, bytes.length - max);
46
+ while (start < bytes.length && ((bytes.at(start) ?? 0) & 0xc0) === 0x80) start++;
47
+ return bytes.subarray(start).toString();
48
+ }
49
+
22
50
  /** Preparation events never enter this reducer. Overflow is sticky until verified settlement. */
23
51
  export class ActivityReducer {
24
52
  private blocks = new Map<number, "thinking" | "responding">();
53
+ private thoughts = new Map<number, string>();
25
54
  private tools = new Map<string, ActiveTool>();
26
55
  private gap: "resyncing" | "overflow" | undefined;
27
56
  private idle: boolean;
@@ -34,23 +63,30 @@ export class ActivityReducer {
34
63
  reduce(event: ActivityEvent): Payload {
35
64
  if (event.type === "settled") {
36
65
  this.blocks.clear();
66
+ this.thoughts.clear();
37
67
  this.tools.clear();
38
68
  this.gap = undefined;
39
69
  this.idle = true;
40
70
  } else if (!this.gap) {
41
71
  if (event.type === "agent_start" || event.type === "agent_end") this.idle = false;
42
- else if (event.type === "message_end") this.blocks.clear();
43
- else if (event.type === "block") {
72
+ else if (event.type === "message_end") {
73
+ this.blocks.clear();
74
+ this.thoughts.clear();
75
+ } else if (event.type === "block") {
44
76
  this.idle = false;
45
77
  this.blocks.delete(event.index);
46
78
  if (!event.ended) this.blocks.set(event.index, event.phase);
79
+ if (event.phase === "thinking") {
80
+ this.thoughts.set(event.index, (this.thoughts.get(event.index) ?? "") + (event.delta ?? ""));
81
+ }
47
82
  } else if (event.type === "tool_start") {
48
83
  this.idle = false;
49
84
  this.tools.set(event.tool.call_id, { ...event.tool });
50
85
  } else if (event.type === "tool_end") this.tools.delete(event.id);
51
- if (this.blocks.size > 64 || this.tools.size > 64) {
86
+ if (this.blocks.size > 64 || this.thoughts.size > 64 || this.tools.size > 64) {
52
87
  this.gap = "overflow";
53
88
  this.blocks.clear();
89
+ this.thoughts.clear();
54
90
  this.tools.clear();
55
91
  }
56
92
  }
@@ -63,7 +99,15 @@ export class ActivityReducer {
63
99
  const phase = active_tools.length
64
100
  ? "tool_running"
65
101
  : ([...this.blocks.values()].at(-1) ?? (this.idle ? "idle" : "working"));
66
- return { kind: "snapshot", state: { phase, active_tools } };
102
+ const reasoning = tail(
103
+ [...this.thoughts.entries()]
104
+ .sort(([a], [b]) => a - b)
105
+ .map(([, thought]) => thought)
106
+ .filter((thought) => thought.length > 0)
107
+ .join("\n\n"),
108
+ 16 * 1024,
109
+ );
110
+ return { kind: "snapshot", state: { phase, active_tools, ...(reasoning ? { reasoning } : {}) } };
67
111
  }
68
112
  }
69
113
 
@@ -143,7 +187,7 @@ export class ActivityPublisher {
143
187
  this.client = client;
144
188
  this.pane = pane;
145
189
  this.evidence = { ...evidence };
146
- this.path = `/api/agents/${encodeURIComponent(pane)}/activity`;
190
+ this.path = `/api/agents/local/${encodeURIComponent(pane)}/activity`;
147
191
  this.reducer = new ActivityReducer(idle);
148
192
  this.pending = this.reducer.snapshot();
149
193
  this.request = { method: "GET", path: this.path };
@@ -401,6 +445,7 @@ export function registerActivity(pi: ExtensionAPI, client: Client, pane: string
401
445
  index: update.contentIndex,
402
446
  phase: update.type.startsWith("thinking") ? "thinking" : "responding",
403
447
  ended: update.type.endsWith("_end"),
448
+ ...(update.type === "thinking_delta" ? { delta: update.delta } : {}),
404
449
  });
405
450
  break;
406
451
  }
@@ -415,6 +460,7 @@ export function registerActivity(pi: ExtensionAPI, client: Client, pane: string
415
460
  call_id: event.toolCallId,
416
461
  name: event.toolName,
417
462
  parent_call_id: event.parentToolCallId ?? null,
463
+ call: tail(callLine(event.toolName, event.args), 512),
418
464
  },
419
465
  });
420
466
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  1. Run the repository's heavy gate once, at the final revision. Limit it to the change if the task runner can do that. If a target fails, start a follow-up writer unit on the same branch with the failure. A finished writer is closed. When the fix arrives, run only the failed targets again.
4
4
  2. Run `gh pr ready <n>`, then merge the PR. Then confirm that its state is `MERGED`.
5
- 3. Landing never bumps versions or creates tags. Use conventional commit titles for feature PRs because release-please builds the changelog from them. Release only when the user asks: merge the open release-please PR. Its workflow runs the full CI suite, then tags the release commit and dispatches publication. Never auto-merge the release-please PR.
5
+ 3. Landing never bumps versions or creates tags. Use conventional commit titles for feature PRs because release-please builds the changelog from them. Release only when the user asks: merge the open release-please PR. Its workflow runs the full CI suite on the release commit, then tags it and dispatches publication. A failed release stays outstanding: retry it by dispatching `release-please.yml` before anything else lands on main, or abandon it by reverting its release commit with a `chore(release):` subject. Never auto-merge the release-please PR.
6
6
  4. If GitHub Actions does not run because of billing, the local gate is the evidence. Say so once in the PR body.
7
7
  5. Bring the local `main` up to date with `origin/main`. Leave the tree clean.
8
8
  6. Report to the user what changed and what is live.