Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "model-hub/oauth-flow.schema.json",
"title": "OAuthFlow",
"description": "Subscription-connect flow state. RUNTIME-DECLARED presentation (S1 gap ③): the server declares what to show and what it expects back; the UI renders declaratively and never keys off a vendor→form table. UI shell semantics mirror the existing BackendOAuthPanel (2s poll, 15-min timeout, cancel). Forms A/B/C from spec §5 frame 09 are presentation patterns the declaration composes: A = auth_url + expects paste_code; B = auth_url + device_code + expects none; C = auth_url + expects paste_callback_url. Under Option 1, native_cli subscription connect drives the CLI's own login through this same shape.",
"$comment": "Owner-approved channel class audit: this is the user-facing presentation wire, not the service-side OAuthFlowState seam. `credential_ref`, `retained_material_disposition`, and `retained_credential_ref` are deliberately excluded because only the service repair consumer acts on them; no UI or wire consumer does. Both channel branches still expose `channel`, and source-bound create/reauth flows carry `source_id`. Evidence at master 05f72ae5: core/handlers/model_hub/native_oauth.py:252-289 produces native success with no engine credential ref, while the HTTP projection publishes presentation fields rather than adapter refs.",
"type": "object",
"required": ["flow_id", "intent", "source_id", "vendor", "channel", "state", "presentation", "error_key", "expires_at"],
"additionalProperties": false,
"properties": {
"flow_id": { "type": "string" },
"client_nonce": {
"type": "string",
"pattern": "^ofn_[a-z0-9]{16,64}$",
"description": "Optional client-generated OAuth-start correlation echoed from the start request. Before provider work the server atomically claims the exact (client_nonce, vendor, channel) tuple; concurrent retries coalesce to its one pending start and terminal result. Provider failure or task cancellation before a flow exists releases the claim after cleanup, while success atomically converts it to the one OAuthFlow returned by every retry until its existing expires_at. Explicit cancellation retains that committed flow with state cancelled until expiry and starts no provider on a same-tuple retry."
},
"intent": {
"enum": ["create", "reauth"],
"description": "The flow intent determines its successful terminal response: create returns `{flow, source, added_to, adopted_by}`; reauth returns `{flow, source, recovered, interrupted_pairs}`. A local terminal materialization error instead uses the standard error envelope; only a nonempty acquisition-stage interruption report adds `interrupted_pairs`. Intent is explicit because source_id cannot distinguish create from reauth and clients must not infer response shape from remembered UI state."
},
"source_id": { "type": ["string", "null"], "description": "Pending or existing Source this flow binds to. Both hub and native_cli create/reauth flows set it; null is reserved for presentation-only flows outside Model Hub." },
"vendor": { "type": "string" },
"channel": { "enum": ["native_cli", "hub"], "description": "Where the resulting credential lives. Claude recommends native_cli; ChatGPT recommends hub; both explicit alternatives remain legal. Hub-held subscriptions require no feature flag or consent record." },
"state": { "enum": ["starting", "awaiting_action", "verifying", "success", "failed", "cancelled"] },
"presentation": {
"type": "object",
"required": ["expects"],
"additionalProperties": false,
"properties": {
"auth_url": { "type": ["string", "null"] },
"device_code": { "type": ["string", "null"] },
"expects": { "enum": ["none", "paste_code", "paste_callback_url"] },
"instructions_key": { "type": ["string", "null"], "description": "i18n key for the step-2 helper line" }
}
},
"error_key": { "type": ["string", "null"], "description": "Closed i18n key for the user-facing sentence. The provider's own words never replace it; when there are any, they travel separately in `error_detail`." },
"error_detail": { "type": "string", "minLength": 1, "maxLength": 1000, "description": "Present only on a failed flow whose provider, engine, or native CLI gave a reason beyond `error_key`: that reason verbatim, with whitespace collapsed to one line and bounded to 1000 characters. Its sources are the pinned engine's session errors (whose only quoted cause is the provider's OAuth error response or a transport error) and the native CLI's last output line; none carries grant material. Shown behind an expandable details control the user can copy. Never persisted." },
"application_failed": { "type": "boolean", "description": "For a receipt-backed native authorization: its credential/config commit succeeded and the Source can materialize, but that operation's runtime-application attempt failed. This is a warning, not an authorization failure or a claim about current runtime health. Omitted means no such warning was reported." },
"expires_at": { "type": ["string", "null"], "format": "date-time", "description": "Flow expiry. A flow without client_nonce may use null for ordinary or presentation-only lifetime handling; a nonce-bearing flow always carries a non-null date-time that bounds reconciliation and retained cancellation." }
},
"allOf": [
{
"if": { "required": ["application_failed"], "properties": { "application_failed": { "const": true } } },
"then": { "properties": { "channel": { "const": "native_cli" }, "state": { "const": "success" } } }
},
{
"if": { "required": ["client_nonce"] },
"then": {
"properties": {
"expires_at": { "type": "string", "format": "date-time" }
}
}
}
],
"examples": [
{
"flow_id": "oaf_claude01",
"client_nonce": "ofn_01j5w8z7p4n6q2rt",
"intent": "create",
"source_id": "src_claudepro1",
"vendor": "anthropic",
"channel": "native_cli",
"state": "awaiting_action",
"presentation": {
"auth_url": "https://claude.ai/oauth/authorize?code=true&...",
"device_code": null,
"expects": "paste_code",
"instructions_key": "models.oauth.claude.paste_code"
},
"error_key": null,
"expires_at": "2026-07-23T04:15:00+08:00"
}
]
}