@henryqw/pi-herdr-btw 1.1.4 → 1.1.6

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
@@ -15,7 +15,7 @@ pi install npm:@henryqw/pi-task-models
15
15
  pi install npm:@henryqw/pi-herdr-btw
16
16
  ```
17
17
 
18
- Requires Pi Coding Agent 0.84.2+, Herdr 0.7.4+, and a Herdr-managed pane.
18
+ Requires Pi Coding Agent 0.84.3+, Herdr 0.7.4+, and a Herdr-managed pane.
19
19
 
20
20
  ## With
21
21
 
@@ -1,4 +1,4 @@
1
- import { chmod, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
1
+ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
2
2
  import { dirname, join } from "node:path";
3
3
  import { getAgentDir } from "@earendil-works/pi-coding-agent";
4
4
  import { lock } from "proper-lockfile";
@@ -138,8 +138,6 @@ export class ConfigStore {
138
138
  }
139
139
 
140
140
  private async saveUnlocked(validated: BtwConfig): Promise<void> {
141
- const directory = dirname(this.path);
142
- await mkdir(directory, { recursive: true, mode: 0o700 });
143
141
  const temporaryPath = `${this.path}.${process.pid}.${Date.now()}.tmp`;
144
142
  try {
145
143
  await writeFile(temporaryPath, `${JSON.stringify(validated, null, 2)}\n`, {
@@ -147,7 +145,6 @@ export class ConfigStore {
147
145
  flag: "wx",
148
146
  mode: 0o600,
149
147
  });
150
- await chmod(temporaryPath, 0o600);
151
148
  await rename(temporaryPath, this.path);
152
149
  } catch (error) {
153
150
  await rm(temporaryPath, { force: true }).catch(() => undefined);
@@ -78,7 +78,6 @@ export class ContextStore {
78
78
  flag: "wx",
79
79
  mode: 0o600,
80
80
  });
81
- await chmod(payloadPath, 0o600);
82
81
  return payloadPath;
83
82
  } catch (error) {
84
83
  await rm(launchDir, { recursive: true, force: true }).catch(() => undefined);
@@ -88,7 +87,6 @@ export class ContextStore {
88
87
 
89
88
  async read(payloadPath: string): Promise<BtwPayload> {
90
89
  const canonicalPath = await this.validateLaunchFile(payloadPath, PAYLOAD_FILE);
91
- if (!canonicalPath) throw new Error(`Missing /btw context payload: ${payloadPath}`);
92
90
  const parsed: unknown = JSON.parse(await readFile(canonicalPath, "utf8"));
93
91
  if (!isBtwPayload(parsed)) {
94
92
  throw new Error("Invalid or unsupported /btw context payload");
@@ -204,7 +202,6 @@ export class ContextStore {
204
202
  flag: "wx",
205
203
  mode: 0o600,
206
204
  });
207
- await chmod(temporaryPath, 0o600);
208
205
  await rename(temporaryPath, targetPath);
209
206
  } catch (error) {
210
207
  await rm(temporaryPath, { force: true }).catch(() => undefined);
@@ -218,6 +215,8 @@ export class ContextStore {
218
215
  return JSON.parse(await readFile(canonicalPath, "utf8")) as unknown;
219
216
  }
220
217
 
218
+ private validateLaunchFile(payloadPath: string, fileName: typeof PAYLOAD_FILE): Promise<string>;
219
+ private validateLaunchFile(payloadPath: string, fileName: string): Promise<string | undefined>;
221
220
  private async validateLaunchFile(
222
221
  payloadPath: string,
223
222
  fileName: string,
package/internal/core.ts CHANGED
@@ -249,13 +249,13 @@ export function buildParentContextMessage(contextDocument: string): AgentMessage
249
249
  * here, after the reusable parent prefix, so the system prompt and parent
250
250
  * messages stay byte-identical to the parent's own requests.
251
251
  */
252
- export function buildNativeBridgeMessage(instructions: string, draftHint?: string): AgentMessage {
252
+ export function buildNativeBridgeMessage(instructions: string): AgentMessage {
253
253
  return {
254
254
  role: "user",
255
255
  content: [
256
256
  {
257
257
  type: "text",
258
- text: `The conversation above is a read-only snapshot of the parent session, replayed as reference context for this side conversation. It is not new work to continue.\n\n${instructions}${draftHint ? `\n\n${draftHint}` : ""}`,
258
+ text: `The conversation above is a read-only snapshot of the parent session, replayed as reference context for this side conversation. It is not new work to continue.\n\n${instructions}`,
259
259
  },
260
260
  ],
261
261
  timestamp: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-herdr-btw",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Open and merge tool-enabled Pi side threads in Herdr panes.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -26,8 +26,8 @@
26
26
  "pack:check": "npm pack --dry-run"
27
27
  },
28
28
  "peerDependencies": {
29
- "@earendil-works/pi-agent-core": "^0.84.2",
30
- "@earendil-works/pi-coding-agent": "^0.84.2"
29
+ "@earendil-works/pi-agent-core": "^0.84.3",
30
+ "@earendil-works/pi-coding-agent": "^0.84.3"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@henryqw/pi-herdr": "^0.3.0",
50
- "@henryqw/pi-task-models": "^0.7.0",
50
+ "@henryqw/pi-task-models": "^1.0.0",
51
51
  "proper-lockfile": "^4.1.2"
52
52
  },
53
53
  "devDependencies": {