@oh-my-pi/pi-coding-agent 16.4.2 → 16.4.3
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 +42 -0
- package/dist/cli.js +17514 -17799
- package/dist/types/advisor/config.d.ts +4 -3
- package/dist/types/commit/agentic/agent.d.ts +1 -0
- package/dist/types/config/settings-schema.d.ts +28 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +10 -22
- package/dist/types/lsp/deferred-diagnostics.d.ts +11 -0
- package/dist/types/modes/components/move-overlay.d.ts +1 -1
- package/dist/types/modes/components/status-line/component.d.ts +3 -0
- package/dist/types/modes/components/status-line/types.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +8 -0
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +16 -0
- package/dist/types/task/executor.d.ts +31 -0
- package/dist/types/tools/__tests__/vibe-render.test.d.ts +1 -0
- package/dist/types/tools/browser/cmux/cmux-tab.d.ts +3 -1
- package/dist/types/tools/browser/cmux/rpc.d.ts +20 -0
- package/dist/types/tools/browser/run-output.d.ts +25 -0
- package/dist/types/tools/browser/tab-worker.d.ts +16 -0
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/vibe.d.ts +161 -0
- package/dist/types/utils/changelog.d.ts +35 -1
- package/dist/types/vibe/runtime.d.ts +124 -0
- package/dist/types/vibe/state.d.ts +4 -0
- package/dist/types/web/search/provider.d.ts +2 -0
- package/dist/types/web/search/providers/bing.d.ts +14 -0
- package/dist/types/web/search/providers/browser-headers.d.ts +9 -0
- package/dist/types/web/search/providers/browser-page.d.ts +32 -0
- package/dist/types/web/search/providers/ecosia.d.ts +14 -0
- package/dist/types/web/search/providers/google.d.ts +13 -0
- package/dist/types/web/search/providers/mojeek.d.ts +14 -0
- package/dist/types/web/search/providers/public.d.ts +37 -0
- package/dist/types/web/search/providers/startpage.d.ts +14 -0
- package/dist/types/web/search/providers/yahoo.d.ts +14 -0
- package/dist/types/web/search/types.d.ts +28 -0
- package/package.json +15 -18
- package/scripts/build-binary.ts +56 -73
- package/scripts/bundle-dist.ts +36 -40
- package/scripts/compile-binary.ts +68 -0
- package/scripts/generate-docs-index.ts +3 -93
- package/scripts/legacy-pi-virtual-module.ts +192 -0
- package/src/advisor/__tests__/advisor.test.ts +13 -0
- package/src/advisor/__tests__/config.test.ts +36 -0
- package/src/advisor/config.ts +11 -8
- package/src/commit/agentic/agent.ts +4 -0
- package/src/commit/agentic/index.ts +46 -21
- package/src/edit/index.ts +10 -76
- package/src/exec/non-interactive-env.ts +0 -1
- package/src/extensibility/plugins/legacy-pi-compat.ts +328 -162
- package/src/extensibility/plugins/legacy-pi-virtual-modules.d.ts +4 -0
- package/src/internal-urls/docs-index.ts +2 -1
- package/src/internal-urls/skill-protocol.ts +1 -1
- package/src/lsp/deferred-diagnostics.ts +66 -0
- package/src/main.ts +13 -13
- package/src/mcp/transports/stdio.test.ts +45 -1
- package/src/mcp/transports/stdio.ts +6 -3
- package/src/modes/acp/acp-agent.ts +65 -1
- package/src/modes/acp/acp-event-mapper.ts +5 -0
- package/src/modes/acp/acp-mode.ts +11 -0
- package/src/modes/components/__tests__/move-overlay.test.ts +16 -1
- package/src/modes/components/advisor-config.ts +15 -7
- package/src/modes/components/move-overlay.ts +2 -3
- package/src/modes/components/status-line/component.ts +6 -0
- package/src/modes/components/status-line/segments.ts +6 -0
- package/src/modes/components/status-line/types.ts +3 -0
- package/src/modes/controllers/command-controller.ts +8 -10
- package/src/modes/interactive-mode.ts +117 -1
- package/src/modes/types.ts +2 -0
- package/src/prompts/system/eager-task.md +2 -2
- package/src/prompts/system/system-prompt.md +9 -2
- package/src/prompts/system/vibe-mode-active.md +23 -0
- package/src/prompts/tools/browser.md +3 -3
- package/src/prompts/tools/grep.md +1 -1
- package/src/prompts/tools/vibe-kill.md +3 -0
- package/src/prompts/tools/vibe-list.md +3 -0
- package/src/prompts/tools/vibe-send.md +9 -0
- package/src/prompts/tools/vibe-spawn.md +10 -0
- package/src/prompts/tools/vibe-turn-result.md +19 -0
- package/src/prompts/tools/vibe-wait.md +8 -0
- package/src/sdk.ts +5 -0
- package/src/session/agent-session.ts +103 -13
- package/src/session/snapcompact-inline.ts +3 -19
- package/src/slash-commands/builtin-registry.ts +24 -8
- package/src/task/agents.ts +0 -2
- package/src/task/executor.ts +105 -0
- package/src/tools/__tests__/vibe-render.test.ts +210 -0
- package/src/tools/bash-skill-urls.ts +1 -1
- package/src/tools/browser/cmux/cmux-tab.ts +46 -48
- package/src/tools/browser/cmux/rpc.ts +50 -0
- package/src/tools/browser/run-output.ts +76 -0
- package/src/tools/browser/tab-worker.ts +264 -129
- package/src/tools/glob.ts +20 -6
- package/src/tools/index.ts +1 -0
- package/src/tools/read.ts +17 -9
- package/src/tools/renderers.ts +6 -0
- package/src/tools/vibe.ts +608 -0
- package/src/tools/write.ts +15 -2
- package/src/utils/changelog.ts +106 -9
- package/src/utils/git.ts +0 -1
- package/src/utils/title-generator.ts +70 -7
- package/src/vibe/runtime.ts +710 -0
- package/src/vibe/state.ts +4 -0
- package/src/web/search/index.ts +14 -6
- package/src/web/search/provider.ts +37 -1
- package/src/web/search/providers/bing.ts +197 -0
- package/src/web/search/providers/browser-headers.ts +92 -0
- package/src/web/search/providers/browser-page.ts +123 -0
- package/src/web/search/providers/duckduckgo.ts +13 -34
- package/src/web/search/providers/ecosia.ts +178 -0
- package/src/web/search/providers/google.ts +193 -0
- package/src/web/search/providers/mojeek.ts +206 -0
- package/src/web/search/providers/public.ts +201 -0
- package/src/web/search/providers/startpage.ts +213 -0
- package/src/web/search/providers/yahoo.ts +179 -0
- package/src/web/search/types.ts +35 -0
- package/dist/types/extensibility/plugins/legacy-pi-bundled-keys.d.ts +0 -10
- package/dist/types/extensibility/plugins/legacy-pi-bundled-registry.d.ts +0 -10
- package/scripts/generate-legacy-pi-bundled-registry.ts +0 -420
- package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +0 -1011
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +0 -3430
- package/src/internal-urls/docs-index.generated.txt +0 -2
- package/src/prompts/agents/plan.md +0 -47
package/src/tools/glob.ts
CHANGED
|
@@ -184,6 +184,7 @@ export class GlobTool implements AgentTool<typeof findSchema, GlobToolDetails> {
|
|
|
184
184
|
signal,
|
|
185
185
|
localProtocolOptions: this.session.localProtocolOptions,
|
|
186
186
|
skills: this.session.skills,
|
|
187
|
+
pathOnly: true,
|
|
187
188
|
});
|
|
188
189
|
if (!resource.sourcePath) {
|
|
189
190
|
throw new ToolError(`Cannot find internal URL without a backing file: ${rawPattern}`);
|
|
@@ -258,7 +259,7 @@ export class GlobTool implements AgentTool<typeof findSchema, GlobToolDetails> {
|
|
|
258
259
|
|
|
259
260
|
const buildResult = (
|
|
260
261
|
files: string[],
|
|
261
|
-
opts?: { notice?: string; forceTruncated?: boolean },
|
|
262
|
+
opts?: { notice?: string; forceTruncated?: boolean; timedOut?: boolean },
|
|
262
263
|
): AgentToolResult<GlobToolDetails> => {
|
|
263
264
|
const notice = opts?.notice;
|
|
264
265
|
const forceTruncated = opts?.forceTruncated ?? false;
|
|
@@ -271,7 +272,10 @@ export class GlobTool implements AgentTool<typeof findSchema, GlobToolDetails> {
|
|
|
271
272
|
cwd: this.session.cwd,
|
|
272
273
|
missingPaths: missingPaths.length > 0 ? missingPaths : undefined,
|
|
273
274
|
};
|
|
274
|
-
|
|
275
|
+
// A timed-out empty result is an incomplete scan, not a verified
|
|
276
|
+
// absence — never emit the definitive "No files found" claim next
|
|
277
|
+
// to a timeout notice (the two statements contradict each other).
|
|
278
|
+
const parts = opts?.timedOut ? [] : ["No files found matching pattern"];
|
|
275
279
|
if (notice) parts.push(notice);
|
|
276
280
|
if (missingPathsNote) parts.push(missingPathsNote);
|
|
277
281
|
// Zero results is useless regardless of notices: the follow-up
|
|
@@ -452,8 +456,15 @@ export class GlobTool implements AgentTool<typeof findSchema, GlobToolDetails> {
|
|
|
452
456
|
partial.sort((a, b) => b.m - a.m);
|
|
453
457
|
const sortedPaths = partial.map(entry => entry.p);
|
|
454
458
|
const seconds = timeoutMs % 1000 === 0 ? `${timeoutMs / 1000}` : (timeoutMs / 1000).toFixed(1);
|
|
455
|
-
|
|
456
|
-
|
|
459
|
+
// Walk cost tracks directory-tree size, not pattern specificity: a
|
|
460
|
+
// mtime-ranked scan cannot early-exit, so a "narrow" pattern over a
|
|
461
|
+
// huge tree still times out. Say so instead of implying the pattern
|
|
462
|
+
// was too broad.
|
|
463
|
+
const notice =
|
|
464
|
+
sortedPaths.length > 0
|
|
465
|
+
? `glob timed out after ${seconds}s; returning ${sortedPaths.length} partial matches — results are incomplete, scope to a deeper directory instead of retrying blindly`
|
|
466
|
+
: `Glob timed out after ${seconds}s before finding any matches — the scan is incomplete, NOT proof of absence. The walk is bounded by directory size, not pattern width; scope the search to a deeper directory (e.g. \`sub/dir/*.ext\` instead of \`*.ext\` at a huge root).`;
|
|
467
|
+
return buildResult(sortedPaths, { notice, forceTruncated: true, timedOut: true });
|
|
457
468
|
}
|
|
458
469
|
|
|
459
470
|
// Merge per-target results: native glob already ranks each target's own
|
|
@@ -582,17 +593,20 @@ export const globToolRenderer = {
|
|
|
582
593
|
missingPaths.length > 0 ? uiTheme.fg("warning", `skipped missing: ${missingPaths.join(", ")}`) : undefined;
|
|
583
594
|
|
|
584
595
|
if (fileCount === 0) {
|
|
596
|
+
// `truncated` on an empty result means the scan timed out mid-walk —
|
|
597
|
+
// render "incomplete", not a definitive "No files found".
|
|
598
|
+
const emptyLabel = truncated ? "No matches before timeout (scan incomplete)" : "No files found";
|
|
585
599
|
const header = renderStatusLine(
|
|
586
600
|
{
|
|
587
601
|
icon: "warning",
|
|
588
602
|
title: "Glob",
|
|
589
603
|
titleColor: "toolTitle",
|
|
590
604
|
description: formatGlobRenderPaths(args),
|
|
591
|
-
meta: ["0 files"],
|
|
605
|
+
meta: truncated ? ["0 files", uiTheme.fg("warning", "timed out")] : ["0 files"],
|
|
592
606
|
},
|
|
593
607
|
uiTheme,
|
|
594
608
|
);
|
|
595
|
-
const lines = [header, formatEmptyMessage(
|
|
609
|
+
const lines = [header, formatEmptyMessage(emptyLabel, uiTheme)];
|
|
596
610
|
if (missingNote) lines.push(missingNote);
|
|
597
611
|
return new Text(lines.join("\n"), 1, 0);
|
|
598
612
|
}
|
package/src/tools/index.ts
CHANGED
package/src/tools/read.ts
CHANGED
|
@@ -1289,13 +1289,17 @@ export class ReadTool implements AgentTool<typeof readSchema, ReadToolDetails> {
|
|
|
1289
1289
|
const ignoreResultLimits = options.ignoreResultLimits ?? false;
|
|
1290
1290
|
const requestedEnd = limit !== undefined ? Math.min(requestedStart + limit, allLines.length) : allLines.length;
|
|
1291
1291
|
// Expand only on sides the user actually constrained: leading context
|
|
1292
|
-
// when offset>1, trailing context when a finite limit was set.
|
|
1292
|
+
// when offset>1, trailing context when a finite limit was set. Raw mode
|
|
1293
|
+
// never expands — without line numbers the padding is indistinguishable
|
|
1294
|
+
// from requested content, so `raw:31-31` must return line 31 and nothing
|
|
1295
|
+
// else (verbatim-extraction contract).
|
|
1296
|
+
const rawDisplay = options.raw === true;
|
|
1293
1297
|
const expanded = expandRangeWithContext(
|
|
1294
1298
|
requestedStart,
|
|
1295
1299
|
requestedEnd,
|
|
1296
1300
|
allLines.length,
|
|
1297
|
-
offset !== undefined && offset > 1,
|
|
1298
|
-
limit !== undefined,
|
|
1301
|
+
!rawDisplay && offset !== undefined && offset > 1,
|
|
1302
|
+
!rawDisplay && limit !== undefined,
|
|
1299
1303
|
);
|
|
1300
1304
|
const startLine = expanded.startLine;
|
|
1301
1305
|
const endLineExpanded = expanded.endLine;
|
|
@@ -2527,10 +2531,14 @@ export class ReadTool implements AgentTool<typeof readSchema, ReadToolDetails> {
|
|
|
2527
2531
|
}
|
|
2528
2532
|
|
|
2529
2533
|
// User-requested 0-indexed range start. Lines BEFORE this become
|
|
2530
|
-
// leading context (added below if offset is explicit).
|
|
2534
|
+
// leading context (added below if offset is explicit). Raw mode
|
|
2535
|
+
// never adds context: without line numbers the padding is
|
|
2536
|
+
// indistinguishable from requested content, so `raw:31-31` must
|
|
2537
|
+
// return line 31 and nothing else.
|
|
2538
|
+
const rawSelector = isRawSelector(parsed);
|
|
2531
2539
|
const requestedStart = offset ? Math.max(0, offset - 1) : 0;
|
|
2532
|
-
const expandStart = offset !== undefined && offset > 1;
|
|
2533
|
-
const expandEnd = limit !== undefined;
|
|
2540
|
+
const expandStart = !rawSelector && offset !== undefined && offset > 1;
|
|
2541
|
+
const expandEnd = !rawSelector && limit !== undefined;
|
|
2534
2542
|
const leadingContext = expandStart ? Math.min(requestedStart, RANGE_LEADING_CONTEXT_LINES) : 0;
|
|
2535
2543
|
const trailingContext = expandEnd ? RANGE_TRAILING_CONTEXT_LINES : 0;
|
|
2536
2544
|
const startLine = requestedStart - leadingContext;
|
|
@@ -2581,7 +2589,6 @@ export class ReadTool implements AgentTool<typeof readSchema, ReadToolDetails> {
|
|
|
2581
2589
|
// verbatim bytes for paste-back-into-tool workflows. Total byte/line
|
|
2582
2590
|
// counts in `truncation` keep reflecting the source, not the trimmed
|
|
2583
2591
|
// view — column truncation surfaces separately via `.limits()`.
|
|
2584
|
-
const rawSelector = isRawSelector(parsed);
|
|
2585
2592
|
const maxColumns = resolveOutputMaxColumns(this.session.settings);
|
|
2586
2593
|
// Column truncation is display-only. `collectedLines` MUST stay
|
|
2587
2594
|
// byte-for-byte with the on-disk content so the snapshot recorded
|
|
@@ -2972,8 +2979,9 @@ export class ReadTool implements AgentTool<typeof readSchema, ReadToolDetails> {
|
|
|
2972
2979
|
|
|
2973
2980
|
const { offset, limit } = selToOffsetLimit(parsedSel);
|
|
2974
2981
|
const requestedStart = offset ? Math.max(0, offset - 1) : 0;
|
|
2975
|
-
|
|
2976
|
-
const
|
|
2982
|
+
// Raw mode never adds context lines — see the plain-file range path.
|
|
2983
|
+
const expandStart = !rawSelector && offset !== undefined && offset > 1;
|
|
2984
|
+
const expandEnd = !rawSelector && limit !== undefined;
|
|
2977
2985
|
const leadingContext = expandStart ? Math.min(requestedStart, RANGE_LEADING_CONTEXT_LINES) : 0;
|
|
2978
2986
|
const trailingContext = expandEnd ? RANGE_TRAILING_CONTEXT_LINES : 0;
|
|
2979
2987
|
const startLine = requestedStart - leadingContext;
|
package/src/tools/renderers.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { resolveToolRenderer } from "./resolve";
|
|
|
30
30
|
import { searchToolBm25Renderer } from "./search-tool-bm25";
|
|
31
31
|
import { sshToolRenderer } from "./ssh";
|
|
32
32
|
import { todoToolRenderer } from "./todo";
|
|
33
|
+
import { createVibeToolRenderer } from "./vibe";
|
|
33
34
|
import { writeToolRenderer } from "./write";
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -111,5 +112,10 @@ export const toolRenderers: Record<string, ToolRenderer> = {
|
|
|
111
112
|
github: githubToolRenderer as ToolRenderer,
|
|
112
113
|
goal: goalToolRenderer as ToolRenderer,
|
|
113
114
|
web_search: webSearchToolRenderer as ToolRenderer,
|
|
115
|
+
vibe_spawn: createVibeToolRenderer("spawn") as ToolRenderer,
|
|
116
|
+
vibe_send: createVibeToolRenderer("send") as ToolRenderer,
|
|
117
|
+
vibe_wait: createVibeToolRenderer("wait") as ToolRenderer,
|
|
118
|
+
vibe_kill: createVibeToolRenderer("kill") as ToolRenderer,
|
|
119
|
+
vibe_list: createVibeToolRenderer("list") as ToolRenderer,
|
|
114
120
|
write: writeToolRenderer as ToolRenderer,
|
|
115
121
|
};
|