mirror of
https://github.com/openai/codex.git
synced 2026-09-05 15:18:41 +00:00
Add app server account session protocol
This commit is contained in:
@@ -5,6 +5,48 @@
|
||||
"description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.",
|
||||
"type": "string"
|
||||
},
|
||||
"AccountSessionsAddParams": {
|
||||
"properties": {
|
||||
"switchToAddedAccount": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsListParams": {
|
||||
"properties": {
|
||||
"refreshWorkspaceMetadata": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsLogoutParams": {
|
||||
"properties": {
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessionId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsSwitchParams": {
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string"
|
||||
},
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountId",
|
||||
"sessionId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AddCreditsNudgeCreditType": {
|
||||
"enum": [
|
||||
"credits",
|
||||
@@ -5875,6 +5917,102 @@
|
||||
"title": "Account/login/cancelRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/add"
|
||||
],
|
||||
"title": "AccountSession/addRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsAddParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/addRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/list"
|
||||
],
|
||||
"title": "AccountSession/listRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsListParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/logout"
|
||||
],
|
||||
"title": "AccountSession/logoutRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsLogoutParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/logoutRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/switch"
|
||||
],
|
||||
"title": "AccountSession/switchRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsSwitchParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/switchRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
|
||||
@@ -1787,6 +1787,102 @@
|
||||
"title": "Account/login/cancelRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/add"
|
||||
],
|
||||
"title": "AccountSession/addRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/AccountSessionsAddParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/addRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/list"
|
||||
],
|
||||
"title": "AccountSession/listRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/AccountSessionsListParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/logout"
|
||||
],
|
||||
"title": "AccountSession/logoutRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/AccountSessionsLogoutParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/logoutRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/v2/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/switch"
|
||||
],
|
||||
"title": "AccountSession/switchRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/v2/AccountSessionsSwitchParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/switchRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
@@ -5731,6 +5827,193 @@
|
||||
"title": "AccountRateLimitsUpdatedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSession": {
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"email": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"imageUrl": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"isActive": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lastUsedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"plan": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"selectedWorkspaceAccountId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workspaces": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/AccountSessionWorkspace"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"isActive",
|
||||
"lastUsedAt",
|
||||
"sessionId",
|
||||
"workspaces"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionWorkspace": {
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string"
|
||||
},
|
||||
"imageUrl": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"kind": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/v2/AccountSessionWorkspaceKind"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/v2/AccountSessionWorkspaceStatus"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountId",
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionWorkspaceKind": {
|
||||
"enum": [
|
||||
"personal",
|
||||
"workspace"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"AccountSessionWorkspaceStatus": {
|
||||
"enum": [
|
||||
"active",
|
||||
"disabled",
|
||||
"deactivated"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"AccountSessionsAddParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"switchToAddedAccount": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"title": "AccountSessionsAddParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsListParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"refreshWorkspaceMetadata": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"title": "AccountSessionsListParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsLogoutParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessionId"
|
||||
],
|
||||
"title": "AccountSessionsLogoutParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"activeSessionId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/v2/AccountSession"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessions"
|
||||
],
|
||||
"title": "AccountSessionsResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsSwitchParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string"
|
||||
},
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountId",
|
||||
"sessionId"
|
||||
],
|
||||
"title": "AccountSessionsSwitchParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountUpdatedNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
|
||||
@@ -103,6 +103,193 @@
|
||||
"title": "AccountRateLimitsUpdatedNotification",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSession": {
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"email": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"imageUrl": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"isActive": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lastUsedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"plan": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"selectedWorkspaceAccountId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workspaces": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/AccountSessionWorkspace"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"isActive",
|
||||
"lastUsedAt",
|
||||
"sessionId",
|
||||
"workspaces"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionWorkspace": {
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string"
|
||||
},
|
||||
"imageUrl": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"kind": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AccountSessionWorkspaceKind"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/AccountSessionWorkspaceStatus"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountId",
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionWorkspaceKind": {
|
||||
"enum": [
|
||||
"personal",
|
||||
"workspace"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"AccountSessionWorkspaceStatus": {
|
||||
"enum": [
|
||||
"active",
|
||||
"disabled",
|
||||
"deactivated"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"AccountSessionsAddParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"switchToAddedAccount": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"title": "AccountSessionsAddParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsListParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"refreshWorkspaceMetadata": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"title": "AccountSessionsListParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsLogoutParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessionId"
|
||||
],
|
||||
"title": "AccountSessionsLogoutParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsResponse": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"activeSessionId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/AccountSession"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessions"
|
||||
],
|
||||
"title": "AccountSessionsResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionsSwitchParams": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string"
|
||||
},
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountId",
|
||||
"sessionId"
|
||||
],
|
||||
"title": "AccountSessionsSwitchParams",
|
||||
"type": "object"
|
||||
},
|
||||
"AccountUpdatedNotification": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
@@ -2535,6 +2722,102 @@
|
||||
"title": "Account/login/cancelRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/add"
|
||||
],
|
||||
"title": "AccountSession/addRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsAddParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/addRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/list"
|
||||
],
|
||||
"title": "AccountSession/listRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsListParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/listRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/logout"
|
||||
],
|
||||
"title": "AccountSession/logoutRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsLogoutParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/logoutRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "#/definitions/RequestId"
|
||||
},
|
||||
"method": {
|
||||
"enum": [
|
||||
"accountSession/switch"
|
||||
],
|
||||
"title": "AccountSession/switchRequestMethod",
|
||||
"type": "string"
|
||||
},
|
||||
"params": {
|
||||
"$ref": "#/definitions/AccountSessionsSwitchParams"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"method",
|
||||
"params"
|
||||
],
|
||||
"title": "AccountSession/switchRequest",
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"id": {
|
||||
|
||||
10
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsAddParams.json
generated
Normal file
10
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsAddParams.json
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"switchToAddedAccount": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"title": "AccountSessionsAddParams",
|
||||
"type": "object"
|
||||
}
|
||||
10
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsListParams.json
generated
Normal file
10
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsListParams.json
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"refreshWorkspaceMetadata": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"title": "AccountSessionsListParams",
|
||||
"type": "object"
|
||||
}
|
||||
13
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsLogoutParams.json
generated
Normal file
13
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsLogoutParams.json
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessionId"
|
||||
],
|
||||
"title": "AccountSessionsLogoutParams",
|
||||
"type": "object"
|
||||
}
|
||||
139
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsResponse.json
generated
Normal file
139
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsResponse.json
generated
Normal file
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"AccountSession": {
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"email": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"imageUrl": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"isActive": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lastUsedAt": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"plan": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"selectedWorkspaceAccountId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"workspaces": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/AccountSessionWorkspace"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"isActive",
|
||||
"lastUsedAt",
|
||||
"sessionId",
|
||||
"workspaces"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionWorkspace": {
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string"
|
||||
},
|
||||
"imageUrl": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"kind": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AccountSessionWorkspaceKind"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/AccountSessionWorkspaceStatus"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountId",
|
||||
"status"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AccountSessionWorkspaceKind": {
|
||||
"enum": [
|
||||
"personal",
|
||||
"workspace"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"AccountSessionWorkspaceStatus": {
|
||||
"enum": [
|
||||
"active",
|
||||
"disabled",
|
||||
"deactivated"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"activeSessionId": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"items": {
|
||||
"$ref": "#/definitions/AccountSession"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sessions"
|
||||
],
|
||||
"title": "AccountSessionsResponse",
|
||||
"type": "object"
|
||||
}
|
||||
17
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsSwitchParams.json
generated
Normal file
17
codex-rs/app-server-protocol/schema/json/v2/AccountSessionsSwitchParams.json
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"accountId": {
|
||||
"type": "string"
|
||||
},
|
||||
"sessionId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accountId",
|
||||
"sessionId"
|
||||
],
|
||||
"title": "AccountSessionsSwitchParams",
|
||||
"type": "object"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
6
codex-rs/app-server-protocol/schema/typescript/v2/AccountSession.ts
generated
Normal file
6
codex-rs/app-server-protocol/schema/typescript/v2/AccountSession.ts
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AccountSessionWorkspace } from "./AccountSessionWorkspace";
|
||||
|
||||
export type AccountSession = { sessionId: string, email: string | null, userId: string | null, displayName: string | null, imageUrl: string | null, plan: string | null, lastUsedAt: bigint, isActive: boolean, selectedWorkspaceAccountId: string | null, workspaces: Array<AccountSessionWorkspace>, };
|
||||
7
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionWorkspace.ts
generated
Normal file
7
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionWorkspace.ts
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AccountSessionWorkspaceKind } from "./AccountSessionWorkspaceKind";
|
||||
import type { AccountSessionWorkspaceStatus } from "./AccountSessionWorkspaceStatus";
|
||||
|
||||
export type AccountSessionWorkspace = { accountId: string, name: string | null, imageUrl: string | null, kind: AccountSessionWorkspaceKind | null, status: AccountSessionWorkspaceStatus, };
|
||||
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionWorkspaceKind.ts
generated
Normal file
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionWorkspaceKind.ts
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AccountSessionWorkspaceKind = "personal" | "workspace";
|
||||
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionWorkspaceStatus.ts
generated
Normal file
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionWorkspaceStatus.ts
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AccountSessionWorkspaceStatus = "active" | "disabled" | "deactivated";
|
||||
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsAddParams.ts
generated
Normal file
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsAddParams.ts
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AccountSessionsAddParams = { switchToAddedAccount?: boolean, };
|
||||
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsListParams.ts
generated
Normal file
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsListParams.ts
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AccountSessionsListParams = { refreshWorkspaceMetadata?: boolean, };
|
||||
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsLogoutParams.ts
generated
Normal file
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsLogoutParams.ts
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AccountSessionsLogoutParams = { sessionId: string, };
|
||||
6
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsResponse.ts
generated
Normal file
6
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsResponse.ts
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AccountSession } from "./AccountSession";
|
||||
|
||||
export type AccountSessionsResponse = { activeSessionId: string | null, sessions: Array<AccountSession>, };
|
||||
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsSwitchParams.ts
generated
Normal file
5
codex-rs/app-server-protocol/schema/typescript/v2/AccountSessionsSwitchParams.ts
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type AccountSessionsSwitchParams = { sessionId: string, accountId: string, };
|
||||
@@ -3,6 +3,15 @@
|
||||
export type { Account } from "./Account";
|
||||
export type { AccountLoginCompletedNotification } from "./AccountLoginCompletedNotification";
|
||||
export type { AccountRateLimitsUpdatedNotification } from "./AccountRateLimitsUpdatedNotification";
|
||||
export type { AccountSession } from "./AccountSession";
|
||||
export type { AccountSessionWorkspace } from "./AccountSessionWorkspace";
|
||||
export type { AccountSessionWorkspaceKind } from "./AccountSessionWorkspaceKind";
|
||||
export type { AccountSessionWorkspaceStatus } from "./AccountSessionWorkspaceStatus";
|
||||
export type { AccountSessionsAddParams } from "./AccountSessionsAddParams";
|
||||
export type { AccountSessionsListParams } from "./AccountSessionsListParams";
|
||||
export type { AccountSessionsLogoutParams } from "./AccountSessionsLogoutParams";
|
||||
export type { AccountSessionsResponse } from "./AccountSessionsResponse";
|
||||
export type { AccountSessionsSwitchParams } from "./AccountSessionsSwitchParams";
|
||||
export type { AccountUpdatedNotification } from "./AccountUpdatedNotification";
|
||||
export type { ActivePermissionProfile } from "./ActivePermissionProfile";
|
||||
export type { AddCreditsNudgeCreditType } from "./AddCreditsNudgeCreditType";
|
||||
|
||||
@@ -919,6 +919,33 @@ client_request_definitions! {
|
||||
response: v2::CancelLoginAccountResponse,
|
||||
},
|
||||
|
||||
AccountSessionsAdd => "accountSession/add" {
|
||||
params: v2::AccountSessionsAddParams,
|
||||
serialization: global("account-auth"),
|
||||
response: v2::AccountSessionsResponse,
|
||||
},
|
||||
|
||||
AccountSessionsList => "accountSession/list" {
|
||||
params: v2::AccountSessionsListParams,
|
||||
serialization: global("account-auth"),
|
||||
manual_payload_conversion: manual,
|
||||
response: v2::AccountSessionsResponse,
|
||||
},
|
||||
|
||||
AccountSessionsLogout => "accountSession/logout" {
|
||||
params: v2::AccountSessionsLogoutParams,
|
||||
serialization: global("account-auth"),
|
||||
manual_payload_conversion: manual,
|
||||
response: v2::AccountSessionsResponse,
|
||||
},
|
||||
|
||||
AccountSessionsSwitch => "accountSession/switch" {
|
||||
params: v2::AccountSessionsSwitchParams,
|
||||
serialization: global("account-auth"),
|
||||
manual_payload_conversion: manual,
|
||||
response: v2::AccountSessionsResponse,
|
||||
},
|
||||
|
||||
LogoutAccount => "account/logout" {
|
||||
params: #[ts(type = "undefined")] #[serde(skip_serializing_if = "Option::is_none")] Option<()>,
|
||||
serialization: global("account-auth"),
|
||||
|
||||
@@ -137,6 +137,89 @@ pub struct CancelLoginAccountResponse {
|
||||
pub status: CancelLoginAccountStatus,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct AccountSessionsAddParams {
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub switch_to_added_account: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct AccountSessionsListParams {
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub refresh_workspace_metadata: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct AccountSessionsLogoutParams {
|
||||
pub session_id: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct AccountSessionsSwitchParams {
|
||||
pub session_id: String,
|
||||
pub account_id: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct AccountSessionsResponse {
|
||||
pub active_session_id: Option<String>,
|
||||
pub sessions: Vec<AccountSession>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct AccountSession {
|
||||
pub session_id: String,
|
||||
pub email: Option<String>,
|
||||
pub user_id: Option<String>,
|
||||
pub display_name: Option<String>,
|
||||
pub image_url: Option<String>,
|
||||
pub plan: Option<String>,
|
||||
pub last_used_at: i64,
|
||||
pub is_active: bool,
|
||||
pub selected_workspace_account_id: Option<String>,
|
||||
pub workspaces: Vec<AccountSessionWorkspace>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct AccountSessionWorkspace {
|
||||
pub account_id: String,
|
||||
pub name: Option<String>,
|
||||
pub image_url: Option<String>,
|
||||
pub kind: Option<AccountSessionWorkspaceKind>,
|
||||
pub status: AccountSessionWorkspaceStatus,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum AccountSessionWorkspaceKind {
|
||||
Personal,
|
||||
Workspace,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum AccountSessionWorkspaceStatus {
|
||||
Active,
|
||||
Disabled,
|
||||
Deactivated,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use crate::types::AccountsCheckResponse;
|
||||
use crate::types::CodeTaskDetailsResponse;
|
||||
use crate::types::ConfigFileResponse;
|
||||
use crate::types::PaginatedListTaskListItem;
|
||||
@@ -301,6 +302,16 @@ impl Client {
|
||||
Ok(Self::rate_limit_snapshots_from_payload(payload))
|
||||
}
|
||||
|
||||
pub async fn get_accounts_check(&self) -> Result<AccountsCheckResponse> {
|
||||
let url = match self.path_style {
|
||||
PathStyle::CodexApi => format!("{}/api/codex/accounts/check", self.base_url),
|
||||
PathStyle::ChatGptApi => format!("{}/wham/accounts/check", self.base_url),
|
||||
};
|
||||
let req = self.http.get(&url).headers(self.headers());
|
||||
let (body, ct) = self.exec_request(req, "GET", &url).await?;
|
||||
self.decode_json(&url, &ct, &body)
|
||||
}
|
||||
|
||||
pub async fn send_add_credits_nudge_email(
|
||||
&self,
|
||||
credit_type: AddCreditsNudgeCreditType,
|
||||
|
||||
@@ -4,6 +4,8 @@ pub(crate) mod types;
|
||||
pub use client::AddCreditsNudgeCreditType;
|
||||
pub use client::Client;
|
||||
pub use client::RequestError;
|
||||
pub use types::AccountEntry;
|
||||
pub use types::AccountsCheckResponse;
|
||||
pub use types::CodeTaskDetailsResponse;
|
||||
pub use types::CodeTaskDetailsResponseExt;
|
||||
pub use types::ConfigFileResponse;
|
||||
|
||||
@@ -13,6 +13,27 @@ use serde::de::Deserializer;
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct AccountsCheckResponse {
|
||||
#[serde(default)]
|
||||
pub accounts: Vec<AccountEntry>,
|
||||
#[serde(default)]
|
||||
pub account_ordering: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub default_account_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct AccountEntry {
|
||||
pub id: String,
|
||||
#[serde(default)]
|
||||
pub name: Option<String>,
|
||||
#[serde(default)]
|
||||
pub profile_picture_url: Option<String>,
|
||||
#[serde(default)]
|
||||
pub structure: String,
|
||||
}
|
||||
|
||||
/// Hand-rolled models for the Cloud Tasks task-details response.
|
||||
/// The generated OpenAPI models are pretty bad. This is a half-step
|
||||
/// towards hand-rolling them.
|
||||
|
||||
Reference in New Issue
Block a user