MCPcopy Create free account
hub / github.com/github/gh-aw / buildCLIWorkflowDataForMounts

Function buildCLIWorkflowDataForMounts

pkg/workflow/mcp_cli_mount.go:119–139  ·  view source on GitHub ↗
(workflowData *WorkflowData, tools map[string]any, safeOutputs *SafeOutputsConfig, mcpScripts *MCPScriptsConfig)

Source from the content-addressed store, hash-verified

117}
118
119func buildCLIWorkflowDataForMounts(workflowData *WorkflowData, tools map[string]any, safeOutputs *SafeOutputsConfig, mcpScripts *MCPScriptsConfig) *WorkflowData {
120 if workflowData == nil {
121 workflowData = &WorkflowData{}
122 }
123
124 copied := *workflowData
125 if copied.Tools == nil {
126 copied.Tools = tools
127 }
128 if copied.SafeOutputs == nil {
129 copied.SafeOutputs = safeOutputs
130 }
131 if copied.MCPScripts == nil {
132 copied.MCPScripts = mcpScripts
133 }
134 if copied.ParsedTools == nil && copied.Tools != nil {
135 copied.ParsedTools = NewTools(copied.Tools)
136 }
137
138 return &copied
139}
140
141// hasBashRestrictedAllowlist reports true when tools contains an explicit, finite bash
142// command allowlist (not a wildcard). Used to decide whether implicit commands must be

Calls 1

NewToolsFunction · 0.85

Tested by

no test coverage detected