pi-bro 0.13.2 → 0.14.0
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 +13 -0
- package/README.md +109 -8
- package/bro.ts +1261 -37
- package/package.json +4 -3
- package/prompt.ts +29 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-bro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "An Earendil Pi extension that explains pasted text, assistant responses, local documents, public webpages, and recent session turns (as shapes) in a context-isolated window, and opens a sandboxed side conversation with /bro btw.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
63
|
-
"@earendil-works/pi-tui": ">=0.
|
|
62
|
+
"@earendil-works/pi-coding-agent": ">=0.84.2 <1",
|
|
63
|
+
"@earendil-works/pi-tui": ">=0.84.2 <1"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"defuddle": "0.19.2",
|
|
73
73
|
"linkedom": "0.18.13",
|
|
74
74
|
"mammoth": "^1.12.1",
|
|
75
|
+
"typebox": "1.3.7",
|
|
75
76
|
"unpdf": "^1.8.1"
|
|
76
77
|
}
|
|
77
78
|
}
|
package/prompt.ts
CHANGED
|
@@ -71,3 +71,32 @@ export function buildBtwPrompt(context: string | undefined, question: string): s
|
|
|
71
71
|
: "";
|
|
72
72
|
return `You are answering a side question in the pi-bro extension, separate from the main agent conversation. Answer directly and concisely.${seed}\n\nQuestion:\n${question}`;
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
// The advisor tool: a fresh, standalone Agy consultation the executor agent voluntarily calls
|
|
76
|
+
// mid-task. Four sections are labeled and kept structurally separate so a fresh Agy process can
|
|
77
|
+
// tell exactly what kind of claim each part is -- a human priority, an unverified snapshot of the
|
|
78
|
+
// executor's own session, an optional question, and Bro's own role instructions -- never blurred
|
|
79
|
+
// into one undifferentiated blob. See docs/plans/2026-09-19-bro-advisor-design.md.
|
|
80
|
+
export function buildAdvisorPrompt(steering: string, snapshot: string, question: string | undefined): string {
|
|
81
|
+
const steeringSection = steering.trim()
|
|
82
|
+
? `## Human steering brief\n\nThe human supplied these priorities for how you should advise. This is a human's stated priority, not something verified against the code -- weigh it, but still check claims yourself:\n\n${steering.trim()}`
|
|
83
|
+
: "## Human steering brief\n\nNone was set.";
|
|
84
|
+
const questionSection = question?.trim()
|
|
85
|
+
? `## Executor's question\n\n${question.trim()}`
|
|
86
|
+
: "## Executor's question\n\nNone was given. Use your own judgment about what advice would help most, given the snapshot below.";
|
|
87
|
+
return `You are the Bro advisor: a separate Agy process an executor coding agent voluntarily consulted mid-task, in the pi-bro Pi extension. You have real tool access in this workspace and are running with permissions auto-approved (--dangerously-skip-permissions) -- you can freely read files, search, and run read-oriented commands to verify claims. Investigate before advising: do not just restate what the snapshot below reports as true.
|
|
88
|
+
|
|
89
|
+
Your job is strictly advisory. Return findings and recommendations in your reply; do not edit files or otherwise implement the change yourself -- the executor remains responsible for implementation.
|
|
90
|
+
|
|
91
|
+
${steeringSection}
|
|
92
|
+
|
|
93
|
+
## Context snapshot from the executor's session
|
|
94
|
+
|
|
95
|
+
This is background/evidence captured from the executor's own conversation. It is the executor's own account of what happened, not independently verified by you -- treat it as a starting point to check, not as ground truth:
|
|
96
|
+
|
|
97
|
+
${snapshot}
|
|
98
|
+
|
|
99
|
+
${questionSection}
|
|
100
|
+
|
|
101
|
+
Begin with a one-line answer or verdict. Then give concise findings, evidence, and recommended next actions grounded in what you verified yourself in the workspace. Omit investigation narration, waiting updates, and progress reports.`;
|
|
102
|
+
}
|