{"modulePath":"github.com/kernel/kernel-go-sdk","version":"v0.159.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package shared\n\n## Types\n\n```go\ntype AppAction struct {\n\t// Name of the action\n\tName string `json:\"name\" api:\"required\"`\n\t// JSON Schema (draft-07) describing the expected input payload. Null if schema\n\t// could not be automatically generated.\n\tInputSchema map[string]any `json:\"input_schema\" api:\"nullable\"`\n\t// JSON Schema (draft-07) describing the expected output payload. Null if schema\n\t// could not be automatically generated.\n\tOutputSchema map[string]any `json:\"output_schema\" api:\"nullable\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tName         respjson.Field\n\t\tInputSchema  respjson.Field\n\t\tOutputSchema respjson.Field\n\t\tExtraFields  map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\nAn action available on the app\n\n```go\nfunc (r AppAction) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *AppAction) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype BrowserExtension struct {\n\t// Extension ID to load for this browser session\n\tID string `json:\"id\"`\n\t// Extension name to load for this browser session (instead of id). Must be 1-255\n\t// characters, using letters, numbers, dots, underscores, or hyphens.\n\tName string `json:\"name\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tID          respjson.Field\n\t\tName        respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\nExtension selection for the browser session. Provide either id or name of an extension uploaded to Kernel.\n\n```go\nfunc (r BrowserExtension) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r BrowserExtension) ToParam() BrowserExtensionParam\n```\nToParam converts this BrowserExtension to a BrowserExtensionParam.\n\nWarning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BrowserExtensionParam.Overrides()\n\n```go\nfunc (r *BrowserExtension) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype BrowserExtensionParam struct {\n\t// Extension ID to load for this browser session\n\tID param.Opt[string] `json:\"id,omitzero\"`\n\t// Extension name to load for this browser session (instead of id). Must be 1-255\n\t// characters, using letters, numbers, dots, underscores, or hyphens.\n\tName param.Opt[string] `json:\"name,omitzero\"`\n\t// contains filtered or unexported fields\n}\n```\nExtension selection for the browser session. Provide either id or name of an extension uploaded to Kernel.\n\n```go\nfunc (r BrowserExtensionParam) MarshalJSON() (data []byte, err error)\n```\n\n```go\nfunc (r *BrowserExtensionParam) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype BrowserProfileParam struct {\n\t// Profile ID to load for this browser session\n\tID param.Opt[string] `json:\"id,omitzero\"`\n\t// Profile name to load for this browser session (instead of id). Must be 1-255\n\t// characters, using letters, numbers, dots, underscores, or hyphens.\n\tName param.Opt[string] `json:\"name,omitzero\"`\n\t// If true, save changes made during the session back to the profile when the\n\t// session ends.\n\tSaveChanges param.Opt[bool] `json:\"save_changes,omitzero\"`\n\t// contains filtered or unexported fields\n}\n```\nProfile selection for the browser session. Provide either id or name. If specified, the matching profile will be loaded into the browser session. Profiles must be created beforehand.\n\n```go\nfunc (r BrowserProfileParam) MarshalJSON() (data []byte, err error)\n```\n\n```go\nfunc (r *BrowserProfileParam) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype BrowserViewport struct {\n\t// Browser window height in pixels. Any positive integer is accepted; headful\n\t// browsers require at least 64.\n\tHeight int64 `json:\"height\" api:\"required\"`\n\t// Browser window width in pixels. Any positive integer is accepted; headful\n\t// browsers require at least 64.\n\tWidth int64 `json:\"width\" api:\"required\"`\n\t// Display refresh rate in Hz. Any positive integer is accepted; if omitted, GPU\n\t// browsers default to 60 and other browsers derive it from width and height.\n\tRefreshRate int64 `json:\"refresh_rate\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tHeight      respjson.Field\n\t\tWidth       respjson.Field\n\t\tRefreshRate respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\nInitial browser window size in pixels with optional refresh rate. If omitted, image defaults apply (1920x1080@25). For GPU images, the default is 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60, 768x1024@60, 390x844@60. For GPU images, recommended presets use one of these resolutions with refresh rates 60, 30, 25, or 10: 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh\\_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep bandwidth reasonable).\n\n```go\nfunc (r BrowserViewport) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r BrowserViewport) ToParam() BrowserViewportParam\n```\nToParam converts this BrowserViewport to a BrowserViewportParam.\n\nWarning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BrowserViewportParam.Overrides()\n\n```go\nfunc (r *BrowserViewport) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype BrowserViewportParam struct {\n\t// Browser window height in pixels. Any positive integer is accepted; headful\n\t// browsers require at least 64.\n\tHeight int64 `json:\"height\" api:\"required\"`\n\t// Browser window width in pixels. Any positive integer is accepted; headful\n\t// browsers require at least 64.\n\tWidth int64 `json:\"width\" api:\"required\"`\n\t// Display refresh rate in Hz. Any positive integer is accepted; if omitted, GPU\n\t// browsers default to 60 and other browsers derive it from width and height.\n\tRefreshRate param.Opt[int64] `json:\"refresh_rate,omitzero\"`\n\t// contains filtered or unexported fields\n}\n```\nInitial browser window size in pixels with optional refresh rate. If omitted, image defaults apply (1920x1080@25). For GPU images, the default is 1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted. Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60, 768x1024@60, 390x844@60. For GPU images, recommended presets use one of these resolutions with refresh rates 60, 30, 25, or 10: 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768, 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600. Viewports outside this list may exhibit unstable live view or recording behavior. If refresh\\_rate is not provided, it will be automatically determined based on the resolution (higher resolutions use lower refresh rates to keep bandwidth reasonable).\n\nThe properties Height, Width are required.\n\n```go\nfunc (r BrowserViewportParam) MarshalJSON() (data []byte, err error)\n```\n\n```go\nfunc (r *BrowserViewportParam) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ErrorDetail struct {\n\t// Lower-level error code providing more specific detail\n\tCode string `json:\"code\"`\n\t// Further detail about the error\n\tMessage string `json:\"message\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tCode        respjson.Field\n\t\tMessage     respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\n\n```go\nfunc (r ErrorDetail) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *ErrorDetail) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ErrorEvent struct {\n\tError ErrorModel `json:\"error\" api:\"required\"`\n\t// Event type identifier (always \"error\").\n\tEvent constant.Error `json:\"event\" default:\"error\"`\n\t// Time the error occurred.\n\tTimestamp time.Time `json:\"timestamp\" api:\"required\" format:\"date-time\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tError       respjson.Field\n\t\tEvent       respjson.Field\n\t\tTimestamp   respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\nAn error event from the application.\n\n```go\nfunc (ErrorEvent) ImplAuthConnectionFollowResponseUnion()\n```\n\n```go\nfunc (ErrorEvent) ImplInvocationFollowResponseUnion()\n```\n\n```go\nfunc (r ErrorEvent) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *ErrorEvent) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ErrorModel struct {\n\t// Application-specific error code (machine-readable)\n\tCode string `json:\"code\" api:\"required\"`\n\t// Human-readable error description for debugging\n\tMessage string `json:\"message\" api:\"required\"`\n\t// Additional error details (for multiple errors)\n\tDetails    []ErrorDetail `json:\"details\"`\n\tInnerError ErrorDetail   `json:\"inner_error\"`\n\t// Request fields that are incompatible with the requested browser platform.\n\tUnsupportedFields []string `json:\"unsupported_fields\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tCode              respjson.Field\n\t\tMessage           respjson.Field\n\t\tDetails           respjson.Field\n\t\tInnerError        respjson.Field\n\t\tUnsupportedFields respjson.Field\n\t\tExtraFields       map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\n\n```go\nfunc (r ErrorModel) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *ErrorModel) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype HeartbeatEvent struct {\n\t// Event type identifier (always \"sse_heartbeat\").\n\tEvent constant.SseHeartbeat `json:\"event\" default:\"sse_heartbeat\"`\n\t// Time the heartbeat was sent.\n\tTimestamp time.Time `json:\"timestamp\" api:\"required\" format:\"date-time\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tEvent       respjson.Field\n\t\tTimestamp   respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\nHeartbeat event sent periodically to keep SSE connection alive.\n\n```go\nfunc (HeartbeatEvent) ImplAuthConnectionFollowResponseUnion()\n```\n\n```go\nfunc (HeartbeatEvent) ImplInvocationFollowResponseUnion()\n```\n\n```go\nfunc (r HeartbeatEvent) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *HeartbeatEvent) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype LogEvent struct {\n\t// Event type identifier (always \"log\").\n\tEvent constant.Log `json:\"event\" default:\"log\"`\n\t// Log message text.\n\tMessage string `json:\"message\" api:\"required\"`\n\t// Time the log entry was produced.\n\tTimestamp time.Time `json:\"timestamp\" api:\"required\" format:\"date-time\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tEvent       respjson.Field\n\t\tMessage     respjson.Field\n\t\tTimestamp   respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\nA log entry from the application.\n\n```go\nfunc (LogEvent) ImplInvocationFollowResponseUnion()\n```\n\n```go\nfunc (r LogEvent) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *LogEvent) UnmarshalJSON(data []byte) error\n```\n\n","path":"github.com/kernel/kernel-go-sdk/shared","name":"shared","synopsis":"","isRedistributable":true}
