Improve approval and sandbox flows

This commit is contained in:
Codex
2026-05-28 11:17:40 +00:00
parent 44384a90c7
commit 372d5831fa
4 changed files with 496 additions and 47 deletions

View File

@@ -443,6 +443,23 @@ func ParseApprovalCallbackData(data string) (int64, string, bool) {
}
}
func SandboxCallbackData(sandbox string) string {
return "sandbox:" + sandbox
}
func ParseSandboxCallbackData(data string) (string, bool) {
if !strings.HasPrefix(data, "sandbox:") {
return "", false
}
sandbox := strings.TrimPrefix(data, "sandbox:")
switch sandbox {
case "read-only", "workspace-write", "danger-full-access":
return sandbox, true
default:
return "", false
}
}
func WorkspaceCallbackData(id int64) string {
return fmt.Sprintf("workspace:%d", id)
}