feat(conversation): replicate table quote-to-chat action (TODO 02)

This commit is contained in:
xiaohan.yuan committed 2026-10-17 05:57:49 +08:00
1 parent e335588826
commit ed31a7c1b4
20 files changed
+939 -46

No files matched your search

+6 -1
View File
@@ -115,8 +115,13 @@ assert.deepEqual(oversizedAttachmentNames([
{ name: 'over.bin', size: MAX_ATTACHMENT_BYTES + 1 }
]), ['over.bin'])
assert.deepEqual(buildComposerSendPayload(' prompt ', [], ['C:/work/file.ts'], 'full-access'), {
text: 'prompt', attachments: [], resources: ['C:/work/file.ts'], mode: 'full-access'
text: 'prompt', attachments: [], resources: ['C:/work/file.ts'], quotes: [], mode: 'full-access'
})
const quotedPayload = buildComposerSendPayload('', [], [], 'full-access', [
{ id: 'm1-text-0:table:table-0', kind: 'table', sourceId: 'm1-text-0:table:table-0', messageId: 'm1', markdown: '| a |\n| - |\n| 1 |', preview: '| a |' }
])
assert.deepEqual(quotedPayload.quotes.map((quote) => quote.sourceId), ['m1-text-0:table:table-0'])
assert.equal(quotedPayload.text, '', '引用单独存在时正文可以为空')
assert.equal(parseResourcePath('file:///C:/work/file.ts'), 'C:\\work\\file.ts')
assert.equal(parseResourcePath('C:\\work\\file.ts'), 'C:\\work\\file.ts')
assert.deepEqual(readReferenceUris({ getData: (type) => type === 'application/vnd.code.uri-list' ? 'file:///C:/a.ts\r\nfile:///C:/b.ts' : '' }), ['file:///C:/a.ts', 'file:///C:/b.ts'])