From 398d15085919c03a3145092eda44810b9f2081ba Mon Sep 17 00:00:00 2001 From: Sebastian Rath Date: Wed, 8 Apr 2026 20:30:33 -0400 Subject: [PATCH] Add debug subcommand and interactive welcome menu --- cmd/cmd_debug.go | 35 ++++++++ cmd/cmd_root.go | 54 ++++++++++-- github/server/cache_test.go | 10 ++- github/server/legacy_test.go | 10 ++- github/server/server_test.go | 10 ++- go.mod | 26 +++++- go.sum | 65 +++++++++++++- sessions/gateway.go | 87 +++++++++++++++---- tests_e2e/references/reference_app.sh_l10 | 1 + tests_e2e/references/reference_app.sh_l11 | 15 ---- tests_e2e/references/reference_app.sh_l28 | 19 ++-- tests_e2e/references/reference_app.sh_l8 | 19 ++-- .../references/reference_contexts_env.sh_l26 | 1 + 13 files changed, 278 insertions(+), 74 deletions(-) create mode 100644 cmd/cmd_debug.go diff --git a/cmd/cmd_debug.go b/cmd/cmd_debug.go new file mode 100644 index 0000000..13031fe --- /dev/null +++ b/cmd/cmd_debug.go @@ -0,0 +1,35 @@ +package cmd + +import ( + "os" + + "github.com/actionforge/actrun-cli/sessions" + "github.com/actionforge/actrun-cli/utils" + "github.com/spf13/cobra" +) + +var ( + flagDebugSessionToken string + flagDebugConfigFile string +) + +var cmdDebug = &cobra.Command{ + Use: "debug", + Short: "Connect to the web app with a session token", + Run: cmdDebugRun, +} + +func init() { + cmdRoot.AddCommand(cmdDebug) + + cmdDebug.Flags().StringVar(&flagDebugSessionToken, "session-token", envOr("ACT_SESSION_TOKEN", ""), "Session token from your browser (env: ACT_SESSION_TOKEN)") + cmdDebug.Flags().StringVar(&flagDebugConfigFile, "config-file", "", "The config file to use") +} + +func cmdDebugRun(cmd *cobra.Command, args []string) { + err := sessions.RunSessionMode(flagDebugConfigFile, "", flagDebugSessionToken, "flag") + if err != nil { + utils.LogErr.Print(err.Error()) + os.Exit(1) + } +} diff --git a/cmd/cmd_root.go b/cmd/cmd_root.go index a77a18f..8ebe6a6 100644 --- a/cmd/cmd_root.go +++ b/cmd/cmd_root.go @@ -180,7 +180,7 @@ func cmdRootRun(cmd *cobra.Command, args []string) { return } - // if we still have no graph file, go to Session Mode + // if we still have no graph file, show the interactive menu or go to Session Mode if finalGraphFile == "" || finalCreateDebugSession { trapfn := func() { if mousetrap.StartedByExplorer() { @@ -189,14 +189,54 @@ func cmdRootRun(cmd *cobra.Command, args []string) { } } - err := sessions.RunSessionMode(finalConfigFile, finalGraphFile, finalSessionToken, finalConfigValueSource) - if err != nil { - utils.LogErr.Print(err.Error()) + // If a session token was explicitly provided or debug session requested, + // go straight to session mode. Otherwise, show the interactive menu. + if finalSessionToken != "" || finalCreateDebugSession { + err := sessions.RunSessionMode(finalConfigFile, finalGraphFile, finalSessionToken, finalConfigValueSource) + if err != nil { + utils.LogErr.Print(err.Error()) + trapfn() + os.Exit(1) + } trapfn() - os.Exit(1) + return + } + + sessions.PrintWelcomeMessage() + + if !sessions.IsInteractive() { + sessions.PrintUsageHints() + return + } + + choice := sessions.PromptMainMenu() + + switch choice { + case 1: // Run a graph + graphFile := sessions.PromptGraphFile() + if graphFile == "" { + return + } + finalGraphFile = graphFile + // Fall through to graph execution below. + + case 2: // Connect to web debug session (session token) + err := sessions.RunSessionMode(finalConfigFile, "", "", "") + if err != nil { + utils.LogErr.Print(err.Error()) + trapfn() + os.Exit(1) + } + trapfn() + return + + case 3: // Connect as agent + fmt.Println("Agent mode is not yet implemented.") + return + + default: + return } - trapfn() - return } var err error diff --git a/github/server/cache_test.go b/github/server/cache_test.go index 78a83e4..0152d5e 100644 --- a/github/server/cache_test.go +++ b/github/server/cache_test.go @@ -154,7 +154,10 @@ func TestCachePrefixMatch(t *testing.T) { } // Download and verify it's one of the two entries (the newest) - getResp, _ := http.Get(dlResp.SignedDownloadURL) + getResp, err := http.Get(dlResp.SignedDownloadURL) + if err != nil { + t.Fatal(err) + } defer getResp.Body.Close() data, _ := io.ReadAll(getResp.Body) if string(data) != "node-modules-bbb" { @@ -204,7 +207,10 @@ func TestCacheOverwrite(t *testing.T) { "metadata": map[string]string{"scope": scope}, }) dlResp := decodeResponse[GetCacheEntryDownloadURLResponse](t, resp) - getResp, _ := http.Get(dlResp.SignedDownloadURL) + getResp, err := http.Get(dlResp.SignedDownloadURL) + if err != nil { + t.Fatal(err) + } defer getResp.Body.Close() data, _ := io.ReadAll(getResp.Body) if string(data) != "new-data" { diff --git a/github/server/legacy_test.go b/github/server/legacy_test.go index 049b911..3144728 100644 --- a/github/server/legacy_test.go +++ b/github/server/legacy_test.go @@ -191,7 +191,10 @@ func TestLegacyChunkedUpload(t *testing.T) { dlReq, _ := http.NewRequest("GET", contentLocation, nil) dlReq.Header.Set("Authorization", "Bearer test-token") - dlResp, _ := http.DefaultClient.Do(dlReq) + dlResp, err := http.DefaultClient.Do(dlReq) + if err != nil { + t.Fatal(err) + } defer dlResp.Body.Close() data, _ := io.ReadAll(dlResp.Body) expected := append(chunk1, chunk2...) @@ -249,7 +252,10 @@ func TestLegacyGzipRoundtrip(t *testing.T) { client := &http.Client{Transport: transport} dlReq, _ := http.NewRequest("GET", filesResult.Value[0]["contentLocation"].(string), nil) dlReq.Header.Set("Authorization", "Bearer test-token") - dlResp, _ := client.Do(dlReq) + dlResp, err := client.Do(dlReq) + if err != nil { + t.Fatal(err) + } defer dlResp.Body.Close() if dlResp.Header.Get("Content-Encoding") != "gzip" { diff --git a/github/server/server_test.go b/github/server/server_test.go index 7707ecc..e1fc020 100644 --- a/github/server/server_test.go +++ b/github/server/server_test.go @@ -264,7 +264,10 @@ func TestChunkedUpload(t *testing.T) { "name": "chunked-artifact", }) urlResp := decodeResponse[GetSignedArtifactURLResponse](t, resp) - dlResp, _ := http.Get(urlResp.SignedURL) + dlResp, err := http.Get(urlResp.SignedURL) + if err != nil { + t.Fatal(err) + } defer dlResp.Body.Close() data, _ := io.ReadAll(dlResp.Body) expected := append(append(chunk1, chunk2...), chunk3...) @@ -639,7 +642,10 @@ func TestMigrateArtifact(t *testing.T) { "name": "migrated-artifact", }) urlResp := decodeResponse[GetSignedArtifactURLResponse](t, resp) - dlResp, _ := http.Get(urlResp.SignedURL) + dlResp, err := http.Get(urlResp.SignedURL) + if err != nil { + t.Fatal(err) + } defer dlResp.Body.Close() data, _ := io.ReadAll(dlResp.Body) if !bytes.Equal(data, blobContent) { diff --git a/go.mod b/go.mod index ea6733a..3758d8b 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,8 @@ require ( github.com/aws/aws-sdk-go-v2/credentials v1.19.6 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18 github.com/aws/aws-sdk-go-v2/service/s3 v1.97.3 + github.com/charmbracelet/huh v1.0.0 + github.com/charmbracelet/lipgloss v1.1.0 github.com/containerd/errdefs v1.0.0 github.com/docker/docker v28.5.2+incompatible github.com/fatih/color v1.18.0 @@ -21,6 +23,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 github.com/joho/godotenv v1.5.1 github.com/mark3labs/mcp-go v0.44.0 + github.com/mattn/go-isatty v0.0.20 github.com/perforce/p4go v1.20252.2872356 github.com/pkg/errors v0.9.1 github.com/rhysd/actionlint v1.7.10 @@ -54,6 +57,7 @@ require ( dario.cat/mergo v1.0.2 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProtonMail/go-crypto v1.3.0 // indirect + github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect @@ -69,11 +73,20 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 // indirect github.com/aws/smithy-go v1.24.2 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect - github.com/buger/jsonparser v1.1.1 // indirect + github.com/buger/jsonparser v1.1.2 // indirect + github.com/catppuccin/go v0.3.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 // indirect + github.com/charmbracelet/bubbletea v1.3.6 // indirect + github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect + github.com/charmbracelet/x/ansi v0.9.3 // indirect + github.com/charmbracelet/x/cellbuf v0.0.13 // indirect + github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect + github.com/charmbracelet/x/term v0.2.1 // indirect github.com/clipperhouse/stringish v0.1.1 // indirect github.com/clipperhouse/uax29/v2 v2.3.0 // indirect github.com/cloudflare/circl v1.6.3 // indirect @@ -84,7 +97,9 @@ require ( github.com/dlclark/regexp2 v1.11.5 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/gage-technologies/mistral-go v1.1.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect @@ -112,21 +127,27 @@ require ( github.com/kevinburke/ssh_config v1.4.0 // indirect github.com/klauspost/compress v1.18.2 // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.19 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/montanaflynn/stats v0.7.1 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/termenv v0.16.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pjbgf/sha1cd v0.5.0 // indirect github.com/pkoukk/tiktoken-go v0.1.8 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sergi/go-diff v1.4.0 // indirect @@ -137,6 +158,7 @@ require ( github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.2.0 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect + github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect diff --git a/go.sum b/go.sum index 9b1e5bf..d97ddd6 100644 --- a/go.sum +++ b/go.sum @@ -22,6 +22,8 @@ github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEK github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= +github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= @@ -33,6 +35,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= +github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY= github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 h1:eBMB84YGghSocM7PsjmmPffTa+1FBUeNvGvFou6V/4o= @@ -73,12 +77,18 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY= +github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE= github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk= +github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/catppuccin/go v0.3.0 h1:d+0/YicIq+hSTo5oPuRi5kOpqkVA5tAsU6dNhvRu+aY= +github.com/catppuccin/go v0.3.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= @@ -86,6 +96,34 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1x github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7 h1:JFgG/xnwFfbezlUnFMJy0nusZvytYysV4SCS2cYbvws= +github.com/charmbracelet/bubbles v0.21.1-0.20250623103423-23b8fd6302d7/go.mod h1:ISC1gtLcVilLOf23wvTfoQuYbW2q0JevFxPfUzZ9Ybw= +github.com/charmbracelet/bubbletea v1.3.6 h1:VkHIxPJQeDt0aFJIsVxw8BQdh/F/L2KKZGsK6et5taU= +github.com/charmbracelet/bubbletea v1.3.6/go.mod h1:oQD9VCRQFF8KplacJLo28/jofOI2ToOfGYeFgBBxHOc= +github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs= +github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk= +github.com/charmbracelet/huh v1.0.0 h1:wOnedH8G4qzJbmhftTqrpppyqHakl/zbbNdXIWJyIxw= +github.com/charmbracelet/huh v1.0.0/go.mod h1:5YVc+SlZ1IhQALxRPpkGwwEKftN/+OlJlnJYlDRFqN4= +github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= +github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= +github.com/charmbracelet/x/ansi v0.9.3 h1:BXt5DHS/MKF+LjuK4huWrC6NCvHtexww7dMayh6GXd0= +github.com/charmbracelet/x/ansi v0.9.3/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE= +github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k= +github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs= +github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U= +github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ= +github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA= +github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0= +github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ= +github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= +github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko3AQ4gK1MTS/de7F5hPGx6/k1u0w4TeYmBFwzYVP4= +github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ= +github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= +github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= +github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY= +github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo= +github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI= +github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4= github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs= github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA= github.com/clipperhouse/uax29/v2 v2.3.0 h1:SNdx9DVUqMoBuBoW3iLOj4FQv3dN5mDtuqwuhIGpJy4= @@ -101,6 +139,8 @@ github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmC github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= +github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE= github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -117,6 +157,8 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -126,6 +168,8 @@ github.com/envoyproxy/go-control-plane/envoy v1.36.0 h1:yg/JjO5E7ubRyKX3m07GF3re github.com/envoyproxy/go-control-plane/envoy v1.36.0/go.mod h1:ty89S1YCCVruQAm9OtKeEkQLTb+Lkz0k8v9W0Oxsv98= github.com/envoyproxy/protoc-gen-validate v1.3.0 h1:TvGH1wof4H33rezVKWSpqKz5NXWg5VPuZ0uONDT6eb4= github.com/envoyproxy/protoc-gen-validate v1.3.0/go.mod h1:HvYl7zwPa5mffgyeTUHA9zHIH36nmrm7oCbo4YKoSWA= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -223,6 +267,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mark3labs/mcp-go v0.44.0 h1:OlYfcVviAnwNN40QZUrrzU0QZjq3En7rCU5X09a/B7I= @@ -231,12 +277,16 @@ github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHP github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw= github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= +github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= @@ -251,6 +301,12 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8 github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc= +github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -272,6 +328,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rhysd/actionlint v1.7.10 h1:FL3XIEs72G4/++168vlv5FKOWMSWvWIQw1kBCadyOcM= github.com/rhysd/actionlint v1.7.10/go.mod h1:ZHX/hrmknlsJN73InPTKsKdXpAv9wVdrJy8h8HAwFHg= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= @@ -317,6 +375,8 @@ github.com/xdg-go/scram v1.2.0 h1:bYKF2AEwG5rqd1BumT4gAnvwU/M9nBp2pTSxeZw7Wvs= github.com/xdg-go/scram v1.2.0/go.mod h1:3dlrS0iBaWKYVt2ZfA4cj48umJZ+cAEbR6/SjLA88I8= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= @@ -375,6 +435,7 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/sessions/gateway.go b/sessions/gateway.go index 8512ec3..26ea735 100644 --- a/sessions/gateway.go +++ b/sessions/gateway.go @@ -19,7 +19,10 @@ import ( "github.com/actionforge/actrun-cli/build" "github.com/actionforge/actrun-cli/utils" + "github.com/charmbracelet/huh" + "github.com/charmbracelet/lipgloss" "github.com/gorilla/websocket" + "github.com/mattn/go-isatty" ) func RunSessionMode(configFile string, graphFileForDebugSession string, sessionToken string, configValueSource string) error { @@ -28,10 +31,6 @@ func RunSessionMode(configFile string, graphFileForDebugSession string, sessionT return errors.New("both createDebugSession and sessionToken cannot be set") } - if graphFileForDebugSession == "" { - PrintWelcomeMessage() - } - if configFile != "" { utils.LogOut.Infof("👉 Configs will be loaded from: %s\n", configFile) _, err := utils.LoadConfig(configFile) @@ -350,25 +349,77 @@ func GetSessionToken(sessionToken string, configValueSource string) (string, err } func PrintWelcomeMessage() { - welcomeText := `Welcome to your Actionforge Runner + fmt.Print("Welcome to your Actionforge Runner\n\n") + fmt.Print("📖 Docs: https://docs.actionforge.dev\n\n") +} + +// IsInteractive returns true if stdin is a terminal. +func IsInteractive() bool { + return isatty.IsTerminal(os.Stdin.Fd()) || isatty.IsCygwinTerminal(os.Stdin.Fd()) +} + +// PrintUsageHints prints a static version of the menu options for non-interactive environments. +func PrintUsageHints() { + fmt.Print("🚀 Run a graph — execute a local graph file\n") + fmt.Print(" actrun \n\n") + fmt.Print("🔗 Connect to web debug session — paste a session token\n") + fmt.Print(" actrun debug --session-token \n\n") + fmt.Print("🤖 Connect as agent — connect to the orchestrator\n") + fmt.Print(" actrun agent --token \n\n") +} + +// PromptMainMenu displays an interactive menu with arrow-key navigation. +// Returns 1, 2, or 3 for the selected option, or 0 if the user quits. +func PromptMainMenu() int { + var choice int + + hint := lipgloss.NewStyle().Foreground(lipgloss.Color("240")) -----------------------[ HOW TO RUN ]---------------------- + err := huh.NewSelect[int](). + Title("Choose an option"). + Options( + huh.NewOption("🚀 Run a graph — execute a local graph file\n"+hint.Render(" actrun "), 1), + huh.NewOption("🔗 Connect to web debug session — paste a session token\n"+hint.Render(" actrun debug --session-token "), 2), + huh.NewOption("🤖 Connect as agent — connect to the orchestrator\n"+hint.Render(" actrun agent --token "), 3), + ). + Value(&choice). + Run() -[ 🚀 OPTION 1: RUN LOCAL ACTION GRAPH ] - Execute a local graph file directly from your terminal. - Example: $ actrun my-graph.act + if err != nil { + return 0 + } + return choice +} -[ 🔗 OPTION 2: CONNECT TO WEB APP ] - Please paste the session token from your browser to connect. +// PromptGraphFile asks the user for a graph file path and returns it. +func PromptGraphFile() string { + var path string ----------------------------------------------------------- + err := huh.NewInput(). + Title("Enter graph file path"). + Prompt("📂 "). + Value(&path). + Run() -📖 Docs: https://docs.actionforge.dev + if err != nil { + return "" + } + return strings.TrimSpace(path) +} + +// PromptAgentToken asks the user for an agent token and returns it. +func PromptAgentToken() string { + var token string -` + err := huh.NewInput(). + Title("Enter agent token"). + Prompt("🔑 "). + Placeholder("bsa_..."). + Value(&token). + Run() - // Print the message to standard output. - // We use fmt.Print here instead of Println to avoid adding an extra - // newline at the very end, keeping the cursor right after the prompt. - fmt.Print(welcomeText) + if err != nil { + return "" + } + return strings.TrimSpace(token) } diff --git a/tests_e2e/references/reference_app.sh_l10 b/tests_e2e/references/reference_app.sh_l10 index 08b9aa4..f76116b 100644 --- a/tests_e2e/references/reference_app.sh_l10 +++ b/tests_e2e/references/reference_app.sh_l10 @@ -7,6 +7,7 @@ Usage: Available Commands: agent Start an agent that polls the server for jobs completion Generate the autocompletion script for the specified shell + debug Connect to the web app with a session token help Help about any command mcp Start the MCP server (stdio transport). schema Print the JSON schema for .act files. diff --git a/tests_e2e/references/reference_app.sh_l11 b/tests_e2e/references/reference_app.sh_l11 index d815fb4..0a073cf 100644 --- a/tests_e2e/references/reference_app.sh_l11 +++ b/tests_e2e/references/reference_app.sh_l11 @@ -13,21 +13,6 @@ looking for value: 'session_token' looking for value: 'create_debug_session' found value in flags evaluated to: 'false' -Welcome to your Actionforge Runner - -----------------------[ HOW TO RUN ]---------------------- - -[ 🚀 OPTION 1: RUN LOCAL ACTION GRAPH ] - Execute a local graph file directly from your terminal. - Example: $ actrun my-graph.act - -[ 🔗 OPTION 2: CONNECT TO WEB APP ] - Please paste the session token from your browser to connect. - ----------------------------------------------------------- - -📖 Docs: https:[REDACTED]/docs.actionforge.dev - No config file specified, config values will be derived from environment variables and flags 🔑 Enter session token: diff --git a/tests_e2e/references/reference_app.sh_l28 b/tests_e2e/references/reference_app.sh_l28 index 61b46a9..4e04a77 100644 --- a/tests_e2e/references/reference_app.sh_l28 +++ b/tests_e2e/references/reference_app.sh_l28 @@ -14,19 +14,14 @@ looking for value: 'create_debug_session' evaluated to: 'false' Welcome to your Actionforge Runner -----------------------[ HOW TO RUN ]---------------------- - -[ 🚀 OPTION 1: RUN LOCAL ACTION GRAPH ] - Execute a local graph file directly from your terminal. - Example: $ actrun my-graph.act - -[ 🔗 OPTION 2: CONNECT TO WEB APP ] - Please paste the session token from your browser to connect. +📖 Docs: https:[REDACTED]/docs.actionforge.dev ----------------------------------------------------------- +🚀 Run a graph — execute a local graph file + actrun -📖 Docs: https:[REDACTED]/docs.actionforge.dev +🔗 Connect to web debug session — paste a session token + actrun debug --session-token -No config file specified, config values will be derived from environment variables and flags +🤖 Connect as agent — connect to the orchestrator + actrun agent --token -🔑 Enter session token: no session token provided, exiting. \ No newline at end of file diff --git a/tests_e2e/references/reference_app.sh_l8 b/tests_e2e/references/reference_app.sh_l8 index 61b46a9..4e04a77 100644 --- a/tests_e2e/references/reference_app.sh_l8 +++ b/tests_e2e/references/reference_app.sh_l8 @@ -14,19 +14,14 @@ looking for value: 'create_debug_session' evaluated to: 'false' Welcome to your Actionforge Runner -----------------------[ HOW TO RUN ]---------------------- - -[ 🚀 OPTION 1: RUN LOCAL ACTION GRAPH ] - Execute a local graph file directly from your terminal. - Example: $ actrun my-graph.act - -[ 🔗 OPTION 2: CONNECT TO WEB APP ] - Please paste the session token from your browser to connect. +📖 Docs: https:[REDACTED]/docs.actionforge.dev ----------------------------------------------------------- +🚀 Run a graph — execute a local graph file + actrun -📖 Docs: https:[REDACTED]/docs.actionforge.dev +🔗 Connect to web debug session — paste a session token + actrun debug --session-token -No config file specified, config values will be derived from environment variables and flags +🤖 Connect as agent — connect to the orchestrator + actrun agent --token -🔑 Enter session token: no session token provided, exiting. \ No newline at end of file diff --git a/tests_e2e/references/reference_contexts_env.sh_l26 b/tests_e2e/references/reference_contexts_env.sh_l26 index bfdfc7b..1eaf936 100644 --- a/tests_e2e/references/reference_contexts_env.sh_l26 +++ b/tests_e2e/references/reference_contexts_env.sh_l26 @@ -7,6 +7,7 @@ Usage: Available Commands: agent Start an agent that polls the server for jobs completion Generate the autocompletion script for the specified shell + debug Connect to the web app with a session token help Help about any command mcp Start the MCP server (stdio transport). schema Print the JSON schema for .act files.