@henryqw/pi-herdr-btw 1.1.7 → 1.1.9

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
@@ -38,7 +38,7 @@ Requires Pi Coding Agent 0.84.3+, Herdr 0.7.4+, and a Herdr-managed pane.
38
38
  /btw help show grammar
39
39
  ```
40
40
 
41
- `ask`, `config`, `merge`, and `help` route only when exact first words. Other input is a question. A provided question is an editable draft by default. `/btw` snapshots Main's compaction-aware context, inherits its working directory, and uses shared task `pi-herdr-btw/btw`, which defaults to `fast`. It selects first authenticated viable profile route before pane launch.
41
+ `ask`, `config`, `merge`, and `help` route only when exact first words. Other input is a question. A provided question is an editable draft by default. `/btw` snapshots Main's compaction-aware context, inherits its working directory, and uses its consumer-owned `pi-herdr-btw/btw` task, which defaults to `fast`. It selects the first authenticated viable effective profile route before pane launch.
42
42
 
43
43
  In side pane, `/btw merge <prompt>` sends user/assistant text transcript to Main, refocuses Main, and closes side pane. Main appends transcript without starting a turn, then submits prompt. Bare `/btw merge` opens prompt editor. Pending delivery waits for Main to settle and current model authentication; it survives side-pane shutdown until consumed or 24-hour stale cleanup.
44
44
 
@@ -46,7 +46,7 @@ Side pane gets static parent context and shares Main's working directory, so ena
46
46
 
47
47
  ## Config
48
48
 
49
- `~/.pi/agent/config/pi-herdr-btw.json`
49
+ Package-owned: `~/.pi/agent/config/pi-herdr-btw.json`
50
50
 
51
51
  ```json
52
52
  {
@@ -56,18 +56,12 @@ Side pane gets static parent context and shares Main's working directory, so ena
56
56
  }
57
57
  ```
58
58
 
59
- `/btw config` shows defaults. Set `auto-submit on|off`, `tools inherit|all|read-only|none`, or `split right|down`; `reset` removes config. Missing config uses defaults. Malformed config fails visibly and remains unchanged. Model routes live in `~/.pi/agent/config/pi-task-models.json`.
59
+ | Field | Required | Possible values | Default |
60
+ | --- | --- | --- | --- |
61
+ | `autoSubmit` | No | `true`, `false` — submit the draft question automatically instead of leaving it editable in the side pane | `false` |
62
+ | `tools` | No | `inherit` (parent's active tools), `all`, `read-only` (built-in read-only tools), `none` | `inherit` |
63
+ | `split` | No | `right`, `down` — side-pane placement | `right` |
60
64
 
61
- ## Remove
65
+ All fields are optional; unknown keys and non-object files are rejected. `/btw config show` prints effective values; `/btw config reset` removes the file. Missing config uses defaults; malformed config fails visibly and remains unchanged.
62
66
 
63
- ```bash
64
- pi remove npm:@henryqw/pi-herdr-btw
65
- ```
66
-
67
- ## Development
68
-
69
- ```bash
70
- npm test --workspace @henryqw/pi-herdr-btw
71
- npm run typecheck --workspace @henryqw/pi-herdr-btw
72
- npm run pack:check --workspace @henryqw/pi-herdr-btw
73
- ```
67
+ Shared: `~/.pi/agent/config/pi-task-models.json`, owned by `@henryqw/pi-task-models`. The local `pi-herdr-btw/btw` declaration defaults to `fast`; a task entry is an explicit user override. Side-thread routes resolve before pane launch.
package/extensions/btw.ts CHANGED
@@ -2,7 +2,9 @@ import { randomUUID } from "node:crypto";
2
2
  import type { ExtensionAPI, ExtensionCommandContext, ExtensionContext } from "@earendil-works/pi-coding-agent";
3
3
  import { createHerdrClient, hasHerdrErrorCode, startPiAgent } from "@henryqw/pi-herdr";
4
4
  import {
5
+ registerModelTask,
5
6
  resolveConfiguredTaskRoutes,
7
+ type ModelTask,
6
8
  type ResolvedTaskRoute,
7
9
  type TaskRouteError,
8
10
  } from "@henryqw/pi-task-models";
@@ -49,7 +51,12 @@ import {
49
51
  } from "../internal/merge.ts";
50
52
  import { HELP_TEXT, parseBtwCommand } from "../internal/router.ts";
51
53
 
52
- const BTW_TASK = "pi-herdr-btw/btw";
54
+ export const BTW_TASK = {
55
+ id: "pi-herdr-btw/btw",
56
+ label: "BTW side thread",
57
+ purpose: "Launch an isolated Herdr side thread.",
58
+ defaultProfile: "fast",
59
+ } as const satisfies ModelTask;
53
60
  const CHILD_HEARTBEAT_INTERVAL_MS = 5 * 60 * 1_000;
54
61
  const LITERAL_DRAFT_PREFIX = "\u200b";
55
62
  const MERGE_POLL_INTERVAL_MS = 3_000;
@@ -389,6 +396,7 @@ export async function registerBtwExtension(
389
396
  pi: ExtensionAPI,
390
397
  options: { store?: ContextStorePort; configStore?: ConfigStorePort } = {},
391
398
  ): Promise<void> {
399
+ registerModelTask(pi, BTW_TASK);
392
400
  const store = options.store ?? new ContextStore();
393
401
  // Pi applies extension flag values after factories load, so inspect argv here
394
402
  // while registering the same flag keeps Pi's CLI validation and help intact.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-herdr-btw",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Open and merge tool-enabled Pi side threads in Herdr panes.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@henryqw/pi-herdr": "^0.4.0",
50
- "@henryqw/pi-task-models": "^1.0.0",
50
+ "@henryqw/pi-task-models": "^3.0.0",
51
51
  "proper-lockfile": "^4.1.2"
52
52
  },
53
53
  "devDependencies": {