oh-my-opencode 3.8.4 → 3.8.5
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/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +3 -3
- package/README.zh-cn.md +3 -3
- package/dist/cli/index.js +8 -8
- package/dist/index.js +384 -463
- package/dist/tools/hashline-edit/constants.d.ts +0 -1
- package/dist/tools/hashline-edit/edit-operation-primitives.d.ts +0 -2
- package/dist/tools/hashline-edit/edit-operations.d.ts +0 -1
- package/dist/tools/hashline-edit/edit-ordering.d.ts +1 -0
- package/dist/tools/hashline-edit/index.d.ts +2 -2
- package/dist/tools/hashline-edit/normalize-edits.d.ts +6 -9
- package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
- package/dist/tools/hashline-edit/types.d.ts +17 -41
- package/package.json +8 -8
|
@@ -5,8 +5,6 @@ export declare function applySetLine(lines: string[], anchor: string, newText: s
|
|
|
5
5
|
export declare function applyReplaceLines(lines: string[], startAnchor: string, endAnchor: string, newText: string | string[], options?: EditApplyOptions): string[];
|
|
6
6
|
export declare function applyInsertAfter(lines: string[], anchor: string, text: string | string[], options?: EditApplyOptions): string[];
|
|
7
7
|
export declare function applyInsertBefore(lines: string[], anchor: string, text: string | string[], options?: EditApplyOptions): string[];
|
|
8
|
-
export declare function applyInsertBetween(lines: string[], afterAnchor: string, beforeAnchor: string, text: string | string[], options?: EditApplyOptions): string[];
|
|
9
8
|
export declare function applyAppend(lines: string[], text: string | string[]): string[];
|
|
10
9
|
export declare function applyPrepend(lines: string[], text: string | string[]): string[];
|
|
11
|
-
export declare function applyReplace(content: string, oldText: string, newText: string | string[]): string;
|
|
12
10
|
export {};
|
|
@@ -6,4 +6,3 @@ export interface HashlineApplyReport {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function applyHashlineEditsWithReport(content: string, edits: HashlineEdit[]): HashlineApplyReport;
|
|
8
8
|
export declare function applyHashlineEdits(content: string, edits: HashlineEdit[]): string;
|
|
9
|
-
export { applySetLine, applyReplaceLines, applyInsertAfter, applyInsertBefore, applyInsertBetween, applyReplace, } from "./edit-operation-primitives";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { HashlineEdit } from "./types";
|
|
2
2
|
export declare function getEditLineNumber(edit: HashlineEdit): number;
|
|
3
3
|
export declare function collectLineRefs(edits: HashlineEdit[]): string[];
|
|
4
|
+
export declare function detectOverlappingRanges(edits: HashlineEdit[]): string | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { computeLineHash, formatHashLine, formatHashLines, streamHashLinesFromLines, streamHashLinesFromUtf8, } from "./hash-computation";
|
|
2
2
|
export { parseLineRef, validateLineRef } from "./validation";
|
|
3
3
|
export type { LineRef } from "./validation";
|
|
4
|
-
export type {
|
|
4
|
+
export type { ReplaceEdit, AppendEdit, PrependEdit, HashlineEdit, } from "./types";
|
|
5
5
|
export { NIBBLE_STR, HASHLINE_DICT, HASHLINE_REF_PATTERN, HASHLINE_OUTPUT_PATTERN } from "./constants";
|
|
6
|
-
export { applyHashlineEdits,
|
|
6
|
+
export { applyHashlineEdits, } from "./edit-operations";
|
|
7
7
|
export { createHashlineEditTool } from "./tools";
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { HashlineEdit } from "./types";
|
|
2
|
+
type HashlineToolOp = "replace" | "append" | "prepend";
|
|
2
3
|
export interface RawHashlineEdit {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
after_line?: string;
|
|
8
|
-
before_line?: string;
|
|
9
|
-
text?: string | string[];
|
|
10
|
-
old_text?: string;
|
|
11
|
-
new_text?: string | string[];
|
|
4
|
+
op?: HashlineToolOp;
|
|
5
|
+
pos?: string;
|
|
6
|
+
end?: string;
|
|
7
|
+
lines?: string | string[] | null;
|
|
12
8
|
}
|
|
13
9
|
export declare function normalizeHashlineEdits(rawEdits: RawHashlineEdit[]): HashlineEdit[];
|
|
10
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HASHLINE_EDIT_DESCRIPTION = "Edit files using LINE#ID format for precise, safe modifications.\n\nWORKFLOW:\n1. Read target file/range and copy exact LINE#ID tags.\n2. Pick the smallest operation per logical mutation site.\n3. Submit one edit call per file with all related operations.\n4. If same file needs another call, re-read first.\n5. Use anchors as \"LINE#ID\" only (never include trailing \"
|
|
1
|
+
export declare const HASHLINE_EDIT_DESCRIPTION = "Edit files using LINE#ID format for precise, safe modifications.\n\nWORKFLOW:\n1. Read target file/range and copy exact LINE#ID tags.\n2. Pick the smallest operation per logical mutation site.\n3. Submit one edit call per file with all related operations.\n4. If same file needs another call, re-read first.\n5. Use anchors as \"LINE#ID\" only (never include trailing \"|content\").\n\nVALIDATION:\n Payload shape: { \"filePath\": string, \"edits\": [...], \"delete\"?: boolean, \"rename\"?: string }\n Each edit must be one of: replace, append, prepend\n Edit shape: { \"op\": \"replace\"|\"append\"|\"prepend\", \"pos\"?: \"LINE#ID\", \"end\"?: \"LINE#ID\", \"lines\"?: string|string[]|null }\n lines must contain plain replacement text only (no LINE#ID prefixes, no diff + markers)\n CRITICAL: all operations validate against the same pre-edit file snapshot and apply bottom-up. Refs/tags are interpreted against the last-read version of the file.\n\nLINE#ID FORMAT (CRITICAL):\n Each line reference must be in \"{line_number}#{hash_id}\" format where:\n {line_number}: 1-based line number\n {hash_id}: Two CID letters from the set ZPMQVRWSNKTXJBYH\n\nFILE MODES:\n delete=true deletes file and requires edits=[] with no rename\n rename moves final content to a new path and removes old path\n\nCONTENT FORMAT:\n lines can be a string (single line) or string[] (multi-line, preferred).\n If you pass a multi-line string, it is split by real newline characters.\n Literal \"\\n\" is preserved as text.\n\nFILE CREATION:\n append without anchors adds content at EOF. If file does not exist, creates it.\n prepend without anchors adds content at BOF. If file does not exist, creates it.\n CRITICAL: only unanchored append/prepend can create a missing file.\n\nOPERATION CHOICE:\n replace with pos only -> replace one line at pos (MOST COMMON for single-line edits)\n replace with pos+end -> replace ENTIRE range pos..end as a block (ranges MUST NOT overlap across edits)\n append with pos/end anchor -> insert after that anchor\n prepend with pos/end anchor -> insert before that anchor\n append/prepend without anchors -> EOF/BOF insertion\n\nRULES (CRITICAL):\n 1. Minimize scope: one logical mutation site per operation.\n 2. Preserve formatting: keep indentation, punctuation, line breaks, trailing commas, brace style.\n 3. Prefer insertion over neighbor rewrites: anchor to structural boundaries (}, ], },), not interior property lines.\n 4. No no-ops: replacement content must differ from current content.\n 5. Touch only requested code: avoid incidental edits.\n 6. Use exact current tokens: NEVER rewrite approximately.\n 7. For swaps/moves: prefer one range operation over multiple single-line operations.\n 8. Output tool calls only; no prose or commentary between them.\n\nTAG CHOICE (ALWAYS):\n - Copy tags exactly from read output or >>> mismatch output.\n - NEVER guess tags.\n - Anchor to structural lines (function/class/brace), NEVER blank lines.\n - Anti-pattern warning: blank/whitespace anchors are fragile.\n - Re-read after each successful edit call before issuing another on the same file.\n\nAUTOCORRECT (built-in - you do NOT need to handle these):\n Merged lines are auto-expanded back to original line count.\n Indentation is auto-restored from original lines.\n BOM and CRLF line endings are preserved automatically.\n Hashline prefixes and diff markers in text are auto-stripped.\n\nRECOVERY (when >>> mismatch error appears):\n Copy the updated LINE#ID tags shown in the error output directly.\n Re-read only if the needed tags are missing from the error snippet.\n ALWAYS batch all edits for one file in a single call.";
|
|
@@ -1,41 +1,17 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export interface
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
export
|
|
18
|
-
type: "insert_before";
|
|
19
|
-
line: string;
|
|
20
|
-
text: string | string[];
|
|
21
|
-
}
|
|
22
|
-
export interface InsertBetween {
|
|
23
|
-
type: "insert_between";
|
|
24
|
-
after_line: string;
|
|
25
|
-
before_line: string;
|
|
26
|
-
text: string | string[];
|
|
27
|
-
}
|
|
28
|
-
export interface Replace {
|
|
29
|
-
type: "replace";
|
|
30
|
-
old_text: string;
|
|
31
|
-
new_text: string | string[];
|
|
32
|
-
}
|
|
33
|
-
export interface Append {
|
|
34
|
-
type: "append";
|
|
35
|
-
text: string | string[];
|
|
36
|
-
}
|
|
37
|
-
export interface Prepend {
|
|
38
|
-
type: "prepend";
|
|
39
|
-
text: string | string[];
|
|
40
|
-
}
|
|
41
|
-
export type HashlineEdit = SetLine | ReplaceLines | InsertAfter | InsertBefore | InsertBetween | Replace | Append | Prepend;
|
|
1
|
+
export interface ReplaceEdit {
|
|
2
|
+
op: "replace";
|
|
3
|
+
pos: string;
|
|
4
|
+
end?: string;
|
|
5
|
+
lines: string | string[];
|
|
6
|
+
}
|
|
7
|
+
export interface AppendEdit {
|
|
8
|
+
op: "append";
|
|
9
|
+
pos?: string;
|
|
10
|
+
lines: string | string[];
|
|
11
|
+
}
|
|
12
|
+
export interface PrependEdit {
|
|
13
|
+
op: "prepend";
|
|
14
|
+
pos?: string;
|
|
15
|
+
lines: string | string[];
|
|
16
|
+
}
|
|
17
|
+
export type HashlineEdit = ReplaceEdit | AppendEdit | PrependEdit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.5",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"typescript": "^5.7.3"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"oh-my-opencode-darwin-arm64": "3.8.
|
|
78
|
-
"oh-my-opencode-darwin-x64": "3.8.
|
|
79
|
-
"oh-my-opencode-linux-arm64": "3.8.
|
|
80
|
-
"oh-my-opencode-linux-arm64-musl": "3.8.
|
|
81
|
-
"oh-my-opencode-linux-x64": "3.8.
|
|
82
|
-
"oh-my-opencode-linux-x64-musl": "3.8.
|
|
83
|
-
"oh-my-opencode-windows-x64": "3.8.
|
|
77
|
+
"oh-my-opencode-darwin-arm64": "3.8.5",
|
|
78
|
+
"oh-my-opencode-darwin-x64": "3.8.5",
|
|
79
|
+
"oh-my-opencode-linux-arm64": "3.8.5",
|
|
80
|
+
"oh-my-opencode-linux-arm64-musl": "3.8.5",
|
|
81
|
+
"oh-my-opencode-linux-x64": "3.8.5",
|
|
82
|
+
"oh-my-opencode-linux-x64-musl": "3.8.5",
|
|
83
|
+
"oh-my-opencode-windows-x64": "3.8.5"
|
|
84
84
|
},
|
|
85
85
|
"trustedDependencies": [
|
|
86
86
|
"@ast-grep/cli",
|