ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import assert from 'assert';
import { URI } from '../../../../../base/common/uri.js';
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js';
import { toHostSnapshotAttachmentMeta } from '../../../common/meta/agentSnapshotAttachmentMeta.js';
import { MessageAttachmentKind, type MessageAttachment } from '../../../common/state/protocol/state.js';
import { resolvePromptToContentBlocks } from '../../../node/claude/claudePromptResolver.js';
suite('claudePromptResolver', () => {
ensureNoDisposablesAreLeakedInTestSuite();
function referencesText(prompt: string, attachments: MessageAttachment[]): string {
return resolvePromptToContentBlocks(prompt, attachments)
.map(block => (block as { text?: string }).text ?? '')
.join('\n');
}
test('a host-created snapshot path is annotated read-only, a normal file reference is not (#331154)', () => {
const snapshotUri = URI.file('/data/attachments/id/Pasted text #1.txt');
const snapshot: MessageAttachment = {
type: MessageAttachmentKind.Resource,
label: 'Pasted text #1',
displayKind: 'document',
uri: snapshotUri.toString(),
_meta: toHostSnapshotAttachmentMeta('text/plain'),
} as MessageAttachment;
const fileUri = URI.file('/workspace/real.txt');
const normal: MessageAttachment = {
type: MessageAttachmentKind.Resource,
label: 'real.txt',
displayKind: 'document',
uri: fileUri.toString(),
} as MessageAttachment;
const text = referencesText('trim this', [snapshot, normal]);
assert.ok(text.includes(`- ${snapshotUri.fsPath} (read-only snapshot — do not edit this file)`), `text: ${text}`);
assert.ok(text.includes(`- ${fileUri.fsPath}`) && !text.includes(`- ${fileUri.fsPath} (read-only`), `text: ${text}`);
});
});