@ian-pascoe/pi-advisor 0.3.4 → 0.3.5
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 +1 -1
- package/package.json +1 -1
- package/src/advisor-session.ts +7 -1
- package/src/index.ts +2 -0
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ Consultation authorizes analysis and investigation, not implementation or other
|
|
|
54
54
|
| Findings per Review | 4 |
|
|
55
55
|
| Automatic Corrective Turns | 1 per request/task |
|
|
56
56
|
|
|
57
|
-
A Tool Grant names tools; it does not sandbox their full native interfaces. Explicitly granting `lsp`, for example, permits its native operations, including mutations. Unavailable names are ignored and reported. Advisor never autogrants missing tools. Granting `codemode` lets the Advisor script its other granted tools; it inherits the observed `codemode.mode`, so under `"only"` the Advisor calls `advisor_report` from a script.
|
|
57
|
+
A Tool Grant names tools; it does not sandbox their full native interfaces. Explicitly granting `lsp`, for example, permits its native operations, including mutations. Unavailable names are ignored and reported. Advisor never autogrants missing tools. Granting `codemode` lets the Advisor script its other granted tools; it inherits the observed `codemode.mode`, so under `"only"` the Advisor calls `advisor_report` from a script. It also inherits whether scripts get the `models` API: Minimal Subagents Child Agents have none, so neither do their Advisors.
|
|
58
58
|
|
|
59
59
|
The Advisor inherits each observed agent's model and thinking level independently unless configured otherwise. One root policy can cover current and future Minimal Subagents descendants when enabled.
|
|
60
60
|
|
package/package.json
CHANGED
package/src/advisor-session.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface AdvisorResourceInputs {
|
|
|
31
31
|
readonly hidden?: boolean | undefined;
|
|
32
32
|
}[];
|
|
33
33
|
flagValues: ReadonlyMap<string, boolean | string>;
|
|
34
|
+
/** Whether the owner's built-in codemode gives scripts the `models` API; Pi's default is true. */
|
|
35
|
+
codemodeModels?: boolean | undefined;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
/** Fresh factories and native services; the observed session supplies data, never bound handlers. */
|
|
@@ -228,9 +230,13 @@ async function buildAdvisorSession(
|
|
|
228
230
|
`Unsupported Advisor resources: this Pi runtime does not export ${factoryExport} to recreate ${extension.path}`,
|
|
229
231
|
);
|
|
230
232
|
recreated.add(index);
|
|
233
|
+
const codemodeModels = options.resourceInputs?.codemodeModels;
|
|
231
234
|
builtins.push({
|
|
232
235
|
name,
|
|
233
|
-
factory:
|
|
236
|
+
factory:
|
|
237
|
+
name === "codemode" && codemodeModels !== undefined
|
|
238
|
+
? piSdk.createCodemodeExtension({ models: codemodeModels })
|
|
239
|
+
: create(),
|
|
234
240
|
builtin: true,
|
|
235
241
|
replaceable: extension.replaceable === true,
|
|
236
242
|
});
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ const childRequestSchema = Type.Object({
|
|
|
40
40
|
agentDir: Type.String({ minLength: 1 }),
|
|
41
41
|
extensions: Type.Array(Type.Unknown()),
|
|
42
42
|
flagValues: Type.Unknown(),
|
|
43
|
+
codemodeModels: Type.Optional(Type.Boolean()),
|
|
43
44
|
}),
|
|
44
45
|
});
|
|
45
46
|
|
|
@@ -246,6 +247,7 @@ export default function advisor(pi: ExtensionAPI): void {
|
|
|
246
247
|
agentDir: payload.resourceInputs.agentDir,
|
|
247
248
|
extensions,
|
|
248
249
|
flagValues: new Map(resources.runtime.flagValues),
|
|
250
|
+
codemodeModels: payload.resourceInputs.codemodeModels,
|
|
249
251
|
},
|
|
250
252
|
observer: undefined,
|
|
251
253
|
};
|