@alexeiled/pi-fusion 0.2.3 → 0.3.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/package.json +5 -1
- package/skills/fusion-review/SKILL.md +30 -0
- package/src/index.ts +47 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexeiled/pi-fusion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Stronger answers for hard Pi questions via a parallel model panel + judge, built on pi-subagents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"files": [
|
|
23
23
|
"agents/*.md",
|
|
24
|
+
"skills/**/*.md",
|
|
24
25
|
"src/*.ts",
|
|
25
26
|
"docs/user-guide.md"
|
|
26
27
|
],
|
|
@@ -39,6 +40,9 @@
|
|
|
39
40
|
"extensions": [
|
|
40
41
|
"./src/index.ts"
|
|
41
42
|
],
|
|
43
|
+
"skills": [
|
|
44
|
+
"./skills"
|
|
45
|
+
],
|
|
42
46
|
"subagents": {
|
|
43
47
|
"agents": [
|
|
44
48
|
"./agents"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fusion-review
|
|
3
|
+
description: >
|
|
4
|
+
Trigger a pi-fusion multi-model panel review implicitly. Use when the user asks to
|
|
5
|
+
"invoke fusion", "run a fusion panel", "discuss this through fusion", "get multi-model
|
|
6
|
+
opinions", "panel review", or any phrasing that implies running a parallel model review.
|
|
7
|
+
Call the start_fusion_review tool with the user's topic or prompt.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Fusion Review
|
|
11
|
+
|
|
12
|
+
Use the `start_fusion_review` tool to launch a fusion panel without the user needing to type `/fusion`.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
- "invoke fusion panel to discuss this"
|
|
17
|
+
- "run fusion on this"
|
|
18
|
+
- "get a panel review of …"
|
|
19
|
+
- "use multi-model review for …"
|
|
20
|
+
- "discuss this through fusion"
|
|
21
|
+
- Any prompt that implies parallel model review or multi-perspective analysis
|
|
22
|
+
|
|
23
|
+
## How to use
|
|
24
|
+
|
|
25
|
+
Call `start_fusion_review` with:
|
|
26
|
+
|
|
27
|
+
- `prompt` — the topic, question, or code excerpt to review (required)
|
|
28
|
+
- `profile` — a named fusion profile (optional; omit to use the default)
|
|
29
|
+
|
|
30
|
+
The tool queues a `/fusion` command as a follow-up, so the panel starts immediately after the current turn.
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Type } from "typebox";
|
|
2
3
|
import { registerFusionCommands } from "./commands.js";
|
|
3
4
|
import {
|
|
4
5
|
FusionOrchestrator,
|
|
@@ -7,6 +8,51 @@ import {
|
|
|
7
8
|
import { FusionRunStore } from "./run-store.js";
|
|
8
9
|
import { SubagentsRpcClient } from "./subagents-rpc.js";
|
|
9
10
|
|
|
11
|
+
function registerFusionTool(
|
|
12
|
+
pi: ExtensionAPI,
|
|
13
|
+
orchestrator: FusionOrchestrator,
|
|
14
|
+
): void {
|
|
15
|
+
pi.registerTool({
|
|
16
|
+
name: "start_fusion_review",
|
|
17
|
+
label: "Fusion Review",
|
|
18
|
+
description:
|
|
19
|
+
"Start a pi-fusion multi-model panel review. Use when the user asks to invoke fusion, run a panel review, get multi-model opinions, or discuss something through the fusion panel.",
|
|
20
|
+
promptSnippet: "Start a fusion panel review for a topic or code",
|
|
21
|
+
promptGuidelines: [
|
|
22
|
+
"Use start_fusion_review when the user says 'invoke fusion', 'run fusion', 'fusion panel', 'multi-model review', 'panel review', or similar.",
|
|
23
|
+
],
|
|
24
|
+
parameters: Type.Object({
|
|
25
|
+
prompt: Type.String({ description: "What to review or discuss" }),
|
|
26
|
+
profile: Type.Optional(
|
|
27
|
+
Type.String({ description: "Fusion profile name (optional)" }),
|
|
28
|
+
),
|
|
29
|
+
}),
|
|
30
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
31
|
+
const result = await orchestrator.startRun(
|
|
32
|
+
{
|
|
33
|
+
prompt: params.prompt,
|
|
34
|
+
...(params.profile ? { profile: params.profile } : {}),
|
|
35
|
+
},
|
|
36
|
+
ctx,
|
|
37
|
+
);
|
|
38
|
+
const text =
|
|
39
|
+
result.status === "started"
|
|
40
|
+
? "Fusion panel review started. The report will be posted when the panel and judge finish."
|
|
41
|
+
: result.status === "conflict"
|
|
42
|
+
? `A fusion run is already active (${result.activeRunId}). Do not start another; wait for its report.`
|
|
43
|
+
: `Fusion review failed to start: ${result.status === "failed" ? result.error : result.status}`;
|
|
44
|
+
return {
|
|
45
|
+
content: [{ type: "text", text }],
|
|
46
|
+
details: {
|
|
47
|
+
prompt: params.prompt,
|
|
48
|
+
profile: params.profile,
|
|
49
|
+
status: result.status,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
10
56
|
export default function fusionExtension(pi: ExtensionAPI): void {
|
|
11
57
|
const orchestrator = new FusionOrchestrator({
|
|
12
58
|
rpc: new SubagentsRpcClient({ events: pi.events }),
|
|
@@ -15,6 +61,7 @@ export default function fusionExtension(pi: ExtensionAPI): void {
|
|
|
15
61
|
});
|
|
16
62
|
|
|
17
63
|
registerFusionCommands(pi, orchestrator);
|
|
64
|
+
registerFusionTool(pi, orchestrator);
|
|
18
65
|
|
|
19
66
|
const unsubscribeComplete = pi.events.on(
|
|
20
67
|
SUBAGENT_ASYNC_COMPLETE_EVENT,
|