@mrquake/quakecode-cli 0.64.0 → 0.64.1

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 (150) hide show
  1. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  2. package/dist/modes/interactive/components/session-selector.js +82 -105
  3. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  4. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  5. package/dist/modes/interactive/interactive-mode.js +7 -2
  6. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  7. package/package.json +11 -4
  8. package/docs/compaction.md +0 -394
  9. package/docs/custom-provider.md +0 -596
  10. package/docs/development.md +0 -71
  11. package/docs/extensions.md +0 -2286
  12. package/docs/images/doom-extension.png +0 -0
  13. package/docs/images/exy.png +0 -0
  14. package/docs/images/interactive-mode.png +0 -0
  15. package/docs/images/tree-view.png +0 -0
  16. package/docs/json.md +0 -82
  17. package/docs/keybindings.md +0 -175
  18. package/docs/models.md +0 -341
  19. package/docs/packages.md +0 -218
  20. package/docs/prompt-templates.md +0 -67
  21. package/docs/providers.md +0 -195
  22. package/docs/rpc.md +0 -1377
  23. package/docs/sdk.md +0 -1064
  24. package/docs/session.md +0 -412
  25. package/docs/settings.md +0 -246
  26. package/docs/shell-aliases.md +0 -13
  27. package/docs/skills.md +0 -232
  28. package/docs/terminal-setup.md +0 -106
  29. package/docs/termux.md +0 -127
  30. package/docs/themes.md +0 -295
  31. package/docs/tmux.md +0 -61
  32. package/docs/tree.md +0 -231
  33. package/docs/tui.md +0 -887
  34. package/docs/windows.md +0 -17
  35. package/examples/README.md +0 -25
  36. package/examples/extensions/README.md +0 -206
  37. package/examples/extensions/antigravity-image-gen.ts +0 -418
  38. package/examples/extensions/auto-commit-on-exit.ts +0 -49
  39. package/examples/extensions/bash-spawn-hook.ts +0 -30
  40. package/examples/extensions/bookmark.ts +0 -50
  41. package/examples/extensions/built-in-tool-renderer.ts +0 -246
  42. package/examples/extensions/claude-rules.ts +0 -86
  43. package/examples/extensions/commands.ts +0 -72
  44. package/examples/extensions/confirm-destructive.ts +0 -59
  45. package/examples/extensions/custom-compaction.ts +0 -127
  46. package/examples/extensions/custom-footer.ts +0 -64
  47. package/examples/extensions/custom-header.ts +0 -73
  48. package/examples/extensions/custom-provider-anthropic/index.ts +0 -604
  49. package/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
  50. package/examples/extensions/custom-provider-anthropic/package.json +0 -19
  51. package/examples/extensions/custom-provider-gitlab-duo/index.ts +0 -349
  52. package/examples/extensions/custom-provider-gitlab-duo/package.json +0 -16
  53. package/examples/extensions/custom-provider-gitlab-duo/test.ts +0 -82
  54. package/examples/extensions/custom-provider-qwen-cli/index.ts +0 -345
  55. package/examples/extensions/custom-provider-qwen-cli/package.json +0 -16
  56. package/examples/extensions/dirty-repo-guard.ts +0 -56
  57. package/examples/extensions/doom-overlay/README.md +0 -46
  58. package/examples/extensions/doom-overlay/doom/build/doom.js +0 -21
  59. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  60. package/examples/extensions/doom-overlay/doom/build.sh +0 -152
  61. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -72
  62. package/examples/extensions/doom-overlay/doom-component.ts +0 -132
  63. package/examples/extensions/doom-overlay/doom-engine.ts +0 -173
  64. package/examples/extensions/doom-overlay/doom-keys.ts +0 -104
  65. package/examples/extensions/doom-overlay/index.ts +0 -74
  66. package/examples/extensions/doom-overlay/wad-finder.ts +0 -51
  67. package/examples/extensions/dynamic-resources/SKILL.md +0 -8
  68. package/examples/extensions/dynamic-resources/dynamic.json +0 -79
  69. package/examples/extensions/dynamic-resources/dynamic.md +0 -5
  70. package/examples/extensions/dynamic-resources/index.ts +0 -15
  71. package/examples/extensions/dynamic-tools.ts +0 -74
  72. package/examples/extensions/event-bus.ts +0 -43
  73. package/examples/extensions/file-trigger.ts +0 -41
  74. package/examples/extensions/git-checkpoint.ts +0 -53
  75. package/examples/extensions/handoff.ts +0 -153
  76. package/examples/extensions/hello.ts +0 -26
  77. package/examples/extensions/hidden-thinking-label.ts +0 -53
  78. package/examples/extensions/inline-bash.ts +0 -94
  79. package/examples/extensions/input-transform.ts +0 -43
  80. package/examples/extensions/interactive-shell.ts +0 -196
  81. package/examples/extensions/mac-system-theme.ts +0 -47
  82. package/examples/extensions/message-renderer.ts +0 -59
  83. package/examples/extensions/minimal-mode.ts +0 -426
  84. package/examples/extensions/modal-editor.ts +0 -85
  85. package/examples/extensions/model-status.ts +0 -31
  86. package/examples/extensions/notify.ts +0 -55
  87. package/examples/extensions/overlay-qa-tests.ts +0 -1348
  88. package/examples/extensions/overlay-test.ts +0 -150
  89. package/examples/extensions/permission-gate.ts +0 -34
  90. package/examples/extensions/pirate.ts +0 -47
  91. package/examples/extensions/plan-mode/README.md +0 -65
  92. package/examples/extensions/plan-mode/index.ts +0 -340
  93. package/examples/extensions/plan-mode/utils.ts +0 -168
  94. package/examples/extensions/preset.ts +0 -397
  95. package/examples/extensions/protected-paths.ts +0 -30
  96. package/examples/extensions/provider-payload.ts +0 -14
  97. package/examples/extensions/qna.ts +0 -122
  98. package/examples/extensions/question.ts +0 -264
  99. package/examples/extensions/questionnaire.ts +0 -427
  100. package/examples/extensions/rainbow-editor.ts +0 -88
  101. package/examples/extensions/reload-runtime.ts +0 -37
  102. package/examples/extensions/rpc-demo.ts +0 -118
  103. package/examples/extensions/sandbox/index.ts +0 -321
  104. package/examples/extensions/sandbox/package-lock.json +0 -92
  105. package/examples/extensions/sandbox/package.json +0 -19
  106. package/examples/extensions/send-user-message.ts +0 -97
  107. package/examples/extensions/session-name.ts +0 -27
  108. package/examples/extensions/shutdown-command.ts +0 -63
  109. package/examples/extensions/snake.ts +0 -343
  110. package/examples/extensions/space-invaders.ts +0 -560
  111. package/examples/extensions/ssh.ts +0 -220
  112. package/examples/extensions/status-line.ts +0 -32
  113. package/examples/extensions/subagent/README.md +0 -172
  114. package/examples/extensions/subagent/agents/planner.md +0 -37
  115. package/examples/extensions/subagent/agents/reviewer.md +0 -35
  116. package/examples/extensions/subagent/agents/scout.md +0 -50
  117. package/examples/extensions/subagent/agents/worker.md +0 -24
  118. package/examples/extensions/subagent/agents.ts +0 -126
  119. package/examples/extensions/subagent/index.ts +0 -986
  120. package/examples/extensions/subagent/prompts/implement-and-review.md +0 -10
  121. package/examples/extensions/subagent/prompts/implement.md +0 -10
  122. package/examples/extensions/subagent/prompts/scout-and-plan.md +0 -9
  123. package/examples/extensions/summarize.ts +0 -206
  124. package/examples/extensions/system-prompt-header.ts +0 -17
  125. package/examples/extensions/timed-confirm.ts +0 -70
  126. package/examples/extensions/titlebar-spinner.ts +0 -58
  127. package/examples/extensions/todo.ts +0 -297
  128. package/examples/extensions/tool-override.ts +0 -144
  129. package/examples/extensions/tools.ts +0 -141
  130. package/examples/extensions/trigger-compact.ts +0 -50
  131. package/examples/extensions/truncated-tool.ts +0 -195
  132. package/examples/extensions/widget-placement.ts +0 -9
  133. package/examples/extensions/with-deps/index.ts +0 -32
  134. package/examples/extensions/with-deps/package-lock.json +0 -31
  135. package/examples/extensions/with-deps/package.json +0 -22
  136. package/examples/rpc-extension-ui.ts +0 -632
  137. package/examples/sdk/01-minimal.ts +0 -22
  138. package/examples/sdk/02-custom-model.ts +0 -49
  139. package/examples/sdk/03-custom-prompt.ts +0 -55
  140. package/examples/sdk/04-skills.ts +0 -52
  141. package/examples/sdk/05-tools.ts +0 -56
  142. package/examples/sdk/06-extensions.ts +0 -88
  143. package/examples/sdk/07-context-files.ts +0 -40
  144. package/examples/sdk/08-prompt-templates.ts +0 -48
  145. package/examples/sdk/09-api-keys-and-oauth.ts +0 -48
  146. package/examples/sdk/10-settings.ts +0 -51
  147. package/examples/sdk/11-sessions.ts +0 -48
  148. package/examples/sdk/12-full-control.ts +0 -81
  149. package/examples/sdk/13-session-runtime.ts +0 -49
  150. 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
- }