@vanillagreen/pi-qol 1.7.1 → 1.7.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 CHANGED
@@ -64,6 +64,8 @@ Arguments support autocomplete.
64
64
 
65
65
  Open `/extensions:settings`; settings appear under the **QOL** tab. Names below match the labels shown there.
66
66
 
67
+ Project settings in `.pi/settings.json` apply only after Pi marks the workspace trusted; before trust, vstack Pi extensions read user/global settings only.
68
+
67
69
  Glyph style: each package exposes `glyphStyle` (`unicode` default, `ascii` for terminal-safe chrome). `@vanillagreen/pi-tool-renderer.globalGlyphStyleOverride=ascii` forces ASCII chrome across vstack Pi extensions while leaving tool/model/user content unchanged.
68
70
 
69
71
  ### Statusline
@@ -181,7 +183,7 @@ Idle thresholds (token threshold, idle delay, fixed token limit, percent limit)
181
183
 
182
184
  ### Long-session budget guard
183
185
 
184
- For autonomous/Flightdeck-style runs the agent never goes idle, so idle compaction may never fire and the transcript can grow until provider/buffer limits hit. The budget guard runs on `agent_end` (not idle) and starts a compaction immediately when context usage crosses a percent of the model window or an absolute token limit. It fires once per threshold crossing — repeated `agent_end` events above the same threshold do not retrigger it, and the crossing key resets on a successful compaction or on a transient compaction failure (so the next `agent_end` retries).
186
+ For long autonomous runs the agent may not go idle, so idle compaction may never fire and the transcript can grow until provider/buffer limits hit. The budget guard runs on `agent_end` (not idle) and starts a compaction immediately when context usage crosses a percent of the model window or an absolute token limit. It fires once per threshold crossing — repeated `agent_end` events above the same threshold do not retrigger it, and the crossing key resets on a successful compaction or on a transient compaction failure (so the next `agent_end` retries).
185
187
 
186
188
  | Setting | What it does | Default |
187
189
  | --- | --- | --- |
@@ -196,7 +198,7 @@ When the budget guard fires it injects a sentinel into the compaction request so
196
198
 
197
199
  While budget-guard compaction is running, QOL keeps a persistent status line above the prompt (and in the normal status footer when the compact statusline is disabled). After Pi prints the compacted-summary block, the line changes to `QOL budget guard finalizing compaction…` until `ctx.compact()` reports completion, so long reload/finalization gaps do not look frozen.
198
200
 
199
- Recommended values for autonomous/Flightdeck runs:
201
+ Recommended values for long autonomous runs:
200
202
 
201
203
  - Keep **Long-session budget guard** on. Lower **Budget guard percent** to `75` if your provider buffers are tight.
202
204
  - Optionally turn **Custom compaction summaries** on so user-initiated and idle compactions also use the QOL chunked summarizer + handoff artifact. (Budget-guard-triggered compactions always use them regardless of this setting.)
