pi-local-agents-only 0.1.19 → 0.1.20
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 +5 -0
- package/extensions/local-agents-only.js +12 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.20 - 2026-06-15
|
|
6
|
+
|
|
7
|
+
- updated the local pi development baseline to `@earendil-works/pi-coding-agent` `0.79.4` and refreshed the npm lockfile
|
|
8
|
+
- validated project-trust no-UI/global-block stripping behavior and package load under pi `0.79.4`
|
|
9
|
+
|
|
5
10
|
## 0.1.19 - 2026-06-04
|
|
6
11
|
|
|
7
12
|
- updated the local pi development baseline to `@earendil-works/pi-coding-agent` `0.78.1` and regenerated the npm lockfile
|
|
@@ -428,12 +428,18 @@ const applyLocalOnlyPrompt = (prompt, agentDir = getAgentDir(), systemPromptOpti
|
|
|
428
428
|
return notice ? `${stripped}\n\n${notice}` : stripped;
|
|
429
429
|
};
|
|
430
430
|
|
|
431
|
+
/** @param {ExtensionContext} ctx */
|
|
432
|
+
const isProjectTrusted = (ctx) => typeof ctx.isProjectTrusted === "function" ? ctx.isProjectTrusted() : true;
|
|
433
|
+
|
|
434
|
+
/** @param {ExtensionContext} ctx */
|
|
435
|
+
const getTrustedMode = (ctx) => getMode(ctx.cwd, undefined, undefined, { projectTrusted: isProjectTrusted(ctx) });
|
|
436
|
+
|
|
431
437
|
/** @param {ExtensionContext} ctx */
|
|
432
438
|
const setStatus = (ctx) => {
|
|
433
439
|
if (!ctx.hasUI) {
|
|
434
440
|
return;
|
|
435
441
|
}
|
|
436
|
-
const mode =
|
|
442
|
+
const mode = getTrustedMode(ctx);
|
|
437
443
|
ctx.ui.setStatus(COMMAND, mode.enabled ? `AGENTS: local-only (${mode.source})` : undefined);
|
|
438
444
|
};
|
|
439
445
|
|
|
@@ -497,15 +503,16 @@ export function findProjectRoot(start = process.cwd()) {
|
|
|
497
503
|
* @param {string | ProjectState} [start]
|
|
498
504
|
* @param {string | undefined} [envValue]
|
|
499
505
|
* @param {string} [configPath]
|
|
506
|
+
* @param {{ projectTrusted?: boolean }} [options]
|
|
500
507
|
* @returns {Mode}
|
|
501
508
|
*/
|
|
502
|
-
export function getMode(start = process.cwd(), envValue = process.env.PI_LOCAL_AGENTS_ONLY, configPath = CONFIG()) {
|
|
509
|
+
export function getMode(start = process.cwd(), envValue = process.env.PI_LOCAL_AGENTS_ONLY, configPath = CONFIG(), options = {}) {
|
|
503
510
|
const state = typeof start === "string" ? getProjectState(start) : start;
|
|
504
511
|
const envToggle = getEnvToggle(envValue);
|
|
505
512
|
if (envToggle !== undefined) {
|
|
506
513
|
return { enabled: envToggle, source: "env" };
|
|
507
514
|
}
|
|
508
|
-
if (hasMarker(state)) {
|
|
515
|
+
if (options.projectTrusted !== false && hasMarker(state)) {
|
|
509
516
|
return { enabled: true, source: "marker" };
|
|
510
517
|
}
|
|
511
518
|
const { projects, repositories } = readConfig(configPath);
|
|
@@ -576,7 +583,7 @@ export default function localAgentsOnly(pi) {
|
|
|
576
583
|
return;
|
|
577
584
|
}
|
|
578
585
|
case "status": {
|
|
579
|
-
const mode = getMode(state);
|
|
586
|
+
const mode = getMode(state, undefined, undefined, { projectTrusted: isProjectTrusted(ctx) });
|
|
580
587
|
ctx.ui.notify(
|
|
581
588
|
`local-agents-only: ${mode.enabled ? `enabled via ${mode.source}` : "disabled"} (${state.projectRoot})`,
|
|
582
589
|
"info",
|
|
@@ -600,7 +607,7 @@ export default function localAgentsOnly(pi) {
|
|
|
600
607
|
});
|
|
601
608
|
|
|
602
609
|
pi.on("before_agent_start", (event, ctx) => {
|
|
603
|
-
return
|
|
610
|
+
return getTrustedMode(ctx).enabled
|
|
604
611
|
? { systemPrompt: applyLocalOnlyPrompt(event.systemPrompt, getAgentDir(), event.systemPromptOptions) }
|
|
605
612
|
: undefined;
|
|
606
613
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-local-agents-only",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "Pi extension that strips global AGENTS.md and CLAUDE.md from the effective prompt for selected projects.",
|
|
5
5
|
"author": "Mitch Fultz (https://github.com/fitchmultz)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"prepublishOnly": "npm run check"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@earendil-works/pi-coding-agent": "
|
|
40
|
+
"@earendil-works/pi-coding-agent": "0.79.4",
|
|
41
41
|
"@types/node": "^25.9.1",
|
|
42
42
|
"typescript": "^6.0.3"
|
|
43
43
|
},
|