@oh-my-pi/pi-coding-agent 15.9.5 → 15.10.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/CHANGELOG.md +98 -1
- package/dist/types/cli/args.d.ts +1 -1
- package/dist/types/cli/gallery-cli.d.ts +43 -0
- package/dist/types/cli/gallery-fixtures/agentic.d.ts +2 -0
- package/dist/types/cli/gallery-fixtures/codeintel.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/edit.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/fs.d.ts +2 -0
- package/dist/types/cli/gallery-fixtures/index.d.ts +4 -0
- package/dist/types/cli/gallery-fixtures/interaction.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/memory.d.ts +2 -0
- package/dist/types/cli/gallery-fixtures/misc.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/search.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/shell.d.ts +3 -0
- package/dist/types/cli/gallery-fixtures/types.d.ts +44 -0
- package/dist/types/cli/gallery-fixtures/web.d.ts +2 -0
- package/dist/types/cli/gallery-screenshot.d.ts +35 -0
- package/dist/types/commands/gallery.d.ts +47 -0
- package/dist/types/config/keybindings.d.ts +10 -2
- package/dist/types/config/model-id-affixes.d.ts +2 -0
- package/dist/types/config/model-registry.d.ts +8 -1
- package/dist/types/config/settings-schema.d.ts +43 -7
- package/dist/types/edit/file-snapshot-store.d.ts +1 -1
- package/dist/types/eval/backend.d.ts +6 -6
- package/dist/types/eval/bridge-timeout.d.ts +27 -0
- package/dist/types/eval/idle-timeout.d.ts +16 -14
- package/dist/types/eval/js/executor.d.ts +3 -3
- package/dist/types/eval/py/executor.d.ts +2 -2
- package/dist/types/eval/py/spawn-options.d.ts +58 -0
- package/dist/types/extensibility/plugins/marketplace-auto-update.d.ts +8 -0
- package/dist/types/lsp/types.d.ts +10 -0
- package/dist/types/main.d.ts +3 -2
- package/dist/types/memory-backend/index.d.ts +2 -1
- package/dist/types/memory-backend/resolve.d.ts +1 -1
- package/dist/types/memory-backend/types.d.ts +1 -1
- package/dist/types/modes/components/assistant-message.d.ts +5 -0
- package/dist/types/modes/components/copy-selector.d.ts +22 -0
- package/dist/types/modes/components/custom-editor.d.ts +2 -1
- package/dist/types/modes/components/model-selector.d.ts +1 -0
- package/dist/types/modes/components/tool-execution.d.ts +18 -0
- package/dist/types/modes/controllers/command-controller.d.ts +0 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +2 -1
- package/dist/types/modes/index.d.ts +5 -4
- package/dist/types/modes/interactive-mode.d.ts +2 -2
- package/dist/types/modes/setup-version.d.ts +11 -0
- package/dist/types/modes/setup-wizard/index.d.ts +2 -1
- package/dist/types/modes/setup-wizard/scenes/web-search.d.ts +2 -1
- package/dist/types/modes/types.d.ts +2 -2
- package/dist/types/modes/utils/copy-targets.d.ts +53 -0
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/task/executor.d.ts +7 -0
- package/dist/types/telemetry-export.d.ts +1 -1
- package/dist/types/tools/eval-render.d.ts +1 -0
- package/dist/types/tools/fetch.d.ts +15 -7
- package/dist/types/tools/render-utils.d.ts +33 -0
- package/dist/types/tools/renderers.d.ts +16 -2
- package/dist/types/tools/search.d.ts +1 -1
- package/dist/types/tools/write.d.ts +2 -0
- package/dist/types/tui/code-cell.d.ts +6 -0
- package/dist/types/tui/output-block.d.ts +11 -0
- package/dist/types/web/scrapers/github.d.ts +22 -0
- package/dist/types/web/search/providers/perplexity.d.ts +8 -1
- package/dist/types/web/search/types.d.ts +1 -1
- package/package.json +9 -9
- package/scripts/dev-launch +42 -0
- package/scripts/dev-launch-preload.ts +19 -0
- package/src/autoresearch/dashboard.ts +11 -21
- package/src/cli/args.ts +2 -2
- package/src/cli/claude-trace-cli.ts +13 -1
- package/src/cli/gallery-cli.ts +223 -0
- package/src/cli/gallery-fixtures/agentic.ts +292 -0
- package/src/cli/gallery-fixtures/codeintel.ts +188 -0
- package/src/cli/gallery-fixtures/edit.ts +194 -0
- package/src/cli/gallery-fixtures/fs.ts +153 -0
- package/src/cli/gallery-fixtures/index.ts +40 -0
- package/src/cli/gallery-fixtures/interaction.ts +49 -0
- package/src/cli/gallery-fixtures/memory.ts +81 -0
- package/src/cli/gallery-fixtures/misc.ts +221 -0
- package/src/cli/gallery-fixtures/search.ts +213 -0
- package/src/cli/gallery-fixtures/shell.ts +167 -0
- package/src/cli/gallery-fixtures/types.ts +41 -0
- package/src/cli/gallery-fixtures/web.ts +158 -0
- package/src/cli/gallery-screenshot.ts +279 -0
- package/src/cli-commands.ts +1 -0
- package/src/commands/gallery.ts +52 -0
- package/src/commands/launch.ts +1 -1
- package/src/config/keybindings.ts +68 -2
- package/src/config/model-equivalence.ts +35 -12
- package/src/config/model-id-affixes.ts +39 -22
- package/src/config/model-registry.ts +16 -16
- package/src/config/settings-schema.ts +29 -6
- package/src/config/settings.ts +11 -0
- package/src/dap/client.ts +14 -16
- package/src/debug/raw-sse.ts +18 -4
- package/src/edit/file-snapshot-store.ts +1 -1
- package/src/edit/index.ts +1 -1
- package/src/edit/renderer.ts +43 -55
- package/src/edit/streaming.ts +1 -1
- package/src/eval/__tests__/agent-bridge.test.ts +102 -58
- package/src/eval/__tests__/bridge-timeout.test.ts +64 -0
- package/src/eval/__tests__/idle-timeout.test.ts +26 -12
- package/src/eval/__tests__/kernel-spawn.test.ts +103 -0
- package/src/eval/__tests__/llm-bridge.test.ts +10 -10
- package/src/eval/agent-bridge.ts +38 -12
- package/src/eval/backend.ts +6 -6
- package/src/eval/bridge-timeout.ts +44 -0
- package/src/eval/idle-timeout.ts +33 -15
- package/src/eval/js/executor.ts +10 -10
- package/src/eval/llm-bridge.ts +4 -5
- package/src/eval/py/executor.ts +6 -6
- package/src/eval/py/kernel.ts +11 -1
- package/src/eval/py/spawn-options.ts +126 -0
- package/src/export/ttsr.ts +9 -0
- package/src/extensibility/extensions/runner.ts +3 -0
- package/src/extensibility/plugins/doctor.ts +0 -1
- package/src/extensibility/plugins/marketplace-auto-update.ts +49 -0
- package/src/goals/tools/goal-tool.ts +2 -2
- package/src/internal-urls/docs-index.generated.ts +7 -6
- package/src/lsp/client.ts +179 -52
- package/src/lsp/index.ts +38 -4
- package/src/lsp/render.ts +3 -3
- package/src/lsp/types.ts +10 -0
- package/src/main.ts +47 -52
- package/src/memory-backend/index.ts +13 -1
- package/src/memory-backend/resolve.ts +3 -5
- package/src/memory-backend/types.ts +1 -1
- package/src/modes/components/agent-dashboard.ts +13 -4
- package/src/modes/components/assistant-message.ts +22 -1
- package/src/modes/components/copy-selector.ts +249 -0
- package/src/modes/components/custom-editor.ts +10 -1
- package/src/modes/components/extensions/extension-list.ts +17 -8
- package/src/modes/components/history-search.ts +19 -11
- package/src/modes/components/model-selector.ts +125 -29
- package/src/modes/components/oauth-selector.ts +28 -12
- package/src/modes/components/session-observer-overlay.ts +13 -15
- package/src/modes/components/session-selector.ts +24 -13
- package/src/modes/components/status-line.ts +3 -5
- package/src/modes/components/tool-execution.ts +83 -24
- package/src/modes/components/tree-selector.ts +19 -7
- package/src/modes/components/user-message-selector.ts +25 -14
- package/src/modes/controllers/command-controller.ts +13 -118
- package/src/modes/controllers/event-controller.ts +26 -10
- package/src/modes/controllers/input-controller.ts +11 -3
- package/src/modes/controllers/selector-controller.ts +40 -3
- package/src/modes/index.ts +5 -4
- package/src/modes/interactive-mode.ts +21 -7
- package/src/modes/setup-version.ts +11 -0
- package/src/modes/setup-wizard/index.ts +3 -2
- package/src/modes/setup-wizard/scenes/web-search.ts +3 -2
- package/src/modes/theme/theme.ts +46 -10
- package/src/modes/types.ts +2 -2
- package/src/modes/utils/context-usage.ts +10 -6
- package/src/modes/utils/copy-targets.ts +254 -0
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/prompts/tools/ast-edit.md +1 -1
- package/src/prompts/tools/ast-grep.md +1 -1
- package/src/prompts/tools/read.md +1 -1
- package/src/prompts/tools/search.md +1 -1
- package/src/sdk.ts +21 -23
- package/src/session/agent-session.ts +13 -9
- package/src/slash-commands/builtin-registry.ts +4 -12
- package/src/slash-commands/helpers/usage-report.ts +2 -0
- package/src/task/executor.ts +20 -2
- package/src/task/render.ts +37 -11
- package/src/telemetry-export.ts +25 -7
- package/src/tools/bash.ts +18 -8
- package/src/tools/browser/render.ts +5 -4
- package/src/tools/debug.ts +3 -3
- package/src/tools/eval-backends.ts +6 -17
- package/src/tools/eval-render.ts +28 -10
- package/src/tools/eval.ts +19 -23
- package/src/tools/fetch.ts +99 -89
- package/src/tools/read.ts +7 -7
- package/src/tools/render-utils.ts +63 -3
- package/src/tools/renderers.ts +16 -1
- package/src/tools/report-tool-issue.ts +1 -1
- package/src/tools/search.ts +173 -81
- package/src/tools/ssh.ts +21 -8
- package/src/tools/todo.ts +20 -7
- package/src/tools/write.ts +39 -9
- package/src/tui/code-cell.ts +19 -4
- package/src/tui/output-block.ts +14 -0
- package/src/web/scrapers/github.ts +255 -3
- package/src/web/scrapers/youtube.ts +3 -2
- package/src/web/search/providers/perplexity.ts +199 -51
- package/src/web/search/render.ts +42 -57
- package/src/web/search/types.ts +5 -1
- package/dist/types/eval/heartbeat.d.ts +0 -45
- package/src/eval/__tests__/heartbeat.test.ts +0 -84
- package/src/eval/__tests__/shared-executors.test.ts +0 -609
- package/src/eval/heartbeat.ts +0 -74
- /package/dist/types/eval/__tests__/{heartbeat.test.d.ts → bridge-timeout.test.d.ts} +0 -0
- /package/dist/types/eval/__tests__/{shared-executors.test.d.ts → kernel-spawn.test.d.ts} +0 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
// Gallery fixtures for the agentic orchestration tools (task, goal, job).
|
|
2
|
+
import type { GalleryFixture } from "./types";
|
|
3
|
+
|
|
4
|
+
export const agenticFixtures: Record<string, GalleryFixture> = {
|
|
5
|
+
task: {
|
|
6
|
+
label: "Task",
|
|
7
|
+
customRendered: true,
|
|
8
|
+
// Streaming: agent chosen, first task fully arrived, second still landing.
|
|
9
|
+
streamingArgs: {
|
|
10
|
+
agent: "task",
|
|
11
|
+
tasks: [
|
|
12
|
+
{
|
|
13
|
+
id: "AuthLoader",
|
|
14
|
+
description: "Load auth middleware",
|
|
15
|
+
assignment: "Read packages/server/src/auth/*.ts and summarize the session-cookie flow.",
|
|
16
|
+
},
|
|
17
|
+
{ id: "RateLimiter", description: "Audit rate limiter" },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
agent: "task",
|
|
22
|
+
context: [
|
|
23
|
+
"# Goal",
|
|
24
|
+
"Harden the HTTP auth stack before the release cut.",
|
|
25
|
+
"# Constraints",
|
|
26
|
+
"Touch only files under packages/server/src/auth/. Do not run gates.",
|
|
27
|
+
].join("\n"),
|
|
28
|
+
tasks: [
|
|
29
|
+
{
|
|
30
|
+
id: "AuthLoader",
|
|
31
|
+
description: "Load auth middleware",
|
|
32
|
+
assignment:
|
|
33
|
+
"Read packages/server/src/auth/session.ts and middleware.ts, then document the session-cookie validation flow and any TODOs.",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "RateLimiter",
|
|
37
|
+
description: "Audit rate limiter",
|
|
38
|
+
assignment:
|
|
39
|
+
"Inspect packages/server/src/auth/rate-limit.ts. Confirm the 429 path sets Retry-After and report gaps.",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "TokenRotation",
|
|
43
|
+
description: "Check token rotation",
|
|
44
|
+
assignment:
|
|
45
|
+
"Trace refresh-token rotation in packages/server/src/auth/tokens.ts and flag any reuse window.",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
result: {
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: "text",
|
|
53
|
+
text: "3 agents completed: AuthLoader, RateLimiter, TokenRotation.",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
details: {
|
|
57
|
+
projectAgentsDir: null,
|
|
58
|
+
totalDurationMs: 48_200,
|
|
59
|
+
usage: { cost: { total: 0.34 } },
|
|
60
|
+
results: [
|
|
61
|
+
{
|
|
62
|
+
index: 0,
|
|
63
|
+
id: "AuthLoader",
|
|
64
|
+
agent: "task",
|
|
65
|
+
agentSource: "bundled",
|
|
66
|
+
description: "Load auth middleware",
|
|
67
|
+
task: "Read packages/server/src/auth/session.ts and middleware.ts",
|
|
68
|
+
assignment:
|
|
69
|
+
"Read packages/server/src/auth/session.ts and middleware.ts, then document the session-cookie validation flow and any TODOs.",
|
|
70
|
+
exitCode: 0,
|
|
71
|
+
output: [
|
|
72
|
+
"Session validation runs in middleware.ts:42 via verifySessionCookie().",
|
|
73
|
+
"Cookies are HMAC-signed (SHA-256) and checked against the session store.",
|
|
74
|
+
"TODO at session.ts:88 — sliding-expiration refresh is stubbed.",
|
|
75
|
+
].join("\n"),
|
|
76
|
+
stderr: "",
|
|
77
|
+
truncated: false,
|
|
78
|
+
durationMs: 41_900,
|
|
79
|
+
tokens: 61_400,
|
|
80
|
+
contextTokens: 23_100,
|
|
81
|
+
contextWindow: 200_000,
|
|
82
|
+
resolvedModel: "anthropic/claude-sonnet",
|
|
83
|
+
usage: { cost: { total: 0.12 } },
|
|
84
|
+
outputMeta: { lineCount: 3, charCount: 214 },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
index: 1,
|
|
88
|
+
id: "RateLimiter",
|
|
89
|
+
agent: "task",
|
|
90
|
+
agentSource: "bundled",
|
|
91
|
+
description: "Audit rate limiter",
|
|
92
|
+
task: "Inspect packages/server/src/auth/rate-limit.ts",
|
|
93
|
+
assignment:
|
|
94
|
+
"Inspect packages/server/src/auth/rate-limit.ts. Confirm the 429 path sets Retry-After and report gaps.",
|
|
95
|
+
exitCode: 0,
|
|
96
|
+
output: [
|
|
97
|
+
"rate-limit.ts uses a fixed-window counter keyed by client IP.",
|
|
98
|
+
"429 responses set Retry-After (rate-limit.ts:57).",
|
|
99
|
+
"Gap: no per-account limit, so a botnet across IPs bypasses the cap.",
|
|
100
|
+
].join("\n"),
|
|
101
|
+
stderr: "",
|
|
102
|
+
truncated: false,
|
|
103
|
+
durationMs: 38_500,
|
|
104
|
+
tokens: 54_800,
|
|
105
|
+
contextTokens: 19_700,
|
|
106
|
+
contextWindow: 200_000,
|
|
107
|
+
resolvedModel: "anthropic/claude-sonnet",
|
|
108
|
+
usage: { cost: { total: 0.1 } },
|
|
109
|
+
outputMeta: { lineCount: 3, charCount: 198 },
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
index: 2,
|
|
113
|
+
id: "TokenRotation",
|
|
114
|
+
agent: "task",
|
|
115
|
+
agentSource: "bundled",
|
|
116
|
+
description: "Check token rotation",
|
|
117
|
+
task: "Trace refresh-token rotation in packages/server/src/auth/tokens.ts",
|
|
118
|
+
assignment:
|
|
119
|
+
"Trace refresh-token rotation in packages/server/src/auth/tokens.ts and flag any reuse window.",
|
|
120
|
+
exitCode: 0,
|
|
121
|
+
output: [
|
|
122
|
+
"Refresh tokens rotate on every use (tokens.ts:120) and the old jti is revoked.",
|
|
123
|
+
"Reuse of a rotated token triggers full-family revocation — no reuse window found.",
|
|
124
|
+
].join("\n"),
|
|
125
|
+
stderr: "",
|
|
126
|
+
truncated: false,
|
|
127
|
+
durationMs: 48_200,
|
|
128
|
+
tokens: 49_200,
|
|
129
|
+
contextTokens: 17_500,
|
|
130
|
+
contextWindow: 200_000,
|
|
131
|
+
resolvedModel: "anthropic/claude-sonnet",
|
|
132
|
+
usage: { cost: { total: 0.12 } },
|
|
133
|
+
outputMeta: { lineCount: 2, charCount: 160 },
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
errorResult: {
|
|
139
|
+
isError: true,
|
|
140
|
+
content: [
|
|
141
|
+
{
|
|
142
|
+
type: "text",
|
|
143
|
+
text: "1 of 3 agents failed: RateLimiter.",
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
details: {
|
|
147
|
+
projectAgentsDir: null,
|
|
148
|
+
totalDurationMs: 39_400,
|
|
149
|
+
usage: { cost: { total: 0.21 } },
|
|
150
|
+
results: [
|
|
151
|
+
{
|
|
152
|
+
index: 0,
|
|
153
|
+
id: "AuthLoader",
|
|
154
|
+
agent: "task",
|
|
155
|
+
agentSource: "bundled",
|
|
156
|
+
description: "Load auth middleware",
|
|
157
|
+
task: "Read packages/server/src/auth/session.ts and middleware.ts",
|
|
158
|
+
assignment:
|
|
159
|
+
"Read packages/server/src/auth/session.ts and middleware.ts, then document the session-cookie validation flow and any TODOs.",
|
|
160
|
+
exitCode: 0,
|
|
161
|
+
output: "Session validation runs in middleware.ts:42 via verifySessionCookie().",
|
|
162
|
+
stderr: "",
|
|
163
|
+
truncated: false,
|
|
164
|
+
durationMs: 31_200,
|
|
165
|
+
tokens: 58_100,
|
|
166
|
+
contextTokens: 21_900,
|
|
167
|
+
contextWindow: 200_000,
|
|
168
|
+
resolvedModel: "anthropic/claude-sonnet",
|
|
169
|
+
usage: { cost: { total: 0.11 } },
|
|
170
|
+
outputMeta: { lineCount: 1, charCount: 70 },
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
index: 1,
|
|
174
|
+
id: "RateLimiter",
|
|
175
|
+
agent: "task",
|
|
176
|
+
agentSource: "bundled",
|
|
177
|
+
description: "Audit rate limiter",
|
|
178
|
+
task: "Inspect packages/server/src/auth/rate-limit.ts",
|
|
179
|
+
assignment:
|
|
180
|
+
"Inspect packages/server/src/auth/rate-limit.ts. Confirm the 429 path sets Retry-After and report gaps.",
|
|
181
|
+
exitCode: 1,
|
|
182
|
+
output: "",
|
|
183
|
+
stderr: "ENOENT: packages/server/src/auth/rate-limit.ts",
|
|
184
|
+
truncated: false,
|
|
185
|
+
durationMs: 9_800,
|
|
186
|
+
tokens: 12_300,
|
|
187
|
+
contextTokens: 6_400,
|
|
188
|
+
contextWindow: 200_000,
|
|
189
|
+
resolvedModel: "anthropic/claude-sonnet",
|
|
190
|
+
usage: { cost: { total: 0.1 } },
|
|
191
|
+
error: "Subagent exited 1: target file packages/server/src/auth/rate-limit.ts does not exist.",
|
|
192
|
+
outputMeta: { lineCount: 0, charCount: 0 },
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
goal: {
|
|
200
|
+
label: "Goal",
|
|
201
|
+
// Streaming: op is "create"; objective text still being typed.
|
|
202
|
+
streamingArgs: { op: "create", objective: "Ship the auth hardening" },
|
|
203
|
+
args: {
|
|
204
|
+
op: "create",
|
|
205
|
+
objective: "Ship the auth hardening pass: per-account rate limits and sliding session expiry.",
|
|
206
|
+
token_budget: 500_000,
|
|
207
|
+
},
|
|
208
|
+
result: {
|
|
209
|
+
content: [
|
|
210
|
+
{
|
|
211
|
+
type: "text",
|
|
212
|
+
text: "Goal set. Working toward: Ship the auth hardening pass.",
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
details: {
|
|
216
|
+
op: "create",
|
|
217
|
+
remainingTokens: 451_800,
|
|
218
|
+
completionBudgetReport: null,
|
|
219
|
+
goal: {
|
|
220
|
+
id: "goal_8f2a",
|
|
221
|
+
objective: "Ship the auth hardening pass: per-account rate limits and sliding session expiry.",
|
|
222
|
+
status: "active",
|
|
223
|
+
tokenBudget: 500_000,
|
|
224
|
+
tokensUsed: 48_200,
|
|
225
|
+
timeUsedSeconds: 312,
|
|
226
|
+
createdAt: 1_749_200_000_000,
|
|
227
|
+
updatedAt: 1_749_200_312_000,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
errorResult: {
|
|
232
|
+
isError: true,
|
|
233
|
+
content: [{ type: "text", text: "Goal tool failed: objective is required when op=create." }],
|
|
234
|
+
details: { op: "create" },
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
job: {
|
|
239
|
+
label: "Job",
|
|
240
|
+
// Streaming: polling a single job id; the second id is still arriving.
|
|
241
|
+
streamingArgs: { poll: ["job_a1"] },
|
|
242
|
+
args: { poll: ["job_a1", "job_b2", "job_c3"] },
|
|
243
|
+
result: {
|
|
244
|
+
content: [{ type: "text", text: "3 jobs settled." }],
|
|
245
|
+
details: {
|
|
246
|
+
jobs: [
|
|
247
|
+
{
|
|
248
|
+
id: "job_a1",
|
|
249
|
+
type: "bash",
|
|
250
|
+
status: "completed",
|
|
251
|
+
label: "bun test packages/server/test/auth.test.ts",
|
|
252
|
+
durationMs: 18_400,
|
|
253
|
+
resultText: "42 pass, 0 fail (18.4s)",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "job_b2",
|
|
257
|
+
type: "task",
|
|
258
|
+
status: "completed",
|
|
259
|
+
label: "Migrate rate limiter to a sliding window",
|
|
260
|
+
durationMs: 96_700,
|
|
261
|
+
resultText: "Rewrote rate-limit.ts to a token-bucket; added per-account keys.",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: "job_c3",
|
|
265
|
+
type: "bash",
|
|
266
|
+
status: "failed",
|
|
267
|
+
label: "bunx biome check packages/server/src/auth",
|
|
268
|
+
durationMs: 4_100,
|
|
269
|
+
errorText: "biome: 2 errors in tokens.ts — noUnusedVariables, useConst",
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
errorResult: {
|
|
275
|
+
isError: true,
|
|
276
|
+
content: [{ type: "text", text: "Job cancelled by user." }],
|
|
277
|
+
details: {
|
|
278
|
+
jobs: [
|
|
279
|
+
{
|
|
280
|
+
id: "job_d4",
|
|
281
|
+
type: "task",
|
|
282
|
+
status: "cancelled",
|
|
283
|
+
label: "Refactor the session store to Redis",
|
|
284
|
+
durationMs: 52_300,
|
|
285
|
+
errorText: "Aborted: superseded by goal re-scope.",
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
cancelled: [{ id: "job_d4", status: "cancelled" }],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/** Gallery fixtures for the code-intelligence tools (lsp, debug). */
|
|
2
|
+
import type { GalleryFixture } from "./types";
|
|
3
|
+
|
|
4
|
+
export const codeintelFixtures: Record<string, GalleryFixture> = {
|
|
5
|
+
lsp: {
|
|
6
|
+
label: "LSP",
|
|
7
|
+
customRendered: true,
|
|
8
|
+
streamingArgs: {
|
|
9
|
+
action: "references",
|
|
10
|
+
file: "src/server/auth.ts",
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
action: "references",
|
|
14
|
+
file: "src/server/auth.ts",
|
|
15
|
+
line: 42,
|
|
16
|
+
symbol: "validateToken",
|
|
17
|
+
},
|
|
18
|
+
result: {
|
|
19
|
+
content: [
|
|
20
|
+
{
|
|
21
|
+
type: "text",
|
|
22
|
+
text: [
|
|
23
|
+
"Found 6 reference(s):",
|
|
24
|
+
" src/server/auth.ts:42:14",
|
|
25
|
+
" 41: ",
|
|
26
|
+
" 42: export function validateToken(token: string): Claims {",
|
|
27
|
+
" 43: const claims = verifyJwt(token);",
|
|
28
|
+
" src/server/auth.ts:118:21",
|
|
29
|
+
' 117: if (!header) throw new HttpError(401, "missing token");',
|
|
30
|
+
" 118: const claims = validateToken(stripBearer(header));",
|
|
31
|
+
" 119: return claims.sub;",
|
|
32
|
+
" src/server/middleware/session.ts:57:18",
|
|
33
|
+
" 56: const token = req.cookies.session;",
|
|
34
|
+
" 57: const claims = validateToken(token);",
|
|
35
|
+
" 58: req.userId = claims.sub;",
|
|
36
|
+
" src/server/router.ts:153:20",
|
|
37
|
+
" 152: router.use(async (req, res, next) => {",
|
|
38
|
+
" 153: req.claims = await validateToken(req.token);",
|
|
39
|
+
" 154: next();",
|
|
40
|
+
" test/auth.test.ts:24:9",
|
|
41
|
+
' 23: it("rejects expired tokens", () => {',
|
|
42
|
+
" 24: expect(() => validateToken(expired)).toThrow(/expired/);",
|
|
43
|
+
" 25: });",
|
|
44
|
+
" test/auth.test.ts:41:9",
|
|
45
|
+
' 40: it("accepts valid tokens", () => {',
|
|
46
|
+
" 41: const claims = validateToken(signed);",
|
|
47
|
+
' 42: expect(claims.sub).toBe("u_123");',
|
|
48
|
+
].join("\n"),
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
details: {
|
|
52
|
+
serverName: "typescript-language-server",
|
|
53
|
+
action: "references",
|
|
54
|
+
success: true,
|
|
55
|
+
request: {
|
|
56
|
+
action: "references",
|
|
57
|
+
file: "src/server/auth.ts",
|
|
58
|
+
line: 42,
|
|
59
|
+
symbol: "validateToken",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
errorResult: {
|
|
64
|
+
content: [
|
|
65
|
+
{
|
|
66
|
+
type: "text",
|
|
67
|
+
text: "No language server found for this file",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
isError: true,
|
|
71
|
+
details: {
|
|
72
|
+
serverName: "typescript-language-server",
|
|
73
|
+
action: "references",
|
|
74
|
+
success: false,
|
|
75
|
+
request: {
|
|
76
|
+
action: "references",
|
|
77
|
+
file: "src/server/auth.ts",
|
|
78
|
+
line: 42,
|
|
79
|
+
symbol: "validateToken",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
debug: {
|
|
86
|
+
label: "Debug",
|
|
87
|
+
streamingArgs: {
|
|
88
|
+
action: "stack_trace",
|
|
89
|
+
},
|
|
90
|
+
args: {
|
|
91
|
+
action: "stack_trace",
|
|
92
|
+
levels: 20,
|
|
93
|
+
},
|
|
94
|
+
result: {
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: "text",
|
|
98
|
+
text: [
|
|
99
|
+
"Stack trace:",
|
|
100
|
+
"- #1000 validate_token @ app/server.py:42:14",
|
|
101
|
+
"- #1001 authenticate @ app/server.py:88:9",
|
|
102
|
+
"- #1002 handle_request @ app/router.py:153:20",
|
|
103
|
+
"- #1003 dispatch @ app/router.py:97:5",
|
|
104
|
+
"- #1004 <module> @ app/server.py:212:1",
|
|
105
|
+
].join("\n"),
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
details: {
|
|
109
|
+
action: "stack_trace",
|
|
110
|
+
success: true,
|
|
111
|
+
snapshot: {
|
|
112
|
+
id: "dbg-1",
|
|
113
|
+
adapter: "debugpy",
|
|
114
|
+
cwd: "/Users/dev/project",
|
|
115
|
+
program: "./app/server.py",
|
|
116
|
+
status: "stopped",
|
|
117
|
+
launchedAt: "2026-06-06T14:21:08.412Z",
|
|
118
|
+
lastUsedAt: "2026-06-06T14:22:55.901Z",
|
|
119
|
+
threadId: 1,
|
|
120
|
+
frameId: 1000,
|
|
121
|
+
stopReason: "breakpoint",
|
|
122
|
+
stopDescription: "breakpoint 2",
|
|
123
|
+
frameName: "validate_token",
|
|
124
|
+
instructionPointerReference: "0x00000001000034a8",
|
|
125
|
+
source: { name: "server.py", path: "app/server.py" },
|
|
126
|
+
line: 42,
|
|
127
|
+
column: 14,
|
|
128
|
+
breakpointFiles: 1,
|
|
129
|
+
breakpointCount: 2,
|
|
130
|
+
functionBreakpointCount: 0,
|
|
131
|
+
outputBytes: 248,
|
|
132
|
+
outputTruncated: false,
|
|
133
|
+
needsConfigurationDone: false,
|
|
134
|
+
},
|
|
135
|
+
stackFrames: [
|
|
136
|
+
{
|
|
137
|
+
id: 1000,
|
|
138
|
+
name: "validate_token",
|
|
139
|
+
source: { name: "server.py", path: "app/server.py" },
|
|
140
|
+
line: 42,
|
|
141
|
+
column: 14,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 1001,
|
|
145
|
+
name: "authenticate",
|
|
146
|
+
source: { name: "server.py", path: "app/server.py" },
|
|
147
|
+
line: 88,
|
|
148
|
+
column: 9,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 1002,
|
|
152
|
+
name: "handle_request",
|
|
153
|
+
source: { name: "router.py", path: "app/router.py" },
|
|
154
|
+
line: 153,
|
|
155
|
+
column: 20,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 1003,
|
|
159
|
+
name: "dispatch",
|
|
160
|
+
source: { name: "router.py", path: "app/router.py" },
|
|
161
|
+
line: 97,
|
|
162
|
+
column: 5,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 1004,
|
|
166
|
+
name: "<module>",
|
|
167
|
+
source: { name: "server.py", path: "app/server.py" },
|
|
168
|
+
line: 212,
|
|
169
|
+
column: 1,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
errorResult: {
|
|
175
|
+
content: [
|
|
176
|
+
{
|
|
177
|
+
type: "text",
|
|
178
|
+
text: "No active debug session. Launch or attach first.",
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
isError: true,
|
|
182
|
+
details: {
|
|
183
|
+
action: "stack_trace",
|
|
184
|
+
success: false,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/** Gallery fixtures for the edit tools (edit, apply_patch, ast_edit). */
|
|
2
|
+
import type { GalleryFixture } from "./types";
|
|
3
|
+
|
|
4
|
+
export const editFixtures: Record<string, GalleryFixture> = {
|
|
5
|
+
edit: {
|
|
6
|
+
label: "Edit",
|
|
7
|
+
editMode: "replace",
|
|
8
|
+
// `previewDiff` is surfaced verbatim by the renderer's call preview, and the
|
|
9
|
+
// harness diff strategy skips `{ file_path, previewDiff }` (no `path`/`edits`),
|
|
10
|
+
// so the canned diff survives the streaming and progress states.
|
|
11
|
+
streamingArgs: {
|
|
12
|
+
file_path: "packages/coding-agent/src/tools/read.ts",
|
|
13
|
+
previewDiff: [
|
|
14
|
+
"@@ -88,3 +88,4 @@",
|
|
15
|
+
" const offset = args.offset ?? 1;",
|
|
16
|
+
"- const limit = args.limit ?? 2000;",
|
|
17
|
+
"+ const limit = args.limit ?? 4000;",
|
|
18
|
+
].join("\n"),
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
file_path: "packages/coding-agent/src/tools/read.ts",
|
|
22
|
+
previewDiff: [
|
|
23
|
+
"@@ -88,5 +88,6 @@",
|
|
24
|
+
" const offset = args.offset ?? 1;",
|
|
25
|
+
"- const limit = args.limit ?? 2000;",
|
|
26
|
+
"+ const limit = args.limit ?? 4000;",
|
|
27
|
+
" const raw = await Bun.file(path).text();",
|
|
28
|
+
"- return raw.slice(offset, offset + limit);",
|
|
29
|
+
'+ return raw.split("\\n").slice(offset - 1, offset - 1 + limit).join("\\n");',
|
|
30
|
+
].join("\n"),
|
|
31
|
+
},
|
|
32
|
+
result: {
|
|
33
|
+
content: [{ type: "text", text: "Edited packages/coding-agent/src/tools/read.ts (1 hunk, +3 -2)" }],
|
|
34
|
+
details: {
|
|
35
|
+
path: "packages/coding-agent/src/tools/read.ts",
|
|
36
|
+
firstChangedLine: 89,
|
|
37
|
+
diff: [
|
|
38
|
+
"@@ -88,5 +88,6 @@",
|
|
39
|
+
" const offset = args.offset ?? 1;",
|
|
40
|
+
"- const limit = args.limit ?? 2000;",
|
|
41
|
+
"+ const limit = args.limit ?? 4000;",
|
|
42
|
+
" const raw = await Bun.file(path).text();",
|
|
43
|
+
"- return raw.slice(offset, offset + limit);",
|
|
44
|
+
'+ return raw.split("\\n").slice(offset - 1, offset - 1 + limit).join("\\n");',
|
|
45
|
+
].join("\n"),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
errorResult: {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: "text",
|
|
52
|
+
text: "Edit failed: the search text was not found in packages/coding-agent/src/tools/read.ts",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
isError: true,
|
|
56
|
+
details: {
|
|
57
|
+
path: "packages/coding-agent/src/tools/read.ts",
|
|
58
|
+
diff: "",
|
|
59
|
+
errorText:
|
|
60
|
+
"No match for the search text. Expected `const limit = args.limit ?? 2000;` near line 89, but the file has `const limit = args.limit ?? 1000;`. Re-read the file and retry with the current contents.",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
apply_patch: {
|
|
66
|
+
label: "Apply Patch",
|
|
67
|
+
editMode: "apply_patch",
|
|
68
|
+
streamingArgs: {
|
|
69
|
+
file_path: "packages/coding-agent/src/edit/renderer.ts",
|
|
70
|
+
previewDiff: [
|
|
71
|
+
"@@ -464,2 +464,2 @@",
|
|
72
|
+
"- fileCount = countEditFiles(editArgs.edits);",
|
|
73
|
+
"+ fileCount = countDistinctFiles(editArgs.edits);",
|
|
74
|
+
].join("\n"),
|
|
75
|
+
},
|
|
76
|
+
args: {
|
|
77
|
+
file_path: "packages/coding-agent/src/edit/renderer.ts",
|
|
78
|
+
previewDiff: [
|
|
79
|
+
"@@ -177,4 +177,4 @@",
|
|
80
|
+
" /** Count distinct file paths in an edits array. */",
|
|
81
|
+
"-function countEditFiles(edits: EditRenderEntry[]): number {",
|
|
82
|
+
"+function countDistinctFiles(edits: EditRenderEntry[]): number {",
|
|
83
|
+
" return new Set(edits.map(edit => filePathFromEditEntry(edit.path)).filter(Boolean)).size;",
|
|
84
|
+
" }",
|
|
85
|
+
"@@ -467,2 +467,2 @@",
|
|
86
|
+
"- fileCount = countEditFiles(editArgs.edits);",
|
|
87
|
+
"+ fileCount = countDistinctFiles(editArgs.edits);",
|
|
88
|
+
].join("\n"),
|
|
89
|
+
},
|
|
90
|
+
result: {
|
|
91
|
+
content: [
|
|
92
|
+
{ type: "text", text: "Applied patch to packages/coding-agent/src/edit/renderer.ts (2 hunks, +2 -2)" },
|
|
93
|
+
],
|
|
94
|
+
details: {
|
|
95
|
+
op: "update",
|
|
96
|
+
path: "packages/coding-agent/src/edit/renderer.ts",
|
|
97
|
+
firstChangedLine: 178,
|
|
98
|
+
diff: [
|
|
99
|
+
"@@ -177,4 +177,4 @@",
|
|
100
|
+
" /** Count distinct file paths in an edits array. */",
|
|
101
|
+
"-function countEditFiles(edits: EditRenderEntry[]): number {",
|
|
102
|
+
"+function countDistinctFiles(edits: EditRenderEntry[]): number {",
|
|
103
|
+
" return new Set(edits.map(edit => filePathFromEditEntry(edit.path)).filter(Boolean)).size;",
|
|
104
|
+
" }",
|
|
105
|
+
"@@ -467,2 +467,2 @@",
|
|
106
|
+
"- fileCount = countEditFiles(editArgs.edits);",
|
|
107
|
+
"+ fileCount = countDistinctFiles(editArgs.edits);",
|
|
108
|
+
].join("\n"),
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
errorResult: {
|
|
112
|
+
content: [
|
|
113
|
+
{
|
|
114
|
+
type: "text",
|
|
115
|
+
text: "Apply patch failed: context does not match at line 177 of packages/coding-agent/src/edit/renderer.ts",
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
isError: true,
|
|
119
|
+
details: {
|
|
120
|
+
op: "update",
|
|
121
|
+
path: "packages/coding-agent/src/edit/renderer.ts",
|
|
122
|
+
diff: "",
|
|
123
|
+
errorText:
|
|
124
|
+
"Hunk @@ -177,4 +177,4 @@ failed to apply: the context line `function countEditFiles(edits: EditRenderEntry[]): number {` does not match the file. The file may have changed since it was read.",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
ast_edit: {
|
|
130
|
+
label: "AST Edit",
|
|
131
|
+
streamingArgs: {
|
|
132
|
+
ops: [{ pat: "countEditFiles($$$ARGS)" }],
|
|
133
|
+
paths: ["packages/coding-agent/src/**/*.ts"],
|
|
134
|
+
},
|
|
135
|
+
args: {
|
|
136
|
+
ops: [{ pat: "countEditFiles($$$ARGS)", out: "countDistinctFiles($$$ARGS)" }],
|
|
137
|
+
paths: ["packages/coding-agent/src/**/*.ts"],
|
|
138
|
+
},
|
|
139
|
+
result: {
|
|
140
|
+
content: [
|
|
141
|
+
{
|
|
142
|
+
type: "text",
|
|
143
|
+
text: [
|
|
144
|
+
"# edit/renderer.ts (2 replacements)",
|
|
145
|
+
"-468: fileCount = countEditFiles(editArgs.edits);",
|
|
146
|
+
"+468: fileCount = countDistinctFiles(editArgs.edits);",
|
|
147
|
+
"-488: const totalFiles = args?.edits ? countEditFiles(args.edits) : 0;",
|
|
148
|
+
"+488: const totalFiles = args?.edits ? countDistinctFiles(args.edits) : 0;",
|
|
149
|
+
"",
|
|
150
|
+
"# tools/tool-result.ts (1 replacement)",
|
|
151
|
+
"-42: return countEditFiles(files);",
|
|
152
|
+
"+42: return countDistinctFiles(files);",
|
|
153
|
+
].join("\n"),
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
details: {
|
|
157
|
+
totalReplacements: 3,
|
|
158
|
+
filesTouched: 2,
|
|
159
|
+
filesSearched: 214,
|
|
160
|
+
applied: false,
|
|
161
|
+
limitReached: false,
|
|
162
|
+
scopePath: "packages/coding-agent/src",
|
|
163
|
+
searchPath: "/Users/dev/Projects/pi/packages/coding-agent/src",
|
|
164
|
+
files: ["edit/renderer.ts", "tools/tool-result.ts"],
|
|
165
|
+
fileReplacements: [
|
|
166
|
+
{ path: "edit/renderer.ts", count: 2 },
|
|
167
|
+
{ path: "tools/tool-result.ts", count: 1 },
|
|
168
|
+
],
|
|
169
|
+
displayContent: [
|
|
170
|
+
"# edit/",
|
|
171
|
+
"## renderer.ts (2 replacements)",
|
|
172
|
+
"-468│ fileCount = countEditFiles(editArgs.edits);",
|
|
173
|
+
"+468│ fileCount = countDistinctFiles(editArgs.edits);",
|
|
174
|
+
"-488│ const totalFiles = args?.edits ? countEditFiles(args.edits) : 0;",
|
|
175
|
+
"+488│ const totalFiles = args?.edits ? countDistinctFiles(args.edits) : 0;",
|
|
176
|
+
"",
|
|
177
|
+
"# tools/",
|
|
178
|
+
"## tool-result.ts (1 replacement)",
|
|
179
|
+
"-42│ return countEditFiles(files);",
|
|
180
|
+
"+42│ return countDistinctFiles(files);",
|
|
181
|
+
].join("\n"),
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
errorResult: {
|
|
185
|
+
content: [
|
|
186
|
+
{
|
|
187
|
+
type: "text",
|
|
188
|
+
text: "Pattern parse error in ops[0].pat: unbalanced parenthesis in `countEditFiles($$$ARGS`",
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
isError: true,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
};
|