@oh-my-pi/pi-coding-agent 15.1.2 → 15.1.4
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 +60 -0
- package/dist/types/async/job-manager.d.ts +3 -2
- package/dist/types/cli/auth-broker-cli.d.ts +25 -0
- package/dist/types/cli/auth-gateway-cli.d.ts +18 -0
- package/dist/types/cli/grievances-cli.d.ts +12 -0
- package/dist/types/commands/auth-broker.d.ts +54 -0
- package/dist/types/commands/auth-gateway.d.ts +32 -0
- package/dist/types/commands/grievances.d.ts +1 -1
- package/dist/types/commit/agentic/tools/propose-commit.d.ts +9 -1
- package/dist/types/commit/agentic/tools/schemas.d.ts +9 -1
- package/dist/types/commit/agentic/tools/split-commit.d.ts +9 -1
- package/dist/types/config/model-registry.d.ts +3 -0
- package/dist/types/config/models-config-schema.d.ts +1 -0
- package/dist/types/config/settings-schema.d.ts +46 -0
- package/dist/types/discovery/agents.d.ts +12 -1
- package/dist/types/edit/renderer.d.ts +3 -0
- package/dist/types/eval/index.d.ts +0 -2
- package/dist/types/goals/tools/goal-tool.d.ts +10 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/internal-urls/index.d.ts +1 -1
- package/dist/types/internal-urls/{pi-protocol.d.ts → omp-protocol.d.ts} +3 -3
- package/dist/types/internal-urls/types.d.ts +1 -1
- package/dist/types/main.d.ts +11 -2
- package/dist/types/modes/acp/acp-agent.d.ts +2 -1
- package/dist/types/modes/acp/acp-event-mapper.d.ts +13 -1
- package/dist/types/modes/acp/acp-mode.d.ts +3 -1
- package/dist/types/modes/emoji-autocomplete.d.ts +16 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/modes/prompt-action-autocomplete.d.ts +4 -0
- package/dist/types/plan-mode/approved-plan.d.ts +10 -4
- package/dist/types/sdk.d.ts +10 -3
- package/dist/types/session/agent-session.d.ts +7 -3
- package/dist/types/session/auth-broker-config.d.ts +13 -0
- package/dist/types/session/auth-storage.d.ts +1 -1
- package/dist/types/session/client-bridge.d.ts +3 -0
- package/dist/types/tools/eval.d.ts +41 -7
- package/dist/types/tools/irc.d.ts +8 -2
- package/dist/types/tools/report-tool-issue.d.ts +118 -1
- package/dist/types/tools/resolve.d.ts +8 -2
- package/examples/custom-tools/README.md +3 -12
- package/examples/extensions/README.md +2 -15
- package/examples/extensions/api-demo.ts +1 -7
- package/package.json +7 -7
- package/src/async/job-manager.ts +111 -13
- package/src/autoresearch/tools/init-experiment.ts +11 -33
- package/src/autoresearch/tools/log-experiment.ts +10 -24
- package/src/autoresearch/tools/run-experiment.ts +1 -1
- package/src/autoresearch/tools/update-notes.ts +2 -9
- package/src/cli/auth-broker-cli.ts +746 -0
- package/src/cli/auth-gateway-cli.ts +342 -0
- package/src/cli/grievances-cli.ts +109 -16
- package/src/cli/update-cli.ts +1 -5
- package/src/cli.ts +4 -2
- package/src/commands/auth-broker.ts +96 -0
- package/src/commands/auth-gateway.ts +61 -0
- package/src/commands/grievances.ts +13 -8
- package/src/commands/launch.ts +1 -1
- package/src/commit/agentic/agent.ts +2 -0
- package/src/commit/agentic/tools/analyze-file.ts +2 -2
- package/src/commit/agentic/tools/git-file-diff.ts +2 -2
- package/src/commit/agentic/tools/git-hunk.ts +3 -3
- package/src/commit/agentic/tools/git-overview.ts +2 -2
- package/src/commit/agentic/tools/propose-changelog.ts +1 -3
- package/src/commit/agentic/tools/recent-commits.ts +1 -1
- package/src/commit/agentic/tools/schemas.ts +1 -9
- package/src/config/model-equivalence.ts +279 -174
- package/src/config/model-registry.ts +37 -6
- package/src/config/model-resolver.ts +13 -8
- package/src/config/models-config-schema.ts +8 -0
- package/src/config/settings-schema.ts +52 -0
- package/src/cursor.ts +1 -1
- package/src/debug/log-formatting.ts +1 -1
- package/src/debug/log-viewer.ts +1 -1
- package/src/debug/profiler.ts +4 -0
- package/src/debug/raw-sse-buffer.ts +100 -59
- package/src/debug/raw-sse.ts +1 -1
- package/src/discovery/agents.ts +15 -4
- package/src/edit/modes/apply-patch.ts +1 -5
- package/src/edit/modes/patch.ts +5 -5
- package/src/edit/modes/replace.ts +5 -5
- package/src/edit/renderer.ts +2 -1
- package/src/edit/streaming.ts +1 -1
- package/src/eval/index.ts +0 -2
- package/src/eval/js/shared/runtime.ts +107 -2
- package/src/eval/py/kernel.ts +1 -1
- package/src/exa/researcher.ts +4 -4
- package/src/exa/search.ts +10 -22
- package/src/exa/websets.ts +33 -33
- package/src/extensibility/typebox.ts +44 -17
- package/src/goals/tools/goal-tool.ts +3 -3
- package/src/index.ts +0 -3
- package/src/internal-urls/docs-index.generated.ts +21 -18
- package/src/internal-urls/index.ts +1 -1
- package/src/internal-urls/{pi-protocol.ts → omp-protocol.ts} +10 -10
- package/src/internal-urls/router.ts +3 -3
- package/src/internal-urls/types.ts +1 -1
- package/src/lsp/types.ts +8 -11
- package/src/main.ts +216 -146
- package/src/mcp/tool-bridge.ts +3 -3
- package/src/modes/acp/acp-agent.ts +203 -57
- package/src/modes/acp/acp-client-bridge.ts +2 -1
- package/src/modes/acp/acp-event-mapper.ts +208 -32
- package/src/modes/acp/acp-mode.ts +11 -3
- package/src/modes/components/bash-execution.ts +1 -1
- package/src/modes/components/diff.ts +1 -2
- package/src/modes/components/eval-execution.ts +1 -1
- package/src/modes/components/oauth-selector.ts +38 -2
- package/src/modes/components/tool-execution.ts +1 -2
- package/src/modes/components/tree-selector.ts +26 -7
- package/src/modes/controllers/command-controller.ts +95 -34
- package/src/modes/controllers/input-controller.ts +4 -3
- package/src/modes/data/emojis.json +1 -0
- package/src/modes/emoji-autocomplete.ts +285 -0
- package/src/modes/interactive-mode.ts +92 -19
- package/src/modes/print-mode.ts +3 -3
- package/src/modes/prompt-action-autocomplete.ts +14 -0
- package/src/plan-mode/approved-plan.ts +30 -9
- package/src/prompts/system/system-prompt.md +1 -1
- package/src/prompts/system/ttsr-tool-reminder.md +5 -0
- package/src/prompts/tools/ask.md +4 -3
- package/src/prompts/tools/eval.md +25 -26
- package/src/prompts/tools/read.md +1 -1
- package/src/prompts/tools/resolve.md +1 -1
- package/src/prompts/tools/search.md +1 -1
- package/src/prompts/tools/web-search.md +1 -1
- package/src/sdk.ts +81 -8
- package/src/session/agent-session.ts +362 -131
- package/src/session/agent-storage.ts +7 -2
- package/src/session/auth-broker-config.ts +102 -0
- package/src/session/auth-storage.ts +7 -1
- package/src/session/client-bridge.ts +3 -0
- package/src/session/streaming-output.ts +1 -1
- package/src/task/types.ts +10 -35
- package/src/tools/bash-interactive.ts +4 -1
- package/src/tools/bash-pty-selection.ts +2 -2
- package/src/tools/browser.ts +12 -20
- package/src/tools/eval.ts +77 -100
- package/src/tools/gh.ts +21 -45
- package/src/tools/hindsight-recall.ts +1 -1
- package/src/tools/hindsight-reflect.ts +2 -2
- package/src/tools/hindsight-retain.ts +3 -7
- package/src/tools/index.ts +8 -1
- package/src/tools/inspect-image.ts +4 -1
- package/src/tools/irc.ts +4 -12
- package/src/tools/job.ts +3 -11
- package/src/tools/report-tool-issue.ts +462 -17
- package/src/tools/resolve.ts +2 -7
- package/src/tools/todo-write.ts +8 -15
- package/src/utils/title-generator.ts +3 -0
- package/src/web/search/index.ts +6 -6
- package/dist/types/eval/parse.d.ts +0 -28
- package/dist/types/eval/sniff.d.ts +0 -11
- package/src/eval/eval.lark +0 -36
- package/src/eval/parse.ts +0 -407
- package/src/eval/sniff.ts +0 -28
package/src/tools/gh.ts
CHANGED
|
@@ -213,58 +213,34 @@ const githubSchema = z
|
|
|
213
213
|
"run_watch",
|
|
214
214
|
] as const)
|
|
215
215
|
.describe("github operation"),
|
|
216
|
-
repo: z.string().describe("owner/repo
|
|
217
|
-
branch: z.string().describe("branch
|
|
216
|
+
repo: z.string().describe("owner/repo").optional(),
|
|
217
|
+
branch: z.string().describe("branch").optional(),
|
|
218
218
|
pr: z
|
|
219
219
|
.union([z.string(), z.array(z.string())])
|
|
220
|
-
.describe(
|
|
221
|
-
"pr number, url, or branch (pr_checkout); pass an array to batch-process multiple pull requests in one call",
|
|
222
|
-
)
|
|
223
|
-
.optional(),
|
|
224
|
-
force: z.boolean().describe("reset existing local branch (pr_checkout)").optional(),
|
|
225
|
-
forceWithLease: z.boolean().describe("force-with-lease push (pr_push)").optional(),
|
|
226
|
-
title: z.string().describe("PR title (pr_create)").optional(),
|
|
227
|
-
body: z.string().describe("PR body markdown (pr_create); mutually exclusive with fill").optional(),
|
|
228
|
-
base: z.string().describe("PR base branch (pr_create); defaults to repo default branch").optional(),
|
|
229
|
-
head: z.string().describe("PR head branch (pr_create); defaults to current branch").optional(),
|
|
230
|
-
draft: z.boolean().describe("open PR as draft (pr_create)").optional(),
|
|
231
|
-
fill: z
|
|
232
|
-
.boolean()
|
|
233
|
-
.describe("auto-fill PR title/body from commits (pr_create); mutually exclusive with title/body")
|
|
234
|
-
.optional(),
|
|
235
|
-
reviewer: z.array(z.string()).describe("reviewers to request (pr_create); accepts users or org/team").optional(),
|
|
236
|
-
assignee: z.array(z.string()).describe("assignees (pr_create); use @me for the authenticated user").optional(),
|
|
237
|
-
label: z.array(z.string()).describe("labels to apply (pr_create)").optional(),
|
|
238
|
-
query: z
|
|
239
|
-
.string()
|
|
240
|
-
.describe("search query (search_issues, search_prs, search_code, search_commits, search_repos)")
|
|
241
|
-
.optional(),
|
|
242
|
-
since: z
|
|
243
|
-
.string()
|
|
244
|
-
.describe(
|
|
245
|
-
"lower-bound date for search_issues/search_prs/search_commits/search_repos. Accepts a relative duration (`<n><unit>` with unit `m`/`h`/`d`/`w`/`mo`/`y`, e.g. `3d`, `12h`, `2w`) or an ISO date (`YYYY-MM-DD`) / datetime. Translated to a `created:>=…` (or `committer-date:`/`pushed:`) qualifier; not supported by search_code.",
|
|
246
|
-
)
|
|
247
|
-
.optional(),
|
|
248
|
-
until: z
|
|
249
|
-
.string()
|
|
250
|
-
.describe(
|
|
251
|
-
"upper-bound date in the same format as `since`. With both, builds a `field:since..until` range qualifier.",
|
|
252
|
-
)
|
|
220
|
+
.describe("pr number, url, or branch")
|
|
253
221
|
.optional(),
|
|
222
|
+
force: z.boolean().describe("reset existing local branch").optional(),
|
|
223
|
+
forceWithLease: z.boolean().describe("force-with-lease push").optional(),
|
|
224
|
+
title: z.string().describe("pr title").optional(),
|
|
225
|
+
body: z.string().describe("pr body markdown").optional(),
|
|
226
|
+
base: z.string().describe("pr base branch").optional(),
|
|
227
|
+
head: z.string().describe("pr head branch").optional(),
|
|
228
|
+
draft: z.boolean().describe("open pr as draft").optional(),
|
|
229
|
+
fill: z.boolean().describe("auto-fill pr title/body from commits").optional(),
|
|
230
|
+
reviewer: z.array(z.string()).describe("reviewers").optional(),
|
|
231
|
+
assignee: z.array(z.string()).describe("assignees").optional(),
|
|
232
|
+
label: z.array(z.string()).describe("labels").optional(),
|
|
233
|
+
query: z.string().describe("search query").optional(),
|
|
234
|
+
since: z.string().describe("lower-bound date filter").optional(),
|
|
235
|
+
until: z.string().describe("upper-bound date filter").optional(),
|
|
254
236
|
dateField: z
|
|
255
237
|
.enum(["created", "updated"] as const)
|
|
256
|
-
.describe(
|
|
257
|
-
"date field used by `since`/`until`. issues/prs: `created` (default) or `updated`. repos: `created` (default) or `updated` (mapped to GitHub's `pushed:`). commits: ignored — always uses `committer-date`.",
|
|
258
|
-
)
|
|
238
|
+
.describe("date field")
|
|
259
239
|
.default("created")
|
|
260
240
|
.optional(),
|
|
261
|
-
limit: z
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
.describe("max results (search_issues, search_prs, search_code, search_commits, search_repos)")
|
|
265
|
-
.optional(),
|
|
266
|
-
run: z.string().describe("actions run id or url (run_watch)").optional(),
|
|
267
|
-
tail: z.number().default(15).describe("log lines per failed job (run_watch)").optional(),
|
|
241
|
+
limit: z.number().default(10).describe("max results").optional(),
|
|
242
|
+
run: z.string().describe("actions run id or url").optional(),
|
|
243
|
+
tail: z.number().default(15).describe("log lines per failed job").optional(),
|
|
268
244
|
})
|
|
269
245
|
.strict();
|
|
270
246
|
|
|
@@ -6,7 +6,7 @@ import recallDescription from "../prompts/tools/recall.md" with { type: "text" }
|
|
|
6
6
|
import type { ToolSession } from ".";
|
|
7
7
|
|
|
8
8
|
const hindsightRecallSchema = z.object({
|
|
9
|
-
query: z.string().describe("
|
|
9
|
+
query: z.string().describe("natural language search query"),
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export type HindsightRecallParams = z.infer<typeof hindsightRecallSchema>;
|
|
@@ -6,8 +6,8 @@ import reflectDescription from "../prompts/tools/reflect.md" with { type: "text"
|
|
|
6
6
|
import type { ToolSession } from ".";
|
|
7
7
|
|
|
8
8
|
const hindsightReflectSchema = z.object({
|
|
9
|
-
query: z.string().describe("
|
|
10
|
-
context: z.string().describe("
|
|
9
|
+
query: z.string().describe("question to answer"),
|
|
10
|
+
context: z.string().describe("optional context").optional(),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export type HindsightReflectParams = z.infer<typeof hindsightReflectSchema>;
|
|
@@ -7,16 +7,12 @@ const hindsightRetainSchema = z.object({
|
|
|
7
7
|
items: z
|
|
8
8
|
.array(
|
|
9
9
|
z.object({
|
|
10
|
-
content: z
|
|
11
|
-
|
|
12
|
-
.describe("The information to remember. Be specific and self-contained — include who, what, when, why."),
|
|
13
|
-
context: z.string().describe("Optional context describing where this information came from.").optional(),
|
|
10
|
+
content: z.string().describe("information to remember"),
|
|
11
|
+
context: z.string().describe("source context").optional(),
|
|
14
12
|
}),
|
|
15
13
|
)
|
|
16
14
|
.min(1)
|
|
17
|
-
.describe(
|
|
18
|
-
"One or more memories to retain. Batch related facts in a single call rather than calling retain repeatedly — they are deduplicated and consolidated together.",
|
|
19
|
-
),
|
|
15
|
+
.describe("memories to retain"),
|
|
20
16
|
});
|
|
21
17
|
|
|
22
18
|
export type HindsightRetainParams = z.infer<typeof hindsightRetainSchema>;
|
package/src/tools/index.ts
CHANGED
|
@@ -514,7 +514,14 @@ export async function createTools(session: ToolSession, toolNames?: string[]): P
|
|
|
514
514
|
// Injected unconditionally into every agent, regardless of requested tool list.
|
|
515
515
|
const autoQA = isAutoQaEnabled(session.settings);
|
|
516
516
|
if (autoQA && !tools.some(t => t.name === "report_tool_issue")) {
|
|
517
|
-
|
|
517
|
+
// Build the enum from tools we just constructed via BUILTIN_TOOLS / HIDDEN_TOOLS.
|
|
518
|
+
// Extension overrides (e.g. a user's custom `bash`) get added later by
|
|
519
|
+
// other code paths, so they're absent here — exactly what we want; MCP /
|
|
520
|
+
// extension tools never end up in the report enum.
|
|
521
|
+
const activeBuiltinNames = tools
|
|
522
|
+
.map(t => t.name)
|
|
523
|
+
.filter(name => (name in BUILTIN_TOOLS || name in HIDDEN_TOOLS) && name !== "report_tool_issue");
|
|
524
|
+
const qaTool = createReportToolIssueTool(session, activeBuiltinNames);
|
|
518
525
|
if (qaTool) {
|
|
519
526
|
tools.push(wrapToolWithMetaNotice(qaTool));
|
|
520
527
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import { instrumentedCompleteSimple, resolveTelemetry } from "@oh-my-pi/pi-agent-core";
|
|
2
3
|
import { type Api, completeSimple, type Model } from "@oh-my-pi/pi-ai";
|
|
3
4
|
import { prompt } from "@oh-my-pi/pi-utils";
|
|
4
5
|
import * as z from "zod/v4";
|
|
@@ -118,7 +119,8 @@ export class InspectImageTool implements AgentTool<typeof inspectImageSchema, In
|
|
|
118
119
|
throw new ToolError("inspect_image only supports PNG, JPEG, GIF, and WEBP files detected by file content.");
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
const
|
|
122
|
+
const telemetry = resolveTelemetry(this.session.getTelemetry?.(), this.session.getSessionId?.() ?? undefined);
|
|
123
|
+
const response = await instrumentedCompleteSimple(
|
|
122
124
|
model,
|
|
123
125
|
{
|
|
124
126
|
systemPrompt: [prompt.render(inspectImageSystemPromptTemplate)],
|
|
@@ -134,6 +136,7 @@ export class InspectImageTool implements AgentTool<typeof inspectImageSchema, In
|
|
|
134
136
|
],
|
|
135
137
|
},
|
|
136
138
|
{ apiKey, signal },
|
|
139
|
+
{ telemetry, oneshotKind: "inspect_image", completeImpl: this.completeImageRequest },
|
|
137
140
|
);
|
|
138
141
|
|
|
139
142
|
if (response.stopReason === "error") {
|
package/src/tools/irc.ts
CHANGED
|
@@ -26,18 +26,10 @@ import type { AgentRef, AgentRegistry } from "../registry/agent-registry";
|
|
|
26
26
|
import type { ToolSession } from ".";
|
|
27
27
|
|
|
28
28
|
const ircSchema = z.object({
|
|
29
|
-
op: z
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
])
|
|
34
|
-
.describe("IRC operation"),
|
|
35
|
-
to: z.string().optional().describe('Recipient agent id (e.g. "0-Main", "0-AuthLoader") or "all" to broadcast'),
|
|
36
|
-
message: z.string().optional().describe("Message body to deliver"),
|
|
37
|
-
awaitReply: z
|
|
38
|
-
.boolean()
|
|
39
|
-
.optional()
|
|
40
|
-
.describe("Wait for the recipient's prose reply (default: true for DM, false for broadcast)"),
|
|
29
|
+
op: z.enum(["send", "list"]).describe("irc operation"),
|
|
30
|
+
to: z.string().optional().describe('recipient agent id or "all"'),
|
|
31
|
+
message: z.string().optional().describe("message body"),
|
|
32
|
+
awaitReply: z.boolean().optional().describe("wait for prose reply"),
|
|
41
33
|
});
|
|
42
34
|
|
|
43
35
|
type IrcParams = z.infer<typeof ircSchema>;
|
package/src/tools/job.ts
CHANGED
|
@@ -23,17 +23,9 @@ import {
|
|
|
23
23
|
import { ToolError } from "./tool-errors";
|
|
24
24
|
|
|
25
25
|
const jobSchema = z.object({
|
|
26
|
-
poll: z
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.describe("background job ids to wait for; omit (with no `cancel`) to wait on all running jobs"),
|
|
30
|
-
cancel: z.array(z.string()).optional().describe("background job ids to cancel"),
|
|
31
|
-
list: z
|
|
32
|
-
.boolean()
|
|
33
|
-
.optional()
|
|
34
|
-
.describe(
|
|
35
|
-
"Return an immediate snapshot of every job spawned by this agent (running + completed within retention). Read-only \u2014 cannot be combined with `poll` or `cancel`.",
|
|
36
|
-
),
|
|
26
|
+
poll: z.array(z.string()).optional().describe("job ids to wait for"),
|
|
27
|
+
cancel: z.array(z.string()).optional().describe("job ids to cancel"),
|
|
28
|
+
list: z.boolean().optional().describe("snapshot all jobs"),
|
|
37
29
|
});
|
|
38
30
|
|
|
39
31
|
type JobParams = z.infer<typeof jobSchema>;
|