continue-custom/core/config/createNewAssistantFile.ts
Nate Sesti 10639a20f2
Final release cleanup: remove CLI banner & Generate Rule, explicit onboarding/config models, deprecation link (#12634)
* chore: remove CLI-install banner and Generate Rule feature, use explicit onboarding models

- Remove CliInstallBanner component, test, and dismissal localStorage key
- Remove "Generate Rule" button, GenerateRuleDialog, command, and protocol message
- Convert onboarding and new-assistant template off Hub `uses:` slugs to explicit model definitions
- Update deprecation banner export link to https://continue.dev/export

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: bump vscode extension version to 1.3.40

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 09:09:30 -07:00

69 lines
1.7 KiB
TypeScript

import { IDE } from "..";
import { joinPathsToUri } from "../util/uri";
const DEFAULT_ASSISTANT_FILE = `# This is an example configuration file
# To learn more, see the full config.yaml reference: https://docs.continue.dev/reference
name: Example Config
version: 1.0.0
schema: v1
# Define which models can be used
# https://docs.continue.dev/customization/models
models:
- name: my gpt-5
provider: openai
model: gpt-5
apiKey: YOUR_OPENAI_API_KEY_HERE
- name: qwen2.5-coder 7b
provider: ollama
model: qwen2.5-coder:7b
roles:
- apply
- autocomplete
- chat
- edit
- name: Claude 4 Sonnet
provider: anthropic
model: claude-sonnet-4-20250514
apiKey: \${{ secrets.ANTHROPIC_API_KEY }}
roles:
- chat
- edit
- apply
defaultCompletionOptions:
contextLength: 200000
maxTokens: 64000
capabilities:
- tool_use
- image_input
`;
export async function createNewAssistantFile(
ide: IDE,
assistantPath: string | undefined,
): Promise<void> {
const workspaceDirs = await ide.getWorkspaceDirs();
if (workspaceDirs.length === 0) {
throw new Error(
"No workspace directories found. Make sure you've opened a folder in your IDE.",
);
}
const baseDirUri = joinPathsToUri(
workspaceDirs[0],
assistantPath ?? ".continue/agents",
);
// Find the first available filename
let counter = 0;
let assistantFileUri: string;
do {
const suffix = counter === 0 ? "" : `-${counter}`;
assistantFileUri = joinPathsToUri(baseDirUri, `new-config${suffix}.yaml`);
counter++;
} while (await ide.fileExists(assistantFileUri));
await ide.writeFile(assistantFileUri, DEFAULT_ASSISTANT_FILE);
await ide.openFile(assistantFileUri);
}