MCPcopy Create free account
hub / github.com/browserwing/browserwing / Get

Method Get

backend/sdk/script.go:77–101  ·  view source on GitHub ↗

Get 获取脚本

(ctx context.Context, scriptID string)

Source from the content-addressed store, hash-verified

75
76// Get 获取脚本
77func (sc *ScriptClient) Get(ctx context.Context, scriptID string) (*Script, error) {
78 if sc.client.db == nil {
79 return nil, fmt.Errorf("database not initialized")
80 }
81
82 dbScript, err := sc.client.db.GetScript(scriptID)
83 if err != nil {
84 return nil, fmt.Errorf("failed to get script: %w", err)
85 }
86
87 if dbScript == nil {
88 return nil, fmt.Errorf("script not found: %s", scriptID)
89 }
90
91 // 转换为 SDK 模型
92 return &Script{
93 ID: dbScript.ID,
94 Name: dbScript.Name,
95 Description: dbScript.Description,
96 URL: dbScript.URL,
97 Actions: dbScript.Actions,
98 Tags: dbScript.Tags,
99 Group: dbScript.Group,
100 }, nil
101}
102
103// List 列出所有脚本
104func (sc *ScriptClient) List(ctx context.Context) ([]*Script, error) {

Callers 15

GetCookiesMethod · 0.45
GetScriptMethod · 0.45
GetLLMConfigMethod · 0.45
GetBrowserConfigMethod · 0.45
DeleteBrowserConfigMethod · 0.45
GetPromptMethod · 0.45
GetScriptExecutionMethod · 0.45
GetRecordingConfigMethod · 0.45
GetAgentSessionMethod · 0.45
GetAgentMessageMethod · 0.45
GetToolConfigMethod · 0.45

Calls 1

GetScriptMethod · 0.65

Tested by

no test coverage detected