chore: establish YCode replication baseline and TODO
This commit is contained in:
commit
6dc59f89ba
1118 files changed
+196002
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// Offline YCode renderer cases. These are not original WorkBuddy runtime samples.
|
||||
const now = Date.now()
|
||||
const cases = [
|
||||
['changed', '修改 Diff', 'sample.ts', 'modified', 'export const value = 2\n', '--- a/sample.ts\n+++ b/sample.ts\n@@ -1 +1 @@\n-export const value = 1\n+export const value = 2\n'],
|
||||
['added', '新增 Diff', 'new.txt', 'added', 'created\n', '--- /dev/null\n+++ b/new.txt\n@@ -0,0 +1 @@\n+created\n'],
|
||||
['deleted', '删除 Diff', 'empty.txt', 'deleted', '', '--- a/empty.txt\n+++ /dev/null\n@@ -1 +0,0 @@\n-removed\n'],
|
||||
['unchanged', '相同 Diff', 'same.txt', 'modified', 'unchanged\n', '']
|
||||
]
|
||||
export const pierreDiffFixture = {
|
||||
sessions: [{ id: 'pierre-diff', title: 'Pierre Diff 运行验证', createdAt: now, updatedAt: now }],
|
||||
messages: { 'pierre-diff': [
|
||||
{ id: 'user', role: 'user', content: '验证 Diff 渲染与视图切换。', status: 'done', createdAt: now },
|
||||
{ id: 'assistant', role: 'assistant', content: '离线 Diff 样本。', status: 'done', createdAt: now + 1,
|
||||
parts: [{ type: 'text', text: '离线 Diff 样本。' }, ...cases.map(([id, name, uri, changeType, cachedContent, diff]) => ({
|
||||
type: 'artifact', artifact: { id, name, path: uri, preview: {
|
||||
id, title: uri, type: 'file-changes', fileChangeInfo: { uri, changeType, cachedContent, diff }
|
||||
} }
|
||||
}))] }
|
||||
] },
|
||||
files: Object.fromEntries(cases.map(([, , uri, , content]) => [uri, content]))
|
||||
}
|
||||
Reference in new issue
Block a user