@oh-my-pi/pi-coding-agent 14.7.8 → 14.8.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 +13 -0
- package/README.md +1 -0
- package/package.json +7 -7
- package/src/commit/agentic/index.ts +2 -1
- package/src/config/model-registry.ts +18 -10
- package/src/edit/file-read-cache.ts +95 -0
- package/src/edit/index.ts +1 -0
- package/src/edit/modes/hashline.ts +137 -2
- package/src/extensibility/extensions/loader.ts +5 -2
- package/src/extensibility/plugins/legacy-pi-compat.ts +166 -0
- package/src/extensibility/plugins/loader.ts +3 -7
- package/src/internal-urls/docs-index.generated.ts +2 -1
- package/src/modes/components/model-selector.ts +22 -2
- package/src/modes/components/status-line/segments.ts +2 -2
- package/src/modes/components/status-line-segment-editor.ts +2 -2
- package/src/modes/controllers/mcp-command-controller.ts +4 -12
- package/src/prompts/tools/eval.md +1 -1
- package/src/prompts/tools/hashline.md +17 -3
- package/src/tools/eval.ts +10 -0
- package/src/tools/fs-cache-invalidation.ts +2 -2
- package/src/tools/index.ts +6 -0
- package/src/tools/read.ts +68 -11
- package/src/tools/search.ts +10 -4
- package/src/utils/git.ts +10 -4
package/src/utils/git.ts
CHANGED
|
@@ -40,6 +40,12 @@ export type HunkSelection = {
|
|
|
40
40
|
hunks: { type: "all" } | { type: "indices"; indices: number[] } | { type: "lines"; start: number; end: number };
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
export interface StageHunksOptions {
|
|
44
|
+
readonly diffCached?: boolean;
|
|
45
|
+
readonly rawDiff?: string;
|
|
46
|
+
readonly signal?: AbortSignal;
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
export interface DiffOptions {
|
|
44
50
|
readonly allowFailure?: boolean;
|
|
45
51
|
readonly base?: string;
|
|
@@ -803,10 +809,10 @@ export const stage = {
|
|
|
803
809
|
await runEffect(cwd, args, { signal });
|
|
804
810
|
},
|
|
805
811
|
|
|
806
|
-
/** Selectively stage hunks from the working tree diff. */
|
|
807
|
-
async hunks(cwd: string, selections: HunkSelection[],
|
|
812
|
+
/** Selectively stage hunks from the provided diff or the current working tree diff. */
|
|
813
|
+
async hunks(cwd: string, selections: HunkSelection[], options: StageHunksOptions = {}): Promise<void> {
|
|
808
814
|
if (selections.length === 0) return;
|
|
809
|
-
const rawDiff = await diff(cwd, { cached:
|
|
815
|
+
const rawDiff = options.rawDiff ?? (await diff(cwd, { cached: options.diffCached, signal: options.signal }));
|
|
810
816
|
const fileDiffs = parseFileDiffs(rawDiff);
|
|
811
817
|
const fileDiffMap = new Map(fileDiffs.map(entry => [entry.filename, entry]));
|
|
812
818
|
const patchParts: string[] = [];
|
|
@@ -833,7 +839,7 @@ export const stage = {
|
|
|
833
839
|
|
|
834
840
|
const patchText = patch.join(patchParts);
|
|
835
841
|
if (!patchText.trim()) return;
|
|
836
|
-
await patch.applyText(cwd, patchText, { cached: true, signal });
|
|
842
|
+
await patch.applyText(cwd, patchText, { cached: true, signal: options.signal });
|
|
837
843
|
},
|
|
838
844
|
|
|
839
845
|
/** Unstage files. Empty array unstages all (`git reset`). */
|