@excitedjs/tm 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/tm +76 -0
- package/package.json +39 -0
- package/resolver-register.mjs +7 -0
- package/resolver.mjs +86 -0
- package/src/cli/context.ts +63 -0
- package/src/cli/dispatch.ts +444 -0
- package/src/cli/errors.ts +45 -0
- package/src/cli/parse.ts +265 -0
- package/src/cli.ts +12 -0
- package/src/codex-protocol/AbsolutePathBuf.ts +14 -0
- package/src/codex-protocol/AgentPath.ts +5 -0
- package/src/codex-protocol/ApplyPatchApprovalParams.ts +21 -0
- package/src/codex-protocol/ApplyPatchApprovalResponse.ts +6 -0
- package/src/codex-protocol/AuthMode.ts +8 -0
- package/src/codex-protocol/AutoCompactTokenLimitScope.ts +9 -0
- package/src/codex-protocol/ClientInfo.ts +5 -0
- package/src/codex-protocol/ClientNotification.ts +5 -0
- package/src/codex-protocol/ClientRequest.ts +110 -0
- package/src/codex-protocol/CollaborationMode.ts +10 -0
- package/src/codex-protocol/ContentItem.ts +6 -0
- package/src/codex-protocol/ConversationGitInfo.ts +5 -0
- package/src/codex-protocol/ConversationSummary.ts +8 -0
- package/src/codex-protocol/ExecCommandApprovalParams.ts +16 -0
- package/src/codex-protocol/ExecCommandApprovalResponse.ts +6 -0
- package/src/codex-protocol/ExecPolicyAmendment.ts +12 -0
- package/src/codex-protocol/FileChange.ts +5 -0
- package/src/codex-protocol/ForcedLoginMethod.ts +5 -0
- package/src/codex-protocol/FunctionCallOutputBody.ts +6 -0
- package/src/codex-protocol/FunctionCallOutputContentItem.ts +10 -0
- package/src/codex-protocol/FuzzyFileSearchMatchType.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchParams.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchResponse.ts +6 -0
- package/src/codex-protocol/FuzzyFileSearchResult.ts +9 -0
- package/src/codex-protocol/FuzzyFileSearchSessionCompletedNotification.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchSessionStartParams.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchSessionStartResponse.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchSessionStopParams.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchSessionStopResponse.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchSessionUpdateParams.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchSessionUpdateResponse.ts +5 -0
- package/src/codex-protocol/FuzzyFileSearchSessionUpdatedNotification.ts +6 -0
- package/src/codex-protocol/GetAuthStatusParams.ts +5 -0
- package/src/codex-protocol/GetAuthStatusResponse.ts +6 -0
- package/src/codex-protocol/GetConversationSummaryParams.ts +6 -0
- package/src/codex-protocol/GetConversationSummaryResponse.ts +6 -0
- package/src/codex-protocol/GitDiffToRemoteParams.ts +5 -0
- package/src/codex-protocol/GitDiffToRemoteResponse.ts +6 -0
- package/src/codex-protocol/GitSha.ts +5 -0
- package/src/codex-protocol/ImageDetail.ts +5 -0
- package/src/codex-protocol/InitializeCapabilities.ts +21 -0
- package/src/codex-protocol/InitializeParams.ts +7 -0
- package/src/codex-protocol/InitializeResponse.ts +20 -0
- package/src/codex-protocol/InputModality.ts +8 -0
- package/src/codex-protocol/InternalSessionSource.ts +5 -0
- package/src/codex-protocol/LocalShellAction.ts +6 -0
- package/src/codex-protocol/LocalShellExecAction.ts +5 -0
- package/src/codex-protocol/LocalShellStatus.ts +5 -0
- package/src/codex-protocol/MessagePhase.ts +11 -0
- package/src/codex-protocol/ModeKind.ts +8 -0
- package/src/codex-protocol/NetworkPolicyAmendment.ts +6 -0
- package/src/codex-protocol/NetworkPolicyRuleAction.ts +5 -0
- package/src/codex-protocol/ParsedCommand.ts +12 -0
- package/src/codex-protocol/Personality.ts +5 -0
- package/src/codex-protocol/PlanType.ts +5 -0
- package/src/codex-protocol/RealtimeConversationVersion.ts +5 -0
- package/src/codex-protocol/RealtimeOutputModality.ts +5 -0
- package/src/codex-protocol/RealtimeVoice.ts +5 -0
- package/src/codex-protocol/RealtimeVoicesList.ts +6 -0
- package/src/codex-protocol/ReasoningEffort.ts +8 -0
- package/src/codex-protocol/ReasoningItemContent.ts +5 -0
- package/src/codex-protocol/ReasoningItemReasoningSummary.ts +5 -0
- package/src/codex-protocol/ReasoningSummary.ts +10 -0
- package/src/codex-protocol/RequestId.ts +5 -0
- package/src/codex-protocol/Resource.ts +9 -0
- package/src/codex-protocol/ResourceContent.ts +17 -0
- package/src/codex-protocol/ResourceTemplate.ts +9 -0
- package/src/codex-protocol/ResponseItem.ts +17 -0
- package/src/codex-protocol/ReviewDecision.ts +10 -0
- package/src/codex-protocol/ServerNotification.ts +73 -0
- package/src/codex-protocol/ServerRequest.ts +19 -0
- package/src/codex-protocol/SessionSource.ts +7 -0
- package/src/codex-protocol/Settings.ts +9 -0
- package/src/codex-protocol/SubAgentSource.ts +7 -0
- package/src/codex-protocol/ThreadId.ts +5 -0
- package/src/codex-protocol/ThreadMemoryMode.ts +5 -0
- package/src/codex-protocol/Tool.ts +9 -0
- package/src/codex-protocol/Verbosity.ts +9 -0
- package/src/codex-protocol/WebSearchAction.ts +5 -0
- package/src/codex-protocol/WebSearchContextSize.ts +5 -0
- package/src/codex-protocol/WebSearchLocation.ts +5 -0
- package/src/codex-protocol/WebSearchMode.ts +5 -0
- package/src/codex-protocol/WebSearchToolConfig.ts +7 -0
- package/src/codex-protocol/index.ts +86 -0
- package/src/codex-protocol/serde_json/JsonValue.ts +5 -0
- package/src/codex-protocol/v2/Account.ts +6 -0
- package/src/codex-protocol/v2/AccountLoginCompletedNotification.ts +5 -0
- package/src/codex-protocol/v2/AccountRateLimitsUpdatedNotification.ts +6 -0
- package/src/codex-protocol/v2/AccountUpdatedNotification.ts +7 -0
- package/src/codex-protocol/v2/ActivePermissionProfile.ts +15 -0
- package/src/codex-protocol/v2/AddCreditsNudgeCreditType.ts +5 -0
- package/src/codex-protocol/v2/AddCreditsNudgeEmailStatus.ts +5 -0
- package/src/codex-protocol/v2/AdditionalFileSystemPermissions.ts +15 -0
- package/src/codex-protocol/v2/AdditionalNetworkPermissions.ts +5 -0
- package/src/codex-protocol/v2/AdditionalPermissionProfile.ts +11 -0
- package/src/codex-protocol/v2/AgentMessageDeltaNotification.ts +5 -0
- package/src/codex-protocol/v2/AnalyticsConfig.ts +6 -0
- package/src/codex-protocol/v2/AppBranding.ts +8 -0
- package/src/codex-protocol/v2/AppInfo.ts +19 -0
- package/src/codex-protocol/v2/AppListUpdatedNotification.ts +9 -0
- package/src/codex-protocol/v2/AppMetadata.ts +7 -0
- package/src/codex-protocol/v2/AppReview.ts +5 -0
- package/src/codex-protocol/v2/AppScreenshot.ts +5 -0
- package/src/codex-protocol/v2/AppSummary.ts +8 -0
- package/src/codex-protocol/v2/AppToolApproval.ts +5 -0
- package/src/codex-protocol/v2/AppToolsConfig.ts +6 -0
- package/src/codex-protocol/v2/ApprovalsReviewer.ts +12 -0
- package/src/codex-protocol/v2/AppsConfig.ts +8 -0
- package/src/codex-protocol/v2/AppsDefaultConfig.ts +5 -0
- package/src/codex-protocol/v2/AppsListParams.ts +24 -0
- package/src/codex-protocol/v2/AppsListResponse.ts +14 -0
- package/src/codex-protocol/v2/AskForApproval.ts +5 -0
- package/src/codex-protocol/v2/AttestationGenerateParams.ts +5 -0
- package/src/codex-protocol/v2/AttestationGenerateResponse.ts +9 -0
- package/src/codex-protocol/v2/AutoReviewDecisionSource.ts +8 -0
- package/src/codex-protocol/v2/ByteRange.ts +5 -0
- package/src/codex-protocol/v2/CancelLoginAccountParams.ts +5 -0
- package/src/codex-protocol/v2/CancelLoginAccountResponse.ts +6 -0
- package/src/codex-protocol/v2/CancelLoginAccountStatus.ts +5 -0
- package/src/codex-protocol/v2/ChatgptAuthTokensRefreshParams.ts +16 -0
- package/src/codex-protocol/v2/ChatgptAuthTokensRefreshReason.ts +5 -0
- package/src/codex-protocol/v2/ChatgptAuthTokensRefreshResponse.ts +5 -0
- package/src/codex-protocol/v2/CodexErrorInfo.ts +12 -0
- package/src/codex-protocol/v2/CollabAgentState.ts +6 -0
- package/src/codex-protocol/v2/CollabAgentStatus.ts +5 -0
- package/src/codex-protocol/v2/CollabAgentTool.ts +5 -0
- package/src/codex-protocol/v2/CollabAgentToolCallStatus.ts +5 -0
- package/src/codex-protocol/v2/CollaborationModeListParams.ts +8 -0
- package/src/codex-protocol/v2/CollaborationModeListResponse.ts +9 -0
- package/src/codex-protocol/v2/CollaborationModeMask.ts +10 -0
- package/src/codex-protocol/v2/CommandAction.ts +6 -0
- package/src/codex-protocol/v2/CommandExecOutputDeltaNotification.ts +30 -0
- package/src/codex-protocol/v2/CommandExecOutputStream.ts +8 -0
- package/src/codex-protocol/v2/CommandExecParams.ts +105 -0
- package/src/codex-protocol/v2/CommandExecResizeParams.ts +18 -0
- package/src/codex-protocol/v2/CommandExecResizeResponse.ts +8 -0
- package/src/codex-protocol/v2/CommandExecResponse.ts +24 -0
- package/src/codex-protocol/v2/CommandExecTerminalSize.ts +16 -0
- package/src/codex-protocol/v2/CommandExecTerminateParams.ts +13 -0
- package/src/codex-protocol/v2/CommandExecTerminateResponse.ts +8 -0
- package/src/codex-protocol/v2/CommandExecWriteParams.ts +22 -0
- package/src/codex-protocol/v2/CommandExecWriteResponse.ts +8 -0
- package/src/codex-protocol/v2/CommandExecutionApprovalDecision.ts +7 -0
- package/src/codex-protocol/v2/CommandExecutionOutputDeltaNotification.ts +5 -0
- package/src/codex-protocol/v2/CommandExecutionRequestApprovalParams.ts +62 -0
- package/src/codex-protocol/v2/CommandExecutionRequestApprovalResponse.ts +6 -0
- package/src/codex-protocol/v2/CommandExecutionSource.ts +5 -0
- package/src/codex-protocol/v2/CommandExecutionStatus.ts +5 -0
- package/src/codex-protocol/v2/CommandMigration.ts +5 -0
- package/src/codex-protocol/v2/ComputerUseRequirements.ts +5 -0
- package/src/codex-protocol/v2/Config.ts +26 -0
- package/src/codex-protocol/v2/ConfigBatchWriteParams.ts +14 -0
- package/src/codex-protocol/v2/ConfigEdit.ts +7 -0
- package/src/codex-protocol/v2/ConfigLayer.ts +7 -0
- package/src/codex-protocol/v2/ConfigLayerMetadata.ts +6 -0
- package/src/codex-protocol/v2/ConfigLayerSource.ts +21 -0
- package/src/codex-protocol/v2/ConfigReadParams.ts +11 -0
- package/src/codex-protocol/v2/ConfigReadResponse.ts +8 -0
- package/src/codex-protocol/v2/ConfigRequirements.ts +13 -0
- package/src/codex-protocol/v2/ConfigRequirementsReadResponse.ts +10 -0
- package/src/codex-protocol/v2/ConfigValueWriteParams.ts +11 -0
- package/src/codex-protocol/v2/ConfigWarningNotification.ts +22 -0
- package/src/codex-protocol/v2/ConfigWriteResponse.ts +12 -0
- package/src/codex-protocol/v2/ConfiguredHookHandler.ts +5 -0
- package/src/codex-protocol/v2/ConfiguredHookMatcherGroup.ts +6 -0
- package/src/codex-protocol/v2/ContextCompactedNotification.ts +8 -0
- package/src/codex-protocol/v2/CreditsSnapshot.ts +5 -0
- package/src/codex-protocol/v2/DeprecationNoticeNotification.ts +13 -0
- package/src/codex-protocol/v2/DynamicToolCallOutputContentItem.ts +5 -0
- package/src/codex-protocol/v2/DynamicToolCallParams.ts +6 -0
- package/src/codex-protocol/v2/DynamicToolCallResponse.ts +6 -0
- package/src/codex-protocol/v2/DynamicToolCallStatus.ts +5 -0
- package/src/codex-protocol/v2/DynamicToolSpec.ts +6 -0
- package/src/codex-protocol/v2/EnvironmentAddParams.ts +5 -0
- package/src/codex-protocol/v2/EnvironmentAddResponse.ts +5 -0
- package/src/codex-protocol/v2/ErrorNotification.ts +6 -0
- package/src/codex-protocol/v2/ExecPolicyAmendment.ts +5 -0
- package/src/codex-protocol/v2/ExperimentalFeature.ts +37 -0
- package/src/codex-protocol/v2/ExperimentalFeatureEnablementSetParams.ts +12 -0
- package/src/codex-protocol/v2/ExperimentalFeatureEnablementSetResponse.ts +9 -0
- package/src/codex-protocol/v2/ExperimentalFeatureListParams.ts +19 -0
- package/src/codex-protocol/v2/ExperimentalFeatureListResponse.ts +11 -0
- package/src/codex-protocol/v2/ExperimentalFeatureStage.ts +5 -0
- package/src/codex-protocol/v2/ExternalAgentConfigDetectParams.ts +13 -0
- package/src/codex-protocol/v2/ExternalAgentConfigDetectResponse.ts +6 -0
- package/src/codex-protocol/v2/ExternalAgentConfigImportCompletedNotification.ts +5 -0
- package/src/codex-protocol/v2/ExternalAgentConfigImportParams.ts +6 -0
- package/src/codex-protocol/v2/ExternalAgentConfigImportResponse.ts +5 -0
- package/src/codex-protocol/v2/ExternalAgentConfigMigrationItem.ts +11 -0
- package/src/codex-protocol/v2/ExternalAgentConfigMigrationItemType.ts +5 -0
- package/src/codex-protocol/v2/FeedbackUploadParams.ts +5 -0
- package/src/codex-protocol/v2/FeedbackUploadResponse.ts +5 -0
- package/src/codex-protocol/v2/FileChangeApprovalDecision.ts +5 -0
- package/src/codex-protocol/v2/FileChangeOutputDeltaNotification.ts +10 -0
- package/src/codex-protocol/v2/FileChangePatchUpdatedNotification.ts +6 -0
- package/src/codex-protocol/v2/FileChangeRequestApprovalParams.ts +18 -0
- package/src/codex-protocol/v2/FileChangeRequestApprovalResponse.ts +6 -0
- package/src/codex-protocol/v2/FileSystemAccessMode.ts +5 -0
- package/src/codex-protocol/v2/FileSystemPath.ts +7 -0
- package/src/codex-protocol/v2/FileSystemSandboxEntry.ts +7 -0
- package/src/codex-protocol/v2/FileSystemSpecialPath.ts +5 -0
- package/src/codex-protocol/v2/FileUpdateChange.ts +6 -0
- package/src/codex-protocol/v2/ForcedChatgptWorkspaceIds.ts +8 -0
- package/src/codex-protocol/v2/FsChangedNotification.ts +17 -0
- package/src/codex-protocol/v2/FsCopyParams.ts +21 -0
- package/src/codex-protocol/v2/FsCopyResponse.ts +8 -0
- package/src/codex-protocol/v2/FsCreateDirectoryParams.ts +17 -0
- package/src/codex-protocol/v2/FsCreateDirectoryResponse.ts +8 -0
- package/src/codex-protocol/v2/FsGetMetadataParams.ts +13 -0
- package/src/codex-protocol/v2/FsGetMetadataResponse.ts +28 -0
- package/src/codex-protocol/v2/FsReadDirectoryEntry.ts +20 -0
- package/src/codex-protocol/v2/FsReadDirectoryParams.ts +13 -0
- package/src/codex-protocol/v2/FsReadDirectoryResponse.ts +13 -0
- package/src/codex-protocol/v2/FsReadFileParams.ts +13 -0
- package/src/codex-protocol/v2/FsReadFileResponse.ts +12 -0
- package/src/codex-protocol/v2/FsRemoveParams.ts +21 -0
- package/src/codex-protocol/v2/FsRemoveResponse.ts +8 -0
- package/src/codex-protocol/v2/FsUnwatchParams.ts +12 -0
- package/src/codex-protocol/v2/FsUnwatchResponse.ts +8 -0
- package/src/codex-protocol/v2/FsWatchParams.ts +17 -0
- package/src/codex-protocol/v2/FsWatchResponse.ts +13 -0
- package/src/codex-protocol/v2/FsWriteFileParams.ts +17 -0
- package/src/codex-protocol/v2/FsWriteFileResponse.ts +8 -0
- package/src/codex-protocol/v2/GetAccountParams.ts +13 -0
- package/src/codex-protocol/v2/GetAccountRateLimitsResponse.ts +14 -0
- package/src/codex-protocol/v2/GetAccountResponse.ts +6 -0
- package/src/codex-protocol/v2/GitInfo.ts +5 -0
- package/src/codex-protocol/v2/GrantedPermissionProfile.ts +7 -0
- package/src/codex-protocol/v2/GuardianApprovalReview.ts +13 -0
- package/src/codex-protocol/v2/GuardianApprovalReviewAction.ts +9 -0
- package/src/codex-protocol/v2/GuardianApprovalReviewStatus.ts +8 -0
- package/src/codex-protocol/v2/GuardianCommandSource.ts +5 -0
- package/src/codex-protocol/v2/GuardianRiskLevel.ts +8 -0
- package/src/codex-protocol/v2/GuardianUserAuthorization.ts +8 -0
- package/src/codex-protocol/v2/GuardianWarningNotification.ts +13 -0
- package/src/codex-protocol/v2/HookCompletedNotification.ts +6 -0
- package/src/codex-protocol/v2/HookErrorInfo.ts +5 -0
- package/src/codex-protocol/v2/HookEventName.ts +5 -0
- package/src/codex-protocol/v2/HookExecutionMode.ts +5 -0
- package/src/codex-protocol/v2/HookHandlerType.ts +5 -0
- package/src/codex-protocol/v2/HookMetadata.ts +10 -0
- package/src/codex-protocol/v2/HookMigration.ts +5 -0
- package/src/codex-protocol/v2/HookOutputEntry.ts +6 -0
- package/src/codex-protocol/v2/HookOutputEntryKind.ts +5 -0
- package/src/codex-protocol/v2/HookPromptFragment.ts +5 -0
- package/src/codex-protocol/v2/HookRunStatus.ts +5 -0
- package/src/codex-protocol/v2/HookRunSummary.ts +13 -0
- package/src/codex-protocol/v2/HookScope.ts +5 -0
- package/src/codex-protocol/v2/HookSource.ts +5 -0
- package/src/codex-protocol/v2/HookStartedNotification.ts +6 -0
- package/src/codex-protocol/v2/HookTrustStatus.ts +5 -0
- package/src/codex-protocol/v2/HooksListEntry.ts +7 -0
- package/src/codex-protocol/v2/HooksListParams.ts +9 -0
- package/src/codex-protocol/v2/HooksListResponse.ts +6 -0
- package/src/codex-protocol/v2/ItemCompletedNotification.ts +10 -0
- package/src/codex-protocol/v2/ItemGuardianApprovalReviewCompletedNotification.ts +38 -0
- package/src/codex-protocol/v2/ItemGuardianApprovalReviewStartedNotification.ts +33 -0
- package/src/codex-protocol/v2/ItemStartedNotification.ts +10 -0
- package/src/codex-protocol/v2/ListMcpServerStatusParams.ts +19 -0
- package/src/codex-protocol/v2/ListMcpServerStatusResponse.ts +11 -0
- package/src/codex-protocol/v2/LoginAccountParams.ts +21 -0
- package/src/codex-protocol/v2/LoginAccountResponse.ts +17 -0
- package/src/codex-protocol/v2/LogoutAccountResponse.ts +5 -0
- package/src/codex-protocol/v2/ManagedHooksRequirements.ts +6 -0
- package/src/codex-protocol/v2/MarketplaceAddParams.ts +5 -0
- package/src/codex-protocol/v2/MarketplaceAddResponse.ts +6 -0
- package/src/codex-protocol/v2/MarketplaceInterface.ts +5 -0
- package/src/codex-protocol/v2/MarketplaceLoadErrorInfo.ts +6 -0
- package/src/codex-protocol/v2/MarketplaceRemoveParams.ts +5 -0
- package/src/codex-protocol/v2/MarketplaceRemoveResponse.ts +6 -0
- package/src/codex-protocol/v2/MarketplaceUpgradeErrorInfo.ts +5 -0
- package/src/codex-protocol/v2/MarketplaceUpgradeParams.ts +5 -0
- package/src/codex-protocol/v2/MarketplaceUpgradeResponse.ts +7 -0
- package/src/codex-protocol/v2/McpAuthStatus.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationArrayType.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationBooleanSchema.ts +6 -0
- package/src/codex-protocol/v2/McpElicitationBooleanType.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationConstOption.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationEnumSchema.ts +8 -0
- package/src/codex-protocol/v2/McpElicitationLegacyTitledEnumSchema.ts +6 -0
- package/src/codex-protocol/v2/McpElicitationMultiSelectEnumSchema.ts +7 -0
- package/src/codex-protocol/v2/McpElicitationNumberSchema.ts +6 -0
- package/src/codex-protocol/v2/McpElicitationNumberType.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationObjectType.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationPrimitiveSchema.ts +9 -0
- package/src/codex-protocol/v2/McpElicitationSchema.ts +13 -0
- package/src/codex-protocol/v2/McpElicitationSingleSelectEnumSchema.ts +7 -0
- package/src/codex-protocol/v2/McpElicitationStringFormat.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationStringSchema.ts +7 -0
- package/src/codex-protocol/v2/McpElicitationStringType.ts +5 -0
- package/src/codex-protocol/v2/McpElicitationTitledEnumItems.ts +6 -0
- package/src/codex-protocol/v2/McpElicitationTitledMultiSelectEnumSchema.ts +7 -0
- package/src/codex-protocol/v2/McpElicitationTitledSingleSelectEnumSchema.ts +7 -0
- package/src/codex-protocol/v2/McpElicitationUntitledEnumItems.ts +6 -0
- package/src/codex-protocol/v2/McpElicitationUntitledMultiSelectEnumSchema.ts +7 -0
- package/src/codex-protocol/v2/McpElicitationUntitledSingleSelectEnumSchema.ts +6 -0
- package/src/codex-protocol/v2/McpResourceReadParams.ts +5 -0
- package/src/codex-protocol/v2/McpResourceReadResponse.ts +6 -0
- package/src/codex-protocol/v2/McpServerElicitationAction.ts +5 -0
- package/src/codex-protocol/v2/McpServerElicitationRequestParams.ts +16 -0
- package/src/codex-protocol/v2/McpServerElicitationRequestResponse.ts +17 -0
- package/src/codex-protocol/v2/McpServerMigration.ts +5 -0
- package/src/codex-protocol/v2/McpServerOauthLoginCompletedNotification.ts +5 -0
- package/src/codex-protocol/v2/McpServerOauthLoginParams.ts +5 -0
- package/src/codex-protocol/v2/McpServerOauthLoginResponse.ts +5 -0
- package/src/codex-protocol/v2/McpServerRefreshResponse.ts +5 -0
- package/src/codex-protocol/v2/McpServerStartupState.ts +5 -0
- package/src/codex-protocol/v2/McpServerStatus.ts +9 -0
- package/src/codex-protocol/v2/McpServerStatusDetail.ts +5 -0
- package/src/codex-protocol/v2/McpServerStatusUpdatedNotification.ts +6 -0
- package/src/codex-protocol/v2/McpServerToolCallParams.ts +6 -0
- package/src/codex-protocol/v2/McpServerToolCallResponse.ts +6 -0
- package/src/codex-protocol/v2/McpToolCallError.ts +5 -0
- package/src/codex-protocol/v2/McpToolCallProgressNotification.ts +5 -0
- package/src/codex-protocol/v2/McpToolCallResult.ts +6 -0
- package/src/codex-protocol/v2/McpToolCallStatus.ts +5 -0
- package/src/codex-protocol/v2/MemoryCitation.ts +6 -0
- package/src/codex-protocol/v2/MemoryCitationEntry.ts +5 -0
- package/src/codex-protocol/v2/MemoryResetResponse.ts +5 -0
- package/src/codex-protocol/v2/MergeStrategy.ts +5 -0
- package/src/codex-protocol/v2/MigrationDetails.ts +11 -0
- package/src/codex-protocol/v2/MockExperimentalMethodParams.ts +9 -0
- package/src/codex-protocol/v2/MockExperimentalMethodResponse.ts +9 -0
- package/src/codex-protocol/v2/Model.ts +19 -0
- package/src/codex-protocol/v2/ModelAvailabilityNux.ts +5 -0
- package/src/codex-protocol/v2/ModelListParams.ts +17 -0
- package/src/codex-protocol/v2/ModelListResponse.ts +11 -0
- package/src/codex-protocol/v2/ModelProviderCapabilitiesReadParams.ts +5 -0
- package/src/codex-protocol/v2/ModelProviderCapabilitiesReadResponse.ts +5 -0
- package/src/codex-protocol/v2/ModelRerouteReason.ts +5 -0
- package/src/codex-protocol/v2/ModelReroutedNotification.ts +6 -0
- package/src/codex-protocol/v2/ModelServiceTier.ts +5 -0
- package/src/codex-protocol/v2/ModelUpgradeInfo.ts +5 -0
- package/src/codex-protocol/v2/ModelVerification.ts +5 -0
- package/src/codex-protocol/v2/ModelVerificationNotification.ts +6 -0
- package/src/codex-protocol/v2/NetworkAccess.ts +5 -0
- package/src/codex-protocol/v2/NetworkApprovalContext.ts +6 -0
- package/src/codex-protocol/v2/NetworkApprovalProtocol.ts +5 -0
- package/src/codex-protocol/v2/NetworkDomainPermission.ts +5 -0
- package/src/codex-protocol/v2/NetworkPolicyAmendment.ts +6 -0
- package/src/codex-protocol/v2/NetworkPolicyRuleAction.ts +5 -0
- package/src/codex-protocol/v2/NetworkRequirements.ts +32 -0
- package/src/codex-protocol/v2/NetworkUnixSocketPermission.ts +5 -0
- package/src/codex-protocol/v2/NonSteerableTurnKind.ts +5 -0
- package/src/codex-protocol/v2/OverriddenMetadata.ts +7 -0
- package/src/codex-protocol/v2/PatchApplyStatus.ts +5 -0
- package/src/codex-protocol/v2/PatchChangeKind.ts +5 -0
- package/src/codex-protocol/v2/PermissionGrantScope.ts +5 -0
- package/src/codex-protocol/v2/PermissionProfileListParams.ts +17 -0
- package/src/codex-protocol/v2/PermissionProfileListResponse.ts +11 -0
- package/src/codex-protocol/v2/PermissionProfileSummary.ts +13 -0
- package/src/codex-protocol/v2/PermissionsRequestApprovalParams.ts +11 -0
- package/src/codex-protocol/v2/PermissionsRequestApprovalResponse.ts +11 -0
- package/src/codex-protocol/v2/PlanDeltaNotification.ts +9 -0
- package/src/codex-protocol/v2/PluginAuthPolicy.ts +5 -0
- package/src/codex-protocol/v2/PluginAvailability.ts +5 -0
- package/src/codex-protocol/v2/PluginDetail.ts +10 -0
- package/src/codex-protocol/v2/PluginHookSummary.ts +6 -0
- package/src/codex-protocol/v2/PluginInstallParams.ts +6 -0
- package/src/codex-protocol/v2/PluginInstallPolicy.ts +5 -0
- package/src/codex-protocol/v2/PluginInstallResponse.ts +7 -0
- package/src/codex-protocol/v2/PluginInstalledParams.ts +15 -0
- package/src/codex-protocol/v2/PluginInstalledResponse.ts +7 -0
- package/src/codex-protocol/v2/PluginInterface.ts +35 -0
- package/src/codex-protocol/v2/PluginListMarketplaceKind.ts +5 -0
- package/src/codex-protocol/v2/PluginListParams.ts +17 -0
- package/src/codex-protocol/v2/PluginListResponse.ts +7 -0
- package/src/codex-protocol/v2/PluginMarketplaceEntry.ts +13 -0
- package/src/codex-protocol/v2/PluginReadParams.ts +6 -0
- package/src/codex-protocol/v2/PluginReadResponse.ts +6 -0
- package/src/codex-protocol/v2/PluginShareCheckoutParams.ts +5 -0
- package/src/codex-protocol/v2/PluginShareCheckoutResponse.ts +6 -0
- package/src/codex-protocol/v2/PluginShareContext.ts +11 -0
- package/src/codex-protocol/v2/PluginShareDeleteParams.ts +5 -0
- package/src/codex-protocol/v2/PluginShareDeleteResponse.ts +5 -0
- package/src/codex-protocol/v2/PluginShareDiscoverability.ts +5 -0
- package/src/codex-protocol/v2/PluginShareListItem.ts +7 -0
- package/src/codex-protocol/v2/PluginShareListParams.ts +5 -0
- package/src/codex-protocol/v2/PluginShareListResponse.ts +6 -0
- package/src/codex-protocol/v2/PluginSharePrincipal.ts +7 -0
- package/src/codex-protocol/v2/PluginSharePrincipalRole.ts +5 -0
- package/src/codex-protocol/v2/PluginSharePrincipalType.ts +5 -0
- package/src/codex-protocol/v2/PluginShareSaveParams.ts +8 -0
- package/src/codex-protocol/v2/PluginShareSaveResponse.ts +5 -0
- package/src/codex-protocol/v2/PluginShareTarget.ts +7 -0
- package/src/codex-protocol/v2/PluginShareTargetRole.ts +5 -0
- package/src/codex-protocol/v2/PluginShareUpdateDiscoverability.ts +5 -0
- package/src/codex-protocol/v2/PluginShareUpdateTargetsParams.ts +7 -0
- package/src/codex-protocol/v2/PluginShareUpdateTargetsResponse.ts +7 -0
- package/src/codex-protocol/v2/PluginSkillReadParams.ts +5 -0
- package/src/codex-protocol/v2/PluginSkillReadResponse.ts +5 -0
- package/src/codex-protocol/v2/PluginSource.ts +6 -0
- package/src/codex-protocol/v2/PluginSummary.ts +27 -0
- package/src/codex-protocol/v2/PluginUninstallParams.ts +5 -0
- package/src/codex-protocol/v2/PluginUninstallResponse.ts +5 -0
- package/src/codex-protocol/v2/PluginsMigration.ts +5 -0
- package/src/codex-protocol/v2/ProcessExitedNotification.ts +42 -0
- package/src/codex-protocol/v2/ProcessKillParams.ts +12 -0
- package/src/codex-protocol/v2/ProcessKillResponse.ts +8 -0
- package/src/codex-protocol/v2/ProcessOutputDeltaNotification.ts +26 -0
- package/src/codex-protocol/v2/ProcessOutputStream.ts +8 -0
- package/src/codex-protocol/v2/ProcessResizePtyParams.ts +17 -0
- package/src/codex-protocol/v2/ProcessResizePtyResponse.ts +8 -0
- package/src/codex-protocol/v2/ProcessSpawnParams.ts +73 -0
- package/src/codex-protocol/v2/ProcessSpawnResponse.ts +8 -0
- package/src/codex-protocol/v2/ProcessTerminalSize.ts +16 -0
- package/src/codex-protocol/v2/ProcessWriteStdinParams.ts +21 -0
- package/src/codex-protocol/v2/ProcessWriteStdinResponse.ts +8 -0
- package/src/codex-protocol/v2/ProfileV2.ts +19 -0
- package/src/codex-protocol/v2/RateLimitReachedType.ts +5 -0
- package/src/codex-protocol/v2/RateLimitSnapshot.ts +9 -0
- package/src/codex-protocol/v2/RateLimitWindow.ts +5 -0
- package/src/codex-protocol/v2/RawResponseItemCompletedNotification.ts +6 -0
- package/src/codex-protocol/v2/ReasoningEffortOption.ts +6 -0
- package/src/codex-protocol/v2/ReasoningSummaryPartAddedNotification.ts +5 -0
- package/src/codex-protocol/v2/ReasoningSummaryTextDeltaNotification.ts +5 -0
- package/src/codex-protocol/v2/ReasoningTextDeltaNotification.ts +5 -0
- package/src/codex-protocol/v2/RemoteControlConnectionStatus.ts +5 -0
- package/src/codex-protocol/v2/RemoteControlDisableResponse.ts +6 -0
- package/src/codex-protocol/v2/RemoteControlEnableResponse.ts +6 -0
- package/src/codex-protocol/v2/RemoteControlStatusChangedNotification.ts +9 -0
- package/src/codex-protocol/v2/RemoteControlStatusReadResponse.ts +6 -0
- package/src/codex-protocol/v2/RequestPermissionProfile.ts +7 -0
- package/src/codex-protocol/v2/ResidencyRequirement.ts +5 -0
- package/src/codex-protocol/v2/ReviewDelivery.ts +5 -0
- package/src/codex-protocol/v2/ReviewStartParams.ts +12 -0
- package/src/codex-protocol/v2/ReviewStartResponse.ts +13 -0
- package/src/codex-protocol/v2/ReviewTarget.ts +9 -0
- package/src/codex-protocol/v2/SandboxMode.ts +5 -0
- package/src/codex-protocol/v2/SandboxPolicy.ts +7 -0
- package/src/codex-protocol/v2/SandboxWorkspaceWrite.ts +5 -0
- package/src/codex-protocol/v2/SendAddCreditsNudgeEmailParams.ts +6 -0
- package/src/codex-protocol/v2/SendAddCreditsNudgeEmailResponse.ts +6 -0
- package/src/codex-protocol/v2/ServerRequestResolvedNotification.ts +6 -0
- package/src/codex-protocol/v2/SessionMigration.ts +5 -0
- package/src/codex-protocol/v2/SessionSource.ts +6 -0
- package/src/codex-protocol/v2/SkillDependencies.ts +6 -0
- package/src/codex-protocol/v2/SkillErrorInfo.ts +5 -0
- package/src/codex-protocol/v2/SkillInterface.ts +6 -0
- package/src/codex-protocol/v2/SkillMetadata.ts +13 -0
- package/src/codex-protocol/v2/SkillScope.ts +5 -0
- package/src/codex-protocol/v2/SkillSummary.ts +7 -0
- package/src/codex-protocol/v2/SkillToolDependency.ts +5 -0
- package/src/codex-protocol/v2/SkillsChangedNotification.ts +11 -0
- package/src/codex-protocol/v2/SkillsConfigWriteParams.ts +14 -0
- package/src/codex-protocol/v2/SkillsConfigWriteResponse.ts +5 -0
- package/src/codex-protocol/v2/SkillsListEntry.ts +7 -0
- package/src/codex-protocol/v2/SkillsListParams.ts +13 -0
- package/src/codex-protocol/v2/SkillsListResponse.ts +6 -0
- package/src/codex-protocol/v2/SortDirection.ts +5 -0
- package/src/codex-protocol/v2/SubagentMigration.ts +5 -0
- package/src/codex-protocol/v2/TerminalInteractionNotification.ts +5 -0
- package/src/codex-protocol/v2/TextElement.ts +14 -0
- package/src/codex-protocol/v2/TextPosition.ts +13 -0
- package/src/codex-protocol/v2/TextRange.ts +6 -0
- package/src/codex-protocol/v2/Thread.ts +86 -0
- package/src/codex-protocol/v2/ThreadActiveFlag.ts +5 -0
- package/src/codex-protocol/v2/ThreadApproveGuardianDeniedActionParams.ts +10 -0
- package/src/codex-protocol/v2/ThreadApproveGuardianDeniedActionResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadArchiveParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadArchiveResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadArchivedNotification.ts +5 -0
- package/src/codex-protocol/v2/ThreadBackgroundTerminalsCleanParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadBackgroundTerminalsCleanResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadClosedNotification.ts +5 -0
- package/src/codex-protocol/v2/ThreadCompactStartParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadCompactStartResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadDecrementElicitationParams.ts +12 -0
- package/src/codex-protocol/v2/ThreadDecrementElicitationResponse.ts +16 -0
- package/src/codex-protocol/v2/ThreadForkParams.ts +60 -0
- package/src/codex-protocol/v2/ThreadForkResponse.ts +35 -0
- package/src/codex-protocol/v2/ThreadGoal.ts +6 -0
- package/src/codex-protocol/v2/ThreadGoalClearParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadGoalClearResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadGoalClearedNotification.ts +5 -0
- package/src/codex-protocol/v2/ThreadGoalGetParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadGoalGetResponse.ts +6 -0
- package/src/codex-protocol/v2/ThreadGoalSetParams.ts +6 -0
- package/src/codex-protocol/v2/ThreadGoalSetResponse.ts +6 -0
- package/src/codex-protocol/v2/ThreadGoalStatus.ts +5 -0
- package/src/codex-protocol/v2/ThreadGoalUpdatedNotification.ts +6 -0
- package/src/codex-protocol/v2/ThreadIncrementElicitationParams.ts +12 -0
- package/src/codex-protocol/v2/ThreadIncrementElicitationResponse.ts +16 -0
- package/src/codex-protocol/v2/ThreadInjectItemsParams.ts +10 -0
- package/src/codex-protocol/v2/ThreadInjectItemsResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadItem.ts +101 -0
- package/src/codex-protocol/v2/ThreadListParams.ts +54 -0
- package/src/codex-protocol/v2/ThreadListResponse.ts +18 -0
- package/src/codex-protocol/v2/ThreadLoadedListParams.ts +13 -0
- package/src/codex-protocol/v2/ThreadLoadedListResponse.ts +14 -0
- package/src/codex-protocol/v2/ThreadMemoryModeSetParams.ts +6 -0
- package/src/codex-protocol/v2/ThreadMemoryModeSetResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadMetadataGitInfoUpdateParams.ts +20 -0
- package/src/codex-protocol/v2/ThreadMetadataUpdateParams.ts +12 -0
- package/src/codex-protocol/v2/ThreadMetadataUpdateResponse.ts +6 -0
- package/src/codex-protocol/v2/ThreadNameUpdatedNotification.ts +5 -0
- package/src/codex-protocol/v2/ThreadReadParams.ts +9 -0
- package/src/codex-protocol/v2/ThreadReadResponse.ts +6 -0
- package/src/codex-protocol/v2/ThreadRealtimeAppendAudioParams.ts +9 -0
- package/src/codex-protocol/v2/ThreadRealtimeAppendAudioResponse.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeAppendTextParams.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeAppendTextResponse.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeAudioChunk.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeClosedNotification.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeErrorNotification.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeItemAddedNotification.ts +9 -0
- package/src/codex-protocol/v2/ThreadRealtimeListVoicesParams.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeListVoicesResponse.ts +9 -0
- package/src/codex-protocol/v2/ThreadRealtimeOutputAudioDeltaNotification.ts +9 -0
- package/src/codex-protocol/v2/ThreadRealtimeSdpNotification.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeStartParams.ts +16 -0
- package/src/codex-protocol/v2/ThreadRealtimeStartResponse.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeStartTransport.ts +13 -0
- package/src/codex-protocol/v2/ThreadRealtimeStartedNotification.ts +9 -0
- package/src/codex-protocol/v2/ThreadRealtimeStopParams.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeStopResponse.ts +8 -0
- package/src/codex-protocol/v2/ThreadRealtimeTranscriptDeltaNotification.ts +13 -0
- package/src/codex-protocol/v2/ThreadRealtimeTranscriptDoneNotification.ts +13 -0
- package/src/codex-protocol/v2/ThreadResumeParams.ts +71 -0
- package/src/codex-protocol/v2/ThreadResumeResponse.ts +35 -0
- package/src/codex-protocol/v2/ThreadRollbackParams.ts +12 -0
- package/src/codex-protocol/v2/ThreadRollbackResponse.ts +14 -0
- package/src/codex-protocol/v2/ThreadSetNameParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadSetNameResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadSettings.ts +14 -0
- package/src/codex-protocol/v2/ThreadSettingsUpdateParams.ts +61 -0
- package/src/codex-protocol/v2/ThreadSettingsUpdateResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadSettingsUpdatedNotification.ts +6 -0
- package/src/codex-protocol/v2/ThreadShellCommandParams.ts +12 -0
- package/src/codex-protocol/v2/ThreadShellCommandResponse.ts +5 -0
- package/src/codex-protocol/v2/ThreadSortKey.ts +5 -0
- package/src/codex-protocol/v2/ThreadSource.ts +5 -0
- package/src/codex-protocol/v2/ThreadSourceKind.ts +5 -0
- package/src/codex-protocol/v2/ThreadStartParams.ts +57 -0
- package/src/codex-protocol/v2/ThreadStartResponse.ts +35 -0
- package/src/codex-protocol/v2/ThreadStartSource.ts +5 -0
- package/src/codex-protocol/v2/ThreadStartedNotification.ts +6 -0
- package/src/codex-protocol/v2/ThreadStatus.ts +6 -0
- package/src/codex-protocol/v2/ThreadStatusChangedNotification.ts +6 -0
- package/src/codex-protocol/v2/ThreadTokenUsage.ts +6 -0
- package/src/codex-protocol/v2/ThreadTokenUsageUpdatedNotification.ts +6 -0
- package/src/codex-protocol/v2/ThreadTurnsItemsListParams.ts +18 -0
- package/src/codex-protocol/v2/ThreadTurnsItemsListResponse.ts +16 -0
- package/src/codex-protocol/v2/ThreadTurnsListParams.ts +23 -0
- package/src/codex-protocol/v2/ThreadTurnsListResponse.ts +18 -0
- package/src/codex-protocol/v2/ThreadUnarchiveParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadUnarchiveResponse.ts +6 -0
- package/src/codex-protocol/v2/ThreadUnarchivedNotification.ts +5 -0
- package/src/codex-protocol/v2/ThreadUnsubscribeParams.ts +5 -0
- package/src/codex-protocol/v2/ThreadUnsubscribeResponse.ts +6 -0
- package/src/codex-protocol/v2/ThreadUnsubscribeStatus.ts +5 -0
- package/src/codex-protocol/v2/TokenUsageBreakdown.ts +5 -0
- package/src/codex-protocol/v2/ToolRequestUserInputAnswer.ts +8 -0
- package/src/codex-protocol/v2/ToolRequestUserInputOption.ts +8 -0
- package/src/codex-protocol/v2/ToolRequestUserInputParams.ts +9 -0
- package/src/codex-protocol/v2/ToolRequestUserInputQuestion.ts +9 -0
- package/src/codex-protocol/v2/ToolRequestUserInputResponse.ts +9 -0
- package/src/codex-protocol/v2/ToolsV2.ts +6 -0
- package/src/codex-protocol/v2/Turn.ts +33 -0
- package/src/codex-protocol/v2/TurnCompletedNotification.ts +6 -0
- package/src/codex-protocol/v2/TurnDiffUpdatedNotification.ts +9 -0
- package/src/codex-protocol/v2/TurnEnvironmentParams.ts +6 -0
- package/src/codex-protocol/v2/TurnError.ts +6 -0
- package/src/codex-protocol/v2/TurnInterruptParams.ts +5 -0
- package/src/codex-protocol/v2/TurnInterruptResponse.ts +5 -0
- package/src/codex-protocol/v2/TurnItemsView.ts +5 -0
- package/src/codex-protocol/v2/TurnPlanStep.ts +6 -0
- package/src/codex-protocol/v2/TurnPlanStepStatus.ts +5 -0
- package/src/codex-protocol/v2/TurnPlanUpdatedNotification.ts +6 -0
- package/src/codex-protocol/v2/TurnStartParams.ts +88 -0
- package/src/codex-protocol/v2/TurnStartResponse.ts +6 -0
- package/src/codex-protocol/v2/TurnStartedNotification.ts +6 -0
- package/src/codex-protocol/v2/TurnStatus.ts +5 -0
- package/src/codex-protocol/v2/TurnSteerParams.ts +15 -0
- package/src/codex-protocol/v2/TurnSteerResponse.ts +5 -0
- package/src/codex-protocol/v2/UserInput.ts +11 -0
- package/src/codex-protocol/v2/WarningNotification.ts +13 -0
- package/src/codex-protocol/v2/WebSearchAction.ts +5 -0
- package/src/codex-protocol/v2/WindowsSandboxReadiness.ts +5 -0
- package/src/codex-protocol/v2/WindowsSandboxReadinessResponse.ts +6 -0
- package/src/codex-protocol/v2/WindowsSandboxSetupCompletedNotification.ts +6 -0
- package/src/codex-protocol/v2/WindowsSandboxSetupMode.ts +5 -0
- package/src/codex-protocol/v2/WindowsSandboxSetupStartParams.ts +7 -0
- package/src/codex-protocol/v2/WindowsSandboxSetupStartResponse.ts +5 -0
- package/src/codex-protocol/v2/WindowsWorldWritableWarningNotification.ts +5 -0
- package/src/codex-protocol/v2/WriteStatus.ts +5 -0
- package/src/codex-protocol/v2/index.ts +503 -0
- package/src/column.ts +44 -0
- package/src/engines/claude/claude-engine.ts +769 -0
- package/src/engines/claude/clock.ts +48 -0
- package/src/engines/claude/compact.ts +107 -0
- package/src/engines/claude/ctx.ts +239 -0
- package/src/engines/claude/doctor.ts +202 -0
- package/src/engines/claude/env.ts +16 -0
- package/src/engines/claude/history.ts +504 -0
- package/src/engines/claude/identifiers.ts +25 -0
- package/src/engines/claude/identity-migration.ts +16 -0
- package/src/engines/claude/idle.ts +91 -0
- package/src/engines/claude/keys.ts +163 -0
- package/src/engines/claude/last.ts +52 -0
- package/src/engines/claude/mem.ts +124 -0
- package/src/engines/claude/persistence.ts +41 -0
- package/src/engines/claude/post-turn.ts +45 -0
- package/src/engines/claude/reload.ts +53 -0
- package/src/engines/claude/repo-fs.ts +63 -0
- package/src/engines/claude/resume.ts +145 -0
- package/src/engines/claude/send.ts +86 -0
- package/src/engines/claude/spawn.ts +435 -0
- package/src/engines/claude/state.ts +124 -0
- package/src/engines/claude/tmux.ts +99 -0
- package/src/engines/claude/wait-signals.ts +128 -0
- package/src/engines/claude/wait.ts +59 -0
- package/src/engines/codex/ask.ts +69 -0
- package/src/engines/codex/engine.ts +1261 -0
- package/src/engines/codex/events.ts +106 -0
- package/src/engines/codex/history.ts +385 -0
- package/src/engines/codex/identity-migration.ts +14 -0
- package/src/engines/codex/ipc-bridge-process.ts +14 -0
- package/src/engines/codex/ipc-bridge.ts +844 -0
- package/src/engines/codex/persistence.ts +236 -0
- package/src/engines/codex/rollout.ts +384 -0
- package/src/engines/codex/rpc.ts +311 -0
- package/src/engines/codex/supervisor.ts +648 -0
- package/src/engines/codex/ui-ipc.ts +374 -0
- package/src/engines/codex/verb-common.ts +34 -0
- package/src/engines/codex/verb-lifecycle.ts +94 -0
- package/src/engines/codex/verb-state.ts +19 -0
- package/src/engines/codex/verb-turns.ts +49 -0
- package/src/engines/codex/verbs.ts +15 -0
- package/src/engines/engine.ts +91 -0
- package/src/engines/git-worktree.ts +137 -0
- package/src/engines/production.ts +19 -0
- package/src/engines/registry.ts +70 -0
- package/src/engines/teammate-record.ts +113 -0
- package/src/engines/types.ts +334 -0
- package/src/env.ts +29 -0
- package/src/grep.ts +39 -0
- package/src/help.ts +433 -0
- package/src/identity/name.ts +58 -0
- package/src/identity/router.ts +80 -0
- package/src/identity/uuid-prefix.ts +40 -0
- package/src/main.ts +39 -0
- package/src/persistence/atomic-file.ts +74 -0
- package/src/persistence/identity-store.ts +294 -0
- package/src/persistence/identity-writer.ts +28 -0
- package/src/persistence/paths.ts +138 -0
- package/src/plugin-root.ts +26 -0
- package/src/proc.ts +66 -0
- package/src/shared/verb-args.ts +331 -0
- package/src/tm.ts +54 -0
- package/src/tmux.ts +57 -0
- package/src/verbs/archive.ts +211 -0
- package/src/verbs/ask.ts +29 -0
- package/src/verbs/compact.ts +25 -0
- package/src/verbs/context.ts +68 -0
- package/src/verbs/ctx.ts +21 -0
- package/src/verbs/format.ts +213 -0
- package/src/verbs/history.ts +190 -0
- package/src/verbs/kill.ts +61 -0
- package/src/verbs/last.ts +34 -0
- package/src/verbs/ls.ts +27 -0
- package/src/verbs/mem.ts +40 -0
- package/src/verbs/poll.ts +61 -0
- package/src/verbs/reload.ts +17 -0
- package/src/verbs/resolve.ts +14 -0
- package/src/verbs/resume.ts +170 -0
- package/src/verbs/send.ts +36 -0
- package/src/verbs/spawn.ts +81 -0
- package/src/verbs/states.ts +74 -0
- package/src/verbs/status.ts +26 -0
- package/src/verbs/wait.ts +40 -0
- package/src/verbs.ts +56 -0
- package/src/ws-types.d.ts +9 -0
- package/third_party/ws/LICENSE +20 -0
- package/third_party/ws/README.md +548 -0
- package/third_party/ws/UPSTREAM.md +55 -0
- package/third_party/ws/browser.js +8 -0
- package/third_party/ws/index.js +22 -0
- package/third_party/ws/lib/buffer-util.js +131 -0
- package/third_party/ws/lib/constants.js +19 -0
- package/third_party/ws/lib/event-target.js +292 -0
- package/third_party/ws/lib/extension.js +203 -0
- package/third_party/ws/lib/limiter.js +55 -0
- package/third_party/ws/lib/permessage-deflate.js +528 -0
- package/third_party/ws/lib/receiver.js +760 -0
- package/third_party/ws/lib/sender.js +607 -0
- package/third_party/ws/lib/stream.js +161 -0
- package/third_party/ws/lib/subprotocol.js +62 -0
- package/third_party/ws/lib/validation.js +152 -0
- package/third_party/ws/lib/websocket-server.js +562 -0
- package/third_party/ws/lib/websocket.js +1407 -0
- package/third_party/ws/package.json +13 -0
- package/third_party/ws/wrapper.mjs +21 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto'
|
|
2
|
+
import { existsSync } from 'node:fs'
|
|
3
|
+
import { createConnection, type Socket } from 'node:net'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
|
|
6
|
+
export const CODEX_UI_IPC_VERSION = 0
|
|
7
|
+
const INITIALIZING_CLIENT_ID = 'initializing-client'
|
|
8
|
+
// Matches the Codex UI IPC method-version table in OpenAI ChatGPT VS Code extension 26.519.x.
|
|
9
|
+
const METHOD_VERSIONS = new Map<string, number>([
|
|
10
|
+
['thread-stream-state-changed', 6],
|
|
11
|
+
['thread-read-state-changed', 1],
|
|
12
|
+
['thread-archived', 2],
|
|
13
|
+
['thread-unarchived', 1],
|
|
14
|
+
['thread-follower-start-turn', 1],
|
|
15
|
+
['thread-follower-compact-thread', 1],
|
|
16
|
+
['thread-follower-steer-turn', 1],
|
|
17
|
+
['thread-follower-interrupt-turn', 1],
|
|
18
|
+
['thread-follower-set-model-and-reasoning', 1],
|
|
19
|
+
['thread-follower-set-collaboration-mode', 1],
|
|
20
|
+
['thread-follower-edit-last-user-turn', 1],
|
|
21
|
+
['thread-follower-command-approval-decision', 1],
|
|
22
|
+
['thread-follower-file-approval-decision', 1],
|
|
23
|
+
['thread-follower-permissions-request-approval-response', 1],
|
|
24
|
+
['thread-follower-submit-user-input', 1],
|
|
25
|
+
['thread-follower-submit-mcp-server-elicitation-response', 1],
|
|
26
|
+
['thread-follower-set-queued-follow-ups-state', 1],
|
|
27
|
+
['thread-queued-followups-changed', 1],
|
|
28
|
+
])
|
|
29
|
+
|
|
30
|
+
type PendingResponse = {
|
|
31
|
+
readonly method: string
|
|
32
|
+
readonly resolve: (value: unknown) => void
|
|
33
|
+
readonly reject: (error: Error) => void
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface IpcRequestEnvelope {
|
|
37
|
+
readonly type: 'request'
|
|
38
|
+
readonly requestId: string
|
|
39
|
+
readonly sourceClientId: string
|
|
40
|
+
readonly targetClientId?: string
|
|
41
|
+
readonly version: number
|
|
42
|
+
readonly method: string
|
|
43
|
+
readonly params?: unknown
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface IpcBroadcastEnvelope {
|
|
47
|
+
readonly type: 'broadcast'
|
|
48
|
+
readonly sourceClientId: string
|
|
49
|
+
readonly version: number
|
|
50
|
+
readonly method: string
|
|
51
|
+
readonly params?: unknown
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface IpcDiscoveryRequestEnvelope {
|
|
55
|
+
readonly type: 'client-discovery-request'
|
|
56
|
+
readonly requestId: string
|
|
57
|
+
readonly request?: Partial<IpcRequestEnvelope>
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type IpcIncomingEnvelope =
|
|
61
|
+
| IpcRequestEnvelope
|
|
62
|
+
| IpcBroadcastEnvelope
|
|
63
|
+
| IpcDiscoveryRequestEnvelope
|
|
64
|
+
| {
|
|
65
|
+
readonly type: 'response'
|
|
66
|
+
readonly requestId: string
|
|
67
|
+
readonly resultType: 'success'
|
|
68
|
+
readonly handledByClientId?: string
|
|
69
|
+
readonly method?: string
|
|
70
|
+
readonly result?: unknown
|
|
71
|
+
}
|
|
72
|
+
| {
|
|
73
|
+
readonly type: 'response'
|
|
74
|
+
readonly requestId: string
|
|
75
|
+
readonly resultType: 'error'
|
|
76
|
+
readonly handledByClientId?: string
|
|
77
|
+
readonly method?: string
|
|
78
|
+
readonly error?: unknown
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface IpcRequestContext {
|
|
82
|
+
readonly requestId: string
|
|
83
|
+
readonly sourceClientId: string
|
|
84
|
+
readonly method: string
|
|
85
|
+
readonly params: unknown
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface IpcBroadcastContext {
|
|
89
|
+
readonly sourceClientId: string
|
|
90
|
+
readonly method: string
|
|
91
|
+
readonly params: unknown
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type IpcRequestHandler = (ctx: IpcRequestContext) => Promise<unknown>
|
|
95
|
+
export type IpcCanHandle = (ctx: Omit<IpcRequestContext, 'requestId'>) => Promise<boolean>
|
|
96
|
+
export type IpcBroadcastHandler = (ctx: IpcBroadcastContext) => void
|
|
97
|
+
|
|
98
|
+
export function codexUiIpcSocketPath(env: NodeJS.ProcessEnv = process.env): string {
|
|
99
|
+
const uid = typeof process.getuid === 'function' ? process.getuid() : 0
|
|
100
|
+
return join(env['TMPDIR'] ?? '/tmp', 'codex-ipc', `ipc-${uid}.sock`)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function codexUiIpcSocketExists(env: NodeJS.ProcessEnv = process.env): boolean {
|
|
104
|
+
return existsSync(codexUiIpcSocketPath(env))
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export class CodexUiIpcClient {
|
|
108
|
+
private socket: Socket | null = null
|
|
109
|
+
private buffer = Buffer.alloc(0)
|
|
110
|
+
private readonly pending = new Map<string, PendingResponse>()
|
|
111
|
+
private readonly broadcastHandlers: IpcBroadcastHandler[] = []
|
|
112
|
+
private closedPromise: Promise<void> | null = null
|
|
113
|
+
private closeResolve: (() => void) | null = null
|
|
114
|
+
private clientId: string | null = null
|
|
115
|
+
|
|
116
|
+
constructor(private readonly opts: {
|
|
117
|
+
readonly socketPath: string
|
|
118
|
+
readonly clientType: string
|
|
119
|
+
readonly canHandle: IpcCanHandle
|
|
120
|
+
readonly handleRequest: IpcRequestHandler
|
|
121
|
+
}) {}
|
|
122
|
+
|
|
123
|
+
get id(): string | null {
|
|
124
|
+
return this.clientId
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async connect(): Promise<string> {
|
|
128
|
+
if (this.socket !== null) throw new Error('CodexUiIpcClient already connected')
|
|
129
|
+
this.closedPromise = new Promise<void>((resolve) => {
|
|
130
|
+
this.closeResolve = resolve
|
|
131
|
+
})
|
|
132
|
+
const socket = createConnection(this.opts.socketPath)
|
|
133
|
+
this.socket = socket
|
|
134
|
+
socket.on('data', (chunk) => this.onData(chunk))
|
|
135
|
+
socket.once('close', () => this.onClose(new Error('codex UI IPC socket closed')))
|
|
136
|
+
socket.once('error', (e) => this.onClose(e instanceof Error ? e : new Error(String(e))))
|
|
137
|
+
await new Promise<void>((resolve, reject) => {
|
|
138
|
+
socket.once('connect', resolve)
|
|
139
|
+
socket.once('error', (e) => reject(e instanceof Error ? e : new Error(String(e))))
|
|
140
|
+
})
|
|
141
|
+
const result = await this.request('initialize', { clientType: this.opts.clientType }, {
|
|
142
|
+
sourceClientId: INITIALIZING_CLIENT_ID,
|
|
143
|
+
})
|
|
144
|
+
const clientId = extractClientId(result)
|
|
145
|
+
if (clientId === null) throw new Error('codex UI IPC initialize response did not include clientId')
|
|
146
|
+
this.clientId = clientId
|
|
147
|
+
return clientId
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
onBroadcast(handler: IpcBroadcastHandler): void {
|
|
151
|
+
this.broadcastHandlers.push(handler)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async request(
|
|
155
|
+
method: string,
|
|
156
|
+
params: unknown,
|
|
157
|
+
options: { readonly targetClientId?: string; readonly sourceClientId?: string } = {},
|
|
158
|
+
): Promise<unknown> {
|
|
159
|
+
const socket = this.socket
|
|
160
|
+
if (socket === null) throw new Error('codex UI IPC client is not connected')
|
|
161
|
+
const requestId = randomUUID()
|
|
162
|
+
const sourceClientId = options.sourceClientId ?? this.requireClientId()
|
|
163
|
+
const envelope: IpcRequestEnvelope = {
|
|
164
|
+
type: 'request',
|
|
165
|
+
requestId,
|
|
166
|
+
sourceClientId,
|
|
167
|
+
version: ipcMethodVersion(method),
|
|
168
|
+
method,
|
|
169
|
+
params,
|
|
170
|
+
...(options.targetClientId === undefined ? {} : { targetClientId: options.targetClientId }),
|
|
171
|
+
}
|
|
172
|
+
return new Promise((resolve, reject) => {
|
|
173
|
+
this.pending.set(requestId, { method, resolve, reject })
|
|
174
|
+
try {
|
|
175
|
+
this.send(envelope)
|
|
176
|
+
} catch (e) {
|
|
177
|
+
this.pending.delete(requestId)
|
|
178
|
+
reject(e instanceof Error ? e : new Error(String(e)))
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
broadcast(method: string, params: unknown): void {
|
|
184
|
+
this.send({
|
|
185
|
+
type: 'broadcast',
|
|
186
|
+
sourceClientId: this.requireClientId(),
|
|
187
|
+
version: ipcMethodVersion(method),
|
|
188
|
+
method,
|
|
189
|
+
params,
|
|
190
|
+
})
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
close(): void {
|
|
194
|
+
if (this.socket === null) return
|
|
195
|
+
this.socket.destroy()
|
|
196
|
+
this.onClose(new Error('codex UI IPC client closed by caller'))
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
closed(): Promise<void> {
|
|
200
|
+
return this.closedPromise ?? Promise.resolve()
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
private requireClientId(): string {
|
|
204
|
+
if (this.clientId === null) throw new Error('codex UI IPC client is not initialized')
|
|
205
|
+
return this.clientId
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
private onData(chunk: Buffer): void {
|
|
209
|
+
this.buffer = Buffer.concat([this.buffer, chunk])
|
|
210
|
+
while (this.buffer.length >= 4) {
|
|
211
|
+
const payloadLength = this.buffer.readUInt32LE(0)
|
|
212
|
+
if (this.buffer.length < payloadLength + 4) return
|
|
213
|
+
const payload = this.buffer.subarray(4, payloadLength + 4)
|
|
214
|
+
this.buffer = this.buffer.subarray(payloadLength + 4)
|
|
215
|
+
this.onEnvelope(payload)
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
private onEnvelope(payload: Buffer): void {
|
|
220
|
+
let parsed: unknown
|
|
221
|
+
const text = payload.toString('utf8')
|
|
222
|
+
if (process.env['CLAUDEMUX_DEBUG_IPC'] !== undefined) {
|
|
223
|
+
console.error(`[codex-ui-ipc] inbound ${text}`)
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
parsed = JSON.parse(text)
|
|
227
|
+
} catch {
|
|
228
|
+
return
|
|
229
|
+
}
|
|
230
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) return
|
|
231
|
+
const env = parsed as Partial<IpcIncomingEnvelope>
|
|
232
|
+
switch (env.type) {
|
|
233
|
+
case 'response':
|
|
234
|
+
this.onResponse(env as IpcIncomingEnvelope)
|
|
235
|
+
break
|
|
236
|
+
case 'broadcast':
|
|
237
|
+
this.onBroadcastEnvelope(env as IpcBroadcastEnvelope)
|
|
238
|
+
break
|
|
239
|
+
case 'client-discovery-request':
|
|
240
|
+
this.onDiscoveryRequest(env as IpcDiscoveryRequestEnvelope).catch(() => {})
|
|
241
|
+
break
|
|
242
|
+
case 'request':
|
|
243
|
+
this.onRequestEnvelope(env as IpcRequestEnvelope).catch(() => {})
|
|
244
|
+
break
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
private onResponse(env: IpcIncomingEnvelope): void {
|
|
249
|
+
if (env.type !== 'response') return
|
|
250
|
+
const pending = this.pending.get(env.requestId)
|
|
251
|
+
if (pending === undefined) return
|
|
252
|
+
this.pending.delete(env.requestId)
|
|
253
|
+
if (env.resultType === 'success') {
|
|
254
|
+
pending.resolve(env.result)
|
|
255
|
+
return
|
|
256
|
+
}
|
|
257
|
+
pending.reject(new Error(errorMessage(env.error) ?? `codex UI IPC request ${pending.method} failed`))
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private onBroadcastEnvelope(env: IpcBroadcastEnvelope): void {
|
|
261
|
+
for (const handler of this.broadcastHandlers) {
|
|
262
|
+
try {
|
|
263
|
+
handler({
|
|
264
|
+
sourceClientId: env.sourceClientId,
|
|
265
|
+
method: env.method,
|
|
266
|
+
params: env.params,
|
|
267
|
+
})
|
|
268
|
+
} catch {
|
|
269
|
+
// Broadcast handlers are observers; one bad observer must not close the IPC link.
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
private async onDiscoveryRequest(env: IpcDiscoveryRequestEnvelope): Promise<void> {
|
|
275
|
+
const request = env.request
|
|
276
|
+
if (request === undefined || typeof request.method !== 'string') {
|
|
277
|
+
this.send({
|
|
278
|
+
type: 'client-discovery-response',
|
|
279
|
+
requestId: env.requestId,
|
|
280
|
+
response: { canHandle: false },
|
|
281
|
+
})
|
|
282
|
+
return
|
|
283
|
+
}
|
|
284
|
+
// Codex.app wraps discovery around the original request; the method
|
|
285
|
+
// version lives on request.version, not on the discovery envelope.
|
|
286
|
+
if ((request.version ?? 0) !== ipcMethodVersion(request.method)) {
|
|
287
|
+
this.send({
|
|
288
|
+
type: 'client-discovery-response',
|
|
289
|
+
requestId: env.requestId,
|
|
290
|
+
response: { canHandle: false },
|
|
291
|
+
})
|
|
292
|
+
return
|
|
293
|
+
}
|
|
294
|
+
const canHandle = await this.opts.canHandle({
|
|
295
|
+
sourceClientId: typeof request.sourceClientId === 'string' ? request.sourceClientId : '',
|
|
296
|
+
method: request.method,
|
|
297
|
+
params: request.params,
|
|
298
|
+
})
|
|
299
|
+
this.send({
|
|
300
|
+
type: 'client-discovery-response',
|
|
301
|
+
requestId: env.requestId,
|
|
302
|
+
response: { canHandle },
|
|
303
|
+
})
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
private async onRequestEnvelope(env: IpcRequestEnvelope): Promise<void> {
|
|
307
|
+
try {
|
|
308
|
+
const result = await this.opts.handleRequest({
|
|
309
|
+
requestId: env.requestId,
|
|
310
|
+
sourceClientId: env.sourceClientId,
|
|
311
|
+
method: env.method,
|
|
312
|
+
params: env.params,
|
|
313
|
+
})
|
|
314
|
+
this.send({
|
|
315
|
+
type: 'response',
|
|
316
|
+
requestId: env.requestId,
|
|
317
|
+
sourceClientId: this.requireClientId(),
|
|
318
|
+
handledByClientId: this.requireClientId(),
|
|
319
|
+
version: ipcMethodVersion(env.method),
|
|
320
|
+
resultType: 'success',
|
|
321
|
+
method: env.method,
|
|
322
|
+
result,
|
|
323
|
+
})
|
|
324
|
+
} catch (e) {
|
|
325
|
+
this.send({
|
|
326
|
+
type: 'response',
|
|
327
|
+
requestId: env.requestId,
|
|
328
|
+
sourceClientId: this.requireClientId(),
|
|
329
|
+
handledByClientId: this.requireClientId(),
|
|
330
|
+
version: ipcMethodVersion(env.method),
|
|
331
|
+
resultType: 'error',
|
|
332
|
+
method: env.method,
|
|
333
|
+
error: e instanceof Error ? e.message : String(e),
|
|
334
|
+
})
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
private send(envelope: unknown): void {
|
|
339
|
+
const socket = this.socket
|
|
340
|
+
if (socket === null) throw new Error('codex UI IPC client is not connected')
|
|
341
|
+
const payload = Buffer.from(JSON.stringify(envelope), 'utf8')
|
|
342
|
+
const header = Buffer.alloc(4)
|
|
343
|
+
header.writeUInt32LE(payload.length, 0)
|
|
344
|
+
socket.write(Buffer.concat([header, payload]))
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
private onClose(reason: Error): void {
|
|
348
|
+
if (this.socket === null) return
|
|
349
|
+
this.socket = null
|
|
350
|
+
this.clientId = null
|
|
351
|
+
this.buffer = Buffer.alloc(0)
|
|
352
|
+
for (const pending of this.pending.values()) pending.reject(reason)
|
|
353
|
+
this.pending.clear()
|
|
354
|
+
this.closeResolve?.()
|
|
355
|
+
this.closeResolve = null
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
function extractClientId(result: unknown): string | null {
|
|
360
|
+
if (typeof result !== 'object' || result === null) return null
|
|
361
|
+
const clientId = (result as { clientId?: unknown }).clientId
|
|
362
|
+
return typeof clientId === 'string' && clientId.length > 0 ? clientId : null
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export function ipcMethodVersion(method: string): number {
|
|
366
|
+
return METHOD_VERSIONS.get(method) ?? CODEX_UI_IPC_VERSION
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function errorMessage(value: unknown): string | null {
|
|
370
|
+
if (typeof value === 'string') return value
|
|
371
|
+
if (typeof value !== 'object' || value === null) return null
|
|
372
|
+
const message = (value as { message?: unknown }).message
|
|
373
|
+
return typeof message === 'string' ? message : null
|
|
374
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Engine } from '../engine'
|
|
2
|
+
import type { EngineContext } from '../types'
|
|
3
|
+
import type { TmResult } from '../../tm'
|
|
4
|
+
import { validateTeammateName } from '../../identity/name.js'
|
|
5
|
+
import { CodexEngine } from './engine.js'
|
|
6
|
+
|
|
7
|
+
/** Per-codex-verb `die` — mirrors the `tm: <msg>` wire shape native.ts uses. */
|
|
8
|
+
export function die(message: string): TmResult {
|
|
9
|
+
return { code: 1, stdout: '', stderr: `tm: ${message}\n` }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function engineContext(): EngineContext {
|
|
13
|
+
return { now: () => Date.now(), env: process.env }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function resolveEngine(engine: Engine | undefined): Engine {
|
|
17
|
+
return engine ?? new CodexEngine()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function timeoutMsFromSeconds(timeoutSec: number | null): number | null {
|
|
21
|
+
return timeoutSec === null ? null : timeoutSec * 1000
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function codexNameValidationError(name: string): string | null {
|
|
25
|
+
const validation = validateTeammateName(name)
|
|
26
|
+
return validation.kind === 'ok'
|
|
27
|
+
? null
|
|
28
|
+
: `invalid codex teammate name '${name}': ${validation.reason}`
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function validateCodexName(name: string): TmResult | null {
|
|
32
|
+
const message = codexNameValidationError(name)
|
|
33
|
+
return message === null ? null : die(message)
|
|
34
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Engine } from '../engine'
|
|
2
|
+
import type { TmResult } from '../../tm'
|
|
3
|
+
import { formatTurn } from '../../verbs/format'
|
|
4
|
+
import { readDaemonState } from './supervisor.js'
|
|
5
|
+
import { readBaseRecord } from './persistence.js'
|
|
6
|
+
import {
|
|
7
|
+
die,
|
|
8
|
+
engineContext,
|
|
9
|
+
resolveEngine,
|
|
10
|
+
timeoutMsFromSeconds,
|
|
11
|
+
validateCodexName,
|
|
12
|
+
} from './verb-common.js'
|
|
13
|
+
|
|
14
|
+
export interface CodexSpawnOptions {
|
|
15
|
+
readonly cwd?: string
|
|
16
|
+
readonly prompt?: string | null
|
|
17
|
+
readonly timeoutSec?: number | null
|
|
18
|
+
readonly displayName?: string | null
|
|
19
|
+
readonly engine?: Engine
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* `tm spawn <name> --engine codex` — start a per-teammate codex daemon and
|
|
24
|
+
* optionally run the first prompt through the Engine contract.
|
|
25
|
+
*/
|
|
26
|
+
export async function codexSpawn(
|
|
27
|
+
name: string,
|
|
28
|
+
opts: CodexSpawnOptions = {},
|
|
29
|
+
): Promise<TmResult> {
|
|
30
|
+
const invalidName = validateCodexName(name)
|
|
31
|
+
if (invalidName !== null) return invalidName
|
|
32
|
+
const engine = resolveEngine(opts.engine)
|
|
33
|
+
const cwd = opts.cwd ?? process.cwd()
|
|
34
|
+
const result = await engine.spawn(
|
|
35
|
+
{
|
|
36
|
+
name,
|
|
37
|
+
repo: cwd,
|
|
38
|
+
cwd,
|
|
39
|
+
worktreeSlug: null,
|
|
40
|
+
resumeCheckpoint: null,
|
|
41
|
+
prompt: opts.prompt ?? null,
|
|
42
|
+
timeoutMs: timeoutMsFromSeconds(opts.timeoutSec ?? null),
|
|
43
|
+
displayName: opts.displayName ?? null,
|
|
44
|
+
},
|
|
45
|
+
engineContext(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
switch (result.kind) {
|
|
49
|
+
case 'spawned': {
|
|
50
|
+
const state = readDaemonState(name)
|
|
51
|
+
let stderr =
|
|
52
|
+
state === null
|
|
53
|
+
? `spawned: ${name}\n`
|
|
54
|
+
: `spawned: ${name} (pid=${state.pid}, socket=${state.socketPath})\n`
|
|
55
|
+
if (result.firstTurn === null) return { code: 0, stdout: '', stderr }
|
|
56
|
+
const turn = formatTurn(result.firstTurn)
|
|
57
|
+
return {
|
|
58
|
+
code: turn.code,
|
|
59
|
+
stdout: turn.stdout,
|
|
60
|
+
stderr: stderr + turn.stderr,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
case 'already-exists':
|
|
64
|
+
return die(`codex teammate '${name}' already exists (engine=${result.existingEngine})`)
|
|
65
|
+
case 'failed':
|
|
66
|
+
return die(result.message)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* `tm kill <codex-name>` — SIGTERM the daemon and remove its Engine base
|
|
72
|
+
* record. The historical CLI shape is idempotent on missing teammates.
|
|
73
|
+
*/
|
|
74
|
+
export async function codexKill(
|
|
75
|
+
name: string,
|
|
76
|
+
opts: { readonly engine?: Engine } = {},
|
|
77
|
+
): Promise<TmResult> {
|
|
78
|
+
const state = readDaemonState(name)
|
|
79
|
+
const base = readBaseRecord(name)
|
|
80
|
+
const result = await resolveEngine(opts.engine).kill({ name }, engineContext())
|
|
81
|
+
if (result.kind === 'failed') return die(result.message)
|
|
82
|
+
if (result.kind === 'not-found' || (state === null && base === null)) {
|
|
83
|
+
return {
|
|
84
|
+
code: 0,
|
|
85
|
+
stdout: '',
|
|
86
|
+
stderr: `no codex teammate '${name}' to kill (already gone)\n`,
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
code: 0,
|
|
91
|
+
stdout: '',
|
|
92
|
+
stderr: state === null ? `killed: ${name}\n` : `killed: ${name} (was pid=${state.pid})\n`,
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Engine } from '../engine'
|
|
2
|
+
import { engineContext, resolveEngine } from './verb-common.js'
|
|
3
|
+
|
|
4
|
+
/** Codex rows for `tm states`, using the legacy REPO/SID/BUSY/LAST/PREVIEW columns. */
|
|
5
|
+
export async function codexStateRows(
|
|
6
|
+
_nowSec: number,
|
|
7
|
+
engine?: Engine,
|
|
8
|
+
): Promise<readonly string[][]> {
|
|
9
|
+
const rows = await resolveEngine(engine).list(engineContext())
|
|
10
|
+
return rows.map((row) => {
|
|
11
|
+
return [
|
|
12
|
+
row.name,
|
|
13
|
+
row.extras['sidShort'] ?? '-',
|
|
14
|
+
row.extras['busy'] ?? '-',
|
|
15
|
+
row.extras['last'] ?? '-',
|
|
16
|
+
row.extras['preview'] ?? '-',
|
|
17
|
+
]
|
|
18
|
+
})
|
|
19
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Engine } from '../engine'
|
|
2
|
+
import type { TmResult } from '../../tm'
|
|
3
|
+
import { formatTurn } from '../../verbs/format'
|
|
4
|
+
import {
|
|
5
|
+
engineContext,
|
|
6
|
+
resolveEngine,
|
|
7
|
+
timeoutMsFromSeconds,
|
|
8
|
+
validateCodexName,
|
|
9
|
+
} from './verb-common.js'
|
|
10
|
+
|
|
11
|
+
/** `tm send <codex-name> --prompt ...` — atomic turn by default. */
|
|
12
|
+
export async function codexSend(
|
|
13
|
+
name: string,
|
|
14
|
+
prompt: string,
|
|
15
|
+
opts: { readonly timeoutSec?: number | null; readonly engine?: Engine } = {},
|
|
16
|
+
): Promise<TmResult> {
|
|
17
|
+
const invalidName = validateCodexName(name)
|
|
18
|
+
if (invalidName !== null) return invalidName
|
|
19
|
+
const result = await resolveEngine(opts.engine).send(
|
|
20
|
+
{
|
|
21
|
+
name,
|
|
22
|
+
prompt,
|
|
23
|
+
timeoutMs: timeoutMsFromSeconds(opts.timeoutSec ?? null),
|
|
24
|
+
paneQuiet: false,
|
|
25
|
+
},
|
|
26
|
+
engineContext(),
|
|
27
|
+
)
|
|
28
|
+
return formatTurn(result)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** `tm wait <codex-name>` — wait for the next turn/completed notification. */
|
|
32
|
+
export async function codexWait(
|
|
33
|
+
name: string,
|
|
34
|
+
opts: { readonly timeoutSec?: number | null; readonly engine?: Engine } = {},
|
|
35
|
+
): Promise<TmResult> {
|
|
36
|
+
const invalidName = validateCodexName(name)
|
|
37
|
+
if (invalidName !== null) return invalidName
|
|
38
|
+
const result = await resolveEngine(opts.engine).wait(
|
|
39
|
+
{
|
|
40
|
+
name,
|
|
41
|
+
recoverFor: null,
|
|
42
|
+
timeoutMs: timeoutMsFromSeconds(opts.timeoutSec ?? null),
|
|
43
|
+
fresh: false,
|
|
44
|
+
paneQuiet: false,
|
|
45
|
+
},
|
|
46
|
+
engineContext(),
|
|
47
|
+
)
|
|
48
|
+
return formatTurn(result)
|
|
49
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin CLI compatibility exports for Codex-specific callers and tests.
|
|
3
|
+
*
|
|
4
|
+
* The implementation is split by behavior boundary: daemon lifecycle,
|
|
5
|
+
* turn-driving wrappers, state rows, and the `tm ask` pool-borrow path.
|
|
6
|
+
* Engine-routed production verbs go through `verbs/<v>.ts` and
|
|
7
|
+
* `CodexEngine`; this module remains a small compatibility surface.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export { codexAsk } from './ask.js'
|
|
11
|
+
export { codexKill, codexSpawn, type CodexSpawnOptions } from './verb-lifecycle.js'
|
|
12
|
+
export { codexSend, codexWait } from './verb-turns.js'
|
|
13
|
+
export { codexStateRows } from './verb-state.js'
|
|
14
|
+
export { subscribeTurnCollection } from './events.js'
|
|
15
|
+
export type { TurnCompletedNotification } from './events.js'
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cross-engine TUI contract. Decision multi-engine-tui-architecture §"Engine interface" sets
|
|
3
|
+
* the shape: every engine implements every method (no `?` optionals),
|
|
4
|
+
* and an operation an engine genuinely cannot perform returns a
|
|
5
|
+
* discriminated result whose `kind` says so. The verb layer formats the
|
|
6
|
+
* result; the engine never decides exit codes.
|
|
7
|
+
*
|
|
8
|
+
* Why "implement everything, discriminate the result" instead of optional
|
|
9
|
+
* methods: a caller that has to write `if (engine.foo)` once will write
|
|
10
|
+
* it twice, then forget the third time. A returned-result is one path
|
|
11
|
+
* for "this engine cannot do this", not two; the type system enforces
|
|
12
|
+
* that every caller switches on `kind` and handles the missing-case
|
|
13
|
+
* arm. Phase 2's concrete engines (Claude, Codex) consume this file
|
|
14
|
+
* unchanged; future engines (gemini, cursor, …) implement the same
|
|
15
|
+
* surface.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
CompactRequest,
|
|
20
|
+
CompactResult,
|
|
21
|
+
ContextRequest,
|
|
22
|
+
ContextResult,
|
|
23
|
+
DoctorSection,
|
|
24
|
+
EngineCapabilities,
|
|
25
|
+
EngineContext,
|
|
26
|
+
EngineKind,
|
|
27
|
+
EngineSnapshot,
|
|
28
|
+
HistoryRequest,
|
|
29
|
+
HistoryResult,
|
|
30
|
+
InspectRequest,
|
|
31
|
+
KillRequest,
|
|
32
|
+
KillResult,
|
|
33
|
+
LastRequest,
|
|
34
|
+
MemoryRequest,
|
|
35
|
+
ReloadRequest,
|
|
36
|
+
ReloadResult,
|
|
37
|
+
ResumeRequest,
|
|
38
|
+
ResumeResult,
|
|
39
|
+
SendRequest,
|
|
40
|
+
SpawnRequest,
|
|
41
|
+
SpawnResult,
|
|
42
|
+
StatusRequest,
|
|
43
|
+
TeammateListing,
|
|
44
|
+
TeammateStatus,
|
|
45
|
+
TextResult,
|
|
46
|
+
TurnResult,
|
|
47
|
+
WaitRequest,
|
|
48
|
+
} from './types'
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Every `tm` engine implements this interface. The fleet-facing methods
|
|
52
|
+
* (`list`, `status`, `kill`) make `tm ls` / `tm states` / `tm status` /
|
|
53
|
+
* `tm kill` reachable for a teammate that has no tmux session — that
|
|
54
|
+
* line is the load-bearing change in decision multi-engine-tui-architecture's amend.
|
|
55
|
+
*/
|
|
56
|
+
export interface Engine {
|
|
57
|
+
/** Which engine this is. Mirrors the JSON-recorded identity. */
|
|
58
|
+
readonly kind: EngineKind
|
|
59
|
+
/** Structured capability report — drives verb-side conditional behavior. */
|
|
60
|
+
readonly capabilities: EngineCapabilities
|
|
61
|
+
|
|
62
|
+
// Hot path
|
|
63
|
+
spawn(req: SpawnRequest, ctx: EngineContext): Promise<SpawnResult>
|
|
64
|
+
send(req: SendRequest, ctx: EngineContext): Promise<TurnResult>
|
|
65
|
+
wait(req: WaitRequest, ctx: EngineContext): Promise<TurnResult>
|
|
66
|
+
/**
|
|
67
|
+
* Tear down the runtime process / worktree state for `req.name`. The
|
|
68
|
+
* implementation must leave the live identity JSON
|
|
69
|
+
* (`/tmp/teammate-<name>.json`) alone — `killVerb` archives + removes
|
|
70
|
+
* it once the engine returns, so a `tm resume` / `tm history` after
|
|
71
|
+
* the kill can recover the teammate's launch context.
|
|
72
|
+
*/
|
|
73
|
+
kill(req: KillRequest, ctx: EngineContext): Promise<KillResult>
|
|
74
|
+
|
|
75
|
+
// Fleet visibility — decision multi-engine-tui-architecture amend §"Fleet-visibility verbs"
|
|
76
|
+
list(ctx: EngineContext): Promise<readonly TeammateListing[]>
|
|
77
|
+
status(req: StatusRequest, ctx: EngineContext): Promise<TeammateStatus>
|
|
78
|
+
|
|
79
|
+
// Session-shape verbs
|
|
80
|
+
compact(req: CompactRequest, ctx: EngineContext): Promise<CompactResult>
|
|
81
|
+
resume(req: ResumeRequest, ctx: EngineContext): Promise<ResumeResult>
|
|
82
|
+
last(req: LastRequest, ctx: EngineContext): Promise<TextResult>
|
|
83
|
+
ctx(req: ContextRequest, ctx: EngineContext): Promise<ContextResult>
|
|
84
|
+
history(req: HistoryRequest, ctx: EngineContext): Promise<HistoryResult>
|
|
85
|
+
mem(req: MemoryRequest, ctx: EngineContext): Promise<TextResult>
|
|
86
|
+
reload(req: ReloadRequest, ctx: EngineContext): Promise<ReloadResult>
|
|
87
|
+
|
|
88
|
+
// Diagnostic
|
|
89
|
+
inspect(req: InspectRequest, ctx: EngineContext): Promise<EngineSnapshot>
|
|
90
|
+
doctor(ctx: EngineContext): Promise<DoctorSection>
|
|
91
|
+
}
|