This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { PluginAPI } from '@ampcode/plugin' | |
| const DEEPSEEK_V4_AGENT_PROMPT = ` | |
| You are a coding agent. Your job is to modify the user's codebase to satisfy the | |
| latest request, then verify the result. | |
| <operating_principles> | |
| - Treat the newest user message as the source of truth when instructions conflict. | |
| - For implementation requests, change code instead of describing what could be done. | |
| - Ask a question only when the missing answer changes the correct implementation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { PluginAPI } from '@ampcode/plugin' | |
| const OPUS_4_8_AGENT_PROMPT = ` | |
| You are Amp running in Claude Opus 4.8 mode. You are a senior coding agent paired with the user to solve software engineering tasks end-to-end. Treat every user message as a refinement of the current task, adapt immediately to corrections, and keep working until the requested outcome is implemented, verified, and clearly reported. | |
| <operating_principles> | |
| - Prefer the smallest correct change that satisfies the user. | |
| - Read the relevant code before making claims or edits. Never guess about files you have not inspected. | |
| - Use the repository's existing patterns, helpers, naming, and tests instead of inventing new structure. | |
| - Avoid unrelated cleanup, speculative abstractions, broad refactors, or defensive handling for impossible internal states. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // .amp/plugins/ask-user-choice.ts | |
| // | |
| // See https://ampcode.com/manual#plugins for more information about Amp plugins. | |
| import type { PluginAPI, ThreadID } from '@ampcode/plugin' | |
| const threadURL = (ampURL: URL, threadID: ThreadID): URL => { | |
| const url = new URL(ampURL.toString()) | |
| url.pathname = `/threads/${threadID}` | |
| url.search = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // .amp/plugins/ask-user-choice.ts | |
| // | |
| // See https://ampcode.com/manual#plugins for more information about Amp plugins. | |
| import type { PluginAPI } from '@ampcode/plugin' | |
| export default function (amp: PluginAPI) { | |
| amp.registerTool({ | |
| name: 'ask_user_choice', | |
| description: | |
| 'Present the user with a multiple choice question when there are several possible approaches and you need them to pick one. Use when you have 2-5 concrete options to choose from.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { describe, expect, test } from 'vitest' | |
| import { lastValueFromAsyncGenerator } from '../common/asyncGenerator' | |
| import { parseMessageXMLLike } from './structuredMessageParser' | |
| describe('parseXmlTags', () => { | |
| test('parses XML tags correctly', async () => { | |
| const input = '<tag1>content1</tag1><tag2>content2</tag2><tag1>content3</tag1>' | |
| async function* generateChunks() { | |
| yield input | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/doc/extensions/authoring/publishing.md b/doc/extensions/authoring/publishing.md | |
| index ddd670600..147efece3 100644 | |
| --- a/doc/extensions/authoring/publishing.md | |
| +++ b/doc/extensions/authoring/publishing.md | |
| @@ -19,11 +19,26 @@ At this point, your extension has been built and sent to Sourcegraph. The output | |
| Any user can publish to the Sourcegraph.com extension registry, all Sourcegraph instances can use extensions from Sourcegraph.com, and all Sourcegraph.com extensions are visible to everyone. If you need to publish an extension privately, use a private extension registry on your own self-hosted Sourcegraph instance. | |
| -## Testing your extension | |
| +## Using extensions in local development (sideloading) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Full-text/regexp search across the top 500 Rust crates: | |
| // | |
| // 1. Sign up for Sourcegraph.com at https://sourcegraph.com/sign-up (or sign in) | |
| // 2. Click your username in the top right | |
| // 3. Go to Configuration | |
| // 4. Paste this entire JSON in and click Save | |
| // 5. In the search box, type a search query of the form "repogroup:crates YOUR QUERY" | |
| // and hit enter (regexps, exact matching, etc., are supported) | |
| // | |
| // Examples: "repogroup:crates remove_file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*--------------------------------------------------------------------------------------------- | |
| * Copyright (c) Microsoft Corporation. All rights reserved. | |
| * Licensed under the MIT License. See License.txt in the project root for license information. | |
| *--------------------------------------------------------------------------------------------*/ | |
| 'use strict'; | |
| import URI from 'vs/base/common/uri'; | |
| import { FileService } from 'vs/workbench/services/files/electron-browser/fileService'; | |
| import { IContent, IStreamContent, IFileStat, IResolveContentOptions, IResolveFileOptions, IResolveFileResult, IUpdateContentOptions, FileChangesEvent, FileChangeType, IImportResult } from 'vs/platform/files/common/files'; | |
| import { TPromise } from "vs/base/common/winjs.base"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * An EventEmitter that implements the NodeJS.EventEmitter interface. | |
| */ | |
| export class EventEmitter implements NodeJS.EventEmitter { | |
| private _events: { [name: string]: Function[] } = Object.create(null); | |
| private _maxListeners = 10; | |
| private _onceListeners: Function[] = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Returns true iff url == uri-resolve(url, candidate) per | |
| * https://tools.ietf.org/html/rfc3986#section-5.2.2. For example, if currentURL is | |
| * http://example.com/foo and newURL is /foo, then it returns true. | |
| */ | |
| export function resolvesToEqual(url: URI | string, candidate: URI | string): boolean { | |
| if (typeof url === 'string') { url = URI.parse(url); } | |
| if (typeof candidate === 'string') { candidate = URI.parse(candidate); } | |
| const change: { |
NewerOlder