From fc1ee33ed912543f596d32ae6eaacbbdbc3bcae4 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Mon, 28 Apr 2025 17:25:07 -0700 Subject: [PATCH] feat: Dallin's feedback --- core/tools/definitions/createRuleBlock.ts | 4 +--- core/tools/implementations/createRuleBlock.ts | 10 +++++++--- docs/docs/customize/deep-dives/rules.md | 2 +- gui/src/pages/gui/ToolCallDiv/index.tsx | 2 ++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/core/tools/definitions/createRuleBlock.ts b/core/tools/definitions/createRuleBlock.ts index 098edda10..c3a0846f4 100644 --- a/core/tools/definitions/createRuleBlock.ts +++ b/core/tools/definitions/createRuleBlock.ts @@ -13,9 +13,7 @@ export const createRuleBlock: Tool = { function: { name: BuiltInToolNames.CreateRuleBlock, description: - "Creates a persistent rule that applies to all future conversations. " + - "Use for establishing ongoing code standards or preferences (e.g. 'use named exports', 'follow Google docstrings'). " + - "Not for one-time instructions. Rules are stored as YAML in `.continue/rules`.", + "Creates a persistent rule for all future conversations. For establishing code standards or preferences that should be applied consistently.", parameters: { type: "object", required: ["name", "rule"], diff --git a/core/tools/implementations/createRuleBlock.ts b/core/tools/implementations/createRuleBlock.ts index e1e1a7f11..5d2677ffc 100644 --- a/core/tools/implementations/createRuleBlock.ts +++ b/core/tools/implementations/createRuleBlock.ts @@ -47,9 +47,13 @@ export const createRuleBlockImpl: ToolImpl = async ( return [ { - name: "Rule Block Created", - description: `Created ${args.name} rule`, - content: ruleYaml, + name: `New Rule Block`, + description: "", // No description throws an error in the GUI + uri: { + type: "file", + value: rulesDirUri, + }, + content: "Rule created successfully", }, ]; }; diff --git a/docs/docs/customize/deep-dives/rules.md b/docs/docs/customize/deep-dives/rules.md index ec7c44538..6113a0e33 100644 --- a/docs/docs/customize/deep-dives/rules.md +++ b/docs/docs/customize/deep-dives/rules.md @@ -20,7 +20,7 @@ To form the system message, rules are joined with new lines, in the order they a Rules can be added to an Assistant on the Continue Hub. Explore available rules [here](https://hub.continue.dev/explore/rules), or [create your own](https://hub.continue.dev/new?type=block&blockType=rules) in the Hub. These blocks are defined using the [`config.yaml` syntax](../../reference.md#rules) and can also be created locally. :::info Automatically create local rule blocks -When in Agent mode, you can simply prompt the agent to create a rule for you. +When in Agent mode, you can simply prompt the agent to create a rule for you using the `builtin_create_rule_block` tool if enabled. For example, you can say "Create a rule for this", and a rule will be created for you in `.continue/rules` based on your conversation. ::: diff --git a/gui/src/pages/gui/ToolCallDiv/index.tsx b/gui/src/pages/gui/ToolCallDiv/index.tsx index 5fd016d45..bac9b7cb1 100644 --- a/gui/src/pages/gui/ToolCallDiv/index.tsx +++ b/gui/src/pages/gui/ToolCallDiv/index.tsx @@ -10,6 +10,7 @@ import { GlobeAltIcon, MagnifyingGlassIcon, MapIcon, + PencilIcon, XMarkIcon, } from "@heroicons/react/24/outline"; import { @@ -44,6 +45,7 @@ const toolCallIcons: Record = { [BuiltInToolNames.ViewDiff]: CodeBracketIcon, [BuiltInToolNames.ViewRepoMap]: MapIcon, [BuiltInToolNames.ViewSubdirectory]: FolderOpenIcon, + [BuiltInToolNames.CreateRuleBlock]: PencilIcon, }; export function ToolCallDiv(props: ToolCallDivProps) {