@oh-my-pi/pi-coding-agent 16.3.0 → 16.3.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 +91 -0
- package/dist/cli.js +3855 -3798
- package/dist/types/cli/update-cli.d.ts +1 -0
- package/dist/types/cli/update-cli.test.d.ts +1 -0
- package/dist/types/commands/update.d.ts +5 -0
- package/dist/types/config/config-file.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +20 -0
- package/dist/types/dap/client.d.ts +9 -1
- package/dist/types/discovery/helpers.d.ts +2 -0
- package/dist/types/edit/file-snapshot-store.d.ts +9 -1
- package/dist/types/edit/hashline/execute.d.ts +1 -1
- package/dist/types/edit/hashline/params.d.ts +3 -6
- package/dist/types/edit/renderer.d.ts +1 -0
- package/dist/types/extensibility/plugins/parser.d.ts +2 -1
- package/dist/types/hindsight/client.d.ts +15 -11
- package/dist/types/hindsight/client.test.d.ts +1 -0
- package/dist/types/irc/bus.d.ts +5 -4
- package/dist/types/mcp/smithery-registry.d.ts +1 -0
- package/dist/types/mcp/smithery-registry.test.d.ts +1 -0
- package/dist/types/modes/components/advisor-message.d.ts +4 -2
- package/dist/types/modes/components/tool-execution.d.ts +9 -6
- package/dist/types/modes/components/transcript-container.d.ts +1 -0
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +13 -13
- package/dist/types/session/indexed-session-storage.d.ts +2 -2
- package/dist/types/session/session-storage.d.ts +31 -3
- package/dist/types/ssh/__tests__/connection-manager-timeout.test.d.ts +1 -0
- package/dist/types/ssh/__tests__/sshfs-mount.test.d.ts +1 -0
- package/dist/types/ssh/connection-manager.d.ts +19 -0
- package/dist/types/ssh/sshfs-mount.d.ts +10 -1
- package/dist/types/subprocess/worker-client.d.ts +20 -6
- package/dist/types/task/discovery.d.ts +5 -2
- package/dist/types/task/renderer.d.ts +1 -0
- package/dist/types/tools/ast-grep.d.ts +4 -2
- package/dist/types/tools/bash.d.ts +27 -0
- package/dist/types/tools/browser/render.d.ts +2 -0
- package/dist/types/tools/debug.d.ts +1 -0
- package/dist/types/tools/eval-render.d.ts +2 -0
- package/dist/types/tools/glob.d.ts +4 -2
- package/dist/types/tools/grep.d.ts +4 -3
- package/dist/types/tools/path-utils.d.ts +7 -0
- package/dist/types/tools/renderers.d.ts +24 -0
- package/dist/types/tools/ssh.d.ts +4 -1
- package/dist/types/tts/index.d.ts +2 -0
- package/dist/types/tts/speakable.d.ts +47 -0
- package/dist/types/tts/speech-enhancer.d.ts +46 -0
- package/dist/types/tts/streaming-player.d.ts +1 -2
- package/dist/types/tts/tts-client.d.ts +11 -10
- package/dist/types/tts/tts-protocol.d.ts +7 -0
- package/dist/types/tts/vocalizer.d.ts +15 -8
- package/dist/types/utils/fetch-timeout.d.ts +4 -0
- package/dist/types/utils/git.d.ts +2 -0
- package/dist/types/web/search/providers/base.d.ts +1 -0
- package/dist/types/web/search/providers/gemini.d.ts +1 -0
- package/package.json +12 -12
- package/scripts/generate-legacy-pi-bundled-registry.ts +8 -2
- package/src/advisor/__tests__/advisor.test.ts +1 -1
- package/src/cli/gallery-fixtures/fs.ts +2 -2
- package/src/cli/gallery-fixtures/search.ts +2 -2
- package/src/cli/models-cli.ts +19 -0
- package/src/cli/update-cli.test.ts +28 -0
- package/src/cli/update-cli.ts +35 -8
- package/src/cli.ts +27 -5
- package/src/commands/update.ts +8 -2
- package/src/config/config-file.ts +6 -6
- package/src/config/model-resolver.ts +31 -10
- package/src/config/settings-schema.ts +21 -0
- package/src/cursor.ts +1 -1
- package/src/dap/client.ts +134 -36
- package/src/discovery/helpers.ts +8 -0
- package/src/edit/file-snapshot-store.ts +12 -1
- package/src/edit/hashline/diff.ts +4 -13
- package/src/edit/hashline/execute.ts +1 -1
- package/src/edit/hashline/params.ts +5 -12
- package/src/edit/renderer.ts +4 -2
- package/src/edit/streaming.ts +15 -5
- package/src/export/html/tool-views.generated.js +34 -34
- package/src/extensibility/custom-tools/loader.ts +3 -3
- package/src/extensibility/extensions/loader.ts +10 -3
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +2 -2
- package/src/extensibility/plugins/installer.ts +12 -3
- package/src/extensibility/plugins/legacy-pi-compat.ts +87 -11
- package/src/extensibility/plugins/loader.ts +30 -1
- package/src/extensibility/plugins/manager.ts +32 -8
- package/src/extensibility/plugins/parser.ts +7 -5
- package/src/extensibility/tool-event-input.ts +1 -1
- package/src/hindsight/client.test.ts +33 -0
- package/src/hindsight/client.ts +42 -22
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/irc/bus.ts +5 -4
- package/src/main.ts +7 -1
- package/src/mcp/oauth-flow.ts +93 -4
- package/src/mcp/smithery-auth.ts +3 -0
- package/src/mcp/smithery-connect.ts +9 -0
- package/src/mcp/smithery-registry.test.ts +51 -0
- package/src/mcp/smithery-registry.ts +27 -4
- package/src/modes/components/__tests__/move-overlay.test.ts +72 -1
- package/src/modes/components/advisor-message.ts +13 -10
- package/src/modes/components/assistant-message.ts +1 -1
- package/src/modes/components/move-overlay.ts +35 -23
- package/src/modes/components/status-line/component.ts +11 -4
- package/src/modes/components/tool-execution.ts +119 -20
- package/src/modes/components/transcript-container.ts +26 -0
- package/src/modes/components/tree-selector.ts +10 -3
- package/src/modes/controllers/event-controller.ts +23 -3
- package/src/modes/controllers/tool-args-reveal.ts +1 -1
- package/src/modes/interactive-mode.ts +1 -0
- package/src/modes/rpc/rpc-client.ts +29 -16
- package/src/modes/theme/shimmer.ts +49 -15
- package/src/modes/theme/theme.ts +7 -0
- package/src/prompts/goals/goal-mode-context.md +4 -0
- package/src/prompts/goals/goal-todo-context.md +10 -2
- package/src/prompts/system/speech-rewrite.md +15 -0
- package/src/prompts/system/tiny-title-system.md +1 -1
- package/src/prompts/system/title-system-marker.md +2 -1
- package/src/prompts/system/title-system.md +2 -1
- package/src/prompts/tools/ast-grep.md +3 -3
- package/src/prompts/tools/glob.md +1 -1
- package/src/prompts/tools/grep.md +1 -1
- package/src/sdk.ts +8 -5
- package/src/session/agent-session.ts +329 -79
- package/src/session/indexed-session-storage.ts +40 -3
- package/src/session/session-history-format.ts +6 -2
- package/src/session/session-manager.ts +83 -14
- package/src/session/session-storage.ts +112 -26
- package/src/slash-commands/helpers/usage-report.ts +6 -1
- package/src/ssh/__tests__/connection-manager-timeout.test.ts +61 -0
- package/src/ssh/__tests__/sshfs-mount.test.ts +13 -0
- package/src/ssh/connection-manager.ts +44 -11
- package/src/ssh/sshfs-mount.ts +27 -4
- package/src/subprocess/worker-client.ts +161 -10
- package/src/task/discovery.ts +25 -2
- package/src/task/executor.ts +24 -4
- package/src/task/render.ts +26 -12
- package/src/task/renderer.ts +1 -0
- package/src/task/worktree.ts +144 -16
- package/src/tiny/text.ts +109 -17
- package/src/tools/ast-grep.ts +20 -17
- package/src/tools/bash.ts +46 -9
- package/src/tools/browser/render.ts +2 -0
- package/src/tools/debug.ts +1 -0
- package/src/tools/eval-render.ts +5 -2
- package/src/tools/gh-renderer.ts +3 -0
- package/src/tools/glob.ts +24 -20
- package/src/tools/grep.ts +39 -37
- package/src/tools/path-utils.ts +55 -10
- package/src/tools/read.ts +23 -6
- package/src/tools/renderers.ts +24 -0
- package/src/tools/ssh.ts +25 -7
- package/src/tts/index.ts +2 -0
- package/src/tts/speakable.ts +382 -0
- package/src/tts/speech-enhancer.ts +204 -0
- package/src/tts/streaming-player.ts +71 -16
- package/src/tts/tts-client.ts +11 -10
- package/src/tts/tts-protocol.ts +14 -5
- package/src/tts/tts-worker.ts +52 -49
- package/src/tts/vocalizer.ts +277 -46
- package/src/utils/clipboard.ts +49 -12
- package/src/utils/fetch-timeout.ts +10 -0
- package/src/utils/git.ts +8 -0
- package/src/web/search/index.ts +8 -0
- package/src/web/search/providers/base.ts +1 -0
- package/src/web/search/providers/gemini.ts +23 -6
|
@@ -180,8 +180,7 @@ function resolvePreviewEdits(args: {
|
|
|
180
180
|
}): readonly Edit[] {
|
|
181
181
|
const { section, absolutePath, normalized, snapshots, expected, liveMatches, edits } = args;
|
|
182
182
|
if (!hasBlockEdit(edits)) return edits;
|
|
183
|
-
const baseText =
|
|
184
|
-
expected === undefined || liveMatches ? normalized : snapshots.byHashExact(absolutePath, expected)?.text;
|
|
183
|
+
const baseText = expected === undefined || liveMatches ? normalized : snapshots.byHash(absolutePath, expected)?.text;
|
|
185
184
|
if (baseText === undefined) {
|
|
186
185
|
throw createMismatchError(section, absolutePath, normalized, snapshots, expected ?? "");
|
|
187
186
|
}
|
|
@@ -200,17 +199,9 @@ function applyPreviewEdits(args: {
|
|
|
200
199
|
if (!options.skipHashValidation && expected === undefined) {
|
|
201
200
|
throw new Error(missingSnapshotTagMessage(section.path));
|
|
202
201
|
}
|
|
203
|
-
//
|
|
204
|
-
//
|
|
205
|
-
|
|
206
|
-
// the store retains text for the tag, require it to be unambiguous and
|
|
207
|
-
// byte-identical to live; otherwise fall through to recovery/reject below
|
|
208
|
-
// exactly as if the hash had not matched.
|
|
209
|
-
const liveMatches =
|
|
210
|
-
expected !== undefined &&
|
|
211
|
-
computeFileHash(normalized) === expected &&
|
|
212
|
-
(snapshots.byHash(absolutePath, expected) === null ||
|
|
213
|
-
snapshots.byHashExact(absolutePath, expected)?.text === normalized);
|
|
202
|
+
// The 4-hex tag is content-derived: when the live text hashes to it, trust
|
|
203
|
+
// the match and preview directly (mirrors Patcher's apply-time behavior).
|
|
204
|
+
const liveMatches = expected !== undefined && computeFileHash(normalized) === expected;
|
|
214
205
|
const edits = parsePreviewEdits(section, options.streaming);
|
|
215
206
|
const resolved = resolvePreviewEdits({ section, absolutePath, normalized, snapshots, expected, liveMatches, edits });
|
|
216
207
|
if (options.skipHashValidation || expected === undefined || liveMatches) return applyEdits(normalized, resolved);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Coding-agent runner that drives the hashline {@link Patcher} on behalf of
|
|
3
|
-
* the `edit` tool. Converts
|
|
3
|
+
* the `edit` tool. Converts an `{input}` tool-call payload into a
|
|
4
4
|
* fully-applied patch, wraps the result in the agent's
|
|
5
5
|
* {@link AgentToolResult} shape, and attaches LSP diagnostics + `outputMeta`
|
|
6
6
|
* for the renderer.
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Arktype schema for the `edit` tool's hashline mode payload. The schema is
|
|
3
3
|
* deliberately permissive (allows extra keys) so providers can attach extra
|
|
4
|
-
* keys without rejection; only `input` is required.
|
|
5
|
-
* provider-emitted alias for `input`.
|
|
4
|
+
* keys without rejection; only `input` is required.
|
|
6
5
|
*/
|
|
7
6
|
import { type } from "arktype";
|
|
8
7
|
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
export const hashlineEditParamsSchema = type({
|
|
9
|
+
input: "string",
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
export
|
|
13
|
-
.pipe(raw => {
|
|
14
|
-
if (raw.input !== undefined || raw._input === undefined) return raw;
|
|
15
|
-
return { ...raw, input: raw._input };
|
|
16
|
-
})
|
|
17
|
-
.pipe(requiredInputSchema);
|
|
18
|
-
|
|
19
|
-
export type HashlineParams = Parameters<typeof hashlineEditParamsSchema.assert>[0];
|
|
12
|
+
export type HashlineParams = typeof hashlineEditParamsSchema.infer;
|
package/src/edit/renderer.ts
CHANGED
|
@@ -114,6 +114,7 @@ interface EditRenderArgs {
|
|
|
114
114
|
newText?: string;
|
|
115
115
|
patch?: string;
|
|
116
116
|
input?: string;
|
|
117
|
+
_input?: string;
|
|
117
118
|
all?: boolean;
|
|
118
119
|
// Patch mode fields
|
|
119
120
|
op?: Operation;
|
|
@@ -600,10 +601,11 @@ function getHashlineInputRenderSummary(
|
|
|
600
601
|
args: EditRenderArgs,
|
|
601
602
|
editMode: EditMode | undefined,
|
|
602
603
|
): HashlineInputRenderSummary | undefined {
|
|
603
|
-
|
|
604
|
+
const input = args.input ?? args._input;
|
|
605
|
+
if (editMode !== "hashline" || typeof input !== "string") {
|
|
604
606
|
return undefined;
|
|
605
607
|
}
|
|
606
|
-
return { entries: getHashlineInputSections(
|
|
608
|
+
return { entries: getHashlineInputSections(input) };
|
|
607
609
|
}
|
|
608
610
|
|
|
609
611
|
function getApplyPatchRenderSummary(
|
package/src/edit/streaming.ts
CHANGED
|
@@ -429,9 +429,19 @@ const patchStrategy: EditStreamingStrategy<PatchArgs> = {
|
|
|
429
429
|
|
|
430
430
|
interface HashlineArgs {
|
|
431
431
|
input?: string;
|
|
432
|
+
_input?: string;
|
|
432
433
|
__partialJson?: string;
|
|
433
434
|
}
|
|
434
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Text payload of a hashline edit call. The public schema declares `input`, but
|
|
438
|
+
* streaming sees the raw model output before validation coerces aliases, so a
|
|
439
|
+
* provider that emits the legacy `_input` key still previews correctly.
|
|
440
|
+
*/
|
|
441
|
+
function hashlineEditText(args: HashlineArgs | undefined): string | undefined {
|
|
442
|
+
return args?.input ?? args?._input;
|
|
443
|
+
}
|
|
444
|
+
|
|
435
445
|
/**
|
|
436
446
|
* While streaming a free-form text payload (apply_patch envelope, hashline
|
|
437
447
|
* input), trim the trailing partial line so per-character growth of an
|
|
@@ -513,7 +523,8 @@ const hashlineStrategy: EditStreamingStrategy<HashlineArgs> = {
|
|
|
513
523
|
return args;
|
|
514
524
|
},
|
|
515
525
|
async computeDiffPreview(args, ctx) {
|
|
516
|
-
|
|
526
|
+
const input = hashlineEditText(args);
|
|
527
|
+
if (typeof input !== "string" || input.length === 0) return null;
|
|
517
528
|
// Unlike apply_patch, hashline previews flow through `applyPartialTo`,
|
|
518
529
|
// whose streaming-tolerant parser (`parsePatchStreaming` → `endStreaming`)
|
|
519
530
|
// drops a payload-less trailing op and projects a partially-typed payload
|
|
@@ -521,7 +532,6 @@ const hashlineStrategy: EditStreamingStrategy<HashlineArgs> = {
|
|
|
521
532
|
// would instead strip the sole payload of a single-op `replace`/`insert`
|
|
522
533
|
// for almost the entire stream, collapsing the preview to "No changes" and
|
|
523
534
|
// rendering a blank box. Feed the raw in-flight text straight through.
|
|
524
|
-
const input = args.input;
|
|
525
535
|
ctx.signal.throwIfAborted();
|
|
526
536
|
|
|
527
537
|
let sections: readonly HashlineInputSection[];
|
|
@@ -579,19 +589,19 @@ const hashlineStrategy: EditStreamingStrategy<HashlineArgs> = {
|
|
|
579
589
|
return "";
|
|
580
590
|
},
|
|
581
591
|
matcherDigest(args) {
|
|
582
|
-
const input = args
|
|
592
|
+
const input = hashlineEditText(args);
|
|
583
593
|
if (typeof input !== "string") return undefined;
|
|
584
594
|
// Body rows are `+TEXT`; headers and op lines are grammar, never content.
|
|
585
595
|
return extractAddedLines(input, false);
|
|
586
596
|
},
|
|
587
597
|
matcherPaths(args) {
|
|
588
|
-
const input = args
|
|
598
|
+
const input = hashlineEditText(args);
|
|
589
599
|
if (typeof input !== "string" || input.length === 0) return undefined;
|
|
590
600
|
const paths = extractHashlineHeaderPaths(input);
|
|
591
601
|
return paths.length > 0 ? paths : undefined;
|
|
592
602
|
},
|
|
593
603
|
matcherEntries(args) {
|
|
594
|
-
const input = args
|
|
604
|
+
const input = hashlineEditText(args);
|
|
595
605
|
if (typeof input !== "string" || input.length === 0) return undefined;
|
|
596
606
|
const entries = splitHashlinePerFile(input);
|
|
597
607
|
return entries.length > 0 ? entries : undefined;
|