@mrquake/quakecode-cli 0.64.0 → 0.64.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.
Files changed (180) hide show
  1. package/dist/bun/cli.d.ts.map +1 -1
  2. package/dist/bun/cli.js +1 -1
  3. package/dist/bun/cli.js.map +1 -1
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +7 -10
  6. package/dist/config.js.map +1 -1
  7. package/dist/core/extensions/loader.d.ts.map +1 -1
  8. package/dist/core/extensions/loader.js +21 -7
  9. package/dist/core/extensions/loader.js.map +1 -1
  10. package/dist/core/settings-manager.d.ts.map +1 -1
  11. package/dist/core/settings-manager.js +2 -2
  12. package/dist/core/settings-manager.js.map +1 -1
  13. package/dist/core/slash-commands.d.ts.map +1 -1
  14. package/dist/core/slash-commands.js +1 -1
  15. package/dist/core/slash-commands.js.map +1 -1
  16. package/dist/core/system-prompt.d.ts.map +1 -1
  17. package/dist/core/system-prompt.js +5 -5
  18. package/dist/core/system-prompt.js.map +1 -1
  19. package/dist/main.d.ts.map +1 -1
  20. package/dist/main.js +7 -7
  21. package/dist/main.js.map +1 -1
  22. package/dist/migrations.d.ts.map +1 -1
  23. package/dist/migrations.js +2 -2
  24. package/dist/migrations.js.map +1 -1
  25. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  26. package/dist/modes/interactive/components/config-selector.js +1 -1
  27. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  28. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  29. package/dist/modes/interactive/components/session-selector.js +82 -105
  30. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  31. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  32. package/dist/modes/interactive/interactive-mode.js +10 -5
  33. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  34. package/dist/utils/clipboard-image.d.ts.map +1 -1
  35. package/dist/utils/clipboard-image.js +3 -3
  36. package/dist/utils/clipboard-image.js.map +1 -1
  37. package/package.json +14 -7
  38. package/docs/compaction.md +0 -394
  39. package/docs/custom-provider.md +0 -596
  40. package/docs/development.md +0 -71
  41. package/docs/extensions.md +0 -2286
  42. package/docs/images/doom-extension.png +0 -0
  43. package/docs/images/exy.png +0 -0
  44. package/docs/images/interactive-mode.png +0 -0
  45. package/docs/images/tree-view.png +0 -0
  46. package/docs/json.md +0 -82
  47. package/docs/keybindings.md +0 -175
  48. package/docs/models.md +0 -341
  49. package/docs/packages.md +0 -218
  50. package/docs/prompt-templates.md +0 -67
  51. package/docs/providers.md +0 -195
  52. package/docs/rpc.md +0 -1377
  53. package/docs/sdk.md +0 -1064
  54. package/docs/session.md +0 -412
  55. package/docs/settings.md +0 -246
  56. package/docs/shell-aliases.md +0 -13
  57. package/docs/skills.md +0 -232
  58. package/docs/terminal-setup.md +0 -106
  59. package/docs/termux.md +0 -127
  60. package/docs/themes.md +0 -295
  61. package/docs/tmux.md +0 -61
  62. package/docs/tree.md +0 -231
  63. package/docs/tui.md +0 -887
  64. package/docs/windows.md +0 -17
  65. package/examples/README.md +0 -25
  66. package/examples/extensions/README.md +0 -206
  67. package/examples/extensions/antigravity-image-gen.ts +0 -418
  68. package/examples/extensions/auto-commit-on-exit.ts +0 -49
  69. package/examples/extensions/bash-spawn-hook.ts +0 -30
  70. package/examples/extensions/bookmark.ts +0 -50
  71. package/examples/extensions/built-in-tool-renderer.ts +0 -246
  72. package/examples/extensions/claude-rules.ts +0 -86
  73. package/examples/extensions/commands.ts +0 -72
  74. package/examples/extensions/confirm-destructive.ts +0 -59
  75. package/examples/extensions/custom-compaction.ts +0 -127
  76. package/examples/extensions/custom-footer.ts +0 -64
  77. package/examples/extensions/custom-header.ts +0 -73
  78. package/examples/extensions/custom-provider-anthropic/index.ts +0 -604
  79. package/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
  80. package/examples/extensions/custom-provider-anthropic/package.json +0 -19
  81. package/examples/extensions/custom-provider-gitlab-duo/index.ts +0 -349
  82. package/examples/extensions/custom-provider-gitlab-duo/package.json +0 -16
  83. package/examples/extensions/custom-provider-gitlab-duo/test.ts +0 -82
  84. package/examples/extensions/custom-provider-qwen-cli/index.ts +0 -345
  85. package/examples/extensions/custom-provider-qwen-cli/package.json +0 -16
  86. package/examples/extensions/dirty-repo-guard.ts +0 -56
  87. package/examples/extensions/doom-overlay/README.md +0 -46
  88. package/examples/extensions/doom-overlay/doom/build/doom.js +0 -21
  89. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  90. package/examples/extensions/doom-overlay/doom/build.sh +0 -152
  91. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -72
  92. package/examples/extensions/doom-overlay/doom-component.ts +0 -132
  93. package/examples/extensions/doom-overlay/doom-engine.ts +0 -173
  94. package/examples/extensions/doom-overlay/doom-keys.ts +0 -104
  95. package/examples/extensions/doom-overlay/index.ts +0 -74
  96. package/examples/extensions/doom-overlay/wad-finder.ts +0 -51
  97. package/examples/extensions/dynamic-resources/SKILL.md +0 -8
  98. package/examples/extensions/dynamic-resources/dynamic.json +0 -79
  99. package/examples/extensions/dynamic-resources/dynamic.md +0 -5
  100. package/examples/extensions/dynamic-resources/index.ts +0 -15
  101. package/examples/extensions/dynamic-tools.ts +0 -74
  102. package/examples/extensions/event-bus.ts +0 -43
  103. package/examples/extensions/file-trigger.ts +0 -41
  104. package/examples/extensions/git-checkpoint.ts +0 -53
  105. package/examples/extensions/handoff.ts +0 -153
  106. package/examples/extensions/hello.ts +0 -26
  107. package/examples/extensions/hidden-thinking-label.ts +0 -53
  108. package/examples/extensions/inline-bash.ts +0 -94
  109. package/examples/extensions/input-transform.ts +0 -43
  110. package/examples/extensions/interactive-shell.ts +0 -196
  111. package/examples/extensions/mac-system-theme.ts +0 -47
  112. package/examples/extensions/message-renderer.ts +0 -59
  113. package/examples/extensions/minimal-mode.ts +0 -426
  114. package/examples/extensions/modal-editor.ts +0 -85
  115. package/examples/extensions/model-status.ts +0 -31
  116. package/examples/extensions/notify.ts +0 -55
  117. package/examples/extensions/overlay-qa-tests.ts +0 -1348
  118. package/examples/extensions/overlay-test.ts +0 -150
  119. package/examples/extensions/permission-gate.ts +0 -34
  120. package/examples/extensions/pirate.ts +0 -47
  121. package/examples/extensions/plan-mode/README.md +0 -65
  122. package/examples/extensions/plan-mode/index.ts +0 -340
  123. package/examples/extensions/plan-mode/utils.ts +0 -168
  124. package/examples/extensions/preset.ts +0 -397
  125. package/examples/extensions/protected-paths.ts +0 -30
  126. package/examples/extensions/provider-payload.ts +0 -14
  127. package/examples/extensions/qna.ts +0 -122
  128. package/examples/extensions/question.ts +0 -264
  129. package/examples/extensions/questionnaire.ts +0 -427
  130. package/examples/extensions/rainbow-editor.ts +0 -88
  131. package/examples/extensions/reload-runtime.ts +0 -37
  132. package/examples/extensions/rpc-demo.ts +0 -118
  133. package/examples/extensions/sandbox/index.ts +0 -321
  134. package/examples/extensions/sandbox/package-lock.json +0 -92
  135. package/examples/extensions/sandbox/package.json +0 -19
  136. package/examples/extensions/send-user-message.ts +0 -97
  137. package/examples/extensions/session-name.ts +0 -27
  138. package/examples/extensions/shutdown-command.ts +0 -63
  139. package/examples/extensions/snake.ts +0 -343
  140. package/examples/extensions/space-invaders.ts +0 -560
  141. package/examples/extensions/ssh.ts +0 -220
  142. package/examples/extensions/status-line.ts +0 -32
  143. package/examples/extensions/subagent/README.md +0 -172
  144. package/examples/extensions/subagent/agents/planner.md +0 -37
  145. package/examples/extensions/subagent/agents/reviewer.md +0 -35
  146. package/examples/extensions/subagent/agents/scout.md +0 -50
  147. package/examples/extensions/subagent/agents/worker.md +0 -24
  148. package/examples/extensions/subagent/agents.ts +0 -126
  149. package/examples/extensions/subagent/index.ts +0 -986
  150. package/examples/extensions/subagent/prompts/implement-and-review.md +0 -10
  151. package/examples/extensions/subagent/prompts/implement.md +0 -10
  152. package/examples/extensions/subagent/prompts/scout-and-plan.md +0 -9
  153. package/examples/extensions/summarize.ts +0 -206
  154. package/examples/extensions/system-prompt-header.ts +0 -17
  155. package/examples/extensions/timed-confirm.ts +0 -70
  156. package/examples/extensions/titlebar-spinner.ts +0 -58
  157. package/examples/extensions/todo.ts +0 -297
  158. package/examples/extensions/tool-override.ts +0 -144
  159. package/examples/extensions/tools.ts +0 -141
  160. package/examples/extensions/trigger-compact.ts +0 -50
  161. package/examples/extensions/truncated-tool.ts +0 -195
  162. package/examples/extensions/widget-placement.ts +0 -9
  163. package/examples/extensions/with-deps/index.ts +0 -32
  164. package/examples/extensions/with-deps/package-lock.json +0 -31
  165. package/examples/extensions/with-deps/package.json +0 -22
  166. package/examples/rpc-extension-ui.ts +0 -632
  167. package/examples/sdk/01-minimal.ts +0 -22
  168. package/examples/sdk/02-custom-model.ts +0 -49
  169. package/examples/sdk/03-custom-prompt.ts +0 -55
  170. package/examples/sdk/04-skills.ts +0 -52
  171. package/examples/sdk/05-tools.ts +0 -56
  172. package/examples/sdk/06-extensions.ts +0 -88
  173. package/examples/sdk/07-context-files.ts +0 -40
  174. package/examples/sdk/08-prompt-templates.ts +0 -48
  175. package/examples/sdk/09-api-keys-and-oauth.ts +0 -48
  176. package/examples/sdk/10-settings.ts +0 -51
  177. package/examples/sdk/11-sessions.ts +0 -48
  178. package/examples/sdk/12-full-control.ts +0 -81
  179. package/examples/sdk/13-session-runtime.ts +0 -49
  180. package/examples/sdk/README.md +0 -145
