yepanywhere 0.5.2 → 0.6.1
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 +21 -5
- package/bundled/@yep-anywhere/shared/dist/agent-context.d.ts +9 -0
- package/bundled/@yep-anywhere/shared/dist/agent-context.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/agent-context.js +18 -0
- package/bundled/@yep-anywhere/shared/dist/agent-context.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +107 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.js +4 -0
- package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/binary-framing.d.ts +4 -1
- package/bundled/@yep-anywhere/shared/dist/binary-framing.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/binary-framing.js +8 -3
- package/bundled/@yep-anywhere/shared/dist/binary-framing.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/AssistantEntrySchema.d.ts +4 -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/BaseEntrySchema.d.ts +4 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js +7 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/BaseEntrySchema.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/ProgressEntrySchema.d.ts +4 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/ProgressEntrySchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts +64 -1
- 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 +9 -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/entry/UserEntrySchema.d.ts +4 -0
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/UserEntrySchema.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js +45 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts +144 -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/tool/ToolResultSchemas.d.ts +6 -4
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js +8 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts +3 -2
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js +3 -2
- package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts +266 -17
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js +128 -1
- package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/dag.d.ts +31 -11
- package/bundled/@yep-anywhere/shared/dist/dag.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/dag.js +77 -33
- package/bundled/@yep-anywhere/shared/dist/dag.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/git-status.d.ts +93 -1
- package/bundled/@yep-anywhere/shared/dist/git-status.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/git-status.js +1 -1
- package/bundled/@yep-anywhere/shared/dist/git-status.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/ideMetadata.js +1 -1
- package/bundled/@yep-anywhere/shared/dist/ideMetadata.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +22 -11
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.js +9 -3
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/local-resource.d.ts +1 -0
- package/bundled/@yep-anywhere/shared/dist/local-resource.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/local-resource.js +4 -0
- package/bundled/@yep-anywhere/shared/dist/local-resource.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts +136 -0
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js +65 -3
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts +1 -1
- package/bundled/@yep-anywhere/shared/dist/opencode-schema/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/project-queue.d.ts +153 -0
- package/bundled/@yep-anywhere/shared/dist/project-queue.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/project-queue.js +8 -0
- package/bundled/@yep-anywhere/shared/dist/project-queue.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/relay-protocol.d.ts +26 -2
- package/bundled/@yep-anywhere/shared/dist/relay-protocol.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/relay-protocol.js +33 -0
- package/bundled/@yep-anywhere/shared/dist/relay-protocol.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/relay.d.ts +45 -5
- package/bundled/@yep-anywhere/shared/dist/relay.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/relay.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/safe-restart.d.ts +25 -0
- package/bundled/@yep-anywhere/shared/dist/safe-restart.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/safe-restart.js +2 -0
- package/bundled/@yep-anywhere/shared/dist/safe-restart.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +248 -0
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +251 -0
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/session/SessionView.d.ts +2 -2
- package/bundled/@yep-anywhere/shared/dist/session/SessionView.js +3 -3
- package/bundled/@yep-anywhere/shared/dist/session/SessionView.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts +10 -0
- package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/session-liveness.d.ts +18 -0
- package/bundled/@yep-anywhere/shared/dist/session-liveness.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/tool-display-actions.d.ts +26 -0
- package/bundled/@yep-anywhere/shared/dist/tool-display-actions.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/tool-display-actions.js +9 -0
- package/bundled/@yep-anywhere/shared/dist/tool-display-actions.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts +253 -8
- package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.js +48 -5
- package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/upload.d.ts +34 -2
- package/bundled/@yep-anywhere/shared/dist/upload.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/user-message-metadata.d.ts +47 -0
- package/bundled/@yep-anywhere/shared/dist/user-message-metadata.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/user-message-metadata.js +59 -1
- package/bundled/@yep-anywhere/shared/dist/user-message-metadata.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/workstreams.d.ts +54 -0
- package/bundled/@yep-anywhere/shared/dist/workstreams.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/workstreams.js +8 -0
- package/bundled/@yep-anywhere/shared/dist/workstreams.js.map +1 -0
- package/bundled/@yep-anywhere/shared/package.json +1 -1
- package/client-dist/assets/alegreya-sans-latin-400-italic-BQIUBrX-.woff2 +0 -0
- package/client-dist/assets/alegreya-sans-latin-400-normal-BxeZdXas.woff2 +0 -0
- package/client-dist/assets/alegreya-sans-latin-500-normal-uodOEoAl.woff2 +0 -0
- package/client-dist/assets/alegreya-sans-latin-700-normal-DFYOGfC8.woff2 +0 -0
- package/client-dist/assets/de-BNhVdIq4.js +6 -0
- package/client-dist/assets/es-Csn9n24J.js +6 -0
- package/client-dist/assets/fira-mono-latin-400-normal-DVTTRLHv.woff2 +0 -0
- package/client-dist/assets/fira-mono-latin-ext-400-normal-B2gPvaNr.woff2 +0 -0
- package/client-dist/assets/fira-mono-symbols2-400-normal-C6JptOil.woff2 +0 -0
- package/client-dist/assets/fr-DKx4tSpo.js +6 -0
- package/client-dist/assets/index-C41clQ66.js +561 -0
- package/client-dist/assets/index-LbeFv8ym.css +1 -0
- package/client-dist/assets/inter-latin-400-italic-D1l0FflY.woff2 +0 -0
- package/client-dist/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/client-dist/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/client-dist/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
- package/client-dist/assets/ja-DAkhkwQZ.js +6 -0
- package/client-dist/assets/zh-CN-B7lY0cc6.js +6 -0
- package/client-dist/index.html +3 -3
- package/client-dist/sw.js +96 -9
- package/dist/app.d.ts +25 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +350 -35
- package/dist/app.js.map +1 -1
- package/dist/augments/augment-generator.d.ts +1 -1
- package/dist/augments/augment-generator.d.ts.map +1 -1
- package/dist/augments/augment-generator.js +2 -2
- package/dist/augments/augment-generator.js.map +1 -1
- package/dist/augments/markdown-augments.d.ts +1 -1
- package/dist/augments/markdown-augments.d.ts.map +1 -1
- package/dist/augments/markdown-augments.js +5 -5
- package/dist/augments/markdown-augments.js.map +1 -1
- package/dist/augments/safe-markdown.d.ts +10 -0
- package/dist/augments/safe-markdown.d.ts.map +1 -1
- package/dist/augments/safe-markdown.js +146 -3
- package/dist/augments/safe-markdown.js.map +1 -1
- package/dist/augments/stream-augmenter.d.ts +3 -0
- package/dist/augments/stream-augmenter.d.ts.map +1 -1
- package/dist/augments/stream-augmenter.js +6 -3
- package/dist/augments/stream-augmenter.js.map +1 -1
- package/dist/augments/stream-coordinator.d.ts +5 -1
- package/dist/augments/stream-coordinator.d.ts.map +1 -1
- package/dist/augments/stream-coordinator.js +6 -4
- package/dist/augments/stream-coordinator.js.map +1 -1
- package/dist/augments/task-list-augments.d.ts +27 -0
- package/dist/augments/task-list-augments.d.ts.map +1 -0
- package/dist/augments/task-list-augments.js +360 -0
- package/dist/augments/task-list-augments.js.map +1 -0
- package/dist/cli.d.ts +1 -17
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +22 -8
- package/dist/cli.js.map +1 -1
- package/dist/codex/codeModeExec.d.ts +27 -0
- package/dist/codex/codeModeExec.d.ts.map +1 -0
- package/dist/codex/codeModeExec.js +264 -0
- package/dist/codex/codeModeExec.js.map +1 -0
- package/dist/codex/correlationDebugLogger.d.ts.map +1 -1
- package/dist/codex/correlationDebugLogger.js +36 -8
- package/dist/codex/correlationDebugLogger.js.map +1 -1
- package/dist/codex/displayActions.d.ts +48 -0
- package/dist/codex/displayActions.d.ts.map +1 -0
- package/dist/codex/displayActions.js +674 -0
- package/dist/codex/displayActions.js.map +1 -0
- package/dist/codex/normalization.d.ts +10 -6
- package/dist/codex/normalization.d.ts.map +1 -1
- package/dist/codex/normalization.js +94 -261
- package/dist/codex/normalization.js.map +1 -1
- package/dist/config.d.ts +49 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +55 -14
- package/dist/config.js.map +1 -1
- package/dist/defaults.d.ts +3 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +3 -0
- package/dist/defaults.js.map +1 -0
- package/dist/device/DeviceBridgeService.js +1 -1
- package/dist/device/DeviceBridgeService.js.map +1 -1
- package/dist/envSettings.d.ts +64 -0
- package/dist/envSettings.d.ts.map +1 -0
- package/dist/envSettings.js +553 -0
- package/dist/envSettings.js.map +1 -0
- package/dist/frontend/static.d.ts.map +1 -1
- package/dist/frontend/static.js +3 -1
- package/dist/frontend/static.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +190 -14
- package/dist/index.js.map +1 -1
- package/dist/indexes/SessionDiscoveryIndex.d.ts +78 -0
- package/dist/indexes/SessionDiscoveryIndex.d.ts.map +1 -0
- package/dist/indexes/SessionDiscoveryIndex.js +223 -0
- package/dist/indexes/SessionDiscoveryIndex.js.map +1 -0
- package/dist/indexes/SessionIndexService.d.ts +114 -1
- package/dist/indexes/SessionIndexService.d.ts.map +1 -1
- package/dist/indexes/SessionIndexService.js +875 -105
- package/dist/indexes/SessionIndexService.js.map +1 -1
- package/dist/indexes/index.d.ts +2 -1
- package/dist/indexes/index.d.ts.map +1 -1
- package/dist/indexes/index.js +1 -0
- package/dist/indexes/index.js.map +1 -1
- package/dist/indexes/types.d.ts +26 -0
- package/dist/indexes/types.d.ts.map +1 -1
- package/dist/logging/logger.d.ts.map +1 -1
- package/dist/logging/logger.js +2 -3
- package/dist/logging/logger.js.map +1 -1
- package/dist/maintenance/server.d.ts.map +1 -1
- package/dist/maintenance/server.js +8 -11
- package/dist/maintenance/server.js.map +1 -1
- package/dist/metadata/ProjectMetadataService.d.ts +7 -0
- package/dist/metadata/ProjectMetadataService.d.ts.map +1 -1
- package/dist/metadata/ProjectMetadataService.js +63 -19
- package/dist/metadata/ProjectMetadataService.js.map +1 -1
- package/dist/metadata/SessionMetadataService.d.ts +82 -3
- package/dist/metadata/SessionMetadataService.d.ts.map +1 -1
- package/dist/metadata/SessionMetadataService.js +233 -17
- package/dist/metadata/SessionMetadataService.js.map +1 -1
- package/dist/middleware/file-access.d.ts +66 -0
- package/dist/middleware/file-access.d.ts.map +1 -0
- package/dist/middleware/file-access.js +112 -0
- package/dist/middleware/file-access.js.map +1 -0
- package/dist/projects/codex-scanner.d.ts +28 -1
- package/dist/projects/codex-scanner.d.ts.map +1 -1
- package/dist/projects/codex-scanner.js +149 -39
- package/dist/projects/codex-scanner.js.map +1 -1
- package/dist/projects/gemini-scanner.d.ts.map +1 -1
- package/dist/projects/gemini-scanner.js +59 -6
- package/dist/projects/gemini-scanner.js.map +1 -1
- package/dist/projects/paths.d.ts +15 -1
- package/dist/projects/paths.d.ts.map +1 -1
- package/dist/projects/paths.js +69 -23
- package/dist/projects/paths.js.map +1 -1
- package/dist/projects/scanner.d.ts +5 -0
- package/dist/projects/scanner.d.ts.map +1 -1
- package/dist/projects/scanner.js +136 -28
- package/dist/projects/scanner.js.map +1 -1
- package/dist/push/InactivityPushNotifier.d.ts +61 -0
- package/dist/push/InactivityPushNotifier.d.ts.map +1 -0
- package/dist/push/InactivityPushNotifier.js +305 -0
- package/dist/push/InactivityPushNotifier.js.map +1 -0
- package/dist/push/PushNotifier.d.ts.map +1 -1
- package/dist/push/PushNotifier.js.map +1 -1
- package/dist/push/PushService.d.ts +7 -4
- package/dist/push/PushService.d.ts.map +1 -1
- package/dist/push/PushService.js +27 -7
- package/dist/push/PushService.js.map +1 -1
- package/dist/push/index.d.ts +2 -1
- package/dist/push/index.d.ts.map +1 -1
- package/dist/push/index.js +1 -0
- package/dist/push/index.js.map +1 -1
- package/dist/push/routes.d.ts.map +1 -1
- package/dist/push/routes.js +28 -1
- package/dist/push/routes.js.map +1 -1
- package/dist/push/types.d.ts +21 -3
- package/dist/push/types.d.ts.map +1 -1
- package/dist/push/types.js +2 -0
- package/dist/push/types.js.map +1 -1
- package/dist/routes/dev.d.ts +2 -0
- package/dist/routes/dev.d.ts.map +1 -1
- package/dist/routes/dev.js +25 -0
- package/dist/routes/dev.js.map +1 -1
- package/dist/routes/env-settings.d.ts +20 -0
- package/dist/routes/env-settings.d.ts.map +1 -0
- package/dist/routes/env-settings.js +25 -0
- package/dist/routes/env-settings.js.map +1 -0
- package/dist/routes/files.d.ts +9 -0
- package/dist/routes/files.d.ts.map +1 -1
- package/dist/routes/files.js +98 -10
- package/dist/routes/files.js.map +1 -1
- package/dist/routes/git-status.d.ts.map +1 -1
- package/dist/routes/git-status.js +691 -23
- package/dist/routes/git-status.js.map +1 -1
- package/dist/routes/global-sessions.d.ts +11 -1
- package/dist/routes/global-sessions.d.ts.map +1 -1
- package/dist/routes/global-sessions.js +53 -33
- package/dist/routes/global-sessions.js.map +1 -1
- package/dist/routes/inbox.d.ts +10 -1
- package/dist/routes/inbox.d.ts.map +1 -1
- package/dist/routes/inbox.js +30 -3
- package/dist/routes/inbox.js.map +1 -1
- package/dist/routes/local-file.d.ts +6 -2
- package/dist/routes/local-file.d.ts.map +1 -1
- package/dist/routes/local-file.js +13 -4
- package/dist/routes/local-file.js.map +1 -1
- package/dist/routes/local-image.d.ts +2 -1
- package/dist/routes/local-image.d.ts.map +1 -1
- package/dist/routes/local-image.js.map +1 -1
- package/dist/routes/local-resource-policy.d.ts +7 -1
- package/dist/routes/local-resource-policy.d.ts.map +1 -1
- package/dist/routes/local-resource-policy.js +0 -0
- package/dist/routes/local-resource-policy.js.map +1 -1
- package/dist/routes/processes.d.ts.map +1 -1
- package/dist/routes/processes.js +49 -11
- package/dist/routes/processes.js.map +1 -1
- package/dist/routes/project-queue-response.d.ts +26 -0
- package/dist/routes/project-queue-response.d.ts.map +1 -0
- package/dist/routes/project-queue-response.js +188 -0
- package/dist/routes/project-queue-response.js.map +1 -0
- package/dist/routes/project-queue.d.ts +5 -0
- package/dist/routes/project-queue.d.ts.map +1 -0
- package/dist/routes/project-queue.js +219 -0
- package/dist/routes/project-queue.js.map +1 -0
- package/dist/routes/projects.d.ts +6 -0
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +116 -28
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/providers.d.ts +5 -0
- package/dist/routes/providers.d.ts.map +1 -1
- package/dist/routes/providers.js +52 -33
- package/dist/routes/providers.js.map +1 -1
- package/dist/routes/public-shares.d.ts.map +1 -1
- package/dist/routes/public-shares.js +46 -17
- package/dist/routes/public-shares.js.map +1 -1
- package/dist/routes/recents.d.ts +3 -0
- package/dist/routes/recents.d.ts.map +1 -1
- package/dist/routes/recents.js +3 -1
- package/dist/routes/recents.js.map +1 -1
- package/dist/routes/server-admin.d.ts +9 -0
- package/dist/routes/server-admin.d.ts.map +1 -1
- package/dist/routes/server-admin.js +45 -7
- package/dist/routes/server-admin.js.map +1 -1
- package/dist/routes/session-claude-resume-guard.d.ts +16 -0
- package/dist/routes/session-claude-resume-guard.d.ts.map +1 -0
- package/dist/routes/session-claude-resume-guard.js +50 -0
- package/dist/routes/session-claude-resume-guard.js.map +1 -0
- package/dist/routes/session-compact-thresholds.d.ts +22 -0
- package/dist/routes/session-compact-thresholds.d.ts.map +1 -0
- package/dist/routes/session-compact-thresholds.js +35 -0
- package/dist/routes/session-compact-thresholds.js.map +1 -0
- package/dist/routes/session-index.d.ts +7 -0
- package/dist/routes/session-index.d.ts.map +1 -0
- package/dist/routes/session-index.js +9 -0
- package/dist/routes/session-index.js.map +1 -0
- package/dist/routes/session-list-options.d.ts +1 -1
- package/dist/routes/session-list-options.d.ts.map +1 -1
- package/dist/routes/session-list-options.js +1 -1
- package/dist/routes/session-list-options.js.map +1 -1
- package/dist/routes/session-metadata-patch.d.ts +24 -0
- package/dist/routes/session-metadata-patch.d.ts.map +1 -0
- package/dist/routes/session-metadata-patch.js +119 -0
- package/dist/routes/session-metadata-patch.js.map +1 -0
- package/dist/routes/session-project-routing.d.ts +25 -0
- package/dist/routes/session-project-routing.d.ts.map +1 -0
- package/dist/routes/session-project-routing.js +32 -0
- package/dist/routes/session-project-routing.js.map +1 -0
- package/dist/routes/session-provider-resolution.d.ts +28 -0
- package/dist/routes/session-provider-resolution.d.ts.map +1 -0
- package/dist/routes/session-provider-resolution.js +22 -0
- package/dist/routes/session-provider-resolution.js.map +1 -0
- package/dist/routes/session-queue-summaries.d.ts +21 -0
- package/dist/routes/session-queue-summaries.d.ts.map +1 -0
- package/dist/routes/session-queue-summaries.js +79 -0
- package/dist/routes/session-queue-summaries.js.map +1 -0
- package/dist/routes/session-recovered-queue.d.ts +43 -0
- package/dist/routes/session-recovered-queue.d.ts.map +1 -0
- package/dist/routes/session-recovered-queue.js +132 -0
- package/dist/routes/session-recovered-queue.js.map +1 -0
- package/dist/routes/session-request-helpers.d.ts +31 -0
- package/dist/routes/session-request-helpers.d.ts.map +1 -0
- package/dist/routes/session-request-helpers.js +212 -0
- package/dist/routes/session-request-helpers.js.map +1 -0
- package/dist/routes/session-thinking-options.d.ts +12 -0
- package/dist/routes/session-thinking-options.d.ts.map +1 -0
- package/dist/routes/session-thinking-options.js +7 -0
- package/dist/routes/session-thinking-options.js.map +1 -0
- package/dist/routes/sessions.d.ts +14 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +1965 -679
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/settings-parsers.d.ts +37 -0
- package/dist/routes/settings-parsers.d.ts.map +1 -0
- package/dist/routes/settings-parsers.js +896 -0
- package/dist/routes/settings-parsers.js.map +1 -0
- package/dist/routes/settings.d.ts +7 -1
- package/dist/routes/settings.d.ts.map +1 -1
- package/dist/routes/settings.js +114 -258
- package/dist/routes/settings.js.map +1 -1
- package/dist/routes/speech.d.ts +24 -2
- package/dist/routes/speech.d.ts.map +1 -1
- package/dist/routes/speech.js +539 -10
- package/dist/routes/speech.js.map +1 -1
- package/dist/routes/supervisor-queue.d.ts +6 -0
- package/dist/routes/supervisor-queue.d.ts.map +1 -0
- package/dist/routes/supervisor-queue.js +35 -0
- package/dist/routes/supervisor-queue.js.map +1 -0
- package/dist/routes/upload.d.ts +2 -0
- package/dist/routes/upload.d.ts.map +1 -1
- package/dist/routes/upload.js +190 -38
- package/dist/routes/upload.js.map +1 -1
- package/dist/routes/version.d.ts +16 -1
- package/dist/routes/version.d.ts.map +1 -1
- package/dist/routes/version.js +27 -8
- package/dist/routes/version.js.map +1 -1
- package/dist/routes/workstreams.d.ts +11 -0
- package/dist/routes/workstreams.d.ts.map +1 -0
- package/dist/routes/workstreams.js +144 -0
- package/dist/routes/workstreams.js.map +1 -0
- package/dist/routes/ws-message-router.d.ts +10 -1
- package/dist/routes/ws-message-router.d.ts.map +1 -1
- package/dist/routes/ws-message-router.js +43 -4
- package/dist/routes/ws-message-router.js.map +1 -1
- package/dist/routes/ws-relay-handlers.d.ts +27 -5
- package/dist/routes/ws-relay-handlers.d.ts.map +1 -1
- package/dist/routes/ws-relay-handlers.js +177 -19
- package/dist/routes/ws-relay-handlers.js.map +1 -1
- package/dist/routes/ws-relay.d.ts +19 -0
- package/dist/routes/ws-relay.d.ts.map +1 -1
- package/dist/routes/ws-relay.js +21 -7
- package/dist/routes/ws-relay.js.map +1 -1
- package/dist/sdk/cli-detection.d.ts +1 -1
- package/dist/sdk/cli-detection.d.ts.map +1 -1
- package/dist/sdk/cli-detection.js +47 -7
- package/dist/sdk/cli-detection.js.map +1 -1
- package/dist/sdk/messageLogger.d.ts.map +1 -1
- package/dist/sdk/messageLogger.js +38 -10
- package/dist/sdk/messageLogger.js.map +1 -1
- package/dist/sdk/messageQueue.d.ts +5 -0
- package/dist/sdk/messageQueue.d.ts.map +1 -1
- package/dist/sdk/messageQueue.js +47 -0
- package/dist/sdk/messageQueue.js.map +1 -1
- package/dist/sdk/providers/__mocks__/grok.d.ts +1 -1
- package/dist/sdk/providers/__mocks__/grok.d.ts.map +1 -1
- package/dist/sdk/providers/__mocks__/grok.js +1 -1
- package/dist/sdk/providers/__mocks__/grok.js.map +1 -1
- package/dist/sdk/providers/agentctl-session-env.d.ts +8 -0
- package/dist/sdk/providers/agentctl-session-env.d.ts.map +1 -0
- package/dist/sdk/providers/agentctl-session-env.js +52 -0
- package/dist/sdk/providers/agentctl-session-env.js.map +1 -0
- package/dist/sdk/providers/claude-ollama.d.ts +2 -1
- package/dist/sdk/providers/claude-ollama.d.ts.map +1 -1
- package/dist/sdk/providers/claude-ollama.js +1 -0
- package/dist/sdk/providers/claude-ollama.js.map +1 -1
- package/dist/sdk/providers/claude-retention.d.ts +19 -0
- package/dist/sdk/providers/claude-retention.d.ts.map +1 -0
- package/dist/sdk/providers/claude-retention.js +169 -0
- package/dist/sdk/providers/claude-retention.js.map +1 -0
- package/dist/sdk/providers/claude.d.ts +52 -5
- package/dist/sdk/providers/claude.d.ts.map +1 -1
- package/dist/sdk/providers/claude.js +593 -71
- package/dist/sdk/providers/claude.js.map +1 -1
- package/dist/sdk/providers/codex-model-catalog.d.ts +34 -0
- package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -0
- package/dist/sdk/providers/codex-model-catalog.js +378 -0
- package/dist/sdk/providers/codex-model-catalog.js.map +1 -0
- package/dist/sdk/providers/codex-notification-guards.d.ts +15 -0
- package/dist/sdk/providers/codex-notification-guards.d.ts.map +1 -0
- package/dist/sdk/providers/codex-notification-guards.js +159 -0
- package/dist/sdk/providers/codex-notification-guards.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/AgentMessageInputContent.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/AgentMessageInputContent.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/AgentMessageInputContent.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/AgentMessageInputContent.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts +9 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/InternalChatMessageMetadataPassthrough.d.ts +10 -0
- package/dist/sdk/providers/codex-protocol/generated/InternalChatMessageMetadataPassthrough.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/InternalChatMessageMetadataPassthrough.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/InternalChatMessageMetadataPassthrough.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/LegacyAppPathString.d.ts +23 -0
- package/dist/sdk/providers/codex-protocol/generated/LegacyAppPathString.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/LegacyAppPathString.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/LegacyAppPathString.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/MultiAgentMode.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/MultiAgentMode.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/MultiAgentMode.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/MultiAgentMode.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ReasoningEffort.d.ts +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ReasoningEffort.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ResponseItem.d.ts +39 -1
- package/dist/sdk/providers/codex-protocol/generated/ResponseItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ThreadId.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/ThreadId.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/WebSearchItem.d.ts +7 -0
- package/dist/sdk/providers/codex-protocol/generated/WebSearchItem.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/WebSearchItem.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/WebSearchItem.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/AdditionalFileSystemPermissions.d.ts +3 -3
- package/dist/sdk/providers/codex-protocol/generated/v2/AdditionalFileSystemPermissions.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/AskForApproval.d.ts +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/AskForApproval.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/CapabilityRootLocation.d.ts +12 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/CapabilityRootLocation.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/CapabilityRootLocation.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/CapabilityRootLocation.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/CodexErrorInfo.d.ts +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/CodexErrorInfo.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionRequestApprovalParams.d.ts +6 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionRequestApprovalParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolFunctionSpec.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolFunctionSpec.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolFunctionSpec.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolFunctionSpec.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceSpec.d.ts +7 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceSpec.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceSpec.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceSpec.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceTool.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceTool.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceTool.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolNamespaceTool.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolSpec.d.ts +6 -7
- package/dist/sdk/providers/codex-protocol/generated/v2/DynamicToolSpec.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/FileSystemPath.d.ts +2 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/FileSystemPath.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpToolCallAppContext.d.ts +9 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpToolCallAppContext.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpToolCallAppContext.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpToolCallAppContext.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/PermissionsRequestApprovalParams.d.ts +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/PermissionsRequestApprovalParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/SelectedCapabilityRoot.d.ts +15 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SelectedCapabilityRoot.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SelectedCapabilityRoot.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SelectedCapabilityRoot.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SortDirection.d.ts +2 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SortDirection.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SortDirection.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SortDirection.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SubAgentActivityKind.d.ts +2 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SubAgentActivityKind.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SubAgentActivityKind.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/SubAgentActivityKind.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +21 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartParams.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartParams.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartParams.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartParams.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartResponse.d.ts +2 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartResponse.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartResponse.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadCompactStartResponse.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadExtra.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadExtra.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadExtra.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadExtra.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts +71 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts +46 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadHistoryMode.d.ts +2 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadHistoryMode.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadHistoryMode.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadHistoryMode.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +22 -12
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadReadResponse.d.ts +5 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadReadResponse.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadReadResponse.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadReadResponse.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeInitialTurnsPageParams.d.ts +17 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeInitialTurnsPageParams.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeInitialTurnsPageParams.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeInitialTurnsPageParams.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts +7 -7
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts +13 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts +14 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts +12 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSource.d.ts +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSource.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts +23 -9
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts +8 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ToolRequestUserInputParams.d.ts +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ToolRequestUserInputParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/Turn.d.ts +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/Turn.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnEnvironmentParams.d.ts +2 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnEnvironmentParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +17 -5
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts +8 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnsPage.d.ts +7 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnsPage.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnsPage.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnsPage.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/index.d.ts +7 -0
- package/dist/sdk/providers/codex-protocol/index.d.ts.map +1 -1
- package/dist/sdk/providers/codex-summary-helpers.d.ts +41 -0
- package/dist/sdk/providers/codex-summary-helpers.d.ts.map +1 -0
- package/dist/sdk/providers/codex-summary-helpers.js +207 -0
- package/dist/sdk/providers/codex-summary-helpers.js.map +1 -0
- package/dist/sdk/providers/codex.d.ts +23 -26
- package/dist/sdk/providers/codex.d.ts.map +1 -1
- package/dist/sdk/providers/codex.js +429 -623
- package/dist/sdk/providers/codex.js.map +1 -1
- package/dist/sdk/providers/env-filter.d.ts.map +1 -1
- package/dist/sdk/providers/env-filter.js +19 -1
- package/dist/sdk/providers/env-filter.js.map +1 -1
- package/dist/sdk/providers/gemini-tools.d.ts +28 -0
- package/dist/sdk/providers/gemini-tools.d.ts.map +1 -0
- package/dist/sdk/providers/gemini-tools.js +57 -0
- package/dist/sdk/providers/gemini-tools.js.map +1 -0
- package/dist/sdk/providers/gemini.d.ts.map +1 -1
- package/dist/sdk/providers/gemini.js +4 -2
- package/dist/sdk/providers/gemini.js.map +1 -1
- package/dist/sdk/providers/grok-acp.d.ts +1 -1
- package/dist/sdk/providers/grok-acp.d.ts.map +1 -1
- package/dist/sdk/providers/grok-acp.js +1 -1
- package/dist/sdk/providers/grok-acp.js.map +1 -1
- package/dist/sdk/providers/index.d.ts +1 -0
- package/dist/sdk/providers/index.d.ts.map +1 -1
- package/dist/sdk/providers/index.js +6 -0
- package/dist/sdk/providers/index.js.map +1 -1
- package/dist/sdk/providers/opencode-models.d.ts +17 -0
- package/dist/sdk/providers/opencode-models.d.ts.map +1 -0
- package/dist/sdk/providers/opencode-models.js +83 -0
- package/dist/sdk/providers/opencode-models.js.map +1 -0
- package/dist/sdk/providers/opencode-tools.d.ts +36 -0
- package/dist/sdk/providers/opencode-tools.d.ts.map +1 -0
- package/dist/sdk/providers/opencode-tools.js +78 -0
- package/dist/sdk/providers/opencode-tools.js.map +1 -0
- package/dist/sdk/providers/opencode.d.ts +44 -4
- package/dist/sdk/providers/opencode.d.ts.map +1 -1
- package/dist/sdk/providers/opencode.js +329 -102
- package/dist/sdk/providers/opencode.js.map +1 -1
- package/dist/sdk/providers/pi-rpc-client.d.ts +90 -0
- package/dist/sdk/providers/pi-rpc-client.d.ts.map +1 -0
- package/dist/sdk/providers/pi-rpc-client.js +168 -0
- package/dist/sdk/providers/pi-rpc-client.js.map +1 -0
- package/dist/sdk/providers/pi-tools.d.ts +38 -0
- package/dist/sdk/providers/pi-tools.d.ts.map +1 -0
- package/dist/sdk/providers/pi-tools.js +214 -0
- package/dist/sdk/providers/pi-tools.js.map +1 -0
- package/dist/sdk/providers/pi.d.ts +84 -0
- package/dist/sdk/providers/pi.d.ts.map +1 -0
- package/dist/sdk/providers/pi.js +686 -0
- package/dist/sdk/providers/pi.js.map +1 -0
- package/dist/sdk/providers/staticSlashCommands.d.ts +4 -0
- package/dist/sdk/providers/staticSlashCommands.d.ts.map +1 -0
- package/dist/sdk/providers/staticSlashCommands.js +14 -0
- package/dist/sdk/providers/staticSlashCommands.js.map +1 -0
- package/dist/sdk/providers/types.d.ts +144 -17
- package/dist/sdk/providers/types.d.ts.map +1 -1
- package/dist/sdk/remote-spawn.d.ts.map +1 -1
- package/dist/sdk/remote-spawn.js.map +1 -1
- package/dist/sdk/slashCommandEmulation.d.ts +9 -0
- package/dist/sdk/slashCommandEmulation.d.ts.map +1 -1
- package/dist/sdk/slashCommandEmulation.js +15 -0
- package/dist/sdk/slashCommandEmulation.js.map +1 -1
- package/dist/sdk/types.d.ts +43 -1
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/security/approvalAuditLog.d.ts +3 -2
- package/dist/security/approvalAuditLog.d.ts.map +1 -1
- package/dist/security/approvalAuditLog.js +62 -2
- package/dist/security/approvalAuditLog.js.map +1 -1
- package/dist/services/BrowserProfileService.d.ts +21 -0
- package/dist/services/BrowserProfileService.d.ts.map +1 -1
- package/dist/services/BrowserProfileService.js +74 -1
- package/dist/services/BrowserProfileService.js.map +1 -1
- package/dist/services/CacheMissBillingMonitor.d.ts +25 -0
- package/dist/services/CacheMissBillingMonitor.d.ts.map +1 -0
- package/dist/services/CacheMissBillingMonitor.js +179 -0
- package/dist/services/CacheMissBillingMonitor.js.map +1 -0
- package/dist/services/CodexUpdateChecker.d.ts.map +1 -1
- package/dist/services/CodexUpdateChecker.js +3 -2
- package/dist/services/CodexUpdateChecker.js.map +1 -1
- package/dist/services/ModelInfoService.d.ts +58 -9
- package/dist/services/ModelInfoService.d.ts.map +1 -1
- package/dist/services/ModelInfoService.js +127 -14
- package/dist/services/ModelInfoService.js.map +1 -1
- package/dist/services/ProjectQueueScheduler.d.ts +91 -0
- package/dist/services/ProjectQueueScheduler.d.ts.map +1 -0
- package/dist/services/ProjectQueueScheduler.js +404 -0
- package/dist/services/ProjectQueueScheduler.js.map +1 -0
- package/dist/services/ProjectQueueService.d.ts +60 -0
- package/dist/services/ProjectQueueService.d.ts.map +1 -0
- package/dist/services/ProjectQueueService.js +806 -0
- package/dist/services/ProjectQueueService.js.map +1 -0
- package/dist/services/RelayClientService.d.ts +5 -0
- package/dist/services/RelayClientService.d.ts.map +1 -1
- package/dist/services/RelayClientService.js +26 -12
- package/dist/services/RelayClientService.js.map +1 -1
- package/dist/services/SafeRestartService.d.ts +48 -0
- package/dist/services/SafeRestartService.d.ts.map +1 -0
- package/dist/services/SafeRestartService.js +173 -0
- package/dist/services/SafeRestartService.js.map +1 -0
- package/dist/services/ServerSettingsService.d.ts +41 -1
- package/dist/services/ServerSettingsService.d.ts.map +1 -1
- package/dist/services/ServerSettingsService.js +110 -1
- package/dist/services/ServerSettingsService.js.map +1 -1
- package/dist/services/SessionQueuePersistenceService.d.ts +55 -0
- package/dist/services/SessionQueuePersistenceService.d.ts.map +1 -0
- package/dist/services/SessionQueuePersistenceService.js +264 -0
- package/dist/services/SessionQueuePersistenceService.js.map +1 -0
- package/dist/services/WorkstreamService.d.ts +92 -0
- package/dist/services/WorkstreamService.d.ts.map +1 -0
- package/dist/services/WorkstreamService.js +627 -0
- package/dist/services/WorkstreamService.js.map +1 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +4 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/projectWorkIdle.d.ts +42 -0
- package/dist/services/projectWorkIdle.d.ts.map +1 -0
- package/dist/services/projectWorkIdle.js +50 -0
- package/dist/services/projectWorkIdle.js.map +1 -0
- package/dist/services/voice/SpeechBackend.d.ts +18 -1
- package/dist/services/voice/SpeechBackend.d.ts.map +1 -1
- package/dist/services/voice/SpeechBackend.js +3 -0
- package/dist/services/voice/SpeechBackend.js.map +1 -1
- package/dist/services/voice/audioRetention.d.ts +20 -0
- package/dist/services/voice/audioRetention.d.ts.map +1 -1
- package/dist/services/voice/audioRetention.js +2 -0
- package/dist/services/voice/audioRetention.js.map +1 -1
- package/dist/services/voice/deepgramBackend.d.ts.map +1 -1
- package/dist/services/voice/deepgramBackend.js +4 -1
- package/dist/services/voice/deepgramBackend.js.map +1 -1
- package/dist/services/voice/localNemoBackend.d.ts +31 -0
- package/dist/services/voice/localNemoBackend.d.ts.map +1 -0
- package/dist/services/voice/localNemoBackend.js +181 -0
- package/dist/services/voice/localNemoBackend.js.map +1 -0
- package/dist/services/voice/localParakeetBackend.d.ts +31 -0
- package/dist/services/voice/localParakeetBackend.d.ts.map +1 -0
- package/dist/services/voice/localParakeetBackend.js +180 -0
- package/dist/services/voice/localParakeetBackend.js.map +1 -0
- package/dist/services/voice/localSttRuntime.d.ts +21 -0
- package/dist/services/voice/localSttRuntime.d.ts.map +1 -0
- package/dist/services/voice/localSttRuntime.js +87 -0
- package/dist/services/voice/localSttRuntime.js.map +1 -0
- package/dist/services/voice/localWhisperBackend.d.ts +2 -1
- package/dist/services/voice/localWhisperBackend.d.ts.map +1 -1
- package/dist/services/voice/localWhisperBackend.js +47 -34
- package/dist/services/voice/localWhisperBackend.js.map +1 -1
- package/dist/services/voice/nemo_worker.py +232 -0
- package/dist/services/voice/parakeet_worker.py +151 -0
- package/dist/services/voice/registry.d.ts +19 -4
- package/dist/services/voice/registry.d.ts.map +1 -1
- package/dist/services/voice/registry.js +72 -22
- package/dist/services/voice/registry.js.map +1 -1
- package/dist/services/voice/serialQueue.d.ts +17 -0
- package/dist/services/voice/serialQueue.d.ts.map +1 -0
- package/dist/services/voice/serialQueue.js +24 -0
- package/dist/services/voice/serialQueue.js.map +1 -0
- package/dist/services/voice/whisper_worker.py +94 -0
- package/dist/services/voice/xaiSttBackend.d.ts +1 -1
- package/dist/services/voice/xaiSttBackend.d.ts.map +1 -1
- package/dist/services/voice/xaiSttBackend.js +15 -3
- package/dist/services/voice/xaiSttBackend.js.map +1 -1
- package/dist/sessions/agent-excerpt.d.ts +29 -0
- package/dist/sessions/agent-excerpt.d.ts.map +1 -0
- package/dist/sessions/agent-excerpt.js +128 -0
- package/dist/sessions/agent-excerpt.js.map +1 -0
- package/dist/sessions/claude-messages.d.ts.map +1 -1
- package/dist/sessions/claude-messages.js +75 -4
- package/dist/sessions/claude-messages.js.map +1 -1
- package/dist/sessions/claude-summary.d.ts +33 -0
- package/dist/sessions/claude-summary.d.ts.map +1 -0
- package/dist/sessions/claude-summary.js +461 -0
- package/dist/sessions/claude-summary.js.map +1 -0
- package/dist/sessions/codex-discovery.d.ts +46 -0
- package/dist/sessions/codex-discovery.d.ts.map +1 -0
- package/dist/sessions/codex-discovery.js +269 -0
- package/dist/sessions/codex-discovery.js.map +1 -0
- package/dist/sessions/codex-reader.d.ts +96 -13
- package/dist/sessions/codex-reader.d.ts.map +1 -1
- package/dist/sessions/codex-reader.js +1070 -142
- package/dist/sessions/codex-reader.js.map +1 -1
- package/dist/sessions/dag.d.ts +25 -4
- package/dist/sessions/dag.d.ts.map +1 -1
- package/dist/sessions/dag.js +37 -4
- package/dist/sessions/dag.js.map +1 -1
- package/dist/sessions/gemini-reader.d.ts +3 -1
- package/dist/sessions/gemini-reader.d.ts.map +1 -1
- package/dist/sessions/gemini-reader.js +17 -8
- package/dist/sessions/gemini-reader.js.map +1 -1
- package/dist/sessions/grok-reader.d.ts +1 -0
- package/dist/sessions/grok-reader.d.ts.map +1 -1
- package/dist/sessions/grok-reader.js +11 -5
- package/dist/sessions/grok-reader.js.map +1 -1
- package/dist/sessions/normalization.d.ts +4 -1
- package/dist/sessions/normalization.d.ts.map +1 -1
- package/dist/sessions/normalization.js +109 -21
- package/dist/sessions/normalization.js.map +1 -1
- package/dist/sessions/null-reader.d.ts +31 -0
- package/dist/sessions/null-reader.d.ts.map +1 -0
- package/dist/sessions/null-reader.js +30 -0
- package/dist/sessions/null-reader.js.map +1 -0
- package/dist/sessions/opencode-db-reader.d.ts +66 -0
- package/dist/sessions/opencode-db-reader.d.ts.map +1 -0
- package/dist/sessions/opencode-db-reader.js +333 -0
- package/dist/sessions/opencode-db-reader.js.map +1 -0
- package/dist/sessions/opencode-reader.d.ts +50 -0
- package/dist/sessions/opencode-reader.d.ts.map +1 -1
- package/dist/sessions/opencode-reader.js +375 -71
- package/dist/sessions/opencode-reader.js.map +1 -1
- package/dist/sessions/pagination.d.ts +6 -0
- package/dist/sessions/pagination.d.ts.map +1 -1
- package/dist/sessions/pagination.js +158 -5
- package/dist/sessions/pagination.js.map +1 -1
- package/dist/sessions/persisted-augments.d.ts +2 -1
- package/dist/sessions/persisted-augments.d.ts.map +1 -1
- package/dist/sessions/persisted-augments.js +2 -2
- package/dist/sessions/persisted-augments.js.map +1 -1
- package/dist/sessions/pi-fork.d.ts +12 -0
- package/dist/sessions/pi-fork.d.ts.map +1 -0
- package/dist/sessions/pi-fork.js +125 -0
- package/dist/sessions/pi-fork.js.map +1 -0
- package/dist/sessions/pi-reader.d.ts +81 -0
- package/dist/sessions/pi-reader.d.ts.map +1 -0
- package/dist/sessions/pi-reader.js +413 -0
- package/dist/sessions/pi-reader.js.map +1 -0
- package/dist/sessions/provider-resolution.d.ts +10 -3
- package/dist/sessions/provider-resolution.d.ts.map +1 -1
- package/dist/sessions/provider-resolution.js +62 -6
- package/dist/sessions/provider-resolution.js.map +1 -1
- package/dist/sessions/reader.d.ts +17 -24
- package/dist/sessions/reader.d.ts.map +1 -1
- package/dist/sessions/reader.js +86 -157
- package/dist/sessions/reader.js.map +1 -1
- package/dist/sessions/recap-overlays.d.ts +38 -0
- package/dist/sessions/recap-overlays.d.ts.map +1 -0
- package/dist/sessions/recap-overlays.js +176 -0
- package/dist/sessions/recap-overlays.js.map +1 -0
- package/dist/sessions/summary-parser-worker-client.d.ts +80 -0
- package/dist/sessions/summary-parser-worker-client.d.ts.map +1 -0
- package/dist/sessions/summary-parser-worker-client.js +539 -0
- package/dist/sessions/summary-parser-worker-client.js.map +1 -0
- package/dist/sessions/summary-parser-worker-entry.d.ts +2 -0
- package/dist/sessions/summary-parser-worker-entry.d.ts.map +1 -0
- package/dist/sessions/summary-parser-worker-entry.js +29 -0
- package/dist/sessions/summary-parser-worker-entry.js.map +1 -0
- package/dist/sessions/summary-parser-worker-protocol.d.ts +105 -0
- package/dist/sessions/summary-parser-worker-protocol.d.ts.map +1 -0
- package/dist/sessions/summary-parser-worker-protocol.js +35 -0
- package/dist/sessions/summary-parser-worker-protocol.js.map +1 -0
- package/dist/sessions/summary-parser-worker-runner.d.ts +3 -0
- package/dist/sessions/summary-parser-worker-runner.d.ts.map +1 -0
- package/dist/sessions/summary-parser-worker-runner.js +158 -0
- package/dist/sessions/summary-parser-worker-runner.js.map +1 -0
- package/dist/sessions/types.d.ts +30 -1
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/startupEnv.d.ts +2 -0
- package/dist/startupEnv.d.ts.map +1 -0
- package/dist/startupEnv.js +97 -0
- package/dist/startupEnv.js.map +1 -0
- package/dist/subscriptions.d.ts.map +1 -1
- package/dist/subscriptions.js +28 -18
- package/dist/subscriptions.js.map +1 -1
- package/dist/supervisor/ExternalSessionTracker.d.ts +5 -1
- package/dist/supervisor/ExternalSessionTracker.d.ts.map +1 -1
- package/dist/supervisor/ExternalSessionTracker.js +98 -6
- package/dist/supervisor/ExternalSessionTracker.js.map +1 -1
- package/dist/supervisor/Process.d.ts +259 -30
- package/dist/supervisor/Process.d.ts.map +1 -1
- package/dist/supervisor/Process.js +1282 -229
- package/dist/supervisor/Process.js.map +1 -1
- package/dist/supervisor/Supervisor.d.ts +201 -5
- package/dist/supervisor/Supervisor.d.ts.map +1 -1
- package/dist/supervisor/Supervisor.js +1074 -55
- package/dist/supervisor/Supervisor.js.map +1 -1
- package/dist/supervisor/WorkerQueue.d.ts +3 -1
- package/dist/supervisor/WorkerQueue.d.ts.map +1 -1
- package/dist/supervisor/WorkerQueue.js +1 -0
- package/dist/supervisor/WorkerQueue.js.map +1 -1
- package/dist/supervisor/composeTimeAnchor.d.ts +36 -0
- package/dist/supervisor/composeTimeAnchor.d.ts.map +1 -0
- package/dist/supervisor/composeTimeAnchor.js +51 -0
- package/dist/supervisor/composeTimeAnchor.js.map +1 -0
- package/dist/supervisor/deferredDeliverySettings.d.ts +23 -0
- package/dist/supervisor/deferredDeliverySettings.d.ts.map +1 -0
- package/dist/supervisor/deferredDeliverySettings.js +40 -0
- package/dist/supervisor/deferredDeliverySettings.js.map +1 -0
- package/dist/supervisor/liveness.d.ts +5 -2
- package/dist/supervisor/liveness.d.ts.map +1 -1
- package/dist/supervisor/liveness.js +40 -2
- package/dist/supervisor/liveness.js.map +1 -1
- package/dist/supervisor/types.d.ts +56 -5
- package/dist/supervisor/types.d.ts.map +1 -1
- package/dist/supervisor/types.js +0 -2
- package/dist/supervisor/types.js.map +1 -1
- package/dist/uploads/AttachmentStagingService.d.ts +94 -0
- package/dist/uploads/AttachmentStagingService.d.ts.map +1 -0
- package/dist/uploads/AttachmentStagingService.js +673 -0
- package/dist/uploads/AttachmentStagingService.js.map +1 -0
- package/dist/uploads/index.d.ts +2 -0
- package/dist/uploads/index.d.ts.map +1 -1
- package/dist/uploads/index.js +1 -0
- package/dist/uploads/index.js.map +1 -1
- package/dist/uploads/manager.d.ts +1 -0
- package/dist/uploads/manager.d.ts.map +1 -1
- package/dist/uploads/manager.js +72 -12
- package/dist/uploads/manager.js.map +1 -1
- package/dist/utils/codexRolloutFiles.d.ts +16 -0
- package/dist/utils/codexRolloutFiles.d.ts.map +1 -0
- package/dist/utils/codexRolloutFiles.js +45 -0
- package/dist/utils/codexRolloutFiles.js.map +1 -0
- package/dist/utils/jsonl.d.ts +8 -0
- package/dist/utils/jsonl.d.ts.map +1 -1
- package/dist/utils/jsonl.js +158 -5
- package/dist/utils/jsonl.js.map +1 -1
- package/dist/utils/publicShareViewerUrl.d.ts.map +1 -1
- package/dist/utils/publicShareViewerUrl.js +2 -15
- package/dist/utils/publicShareViewerUrl.js.map +1 -1
- package/dist/watcher/EventBus.d.ts +42 -4
- package/dist/watcher/EventBus.d.ts.map +1 -1
- package/dist/watcher/EventBus.js.map +1 -1
- package/dist/watcher/FileWatcher.d.ts +47 -0
- package/dist/watcher/FileWatcher.d.ts.map +1 -1
- package/dist/watcher/FileWatcher.js +185 -14
- package/dist/watcher/FileWatcher.js.map +1 -1
- package/dist/watcher/index.d.ts +2 -2
- package/dist/watcher/index.d.ts.map +1 -1
- package/dist/watcher/index.js.map +1 -1
- package/dist/yaModuleEnv.d.ts +6 -6
- package/dist/yaModuleEnv.d.ts.map +1 -1
- package/dist/yaModuleEnv.js +12 -12
- package/dist/yaModuleEnv.js.map +1 -1
- package/package.json +5 -6
- package/client-dist/assets/de-BuEb60Yc.js +0 -6
- package/client-dist/assets/es-CRlmPKnE.js +0 -6
- package/client-dist/assets/fr-Cglgjc2X.js +0 -6
- package/client-dist/assets/index-BNj7ibmq.js +0 -524
- package/client-dist/assets/index-CAmsUazi.css +0 -1
- package/client-dist/assets/ja-DMb9mFPv.js +0 -6
- package/client-dist/assets/zh-CN-D1tbfamz.js +0 -6
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { ALL_PERMISSION_MODES, ALL_PROVIDERS, isUrlProjectId, } from "../../bundled/@yep-anywhere/shared/dist/index.js";
|
|
5
|
+
const CURRENT_VERSION = 2;
|
|
6
|
+
const MAX_MESSAGE_PREVIEW_LENGTH = 180;
|
|
7
|
+
const RUNNING_DISPATCH_STATE = { status: "running" };
|
|
8
|
+
export class ProjectQueueValidationError extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "ProjectQueueValidationError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function isRecord(value) {
|
|
15
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
function optionalString(value, field) {
|
|
18
|
+
if (value === undefined)
|
|
19
|
+
return undefined;
|
|
20
|
+
if (typeof value !== "string") {
|
|
21
|
+
throw new ProjectQueueValidationError(`${field} must be a string`);
|
|
22
|
+
}
|
|
23
|
+
const trimmed = value.trim();
|
|
24
|
+
return trimmed || undefined;
|
|
25
|
+
}
|
|
26
|
+
function errorMessage(error) {
|
|
27
|
+
return error instanceof Error ? error.message : String(error);
|
|
28
|
+
}
|
|
29
|
+
function dispatchStatesEqual(a, b) {
|
|
30
|
+
return JSON.stringify(a ?? RUNNING_DISPATCH_STATE) === JSON.stringify(b);
|
|
31
|
+
}
|
|
32
|
+
function normalizeDispatchState(raw, hasItems) {
|
|
33
|
+
if (!hasItems)
|
|
34
|
+
return RUNNING_DISPATCH_STATE;
|
|
35
|
+
if (isRecord(raw) && raw.status === "paused") {
|
|
36
|
+
const reason = raw.reason === "manual" || raw.reason === "restart"
|
|
37
|
+
? raw.reason
|
|
38
|
+
: undefined;
|
|
39
|
+
const pausedAt = typeof raw.pausedAt === "string" && raw.pausedAt.trim()
|
|
40
|
+
? raw.pausedAt
|
|
41
|
+
: undefined;
|
|
42
|
+
if (reason && pausedAt) {
|
|
43
|
+
return { status: "paused", reason, pausedAt };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
status: "paused",
|
|
48
|
+
reason: "restart",
|
|
49
|
+
pausedAt: new Date().toISOString(),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function optionalProvider(value) {
|
|
53
|
+
if (value === undefined)
|
|
54
|
+
return undefined;
|
|
55
|
+
if (typeof value !== "string" ||
|
|
56
|
+
!ALL_PROVIDERS.includes(value)) {
|
|
57
|
+
throw new ProjectQueueValidationError("target.provider is invalid");
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
function optionalPermissionMode(value) {
|
|
62
|
+
if (value === undefined)
|
|
63
|
+
return undefined;
|
|
64
|
+
if (typeof value !== "string" ||
|
|
65
|
+
!ALL_PERMISSION_MODES.includes(value)) {
|
|
66
|
+
throw new ProjectQueueValidationError("mode is invalid");
|
|
67
|
+
}
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
function optionalThinking(value) {
|
|
71
|
+
if (value === undefined)
|
|
72
|
+
return undefined;
|
|
73
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
74
|
+
throw new ProjectQueueValidationError("target.thinking is invalid");
|
|
75
|
+
}
|
|
76
|
+
return value.trim();
|
|
77
|
+
}
|
|
78
|
+
function optionalShowThinking(value) {
|
|
79
|
+
if (value === undefined)
|
|
80
|
+
return undefined;
|
|
81
|
+
if (value !== "default" && value !== "on" && value !== "off") {
|
|
82
|
+
throw new ProjectQueueValidationError("target.showThinking is invalid");
|
|
83
|
+
}
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
function normalizeUploadedFile(value, index) {
|
|
87
|
+
if (!isRecord(value)) {
|
|
88
|
+
throw new ProjectQueueValidationError(`message.attachments[${index}] must be an object`);
|
|
89
|
+
}
|
|
90
|
+
const id = optionalString(value.id, `message.attachments[${index}].id`);
|
|
91
|
+
const originalName = optionalString(value.originalName, `message.attachments[${index}].originalName`);
|
|
92
|
+
const name = optionalString(value.name, `message.attachments[${index}].name`);
|
|
93
|
+
const filePath = optionalString(value.path, `message.attachments[${index}].path`);
|
|
94
|
+
const mimeType = optionalString(value.mimeType, `message.attachments[${index}].mimeType`);
|
|
95
|
+
if (!id || !originalName || !name || !filePath || !mimeType) {
|
|
96
|
+
throw new ProjectQueueValidationError(`message.attachments[${index}] is missing required fields`);
|
|
97
|
+
}
|
|
98
|
+
if (typeof value.size !== "number" || !Number.isFinite(value.size)) {
|
|
99
|
+
throw new ProjectQueueValidationError(`message.attachments[${index}].size must be a number`);
|
|
100
|
+
}
|
|
101
|
+
const width = typeof value.width === "number" && Number.isFinite(value.width)
|
|
102
|
+
? value.width
|
|
103
|
+
: undefined;
|
|
104
|
+
const height = typeof value.height === "number" && Number.isFinite(value.height)
|
|
105
|
+
? value.height
|
|
106
|
+
: undefined;
|
|
107
|
+
return {
|
|
108
|
+
id,
|
|
109
|
+
originalName,
|
|
110
|
+
name,
|
|
111
|
+
path: filePath,
|
|
112
|
+
size: value.size,
|
|
113
|
+
mimeType,
|
|
114
|
+
...(width !== undefined ? { width } : {}),
|
|
115
|
+
...(height !== undefined ? { height } : {}),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function normalizeStagedAttachmentRef(value, index, batchId) {
|
|
119
|
+
if (!isRecord(value)) {
|
|
120
|
+
throw new ProjectQueueValidationError(`message.stagedAttachments.refs[${index}] must be an object`);
|
|
121
|
+
}
|
|
122
|
+
const id = optionalString(value.id, `message.stagedAttachments.refs[${index}].id`);
|
|
123
|
+
const refBatchId = optionalString(value.batchId, `message.stagedAttachments.refs[${index}].batchId`);
|
|
124
|
+
const originalName = optionalString(value.originalName, `message.stagedAttachments.refs[${index}].originalName`);
|
|
125
|
+
const name = optionalString(value.name, `message.stagedAttachments.refs[${index}].name`);
|
|
126
|
+
const mimeType = optionalString(value.mimeType, `message.stagedAttachments.refs[${index}].mimeType`);
|
|
127
|
+
const createdAt = optionalString(value.createdAt, `message.stagedAttachments.refs[${index}].createdAt`);
|
|
128
|
+
const updatedAt = optionalString(value.updatedAt, `message.stagedAttachments.refs[${index}].updatedAt`);
|
|
129
|
+
if (!id ||
|
|
130
|
+
!refBatchId ||
|
|
131
|
+
refBatchId !== batchId ||
|
|
132
|
+
!originalName ||
|
|
133
|
+
!name ||
|
|
134
|
+
!mimeType ||
|
|
135
|
+
!createdAt ||
|
|
136
|
+
!updatedAt) {
|
|
137
|
+
throw new ProjectQueueValidationError(`message.stagedAttachments.refs[${index}] is missing required fields`);
|
|
138
|
+
}
|
|
139
|
+
if (typeof value.size !== "number" || !Number.isFinite(value.size)) {
|
|
140
|
+
throw new ProjectQueueValidationError(`message.stagedAttachments.refs[${index}].size must be a number`);
|
|
141
|
+
}
|
|
142
|
+
const width = typeof value.width === "number" && Number.isFinite(value.width)
|
|
143
|
+
? value.width
|
|
144
|
+
: undefined;
|
|
145
|
+
const height = typeof value.height === "number" && Number.isFinite(value.height)
|
|
146
|
+
? value.height
|
|
147
|
+
: undefined;
|
|
148
|
+
return {
|
|
149
|
+
id,
|
|
150
|
+
batchId: refBatchId,
|
|
151
|
+
originalName,
|
|
152
|
+
name,
|
|
153
|
+
size: value.size,
|
|
154
|
+
mimeType,
|
|
155
|
+
...(width !== undefined ? { width } : {}),
|
|
156
|
+
...(height !== undefined ? { height } : {}),
|
|
157
|
+
createdAt,
|
|
158
|
+
updatedAt,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function normalizeStagedAttachments(value) {
|
|
162
|
+
if (!isRecord(value)) {
|
|
163
|
+
throw new ProjectQueueValidationError("message.stagedAttachments must be an object");
|
|
164
|
+
}
|
|
165
|
+
const batchId = optionalString(value.batchId, "message.stagedAttachments.batchId");
|
|
166
|
+
const updatedAt = optionalString(value.updatedAt, "message.stagedAttachments.updatedAt");
|
|
167
|
+
if (!batchId || !updatedAt) {
|
|
168
|
+
throw new ProjectQueueValidationError("message.stagedAttachments is missing required fields");
|
|
169
|
+
}
|
|
170
|
+
if (!Array.isArray(value.refs)) {
|
|
171
|
+
throw new ProjectQueueValidationError("message.stagedAttachments.refs must be an array");
|
|
172
|
+
}
|
|
173
|
+
const refs = value.refs.map((ref, index) => normalizeStagedAttachmentRef(ref, index, batchId));
|
|
174
|
+
if (refs.length === 0) {
|
|
175
|
+
throw new ProjectQueueValidationError("message.stagedAttachments.refs must not be empty");
|
|
176
|
+
}
|
|
177
|
+
return { batchId, refs, updatedAt };
|
|
178
|
+
}
|
|
179
|
+
function normalizeMessage(raw) {
|
|
180
|
+
if (!isRecord(raw)) {
|
|
181
|
+
throw new ProjectQueueValidationError("message must be an object");
|
|
182
|
+
}
|
|
183
|
+
if (typeof raw.text !== "string") {
|
|
184
|
+
throw new ProjectQueueValidationError("message.text is required");
|
|
185
|
+
}
|
|
186
|
+
const text = raw.text;
|
|
187
|
+
const mode = optionalPermissionMode(raw.mode);
|
|
188
|
+
const attachments = raw.attachments === undefined
|
|
189
|
+
? undefined
|
|
190
|
+
: Array.isArray(raw.attachments)
|
|
191
|
+
? raw.attachments.map(normalizeUploadedFile)
|
|
192
|
+
: (() => {
|
|
193
|
+
throw new ProjectQueueValidationError("message.attachments must be an array");
|
|
194
|
+
})();
|
|
195
|
+
const stagedAttachments = raw.stagedAttachments === undefined
|
|
196
|
+
? undefined
|
|
197
|
+
: normalizeStagedAttachments(raw.stagedAttachments);
|
|
198
|
+
if (!text.trim() && !attachments?.length && !stagedAttachments?.refs.length) {
|
|
199
|
+
throw new ProjectQueueValidationError("message.text, message.attachments, or message.stagedAttachments is required");
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
text,
|
|
203
|
+
...(attachments?.length ? { attachments } : {}),
|
|
204
|
+
...(stagedAttachments ? { stagedAttachments } : {}),
|
|
205
|
+
...(mode ? { mode } : {}),
|
|
206
|
+
...(isRecord(raw.metadata) ? { metadata: raw.metadata } : {}),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function normalizeTarget(raw) {
|
|
210
|
+
if (!isRecord(raw)) {
|
|
211
|
+
throw new ProjectQueueValidationError("target must be an object");
|
|
212
|
+
}
|
|
213
|
+
const common = {
|
|
214
|
+
provider: optionalProvider(raw.provider),
|
|
215
|
+
mode: optionalPermissionMode(raw.mode),
|
|
216
|
+
model: optionalString(raw.model, "target.model"),
|
|
217
|
+
serviceTier: optionalString(raw.serviceTier, "target.serviceTier"),
|
|
218
|
+
executor: optionalString(raw.executor, "target.executor"),
|
|
219
|
+
thinking: optionalThinking(raw.thinking),
|
|
220
|
+
showThinking: optionalShowThinking(raw.showThinking),
|
|
221
|
+
};
|
|
222
|
+
if (raw.type === "existing-session") {
|
|
223
|
+
const sessionId = optionalString(raw.sessionId, "target.sessionId");
|
|
224
|
+
if (!sessionId) {
|
|
225
|
+
throw new ProjectQueueValidationError("target.sessionId is required");
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
type: "existing-session",
|
|
229
|
+
sessionId,
|
|
230
|
+
...common,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (raw.type === "new-session") {
|
|
234
|
+
return {
|
|
235
|
+
type: "new-session",
|
|
236
|
+
title: optionalString(raw.title, "target.title"),
|
|
237
|
+
...common,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
throw new ProjectQueueValidationError("target.type is invalid");
|
|
241
|
+
}
|
|
242
|
+
function normalizeCreatedFrom(raw) {
|
|
243
|
+
if (raw === undefined)
|
|
244
|
+
return undefined;
|
|
245
|
+
if (!isRecord(raw)) {
|
|
246
|
+
throw new ProjectQueueValidationError("createdFrom must be an object");
|
|
247
|
+
}
|
|
248
|
+
const sessionId = optionalString(raw.sessionId, "createdFrom.sessionId");
|
|
249
|
+
const client = optionalString(raw.client, "createdFrom.client");
|
|
250
|
+
if (client !== undefined &&
|
|
251
|
+
client !== "toolbar" &&
|
|
252
|
+
client !== "projects-page" &&
|
|
253
|
+
client !== "new-session") {
|
|
254
|
+
throw new ProjectQueueValidationError("createdFrom.client is invalid");
|
|
255
|
+
}
|
|
256
|
+
if (!sessionId && !client)
|
|
257
|
+
return undefined;
|
|
258
|
+
return {
|
|
259
|
+
...(sessionId ? { sessionId } : {}),
|
|
260
|
+
...(client ? { client } : {}),
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function normalizeProjectQueueItem(raw) {
|
|
264
|
+
if (!isRecord(raw))
|
|
265
|
+
return null;
|
|
266
|
+
try {
|
|
267
|
+
const id = optionalString(raw.id, "id") ?? randomUUID();
|
|
268
|
+
const projectId = optionalString(raw.projectId, "projectId");
|
|
269
|
+
const projectPath = optionalString(raw.projectPath, "projectPath");
|
|
270
|
+
if (!projectId || !isUrlProjectId(projectId) || !projectPath) {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
const createdAt = optionalString(raw.createdAt, "createdAt") ?? new Date().toISOString();
|
|
274
|
+
const updatedAt = optionalString(raw.updatedAt, "updatedAt") ?? createdAt;
|
|
275
|
+
const rawStatus = optionalString(raw.status, "status");
|
|
276
|
+
const status = rawStatus === "failed"
|
|
277
|
+
? "failed"
|
|
278
|
+
: // A restart means no dispatch is in progress anymore.
|
|
279
|
+
"queued";
|
|
280
|
+
return {
|
|
281
|
+
id,
|
|
282
|
+
projectId,
|
|
283
|
+
projectPath,
|
|
284
|
+
target: normalizeTarget(raw.target),
|
|
285
|
+
message: normalizeMessage(raw.message),
|
|
286
|
+
createdAt,
|
|
287
|
+
updatedAt,
|
|
288
|
+
createdFrom: normalizeCreatedFrom(raw.createdFrom),
|
|
289
|
+
status,
|
|
290
|
+
lastError: optionalString(raw.lastError, "lastError"),
|
|
291
|
+
lastAttemptAt: optionalString(raw.lastAttemptAt, "lastAttemptAt"),
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function summarizeItem(item) {
|
|
299
|
+
const attachmentCount = (item.message.attachments?.length ?? 0) +
|
|
300
|
+
(item.message.stagedAttachments?.refs.length ?? 0);
|
|
301
|
+
const previewText = item.message.text.trim();
|
|
302
|
+
return {
|
|
303
|
+
id: item.id,
|
|
304
|
+
projectId: item.projectId,
|
|
305
|
+
target: item.target,
|
|
306
|
+
messagePreview: previewText.length > MAX_MESSAGE_PREVIEW_LENGTH
|
|
307
|
+
? `${previewText.slice(0, MAX_MESSAGE_PREVIEW_LENGTH - 3)}...`
|
|
308
|
+
: previewText,
|
|
309
|
+
message: item.message,
|
|
310
|
+
createdAt: item.createdAt,
|
|
311
|
+
updatedAt: item.updatedAt,
|
|
312
|
+
createdFrom: item.createdFrom,
|
|
313
|
+
status: item.status,
|
|
314
|
+
attachmentCount,
|
|
315
|
+
lastError: item.lastError,
|
|
316
|
+
lastAttemptAt: item.lastAttemptAt,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
function cloneItem(item) {
|
|
320
|
+
return {
|
|
321
|
+
...item,
|
|
322
|
+
target: { ...item.target },
|
|
323
|
+
message: {
|
|
324
|
+
...item.message,
|
|
325
|
+
...(item.message.attachments
|
|
326
|
+
? { attachments: item.message.attachments.map((file) => ({ ...file })) }
|
|
327
|
+
: {}),
|
|
328
|
+
...(item.message.stagedAttachments
|
|
329
|
+
? {
|
|
330
|
+
stagedAttachments: {
|
|
331
|
+
...item.message.stagedAttachments,
|
|
332
|
+
refs: item.message.stagedAttachments.refs.map((ref) => ({
|
|
333
|
+
...ref,
|
|
334
|
+
})),
|
|
335
|
+
},
|
|
336
|
+
}
|
|
337
|
+
: {}),
|
|
338
|
+
...(item.message.metadata
|
|
339
|
+
? { metadata: { ...item.message.metadata } }
|
|
340
|
+
: {}),
|
|
341
|
+
},
|
|
342
|
+
...(item.createdFrom ? { createdFrom: { ...item.createdFrom } } : {}),
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
export class ProjectQueueService {
|
|
346
|
+
options;
|
|
347
|
+
dataDir;
|
|
348
|
+
filePath;
|
|
349
|
+
state = {
|
|
350
|
+
version: CURRENT_VERSION,
|
|
351
|
+
items: [],
|
|
352
|
+
dispatchState: RUNNING_DISPATCH_STATE,
|
|
353
|
+
};
|
|
354
|
+
initialized = false;
|
|
355
|
+
mutationQueue = Promise.resolve();
|
|
356
|
+
attachmentStagingService;
|
|
357
|
+
constructor(options) {
|
|
358
|
+
this.options = options;
|
|
359
|
+
this.dataDir = options.dataDir;
|
|
360
|
+
this.filePath = path.join(this.dataDir, "project-queues.json");
|
|
361
|
+
this.attachmentStagingService = options.attachmentStagingService;
|
|
362
|
+
}
|
|
363
|
+
setAttachmentStagingService(attachmentStagingService) {
|
|
364
|
+
this.attachmentStagingService = attachmentStagingService;
|
|
365
|
+
}
|
|
366
|
+
async initialize() {
|
|
367
|
+
if (this.initialized)
|
|
368
|
+
return;
|
|
369
|
+
await fs.mkdir(this.dataDir, { recursive: true });
|
|
370
|
+
try {
|
|
371
|
+
const content = await fs.readFile(this.filePath, "utf-8");
|
|
372
|
+
const parsed = JSON.parse(content);
|
|
373
|
+
const rawItems = Array.isArray(parsed.items) ? parsed.items : [];
|
|
374
|
+
const items = rawItems
|
|
375
|
+
.map(normalizeProjectQueueItem)
|
|
376
|
+
.filter((item) => item !== null);
|
|
377
|
+
const dispatchState = normalizeDispatchState(parsed.dispatchState, items.length > 0);
|
|
378
|
+
this.state = {
|
|
379
|
+
version: CURRENT_VERSION,
|
|
380
|
+
items,
|
|
381
|
+
dispatchState,
|
|
382
|
+
};
|
|
383
|
+
const needsSave = parsed.version !== CURRENT_VERSION ||
|
|
384
|
+
items.length !== rawItems.length ||
|
|
385
|
+
!dispatchStatesEqual(dispatchState, parsed.dispatchState) ||
|
|
386
|
+
rawItems.some((item) => isRecord(item) &&
|
|
387
|
+
item.status !== undefined &&
|
|
388
|
+
item.status !== "queued" &&
|
|
389
|
+
item.status !== "failed");
|
|
390
|
+
if (needsSave) {
|
|
391
|
+
await this.save();
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
catch (error) {
|
|
395
|
+
if (error.code !== "ENOENT") {
|
|
396
|
+
console.warn("[ProjectQueueService] Failed to load project queues, starting fresh:", error);
|
|
397
|
+
}
|
|
398
|
+
this.state = {
|
|
399
|
+
version: CURRENT_VERSION,
|
|
400
|
+
items: [],
|
|
401
|
+
dispatchState: RUNNING_DISPATCH_STATE,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
this.initialized = true;
|
|
405
|
+
}
|
|
406
|
+
listProject(projectId) {
|
|
407
|
+
this.ensureInitialized();
|
|
408
|
+
return {
|
|
409
|
+
projectId,
|
|
410
|
+
items: this.state.items
|
|
411
|
+
.filter((item) => item.projectId === projectId)
|
|
412
|
+
.map(summarizeItem),
|
|
413
|
+
dispatchState: this.state.dispatchState,
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
listAll() {
|
|
417
|
+
this.ensureInitialized();
|
|
418
|
+
return this.state.items.map(summarizeItem);
|
|
419
|
+
}
|
|
420
|
+
getDispatchState() {
|
|
421
|
+
this.ensureInitialized();
|
|
422
|
+
return this.state.dispatchState;
|
|
423
|
+
}
|
|
424
|
+
isDispatchPaused() {
|
|
425
|
+
this.ensureInitialized();
|
|
426
|
+
return this.state.dispatchState.status === "paused";
|
|
427
|
+
}
|
|
428
|
+
getProjectIdsWithDispatchableItems() {
|
|
429
|
+
this.ensureInitialized();
|
|
430
|
+
if (this.isDispatchPaused())
|
|
431
|
+
return [];
|
|
432
|
+
const projectIds = new Set();
|
|
433
|
+
for (const item of this.state.items) {
|
|
434
|
+
if (projectIds.has(item.projectId))
|
|
435
|
+
continue;
|
|
436
|
+
const first = this.state.items.find((candidate) => candidate.projectId === item.projectId);
|
|
437
|
+
if (first?.status === "queued") {
|
|
438
|
+
projectIds.add(item.projectId);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return [...projectIds];
|
|
442
|
+
}
|
|
443
|
+
hasDispatchableItem(projectId) {
|
|
444
|
+
this.ensureInitialized();
|
|
445
|
+
if (this.isDispatchPaused())
|
|
446
|
+
return false;
|
|
447
|
+
return (this.state.items.find((item) => item.projectId === projectId)?.status ===
|
|
448
|
+
"queued");
|
|
449
|
+
}
|
|
450
|
+
async pauseDispatch(reason = "manual") {
|
|
451
|
+
return this.withMutation(async () => {
|
|
452
|
+
this.ensureInitialized();
|
|
453
|
+
if (this.state.items.length === 0) {
|
|
454
|
+
throw new ProjectQueueValidationError("Cannot pause an empty Project Queue");
|
|
455
|
+
}
|
|
456
|
+
this.state.dispatchState = {
|
|
457
|
+
status: "paused",
|
|
458
|
+
reason,
|
|
459
|
+
pausedAt: new Date().toISOString(),
|
|
460
|
+
};
|
|
461
|
+
await this.save();
|
|
462
|
+
this.emitAllProjectChanges("paused");
|
|
463
|
+
return this.state.dispatchState;
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
async resumeDispatch() {
|
|
467
|
+
return this.withMutation(async () => {
|
|
468
|
+
this.ensureInitialized();
|
|
469
|
+
this.state.dispatchState = RUNNING_DISPATCH_STATE;
|
|
470
|
+
await this.save();
|
|
471
|
+
this.emitAllProjectChanges("resumed");
|
|
472
|
+
return this.state.dispatchState;
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
async createItem(params) {
|
|
476
|
+
return this.withMutation(async () => {
|
|
477
|
+
this.ensureInitialized();
|
|
478
|
+
const now = new Date().toISOString();
|
|
479
|
+
const itemId = randomUUID();
|
|
480
|
+
const message = await this.prepareMessageForItem(itemId, normalizeMessage(params.request.message));
|
|
481
|
+
const item = {
|
|
482
|
+
id: itemId,
|
|
483
|
+
projectId: params.projectId,
|
|
484
|
+
projectPath: params.projectPath,
|
|
485
|
+
target: normalizeTarget(params.request.target),
|
|
486
|
+
message,
|
|
487
|
+
createdAt: now,
|
|
488
|
+
updatedAt: now,
|
|
489
|
+
createdFrom: normalizeCreatedFrom(params.request.createdFrom),
|
|
490
|
+
status: "queued",
|
|
491
|
+
};
|
|
492
|
+
this.state.items.push(item);
|
|
493
|
+
await this.save();
|
|
494
|
+
this.emitChange(params.projectId, "created", item.id);
|
|
495
|
+
return summarizeItem(item);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
async updateItem(projectId, itemId, request) {
|
|
499
|
+
return this.withMutation(async () => {
|
|
500
|
+
this.ensureInitialized();
|
|
501
|
+
const index = this.findProjectItemIndex(projectId, itemId);
|
|
502
|
+
if (index === -1)
|
|
503
|
+
return null;
|
|
504
|
+
const existing = this.state.items[index];
|
|
505
|
+
if (existing.status === "dispatching") {
|
|
506
|
+
throw new ProjectQueueValidationError("Cannot update an item while it is dispatching");
|
|
507
|
+
}
|
|
508
|
+
const updated = {
|
|
509
|
+
...existing,
|
|
510
|
+
...(request.target !== undefined
|
|
511
|
+
? { target: normalizeTarget(request.target) }
|
|
512
|
+
: {}),
|
|
513
|
+
...(request.message !== undefined
|
|
514
|
+
? {
|
|
515
|
+
message: await this.prepareMessageForItem(existing.id, normalizeMessage(request.message), existing.message.stagedAttachments),
|
|
516
|
+
}
|
|
517
|
+
: {}),
|
|
518
|
+
status: existing.status === "failed" ? "queued" : existing.status,
|
|
519
|
+
lastError: undefined,
|
|
520
|
+
updatedAt: new Date().toISOString(),
|
|
521
|
+
};
|
|
522
|
+
this.state.items[index] = updated;
|
|
523
|
+
await this.save();
|
|
524
|
+
if (request.message !== undefined) {
|
|
525
|
+
await this.cleanupReplacedQueueAttachments(existing.id, existing.message.stagedAttachments, updated.message.stagedAttachments);
|
|
526
|
+
}
|
|
527
|
+
this.emitChange(projectId, "updated", itemId);
|
|
528
|
+
return summarizeItem(updated);
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
async deleteItem(projectId, itemId) {
|
|
532
|
+
return this.withMutation(async () => {
|
|
533
|
+
this.ensureInitialized();
|
|
534
|
+
const index = this.findProjectItemIndex(projectId, itemId);
|
|
535
|
+
if (index === -1)
|
|
536
|
+
return false;
|
|
537
|
+
if (this.state.items[index]?.status === "dispatching") {
|
|
538
|
+
throw new ProjectQueueValidationError("Cannot delete an item while it is dispatching");
|
|
539
|
+
}
|
|
540
|
+
const [deleted] = this.state.items.splice(index, 1);
|
|
541
|
+
this.clearDispatchPauseIfEmpty();
|
|
542
|
+
await this.save();
|
|
543
|
+
await this.cleanupQueueAttachments(deleted);
|
|
544
|
+
this.emitChange(projectId, "deleted", itemId);
|
|
545
|
+
return true;
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
async retryItem(projectId, itemId) {
|
|
549
|
+
return this.withMutation(async () => {
|
|
550
|
+
this.ensureInitialized();
|
|
551
|
+
const index = this.findProjectItemIndex(projectId, itemId);
|
|
552
|
+
if (index === -1)
|
|
553
|
+
return null;
|
|
554
|
+
const existing = this.state.items[index];
|
|
555
|
+
if (existing.status === "dispatching") {
|
|
556
|
+
throw new ProjectQueueValidationError("Cannot retry an item while it is dispatching");
|
|
557
|
+
}
|
|
558
|
+
const updated = {
|
|
559
|
+
...existing,
|
|
560
|
+
status: "queued",
|
|
561
|
+
lastError: undefined,
|
|
562
|
+
updatedAt: new Date().toISOString(),
|
|
563
|
+
};
|
|
564
|
+
this.state.items[index] = updated;
|
|
565
|
+
await this.save();
|
|
566
|
+
this.emitChange(projectId, "retry", itemId);
|
|
567
|
+
return summarizeItem(updated);
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
async moveItemToTop(projectId, itemId) {
|
|
571
|
+
return this.withMutation(async () => {
|
|
572
|
+
this.ensureInitialized();
|
|
573
|
+
const index = this.findProjectItemIndex(projectId, itemId);
|
|
574
|
+
if (index === -1)
|
|
575
|
+
return null;
|
|
576
|
+
const existing = this.state.items[index];
|
|
577
|
+
if (existing.status === "dispatching") {
|
|
578
|
+
throw new ProjectQueueValidationError("Cannot reorder an item while it is dispatching");
|
|
579
|
+
}
|
|
580
|
+
const projectIndexes = this.getProjectItemIndexes(projectId);
|
|
581
|
+
const projectItems = projectIndexes.map((projectIndex) => this.state.items[projectIndex]);
|
|
582
|
+
const originalIds = projectItems.map((item) => item.id);
|
|
583
|
+
const projectItemIndex = projectItems.findIndex((item) => item.id === itemId);
|
|
584
|
+
if (projectItemIndex === -1)
|
|
585
|
+
return null;
|
|
586
|
+
const [removed] = projectItems.splice(projectItemIndex, 1);
|
|
587
|
+
const moved = {
|
|
588
|
+
...removed,
|
|
589
|
+
updatedAt: new Date().toISOString(),
|
|
590
|
+
};
|
|
591
|
+
const firstMovableIndex = projectItems.findIndex((item) => item.status !== "dispatching");
|
|
592
|
+
projectItems.splice(firstMovableIndex === -1 ? projectItems.length : firstMovableIndex, 0, moved);
|
|
593
|
+
const reordered = projectItems.some((item, position) => item.id !== originalIds[position]);
|
|
594
|
+
if (!reordered) {
|
|
595
|
+
return summarizeItem(existing);
|
|
596
|
+
}
|
|
597
|
+
for (const [position, projectIndex] of projectIndexes.entries()) {
|
|
598
|
+
this.state.items[projectIndex] = projectItems[position];
|
|
599
|
+
}
|
|
600
|
+
await this.save();
|
|
601
|
+
this.emitChange(projectId, "reordered", itemId);
|
|
602
|
+
return summarizeItem(moved);
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
async claimNextDispatchableItem(projectId) {
|
|
606
|
+
return this.claimDispatchableItem(projectId);
|
|
607
|
+
}
|
|
608
|
+
async claimDispatchableItem(projectId, itemId) {
|
|
609
|
+
return this.withMutation(async () => {
|
|
610
|
+
this.ensureInitialized();
|
|
611
|
+
if (this.isDispatchPaused())
|
|
612
|
+
return null;
|
|
613
|
+
const index = itemId
|
|
614
|
+
? this.findProjectItemIndex(projectId, itemId)
|
|
615
|
+
: this.state.items.findIndex((item) => item.projectId === projectId);
|
|
616
|
+
if (index === -1)
|
|
617
|
+
return null;
|
|
618
|
+
const existing = this.state.items[index];
|
|
619
|
+
if (existing.status !== "queued")
|
|
620
|
+
return null;
|
|
621
|
+
const now = new Date().toISOString();
|
|
622
|
+
const updated = {
|
|
623
|
+
...existing,
|
|
624
|
+
status: "dispatching",
|
|
625
|
+
lastError: undefined,
|
|
626
|
+
lastAttemptAt: now,
|
|
627
|
+
updatedAt: now,
|
|
628
|
+
};
|
|
629
|
+
this.state.items[index] = updated;
|
|
630
|
+
await this.save();
|
|
631
|
+
this.emitChange(projectId, "dispatching", updated.id);
|
|
632
|
+
return cloneItem(updated);
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
async releaseDispatchingItem(projectId, itemId) {
|
|
636
|
+
return this.withMutation(async () => {
|
|
637
|
+
this.ensureInitialized();
|
|
638
|
+
const index = this.findProjectItemIndex(projectId, itemId);
|
|
639
|
+
if (index === -1)
|
|
640
|
+
return null;
|
|
641
|
+
const existing = this.state.items[index];
|
|
642
|
+
if (existing.status !== "dispatching")
|
|
643
|
+
return null;
|
|
644
|
+
const updated = {
|
|
645
|
+
...existing,
|
|
646
|
+
status: "queued",
|
|
647
|
+
lastError: undefined,
|
|
648
|
+
updatedAt: new Date().toISOString(),
|
|
649
|
+
};
|
|
650
|
+
this.state.items[index] = updated;
|
|
651
|
+
await this.save();
|
|
652
|
+
this.emitChange(projectId, "released", itemId);
|
|
653
|
+
return summarizeItem(updated);
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
async completeDispatch(projectId, itemId) {
|
|
657
|
+
return this.withMutation(async () => {
|
|
658
|
+
this.ensureInitialized();
|
|
659
|
+
const index = this.findProjectItemIndex(projectId, itemId);
|
|
660
|
+
if (index === -1)
|
|
661
|
+
return false;
|
|
662
|
+
const [completed] = this.state.items.splice(index, 1);
|
|
663
|
+
this.clearDispatchPauseIfEmpty();
|
|
664
|
+
await this.save();
|
|
665
|
+
await this.cleanupQueueAttachments(completed);
|
|
666
|
+
this.emitChange(projectId, "promoted", itemId);
|
|
667
|
+
return true;
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
async failDispatch(projectId, itemId, error) {
|
|
671
|
+
return this.withMutation(async () => {
|
|
672
|
+
this.ensureInitialized();
|
|
673
|
+
const index = this.findProjectItemIndex(projectId, itemId);
|
|
674
|
+
if (index === -1)
|
|
675
|
+
return null;
|
|
676
|
+
const existing = this.state.items[index];
|
|
677
|
+
const now = new Date().toISOString();
|
|
678
|
+
const updated = {
|
|
679
|
+
...existing,
|
|
680
|
+
status: "failed",
|
|
681
|
+
lastError: error,
|
|
682
|
+
lastAttemptAt: now,
|
|
683
|
+
updatedAt: now,
|
|
684
|
+
};
|
|
685
|
+
this.state.items[index] = updated;
|
|
686
|
+
await this.save();
|
|
687
|
+
this.emitChange(projectId, "failed", itemId);
|
|
688
|
+
return summarizeItem(updated);
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
getFilePath() {
|
|
692
|
+
return this.filePath;
|
|
693
|
+
}
|
|
694
|
+
findProjectItemIndex(projectId, itemId) {
|
|
695
|
+
return this.state.items.findIndex((item) => item.projectId === projectId && item.id === itemId);
|
|
696
|
+
}
|
|
697
|
+
getProjectItemIndexes(projectId) {
|
|
698
|
+
const indexes = [];
|
|
699
|
+
for (const [index, item] of this.state.items.entries()) {
|
|
700
|
+
if (item.projectId === projectId)
|
|
701
|
+
indexes.push(index);
|
|
702
|
+
}
|
|
703
|
+
return indexes;
|
|
704
|
+
}
|
|
705
|
+
clearDispatchPauseIfEmpty() {
|
|
706
|
+
if (this.state.items.length > 0)
|
|
707
|
+
return;
|
|
708
|
+
this.state.dispatchState = RUNNING_DISPATCH_STATE;
|
|
709
|
+
}
|
|
710
|
+
getProjectIdsWithItems() {
|
|
711
|
+
return [...new Set(this.state.items.map((item) => item.projectId))];
|
|
712
|
+
}
|
|
713
|
+
ensureInitialized() {
|
|
714
|
+
if (!this.initialized) {
|
|
715
|
+
throw new Error("ProjectQueueService not initialized. Call initialize() first.");
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
async withMutation(fn) {
|
|
719
|
+
const run = this.mutationQueue.then(fn, fn);
|
|
720
|
+
this.mutationQueue = run.then(() => undefined, () => undefined);
|
|
721
|
+
return run;
|
|
722
|
+
}
|
|
723
|
+
async save() {
|
|
724
|
+
const tmpPath = `${this.filePath}.tmp`;
|
|
725
|
+
await fs.mkdir(this.dataDir, { recursive: true });
|
|
726
|
+
await fs.writeFile(tmpPath, JSON.stringify(this.state, null, 2));
|
|
727
|
+
await fs.rename(tmpPath, this.filePath);
|
|
728
|
+
}
|
|
729
|
+
async prepareMessageForItem(itemId, message, existingStagedAttachments) {
|
|
730
|
+
if (!message.stagedAttachments) {
|
|
731
|
+
return message;
|
|
732
|
+
}
|
|
733
|
+
const stagedAttachments = await this.prepareStagedAttachmentsForItem(itemId, message.stagedAttachments, existingStagedAttachments);
|
|
734
|
+
return {
|
|
735
|
+
...message,
|
|
736
|
+
stagedAttachments,
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
async prepareStagedAttachmentsForItem(itemId, stagedAttachments, existingStagedAttachments) {
|
|
740
|
+
const staging = this.attachmentStagingService;
|
|
741
|
+
if (!staging) {
|
|
742
|
+
throw new ProjectQueueValidationError("message.stagedAttachments is not supported");
|
|
743
|
+
}
|
|
744
|
+
const refsMatchExisting = existingStagedAttachments !== undefined &&
|
|
745
|
+
existingStagedAttachments.batchId === stagedAttachments.batchId &&
|
|
746
|
+
existingStagedAttachments.refs.length === stagedAttachments.refs.length &&
|
|
747
|
+
existingStagedAttachments.refs.every((ref, index) => ref.id === stagedAttachments.refs[index]?.id);
|
|
748
|
+
try {
|
|
749
|
+
const refs = refsMatchExisting
|
|
750
|
+
? await staging.validateQueueRefs(itemId, stagedAttachments.refs)
|
|
751
|
+
: await staging.transferDraftAttachmentsToQueue({
|
|
752
|
+
batchId: stagedAttachments.batchId,
|
|
753
|
+
queueItemId: itemId,
|
|
754
|
+
refs: stagedAttachments.refs,
|
|
755
|
+
});
|
|
756
|
+
const batchId = refs[0]?.batchId ?? stagedAttachments.batchId;
|
|
757
|
+
return {
|
|
758
|
+
batchId,
|
|
759
|
+
refs,
|
|
760
|
+
updatedAt: new Date().toISOString(),
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
catch (error) {
|
|
764
|
+
throw new ProjectQueueValidationError(`message.stagedAttachments is invalid: ${errorMessage(error)}`);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
async cleanupQueueAttachments(item) {
|
|
768
|
+
if (!item?.message.stagedAttachments || !this.attachmentStagingService) {
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
await this.attachmentStagingService.deleteQueueAttachments(item.id);
|
|
772
|
+
}
|
|
773
|
+
async cleanupReplacedQueueAttachments(itemId, previous, next) {
|
|
774
|
+
if (!previous || !this.attachmentStagingService) {
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
const keptIds = new Set(next?.refs.map((ref) => ref.id) ?? []);
|
|
778
|
+
for (const ref of previous.refs) {
|
|
779
|
+
if (keptIds.has(ref.id))
|
|
780
|
+
continue;
|
|
781
|
+
const record = this.attachmentStagingService.getRecord(ref.id);
|
|
782
|
+
if (record?.owner.type === "project-queue" &&
|
|
783
|
+
record.owner.queueItemId === itemId) {
|
|
784
|
+
await this.attachmentStagingService.deleteAttachment(ref.id);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
emitChange(projectId, reason, itemId) {
|
|
789
|
+
const event = {
|
|
790
|
+
type: "project-queue-changed",
|
|
791
|
+
projectId,
|
|
792
|
+
items: this.listProject(projectId).items,
|
|
793
|
+
reason,
|
|
794
|
+
...(itemId ? { itemId } : {}),
|
|
795
|
+
dispatchState: this.state.dispatchState,
|
|
796
|
+
timestamp: new Date().toISOString(),
|
|
797
|
+
};
|
|
798
|
+
this.options.eventBus?.emit(event);
|
|
799
|
+
}
|
|
800
|
+
emitAllProjectChanges(reason) {
|
|
801
|
+
for (const projectId of this.getProjectIdsWithItems()) {
|
|
802
|
+
this.emitChange(projectId, reason);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
//# sourceMappingURL=ProjectQueueService.js.map
|