@withbuddi/buddi 0.1.0-pre.19 → 0.1.0-pre.21
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 +1 -1
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/args.d.ts +6 -0
- package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/args.js +15 -0
- package/node_modules/@buddi/cli/dist/args.js.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.js +18 -1
- package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
- package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/main.js +19 -2
- package/node_modules/@buddi/cli/dist/main.js.map +1 -1
- package/node_modules/@buddi/cli/dist/status.d.ts +10 -0
- package/node_modules/@buddi/cli/dist/status.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/status.js +4 -0
- package/node_modules/@buddi/cli/dist/status.js.map +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js +7 -1
- package/node_modules/@buddi/core/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.js +33 -16
- package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/types.d.ts +17 -0
- package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.js +1 -0
- package/node_modules/@buddi/core/dist/pages/__fixtures__/demo.js.map +1 -1
- package/node_modules/@buddi/core/dist/pages.d.ts +74 -0
- package/node_modules/@buddi/core/dist/pages.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/pages.js +27 -1
- package/node_modules/@buddi/core/dist/pages.js.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.d.ts +2 -2
- package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/version.d.ts +1 -1
- package/node_modules/@buddi/core/dist/plugin/version.js +1 -1
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts +15 -1
- package/node_modules/@buddi/core/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/provider-accounts.js +22 -1
- package/node_modules/@buddi/core/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/core/dist/provider.d.ts +6 -0
- package/node_modules/@buddi/core/dist/provider.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/provider.js.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.d.ts +11 -0
- package/node_modules/@buddi/core/dist/surfaces.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/surfaces.js +4 -0
- package/node_modules/@buddi/core/dist/surfaces.js.map +1 -1
- package/node_modules/@buddi/core/migrations/046_ollama_device_key.sql +7 -0
- package/node_modules/@buddi/core/migrations/047_reported_context_windows.sql +5 -0
- package/node_modules/@buddi/core/migrations/048_surface_chat_voice.sql +13 -0
- package/node_modules/@buddi/core/migrations/049_surface_chat_voice_form.sql +8 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/agents-cli.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents-cli.js +5 -3
- package/node_modules/@buddi/gateway/dist/agents-cli.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/session.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/session.js +2 -2
- package/node_modules/@buddi/gateway/dist/chat/session.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/usage.d.ts +16 -0
- package/node_modules/@buddi/gateway/dist/chat/usage.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/usage.js +53 -11
- package/node_modules/@buddi/gateway/dist/chat/usage.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/codex-accounts.d.ts +24 -11
- package/node_modules/@buddi/gateway/dist/codex-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/codex-accounts.js +151 -215
- package/node_modules/@buddi/gateway/dist/codex-accounts.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/index.js +2 -0
- package/node_modules/@buddi/gateway/dist/index.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/ollama-accounts.d.ts +87 -0
- package/node_modules/@buddi/gateway/dist/ollama-accounts.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/ollama-accounts.js +179 -0
- package/node_modules/@buddi/gateway/dist/ollama-accounts.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts +51 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/provider-accounts.js +184 -25
- package/node_modules/@buddi/gateway/dist/provider-accounts.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/speech-cli.d.ts +43 -0
- package/node_modules/@buddi/gateway/dist/speech-cli.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/speech-cli.js +105 -0
- package/node_modules/@buddi/gateway/dist/speech-cli.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/surfaces/context-budget.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/context-budget.js +10 -3
- package/node_modules/@buddi/gateway/dist/surfaces/context-budget.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/api.d.ts +10 -0
- package/node_modules/@buddi/gateway/dist/telegram/api.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/api.js +12 -0
- package/node_modules/@buddi/gateway/dist/telegram/api.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.d.ts +2 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js +4 -2
- package/node_modules/@buddi/gateway/dist/telegram/browser-view.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/main.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/main.js +10 -2
- package/node_modules/@buddi/gateway/dist/telegram/main.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts +25 -0
- package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.js +212 -10
- package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/voice.d.ts +112 -0
- package/node_modules/@buddi/gateway/dist/telegram/voice.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/telegram/voice.js +220 -0
- package/node_modules/@buddi/gateway/dist/telegram/voice.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/chat.d.ts +31 -8
- package/node_modules/@buddi/gateway/dist/web/chat.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/chat.js +3 -2
- package/node_modules/@buddi/gateway/dist/web/chat.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts +13 -2
- package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js +24 -3
- package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.d.ts +15 -12
- package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.js +9 -10
- package/node_modules/@buddi/gateway/dist/web/read.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +29 -13
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/speech.d.ts +47 -0
- package/node_modules/@buddi/gateway/dist/web/speech.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/speech.js +83 -0
- package/node_modules/@buddi/gateway/dist/web/speech.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/stream.d.ts +0 -24
- package/node_modules/@buddi/gateway/dist/web/stream.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/stream.js +26 -2
- package/node_modules/@buddi/gateway/dist/web/stream.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/usage-view.d.ts +15 -0
- package/node_modules/@buddi/gateway/dist/web/usage-view.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/usage-view.js +20 -0
- package/node_modules/@buddi/gateway/dist/web/usage-view.js.map +1 -0
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts +18 -0
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.js +65 -13
- package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/codex-direct.d.ts +55 -0
- package/node_modules/@buddi/runtime/dist/codex-direct.d.ts.map +1 -0
- package/node_modules/@buddi/runtime/dist/codex-direct.js +342 -0
- package/node_modules/@buddi/runtime/dist/codex-direct.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/codex-oauth.d.ts +66 -0
- package/node_modules/@buddi/runtime/dist/codex-oauth.d.ts.map +1 -0
- package/node_modules/@buddi/runtime/dist/codex-oauth.js +210 -0
- package/node_modules/@buddi/runtime/dist/codex-oauth.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/codex-profile.d.ts +19 -0
- package/node_modules/@buddi/runtime/dist/codex-profile.d.ts.map +1 -0
- package/node_modules/@buddi/runtime/dist/codex-profile.js +99 -0
- package/node_modules/@buddi/runtime/dist/codex-profile.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/context-window.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/context-window.js +17 -4
- package/node_modules/@buddi/runtime/dist/context-window.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/delegate.d.ts +24 -0
- package/node_modules/@buddi/runtime/dist/delegate.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/delegate.js +87 -11
- package/node_modules/@buddi/runtime/dist/delegate.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/index.d.ts +4 -4
- package/node_modules/@buddi/runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/index.js +5 -5
- package/node_modules/@buddi/runtime/dist/index.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/loop.d.ts +7 -0
- package/node_modules/@buddi/runtime/dist/loop.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/loop.js +54 -8
- package/node_modules/@buddi/runtime/dist/loop.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/ollama-signing.d.ts +52 -0
- package/node_modules/@buddi/runtime/dist/ollama-signing.d.ts.map +1 -0
- package/node_modules/@buddi/runtime/dist/ollama-signing.js +154 -0
- package/node_modules/@buddi/runtime/dist/ollama-signing.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/openai.d.ts +16 -4
- package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/openai.js +44 -11
- package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/provider-models.d.ts +2 -0
- package/node_modules/@buddi/runtime/dist/provider-models.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/provider-models.js +13 -4
- package/node_modules/@buddi/runtime/dist/provider-models.js.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/computer.d.ts +53 -1
- package/node_modules/@buddi/tool-browser/dist/computer.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/computer.js +154 -5
- package/node_modules/@buddi/tool-browser/dist/computer.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +20 -3
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +170 -5
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +9 -1
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +14 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js +28 -5
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.d.ts +11 -0
- package/node_modules/@buddi/tool-browser/dist/types.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js +16 -3
- package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
- package/node_modules/@buddi/tool-browser/package.json +1 -1
- package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
- package/node_modules/imapflow/CHANGELOG.md +29 -0
- package/node_modules/imapflow/dist/cjs/commands/append.js +12 -12
- package/node_modules/imapflow/dist/cjs/commands/authenticate.d.ts +3 -8
- package/node_modules/imapflow/dist/cjs/commands/close.js +2 -1
- package/node_modules/imapflow/dist/cjs/commands/copy.js +4 -4
- package/node_modules/imapflow/dist/cjs/commands/create.js +2 -3
- package/node_modules/imapflow/dist/cjs/commands/delete.js +4 -4
- package/node_modules/imapflow/dist/cjs/commands/expunge.js +8 -5
- package/node_modules/imapflow/dist/cjs/commands/fetch.js +12 -10
- package/node_modules/imapflow/dist/cjs/commands/idle.js +6 -2
- package/node_modules/imapflow/dist/cjs/commands/list.js +22 -18
- package/node_modules/imapflow/dist/cjs/commands/move.js +11 -6
- package/node_modules/imapflow/dist/cjs/commands/namespace.js +1 -1
- package/node_modules/imapflow/dist/cjs/commands/quota.js +10 -9
- package/node_modules/imapflow/dist/cjs/commands/rename.js +4 -4
- package/node_modules/imapflow/dist/cjs/commands/search.js +7 -8
- package/node_modules/imapflow/dist/cjs/commands/select.js +12 -9
- package/node_modules/imapflow/dist/cjs/commands/status.js +11 -11
- package/node_modules/imapflow/dist/cjs/commands/store.js +5 -5
- package/node_modules/imapflow/dist/cjs/commands/subscribe.js +2 -17
- package/node_modules/imapflow/dist/cjs/commands/subscription.d.ts +10 -0
- package/node_modules/imapflow/dist/cjs/commands/subscription.js +29 -0
- package/node_modules/imapflow/dist/cjs/commands/unsubscribe.js +2 -17
- package/node_modules/imapflow/dist/cjs/download.d.ts +22 -0
- package/node_modules/imapflow/dist/cjs/download.js +588 -0
- package/node_modules/imapflow/dist/cjs/errors.d.ts +50 -1
- package/node_modules/imapflow/dist/cjs/errors.js +53 -1
- package/node_modules/imapflow/dist/cjs/handler/imap-compiler.js +1 -1
- package/node_modules/imapflow/dist/cjs/handler/imap-stream.d.ts +13 -2
- package/node_modules/imapflow/dist/cjs/handler/imap-stream.js +51 -30
- package/node_modules/imapflow/dist/cjs/handler/parser-instance.js +2 -2
- package/node_modules/imapflow/dist/cjs/handler/token-parser.js +15 -9
- package/node_modules/imapflow/dist/cjs/imap-flow.d.ts +30 -84
- package/node_modules/imapflow/dist/cjs/imap-flow.js +282 -734
- package/node_modules/imapflow/dist/cjs/jp-decoder.js +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.js +3 -3
- package/node_modules/imapflow/dist/cjs/search-compiler.js +5 -12
- package/node_modules/imapflow/dist/cjs/tools.d.ts +52 -11
- package/node_modules/imapflow/dist/cjs/tools.js +86 -23
- package/node_modules/imapflow/dist/cjs/types.d.ts +30 -16
- package/node_modules/imapflow/dist/esm/commands/append.js +13 -13
- package/node_modules/imapflow/dist/esm/commands/authenticate.d.ts +3 -8
- package/node_modules/imapflow/dist/esm/commands/close.js +2 -1
- package/node_modules/imapflow/dist/esm/commands/copy.js +5 -5
- package/node_modules/imapflow/dist/esm/commands/create.js +3 -4
- package/node_modules/imapflow/dist/esm/commands/delete.js +5 -5
- package/node_modules/imapflow/dist/esm/commands/expunge.js +9 -6
- package/node_modules/imapflow/dist/esm/commands/fetch.js +13 -11
- package/node_modules/imapflow/dist/esm/commands/idle.js +7 -3
- package/node_modules/imapflow/dist/esm/commands/list.js +22 -18
- package/node_modules/imapflow/dist/esm/commands/move.js +12 -7
- package/node_modules/imapflow/dist/esm/commands/namespace.js +2 -2
- package/node_modules/imapflow/dist/esm/commands/quota.js +11 -10
- package/node_modules/imapflow/dist/esm/commands/rename.js +5 -5
- package/node_modules/imapflow/dist/esm/commands/search.js +8 -9
- package/node_modules/imapflow/dist/esm/commands/select.js +13 -10
- package/node_modules/imapflow/dist/esm/commands/status.js +12 -12
- package/node_modules/imapflow/dist/esm/commands/store.js +6 -6
- package/node_modules/imapflow/dist/esm/commands/subscribe.js +2 -17
- package/node_modules/imapflow/dist/esm/commands/subscription.d.ts +10 -0
- package/node_modules/imapflow/dist/esm/commands/subscription.js +26 -0
- package/node_modules/imapflow/dist/esm/commands/unsubscribe.js +2 -17
- package/node_modules/imapflow/dist/esm/download.d.ts +22 -0
- package/node_modules/imapflow/dist/esm/download.js +581 -0
- package/node_modules/imapflow/dist/esm/errors.d.ts +50 -1
- package/node_modules/imapflow/dist/esm/errors.js +52 -0
- package/node_modules/imapflow/dist/esm/handler/imap-compiler.js +1 -1
- package/node_modules/imapflow/dist/esm/handler/imap-stream.d.ts +13 -2
- package/node_modules/imapflow/dist/esm/handler/imap-stream.js +51 -30
- package/node_modules/imapflow/dist/esm/handler/parser-instance.js +2 -2
- package/node_modules/imapflow/dist/esm/handler/token-parser.js +15 -9
- package/node_modules/imapflow/dist/esm/imap-flow.d.ts +30 -84
- package/node_modules/imapflow/dist/esm/imap-flow.js +282 -735
- package/node_modules/imapflow/dist/esm/jp-decoder.js +1 -1
- package/node_modules/imapflow/dist/esm/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/package-info.js +3 -3
- package/node_modules/imapflow/dist/esm/search-compiler.js +5 -12
- package/node_modules/imapflow/dist/esm/tools.d.ts +52 -11
- package/node_modules/imapflow/dist/esm/tools.js +79 -21
- package/node_modules/imapflow/dist/esm/types.d.ts +30 -16
- package/node_modules/imapflow/package.json +4 -4
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/args.d.ts +6 -0
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +15 -0
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands.d.ts.map +1 -1
- package/packages/cli/dist/commands.js +18 -1
- package/packages/cli/dist/commands.js.map +1 -1
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +19 -2
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/status.d.ts +10 -0
- package/packages/cli/dist/status.d.ts.map +1 -1
- package/packages/cli/dist/status.js +4 -0
- package/packages/cli/dist/status.js.map +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/agents/catalog.d.ts.map +1 -1
- package/packages/core/dist/agents/catalog.js +7 -1
- package/packages/core/dist/agents/catalog.js.map +1 -1
- package/packages/core/dist/host/build.d.ts.map +1 -1
- package/packages/core/dist/host/build.js +33 -16
- package/packages/core/dist/host/build.js.map +1 -1
- package/packages/core/dist/host/types.d.ts +17 -0
- package/packages/core/dist/host/types.d.ts.map +1 -1
- package/packages/core/dist/pages/__fixtures__/demo.d.ts.map +1 -1
- package/packages/core/dist/pages/__fixtures__/demo.js +1 -0
- package/packages/core/dist/pages/__fixtures__/demo.js.map +1 -1
- package/packages/core/dist/pages.d.ts +74 -0
- package/packages/core/dist/pages.d.ts.map +1 -1
- package/packages/core/dist/pages.js +27 -1
- package/packages/core/dist/pages.js.map +1 -1
- package/packages/core/dist/plugin/index.d.ts +2 -2
- package/packages/core/dist/plugin/index.d.ts.map +1 -1
- package/packages/core/dist/plugin/version.d.ts +1 -1
- package/packages/core/dist/plugin/version.js +1 -1
- package/packages/core/dist/provider-accounts.d.ts +15 -1
- package/packages/core/dist/provider-accounts.d.ts.map +1 -1
- package/packages/core/dist/provider-accounts.js +22 -1
- package/packages/core/dist/provider-accounts.js.map +1 -1
- package/packages/core/dist/provider.d.ts +6 -0
- package/packages/core/dist/provider.d.ts.map +1 -1
- package/packages/core/dist/provider.js.map +1 -1
- package/packages/core/dist/surfaces.d.ts +11 -0
- package/packages/core/dist/surfaces.d.ts.map +1 -1
- package/packages/core/dist/surfaces.js +4 -0
- package/packages/core/dist/surfaces.js.map +1 -1
- package/packages/core/migrations/046_ollama_device_key.sql +7 -0
- package/packages/core/migrations/047_reported_context_windows.sql +5 -0
- package/packages/core/migrations/048_surface_chat_voice.sql +13 -0
- package/packages/core/migrations/049_surface_chat_voice_form.sql +8 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents-cli.d.ts +2 -0
- package/packages/gateway/dist/agents-cli.d.ts.map +1 -1
- package/packages/gateway/dist/agents-cli.js +5 -3
- package/packages/gateway/dist/agents-cli.js.map +1 -1
- package/packages/gateway/dist/chat/session.d.ts.map +1 -1
- package/packages/gateway/dist/chat/session.js +2 -2
- package/packages/gateway/dist/chat/session.js.map +1 -1
- package/packages/gateway/dist/chat/usage.d.ts +16 -0
- package/packages/gateway/dist/chat/usage.d.ts.map +1 -1
- package/packages/gateway/dist/chat/usage.js +53 -11
- package/packages/gateway/dist/chat/usage.js.map +1 -1
- package/packages/gateway/dist/codex-accounts.d.ts +24 -11
- package/packages/gateway/dist/codex-accounts.d.ts.map +1 -1
- package/packages/gateway/dist/codex-accounts.js +151 -215
- package/packages/gateway/dist/codex-accounts.js.map +1 -1
- package/packages/gateway/dist/index.d.ts +2 -0
- package/packages/gateway/dist/index.d.ts.map +1 -1
- package/packages/gateway/dist/index.js +2 -0
- package/packages/gateway/dist/index.js.map +1 -1
- package/packages/gateway/dist/ollama-accounts.d.ts +87 -0
- package/packages/gateway/dist/ollama-accounts.d.ts.map +1 -0
- package/packages/gateway/dist/ollama-accounts.js +179 -0
- package/packages/gateway/dist/ollama-accounts.js.map +1 -0
- package/packages/gateway/dist/provider-accounts.d.ts +51 -1
- package/packages/gateway/dist/provider-accounts.d.ts.map +1 -1
- package/packages/gateway/dist/provider-accounts.js +184 -25
- package/packages/gateway/dist/provider-accounts.js.map +1 -1
- package/packages/gateway/dist/speech-cli.d.ts +43 -0
- package/packages/gateway/dist/speech-cli.d.ts.map +1 -0
- package/packages/gateway/dist/speech-cli.js +105 -0
- package/packages/gateway/dist/speech-cli.js.map +1 -0
- package/packages/gateway/dist/surfaces/context-budget.d.ts.map +1 -1
- package/packages/gateway/dist/surfaces/context-budget.js +10 -3
- package/packages/gateway/dist/surfaces/context-budget.js.map +1 -1
- package/packages/gateway/dist/telegram/api.d.ts +10 -0
- package/packages/gateway/dist/telegram/api.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/api.js +12 -0
- package/packages/gateway/dist/telegram/api.js.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.d.ts +2 -1
- package/packages/gateway/dist/telegram/browser-view.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/browser-view.js +4 -2
- package/packages/gateway/dist/telegram/browser-view.js.map +1 -1
- package/packages/gateway/dist/telegram/main.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/main.js +10 -2
- package/packages/gateway/dist/telegram/main.js.map +1 -1
- package/packages/gateway/dist/telegram/surface.d.ts +25 -0
- package/packages/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/surface.js +212 -10
- package/packages/gateway/dist/telegram/surface.js.map +1 -1
- package/packages/gateway/dist/telegram/voice.d.ts +112 -0
- package/packages/gateway/dist/telegram/voice.d.ts.map +1 -0
- package/packages/gateway/dist/telegram/voice.js +220 -0
- package/packages/gateway/dist/telegram/voice.js.map +1 -0
- package/packages/gateway/dist/web/chat.d.ts +31 -8
- package/packages/gateway/dist/web/chat.d.ts.map +1 -1
- package/packages/gateway/dist/web/chat.js +3 -2
- package/packages/gateway/dist/web/chat.js.map +1 -1
- package/packages/gateway/dist/web/onboarding.d.ts +13 -2
- package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
- package/packages/gateway/dist/web/onboarding.js +24 -3
- package/packages/gateway/dist/web/onboarding.js.map +1 -1
- package/packages/gateway/dist/web/read.d.ts +15 -12
- package/packages/gateway/dist/web/read.d.ts.map +1 -1
- package/packages/gateway/dist/web/read.js +9 -10
- package/packages/gateway/dist/web/read.js.map +1 -1
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +29 -13
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/speech.d.ts +47 -0
- package/packages/gateway/dist/web/speech.d.ts.map +1 -0
- package/packages/gateway/dist/web/speech.js +83 -0
- package/packages/gateway/dist/web/speech.js.map +1 -0
- package/packages/gateway/dist/web/stream.d.ts +0 -24
- package/packages/gateway/dist/web/stream.d.ts.map +1 -1
- package/packages/gateway/dist/web/stream.js +26 -2
- package/packages/gateway/dist/web/stream.js.map +1 -1
- package/packages/gateway/dist/web/usage-view.d.ts +15 -0
- package/packages/gateway/dist/web/usage-view.d.ts.map +1 -0
- package/packages/gateway/dist/web/usage-view.js +20 -0
- package/packages/gateway/dist/web/usage-view.js.map +1 -0
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/anthropic.d.ts +18 -0
- package/packages/runtime/dist/anthropic.d.ts.map +1 -1
- package/packages/runtime/dist/anthropic.js +65 -13
- package/packages/runtime/dist/anthropic.js.map +1 -1
- package/packages/runtime/dist/codex-direct.d.ts +55 -0
- package/packages/runtime/dist/codex-direct.d.ts.map +1 -0
- package/packages/runtime/dist/codex-direct.js +342 -0
- package/packages/runtime/dist/codex-direct.js.map +1 -0
- package/packages/runtime/dist/codex-oauth.d.ts +66 -0
- package/packages/runtime/dist/codex-oauth.d.ts.map +1 -0
- package/packages/runtime/dist/codex-oauth.js +210 -0
- package/packages/runtime/dist/codex-oauth.js.map +1 -0
- package/packages/runtime/dist/codex-profile.d.ts +19 -0
- package/packages/runtime/dist/codex-profile.d.ts.map +1 -0
- package/packages/runtime/dist/codex-profile.js +99 -0
- package/packages/runtime/dist/codex-profile.js.map +1 -0
- package/packages/runtime/dist/context-window.d.ts.map +1 -1
- package/packages/runtime/dist/context-window.js +17 -4
- package/packages/runtime/dist/context-window.js.map +1 -1
- package/packages/runtime/dist/delegate.d.ts +24 -0
- package/packages/runtime/dist/delegate.d.ts.map +1 -1
- package/packages/runtime/dist/delegate.js +87 -11
- package/packages/runtime/dist/delegate.js.map +1 -1
- package/packages/runtime/dist/index.d.ts +4 -4
- package/packages/runtime/dist/index.d.ts.map +1 -1
- package/packages/runtime/dist/index.js +5 -5
- package/packages/runtime/dist/index.js.map +1 -1
- package/packages/runtime/dist/loop.d.ts +7 -0
- package/packages/runtime/dist/loop.d.ts.map +1 -1
- package/packages/runtime/dist/loop.js +54 -8
- package/packages/runtime/dist/loop.js.map +1 -1
- package/packages/runtime/dist/ollama-signing.d.ts +52 -0
- package/packages/runtime/dist/ollama-signing.d.ts.map +1 -0
- package/packages/runtime/dist/ollama-signing.js +154 -0
- package/packages/runtime/dist/ollama-signing.js.map +1 -0
- package/packages/runtime/dist/openai.d.ts +16 -4
- package/packages/runtime/dist/openai.d.ts.map +1 -1
- package/packages/runtime/dist/openai.js +44 -11
- package/packages/runtime/dist/openai.js.map +1 -1
- package/packages/runtime/dist/provider-models.d.ts +2 -0
- package/packages/runtime/dist/provider-models.d.ts.map +1 -1
- package/packages/runtime/dist/provider-models.js +13 -4
- package/packages/runtime/dist/provider-models.js.map +1 -1
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/computer.d.ts +53 -1
- package/packages/tools/browser/dist/computer.d.ts.map +1 -1
- package/packages/tools/browser/dist/computer.js +154 -5
- package/packages/tools/browser/dist/computer.js.map +1 -1
- package/packages/tools/browser/dist/controller.d.ts +20 -3
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +170 -5
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +9 -1
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/service.d.ts +14 -1
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js +28 -5
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/browser/dist/types.d.ts +11 -0
- package/packages/tools/browser/dist/types.d.ts.map +1 -1
- package/packages/tools/browser/dist/types.js +16 -3
- package/packages/tools/browser/dist/types.js.map +1 -1
- package/packages/tools/browser/package.json +1 -1
- package/packages/tools/email/dist/.tsbuildinfo +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/memory/dist/.tsbuildinfo +1 -1
- package/packages/tools/web/dist/.tsbuildinfo +1 -1
- package/packages/web/dist/assets/index-D5cRFcgm.css +1 -0
- package/packages/web/dist/assets/index-GCFB1vBV.js +125 -0
- package/packages/web/dist/index.html +2 -2
- package/node_modules/@buddi/runtime/dist/codex-app-server.d.ts +0 -20
- package/node_modules/@buddi/runtime/dist/codex-app-server.d.ts.map +0 -1
- package/node_modules/@buddi/runtime/dist/codex-app-server.js +0 -172
- package/node_modules/@buddi/runtime/dist/codex-app-server.js.map +0 -1
- package/node_modules/@buddi/runtime/dist/codex-policy.d.ts +0 -6
- package/node_modules/@buddi/runtime/dist/codex-policy.d.ts.map +0 -1
- package/node_modules/@buddi/runtime/dist/codex-policy.js +0 -79
- package/node_modules/@buddi/runtime/dist/codex-policy.js.map +0 -1
- package/node_modules/@buddi/runtime/dist/codex-rpc.d.ts +0 -34
- package/node_modules/@buddi/runtime/dist/codex-rpc.d.ts.map +0 -1
- package/node_modules/@buddi/runtime/dist/codex-rpc.js +0 -152
- package/node_modules/@buddi/runtime/dist/codex-rpc.js.map +0 -1
- package/node_modules/@buddi/runtime/dist/codex-session.d.ts +0 -30
- package/node_modules/@buddi/runtime/dist/codex-session.d.ts.map +0 -1
- package/node_modules/@buddi/runtime/dist/codex-session.js +0 -169
- package/node_modules/@buddi/runtime/dist/codex-session.js.map +0 -1
- package/packages/runtime/dist/codex-app-server.d.ts +0 -20
- package/packages/runtime/dist/codex-app-server.d.ts.map +0 -1
- package/packages/runtime/dist/codex-app-server.js +0 -172
- package/packages/runtime/dist/codex-app-server.js.map +0 -1
- package/packages/runtime/dist/codex-policy.d.ts +0 -6
- package/packages/runtime/dist/codex-policy.d.ts.map +0 -1
- package/packages/runtime/dist/codex-policy.js +0 -79
- package/packages/runtime/dist/codex-policy.js.map +0 -1
- package/packages/runtime/dist/codex-rpc.d.ts +0 -34
- package/packages/runtime/dist/codex-rpc.d.ts.map +0 -1
- package/packages/runtime/dist/codex-rpc.js +0 -152
- package/packages/runtime/dist/codex-rpc.js.map +0 -1
- package/packages/runtime/dist/codex-session.d.ts +0 -30
- package/packages/runtime/dist/codex-session.d.ts.map +0 -1
- package/packages/runtime/dist/codex-session.js +0 -169
- package/packages/runtime/dist/codex-session.js.map +0 -1
- package/packages/web/dist/assets/index-B727JQsO.css +0 -1
- package/packages/web/dist/assets/index-OA0xgibo.js +0 -123
|
@@ -12,23 +12,23 @@ const tools_js_1 = require("../tools.js");
|
|
|
12
12
|
* @returns Object with message count and list, or undefined if not in SELECTED state
|
|
13
13
|
*/
|
|
14
14
|
async function fetch(connection, range, query, options) {
|
|
15
|
-
|
|
15
|
+
let mailbox = (0, tools_js_1.getSelectedMailbox)(connection);
|
|
16
|
+
if (!mailbox || !range) {
|
|
16
17
|
// nothing to do here
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
options = options || {};
|
|
20
|
-
let mailbox = connection.mailbox;
|
|
21
21
|
// Use BINARY extension for fetching if supported and requested, otherwise fall back to BODY.
|
|
22
22
|
// RFC 9051 folds the FETCH side of the BINARY extension into base IMAP4rev2, so an active
|
|
23
23
|
// rev2 session can use it even without the BINARY capability token (the APPEND side is NOT
|
|
24
24
|
// folded in and stays gated on the token in append.ts)
|
|
25
25
|
const canUseBinary = connection.capabilities.has('BINARY') || (0, tools_js_1.isRev2Active)(connection);
|
|
26
26
|
const commandKey = canUseBinary && options.binary && !connection.disableBinary ? 'BINARY' : 'BODY';
|
|
27
|
-
// Retry logic for ETHROTTLE errors (server rate limiting) with exponential backoff
|
|
28
|
-
|
|
27
|
+
// Retry logic for ETHROTTLE errors (server rate limiting) with exponential backoff.
|
|
28
|
+
// Every pass returns or throws: the last throttled attempt throws instead of retrying.
|
|
29
29
|
const maxRetries = 4;
|
|
30
30
|
const baseDelay = 1000; // Start with 1 second delay
|
|
31
|
-
|
|
31
|
+
for (let retryCount = 0;; retryCount++) {
|
|
32
32
|
let messages = {
|
|
33
33
|
count: 0,
|
|
34
34
|
list: []
|
|
@@ -205,15 +205,18 @@ async function fetch(connection, range, query, options) {
|
|
|
205
205
|
return messages;
|
|
206
206
|
}
|
|
207
207
|
catch (err) {
|
|
208
|
-
|
|
208
|
+
// The last throttled attempt falls through and throws, so running out of retries
|
|
209
|
+
// is never mistaken for an empty result
|
|
210
|
+
if (err.code === 'ETHROTTLE' && retryCount < maxRetries - 1) {
|
|
209
211
|
// Server returned a throttle error (rate limiting). Retry with exponential backoff.
|
|
210
|
-
// Delay doubles each retry: 1s, 2s, 4s
|
|
212
|
+
// Delay doubles each retry: 1s, 2s, 4s.
|
|
211
213
|
// If server provides a throttleReset hint, use that if longer.
|
|
212
214
|
const backoffDelay = Math.min(baseDelay * Math.pow(2, retryCount), 30000); // Cap at 30 seconds
|
|
213
215
|
// Use throttle reset time if provided and longer than backoff. The hint is
|
|
214
216
|
// server-controlled, so the wait goes through connection.throttleWait(), which caps
|
|
215
|
-
// it and keeps the timer tracked and abortable.
|
|
216
|
-
|
|
217
|
+
// it and keeps the timer tracked and abortable. The connection already waited
|
|
218
|
+
// part of the back-off before rejecting (throttleWaited), so only the rest is left.
|
|
219
|
+
const delay = Math.max(err.throttleReset || 0, backoffDelay) - (err.throttleWaited || 0);
|
|
217
220
|
connection.log.warn({
|
|
218
221
|
msg: 'Retrying throttled request with exponential backoff',
|
|
219
222
|
cid: connection.id,
|
|
@@ -229,7 +232,6 @@ async function fetch(connection, range, query, options) {
|
|
|
229
232
|
if (aborted) {
|
|
230
233
|
throw connection.createNoConnectionError(connection.byeReason, { rejectedFrom: 'throttleAbort', command: 'FETCH' });
|
|
231
234
|
}
|
|
232
|
-
retryCount++;
|
|
233
235
|
continue;
|
|
234
236
|
}
|
|
235
237
|
connection.log.warn({ err, cid: connection.id });
|
|
@@ -124,7 +124,11 @@ async function runIdle(connection) {
|
|
|
124
124
|
}
|
|
125
125
|
catch (err) {
|
|
126
126
|
(0, tools_js_1.logConnectionError)(connection, 'IDLE session failed', err);
|
|
127
|
-
|
|
127
|
+
// A tagged NO or BAD only means the server refused IDLE; the connection is still usable,
|
|
128
|
+
// so the waiters are released by the finally block below and their own commands run.
|
|
129
|
+
// Anything else (close, lost socket, parser failure) fails the waiters too.
|
|
130
|
+
let refusedByServer = ['NO', 'BAD'].includes(err.responseStatus);
|
|
131
|
+
if (preCheckWaitQueue.length && !refusedByServer) {
|
|
128
132
|
// One error for the whole queue: every waiter failed at the same site, for the same
|
|
129
133
|
// reason. Built inside the guard so a teardown with nothing queued - the common case -
|
|
130
134
|
// does not pay for an Error and its stack capture.
|
|
@@ -240,7 +244,7 @@ async function runPollingFallback(connection, maxIdleTime) {
|
|
|
240
244
|
return;
|
|
241
245
|
}
|
|
242
246
|
// The transport or the mailbox may be gone by the time the timer fires
|
|
243
|
-
if (!connection.socket || connection.socket.destroyed ||
|
|
247
|
+
if (!connection.socket || connection.socket.destroyed || !(0, tools_js_1.getSelectedMailbox)(connection)) {
|
|
244
248
|
return cancel();
|
|
245
249
|
}
|
|
246
250
|
pollOnce(connection, session)
|
|
@@ -184,7 +184,7 @@ async function list(connection, reference, mailbox, options) {
|
|
|
184
184
|
entry.path = entry.path.slice(1);
|
|
185
185
|
}
|
|
186
186
|
// Build parent path hierarchy for tree construction and sorting
|
|
187
|
-
entry.parentPath = entry.delimiter && entry.path ? entry.path.
|
|
187
|
+
entry.parentPath = entry.delimiter && entry.path ? entry.path.substring(0, entry.path.lastIndexOf(entry.delimiter)) : '';
|
|
188
188
|
entry.parent = entry.delimiter ? entry.path.split(entry.delimiter) : [entry.path];
|
|
189
189
|
entry.name = entry.parent.pop();
|
|
190
190
|
// Try to detect special-use from server flags or well-known names
|
|
@@ -395,7 +395,7 @@ async function list(connection, reference, mailbox, options) {
|
|
|
395
395
|
if (entry.delimiter && entry.path.charAt(0) === entry.delimiter) {
|
|
396
396
|
entry.path = entry.path.slice(1);
|
|
397
397
|
}
|
|
398
|
-
entry.parentPath = entry.delimiter && entry.path ? entry.path.
|
|
398
|
+
entry.parentPath = entry.delimiter && entry.path ? entry.path.substring(0, entry.path.lastIndexOf(entry.delimiter)) : '';
|
|
399
399
|
entry.parent = entry.delimiter ? entry.path.split(entry.delimiter) : [entry.path];
|
|
400
400
|
entry.name = entry.parent.pop();
|
|
401
401
|
// Merge LSUB data into existing LIST entry if found
|
|
@@ -447,23 +447,27 @@ async function list(connection, reference, mailbox, options) {
|
|
|
447
447
|
connection.log.warn({ msg: 'Failed to request subscription info', err, cid: connection.id });
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
// Resolve special-use conflicts
|
|
451
|
-
//
|
|
452
|
-
//
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
450
|
+
// Resolve special-use conflicts. Each type goes to one mailbox and each mailbox gets
|
|
451
|
+
// at most one type. Candidates are taken in priority order across all types (user >
|
|
452
|
+
// extension > name, then alphabetically), so a mailbox claimed by a stronger match
|
|
453
|
+
// leaves its other type to that type's next candidate instead of to nobody.
|
|
454
|
+
let candidates = Object.entries(specialUseMatches).flatMap(([type, matches]) => matches.map(match => ({ type, ...match })));
|
|
455
|
+
candidates.sort((a, b) => {
|
|
456
|
+
let aSource = SOURCE_SORT_ORDER.indexOf(a.source);
|
|
457
|
+
let bSource = SOURCE_SORT_ORDER.indexOf(b.source);
|
|
458
|
+
if (aSource === bSource) {
|
|
459
|
+
return a.entry.path.localeCompare(b.entry.path);
|
|
460
|
+
}
|
|
461
|
+
return aSource - bSource;
|
|
462
|
+
});
|
|
463
|
+
let assignedTypes = new Set();
|
|
464
|
+
for (let { type, entry, source } of candidates) {
|
|
465
|
+
if (assignedTypes.has(type) || entry.specialUse) {
|
|
466
|
+
continue;
|
|
466
467
|
}
|
|
468
|
+
entry.specialUse = type;
|
|
469
|
+
entry.specialUseSource = PUBLIC_SOURCE[source] || source;
|
|
470
|
+
assignedTypes.add(type);
|
|
467
471
|
}
|
|
468
472
|
// No source answered, so "not subscribed" was never actually reported for any of
|
|
469
473
|
// these folders - the state is unknown, not false. Reporting the whole listing as
|
|
@@ -14,7 +14,8 @@ const copyuid_parser_js_1 = require("./copyuid-parser.js");
|
|
|
14
14
|
* @returns Move result with UID mapping if available, false on failure, or undefined if preconditions not met
|
|
15
15
|
*/
|
|
16
16
|
async function move(connection, range, destination, options) {
|
|
17
|
-
|
|
17
|
+
let mailbox = (0, tools_js_1.getSelectedMailbox)(connection);
|
|
18
|
+
if (!mailbox || !range || !destination) {
|
|
18
19
|
// nothing to do here
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
@@ -24,13 +25,18 @@ async function move(connection, range, destination, options) {
|
|
|
24
25
|
{ type: 'SEQUENCE', value: range },
|
|
25
26
|
{ type: 'ATOM', value: (0, tools_js_1.encodePath)(connection, destination) }
|
|
26
27
|
];
|
|
27
|
-
let map = { path:
|
|
28
|
+
let map = { path: mailbox.path, destination };
|
|
28
29
|
// Fallback for servers without the MOVE extension (RFC 6851):
|
|
29
30
|
// emulate MOVE using COPY + flag as \Deleted + EXPUNGE.
|
|
30
31
|
if (!(0, tools_js_1.hasCapability)(connection, 'MOVE')) {
|
|
31
32
|
let result = await connection.messageCopy(range, destination, options);
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
if (!result) {
|
|
34
|
+
// The source must stay untouched when the copy failed, otherwise the messages are lost
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
let deleted = await connection.messageDelete(range, Object.assign({ silent: true }, options));
|
|
38
|
+
// Messages that were copied but not removed from the source mean the move did not complete
|
|
39
|
+
return deleted ? result : false;
|
|
34
40
|
}
|
|
35
41
|
let response;
|
|
36
42
|
try {
|
|
@@ -48,8 +54,7 @@ async function move(connection, range, destination, options) {
|
|
|
48
54
|
return map;
|
|
49
55
|
}
|
|
50
56
|
catch (err) {
|
|
51
|
-
await (0, tools_js_1.
|
|
52
|
-
connection.log.warn({ err, cid: connection.id });
|
|
57
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
53
58
|
return false;
|
|
54
59
|
}
|
|
55
60
|
}
|
|
@@ -9,7 +9,7 @@ const tools_js_1 = require("../tools.js");
|
|
|
9
9
|
* @returns The primary personal namespace, or an error object on failure
|
|
10
10
|
*/
|
|
11
11
|
async function namespace(connection) {
|
|
12
|
-
if (!
|
|
12
|
+
if (!(0, tools_js_1.isAuthenticatedState)(connection)) {
|
|
13
13
|
// nothing to do here
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
@@ -10,7 +10,7 @@ const tools_js_1 = require("../tools.js");
|
|
|
10
10
|
* @returns Quota information object, false if QUOTA not supported or on failure, or undefined if preconditions not met
|
|
11
11
|
*/
|
|
12
12
|
async function quota(connection, path) {
|
|
13
|
-
if (!
|
|
13
|
+
if (!(0, tools_js_1.isAuthenticatedState)(connection) || !path) {
|
|
14
14
|
// nothing to do here
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
@@ -50,19 +50,21 @@ async function quota(connection, path) {
|
|
|
50
50
|
if ((0, tools_js_1.isUnsafeKey)(key) || key === 'path' || key === 'quotaroot') {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
let resource = map[key];
|
|
54
|
+
if (typeof resource !== 'object') {
|
|
55
|
+
resource = {};
|
|
56
|
+
map[key] = resource;
|
|
55
57
|
}
|
|
56
58
|
// Storage quota is reported in KB by IMAP; convert to bytes for consistency
|
|
57
59
|
const multiplier = key === 'storage' ? 1024 : 1;
|
|
58
60
|
if (position === 1) {
|
|
59
|
-
|
|
61
|
+
resource.usage = value * multiplier;
|
|
60
62
|
}
|
|
61
63
|
else if (position === 2) {
|
|
62
|
-
|
|
64
|
+
resource.limit = value * multiplier;
|
|
63
65
|
// Calculate usage percentage for convenient display
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
+
if (resource.limit) {
|
|
67
|
+
resource.status = Math.round(((resource.usage || 0) / resource.limit) * 100) + '%';
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
});
|
|
@@ -110,8 +112,7 @@ async function quota(connection, path) {
|
|
|
110
112
|
return map;
|
|
111
113
|
}
|
|
112
114
|
catch (err) {
|
|
113
|
-
await (0, tools_js_1.
|
|
114
|
-
connection.log.warn({ err, cid: connection.id });
|
|
115
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
115
116
|
return false;
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -12,7 +12,7 @@ const tools_js_1 = require("../tools.js");
|
|
|
12
12
|
* @throws If the RENAME command fails
|
|
13
13
|
*/
|
|
14
14
|
async function rename(connection, path, newPath) {
|
|
15
|
-
if (!
|
|
15
|
+
if (!(0, tools_js_1.isAuthenticatedState)(connection)) {
|
|
16
16
|
// nothing to do here
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
@@ -22,7 +22,8 @@ async function rename(connection, path, newPath) {
|
|
|
22
22
|
newPath = (0, tools_js_1.normalizePath)(connection, newPath);
|
|
23
23
|
// Must close/deselect the mailbox before renaming if it's currently selected,
|
|
24
24
|
// as IMAP servers will not rename an active mailbox.
|
|
25
|
-
|
|
25
|
+
let selected = (0, tools_js_1.getSelectedMailbox)(connection);
|
|
26
|
+
if (selected && selected.path === path) {
|
|
26
27
|
await connection.run('CLOSE');
|
|
27
28
|
}
|
|
28
29
|
let response;
|
|
@@ -39,8 +40,7 @@ async function rename(connection, path, newPath) {
|
|
|
39
40
|
return map;
|
|
40
41
|
}
|
|
41
42
|
catch (err) {
|
|
42
|
-
await (0, tools_js_1.
|
|
43
|
-
connection.log.warn({ err, cid: connection.id });
|
|
43
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
44
44
|
throw err;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -34,7 +34,8 @@ const stripEsearchPrefix = (attrs) => {
|
|
|
34
34
|
* When server lacks ESEARCH, falls back to plain SEARCH and returns number[].
|
|
35
35
|
*/
|
|
36
36
|
async function search(connection, query, options) {
|
|
37
|
-
|
|
37
|
+
const mailbox = (0, tools_js_1.getSelectedMailbox)(connection);
|
|
38
|
+
if (!mailbox) {
|
|
38
39
|
// nothing to do here
|
|
39
40
|
return false;
|
|
40
41
|
}
|
|
@@ -92,8 +93,7 @@ async function search(connection, query, options) {
|
|
|
92
93
|
return esearchResult;
|
|
93
94
|
}
|
|
94
95
|
catch (err) {
|
|
95
|
-
await (0, tools_js_1.
|
|
96
|
-
connection.log.warn({ err, cid: connection.id });
|
|
96
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -163,7 +163,7 @@ async function search(connection, query, options) {
|
|
|
163
163
|
// for message sequence numbers, while server-sent UID sets may
|
|
164
164
|
// not contain '*' at all (RFC 9051 section 4.1.1), so UID
|
|
165
165
|
// parts with '*' are dropped
|
|
166
|
-
let existsCount = () =>
|
|
166
|
+
let existsCount = () => mailbox.exists || 0;
|
|
167
167
|
// The mailbox EXISTS count is itself server-supplied and can be
|
|
168
168
|
// absurdly large, so the budget is additionally capped at the same
|
|
169
169
|
// absolute ceiling expandRange() uses - a hostile server cannot
|
|
@@ -188,8 +188,8 @@ async function search(connection, query, options) {
|
|
|
188
188
|
results.add(value);
|
|
189
189
|
continue;
|
|
190
190
|
}
|
|
191
|
-
let first = resolveId(part.
|
|
192
|
-
let second = resolveId(part.
|
|
191
|
+
let first = resolveId(part.substring(0, colon));
|
|
192
|
+
let second = resolveId(part.slice(colon + 1));
|
|
193
193
|
if (!(0, tools_js_1.isValidSequenceValue)(first) || !(0, tools_js_1.isValidSequenceValue)(second)) {
|
|
194
194
|
discarded = true;
|
|
195
195
|
continue;
|
|
@@ -219,8 +219,7 @@ async function search(connection, query, options) {
|
|
|
219
219
|
return Array.from(results).sort((a, b) => a - b);
|
|
220
220
|
}
|
|
221
221
|
catch (err) {
|
|
222
|
-
await (0, tools_js_1.
|
|
223
|
-
connection.log.warn({ err, cid: connection.id });
|
|
222
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
224
223
|
return false;
|
|
225
224
|
}
|
|
226
225
|
}
|
|
@@ -59,7 +59,7 @@ const VALUED_RESPONSE_CODES = Object.assign(Object.create(null), {
|
|
|
59
59
|
* @throws If the SELECT/EXAMINE command fails
|
|
60
60
|
*/
|
|
61
61
|
async function select(connection, pathInput, options) {
|
|
62
|
-
if (!
|
|
62
|
+
if (!(0, tools_js_1.isAuthenticatedState)(connection)) {
|
|
63
63
|
// nothing to do here
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -95,12 +95,16 @@ async function select(connection, pathInput, options) {
|
|
|
95
95
|
// QRESYNC (RFC 7162): allows efficient mailbox resynchronization by sending
|
|
96
96
|
// the last known UIDVALIDITY and HIGHESTMODSEQ. Server responds with only
|
|
97
97
|
// the changes (new flags, expunged UIDs) since that point.
|
|
98
|
+
// The caller may pass UIDVALIDITY as a bigint, a number or a string. It is parsed once,
|
|
99
|
+
// so the value that is sent is also the one checked against the server's below, and a
|
|
100
|
+
// value that is not a plain decimal skips QRESYNC instead of reaching the server.
|
|
101
|
+
let uidValidity = options.uidValidity !== undefined ? (0, tools_js_1.parseBigIntValue)(String(options.uidValidity)) : false;
|
|
98
102
|
let extraArgs = [];
|
|
99
|
-
if (connection.enabled.has('QRESYNC') && options.changedSince &&
|
|
103
|
+
if (connection.enabled.has('QRESYNC') && options.changedSince && uidValidity) {
|
|
100
104
|
extraArgs.push([
|
|
101
105
|
{ type: 'ATOM', value: 'QRESYNC' },
|
|
102
106
|
[
|
|
103
|
-
{ type: 'ATOM', value:
|
|
107
|
+
{ type: 'ATOM', value: uidValidity.toString() },
|
|
104
108
|
{ type: 'ATOM', value: options.changedSince.toString() }
|
|
105
109
|
]
|
|
106
110
|
]);
|
|
@@ -205,7 +209,7 @@ async function select(connection, pathInput, options) {
|
|
|
205
209
|
// QRESYNC results are only valid if UIDVALIDITY matches, HIGHESTMODSEQ is
|
|
206
210
|
// present, and the mailbox supports mod-sequences. If any condition fails,
|
|
207
211
|
// the client cannot trust the incremental updates and must do a full resync.
|
|
208
|
-
if (map.qresync && (
|
|
212
|
+
if (map.qresync && (uidValidity !== map.uidValidity || !map.highestModseq || map.noModseq)) {
|
|
209
213
|
map.qresync = false;
|
|
210
214
|
}
|
|
211
215
|
// Transition mailbox state: save previous mailbox reference, temporarily
|
|
@@ -215,7 +219,7 @@ async function select(connection, pathInput, options) {
|
|
|
215
219
|
// Emit mailboxClose if we're switching from a different mailbox.
|
|
216
220
|
// Re-selecting the same mailbox (e.g., for resync) does not trigger close/open.
|
|
217
221
|
if (currentMailbox && currentMailbox.path !== path) {
|
|
218
|
-
|
|
222
|
+
(0, tools_js_1.emitSafe)(connection, 'mailboxClose', currentMailbox);
|
|
219
223
|
}
|
|
220
224
|
connection.mailbox = map;
|
|
221
225
|
// Save the SELECT command for potential re-use (e.g., NOOP fallback polling
|
|
@@ -223,13 +227,13 @@ async function select(connection, pathInput, options) {
|
|
|
223
227
|
connection.currentSelectCommand = selectCommand;
|
|
224
228
|
connection.state = connection.states.SELECTED;
|
|
225
229
|
if (!currentMailbox || currentMailbox.path !== path) {
|
|
226
|
-
|
|
230
|
+
(0, tools_js_1.emitSafe)(connection, 'mailboxOpen', connection.mailbox);
|
|
227
231
|
}
|
|
228
232
|
response.next();
|
|
229
233
|
return map;
|
|
230
234
|
}
|
|
231
235
|
catch (err) {
|
|
232
|
-
await (0, tools_js_1.
|
|
236
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
233
237
|
// If SELECT/EXAMINE fails while a mailbox was already selected, we must
|
|
234
238
|
// reset to AUTHENTICATED state since the server has implicitly deselected
|
|
235
239
|
// the previous mailbox on failure (RFC 3501 Section 6.3.1).
|
|
@@ -239,10 +243,9 @@ async function select(connection, pathInput, options) {
|
|
|
239
243
|
connection.currentSelectCommand = false;
|
|
240
244
|
connection.state = connection.states.AUTHENTICATED;
|
|
241
245
|
if (currentMailbox) {
|
|
242
|
-
|
|
246
|
+
(0, tools_js_1.emitSafe)(connection, 'mailboxClose', currentMailbox);
|
|
243
247
|
}
|
|
244
248
|
}
|
|
245
|
-
connection.log.warn({ err, cid: connection.id });
|
|
246
249
|
throw err;
|
|
247
250
|
}
|
|
248
251
|
}
|
|
@@ -6,19 +6,18 @@ const status_fields_js_1 = require("./status-fields.js");
|
|
|
6
6
|
// STATUS fields that also refresh the live mailbox state when the queried mailbox is the
|
|
7
7
|
// currently selected one. Keyed by the output property name parseStatusList() reports.
|
|
8
8
|
const MAILBOX_UPDATERS = {
|
|
9
|
-
messages: (value, connection, path) => {
|
|
10
|
-
let mailbox = connection.mailbox;
|
|
9
|
+
messages: (value, mailbox, connection, path) => {
|
|
11
10
|
let prevCount = mailbox.exists;
|
|
12
11
|
if (prevCount !== value) {
|
|
13
12
|
mailbox.exists = value;
|
|
14
|
-
|
|
13
|
+
(0, tools_js_1.emitSafe)(connection, 'exists', { path, count: value, prevCount });
|
|
15
14
|
}
|
|
16
15
|
},
|
|
17
|
-
uidNext: (value,
|
|
18
|
-
|
|
16
|
+
uidNext: (value, mailbox) => {
|
|
17
|
+
mailbox.uidNext = value;
|
|
19
18
|
},
|
|
20
|
-
highestModseq: (value,
|
|
21
|
-
|
|
19
|
+
highestModseq: (value, mailbox) => {
|
|
20
|
+
mailbox.highestModseq = value;
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
/**
|
|
@@ -31,7 +30,7 @@ const MAILBOX_UPDATERS = {
|
|
|
31
30
|
* @throws {Error} If the mailbox does not exist
|
|
32
31
|
*/
|
|
33
32
|
async function status(connection, path, query) {
|
|
34
|
-
if (!
|
|
33
|
+
if (!(0, tools_js_1.isAuthenticatedState)(connection) || !path) {
|
|
35
34
|
// nothing to do here
|
|
36
35
|
return false;
|
|
37
36
|
}
|
|
@@ -62,7 +61,8 @@ async function status(connection, path, query) {
|
|
|
62
61
|
STATUS: async (untagged) => {
|
|
63
62
|
// If querying the currently selected mailbox, also update the
|
|
64
63
|
// connection's live mailbox state and emit events for changes.
|
|
65
|
-
let
|
|
64
|
+
let selected = (0, tools_js_1.getSelectedMailbox)(connection);
|
|
65
|
+
let currentMailbox = selected && selected.path === path ? selected : false;
|
|
66
66
|
let list = untagged.attributes && Array.isArray(untagged.attributes[1]) ? untagged.attributes[1] : false;
|
|
67
67
|
if (!list) {
|
|
68
68
|
return;
|
|
@@ -70,8 +70,8 @@ async function status(connection, path, query) {
|
|
|
70
70
|
(0, status_fields_js_1.parseStatusList)(list, (key, value) => {
|
|
71
71
|
map[key] = value;
|
|
72
72
|
let updater = MAILBOX_UPDATERS[key];
|
|
73
|
-
if (
|
|
74
|
-
updater(value, connection, path);
|
|
73
|
+
if (currentMailbox && updater) {
|
|
74
|
+
updater(value, currentMailbox, connection, path);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -12,7 +12,8 @@ const tools_js_1 = require("../tools.js");
|
|
|
12
12
|
* @returns True on success, false on failure or if nothing to do
|
|
13
13
|
*/
|
|
14
14
|
async function store(connection, range, flags, options) {
|
|
15
|
-
|
|
15
|
+
let mailbox = (0, tools_js_1.getSelectedMailbox)(connection);
|
|
16
|
+
if (!mailbox || !range || (options.useLabels && !connection.capabilities.has('X-GM-EXT-1'))) {
|
|
16
17
|
// nothing to do here
|
|
17
18
|
return false;
|
|
18
19
|
}
|
|
@@ -48,7 +49,7 @@ async function store(connection, range, flags, options) {
|
|
|
48
49
|
flags = (Array.isArray(flags) ? flags : [].concat(flags || []))
|
|
49
50
|
.map(flag => {
|
|
50
51
|
let formatted = (0, tools_js_1.formatFlag)(flag);
|
|
51
|
-
if (!(0, tools_js_1.canUseFlag)(
|
|
52
|
+
if (!(0, tools_js_1.canUseFlag)(mailbox, formatted) && options.operation !== 'remove') {
|
|
52
53
|
return false;
|
|
53
54
|
}
|
|
54
55
|
return formatted;
|
|
@@ -65,7 +66,7 @@ async function store(connection, range, flags, options) {
|
|
|
65
66
|
];
|
|
66
67
|
// CONDSTORE (RFC 7162): UNCHANGEDSINCE modifier prevents updating messages whose
|
|
67
68
|
// mod-sequence is higher than the specified value, avoiding overwriting concurrent changes.
|
|
68
|
-
if (options.unchangedSince && connection.enabled.has('CONDSTORE') && !
|
|
69
|
+
if (options.unchangedSince && connection.enabled.has('CONDSTORE') && !mailbox.noModseq) {
|
|
69
70
|
attributes.push([
|
|
70
71
|
{
|
|
71
72
|
type: 'ATOM',
|
|
@@ -84,8 +85,7 @@ async function store(connection, range, flags, options) {
|
|
|
84
85
|
return true;
|
|
85
86
|
}
|
|
86
87
|
catch (err) {
|
|
87
|
-
await (0, tools_js_1.
|
|
88
|
-
connection.log.warn({ err, cid: connection.id });
|
|
88
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = subscribe;
|
|
4
|
-
const
|
|
4
|
+
const subscription_js_1 = require("./subscription.js");
|
|
5
5
|
/**
|
|
6
6
|
* Subscribes to a mailbox.
|
|
7
7
|
*
|
|
@@ -10,22 +10,7 @@ const tools_js_1 = require("../tools.js");
|
|
|
10
10
|
* @returns True on success, false on failure, or undefined if preconditions not met
|
|
11
11
|
*/
|
|
12
12
|
async function subscribe(connection, path) {
|
|
13
|
-
|
|
14
|
-
// nothing to do here
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
path = (0, tools_js_1.normalizePath)(connection, path);
|
|
18
|
-
let response;
|
|
19
|
-
try {
|
|
20
|
-
response = await connection.exec('SUBSCRIBE', [{ type: 'ATOM', value: (0, tools_js_1.encodePath)(connection, path) }]);
|
|
21
|
-
response.next();
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
await (0, tools_js_1.enhanceCommandError)(err);
|
|
26
|
-
connection.log.warn({ err, cid: connection.id });
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
13
|
+
return await (0, subscription_js_1.setSubscription)(connection, 'SUBSCRIBE', path);
|
|
29
14
|
}
|
|
30
15
|
module.exports = exports.default;
|
|
31
16
|
Object.defineProperty(module.exports, 'default', { value: exports.default, enumerable: false, writable: true, configurable: true });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ImapFlow } from '../imap-flow.js';
|
|
2
|
+
/**
|
|
3
|
+
* Runs SUBSCRIBE or UNSUBSCRIBE for a mailbox, the shared body of the two commands.
|
|
4
|
+
*
|
|
5
|
+
* @param connection - IMAP connection instance
|
|
6
|
+
* @param command - SUBSCRIBE or UNSUBSCRIBE
|
|
7
|
+
* @param path - Mailbox path
|
|
8
|
+
* @returns True on success, false on failure, or undefined if preconditions not met
|
|
9
|
+
*/
|
|
10
|
+
export declare function setSubscription(connection: ImapFlow, command: 'SUBSCRIBE' | 'UNSUBSCRIBE', path: string | string[]): Promise<boolean | undefined>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setSubscription = setSubscription;
|
|
4
|
+
const tools_js_1 = require("../tools.js");
|
|
5
|
+
/**
|
|
6
|
+
* Runs SUBSCRIBE or UNSUBSCRIBE for a mailbox, the shared body of the two commands.
|
|
7
|
+
*
|
|
8
|
+
* @param connection - IMAP connection instance
|
|
9
|
+
* @param command - SUBSCRIBE or UNSUBSCRIBE
|
|
10
|
+
* @param path - Mailbox path
|
|
11
|
+
* @returns True on success, false on failure, or undefined if preconditions not met
|
|
12
|
+
*/
|
|
13
|
+
async function setSubscription(connection, command, path) {
|
|
14
|
+
if (!(0, tools_js_1.isAuthenticatedState)(connection)) {
|
|
15
|
+
// nothing to do here
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
path = (0, tools_js_1.normalizePath)(connection, path);
|
|
19
|
+
let response;
|
|
20
|
+
try {
|
|
21
|
+
response = await connection.exec(command, [{ type: 'ATOM', value: (0, tools_js_1.encodePath)(connection, path) }]);
|
|
22
|
+
response.next();
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
await (0, tools_js_1.reportCommandError)(connection, err);
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = unsubscribe;
|
|
4
|
-
const
|
|
4
|
+
const subscription_js_1 = require("./subscription.js");
|
|
5
5
|
/**
|
|
6
6
|
* Unsubscribes from a mailbox.
|
|
7
7
|
*
|
|
@@ -10,22 +10,7 @@ const tools_js_1 = require("../tools.js");
|
|
|
10
10
|
* @returns True on success, false on failure, or undefined if preconditions not met
|
|
11
11
|
*/
|
|
12
12
|
async function unsubscribe(connection, path) {
|
|
13
|
-
|
|
14
|
-
// nothing to do here
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
path = (0, tools_js_1.normalizePath)(connection, path);
|
|
18
|
-
let response;
|
|
19
|
-
try {
|
|
20
|
-
response = await connection.exec('UNSUBSCRIBE', [{ type: 'ATOM', value: (0, tools_js_1.encodePath)(connection, path) }]);
|
|
21
|
-
response.next();
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
await (0, tools_js_1.enhanceCommandError)(err);
|
|
26
|
-
connection.log.warn({ err, cid: connection.id });
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
13
|
+
return await (0, subscription_js_1.setSubscription)(connection, 'UNSUBSCRIBE', path);
|
|
29
14
|
}
|
|
30
15
|
module.exports = exports.default;
|
|
31
16
|
Object.defineProperty(module.exports, 'default', { value: exports.default, enumerable: false, writable: true, configurable: true });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ImapFlow } from './imap-flow.js';
|
|
2
|
+
import type { DownloadManyOptions, DownloadManyResult, DownloadNotFound, DownloadObject, DownloadOptions, SequenceString } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Implements ImapFlow.download(), see its documentation
|
|
5
|
+
*
|
|
6
|
+
* @param client - Connection to download from
|
|
7
|
+
* @param range - UID or sequence number of the message
|
|
8
|
+
* @param part - Body part to download, the whole message when not set
|
|
9
|
+
* @param options - Download options
|
|
10
|
+
* @returns The download, or an empty object when there is nothing to download
|
|
11
|
+
*/
|
|
12
|
+
export declare function downloadMessage(client: ImapFlow, range: SequenceString, part?: string | undefined, options?: DownloadOptions | undefined): Promise<DownloadObject | DownloadNotFound>;
|
|
13
|
+
/**
|
|
14
|
+
* Implements ImapFlow.downloadMany(), see its documentation
|
|
15
|
+
*
|
|
16
|
+
* @param client - Connection to download from
|
|
17
|
+
* @param range - UID or sequence number of the message
|
|
18
|
+
* @param parts - Body parts to download
|
|
19
|
+
* @param options - Download options
|
|
20
|
+
* @returns Downloaded parts keyed by part number
|
|
21
|
+
*/
|
|
22
|
+
export declare function downloadMessageParts(client: ImapFlow, range: SequenceString, parts: string[], options?: DownloadManyOptions | undefined): Promise<DownloadManyResult>;
|