You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/chat-context-kind-registry/chat-context-kind-registry.tsx
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/browser-session/browser-tab-strip.tsx
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session.tsx
+41-3Lines changed: 41 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
'use client'
2
2
3
3
import{
4
+
typeDragEventasReactDragEvent,
4
5
typeMouseEventasReactMouseEvent,
5
6
useCallback,
6
7
useEffect,
@@ -19,6 +20,7 @@ import { Terminal } from '@xterm/xterm'
Copy file name to clipboardExpand all lines: apps/sim/lib/copilot/chat/process-contents.ts
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,24 @@ export async function processContextsServer(
143
143
currentWorkspaceId
144
144
)
145
145
}
146
+
// Tabs resolve to a pointer, not their contents. The agent has tools
147
+
// that read a live tab, and by the time it acts the page may have
148
+
// navigated or the shell scrolled on — so naming the tab it should look
149
+
// at beats pasting a snapshot that was true when the message was sent.
150
+
if(ctx.kind==='browser_tab'&&ctx.tabId){
151
+
return{
152
+
type: 'browser_tab',
153
+
tag: ctx.label ? `@${ctx.label}` : '@',
154
+
content: `The user pointed at an open browser tab: "${ctx.label}" (tabId ${ctx.tabId}). Act on THIS tab — switch to it with browser_switch_tab and read it with browser_snapshot rather than assuming which tab they meant.`,
155
+
}
156
+
}
157
+
if(ctx.kind==='terminal_tab'&&ctx.terminalId){
158
+
return{
159
+
type: 'terminal_tab',
160
+
tag: ctx.label ? `@${ctx.label}` : '@',
161
+
content: `The user pointed at an open terminal: "${ctx.label}" (terminalId ${ctx.terminalId}). Act on THIS terminal — pass that terminalId to the terminal tool, and read its screen before assuming what is in it.`,
0 commit comments