MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / parseBashTimeoutString

Function parseBashTimeoutString

tools/builtin.go:1668–1699  ·  view source on GitHub ↗
(raw string, legacyTimeoutField bool)

Source from the content-addressed store, hash-verified

1666
1667func projectRuntimeDirFromContext(execCtx ExecutionContext, cwd string) string {
1668 if execCtx != nil {
1669 if runtimeDir, ok := execCtx["runtime_dir"].(string); ok && strings.TrimSpace(runtimeDir) != "" {
1670 return runtimeDir
1671 }
1672 }
1673 return config.ProjectRuntimeDir(cwd)
1674}
1675
1676func toolResultsDirFromContext(execCtx ExecutionContext, cwd string) string {
1677 if execCtx != nil {
1678 if cfg, ok := execCtx["config"].(config.Config); ok {
1679 sessionID, _ := execCtx["_session_id"].(string)
1680 sessionID = strings.TrimSpace(sessionID)
1681 if resultDir := cfg.ToolResultsDir(sessionID); resultDir != "" {
1682 return resultDir
1683 }
1684 }
1685 }
1686 return filepath.Join(projectRuntimeDirFromContext(execCtx, cwd), "tool-results", "_legacy")
1687}
1688
1689func bashYoloEnabled(execCtx ExecutionContext) bool {
1690 if execCtx != nil {
1691 if state, ok := execCtx["parent_state"].(interface{ YoloEnabled() bool }); ok && state.YoloEnabled() {
1692 return true
1693 }
1694 if cfg, ok := execCtx["config"].(config.Config); ok && cfg.Yolo {
1695 return true
1696 }
1697 }
1698 return false
1699}
1700
1701func runShellCommand(ctx context.Context, command, cwd string, timeout time.Duration) (int, string) {
1702 return runArgvCommand(ctx, bashpkg.ShellArgv(command, ""), cwd, timeout, command)

Callers 2

DecodeInputMethod · 0.85
parseBashTimeoutValueFunction · 0.85

Calls 1

validatePositiveTimeoutFunction · 0.85

Tested by

no test coverage detected