{"modulePath":"github.com/MiniMax-AI/OpenAgentCore","version":"v0.0.14","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package machineapi\n\nPackage machineapi is the code of the machine connection API: every request and response body of Core's /api/v1 routes. Core's handlers, the daemon and the sandbox node all use these types. The routes, credentials and errors are in contracts/agents-api/machine-api.md.\n\n## Constants\n\n```go\nconst (\n\tConnectionConnected    = \"connected\"\n\tConnectionDisconnected = \"disconnected\"\n)\n```\n\n```go\nconst DefaultHeartbeat = 15 * time.Second\n```\nDefaultHeartbeat applies when Core reports no positive heartbeat\\_seconds. A zero heartbeat would never ping and always hit the 60 second timeout.\n\n```go\nconst InstallGrantEnv = \"OAC_INSTALL_GRANT\"\n```\nInstallGrantEnv names the environment variable that carries the short-lived installation grant from Core's command to the installer. It never carries an executor credential.\n\n## Functions\n\n```go\nfunc CanonicalUUID(value string) bool\n```\nCanonicalUUID reports whether value is a non-nil UUID in canonical lower-case form.\n\n## Types\n\n```go\ntype AuthError struct {\n\tError  string `json:\"error\"`\n\tDetail string `json:\"detail\"`\n}\n```\nAuthError is the body of every failed agent-daemon/bootstrap and agent-daemon/ws request.\n\n```go\ntype BootstrapRequest struct {\n\tDeviceID string `json:\"device_id\"`\n}\n```\nBootstrapRequest is the body of POST agent-daemon/bootstrap.\n\n```go\ntype BootstrapResponse struct {\n\tDeviceID         string `json:\"device_id\"`\n\tWSURL            string `json:\"ws_url\"`\n\tHeartbeatSeconds int    `json:\"heartbeat_seconds\"`\n}\n```\nBootstrapResponse answers POST agent-daemon/bootstrap.\n\n```go\nfunc (b BootstrapResponse) HeartbeatInterval() time.Duration\n```\n\n```go\ntype Connection struct {\n\tEnvironmentID string `json:\"environment_id\"`\n\tStatus        string `json:\"status\"`\n}\n```\nConnection answers GET agent-daemon/connection.\n\n```go\ntype EnrollRequest struct {\n\tEnvironmentID string `json:\"environment_id\"`\n}\n```\nEnrollRequest is the body of POST agent-daemon/enroll.\n\n```go\ntype Enrollment struct {\n\tDeviceID           string `json:\"device_id\"`\n\tEnvironmentID      string `json:\"environment_id\"`\n\tWorkspaceDirectory string `json:\"workspace_directory\"`\n}\n```\nEnrollment answers POST agent-daemon/enroll: the device bound to the Environment.\n\n```go\nfunc (e Enrollment) Validate(environment string) error\n```\nValidate checks that the binding names canonical IDs and the requested Environment.\n\n```go\ntype InstallationClaim struct {\n\tExecutorToken string `json:\"executor_token\"`\n}\n```\nInstallationClaim is the body of POST agent-daemon/installation/claim.\n\n```go\ntype InstallationContext struct {\n\tVersion         string `json:\"version\"`\n\tProtocolVersion string `json:\"protocol_version\"`\n\tEnvironmentID   string `json:\"environment_id\"`\n\tRemoteURL       string `json:\"remote_url\"`\n\tWorkspace       string `json:\"workspace_directory\"`\n\tHarness         string `json:\"harness\"`\n}\n```\nInstallationContext answers POST agent-daemon/installation: the frozen connection constraints of one Session. It is bootstrap metadata, not an execution protocol.\n\n```go\ntype NodeEnrollment struct {\n\tSpecificationDigest  string `json:\"specification_digest\"`\n\tDeploymentGeneration uint64 `json:\"deployment_generation\"`\n\tNodeID               string `json:\"node_id\"`\n\tCredential           string `json:\"credential\"`\n\tName                 string `json:\"name\"`\n\tProvider             string `json:\"provider\"`\n\tBackendFingerprint   string `json:\"backend_fingerprint\"`\n\t// The Core origin this node stores and connects to, such as https://core.example. It must equal the installation public URL; otherwise enrollment gets 409 sandbox_node_address_mismatch and the token stays unused.\n\tCoreURL string `json:\"core_url\"`\n\t// Host measurements as in the node's health reports. Core derives a limit the enrollment token leaves unset from them.\n\tCPUCount           *int64   `json:\"cpu_count,omitempty\"`\n\tEffectiveCPUCores  *float64 `json:\"effective_cpu_cores,omitempty\"`\n\tTotalMemoryBytes   *int64   `json:\"total_memory_bytes,omitempty\"`\n\tAvailableDiskBytes *int64   `json:\"available_disk_bytes,omitempty\"`\n}\n```\nNodeEnrollment is the body of POST sandbox-node/enroll.\n\n```go\ntype NodeIdentity struct {\n\tSpecificationDigest  string `json:\"specification_digest\"`\n\tDeploymentGeneration uint64 `json:\"deployment_generation\"`\n\tNodeID               string `json:\"node_id\"`\n\tInstallationID       string `json:\"installation_id\"`\n\tProvider             string `json:\"provider\"`\n\tMaxActive            int    `json:\"max_active\"`\n\tMaxRetained          int    `json:\"max_retained\"`\n}\n```\nNodeIdentity answers POST sandbox-node/enroll.\n\n```go\ntype NodeStatus struct {\n\tNodeIdentity\n\tConnected     bool `json:\"connected\"`\n\tProviderReady bool `json:\"provider_ready\"`\n}\n```\nNodeStatus answers GET sandbox-node/identity: the authenticated node's identity and Core-owned presence.\n\n","path":"github.com/MiniMax-AI/OpenAgentCore/internal/machineapi","name":"machineapi","synopsis":"Package machineapi is the code of the machine connection API: every request and response body of Core's /api/v1 routes.","isRedistributable":true}
