@mariozechner/pi-coding-agent 0.50.7 → 0.50.9

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cli/args.d.ts.map +1 -1
  3. package/dist/cli/args.js +1 -0
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/core/agent-session.d.ts +4 -1
  6. package/dist/core/agent-session.d.ts.map +1 -1
  7. package/dist/core/agent-session.js +52 -6
  8. package/dist/core/agent-session.js.map +1 -1
  9. package/dist/core/extensions/index.d.ts +1 -1
  10. package/dist/core/extensions/index.d.ts.map +1 -1
  11. package/dist/core/extensions/index.js.map +1 -1
  12. package/dist/core/extensions/runner.d.ts +15 -1
  13. package/dist/core/extensions/runner.d.ts.map +1 -1
  14. package/dist/core/extensions/runner.js +38 -0
  15. package/dist/core/extensions/runner.js.map +1 -1
  16. package/dist/core/extensions/types.d.ts +14 -1
  17. package/dist/core/extensions/types.d.ts.map +1 -1
  18. package/dist/core/extensions/types.js.map +1 -1
  19. package/dist/core/keybindings.d.ts +1 -1
  20. package/dist/core/keybindings.d.ts.map +1 -1
  21. package/dist/core/keybindings.js +6 -0
  22. package/dist/core/keybindings.js.map +1 -1
  23. package/dist/core/model-registry.d.ts.map +1 -1
  24. package/dist/core/model-registry.js +8 -1
  25. package/dist/core/model-registry.js.map +1 -1
  26. package/dist/core/resource-loader.d.ts +24 -0
  27. package/dist/core/resource-loader.d.ts.map +1 -1
  28. package/dist/core/resource-loader.js +88 -19
  29. package/dist/core/resource-loader.js.map +1 -1
  30. package/dist/core/sdk.d.ts.map +1 -1
  31. package/dist/core/sdk.js +1 -0
  32. package/dist/core/sdk.js.map +1 -1
  33. package/dist/core/session-manager.d.ts +2 -0
  34. package/dist/core/session-manager.d.ts.map +1 -1
  35. package/dist/core/session-manager.js +2 -0
  36. package/dist/core/session-manager.js.map +1 -1
  37. package/dist/core/settings-manager.d.ts +2 -0
  38. package/dist/core/settings-manager.d.ts.map +1 -1
  39. package/dist/core/settings-manager.js +1 -0
  40. package/dist/core/settings-manager.js.map +1 -1
  41. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  42. package/dist/modes/interactive/components/daxnuts.js +1 -1
  43. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  44. package/dist/modes/interactive/components/session-selector-search.d.ts +1 -1
  45. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  46. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  47. package/dist/modes/interactive/components/session-selector.d.ts +1 -0
  48. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  49. package/dist/modes/interactive/components/session-selector.js +132 -47
  50. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  51. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  52. package/dist/modes/interactive/interactive-mode.js +6 -0
  53. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  54. package/dist/utils/clipboard-image.d.ts.map +1 -1
  55. package/dist/utils/clipboard-image.js +52 -10
  56. package/dist/utils/clipboard-image.js.map +1 -1
  57. package/docs/custom-provider.md +2 -1
  58. package/docs/keybindings.md +8 -0
  59. package/docs/settings.md +5 -1
  60. package/examples/extensions/README.md +8 -0
  61. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  62. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  63. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  64. package/examples/extensions/custom-provider-qwen-cli/index.ts +345 -0
  65. package/examples/extensions/custom-provider-qwen-cli/package.json +16 -0
  66. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  67. package/examples/extensions/dynamic-resources/dynamic.json +79 -0
  68. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  69. package/examples/extensions/dynamic-resources/index.ts +15 -0
  70. package/examples/extensions/titlebar-spinner.ts +58 -0
  71. package/examples/extensions/with-deps/package-lock.json +2 -2
  72. package/examples/extensions/with-deps/package.json +1 -1
  73. package/examples/sdk/12-full-control.ts +1 -0
  74. package/package.json +5 -4
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: dynamic-resources
3
+ description: Example skill loaded from resources_discover
4
+ ---
5
+
6
+ # Dynamic Resources Skill
7
+
8
+ This skill is provided by the dynamic-resources extension.
@@ -0,0 +1,79 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
3
+ "name": "dynamic-resources",
4
+ "vars": {
5
+ "cyan": "#00d7ff",
6
+ "blue": "#5f87ff",
7
+ "green": "#b5bd68",
8
+ "red": "#cc6666",
9
+ "yellow": "#ffff00",
10
+ "gray": "#808080",
11
+ "dimGray": "#666666",
12
+ "darkGray": "#505050",
13
+ "accent": "#8abeb7",
14
+ "selectedBg": "#3a3a4a",
15
+ "userMsgBg": "#343541",
16
+ "toolPendingBg": "#282832",
17
+ "toolSuccessBg": "#283228",
18
+ "toolErrorBg": "#3c2828",
19
+ "customMsgBg": "#2d2838"
20
+ },
21
+ "colors": {
22
+ "accent": "accent",
23
+ "border": "blue",
24
+ "borderAccent": "cyan",
25
+ "borderMuted": "darkGray",
26
+ "success": "green",
27
+ "error": "red",
28
+ "warning": "yellow",
29
+ "muted": "gray",
30
+ "dim": "dimGray",
31
+ "text": "",
32
+ "thinkingText": "gray",
33
+ "selectedBg": "selectedBg",
34
+ "userMessageBg": "userMsgBg",
35
+ "userMessageText": "",
36
+ "customMessageBg": "customMsgBg",
37
+ "customMessageText": "",
38
+ "customMessageLabel": "#9575cd",
39
+ "toolPendingBg": "toolPendingBg",
40
+ "toolSuccessBg": "toolSuccessBg",
41
+ "toolErrorBg": "toolErrorBg",
42
+ "toolTitle": "",
43
+ "toolOutput": "gray",
44
+ "mdHeading": "#f0c674",
45
+ "mdLink": "#81a2be",
46
+ "mdLinkUrl": "dimGray",
47
+ "mdCode": "accent",
48
+ "mdCodeBlock": "green",
49
+ "mdCodeBlockBorder": "gray",
50
+ "mdQuote": "gray",
51
+ "mdQuoteBorder": "gray",
52
+ "mdHr": "gray",
53
+ "mdListBullet": "accent",
54
+ "toolDiffAdded": "green",
55
+ "toolDiffRemoved": "red",
56
+ "toolDiffContext": "gray",
57
+ "syntaxComment": "#6A9955",
58
+ "syntaxKeyword": "#569CD6",
59
+ "syntaxFunction": "#DCDCAA",
60
+ "syntaxVariable": "#9CDCFE",
61
+ "syntaxString": "#CE9178",
62
+ "syntaxNumber": "#B5CEA8",
63
+ "syntaxType": "#4EC9B0",
64
+ "syntaxOperator": "#D4D4D4",
65
+ "syntaxPunctuation": "#D4D4D4",
66
+ "thinkingOff": "darkGray",
67
+ "thinkingMinimal": "#6e6e6e",
68
+ "thinkingLow": "#5f87af",
69
+ "thinkingMedium": "#81a2be",
70
+ "thinkingHigh": "#b294bb",
71
+ "thinkingXhigh": "#d183e8",
72
+ "bashMode": "green"
73
+ },
74
+ "export": {
75
+ "pageBg": "#18181e",
76
+ "cardBg": "#1e1e24",
77
+ "infoBg": "#3c3728"
78
+ }
79
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Example prompt template loaded from resources_discover
3
+ ---
4
+
5
+ Summarize the current repository structure and mention any build or test commands.
@@ -0,0 +1,15 @@
1
+ import { dirname, join } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
4
+
5
+ const baseDir = dirname(fileURLToPath(import.meta.url));
6
+
7
+ export default function (pi: ExtensionAPI) {
8
+ pi.on("resources_discover", () => {
9
+ return {
10
+ skillPaths: [join(baseDir, "SKILL.md")],
11
+ promptPaths: [join(baseDir, "dynamic.md")],
12
+ themePaths: [join(baseDir, "dynamic.json")],
13
+ };
14
+ });
15
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Titlebar Spinner Extension
3
+ *
4
+ * Shows a braille spinner animation in the terminal title while the agent is working.
5
+ * Uses `ctx.ui.setTitle()` to update the terminal title via the extension API.
6
+ *
7
+ * Usage:
8
+ * pi --extension examples/extensions/titlebar-spinner.ts
9
+ */
10
+
11
+ import path from "node:path";
12
+ import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
13
+
14
+ const BRAILLE_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
15
+
16
+ function getBaseTitle(pi: ExtensionAPI): string {
17
+ const cwd = path.basename(process.cwd());
18
+ const session = pi.getSessionName();
19
+ return session ? `π - ${session} - ${cwd}` : `π - ${cwd}`;
20
+ }
21
+
22
+ export default function (pi: ExtensionAPI) {
23
+ let timer: ReturnType<typeof setInterval> | null = null;
24
+ let frameIndex = 0;
25
+
26
+ function stopAnimation(ctx: ExtensionContext) {
27
+ if (timer) {
28
+ clearInterval(timer);
29
+ timer = null;
30
+ }
31
+ frameIndex = 0;
32
+ ctx.ui.setTitle(getBaseTitle(pi));
33
+ }
34
+
35
+ function startAnimation(ctx: ExtensionContext) {
36
+ stopAnimation(ctx);
37
+ timer = setInterval(() => {
38
+ const frame = BRAILLE_FRAMES[frameIndex % BRAILLE_FRAMES.length];
39
+ const cwd = path.basename(process.cwd());
40
+ const session = pi.getSessionName();
41
+ const title = session ? `${frame} π - ${session} - ${cwd}` : `${frame} π - ${cwd}`;
42
+ ctx.ui.setTitle(title);
43
+ frameIndex++;
44
+ }, 80);
45
+ }
46
+
47
+ pi.on("agent_start", async (_event, ctx) => {
48
+ startAnimation(ctx);
49
+ });
50
+
51
+ pi.on("agent_end", async (_event, ctx) => {
52
+ stopAnimation(ctx);
53
+ });
54
+
55
+ pi.on("session_shutdown", async (_event, ctx) => {
56
+ stopAnimation(ctx);
57
+ });
58
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "1.14.7",
3
+ "version": "1.14.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "1.14.7",
9
+ "version": "1.14.9",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "1.14.7",
4
+ "version": "1.14.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -54,6 +54,7 @@ const resourceLoader: ResourceLoader = {
54
54
  Available: read, bash. Be concise.`,
55
55
  getAppendSystemPrompt: () => [],
56
56
  getPathMetadata: () => new Map(),
57
+ extendResources: () => {},
57
58
  reload: async () => {},
58
59
  };
59
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mariozechner/pi-coding-agent",
3
- "version": "0.50.7",
3
+ "version": "0.50.9",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -30,6 +30,7 @@
30
30
  ],
31
31
  "scripts": {
32
32
  "clean": "shx rm -rf dist",
33
+ "dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
33
34
  "build": "tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && npm run copy-assets",
34
35
  "build:binary": "npm run build && bun build --compile ./dist/cli.js --outfile dist/pi && npm run copy-binary-assets",
35
36
  "copy-assets": "shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/",
@@ -40,9 +41,9 @@
40
41
  "dependencies": {
41
42
  "@mariozechner/clipboard": "^0.3.0",
42
43
  "@mariozechner/jiti": "^2.6.2",
43
- "@mariozechner/pi-agent-core": "^0.50.7",
44
- "@mariozechner/pi-ai": "^0.50.7",
45
- "@mariozechner/pi-tui": "^0.50.7",
44
+ "@mariozechner/pi-agent-core": "^0.50.9",
45
+ "@mariozechner/pi-ai": "^0.50.9",
46
+ "@mariozechner/pi-tui": "^0.50.9",
46
47
  "@silvia-odwyer/photon-node": "^0.3.4",
47
48
  "chalk": "^5.5.0",
48
49
  "cli-highlight": "^2.1.11",