@oh-my-pi/pi-coding-agent 15.9.67 → 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 +63 -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 +6 -1
- 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 +32 -6
- 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/custom-editor.d.ts +2 -1
- package/dist/types/modes/components/tool-execution.d.ts +18 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
- package/dist/types/modes/index.d.ts +5 -4
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- 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 +1 -1
- 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 -8
- package/dist/types/tools/fetch.d.ts +15 -7
- package/dist/types/tools/render-utils.d.ts +8 -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/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/cli/args.ts +2 -2
- 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 +15 -6
- 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 +18 -5
- package/src/config/settings.ts +11 -0
- package/src/dap/client.ts +14 -16
- package/src/edit/renderer.ts +36 -48
- package/src/eval/__tests__/agent-bridge.test.ts +75 -32
- package/src/eval/agent-bridge.ts +34 -7
- package/src/extensibility/extensions/runner.ts +1 -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 +5 -5
- package/src/lsp/client.ts +104 -55
- package/src/lsp/types.ts +10 -0
- package/src/main.ts +44 -49
- 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/custom-editor.ts +10 -1
- package/src/modes/components/status-line.ts +3 -5
- package/src/modes/components/tool-execution.ts +61 -16
- package/src/modes/controllers/command-controller.ts +13 -2
- package/src/modes/controllers/input-controller.ts +11 -3
- package/src/modes/controllers/selector-controller.ts +2 -2
- package/src/modes/index.ts +5 -4
- package/src/modes/interactive-mode.ts +17 -3
- 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/types.ts +1 -1
- package/src/modes/utils/context-usage.ts +10 -6
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/sdk.ts +21 -23
- package/src/session/agent-session.ts +7 -7
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/slash-commands/helpers/usage-report.ts +2 -0
- package/src/task/executor.ts +20 -2
- package/src/task/render.ts +1 -2
- package/src/telemetry-export.ts +25 -7
- package/src/tools/eval-backends.ts +6 -17
- package/src/tools/eval-render.ts +21 -18
- package/src/tools/eval.ts +5 -4
- package/src/tools/fetch.ts +94 -84
- package/src/tools/render-utils.ts +17 -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/todo.ts +20 -7
- package/src/tools/write.ts +22 -1
- 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 +39 -54
- package/src/web/search/types.ts +5 -1
- package/dist/types/eval/__tests__/shared-executors.test.d.ts +0 -1
- package/src/eval/__tests__/shared-executors.test.ts +0 -609
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// biome-ignore-all lint/suspicious/noTemplateCurlyInString: sample source-code strings (read fixtures) intentionally contain literal ${...}.
|
|
2
|
+
// Gallery fixtures for the filesystem tools (read, write, find).
|
|
3
|
+
import type { GalleryFixture } from "./types";
|
|
4
|
+
|
|
5
|
+
const readSnippet = [
|
|
6
|
+
"export const findToolRenderer = {",
|
|
7
|
+
"\tinline: true,",
|
|
8
|
+
"\trenderCall(args: FindRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component {",
|
|
9
|
+
"\t\tconst meta: string[] = [];",
|
|
10
|
+
"\t\tif (args.limit !== undefined) meta.push(`limit:${args.limit}`);",
|
|
11
|
+
"",
|
|
12
|
+
"\t\tconst text = renderStatusLine(",
|
|
13
|
+
'\t\t\t{ icon: "pending", title: "Find", description: formatFindRenderPaths(args.paths) || "*", meta },',
|
|
14
|
+
"\t\t\tuiTheme,",
|
|
15
|
+
"\t\t);",
|
|
16
|
+
"\t\treturn new Text(text, 0, 0);",
|
|
17
|
+
"\t},",
|
|
18
|
+
].join("\n");
|
|
19
|
+
|
|
20
|
+
const writtenContent = [
|
|
21
|
+
'import { describe, expect, it } from "bun:test";',
|
|
22
|
+
'import { parseSel } from "../src/tools/read";',
|
|
23
|
+
"",
|
|
24
|
+
'describe("parseSel", () => {',
|
|
25
|
+
'\tit("parses a single line range", () => {',
|
|
26
|
+
'\t\texpect(parseSel("42-58")).toEqual({',
|
|
27
|
+
'\t\t\tkind: "lines",',
|
|
28
|
+
"\t\t\tranges: [{ startLine: 42, endLine: 58 }],",
|
|
29
|
+
"\t\t});",
|
|
30
|
+
"\t});",
|
|
31
|
+
"",
|
|
32
|
+
'\tit("treats raw as a verbatim selector", () => {',
|
|
33
|
+
'\t\texpect(parseSel("raw")).toEqual({ kind: "raw" });',
|
|
34
|
+
"\t});",
|
|
35
|
+
"});",
|
|
36
|
+
"",
|
|
37
|
+
].join("\n");
|
|
38
|
+
|
|
39
|
+
export const fsFixtures: Record<string, GalleryFixture> = {
|
|
40
|
+
read: {
|
|
41
|
+
label: "Read",
|
|
42
|
+
// Streaming: path still being typed, selector not yet appended.
|
|
43
|
+
streamingArgs: { path: "packages/coding-agent/src/tools/find" },
|
|
44
|
+
args: { path: "packages/coding-agent/src/tools/find.ts:437-448" },
|
|
45
|
+
result: {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: "text",
|
|
49
|
+
text: [
|
|
50
|
+
"[packages/coding-agent/src/tools/find.ts#E48E]",
|
|
51
|
+
"437:export const findToolRenderer = {",
|
|
52
|
+
"438:\tinline: true,",
|
|
53
|
+
"439:\trenderCall(args: FindRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component {",
|
|
54
|
+
"440:\t\tconst meta: string[] = [];",
|
|
55
|
+
"441:\t\tif (args.limit !== undefined) meta.push(`limit:${args.limit}`);",
|
|
56
|
+
"442:",
|
|
57
|
+
"443:\t\tconst text = renderStatusLine(",
|
|
58
|
+
'444:\t\t\t{ icon: "pending", title: "Find", description: formatFindRenderPaths(args.paths) || "*", meta },',
|
|
59
|
+
"445:\t\t\tuiTheme,",
|
|
60
|
+
"446:\t\t);",
|
|
61
|
+
"447:\t\treturn new Text(text, 0, 0);",
|
|
62
|
+
"448:\t},",
|
|
63
|
+
].join("\n"),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
details: {
|
|
67
|
+
kind: "file",
|
|
68
|
+
resolvedPath: "/Users/dev/Projects/pi/packages/coding-agent/src/tools/find.ts",
|
|
69
|
+
contentType: "text/typescript",
|
|
70
|
+
displayContent: { text: readSnippet, startLine: 437 },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
errorResult: {
|
|
74
|
+
isError: true,
|
|
75
|
+
content: [
|
|
76
|
+
{
|
|
77
|
+
type: "text",
|
|
78
|
+
text: "Error: ENOENT: no such file or directory, open 'packages/coding-agent/src/tools/find.ts'",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
write: {
|
|
85
|
+
label: "Write",
|
|
86
|
+
// Streaming: path known, content still arriving (only the imports so far).
|
|
87
|
+
streamingArgs: {
|
|
88
|
+
path: "packages/coding-agent/test/parse-sel.test.ts",
|
|
89
|
+
content: 'import { describe, expect, it } from "bun:test";\nimport { parseSel } from "../src/tools/read";\n',
|
|
90
|
+
},
|
|
91
|
+
args: {
|
|
92
|
+
path: "packages/coding-agent/test/parse-sel.test.ts",
|
|
93
|
+
content: writtenContent,
|
|
94
|
+
},
|
|
95
|
+
result: {
|
|
96
|
+
content: [
|
|
97
|
+
{
|
|
98
|
+
type: "text",
|
|
99
|
+
text: "Created packages/coding-agent/test/parse-sel.test.ts (17 lines, 412 bytes).",
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
details: {},
|
|
103
|
+
},
|
|
104
|
+
errorResult: {
|
|
105
|
+
isError: true,
|
|
106
|
+
content: [
|
|
107
|
+
{
|
|
108
|
+
type: "text",
|
|
109
|
+
text: "Error: EACCES: permission denied, open 'packages/coding-agent/test/parse-sel.test.ts'",
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
find: {
|
|
116
|
+
label: "Find",
|
|
117
|
+
// Streaming: glob half-typed, no limit yet.
|
|
118
|
+
streamingArgs: { paths: ["packages/coding-agent/src/tools/*-render"] },
|
|
119
|
+
args: { paths: ["packages/coding-agent/src/**/*.test.ts"], limit: 50 },
|
|
120
|
+
result: {
|
|
121
|
+
content: [
|
|
122
|
+
{
|
|
123
|
+
type: "text",
|
|
124
|
+
text: [
|
|
125
|
+
"packages/coding-agent/src/tools/read.test.ts",
|
|
126
|
+
"packages/coding-agent/src/tools/write.test.ts",
|
|
127
|
+
"packages/coding-agent/src/tools/find.test.ts",
|
|
128
|
+
"packages/coding-agent/src/cli/gallery-cli.test.ts",
|
|
129
|
+
"packages/coding-agent/src/edit/edit.test.ts",
|
|
130
|
+
].join("\n"),
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
details: {
|
|
134
|
+
scopePath: "packages/coding-agent/src",
|
|
135
|
+
cwd: "/Users/dev/Projects/pi",
|
|
136
|
+
fileCount: 5,
|
|
137
|
+
truncated: false,
|
|
138
|
+
files: [
|
|
139
|
+
"packages/coding-agent/src/cli/gallery-cli.test.ts",
|
|
140
|
+
"packages/coding-agent/src/edit/edit.test.ts",
|
|
141
|
+
"packages/coding-agent/src/tools/find.test.ts",
|
|
142
|
+
"packages/coding-agent/src/tools/read.test.ts",
|
|
143
|
+
"packages/coding-agent/src/tools/write.test.ts",
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
errorResult: {
|
|
148
|
+
isError: true,
|
|
149
|
+
content: [{ type: "text", text: "Find failed: invalid glob pattern '[unclosed'." }],
|
|
150
|
+
details: { error: "invalid glob pattern '[unclosed'" },
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregated sample data for the `omp gallery` command.
|
|
3
|
+
*
|
|
4
|
+
* Each fixture drives one tool's renderer through the four lifecycle states the
|
|
5
|
+
* gallery showcases: arguments streaming in, arguments complete but awaiting a
|
|
6
|
+
* result, a successful result, and a failed result. The data is intentionally
|
|
7
|
+
* hand-written (rather than schema-derived) so the gallery reflects what a real
|
|
8
|
+
* tool call looks like — the whole point is visual QA of the renderers.
|
|
9
|
+
*
|
|
10
|
+
* Fixtures are grouped by subsystem into sibling modules and merged here.
|
|
11
|
+
* Adding a tool to one of those groups is enough for the gallery to render it.
|
|
12
|
+
* Tools present in the renderer registry but missing here fall back to a
|
|
13
|
+
* generic fixture (see `gallery-cli.ts`), so the gallery never crashes on a
|
|
14
|
+
* newly added tool — it just looks plain until a fixture is supplied.
|
|
15
|
+
*/
|
|
16
|
+
import { agenticFixtures } from "./agentic";
|
|
17
|
+
import { codeintelFixtures } from "./codeintel";
|
|
18
|
+
import { editFixtures } from "./edit";
|
|
19
|
+
import { fsFixtures } from "./fs";
|
|
20
|
+
import { interactionFixtures } from "./interaction";
|
|
21
|
+
import { memoryFixtures } from "./memory";
|
|
22
|
+
import { miscFixtures } from "./misc";
|
|
23
|
+
import { searchFixtures } from "./search";
|
|
24
|
+
import { shellFixtures } from "./shell";
|
|
25
|
+
import { webFixtures } from "./web";
|
|
26
|
+
|
|
27
|
+
export * from "./types";
|
|
28
|
+
|
|
29
|
+
export const galleryFixtures = {
|
|
30
|
+
...interactionFixtures,
|
|
31
|
+
...shellFixtures,
|
|
32
|
+
...fsFixtures,
|
|
33
|
+
...searchFixtures,
|
|
34
|
+
...editFixtures,
|
|
35
|
+
...agenticFixtures,
|
|
36
|
+
...memoryFixtures,
|
|
37
|
+
...webFixtures,
|
|
38
|
+
...codeintelFixtures,
|
|
39
|
+
...miscFixtures,
|
|
40
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Gallery fixtures for the todo / ask / resolve interaction tools. */
|
|
2
|
+
import type { GalleryFixture } from "./types";
|
|
3
|
+
|
|
4
|
+
export const interactionFixtures: Record<string, GalleryFixture> = {
|
|
5
|
+
todo: {
|
|
6
|
+
label: "Todo",
|
|
7
|
+
streamingArgs: {
|
|
8
|
+
ops: [{ op: "init", list: [{ phase: "Foundation", items: ["Scaffold crate"] }] }],
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
ops: [
|
|
12
|
+
{
|
|
13
|
+
op: "init",
|
|
14
|
+
list: [
|
|
15
|
+
{ phase: "Foundation", items: ["Scaffold crate", "Wire workspace"] },
|
|
16
|
+
{ phase: "Auth", items: ["Port credential store", "Wire OAuth providers"] },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
result: {
|
|
22
|
+
content: [{ type: "text", text: "Initialized 4 tasks across 2 phases" }],
|
|
23
|
+
details: {
|
|
24
|
+
storage: "session",
|
|
25
|
+
phases: [
|
|
26
|
+
{
|
|
27
|
+
name: "Foundation",
|
|
28
|
+
tasks: [
|
|
29
|
+
{ content: "Scaffold crate", status: "done" },
|
|
30
|
+
{ content: "Wire workspace", status: "in_progress" },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Auth",
|
|
35
|
+
tasks: [
|
|
36
|
+
{ content: "Port credential store", status: "pending" },
|
|
37
|
+
{ content: "Wire OAuth providers", status: "pending" },
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
completedTasks: [{ phase: "Foundation", content: "Scaffold crate" }],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
errorResult: {
|
|
45
|
+
content: [{ type: "text", text: "Unknown phase 'Auth' — initialize the list first" }],
|
|
46
|
+
isError: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Gallery fixtures for the long-term memory tools (retain, recall, reflect).
|
|
2
|
+
import type { GalleryFixture } from "./types";
|
|
3
|
+
|
|
4
|
+
export const memoryFixtures: Record<string, GalleryFixture> = {
|
|
5
|
+
retain: {
|
|
6
|
+
label: "Retain",
|
|
7
|
+
// Streaming: first item complete, second still arriving without a context.
|
|
8
|
+
streamingArgs: {
|
|
9
|
+
items: [{ content: "User prefers Bun over Node for all new scripts in this repo." }],
|
|
10
|
+
},
|
|
11
|
+
args: {
|
|
12
|
+
items: [
|
|
13
|
+
{
|
|
14
|
+
content: "User prefers Bun over Node for all new scripts in this repo.",
|
|
15
|
+
context: "Established while wiring up the gallery command tooling.",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
content: "The TUI renderers live in packages/coding-agent/src/tools/*-render.ts.",
|
|
19
|
+
context: "Discovered during the gallery-fixtures task.",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
result: {
|
|
24
|
+
content: [{ type: "text", text: "2 memories stored." }],
|
|
25
|
+
details: { count: 2 },
|
|
26
|
+
},
|
|
27
|
+
errorResult: {
|
|
28
|
+
isError: true,
|
|
29
|
+
content: [{ type: "text", text: "Retain failed: memory store is not initialized." }],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
recall: {
|
|
34
|
+
label: "Recall",
|
|
35
|
+
// Streaming: query partially typed.
|
|
36
|
+
streamingArgs: { query: "bun vs node" },
|
|
37
|
+
args: { query: "Which runtime does the user prefer for scripts?" },
|
|
38
|
+
result: {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
text: [
|
|
43
|
+
"Found 2 relevant memories:",
|
|
44
|
+
"",
|
|
45
|
+
"1. [0.92] User prefers Bun over Node for all new scripts in this repo.",
|
|
46
|
+
" (Established while wiring up the gallery command tooling.)",
|
|
47
|
+
"2. [0.78] The TUI renderers live in packages/coding-agent/src/tools/*-render.ts.",
|
|
48
|
+
" (Discovered during the gallery-fixtures task.)",
|
|
49
|
+
].join("\n"),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
errorResult: {
|
|
54
|
+
isError: true,
|
|
55
|
+
content: [{ type: "text", text: "Recall failed: vector index unavailable." }],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
reflect: {
|
|
60
|
+
label: "Reflect",
|
|
61
|
+
streamingArgs: { query: "what have we learned about the user's" },
|
|
62
|
+
args: { query: "What have we learned about the user's tooling preferences?" },
|
|
63
|
+
result: {
|
|
64
|
+
content: [
|
|
65
|
+
{
|
|
66
|
+
type: "text",
|
|
67
|
+
text: [
|
|
68
|
+
"The user consistently favors Bun as the runtime for scripts in this",
|
|
69
|
+
"repository, avoiding Node where possible. They also track the location",
|
|
70
|
+
"of TUI renderers under packages/coding-agent/src/tools, suggesting an",
|
|
71
|
+
"interest in keeping rendering logic discoverable and well-organized.",
|
|
72
|
+
].join("\n"),
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
errorResult: {
|
|
77
|
+
isError: true,
|
|
78
|
+
content: [{ type: "text", text: "Reflect failed: no memories matched the query." }],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/** Gallery fixtures for the ask / resolve / ssh / github / inspect_image tools. */
|
|
2
|
+
import type { GalleryFixture } from "./types";
|
|
3
|
+
|
|
4
|
+
export const miscFixtures: Record<string, GalleryFixture> = {
|
|
5
|
+
ask: {
|
|
6
|
+
label: "Ask",
|
|
7
|
+
streamingArgs: {
|
|
8
|
+
questions: [
|
|
9
|
+
{
|
|
10
|
+
id: "db",
|
|
11
|
+
question: "Which database should the new service use?",
|
|
12
|
+
options: [{ label: "Postgres" }],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
questions: [
|
|
18
|
+
{
|
|
19
|
+
id: "db",
|
|
20
|
+
question: "Which database should the new service use?",
|
|
21
|
+
options: [
|
|
22
|
+
{ label: "Postgres", description: "Relational, strong consistency, JSONB support" },
|
|
23
|
+
{ label: "SQLite", description: "Embedded, zero-ops, great for single-node" },
|
|
24
|
+
{ label: "MongoDB", description: "Document store, flexible schema" },
|
|
25
|
+
],
|
|
26
|
+
recommended: 0,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "features",
|
|
30
|
+
question: "Which auth flows should ship in v1?",
|
|
31
|
+
options: [
|
|
32
|
+
{ label: "Email + password" },
|
|
33
|
+
{ label: "OAuth (Google, GitHub)" },
|
|
34
|
+
{ label: "Magic links" },
|
|
35
|
+
{ label: "SAML SSO", description: "Enterprise; can be deferred" },
|
|
36
|
+
],
|
|
37
|
+
multi: true,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
result: {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: "db: Postgres\nfeatures: Email + password, OAuth (Google, GitHub)",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
details: {
|
|
49
|
+
results: [
|
|
50
|
+
{
|
|
51
|
+
id: "db",
|
|
52
|
+
question: "Which database should the new service use?",
|
|
53
|
+
options: ["Postgres", "SQLite", "MongoDB"],
|
|
54
|
+
multi: false,
|
|
55
|
+
selectedOptions: ["Postgres"],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "features",
|
|
59
|
+
question: "Which auth flows should ship in v1?",
|
|
60
|
+
options: ["Email + password", "OAuth (Google, GitHub)", "Magic links", "SAML SSO"],
|
|
61
|
+
multi: true,
|
|
62
|
+
selectedOptions: ["Email + password", "OAuth (Google, GitHub)"],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
errorResult: {
|
|
68
|
+
content: [{ type: "text", text: "Prompt cancelled by user before any answer was given" }],
|
|
69
|
+
isError: true,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
resolve: {
|
|
74
|
+
label: "Resolve",
|
|
75
|
+
streamingArgs: {
|
|
76
|
+
action: "apply",
|
|
77
|
+
},
|
|
78
|
+
args: {
|
|
79
|
+
action: "apply",
|
|
80
|
+
reason: "Rename is mechanical and the staged diff matches the intended refactor.",
|
|
81
|
+
extra: { title: "rename-usecredentials-hook" },
|
|
82
|
+
},
|
|
83
|
+
result: {
|
|
84
|
+
content: [{ type: "text", text: "Applied pending ast_edit: 7 replacements across 3 files" }],
|
|
85
|
+
details: {
|
|
86
|
+
action: "apply",
|
|
87
|
+
reason: "Rename is mechanical and the staged diff matches the intended refactor.",
|
|
88
|
+
extra: { title: "rename-usecredentials-hook" },
|
|
89
|
+
sourceToolName: "ast_edit",
|
|
90
|
+
label: "ast_edit: 7 replacements across 3 files",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
errorResult: {
|
|
94
|
+
content: [{ type: "text", text: "No pending action to resolve" }],
|
|
95
|
+
isError: true,
|
|
96
|
+
details: {
|
|
97
|
+
action: "apply",
|
|
98
|
+
reason: "Rename is mechanical and the staged diff matches the intended refactor.",
|
|
99
|
+
sourceToolName: "ast_edit",
|
|
100
|
+
label: "ast_edit: 7 replacements across 3 files",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
ssh: {
|
|
106
|
+
label: "SSH",
|
|
107
|
+
streamingArgs: {
|
|
108
|
+
host: "deploy@web-01",
|
|
109
|
+
command: "systemctl status",
|
|
110
|
+
},
|
|
111
|
+
args: {
|
|
112
|
+
host: "deploy@web-01",
|
|
113
|
+
command: "systemctl status omp-api --no-pager | head -n 12",
|
|
114
|
+
cwd: "/srv/omp",
|
|
115
|
+
timeout: 60,
|
|
116
|
+
},
|
|
117
|
+
result: {
|
|
118
|
+
content: [
|
|
119
|
+
{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: [
|
|
122
|
+
"● omp-api.service - Oh My Pi API",
|
|
123
|
+
" Loaded: loaded (/etc/systemd/system/omp-api.service; enabled)",
|
|
124
|
+
" Active: active (running) since Sat 2026-06-06 09:14:02 UTC; 3h 21min ago",
|
|
125
|
+
" Main PID: 4812 (bun)",
|
|
126
|
+
" Tasks: 17 (limit: 4915)",
|
|
127
|
+
" Memory: 142.6M",
|
|
128
|
+
" CPU: 38.214s",
|
|
129
|
+
" CGroup: /system.slice/omp-api.service",
|
|
130
|
+
" └─4812 /usr/local/bin/bun run dist/server.js",
|
|
131
|
+
].join("\n"),
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
errorResult: {
|
|
136
|
+
content: [
|
|
137
|
+
{
|
|
138
|
+
type: "text",
|
|
139
|
+
text: "ssh: connect to host web-01 port 22: Connection timed out",
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
isError: true,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
github: {
|
|
147
|
+
label: "GitHub",
|
|
148
|
+
streamingArgs: {
|
|
149
|
+
op: "search_prs",
|
|
150
|
+
query: "is:open author:@me",
|
|
151
|
+
},
|
|
152
|
+
args: {
|
|
153
|
+
op: "search_prs",
|
|
154
|
+
query: "is:open review-requested:@me sort:updated",
|
|
155
|
+
repo: "oh-my-pi/pi",
|
|
156
|
+
},
|
|
157
|
+
result: {
|
|
158
|
+
content: [
|
|
159
|
+
{
|
|
160
|
+
type: "text",
|
|
161
|
+
text: [
|
|
162
|
+
"#1842 feat(tui): virtualized scrollback for tool output openyou · 2h ago +312 -47",
|
|
163
|
+
"#1839 fix(agent): retry stream on transient 529 dvir · 5h ago +18 -4",
|
|
164
|
+
"#1830 refactor(edit): unify hashline + ast_edit previews mira · 1d ago +540 -210",
|
|
165
|
+
"#1817 docs: document gallery fixtures contract leo · 2d ago +96 -0",
|
|
166
|
+
"",
|
|
167
|
+
"4 open pull requests requesting your review",
|
|
168
|
+
].join("\n"),
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
errorResult: {
|
|
173
|
+
content: [
|
|
174
|
+
{
|
|
175
|
+
type: "text",
|
|
176
|
+
text: "gh: Could not resolve to a Repository with the name 'oh-my-pi/pi'. (HTTP 404)",
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
isError: true,
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
inspect_image: {
|
|
184
|
+
label: "Inspect Image",
|
|
185
|
+
streamingArgs: {
|
|
186
|
+
path: "docs/assets/dashboard-mock.png",
|
|
187
|
+
},
|
|
188
|
+
args: {
|
|
189
|
+
path: "docs/assets/dashboard-mock.png",
|
|
190
|
+
question: "What chart types are shown and roughly what layout does the dashboard use?",
|
|
191
|
+
},
|
|
192
|
+
result: {
|
|
193
|
+
content: [
|
|
194
|
+
{
|
|
195
|
+
type: "text",
|
|
196
|
+
text: [
|
|
197
|
+
"The dashboard uses a two-column layout on a dark background.",
|
|
198
|
+
"Top row: four KPI cards (Revenue, Active Users, Churn, MRR) with sparklines.",
|
|
199
|
+
"Left column: a stacked area chart of weekly sessions over ~3 months.",
|
|
200
|
+
"Right column: a horizontal bar chart ranking the top 6 referrers.",
|
|
201
|
+
"Bottom: a paginated table of recent transactions with status pills.",
|
|
202
|
+
].join("\n"),
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
details: {
|
|
206
|
+
model: "claude-opus-4",
|
|
207
|
+
imagePath: "docs/assets/dashboard-mock.png",
|
|
208
|
+
mimeType: "image/png",
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
errorResult: {
|
|
212
|
+
content: [{ type: "text", text: "Image not found: docs/assets/dashboard-mock.png" }],
|
|
213
|
+
isError: true,
|
|
214
|
+
details: {
|
|
215
|
+
model: "claude-opus-4",
|
|
216
|
+
imagePath: "docs/assets/dashboard-mock.png",
|
|
217
|
+
mimeType: "image/png",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
};
|