@@ -36,12 +36,13 @@ const main = async () => {
3636 const projectFile = projectWithFile . files [ 0 ] !
3737 const before = await source . readProjectFile ( project . id , projectFile . path )
3838 await source . updateProjectFile ( project . id , projectFile . path , 'Imported project context v2.' , before . contentHash )
39- const task = await source . createTask ( 'Import durable bytes' , 'demo' , 'document' , project . id , undefined , [ ] , [ ] , [ ] , ownerUserId )
39+ const attachment = { name : 'private.txt' , path : 'inputs/01-private.txt' , size : Buffer . byteLength ( 'private input' ) , mimeType : 'text/plain' }
40+ const task = await source . createTask ( 'Import durable bytes' , 'demo' , 'document' , project . id , undefined , [ ] , [ attachment ] , [ ] , ownerUserId )
4041 await source . writeWorkspaceFile ( task . id , 'README.md' , '# Imported workspace\n' )
4142 await source . writeWorkspaceBytes ( task . id , 'data.bin' , Buffer . from ( [ 0 , 1 , 2 , 255 ] ) )
4243 const version = await source . createWorkspaceVersion ( task . id , 'Import snapshot' )
4344 assert . ok ( version )
44- await source . writeWorkspaceFile ( task . id , 'inputs/private.txt' , 'private input' )
45+ await source . writeWorkspaceFile ( task . id , attachment . path , 'private input' )
4546 await source . beginTurn ( task . id , 'Import native trace' , 'demo' )
4647 await source . ingestNativeEvent ( task . id , {
4748 source : 'claude_agent_sdk' , sourceEventId : 'sdk-import-0' , sourceSequence : 0 , nativeType : 'tool_use' ,
@@ -60,7 +61,7 @@ const main = async () => {
6061 assert . equal ( await imported . readWorkspaceFile ( task . id , 'README.md' ) , '# Imported workspace\n' )
6162 assert . deepEqual ( [ ...await imported . readWorkspaceBytes ( task . id , 'data.bin' ) ] , [ 0 , 1 , 2 , 255 ] )
6263 assert . equal ( ( await imported . listWorkspaceVersions ( task . id ) ) . length , 1 )
63- assert . equal ( await imported . readWorkspaceFile ( task . id , 'inputs/private.txt' ) , 'private input' )
64+ assert . equal ( await imported . readWorkspaceFile ( task . id , attachment . path ) , 'private input' )
6465 assert . equal ( ( await imported . readProjectFile ( project . id , projectFile . path , ownerUserId ) ) . content , 'Imported project context v2.' )
6566 assert . equal ( imported . listProjectFileVersions ( project . id , projectFile . path , ownerUserId ) . length , 1 )
6667 assert . equal ( ( await imported . listNativeEvents ( task . id ) ) . length , 1 )
0 commit comments