feat(app): allow agents to open workspace files from chat

This commit is contained in:
Mohamed Boudra
2026-03-12 23:43:59 +07:00
parent 999d100464
commit 6db99c03cb
5 changed files with 64 additions and 0 deletions
@@ -29,6 +29,7 @@ type WorkspaceDraftAgentTabProps = {
tabId: string
draftId: string
onCreated: (snapshot: AgentSnapshotPayload) => void
onOpenWorkspaceFile: (input: { filePath: string }) => void
}
export function WorkspaceDraftAgentTab({
@@ -37,6 +38,7 @@ export function WorkspaceDraftAgentTab({
tabId,
draftId,
onCreated,
onOpenWorkspaceFile,
}: WorkspaceDraftAgentTabProps) {
const { client, isConnected } = useHostRuntimeSession(serverId)
const addImagesRef = useRef<((images: ImageAttachment[]) => void) | null>(null)
@@ -204,6 +206,7 @@ export function WorkspaceDraftAgentTab({
agent={draftAgent}
streamItems={optimisticStreamItems}
pendingPermissions={EMPTY_PENDING_PERMISSIONS}
onOpenWorkspaceFile={onOpenWorkspaceFile}
/>
</View>
) : (