@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,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tm`'s `_send_keys`: push a prompt into a teammate's tmux pane.
|
|
3
|
+
*
|
|
4
|
+
* The hot-path verbs (`spawn` atomic-prompt tail, `send`, `compact`)
|
|
5
|
+
* share the same delivery shape — two modes by size, both clear the
|
|
6
|
+
* idle/last/busy baseline first and touch `<name>.send-at`. Centralised
|
|
7
|
+
* here so a future fix lands across every verb that composes them.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { mkdirSync, writeFileSync } from 'node:fs'
|
|
11
|
+
import { randomBytes } from 'node:crypto'
|
|
12
|
+
import { dirname } from 'node:path'
|
|
13
|
+
|
|
14
|
+
import { clearIdle, resolveSid } from './idle'
|
|
15
|
+
import { sendAtFile, tmuxSessionName } from '../../persistence/paths'
|
|
16
|
+
import { die, requireSession, resolvePaneTarget } from './tmux'
|
|
17
|
+
import { sleepMs } from './clock'
|
|
18
|
+
import type { TeammateName } from '../types'
|
|
19
|
+
import type { TmResult } from '../../tm'
|
|
20
|
+
import type { TmuxRunner } from '../../tmux'
|
|
21
|
+
|
|
22
|
+
/** Runtime knobs `_send_keys` reads from the environment. */
|
|
23
|
+
export interface SendKeysConfig {
|
|
24
|
+
/** Max prompt size (chars) to take the inline `send-keys -l + Enter` path. */
|
|
25
|
+
inlineMax: number
|
|
26
|
+
/** Optional override (seconds) for the post-paste settle gap. */
|
|
27
|
+
gapOverride: string | null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Parse the env knobs for `_send_keys` once per call — a malformed value
|
|
32
|
+
* dies up front rather than crashing the script mid-flow.
|
|
33
|
+
*/
|
|
34
|
+
export function readSendKeysConfig(env: NodeJS.ProcessEnv): SendKeysConfig | TmResult {
|
|
35
|
+
const inlineRaw = env.TM_SEND_INLINE_MAX ?? ''
|
|
36
|
+
const inlineMax = inlineRaw === '' ? 200 : Number(inlineRaw)
|
|
37
|
+
if (inlineRaw !== '' && !/^[0-9]+$/.test(inlineRaw)) {
|
|
38
|
+
return die(`TM_SEND_INLINE_MAX must be a non-negative integer (got: '${inlineRaw}')`)
|
|
39
|
+
}
|
|
40
|
+
const gapRaw = env.TM_SEND_GAP ?? ''
|
|
41
|
+
if (gapRaw !== '' && !/^[0-9]+(\.[0-9]+)?$/.test(gapRaw)) {
|
|
42
|
+
return die(`TM_SEND_GAP must be a non-negative number of seconds (got: '${gapRaw}')`)
|
|
43
|
+
}
|
|
44
|
+
return { inlineMax, gapOverride: gapRaw === '' ? null : gapRaw }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** `tm`'s size-based default paste-buffer settle gap, in seconds. */
|
|
48
|
+
export function defaultPasteGapSec(promptLength: number): number {
|
|
49
|
+
if (promptLength <= 256) return 0.2
|
|
50
|
+
if (promptLength <= 1024) return 0.5
|
|
51
|
+
if (promptLength <= 4096) return 1.0
|
|
52
|
+
if (promptLength <= 16384) return 2.0
|
|
53
|
+
return 4.0
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* `tm`'s `_send_keys`. Two delivery modes by size:
|
|
58
|
+
*
|
|
59
|
+
* - short single-line prompts take the inline `send-keys -l + Enter`
|
|
60
|
+
* fast path
|
|
61
|
+
* - larger or multi-line prompts stage the bytes in a named tmux
|
|
62
|
+
* buffer and `paste-buffer -p -r` them in a single bracketed-paste
|
|
63
|
+
* sequence, then send Enter after the trailing `\e[201~` marker
|
|
64
|
+
*
|
|
65
|
+
* Both modes clear the idle baseline first and touch `<name>.send-at`.
|
|
66
|
+
*
|
|
67
|
+
* Returns the `TmResult` whose stderr carries the `sent to ... ` /
|
|
68
|
+
* `sid=...` lines `cmd_send`'s preamble emits.
|
|
69
|
+
*/
|
|
70
|
+
export async function sendKeys(
|
|
71
|
+
name: TeammateName,
|
|
72
|
+
prompt: string,
|
|
73
|
+
runTmux: TmuxRunner,
|
|
74
|
+
processEnv: NodeJS.ProcessEnv,
|
|
75
|
+
): Promise<TmResult> {
|
|
76
|
+
const sessionMissing = await requireSession(name, runTmux)
|
|
77
|
+
if (sessionMissing !== null) return sessionMissing
|
|
78
|
+
|
|
79
|
+
const pane = await resolvePaneTarget(name, runTmux)
|
|
80
|
+
if (pane === '') return die(`could not resolve pane target for ${name}`)
|
|
81
|
+
|
|
82
|
+
const cfg = readSendKeysConfig(processEnv)
|
|
83
|
+
if ('code' in cfg) return cfg
|
|
84
|
+
|
|
85
|
+
// Clear the idle baseline before sending so the subsequent wait reflects
|
|
86
|
+
// THIS turn, not a prior one. A no-sid case is the fresh-spawn path where
|
|
87
|
+
// there is no prior turn to clear.
|
|
88
|
+
const sid = resolveSid(name)
|
|
89
|
+
if (sid !== null) clearIdle(sid)
|
|
90
|
+
|
|
91
|
+
// `tm`'s `: > "$(send_at_file "$repo")"` — touch the marker.
|
|
92
|
+
const sa = sendAtFile(name)
|
|
93
|
+
mkdirSync(dirname(sa), { recursive: true })
|
|
94
|
+
writeFileSync(sa, '')
|
|
95
|
+
|
|
96
|
+
const n = prompt.length
|
|
97
|
+
const inlinePath = n <= cfg.inlineMax && !prompt.includes('\n')
|
|
98
|
+
|
|
99
|
+
const session = tmuxSessionName(name)
|
|
100
|
+
let stderr = `sent to ${name} (tmux=${session})\n`
|
|
101
|
+
if (sid !== null) stderr += `sid=${sid}\n`
|
|
102
|
+
|
|
103
|
+
// `bin/tm` runs under `set -euo pipefail`, so a failed `tmux send-keys` /
|
|
104
|
+
// `load-buffer` / `paste-buffer` aborts the script before the verb claims
|
|
105
|
+
// success. Mirror that: any non-zero tmux exit fails the verb so the
|
|
106
|
+
// dispatcher does not later block on a Stop hook that will never fire.
|
|
107
|
+
const tmuxOk = (
|
|
108
|
+
result: { code: number; stderr: string },
|
|
109
|
+
what: string,
|
|
110
|
+
): TmResult | null =>
|
|
111
|
+
result.code === 0
|
|
112
|
+
? null
|
|
113
|
+
: die(`tmux ${what} failed: ${result.stderr.trim() || 'non-zero exit'}`)
|
|
114
|
+
|
|
115
|
+
if (inlinePath) {
|
|
116
|
+
const sent = await runTmux(['send-keys', '-t', pane, '-l', prompt])
|
|
117
|
+
const sentErr = tmuxOk(sent, 'send-keys')
|
|
118
|
+
if (sentErr !== null) return sentErr
|
|
119
|
+
const enter = await runTmux(['send-keys', '-t', pane, 'Enter'])
|
|
120
|
+
const enterErr = tmuxOk(enter, 'send-keys Enter')
|
|
121
|
+
if (enterErr !== null) return enterErr
|
|
122
|
+
return { code: 0, stdout: '', stderr }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const gap = cfg.gapOverride !== null ? Number(cfg.gapOverride) : defaultPasteGapSec(n)
|
|
126
|
+
const buf = `tm-send-${process.pid}-${randomBytes(2).toString('hex')}`
|
|
127
|
+
let loaded = false
|
|
128
|
+
try {
|
|
129
|
+
const loadResult = await runTmux(['load-buffer', '-b', buf, '-'], { stdin: prompt })
|
|
130
|
+
const loadErr = tmuxOk(loadResult, 'load-buffer')
|
|
131
|
+
if (loadErr !== null) return loadErr
|
|
132
|
+
loaded = true
|
|
133
|
+
const pasteResult = await runTmux([
|
|
134
|
+
'paste-buffer',
|
|
135
|
+
'-p',
|
|
136
|
+
'-r',
|
|
137
|
+
'-d',
|
|
138
|
+
'-b',
|
|
139
|
+
buf,
|
|
140
|
+
'-t',
|
|
141
|
+
pane,
|
|
142
|
+
])
|
|
143
|
+
const pasteErr = tmuxOk(pasteResult, 'paste-buffer')
|
|
144
|
+
if (pasteErr !== null) return pasteErr
|
|
145
|
+
// `paste-buffer -d` deletes the buffer on success.
|
|
146
|
+
loaded = false
|
|
147
|
+
await sleepMs(Math.round(gap * 1000))
|
|
148
|
+
const enter = await runTmux(['send-keys', '-t', pane, 'Enter'])
|
|
149
|
+
const enterErr = tmuxOk(enter, 'send-keys Enter')
|
|
150
|
+
if (enterErr !== null) return enterErr
|
|
151
|
+
} finally {
|
|
152
|
+
// Mirror `tm`'s RETURN trap: a `paste-buffer` that failed after
|
|
153
|
+
// `load-buffer` succeeded would otherwise leak a named buffer entry.
|
|
154
|
+
if (loaded) {
|
|
155
|
+
try {
|
|
156
|
+
await runTmux(['delete-buffer', '-b', buf])
|
|
157
|
+
} catch {
|
|
158
|
+
// Best effort — `tm` swallows this too (`2>/dev/null || true`).
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return { code: 0, stdout: '', stderr }
|
|
163
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude-engine `tm last` body — reprint a teammate's last-turn reply.
|
|
3
|
+
*
|
|
4
|
+
* The verb resolves the teammate's sid via the on-disk marker, then
|
|
5
|
+
* returns the verbatim content of `<sid>.last`. Two empty states are
|
|
6
|
+
* both "no reply yet": the file missing, or present but zero bytes.
|
|
7
|
+
*
|
|
8
|
+
* Returns a structured result so `ClaudeEngine.last` can pass it through
|
|
9
|
+
* unchanged and the verb-layer formatter renders the right
|
|
10
|
+
* `TmResult`. The `message` field carries the bare diagnostic text
|
|
11
|
+
* without a `tm:` prefix — the formatter adds that.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { readFileSync, statSync } from 'node:fs'
|
|
15
|
+
|
|
16
|
+
import { lastFileFor, sidFile } from '../../persistence/paths'
|
|
17
|
+
import { readSid } from './state'
|
|
18
|
+
import type { TeammateName, TextResult } from '../types'
|
|
19
|
+
|
|
20
|
+
/** Read a file only if it exists and is non-empty (`tm`'s `[[ -s file ]]`). */
|
|
21
|
+
function readIfNonEmpty(file: string): string | null {
|
|
22
|
+
try {
|
|
23
|
+
if (statSync(file).size === 0) return null
|
|
24
|
+
return readFileSync(file, 'utf8')
|
|
25
|
+
} catch {
|
|
26
|
+
return null
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function claudeLast(name: TeammateName): TextResult {
|
|
31
|
+
const sid = readSid(name)
|
|
32
|
+
if (sid === null) {
|
|
33
|
+
return {
|
|
34
|
+
kind: 'failed',
|
|
35
|
+
message:
|
|
36
|
+
`no sid file for ${name} at ${sidFile(name)} — was this teammate ` +
|
|
37
|
+
"spawned via 'tm spawn'? (raw 'tmux new-session' won't seed the sid)",
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const file = lastFileFor(sid)
|
|
41
|
+
const reply = readIfNonEmpty(file)
|
|
42
|
+
if (reply === null) {
|
|
43
|
+
return {
|
|
44
|
+
kind: 'failed',
|
|
45
|
+
message:
|
|
46
|
+
`no reply yet for ${name} (sid=${sid}) — file is missing or empty at ` +
|
|
47
|
+
`${file}. Try 'tm wait ${name}' to block for the next Stop, or ` +
|
|
48
|
+
`'tm send ${name} --prompt "..."' to drive a turn.`,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return { kind: 'text', text: reply }
|
|
52
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude-engine `tm mem` body — print a teammate's Claude Code
|
|
3
|
+
* project memory index (`MEMORY.md` under
|
|
4
|
+
* `~/.claude/projects/<dir>/memory/`).
|
|
5
|
+
*
|
|
6
|
+
* Schema 2 lookup: the AutoMemory directory is shared across a repo
|
|
7
|
+
* and its `.claude/worktrees/<slug>` children — Claude Code keys it
|
|
8
|
+
* by the **parent repo path**, not the runtime cwd. The verb resolves
|
|
9
|
+
* `identity.repo` (the recorded source repo) and encodes that path,
|
|
10
|
+
* so a teammate launched inside a worktree still surfaces the
|
|
11
|
+
* sibling repo's memory.
|
|
12
|
+
*
|
|
13
|
+
* Three outcomes carry into the verb-layer formatter:
|
|
14
|
+
*
|
|
15
|
+
* - `kind: 'text'` — file present (possibly empty); content verbatim.
|
|
16
|
+
* - `kind: 'not-supported'` — file absent; the formatter renders the
|
|
17
|
+
* diagnostic on stderr with exit 0.
|
|
18
|
+
* - `kind: 'failed'` — the teammate has no identity record (kill +
|
|
19
|
+
* respawn migration message) or the recorded repo path is gone.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { readFileSync, realpathSync, statSync } from 'node:fs'
|
|
23
|
+
import { dirname, join } from 'node:path'
|
|
24
|
+
|
|
25
|
+
import { encodeProjectDir } from '../../persistence/paths'
|
|
26
|
+
import { read as readIdentity } from '../../persistence/identity-store'
|
|
27
|
+
import type { TeammateName, TextResult } from '../types'
|
|
28
|
+
|
|
29
|
+
/** Whether a path exists and is a regular file. */
|
|
30
|
+
export function isRegularFile(path: string): boolean {
|
|
31
|
+
try {
|
|
32
|
+
return statSync(path).isFile()
|
|
33
|
+
} catch {
|
|
34
|
+
return false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Whether a path exists and is a directory. */
|
|
39
|
+
export function isDirectory(path: string): boolean {
|
|
40
|
+
try {
|
|
41
|
+
return statSync(path).isDirectory()
|
|
42
|
+
} catch {
|
|
43
|
+
return false
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ClaudeMemEnv {
|
|
48
|
+
readonly dispatcherDir: string
|
|
49
|
+
readonly projectsDir: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The `~/.claude/projects/<dir>` directory for a teammate. Resolved
|
|
54
|
+
* from `identity.repo` (not `identity.cwd`) — worktrees share their
|
|
55
|
+
* parent repo's AutoMemory.
|
|
56
|
+
*/
|
|
57
|
+
export function projectDirForName(name: TeammateName, env: ClaudeMemEnv): string | null {
|
|
58
|
+
const identity = readIdentity(name)
|
|
59
|
+
const target = identity === null ? join(env.dispatcherDir, name) : identity.repo
|
|
60
|
+
if (!isDirectory(target)) return null
|
|
61
|
+
const phys = realpathSync(target)
|
|
62
|
+
return join(env.projectsDir, encodeProjectDir(phys))
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The "repo not under dispatcher dir" diagnostic, byte-identical to
|
|
67
|
+
* the legacy `dieRepoNotFound`. Two branches: dispatcher dir itself
|
|
68
|
+
* is a git working tree (steer the user to `cd ..`), or the generic
|
|
69
|
+
* miss (instruction to set `TM_DISPATCHER_DIR`).
|
|
70
|
+
*/
|
|
71
|
+
export function repoNotFoundMessage(
|
|
72
|
+
verb: string,
|
|
73
|
+
name: TeammateName,
|
|
74
|
+
expected: string,
|
|
75
|
+
dispatcherDir: string,
|
|
76
|
+
): string {
|
|
77
|
+
if (isDirectory(join(dispatcherDir, '.git'))) {
|
|
78
|
+
return (
|
|
79
|
+
`${dispatcherDir} looks like a git working tree (.git exists), not a dispatcher root.\n` +
|
|
80
|
+
' The dispatcher dir should be the PARENT of your sibling repos.\n' +
|
|
81
|
+
` Try: cd "${dirname(dispatcherDir)}" && tm ${verb} ${name}\n` +
|
|
82
|
+
" (Or set TM_DISPATCHER_DIR in your dispatcher's .claude/settings.json\n" +
|
|
83
|
+
' — run /claudemux:setup to wire it up automatically.)'
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
return (
|
|
87
|
+
`repo not found at ${expected} — the teammate's identity record points at ` +
|
|
88
|
+
`a directory that no longer exists. Re-spawn with 'tm spawn <path> --name ${name}' ` +
|
|
89
|
+
`(or fix the path) to recover.`
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function claudeMem(name: TeammateName, env: ClaudeMemEnv): TextResult {
|
|
94
|
+
const identity = readIdentity(name)
|
|
95
|
+
if (identity === null) {
|
|
96
|
+
return {
|
|
97
|
+
kind: 'failed',
|
|
98
|
+
message:
|
|
99
|
+
`tm mem: no identity record for '${name}'. Spawn it with ` +
|
|
100
|
+
`'tm spawn <path> --name ${name}' first, or check 'tm ls'.`,
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!isDirectory(identity.repo)) {
|
|
104
|
+
return {
|
|
105
|
+
kind: 'failed',
|
|
106
|
+
message: repoNotFoundMessage('mem', name, identity.repo, env.dispatcherDir),
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const projectDir = projectDirForName(name, env)
|
|
110
|
+
if (projectDir === null) {
|
|
111
|
+
return {
|
|
112
|
+
kind: 'failed',
|
|
113
|
+
message: repoNotFoundMessage('mem', name, identity.repo, env.dispatcherDir),
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const mfile = join(projectDir, 'memory', 'MEMORY.md')
|
|
117
|
+
if (!isRegularFile(mfile)) {
|
|
118
|
+
return {
|
|
119
|
+
kind: 'not-supported',
|
|
120
|
+
reason: `tm mem: no auto-memory recorded for ${name} (looked at ${mfile})`,
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return { kind: 'text', text: readFileSync(mfile, 'utf8') }
|
|
124
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClaudeTeammateRecord.
|
|
3
|
+
*
|
|
4
|
+
* The base `/tmp/teammate-<name>.json` is owned by
|
|
5
|
+
* `persistence/identity-store.ts`; the Claude extension path builders and
|
|
6
|
+
* tmux session-name encoding live in `persistence/paths.ts`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { TeammateRecord } from '../teammate-record'
|
|
10
|
+
import type { EngineKind, TeammateName } from '../types'
|
|
11
|
+
import { claudeExtensionFor, tmuxSessionName, type ClaudeTeammateExtension } from '../../persistence/paths'
|
|
12
|
+
|
|
13
|
+
export class ClaudeTeammateRecord extends TeammateRecord {
|
|
14
|
+
readonly engine: EngineKind = 'claude'
|
|
15
|
+
|
|
16
|
+
constructor(args: {
|
|
17
|
+
name: TeammateName
|
|
18
|
+
repo: string
|
|
19
|
+
cwd: string
|
|
20
|
+
worktreeSlug: string | null
|
|
21
|
+
createdAt: number
|
|
22
|
+
displayName: string | null
|
|
23
|
+
}) {
|
|
24
|
+
super(args)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The tmux session name this teammate is launched as. */
|
|
28
|
+
tmuxSession(): string {
|
|
29
|
+
return tmuxSessionName(this.name)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The Claude-engine extension paths for this teammate. */
|
|
33
|
+
extension(): ClaudeTeammateExtension {
|
|
34
|
+
return claudeExtensionFor(this.name)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override engineExtensionFiles(): readonly string[] {
|
|
38
|
+
const ext = this.extension()
|
|
39
|
+
return [ext.cwd, ext.sid, ext.ready, ext.sendAt]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-turn output helpers — what `tm send` and `tm wait` print after a
|
|
3
|
+
* Stop fires (or a timeout decides). The reply text goes to stdout via
|
|
4
|
+
* `printLastOrEmpty`; the post-turn ctx echo goes to stderr via
|
|
5
|
+
* `echoCtxToStderr`. Centralised so the two verbs render identically.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { readIfNonEmpty, resolveSid } from './idle'
|
|
9
|
+
import { lastFileFor } from '../../persistence/paths'
|
|
10
|
+
import { claudeCtxLine } from './ctx'
|
|
11
|
+
import type { ClaudeCtxEnv } from './ctx'
|
|
12
|
+
import type { TeammateName } from '../types'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* `tm`'s `_print_last_or_empty`: the teammate's `<sid>.last` content,
|
|
16
|
+
* or the documented sentinel line when the file is missing or zero
|
|
17
|
+
* bytes. Always exit 0; the verb wrapper decides what code to ship.
|
|
18
|
+
*/
|
|
19
|
+
export function printLastOrEmpty(name: TeammateName): string {
|
|
20
|
+
const sid = resolveSid(name)
|
|
21
|
+
if (sid === null) return `(no sid for ${name})\n`
|
|
22
|
+
const reply = readIfNonEmpty(lastFileFor(sid))
|
|
23
|
+
if (reply === null) {
|
|
24
|
+
return '(no text reply this turn — tool-only, /compact, /clear, or fresh spawn)\n'
|
|
25
|
+
}
|
|
26
|
+
// `cat` does not append a newline; the file's own trailing newline is
|
|
27
|
+
// what shapes the printed line. Reproduce that verbatim.
|
|
28
|
+
return reply
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* `tm`'s `_echo_ctx_to_stderr`: the teammate's post-turn ctx line,
|
|
33
|
+
* prefixed with `ctx: `, on stderr. Soft-fails: an unreadable transcript
|
|
34
|
+
* or a sid that cannot be resolved drops the line silently.
|
|
35
|
+
*/
|
|
36
|
+
export function echoCtxToStderr(name: TeammateName, env: ClaudeCtxEnv): string {
|
|
37
|
+
// Reuse `claudeCtxLine` — its `?` diagnostic shape would also be a
|
|
38
|
+
// soft-fail, so any `name:` prefix indicates an unreadable transcript;
|
|
39
|
+
// only the formatted success line is echoed (the part after `<name>: `).
|
|
40
|
+
const body = claudeCtxLine(name, '', env)
|
|
41
|
+
if (body.includes(': ? (')) return ''
|
|
42
|
+
const prefix = `${name}: `
|
|
43
|
+
const data = body.startsWith(prefix) ? body.slice(prefix.length) : body
|
|
44
|
+
return `ctx: ${data}\n`
|
|
45
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tm reload` — fan `/reload-plugins` out to one, many, or all
|
|
3
|
+
* teammates.
|
|
4
|
+
*
|
|
5
|
+
* Fire-and-forget per teammate: each `/reload-plugins` is pushed into
|
|
6
|
+
* the pane via `sendKeys` directly, without waiting for the Stop hook
|
|
7
|
+
* (the user only cares that the slash command was queued; the
|
|
8
|
+
* underlying claude session takes seconds to reload its plugin set,
|
|
9
|
+
* and a 1-by-1 wait would serialize a 10-teammate fleet for minutes).
|
|
10
|
+
*
|
|
11
|
+
* `cmd_reload`'s `(failed — ...)` line and keep-iterating `rc` are
|
|
12
|
+
* dead code in bash: `_send_keys` `die`s (`exit 1`) for a non-running
|
|
13
|
+
* teammate rather than returning non-zero, which terminates `tm
|
|
14
|
+
* reload` outright. This reproduces what `tm reload` *does* — stop at
|
|
15
|
+
* the first send that exits non-zero, and propagate that exit code —
|
|
16
|
+
* not the unreachable intent.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { sendKeys } from './keys'
|
|
20
|
+
import { die, iterTeammates } from './tmux'
|
|
21
|
+
import type { ClaudeVerbEnv } from './env'
|
|
22
|
+
import type { TmResult } from '../../tm'
|
|
23
|
+
|
|
24
|
+
export async function claudeReload(args: readonly string[], env: ClaudeVerbEnv): Promise<TmResult> {
|
|
25
|
+
let all = false
|
|
26
|
+
const names: string[] = []
|
|
27
|
+
for (const arg of args) {
|
|
28
|
+
if (arg === '--all') all = true
|
|
29
|
+
else if (arg === '-h' || arg === '--help') return die('usage: tm reload <name>... | --all')
|
|
30
|
+
else if (arg.startsWith('-')) return die(`tm reload: unknown flag: ${arg}`)
|
|
31
|
+
else names.push(arg)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (all) {
|
|
35
|
+
if (names.length > 0) return die('tm reload: --all conflicts with explicit names')
|
|
36
|
+
names.push(...(await iterTeammates(env.runTmux)))
|
|
37
|
+
if (names.length === 0) {
|
|
38
|
+
return { code: 0, stdout: '(no teammate sessions to reload)\n', stderr: '' }
|
|
39
|
+
}
|
|
40
|
+
} else if (names.length === 0) {
|
|
41
|
+
return die('usage: tm reload <name>... | --all')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let stdout = ''
|
|
45
|
+
for (const name of names) {
|
|
46
|
+
stdout += `→ ${name}: /reload-plugins\n`
|
|
47
|
+
const sent = await sendKeys(name, '/reload-plugins', env.runTmux, process.env)
|
|
48
|
+
// A non-zero `sendKeys` is the `die` that ends `tm reload`; its
|
|
49
|
+
// own stderr went to `cmd_reload`'s `>/dev/null`, so it is dropped.
|
|
50
|
+
if (sent.code !== 0) return { code: sent.code, stdout, stderr: '' }
|
|
51
|
+
}
|
|
52
|
+
return { code: 0, stdout, stderr: '' }
|
|
53
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-resolution helpers — the dispatcher-tree → physical-path →
|
|
3
|
+
* `~/.claude/projects/<dir>` mapping `tm history`, `tm mem`, and
|
|
4
|
+
* `tm resume` all reach for.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { realpathSync } from 'node:fs'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
|
|
10
|
+
import { encodeProjectDir } from '../../persistence/paths'
|
|
11
|
+
import { isDirectory } from './idle'
|
|
12
|
+
import { die } from './tmux'
|
|
13
|
+
import type { TeammateName } from '../types'
|
|
14
|
+
import type { TmResult } from '../../tm'
|
|
15
|
+
|
|
16
|
+
export interface RepoFsEnv {
|
|
17
|
+
readonly dispatcherDir: string
|
|
18
|
+
readonly projectsDir: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The Claude Code project directory for a teammate, keyed on its
|
|
23
|
+
* runtime cwd. The cwd's *physical* path (symlinks resolved, as
|
|
24
|
+
* `cd && pwd -P` does) is encoded — Claude Code writes transcripts
|
|
25
|
+
* under that exact encoding. Worktree teammates therefore land at
|
|
26
|
+
* `~/.claude/projects/<repo-with-worktree-suffix>/`; `--no-worktree`
|
|
27
|
+
* teammates land at the repo's bare encoded path.
|
|
28
|
+
*
|
|
29
|
+
* The caller must have already confirmed `cwd` exists —
|
|
30
|
+
* `realpathSync` needs a real path.
|
|
31
|
+
*/
|
|
32
|
+
export function projectDirForCwd(cwd: string, env: RepoFsEnv): string {
|
|
33
|
+
const phys = realpathSync(cwd)
|
|
34
|
+
return join(env.projectsDir, encodeProjectDir(phys))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* `tm`'s `die_repo_not_found`. Two branches: dispatcher dir itself is
|
|
39
|
+
* a git working tree (steer the user to `cd ..`), or the generic miss
|
|
40
|
+
* (instruction to set `TM_DISPATCHER_DIR`).
|
|
41
|
+
*/
|
|
42
|
+
export function dieRepoNotFound(
|
|
43
|
+
verb: string,
|
|
44
|
+
name: TeammateName,
|
|
45
|
+
expected: string,
|
|
46
|
+
dispatcherDir: string,
|
|
47
|
+
): TmResult {
|
|
48
|
+
if (isDirectory(join(dispatcherDir, '.git'))) {
|
|
49
|
+
return die(
|
|
50
|
+
`${dispatcherDir} looks like a git working tree (.git exists), not a dispatcher root.\n` +
|
|
51
|
+
' The dispatcher dir should be the PARENT of your sibling repos.\n' +
|
|
52
|
+
` Try: cd "${dirname(dispatcherDir)}" && tm ${verb} ${name}\n` +
|
|
53
|
+
" (Or set TM_DISPATCHER_DIR in your dispatcher's .claude/settings.json\n" +
|
|
54
|
+
' — run /claudemux:setup to wire it up automatically.)',
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
return die(
|
|
58
|
+
`repo not found at ${expected} — <repo> must be a direct subdirectory of the ` +
|
|
59
|
+
`dispatcher dir (${dispatcherDir}). Dispatcher dir is read from ` +
|
|
60
|
+
"TM_DISPATCHER_DIR (env) or $PWD; if it's wrong, set TM_DISPATCHER_DIR or " +
|
|
61
|
+
'run tm from the right place.',
|
|
62
|
+
)
|
|
63
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tm resume` (Claude) — relaunch a prior conversation. With no sid
|
|
3
|
+
* the verb delegates session choice to the Claude CLI's native
|
|
4
|
+
* `--continue`. With a sid it proves the transcript exists at the
|
|
5
|
+
* recorded cwd's project-dir, then delegates to `spawn --resume`.
|
|
6
|
+
*
|
|
7
|
+
* Schema 2 changes:
|
|
8
|
+
* - The repo / worktree / cwd are passed in explicitly from the
|
|
9
|
+
* engine-router argv (`--repo`, `--cwd`, `--worktree-slug`); the
|
|
10
|
+
* legacy `<repo> sid` two-positional form is gone.
|
|
11
|
+
* - The teammate identity is the flat `<name>` (not a repo path);
|
|
12
|
+
* the tmux-session existence guard reads off `tmuxSessionName(name)`.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { join } from 'node:path'
|
|
16
|
+
|
|
17
|
+
import { claudeContinue, claudeSpawn } from './spawn'
|
|
18
|
+
import { isRegularFile } from './idle'
|
|
19
|
+
import { UUID_RE } from './identifiers'
|
|
20
|
+
import { encodeProjectDir, tmuxSessionName } from '../../persistence/paths'
|
|
21
|
+
import { die, sessionExists } from './tmux'
|
|
22
|
+
import { looksLikeUuidPrefix } from '../../identity/uuid-prefix'
|
|
23
|
+
import type { ClaudeVerbEnv } from './env'
|
|
24
|
+
import type { TmResult } from '../../tm'
|
|
25
|
+
|
|
26
|
+
interface ParsedClaudeResume {
|
|
27
|
+
name: string
|
|
28
|
+
repo: string
|
|
29
|
+
cwd: string
|
|
30
|
+
worktreeSlug: string | null
|
|
31
|
+
displayName: string
|
|
32
|
+
sid: string
|
|
33
|
+
prompt: string
|
|
34
|
+
hasPrompt: boolean
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function parseResumeRouterArgs(
|
|
38
|
+
args: readonly string[],
|
|
39
|
+
): ParsedClaudeResume | { error: TmResult } {
|
|
40
|
+
const name = args[0] ?? ''
|
|
41
|
+
if (name.length === 0) return { error: die('claude resume: <name> required') }
|
|
42
|
+
let repo = ''
|
|
43
|
+
let cwd = ''
|
|
44
|
+
let worktreeSlug: string | null = null
|
|
45
|
+
let displayName = ''
|
|
46
|
+
let sid = ''
|
|
47
|
+
let prompt = ''
|
|
48
|
+
let hasPrompt = false
|
|
49
|
+
for (let i = 1; i < args.length; i++) {
|
|
50
|
+
const arg = args[i]!
|
|
51
|
+
const next = (): string | null => {
|
|
52
|
+
const value = args[i + 1]
|
|
53
|
+
if (value === undefined) return null
|
|
54
|
+
i++
|
|
55
|
+
return value
|
|
56
|
+
}
|
|
57
|
+
if (arg === '--repo') {
|
|
58
|
+
const v = next()
|
|
59
|
+
if (v === null) return { error: die('claude resume: --repo requires a value') }
|
|
60
|
+
repo = v
|
|
61
|
+
} else if (arg === '--cwd') {
|
|
62
|
+
const v = next()
|
|
63
|
+
if (v === null) return { error: die('claude resume: --cwd requires a value') }
|
|
64
|
+
cwd = v
|
|
65
|
+
} else if (arg === '--worktree-slug') {
|
|
66
|
+
const v = next()
|
|
67
|
+
if (v === null) return { error: die('claude resume: --worktree-slug requires a value') }
|
|
68
|
+
worktreeSlug = v
|
|
69
|
+
} else if (arg === '--display-name') {
|
|
70
|
+
const v = next()
|
|
71
|
+
if (v === null) return { error: die('claude resume: --display-name requires a value') }
|
|
72
|
+
displayName = v
|
|
73
|
+
} else if (arg === '--prompt') {
|
|
74
|
+
const v = next()
|
|
75
|
+
if (v === null) return { error: die('claude resume: --prompt requires a value') }
|
|
76
|
+
prompt = v
|
|
77
|
+
hasPrompt = true
|
|
78
|
+
} else if (arg.startsWith('-')) {
|
|
79
|
+
return { error: die(`claude resume: unknown flag: ${arg}`) }
|
|
80
|
+
} else if (sid === '') {
|
|
81
|
+
sid = arg
|
|
82
|
+
} else {
|
|
83
|
+
return { error: die(`claude resume: unexpected positional '${arg}'`) }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (repo.length === 0) return { error: die('claude resume: missing --repo') }
|
|
87
|
+
if (cwd.length === 0) cwd = repo
|
|
88
|
+
return { name, repo, cwd, worktreeSlug, displayName, sid, prompt, hasPrompt }
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export async function claudeResume(args: readonly string[], env: ClaudeVerbEnv): Promise<TmResult> {
|
|
92
|
+
const parsed = parseResumeRouterArgs(args)
|
|
93
|
+
if ('error' in parsed) return parsed.error
|
|
94
|
+
const { name, repo, cwd, worktreeSlug, displayName, prompt, hasPrompt } = parsed
|
|
95
|
+
let { sid } = parsed
|
|
96
|
+
|
|
97
|
+
const session = tmuxSessionName(name)
|
|
98
|
+
if (await sessionExists(session, env.runTmux)) {
|
|
99
|
+
return die(
|
|
100
|
+
`${name} already running (tmux=${session}) — 'tm kill ${name}' first ` +
|
|
101
|
+
'if you really want to start over',
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const spawnArgs: string[] = [name, '--repo', repo, '--cwd', cwd]
|
|
106
|
+
if (worktreeSlug !== null) spawnArgs.push('--worktree-slug', worktreeSlug)
|
|
107
|
+
if (displayName.length > 0) spawnArgs.push('--display-name', displayName)
|
|
108
|
+
if (hasPrompt) spawnArgs.push('--prompt', prompt)
|
|
109
|
+
|
|
110
|
+
if (sid === '') {
|
|
111
|
+
return claudeContinue(name, spawnArgs.slice(1), env)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// The transcript directory Claude uses is keyed by the runtime
|
|
115
|
+
// cwd (the worktree path when `--worktree-slug` is set). Probe
|
|
116
|
+
// there for the sid.
|
|
117
|
+
const projectDir = join(env.projectsDir, encodeProjectDir(cwd))
|
|
118
|
+
const target = join(projectDir, `${sid}.jsonl`)
|
|
119
|
+
if (!isRegularFile(target)) {
|
|
120
|
+
if (looksLikeUuidPrefix(sid)) {
|
|
121
|
+
return die(
|
|
122
|
+
`received '${sid}', looks like a sid prefix; resume requires the ` +
|
|
123
|
+
`full sid. Run 'tm history ${name} ${sid}' to expand it, or ` +
|
|
124
|
+
`'tm history ${name}' to list past sessions with full ids.`,
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
return die(
|
|
128
|
+
`no transcript at ${target} — wrong name/worktree for this sid, or sid does not ` +
|
|
129
|
+
`exist. Check 'ls ${projectDir}/'.`,
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
if (!UUID_RE.test(sid)) {
|
|
133
|
+
if (looksLikeUuidPrefix(sid)) {
|
|
134
|
+
return die(
|
|
135
|
+
`received '${sid}', looks like a sid prefix; resume requires the ` +
|
|
136
|
+
`full sid. Run 'tm history ${name} ${sid}' to expand it.`,
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
return die(`sid is not a valid uuid: ${sid}`)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
spawnArgs.splice(1, 0, '--resume', sid)
|
|
143
|
+
// After splice: [name, --resume, sid, --repo, ..., --cwd, ..., ...]
|
|
144
|
+
return claudeSpawn(spawnArgs, env)
|
|
145
|
+
}
|