@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,769 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ClaudeEngine implements Engine`. Decision multi-engine-tui-architecture §"Engine interface"
|
|
3
|
+
* makes this the layer the verb dispatcher routes to; every method is
|
|
4
|
+
* present, every result is a discriminated union.
|
|
5
|
+
*
|
|
6
|
+
* The fleet-visibility methods (`list`, `status`, `kill`) and every
|
|
7
|
+
* teammate-targeted hot path are implemented here or in
|
|
8
|
+
* `engines/claude/<verb>.ts`; `cli/dispatch.ts` reaches them only through
|
|
9
|
+
* `verbs/<verb>.ts` and the Engine registry.
|
|
10
|
+
*
|
|
11
|
+
* The capabilities record below is what verbs branch on. `atomicSend`
|
|
12
|
+
* is the type literal `true` (decision multi-engine-tui-architecture §"Capabilities are
|
|
13
|
+
* structured, not stringly-typed") — Claude Code's `tm send` already
|
|
14
|
+
* blocks for the next Stop hook fire, so the atomic-round-trip rule
|
|
15
|
+
* holds on the Claude side without further work.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { existsSync, readFileSync, realpathSync, rmSync, statSync } from 'node:fs'
|
|
19
|
+
|
|
20
|
+
import type {
|
|
21
|
+
CompactRequest,
|
|
22
|
+
CompactResult,
|
|
23
|
+
ContextRequest,
|
|
24
|
+
ContextResult,
|
|
25
|
+
DoctorSection,
|
|
26
|
+
EngineCapabilities,
|
|
27
|
+
EngineContext,
|
|
28
|
+
EngineKind,
|
|
29
|
+
EngineSnapshot,
|
|
30
|
+
HistoryRequest,
|
|
31
|
+
HistoryResult,
|
|
32
|
+
InspectRequest,
|
|
33
|
+
KillRequest,
|
|
34
|
+
KillResult,
|
|
35
|
+
LastRequest,
|
|
36
|
+
MemoryRequest,
|
|
37
|
+
ReloadRequest,
|
|
38
|
+
ReloadResult,
|
|
39
|
+
ResumeRequest,
|
|
40
|
+
ResumeResult,
|
|
41
|
+
SendRequest,
|
|
42
|
+
SpawnRequest,
|
|
43
|
+
SpawnResult,
|
|
44
|
+
StatusRequest,
|
|
45
|
+
TeammateName,
|
|
46
|
+
TeammateListing,
|
|
47
|
+
TeammateStatus,
|
|
48
|
+
TextResult,
|
|
49
|
+
TurnResult,
|
|
50
|
+
WaitRequest,
|
|
51
|
+
} from '../types'
|
|
52
|
+
import type { Engine } from '../engine'
|
|
53
|
+
import type { NativeEnv } from '../../env'
|
|
54
|
+
import { claudeCompact } from './compact'
|
|
55
|
+
import { claudeCtxLine, claudeCtxUsage } from './ctx'
|
|
56
|
+
import { claudeDoctor } from './doctor'
|
|
57
|
+
import { claudeHistory, claudeHistoryList } from './history'
|
|
58
|
+
import { claudeLast } from './last'
|
|
59
|
+
import { claudeMem } from './mem'
|
|
60
|
+
import { claudeReload } from './reload'
|
|
61
|
+
import { dieRepoNotFound } from './repo-fs'
|
|
62
|
+
import { claudeResume } from './resume'
|
|
63
|
+
import { claudeSend } from './send'
|
|
64
|
+
import { claudeSpawn } from './spawn'
|
|
65
|
+
import { claudeWait } from './wait'
|
|
66
|
+
import { ClaudeTeammateRecord } from './persistence'
|
|
67
|
+
import {
|
|
68
|
+
busyMarkerFor,
|
|
69
|
+
cwdFile,
|
|
70
|
+
idleMarkerFor,
|
|
71
|
+
lastFileFor,
|
|
72
|
+
readyFile,
|
|
73
|
+
sendAtFile,
|
|
74
|
+
sidFile,
|
|
75
|
+
TMUX_SESSION_PREFIX,
|
|
76
|
+
tmuxSessionName,
|
|
77
|
+
} from '../../persistence/paths'
|
|
78
|
+
import { listingExtras } from './state'
|
|
79
|
+
import { pluginJsonPath, tmWrapperPath } from '../../plugin-root'
|
|
80
|
+
import type { TmResult } from '../../tm'
|
|
81
|
+
import {
|
|
82
|
+
read as readIdentity,
|
|
83
|
+
remove as removeIdentity,
|
|
84
|
+
reserve as reserveIdentity,
|
|
85
|
+
} from '../../persistence/identity-store'
|
|
86
|
+
|
|
87
|
+
/** The Claude engine's capability report. */
|
|
88
|
+
export const CLAUDE_CAPABILITIES: EngineCapabilities = {
|
|
89
|
+
atomicSend: true,
|
|
90
|
+
atomicSpawnPrompt: true,
|
|
91
|
+
compaction: 'manual',
|
|
92
|
+
contextUsage: 'transcript-jsonl',
|
|
93
|
+
history: 'transcript-files',
|
|
94
|
+
memory: 'claude-project-memory',
|
|
95
|
+
reload: 'prompt-command',
|
|
96
|
+
resume: 'transcript-id',
|
|
97
|
+
detachedTurn: 'replayable',
|
|
98
|
+
events: 'synthesized',
|
|
99
|
+
} as const
|
|
100
|
+
|
|
101
|
+
/** Trim trailing newlines without touching the rest of the string. */
|
|
102
|
+
function rstrip(text: string): string {
|
|
103
|
+
return text.replace(/\n+$/, '')
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Read a file only if it exists and is non-empty (`tm`'s `[[ -s file ]]`). */
|
|
107
|
+
function readIfNonEmpty(path: string): string | null {
|
|
108
|
+
try {
|
|
109
|
+
if (statSync(path).size === 0) return null
|
|
110
|
+
return readFileSync(path, 'utf8')
|
|
111
|
+
} catch {
|
|
112
|
+
return null
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Lookup a teammate's session id, or `null` when the marker is missing. */
|
|
117
|
+
function readSid(name: string): string | null {
|
|
118
|
+
const raw = readIfNonEmpty(sidFile(name))
|
|
119
|
+
return raw === null ? null : rstrip(raw)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Compact representation of an idle marker's existence + mtime — enough
|
|
124
|
+
* for the kill-path SessionEnd watcher to tell "the marker was just
|
|
125
|
+
* touched" from "nothing happened". `null` means the file did not
|
|
126
|
+
* exist; otherwise the value is `mtimeMs`. Captured once before
|
|
127
|
+
* `/exit` is sent and compared on each poll tick.
|
|
128
|
+
*/
|
|
129
|
+
type MarkerSignature = number | null
|
|
130
|
+
|
|
131
|
+
function markerSignature(path: string): MarkerSignature {
|
|
132
|
+
try {
|
|
133
|
+
return statSync(path).mtimeMs
|
|
134
|
+
} catch {
|
|
135
|
+
return null
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Whether `current` reflects a marker touch that happened *after*
|
|
141
|
+
* `baseline` was sampled. `on-stop.sh` re-touches the idle marker on
|
|
142
|
+
* every Stop event — including SessionEnd — so an mtime that advances
|
|
143
|
+
* past the baseline (or a marker that appears where there was none)
|
|
144
|
+
* is the positive SessionEnd signal the kill path waits for.
|
|
145
|
+
*/
|
|
146
|
+
function markerAdvanced(baseline: MarkerSignature, current: MarkerSignature): boolean {
|
|
147
|
+
if (current === null) return false
|
|
148
|
+
if (baseline === null) return true
|
|
149
|
+
return current > baseline
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Lookup a teammate's recorded cwd; `null` if absent. */
|
|
153
|
+
function readCwd(name: string): string | null {
|
|
154
|
+
const raw = readIfNonEmpty(cwdFile(name))
|
|
155
|
+
return raw === null ? null : rstrip(raw)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Production grace budget (ms) for the graceful kill path — 15s
|
|
160
|
+
* wait for SessionEnd after `/exit`, plus 5s wait for SessionEnd
|
|
161
|
+
* after the Enter that confirms the dirty-worktree "Keep" prompt.
|
|
162
|
+
*
|
|
163
|
+
* The success signal in production is the idle marker
|
|
164
|
+
* (`/tmp/claude-idle/<sid>`) being touched by `on-stop.sh` when
|
|
165
|
+
* SessionEnd fires — that runs *before* the tmux pane dies, so on a
|
|
166
|
+
* slow box where REPL teardown takes a few seconds the budget is
|
|
167
|
+
* mostly headroom rather than a wait every kill pays. The 8s
|
|
168
|
+
* predecessor was tight enough that even a fast Linux box on Opus
|
|
169
|
+
* 4.7 would expire it and SIGHUP every kill; 20s leaves the slow
|
|
170
|
+
* tail covered while keeping the fallback well clear of any human
|
|
171
|
+
* impatience threshold.
|
|
172
|
+
*
|
|
173
|
+
* Override via `CLAUDEMUX_KILL_GRACE_MS` so the conformance harness
|
|
174
|
+
* (fake tmux that never reports a pane gone, no real on-stop hook
|
|
175
|
+
* to touch the marker) can keep tests under vitest's default 5s
|
|
176
|
+
* timeout.
|
|
177
|
+
*/
|
|
178
|
+
function killGraceMs(): number {
|
|
179
|
+
const override = process.env['CLAUDEMUX_KILL_GRACE_MS']
|
|
180
|
+
if (override !== undefined && override !== '') {
|
|
181
|
+
const parsed = Number(override)
|
|
182
|
+
if (Number.isFinite(parsed) && parsed >= 0) return parsed
|
|
183
|
+
}
|
|
184
|
+
return 20000
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Format a graceful-exit budget for the SIGHUP-fallback note. Renders
|
|
189
|
+
* whole seconds as `Ns` (`20s`); sub-second budgets — the conformance
|
|
190
|
+
* harness's `CLAUDEMUX_KILL_GRACE_MS=50` shape — render as `Nms` so
|
|
191
|
+
* the message stays truthful when the override is short.
|
|
192
|
+
*/
|
|
193
|
+
function describeKillGrace(ms: number): string {
|
|
194
|
+
if (ms >= 1000) return `${Math.round(ms / 1000)}s`
|
|
195
|
+
return `${ms}ms`
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Whether the teammate's tmux session is alive. */
|
|
199
|
+
async function hasTmuxSession(env: NativeEnv, sessionName: string): Promise<boolean> {
|
|
200
|
+
try {
|
|
201
|
+
return (await env.runTmux(['has-session', '-t', `=${sessionName}`])).code === 0
|
|
202
|
+
} catch {
|
|
203
|
+
return false
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
type ClaudeIdentityReservation =
|
|
208
|
+
| { kind: 'reserved' }
|
|
209
|
+
| { kind: 'preexisting' }
|
|
210
|
+
| { kind: 'already-exists'; existingEngine: EngineKind }
|
|
211
|
+
| { kind: 'failed'; result: TmResult }
|
|
212
|
+
|
|
213
|
+
function reserveClaudeIdentityForLaunch(args: {
|
|
214
|
+
readonly name: TeammateName
|
|
215
|
+
/** Physical repo path (parent of the worktree, or the cwd itself for `--no-worktree`). */
|
|
216
|
+
readonly repo: string
|
|
217
|
+
/** Runtime cwd — worktree path or repo. */
|
|
218
|
+
readonly cwd: string
|
|
219
|
+
/** Worktree slug under `.claude/worktrees/`; `null` for `--no-worktree`. */
|
|
220
|
+
readonly worktreeSlug: string | null
|
|
221
|
+
readonly displayName: string | null
|
|
222
|
+
readonly env: NativeEnv
|
|
223
|
+
readonly nowMs: number
|
|
224
|
+
readonly verb: 'spawn' | 'resume'
|
|
225
|
+
}): ClaudeIdentityReservation {
|
|
226
|
+
const existing = readIdentity(args.name)
|
|
227
|
+
if (existing !== null) {
|
|
228
|
+
return existing.engine === 'claude'
|
|
229
|
+
? { kind: 'preexisting' }
|
|
230
|
+
: { kind: 'already-exists', existingEngine: existing.engine }
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// The repo must already exist on disk; the worktree path may not (the
|
|
234
|
+
// Claude engine creates it via `claude --worktree`). Validate the
|
|
235
|
+
// repo, not the runtime cwd.
|
|
236
|
+
try {
|
|
237
|
+
if (!statSync(args.repo).isDirectory()) {
|
|
238
|
+
return {
|
|
239
|
+
kind: 'failed',
|
|
240
|
+
result: dieRepoNotFound(args.verb, args.name, args.repo, args.env.dispatcherDir),
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
} catch {
|
|
244
|
+
return {
|
|
245
|
+
kind: 'failed',
|
|
246
|
+
result: dieRepoNotFound(args.verb, args.name, args.repo, args.env.dispatcherDir),
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const record = new ClaudeTeammateRecord({
|
|
251
|
+
name: args.name,
|
|
252
|
+
repo: realpathSync(args.repo),
|
|
253
|
+
cwd: args.cwd,
|
|
254
|
+
worktreeSlug: args.worktreeSlug,
|
|
255
|
+
createdAt: Math.floor(args.nowMs / 1000),
|
|
256
|
+
displayName: args.displayName,
|
|
257
|
+
})
|
|
258
|
+
const reserved = reserveIdentity(record.toJson())
|
|
259
|
+
if (reserved.kind === 'reserved') return { kind: 'reserved' }
|
|
260
|
+
if (reserved.kind === 'taken') {
|
|
261
|
+
return { kind: 'already-exists', existingEngine: reserved.existing.engine }
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
kind: 'failed',
|
|
265
|
+
result: { code: 1, stdout: '', stderr: `tm: ${reserved.message}\n` },
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** Decide a teammate's `idle`/`busy`/`unknown` state from the hook markers. */
|
|
270
|
+
function deriveState(name: string): 'idle' | 'busy' | 'unknown' {
|
|
271
|
+
const sid = readSid(name)
|
|
272
|
+
if (sid === null) return 'unknown'
|
|
273
|
+
if (existsSync(busyMarkerFor(sid))) return 'busy'
|
|
274
|
+
if (existsSync(idleMarkerFor(sid))) return 'idle'
|
|
275
|
+
return 'unknown'
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** `ClaudeEngine` — the Claude Code engine. Stateless; verbs inject `EngineContext`. */
|
|
279
|
+
export class ClaudeEngine implements Engine {
|
|
280
|
+
readonly kind: EngineKind = 'claude'
|
|
281
|
+
readonly capabilities = CLAUDE_CAPABILITIES
|
|
282
|
+
|
|
283
|
+
/** Runtime adapters (`tmux`, `column`, dispatcher paths) are injected per CLI invocation. */
|
|
284
|
+
constructor(private readonly env: NativeEnv) {}
|
|
285
|
+
|
|
286
|
+
// ─── Fleet visibility ──────────────────────────────────────────────
|
|
287
|
+
|
|
288
|
+
async list(ctx: EngineContext): Promise<readonly TeammateListing[]> {
|
|
289
|
+
let listing = ''
|
|
290
|
+
try {
|
|
291
|
+
listing = (await this.env.runTmux(['ls'])).stdout
|
|
292
|
+
} catch {
|
|
293
|
+
listing = ''
|
|
294
|
+
}
|
|
295
|
+
// Sample `now` once per `list()` call so a multi-row scan reports
|
|
296
|
+
// the same clock reading across every teammate's LAST age.
|
|
297
|
+
const now = Math.floor(ctx.now() / 1000)
|
|
298
|
+
const out: TeammateListing[] = []
|
|
299
|
+
for (const line of listing.split('\n')) {
|
|
300
|
+
const colon = line.indexOf(':')
|
|
301
|
+
const session = colon >= 0 ? line.slice(0, colon) : line
|
|
302
|
+
if (!session.startsWith(TMUX_SESSION_PREFIX)) continue
|
|
303
|
+
const name = session.slice(TMUX_SESSION_PREFIX.length)
|
|
304
|
+
const extras = listingExtras(name, now)
|
|
305
|
+
const identity = readIdentity(name)
|
|
306
|
+
out.push({
|
|
307
|
+
name,
|
|
308
|
+
engine: 'claude',
|
|
309
|
+
state: deriveState(name),
|
|
310
|
+
repo: identity?.repo ?? readCwd(name) ?? '',
|
|
311
|
+
cwd: identity?.cwd ?? readCwd(name) ?? '',
|
|
312
|
+
worktreeSlug: identity?.worktreeSlug ?? null,
|
|
313
|
+
displayName: identity?.displayName ?? null,
|
|
314
|
+
extras: {
|
|
315
|
+
sidShort: extras.sidShort,
|
|
316
|
+
busy: extras.busy,
|
|
317
|
+
last: extras.last,
|
|
318
|
+
preview: extras.preview,
|
|
319
|
+
},
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
return out
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
async status(req: StatusRequest, _ctx: EngineContext): Promise<TeammateStatus> {
|
|
326
|
+
const sessionName = tmuxSessionName(req.name)
|
|
327
|
+
if (!(await hasTmuxSession(this.env, sessionName))) return { kind: 'not-found' }
|
|
328
|
+
|
|
329
|
+
const linesArg = String(req.lines ?? 80)
|
|
330
|
+
let pane: string | null = null
|
|
331
|
+
try {
|
|
332
|
+
const list = await this.env.runTmux(['list-sessions', '-F', '#{session_id} #{session_name}'])
|
|
333
|
+
if (list.code !== 0) {
|
|
334
|
+
return { kind: 'failed', message: rstrip(list.stderr) || rstrip(list.stdout) || `tmux list-sessions exit ${list.code}` }
|
|
335
|
+
}
|
|
336
|
+
for (const line of list.stdout.split('\n')) {
|
|
337
|
+
const space = line.indexOf(' ')
|
|
338
|
+
if (space >= 0 && line.slice(space + 1) === sessionName) {
|
|
339
|
+
pane = line.slice(0, space)
|
|
340
|
+
break
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
} catch (err) {
|
|
344
|
+
return { kind: 'failed', message: err instanceof Error ? err.message : String(err) }
|
|
345
|
+
}
|
|
346
|
+
if (pane === null) {
|
|
347
|
+
// `hasTmuxSession` saw the session but list-sessions did not return a
|
|
348
|
+
// matching row — surface this rather than reporting a successful
|
|
349
|
+
// status without any captured pane content.
|
|
350
|
+
return { kind: 'failed', message: `tmux session ${sessionName} present in has-session but absent from list-sessions` }
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
let capture: string
|
|
354
|
+
try {
|
|
355
|
+
const result = await this.env.runTmux(['capture-pane', '-t', pane, '-p', '-S', `-${linesArg}`])
|
|
356
|
+
if (result.code !== 0) {
|
|
357
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout) || `tmux capture-pane exit ${result.code}` }
|
|
358
|
+
}
|
|
359
|
+
capture = result.stdout
|
|
360
|
+
} catch (err) {
|
|
361
|
+
return { kind: 'failed', message: err instanceof Error ? err.message : String(err) }
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
return {
|
|
365
|
+
kind: 'present',
|
|
366
|
+
name: req.name,
|
|
367
|
+
engine: 'claude',
|
|
368
|
+
state: deriveState(req.name),
|
|
369
|
+
cwd: readCwd(req.name) ?? '',
|
|
370
|
+
pane: capture,
|
|
371
|
+
diagnostics: {
|
|
372
|
+
tmuxSession: sessionName,
|
|
373
|
+
sid: readSid(req.name) ?? '',
|
|
374
|
+
},
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
async kill(req: KillRequest, _ctx: EngineContext): Promise<KillResult> {
|
|
379
|
+
const sessionName = tmuxSessionName(req.name)
|
|
380
|
+
const sid = readSid(req.name)
|
|
381
|
+
|
|
382
|
+
let running = false
|
|
383
|
+
try {
|
|
384
|
+
running = (await this.env.runTmux(['has-session', '-t', `=${sessionName}`])).code === 0
|
|
385
|
+
} catch {
|
|
386
|
+
running = false
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
let exitMode: 'graceful' | 'forced' | 'absent' = 'absent'
|
|
390
|
+
if (running) {
|
|
391
|
+
exitMode = await this.runGracefulExit(sessionName, sid)
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
if (sid !== null) {
|
|
395
|
+
rmSync(idleMarkerFor(sid), { force: true })
|
|
396
|
+
rmSync(lastFileFor(sid), { force: true })
|
|
397
|
+
rmSync(busyMarkerFor(sid), { force: true })
|
|
398
|
+
}
|
|
399
|
+
for (const file of [sidFile(req.name), sendAtFile(req.name), readyFile(req.name), cwdFile(req.name)]) {
|
|
400
|
+
rmSync(file, { force: true })
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (exitMode === 'absent') return { kind: 'not-found' }
|
|
404
|
+
if (exitMode === 'forced') {
|
|
405
|
+
return {
|
|
406
|
+
kind: 'killed',
|
|
407
|
+
note:
|
|
408
|
+
`${req.name}: /exit did not return SessionEnd within ${describeKillGrace(killGraceMs())} — fell back to ` +
|
|
409
|
+
`tmux kill-session (SIGHUP). Any worktree Claude created is preserved; ` +
|
|
410
|
+
`remove with 'git worktree remove --force' if no longer needed.\n`,
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return { kind: 'killed' }
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Graceful Claude exit:
|
|
418
|
+
* 1. send `/exit\n` to the pane — clean worktree → auto-clean +
|
|
419
|
+
* SessionEnd; dirty worktree → TUI prompt waits for input.
|
|
420
|
+
* 2. poll for a SessionEnd signal for up to the first budget.
|
|
421
|
+
* 3. if no signal yet, send `Enter` (picks the default "Keep
|
|
422
|
+
* worktree" choice on the dirty prompt) and poll again for
|
|
423
|
+
* the second budget.
|
|
424
|
+
* 4. if still no signal, fall back to `tmux kill-session` (SIGHUP).
|
|
425
|
+
*
|
|
426
|
+
* The SessionEnd signal is *either* the tmux session disappearing
|
|
427
|
+
* (process-level teardown finished) *or* the teammate's idle
|
|
428
|
+
* marker — `/tmp/claude-idle/<sid>` — being touched by `on-stop.sh`
|
|
429
|
+
* when SessionEnd fires. The hook touches the marker before the
|
|
430
|
+
* REPL exits and tmux reaps the pane, so on a slow box the marker
|
|
431
|
+
* flips seconds before `has-session` reports gone. Polling both
|
|
432
|
+
* means a clean kill returns in ~one tick instead of paying the
|
|
433
|
+
* full process-teardown wall-clock.
|
|
434
|
+
*
|
|
435
|
+
* After a marker-signaled clean exit, the pane still hosts the
|
|
436
|
+
* shell that launched Claude — without an explicit `kill-session`
|
|
437
|
+
* the tmux session lives on as a bare prompt and the teammate
|
|
438
|
+
* shows up as `unknown` in `tm ls`. The kill-session call after
|
|
439
|
+
* each graceful branch handles that teardown.
|
|
440
|
+
*
|
|
441
|
+
* Budgets default to 15s + 5s in production. The conformance
|
|
442
|
+
* harness sets `CLAUDEMUX_KILL_GRACE_MS` to a short value so the
|
|
443
|
+
* fake tmux (which never reports a pane gone after send-keys, and
|
|
444
|
+
* has no real `on-stop.sh` to touch the marker) does not blow the
|
|
445
|
+
* per-test timeout — production is unaffected.
|
|
446
|
+
*
|
|
447
|
+
* Returns `'graceful'` when SessionEnd was reached cleanly,
|
|
448
|
+
* `'forced'` when the SIGHUP fallback fired, `'absent'` when the
|
|
449
|
+
* session was gone to begin with.
|
|
450
|
+
*/
|
|
451
|
+
private async runGracefulExit(
|
|
452
|
+
sessionName: string,
|
|
453
|
+
sid: string | null,
|
|
454
|
+
): Promise<'graceful' | 'forced' | 'absent'> {
|
|
455
|
+
const totalGrace = killGraceMs()
|
|
456
|
+
const exitWait = Math.max(50, Math.floor(totalGrace * 0.75))
|
|
457
|
+
const keepWait = Math.max(50, totalGrace - exitWait)
|
|
458
|
+
const markerBaseline = sid === null ? null : markerSignature(idleMarkerFor(sid))
|
|
459
|
+
try {
|
|
460
|
+
const sendExit = await this.env.runTmux(['send-keys', '-t', sessionName, '/exit', 'Enter'])
|
|
461
|
+
if (sendExit.code !== 0) {
|
|
462
|
+
return 'absent'
|
|
463
|
+
}
|
|
464
|
+
} catch {
|
|
465
|
+
return 'absent'
|
|
466
|
+
}
|
|
467
|
+
if (await this.waitForExitSignal(sessionName, sid, markerBaseline, exitWait)) {
|
|
468
|
+
await this.tryKillTmuxSession(sessionName)
|
|
469
|
+
return 'graceful'
|
|
470
|
+
}
|
|
471
|
+
try {
|
|
472
|
+
await this.env.runTmux(['send-keys', '-t', sessionName, 'Enter'])
|
|
473
|
+
} catch {
|
|
474
|
+
// best-effort; keep going to the SIGHUP fallback.
|
|
475
|
+
}
|
|
476
|
+
if (await this.waitForExitSignal(sessionName, sid, markerBaseline, keepWait)) {
|
|
477
|
+
await this.tryKillTmuxSession(sessionName)
|
|
478
|
+
return 'graceful'
|
|
479
|
+
}
|
|
480
|
+
await this.tryKillTmuxSession(sessionName)
|
|
481
|
+
return 'forced'
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Best-effort `tmux kill-session`. Wrapped in try/catch because:
|
|
486
|
+
* - in the forced path the call is the SIGHUP fallback and a
|
|
487
|
+
* failure means tmux already lost the session, which is the
|
|
488
|
+
* same outcome we wanted;
|
|
489
|
+
* - in the graceful path the marker mtime advance means the
|
|
490
|
+
* SessionEnd hook fired, but Claude's REPL teardown plus tmux
|
|
491
|
+
* pane reap finish later — without this call the shell that
|
|
492
|
+
* replaces Claude in the pane keeps the tmux session alive
|
|
493
|
+
* indefinitely as a bare prompt.
|
|
494
|
+
*/
|
|
495
|
+
private async tryKillTmuxSession(sessionName: string): Promise<void> {
|
|
496
|
+
try {
|
|
497
|
+
await this.env.runTmux(['kill-session', '-t', `=${sessionName}`])
|
|
498
|
+
} catch {
|
|
499
|
+
// ignore — best-effort.
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Poll for any of three SessionEnd signals — `tmux has-session`
|
|
505
|
+
* reports gone, the idle marker mtime advances past `baseline`, or
|
|
506
|
+
* a previously absent idle marker appears — until `budgetMs`
|
|
507
|
+
* elapses. Returns `true` on cleanup, `false` on timeout.
|
|
508
|
+
*
|
|
509
|
+
* Wall-clock is read via `process.hrtime.bigint()` so the
|
|
510
|
+
* conformance harness's `vi.useFakeTimers({ toFake: ['Date'] })`
|
|
511
|
+
* does not freeze the loop. The 200ms interval matches `pollReady`
|
|
512
|
+
* — fast enough to surface a clean exit immediately, cheap enough
|
|
513
|
+
* not to flood tmux during the dirty-prompt wait.
|
|
514
|
+
*
|
|
515
|
+
* When `sid` is `null` the teammate had no recorded session id, so
|
|
516
|
+
* the marker file does not exist and is never touched; the loop
|
|
517
|
+
* degrades cleanly to a pane-gone-only watch.
|
|
518
|
+
*/
|
|
519
|
+
private async waitForExitSignal(
|
|
520
|
+
sessionName: string,
|
|
521
|
+
sid: string | null,
|
|
522
|
+
baseline: MarkerSignature,
|
|
523
|
+
budgetMs: number,
|
|
524
|
+
): Promise<boolean> {
|
|
525
|
+
const start = process.hrtime.bigint()
|
|
526
|
+
const budgetNs = BigInt(budgetMs) * 1_000_000n
|
|
527
|
+
const markerPath = sid === null ? null : idleMarkerFor(sid)
|
|
528
|
+
while (process.hrtime.bigint() - start < budgetNs) {
|
|
529
|
+
if (markerPath !== null) {
|
|
530
|
+
const current = markerSignature(markerPath)
|
|
531
|
+
if (markerAdvanced(baseline, current)) return true
|
|
532
|
+
}
|
|
533
|
+
try {
|
|
534
|
+
const present = (await this.env.runTmux(['has-session', '-t', `=${sessionName}`])).code === 0
|
|
535
|
+
if (!present) return true
|
|
536
|
+
} catch {
|
|
537
|
+
return true
|
|
538
|
+
}
|
|
539
|
+
await new Promise((r) => setTimeout(r, 200))
|
|
540
|
+
}
|
|
541
|
+
return false
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// ─── Hot path / session-shape — real bodies in engines/claude/<verb>.ts
|
|
545
|
+
|
|
546
|
+
async spawn(req: SpawnRequest, _ctx: EngineContext): Promise<SpawnResult> {
|
|
547
|
+
const identity = reserveClaudeIdentityForLaunch({
|
|
548
|
+
name: req.name,
|
|
549
|
+
repo: req.repo,
|
|
550
|
+
cwd: req.cwd,
|
|
551
|
+
worktreeSlug: req.worktreeSlug,
|
|
552
|
+
displayName: req.displayName,
|
|
553
|
+
env: this.env,
|
|
554
|
+
nowMs: _ctx.now(),
|
|
555
|
+
verb: 'spawn',
|
|
556
|
+
})
|
|
557
|
+
if (identity.kind === 'already-exists') {
|
|
558
|
+
return { kind: 'already-exists', existingEngine: identity.existingEngine }
|
|
559
|
+
}
|
|
560
|
+
if (identity.kind === 'failed') {
|
|
561
|
+
return {
|
|
562
|
+
kind: 'failed',
|
|
563
|
+
message: rstrip(identity.result.stderr) || rstrip(identity.result.stdout),
|
|
564
|
+
tmResult: identity.result,
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
const argv: string[] = [req.name, '--repo', req.repo, '--cwd', req.cwd]
|
|
569
|
+
if (req.worktreeSlug !== null) argv.push('--worktree-slug', req.worktreeSlug)
|
|
570
|
+
if (req.resumeCheckpoint !== null) argv.push('--resume', req.resumeCheckpoint)
|
|
571
|
+
if (req.displayName !== null) argv.push('--display-name', req.displayName)
|
|
572
|
+
if (req.prompt !== null) argv.push('--prompt', req.prompt)
|
|
573
|
+
// `--timeout` MUST reach the inner `tm send` on the --prompt sync path —
|
|
574
|
+
// CLI parses it into `SpawnRequest.timeoutMs` for a reason. Without this,
|
|
575
|
+
// `tm spawn <repo> --prompt "…" --timeout 60` silently waits 1800s and
|
|
576
|
+
// the dispatcher's bg classifier never sees the 124 it was scheduling
|
|
577
|
+
// against. The Codex engine already propagates timeoutMs into its own
|
|
578
|
+
// `send`; this keeps the two engines symmetric.
|
|
579
|
+
if (req.timeoutMs !== null) argv.push('--timeout', String(Math.round(req.timeoutMs / 1000)))
|
|
580
|
+
const result = await claudeSpawn(argv, this.env)
|
|
581
|
+
if (result.code !== 0) {
|
|
582
|
+
if (
|
|
583
|
+
identity.kind === 'reserved' &&
|
|
584
|
+
!(await hasTmuxSession(this.env, tmuxSessionName(req.name)))
|
|
585
|
+
) {
|
|
586
|
+
removeIdentity(req.name)
|
|
587
|
+
}
|
|
588
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout), tmResult: result }
|
|
589
|
+
}
|
|
590
|
+
return {
|
|
591
|
+
kind: 'spawned',
|
|
592
|
+
name: req.name,
|
|
593
|
+
tmResult: result,
|
|
594
|
+
firstTurn:
|
|
595
|
+
req.prompt === null
|
|
596
|
+
? null
|
|
597
|
+
: { kind: 'completed', text: result.stdout, items: [], context: null, tmResult: result },
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
async send(req: SendRequest, _ctx: EngineContext): Promise<TurnResult> {
|
|
602
|
+
const argv = [req.name, '--prompt', req.prompt]
|
|
603
|
+
if (req.timeoutMs !== null) argv.push('--timeout', String(Math.round(req.timeoutMs / 1000)))
|
|
604
|
+
if (req.paneQuiet) argv.push('--pane-quiet')
|
|
605
|
+
const result = await claudeSend(argv, this.env)
|
|
606
|
+
if (result.code !== 0) {
|
|
607
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout), recoverable: false, tmResult: result }
|
|
608
|
+
}
|
|
609
|
+
return { kind: 'completed', text: result.stdout, items: [], context: null, tmResult: result }
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
async wait(req: WaitRequest, _ctx: EngineContext): Promise<TurnResult> {
|
|
613
|
+
const argv = [req.name]
|
|
614
|
+
if (req.timeoutMs !== null) argv.push('--timeout', String(Math.round(req.timeoutMs / 1000)))
|
|
615
|
+
if (req.fresh) argv.push('--fresh')
|
|
616
|
+
if (req.paneQuiet) argv.push('--pane-quiet')
|
|
617
|
+
const result = await claudeWait(argv, this.env)
|
|
618
|
+
if (result.code !== 0) {
|
|
619
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout), recoverable: true, tmResult: result }
|
|
620
|
+
}
|
|
621
|
+
return { kind: 'completed', text: result.stdout, items: [], context: null, tmResult: result }
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
async compact(req: CompactRequest, _ctx: EngineContext): Promise<CompactResult> {
|
|
625
|
+
const argv = [req.name]
|
|
626
|
+
if (req.timeoutMs !== null) argv.push('--timeout', String(Math.round(req.timeoutMs / 1000)))
|
|
627
|
+
const result = await claudeCompact(argv, this.env)
|
|
628
|
+
if (result.code === 0) return { kind: 'compacted', tmResult: result }
|
|
629
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout), tmResult: result }
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
async resume(req: ResumeRequest, _ctx: EngineContext): Promise<ResumeResult> {
|
|
633
|
+
const resumeRepo = req.repo ?? req.cwd ?? this.env.dispatcherDir
|
|
634
|
+
const resumeCwd = req.cwd ?? resumeRepo
|
|
635
|
+
const identity = reserveClaudeIdentityForLaunch({
|
|
636
|
+
name: req.name,
|
|
637
|
+
repo: resumeRepo,
|
|
638
|
+
cwd: resumeCwd,
|
|
639
|
+
worktreeSlug: req.worktreeSlug,
|
|
640
|
+
displayName: req.displayName,
|
|
641
|
+
env: this.env,
|
|
642
|
+
nowMs: _ctx.now(),
|
|
643
|
+
verb: 'resume',
|
|
644
|
+
})
|
|
645
|
+
if (identity.kind === 'already-exists') {
|
|
646
|
+
return {
|
|
647
|
+
kind: 'failed',
|
|
648
|
+
message: `'${req.name}' already exists as a ${identity.existingEngine} teammate`,
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
if (identity.kind === 'failed') {
|
|
652
|
+
return {
|
|
653
|
+
kind: 'failed',
|
|
654
|
+
message: rstrip(identity.result.stderr) || rstrip(identity.result.stdout),
|
|
655
|
+
tmResult: identity.result,
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
const argv = [req.name, '--repo', resumeRepo, '--cwd', resumeCwd]
|
|
660
|
+
if (req.worktreeSlug !== null) argv.push('--worktree-slug', req.worktreeSlug)
|
|
661
|
+
if (req.checkpoint !== null) argv.push(req.checkpoint)
|
|
662
|
+
if (req.displayName !== null) argv.push('--display-name', req.displayName)
|
|
663
|
+
if (req.prompt !== null) argv.push('--prompt', req.prompt)
|
|
664
|
+
const result = await claudeResume(argv, this.env)
|
|
665
|
+
if (result.code === 0) return { kind: 'resumed', checkpoint: req.checkpoint, tmResult: result }
|
|
666
|
+
if (
|
|
667
|
+
identity.kind === 'reserved' &&
|
|
668
|
+
!(await hasTmuxSession(this.env, tmuxSessionName(req.name)))
|
|
669
|
+
) {
|
|
670
|
+
removeIdentity(req.name)
|
|
671
|
+
}
|
|
672
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout), tmResult: result }
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
async last(req: LastRequest, _ctx: EngineContext): Promise<TextResult> {
|
|
676
|
+
if (req.verbose) return { kind: 'not-supported', reason: 'raw turn JSON is only available for codex teammates' }
|
|
677
|
+
return claudeLast(req.name)
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
async ctx(req: ContextRequest, _ctx: EngineContext): Promise<ContextResult> {
|
|
681
|
+
const structured = claudeCtxUsage(req.name, {
|
|
682
|
+
dispatcherDir: this.env.dispatcherDir,
|
|
683
|
+
projectsDir: this.env.projectsDir,
|
|
684
|
+
})
|
|
685
|
+
return {
|
|
686
|
+
...structured,
|
|
687
|
+
tmResult: {
|
|
688
|
+
code: 0,
|
|
689
|
+
stdout: `${claudeCtxLine(req.name, req.windowOverride, this.env)}\n`,
|
|
690
|
+
stderr: '',
|
|
691
|
+
},
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
async history(req: HistoryRequest, _ctx: EngineContext): Promise<HistoryResult> {
|
|
696
|
+
// List mode shares one project-dir walk with `claudeHistoryList`;
|
|
697
|
+
// detail mode keeps the path through `claudeHistory` (which itself
|
|
698
|
+
// routes to `historyDetail` after a single cwd check). Both modes
|
|
699
|
+
// use the runtime cwd (worktree path when applicable) — Claude
|
|
700
|
+
// Code writes transcripts there.
|
|
701
|
+
const cwd = req.cwd
|
|
702
|
+
if (req.index === null) {
|
|
703
|
+
const { tmResult, entries } = await claudeHistoryList(req.name, cwd, this.env)
|
|
704
|
+
if (tmResult.code !== 0) {
|
|
705
|
+
return { kind: 'failed', message: rstrip(tmResult.stderr) || rstrip(tmResult.stdout), tmResult }
|
|
706
|
+
}
|
|
707
|
+
return {
|
|
708
|
+
kind: 'list',
|
|
709
|
+
turns: [{ index: 0, startedAt: 0, summary: rstrip(tmResult.stdout) }],
|
|
710
|
+
entries,
|
|
711
|
+
tmResult,
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const result = await claudeHistory([req.name, req.index, cwd ?? ''], this.env)
|
|
715
|
+
if (result.code !== 0) {
|
|
716
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout), tmResult: result }
|
|
717
|
+
}
|
|
718
|
+
return {
|
|
719
|
+
kind: 'list',
|
|
720
|
+
turns: [{ index: Number(req.index), startedAt: 0, summary: rstrip(result.stdout) }],
|
|
721
|
+
entries: undefined,
|
|
722
|
+
tmResult: result,
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
async mem(req: MemoryRequest, _ctx: EngineContext): Promise<TextResult> {
|
|
727
|
+
return claudeMem(req.name, {
|
|
728
|
+
dispatcherDir: this.env.dispatcherDir,
|
|
729
|
+
projectsDir: this.env.projectsDir,
|
|
730
|
+
})
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
async reload(req: ReloadRequest, _ctx: EngineContext): Promise<ReloadResult> {
|
|
734
|
+
const result = await claudeReload([req.name], this.env)
|
|
735
|
+
if (result.code === 0) return { kind: 'reloaded', tmResult: result }
|
|
736
|
+
return { kind: 'failed', message: rstrip(result.stderr) || rstrip(result.stdout), tmResult: result }
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// ─── Diagnostic ─────────────────────────────────────────────────────
|
|
740
|
+
|
|
741
|
+
async inspect(req: InspectRequest, _ctx: EngineContext): Promise<EngineSnapshot> {
|
|
742
|
+
return {
|
|
743
|
+
engine: 'claude',
|
|
744
|
+
name: req.name,
|
|
745
|
+
fields: {
|
|
746
|
+
sid: readSid(req.name) ?? '',
|
|
747
|
+
cwd: readCwd(req.name) ?? '',
|
|
748
|
+
tmuxSession: tmuxSessionName(req.name),
|
|
749
|
+
},
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
async doctor(_ctx: EngineContext): Promise<DoctorSection> {
|
|
754
|
+
const result = await claudeDoctor([], this.env, {
|
|
755
|
+
tmWrapper: tmWrapperPath(),
|
|
756
|
+
pluginJson: pluginJsonPath(),
|
|
757
|
+
})
|
|
758
|
+
return {
|
|
759
|
+
engine: 'claude',
|
|
760
|
+
findings: [
|
|
761
|
+
{
|
|
762
|
+
severity: result.code === 0 ? 'ok' : 'warn',
|
|
763
|
+
summary: rstrip(result.stdout) || rstrip(result.stderr) || 'no doctor output',
|
|
764
|
+
fix: null,
|
|
765
|
+
},
|
|
766
|
+
],
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|