@phi-code-admin/phi-code 0.61.11 โ 0.62.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.
|
@@ -477,40 +477,35 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
|
|
|
477
477
|
const specFile = `spec-${ts}.md`;
|
|
478
478
|
await writeFile(join(plansDir, specFile), `# ${description}\n\n**Created:** ${new Date().toLocaleString()}\n`, "utf-8");
|
|
479
479
|
|
|
480
|
-
ctx.ui.notify(`๐
|
|
481
|
-
|
|
482
|
-
//
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
} catch {
|
|
508
|
-
pi.sendUserMessage(phase.instruction + systemPromptNote, { deliverAs: "followUp" });
|
|
509
|
-
}
|
|
510
|
-
await ctx.waitForIdle();
|
|
511
|
-
}
|
|
480
|
+
ctx.ui.notify(`๐ Executing project with agent workflow...`, "info");
|
|
481
|
+
|
|
482
|
+
// Build a single comprehensive prompt with all agent phases
|
|
483
|
+
const prompt = `# Project: ${description}
|
|
484
|
+
|
|
485
|
+
## Your workflow (follow these phases in order):
|
|
486
|
+
|
|
487
|
+
### Phase 1 โ ๐ EXPLORE
|
|
488
|
+
Analyze the project requirements and any existing codebase. List what exists, what's needed, and constraints.
|
|
489
|
+
|
|
490
|
+
### Phase 2 โ ๐ PLAN
|
|
491
|
+
Design the architecture, file structure, and tech choices. Be specific about file names and structure.
|
|
492
|
+
|
|
493
|
+
### Phase 3 โ ๐ป CODE
|
|
494
|
+
Implement EVERYTHING. Create ALL files with complete, production-quality code. No placeholders, no TODOs, no "implement later". Every file must be fully functional.
|
|
495
|
+
|
|
496
|
+
### Phase 4 โ ๐งช TEST
|
|
497
|
+
Run the code. Verify it works. Fix any errors you find.
|
|
498
|
+
|
|
499
|
+
### Phase 5 โ ๐ REVIEW
|
|
500
|
+
Check code quality. Fix any issues. Ensure everything is polished.
|
|
501
|
+
|
|
502
|
+
## Rules
|
|
503
|
+
- Complete ALL 5 phases in this turn
|
|
504
|
+
- Create every file needed for a working project
|
|
505
|
+
- Announce each phase as you start it (e.g. "## Phase 1 โ Exploring...")
|
|
506
|
+
- Do NOT stop after planning โ implement everything`;
|
|
512
507
|
|
|
513
|
-
ctx.ui.
|
|
508
|
+
ctx.ui.pasteToEditor(prompt);
|
|
514
509
|
},
|
|
515
510
|
});
|
|
516
511
|
|
|
@@ -80,13 +80,29 @@ export default function smartRouterExtension(pi: ExtensionAPI) {
|
|
|
80
80
|
const recommendation = router.getRecommendation(event.text);
|
|
81
81
|
|
|
82
82
|
if (recommendation.category !== "general") {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
// Find the recommended model in the registry
|
|
84
|
+
const available = ctx.modelRegistry?.getAvailable?.() || [];
|
|
85
|
+
const targetModel = available.find((m: any) => m.id === recommendation.model);
|
|
86
|
+
const fallbackRoute = (router as any).config?.routes?.[recommendation.category];
|
|
87
|
+
const fallbackModel = fallbackRoute?.fallback
|
|
88
|
+
? available.find((m: any) => m.id === fallbackRoute.fallback)
|
|
89
|
+
: undefined;
|
|
90
|
+
|
|
91
|
+
const modelToUse = targetModel || fallbackModel;
|
|
92
|
+
|
|
93
|
+
if (modelToUse && modelToUse.id !== ctx.model?.id) {
|
|
94
|
+
// Actually switch the model
|
|
95
|
+
const switched = await pi.setModel(modelToUse);
|
|
96
|
+
if (switched && extConfig.notifyOnRecommendation) {
|
|
97
|
+
ctx.ui.notify(
|
|
98
|
+
`๐ ${recommendation.category} โ \`${modelToUse.id}\`${modelToUse.id !== recommendation.model ? ` (fallback)` : ""}`,
|
|
99
|
+
"info"
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
} else if (extConfig.notifyOnRecommendation && !modelToUse) {
|
|
103
|
+
// Model not available โ just notify
|
|
88
104
|
ctx.ui.notify(
|
|
89
|
-
`๐ ${recommendation.category} โ \`${recommendation.model}
|
|
105
|
+
`๐ ${recommendation.category} โ \`${recommendation.model}\` (not available, keeping current)`,
|
|
90
106
|
"info"
|
|
91
107
|
);
|
|
92
108
|
}
|