@vanillagreen/pi-qol 1.7.2 → 1.7.3

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
@@ -85,8 +85,8 @@ Glyph style: each package exposes `glyphStyle` (`unicode` default, `ascii` for t
85
85
 
86
86
  | Setting | What it does |
87
87
  | --- | --- |
88
- | Newline-insert binding | Insert a newline instead of submitting. |
89
- | Fallback newline binding | Alternate binding for terminals that can't send the primary one. |
88
+ | shift+enter inserts newline | Insert a newline instead of submitting. |
89
+ | Fallback newline key | Alternate binding for terminals that can't send the primary one. |
90
90
  | Style pending queue preview | Highlight Pi's pending-queue preview with a green left bar. |
91
91
  | Style image chips | Render `[Image #N]` placeholders as distinct chips. |
92
92
  | Show attachment count | Show a status badge when the draft has image placeholders. |
@@ -1,5 +1,6 @@
1
1
  import type { AgentMessage } from "@earendil-works/pi-agent-core";
2
- import { complete, type Message } from "@earendil-works/pi-ai";
2
+ import type { Message } from "@earendil-works/pi-ai";
3
+ import { complete } from "./pi-ai-compat.js";
3
4
  import { convertToLlm, serializeConversation, type ExtensionContext } from "@earendil-works/pi-coding-agent";
4
5
  import {
5
6
  DEFAULT_BUDGET_GUARD_PERCENT,
@@ -1,5 +1,6 @@
1
1
  import type { AgentMessage } from "@earendil-works/pi-agent-core";
2
- import { complete, type Message } from "@earendil-works/pi-ai";
2
+ import type { Message } from "@earendil-works/pi-ai";
3
+ import { complete } from "./pi-ai-compat.js";
3
4
  import { BorderedLoader, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
4
5
  import { acquireVstackModalLock } from "./bridges.js";
5
6
  import { serializeMessagesForSummary } from "./compaction.js";
@@ -0,0 +1,15 @@
1
+ import * as piAi from "@earendil-works/pi-ai";
2
+
3
+ const dynamicImport = (specifier: string) => import(specifier);
4
+
5
+ export interface PiAiCompatDeps {
6
+ root?: any;
7
+ loadCompat?: () => Promise<any>;
8
+ }
9
+
10
+ export async function complete(model: unknown, context: unknown, options?: unknown, deps: PiAiCompatDeps = {}): Promise<any> {
11
+ const rootComplete = (deps.root ?? piAi as any).complete;
12
+ if (typeof rootComplete === "function") return await rootComplete(model, context, options);
13
+ const compat = deps.loadCompat ? await deps.loadCompat() : await dynamicImport("@earendil-works/pi-ai/compat") as any;
14
+ return await compat.complete(model, context, options);
15
+ }
@@ -1,4 +1,5 @@
1
- import { complete, type Message } from "@earendil-works/pi-ai";
1
+ import type { Message } from "@earendil-works/pi-ai";
2
+ import { complete } from "./pi-ai-compat.js";
2
3
  import type { ExtensionContext, SessionEntry } from "@earendil-works/pi-coding-agent";
3
4
  import { textFromContent } from "./agent-end.js";
4
5
  import { oneLine } from "./ansi.js";
@@ -39,17 +39,19 @@ function formatModelName(ctx: ExtensionContext): string {
39
39
  return name;
40
40
  }
41
41
 
42
- type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
43
- const THINKING_TOKEN: Record<ThinkingLevel, "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh"> = {
42
+ type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
43
+ type ThinkingThemeToken = "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "thinkingMax";
44
+ const THINKING_TOKEN: Record<ThinkingLevel, ThinkingThemeToken> = {
44
45
  off: "thinkingOff",
45
46
  minimal: "thinkingMinimal",
46
47
  low: "thinkingLow",
47
48
  medium: "thinkingMedium",
48
49
  high: "thinkingHigh",
49
50
  xhigh: "thinkingXhigh",
51
+ max: "thinkingMax",
50
52
  };
51
53
 
52
- function normalizeThinkingLevel(value: string | undefined): ThinkingLevel {
54
+ export function normalizeThinkingLevel(value: string | undefined): ThinkingLevel {
53
55
  switch ((value ?? "").toLowerCase()) {
54
56
  case "off": return "off";
55
57
  case "minimal": return "minimal";
@@ -57,10 +59,15 @@ function normalizeThinkingLevel(value: string | undefined): ThinkingLevel {
57
59
  case "medium": return "medium";
58
60
  case "high": return "high";
59
61
  case "xhigh": return "xhigh";
62
+ case "max": return "max";
60
63
  default: return "off";
61
64
  }
62
65
  }
63
66
 
67
+ export function thinkingThemeToken(value: string | undefined): ThinkingThemeToken {
68
+ return THINKING_TOKEN[normalizeThinkingLevel(value)];
69
+ }
70
+
64
71
  function formatWindow(tokens: number | undefined): string {
65
72
  if (!tokens || tokens <= 0) return "?";
66
73
  if (tokens >= 1_000_000) {
@@ -207,9 +214,10 @@ export function renderStatusLine(width: number, ctx: ExtensionContext, git: GitS
207
214
  const rightPlain = subagentMarker ? `${percentPlain} ${subagentMarker.plain}` : percentPlain;
208
215
  const percentColor = percent === null ? "muted" : percent <= 15 ? "error" : percent <= 30 ? "warning" : "success";
209
216
  const separatorColored = theme.fg("muted", statusSeparator);
217
+ const thinkingToken = thinkingThemeToken(thinkingLevel) as Parameters<Theme["fg"]>[0];
210
218
  const leftColored = caveman
211
- ? `${theme.fg("accent", projectChunk)}${separatorColored}${theme.fg(THINKING_TOKEN[thinkingLevel], thinkingChunk)}${separatorColored}${theme.fg(cavemanTone, cavemanGlyph)}${theme.fg("muted", contextSeparator)}${theme.fg("accent", contextChunk.trimStart())}`
212
- : `${theme.fg("accent", projectChunk)}${separatorColored}${theme.fg(THINKING_TOKEN[thinkingLevel], thinkingChunk)}${theme.fg("accent", contextChunk)}`;
219
+ ? `${theme.fg("accent", projectChunk)}${separatorColored}${theme.fg(thinkingToken, thinkingChunk)}${separatorColored}${theme.fg(cavemanTone, cavemanGlyph)}${theme.fg("muted", contextSeparator)}${theme.fg("accent", contextChunk.trimStart())}`
220
+ : `${theme.fg("accent", projectChunk)}${separatorColored}${theme.fg(thinkingToken, thinkingChunk)}${theme.fg("accent", contextChunk)}`;
213
221
  const right = subagentMarker ? `${theme.fg(percentColor, percentPlain)} ${subagentMarker.styled}` : theme.fg(percentColor, percentPlain);
214
222
  const minimumGap = 1;
215
223
  const gapWidth = Math.max(minimumGap, width - visibleWidth(leftPlain) - visibleWidth(rightPlain) - 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanillagreen/pi-qol",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
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": [