The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
Remove the unwired beacon login and beacon ingest commands
shukieshahe160d704a6a4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex b480574a..69559e60 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -391,7 +391,6 @@ jobs:./internal/endpoint/service/... `./internal/endpoint/wazuh/... `./internal/endpoint/writer/... `- ./internal/ingest/... `./internal/mcpserver/... `./internal/tokens/... `./internal/updatecheck/... `diff --git a/cli/beacon/cmd/endpoint_install.go b/cli/beacon/cmd/endpoint_install.goindex 7e091ab1..530510c7 100644--- a/cli/beacon/cmd/endpoint_install.go+++ b/cli/beacon/cmd/endpoint_install.go@@ -172,7 +172,6 @@ func runEndpointStatus(cmd *cobra.Command, args []string) error {} else {fmt.Println("Last event: present")}- printIngestStatus("Endpoint ingest", status.ManagedUpload)return nil}diff --git a/cli/beacon/cmd/ingest.go b/cli/beacon/cmd/ingest.godeleted file mode 100644index a9ee3e51..00000000--- a/cli/beacon/cmd/ingest.go+++ /dev/null@@ -1,146 +0,0 @@-package cmd--import (- "context"- "encoding/json"- "fmt"- "os"- "time"-- beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"- endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config"- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/lifecycle"- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/ingest"- endpointingest "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/ingest/endpoint"- "github.com/spf13/cobra"-)--var ingestCmd = &cobra.Command{- Use: "ingest",- Short: "Upload Beacon telemetry to configured ingest destinations",-}--var ingestStatusCmd = &cobra.Command{- Use: "status",- Short: "Show configured ingest status",- SilenceUsage: true,- RunE: func(cmd *cobra.Command, args []string) error {- state := endpointIngestStatus()- if endpointOpts.jsonOutput {- return json.NewEncoder(os.Stdout).Encode(map[string]ingest.State{- "endpoint": state,- })- }- fmt.Println("Beacon ingest")- printIngestStatus("Endpoint", state)- return nil- },-}--var ingestEndpointCmd = &cobra.Command{- Use: "endpoint",- Short: "Manage endpoint telemetry ingest",-}--var ingestEndpointStatusCmd = &cobra.Command{- Use: "status",- Short: "Show endpoint telemetry upload status",- SilenceUsage: true,- RunE: func(cmd *cobra.Command, args []string) error {- state := endpointIngestStatus()- if endpointOpts.jsonOutput {- return json.NewEncoder(os.Stdout).Encode(state)- }- printIngestStatus("Endpoint ingest", state)- return nil- },-}--var ingestEndpointUploadCmd = &cobra.Command{- Use: "upload",- Short: "Upload endpoint telemetry to managed ingest",- SilenceUsage: true,- RunE: func(cmd *cobra.Command, args []string) error {- res, err := uploadEndpointIngest(cmd.Context())- if endpointOpts.jsonOutput {- if encodeErr := json.NewEncoder(os.Stdout).Encode(res.State); encodeErr != nil {- return encodeErr- }- } else {- printIngestStatus("Endpoint ingest", res.State)- }- if err != nil {- return err- }- return nil- },-}--func init() {- rootCmd.AddCommand(ingestCmd)- ingestCmd.AddCommand(ingestStatusCmd)- ingestCmd.AddCommand(ingestEndpointCmd)- ingestEndpointCmd.AddCommand(ingestEndpointStatusCmd)- ingestEndpointCmd.AddCommand(ingestEndpointUploadCmd)-- for _, c := range []*cobra.Command{ingestStatusCmd, ingestEndpointStatusCmd, ingestEndpointUploadCmd} {- c.Flags().BoolVar(&endpointOpts.userMode, "user", true, "Use per-user endpoint paths")- c.Flags().BoolVar(&endpointOpts.systemMode, "system", false, "Use system endpoint paths and the system collector service")- c.Flags().StringVar(&endpointOpts.logPath, "log-path", "", "Runtime JSONL log path")- c.Flags().BoolVar(&endpointOpts.jsonOutput, "json", false, "Print output as JSON")- }-}--func endpointIngestStatus() ingest.State {- cfg, effectiveUserMode, logPath := endpointIngestConfig()- creds, _ := beaconauth.LoadCredentials()- return ingest.Status(- endpointingest.Settings(cfg, logPath, effectiveUserMode),- endpointingest.Store(effectiveUserMode),- creds,- )-}--func uploadEndpointIngest(ctx context.Context) (ingest.Result, error) {- cfg, effectiveUserMode, logPath := endpointIngestConfig()- creds, _ := beaconauth.LoadCredentials()- uploadCtx, cancel := context.WithTimeout(ctx, 30*time.Second)- defer cancel()- res := ingest.Upload(uploadCtx, ingest.Options{- Settings: endpointingest.Settings(cfg, logPath, effectiveUserMode),- Creds: creds,- Store: endpointingest.Store(effectiveUserMode),- Source: endpointingest.NewSource(cfg, logPath, effectiveUserMode),- })- if res.State.Enabled && res.State.Managed && res.State.LastError != "" {- return res, fmt.Errorf("%s", res.State.LastError)- }- return res, nil-}--func endpointIngestConfig() (endpointconfig.Config, bool, string) {- cfg := loadOrDefaultConfig()- runtimeLog := lifecycle.ResolveRuntimeLog(endpointUserMode(), endpointOpts.logPath)- effectiveCfg := cfg- effectiveCfg.UserMode = runtimeLog.EffectiveUserMode- if runtimeLog.EffectiveUserMode != cfg.UserMode {- effectiveCfg = loadConfigForMode(runtimeLog.EffectiveUserMode, runtimeLog.EffectiveLogPath)- }- effectiveCfg.LogPath = runtimeLog.EffectiveLogPath- return effectiveCfg, effectiveCfg.UserMode, effectiveCfg.LogPath-}--func printIngestStatus(label string, state ingest.State) {- fmt.Printf("%s: enabled=%t managed=%t logged_in=%t", label, state.Enabled, state.Managed, state.LoggedIn)- if state.LastUploadAt != "" {- fmt.Printf(" last_upload=%s", state.LastUploadAt)- }- if state.LastCursor.Offset > 0 {- fmt.Printf(" cursor_offset=%d", state.LastCursor.Offset)- }- fmt.Printf(" accepted=%d rejected=%d", state.AcceptedCount, state.RejectedCount)- if state.LastError != "" {- fmt.Printf(" error=%s", state.LastError)- }- fmt.Println()-}diff --git a/cli/beacon/cmd/login.go b/cli/beacon/cmd/login.godeleted file mode 100644index 1e75e570..00000000--- a/cli/beacon/cmd/login.go+++ /dev/null@@ -1,110 +0,0 @@-package cmd--import (- "fmt"-- "github.com/spf13/cobra"-- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"-)--type loginOptions struct {- dashboardURL string- force bool-}--type loginService interface {- Login(auth.LoginOptions) (*auth.Credentials, error)- LoadCredentials() (*auth.Credentials, error)- SaveCredentials(*auth.Credentials) error- IsLoggedIn() bool-}--type defaultLoginService struct{}--func (defaultLoginService) Login(opts auth.LoginOptions) (*auth.Credentials, error) {- return auth.Login(opts)-}--func (defaultLoginService) LoadCredentials() (*auth.Credentials, error) {- return auth.LoadCredentials()-}--func (defaultLoginService) SaveCredentials(creds *auth.Credentials) error {- return auth.SaveCredentials(creds)-}--func (defaultLoginService) IsLoggedIn() bool {- return auth.IsLoggedIn()-}--var (- loginOpts = loginOptions{}-- newLoginService = func() loginService {- return defaultLoginService{}- }-)--var loginCmd = &cobra.Command{- Use: "login",- Short: "Log in to the Asymptote dashboard",- Long: "Log in to the Asymptote dashboard using your browser. Beacon endpoint telemetry remains local-only unless you explicitly use cloud features.",- SilenceUsage: true,- Args: cobra.NoArgs,- RunE: runLogin,-}--func init() {- loginCmd.Flags().StringVar(&loginOpts.dashboardURL, "dashboard-url", "", "Asymptote dashboard URL (defaults to "+auth.DefaultDashboardURL+", or "+auth.DashboardURLEnv+")")- loginCmd.Flags().BoolVar(&loginOpts.force, "force", false, "Replace existing saved credentials")- rootCmd.AddCommand(loginCmd)-}--func runLogin(cmd *cobra.Command, args []string) error {- service := newLoginService()- out := cmd.OutOrStdout()-- if !loginOpts.force && service.IsLoggedIn() {- creds, err := service.LoadCredentials()- if err != nil {- return fmt.Errorf("failed to load saved credentials: %w", err)- }- if creds != nil {- if creds.Email != "" {- fmt.Fprintf(out, "Already logged in as %s\n", creds.Email)- } else {- fmt.Fprintln(out, "Already logged in.")- }- if creds.OrgName != "" {- fmt.Fprintf(out, "Organization: %s\n", creds.OrgName)- }- fmt.Fprintln(out, "Run 'beacon login --force' to log in as a different user.")- return nil- }- }-- creds, err := service.Login(auth.LoginOptions{- DashboardURL: loginOpts.dashboardURL,- Out: out,- })- if err != nil {- return fmt.Errorf("login failed: %w", err)- }- if err := service.SaveCredentials(creds); err != nil {- return fmt.Errorf("failed to save credentials: %w", err)- }-- fmt.Fprintln(out)- if creds.Email != "" {- fmt.Fprintf(out, "Success! Logged in as %s\n", creds.Email)- } else {- fmt.Fprintln(out, "Success! Logged in successfully.")- }- if creds.OrgName != "" {- fmt.Fprintf(out, "Organization: %s\n", creds.OrgName)- }- fmt.Fprintln(out)- fmt.Fprintln(out, "Beacon endpoint telemetry remains local-only unless you explicitly use cloud features.")- return nil-}diff --git a/cli/beacon/cmd/login_test.go b/cli/beacon/cmd/login_test.godeleted file mode 100644index e51ef12e..00000000--- a/cli/beacon/cmd/login_test.go+++ /dev/null@@ -1,173 +0,0 @@-package cmd--import (- "bytes"- "errors"- "strings"- "testing"-- "github.com/spf13/cobra"-- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"-)--type stubLoginService struct {- creds *auth.Credentials- loginCreds *auth.Credentials- loginErr error- saveErr error- loggedIn bool- loginCalled bool- saveCalled bool- capturedOpts auth.LoginOptions-}--func (s *stubLoginService) Login(opts auth.LoginOptions) (*auth.Credentials, error) {- s.loginCalled = true- s.capturedOpts = opts- if s.loginErr != nil {- return nil, s.loginErr- }- return s.loginCreds, nil-}--func (s *stubLoginService) LoadCredentials() (*auth.Credentials, error) {- return s.creds, nil-}--func (s *stubLoginService) SaveCredentials(creds *auth.Credentials) error {- s.saveCalled = true- s.creds = creds- return s.saveErr-}--func (s *stubLoginService) IsLoggedIn() bool {- return s.loggedIn-}--func TestLoginCommandRegistered(t *testing.T) {- cmd, _, err := rootCmd.Find([]string{"login"})- if err != nil {- t.Fatalf("Find login returned error: %v", err)- }- if cmd == nil {- t.Fatal("login command not registered")- }- if cmd.Flags().Lookup("dashboard-url") == nil {- t.Fatal("login command missing --dashboard-url")- }- if cmd.Flags().Lookup("force") == nil {- t.Fatal("login command missing --force")- }-}--func TestRunLoginAlreadyLoggedIn(t *testing.T) {- service := &stubLoginService{- loggedIn: true,- creds: &auth.Credentials{- Email: "[email protected]",- OrgName: "Example Org",- },- }- restore := setLoginServiceForTest(t, service)- defer restore()- restoreOpts := setLoginOptsForTest(t, loginOptions{})- defer restoreOpts()-- cmd := &cobra.Command{}- var out bytes.Buffer- cmd.SetOut(&out)- if err := runLogin(cmd, nil); err != nil {- t.Fatalf("runLogin returned error: %v", err)- }- got := out.String()- for _, want := range []string{- "Already logged in as [email protected]",- "Organization: Example Org",- "beacon login --force",- } {- if !strings.Contains(got, want) {- t.Fatalf("output = %q, want %q", got, want)- }- }- if service.loginCalled {- t.Fatal("Login called despite existing credentials")- }-}--func TestRunLoginForceReplacesCredentials(t *testing.T) {- service := &stubLoginService{- loggedIn: true,- creds: &auth.Credentials{Email: "[email protected]"},- loginCreds: &auth.Credentials{- Token: "secret-token",- TokenPrefix: "asym_123",- UserID: "user-1",- Email: "[email protected]",- OrgName: "Example Org",- },- }- restore := setLoginServiceForTest(t, service)- defer restore()- restoreOpts := setLoginOptsForTest(t, loginOptions{force: true, dashboardURL: "https://dashboard.example"})- defer restoreOpts()-- cmd := &cobra.Command{}- var out bytes.Buffer- cmd.SetOut(&out)- if err := runLogin(cmd, nil); err != nil {- t.Fatalf("runLogin returned error: %v", err)- }- if !service.loginCalled {- t.Fatal("Login was not called")- }- if !service.saveCalled {- t.Fatal("SaveCredentials was not called")- }- if service.capturedOpts.DashboardURL != "https://dashboard.example" {- t.Fatalf("DashboardURL = %q, want override", service.capturedOpts.DashboardURL)- }- got := out.String()- for _, want := range []string{- "Success! Logged in as [email protected]",- "Organization: Example Org",- "Beacon endpoint telemetry remains local-only",- } {- if !strings.Contains(got, want) {- t.Fatalf("output = %q, want %q", got, want)- }- }-}--func TestRunLoginReturnsLoginError(t *testing.T) {- service := &stubLoginService{loginErr: errors.New("browser closed")}- restore := setLoginServiceForTest(t, service)- defer restore()- restoreOpts := setLoginOptsForTest(t, loginOptions{})- defer restoreOpts()-- cmd := &cobra.Command{}- err := runLogin(cmd, nil)- if err == nil {- t.Fatal("runLogin error = nil, want error")- }- if !strings.Contains(err.Error(), "login failed: browser closed") {- t.Fatalf("error = %v, want login failure", err)- }-}--func setLoginServiceForTest(t *testing.T, service loginService) func() {- t.Helper()- old := newLoginService- newLoginService = func() loginService {- return service- }- return func() { newLoginService = old }-}--func setLoginOptsForTest(t *testing.T, opts loginOptions) func() {- t.Helper()- old := loginOpts- loginOpts = opts- return func() { loginOpts = old }-}diff --git a/cli/beacon/internal/auth/server.go b/cli/beacon/internal/auth/server.goindex cd5143d1..a4bb89d7 100644--- a/cli/beacon/internal/auth/server.go+++ b/cli/beacon/internal/auth/server.go@@ -250,11 +250,11 @@ func (cs *CallbackServer) sendResponse(w http.ResponseWriter, success bool, erro}_, _ = fmt.Fprintf(w, `<!DOCTYPE html><html>-<head><title>Beacon Login Failed</title></head>+<head><title>Beacon Authentication Failed</title></head><body><h1>Authentication Failed</h1><p>%s</p>- <p>Please return to the terminal and try <code>beacon login</code> again.</p>+ <p>Please return to the terminal and run the command again.</p></body></html>`, html.EscapeString(errorMsg))}diff --git a/cli/beacon/internal/endpoint/config/config.go b/cli/beacon/internal/endpoint/config/config.goindex eaf887b0..368384a3 100644--- a/cli/beacon/internal/endpoint/config/config.go+++ b/cli/beacon/internal/endpoint/config/config.go@@ -95,15 +95,14 @@ const ()type Config struct {- UserMode bool `json:"user_mode"`- LogPath string `json:"log_path"`- Collector Collector `json:"collector"`- Harnesses []string `json:"harnesses"`- EventCategories []string `json:"event_categories,omitempty"`- Inventory *Inventory `json:"inventory_heartbeat,omitempty"`- Destinations *Destinations `json:"destinations,omitempty"`- ManagedUpload *ManagedUpload `json:"managed_upload,omitempty"`- AutoUpdate *AutoUpdate `json:"auto_update,omitempty"`+ UserMode bool `json:"user_mode"`+ LogPath string `json:"log_path"`+ Collector Collector `json:"collector"`+ Harnesses []string `json:"harnesses"`+ EventCategories []string `json:"event_categories,omitempty"`+ Inventory *Inventory `json:"inventory_heartbeat,omitempty"`+ Destinations *Destinations `json:"destinations,omitempty"`+ AutoUpdate *AutoUpdate `json:"auto_update,omitempty"`}// AutoUpdate controls Beacon's endpoint update checker. Phase 1 supports@@ -143,14 +142,6 @@ type Destinations struct {FalconHEC *FalconHEC `json:"falcon_hec,omitempty"`}-type ManagedUpload struct {- Enabled bool `json:"enabled,omitempty"`- Managed bool `json:"managed,omitempty"`- IngestURL string `json:"ingest_url,omitempty"`- SourceID string `json:"source_id,omitempty"`- ContentRetention string `json:"content_retention,omitempty"`-}-type SplunkHEC struct {Enabled bool `json:"enabled,omitempty"`Endpoint string `json:"endpoint,omitempty"`diff --git a/cli/beacon/internal/endpoint/lifecycle/lifecycle.go b/cli/beacon/internal/endpoint/lifecycle/lifecycle.goindex 46e17f0d..df0df5bf 100644--- a/cli/beacon/internal/endpoint/lifecycle/lifecycle.go+++ b/cli/beacon/internal/endpoint/lifecycle/lifecycle.go@@ -8,7 +8,6 @@ import ("strings""time"- beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"endpointcollector "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/collector"endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/diagnostics"@@ -17,8 +16,6 @@ import ("github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/selfupdate""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/service""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/writer"- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/ingest"- endpointingest "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/ingest/endpoint""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/version")@@ -76,17 +73,16 @@ type InstallResult struct {}type Status struct {- Version string `json:"version"`- ConfigPath string `json:"config_path"`- LogPath string `json:"log_path"`- RuntimeLog RuntimeLogSource `json:"runtime_log"`- Collector endpointcollector.Status `json:"collector"`- Service service.Status `json:"service"`- Harnesses []harness.Harness `json:"harnesses"`- Diagnostics []diagnostics.Check `json:"diagnostics"`- LastEvent string `json:"last_event,omitempty"`- Destinations DestinationStatus `json:"destinations"`- ManagedUpload ingest.State `json:"managed_upload"`+ Version string `json:"version"`+ ConfigPath string `json:"config_path"`+ LogPath string `json:"log_path"`+ RuntimeLog RuntimeLogSource `json:"runtime_log"`+ Collector endpointcollector.Status `json:"collector"`+ Service service.Status `json:"service"`+ Harnesses []harness.Harness `json:"harnesses"`+ Diagnostics []diagnostics.Check `json:"diagnostics"`+ LastEvent string `json:"last_event,omitempty"`+ Destinations DestinationStatus `json:"destinations"`}type DestinationStatus struct {@@ -566,24 +562,17 @@ func GetStatus(userMode bool, logPath string) Status {Message: runtimeLog.Warning,})}- creds, _ := beaconauth.LoadCredentials()- managedUpload := ingest.Status(- endpointingest.Settings(effectiveCfg, effectiveCfg.LogPath, effectiveCfg.UserMode),- endpointingest.Store(effectiveCfg.UserMode),- creds,- )return Status{- Version: version.GetVersion(),- ConfigPath: endpointconfig.ConfigPath(effectiveCfg.UserMode),- LogPath: effectiveCfg.LogPath,- RuntimeLog: runtimeLog,- Collector: endpointcollector.CheckStatus(effectiveCfg),- Service: service.Manager{UserMode: effectiveCfg.UserMode}.Status(),- Harnesses: harness.DiscoverAll(),- Diagnostics: checks,- LastEvent: last,- Destinations: destinationStatus(effectiveCfg),- ManagedUpload: managedUpload,+ Version: version.GetVersion(),+ ConfigPath: endpointconfig.ConfigPath(effectiveCfg.UserMode),+ LogPath: effectiveCfg.LogPath,+ RuntimeLog: runtimeLog,+ Collector: endpointcollector.CheckStatus(effectiveCfg),+ Service: service.Manager{UserMode: effectiveCfg.UserMode}.Status(),+ Harnesses: harness.DiscoverAll(),+ Diagnostics: checks,+ LastEvent: last,+ Destinations: destinationStatus(effectiveCfg),}}diff --git a/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.go b/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.goindex 016644ea..6050807f 100644--- a/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.go+++ b/cli/beacon/internal/endpoint/lifecycle/lifecycle_test.go@@ -4,15 +4,12 @@ import ("encoding/json""errors""net"- "net/http"- "net/http/httptest""os""path/filepath""runtime""strings""testing"- beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/harness""github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/schema"@@ -180,47 +177,6 @@ func TestConfigureHarnessesRejectsUnsupportedHarness(t *testing.T) {}}-func TestGetStatusDoesNotUploadManagedTelemetry(t *testing.T) {- home := t.TempDir()- t.Setenv("HOME", home)- logPath := filepath.Join(home, "runtime.jsonl")- if err := os.WriteFile(logPath, []byte("{\"event\":\"ok\"}\n"), 0600); err != nil {- t.Fatal(err)- }- called := false- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {- called = true- http.Error(w, "status should not upload", http.StatusInternalServerError)- }))- defer server.Close()-- _, err := endpointconfig.Save(endpointconfig.Config{- UserMode: true,- LogPath: logPath,- Harnesses: []string{},- ManagedUpload: &endpointconfig.ManagedUpload{- Enabled: true,- Managed: true,- IngestURL: server.URL,- SourceID: "source-1",- },- })- if err != nil {- t.Fatal(err)- }- if err := beaconauth.SaveCredentials(&beaconauth.Credentials{Token: "token", UserID: "user"}); err != nil {- t.Fatal(err)- }-- status := GetStatus(true, logPath)- if !status.ManagedUpload.Enabled || !status.ManagedUpload.Managed || !status.ManagedUpload.LoggedIn {- t.Fatalf("unexpected endpoint ingest status: %#v", status.ManagedUpload)- }- if called {- t.Fatal("GetStatus performed an ingest upload network call")- }-}-func TestConfigureHarnessesRejectsFactoryAsMDMManaged(t *testing.T) {cfg := endpointconfig.Config{Harnesses: []string{"factory"},diff --git a/cli/beacon/internal/ingest/client.go b/cli/beacon/internal/ingest/client.godeleted file mode 100644index 4894245c..00000000--- a/cli/beacon/internal/ingest/client.go+++ /dev/null@@ -1,75 +0,0 @@-package ingest--import (- "bytes"- "context"- "encoding/json"- "fmt"- "io"- "net/http"- "strings"- "time"-- beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/version"-)--const defaultIngestPath = "/api/v1/ingest/beacon/events"--type Client struct {- URL string- HTTPClient *http.Client-}--func NewClient(ingestURL string, httpClient *http.Client) Client {- if strings.TrimSpace(ingestURL) == "" {- ingestURL = beaconauth.ResolveDashboardURL("") + defaultIngestPath- }- if httpClient == nil {- httpClient = &http.Client{Timeout: 15 * time.Second}- }- return Client{- URL: strings.TrimRight(ingestURL, "/"),- HTTPClient: httpClient,- }-}--func (c Client) UploadBatch(ctx context.Context, token string, reqBody uploadRequest) (uploadResponse, error) {- data, err := json.Marshal(reqBody)- if err != nil {- return uploadResponse{}, err- }- req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.URL, bytes.NewReader(data))- if err != nil {- return uploadResponse{}, err- }- req.Header.Set("Authorization", "Bearer "+token)- req.Header.Set("Content-Type", "application/json")- req.Header.Set("User-Agent", "beacon/"+version.GetVersion())-- resp, err := c.HTTPClient.Do(req)- if err != nil {- return uploadResponse{}, err- }- defer resp.Body.Close()-- respBody, _ := io.ReadAll(io.LimitReader(resp.Body, 4096))- if resp.StatusCode < 200 || resp.StatusCode >= 300 {- return uploadResponse{}, fmt.Errorf("ingest upload failed: HTTP %d: %s", resp.StatusCode, strings.TrimSpace(string(respBody)))- }- if strings.TrimSpace(string(respBody)) == "" {- return uploadResponse{}, fmt.Errorf("ingest upload response was empty")- }- var parsed uploadResponse- if err := json.Unmarshal(respBody, &parsed); err != nil {- return uploadResponse{}, fmt.Errorf("ingest upload response was invalid: %w", err)- }- if parsed.Accepted < 0 || parsed.Rejected < 0 {- return uploadResponse{}, fmt.Errorf("ingest upload response had negative event counts")- }- accounted := parsed.Accepted + parsed.Rejected- if accounted != len(reqBody.Events) {- return uploadResponse{}, fmt.Errorf("ingest upload response accounted for %d events, want %d", accounted, len(reqBody.Events))- }- return parsed, nil-}diff --git a/cli/beacon/internal/ingest/endpoint/identity_unix.go b/cli/beacon/internal/ingest/endpoint/identity_unix.godeleted file mode 100644index 0046184a..00000000--- a/cli/beacon/internal/ingest/endpoint/identity_unix.go+++ /dev/null@@ -1,26 +0,0 @@-//go:build !windows--package endpoint--import (- "fmt"- "os"- "syscall"-)--// fileIdentity returns a stable identifier for the file behind an open handle.-//-// This is how the reader follows a rotated log. Rotation renames runtime.jsonl to runtime.jsonl.1,-// so the path a saved byte offset was recorded against now names different content -- resuming from-// that offset would skip or re-read events. Identity survives the rename, so the offset can follow-// the content instead of the name.-//-// Device and inode are that identity on POSIX. An empty result means "unknown", which callers-// already handle by falling back to path-based offsets.-func fileIdentity(_ *os.File, info os.FileInfo) string {- stat, ok := info.Sys().(*syscall.Stat_t)- if !ok {- return ""- }- return fmt.Sprintf("%d:%d", stat.Dev, stat.Ino)-}diff --git a/cli/beacon/internal/ingest/endpoint/identity_windows.go b/cli/beacon/internal/ingest/endpoint/identity_windows.godeleted file mode 100644index 0842910f..00000000--- a/cli/beacon/internal/ingest/endpoint/identity_windows.go+++ /dev/null@@ -1,36 +0,0 @@-//go:build windows--package endpoint--import (- "fmt"- "os"-- "golang.org/x/sys/windows"-)--// fileIdentity returns a stable identifier for the file behind an open handle.-//-// See the POSIX implementation for why identity rather than path: it is what lets a saved byte-// offset follow a log's content across the rename that rotation performs.-//-// The Windows equivalent of device-and-inode is the volume serial number plus the 64-bit file-// index, and unlike POSIX it is not reachable from a FileInfo -- os.Stat's Win32FileAttributeData-// carries no index at all, which is why this takes the open handle. The handle is the one the-// caller already opened, so no second open is needed and there is no chance of blocking the-// collector that is writing the file.-//-// An empty result means "unknown", which callers already handle by falling back to path-based-// offsets. That fallback is why this must not be left unimplemented on Windows: it would work,-// quietly, while re-reading or skipping events on every rotation.-func fileIdentity(f *os.File, _ os.FileInfo) string {- if f == nil {- return ""- }- var d windows.ByHandleFileInformation- if err := windows.GetFileInformationByHandle(windows.Handle(f.Fd()), &d); err != nil {- return ""- }- index := uint64(d.FileIndexHigh)<<32 | uint64(d.FileIndexLow)- return fmt.Sprintf("%d:%d", d.VolumeSerialNumber, index)-}diff --git a/cli/beacon/internal/ingest/endpoint/reader.go b/cli/beacon/internal/ingest/endpoint/reader.godeleted file mode 100644index b9a3b318..00000000--- a/cli/beacon/internal/ingest/endpoint/reader.go+++ /dev/null@@ -1,205 +0,0 @@-package endpoint--import (- "bufio"- "bytes"- "encoding/json"- "os"- "path/filepath"- "sort"- "strconv"- "strings"-- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/ingest"-)--func (s Source) Batches(state ingest.State, maxEvents int, maxBytes int) ([]ingest.Batch, error) {- if maxEvents <= 0 {- maxEvents = ingest.DefaultBatchEvents- }- if maxBytes <= 0 {- maxBytes = ingest.DefaultBatchBytes- }- files, err := logFiles(s.logPath)- if err != nil {- return nil, err- }- var batches []ingest.Batch- for _, file := range files {- fileBatches, err := readFileBatches(file, s.logPath, state, maxEvents, maxBytes)- if err != nil {- return nil, err- }- batches = append(batches, fileBatches...)- }- return batches, nil-}--func readFileBatches(path string, activePath string, state ingest.State, maxEvents int, maxBytes int) ([]ingest.Batch, error) {- file, err := os.Open(path)- if err != nil {- if os.IsNotExist(err) {- return nil, nil- }- return nil, err- }- defer file.Close()- info, err := file.Stat()- if err != nil {- return nil, err- }- fileID := fileIdentity(file, info)- startOffset := startOffsetForFile(path, activePath, state, info.Size(), fileID)-- if startOffset > 0 {- if _, err := file.Seek(startOffset, 0); err != nil {- return nil, err- }- }-- scanner := bufio.NewScanner(file)- scanner.Buffer(make([]byte, 0, 64*1024), maxBytes)- var (- batches []ingest.Batch- events []json.RawMessage- batchSize int- batchRejected int- batchEndOffset int64- batchLine int- line int- offset = startOffset- )- flush := func() {- if len(events) == 0 && batchRejected == 0 {- return- }- batches = append(batches, ingest.Batch{- Cursor: ingest.Cursor{- LogPath: path,- Offset: batchEndOffset,- Line: batchLine,- Archive: archiveName(activePath, path),- FileID: fileID,- },- Events: events,- Rejected: batchRejected,- })- events = nil- batchSize = 0- batchRejected = 0- }-- for scanner.Scan() {- line++- raw := append([]byte(nil), scanner.Bytes()...)- nextOffset := offset + int64(len(raw)) + 1- trimmed := bytes.TrimSpace(raw)- if len(trimmed) == 0 {- batchEndOffset = nextOffset- batchLine = line- offset = nextOffset- continue- }- if len(events) > 0 && (len(events) >= maxEvents || batchSize+len(trimmed) > maxBytes) {- flush()- }- if !json.Valid(trimmed) {- batchRejected++- batchEndOffset = nextOffset- batchLine = line- offset = nextOffset- continue- }- events = append(events, json.RawMessage(trimmed))- batchSize += len(trimmed)- batchEndOffset = nextOffset- batchLine = line- offset = nextOffset- }- if err := scanner.Err(); err != nil {- return nil, err- }- flush()- return batches, nil-}--func logFiles(path string) ([]string, error) {- dir := filepath.Dir(path)- base := filepath.Base(path)- entries, err := os.ReadDir(dir)- if err != nil {- if os.IsNotExist(err) {- return []string{path}, nil- }- return nil, err- }- var archives []string- for _, entry := range entries {- if entry.IsDir() {- continue- }- name := entry.Name()- if _, ok := archiveIndex(base, name); ok {- archives = append(archives, filepath.Join(dir, name))- }- }- sort.Slice(archives, func(i, j int) bool {- left, leftOK := archiveIndex(base, filepath.Base(archives[i]))- right, rightOK := archiveIndex(base, filepath.Base(archives[j]))- if leftOK && rightOK {- return left > right- }- return archives[i] < archives[j]- })- return append(archives, path), nil-}--func archiveIndex(base string, name string) (int, bool) {- suffix, ok := strings.CutPrefix(name, base+".")- if !ok {- return 0, false- }- index, err := strconv.Atoi(suffix)- if err != nil {- return 0, false- }- return index, true-}--func archiveName(activePath string, path string) string {- if activePath == path {- return ""- }- return filepath.Base(path)-}--func startOffsetForFile(path string, activePath string, state ingest.State, fileSize int64, fileID string) int64 {- if fileID != "" && len(state.FileIDs) > 0 {- if state.FileIDs[path] == fileID {- return boundedOffset(state.FileOffsets[path], fileSize)- }- for savedPath, savedID := range state.FileIDs {- if savedID == fileID {- return boundedOffset(state.FileOffsets[savedPath], fileSize)- }- }- if _, knownPath := state.FileIDs[path]; knownPath {- return 0- }- }-- if offset := boundedOffset(state.FileOffsets[path], fileSize); offset > 0 {- return offset- }- if path == activePath+".1" && state.FileIDs[activePath] == "" {- return boundedOffset(state.FileOffsets[activePath], fileSize)- }- return 0-}--func boundedOffset(offset int64, fileSize int64) int64 {- if offset <= 0 || offset > fileSize {- return 0- }- return offset-}diff --git a/cli/beacon/internal/ingest/endpoint/reader_test.go b/cli/beacon/internal/ingest/endpoint/reader_test.godeleted file mode 100644index 2f4d66bc..00000000--- a/cli/beacon/internal/ingest/endpoint/reader_test.go+++ /dev/null@@ -1,302 +0,0 @@-package endpoint--import (- "context"- "os"- "path/filepath"- "testing"-- beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"- endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config"- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/ingest"-)--func TestEndpointSourceBatchesValidEventsAndMalformedRejects(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- content := []byte("{\"event\":\"one\"}\nnot-json\n{\"event\":\"two\"}\n")- if err := os.WriteFile(logPath, content, 0600); err != nil {- t.Fatal(err)- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{FileOffsets: map[string]int64{}}, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 1 {- t.Fatalf("len(batches) = %d, want 1", len(batches))- }- if got := len(batches[0].Events); got != 2 {- t.Fatalf("events = %d, want 2", got)- }- if batches[0].Rejected != 1 {- t.Fatalf("Rejected = %d, want 1", batches[0].Rejected)- }- if batches[0].Cursor.Offset != int64(len(content)) {- t.Fatalf("Offset = %d, want %d", batches[0].Cursor.Offset, len(content))- }-}--func TestUploadTreatsMissingLogDirectoryAsNoBatches(t *testing.T) {- root := t.TempDir()- logPath := filepath.Join(root, "missing", "runtime.jsonl")- statePath := filepath.Join(root, "upload-state.json")- store := ingest.Store{Path: statePath}- if err := store.Save(ingest.State{LastError: "stale error"}); err != nil {- t.Fatal(err)- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- res := ingest.Upload(context.Background(), ingest.Options{- Settings: ingest.Settings{Enabled: true, Managed: true, SourceID: "source-1"},- Store: store,- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- })-- if res.Uploaded {- t.Fatalf("missing log directory should not upload: %#v", res.State)- }- if res.State.LastError != "" {- t.Fatalf("LastError = %q", res.State.LastError)- }- if stored := store.Load(); stored.LastError != "" {- t.Fatalf("persisted LastError = %q", stored.LastError)- }-}--func TestEndpointSourceHonorsSavedOffset(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- first := "{\"event\":\"one\"}\n"- second := "{\"event\":\"two\"}\n"- if err := os.WriteFile(logPath, []byte(first+second), 0600); err != nil {- t.Fatal(err)- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{FileOffsets: map[string]int64{logPath: int64(len(first))}}, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 1 || len(batches[0].Events) != 1 {- t.Fatalf("unexpected batches: %#v", batches)- }- if string(batches[0].Events[0]) != "{\"event\":\"two\"}" {- t.Fatalf("event = %s", batches[0].Events[0])- }-}--func TestEndpointSourceAppliesLegacyActiveOffsetToFirstRotatedArchive(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- archivePath := logPath + ".1"- alreadyUploaded := "{\"event\":\"already-uploaded\"}\n"- archiveNew := "{\"event\":\"archive-new\"}\n"- activeNew := "{\"event\":\"active\"}\n"- if err := os.WriteFile(archivePath, []byte(alreadyUploaded+archiveNew), 0600); err != nil {- t.Fatal(err)- }- if err := os.WriteFile(logPath, []byte(activeNew), 0600); err != nil {- t.Fatal(err)- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{- FileOffsets: map[string]int64{logPath: int64(len(alreadyUploaded))},- }, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 2 {- t.Fatalf("len(batches) = %d, want 2: %#v", len(batches), batches)- }- if batches[0].Cursor.LogPath != archivePath || batches[0].Cursor.Archive != "runtime.jsonl.1" {- t.Fatalf("unexpected archive cursor: %#v", batches[0].Cursor)- }- if string(batches[0].Events[0]) != "{\"event\":\"archive-new\"}" {- t.Fatalf("archive event = %s", batches[0].Events[0])- }- if batches[1].Cursor.LogPath != logPath || string(batches[1].Events[0]) != "{\"event\":\"active\"}" {- t.Fatalf("unexpected active batch: %#v", batches[1])- }-}--func TestEndpointSourceAppliesLegacyActiveOffsetWithUnrelatedFileIDs(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- archivePath := logPath + ".1"- alreadyUploaded := "{\"event\":\"already-uploaded\"}\n"- archiveNew := "{\"event\":\"archive-new\"}\n"- if err := os.WriteFile(archivePath, []byte(alreadyUploaded+archiveNew), 0600); err != nil {- t.Fatal(err)- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{- FileOffsets: map[string]int64{logPath: int64(len(alreadyUploaded))},- FileIDs: map[string]string{filepath.Join(dir, "other.jsonl"): "dev:ino"},- }, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 1 || batches[0].Cursor.LogPath != archivePath {- t.Fatalf("unexpected batches: %#v", batches)- }- if string(batches[0].Events[0]) != "{\"event\":\"archive-new\"}" {- t.Fatalf("archive event = %s", batches[0].Events[0])- }-}--func TestEndpointSourceDoesNotApplyLegacyActiveOffsetWhenActiveFileIDConflicts(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- archivePath := logPath + ".1"- alreadyUploaded := "{\"event\":\"already-uploaded\"}\n"- archiveNew := "{\"event\":\"archive-new\"}\n"- if err := os.WriteFile(archivePath, []byte(alreadyUploaded+archiveNew), 0600); err != nil {- t.Fatal(err)- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{- FileOffsets: map[string]int64{logPath: int64(len(alreadyUploaded))},- FileIDs: map[string]string{logPath: "different-file"},- }, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 1 || batches[0].Cursor.LogPath != archivePath {- t.Fatalf("unexpected batches: %#v", batches)- }- if len(batches[0].Events) != 2 || string(batches[0].Events[0]) != "{\"event\":\"already-uploaded\"}" {- t.Fatalf("archive batch should start at zero when active file identity conflicts: %#v", batches[0])- }-}--func TestEndpointSourceReadsRotatedArchivesOldestFirst(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- files := map[string]string{- logPath + ".10": "{\"event\":\"oldest\"}\n",- logPath + ".3": "{\"event\":\"older\"}\n",- logPath + ".2": "{\"event\":\"middle\"}\n",- logPath + ".1": "{\"event\":\"newer\"}\n",- logPath: "{\"event\":\"active\"}\n",- }- for path, content := range files {- if err := os.WriteFile(path, []byte(content), 0600); err != nil {- t.Fatalf("write %s: %v", path, err)- }- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{FileOffsets: map[string]int64{}}, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 5 {- t.Fatalf("len(batches) = %d, want 5: %#v", len(batches), batches)- }- wantArchives := []string{"runtime.jsonl.10", "runtime.jsonl.3", "runtime.jsonl.2", "runtime.jsonl.1", ""}- wantEvents := []string{- "{\"event\":\"oldest\"}",- "{\"event\":\"older\"}",- "{\"event\":\"middle\"}",- "{\"event\":\"newer\"}",- "{\"event\":\"active\"}",- }- for i := range batches {- if batches[i].Cursor.Archive != wantArchives[i] {- t.Fatalf("batch %d archive = %q, want %q", i, batches[i].Cursor.Archive, wantArchives[i])- }- if string(batches[i].Events[0]) != wantEvents[i] {- t.Fatalf("batch %d event = %s, want %s", i, batches[i].Events[0], wantEvents[i])- }- }-}--func TestEndpointSourceIgnoresWriterLockFile(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- if err := os.WriteFile(logPath+".lock", []byte("not-json\n"), 0600); err != nil {- t.Fatal(err)- }- if err := os.WriteFile(logPath, []byte("{\"event\":\"active\"}\n"), 0600); err != nil {- t.Fatal(err)- }-- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{FileOffsets: map[string]int64{}}, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 1 {- t.Fatalf("len(batches) = %d, want 1: %#v", len(batches), batches)- }- if batches[0].Cursor.LogPath != logPath || batches[0].Cursor.Archive != "" {- t.Fatalf("unexpected active cursor: %#v", batches[0].Cursor)- }- if batches[0].Rejected != 0 {- t.Fatalf("Rejected = %d, want 0", batches[0].Rejected)- }- if string(batches[0].Events[0]) != "{\"event\":\"active\"}" {- t.Fatalf("event = %s", batches[0].Events[0])- }-}--func TestEndpointSourceFollowsSavedOffsetAcrossArchiveRenumbering(t *testing.T) {- dir := t.TempDir()- logPath := filepath.Join(dir, "runtime.jsonl")- savedPath := logPath + ".1"- renumberedPath := logPath + ".2"- first := "{\"event\":\"one\"}\n"- second := "{\"event\":\"two\"}\n"- if err := os.WriteFile(renumberedPath, []byte(first+second), 0600); err != nil {- t.Fatal(err)- }-- // Identity is read from an open handle, not from a path: on Windows the file index is only- // reachable that way, and a FileInfo carries no equivalent.- handle, err := os.Open(renumberedPath)- if err != nil {- t.Fatal(err)- }- info, err := handle.Stat()- if err != nil {- t.Fatal(err)- }- identity := fileIdentity(handle, info)- if err := handle.Close(); err != nil {- t.Fatal(err)- }- if identity == "" {- t.Fatal("file identity is empty, so this test cannot check that an offset follows a rotated file")- }- source := NewSource(endpointconfig.Config{UserMode: true, LogPath: logPath}, logPath, true)- batches, err := source.Batches(ingest.State{- FileOffsets: map[string]int64{savedPath: int64(len(first))},- FileIDs: map[string]string{savedPath: identity},- }, 500, 1024)- if err != nil {- t.Fatal(err)- }-- if len(batches) != 1 || len(batches[0].Events) != 1 {- t.Fatalf("unexpected batches: %#v", batches)- }- if batches[0].Cursor.LogPath != renumberedPath || string(batches[0].Events[0]) != "{\"event\":\"two\"}" {- t.Fatalf("unexpected renumbered archive batch: %#v", batches[0])- }- if batches[0].Cursor.FileID == "" {- t.Fatalf("missing file identity on cursor: %#v", batches[0].Cursor)- }-}diff --git a/cli/beacon/internal/ingest/endpoint/source.go b/cli/beacon/internal/ingest/endpoint/source.godeleted file mode 100644index 4c5a2f25..00000000--- a/cli/beacon/internal/ingest/endpoint/source.go+++ /dev/null@@ -1,90 +0,0 @@-package endpoint--import (- "crypto/sha256"- "encoding/hex"- "fmt"- "os"- "path/filepath"- "strings"-- endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config"- "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/ingest"-)--const stateFileName = "upload-state.json"--type Source struct {- cfg endpointconfig.Config- logPath string- userMode bool-}--func NewSource(cfg endpointconfig.Config, logPath string, userMode bool) Source {- return Source{- cfg: cfg,- logPath: logPath,- userMode: userMode,- }-}--func Settings(cfg endpointconfig.Config, logPath string, userMode bool) ingest.Settings {- managed := cfg.ManagedUpload- settings := ingest.Settings{- SourceID: sourceID(cfg, logPath, userMode),- ContentRetention: contentRetention(managed),- }- if managed == nil {- return settings- }- settings.Enabled = managed.Enabled- settings.Managed = managed.Managed- settings.IngestURL = strings.TrimSpace(managed.IngestURL)- return settings-}--func Store(userMode bool) ingest.Store {- return ingest.Store{Path: filepath.Join(endpointconfig.BaseDir(userMode), "managed", stateFileName)}-}--func (s Source) Metadata() ingest.SourceMetadata {- settings := Settings(s.cfg, s.logPath, s.userMode)- return ingest.SourceMetadata{- SourceID: settings.SourceID,- Hostname: hostname(),- EndpointMode: endpointMode(s.userMode),- LogPath: s.logPath,- ContentRetention: settings.ContentRetention,- ManagedMode: settings.Managed,- }-}--func sourceID(cfg endpointconfig.Config, logPath string, userMode bool) string {- if cfg.ManagedUpload != nil && strings.TrimSpace(cfg.ManagedUpload.SourceID) != "" {- return strings.TrimSpace(cfg.ManagedUpload.SourceID)- }- sum := sha256.Sum256([]byte(fmt.Sprintf("%t|%s", userMode, logPath)))- return "beacon-local-" + hex.EncodeToString(sum[:])[:32]-}--func hostname() string {- name, err := os.Hostname()- if err != nil {- return ""- }- return name-}--func endpointMode(userMode bool) string {- if userMode {- return "user"- }- return "system"-}--func contentRetention(cfg *endpointconfig.ManagedUpload) string {- if cfg == nil || strings.TrimSpace(cfg.ContentRetention) == "" {- return "redacted"- }- return strings.TrimSpace(cfg.ContentRetention)-}diff --git a/cli/beacon/internal/ingest/status.go b/cli/beacon/internal/ingest/status.godeleted file mode 100644index 9be81c76..00000000--- a/cli/beacon/internal/ingest/status.go+++ /dev/null@@ -1,26 +0,0 @@-package ingest--import beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"--func Status(settings Settings, store Store, creds *beaconauth.Credentials) State {- state := store.Load()- applyRuntimeState(&state, settings, creds)- return state-}--func applyRuntimeState(state *State, settings Settings, creds *beaconauth.Credentials) {- state.Enabled = settings.Enabled- state.Managed = settings.Managed- state.SourceID = settings.SourceID- state.LoggedIn = creds != nil && creds.Token != "" && !creds.IsExpired()- if creds != nil {- state.UserEmail = creds.Email- state.OrgName = creds.OrgName- }- if state.FileOffsets == nil {- state.FileOffsets = map[string]int64{}- }- if state.FileIDs == nil {- state.FileIDs = map[string]string{}- }-}diff --git a/cli/beacon/internal/ingest/store.go b/cli/beacon/internal/ingest/store.godeleted file mode 100644index a2f5e6f8..00000000--- a/cli/beacon/internal/ingest/store.go+++ /dev/null@@ -1,50 +0,0 @@-package ingest--import (- "encoding/json"- "os"- "path/filepath"-)--type Store struct {- Path string-}--func (s Store) Load() State {- data, err := os.ReadFile(s.Path)- if err != nil {- return emptyState()- }- var state State- if err := json.Unmarshal(data, &state); err != nil {- return emptyState()- }- if state.FileOffsets == nil {- state.FileOffsets = map[string]int64{}- }- if state.FileIDs == nil {- state.FileIDs = map[string]string{}- }- return state-}--func (s Store) Save(state State) error {- if state.FileOffsets == nil {- state.FileOffsets = map[string]int64{}- }- if state.FileIDs == nil {- state.FileIDs = map[string]string{}- }- if err := os.MkdirAll(filepath.Dir(s.Path), 0700); err != nil {- return err- }- data, err := json.MarshalIndent(state, "", " ")- if err != nil {- return err- }- return os.WriteFile(s.Path, data, 0600)-}--func emptyState() State {- return State{FileOffsets: map[string]int64{}, FileIDs: map[string]string{}}-}diff --git a/cli/beacon/internal/ingest/types.go b/cli/beacon/internal/ingest/types.godeleted file mode 100644index a27fff57..00000000--- a/cli/beacon/internal/ingest/types.go+++ /dev/null@@ -1,102 +0,0 @@-package ingest--import (- "encoding/json"- "net/http"-- beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"-)--const (- DefaultBatchEvents = 500- DefaultBatchBytes = 1024 * 1024-)--type Settings struct {- Enabled bool- Managed bool- IngestURL string- SourceID string- ContentRetention string-}--type State struct {- Enabled bool `json:"enabled"`- Managed bool `json:"managed"`- LoggedIn bool `json:"logged_in"`- UserEmail string `json:"user_email,omitempty"`- OrgName string `json:"org_name,omitempty"`- SourceID string `json:"source_id,omitempty"`- LastUploadAt string `json:"last_upload_at,omitempty"`- LastEventAt string `json:"last_event_at,omitempty"`- LastCursor Cursor `json:"last_cursor,omitempty"`- AcceptedCount int `json:"accepted_count"`- RejectedCount int `json:"rejected_count"`- LastError string `json:"last_error,omitempty"`- FileOffsets map[string]int64 `json:"file_offsets,omitempty"`- FileIDs map[string]string `json:"file_ids,omitempty"`- UpdatedAt string `json:"updated_at,omitempty"`-}--type Cursor struct {- LogPath string `json:"log_path,omitempty"`- Offset int64 `json:"offset,omitempty"`- Line int `json:"line,omitempty"`- Archive string `json:"archive,omitempty"`- FileID string `json:"-"`-}--type SourceMetadata struct {- SourceID string- Hostname string- EndpointMode string- LogPath string- ContentRetention string- ManagedMode bool-}--type Batch struct {- Cursor Cursor- Events []json.RawMessage- Rejected int-}--type Source interface {- Metadata() SourceMetadata- Batches(state State, maxEvents int, maxBytes int) ([]Batch, error)-}--type Options struct {- Settings Settings- Creds *beaconauth.Credentials- Store Store- Client Client- Source Source- HTTPClient *http.Client-}--type Result struct {- State State- Uploaded bool-}--type uploadRequest struct {- UploadID string `json:"upload_id"`- Source uploadSource `json:"source"`- Cursor Cursor `json:"cursor"`- Events []json.RawMessage `json:"events"`-}--type uploadSource struct {- SourceID string `json:"source_id,omitempty"`- Hostname string `json:"hostname,omitempty"`- EndpointMode string `json:"endpoint_mode"`- LogPath string `json:"log_path,omitempty"`- ContentRetention string `json:"content_retention"`- ManagedMode bool `json:"managed_mode"`-}--type uploadResponse struct {- Accepted int `json:"accepted"`- Rejected int `json:"rejected"`-}diff --git a/cli/beacon/internal/ingest/upload.go b/cli/beacon/internal/ingest/upload.godeleted file mode 100644index 9f887ef8..00000000--- a/cli/beacon/internal/ingest/upload.go+++ /dev/null@@ -1,96 +0,0 @@-package ingest--import (- "context"- "crypto/sha256"- "encoding/hex"- "fmt"- "time"-)--func Upload(ctx context.Context, opts Options) Result {- state := opts.Store.Load()- applyRuntimeState(&state, opts.Settings, opts.Creds)-- if !state.Enabled || !state.Managed {- state.LastError = ""- _ = opts.Store.Save(state)- return Result{State: state}- }- if opts.Creds == nil || opts.Creds.Token == "" || opts.Creds.IsExpired() {- state.LastError = "run beacon login before endpoint ingest upload"- _ = opts.Store.Save(state)- return Result{State: state}- }- if opts.Source == nil {- state.LastError = "endpoint ingest source is not configured"- _ = opts.Store.Save(state)- return Result{State: state}- }-- client := opts.Client- if client.URL == "" || client.HTTPClient == nil {- client = NewClient(opts.Settings.IngestURL, opts.HTTPClient)- }-- batches, err := opts.Source.Batches(state, DefaultBatchEvents, DefaultBatchBytes)- if err != nil {- state.LastError = err.Error()- _ = opts.Store.Save(state)- return Result{State: state}- }- state.LastError = ""-- uploaded := false- for _, batch := range batches {- if len(batch.Events) == 0 {- state.RejectedCount += batch.Rejected- state.FileOffsets[batch.Cursor.LogPath] = batch.Cursor.Offset- if batch.Cursor.FileID != "" {- state.FileIDs[batch.Cursor.LogPath] = batch.Cursor.FileID- }- continue- }- response, err := client.UploadBatch(ctx, opts.Creds.Token, uploadRequest{- UploadID: uploadID(state.SourceID, batch.Cursor.LogPath, batch.Cursor.Offset),- Source: uploadSourceFromMetadata(opts.Source.Metadata()),- Cursor: batch.Cursor,- Events: batch.Events,- })- if err != nil {- state.LastError = err.Error()- break- }- now := time.Now().UTC().Format(time.RFC3339)- state.AcceptedCount += response.Accepted- state.RejectedCount += batch.Rejected + response.Rejected- state.LastUploadAt = now- state.LastEventAt = now- state.LastCursor = batch.Cursor- state.FileOffsets[batch.Cursor.LogPath] = batch.Cursor.Offset- if batch.Cursor.FileID != "" {- state.FileIDs[batch.Cursor.LogPath] = batch.Cursor.FileID- }- state.LastError = ""- uploaded = true- }- state.UpdatedAt = time.Now().UTC().Format(time.RFC3339)- _ = opts.Store.Save(state)- return Result{State: state, Uploaded: uploaded}-}--func uploadSourceFromMetadata(metadata SourceMetadata) uploadSource {- return uploadSource{- SourceID: metadata.SourceID,- Hostname: metadata.Hostname,- EndpointMode: metadata.EndpointMode,- LogPath: metadata.LogPath,- ContentRetention: metadata.ContentRetention,- ManagedMode: metadata.ManagedMode,- }-}--func uploadID(sourceID, path string, offset int64) string {- sum := sha256.Sum256([]byte(fmt.Sprintf("%s|%s|%d", sourceID, path, offset)))- return hex.EncodeToString(sum[:])-}diff --git a/cli/beacon/internal/ingest/upload_test.go b/cli/beacon/internal/ingest/upload_test.godeleted file mode 100644index 39692bf3..00000000--- a/cli/beacon/internal/ingest/upload_test.go+++ /dev/null@@ -1,291 +0,0 @@-package ingest--import (- "context"- "encoding/json"- "net/http"- "net/http/httptest"- "os"- "path/filepath"- "strings"- "testing"-- beaconauth "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/auth"-)--type fakeSource struct {- metadata SourceMetadata- batches []Batch- called bool-}--func (s *fakeSource) Metadata() SourceMetadata {- return s.metadata-}--func (s *fakeSource) Batches(state State, maxEvents int, maxBytes int) ([]Batch, error) {- s.called = true- return s.batches, nil-}--func TestStatusIsReadOnly(t *testing.T) {- statePath := filepath.Join(t.TempDir(), "upload-state.json")- state := Status(Settings{Enabled: true, Managed: true, SourceID: "source-1"}, Store{Path: statePath}, &beaconauth.Credentials{- Token: "token",- UserID: "user",- Email: "[email protected]",- })-- if !state.Enabled || !state.Managed || !state.LoggedIn || state.SourceID != "source-1" {- t.Fatalf("unexpected status: %#v", state)- }- if _, err := os.Stat(statePath); !os.IsNotExist(err) {- t.Fatalf("Status wrote state file, err=%v", err)- }-}--func TestUploadIsInertUnlessManagedEnabled(t *testing.T) {- source := &fakeSource{}- res := Upload(context.Background(), Options{- Settings: Settings{Enabled: false, Managed: false},- Store: Store{Path: filepath.Join(t.TempDir(), "upload-state.json")},- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- })-- if source.called {- t.Fatal("disabled upload should not read source batches")- }- if res.Uploaded || res.State.AcceptedCount != 0 || res.State.LastUploadAt != "" {- t.Fatalf("disabled upload should not send events: %#v", res.State)- }-}--func TestUploadRequiresLogin(t *testing.T) {- source := &fakeSource{}- res := Upload(context.Background(), Options{- Settings: Settings{Enabled: true, Managed: true, SourceID: "source-1"},- Store: Store{Path: filepath.Join(t.TempDir(), "upload-state.json")},- Source: source,- })-- if source.called {- t.Fatal("upload without login should not read source batches")- }- if res.State.LastError == "" {- t.Fatalf("expected login error: %#v", res.State)- }-}--func TestUploadPostsBatchAndPersistsCursor(t *testing.T) {- var received uploadRequest- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {- if got := r.Header.Get("Authorization"); got != "Bearer token" {- t.Fatalf("Authorization = %q, want bearer token", got)- }- if err := json.NewDecoder(r.Body).Decode(&received); err != nil {- t.Fatal(err)- }- _, _ = w.Write([]byte(`{"accepted":1,"rejected":0}`))- }))- defer server.Close()-- statePath := filepath.Join(t.TempDir(), "upload-state.json")- source := &fakeSource{- metadata: SourceMetadata{SourceID: "source-1", EndpointMode: "user", LogPath: "runtime.jsonl", ContentRetention: "redacted", ManagedMode: true},- batches: []Batch{{- Cursor: Cursor{LogPath: "runtime.jsonl", Offset: 128, Line: 1, FileID: "dev:ino"},- Events: []json.RawMessage{json.RawMessage(`{"event":"ok"}`)},- }},- }- res := Upload(context.Background(), Options{- Settings: Settings{Enabled: true, Managed: true, SourceID: "source-1", IngestURL: server.URL},- Store: Store{Path: statePath},- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- })-- if res.State.LastError != "" {- t.Fatalf("LastError = %q", res.State.LastError)- }- if !res.Uploaded || res.State.AcceptedCount != 1 || res.State.FileOffsets["runtime.jsonl"] != 128 {- t.Fatalf("unexpected upload state: %#v", res.State)- }- if res.State.FileIDs["runtime.jsonl"] != "dev:ino" {- t.Fatalf("file identity not persisted: %#v", res.State.FileIDs)- }- if received.Source.SourceID != "source-1" || !received.Source.ManagedMode || len(received.Events) != 1 {- t.Fatalf("unexpected request: %#v", received)- }- if _, err := os.Stat(statePath); err != nil {- t.Fatalf("state file not written: %v", err)- }-}--func TestUploadClearsStaleErrorWhenNoBatchesRemain(t *testing.T) {- statePath := filepath.Join(t.TempDir(), "upload-state.json")- store := Store{Path: statePath}- if err := store.Save(State{LastError: "run beacon login before endpoint ingest upload"}); err != nil {- t.Fatal(err)- }-- source := &fakeSource{- metadata: SourceMetadata{SourceID: "source-1", EndpointMode: "user", LogPath: "runtime.jsonl", ContentRetention: "redacted", ManagedMode: true},- }- res := Upload(context.Background(), Options{- Settings: Settings{Enabled: true, Managed: true, SourceID: "source-1"},- Store: store,- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- })-- if !source.called {- t.Fatal("upload should check source batches")- }- if res.Uploaded {- t.Fatalf("no batches should not mark upload as sent: %#v", res.State)- }- if res.State.LastError != "" {- t.Fatalf("LastError = %q", res.State.LastError)- }- if stored := store.Load(); stored.LastError != "" {- t.Fatalf("persisted LastError = %q", stored.LastError)- }-}--func TestUploadDoesNotAdvanceCursorOnFailedPost(t *testing.T) {- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {- http.Error(w, "nope", http.StatusInternalServerError)- }))- defer server.Close()-- source := &fakeSource{- metadata: SourceMetadata{SourceID: "source-1", EndpointMode: "user", LogPath: "runtime.jsonl", ContentRetention: "redacted", ManagedMode: true},- batches: []Batch{{- Cursor: Cursor{LogPath: "runtime.jsonl", Offset: 128, Line: 1},- Events: []json.RawMessage{json.RawMessage(`{"event":"ok"}`)},- }},- }- res := Upload(context.Background(), Options{- Settings: Settings{Enabled: true, Managed: true, SourceID: "source-1", IngestURL: server.URL},- Store: Store{Path: filepath.Join(t.TempDir(), "upload-state.json")},- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- })-- if res.State.LastError == "" {- t.Fatal("expected upload error")- }- if res.State.FileOffsets["runtime.jsonl"] != 0 || res.State.LastCursor.Offset != 0 {- t.Fatalf("cursor advanced on failed post: %#v", res.State)- }-}--func TestUploadDoesNotAdvanceCursorWhenResponseDoesNotAccountForBatch(t *testing.T) {- tests := []struct {- name string- body string- want string- }{- {name: "empty body", body: "", want: "response was empty"},- {name: "zero counts", body: `{}`, want: "accounted for 0 events, want 1"},- }-- for _, tt := range tests {- t.Run(tt.name, func(t *testing.T) {- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {- _, _ = w.Write([]byte(tt.body))- }))- defer server.Close()-- source := &fakeSource{- metadata: SourceMetadata{SourceID: "source-1", EndpointMode: "user", LogPath: "runtime.jsonl", ContentRetention: "redacted", ManagedMode: true},- batches: []Batch{{- Cursor: Cursor{LogPath: "runtime.jsonl", Offset: 128, Line: 1},- Events: []json.RawMessage{json.RawMessage(`{"event":"ok"}`)},- }},- }- res := Upload(context.Background(), Options{- Settings: Settings{Enabled: true, Managed: true, SourceID: "source-1", IngestURL: server.URL},- Store: Store{Path: filepath.Join(t.TempDir(), "upload-state.json")},- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- })-- if res.Uploaded {- t.Fatalf("invalid response should not mark upload as sent: %#v", res.State)- }- if !strings.Contains(res.State.LastError, tt.want) {- t.Fatalf("LastError = %q, want containing %q", res.State.LastError, tt.want)- }- if res.State.AcceptedCount != 0 || res.State.RejectedCount != 0 {- t.Fatalf("counts changed on invalid response: %#v", res.State)- }- if res.State.FileOffsets["runtime.jsonl"] != 0 || res.State.LastCursor.Offset != 0 {- t.Fatalf("cursor advanced on invalid response: %#v", res.State)- }- })- }-}--func TestUploadDoesNotDoubleCountMalformedLinesOnFailedPostRetry(t *testing.T) {- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {- http.Error(w, "nope", http.StatusInternalServerError)- }))- defer server.Close()-- store := Store{Path: filepath.Join(t.TempDir(), "upload-state.json")}- source := &fakeSource{- metadata: SourceMetadata{SourceID: "source-1", EndpointMode: "user", LogPath: "runtime.jsonl", ContentRetention: "redacted", ManagedMode: true},- batches: []Batch{{- Cursor: Cursor{LogPath: "runtime.jsonl", Offset: 128, Line: 2},- Events: []json.RawMessage{json.RawMessage(`{"event":"ok"}`)},- Rejected: 1,- }},- }- opts := Options{- Settings: Settings{Enabled: true, Managed: true, SourceID: "source-1", IngestURL: server.URL},- Store: store,- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- }-- first := Upload(context.Background(), opts)- second := Upload(context.Background(), opts)-- if first.State.LastError == "" || second.State.LastError == "" {- t.Fatalf("expected upload errors: first=%#v second=%#v", first.State, second.State)- }- if second.State.FileOffsets["runtime.jsonl"] != 0 || second.State.LastCursor.Offset != 0 {- t.Fatalf("cursor advanced on failed post retry: %#v", second.State)- }- if second.State.RejectedCount != 0 {- t.Fatalf("RejectedCount = %d, want 0 before cursor advances", second.State.RejectedCount)- }-}--func TestUploadCountsMalformedLinesWhenCursorAdvancesWithoutPost(t *testing.T) {- source := &fakeSource{- metadata: SourceMetadata{SourceID: "source-1", EndpointMode: "user", LogPath: "runtime.jsonl", ContentRetention: "redacted", ManagedMode: true},- batches: []Batch{{- Cursor: Cursor{LogPath: "runtime.jsonl", Offset: 128, Line: 1},- Rejected: 2,- }},- }- res := Upload(context.Background(), Options{- Settings: Settings{Enabled: true, Managed: true, SourceID: "source-1"},- Store: Store{Path: filepath.Join(t.TempDir(), "upload-state.json")},- Creds: &beaconauth.Credentials{Token: "token", UserID: "user"},- Source: source,- })-- if res.Uploaded {- t.Fatalf("rejected-only batch should not mark upload as sent: %#v", res.State)- }- if res.State.FileOffsets["runtime.jsonl"] != 128 {- t.Fatalf("cursor did not advance for rejected-only batch: %#v", res.State)- }- if res.State.RejectedCount != 2 {- t.Fatalf("RejectedCount = %d, want 2", res.State.RejectedCount)- }-}diff --git a/docs/changelog/cli.mdx b/docs/changelog/cli.mdxindex 4bc1ea6c..6f7aa499 100644--- a/docs/changelog/cli.mdx+++ b/docs/changelog/cli.mdx@@ -9,6 +9,18 @@ Stay up to date with the latest changes to the Agent Beacon CLI.---+## September 2026++### Unreleased++- **Removed `beacon login` and `beacon ingest`** · Neither command was ever+ connected to a server: `beacon ingest endpoint upload` had nothing to upload+ to and `beacon login` saved credentials nothing consumed. `beacon endpoint+ status` no longer prints an "Endpoint ingest" line and its JSON output drops+ `managed_upload`; a `managed_upload` block in `config.json` is ignored.+ Forwarding to Asymptote returns as an explicit, revocable Vector destination+ set up by `beacon endpoint connect` in an upcoming release.+## August 2026### v1.2.7 · August 31, 2026diff --git a/docs/cli/index.mdx b/docs/cli/index.mdxindex abd96a00..4f86fde6 100644--- a/docs/cli/index.mdx+++ b/docs/cli/index.mdx@@ -37,9 +37,7 @@ Top-level Agent Beacon CLI commands.| [`beacon cloud`](/cli/cloud) | Configure provider-managed cloud agent telemetry setup helpers. || [`beacon doctor`](/cli/endpoint-doctor) | Alias for `beacon endpoint doctor`. || [`beacon endpoint`](/cli/endpoint) | Manage local endpoint telemetry, runtime logs, and integrations. |-| [`beacon ingest`](/cli/ingest) | Upload Beacon telemetry to configured ingest destinations. || [`beacon inventory`](/cli/endpoint-inventory) | Alias for `beacon endpoint inventory`. |-| [`beacon login`](/cli/login) | Log in to the Asymptote dashboard from the Beacon CLI. || [`beacon mcp`](/cli/mcp) | Expose local Beacon activity to MCP clients. || [`beacon rules`](/cli/rules) | Manage and author Beacon threat-detection rules. || [`beacon scan`](/cli/scan) | Run threat-detection rules over local endpoint telemetry. |@@ -134,20 +132,6 @@ Expose local Beacon runtime activity through MCP.| [`beacon mcp serve`](/cli/mcp-serve) | Run the local Beacon MCP server over stdio or loopback HTTP JSON-RPC. || [`beacon mcp doctor`](/cli/mcp-doctor) | Validate local Beacon MCP setup and print client configuration. |-## beacon ingest--```bash title="Command syntax"-beacon ingest [command]-```--Upload Beacon telemetry to configured ingest destinations.--| Command | Description |-|---------|-------------|-| [`beacon ingest status`](/cli/ingest#beacon-ingest-status) | Show configured ingest status. |-| [`beacon ingest endpoint status`](/cli/ingest-endpoint#beacon-ingest-endpoint-status) | Show endpoint telemetry upload status. |-| [`beacon ingest endpoint upload`](/cli/ingest-endpoint#beacon-ingest-endpoint-upload) | Upload endpoint telemetry to managed ingest. |-## beacon endpoint```bash title="Command syntax"diff --git a/docs/cli/ingest-endpoint.mdx b/docs/cli/ingest-endpoint.mdxdeleted file mode 100644index e6a40d3a..00000000--- a/docs/cli/ingest-endpoint.mdx+++ /dev/null@@ -1,85 +0,0 @@-----title: "beacon ingest endpoint"-description: "Check and upload endpoint telemetry for managed ingest"------## Command overview--`beacon ingest endpoint` manages endpoint telemetry uploads to Asymptote Managed ingest.--```bash title="Command syntax"-beacon ingest endpoint [command]-```--Use this command group when endpoint ingest is configured and you need to inspect upload state or trigger an upload from the local runtime log.--<Note>- Endpoint ingest requires dashboard credentials from `beacon login` and endpoint ingest configuration. Beacon endpoint collection remains local-only unless managed ingest is configured and endpoint upload commands are used.-</Note>--## Commands--<Columns cols={2}>- <Card title="status" icon="circle-info" href="#beacon-ingest-endpoint-status">- Show endpoint telemetry upload status.- </Card>- <Card title="upload" icon="cloud-arrow-up" href="#beacon-ingest-endpoint-upload">- Upload endpoint telemetry to managed ingest.- </Card>-</Columns>--## Flags--| Flag | Description |-|------|-------------|-| `--user` | Use per-user endpoint paths. Enabled by default |-| `--system` | Use system endpoint paths and launch daemon |-| `--log-path <path>` | Runtime JSONL log path |-| `--json` | Print output as JSON |--## beacon ingest endpoint status--`beacon ingest endpoint status` prints endpoint telemetry upload status, including whether ingest is enabled, whether it is managed, whether the CLI is logged in, upload cursor position, accepted and rejected counts, and the last upload error when present.--```bash title="Show endpoint ingest status"-beacon ingest endpoint status-```--Check status for a system-mode endpoint:--```bash title="Show system endpoint ingest status"-sudo beacon ingest endpoint status --system-```--Print machine-readable endpoint ingest status:--```bash title="Print JSON"-beacon ingest endpoint status --json-```--## beacon ingest endpoint upload--`beacon ingest endpoint upload` uploads endpoint telemetry from the runtime log to managed ingest.--```bash title="Upload endpoint telemetry"-beacon ingest endpoint upload-```--Upload from an explicit runtime log:--```bash title="Upload from a runtime log"-beacon ingest endpoint upload --log-path /var/log/beacon-agent/runtime.jsonl-```--When the upload completes, Beacon prints the updated ingest state. If managed ingest is enabled and the upload is rejected or fails, the command exits with an error and includes the latest ingest error in the status output.--## Related--<Columns cols={2}>- <Card title="beacon ingest" icon="cloud-arrow-up" href="/cli/ingest">- Review the managed ingest command group.- </Card>- <Card title="Endpoint config" icon="gear" href="/cli/endpoint-config">- Inspect and validate local endpoint configuration.- </Card>-</Columns>diff --git a/docs/cli/ingest.mdx b/docs/cli/ingest.mdxdeleted file mode 100644index d9b542f2..00000000--- a/docs/cli/ingest.mdx+++ /dev/null@@ -1,73 +0,0 @@-----title: "beacon ingest"-description: "Upload Beacon telemetry to configured ingest destinations"-tag: "Enterprise"------## Command overview--`beacon ingest` shows managed ingest status and uploads endpoint telemetry to configured Asymptote Managed destinations.--```bash title="Command syntax"-beacon ingest [command]-```--Use these commands when an endpoint is configured for managed ingest and you need to verify upload state or trigger an upload from the local runtime log.--<Note>- Managed ingest requires dashboard credentials from `beacon login` and endpoint ingest configuration. Local endpoint collection remains local-only unless managed ingest is configured and upload commands are used.-</Note>--## Commands--<Columns cols={2}>- <Card title="status" icon="circle-info" href="#beacon-ingest-status">- Show configured ingest status across ingest sources.- </Card>- <Card title="endpoint" icon="desktop" href="/cli/ingest-endpoint">- Check and upload endpoint telemetry for managed ingest.- </Card>-</Columns>--## Shared flags--`beacon ingest status`, `beacon ingest endpoint status`, and `beacon ingest endpoint upload` accept the same endpoint selection and output flags.--| Flag | Description |-|------|-------------|-| `--user` | Use per-user endpoint paths. Enabled by default |-| `--system` | Use system endpoint paths and launch daemon |-| `--log-path <path>` | Runtime JSONL log path |-| `--json` | Print output as JSON |--## beacon ingest status--`beacon ingest status` prints configured ingest status across ingest sources.--```bash title="Show ingest status"-beacon ingest status-```--Example output:--```bash title="Example output"-Beacon ingest-Endpoint: enabled=true managed=true logged_in=true accepted=0 rejected=0-```--Print machine-readable status:--```bash title="Print JSON"-beacon ingest status --json-```--## Related--<Columns cols={2}>- <Card title="Endpoint ingest" icon="desktop" href="/cli/ingest-endpoint">- Check endpoint upload status and upload local runtime events.- </Card>- <Card title="beacon login" icon="key" href="/cli/login">- Authenticate the Beacon CLI with your Asymptote dashboard account.- </Card>-</Columns>diff --git a/docs/cli/login.mdx b/docs/cli/login.mdxdeleted file mode 100644index cd0fd094..00000000--- a/docs/cli/login.mdx+++ /dev/null@@ -1,67 +0,0 @@-----title: "beacon login"-description: "Log in to the Asymptote dashboard from the Beacon CLI"-tag: "Enterprise"------## Command overview--Authenticate the Beacon CLI with your Asymptote dashboard account. The command opens a browser-based authorization flow and saves credentials for Beacon features that need dashboard access.--```bash title="Command syntax"-beacon login [flags]-```--<Accordion title="Example output">-```bash title="Example output"-$ beacon login--Opening browser to https://asymptotelabs.ai/cli/auth...-Waiting for authentication...--Success! Logged in as [email protected]-Organization: Acme Corp--Beacon endpoint telemetry remains local-only unless you explicitly use cloud features.-```-</Accordion>--If the browser cannot be opened automatically, Beacon prints the authorization URL so you can open it manually.--Credentials are stored in `~/.beacon/auth/credentials.json` with user-only file permissions.--<Note>- Logging in does not change local endpoint telemetry collection. Beacon endpoint telemetry remains local-only unless you explicitly configure cloud features.-</Note>--## Existing sessions--When valid credentials already exist, `beacon login` prints the saved account and organization instead of replacing them:--```bash title="Existing session"-$ beacon login-Already logged in as [email protected]-Organization: Acme Corp-Run 'beacon login --force' to log in as a different user.-```--Use `--force` when you need to replace saved credentials.--## Flags--| Flag | Description |-|------|-------------|-| `--dashboard-url <url>` | Asymptote dashboard URL. Defaults to `https://asymptotelabs.ai`, or the value of `BEACON_DASHBOARD_URL`. |-| `--force` | Replace existing saved credentials. |-| `-h, --help` | Help for login |--## Related--<Columns cols={2}>- <Card title="beacon cloud" icon="cloud" href="/cli/cloud">- Configure cloud-agent telemetry features that may use dashboard authentication.- </Card>- <Card title="beacon version" icon="code-branch" href="/cli/version">- Check your installed Beacon CLI version.- </Card>-</Columns>diff --git a/docs/docs.json b/docs/docs.jsonindex 8f4202c2..b99ac222 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -398,15 +398,6 @@}]},- {- "group": "beacon ingest",- "root": "cli/ingest",- "tag": "Enterprise",- "pages": [- "cli/ingest-endpoint"- ]- },- "cli/login",{"group": "beacon mcp","root": "cli/mcp",diff --git a/docs/support/troubleshooting.mdx b/docs/support/troubleshooting.mdxindex 24922d45..ee44f48c 100644--- a/docs/support/troubleshooting.mdx+++ b/docs/support/troubleshooting.mdx@@ -17,9 +17,6 @@ description: "Solutions for common issues when setting up and using Asymptote."<Accordion title="Permission errors on the GitHub App">Re-install the Asymptote GitHub App and ensure the correct repositories are selected. See the [GitHub integration page](/deployment/hosting-options) for a full list of required permissions.</Accordion>- <Accordion title="The CLI isn't authenticating">- Run `asymptote whoami` to check your current auth state. If unauthenticated, run `asymptote login` to re-authenticate. See the [CLI authentication docs](/cli/login) for more details.- </Accordion><Accordion title="My coding agent isn't being intercepted">Ensure Asymptote is configured for your agent. See the [Coding Agent Integrations](/runtimes/cursor) docs for setup instructions for your specific tool.</Accordion>