Regenerate Codex reset credit protocol bindings (#4173)
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
501ce27b81
commit
08993a5ec8
5 files changed
+5978
-1324
No files matched your search
@@ -17,7 +17,7 @@ import {
|
||||
} from "effect/unstable/http";
|
||||
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
|
||||
|
||||
const UPSTREAM_REF = "b39f943a634a6e7ba86c3d6e8cf6d5f35e612566";
|
||||
const UPSTREAM_REF = "678157acaa819d5510adfe359abb5d0392cfe461";
|
||||
const USER_AGENT = "effect-codex-app-server-generator";
|
||||
const GITHUB_API_BASE =
|
||||
"https://api.github.com/repos/openai/codex/contents/codex-rs/app-server-protocol";
|
||||
@@ -349,10 +349,12 @@ function resolveResponseTypeName(
|
||||
"account/logout": "LogoutAccountResponse",
|
||||
"account/rateLimits/read": "GetAccountRateLimitsResponse",
|
||||
"account/usage/read": "GetAccountTokenUsageResponse",
|
||||
"account/workspaceMessages/read": "GetWorkspaceMessagesResponse",
|
||||
"config/batchWrite": "ConfigWriteResponse",
|
||||
"config/mcpServer/reload": "McpServerRefreshResponse",
|
||||
"config/value/write": "ConfigWriteResponse",
|
||||
"configRequirements/read": "ConfigRequirementsReadResponse",
|
||||
"externalAgentConfig/import/readHistories": "ExternalAgentConfigImportHistoriesReadResponse",
|
||||
};
|
||||
|
||||
const override = overrides[method];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is generated by the effect-codex-app-server package. Do not edit manually.
|
||||
// Upstream protocol ref: b39f943a634a6e7ba86c3d6e8cf6d5f35e612566
|
||||
// Upstream protocol ref: 678157acaa819d5510adfe359abb5d0392cfe461
|
||||
|
||||
import * as CodexSchema from "./schema.gen.ts";
|
||||
|
||||
@@ -40,7 +40,9 @@ export const CLIENT_REQUEST_METHODS = {
|
||||
"plugin/share/list": "plugin/share/list",
|
||||
"plugin/share/checkout": "plugin/share/checkout",
|
||||
"plugin/share/delete": "plugin/share/delete",
|
||||
"app/read": "app/read",
|
||||
"app/list": "app/list",
|
||||
"app/installed": "app/installed",
|
||||
"fs/readFile": "fs/readFile",
|
||||
"fs/writeFile": "fs/writeFile",
|
||||
"fs/createDirectory": "fs/createDirectory",
|
||||
@@ -73,7 +75,9 @@ export const CLIENT_REQUEST_METHODS = {
|
||||
"account/login/cancel": "account/login/cancel",
|
||||
"account/logout": "account/logout",
|
||||
"account/rateLimits/read": "account/rateLimits/read",
|
||||
"account/rateLimitResetCredit/consume": "account/rateLimitResetCredit/consume",
|
||||
"account/usage/read": "account/usage/read",
|
||||
"account/workspaceMessages/read": "account/workspaceMessages/read",
|
||||
"account/sendAddCreditsNudgeEmail": "account/sendAddCreditsNudgeEmail",
|
||||
"feedback/upload": "feedback/upload",
|
||||
"command/exec": "command/exec",
|
||||
@@ -83,6 +87,7 @@ export const CLIENT_REQUEST_METHODS = {
|
||||
"config/read": "config/read",
|
||||
"externalAgentConfig/detect": "externalAgentConfig/detect",
|
||||
"externalAgentConfig/import": "externalAgentConfig/import",
|
||||
"externalAgentConfig/import/readHistories": "externalAgentConfig/import/readHistories",
|
||||
"config/value/write": "config/value/write",
|
||||
"config/batchWrite": "config/batchWrite",
|
||||
"configRequirements/read": "configRequirements/read",
|
||||
@@ -122,6 +127,8 @@ export const SERVER_NOTIFICATION_METHODS = {
|
||||
"thread/name/updated": "thread/name/updated",
|
||||
"thread/goal/updated": "thread/goal/updated",
|
||||
"thread/goal/cleared": "thread/goal/cleared",
|
||||
"thread/environment/connected": "thread/environment/connected",
|
||||
"thread/environment/disconnected": "thread/environment/disconnected",
|
||||
"thread/settings/updated": "thread/settings/updated",
|
||||
"thread/tokenUsage/updated": "thread/tokenUsage/updated",
|
||||
"turn/started": "turn/started",
|
||||
@@ -135,6 +142,7 @@ export const SERVER_NOTIFICATION_METHODS = {
|
||||
"item/autoApprovalReview/completed": "item/autoApprovalReview/completed",
|
||||
"item/completed": "item/completed",
|
||||
"rawResponseItem/completed": "rawResponseItem/completed",
|
||||
"rawResponse/completed": "rawResponse/completed",
|
||||
"item/agentMessage/delta": "item/agentMessage/delta",
|
||||
"item/plan/delta": "item/plan/delta",
|
||||
"command/exec/outputDelta": "command/exec/outputDelta",
|
||||
@@ -152,6 +160,7 @@ export const SERVER_NOTIFICATION_METHODS = {
|
||||
"account/rateLimits/updated": "account/rateLimits/updated",
|
||||
"app/list/updated": "app/list/updated",
|
||||
"remoteControl/status/changed": "remoteControl/status/changed",
|
||||
"externalAgentConfig/import/progress": "externalAgentConfig/import/progress",
|
||||
"externalAgentConfig/import/completed": "externalAgentConfig/import/completed",
|
||||
"fs/changed": "fs/changed",
|
||||
"item/reasoning/summaryTextDelta": "item/reasoning/summaryTextDelta",
|
||||
@@ -161,6 +170,7 @@ export const SERVER_NOTIFICATION_METHODS = {
|
||||
"model/rerouted": "model/rerouted",
|
||||
"model/verification": "model/verification",
|
||||
"turn/moderationMetadata": "turn/moderationMetadata",
|
||||
"model/safetyBuffering/updated": "model/safetyBuffering/updated",
|
||||
warning: "warning",
|
||||
guardianWarning: "guardianWarning",
|
||||
deprecationNotice: "deprecationNotice",
|
||||
@@ -222,7 +232,9 @@ export interface ClientRequestParamsByMethod {
|
||||
readonly "plugin/share/list": CodexSchema.V2PluginShareListParams;
|
||||
readonly "plugin/share/checkout": CodexSchema.V2PluginShareCheckoutParams;
|
||||
readonly "plugin/share/delete": CodexSchema.V2PluginShareDeleteParams;
|
||||
readonly "app/read": CodexSchema.V2AppsReadParams;
|
||||
readonly "app/list": CodexSchema.V2AppsListParams;
|
||||
readonly "app/installed": CodexSchema.V2AppsInstalledParams;
|
||||
readonly "fs/readFile": CodexSchema.V2FsReadFileParams;
|
||||
readonly "fs/writeFile": CodexSchema.V2FsWriteFileParams;
|
||||
readonly "fs/createDirectory": CodexSchema.V2FsCreateDirectoryParams;
|
||||
@@ -255,7 +267,9 @@ export interface ClientRequestParamsByMethod {
|
||||
readonly "account/login/cancel": CodexSchema.V2CancelLoginAccountParams;
|
||||
readonly "account/logout": undefined;
|
||||
readonly "account/rateLimits/read": undefined;
|
||||
readonly "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditParams;
|
||||
readonly "account/usage/read": undefined;
|
||||
readonly "account/workspaceMessages/read": undefined;
|
||||
readonly "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailParams;
|
||||
readonly "feedback/upload": CodexSchema.V2FeedbackUploadParams;
|
||||
readonly "command/exec": CodexSchema.V2CommandExecParams;
|
||||
@@ -265,6 +279,7 @@ export interface ClientRequestParamsByMethod {
|
||||
readonly "config/read": CodexSchema.V2ConfigReadParams;
|
||||
readonly "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectParams;
|
||||
readonly "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportParams;
|
||||
readonly "externalAgentConfig/import/readHistories": undefined;
|
||||
readonly "config/value/write": CodexSchema.V2ConfigValueWriteParams;
|
||||
readonly "config/batchWrite": CodexSchema.V2ConfigBatchWriteParams;
|
||||
readonly "configRequirements/read": undefined;
|
||||
@@ -312,7 +327,9 @@ export interface ClientRequestResponsesByMethod {
|
||||
readonly "plugin/share/list": CodexSchema.V2PluginShareListResponse;
|
||||
readonly "plugin/share/checkout": CodexSchema.V2PluginShareCheckoutResponse;
|
||||
readonly "plugin/share/delete": CodexSchema.V2PluginShareDeleteResponse;
|
||||
readonly "app/read": CodexSchema.V2AppsReadResponse;
|
||||
readonly "app/list": CodexSchema.V2AppsListResponse;
|
||||
readonly "app/installed": CodexSchema.V2AppsInstalledResponse;
|
||||
readonly "fs/readFile": CodexSchema.V2FsReadFileResponse;
|
||||
readonly "fs/writeFile": CodexSchema.V2FsWriteFileResponse;
|
||||
readonly "fs/createDirectory": CodexSchema.V2FsCreateDirectoryResponse;
|
||||
@@ -345,7 +362,9 @@ export interface ClientRequestResponsesByMethod {
|
||||
readonly "account/login/cancel": CodexSchema.V2CancelLoginAccountResponse;
|
||||
readonly "account/logout": CodexSchema.V2LogoutAccountResponse;
|
||||
readonly "account/rateLimits/read": CodexSchema.V2GetAccountRateLimitsResponse;
|
||||
readonly "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse;
|
||||
readonly "account/usage/read": CodexSchema.V2GetAccountTokenUsageResponse;
|
||||
readonly "account/workspaceMessages/read": CodexSchema.V2GetWorkspaceMessagesResponse;
|
||||
readonly "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailResponse;
|
||||
readonly "feedback/upload": CodexSchema.V2FeedbackUploadResponse;
|
||||
readonly "command/exec": CodexSchema.V2CommandExecResponse;
|
||||
@@ -355,6 +374,7 @@ export interface ClientRequestResponsesByMethod {
|
||||
readonly "config/read": CodexSchema.V2ConfigReadResponse;
|
||||
readonly "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectResponse;
|
||||
readonly "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportResponse;
|
||||
readonly "externalAgentConfig/import/readHistories": CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse;
|
||||
readonly "config/value/write": CodexSchema.V2ConfigWriteResponse;
|
||||
readonly "config/batchWrite": CodexSchema.V2ConfigWriteResponse;
|
||||
readonly "configRequirements/read": CodexSchema.V2ConfigRequirementsReadResponse;
|
||||
@@ -407,6 +427,8 @@ export interface ServerNotificationParamsByMethod {
|
||||
readonly "thread/name/updated": CodexSchema.V2ThreadNameUpdatedNotification;
|
||||
readonly "thread/goal/updated": CodexSchema.V2ThreadGoalUpdatedNotification;
|
||||
readonly "thread/goal/cleared": CodexSchema.V2ThreadGoalClearedNotification;
|
||||
readonly "thread/environment/connected": CodexSchema.V2EnvironmentConnectionNotification;
|
||||
readonly "thread/environment/disconnected": CodexSchema.V2EnvironmentConnectionNotification;
|
||||
readonly "thread/settings/updated": CodexSchema.V2ThreadSettingsUpdatedNotification;
|
||||
readonly "thread/tokenUsage/updated": CodexSchema.V2ThreadTokenUsageUpdatedNotification;
|
||||
readonly "turn/started": CodexSchema.V2TurnStartedNotification;
|
||||
@@ -420,6 +442,7 @@ export interface ServerNotificationParamsByMethod {
|
||||
readonly "item/autoApprovalReview/completed": CodexSchema.V2ItemGuardianApprovalReviewCompletedNotification;
|
||||
readonly "item/completed": CodexSchema.V2ItemCompletedNotification;
|
||||
readonly "rawResponseItem/completed": CodexSchema.V2RawResponseItemCompletedNotification;
|
||||
readonly "rawResponse/completed": CodexSchema.V2RawResponseCompletedNotification;
|
||||
readonly "item/agentMessage/delta": CodexSchema.V2AgentMessageDeltaNotification;
|
||||
readonly "item/plan/delta": CodexSchema.V2PlanDeltaNotification;
|
||||
readonly "command/exec/outputDelta": CodexSchema.V2CommandExecOutputDeltaNotification;
|
||||
@@ -437,6 +460,7 @@ export interface ServerNotificationParamsByMethod {
|
||||
readonly "account/rateLimits/updated": CodexSchema.V2AccountRateLimitsUpdatedNotification;
|
||||
readonly "app/list/updated": CodexSchema.V2AppListUpdatedNotification;
|
||||
readonly "remoteControl/status/changed": CodexSchema.V2RemoteControlStatusChangedNotification;
|
||||
readonly "externalAgentConfig/import/progress": CodexSchema.V2ExternalAgentConfigImportProgressNotification;
|
||||
readonly "externalAgentConfig/import/completed": CodexSchema.V2ExternalAgentConfigImportCompletedNotification;
|
||||
readonly "fs/changed": CodexSchema.V2FsChangedNotification;
|
||||
readonly "item/reasoning/summaryTextDelta": CodexSchema.V2ReasoningSummaryTextDeltaNotification;
|
||||
@@ -446,6 +470,7 @@ export interface ServerNotificationParamsByMethod {
|
||||
readonly "model/rerouted": CodexSchema.V2ModelReroutedNotification;
|
||||
readonly "model/verification": CodexSchema.V2ModelVerificationNotification;
|
||||
readonly "turn/moderationMetadata": CodexSchema.V2TurnModerationMetadataNotification;
|
||||
readonly "model/safetyBuffering/updated": CodexSchema.V2ModelSafetyBufferingUpdatedNotification;
|
||||
readonly warning: CodexSchema.V2WarningNotification;
|
||||
readonly guardianWarning: CodexSchema.V2GuardianWarningNotification;
|
||||
readonly deprecationNotice: CodexSchema.V2DeprecationNoticeNotification;
|
||||
@@ -502,7 +527,9 @@ export const CLIENT_REQUEST_PARAMS = {
|
||||
"plugin/share/list": CodexSchema.V2PluginShareListParams,
|
||||
"plugin/share/checkout": CodexSchema.V2PluginShareCheckoutParams,
|
||||
"plugin/share/delete": CodexSchema.V2PluginShareDeleteParams,
|
||||
"app/read": CodexSchema.V2AppsReadParams,
|
||||
"app/list": CodexSchema.V2AppsListParams,
|
||||
"app/installed": CodexSchema.V2AppsInstalledParams,
|
||||
"fs/readFile": CodexSchema.V2FsReadFileParams,
|
||||
"fs/writeFile": CodexSchema.V2FsWriteFileParams,
|
||||
"fs/createDirectory": CodexSchema.V2FsCreateDirectoryParams,
|
||||
@@ -535,7 +562,9 @@ export const CLIENT_REQUEST_PARAMS = {
|
||||
"account/login/cancel": CodexSchema.V2CancelLoginAccountParams,
|
||||
"account/logout": undefined,
|
||||
"account/rateLimits/read": undefined,
|
||||
"account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditParams,
|
||||
"account/usage/read": undefined,
|
||||
"account/workspaceMessages/read": undefined,
|
||||
"account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailParams,
|
||||
"feedback/upload": CodexSchema.V2FeedbackUploadParams,
|
||||
"command/exec": CodexSchema.V2CommandExecParams,
|
||||
@@ -545,6 +574,7 @@ export const CLIENT_REQUEST_PARAMS = {
|
||||
"config/read": CodexSchema.V2ConfigReadParams,
|
||||
"externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectParams,
|
||||
"externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportParams,
|
||||
"externalAgentConfig/import/readHistories": undefined,
|
||||
"config/value/write": CodexSchema.V2ConfigValueWriteParams,
|
||||
"config/batchWrite": CodexSchema.V2ConfigBatchWriteParams,
|
||||
"configRequirements/read": undefined,
|
||||
@@ -592,7 +622,9 @@ export const CLIENT_REQUEST_RESPONSES = {
|
||||
"plugin/share/list": CodexSchema.V2PluginShareListResponse,
|
||||
"plugin/share/checkout": CodexSchema.V2PluginShareCheckoutResponse,
|
||||
"plugin/share/delete": CodexSchema.V2PluginShareDeleteResponse,
|
||||
"app/read": CodexSchema.V2AppsReadResponse,
|
||||
"app/list": CodexSchema.V2AppsListResponse,
|
||||
"app/installed": CodexSchema.V2AppsInstalledResponse,
|
||||
"fs/readFile": CodexSchema.V2FsReadFileResponse,
|
||||
"fs/writeFile": CodexSchema.V2FsWriteFileResponse,
|
||||
"fs/createDirectory": CodexSchema.V2FsCreateDirectoryResponse,
|
||||
@@ -625,7 +657,9 @@ export const CLIENT_REQUEST_RESPONSES = {
|
||||
"account/login/cancel": CodexSchema.V2CancelLoginAccountResponse,
|
||||
"account/logout": CodexSchema.V2LogoutAccountResponse,
|
||||
"account/rateLimits/read": CodexSchema.V2GetAccountRateLimitsResponse,
|
||||
"account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse,
|
||||
"account/usage/read": CodexSchema.V2GetAccountTokenUsageResponse,
|
||||
"account/workspaceMessages/read": CodexSchema.V2GetWorkspaceMessagesResponse,
|
||||
"account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailResponse,
|
||||
"feedback/upload": CodexSchema.V2FeedbackUploadResponse,
|
||||
"command/exec": CodexSchema.V2CommandExecResponse,
|
||||
@@ -635,6 +669,8 @@ export const CLIENT_REQUEST_RESPONSES = {
|
||||
"config/read": CodexSchema.V2ConfigReadResponse,
|
||||
"externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectResponse,
|
||||
"externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportResponse,
|
||||
"externalAgentConfig/import/readHistories":
|
||||
CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse,
|
||||
"config/value/write": CodexSchema.V2ConfigWriteResponse,
|
||||
"config/batchWrite": CodexSchema.V2ConfigWriteResponse,
|
||||
"configRequirements/read": CodexSchema.V2ConfigRequirementsReadResponse,
|
||||
@@ -687,6 +723,8 @@ export const SERVER_NOTIFICATION_PARAMS = {
|
||||
"thread/name/updated": CodexSchema.V2ThreadNameUpdatedNotification,
|
||||
"thread/goal/updated": CodexSchema.V2ThreadGoalUpdatedNotification,
|
||||
"thread/goal/cleared": CodexSchema.V2ThreadGoalClearedNotification,
|
||||
"thread/environment/connected": CodexSchema.V2EnvironmentConnectionNotification,
|
||||
"thread/environment/disconnected": CodexSchema.V2EnvironmentConnectionNotification,
|
||||
"thread/settings/updated": CodexSchema.V2ThreadSettingsUpdatedNotification,
|
||||
"thread/tokenUsage/updated": CodexSchema.V2ThreadTokenUsageUpdatedNotification,
|
||||
"turn/started": CodexSchema.V2TurnStartedNotification,
|
||||
@@ -701,6 +739,7 @@ export const SERVER_NOTIFICATION_PARAMS = {
|
||||
CodexSchema.V2ItemGuardianApprovalReviewCompletedNotification,
|
||||
"item/completed": CodexSchema.V2ItemCompletedNotification,
|
||||
"rawResponseItem/completed": CodexSchema.V2RawResponseItemCompletedNotification,
|
||||
"rawResponse/completed": CodexSchema.V2RawResponseCompletedNotification,
|
||||
"item/agentMessage/delta": CodexSchema.V2AgentMessageDeltaNotification,
|
||||
"item/plan/delta": CodexSchema.V2PlanDeltaNotification,
|
||||
"command/exec/outputDelta": CodexSchema.V2CommandExecOutputDeltaNotification,
|
||||
@@ -718,6 +757,8 @@ export const SERVER_NOTIFICATION_PARAMS = {
|
||||
"account/rateLimits/updated": CodexSchema.V2AccountRateLimitsUpdatedNotification,
|
||||
"app/list/updated": CodexSchema.V2AppListUpdatedNotification,
|
||||
"remoteControl/status/changed": CodexSchema.V2RemoteControlStatusChangedNotification,
|
||||
"externalAgentConfig/import/progress":
|
||||
CodexSchema.V2ExternalAgentConfigImportProgressNotification,
|
||||
"externalAgentConfig/import/completed":
|
||||
CodexSchema.V2ExternalAgentConfigImportCompletedNotification,
|
||||
"fs/changed": CodexSchema.V2FsChangedNotification,
|
||||
@@ -728,6 +769,7 @@ export const SERVER_NOTIFICATION_PARAMS = {
|
||||
"model/rerouted": CodexSchema.V2ModelReroutedNotification,
|
||||
"model/verification": CodexSchema.V2ModelVerificationNotification,
|
||||
"turn/moderationMetadata": CodexSchema.V2TurnModerationMetadataNotification,
|
||||
"model/safetyBuffering/updated": CodexSchema.V2ModelSafetyBufferingUpdatedNotification,
|
||||
warning: CodexSchema.V2WarningNotification,
|
||||
guardianWarning: CodexSchema.V2GuardianWarningNotification,
|
||||
deprecationNotice: CodexSchema.V2DeprecationNoticeNotification,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is generated by the effect-codex-app-server package. Do not edit manually.
|
||||
// Upstream protocol ref: b39f943a634a6e7ba86c3d6e8cf6d5f35e612566
|
||||
// Upstream protocol ref: 678157acaa819d5510adfe359abb5d0392cfe461
|
||||
|
||||
import * as CodexSchema from "./schema.gen.ts";
|
||||
|
||||
@@ -14,8 +14,12 @@ export const v2 = {
|
||||
AccountUpdatedNotification: CodexSchema.V2AccountUpdatedNotification,
|
||||
AgentMessageDeltaNotification: CodexSchema.V2AgentMessageDeltaNotification,
|
||||
AppListUpdatedNotification: CodexSchema.V2AppListUpdatedNotification,
|
||||
AppsInstalledParams: CodexSchema.V2AppsInstalledParams,
|
||||
AppsInstalledResponse: CodexSchema.V2AppsInstalledResponse,
|
||||
AppsListParams: CodexSchema.V2AppsListParams,
|
||||
AppsListResponse: CodexSchema.V2AppsListResponse,
|
||||
AppsReadParams: CodexSchema.V2AppsReadParams,
|
||||
AppsReadResponse: CodexSchema.V2AppsReadResponse,
|
||||
CancelLoginAccountParams: CodexSchema.V2CancelLoginAccountParams,
|
||||
CancelLoginAccountResponse: CodexSchema.V2CancelLoginAccountResponse,
|
||||
CommandExecOutputDeltaNotification: CodexSchema.V2CommandExecOutputDeltaNotification,
|
||||
@@ -35,8 +39,12 @@ export const v2 = {
|
||||
ConfigValueWriteParams: CodexSchema.V2ConfigValueWriteParams,
|
||||
ConfigWarningNotification: CodexSchema.V2ConfigWarningNotification,
|
||||
ConfigWriteResponse: CodexSchema.V2ConfigWriteResponse,
|
||||
ConsumeAccountRateLimitResetCreditParams: CodexSchema.V2ConsumeAccountRateLimitResetCreditParams,
|
||||
ConsumeAccountRateLimitResetCreditResponse:
|
||||
CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse,
|
||||
ContextCompactedNotification: CodexSchema.V2ContextCompactedNotification,
|
||||
DeprecationNoticeNotification: CodexSchema.V2DeprecationNoticeNotification,
|
||||
EnvironmentConnectionNotification: CodexSchema.V2EnvironmentConnectionNotification,
|
||||
ErrorNotification: CodexSchema.V2ErrorNotification,
|
||||
ExperimentalFeatureEnablementSetParams: CodexSchema.V2ExperimentalFeatureEnablementSetParams,
|
||||
ExperimentalFeatureEnablementSetResponse: CodexSchema.V2ExperimentalFeatureEnablementSetResponse,
|
||||
@@ -46,7 +54,11 @@ export const v2 = {
|
||||
ExternalAgentConfigDetectResponse: CodexSchema.V2ExternalAgentConfigDetectResponse,
|
||||
ExternalAgentConfigImportCompletedNotification:
|
||||
CodexSchema.V2ExternalAgentConfigImportCompletedNotification,
|
||||
ExternalAgentConfigImportHistoriesReadResponse:
|
||||
CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse,
|
||||
ExternalAgentConfigImportParams: CodexSchema.V2ExternalAgentConfigImportParams,
|
||||
ExternalAgentConfigImportProgressNotification:
|
||||
CodexSchema.V2ExternalAgentConfigImportProgressNotification,
|
||||
ExternalAgentConfigImportResponse: CodexSchema.V2ExternalAgentConfigImportResponse,
|
||||
FeedbackUploadParams: CodexSchema.V2FeedbackUploadParams,
|
||||
FeedbackUploadResponse: CodexSchema.V2FeedbackUploadResponse,
|
||||
@@ -75,6 +87,7 @@ export const v2 = {
|
||||
GetAccountRateLimitsResponse: CodexSchema.V2GetAccountRateLimitsResponse,
|
||||
GetAccountResponse: CodexSchema.V2GetAccountResponse,
|
||||
GetAccountTokenUsageResponse: CodexSchema.V2GetAccountTokenUsageResponse,
|
||||
GetWorkspaceMessagesResponse: CodexSchema.V2GetWorkspaceMessagesResponse,
|
||||
GuardianWarningNotification: CodexSchema.V2GuardianWarningNotification,
|
||||
HookCompletedNotification: CodexSchema.V2HookCompletedNotification,
|
||||
HooksListParams: CodexSchema.V2HooksListParams,
|
||||
@@ -112,6 +125,7 @@ export const v2 = {
|
||||
ModelProviderCapabilitiesReadParams: CodexSchema.V2ModelProviderCapabilitiesReadParams,
|
||||
ModelProviderCapabilitiesReadResponse: CodexSchema.V2ModelProviderCapabilitiesReadResponse,
|
||||
ModelReroutedNotification: CodexSchema.V2ModelReroutedNotification,
|
||||
ModelSafetyBufferingUpdatedNotification: CodexSchema.V2ModelSafetyBufferingUpdatedNotification,
|
||||
ModelVerificationNotification: CodexSchema.V2ModelVerificationNotification,
|
||||
PermissionProfileListParams: CodexSchema.V2PermissionProfileListParams,
|
||||
PermissionProfileListResponse: CodexSchema.V2PermissionProfileListResponse,
|
||||
@@ -140,6 +154,7 @@ export const v2 = {
|
||||
PluginUninstallResponse: CodexSchema.V2PluginUninstallResponse,
|
||||
ProcessExitedNotification: CodexSchema.V2ProcessExitedNotification,
|
||||
ProcessOutputDeltaNotification: CodexSchema.V2ProcessOutputDeltaNotification,
|
||||
RawResponseCompletedNotification: CodexSchema.V2RawResponseCompletedNotification,
|
||||
RawResponseItemCompletedNotification: CodexSchema.V2RawResponseItemCompletedNotification,
|
||||
ReasoningSummaryPartAddedNotification: CodexSchema.V2ReasoningSummaryPartAddedNotification,
|
||||
ReasoningSummaryTextDeltaNotification: CodexSchema.V2ReasoningSummaryTextDeltaNotification,
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -23,6 +23,15 @@ const decodeJson = Schema.decodeEffect(Schema.UnknownFromJsonString);
|
||||
const decodeAccountTokenUsageResponse = Schema.decodeUnknownEffect(
|
||||
CodexRpc.CLIENT_REQUEST_RESPONSES["account/usage/read"],
|
||||
);
|
||||
const decodeAccountRateLimitsResponse = Schema.decodeUnknownEffect(
|
||||
CodexRpc.CLIENT_REQUEST_RESPONSES["account/rateLimits/read"],
|
||||
);
|
||||
const decodeConsumeRateLimitResetCreditParams = Schema.decodeUnknownEffect(
|
||||
CodexRpc.CLIENT_REQUEST_PARAMS["account/rateLimitResetCredit/consume"],
|
||||
);
|
||||
const decodeConsumeRateLimitResetCreditResponse = Schema.decodeUnknownEffect(
|
||||
CodexRpc.CLIENT_REQUEST_RESPONSES["account/rateLimitResetCredit/consume"],
|
||||
);
|
||||
|
||||
it.layer(NodeServices.layer)("effect-codex-app-server protocol", (it) => {
|
||||
it.effect("maps account usage responses to the upstream token usage schema", () =>
|
||||
@@ -42,6 +51,83 @@ it.layer(NodeServices.layer)("effect-codex-app-server protocol", (it) => {
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("maps earned rate-limit reset credits from account rate-limit snapshots", () =>
|
||||
Effect.gen(function* () {
|
||||
assert.strictEqual(
|
||||
CodexRpc.CLIENT_REQUEST_RESPONSES["account/rateLimits/read"],
|
||||
CodexSchema.V2GetAccountRateLimitsResponse,
|
||||
);
|
||||
|
||||
const response = {
|
||||
rateLimits: {},
|
||||
rateLimitResetCredits: {
|
||||
availableCount: 2,
|
||||
credits: [
|
||||
{
|
||||
id: "RateLimitResetCredit_1",
|
||||
resetType: "codexRateLimits",
|
||||
status: "available",
|
||||
grantedAt: 1_781_654_400,
|
||||
expiresAt: 1_784_246_400,
|
||||
title: "Full reset",
|
||||
description: "Ready to redeem",
|
||||
},
|
||||
{
|
||||
id: "RateLimitResetCredit_2",
|
||||
resetType: "unknown",
|
||||
status: "unknown",
|
||||
grantedAt: 1_781_654_401,
|
||||
expiresAt: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
} as const;
|
||||
|
||||
assert.deepEqual(yield* decodeAccountRateLimitsResponse(response), response);
|
||||
assert.deepEqual(
|
||||
yield* decodeAccountRateLimitsResponse({
|
||||
rateLimits: {},
|
||||
rateLimitResetCredits: { availableCount: 2, credits: null },
|
||||
}),
|
||||
{
|
||||
rateLimits: {},
|
||||
rateLimitResetCredits: { availableCount: 2, credits: null },
|
||||
},
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("maps the earned rate-limit reset consume request and response", () =>
|
||||
Effect.gen(function* () {
|
||||
assert.equal(
|
||||
CodexRpc.CLIENT_REQUEST_METHODS["account/rateLimitResetCredit/consume"],
|
||||
"account/rateLimitResetCredit/consume",
|
||||
);
|
||||
assert.strictEqual(
|
||||
CodexRpc.CLIENT_REQUEST_PARAMS["account/rateLimitResetCredit/consume"],
|
||||
CodexSchema.V2ConsumeAccountRateLimitResetCreditParams,
|
||||
);
|
||||
assert.strictEqual(
|
||||
CodexRpc.CLIENT_REQUEST_RESPONSES["account/rateLimitResetCredit/consume"],
|
||||
CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse,
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
yield* decodeConsumeRateLimitResetCreditParams({
|
||||
idempotencyKey: "8ae96ff3-3425-4f4c-8772-b6fd61502868",
|
||||
creditId: "RateLimitResetCredit_1",
|
||||
}),
|
||||
{
|
||||
idempotencyKey: "8ae96ff3-3425-4f4c-8772-b6fd61502868",
|
||||
creditId: "RateLimitResetCredit_1",
|
||||
},
|
||||
);
|
||||
assert.deepEqual(yield* decodeConsumeRateLimitResetCreditResponse({ outcome: "reset" }), {
|
||||
outcome: "reset",
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect(
|
||||
"encodes requests without a jsonrpc field and routes inbound requests and notifications",
|
||||
() =>
|
||||
|
||||
Reference in new issue
Block a user