@@ -1,127 +0,0 @@
1
- /**
2
- * Custom Compaction Extension
3
- *
4
- * Replaces the default compaction behavior with a full summary of the entire context.
5
- * Instead of keeping the last 20k tokens of conversation turns, this extension:
6
- * 1. Summarizes ALL messages (messagesToSummarize + turnPrefixMessages)
7
- * 2. Discards all old turns completely, keeping only the summary
8
- *
9
- * This example also demonstrates using a different model (Gemini Flash) for summarization,
10
- * which can be cheaper/faster than the main conversation model.
11
- *
12
- * Usage:
13
- * pi --extension examples/extensions/custom-compaction.ts
14
- */
15
-
16
- import { complete } from "@mariozechner/pi-ai";
17
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
18
- import { convertToLlm, serializeConversation } from "@mariozechner/pi-coding-agent";
19
-
20
- export default function (pi: ExtensionAPI) {
21
- pi.on("session_before_compact", async (event, ctx) => {
22
- ctx.ui.notify("Custom compaction extension triggered", "info");
23
-
24
- const { preparation, branchEntries: _, signal } = event;
25
- const { messagesToSummarize, turnPrefixMessages, tokensBefore, firstKeptEntryId, previousSummary } = preparation;
26
-
27
- // Use Gemini Flash for summarization (cheaper/faster than most conversation models)
28
- const model = ctx.modelRegistry.find("google", "gemini-2.5-flash");
29
- if (!model) {
30
- ctx.ui.notify(`Could not find Gemini Flash model, using default compaction`, "warning");
31
- return;
32
- }
33
-
34
- // Resolve request auth for the summarization model
35
- const auth = await ctx.modelRegistry.getApiKeyAndHeaders(model);
36
- if (!auth.ok) {
37
- ctx.ui.notify(`Compaction auth failed: ${auth.error}`, "warning");
38
- return;
39
- }
40
- if (!auth.apiKey) {
41
- ctx.ui.notify(`No API key for ${model.provider}, using default compaction`, "warning");
42
- return;
43
- }
44
-
45
- // Combine all messages for full summary
46
- const allMessages = [...messagesToSummarize, ...turnPrefixMessages];
47
-
48
- ctx.ui.notify(
49
- `Custom compaction: summarizing ${allMessages.length} messages (${tokensBefore.toLocaleString()} tokens) with ${model.id}...`,
50
- "info",
51
- );
52
-
53
- // Convert messages to readable text format
54
- const conversationText = serializeConversation(convertToLlm(allMessages));
55
-
56
- // Include previous summary context if available
57
- const previousContext = previousSummary ? `\n\nPrevious session summary for context:\n${previousSummary}` : "";
58
-
59
- // Build messages that ask for a comprehensive summary
60
- const summaryMessages = [
61
- {
62
- role: "user" as const,
63
- content: [
64
- {
65
- type: "text" as const,
66
- text: `You are a conversation summarizer. Create a comprehensive summary of this conversation that captures:${previousContext}
67
-
68
- 1. The main goals and objectives discussed
69
- 2. Key decisions made and their rationale
70
- 3. Important code changes, file modifications, or technical details
71
- 4. Current state of any ongoing work
72
- 5. Any blockers, issues, or open questions
73
- 6. Next steps that were planned or suggested
74
-
75
- Be thorough but concise. The summary will replace the ENTIRE conversation history, so include all information needed to continue the work effectively.
76
-
77
- Format the summary as structured markdown with clear sections.
78
-
79
- <conversation>
80
- ${conversationText}
81
- </conversation>`,
82
- },
83
- ],
84
- timestamp: Date.now(),
85
- },
86
- ];
87
-
88
- try {
89
- // Pass signal to honor abort requests (e.g., user cancels compaction)
90
- const response = await complete(
91
- model,
92
- { messages: summaryMessages },
93
- {
94
- apiKey: auth.apiKey,
95
- headers: auth.headers,
96
- maxTokens: 8192,
97
- signal,
98
- },
99
- );
100
-
101
- const summary = response.content
102
- .filter((c): c is { type: "text"; text: string } => c.type === "text")
103
- .map((c) => c.text)
104
- .join("\n");
105
-
106
- if (!summary.trim()) {
107
- if (!signal.aborted) ctx.ui.notify("Compaction summary was empty, using default compaction", "warning");
108
- return;
109
- }
110
-
111
- // Return compaction content - SessionManager adds id/parentId
112
- // Use firstKeptEntryId from preparation to keep recent messages
113
- return {
114
- compaction: {
115
- summary,
116
- firstKeptEntryId,
117
- tokensBefore,
118
- },
119
- };
120
- } catch (error) {
121
- const message = error instanceof Error ? error.message : String(error);
122
- ctx.ui.notify(`Compaction failed: ${message}`, "error");
123
- // Fall back to default compaction on error
124
- return;
125
- }
126
- });
127
- }
@@ -1,64 +0,0 @@
1
- /**
2
- * Custom Footer Extension - demonstrates ctx.ui.setFooter()
3
- *
4
- * footerData exposes data not otherwise accessible:
5
- * - getGitBranch(): current git branch
6
- * - getExtensionStatuses(): texts from ctx.ui.setStatus()
7
- *
8
- * Token stats come from ctx.sessionManager/ctx.model (already accessible).
9
- */
10
-
11
- import type { AssistantMessage } from "@mariozechner/pi-ai";
12
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
13
- import { truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
14
-
15
- export default function (pi: ExtensionAPI) {
16
- let enabled = false;
17
-
18
- pi.registerCommand("footer", {
19
- description: "Toggle custom footer",
20
- handler: async (_args, ctx) => {
21
- enabled = !enabled;
22
-
23
- if (enabled) {
24
- ctx.ui.setFooter((tui, theme, footerData) => {
25
- const unsub = footerData.onBranchChange(() => tui.requestRender());
26
-
27
- return {
28
- dispose: unsub,
29
- invalidate() {},
30
- render(width: number): string[] {
31
- // Compute tokens from ctx (already accessible to extensions)
32
- let input = 0,
33
- output = 0,
34
- cost = 0;
35
- for (const e of ctx.sessionManager.getBranch()) {
36
- if (e.type === "message" && e.message.role === "assistant") {
37
- const m = e.message as AssistantMessage;
38
- input += m.usage.input;
39
- output += m.usage.output;
40
- cost += m.usage.cost.total;
41
- }
42
- }
43
-
44
- // Get git branch (not otherwise accessible)
45
- const branch = footerData.getGitBranch();
46
- const fmt = (n: number) => (n < 1000 ? `${n}` : `${(n / 1000).toFixed(1)}k`);
47
-
48
- const left = theme.fg("dim", `↑${fmt(input)} ↓${fmt(output)} $${cost.toFixed(3)}`);
49
- const branchStr = branch ? ` (${branch})` : "";
50
- const right = theme.fg("dim", `${ctx.model?.id || "no-model"}${branchStr}`);
51
-
52
- const pad = " ".repeat(Math.max(1, width - visibleWidth(left) - visibleWidth(right)));
53
- return [truncateToWidth(left + pad + right, width)];
54
- },
55
- };
56
- });
57
- ctx.ui.notify("Custom footer enabled", "info");
58
- } else {
59
- ctx.ui.setFooter(undefined);
60
- ctx.ui.notify("Default footer restored", "info");
61
- }
62
- },
63
- });
64
- }
@@ -1,73 +0,0 @@
1
- /**
2
- * Custom Header Extension
3
- *
4
- * Demonstrates ctx.ui.setHeader() for replacing the built-in header
5
- * (logo + keybinding hints) with a custom component showing the pi mascot.
6
- */
7
-
8
- import type { ExtensionAPI, Theme } from "@mariozechner/pi-coding-agent";
9
- import { VERSION } from "@mariozechner/pi-coding-agent";
10
-
11
- // --- PI MASCOT ---
12
- // Based on pi_mascot.ts - the pi agent character
13
- function getPiMascot(theme: Theme): string[] {
14
- // --- COLORS ---
15
- // 3b1b Blue: R=80, G=180, B=230
16
- const piBlue = (text: string) => theme.fg("accent", text);
17
- const white = (text: string) => text; // Use plain white (or theme.fg("text", text))
18
- const black = (text: string) => theme.fg("dim", text); // Use dim for contrast
19
-
20
- // --- GLYPHS ---
21
- const BLOCK = "█";
22
- const PUPIL = "▌"; // Vertical half-block for the pupil
23
-
24
- // --- CONSTRUCTION ---
25
-
26
- // 1. The Eye Unit: [White Full Block][Black Vertical Sliver]
27
- // This creates the "looking sideways" effect
28
- const eye = `${white(BLOCK)}${black(PUPIL)}`;
29
-
30
- // 2. Line 1: The Eyes
31
- // 5 spaces indent aligns them with the start of the legs
32
- const lineEyes = ` ${eye} ${eye}`;
33
-
34
- // 3. Line 2: The Wide Top Bar (The "Overhang")
35
- // 14 blocks wide for that serif-style roof
36
- const lineBar = ` ${piBlue(BLOCK.repeat(14))}`;
37
-
38
- // 4. Lines 3-6: The Legs
39
- // Indented 5 spaces relative to the very left edge
40
- // Leg width: 2 blocks | Gap: 4 blocks
41
- const lineLeg = ` ${piBlue(BLOCK.repeat(2))} ${piBlue(BLOCK.repeat(2))}`;
42
-
43
- // --- ASSEMBLY ---
44
- return ["", lineEyes, lineBar, lineLeg, lineLeg, lineLeg, lineLeg, ""];
45
- }
46
-
47
- export default function (pi: ExtensionAPI) {
48
- // Set custom header immediately on load (if UI is available)
49
- pi.on("session_start", async (_event, ctx) => {
50
- if (ctx.hasUI) {
51
- ctx.ui.setHeader((_tui, theme) => {
52
- return {
53
- render(_width: number): string[] {
54
- const mascotLines = getPiMascot(theme);
55
- // Add a subtitle with hint
56
- const subtitle = `${theme.fg("muted", " shitty coding agent")}${theme.fg("dim", ` v${VERSION}`)}`;
57
- return [...mascotLines, subtitle];
58
- },
59
- invalidate() {},
60
- };
61
- });
62
- }
63
- });
64
-
65
- // Command to restore built-in header
66
- pi.registerCommand("builtin-header", {
67
- description: "Restore built-in header with keybinding hints",
68
- handler: async (_args, ctx) => {
69
- ctx.ui.setHeader(undefined);
70
- ctx.ui.notify("Built-in header restored", "info");
71
- },
72
- });
73
- }