| 1 | import { Tool } from "../.."; |
| 2 | import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; |
| 3 | |
| 4 | export const createRuleBlock: Tool = { |
| 5 | type: "function", |
| 6 | displayTitle: "Create Rule Block", |
| 7 | wouldLikeTo: 'create a rule block for "{{{ name }}}"', |
| 8 | isCurrently: 'creating a rule block for "{{{ name }}}"', |
| 9 | hasAlready: 'created a rule block for "{{{ name }}}"', |
| 10 | readonly: false, |
| 11 | isInstant: true, |
| 12 | group: BUILT_IN_GROUP_NAME, |
| 13 | function: { |
| 14 | name: BuiltInToolNames.CreateRuleBlock, |
| 15 | description: |
| 16 | "Creates a persistent rule for all future conversations. For establishing code standards or preferences that should be applied consistently. To modify existing rules, use the edit tool instead.", |
| 17 | parameters: { |
| 18 | type: "object", |
| 19 | required: ["name", "rule", "alwaysApply", "description"], |
| 20 | properties: { |
| 21 | name: { |
| 22 | type: "string", |
| 23 | description: |
| 24 | "Short, descriptive name summarizing the rule's purpose (e.g. 'React Standards', 'Type Hints')", |
| 25 | }, |
| 26 | rule: { |
| 27 | type: "string", |
| 28 | description: |
| 29 | "Clear, imperative instruction for future code generation (e.g. 'Use named exports', 'Add Python type hints'). Each rule should focus on one specific standard.", |
| 30 | }, |
| 31 | description: { |
| 32 | type: "string", |
| 33 | description: "Short description of the rule", |
| 34 | }, |
| 35 | globs: { |
| 36 | type: "string", |
| 37 | description: |
| 38 | "Optional file patterns to which this rule applies (e.g. ['**/*.{ts,tsx}'] or ['src/**/*.ts', 'tests/**/*.ts'])", |
| 39 | }, |
| 40 | }, |
| 41 | }, |
| 42 | }, |
| 43 | }; |