pi-hashline-edit-pro 4.4.4 → 4.5.1

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/src/config-ui.ts CHANGED
@@ -2,7 +2,7 @@ import { Key, matchesKey, visibleWidth } from "@earendil-works/pi-tui";
2
2
  import type { Theme } from "@earendil-works/pi-coding-agent";
3
3
  import { readConfig, type Config } from "./config";
4
4
 
5
- export type ConfigToggleKey = "autoRead" | "autoReadAll" | "autoReadAllIgnore" | "anchorGrepEnabled" | "requirePath" | "strictInput" | "diffContextLines";
5
+ export type ConfigToggleKey = "autoRead" | "autoReadAll" | "autoReadAllIgnore" | "anchorGrepEnabled" | "copyMoveEnabled" | "requirePath" | "strictInput" | "diffContextLines";
6
6
 
7
7
  export interface ConfigRow {
8
8
  key: ConfigToggleKey;
@@ -23,6 +23,7 @@ export function configRows(config: Config): ConfigRow[] {
23
23
  { key: "autoReadAllIgnore", label: "Ignore folders/files", hint: "Extra folders, files, or globs skipped by auto-read all (comma-separated)", enabled: (config.autoReadAllIgnore ?? []).length > 0, folders: config.autoReadAllIgnore ?? [] },
24
24
  { key: "diffContextLines", label: "Diff context", hint: "Surrounding lines in post-edit diffs (needs Auto-read)", enabled: config.autoRead !== false, value: config.diffContextLines ?? 1, disabled: config.autoRead === false },
25
25
  { key: "anchorGrepEnabled", label: "Anchor grep", hint: "anchor_grep tool (builtin grep off while on)", enabled: config.anchorGrepEnabled === true },
26
+ { key: "copyMoveEnabled", label: "Copy/move", hint: "copy and move tools (both off while disabled)", enabled: config.copyMoveEnabled !== false },
26
27
  { key: "requirePath", label: "Require path", hint: "replace + insert need path (RPC visibility)", enabled: config.requirePath === true },
27
28
  { key: "strictInput", label: "Strict input", hint: "Reject auto-fixable slips instead of warnings", enabled: config.strictInput === true },
28
29
  ];
package/src/config.ts CHANGED
@@ -13,6 +13,7 @@ export const MAX_DIFF_CONTEXT_LINES = 10;
13
13
  export interface Config {
14
14
  autoRead: boolean;
15
15
  anchorGrepEnabled: boolean;
16
+ copyMoveEnabled?: boolean;
16
17
  autoReadAll?: AutoReadAllMode;
17
18
  autoReadAllIgnore?: string[];
18
19
  requirePath?: boolean;
@@ -23,6 +24,7 @@ export interface Config {
23
24
  const DEFAULT_CONFIG: Config = {
24
25
  autoRead: true,
25
26
  anchorGrepEnabled: true,
27
+ copyMoveEnabled: true,
26
28
  autoReadAll: "off",
27
29
  autoReadAllIgnore: [],
28
30
  requirePath: false,
@@ -72,6 +74,7 @@ function parseConfig(content: string): Config {
72
74
  }
73
75
  const autoRead = parsed.autoRead;
74
76
  const anchorGrepEnabled = parsed.anchorGrepEnabled;
77
+ const copyMoveEnabled = parsed.copyMoveEnabled;
75
78
  const autoReadAll = parsed.autoReadAll;
76
79
  const requirePath = parsed.requirePath;
77
80
  const strictInput = parsed.strictInput;
@@ -80,6 +83,7 @@ function parseConfig(content: string): Config {
80
83
  return {
81
84
  autoRead: typeof autoRead === "boolean" ? autoRead : DEFAULT_CONFIG.autoRead,
82
85
  anchorGrepEnabled: typeof anchorGrepEnabled === "boolean" ? anchorGrepEnabled : DEFAULT_CONFIG.anchorGrepEnabled,
86
+ copyMoveEnabled: typeof copyMoveEnabled === "boolean" ? copyMoveEnabled : DEFAULT_CONFIG.copyMoveEnabled,
83
87
  autoReadAll: parseAutoReadAllMode(autoReadAll),
84
88
  requirePath: typeof requirePath === "boolean" ? requirePath : DEFAULT_CONFIG.requirePath,
85
89
  strictInput: typeof strictInput === "boolean" ? strictInput : DEFAULT_CONFIG.strictInput,
@@ -192,7 +196,7 @@ export async function writeConfig(config: Config): Promise<void> {
192
196
  }
193
197
 
194
198
 
195
- type ToggleKey = "autoRead" | "anchorGrepEnabled" | "requirePath" | "strictInput";
199
+ type ToggleKey = "autoRead" | "anchorGrepEnabled" | "copyMoveEnabled" | "requirePath" | "strictInput";
196
200
 
197
201
  async function toggleFlag(key: ToggleKey): Promise<boolean> {
198
202
  const config = await updateConfig((c) => { c[key] = !(c[key] === true); });
@@ -200,6 +204,7 @@ async function toggleFlag(key: ToggleKey): Promise<boolean> {
200
204
  }
201
205
  export const toggleAutoRead = (): Promise<boolean> => toggleFlag("autoRead");
202
206
  export const toggleAnchorGrep = (): Promise<boolean> => toggleFlag("anchorGrepEnabled");
207
+ export const toggleCopyMove = (): Promise<boolean> => toggleFlag("copyMoveEnabled");
203
208
  export async function cycleAutoReadAllMode(): Promise<AutoReadAllMode> {
204
209
  let next: AutoReadAllMode = "off";
205
210
  await updateConfig((c) => {
package/src/constants.ts CHANGED
@@ -9,7 +9,7 @@ export const MAX_GREP_LINE_BYTES = 500;
9
9
  export const MAX_DIFF_INPUT_BYTES = 1024 * 1024;
10
10
 
11
11
  export const HASH_STORE_BUSY_TIMEOUT = 1000;
12
- export const HASH_STORE_VERSION = 8;
12
+ export const HASH_STORE_VERSION = 9;
13
13
  export const NEW_CONTENT_NOT_ARRAY_MSG =
14
14
  `[E_BAD_SHAPE] "replacement_lines" must be an array of strings, one per line (use [] to delete).`;
15
15