@d3ara1n/pi-scout 1.0.0 → 1.0.2
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 +2 -3
- package/package.json +1 -1
- package/src/config.ts +1 -2
- package/src/index.ts +4 -2
package/README.md
CHANGED
|
@@ -50,10 +50,9 @@ before_agent_start hook fires
|
|
|
50
50
|
└─ [model-router] Switches model if a different role is recommended
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## Dependencies
|
|
54
54
|
|
|
55
|
-
-
|
|
56
|
-
- A cheap role must be defined in `modelRoles` configuration or use the default (may be much more expensive) instead
|
|
55
|
+
- [`@d3ara1n/pi-model-roles`](../pi-model-roles) — model role resolution
|
|
57
56
|
|
|
58
57
|
## Installation
|
|
59
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d3ara1n/pi-scout",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Per-turn side agent decision framework for pi — uses a cheap model to select skills and route models before each conversation turn",
|
|
6
6
|
"main": "src/index.ts",
|
package/src/config.ts
CHANGED
|
@@ -21,8 +21,7 @@ function readSettingsFile(filePath: string): any {
|
|
|
21
21
|
try {
|
|
22
22
|
if (!fs.existsSync(filePath)) return {};
|
|
23
23
|
const content = fs.readFileSync(filePath, "utf-8");
|
|
24
|
-
|
|
25
|
-
return JSON.parse(stripped);
|
|
24
|
+
return JSON.parse(content);
|
|
26
25
|
} catch {
|
|
27
26
|
return {};
|
|
28
27
|
}
|
package/src/index.ts
CHANGED
|
@@ -219,10 +219,12 @@ export default function scoutExtension(pi: ExtensionAPI) {
|
|
|
219
219
|
.map((s: any) => `- ${s.name}: ${s.description ?? "(no description)"}`)
|
|
220
220
|
.join("\n");
|
|
221
221
|
|
|
222
|
-
// 2. Determine current role
|
|
222
|
+
// 2. Determine current role (use getCurrentRole: it recognizes the
|
|
223
|
+
// default role even when model=null, so the router has a real
|
|
224
|
+
// baseline instead of an opaque "unknown".)
|
|
223
225
|
const currentModel = ctx.model;
|
|
224
226
|
const currentRole = currentModel
|
|
225
|
-
? (rolesApi.
|
|
227
|
+
? (rolesApi.getCurrentRole(`${currentModel.provider}/${currentModel.id}`) ?? "unknown")
|
|
226
228
|
: "unknown";
|
|
227
229
|
|
|
228
230
|
// 3. Build roles list
|