pi-spark 0.5.2 → 0.6.0

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
@@ -13,6 +13,7 @@ A small, opinionated collection of [pi](https://pi.dev/) extensions.
13
13
  - **Presets:** switches named model presets with `/preset`, `--preset`, and quick cycle shortcuts.
14
14
  - **Recap:** generates a short idle-session recap and exposes a `/recap` command for manual generation, inspired by [Claude Code's session recap](https://code.claude.com/docs/en/interactive-mode#session-recap).
15
15
  - **Set session name:** exposes a `set_session_name` tool so the agent can give the current session a concise, recognizable name in the session selector.
16
+ - **Trust all:** bypasses pi's project trust dialog, added in 0.79.0, and removes saved trust decisions so startup stays minimal.
16
17
 
17
18
  ![Screenshot](./assets/screenshot.png)
18
19
 
@@ -71,7 +72,7 @@ Example:
71
72
 
72
73
  ### Editor
73
74
 
74
- - `editor.spinner` controls the working indicator style and can be `dots`, `lights`, or `tildes`.
75
+ - `editor.spinner` controls the working indicator style and can be `dots`, `lights`, `tildes`, or `pulse`.
75
76
 
76
77
  ### Footer
77
78
 
@@ -99,3 +100,8 @@ Use presets in these ways:
99
100
  ### Set session name
100
101
 
101
102
  - The agent can set or refresh the current session's display name and optionally give a reason.
103
+
104
+ ### Trust all
105
+
106
+ - pi-spark always answers pi's project trust check with `yes` and removes `~/.pi/agent/trust.json` on startup.
107
+ - This keeps the experience minimal after the project trust dialog added in pi 0.79.0. Follow [earendil-works/pi#5514](https://github.com/earendil-works/pi/issues/5514) for discussion. If pi ships a better default experience in the future, this extension may be deleted.
Binary file
@@ -5,13 +5,11 @@ import { isUsage } from "../shared/usage";
5
5
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
6
  import type { AgentMessage } from "@earendil-works/pi-agent-core";
7
7
 
8
- function hasCostedUsage(messages: AgentMessage[]): boolean {
9
- return messages.some((message) => {
10
- const usage = (message as { usage?: unknown }).usage;
11
- if (!isUsage(usage)) return false;
8
+ function hasCost(message: AgentMessage): boolean {
9
+ const usage = (message as { usage?: unknown }).usage;
10
+ if (!isUsage(usage)) return false;
12
11
 
13
- return usage.cost.total > 0 || usage.input > 0 || usage.output > 0;
14
- });
12
+ return usage.cost.total > 0 || usage.input > 0 || usage.output > 0;
15
13
  }
16
14
 
17
15
  export default function (pi: ExtensionAPI) {
@@ -31,8 +29,18 @@ export default function (pi: ExtensionAPI) {
31
29
  codexUsageManager?.refresh(ctx);
32
30
  });
33
31
 
34
- pi.on("agent_end", (event, ctx) => {
35
- if (!hasCostedUsage(event.messages)) return;
32
+ pi.on("turn_end", (event, ctx) => {
33
+ if (!hasCost(event.message)) return;
34
+
35
+ codexUsageManager?.refresh(ctx);
36
+ });
37
+
38
+ pi.on("session_compact", (_event, ctx) => {
39
+ codexUsageManager?.refresh(ctx);
40
+ });
41
+
42
+ pi.on("session_tree", (event, ctx) => {
43
+ if (!event.summaryEntry) return;
36
44
 
37
45
  codexUsageManager?.refresh(ctx);
38
46
  });
@@ -22,7 +22,7 @@ export function renderError(theme: Theme, message: string): string {
22
22
  return theme.fg("error", `${LABEL} usage unavailable: ${message}`);
23
23
  }
24
24
 
25
- function renderLane(theme: Theme, label: string, percent: number | undefined): string {
25
+ function renderLane(theme: Theme, label: string, percent?: number): string {
26
26
  const text = `${label} ${percent === undefined ? "?" : percent.toFixed(0)}%`;
27
27
 
28
28
  if (percent && percent > 90) return theme.fg("error", text);
@@ -2,7 +2,7 @@ import * as z from "zod";
2
2
 
3
3
  import type { TUI } from "@earendil-works/pi-tui";
4
4
 
5
- export const spinnerPresetSchema = z.enum(["dots", "lights", "tildes"]);
5
+ export const spinnerPresetSchema = z.enum(["dots", "lights", "tildes", "pulse"]);
6
6
 
7
7
  type SpinnerPreset = z.infer<typeof spinnerPresetSchema>;
8
8
 
@@ -28,6 +28,11 @@ const SPINNER_PRESETS: Record<SpinnerPreset, SpinnerParams> = {
28
28
  interval: 200,
29
29
  random: false,
30
30
  },
31
+ pulse: {
32
+ frames: ["·", "•", "●", "•", "·"],
33
+ interval: 100,
34
+ random: false,
35
+ },
31
36
  };
32
37
 
33
38
  const DEFAULT_SPINNER_PRESET = "tildes";
@@ -0,0 +1,19 @@
1
+ import { rmSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
4
+
5
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
+
7
+ /**
8
+ * Keep the experience minimal after the project trust dialog added in pi 0.79.0.
9
+ *
10
+ * Follow [earendil-works/pi#5514](https://github.com/earendil-works/pi/issues/5514) for discussion.
11
+ * If pi ships a better default experience in the future, this extension may be deleted.
12
+ */
13
+ export default function (pi: ExtensionAPI) {
14
+ rmSync(join(getAgentDir(), "trust.json"), { force: true });
15
+
16
+ pi.on("project_trust", () => {
17
+ return { trusted: "yes" };
18
+ });
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-spark",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "A small, opinionated collection of pi extensions",
5
5
  "keywords": [
6
6
  "pi-coding-agent",