yepanywhere 0.6.1 → 0.7.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/bundled/@yep-anywhere/shared/dist/app-types.d.ts +71 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.js +13 -2
- package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/browser-settings-backup.d.ts +12 -0
- package/bundled/@yep-anywhere/shared/dist/browser-settings-backup.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/browser-settings-backup.js +2 -0
- package/bundled/@yep-anywhere/shared/dist/browser-settings-backup.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-additional-models.d.ts +15 -0
- package/bundled/@yep-anywhere/shared/dist/claude-additional-models.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-additional-models.js +49 -0
- package/bundled/@yep-anywhere/shared/dist/claude-additional-models.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts +8 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AttachmentEntrySchema.d.ts +30 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AttachmentEntrySchema.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AttachmentEntrySchema.js +12 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AttachmentEntrySchema.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/MetadataEntrySchema.d.ts +9 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/MetadataEntrySchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/MetadataEntrySchema.js +16 -3
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/MetadataEntrySchema.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts +57 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js +12 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/QueueOperationEntrySchema.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts +160 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js +52 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts +511 -2
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js +3 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts +16 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/message/AssistantMessageSchema.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts +9 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js +4 -0
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.d.ts +25 -0
- package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.js +52 -0
- package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-web-run.d.ts +46 -0
- package/bundled/@yep-anywhere/shared/dist/codex-web-run.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/codex-web-run.js +14 -0
- package/bundled/@yep-anywhere/shared/dist/codex-web-run.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/host-awake.d.ts +27 -0
- package/bundled/@yep-anywhere/shared/dist/host-awake.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/host-awake.js +19 -0
- package/bundled/@yep-anywhere/shared/dist/host-awake.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/host-identity.d.ts +12 -0
- package/bundled/@yep-anywhere/shared/dist/host-identity.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/host-identity.js +27 -0
- package/bundled/@yep-anywhere/shared/dist/host-identity.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +13 -3
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.js +9 -2
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/jsonlTable.d.ts +17 -0
- package/bundled/@yep-anywhere/shared/dist/jsonlTable.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/jsonlTable.js +87 -0
- package/bundled/@yep-anywhere/shared/dist/jsonlTable.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/project-queue.d.ts +2 -0
- package/bundled/@yep-anywhere/shared/dist/project-queue.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +106 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +135 -0
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/toon.d.ts +22 -0
- package/bundled/@yep-anywhere/shared/dist/toon.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/toon.js +128 -0
- package/bundled/@yep-anywhere/shared/dist/toon.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts +11 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/package.json +1 -1
- package/client-dist/assets/KaTeX_Size3-Regular-gV2CO0n9.woff2 +0 -0
- package/client-dist/assets/index-7OpGawa_.css +1 -0
- package/client-dist/assets/index-CSJgXvUR.js +593 -0
- package/client-dist/index.html +2 -2
- package/dist/app.d.ts +7 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +106 -20
- package/dist/app.js.map +1 -1
- package/dist/augments/augment-generator.d.ts.map +1 -1
- package/dist/augments/augment-generator.js +10 -1
- package/dist/augments/augment-generator.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/codex/codeModeExec.d.ts +5 -2
- package/dist/codex/codeModeExec.d.ts.map +1 -1
- package/dist/codex/codeModeExec.js +157 -2
- package/dist/codex/codeModeExec.js.map +1 -1
- package/dist/codex/normalization.d.ts.map +1 -1
- package/dist/codex/normalization.js +102 -3
- package/dist/codex/normalization.js.map +1 -1
- package/dist/codex/webRun.d.ts +42 -0
- package/dist/codex/webRun.d.ts.map +1 -0
- package/dist/codex/webRun.js +199 -0
- package/dist/codex/webRun.js.map +1 -0
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/indexes/SessionIndexService.d.ts.map +1 -1
- package/dist/indexes/SessionIndexService.js +32 -3
- package/dist/indexes/SessionIndexService.js.map +1 -1
- package/dist/metadata/SessionMetadataService.d.ts +9 -0
- package/dist/metadata/SessionMetadataService.d.ts.map +1 -1
- package/dist/metadata/SessionMetadataService.js +37 -6
- package/dist/metadata/SessionMetadataService.js.map +1 -1
- package/dist/projects/paths.js +4 -4
- package/dist/projects/paths.js.map +1 -1
- package/dist/routes/bang-commands.d.ts +32 -0
- package/dist/routes/bang-commands.d.ts.map +1 -0
- package/dist/routes/bang-commands.js +273 -0
- package/dist/routes/bang-commands.js.map +1 -0
- package/dist/routes/browser-settings-backup.d.ts +7 -0
- package/dist/routes/browser-settings-backup.d.ts.map +1 -0
- package/dist/routes/browser-settings-backup.js +35 -0
- package/dist/routes/browser-settings-backup.js.map +1 -0
- package/dist/routes/inbox.d.ts.map +1 -1
- package/dist/routes/inbox.js +2 -2
- package/dist/routes/inbox.js.map +1 -1
- package/dist/routes/processes.d.ts +9 -0
- package/dist/routes/processes.d.ts.map +1 -1
- package/dist/routes/processes.js +45 -4
- package/dist/routes/processes.js.map +1 -1
- package/dist/routes/project-queue-response.d.ts.map +1 -1
- package/dist/routes/project-queue-response.js +2 -2
- package/dist/routes/project-queue-response.js.map +1 -1
- package/dist/routes/project-queue.d.ts.map +1 -1
- package/dist/routes/project-queue.js +3 -0
- package/dist/routes/project-queue.js.map +1 -1
- package/dist/routes/providers.d.ts.map +1 -1
- package/dist/routes/providers.js +11 -2
- package/dist/routes/providers.js.map +1 -1
- package/dist/routes/public-shares.d.ts +1 -1
- package/dist/routes/public-shares.d.ts.map +1 -1
- package/dist/routes/public-shares.js +4 -6
- package/dist/routes/public-shares.js.map +1 -1
- package/dist/routes/recents.d.ts.map +1 -1
- package/dist/routes/recents.js +3 -3
- package/dist/routes/recents.js.map +1 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +55 -58
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/settings-parsers.d.ts +2 -1
- package/dist/routes/settings-parsers.d.ts.map +1 -1
- package/dist/routes/settings-parsers.js +39 -1
- package/dist/routes/settings-parsers.js.map +1 -1
- package/dist/routes/settings.d.ts +3 -0
- package/dist/routes/settings.d.ts.map +1 -1
- package/dist/routes/settings.js +70 -4
- package/dist/routes/settings.js.map +1 -1
- package/dist/routes/version.d.ts +2 -0
- package/dist/routes/version.d.ts.map +1 -1
- package/dist/routes/version.js +13 -7
- package/dist/routes/version.js.map +1 -1
- package/dist/routes/ws-relay-handlers.d.ts.map +1 -1
- package/dist/routes/ws-relay-handlers.js +2 -1
- package/dist/routes/ws-relay-handlers.js.map +1 -1
- package/dist/sdk/cli-detection.d.ts +15 -1
- package/dist/sdk/cli-detection.d.ts.map +1 -1
- package/dist/sdk/cli-detection.js +159 -28
- package/dist/sdk/cli-detection.js.map +1 -1
- package/dist/sdk/providers/acp/client.d.ts +14 -0
- package/dist/sdk/providers/acp/client.d.ts.map +1 -1
- package/dist/sdk/providers/acp/client.js +23 -2
- package/dist/sdk/providers/acp/client.js.map +1 -1
- package/dist/sdk/providers/claude-additional-models.d.ts +5 -0
- package/dist/sdk/providers/claude-additional-models.d.ts.map +1 -0
- package/dist/sdk/providers/claude-additional-models.js +55 -0
- package/dist/sdk/providers/claude-additional-models.js.map +1 -0
- package/dist/sdk/providers/claude.d.ts +6 -1
- package/dist/sdk/providers/claude.d.ts.map +1 -1
- package/dist/sdk/providers/claude.js +57 -17
- package/dist/sdk/providers/claude.js.map +1 -1
- package/dist/sdk/providers/codex-model-catalog.d.ts +4 -1
- package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -1
- package/dist/sdk/providers/codex-model-catalog.js +144 -98
- package/dist/sdk/providers/codex-model-catalog.js.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts +3 -0
- package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts +3 -0
- package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/LegacyAppPathString.d.ts +7 -6
- package/dist/sdk/providers/codex-protocol/generated/LegacyAppPathString.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ResponseItem.d.ts +15 -14
- package/dist/sdk/providers/codex-protocol/generated/ResponseItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ResponseItemId.d.ts +6 -0
- package/dist/sdk/providers/codex-protocol/generated/ResponseItemId.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ResponseItemId.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/ResponseItemId.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/SleepItem.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/SleepItem.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/SleepItem.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/SleepItem.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/WebSearchItem.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/WebSearchItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolCallOutputContentItem.d.ts +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolCallOutputContentItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/FileSystemSpecialPath.d.ts +3 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/FileSystemSpecialPath.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpToolCallAppContext.d.ts +0 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpToolCallAppContext.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts +11 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +2 -3
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts +14 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TokenUsageBreakdown.d.ts +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TokenUsageBreakdown.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnEnvironmentParams.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnEnvironmentParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts +6 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts.map +1 -1
- package/dist/sdk/providers/codex.d.ts +1 -1
- package/dist/sdk/providers/codex.d.ts.map +1 -1
- package/dist/sdk/providers/codex.js +164 -59
- package/dist/sdk/providers/codex.js.map +1 -1
- package/dist/sdk/providers/grok-acp.d.ts +33 -12
- package/dist/sdk/providers/grok-acp.d.ts.map +1 -1
- package/dist/sdk/providers/grok-acp.js +327 -20
- package/dist/sdk/providers/grok-acp.js.map +1 -1
- package/dist/sdk/providers/index.d.ts +3 -0
- package/dist/sdk/providers/index.d.ts.map +1 -1
- package/dist/sdk/providers/index.js +1 -0
- package/dist/sdk/providers/index.js.map +1 -1
- package/dist/sdk/providers/pi.d.ts +10 -4
- package/dist/sdk/providers/pi.d.ts.map +1 -1
- package/dist/sdk/providers/pi.js +57 -9
- package/dist/sdk/providers/pi.js.map +1 -1
- package/dist/sdk/providers/types.d.ts +16 -1
- package/dist/sdk/providers/types.d.ts.map +1 -1
- package/dist/sdk/types.d.ts +6 -1
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/services/BangCommandService.d.ts +86 -0
- package/dist/services/BangCommandService.d.ts.map +1 -0
- package/dist/services/BangCommandService.js +463 -0
- package/dist/services/BangCommandService.js.map +1 -0
- package/dist/services/BrowserSettingsBackupService.d.ts +30 -0
- package/dist/services/BrowserSettingsBackupService.d.ts.map +1 -0
- package/dist/services/BrowserSettingsBackupService.js +136 -0
- package/dist/services/BrowserSettingsBackupService.js.map +1 -0
- package/dist/services/ProjectQueueScheduler.d.ts +1 -0
- package/dist/services/ProjectQueueScheduler.d.ts.map +1 -1
- package/dist/services/ProjectQueueScheduler.js +16 -7
- package/dist/services/ProjectQueueScheduler.js.map +1 -1
- package/dist/services/PublicShareService.d.ts.map +1 -1
- package/dist/services/PublicShareService.js +1 -1
- package/dist/services/PublicShareService.js.map +1 -1
- package/dist/services/ServerSettingsService.d.ts +9 -1
- package/dist/services/ServerSettingsService.d.ts.map +1 -1
- package/dist/services/ServerSettingsService.js +13 -1
- package/dist/services/ServerSettingsService.js.map +1 -1
- package/dist/services/bangCompletions.d.ts +42 -0
- package/dist/services/bangCompletions.d.ts.map +1 -0
- package/dist/services/bangCompletions.js +186 -0
- package/dist/services/bangCompletions.js.map +1 -0
- package/dist/services/host-awake/HostAwakeBackend.d.ts +30 -0
- package/dist/services/host-awake/HostAwakeBackend.d.ts.map +1 -0
- package/dist/services/host-awake/HostAwakeBackend.js +12 -0
- package/dist/services/host-awake/HostAwakeBackend.js.map +1 -0
- package/dist/services/host-awake/HostAwakeService.d.ts +44 -0
- package/dist/services/host-awake/HostAwakeService.d.ts.map +1 -0
- package/dist/services/host-awake/HostAwakeService.js +282 -0
- package/dist/services/host-awake/HostAwakeService.js.map +1 -0
- package/dist/services/host-awake/MacHostAwakeBackend.d.ts +36 -0
- package/dist/services/host-awake/MacHostAwakeBackend.d.ts.map +1 -0
- package/dist/services/host-awake/MacHostAwakeBackend.js +279 -0
- package/dist/services/host-awake/MacHostAwakeBackend.js.map +1 -0
- package/dist/services/host-awake/WindowsHostAwakeBackend.d.ts +21 -0
- package/dist/services/host-awake/WindowsHostAwakeBackend.d.ts.map +1 -0
- package/dist/services/host-awake/WindowsHostAwakeBackend.js +487 -0
- package/dist/services/host-awake/WindowsHostAwakeBackend.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -1
- package/dist/sessions/claude-summary.d.ts.map +1 -1
- package/dist/sessions/claude-summary.js +14 -2
- package/dist/sessions/claude-summary.js.map +1 -1
- package/dist/sessions/codex-reader.d.ts +5 -5
- package/dist/sessions/codex-reader.d.ts.map +1 -1
- package/dist/sessions/codex-reader.js +113 -93
- package/dist/sessions/codex-reader.js.map +1 -1
- package/dist/sessions/codex-user-turn-provenance.d.ts +40 -0
- package/dist/sessions/codex-user-turn-provenance.d.ts.map +1 -0
- package/dist/sessions/codex-user-turn-provenance.js +165 -0
- package/dist/sessions/codex-user-turn-provenance.js.map +1 -0
- package/dist/sessions/normalization.d.ts +0 -1
- package/dist/sessions/normalization.d.ts.map +1 -1
- package/dist/sessions/normalization.js +50 -53
- package/dist/sessions/normalization.js.map +1 -1
- package/dist/sessions/pagination.d.ts.map +1 -1
- package/dist/sessions/pagination.js +3 -0
- package/dist/sessions/pagination.js.map +1 -1
- package/dist/sessions/provider-resolution.d.ts +7 -1
- package/dist/sessions/provider-resolution.d.ts.map +1 -1
- package/dist/sessions/provider-resolution.js +82 -0
- package/dist/sessions/provider-resolution.js.map +1 -1
- package/dist/sessions/reader.d.ts +23 -7
- package/dist/sessions/reader.d.ts.map +1 -1
- package/dist/sessions/reader.js +136 -73
- package/dist/sessions/reader.js.map +1 -1
- package/dist/sessions/resume-exemption.d.ts +28 -0
- package/dist/sessions/resume-exemption.d.ts.map +1 -0
- package/dist/sessions/resume-exemption.js +22 -0
- package/dist/sessions/resume-exemption.js.map +1 -0
- package/dist/sessions/types.d.ts +31 -3
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js +19 -1
- package/dist/sessions/types.js.map +1 -1
- package/dist/subscriptions.d.ts.map +1 -1
- package/dist/subscriptions.js +8 -0
- package/dist/subscriptions.js.map +1 -1
- package/dist/supervisor/ExternalSessionTracker.d.ts +7 -2
- package/dist/supervisor/ExternalSessionTracker.d.ts.map +1 -1
- package/dist/supervisor/ExternalSessionTracker.js +99 -91
- package/dist/supervisor/ExternalSessionTracker.js.map +1 -1
- package/dist/supervisor/Process.d.ts +48 -6
- package/dist/supervisor/Process.d.ts.map +1 -1
- package/dist/supervisor/Process.js +474 -58
- package/dist/supervisor/Process.js.map +1 -1
- package/dist/supervisor/Supervisor.d.ts +9 -7
- package/dist/supervisor/Supervisor.d.ts.map +1 -1
- package/dist/supervisor/Supervisor.js +127 -19
- package/dist/supervisor/Supervisor.js.map +1 -1
- package/dist/supervisor/types.d.ts +16 -1
- package/dist/supervisor/types.d.ts.map +1 -1
- package/dist/supervisor/types.js.map +1 -1
- package/dist/watcher/EventBus.d.ts +13 -2
- package/dist/watcher/EventBus.d.ts.map +1 -1
- package/dist/watcher/EventBus.js.map +1 -1
- package/dist/watcher/FileWatcher.d.ts.map +1 -1
- package/dist/watcher/FileWatcher.js +5 -3
- package/dist/watcher/FileWatcher.js.map +1 -1
- package/dist/watcher/index.d.ts +1 -1
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js.map +1 -1
- package/package.json +3 -3
- package/client-dist/assets/index-C41clQ66.js +0 -561
- package/client-dist/assets/index-LbeFv8ym.css +0 -1
|
@@ -11,18 +11,68 @@ import { getSystemMessageText, isAwaySummaryMessage, messageTimestampMs, toDurab
|
|
|
11
11
|
import { buildSessionLivenessSnapshot, } from "./liveness.js";
|
|
12
12
|
export const NATIVE_RECAP_FALLBACK_GRACE_MS = 2_000;
|
|
13
13
|
const CLAUDE_UNBOUNDED_MAX_RETRIES = 2_147_483_647;
|
|
14
|
+
const PROCESS_ABORT_TIMEOUT_MS = 5_000;
|
|
15
|
+
const PID_EXIT_POLL_INTERVAL_MS = 25;
|
|
16
|
+
const MODEL_SWITCH_RETRY_INTERRUPT_PREAMBLE = "The previous provider request was interrupted because the model changed while the provider was retrying. Continue under the newly selected model.";
|
|
17
|
+
function isLocalPidRunning(pid) {
|
|
18
|
+
try {
|
|
19
|
+
process.kill(pid, 0);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (error.code === "ESRCH") {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (error.code === "EPERM") {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function waitForLocalPidExit(pid, timeoutMs) {
|
|
33
|
+
const deadline = Date.now() + timeoutMs;
|
|
34
|
+
while (isLocalPidRunning(pid)) {
|
|
35
|
+
const remainingMs = deadline - Date.now();
|
|
36
|
+
if (remainingMs <= 0) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(PID_EXIT_POLL_INTERVAL_MS, remainingMs)));
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
async function waitUntilAbortDeadline(promise, deadline, timeoutMessage) {
|
|
44
|
+
const remainingMs = deadline - Date.now();
|
|
45
|
+
if (remainingMs <= 0) {
|
|
46
|
+
throw new Error(timeoutMessage);
|
|
47
|
+
}
|
|
48
|
+
let timeoutHandle;
|
|
49
|
+
try {
|
|
50
|
+
return await Promise.race([
|
|
51
|
+
promise,
|
|
52
|
+
new Promise((_resolve, reject) => {
|
|
53
|
+
timeoutHandle = setTimeout(() => reject(new Error(timeoutMessage)), remainingMs);
|
|
54
|
+
}),
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
if (timeoutHandle)
|
|
59
|
+
clearTimeout(timeoutHandle);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Whether the user chose durable patient queue intent for this entry. */
|
|
63
|
+
function hasPatientQueueIntent(entry) {
|
|
64
|
+
return entry.message.metadata?.deliveryIntent === "patient";
|
|
65
|
+
}
|
|
14
66
|
/**
|
|
15
|
-
* Whether a queued entry should ride the verified-idle
|
|
16
|
-
* of the plain turn-end deferred path. Patient
|
|
17
|
-
* deferred on Claude — the only provider that reports background-work
|
|
18
|
-
* (session crons, background/live tasks), which is what lets YA wait
|
|
19
|
-
* genuine completion.
|
|
20
|
-
*
|
|
21
|
-
* promotes at turn end and never engages the patient machinery.
|
|
67
|
+
* Whether a queued entry should ride the verified-idle patient delivery path
|
|
68
|
+
* instead of the plain turn-end deferred path. Patient timing only differs
|
|
69
|
+
* from deferred on Claude — the only provider that reports background-work
|
|
70
|
+
* retention (session crons, background/live tasks), which is what lets YA wait
|
|
71
|
+
* for genuine completion. Other providers still preserve patient intent across
|
|
72
|
+
* restart, but promote it at the ordinary turn-end boundary.
|
|
22
73
|
*/
|
|
23
|
-
function
|
|
24
|
-
return (entry
|
|
25
|
-
isClaudeSdkProvider(provider));
|
|
74
|
+
function usesPatientDeliveryPath(entry, provider) {
|
|
75
|
+
return hasPatientQueueIntent(entry) && isClaudeSdkProvider(provider);
|
|
26
76
|
}
|
|
27
77
|
/** Quiet milliseconds this patient entry waits for after verified idle. */
|
|
28
78
|
function patientPatienceMsForEntry(entry) {
|
|
@@ -132,6 +182,23 @@ function readPositiveInteger(value) {
|
|
|
132
182
|
}
|
|
133
183
|
return Math.trunc(number);
|
|
134
184
|
}
|
|
185
|
+
function readNonEmptyString(value) {
|
|
186
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
187
|
+
}
|
|
188
|
+
function readCodexHttpStatus(codexErrorInfo) {
|
|
189
|
+
if (!codexErrorInfo || typeof codexErrorInfo !== "object") {
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
for (const value of Object.values(codexErrorInfo)) {
|
|
193
|
+
if (value && typeof value === "object") {
|
|
194
|
+
const status = readPositiveInteger(value.httpStatusCode);
|
|
195
|
+
if (status !== undefined) {
|
|
196
|
+
return status;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
135
202
|
function normalizeProviderRuntimeReason(error) {
|
|
136
203
|
switch (error) {
|
|
137
204
|
case "rate_limit":
|
|
@@ -182,6 +249,83 @@ function buildClaudeApiRetryStatus(provider, previous, message, receivedAt) {
|
|
|
182
249
|
source: "claude.system.api_retry",
|
|
183
250
|
};
|
|
184
251
|
}
|
|
252
|
+
function normalizeCodexTerminalReason(codexErrorInfo) {
|
|
253
|
+
switch (codexErrorInfo) {
|
|
254
|
+
case "serverOverloaded":
|
|
255
|
+
return "overloaded";
|
|
256
|
+
case "usageLimitExceeded":
|
|
257
|
+
case "sessionBudgetExceeded":
|
|
258
|
+
return "rate_limit";
|
|
259
|
+
case "internalServerError":
|
|
260
|
+
return "server_error";
|
|
261
|
+
default:
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
if (codexErrorInfo && typeof codexErrorInfo === "object") {
|
|
265
|
+
const keys = Object.keys(codexErrorInfo);
|
|
266
|
+
if (keys.some((key) => [
|
|
267
|
+
"httpConnectionFailed",
|
|
268
|
+
"responseStreamConnectionFailed",
|
|
269
|
+
"responseStreamDisconnected",
|
|
270
|
+
].includes(key))) {
|
|
271
|
+
return "network";
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return "unknown";
|
|
275
|
+
}
|
|
276
|
+
function buildCodexRetryStatus(provider, previous, message, receivedAt) {
|
|
277
|
+
if (provider !== "codex" ||
|
|
278
|
+
message.type !== "error" ||
|
|
279
|
+
message.codexWillRetry !== true) {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
const lastSeenAt = receivedAt.toISOString();
|
|
283
|
+
const httpStatus = readCodexHttpStatus(message.codexErrorInfo);
|
|
284
|
+
const providerMessage = readNonEmptyString(message.error);
|
|
285
|
+
const details = readNonEmptyString(message.codexAdditionalDetails);
|
|
286
|
+
const turnId = readNonEmptyString(message.codexTurnId);
|
|
287
|
+
const requestId = readNonEmptyString(message.codexRequestId);
|
|
288
|
+
return {
|
|
289
|
+
kind: "retrying",
|
|
290
|
+
provider,
|
|
291
|
+
reason: normalizeCodexTerminalReason(message.codexErrorInfo),
|
|
292
|
+
...(httpStatus !== undefined ? { httpStatus } : {}),
|
|
293
|
+
startedAt: previous?.kind === "retrying" ? previous.startedAt : lastSeenAt,
|
|
294
|
+
lastSeenAt,
|
|
295
|
+
eventCount: previous?.kind === "retrying" ? previous.eventCount + 1 : 1,
|
|
296
|
+
source: "codex.error",
|
|
297
|
+
...(providerMessage ? { message: providerMessage } : {}),
|
|
298
|
+
...(details ? { details } : {}),
|
|
299
|
+
...(turnId ? { turnId } : {}),
|
|
300
|
+
...(requestId ? { requestId } : {}),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
function buildCodexTerminalStatus(provider, message, receivedAt) {
|
|
304
|
+
if (provider !== "codex" ||
|
|
305
|
+
message.type !== "error" ||
|
|
306
|
+
message.codexWillRetry !== false) {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
const errorMessage = readNonEmptyString(message.error) ?? "Codex turn failed";
|
|
310
|
+
const turnId = readNonEmptyString(message.codexTurnId);
|
|
311
|
+
const requestId = readNonEmptyString(message.codexRequestId);
|
|
312
|
+
const details = readNonEmptyString(message.codexAdditionalDetails);
|
|
313
|
+
const isProcessExit = message.codexErrorScope === "app_server_process";
|
|
314
|
+
return {
|
|
315
|
+
kind: "terminal",
|
|
316
|
+
provider,
|
|
317
|
+
reason: isProcessExit
|
|
318
|
+
? "server_error"
|
|
319
|
+
: normalizeCodexTerminalReason(message.codexErrorInfo),
|
|
320
|
+
message: errorMessage,
|
|
321
|
+
occurredAt: receivedAt.toISOString(),
|
|
322
|
+
source: isProcessExit ? "codex.app_server_process" : "codex.error",
|
|
323
|
+
...(turnId ? { turnId } : {}),
|
|
324
|
+
...(requestId ? { requestId } : {}),
|
|
325
|
+
...(details ? { details } : {}),
|
|
326
|
+
...(isProcessExit ? { scope: "provider_process" } : {}),
|
|
327
|
+
};
|
|
328
|
+
}
|
|
185
329
|
function providerRuntimeStatusesEqual(a, b) {
|
|
186
330
|
if (a === b)
|
|
187
331
|
return true;
|
|
@@ -311,6 +455,12 @@ export class Process {
|
|
|
311
455
|
previousBucket = [];
|
|
312
456
|
bucketSwapTimer = null;
|
|
313
457
|
static BUCKET_SWAP_INTERVAL_MS = 15_000;
|
|
458
|
+
/**
|
|
459
|
+
* User echoes accepted for in-turn steering remain replayable through the
|
|
460
|
+
* provider turn. A steer can wait behind a long-running tool for longer than
|
|
461
|
+
* the ordinary replay buckets, while its durable row does not exist yet.
|
|
462
|
+
*/
|
|
463
|
+
activeSteerEchoes = new Map();
|
|
314
464
|
/** Accumulated streaming text for catch-up when clients connect mid-stream */
|
|
315
465
|
_streamingText = "";
|
|
316
466
|
/** Message ID for current streaming response */
|
|
@@ -351,8 +501,17 @@ export class Process {
|
|
|
351
501
|
_thinking;
|
|
352
502
|
/** Effort level for response quality */
|
|
353
503
|
_effort;
|
|
504
|
+
/** Latest effort selected while the current provider turn is still active. */
|
|
505
|
+
pendingEffortUpdate = null;
|
|
506
|
+
/** Serializes provider effort controls so slower writes cannot win late. */
|
|
507
|
+
effortApplyTail = Promise.resolve();
|
|
508
|
+
/** A failed turn-boundary effort write keeps the process non-idle. */
|
|
509
|
+
effortBoundaryBlocked = false;
|
|
510
|
+
effortBoundaryTransition = null;
|
|
354
511
|
/** Function to change max thinking tokens at runtime (SDK 0.2.7+) */
|
|
355
512
|
setMaxThinkingTokensFn;
|
|
513
|
+
/** Function to change effort without restarting the provider process. */
|
|
514
|
+
setEffortFn;
|
|
356
515
|
/** Function to interrupt current turn gracefully (SDK 0.2.7+) */
|
|
357
516
|
interruptFn;
|
|
358
517
|
/** Function to steer an active turn (provider-specific, currently Codex app-server) */
|
|
@@ -394,6 +553,7 @@ export class Process {
|
|
|
394
553
|
_livenessProbeInFlight = null;
|
|
395
554
|
/** OS PID of the spawned agent child process (supports deferred resolution) */
|
|
396
555
|
_pidResolver;
|
|
556
|
+
_lastKnownPid;
|
|
397
557
|
/** Resolved model name from the first assistant message (e.g., "claude-sonnet-4-5-20250929") */
|
|
398
558
|
_resolvedModel;
|
|
399
559
|
/**
|
|
@@ -435,6 +595,7 @@ export class Process {
|
|
|
435
595
|
this._thinking = options.thinking;
|
|
436
596
|
this._effort = options.effort;
|
|
437
597
|
this.setMaxThinkingTokensFn = options.setMaxThinkingTokensFn ?? null;
|
|
598
|
+
this.setEffortFn = options.setEffortFn ?? null;
|
|
438
599
|
this.interruptFn = options.interruptFn ?? null;
|
|
439
600
|
this.steerFn = options.steerFn ?? null;
|
|
440
601
|
this.supportedModelsFn = options.supportedModelsFn ?? null;
|
|
@@ -450,6 +611,7 @@ export class Process {
|
|
|
450
611
|
this.getProviderActivityFn = options.getProviderActivityFn ?? null;
|
|
451
612
|
this.getProviderRetentionFn = options.getProviderRetentionFn ?? null;
|
|
452
613
|
this.refreshPromptCacheFn = options.refreshPromptCacheFn ?? null;
|
|
614
|
+
this.providerRuntimeStatus = options.initialProviderRuntimeStatus ?? null;
|
|
453
615
|
this._recapMode =
|
|
454
616
|
options.recapMode ?? (options.recapsEnabled ? "side-session" : "off");
|
|
455
617
|
this._recapAfterSeconds = normalizeRecapAfterSeconds(options.recapAfterSeconds ?? DEFAULT_RECAP_AFTER_SECONDS);
|
|
@@ -563,10 +725,13 @@ export class Process {
|
|
|
563
725
|
}
|
|
564
726
|
/** OS PID of the spawned agent child process */
|
|
565
727
|
get pid() {
|
|
566
|
-
|
|
567
|
-
|
|
728
|
+
const resolved = typeof this._pidResolver === "function"
|
|
729
|
+
? this._pidResolver()
|
|
730
|
+
: this._pidResolver;
|
|
731
|
+
if (resolved !== undefined) {
|
|
732
|
+
this._lastKnownPid = resolved;
|
|
568
733
|
}
|
|
569
|
-
return this.
|
|
734
|
+
return resolved ?? this._lastKnownPid;
|
|
570
735
|
}
|
|
571
736
|
get queueDepth() {
|
|
572
737
|
if (this.messageQueue) {
|
|
@@ -578,10 +743,10 @@ export class Process {
|
|
|
578
743
|
return this.deferredQueue.length;
|
|
579
744
|
}
|
|
580
745
|
hasPatientDeferredMessages() {
|
|
581
|
-
return this.deferredQueue.some((entry) =>
|
|
746
|
+
return this.deferredQueue.some((entry) => usesPatientDeliveryPath(entry, this.provider));
|
|
582
747
|
}
|
|
583
748
|
hasVolatileDeferredMessages() {
|
|
584
|
-
return this.deferredQueue.some((entry) => !
|
|
749
|
+
return this.deferredQueue.some((entry) => !hasPatientQueueIntent(entry));
|
|
585
750
|
}
|
|
586
751
|
async waitForPatientQueuePersistenceIdle() {
|
|
587
752
|
await this.patientQueuePersistenceTail;
|
|
@@ -797,7 +962,22 @@ export class Process {
|
|
|
797
962
|
this.setProviderRuntimeStatus(buildClaudeApiRetryStatus(this.provider, this.providerRuntimeStatus, message, receivedAt));
|
|
798
963
|
return;
|
|
799
964
|
}
|
|
800
|
-
|
|
965
|
+
const codexRetryStatus = buildCodexRetryStatus(this.provider, this.providerRuntimeStatus, message, receivedAt);
|
|
966
|
+
if (codexRetryStatus) {
|
|
967
|
+
this.setProviderRuntimeStatus(codexRetryStatus);
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
const terminalStatus = buildCodexTerminalStatus(this.provider, message, receivedAt);
|
|
971
|
+
if (terminalStatus) {
|
|
972
|
+
this.setProviderRuntimeStatus(terminalStatus);
|
|
973
|
+
return;
|
|
974
|
+
}
|
|
975
|
+
if (message.type === "user") {
|
|
976
|
+
this.clearProviderRuntimeStatus();
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
if (isProviderRuntimeProgressMessage(message) &&
|
|
980
|
+
this.providerRuntimeStatus?.kind === "retrying") {
|
|
801
981
|
this.clearProviderRuntimeStatus();
|
|
802
982
|
}
|
|
803
983
|
}
|
|
@@ -811,6 +991,11 @@ export class Process {
|
|
|
811
991
|
clearProviderRuntimeStatus() {
|
|
812
992
|
this.setProviderRuntimeStatus(null);
|
|
813
993
|
}
|
|
994
|
+
clearRetryingProviderRuntimeStatus() {
|
|
995
|
+
if (this.providerRuntimeStatus?.kind === "retrying") {
|
|
996
|
+
this.clearProviderRuntimeStatus();
|
|
997
|
+
}
|
|
998
|
+
}
|
|
814
999
|
toLivenessState() {
|
|
815
1000
|
switch (this._state.type) {
|
|
816
1001
|
case "waiting-input":
|
|
@@ -887,10 +1072,12 @@ export class Process {
|
|
|
887
1072
|
return this._thinking;
|
|
888
1073
|
}
|
|
889
1074
|
/**
|
|
890
|
-
*
|
|
1075
|
+
* Selected effort for subsequent responses. While a provider turn is active,
|
|
1076
|
+
* this reflects the queued next-turn selection before the provider control
|
|
1077
|
+
* request is applied at the turn boundary.
|
|
891
1078
|
*/
|
|
892
1079
|
get effort() {
|
|
893
|
-
return this._effort;
|
|
1080
|
+
return this.pendingEffortUpdate?.effort ?? this._effort;
|
|
894
1081
|
}
|
|
895
1082
|
/**
|
|
896
1083
|
* Update thinking config and effort after a dynamic change.
|
|
@@ -906,6 +1093,10 @@ export class Process {
|
|
|
906
1093
|
get supportsThinkingModeChange() {
|
|
907
1094
|
return this.setMaxThinkingTokensFn !== null;
|
|
908
1095
|
}
|
|
1096
|
+
/** Whether this process can change effort without being restarted. */
|
|
1097
|
+
get supportsEffortChange() {
|
|
1098
|
+
return this.setEffortFn !== null;
|
|
1099
|
+
}
|
|
909
1100
|
/**
|
|
910
1101
|
* Whether this process supports graceful interrupt.
|
|
911
1102
|
* Only Claude SDK 0.2.7+ supports this.
|
|
@@ -991,6 +1182,94 @@ export class Process {
|
|
|
991
1182
|
await this.setMaxThinkingTokensFn(tokens ?? null);
|
|
992
1183
|
return true;
|
|
993
1184
|
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Select a new effort without interrupting provider work. An idle process can
|
|
1187
|
+
* apply it immediately; an active or waiting process holds the latest choice
|
|
1188
|
+
* until the provider reports the turn boundary.
|
|
1189
|
+
*/
|
|
1190
|
+
async setEffort(effort) {
|
|
1191
|
+
if (!this.setEffortFn) {
|
|
1192
|
+
return false;
|
|
1193
|
+
}
|
|
1194
|
+
this.pendingEffortUpdate = { effort };
|
|
1195
|
+
if ((this._state.type === "in-turn" ||
|
|
1196
|
+
this._state.type === "waiting-input") &&
|
|
1197
|
+
!this.effortBoundaryBlocked) {
|
|
1198
|
+
getLogger().info({
|
|
1199
|
+
event: "effort_change_queued",
|
|
1200
|
+
sessionId: this._sessionId,
|
|
1201
|
+
processId: this.id,
|
|
1202
|
+
oldEffort: this._effort,
|
|
1203
|
+
newEffort: effort,
|
|
1204
|
+
}, `Queued effort change: ${this._effort ?? "default"} → ${effort ?? "default"}`);
|
|
1205
|
+
return true;
|
|
1206
|
+
}
|
|
1207
|
+
if (this.effortBoundaryBlocked) {
|
|
1208
|
+
await this.completeEffortBoundaryTransition();
|
|
1209
|
+
}
|
|
1210
|
+
else {
|
|
1211
|
+
await this.enqueuePendingEffortApplication();
|
|
1212
|
+
}
|
|
1213
|
+
return true;
|
|
1214
|
+
}
|
|
1215
|
+
async applyEffort(effort) {
|
|
1216
|
+
if (!this.setEffortFn) {
|
|
1217
|
+
throw new Error("Provider does not support dynamic effort changes");
|
|
1218
|
+
}
|
|
1219
|
+
getLogger().info({
|
|
1220
|
+
event: "effort_change",
|
|
1221
|
+
sessionId: this._sessionId,
|
|
1222
|
+
processId: this.id,
|
|
1223
|
+
oldEffort: this._effort,
|
|
1224
|
+
newEffort: effort,
|
|
1225
|
+
}, `Changing effort: ${this._effort ?? "default"} → ${effort ?? "default"}`);
|
|
1226
|
+
await this.setEffortFn(effort);
|
|
1227
|
+
this._effort = effort;
|
|
1228
|
+
}
|
|
1229
|
+
async applyPendingEffort() {
|
|
1230
|
+
while (this.pendingEffortUpdate) {
|
|
1231
|
+
const pending = this.pendingEffortUpdate;
|
|
1232
|
+
try {
|
|
1233
|
+
await this.applyEffort(pending.effort);
|
|
1234
|
+
}
|
|
1235
|
+
catch (error) {
|
|
1236
|
+
if (this.pendingEffortUpdate !== pending) {
|
|
1237
|
+
continue;
|
|
1238
|
+
}
|
|
1239
|
+
throw new Error("Failed to apply queued effort change", {
|
|
1240
|
+
cause: error,
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
if (this.pendingEffortUpdate === pending) {
|
|
1244
|
+
this.pendingEffortUpdate = null;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
enqueuePendingEffortApplication() {
|
|
1249
|
+
const application = this.effortApplyTail.then(() => this.applyPendingEffort());
|
|
1250
|
+
this.effortApplyTail = application.catch(() => { });
|
|
1251
|
+
return application;
|
|
1252
|
+
}
|
|
1253
|
+
completeEffortBoundaryTransition() {
|
|
1254
|
+
if (this.effortBoundaryTransition) {
|
|
1255
|
+
return this.effortBoundaryTransition;
|
|
1256
|
+
}
|
|
1257
|
+
const transition = this.enqueuePendingEffortApplication().then(() => {
|
|
1258
|
+
this.effortBoundaryBlocked = false;
|
|
1259
|
+
this.finishTransitionToIdle();
|
|
1260
|
+
});
|
|
1261
|
+
this.effortBoundaryTransition = transition;
|
|
1262
|
+
void transition.then(() => {
|
|
1263
|
+
if (this.effortBoundaryTransition === transition) {
|
|
1264
|
+
this.effortBoundaryTransition = null;
|
|
1265
|
+
}
|
|
1266
|
+
}, () => {
|
|
1267
|
+
if (this.effortBoundaryTransition === transition) {
|
|
1268
|
+
this.effortBoundaryTransition = null;
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
return transition;
|
|
1272
|
+
}
|
|
994
1273
|
/**
|
|
995
1274
|
* Whether this process supports dynamic model listing.
|
|
996
1275
|
* Only Claude SDK 0.2.7+ supports this.
|
|
@@ -1086,6 +1365,11 @@ export class Process {
|
|
|
1086
1365
|
if (!this.setModelFn) {
|
|
1087
1366
|
return false;
|
|
1088
1367
|
}
|
|
1368
|
+
const interruptsRetryingTurn = this._state.type === "in-turn" &&
|
|
1369
|
+
this.providerRuntimeStatus?.kind === "retrying";
|
|
1370
|
+
if (interruptsRetryingTurn && !this.interruptFn) {
|
|
1371
|
+
return false;
|
|
1372
|
+
}
|
|
1089
1373
|
const log = getLogger();
|
|
1090
1374
|
log.info({
|
|
1091
1375
|
event: "model_change",
|
|
@@ -1095,6 +1379,19 @@ export class Process {
|
|
|
1095
1379
|
newModel: model,
|
|
1096
1380
|
}, `Changing model: ${this.model} → ${model}`);
|
|
1097
1381
|
await this.setModelFn(model);
|
|
1382
|
+
if (interruptsRetryingTurn &&
|
|
1383
|
+
this._state.type === "in-turn" &&
|
|
1384
|
+
this.providerRuntimeStatus?.kind === "retrying") {
|
|
1385
|
+
const interrupted = await this.interrupt({
|
|
1386
|
+
preamble: MODEL_SWITCH_RETRY_INTERRUPT_PREAMBLE,
|
|
1387
|
+
});
|
|
1388
|
+
if (!interrupted &&
|
|
1389
|
+
this._state.type === "in-turn" &&
|
|
1390
|
+
this.providerRuntimeStatus?.kind === "retrying") {
|
|
1391
|
+
throw new Error("Provider retry could not be interrupted after changing models");
|
|
1392
|
+
}
|
|
1393
|
+
this.clearRetryingProviderRuntimeStatus();
|
|
1394
|
+
}
|
|
1098
1395
|
// Update resolved model so subsequent API responses reflect the switch
|
|
1099
1396
|
if (model) {
|
|
1100
1397
|
this._resolvedModel = model;
|
|
@@ -1156,7 +1453,7 @@ export class Process {
|
|
|
1156
1453
|
this.clearPromptCacheKeepaliveTimer();
|
|
1157
1454
|
this.stopBucketSwapTimer();
|
|
1158
1455
|
this.iteratorDone = true;
|
|
1159
|
-
this.
|
|
1456
|
+
this.clearRetryingProviderRuntimeStatus();
|
|
1160
1457
|
this.resolvePendingToolApprovals({
|
|
1161
1458
|
message: `Process terminated: ${reason}`,
|
|
1162
1459
|
interrupt: true,
|
|
@@ -1243,11 +1540,24 @@ export class Process {
|
|
|
1243
1540
|
return info;
|
|
1244
1541
|
}
|
|
1245
1542
|
/**
|
|
1246
|
-
* Get recent message history
|
|
1247
|
-
*
|
|
1543
|
+
* Get recent message history for SSE replay.
|
|
1544
|
+
*
|
|
1545
|
+
* Ordinary messages remain available for 15-30 seconds. In-turn steer
|
|
1546
|
+
* echoes remain available through the provider turn so a reconnect cannot
|
|
1547
|
+
* lose an accepted user message before its durable row exists.
|
|
1248
1548
|
*/
|
|
1249
1549
|
getMessageHistory() {
|
|
1250
|
-
|
|
1550
|
+
const buffered = [...this.previousBucket, ...this.currentBucket];
|
|
1551
|
+
if (this.activeSteerEchoes.size === 0) {
|
|
1552
|
+
return buffered;
|
|
1553
|
+
}
|
|
1554
|
+
const bufferedUuids = new Set(buffered
|
|
1555
|
+
.map((message) => message.uuid)
|
|
1556
|
+
.filter((uuid) => typeof uuid === "string"));
|
|
1557
|
+
const expiredSteerEchoes = [...this.activeSteerEchoes.entries()]
|
|
1558
|
+
.filter(([uuid]) => !bufferedUuids.has(uuid))
|
|
1559
|
+
.map(([, message]) => message);
|
|
1560
|
+
return [...expiredSteerEchoes, ...buffered];
|
|
1251
1561
|
}
|
|
1252
1562
|
/**
|
|
1253
1563
|
* Get accumulated streaming text for catch-up when clients connect mid-stream.
|
|
@@ -1743,6 +2053,9 @@ export class Process {
|
|
|
1743
2053
|
if (this._state.type === "in-turn" &&
|
|
1744
2054
|
this.steerFn &&
|
|
1745
2055
|
options?.allowSteer !== false) {
|
|
2056
|
+
if (!hidden && shouldEmitMessage(sdkMessage)) {
|
|
2057
|
+
this.activeSteerEchoes.set(uuid, sdkMessage);
|
|
2058
|
+
}
|
|
1746
2059
|
const steerMessage = {
|
|
1747
2060
|
...messageWithUuid,
|
|
1748
2061
|
// Mirror MessageQueue's attachment expansion for steer payloads.
|
|
@@ -1808,8 +2121,7 @@ export class Process {
|
|
|
1808
2121
|
});
|
|
1809
2122
|
}
|
|
1810
2123
|
persistPatientDeferredEntry(entry) {
|
|
1811
|
-
if (!this.sessionQueuePersistenceService ||
|
|
1812
|
-
!isPatientDeferredEntry(entry, this.provider)) {
|
|
2124
|
+
if (!this.sessionQueuePersistenceService || !hasPatientQueueIntent(entry)) {
|
|
1813
2125
|
return;
|
|
1814
2126
|
}
|
|
1815
2127
|
const item = this.toPersistedPatientDeferredItem(entry, "queued");
|
|
@@ -1820,8 +2132,7 @@ export class Process {
|
|
|
1820
2132
|
}, { action: "upsert", persistedQueueId: item.id });
|
|
1821
2133
|
}
|
|
1822
2134
|
toPersistedPatientDeferredItem(entry, status, updatedAt = entry.timestamp) {
|
|
1823
|
-
if (!this.sessionQueuePersistenceService ||
|
|
1824
|
-
!isPatientDeferredEntry(entry, this.provider)) {
|
|
2135
|
+
if (!this.sessionQueuePersistenceService || !hasPatientQueueIntent(entry)) {
|
|
1825
2136
|
return null;
|
|
1826
2137
|
}
|
|
1827
2138
|
const id = entry.persistedQueueId ?? randomUUID();
|
|
@@ -1855,7 +2166,7 @@ export class Process {
|
|
|
1855
2166
|
return;
|
|
1856
2167
|
}
|
|
1857
2168
|
const ids = entries
|
|
1858
|
-
.filter(
|
|
2169
|
+
.filter(hasPatientQueueIntent)
|
|
1859
2170
|
.map((entry) => entry.persistedQueueId)
|
|
1860
2171
|
.filter((id) => Boolean(id));
|
|
1861
2172
|
if (ids.length === 0) {
|
|
@@ -1871,7 +2182,7 @@ export class Process {
|
|
|
1871
2182
|
if (!this.sessionQueuePersistenceService) {
|
|
1872
2183
|
return 0;
|
|
1873
2184
|
}
|
|
1874
|
-
const entries = this.deferredQueue.filter(
|
|
2185
|
+
const entries = this.deferredQueue.filter(hasPatientQueueIntent);
|
|
1875
2186
|
if (entries.length === 0) {
|
|
1876
2187
|
return 0;
|
|
1877
2188
|
}
|
|
@@ -1920,10 +2231,10 @@ export class Process {
|
|
|
1920
2231
|
deferMessage(message, options) {
|
|
1921
2232
|
const canPromoteIfReady = !!(options?.promoteIfReady &&
|
|
1922
2233
|
this.messageQueue &&
|
|
1923
|
-
// Only
|
|
1924
|
-
// elsewhere
|
|
2234
|
+
// Only Claude waits for the verified-idle patient delivery path;
|
|
2235
|
+
// elsewhere durable patient intent uses ordinary deferred timing and
|
|
1925
2236
|
// promotes immediately like any other deferred turn.
|
|
1926
|
-
!
|
|
2237
|
+
!usesPatientDeliveryPath({ message, timestamp: new Date().toISOString() }, this.provider) &&
|
|
1927
2238
|
this._state.type === "idle");
|
|
1928
2239
|
if (canPromoteIfReady) {
|
|
1929
2240
|
const result = this.queueMessage(message);
|
|
@@ -2010,6 +2321,22 @@ export class Process {
|
|
|
2010
2321
|
removeBufferedEchoByTempId(tempId) {
|
|
2011
2322
|
this.currentBucket = this.currentBucket.filter((message) => !this.sdkMessageMatchesTempId(message, tempId));
|
|
2012
2323
|
this.previousBucket = this.previousBucket.filter((message) => !this.sdkMessageMatchesTempId(message, tempId));
|
|
2324
|
+
for (const [uuid, message] of this.activeSteerEchoes) {
|
|
2325
|
+
if (this.sdkMessageMatchesTempId(message, tempId)) {
|
|
2326
|
+
this.activeSteerEchoes.delete(uuid);
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
releaseActiveSteerEchoes() {
|
|
2331
|
+
const bufferedUuids = new Set([...this.previousBucket, ...this.currentBucket]
|
|
2332
|
+
.map((message) => message.uuid)
|
|
2333
|
+
.filter((uuid) => typeof uuid === "string"));
|
|
2334
|
+
for (const [uuid, message] of this.activeSteerEchoes) {
|
|
2335
|
+
if (!bufferedUuids.has(uuid)) {
|
|
2336
|
+
this.currentBucket.push(message);
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
this.activeSteerEchoes.clear();
|
|
2013
2340
|
}
|
|
2014
2341
|
/**
|
|
2015
2342
|
* Get a summary of the deferred queue for SSE events and client sync.
|
|
@@ -2430,29 +2757,81 @@ export class Process {
|
|
|
2430
2757
|
terminate(reason) {
|
|
2431
2758
|
// Kill the underlying CLI process first (if available), so it doesn't
|
|
2432
2759
|
// continue running as an orphan after we unregister from the Supervisor.
|
|
2433
|
-
|
|
2434
|
-
this.abortFn();
|
|
2435
|
-
}
|
|
2760
|
+
this.requestProviderAbortWithoutWaiting(reason);
|
|
2436
2761
|
this.markTerminated(reason);
|
|
2437
2762
|
}
|
|
2763
|
+
async requestProviderAbort() {
|
|
2764
|
+
await this.abortFn?.();
|
|
2765
|
+
}
|
|
2766
|
+
requestProviderAbortWithoutWaiting(reason) {
|
|
2767
|
+
void this.requestProviderAbort().catch((error) => {
|
|
2768
|
+
getLogger().error({
|
|
2769
|
+
event: "provider_abort_failed",
|
|
2770
|
+
sessionId: this._sessionId,
|
|
2771
|
+
processId: this.id,
|
|
2772
|
+
projectId: this.projectId,
|
|
2773
|
+
reason,
|
|
2774
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
2775
|
+
}, `Provider abort failed: ${this._sessionId}`);
|
|
2776
|
+
});
|
|
2777
|
+
}
|
|
2438
2778
|
async abort() {
|
|
2439
2779
|
this.clearIdleTimer();
|
|
2440
2780
|
this.clearPromptCacheKeepaliveTimer();
|
|
2441
2781
|
this.stopBucketSwapTimer();
|
|
2442
|
-
this.
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2782
|
+
this.clearRetryingProviderRuntimeStatus();
|
|
2783
|
+
const pid = this.pid;
|
|
2784
|
+
const deadline = Date.now() + PROCESS_ABORT_TIMEOUT_MS;
|
|
2785
|
+
const providerAbortOutcome = this.requestProviderAbort().then(() => ({ ok: true }), (error) => ({ ok: false, error }));
|
|
2786
|
+
let verification;
|
|
2787
|
+
if (pid !== undefined && this.executor === undefined) {
|
|
2788
|
+
const remainingMs = Math.max(0, deadline - Date.now());
|
|
2789
|
+
if (!(await waitForLocalPidExit(pid, remainingMs))) {
|
|
2790
|
+
throw new Error(`Provider PID ${pid} is still running after abort`);
|
|
2791
|
+
}
|
|
2792
|
+
// A provider may own descendants in the same process group after its
|
|
2793
|
+
// leader exits. When it exposes stronger liveness, let its shutdown
|
|
2794
|
+
// promise finish and require that group-level check to agree.
|
|
2795
|
+
const providerAliveAfterPidExit = this._isProcessAlive?.();
|
|
2796
|
+
if (providerAliveAfterPidExit !== undefined &&
|
|
2797
|
+
providerAliveAfterPidExit) {
|
|
2798
|
+
const abortOutcome = await waitUntilAbortDeadline(providerAbortOutcome, deadline, `Timed out waiting for provider process group ${pid} to stop`);
|
|
2799
|
+
if (!abortOutcome.ok)
|
|
2800
|
+
throw abortOutcome.error;
|
|
2801
|
+
if (this._isProcessAlive?.() !== false) {
|
|
2802
|
+
throw new Error(`Provider process group for PID ${pid} is still running after abort`);
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
verification = "pid";
|
|
2806
|
+
}
|
|
2807
|
+
else {
|
|
2808
|
+
const abortOutcome = await waitUntilAbortDeadline(providerAbortOutcome, deadline, "Timed out waiting for provider shutdown");
|
|
2809
|
+
if (!abortOutcome.ok)
|
|
2810
|
+
throw abortOutcome.error;
|
|
2811
|
+
}
|
|
2812
|
+
if (verification === undefined && this._isProcessAlive) {
|
|
2813
|
+
if (this.isProcessAlive !== false) {
|
|
2814
|
+
throw new Error("Provider still reports its process as running after abort");
|
|
2815
|
+
}
|
|
2816
|
+
verification = "provider";
|
|
2817
|
+
}
|
|
2818
|
+
else if (verification === undefined) {
|
|
2819
|
+
await waitUntilAbortDeadline(this._exitPromise, deadline, "Timed out waiting for provider iterator to stop");
|
|
2820
|
+
verification = "iterator";
|
|
2821
|
+
}
|
|
2450
2822
|
// Signal completion to subscribers (skip if already terminated —
|
|
2451
2823
|
// markTerminated() already emitted "complete")
|
|
2452
2824
|
if (this._state.type !== "terminated") {
|
|
2453
2825
|
this.emit({ type: "complete" });
|
|
2454
2826
|
}
|
|
2455
2827
|
this.listeners.clear();
|
|
2828
|
+
return {
|
|
2829
|
+
processId: this.id,
|
|
2830
|
+
sessionId: this._sessionId,
|
|
2831
|
+
...(pid !== undefined ? { pid } : {}),
|
|
2832
|
+
verifiedStopped: true,
|
|
2833
|
+
verification,
|
|
2834
|
+
};
|
|
2456
2835
|
}
|
|
2457
2836
|
async processMessages() {
|
|
2458
2837
|
try {
|
|
@@ -2462,7 +2841,7 @@ export class Process {
|
|
|
2462
2841
|
this.iteratorDone = true;
|
|
2463
2842
|
// Don't transition to idle if we're waiting for input
|
|
2464
2843
|
if (this._state.type !== "waiting-input") {
|
|
2465
|
-
this.transitionToIdle();
|
|
2844
|
+
this.transitionToIdle({ applyPendingEffort: false });
|
|
2466
2845
|
}
|
|
2467
2846
|
break;
|
|
2468
2847
|
}
|
|
@@ -2542,14 +2921,17 @@ export class Process {
|
|
|
2542
2921
|
this.emit({ type: "message", message });
|
|
2543
2922
|
}
|
|
2544
2923
|
if (isClaudeSdkApiErrorMessage(this.provider, message)) {
|
|
2545
|
-
this.
|
|
2924
|
+
this.requestProviderAbortWithoutWaiting("Claude SDK API error; restart required");
|
|
2546
2925
|
this.markTerminated("Claude SDK API error; restart required", new Error(describeClaudeSdkApiError(message)));
|
|
2547
2926
|
return;
|
|
2548
2927
|
}
|
|
2549
2928
|
// Handle special message types
|
|
2550
2929
|
const claudeSessionState = getClaudeSessionStateChange(message);
|
|
2551
2930
|
if (claudeSessionState) {
|
|
2552
|
-
this.handleClaudeSessionStateChanged(claudeSessionState);
|
|
2931
|
+
const effortUpdate = this.handleClaudeSessionStateChanged(claudeSessionState);
|
|
2932
|
+
if (effortUpdate) {
|
|
2933
|
+
await effortUpdate;
|
|
2934
|
+
}
|
|
2553
2935
|
}
|
|
2554
2936
|
else if (message.type === "system" &&
|
|
2555
2937
|
message.subtype === "input_request") {
|
|
@@ -2579,7 +2961,10 @@ export class Process {
|
|
|
2579
2961
|
}
|
|
2580
2962
|
}
|
|
2581
2963
|
}
|
|
2582
|
-
this.transitionToIdle();
|
|
2964
|
+
const effortUpdate = this.transitionToIdle();
|
|
2965
|
+
if (effortUpdate) {
|
|
2966
|
+
await effortUpdate;
|
|
2967
|
+
}
|
|
2583
2968
|
}
|
|
2584
2969
|
// Note: deferred messages are intentionally NOT promoted at completed
|
|
2585
2970
|
// tool-result boundaries. A queued (`deferred`) item delivers at the
|
|
@@ -2604,7 +2989,7 @@ export class Process {
|
|
|
2604
2989
|
errorStack: err.stack,
|
|
2605
2990
|
currentState: this._state.type,
|
|
2606
2991
|
}, `Process error: ${this._sessionId} - ${err.message}`);
|
|
2607
|
-
this.
|
|
2992
|
+
this.clearRetryingProviderRuntimeStatus();
|
|
2608
2993
|
this.emit({ type: "error", error: err });
|
|
2609
2994
|
// Detect process termination errors - set flag synchronously BEFORE markTerminated
|
|
2610
2995
|
// to prevent race where queueMessage is called before state changes to terminated
|
|
@@ -2614,8 +2999,11 @@ export class Process {
|
|
|
2614
2999
|
return;
|
|
2615
3000
|
}
|
|
2616
3001
|
// Don't transition to idle if we're waiting for input
|
|
2617
|
-
if (this._state.type !== "waiting-input") {
|
|
2618
|
-
this.transitionToIdle();
|
|
3002
|
+
if (this._state.type !== "waiting-input" && !this.effortBoundaryBlocked) {
|
|
3003
|
+
const effortUpdate = this.transitionToIdle();
|
|
3004
|
+
if (effortUpdate) {
|
|
3005
|
+
await effortUpdate;
|
|
3006
|
+
}
|
|
2619
3007
|
}
|
|
2620
3008
|
}
|
|
2621
3009
|
finally {
|
|
@@ -2663,7 +3051,7 @@ export class Process {
|
|
|
2663
3051
|
switch (state) {
|
|
2664
3052
|
case "idle":
|
|
2665
3053
|
if (this._state.type !== "waiting-input") {
|
|
2666
|
-
this.transitionToIdle();
|
|
3054
|
+
return this.transitionToIdle();
|
|
2667
3055
|
}
|
|
2668
3056
|
break;
|
|
2669
3057
|
case "running":
|
|
@@ -2689,9 +3077,38 @@ export class Process {
|
|
|
2689
3077
|
break;
|
|
2690
3078
|
}
|
|
2691
3079
|
}
|
|
2692
|
-
transitionToIdle() {
|
|
3080
|
+
transitionToIdle(options) {
|
|
2693
3081
|
this.clearIdleTimer();
|
|
2694
|
-
this.
|
|
3082
|
+
this.clearRetryingProviderRuntimeStatus();
|
|
3083
|
+
// A provider turn boundary ends the special steering-retention window.
|
|
3084
|
+
// Move any aged-out echoes back into the ordinary replay window to cover
|
|
3085
|
+
// the short gap before the provider's durable transcript becomes visible.
|
|
3086
|
+
this.releaseActiveSteerEchoes();
|
|
3087
|
+
if (options?.applyPendingEffort !== false && this.pendingEffortUpdate) {
|
|
3088
|
+
this.effortBoundaryBlocked = true;
|
|
3089
|
+
return this.completeEffortBoundaryTransition().catch((error) => {
|
|
3090
|
+
const requestedEffort = this.pendingEffortUpdate?.effort;
|
|
3091
|
+
const configurationError = new Error("Failed to apply effort; queued work remains blocked until retry", { cause: error });
|
|
3092
|
+
getLogger().error({
|
|
3093
|
+
event: "effort_change_boundary_failed",
|
|
3094
|
+
sessionId: this._sessionId,
|
|
3095
|
+
processId: this.id,
|
|
3096
|
+
projectId: this.projectId,
|
|
3097
|
+
requestedEffort,
|
|
3098
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
3099
|
+
}, "Failed to apply effort before queued work");
|
|
3100
|
+
this.emit({
|
|
3101
|
+
type: "configuration-error",
|
|
3102
|
+
setting: "effort",
|
|
3103
|
+
requestedValue: requestedEffort,
|
|
3104
|
+
error: configurationError,
|
|
3105
|
+
});
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
this.effortBoundaryBlocked = false;
|
|
3109
|
+
this.finishTransitionToIdle();
|
|
3110
|
+
}
|
|
3111
|
+
finishTransitionToIdle() {
|
|
2695
3112
|
// Promote deferred messages as the same stitched user turn the provider
|
|
2696
3113
|
// receives, so the live echo and later transcript catch-up agree.
|
|
2697
3114
|
if (this.promoteEligibleDeferredAfterTurn()) {
|
|
@@ -2797,7 +3214,7 @@ export class Process {
|
|
|
2797
3214
|
if (this.deferredQueue.length === 0 || !this.messageQueue) {
|
|
2798
3215
|
return false;
|
|
2799
3216
|
}
|
|
2800
|
-
const eligible = this.deferredQueue.filter((entry) => !
|
|
3217
|
+
const eligible = this.deferredQueue.filter((entry) => !usesPatientDeliveryPath(entry, this.provider));
|
|
2801
3218
|
if (eligible.length === 0) {
|
|
2802
3219
|
return false;
|
|
2803
3220
|
}
|
|
@@ -2817,6 +3234,7 @@ export class Process {
|
|
|
2817
3234
|
}
|
|
2818
3235
|
const promotedEntries = new Set(group);
|
|
2819
3236
|
this.deferredQueue = this.deferredQueue.filter((entry) => !promotedEntries.has(entry));
|
|
3237
|
+
this.deletePersistedPatientDeferredEntries(group, "promoted");
|
|
2820
3238
|
this.emitDeferredQueueChange("promoted", group.length === 1 ? group[0].message.tempId : undefined);
|
|
2821
3239
|
return true;
|
|
2822
3240
|
}
|
|
@@ -2838,7 +3256,7 @@ export class Process {
|
|
|
2838
3256
|
this._state.type !== "idle") {
|
|
2839
3257
|
return { promoted: false, nextPatienceMsRemaining: null };
|
|
2840
3258
|
}
|
|
2841
|
-
const patientEntries = this.deferredQueue.filter((entry) =>
|
|
3259
|
+
const patientEntries = this.deferredQueue.filter((entry) => usesPatientDeliveryPath(entry, this.provider));
|
|
2842
3260
|
if (patientEntries.length === 0) {
|
|
2843
3261
|
return { promoted: false, nextPatienceMsRemaining: null };
|
|
2844
3262
|
}
|
|
@@ -3031,11 +3449,9 @@ export class Process {
|
|
|
3031
3449
|
this.clearPromptCacheKeepaliveTimer();
|
|
3032
3450
|
this.stopBucketSwapTimer();
|
|
3033
3451
|
this.iteratorDone = true;
|
|
3034
|
-
this.
|
|
3452
|
+
this.clearRetryingProviderRuntimeStatus();
|
|
3035
3453
|
this.emit({ type: "idle-reap" });
|
|
3036
|
-
|
|
3037
|
-
this.abortFn();
|
|
3038
|
-
}
|
|
3454
|
+
this.requestProviderAbortWithoutWaiting("idle reap");
|
|
3039
3455
|
this.emit({ type: "complete" });
|
|
3040
3456
|
this.listeners.clear();
|
|
3041
3457
|
if (this._exitResolve) {
|