@asterism-app/builtin-api 1.1.3 → 1.1.4

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.
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "@asterism-app/sdk": "2.2.1",
19
- "@asterism-app/builtin-api": "1.1.3",
19
+ "@asterism-app/builtin-api": "1.1.4",
20
20
  "@asterism-app/plugin-build": "1.0.1",
21
21
  "typescript": "^7.0.2",
22
22
  "@types/node": "^26.6.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asterism-app/builtin-api",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Public domain contracts and extensions for Asterism built-in features",
5
5
  "license": "MIT",
6
6
  "author": "Chien Zhang",
package/src/text.ts CHANGED
@@ -45,7 +45,7 @@ export const textChangeSchema = z.strictObject({
45
45
  diff: z.string().describe("The actual unified diff, preserving final-newline and CRLF differences."),
46
46
  added: z.number().int().nonnegative().describe("Number of added lines in the actual diff."),
47
47
  removed: z.number().int().nonnegative().describe("Number of removed lines in the actual diff."),
48
- anchors: z.array(textRowSchema).describe("Fresh anchors for lines produced by edit or replace, including a line shifted into a deletion gap. Always empty for write."),
48
+ anchors: z.array(lineAnchorSchema).describe("Fresh anchors for lines produced by edit or replace, including a line shifted into a deletion gap. Always empty for write."),
49
49
  anchorsTruncated: z.boolean().describe("True when the fresh anchors cover a subset of the changed lines."),
50
50
  }).describe("The committed content change with an actual diff and bounded fresh edit anchors. write returns an empty anchors array.");
51
51
  export type TextRead = z.infer<typeof textReadSchema>;
package/src/tools.ts CHANGED
@@ -52,7 +52,8 @@ export const Edit = defineTool({
52
52
  "append/prepend take body. Each body item is one text line; an empty string represents a blank line.",
53
53
  "All operations refer to the same pre-edit content and commit as one batch. Anchor or overlap failures preserve the original text.",
54
54
  "Replace/delete ranges conflict when they share original lines. Insertions can share range boundaries; an insertion strictly inside a replaced or deleted range conflicts. Insertions at the same original gap appear in edits array order.",
55
- "Anchor mismatch results include current-line or shifted candidates. Successful results include the actual diff and fresh anchors.",
55
+ "A successful edit reports the line counts and fresh LINE#HASH anchors for subsequent edits. The user-facing result contains the diff.",
56
+ "Anchor mismatch results include current-line or shifted candidates.",
56
57
  ],
57
58
  argsSchema: z.strictObject({
58
59
  edits: z.array(editOperationSchema).min(1).max(500).describe("One to 500 hashline operations referring to the same current text. Replace/delete ranges have no shared lines; insertions may share boundaries and use array order at the same gap."),
@@ -89,7 +90,7 @@ export const Replace = defineTool({
89
90
  "Literal mode matches find as text and inserts replace verbatim. Regex mode uses JavaScript regular expressions and replacement syntax.",
90
91
  "All non-overlapping matches are replaced. flags applies in both modes; global matching is always enabled.",
91
92
  "No matches returns an error without changing the target. Matches that produce identical content succeed without writing.",
92
- "The result includes the match count, actual diff, and fresh anchors for changed lines. These anchors can be used by edit.",
93
+ "The receipt reports the match count and fresh anchors for edit. The user-facing result contains the diff.",
93
94
  ],
94
95
  argsSchema: z.strictObject({
95
96
  find: z.string().min(1).describe("Non-empty text to find, or a JavaScript regular expression source when regex is true."),