@asterism-app/builtin-api 0.23.0 → 0.24.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/package.json +1 -1
- package/src/messaging.ts +2 -2
- package/src/search.ts +7 -11
- package/src/text.ts +7 -2
- package/src/tools.ts +2 -5
package/package.json
CHANGED
package/src/messaging.ts
CHANGED
|
@@ -29,8 +29,8 @@ export const Send = defineTool({
|
|
|
29
29
|
id: builtin.name("tool.send"), name: "send",
|
|
30
30
|
description: "Send text and file references through a linked resource.",
|
|
31
31
|
guidelines: [
|
|
32
|
-
"resource_id selects the messaging resource. Its target schema
|
|
33
|
-
"The
|
|
32
|
+
"resource_id selects the messaging resource. Its target schema defines the destination and any reply options.",
|
|
33
|
+
"The resource implementation determines the sending identity and delivery behavior.",
|
|
34
34
|
"A file-reference part carries a FileRef in its ref field. The optional filename specifies the name used for delivery.",
|
|
35
35
|
"Referenced content is resolved by the consuming implementation.",
|
|
36
36
|
],
|
package/src/search.ts
CHANGED
|
@@ -4,9 +4,7 @@ import { builtin } from "./identity.ts";
|
|
|
4
4
|
|
|
5
5
|
const pattern = z.string().min(1).refine(value => !value.includes("\0"), "Patterns must be free of NUL characters.");
|
|
6
6
|
const selection = {
|
|
7
|
-
|
|
8
|
-
noIgnore: z.boolean().optional().describe("Disable ignore-file filtering; defaults to false. Hidden-entry filtering is controlled separately by hidden."),
|
|
9
|
-
limit: z.number().int().positive().max(2000).optional().describe("Maximum returned matching lines in grep content mode, or files otherwise; defaults to 500, maximum 2000. Context lines are bounded only by the output-byte budget. Matching lines with omitted content count toward the limit."),
|
|
7
|
+
limit: z.number().int().positive().max(2000).optional().describe("Maximum returned matching lines, or entries in another resource-specific view; defaults to 500, maximum 2000. Context lines are bounded only by the output-byte budget."),
|
|
10
8
|
};
|
|
11
9
|
const globGuidelines = [
|
|
12
10
|
"Globs use ripgrep semantics. A pattern without '/' such as '*.md' matches filenames at any depth.",
|
|
@@ -19,30 +17,28 @@ export const Find = defineTool({
|
|
|
19
17
|
guidelines: globGuidelines,
|
|
20
18
|
argsSchema: z.strictObject({
|
|
21
19
|
pattern: pattern.describe("File glob relative to the selected search directory, using '/' separators; for example '**/*.ts' or '**/package.json'."),
|
|
20
|
+
hidden: z.boolean().optional().describe("Disable hidden-entry filtering; defaults to false. Ignore-file filtering is controlled separately by noIgnore."),
|
|
21
|
+
noIgnore: z.boolean().optional().describe("Disable ignore-file filtering; defaults to false. Hidden-entry filtering is controlled separately by hidden."),
|
|
22
22
|
...selection,
|
|
23
23
|
}).describe("A file glob and search selection options."),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
export const Grep = defineTool({
|
|
27
27
|
id: builtin.name("tool.grep"), name: "grep",
|
|
28
|
-
description: "Search
|
|
28
|
+
description: "Search text for a regular expression or literal pattern within a resource.",
|
|
29
29
|
guidelines: [
|
|
30
|
-
"
|
|
30
|
+
"Results identify matching lines and surrounding context. Resource implementations define additional output views.",
|
|
31
31
|
"Regular expressions use ripgrep's default Rust regex syntax. Matching is line-oriented.",
|
|
32
|
-
"
|
|
33
|
-
...globGuidelines,
|
|
32
|
+
"target selects the search scope and resource-specific content view according to the resource implementation's schema.",
|
|
34
33
|
],
|
|
35
34
|
argsSchema: z.strictObject({
|
|
36
35
|
pattern: pattern.describe("Pattern in ripgrep's default Rust regex syntax, without / delimiters. Matching is line-oriented; lookaround and pattern backreferences are unsupported. When literal is true, this is literal text."),
|
|
37
36
|
literal: z.boolean().optional().describe("Interpret pattern as literal text; defaults to false."),
|
|
38
37
|
ignoreCase: z.boolean().optional().describe("Use case-insensitive matching; defaults to false."),
|
|
39
38
|
word: z.boolean().optional().describe("Match only at word boundaries; defaults to false."),
|
|
40
|
-
glob: z.array(pattern).optional().describe("File globs relative to the search directory. Prefix exclusions with '!'; later globs take precedence."),
|
|
41
39
|
context: z.number().int().min(0).max(20).optional().describe("Lines before and after each match in content mode; defaults to 0."),
|
|
42
|
-
outputMode: z.enum(["content", "files", "count"]).optional().describe("Result format; defaults to content. Count means matching lines, rather than regex occurrences."),
|
|
43
|
-
anchored: z.boolean().optional().describe("Include edit anchors in content mode; defaults to true."),
|
|
44
40
|
...selection,
|
|
45
|
-
}).describe("
|
|
41
|
+
}).describe("Text pattern, matching options, context and result limit."),
|
|
46
42
|
});
|
|
47
43
|
|
|
48
44
|
export type FindArgs = z.infer<typeof Find.argsSchema>;
|
package/src/text.ts
CHANGED
|
@@ -20,20 +20,25 @@ export const editOperationSchema = z.discriminatedUnion("op", [
|
|
|
20
20
|
export const textRowSchema = z.strictObject({
|
|
21
21
|
line: z.number().int().positive().describe("The absolute 1-based line number in the complete text."),
|
|
22
22
|
content: z.string().describe("The line content without its terminator; for an excerpt, only the excerpt window."),
|
|
23
|
-
hash: z.string().nullable().describe("LINE#HASH content hash of the complete line, also for an excerpt; null when
|
|
23
|
+
hash: z.string().nullable().describe("LINE#HASH content hash of the complete line, also for an excerpt; null when the selected view has no edit anchors."),
|
|
24
24
|
excerpt: z.strictObject({
|
|
25
25
|
start: z.number().int().nonnegative().describe("UTF-16 offset of content within the complete line."),
|
|
26
26
|
length: z.number().int().positive().describe("UTF-16 length of the complete line."),
|
|
27
27
|
}).nullable().describe("Present when the line is too long to return in full; content is then a window of the complete line. Null for a complete line."),
|
|
28
28
|
});
|
|
29
29
|
export type TextRow = z.infer<typeof textRowSchema>;
|
|
30
|
+
export const textReadTargetSchema = z.strictObject({
|
|
31
|
+
offset: z.number().int().positive().optional().describe("First line to read, 1-based in the complete text; defaults to 1."),
|
|
32
|
+
limit: z.number().int().positive().max(2000).optional().describe("Maximum lines to read; defaults to 1000, maximum 2000. Output is also limited to 64 KiB of line text; lines longer than 16000 characters are returned as excerpts."),
|
|
33
|
+
anchored: z.boolean().optional().describe("Include LINE#HASH edit anchors; defaults to true. Anchors identify complete lines, including those displayed as excerpts. False returns text with line numbers only."),
|
|
34
|
+
});
|
|
30
35
|
export const textReadSchema = z.strictObject({
|
|
31
36
|
totalLines: z.number().int().nonnegative().describe("Number of logical lines in the complete text; empty text has zero lines."),
|
|
32
37
|
fromLine: z.number().int().positive().describe("First requested line, counted from 1 in the complete text."),
|
|
33
38
|
rows: z.array(textRowSchema).describe("Selected lines and their available edit anchors; long lines are returned as excerpts."),
|
|
34
39
|
noFinalNewline: z.boolean().describe("Whether non-empty text lacks a final newline."),
|
|
35
40
|
nextOffset: z.number().int().positive().nullable().describe("First unread line after the returned range, or null at end of text. Use as target.offset only when this implementation supports line selection."),
|
|
36
|
-
}).describe("Selected text lines
|
|
41
|
+
}).describe("Selected text lines with available edit anchors, final-newline information and a continuation position.");
|
|
37
42
|
|
|
38
43
|
export const textChangeSchema = z.strictObject({
|
|
39
44
|
changed: z.boolean().describe("Whether the target was created or its content changed."),
|
package/src/tools.ts
CHANGED
|
@@ -23,13 +23,10 @@ export const Read = defineTool({
|
|
|
23
23
|
name: "read",
|
|
24
24
|
description: "Read the selected content as text.",
|
|
25
25
|
guidelines: [
|
|
26
|
-
"target selects the content and
|
|
27
|
-
"Editable text includes LINE#HASH edit anchors by default; args:{\"anchored\":false} omits them. Content that cannot be edited has no anchors.",
|
|
26
|
+
"target selects the content, range, and reading view according to the resource implementation's schema.",
|
|
28
27
|
"The result reports positions and a continuation point where the implementation supports ranges.",
|
|
29
28
|
],
|
|
30
|
-
argsSchema: z.strictObject({
|
|
31
|
-
anchored: z.boolean().optional().describe("Include edit anchors for editable text; defaults to true."),
|
|
32
|
-
}).describe("Reading behavior. Content selection and range belong to target."),
|
|
29
|
+
argsSchema: z.strictObject({}).describe("Empty parameter object. Content selection, range, and reading view belong to target."),
|
|
33
30
|
});
|
|
34
31
|
|
|
35
32
|
export const Edit = defineTool({
|