(ctx context.Context, raw json.RawMessage)
| 1093 | } |
| 1094 | |
| 1095 | func (h *HostAPIHandler) handleSandboxInfo(ctx context.Context, raw json.RawMessage) (any, error) { |
| 1096 | if h.sessions == nil { |
| 1097 | return nil, errors.New("extension: session manager is not configured") |
| 1098 | } |
| 1099 | var params hostAPISandboxInfoParams |
| 1100 | if err := decodeHostAPIParams(raw, ¶ms); err != nil { |
| 1101 | return nil, err |
| 1102 | } |
| 1103 | sessionID := strings.TrimSpace(params.SessionID) |
| 1104 | if sessionID == "" { |
| 1105 | return nil, invalidParamsRPCError(errors.New("session_id is required")) |
| 1106 | } |
| 1107 | info, err := h.requireHostAPISessionWorkspace(ctx, params.WorkspaceID, sessionID) |
| 1108 | if err != nil { |
| 1109 | return nil, err |
| 1110 | } |
| 1111 | if info == nil || info.Sandbox == nil { |
| 1112 | return nil, notFoundRPCError("sandbox", sessionID, errors.New("sandbox is not configured")) |
| 1113 | } |
| 1114 | return hostAPISandboxInfoResult{ |
| 1115 | SandboxID: strings.TrimSpace(info.Sandbox.SandboxID), |
| 1116 | Backend: strings.TrimSpace(info.Sandbox.Backend), |
| 1117 | Profile: strings.TrimSpace(info.Sandbox.Profile), |
| 1118 | InstanceID: strings.TrimSpace(info.Sandbox.InstanceID), |
| 1119 | RuntimeRoot: strings.TrimSpace(info.Sandbox.RuntimeRootDir), |
| 1120 | SyncState: hostAPISandboxSyncState(info.Sandbox), |
| 1121 | CreatedAt: info.CreatedAt, |
| 1122 | LastSyncError: strings.TrimSpace(info.Sandbox.LastSyncError), |
| 1123 | }, nil |
| 1124 | } |
| 1125 | |
| 1126 | func (h *HostAPIHandler) handleSandboxExec(ctx context.Context, raw json.RawMessage) (any, error) { |
| 1127 | if h.sessions == nil { |
nothing calls this directly
no test coverage detected