@@ -364,14 +364,177 @@ var SharedWorkflowForbiddenFields = []string{
364364 "tracker-id" , // Tracker ID
365365}
366366
367+ // Repository directory path constants
368+ //
369+ // These constants define the conventional repository-relative directory paths
370+ // used by gh-aw for GitHub Actions workflows, agents, and related configuration.
371+
372+ // GithubDir is the root .github directory prefix (with trailing slash).
373+ // Use this for path prefix comparisons against workspace-relative paths.
374+ const GithubDir = ".github/"
375+
376+ // WorkflowsDir is the GitHub Actions workflow directory path (without trailing slash).
377+ // This is the canonical location for workflow markdown and compiled lock YAML files.
378+ const WorkflowsDir = ".github/workflows"
379+
380+ // WorkflowsDirSlash is WorkflowsDir with a trailing slash.
381+ // Use this for path prefix matching (e.g. strings.HasPrefix or strings.Contains).
382+ const WorkflowsDirSlash = WorkflowsDir + "/"
383+
384+ // AgentsDir is the custom GitHub Copilot agent definitions directory (with trailing slash).
385+ const AgentsDir = ".github/agents/"
386+
387+ // WorkflowsLockYmlGlob is the glob pattern for compiled workflow lock YAML files.
388+ const WorkflowsLockYmlGlob = WorkflowsDirSlash + "*.lock.yml"
389+
390+ // WorkflowsLockYmlGitAttributesEntry is the .gitattributes entry that marks lock YAML
391+ // files as generated and sets the merge strategy.
392+ const WorkflowsLockYmlGitAttributesEntry = WorkflowsLockYmlGlob + " linguist-generated=true merge=ours"
393+
394+ // Temporary runtime directory constants (/tmp/gh-aw tree)
395+ //
396+ // These constants define the /tmp/gh-aw directory layout used by the agent
397+ // and engine harnesses during workflow execution. Paths here are always
398+ // in the /tmp/gh-aw tree regardless of whether the runner uses RUNNER_TEMP.
399+ // See also GhAwRootDir / GhAwRootDirShell for the host-side RUNNER_TEMP paths.
400+
401+ // TmpGhAwDir is the root /tmp/gh-aw directory (without trailing slash).
402+ const TmpGhAwDir = "/tmp/gh-aw"
403+
404+ // TmpGhAwDirSlash is TmpGhAwDir with a trailing slash.
405+ // Use for path prefix comparisons (e.g. strings.HasPrefix).
406+ const TmpGhAwDirSlash = TmpGhAwDir + "/"
407+
408+ // TmpGhAwAgentDir is the agent working directory in the /tmp/gh-aw tree.
409+ const TmpGhAwAgentDir = TmpGhAwDir + "/agent/"
410+
411+ // AgentStdioLogPath is the path for capturing agent standard I/O log output.
412+ const AgentStdioLogPath = TmpGhAwDir + "/agent-stdio.log"
413+
414+ // AwPromptsFile is the runtime prompt file path populated by the setup action.
415+ // Engine harnesses read this file to pass the compiled prompt to the AI engine.
416+ const AwPromptsFile = TmpGhAwDir + "/aw-prompts/prompt.txt"
417+
418+ // TmpMcpConfigDir is the mcp-config directory in the /tmp/gh-aw tree.
419+ // Engines that require a writable MCP config directory (e.g. Codex) use this path.
420+ const TmpMcpConfigDir = TmpGhAwDir + "/mcp-config"
421+
422+ // TmpMcpServersJsonPath is the MCP servers JSON config file in the /tmp tree.
423+ // Used by engines that resolve the config through the writable /tmp path.
424+ const TmpMcpServersJsonPath = TmpMcpConfigDir + "/mcp-servers.json"
425+
426+ // TmpMcpConfigLogsDir is the MCP config server log directory.
427+ const TmpMcpConfigLogsDir = TmpMcpConfigDir + "/logs/"
428+
429+ // TmpMcpLogsDir is the MCP server logs root directory (with trailing slash).
430+ const TmpMcpLogsDir = TmpGhAwDir + "/mcp-logs/"
431+
432+ // TmpMcpLogsSafeOutputsDir is the safe-outputs MCP server log directory.
433+ const TmpMcpLogsSafeOutputsDir = TmpGhAwDir + "/mcp-logs/safeoutputs"
434+
435+ // TmpMcpLogsPlaywrightDir is the Playwright MCP server log directory.
436+ const TmpMcpLogsPlaywrightDir = TmpGhAwDir + "/mcp-logs/playwright"
437+
438+ // TmpMcpLogsMount is the Docker volume mount spec for the MCP logs directory.
439+ const TmpMcpLogsMount = TmpGhAwDir + "/mcp-logs:" + TmpGhAwDir + "/mcp-logs"
440+
441+ // TmpMcpScriptsLogsDir is the mcp-scripts server log directory (with trailing slash).
442+ const TmpMcpScriptsLogsDir = TmpGhAwDir + "/mcp-scripts/logs/"
443+
444+ // TmpRepoMemoryDir is the repo-memory data directory (with trailing slash).
445+ const TmpRepoMemoryDir = TmpGhAwDir + "/repo-memory/"
446+
447+ // TmpCommentMemoryDir is the comment-memory data directory (with trailing slash).
448+ const TmpCommentMemoryDir = TmpGhAwDir + "/comment-memory/"
449+
450+ // TmpAwBundleGlob is the glob pattern for bundle files produced by the agent.
451+ const TmpAwBundleGlob = TmpGhAwDir + "/aw-*.bundle"
452+
453+ // TmpAwPatchGlob is the glob pattern for patch files produced by the agent.
454+ const TmpAwPatchGlob = TmpGhAwDir + "/aw-*.patch"
455+
456+ // TmpGeminiClientErrorGlob is the glob for Gemini client error JSON diagnostic files.
457+ const TmpGeminiClientErrorGlob = TmpGhAwDir + "/gemini-client-error-*.json"
458+
459+ // TmpAntigravityClientErrorGlob is the glob for Antigravity client error JSON diagnostic files.
460+ const TmpAntigravityClientErrorGlob = TmpGhAwDir + "/antigravity-client-error-*.json"
461+
462+ // TmpPiAgentDir is the Pi engine agent working directory.
463+ const TmpPiAgentDir = TmpGhAwDir + "/pi-agent-dir"
464+
465+ // ThreatDetectionLogPath is the threat detection engine log file path.
466+ const ThreatDetectionLogPath = TmpGhAwDir + "/threat-detection/detection.log"
467+
468+ // TmpProxyLogsDir is the DIFC proxy logs directory (with trailing slash).
469+ const TmpProxyLogsDir = TmpGhAwDir + "/proxy-logs/"
470+
471+ // TmpProxyTLSDir is the proxy TLS certificates sub-directory (with trailing slash).
472+ const TmpProxyTLSDir = TmpGhAwDir + "/proxy-logs/proxy-tls/"
473+
474+ // TmpProxyTLSCACert is the proxy TLS CA certificate file path.
475+ const TmpProxyTLSCACert = TmpGhAwDir + "/proxy-logs/proxy-tls/ca.crt"
476+
477+ // TmpDIFCProxyTLSCACert is the DIFC proxy TLS CA certificate file path.
478+ const TmpDIFCProxyTLSCACert = TmpGhAwDir + "/difc-proxy-tls/ca.crt"
479+
480+ // TmpAwMcpLogsDir is the aw-mcp server logs directory.
481+ const TmpAwMcpLogsDir = TmpGhAwDir + "/aw-mcp/logs"
482+
483+ // TmpSandboxAgentLogsDir is the sandbox agent logs directory (with trailing slash).
484+ const TmpSandboxAgentLogsDir = TmpGhAwDir + "/sandbox/agent/logs/"
485+
486+ // Shell and Actions expression form path constants
487+ //
488+ // These complement GhAwRootDirShell and GhAwRootDir for sub-paths commonly
489+ // referenced in both shell run: blocks and GitHub Actions expression contexts.
490+
491+ // GhAwRootDirShellSlash is GhAwRootDirShell with a trailing slash.
492+ // Use for path prefix matching in shell expressions (e.g. ${RUNNER_TEMP}/gh-aw/).
493+ const GhAwRootDirShellSlash = GhAwRootDirShell + "/"
494+
495+ // ShellMcpConfigDir is the mcp-config directory in shell environment variable form.
496+ const ShellMcpConfigDir = GhAwRootDirShell + "/mcp-config"
497+
498+ // ShellMcpServersJsonPath is the MCP servers JSON config file path in shell form.
499+ // Used by engines that resolve the config via the host RUNNER_TEMP path.
500+ const ShellMcpServersJsonPath = GhAwRootDirShell + "/mcp-config/mcp-servers.json"
501+
502+ // GhAwRootDirSlash is GhAwRootDir with a trailing slash (Actions expression form).
503+ const GhAwRootDirSlash = GhAwRootDir + "/"
504+
505+ // McpServersJsonPathExpr is the MCP servers JSON config path in Actions expression form.
506+ const McpServersJsonPathExpr = GhAwRootDir + "/mcp-config/mcp-servers.json"
507+
508+ // CodexMcpConfigTomlPath is the Codex MCP config TOML file path in Actions expression form.
509+ const CodexMcpConfigTomlPath = GhAwRootDir + "/mcp-config/config.toml"
510+
511+ // System path constants
512+ //
513+ // Well-known host system paths used by CLI tools and shell completion.
514+
515+ // CopilotBinaryPath is the path to the Copilot CLI binary inside AWF containers.
516+ const CopilotBinaryPath = "/usr/local/bin/copilot"
517+
518+ // BashCompletionDir is the system-wide bash completion directory.
519+ const BashCompletionDir = "/etc/bash_completion.d"
520+
521+ // BashCompletionGhAwPath is the gh-aw bash completion file path.
522+ const BashCompletionGhAwPath = BashCompletionDir + "/gh-aw"
523+
524+ // HomebrewPrefix is the default Homebrew installation prefix on macOS.
525+ const HomebrewPrefix = "/opt/homebrew"
526+
527+ // UsrLocalPrefix is the standard /usr/local installation prefix.
528+ const UsrLocalPrefix = "/usr/local"
529+
367530// GetWorkflowDir returns the workflows directory path.
368531// Always uses forward slashes, which are required for git/GitHub paths.
369532// GH_AW_WORKFLOWS_DIR overrides the default; any OS-specific separators are normalized.
370533func GetWorkflowDir () string {
371534 if dir := os .Getenv ("GH_AW_WORKFLOWS_DIR" ); dir != "" {
372535 return filepath .ToSlash (dir )
373536 }
374- return ".github/workflows"
537+ return WorkflowsDir
375538}
376539
377540// MaxSymlinkDepth limits recursive symlink resolution when fetching remote files.
0 commit comments