UNPKG

hataraku

Version:

An autonomous coding agent for building AI-powered development tools. The name "Hataraku" (働く) means "to work" in Japanese.

83 lines 3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_CODE_EXPLANATION_TASK = exports.DEFAULT_CODE_REVIEW_TASK = exports.TaskConfigSchema = exports.TaskTemplateSchema = void 0; const zod_1 = require("zod"); /** * Schema for template parameters * Defines how template strings are processed in tasks */ exports.TaskTemplateSchema = zod_1.z.object({ template: zod_1.z.string(), parameters: zod_1.z.array(zod_1.z.string()) }); /** * Schema for task configuration * Defines the structure for a task configuration file */ exports.TaskConfigSchema = zod_1.z.object({ name: zod_1.z.string(), description: zod_1.z.string(), agent: zod_1.z.string(), // Reference to agent configuration schema: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(), // Input/output schema as JSON Schema task: zod_1.z.union([ zod_1.z.string(), // New format: Task template as a string exports.TaskTemplateSchema // Old format: Task template as an object ]), parameters: zod_1.z.string().optional() // Comma-separated list of parameters (for new format) }); /** * Default task configuration for code review */ exports.DEFAULT_CODE_REVIEW_TASK = { name: "Code Review", description: "Comprehensive code review for pull requests or specific files", agent: "code-reviewer", schema: { type: "object", properties: { files: { type: "array", items: { type: "string" }, description: "Array of file paths to review" }, focus_areas: { type: "array", items: { type: "string" }, description: "Specific areas to focus review on" } }, required: ["files"] }, task: "Review the following files:\n${files.join('\\n- ')}\n\nFocus on the following areas:\n${focus_areas ? focus_areas.join('\\n- ') : 'All aspects of code quality and best practices'}", parameters: "files,focus_areas" }; /** * Default task configuration for code explanation */ exports.DEFAULT_CODE_EXPLANATION_TASK = { name: "Explain Code", description: "Detailed explanation of code functionality and structure", agent: "code-assistant", schema: { type: "object", properties: { file: { type: "string", description: "File path to explain" }, detail_level: { type: "string", enum: ["high", "medium", "low"], description: "Level of detail in the explanation" } }, required: ["file"] }, task: "Explain the code in ${file} with ${detail_level || 'medium'} level of detail. Provide an overview of its purpose, structure, and key functions.", parameters: "file,detail_level" }; //# sourceMappingURL=taskConfig.js.map