MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / determineScopes

Function determineScopes

pkg/userinput/userinput.go:85–105  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

83}
84
85func determineScopes(ctx context.Context) ([]string, error) {
86 connData := genconn.GetConnData(ctx)
87 if connData == nil {
88 return nil, fmt.Errorf("context did not contain connection info")
89 }
90 // resolve windowId from blockId
91 tabId, err := wstore.DBFindTabForBlockId(ctx, connData.BlockId)
92 if err != nil {
93 return nil, fmt.Errorf("unabled to determine tab for route: %w", err)
94 }
95 workspaceId, err := wstore.DBFindWorkspaceForTabId(ctx, tabId)
96 if err != nil {
97 return nil, fmt.Errorf("unabled to determine workspace for route: %w", err)
98 }
99 windowId, err := wstore.DBFindWindowForWorkspaceId(ctx, workspaceId)
100 if err != nil {
101 return nil, fmt.Errorf("unabled to determine window for route: %w", err)
102 }
103
104 return []string{windowId}, nil
105}
106
107func (p *FrontendProvider) GetUserInput(ctx context.Context, request *UserInputRequest) (*UserInputResponse, error) {
108 id, uiCh := MainUserInputHandler.registerChannel()

Callers 1

GetUserInputMethod · 0.85

Calls 4

GetConnDataFunction · 0.92
DBFindTabForBlockIdFunction · 0.92
DBFindWorkspaceForTabIdFunction · 0.92

Tested by

no test coverage detected