@nghyane/arcane 0.1.20 → 0.1.22

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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.22] - 2026-03-08
6
+
7
+ ### Changed
8
+
9
+ - Rename edit operation `replace` to `replace_range` for clarity
10
+
11
+ ## [0.1.21] - 2026-03-05
12
+
13
+ ### Fixed
14
+
15
+ - Fix crash when extension tools define renderCall/renderResult (readonly property assignment)
16
+
5
17
  ## [0.1.20] - 2026-03-05
6
18
 
7
19
  ### Added
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@nghyane/arcane",
4
- "version": "0.1.20",
4
+ "version": "0.1.22",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/nghyane/arcane",
7
7
  "author": "Can Bölük",
@@ -25,16 +25,24 @@ export class RegisteredToolAdapter implements AgentTool<any, any, any> {
25
25
 
26
26
  const def = registeredTool.definition;
27
27
  if (def.renderCall) {
28
- (this as any).renderCall = (args: any, options: any, theme: any) => def.renderCall!(args, options, theme);
28
+ Object.defineProperty(this, "renderCall", {
29
+ value: (args: any, options: any, theme: any) => def.renderCall!(args, options, theme),
30
+ enumerable: true,
31
+ configurable: true,
32
+ });
29
33
  }
30
34
  if (def.renderResult) {
31
- (this as any).renderResult = (result: any, options: any, theme: any, args?: any) =>
32
- def.renderResult!(
33
- result,
34
- { expanded: options.expanded, isPartial: options.isPartial, spinnerFrame: options.spinnerFrame },
35
- theme,
36
- args,
37
- );
35
+ Object.defineProperty(this, "renderResult", {
36
+ value: (result: any, options: any, theme: any, args?: any) =>
37
+ def.renderResult!(
38
+ result,
39
+ { expanded: options.expanded, isPartial: options.isPartial, spinnerFrame: options.spinnerFrame },
40
+ theme,
41
+ args,
42
+ ),
43
+ enumerable: true,
44
+ configurable: true,
45
+ });
38
46
  }
39
47
  }
40
48
 
@@ -314,10 +314,10 @@ export class EditTool implements AgentTool<TInput, any, Theme> {
314
314
  });
315
315
  break;
316
316
  }
317
- case "replace": {
317
+ case "replace_range": {
318
318
  const { first, last, content } = edit;
319
319
  anchorEdits.push({
320
- op: "replace",
320
+ op: "replace_range",
321
321
  first: parseTag(first),
322
322
  last: parseTag(last),
323
323
  content: hashlineParseContent(content),
@@ -419,7 +419,7 @@ export class EditTool implements AgentTool<TInput, any, Theme> {
419
419
  case "set":
420
420
  refs.push(edit.tag);
421
421
  break;
422
- case "replace":
422
+ case "replace_range":
423
423
  refs.push(edit.first, edit.last);
424
424
  break;
425
425
  case "append":
@@ -17,7 +17,7 @@ import type { HashMismatch } from "./types";
17
17
  export type LineTag = { line: number; hash: string };
18
18
  export type HashlineEdit =
19
19
  | { op: "set"; tag: LineTag; content: string[] }
20
- | { op: "replace"; first: LineTag; last: LineTag; content: string[] }
20
+ | { op: "replace_range"; first: LineTag; last: LineTag; content: string[] }
21
21
  | { op: "append"; after?: LineTag; content: string[] }
22
22
  | { op: "prepend"; before?: LineTag; content: string[] }
23
23
  | { op: "insert"; after: LineTag; before: LineTag; content: string[] };
@@ -647,7 +647,7 @@ export function applyHashlineEdits(
647
647
  case "set":
648
648
  touched.add(edit.tag.line);
649
649
  break;
650
- case "replace":
650
+ case "replace_range":
651
651
  for (let ln = edit.first.line; ln <= edit.last.line; ln++) touched.add(ln);
652
652
  break;
653
653
  case "append":
@@ -715,7 +715,7 @@ export function applyHashlineEdits(
715
715
  if (!afterValid || !beforeValid) continue;
716
716
  break;
717
717
  }
718
- case "replace": {
718
+ case "replace_range": {
719
719
  if (edit.first.line > edit.last.line) {
720
720
  throw new Error(`Range start line ${edit.first.line} must be <= end line ${edit.last.line}`);
721
721
  }
@@ -740,7 +740,7 @@ export function applyHashlineEdits(
740
740
  case "set":
741
741
  lineKey = `s:${edit.tag.line}`;
742
742
  break;
743
- case "replace":
743
+ case "replace_range":
744
744
  lineKey = `r:${edit.first.line}:${edit.last.line}`;
745
745
  break;
746
746
  case "append":
@@ -783,7 +783,7 @@ export function applyHashlineEdits(
783
783
  sortLine = edit.tag.line;
784
784
  precedence = 0;
785
785
  break;
786
- case "replace":
786
+ case "replace_range":
787
787
  sortLine = edit.last.line;
788
788
  precedence = 0;
789
789
  break;
@@ -850,7 +850,7 @@ export function applyHashlineEdits(
850
850
  trackFirstChanged(edit.tag.line);
851
851
  break;
852
852
  }
853
- case "replace": {
853
+ case "replace_range": {
854
854
  const count = edit.last.line - edit.first.line + 1;
855
855
  const origLines = originalFileLines.slice(edit.first.line - 1, edit.first.line - 1 + count);
856
856
  let stripped = autocorrect
@@ -133,7 +133,7 @@ const hashlinePrependEditSchema = Type.Object(
133
133
 
134
134
  const hashlineRangeEditSchema = Type.Object(
135
135
  {
136
- op: Type.Literal("replace"),
136
+ op: Type.Literal("replace_range"),
137
137
  first: hashlineTagFormat("first line"),
138
138
  last: hashlineTagFormat("last line"),
139
139
  content: hashlineReplaceContentFormat("Replacement"),