-
Notifications
You must be signed in to change notification settings - Fork 12
Implement mobile project switching and sync catalog #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8aceeb6
400e73f
c2ef038
61f7464
fb1aca4
c57db38
4b10d29
1ac5656
53ae445
dab3ff7
ed81ba0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2843,16 +2843,18 @@ function canCallerAccessCoordinatorTool(name: string, callerCtx: CallerContext): | |||||
| return false; | ||||||
| } | ||||||
|
|
||||||
| function isLocalComputerUseAllowed(): boolean { | ||||||
| return true; | ||||||
| function isLocalComputerUseAllowed(callerCtx: CallerContext): boolean { | ||||||
| return callerCtx.role === "cto" | ||||||
| || callerCtx.role === "orchestrator" | ||||||
| || callerCtx.role === "agent"; | ||||||
| } | ||||||
|
|
||||||
| async function listToolSpecsForSession(runtime: AdeRuntime, session: SessionState): Promise<ToolSpec[]> { | ||||||
| const callerCtx = await resolveEffectiveCallerContext(runtime, session); | ||||||
| const externalComputerUseAvailable = runtime.computerUseArtifactBrokerService | ||||||
| ?.getBackendStatus() | ||||||
| ?.backends.some((backend) => backend.available) ?? false; | ||||||
| const localComputerUseAllowed = isLocalComputerUseAllowed(); | ||||||
| const localComputerUseAllowed = isLocalComputerUseAllowed(callerCtx); | ||||||
| const shouldHideLocalComputerUse = !localComputerUseAllowed || externalComputerUseAvailable; | ||||||
| const visibleBaseTools = shouldHideLocalComputerUse | ||||||
| ? TOOL_SPECS.filter((tool) => !LOCAL_COMPUTER_USE_TOOL_NAMES.has(tool.name)) | ||||||
|
|
@@ -4135,6 +4137,12 @@ async function runTool(args: { | |||||
| toolName: string, | ||||||
| capabilityKey: "screenshot" | "browser_verification" | "browser_trace" | "video_recording" | "console_logs" | "appLaunch" | "guiInteraction" | "environmentInfo", | ||||||
| ) => { | ||||||
| if (!isLocalComputerUseAllowed(callerCtx)) { | ||||||
| throw new JsonRpcError( | ||||||
|
arul28 marked this conversation as resolved.
|
||||||
| JsonRpcErrorCode.policyDenied, | ||||||
| `${toolName} is disabled because local computer use is not allowed for this ADE RPC session.`, | ||||||
| ); | ||||||
| } | ||||||
| const capabilities = getLocalComputerUseCapabilities(); | ||||||
| const capability = | ||||||
| capabilityKey === "appLaunch" || capabilityKey === "guiInteraction" || capabilityKey === "environmentInfo" | ||||||
|
|
@@ -4786,7 +4794,7 @@ async function runTool(args: { | |||||
|
|
||||||
| if (name === "get_environment_info") { | ||||||
| const includeDisplays = asBoolean(toolArgs.includeDisplays, false); | ||||||
| const capabilities = getLocalComputerUseCapabilities(); | ||||||
| const capabilities = ensureLocalComputerUse(name, "environmentInfo"); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [🟡 Medium] [🔵 Bug]
Suggested change
|
||||||
| const frontmostApp = capabilities.environmentInfo.available | ||||||
| ? tryLocalCommand("osascript", [ | ||||||
| "-e", | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.