@@ -24,6 +24,7 @@ function styleSlashAutocompleteHints(suggestions: AutocompleteSuggestions | null
24
24
  export function installAutocompleteHintStyling(ctx: ExtensionContext): void {
25
25
  if (!ctx.hasUI) return;
26
26
  ctx.ui.addAutocompleteProvider((current) => ({
27
+ ...current,
27
28
  async getSuggestions(lines, cursorLine, cursorCol, options) {
28
29
  return styleSlashAutocompleteHints(await current.getSuggestions(lines, cursorLine, cursorCol, options), ctx.ui.theme);
29
30
  },
@@ -26,9 +26,44 @@ function projectSettingsPath(cwd: string): string {
26
26
  }
27
27
  }
28
28
 
29
+ const PROJECT_TRUST_SYMBOL = Symbol.for("vstack.pi.project-trust");
30
+
31
+ interface ProjectTrustRegistry {
32
+ projectSettings?: Map<string, boolean>;
33
+ }
34
+
35
+ function projectTrustRegistry(): ProjectTrustRegistry {
36
+ const host = globalThis as unknown as Record<PropertyKey, ProjectTrustRegistry | undefined>;
37
+ const existing = host[PROJECT_TRUST_SYMBOL];
38
+ if (existing) return existing;
39
+ const created: ProjectTrustRegistry = {};
40
+ host[PROJECT_TRUST_SYMBOL] = created;
41
+ return created;
42
+ }
43
+
44
+ export function recordProjectTrust(ctx: { cwd?: string; isProjectTrusted?: () => boolean }): void {
45
+ if (!ctx.cwd) return;
46
+ let trusted = true;
47
+ try {
48
+ trusted = ctx.isProjectTrusted?.() === true;
49
+ } catch {
50
+ trusted = false;
51
+ }
52
+ const registry = projectTrustRegistry();
53
+ if (!registry.projectSettings) registry.projectSettings = new Map();
54
+ registry.projectSettings.set(projectSettingsPath(ctx.cwd), trusted);
55
+ }
56
+
57
+ function projectSettingsTrusted(settingsPath: string): boolean {
58
+ return projectTrustRegistry().projectSettings?.get(settingsPath) === true;
59
+ }
60
+
61
+
29
62
  function piSettingsPaths(cwd = process.cwd()): string[] {
30
63
  const userDir = resolve(expandHome(process.env.PI_CODING_AGENT_DIR?.trim() || "~/.pi/agent"));
31
- return [join(userDir, "settings.json"), projectSettingsPath(cwd)];
64
+ const user = join(userDir, "settings.json");
65
+ const project = projectSettingsPath(cwd);
66
+ return projectSettingsTrusted(project) ? [user, project] : [user];
32
67
  }
33
68
 
34
69
  function readPackageConfig(packageId: string, cwd?: string): Record<string, unknown> {
@@ -23,9 +23,44 @@ export function projectSettingsPath(cwd: string): string {
23
23
  }
24
24
  }
25
25
 
26
+ const PROJECT_TRUST_SYMBOL = Symbol.for("vstack.pi.project-trust");
27
+
28
+ interface ProjectTrustRegistry {
29
+ projectSettings?: Map<string, boolean>;
30
+ }
31
+
32
+ function projectTrustRegistry(): ProjectTrustRegistry {
33
+ const host = globalThis as unknown as Record<PropertyKey, ProjectTrustRegistry | undefined>;
34
+ const existing = host[PROJECT_TRUST_SYMBOL];
35
+ if (existing) return existing;
36
+ const created: ProjectTrustRegistry = {};
37
+ host[PROJECT_TRUST_SYMBOL] = created;
38
+ return created;
39
+ }
40
+
41
+ export function recordProjectTrust(ctx: { cwd?: string; isProjectTrusted?: () => boolean }): void {
42
+ if (!ctx.cwd) return;
43
+ let trusted = true;
44
+ try {
45
+ trusted = ctx.isProjectTrusted?.() === true;
46
+ } catch {
47
+ trusted = false;
48
+ }
49
+ const registry = projectTrustRegistry();
50
+ if (!registry.projectSettings) registry.projectSettings = new Map();
51
+ registry.projectSettings.set(projectSettingsPath(ctx.cwd), trusted);
52
+ }
53
+
54
+ function projectSettingsTrusted(settingsPath: string): boolean {
55
+ return projectTrustRegistry().projectSettings?.get(settingsPath) === true;
56
+ }
57
+
58
+
26
59
  export function piSettingsPaths(cwd = process.cwd()): string[] {
27
60
  const userDir = resolve(expandHome(process.env.PI_CODING_AGENT_DIR?.trim() || "~/.pi/agent"));
28
- return [join(userDir, "settings.json"), projectSettingsPath(cwd)];
61
+ const user = join(userDir, "settings.json");
62
+ const project = projectSettingsPath(cwd);
63
+ return projectSettingsTrusted(project) ? [user, project] : [user];
29
64
  }
30
65
 
31
66
  export function readVstackConfig(cwd?: string): VstackConfig {
package/extensions/qol.ts CHANGED
@@ -67,7 +67,7 @@ import {
67
67
  runSessionSearchResumeOrFork,
68
68
  sessionSearchShortcut,
69
69
  } from "./qol/session-search/index.js";
70
- import { settingBoolean, settingNumber, settingString } from "./qol/settings.js";
70
+ import { recordProjectTrust, settingBoolean, settingNumber, settingString } from "./qol/settings.js";
71
71
  import { statusMessage } from "./qol/status-message.js";
72
72
  import {
73
73
  formatTmuxSessionTitle,
@@ -560,6 +560,7 @@ export default function qol(pi: ExtensionAPI): void {
560
560
  });
561
561
 
562
562
  pi.on("session_start", (event, ctx) => {
563
+ recordProjectTrust(ctx);
563
564
  currentCtx = ctx;
564
565
  subscribeCavemanBridge();
565
566
  latestSystemPromptOptions = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanillagreen/pi-qol",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Pi quality-of-life extension: compact statusline/π prompt, reliable multiline input, styled pasted-image chips, session naming/search/context import, scheduled prompts, handoff, permission prompts, notifications, custom compaction, and a collapsed-thinking timer.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -875,7 +875,7 @@
875
875
  {
876
876
  "key": "compaction.budgetGuardEnabled",
877
877
  "label": "Long-session budget guard",
878
- "description": "Trigger compaction on agent_end (no idle wait) when context usage crosses budgetPercent or budgetTokens. Designed for autonomous/Flightdeck runs so transcript growth cannot silently hit provider/buffer limits. Fires once per threshold crossing, not in a loop.",
878
+ "description": "Trigger compaction on agent_end (no idle wait) when context usage crosses budgetPercent or budgetTokens. Designed for long autonomous runs so transcript growth cannot silently hit provider/buffer limits. Fires once per threshold crossing, not in a loop.",
879
879
  "type": "boolean",
880
880
  "default": true,
881
881
  "category": "Compaction Budget Guard",