@howaboua/pi-shepherdr 0.2.14 → 0.2.15
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/CHANGELOG.md +4 -0
- package/package.json +3 -3
- package/src/board/host.ts +14 -1
- package/src/messages.ts +55 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @howaboua/pi-shepherdr
|
|
2
2
|
|
|
3
|
+
## 0.2.15
|
|
4
|
+
|
|
5
|
+
- Show a quiet, theme-aware notice with the channel name after an agent successfully posts to the board. Notices remain visible in restored history without adding model context.
|
|
6
|
+
|
|
3
7
|
## 0.2.14
|
|
4
8
|
|
|
5
9
|
- Delegated agents keep reporting after task completion, including follow-up work.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-shepherdr",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"description": "Persistent blocking and asynchronous Pi agents through Herdr.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"pack:dry": "npm pack --dry-run"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@howaboua/pi-codex-conversion": ">=3.0.
|
|
46
|
+
"@howaboua/pi-codex-conversion": ">=3.0.47",
|
|
47
47
|
"@earendil-works/pi-ai": ">=1.0.0",
|
|
48
48
|
"@earendil-works/pi-coding-agent": ">=1.0.0",
|
|
49
49
|
"@earendil-works/pi-tui": ">=1.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"unicode-case-folding": "1.1.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@howaboua/pi-codex-conversion": "3.0.
|
|
61
|
+
"@howaboua/pi-codex-conversion": "3.0.47",
|
|
62
62
|
"@biomejs/biome": "^2.5.10",
|
|
63
63
|
"@earendil-works/pi-ai": "1.0.4",
|
|
64
64
|
"@earendil-works/pi-coding-agent": "1.0.4",
|
package/src/board/host.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
} from "@earendil-works/pi-coding-agent";
|
|
6
6
|
import type { AgentFleet, ConnectedMachine } from "../fleet.js";
|
|
7
7
|
import { sessionPath } from "../herdr.js";
|
|
8
|
+
import { recordBoardPostMarker } from "../messages.js";
|
|
8
9
|
import {
|
|
9
10
|
requestContext,
|
|
10
11
|
sessionContextPath,
|
|
@@ -195,7 +196,7 @@ export class AgentBoard {
|
|
|
195
196
|
throw new Error(
|
|
196
197
|
"Board is off; the user can enable it in /herdr → Settings",
|
|
197
198
|
);
|
|
198
|
-
|
|
199
|
+
const value = await this.toOwner(
|
|
199
200
|
ctx,
|
|
200
201
|
{
|
|
201
202
|
operation: "board-call",
|
|
@@ -205,6 +206,18 @@ export class AgentBoard {
|
|
|
205
206
|
},
|
|
206
207
|
ctx.signal,
|
|
207
208
|
);
|
|
209
|
+
if (params.action === "post") {
|
|
210
|
+
try {
|
|
211
|
+
recordBoardPostMarker(this.pi, ctx, value);
|
|
212
|
+
} catch {
|
|
213
|
+
// Presentation failure must not turn a committed post into a retry.
|
|
214
|
+
ctx.ui.notify(
|
|
215
|
+
"Posted to board. Its history notice is unavailable. Read the board to check the post; do not repost.",
|
|
216
|
+
"warning",
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return value;
|
|
208
221
|
}
|
|
209
222
|
async prepare(
|
|
210
223
|
ctx: ExtensionContext,
|
package/src/messages.ts
CHANGED
|
@@ -22,6 +22,42 @@ import type {
|
|
|
22
22
|
} from "./types.js";
|
|
23
23
|
|
|
24
24
|
const AGENT_EVENT_MESSAGE_TYPE = "herdr-agent-event";
|
|
25
|
+
const BOARD_POST_MARKER = "shepherdr-board-post-marker";
|
|
26
|
+
|
|
27
|
+
export function recordBoardPostMarker(
|
|
28
|
+
pi: ExtensionAPI,
|
|
29
|
+
ctx: ExtensionContext,
|
|
30
|
+
value: unknown,
|
|
31
|
+
): void {
|
|
32
|
+
if (
|
|
33
|
+
!value ||
|
|
34
|
+
typeof value !== "object" ||
|
|
35
|
+
!("message_id" in value) ||
|
|
36
|
+
typeof value.message_id !== "string" ||
|
|
37
|
+
!("channel_name" in value) ||
|
|
38
|
+
typeof value.channel_name !== "string"
|
|
39
|
+
)
|
|
40
|
+
return;
|
|
41
|
+
if (
|
|
42
|
+
ctx.sessionManager
|
|
43
|
+
.getBranch()
|
|
44
|
+
.some(
|
|
45
|
+
(entry) =>
|
|
46
|
+
entry.type === "custom" &&
|
|
47
|
+
entry.customType === BOARD_POST_MARKER &&
|
|
48
|
+
entry.data &&
|
|
49
|
+
typeof entry.data === "object" &&
|
|
50
|
+
"messageId" in entry.data &&
|
|
51
|
+
entry.data.messageId === value.message_id,
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
return;
|
|
55
|
+
// Owner acknowledgements reach the sender here, never the subscription inbox.
|
|
56
|
+
pi.appendEntry(BOARD_POST_MARKER, {
|
|
57
|
+
messageId: value.message_id,
|
|
58
|
+
channelName: value.channel_name,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
25
61
|
const REALTIME_VOICE_PROMPT_CHANNEL =
|
|
26
62
|
"@howaboua/pi-codex-conversion/realtime-voice-prompt/v1";
|
|
27
63
|
const MAX_REALTIME_VOICE_PROMPT_BYTES = 8 * 1_024;
|
|
@@ -512,6 +548,25 @@ export function injectAgentEvent(
|
|
|
512
548
|
}
|
|
513
549
|
|
|
514
550
|
export function registerAgentEventRenderer(pi: ExtensionAPI): void {
|
|
551
|
+
pi.registerEntryRenderer(BOARD_POST_MARKER, (entry, _options, theme) => {
|
|
552
|
+
const data = entry.data;
|
|
553
|
+
const name =
|
|
554
|
+
data &&
|
|
555
|
+
typeof data === "object" &&
|
|
556
|
+
"channelName" in data &&
|
|
557
|
+
typeof data.channelName === "string" &&
|
|
558
|
+
data.channelName.trim()
|
|
559
|
+
? data.channelName.replace(/[\r\n\t\x00-\x1f\x7f]/g, " ")
|
|
560
|
+
: "Board";
|
|
561
|
+
return new Text(
|
|
562
|
+
theme.style(`Posted to board · ${name}`, {
|
|
563
|
+
fg: "syntaxString",
|
|
564
|
+
dim: true,
|
|
565
|
+
}),
|
|
566
|
+
0,
|
|
567
|
+
0,
|
|
568
|
+
);
|
|
569
|
+
});
|
|
515
570
|
pi.registerMessageRenderer<AgentEventDetails>(
|
|
516
571
|
AGENT_EVENT_MESSAGE_TYPE,
|
|
517
572
|
(message, { expanded, outputPad }, theme) => {
|