@gkorepanov/ccodex 0.4.18 → 0.4.20
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/README.md +2 -2
- package/config/compatibility.json +5 -5
- package/dist/claude/developerInstructions.d.ts +2 -0
- package/dist/claude/developerInstructions.js +9 -0
- package/dist/claude/developerInstructions.js.map +1 -0
- package/dist/claude/modelCatalog.d.ts +4 -0
- package/dist/claude/modelCatalog.js +14 -0
- package/dist/claude/modelCatalog.js.map +1 -1
- package/dist/claude/modelSelection.d.ts +14 -0
- package/dist/claude/modelSelection.js +26 -0
- package/dist/claude/modelSelection.js.map +1 -1
- package/dist/claude/resultClassifier.js +4 -1
- package/dist/claude/resultClassifier.js.map +1 -1
- package/dist/claude/service.d.ts +32 -2
- package/dist/claude/service.js +188 -71
- package/dist/claude/service.js.map +1 -1
- package/dist/claude/session/codexRollout.js +40 -1
- package/dist/claude/session/codexRollout.js.map +1 -1
- package/dist/claude/session/commands.d.ts +9 -1
- package/dist/claude/session/providerRuntimeFactory.js +19 -3
- package/dist/claude/session/providerRuntimeFactory.js.map +1 -1
- package/dist/claude/session/session.d.ts +5 -0
- package/dist/claude/session/session.js +58 -17
- package/dist/claude/session/session.js.map +1 -1
- package/dist/claude/toolMapper.js +1 -1
- package/dist/claude/toolMapper.js.map +1 -1
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.js +24 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/main.js +3 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/codex/generated/ClientRequest.d.ts +117 -1
- package/dist/codex/generated/ImageGenerationFailure.d.ts +5 -0
- package/dist/codex/generated/ImageGenerationFailure.js +3 -0
- package/dist/codex/generated/ImageGenerationFailure.js.map +1 -0
- package/dist/codex/generated/ImageGenerationItem.d.ts +3 -0
- package/dist/codex/generated/InitializeCapabilities.d.ts +10 -1
- package/dist/codex/generated/PathUri.d.ts +4 -3
- package/dist/codex/generated/PlanType.d.ts +1 -1
- package/dist/codex/generated/ResponseItem.d.ts +1 -0
- package/dist/codex/generated/ResponseItemRuntimeSchema.js +2 -2
- package/dist/codex/generated/ResponseItemRuntimeSchema.js.map +1 -1
- package/dist/codex/generated/ReviewDecision.d.ts +1 -1
- package/dist/codex/generated/ServerNotification.d.ts +20 -0
- package/dist/codex/generated/ServerNotificationEnvelope.d.ts +20 -0
- package/dist/codex/generated/index.d.ts +1 -0
- package/dist/codex/generated/index.js.map +1 -1
- package/dist/codex/generated/v2/AccountLoginCompletedNotification.d.ts +2 -0
- package/dist/codex/generated/v2/AgentMessageDelivery.d.ts +1 -0
- package/dist/codex/generated/v2/AgentMessageDelivery.js +3 -0
- package/dist/codex/generated/v2/AgentMessageDelivery.js.map +1 -0
- package/dist/codex/generated/v2/AppsReadParams.d.ts +4 -0
- package/dist/codex/generated/v2/AutoReviewRequirements.d.ts +4 -0
- package/dist/codex/generated/v2/AutoReviewRequirements.js +3 -0
- package/dist/codex/generated/v2/AutoReviewRequirements.js.map +1 -0
- package/dist/codex/generated/v2/AwsCredentialType.d.ts +1 -0
- package/dist/codex/generated/v2/AwsCredentialType.js +3 -0
- package/dist/codex/generated/v2/AwsCredentialType.js.map +1 -0
- package/dist/codex/generated/v2/BedrockAwsProfile.d.ts +4 -0
- package/dist/codex/generated/v2/BedrockAwsProfile.js +3 -0
- package/dist/codex/generated/v2/BedrockAwsProfile.js.map +1 -0
- package/dist/codex/generated/v2/BedrockDiscoverParams.d.ts +1 -0
- package/dist/codex/generated/v2/BedrockDiscoverParams.js +3 -0
- package/dist/codex/generated/v2/BedrockDiscoverParams.js.map +1 -0
- package/dist/codex/generated/v2/BedrockDiscoverResponse.d.ts +6 -0
- package/dist/codex/generated/v2/BedrockDiscoverResponse.js +3 -0
- package/dist/codex/generated/v2/BedrockDiscoverResponse.js.map +1 -0
- package/dist/codex/generated/v2/BedrockEnvironmentCredential.d.ts +5 -0
- package/dist/codex/generated/v2/BedrockEnvironmentCredential.js +3 -0
- package/dist/codex/generated/v2/BedrockEnvironmentCredential.js.map +1 -0
- package/dist/codex/generated/v2/BedrockSetupParams.d.ts +16 -0
- package/dist/codex/generated/v2/BedrockSetupParams.js +3 -0
- package/dist/codex/generated/v2/BedrockSetupParams.js.map +1 -0
- package/dist/codex/generated/v2/BedrockSetupResponse.d.ts +1 -0
- package/dist/codex/generated/v2/BedrockSetupResponse.js +3 -0
- package/dist/codex/generated/v2/BedrockSetupResponse.js.map +1 -0
- package/dist/codex/generated/v2/CliAuthCredentialsStoreMode.d.ts +1 -0
- package/dist/codex/generated/v2/CliAuthCredentialsStoreMode.js +3 -0
- package/dist/codex/generated/v2/CliAuthCredentialsStoreMode.js.map +1 -0
- package/dist/codex/generated/v2/CodexErrorInfo.d.ts +1 -1
- package/dist/codex/generated/v2/CommandAction.d.ts +2 -2
- package/dist/codex/generated/v2/ConfigLayerSource.d.ts +6 -0
- package/dist/codex/generated/v2/ConfigRequirements.d.ts +5 -0
- package/dist/codex/generated/v2/ConfiguredHookHandler.d.ts +10 -0
- package/dist/codex/generated/v2/DesktopOnboardingEntrypoint.d.ts +1 -0
- package/dist/codex/generated/v2/DesktopOnboardingEntrypoint.js +3 -0
- package/dist/codex/generated/v2/DesktopOnboardingEntrypoint.js.map +1 -0
- package/dist/codex/generated/v2/ExternalAgentConfigDetectResponse.d.ts +2 -0
- package/dist/codex/generated/v2/ExternalAgentConfigImportHistoryRecordParams.d.ts +2 -2
- package/dist/codex/generated/v2/ExternalAgentConfigImportHistoryRecordSuccessParams.d.ts +11 -0
- package/dist/codex/generated/v2/ExternalAgentConfigImportHistoryRecordSuccessParams.js +3 -0
- package/dist/codex/generated/v2/ExternalAgentConfigImportHistoryRecordSuccessParams.js.map +1 -0
- package/dist/codex/generated/v2/ExternalAgentConfigImportHistoryRecordTypeResultParams.d.ts +8 -0
- package/dist/codex/generated/v2/ExternalAgentConfigImportHistoryRecordTypeResultParams.js +3 -0
- package/dist/codex/generated/v2/ExternalAgentConfigImportHistoryRecordTypeResultParams.js.map +1 -0
- package/dist/codex/generated/v2/ExternalAgentConfigImportItemTypeSuccess.d.ts +4 -0
- package/dist/codex/generated/v2/ExternalAgentDetectedConnectorCandidate.d.ts +6 -0
- package/dist/codex/generated/v2/ExternalAgentDetectedConnectorCandidate.js +3 -0
- package/dist/codex/generated/v2/ExternalAgentDetectedConnectorCandidate.js.map +1 -0
- package/dist/codex/generated/v2/ExternalAgentDetectedConnectorSource.d.ts +1 -0
- package/dist/codex/generated/v2/ExternalAgentDetectedConnectorSource.js +3 -0
- package/dist/codex/generated/v2/ExternalAgentDetectedConnectorSource.js.map +1 -0
- package/dist/codex/generated/v2/GetAccountTokenUsageParams.d.ts +6 -0
- package/dist/codex/generated/v2/GetAccountTokenUsageParams.js +3 -0
- package/dist/codex/generated/v2/GetAccountTokenUsageParams.js.map +1 -0
- package/dist/codex/generated/v2/GetAccountTokenUsageResponse.d.ts +5 -0
- package/dist/codex/generated/v2/HookHandlerType.d.ts +1 -1
- package/dist/codex/generated/v2/HookMetadata.d.ts +13 -4
- package/dist/codex/generated/v2/McpAuthStatus.d.ts +1 -1
- package/dist/codex/generated/v2/McpResourceReadParams.d.ts +5 -0
- package/dist/codex/generated/v2/McpResourceReadResponse.d.ts +4 -0
- package/dist/codex/generated/v2/McpServerOauthClientRegistration.d.ts +1 -0
- package/dist/codex/generated/v2/McpServerOauthClientRegistration.js +3 -0
- package/dist/codex/generated/v2/McpServerOauthClientRegistration.js.map +1 -0
- package/dist/codex/generated/v2/McpServerOauthLoginParams.d.ts +5 -0
- package/dist/codex/generated/v2/McpServerStatus.d.ts +1 -0
- package/dist/codex/generated/v2/Model.d.ts +6 -0
- package/dist/codex/generated/v2/ModelUpgradeInfo.d.ts +4 -0
- package/dist/codex/generated/v2/MultiAgentVersion.d.ts +4 -0
- package/dist/codex/generated/v2/MultiAgentVersion.js +3 -0
- package/dist/codex/generated/v2/MultiAgentVersion.js.map +1 -0
- package/dist/codex/generated/v2/PluginDisabledReason.d.ts +1 -0
- package/dist/codex/generated/v2/PluginDisabledReason.js +3 -0
- package/dist/codex/generated/v2/PluginDisabledReason.js.map +1 -0
- package/dist/codex/generated/v2/PluginInstallParams.d.ts +4 -0
- package/dist/codex/generated/v2/PluginSearchParams.d.ts +9 -0
- package/dist/codex/generated/v2/PluginSearchParams.js +3 -0
- package/dist/codex/generated/v2/PluginSearchParams.js.map +1 -0
- package/dist/codex/generated/v2/PluginSearchResponse.d.ts +5 -0
- package/dist/codex/generated/v2/PluginSearchResponse.js +3 -0
- package/dist/codex/generated/v2/PluginSearchResponse.js.map +1 -0
- package/dist/codex/generated/v2/PluginSearchResult.d.ts +7 -0
- package/dist/codex/generated/v2/PluginSearchResult.js +3 -0
- package/dist/codex/generated/v2/PluginSearchResult.js.map +1 -0
- package/dist/codex/generated/v2/PluginSearchScope.d.ts +1 -0
- package/dist/codex/generated/v2/PluginSearchScope.js +3 -0
- package/dist/codex/generated/v2/PluginSearchScope.js.map +1 -0
- package/dist/codex/generated/v2/PluginSummary.d.ts +13 -0
- package/dist/codex/generated/v2/Project.d.ts +12 -0
- package/dist/codex/generated/v2/Project.js +3 -0
- package/dist/codex/generated/v2/Project.js.map +1 -0
- package/dist/codex/generated/v2/ProjectChangeType.d.ts +1 -0
- package/dist/codex/generated/v2/ProjectChangeType.js +3 -0
- package/dist/codex/generated/v2/ProjectChangeType.js.map +1 -0
- package/dist/codex/generated/v2/ProjectChangedNotification.d.ts +5 -0
- package/dist/codex/generated/v2/ProjectChangedNotification.js +3 -0
- package/dist/codex/generated/v2/ProjectChangedNotification.js.map +1 -0
- package/dist/codex/generated/v2/ProjectCreateParams.d.ts +9 -0
- package/dist/codex/generated/v2/ProjectCreateParams.js +3 -0
- package/dist/codex/generated/v2/ProjectCreateParams.js.map +1 -0
- package/dist/codex/generated/v2/ProjectCreateResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ProjectCreateResponse.js +3 -0
- package/dist/codex/generated/v2/ProjectCreateResponse.js.map +1 -0
- package/dist/codex/generated/v2/ProjectDeleteParams.d.ts +3 -0
- package/dist/codex/generated/v2/ProjectDeleteParams.js +3 -0
- package/dist/codex/generated/v2/ProjectDeleteParams.js.map +1 -0
- package/dist/codex/generated/v2/ProjectDeleteResponse.d.ts +1 -0
- package/dist/codex/generated/v2/ProjectDeleteResponse.js +3 -0
- package/dist/codex/generated/v2/ProjectDeleteResponse.js.map +1 -0
- package/dist/codex/generated/v2/ProjectImportParams.d.ts +10 -0
- package/dist/codex/generated/v2/ProjectImportParams.js +3 -0
- package/dist/codex/generated/v2/ProjectImportParams.js.map +1 -0
- package/dist/codex/generated/v2/ProjectImportResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ProjectImportResponse.js +3 -0
- package/dist/codex/generated/v2/ProjectImportResponse.js.map +1 -0
- package/dist/codex/generated/v2/ProjectListParams.d.ts +4 -0
- package/dist/codex/generated/v2/ProjectListParams.js +3 -0
- package/dist/codex/generated/v2/ProjectListParams.js.map +1 -0
- package/dist/codex/generated/v2/ProjectListResponse.d.ts +5 -0
- package/dist/codex/generated/v2/ProjectListResponse.js +3 -0
- package/dist/codex/generated/v2/ProjectListResponse.js.map +1 -0
- package/dist/codex/generated/v2/ProjectMoveParams.d.ts +4 -0
- package/dist/codex/generated/v2/ProjectMoveParams.js +3 -0
- package/dist/codex/generated/v2/ProjectMoveParams.js.map +1 -0
- package/dist/codex/generated/v2/ProjectMoveResponse.d.ts +1 -0
- package/dist/codex/generated/v2/ProjectMoveResponse.js +3 -0
- package/dist/codex/generated/v2/ProjectMoveResponse.js.map +1 -0
- package/dist/codex/generated/v2/ProjectReadParams.d.ts +3 -0
- package/dist/codex/generated/v2/ProjectReadParams.js +3 -0
- package/dist/codex/generated/v2/ProjectReadParams.js.map +1 -0
- package/dist/codex/generated/v2/ProjectReadResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ProjectReadResponse.js +3 -0
- package/dist/codex/generated/v2/ProjectReadResponse.js.map +1 -0
- package/dist/codex/generated/v2/ProjectRoot.d.ts +4 -0
- package/dist/codex/generated/v2/ProjectRoot.js +3 -0
- package/dist/codex/generated/v2/ProjectRoot.js.map +1 -0
- package/dist/codex/generated/v2/ProjectUpdateParams.d.ts +9 -0
- package/dist/codex/generated/v2/ProjectUpdateParams.js +3 -0
- package/dist/codex/generated/v2/ProjectUpdateParams.js.map +1 -0
- package/dist/codex/generated/v2/ProjectUpdateResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ProjectUpdateResponse.js +3 -0
- package/dist/codex/generated/v2/ProjectUpdateResponse.js.map +1 -0
- package/dist/codex/generated/v2/QueuedSubmission.d.ts +6 -0
- package/dist/codex/generated/v2/QueuedSubmission.js +3 -0
- package/dist/codex/generated/v2/QueuedSubmission.js.map +1 -0
- package/dist/codex/generated/v2/ServerDiagnosticsGauge.d.ts +4 -0
- package/dist/codex/generated/v2/ServerDiagnosticsGauge.js +3 -0
- package/dist/codex/generated/v2/ServerDiagnosticsGauge.js.map +1 -0
- package/dist/codex/generated/v2/ServerDiagnosticsParams.d.ts +1 -0
- package/dist/codex/generated/v2/ServerDiagnosticsParams.js +3 -0
- package/dist/codex/generated/v2/ServerDiagnosticsParams.js.map +1 -0
- package/dist/codex/generated/v2/ServerDiagnosticsProcess.d.ts +5 -0
- package/dist/codex/generated/v2/ServerDiagnosticsProcess.js +3 -0
- package/dist/codex/generated/v2/ServerDiagnosticsProcess.js.map +1 -0
- package/dist/codex/generated/v2/ServerDiagnosticsResponse.d.ts +6 -0
- package/dist/codex/generated/v2/ServerDiagnosticsResponse.js +3 -0
- package/dist/codex/generated/v2/ServerDiagnosticsResponse.js.map +1 -0
- package/dist/codex/generated/v2/StrictReviewRequiredNotification.d.ts +8 -0
- package/dist/codex/generated/v2/StrictReviewRequiredNotification.js +3 -0
- package/dist/codex/generated/v2/StrictReviewRequiredNotification.js.map +1 -0
- package/dist/codex/generated/v2/Thread.d.ts +11 -2
- package/dist/codex/generated/v2/ThreadBackgroundTerminal.d.ts +2 -2
- package/dist/codex/generated/v2/ThreadItem.d.ts +3 -0
- package/dist/codex/generated/v2/ThreadListParams.d.ts +8 -2
- package/dist/codex/generated/v2/ThreadMetadataUpdateParams.d.ts +5 -4
- package/dist/codex/generated/v2/ThreadProjectUpdatedNotification.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadProjectUpdatedNotification.js +3 -0
- package/dist/codex/generated/v2/ThreadProjectUpdatedNotification.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueAddParams.d.ts +6 -0
- package/dist/codex/generated/v2/ThreadQueueAddParams.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueAddParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueAddResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadQueueAddResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueAddResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueChangedNotification.d.ts +3 -0
- package/dist/codex/generated/v2/ThreadQueueChangedNotification.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueChangedNotification.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueDeleteParams.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadQueueDeleteParams.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueDeleteParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueDeleteResponse.d.ts +3 -0
- package/dist/codex/generated/v2/ThreadQueueDeleteResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueDeleteResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueListParams.d.ts +11 -0
- package/dist/codex/generated/v2/ThreadQueueListParams.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueListParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueListResponse.d.ts +8 -0
- package/dist/codex/generated/v2/ThreadQueueListResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueListResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueReorderParams.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadQueueReorderParams.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueReorderParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueReorderResponse.d.ts +1 -0
- package/dist/codex/generated/v2/ThreadQueueReorderResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueReorderResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueStartParams.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadQueueStartParams.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueStartParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueStartResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadQueueStartResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueStartResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueUpdateParams.d.ts +6 -0
- package/dist/codex/generated/v2/ThreadQueueUpdateParams.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueUpdateParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadQueueUpdateResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadQueueUpdateResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadQueueUpdateResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadRealtimeStartParams.d.ts +13 -0
- package/dist/codex/generated/v2/ThreadResumeResponse.d.ts +4 -4
- package/dist/codex/generated/v2/ThreadRevertParams.d.ts +12 -0
- package/dist/codex/generated/v2/ThreadRevertParams.js +3 -0
- package/dist/codex/generated/v2/ThreadRevertParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadRevertResponse.d.ts +22 -0
- package/dist/codex/generated/v2/ThreadRevertResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadRevertResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadRevertedNotification.d.ts +3 -0
- package/dist/codex/generated/v2/ThreadRevertedNotification.js +3 -0
- package/dist/codex/generated/v2/ThreadRevertedNotification.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSearchParams.d.ts +2 -2
- package/dist/codex/generated/v2/ThreadSearchSortKey.d.ts +1 -0
- package/dist/codex/generated/v2/ThreadSearchSortKey.js +3 -0
- package/dist/codex/generated/v2/ThreadSearchSortKey.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSection.d.ts +18 -0
- package/dist/codex/generated/v2/ThreadSection.js +3 -0
- package/dist/codex/generated/v2/ThreadSection.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionAppearance.d.ts +7 -0
- package/dist/codex/generated/v2/ThreadSectionAppearance.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionAppearance.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionCreateParams.d.ts +11 -0
- package/dist/codex/generated/v2/ThreadSectionCreateParams.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionCreateParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionCreateResponse.d.ts +7 -0
- package/dist/codex/generated/v2/ThreadSectionCreateResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionCreateResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionDeleteParams.d.ts +9 -0
- package/dist/codex/generated/v2/ThreadSectionDeleteParams.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionDeleteParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionDeleteResponse.d.ts +4 -0
- package/dist/codex/generated/v2/ThreadSectionDeleteResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionDeleteResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionListParams.d.ts +13 -0
- package/dist/codex/generated/v2/ThreadSectionListParams.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionListParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionListResponse.d.ts +11 -0
- package/dist/codex/generated/v2/ThreadSectionListResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionListResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionMoveParams.d.ts +17 -0
- package/dist/codex/generated/v2/ThreadSectionMoveParams.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionMoveParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionMoveResponse.d.ts +1 -0
- package/dist/codex/generated/v2/ThreadSectionMoveResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionMoveResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionUpdateParams.d.ts +18 -0
- package/dist/codex/generated/v2/ThreadSectionUpdateParams.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionUpdateParams.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSectionUpdateResponse.d.ts +7 -0
- package/dist/codex/generated/v2/ThreadSectionUpdateResponse.js +3 -0
- package/dist/codex/generated/v2/ThreadSectionUpdateResponse.js.map +1 -0
- package/dist/codex/generated/v2/ThreadSortKey.d.ts +1 -1
- package/dist/codex/generated/v2/ThreadStartParams.d.ts +5 -0
- package/dist/codex/generated/v2/ThreadUsage.d.ts +7 -0
- package/dist/codex/generated/v2/ThreadUsage.js +3 -0
- package/dist/codex/generated/v2/ThreadUsage.js.map +1 -0
- package/dist/codex/generated/v2/ThreadUsageBreakdownGroup.d.ts +11 -0
- package/dist/codex/generated/v2/ThreadUsageBreakdownGroup.js +3 -0
- package/dist/codex/generated/v2/ThreadUsageBreakdownGroup.js.map +1 -0
- package/dist/codex/generated/v2/ToolRequestUserInputParams.d.ts +4 -0
- package/dist/codex/generated/v2/index.d.ts +79 -0
- package/dist/daemon/probe.js +1 -1
- package/dist/desktop/launchConfig.d.ts +1 -0
- package/dist/desktop/launchConfig.js +71 -0
- package/dist/desktop/launchConfig.js.map +1 -0
- package/dist/desktop/stdioFrontend.d.ts +1 -0
- package/dist/desktop/stdioFrontend.js +6 -2
- package/dist/desktop/stdioFrontend.js.map +1 -1
- package/dist/gateway/clientConnection.js +63 -36
- package/dist/gateway/clientConnection.js.map +1 -1
- package/dist/gateway/stockRpc.d.ts +2 -0
- package/dist/gateway/stockRpc.js +13 -0
- package/dist/gateway/stockRpc.js.map +1 -1
- package/dist/gateway/threadList.js +7 -2
- package/dist/gateway/threadList.js.map +1 -1
- package/dist/gateway/transientNotice.js +3 -1
- package/dist/gateway/transientNotice.js.map +1 -1
- package/dist/handoff/lineageStore.d.ts +2 -8
- package/dist/handoff/lineageStore.js +2 -8
- package/dist/handoff/lineageStore.js.map +1 -1
- package/dist/handoff/providerEpochs.js +4 -5
- package/dist/handoff/providerEpochs.js.map +1 -1
- package/dist/handoff/service.d.ts +6 -1
- package/dist/handoff/service.js +42 -28
- package/dist/handoff/service.js.map +1 -1
- package/dist/protocol/appContext.d.ts +1 -0
- package/dist/protocol/appContext.js +5 -0
- package/dist/protocol/appContext.js.map +1 -0
- package/dist/runtime/dependencies.js +1 -1
- package/dist/store/sqliteStore.js +18 -1
- package/dist/store/sqliteStore.js.map +1 -1
- package/dist/store/threadFilter.js +11 -2
- package/dist/store/threadFilter.js.map +1 -1
- package/legal/THIRD_PARTY_NOTICES.md +234 -240
- package/package.json +6 -6
- package/skills/workforce/SKILL.md +51 -24
package/dist/claude/service.js
CHANGED
|
@@ -14,16 +14,17 @@ import { SdkTranscriptBrancher, } from "./transcriptBrancher.js";
|
|
|
14
14
|
import { ClaudeRateLimitCoordinator, } from "./rateLimits.js";
|
|
15
15
|
import { isClaudeStatusCommand } from "./statusCommand.js";
|
|
16
16
|
import { systemNoticeText } from "../gateway/transientNotice.js";
|
|
17
|
-
import { claudeCatalogId, normalizeClaudeModelIdentifier, normalizeClaudeServiceTier, resolveClaudeModel, } from "./modelSelection.js";
|
|
17
|
+
import { claudeCatalogId, normalizeClaudeModelIdentifier, normalizeClaudeServiceTier, pickClaudeModelReplacement, resolveClaudeModel, } from "./modelSelection.js";
|
|
18
18
|
import { ClaudeOutputAdapter } from "./session/outputAdapter.js";
|
|
19
19
|
import { branchRevision, ClaudeSessionRepository } from "./session/repository.js";
|
|
20
|
-
import { ClaudeSession } from "./session/session.js";
|
|
20
|
+
import { ActiveClaudeTurnError, ClaudeSession } from "./session/session.js";
|
|
21
21
|
import { ShellRunner } from "./session/shellRunner.js";
|
|
22
22
|
import { ClaudeSessionRegistry } from "./sessionRegistry.js";
|
|
23
23
|
import { validateResponseItems } from "./responseItemValidation.js";
|
|
24
24
|
import { providerUnavailableMessage, } from "../runtime/providerAvailability.js";
|
|
25
25
|
import { isCCodexStateCommand, stateModelName, } from "../state/stateCommand.js";
|
|
26
26
|
import { syncedCollaborationMode, threadSettings } from "./threadSettings.js";
|
|
27
|
+
import { claudeDeveloperInstructions } from "./developerInstructions.js";
|
|
27
28
|
function recordValue(value) {
|
|
28
29
|
return value && typeof value === "object" ? value : undefined;
|
|
29
30
|
}
|
|
@@ -158,7 +159,9 @@ function threadResponse(record, includeTurns) {
|
|
|
158
159
|
...settings,
|
|
159
160
|
thread: {
|
|
160
161
|
...record.thread,
|
|
161
|
-
|
|
162
|
+
section: record.thread.section ?? null,
|
|
163
|
+
sectionEnteredAt: record.thread.sectionEnteredAt ?? null,
|
|
164
|
+
projectId: record.thread.projectId ?? null,
|
|
162
165
|
canAcceptDirectInput: record.thread.parentThreadId ? false : true,
|
|
163
166
|
turns: includeTurns ? record.thread.turns : [],
|
|
164
167
|
},
|
|
@@ -302,10 +305,12 @@ export class ClaudeService {
|
|
|
302
305
|
interactiveQuestions: this.config.features?.interactiveQuestions ?? true,
|
|
303
306
|
resolveChildModel: (model) => {
|
|
304
307
|
const value = normalizeClaudeModelIdentifier(model);
|
|
305
|
-
const modelPickerId = this.
|
|
306
|
-
?? (value.startsWith(this.config.modelPrefix) ? value : `${this.config.modelPrefix}${value}`);
|
|
308
|
+
const modelPickerId = value.startsWith(this.config.modelPrefix) ? value : `${this.config.modelPrefix}${value}`;
|
|
307
309
|
const claudeModelValue = resolveClaudeModel(this.config, modelPickerId);
|
|
308
|
-
|
|
310
|
+
if (!claudeModelValue)
|
|
311
|
+
return undefined;
|
|
312
|
+
const lookup = this.cachedCatalogLookup(claudeModelValue);
|
|
313
|
+
return lookup ? this.catalogSelection(modelPickerId, claudeModelValue, lookup) : { modelPickerId, claudeModelValue };
|
|
309
314
|
},
|
|
310
315
|
}));
|
|
311
316
|
const records = this.store.allThreadRecords();
|
|
@@ -417,11 +422,47 @@ export class ClaudeService {
|
|
|
417
422
|
return threadSettings(this.withCatalogModel(this.requireRecord(threadId, false)));
|
|
418
423
|
}
|
|
419
424
|
withCatalogModel(record) {
|
|
420
|
-
const
|
|
421
|
-
if (!
|
|
425
|
+
const lookup = this.cachedCatalogLookup(record.resolvedModel ?? record.claudeModelValue);
|
|
426
|
+
if (!lookup)
|
|
422
427
|
return record;
|
|
423
|
-
const
|
|
424
|
-
return
|
|
428
|
+
const selection = this.catalogSelection(record.modelPickerId, record.claudeModelValue, lookup);
|
|
429
|
+
return selection.modelPickerId === record.modelPickerId ? record : { ...record, ...selection };
|
|
430
|
+
}
|
|
431
|
+
/** Finds the catalog entry for a Claude model value, migrating retired ids onto the closest current model. */
|
|
432
|
+
catalogLookup(models, claudeModelValue) {
|
|
433
|
+
const catalog = this.modelCatalog;
|
|
434
|
+
const cached = catalog.cachedPickerId?.(claudeModelValue);
|
|
435
|
+
if (cached)
|
|
436
|
+
return { id: cached, model: models.find((candidate) => candidate.id === cached), reason: "exact" };
|
|
437
|
+
const prefix = this.config.modelPrefix;
|
|
438
|
+
const strip = (id) => id.slice(prefix.length);
|
|
439
|
+
const defaultId = catalog.defaultModelId?.();
|
|
440
|
+
const replacement = pickClaudeModelReplacement(claudeModelValue, models.map((candidate) => strip(candidate.id)), defaultId && strip(defaultId));
|
|
441
|
+
const model = replacement && models.find((candidate) => strip(candidate.id) === replacement.value);
|
|
442
|
+
return model ? { id: model.id, model, reason: replacement.reason } : undefined;
|
|
443
|
+
}
|
|
444
|
+
cachedCatalogLookup(claudeModelValue) {
|
|
445
|
+
return this.modelCatalog && this.catalogLookup(this.modelCatalog.cachedModels?.() ?? [], claudeModelValue);
|
|
446
|
+
}
|
|
447
|
+
catalogSelection(modelPickerId, claudeModelValue, lookup) {
|
|
448
|
+
const prefix = this.config.modelPrefix;
|
|
449
|
+
if (lookup.id === `${prefix}${claudeModelValue}` || lookup.id === claudeCatalogId(this.config, modelPickerId))
|
|
450
|
+
return { modelPickerId, claudeModelValue };
|
|
451
|
+
this.logger.warn("claude.model.migrated", { from: modelPickerId, to: lookup.id, reason: lookup.reason });
|
|
452
|
+
return { modelPickerId: lookup.id, claudeModelValue: lookup.id.slice(prefix.length) };
|
|
453
|
+
}
|
|
454
|
+
/** Persists a catalog migration for a stored thread so its runtime starts on a model the account still has. */
|
|
455
|
+
async migrateStoredModel(threadId) {
|
|
456
|
+
if (!this.modelCatalog)
|
|
457
|
+
return;
|
|
458
|
+
const record = this.requireRecord(threadId, false);
|
|
459
|
+
const models = await this.modelCatalog.list().catch(() => undefined);
|
|
460
|
+
const lookup = models && this.catalogLookup(models, record.claudeModelValue);
|
|
461
|
+
if (!lookup)
|
|
462
|
+
return;
|
|
463
|
+
const selection = this.catalogSelection(record.modelPickerId, record.claudeModelValue, lookup);
|
|
464
|
+
if (selection.modelPickerId !== record.modelPickerId)
|
|
465
|
+
await this.applySettings({ threadId, model: selection.modelPickerId });
|
|
425
466
|
}
|
|
426
467
|
sideSnapshot(sourceThreadId, targetThreadId, visibleForkedFromId) {
|
|
427
468
|
const record = this.requireRecord(sourceThreadId, false);
|
|
@@ -530,6 +571,7 @@ export class ClaudeService {
|
|
|
530
571
|
: {}),
|
|
531
572
|
});
|
|
532
573
|
}
|
|
574
|
+
await this.migrateStoredModel(threadId);
|
|
533
575
|
await (await this.sessions.getOrCreate(threadId)).materializeRuntime();
|
|
534
576
|
record = await this.sessions.submit(threadId, { type: "readThread", includeTurns: true });
|
|
535
577
|
record = this.withCatalogModel(record);
|
|
@@ -629,6 +671,39 @@ export class ClaudeService {
|
|
|
629
671
|
throw error;
|
|
630
672
|
}
|
|
631
673
|
}
|
|
674
|
+
async prepareAppTurn(params) {
|
|
675
|
+
try {
|
|
676
|
+
return await this.prepareTurn(params);
|
|
677
|
+
}
|
|
678
|
+
catch (error) {
|
|
679
|
+
if (!(error instanceof ActiveClaudeTurnError))
|
|
680
|
+
throw error;
|
|
681
|
+
const { turnId } = await this.steerTurn({
|
|
682
|
+
threadId: params.threadId,
|
|
683
|
+
input: params.input,
|
|
684
|
+
expectedTurnId: error.turnId,
|
|
685
|
+
...(params.clientUserMessageId === undefined
|
|
686
|
+
? {}
|
|
687
|
+
: { clientUserMessageId: params.clientUserMessageId }),
|
|
688
|
+
...(params.responsesapiClientMetadata === undefined
|
|
689
|
+
? {}
|
|
690
|
+
: { responsesapiClientMetadata: params.responsesapiClientMetadata }),
|
|
691
|
+
...(params.additionalContext === undefined
|
|
692
|
+
? {}
|
|
693
|
+
: { additionalContext: params.additionalContext }),
|
|
694
|
+
});
|
|
695
|
+
const turn = this.requireRecord(params.threadId, true).thread.turns
|
|
696
|
+
.find((candidate) => candidate.id === turnId);
|
|
697
|
+
if (!turn)
|
|
698
|
+
throw new Error(`Active Claude turn '${turnId}' disappeared after steering.`);
|
|
699
|
+
return {
|
|
700
|
+
response: { turn },
|
|
701
|
+
announce: () => Promise.resolve(),
|
|
702
|
+
start: () => undefined,
|
|
703
|
+
startAndWait: () => Promise.resolve(),
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
}
|
|
632
707
|
async prepareStatusTurn(params, render) {
|
|
633
708
|
this.requireIndependentThread(params.threadId, "start a status turn in");
|
|
634
709
|
if (!isClaudeStatusCommand(params.input))
|
|
@@ -933,9 +1008,20 @@ export class ClaudeService {
|
|
|
933
1008
|
}
|
|
934
1009
|
updateThreadMetadata(params) {
|
|
935
1010
|
this.requireIndependentThread(params.threadId, "update metadata for");
|
|
1011
|
+
if (params.projectId !== undefined && params.projectId !== null && params.projectId !== "") {
|
|
1012
|
+
throw invalidParams("Projects are not supported for Claude threads.");
|
|
1013
|
+
}
|
|
936
1014
|
return this.sessions.submit(params.threadId, {
|
|
937
1015
|
type: "threadAdmin",
|
|
938
|
-
command: { kind: "metadata", gitInfo: params.gitInfo
|
|
1016
|
+
command: { kind: "metadata", gitInfo: params.gitInfo },
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
/** Section registry stays stock-owned; CCodex records only the membership. */
|
|
1020
|
+
setThreadSection(threadId, section) {
|
|
1021
|
+
this.requireIndependentThread(threadId, "move into a section");
|
|
1022
|
+
return this.sessions.submit(threadId, {
|
|
1023
|
+
type: "threadAdmin",
|
|
1024
|
+
command: { kind: "metadata", gitInfo: undefined, section },
|
|
939
1025
|
});
|
|
940
1026
|
}
|
|
941
1027
|
async archiveThread(threadId) {
|
|
@@ -1115,9 +1201,8 @@ export class ClaudeService {
|
|
|
1115
1201
|
if (sourceRecord.thread.ephemeral && !sidePromotion) {
|
|
1116
1202
|
throw invalidParams("Forking this ephemeral Claude source thread is not supported.");
|
|
1117
1203
|
}
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
if (!claudeModelValue)
|
|
1204
|
+
const requestedModel = params.model ?? sourceRecord.modelPickerId;
|
|
1205
|
+
if (!resolveClaudeModel(this.config, requestedModel))
|
|
1121
1206
|
throw invalidParams("Cannot fork a Claude thread to a Codex model.");
|
|
1122
1207
|
const activeSideFork = Boolean(params.ephemeral === true && params.excludeTurns === true
|
|
1123
1208
|
&& params.threadSource === "user" && !params.lastTurnId && !params.beforeTurnId);
|
|
@@ -1161,8 +1246,10 @@ export class ClaudeService {
|
|
|
1161
1246
|
const sourceBoundaries = source.boundaries.filter((entry) => stableSelectedIds.has(entry.turnId));
|
|
1162
1247
|
const revisionTurns = sourceTurns.filter((turn) => stableSelectedIds.has(turn.id));
|
|
1163
1248
|
const revision = branchRevision(sourceRecord, sourceBoundaries, revisionTurns);
|
|
1164
|
-
const
|
|
1165
|
-
await this.
|
|
1249
|
+
const requestedServiceTier = normalizeClaudeServiceTier(this.config, requestedModel, params.serviceTier === undefined ? sourceRecord.serviceTier : params.serviceTier);
|
|
1250
|
+
const { modelPickerId, claudeModelValue, reasoningEffort, serviceTier } = await this.resolveModelSettings(requestedModel, sourceRecord.reasoningEffort, requestedServiceTier);
|
|
1251
|
+
if (serviceTier !== requestedServiceTier)
|
|
1252
|
+
throw invalidParams(`Claude model '${requestedModel}' does not support the fast service tier.`);
|
|
1166
1253
|
const boundary = selectedBoundary?.messageUuid ?? sourceBoundaries.at(-1)?.messageUuid;
|
|
1167
1254
|
const branch = boundary
|
|
1168
1255
|
? await this.transcripts.forkWithProvenance(sourceRecord.claudeSessionId, boundary, sourceRecord.thread.cwd, sourceBoundaries.map((entry) => entry.messageUuid), boundaryCorrelations(this.store, sourceRecord, sourceBoundaries))
|
|
@@ -1186,7 +1273,8 @@ export class ClaudeService {
|
|
|
1186
1273
|
});
|
|
1187
1274
|
const threadId = uuidv7();
|
|
1188
1275
|
const thread = {
|
|
1189
|
-
...sourceRecord.thread, id: threadId, ephemeral: params.ephemeral ?? false,
|
|
1276
|
+
...sourceRecord.thread, id: threadId, ephemeral: params.ephemeral ?? false,
|
|
1277
|
+
section: null, sectionEnteredAt: null, projectId: null,
|
|
1190
1278
|
sessionId: threadId, forkedFromId: visibleForkedFromId,
|
|
1191
1279
|
cwd, modelProvider: "claude", createdAt, updatedAt: createdAt, recencyAt: createdAt,
|
|
1192
1280
|
status: params.ephemeral ? { type: "idle" } : { type: "notLoaded" },
|
|
@@ -1199,7 +1287,7 @@ export class ClaudeService {
|
|
|
1199
1287
|
const copiedTurns = sourceTurns.map((turn) => forkProjection(turn, thread.id));
|
|
1200
1288
|
const record = {
|
|
1201
1289
|
...sourceRecord, thread, runtimeWorkspaceRoots,
|
|
1202
|
-
claudeSessionId: branch.sessionId, modelPickerId, claudeModelValue, serviceTier,
|
|
1290
|
+
claudeSessionId: branch.sessionId, modelPickerId, claudeModelValue, serviceTier, reasoningEffort,
|
|
1203
1291
|
approvalPolicy: params.approvalPolicy ?? sourceRecord.approvalPolicy,
|
|
1204
1292
|
approvalsReviewer: approvalsReviewer(params.approvalsReviewer, sourceRecord.approvalsReviewer),
|
|
1205
1293
|
sandboxPolicy: params.permissions
|
|
@@ -1208,8 +1296,8 @@ export class ClaudeService {
|
|
|
1208
1296
|
? sandboxPolicy(params.sandbox, cwd, runtimeWorkspaceRoots)
|
|
1209
1297
|
: inheritedSandboxPolicy(sourceRecord.sandboxPolicy, cwd, runtimeWorkspaceRoots),
|
|
1210
1298
|
baseInstructions: params.baseInstructions === undefined ? sourceRecord.baseInstructions : params.baseInstructions,
|
|
1211
|
-
developerInstructions: params.developerInstructions === undefined
|
|
1212
|
-
? sourceRecord.developerInstructions : params.developerInstructions,
|
|
1299
|
+
developerInstructions: claudeDeveloperInstructions(params.developerInstructions === undefined
|
|
1300
|
+
? sourceRecord.developerInstructions : params.developerInstructions),
|
|
1213
1301
|
lastClaudeMessageUuid: null, lastCompletedTurnId: null,
|
|
1214
1302
|
};
|
|
1215
1303
|
let responseRecord;
|
|
@@ -1247,21 +1335,42 @@ export class ClaudeService {
|
|
|
1247
1335
|
return threadResponse(responseRecord, !params.excludeTurns);
|
|
1248
1336
|
}
|
|
1249
1337
|
async rollbackThread(params) {
|
|
1250
|
-
this.
|
|
1251
|
-
const source = await this.sessions.submit(params.threadId, { type: "snapshotBranch" });
|
|
1252
|
-
const sourceRecord = source.record;
|
|
1253
|
-
if (sourceRecord.thread.ephemeral)
|
|
1254
|
-
throw invalidParams("Rolling back an ephemeral Claude thread is not supported.");
|
|
1338
|
+
const source = await this.truncationSource(params.threadId, "roll back");
|
|
1255
1339
|
if (!Number.isInteger(params.numTurns) || params.numTurns < 1)
|
|
1256
1340
|
throw invalidParams("numTurns must be at least 1.");
|
|
1257
|
-
if (params.numTurns >
|
|
1341
|
+
if (params.numTurns > source.record.thread.turns.length)
|
|
1258
1342
|
throw invalidParams("Cannot remove more turns than the Claude thread contains.");
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
const
|
|
1343
|
+
const committed = await this.truncateThread(source, source.record.thread.turns.length - params.numTurns);
|
|
1344
|
+
return { thread: committed.thread };
|
|
1345
|
+
}
|
|
1346
|
+
/** `thread/revert`: drops `beforeTurnId` and every later turn; the App hydrates retained history via the cursors. */
|
|
1347
|
+
async revertThread(params) {
|
|
1348
|
+
const source = await this.truncationSource(params.threadId, "revert");
|
|
1349
|
+
const keepCount = source.record.thread.turns.findIndex((turn) => turn.id === params.beforeTurnId);
|
|
1350
|
+
if (keepCount === -1)
|
|
1351
|
+
throw invalidParams(`Unknown Claude turn '${params.beforeTurnId}'.`);
|
|
1352
|
+
const retained = (await this.truncateThread(source, keepCount)).thread;
|
|
1353
|
+
return {
|
|
1354
|
+
thread: { ...retained, turns: [] },
|
|
1355
|
+
turnsBackwardsCursor: retained.turns.length ? turnCursor(retained.turns.at(-1).id, true) : null,
|
|
1356
|
+
itemsBackwardsCursor: retained.turns.some((turn) => turn.items.length) ? "hyb-item:0" : null,
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
async truncationSource(threadId, verb) {
|
|
1360
|
+
this.requireIndependentThread(threadId, verb);
|
|
1361
|
+
const snapshot = await this.sessions.submit(threadId, { type: "snapshotBranch" });
|
|
1362
|
+
if (snapshot.record.thread.ephemeral)
|
|
1363
|
+
throw invalidParams(`Cannot ${verb} an ephemeral Claude thread.`);
|
|
1364
|
+
const session = await this.sessions.getOrCreate(threadId);
|
|
1365
|
+
if ((await session.runtimeInspection())?.quiescent === false)
|
|
1366
|
+
throw invalidParams(`Cannot ${verb} a Claude thread with an active turn.`);
|
|
1367
|
+
return { ...snapshot, session };
|
|
1368
|
+
}
|
|
1369
|
+
/** Keeps the first `keepCount` turns by forking the transcript at the last retained provider boundary. */
|
|
1370
|
+
async truncateThread(source, keepCount) {
|
|
1371
|
+
const sourceRecord = source.record;
|
|
1372
|
+
const threadId = sourceRecord.thread.id;
|
|
1373
|
+
const retainedIds = new Set(sourceRecord.thread.turns.slice(0, keepCount).map((turn) => turn.id));
|
|
1265
1374
|
const sourceBoundaries = source.boundaries.filter((entry) => retainedIds.has(entry.turnId));
|
|
1266
1375
|
const boundary = sourceBoundaries.at(-1)?.messageUuid;
|
|
1267
1376
|
const branch = boundary
|
|
@@ -1269,7 +1378,7 @@ export class ClaudeService {
|
|
|
1269
1378
|
: { sessionId: uuidv7(), uuidMap: new Map() };
|
|
1270
1379
|
let committed;
|
|
1271
1380
|
try {
|
|
1272
|
-
committed = await this.sessions.submit(
|
|
1381
|
+
committed = await this.sessions.submit(threadId, {
|
|
1273
1382
|
type: "commitRollback", expectedRevision: source.revision, replacementSessionId: branch.sessionId,
|
|
1274
1383
|
keepCount, sourceBoundaries, uuidMap: [...branch.uuidMap],
|
|
1275
1384
|
});
|
|
@@ -1278,13 +1387,13 @@ export class ClaudeService {
|
|
|
1278
1387
|
await this.transcripts.delete(branch.sessionId, sourceRecord.thread.cwd).catch(() => undefined);
|
|
1279
1388
|
throw error;
|
|
1280
1389
|
}
|
|
1281
|
-
if (
|
|
1282
|
-
await
|
|
1283
|
-
this.logger.warn("claude.rollback.old-runtime-retire-failed", { threadId
|
|
1390
|
+
if (source.session.isLoaded) {
|
|
1391
|
+
await source.session.retireRuntimeSilently().catch((error) => {
|
|
1392
|
+
this.logger.warn("claude.rollback.old-runtime-retire-failed", { threadId, error: String(error) });
|
|
1284
1393
|
});
|
|
1285
1394
|
}
|
|
1286
|
-
await this.transcripts.delete(sourceRecord.claudeSessionId, sourceRecord.thread.cwd).catch((error) => this.logger.warn("claude.rollback.old-session-delete-failed", { threadId
|
|
1287
|
-
return
|
|
1395
|
+
await this.transcripts.delete(sourceRecord.claudeSessionId, sourceRecord.thread.cwd).catch((error) => this.logger.warn("claude.rollback.old-session-delete-failed", { threadId, error: String(error) }));
|
|
1396
|
+
return committed;
|
|
1288
1397
|
}
|
|
1289
1398
|
prepareGoalSet(params) {
|
|
1290
1399
|
this.requireIndependentThread(params.threadId, "set a goal on");
|
|
@@ -1603,7 +1712,9 @@ export class ClaudeService {
|
|
|
1603
1712
|
if (!native)
|
|
1604
1713
|
return {
|
|
1605
1714
|
...record.thread,
|
|
1606
|
-
|
|
1715
|
+
section: record.thread.section ?? null,
|
|
1716
|
+
sectionEnteredAt: record.thread.sectionEnteredAt ?? null,
|
|
1717
|
+
projectId: record.thread.projectId ?? null,
|
|
1607
1718
|
canAcceptDirectInput: record.thread.parentThreadId ? false : true,
|
|
1608
1719
|
};
|
|
1609
1720
|
const createdAt = native.createdAt === undefined
|
|
@@ -1612,7 +1723,9 @@ export class ClaudeService {
|
|
|
1612
1723
|
const updatedAt = Math.floor(native.lastModified / 1_000);
|
|
1613
1724
|
return {
|
|
1614
1725
|
...record.thread,
|
|
1615
|
-
|
|
1726
|
+
section: record.thread.section ?? null,
|
|
1727
|
+
sectionEnteredAt: record.thread.sectionEnteredAt ?? null,
|
|
1728
|
+
projectId: record.thread.projectId ?? null,
|
|
1616
1729
|
canAcceptDirectInput: record.thread.parentThreadId ? false : true,
|
|
1617
1730
|
name: record.thread.name || native.customTitle || native.summary,
|
|
1618
1731
|
preview: native.firstPrompt ?? record.thread.preview,
|
|
@@ -1670,17 +1783,15 @@ export class ClaudeService {
|
|
|
1670
1783
|
return undefined;
|
|
1671
1784
|
}
|
|
1672
1785
|
async newThreadRecord(params, settings) {
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1675
|
-
if (!modelPickerId || !claudeModelValue)
|
|
1786
|
+
const requestedModel = params.model;
|
|
1787
|
+
if (!requestedModel || !resolveClaudeModel(this.config, requestedModel))
|
|
1676
1788
|
throw invalidParams("Claude thread requires a configured Claude model or alias.");
|
|
1677
1789
|
if (params.permissions && params.sandbox)
|
|
1678
1790
|
throw invalidParams("Claude thread start cannot combine permissions with sandbox.");
|
|
1679
|
-
const requestedServiceTier = normalizeClaudeServiceTier(this.config,
|
|
1791
|
+
const requestedServiceTier = normalizeClaudeServiceTier(this.config, requestedModel, params.serviceTier);
|
|
1680
1792
|
if (requestedServiceTier !== null && requestedServiceTier !== "default" && requestedServiceTier !== "fast")
|
|
1681
1793
|
throw invalidParams(`Unsupported Claude service tier '${requestedServiceTier}'.`);
|
|
1682
|
-
const reasoningEffort = settings?.effort ?? null;
|
|
1683
|
-
const serviceTier = await this.validatedServiceTier(modelPickerId, reasoningEffort, requestedServiceTier);
|
|
1794
|
+
const { modelPickerId, claudeModelValue, reasoningEffort, serviceTier } = await this.resolveModelSettings(requestedModel, settings?.effort ?? null, requestedServiceTier);
|
|
1684
1795
|
const createdAt = nowSeconds();
|
|
1685
1796
|
const workspace = workspaceSelection(params);
|
|
1686
1797
|
const { cwd, runtimeWorkspaceRoots } = workspace;
|
|
@@ -1693,7 +1804,9 @@ export class ClaudeService {
|
|
|
1693
1804
|
parentThreadId: null,
|
|
1694
1805
|
preview: "",
|
|
1695
1806
|
ephemeral: params.ephemeral ?? false,
|
|
1696
|
-
|
|
1807
|
+
section: null,
|
|
1808
|
+
sectionEnteredAt: null,
|
|
1809
|
+
projectId: null,
|
|
1697
1810
|
historyMode: params.historyMode ?? "legacy",
|
|
1698
1811
|
modelProvider: "claude",
|
|
1699
1812
|
createdAt,
|
|
@@ -1723,7 +1836,7 @@ export class ClaudeService {
|
|
|
1723
1836
|
? permissionProfileSandboxPolicy(params.permissions, cwd, runtimeWorkspaceRoots)
|
|
1724
1837
|
: sandboxPolicy(params.sandbox, cwd, runtimeWorkspaceRoots),
|
|
1725
1838
|
baseInstructions: params.baseInstructions ?? null,
|
|
1726
|
-
developerInstructions: params.developerInstructions
|
|
1839
|
+
developerInstructions: claudeDeveloperInstructions(params.developerInstructions),
|
|
1727
1840
|
personality: settings?.personality ?? params.personality ?? null,
|
|
1728
1841
|
resolvedModel: null,
|
|
1729
1842
|
lastClaudeMessageUuid: null,
|
|
@@ -1769,11 +1882,10 @@ export class ClaudeService {
|
|
|
1769
1882
|
const session = await this.sessions.getOrCreate(params.threadId);
|
|
1770
1883
|
for (;;) {
|
|
1771
1884
|
const before = await this.sessions.submit(params.threadId, { type: "readThread", includeTurns: false });
|
|
1772
|
-
const
|
|
1773
|
-
|
|
1774
|
-
if (!claudeModelValue)
|
|
1885
|
+
const requestedModel = params.model ?? before.modelPickerId;
|
|
1886
|
+
if (!resolveClaudeModel(this.config, requestedModel))
|
|
1775
1887
|
throw invalidParams("Cannot switch a Claude thread to a Codex model.");
|
|
1776
|
-
const requestedServiceTier = normalizeClaudeServiceTier(this.config,
|
|
1888
|
+
const requestedServiceTier = normalizeClaudeServiceTier(this.config, requestedModel, params.serviceTier === undefined ? before.serviceTier : params.serviceTier);
|
|
1777
1889
|
if (requestedServiceTier !== null && requestedServiceTier !== "default" && requestedServiceTier !== "fast")
|
|
1778
1890
|
throw invalidParams(`Unsupported Claude service tier '${requestedServiceTier}'.`);
|
|
1779
1891
|
const { cwd, runtimeWorkspaceRoots } = workspaceSelection(params, {
|
|
@@ -1783,8 +1895,7 @@ export class ClaudeService {
|
|
|
1783
1895
|
const workspaceChanged = cwd !== before.thread.cwd
|
|
1784
1896
|
|| runtimeWorkspaceRoots.length !== storedWorkspaceRoots(before).length
|
|
1785
1897
|
|| runtimeWorkspaceRoots.some((root, index) => root !== storedWorkspaceRoots(before)[index]);
|
|
1786
|
-
const reasoningEffort = params.effort === undefined ? before.reasoningEffort : params.effort;
|
|
1787
|
-
const serviceTier = await this.validatedServiceTier(modelPickerId, reasoningEffort, requestedServiceTier);
|
|
1898
|
+
const { modelPickerId, claudeModelValue, reasoningEffort, serviceTier } = await this.resolveModelSettings(requestedModel, params.effort === undefined ? before.reasoningEffort : params.effort, requestedServiceTier, params.effort !== undefined);
|
|
1788
1899
|
syncCanonicalSettings = requestedServiceTier === "fast" && serviceTier !== "fast";
|
|
1789
1900
|
const collaborationMode = params.collaborationMode === undefined
|
|
1790
1901
|
? before.collaborationMode
|
|
@@ -1839,24 +1950,30 @@ export class ClaudeService {
|
|
|
1839
1950
|
}
|
|
1840
1951
|
}
|
|
1841
1952
|
}
|
|
1842
|
-
|
|
1953
|
+
/**
|
|
1954
|
+
* Resolves requested model settings against the account catalog. A model id the catalog no longer
|
|
1955
|
+
* lists is migrated onto its closest current entry instead of failing the request, and an effort the
|
|
1956
|
+
* target model does not support is coerced to that model's default unless it was requested explicitly.
|
|
1957
|
+
*/
|
|
1958
|
+
async resolveModelSettings(modelPickerId, effort, serviceTier, explicitEffort = false) {
|
|
1959
|
+
const claudeModelValue = resolveClaudeModel(this.config, modelPickerId);
|
|
1843
1960
|
if (!this.modelCatalog)
|
|
1844
|
-
return serviceTier;
|
|
1845
|
-
const
|
|
1846
|
-
const model =
|
|
1847
|
-
if (!model)
|
|
1848
|
-
throw invalidParams(`Claude model '${
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
:
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
}
|
|
1961
|
+
return { modelPickerId, claudeModelValue, reasoningEffort: effort, serviceTier };
|
|
1962
|
+
const lookup = this.catalogLookup(await this.modelCatalog.list(), claudeModelValue);
|
|
1963
|
+
const model = lookup?.model;
|
|
1964
|
+
if (!lookup || !model)
|
|
1965
|
+
throw invalidParams(`Claude model '${modelPickerId}' is not present in the current account catalog.`);
|
|
1966
|
+
const selection = this.catalogSelection(modelPickerId, claudeModelValue, lookup);
|
|
1967
|
+
const effortSupported = !effort || model.supportedReasoningEfforts.some((level) => level.reasoningEffort === effort);
|
|
1968
|
+
if (!effortSupported && explicitEffort && selection.modelPickerId === modelPickerId)
|
|
1969
|
+
throw invalidParams(`Claude model '${modelPickerId}' does not support effort '${effort}'.`);
|
|
1970
|
+
if (!effortSupported)
|
|
1971
|
+
this.logger.warn("claude.effort.coerced", { model: model.id, from: effort, to: model.defaultReasoningEffort });
|
|
1972
|
+
return {
|
|
1973
|
+
...selection,
|
|
1974
|
+
reasoningEffort: effortSupported ? effort : model.supportedReasoningEfforts.length ? model.defaultReasoningEffort : null,
|
|
1975
|
+
serviceTier: serviceTier === "fast" && !model.serviceTiers.some((tier) => tier.id === "fast") ? null : serviceTier,
|
|
1976
|
+
};
|
|
1860
1977
|
}
|
|
1861
1978
|
async readStandaloneRateLimitStatus() {
|
|
1862
1979
|
const abort = new AbortController();
|