You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/09/16 10:57:22 UTC

(maka) 01/01: fix(runtime): align file tool descriptions with capabilities

This is an automated email from the ASF dual-hosted git repository.

Astro-Han pushed a commit to branch fix/tool-descriptions-capabilities
in repository https://gitbox.apache.org/repos/asf/maka.git

commit 5195e9aab067b709d4688914bb5990bd3a0fc1e2
Author: AstroHan <le...@outlook.com>
AuthorDate: Wed Sep 16 18:57:14 2026 +0800

    fix(runtime): align file tool descriptions with capabilities
    
    Generated-by: Codex
---
 packages/runtime/src/builtin-tools.ts | 6 +++---
 packages/runtime/src/read-page.ts     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/packages/runtime/src/builtin-tools.ts b/packages/runtime/src/builtin-tools.ts
index e2df229a5f..83343d6b0d 100644
--- a/packages/runtime/src/builtin-tools.ts
+++ b/packages/runtime/src/builtin-tools.ts
@@ -422,11 +422,11 @@ export function buildBuiltinTools(options: BuildBuiltinToolsOptions = {}): MakaT
       name: 'Write',
       activityKind: 'edit',
       description:
-        'Write content to a file. Relative paths resolve from the session cwd; ' +
+        'Create a text file or overwrite its entire contents; does not append. The parent directory must exist. Use Edit for partial changes. Relative paths resolve from the session cwd; ' +
         'how far outside it a path may reach is decided by the session permissions.',
       parameters: z.object({
         path: z.string().describe('A file path; relative paths are resolved from the session cwd'),
-        content: z.string(),
+        content: z.string().describe('The complete text to write to the file.'),
       }),
       executionFacts,
       impl: async ({ path, content }, ctx) => {
@@ -533,7 +533,7 @@ export function buildBuiltinTools(options: BuildBuiltinToolsOptions = {}): MakaT
       name: 'Glob',
       activityKind: 'search',
       description:
-        'Find files matching a glob pattern (case-insensitive, capped at 200, sorted by walk order).',
+        'Find file and directory paths matching a glob pattern. Case sensitivity follows platform defaults. Hidden entries require an explicit dot-prefixed pattern component. Returns at most 200 matches in traversal order, without sorting.',
       parameters: z.object({
         pattern: z
           .string()
diff --git a/packages/runtime/src/read-page.ts b/packages/runtime/src/read-page.ts
index 955fc59d3d..d1361f9934 100644
--- a/packages/runtime/src/read-page.ts
+++ b/packages/runtime/src/read-page.ts
@@ -22,7 +22,7 @@ import { z } from 'zod';
 
 export const READ_PAGE_MAX_CHARS = 7_500;
 export const READ_DESCRIPTION =
-  'Read a file or a Maka resource. Only path is required. By default, read from the beginning and return one bounded page. offset and limit select a line range; offset is zero-based. A large limit cannot bypass the response-size cap. If next is non-null, pass its contents to Read to continue; otherwise the requested range is complete. Use a smaller limit for a short excerpt. A partialLine page continues automatically through next.';
+  'Read a text file, view a PNG/JPEG/GIF/WebP image, or read a Maka resource returned by a tool. Only path is required. Images are returned as images, without text pagination. Text reads return one bounded page by default; offset and limit select a line range within the response-size cap. If next is non-null, pass its complete object to Read to continue, including partial lines; otherwise the requested range is complete.';
 export const readParameters = z.object({
   path: z
     .string({
@@ -38,7 +38,7 @@ export const readParameters = z.object({
     .nonnegative('offset must be non-negative. Omit it to start at the beginning.')
     .optional()
     .describe(
-      'Zero-based starting line; defaults to 0. offset 200 starts at line 201. Omit when using a continuation address.',
+      'Zero-based starting text line; defaults to 0. offset 200 starts at line 201. Omit for images or when using a continuation address.',
     ),
   limit: z
     .number({ error: 'limit must be a positive integer. Omit it to read one bounded page.' })
@@ -46,7 +46,7 @@ export const readParameters = z.object({
     .positive('limit must be positive. Omit it to read one bounded page.')
     .optional()
     .describe(
-      'Maximum lines in the requested range. Omit to browse one bounded page at a time. Use next to obtain any remaining content.',
+      'Maximum text lines in the requested range. Omit for images or to browse one bounded page at a time. Use next to obtain any remaining content.',
     ),
 });
 export type ReadInput = z.infer<typeof readParameters>;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org