diff --git a/packages/vscode/README.md b/packages/vscode/README.md index eda34e9627..c0f75d348f 100644 --- a/packages/vscode/README.md +++ b/packages/vscode/README.md @@ -12,31 +12,29 @@ infrastructure to provide a augmented, tooled, prompting experience. ### GPTools -CoArch prompts use stylized JavaScript with minimal syntax. They are stored as files (`gptools/*.gptool.js`) in your project. +CoArch tools (gptools) use stylized JavaScript with minimal syntax. They are stored as files (`gptools/*.gptool.js`) in your project. -CoArch comes with builtin prompts and allows you to fork and customize the AI prompts to your project specific needs. +CoArch comes with builtin tools and allows you to fork and customize the AI prompts to your project specific needs. This leverages VSCode language support (completion, coloring, error checking) while remaining friendly to people not very familiar with JavaScript. CoArch also provides detailed expansion logs to help you debug your templates. -Since prompts are stored as files in the project, they can be shared, versioned, collaborated on by the entire development team +Since gptools are stored as files in the project, they can be shared, versioned, collaborated on by the entire development team using the existing team development cycle. -In the future, we foresee that developers will create libraries of prompts and share them as libraries on their favorite package manager. +In the future, we foresee that developers will create libraries of gptools and share them as libraries on their favorite package manager. ### Specification Files -CoArch parses `*.gpspec.md` markdown files and uses the markdown headings (`#`, `##`, ...) as the base structure of the document. Each element of the document is considered a node and sub section are considered children; similarly to most document object models. - -Once the specification files are parsed, CoArch will automatically suggest which prompt can be applied to each fragment. +CoArch parses `*.gpspec.md` markdown files as specification. ### Editor integration -CoArch leverages the VSCode editor integration point to provide a rich auditing user experience, as well as an assisted prompt authoring experience through various editor extensions. +CoArch leverages the VSCode editor integration point to provide a rich auditing user experience, as well as an assisted gptool authoring experience through various editor extensions. ### Samples -The extension contains a few prompts, and the following samples can also be consulted. +The extension contains a few gptools, and the following samples can also be consulted. - [blackjack game generator](https://github.com/microsoft/coarch/tree/main/packages/blackjack) - [mywordle](https://github.com/microsoft/coarch/tree/main/packages/mywordle) @@ -51,18 +49,9 @@ To start using CoArch, create a new `.gpspec.md` file and start adding content a CoArch uses the header structure of the document (`#`, `##`, ...) to build a tree of text fragments. ```markdown A sample CoArch document. -# Image resize {#YU34} - -A command line application that takes a file name, a size, and an output file name, resizes the image using the best algorithm, and saves the resized image. Use node.js LTS. - -## Parse command line arguments {#UV61} - -Extract file name, size, and output file name from the command line input. +# email address recognizer -## Validate Input {#QY23} - -Ensure all arguments are present. -Verify the input file exists and is in a valid image format. Validate the dimensions and output file name. +Write a function that takes a string argument and returns true if the whole string is a valid email address, false otherwise. ... ``` @@ -73,6 +62,11 @@ When an AI transformation is computed, a code preview will be shown to confirm t You can accept or cancel the changes using the buttons at the bottom of the view. CoArch does **not** apply any changes to your content automatically; all changes have to be reviewed and approved by the user. +### Refinement + +If you decide that the changes are not acceptable, you can click on the **Refine** button in the status dialog (click on the statub bar icon) to refine the gpspec +by adding a line in that file. This flow provides an iterative, chat like experience to evolve your gpspec file. + ### OpenAI or Llama Token CoArch will automatically ask you for a token when needed and will store it in the workspace secret storage. The token is **never** stored in the clear or shared outside the project. diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 1325db58bc..91af05bffa 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -1,8 +1,8 @@ { "name": "coarch-vscode", "publisher": "Microsoft", - "displayName": "CoArch", - "description": "Copilot for Architecture Design", + "displayName": "GPTools", + "description": "Iterative, refining copilot experience designed for Visual Studio Code.", "version": "0.0.1", "engines": { "vscode": "^1.81.0" @@ -29,7 +29,7 @@ "activitybar": [ { "id": "coarch", - "title": "CoArch", + "title": "GPTools", "icon": "./images/robot.svg" } ] @@ -38,17 +38,7 @@ "coarch": [ { "id": "coarch.prompts", - "name": "Prompts" - }, - { - "id": "coarch.runner", - "type": "webview", - "name": "Context" - }, - { - "id": "coarch.fragments", - "name": "Fragments", - "visibility": "collapsed" + "name": "Tools" }, { "id": "coarch.prompts.requests", @@ -59,13 +49,23 @@ "id": "coarch.openai.requests", "name": "OpenAI Requests", "visibility": "collapsed" + }, + { + "id": "coarch.runner", + "type": "webview", + "name": "Context" + }, + { + "id": "coarch.fragments", + "name": "Fragments", + "visibility": "collapsed" } ] }, "viewsWelcome": [ { "view": "coarch.fragments", - "contents": "Create a CoArch markdown file (.gpspec.md) to start generating tasks and code." + "contents": "Create a gpspec file (.gpspec.md) to start generating tasks and code." } ], "menus": { @@ -128,7 +128,7 @@ }, "configuration": [ { - "title": "CoArch", + "title": "GPTools", "properties": { "coarch.maxCachedTemperature": { "type": "number", @@ -142,78 +142,78 @@ { "command": "coarch.openai.token.clear", "title": "Clear OpenAI token", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.openai.token.update", "title": "Update OpenAI token", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.request.abort", "title": "Abort OpenAI request", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.fragment.navigate", "title": "Navigate to fragment", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.fragment.reveal", "title": "Reveal fragment in tree", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.fragment.prompt", "title": "Query a copilot AI to do a task on the node", - "category": "CoArch", + "category": "GPTools", "shortTitle": "Prompt...", "icon": "$(lightbulb)" }, { "command": "coarch.fragment.refine", "title": "Extend specification and run tool again", - "category": "CoArch", + "category": "GPTools", "shortTitle": "Refine...", "icon": "$(lightbulb)" }, { "command": "coarch.prompt.navigate", "title": "Navigate to prompt", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.prompt.create", "title": "Create new prompt file", "icon": "$(add)", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.prompt.fork", "title": "Fork", - "category": "CoArch", + "category": "GPTools", "icon": "$(repo-forked)" }, { "command": "coarch.prompt.unbuiltin", "title": "Move builtin to project", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.request.open", "title": "Open request or response", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.request.status", "title": "Show information message about OpenAI request status", - "category": "CoArch" + "category": "GPTools" }, { "command": "coarch.openIssueReporter", "title": "Report Issue...", - "category": "CoArch" + "category": "GPTools" } ] }, diff --git a/packages/vscode/src/extension.ts b/packages/vscode/src/extension.ts index 4917da9b1e..44384ad67d 100644 --- a/packages/vscode/src/extension.ts +++ b/packages/vscode/src/extension.ts @@ -71,7 +71,7 @@ export async function activate(context: ExtensionContext) { const abort = "Abort" const output = "Open Output" const trace = "Open Trace" - const next = "Refactor" + const next = "Run GPTool" const refine = "Refine" const cmds: string[] = [] if (computing) cmds.push(abort) diff --git a/packages/vscode/src/fragmentcommands.ts b/packages/vscode/src/fragmentcommands.ts index 715f475d22..91f149bd0c 100644 --- a/packages/vscode/src/fragmentcommands.ts +++ b/packages/vscode/src/fragmentcommands.ts @@ -45,7 +45,7 @@ export function activateFragmentCommands(state: ExtensionState) { const picked = await vscode.window.showQuickPick( templatesToQuickPickItems(templates), { - title: `Pick a prompt to apply to ${fragment.title}`, + title: `Pick a GPTool to apply to ${fragment.title}`, } ) return (picked as TemplateQuickPickItem)?.template @@ -172,12 +172,12 @@ export function createCodeActions(fragment: Fragment): vscode.CodeAction[] { const templates = fragment.applicableTemplates() if (!templates.length) return [] const action = new vscode.CodeAction( - `CoArch - Refactor using AI...`, + `Apply GPTool...`, vscode.CodeActionKind.QuickFix ) action.command = { command: "coarch.fragment.prompt", - tooltip: "Use generative AI to refactor this node", + tooltip: "Apply a generative programming tool to this file.", arguments: [fragment], } return [action]