@withbuddi/buddi 0.1.0-pre.46 → 0.1.0-pre.48
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/extension/manifest.json +2 -2
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/agents/frontmatter.d.ts +4 -4
- package/node_modules/@buddi/core/dist/host/build.d.ts +8 -1
- package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/host/build.js +33 -0
- package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
- package/node_modules/@buddi/core/dist/host/types.d.ts +43 -0
- package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/index.d.ts +1 -0
- package/node_modules/@buddi/core/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/index.js +1 -0
- package/node_modules/@buddi/core/dist/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/onboarding/index.d.ts +1 -0
- package/node_modules/@buddi/core/dist/onboarding/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/onboarding/index.js +1 -0
- package/node_modules/@buddi/core/dist/onboarding/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.d.ts +5 -1
- package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/uses.d.ts +1 -1
- package/node_modules/@buddi/core/dist/plugin/uses.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/uses.js +2 -0
- package/node_modules/@buddi/core/dist/plugin/uses.js.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/runtimes/__fixtures__/server.d.ts +26 -0
- package/node_modules/@buddi/core/dist/runtimes/__fixtures__/server.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/__fixtures__/server.js +93 -0
- package/node_modules/@buddi/core/dist/runtimes/__fixtures__/server.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/area.d.ts +22 -0
- package/node_modules/@buddi/core/dist/runtimes/area.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/area.js +127 -0
- package/node_modules/@buddi/core/dist/runtimes/area.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/config.d.ts +54 -0
- package/node_modules/@buddi/core/dist/runtimes/config.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/config.js +57 -0
- package/node_modules/@buddi/core/dist/runtimes/config.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/consent.d.ts +170 -0
- package/node_modules/@buddi/core/dist/runtimes/consent.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/consent.js +205 -0
- package/node_modules/@buddi/core/dist/runtimes/consent.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/download.d.ts +95 -0
- package/node_modules/@buddi/core/dist/runtimes/download.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/download.js +333 -0
- package/node_modules/@buddi/core/dist/runtimes/download.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/index.d.ts +10 -0
- package/node_modules/@buddi/core/dist/runtimes/index.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/index.js +10 -0
- package/node_modules/@buddi/core/dist/runtimes/index.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/models.d.ts +78 -0
- package/node_modules/@buddi/core/dist/runtimes/models.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/models.js +240 -0
- package/node_modules/@buddi/core/dist/runtimes/models.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/native.d.ts +49 -0
- package/node_modules/@buddi/core/dist/runtimes/native.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/native.js +27 -0
- package/node_modules/@buddi/core/dist/runtimes/native.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/onnx.d.ts +87 -0
- package/node_modules/@buddi/core/dist/runtimes/onnx.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/onnx.js +582 -0
- package/node_modules/@buddi/core/dist/runtimes/onnx.js.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/pins.d.ts +53 -0
- package/node_modules/@buddi/core/dist/runtimes/pins.d.ts.map +1 -0
- package/node_modules/@buddi/core/dist/runtimes/pins.js +75 -0
- package/node_modules/@buddi/core/dist/runtimes/pins.js.map +1 -0
- package/node_modules/@buddi/core/dist/scheduler/missions.d.ts +9 -3
- package/node_modules/@buddi/core/dist/scheduler/missions.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/scheduler/missions.js +12 -3
- package/node_modules/@buddi/core/dist/scheduler/missions.js.map +1 -1
- package/node_modules/@buddi/core/dist/scheduler/types.d.ts +8 -3
- package/node_modules/@buddi/core/dist/scheduler/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/scheduler/types.js +5 -1
- package/node_modules/@buddi/core/dist/scheduler/types.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/approval.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/approval.js +3 -1
- package/node_modules/@buddi/core/dist/secrets/approval.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/use.d.ts +3 -1
- package/node_modules/@buddi/core/dist/secrets/use.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/use.js +2 -0
- package/node_modules/@buddi/core/dist/secrets/use.js.map +1 -1
- package/node_modules/@buddi/core/dist/system-context.d.ts +6 -0
- package/node_modules/@buddi/core/dist/system-context.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/tools.d.ts +16 -0
- package/node_modules/@buddi/core/dist/tools.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/tools.js.map +1 -1
- package/node_modules/@buddi/core/dist/views.d.ts +8 -8
- package/node_modules/@buddi/core/migrations/079_mission_browser_owner.sql +7 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalog.js +6 -3
- package/node_modules/@buddi/gateway/dist/agents/catalog.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts +24 -10
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js +6 -2
- package/node_modules/@buddi/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts +17 -4
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js +25 -5
- package/node_modules/@buddi/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/browser-host.d.ts +7 -0
- package/node_modules/@buddi/gateway/dist/browser-host.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/browser-host.js +22 -0
- package/node_modules/@buddi/gateway/dist/browser-host.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/agent-run.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/missions/agent-run.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/agent-run.js +2 -1
- package/node_modules/@buddi/gateway/dist/missions/agent-run.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.d.ts +91 -0
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.js +194 -0
- package/node_modules/@buddi/gateway/dist/missions/chrome-scope.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +20 -0
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +77 -5
- package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/reminders.d.ts +11 -2
- package/node_modules/@buddi/gateway/dist/missions/reminders.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/reminders.js +55 -5
- package/node_modules/@buddi/gateway/dist/missions/reminders.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.d.ts +0 -11
- package/node_modules/@buddi/gateway/dist/owner-notify.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js +3 -1
- package/node_modules/@buddi/gateway/dist/owner-notify.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-profile-edit.d.ts +3 -2
- package/node_modules/@buddi/gateway/dist/owner-profile-edit.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/owner-profile-edit.js +4 -2
- package/node_modules/@buddi/gateway/dist/owner-profile-edit.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +3 -2
- package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.d.ts +10 -2
- package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.js +24 -10
- package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.d.ts +2 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js +16 -4
- package/node_modules/@buddi/gateway/dist/telegram/approvals.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.js +8 -0
- package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/approval-ask.d.ts +8 -0
- package/node_modules/@buddi/gateway/dist/web/approval-ask.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/approval-ask.js +25 -0
- package/node_modules/@buddi/gateway/dist/web/approval-ask.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.js +3 -1
- package/node_modules/@buddi/gateway/dist/web/plugins.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/read.js +1 -0
- package/node_modules/@buddi/gateway/dist/web/read.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/runtimes.d.ts +10 -0
- package/node_modules/@buddi/gateway/dist/web/runtimes.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/runtimes.js +25 -0
- package/node_modules/@buddi/gateway/dist/web/runtimes.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +20 -2
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/write.d.ts +11 -1
- package/node_modules/@buddi/gateway/dist/web/write.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/write.js +18 -1
- package/node_modules/@buddi/gateway/dist/web/write.js.map +1 -1
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/delegate.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/delegate.js +1 -0
- package/node_modules/@buddi/runtime/dist/delegate.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/index.d.ts +1 -0
- package/node_modules/@buddi/runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/index.js +1 -0
- package/node_modules/@buddi/runtime/dist/index.js.map +1 -1
- package/node_modules/@buddi/runtime/dist/language.d.ts +65 -0
- package/node_modules/@buddi/runtime/dist/language.d.ts.map +1 -0
- package/node_modules/@buddi/runtime/dist/language.js +191 -0
- package/node_modules/@buddi/runtime/dist/language.js.map +1 -0
- package/node_modules/@buddi/runtime/dist/loop.d.ts +9 -1
- package/node_modules/@buddi/runtime/dist/loop.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/loop.js +78 -4
- package/node_modules/@buddi/runtime/dist/loop.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/controller.d.ts +5 -0
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +41 -5
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts +6 -0
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.js +2 -2
- package/node_modules/@buddi/tool-browser/dist/routes.js.map +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-mcp/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/express-rate-limit/dist/index.cjs +9 -7
- package/node_modules/express-rate-limit/dist/index.mjs +9 -7
- package/node_modules/express-rate-limit/package.json +9 -9
- package/node_modules/imapflow/CHANGELOG.md +8 -0
- package/node_modules/imapflow/dist/cjs/commands/copyuid-parser.js +16 -2
- package/node_modules/imapflow/dist/cjs/handler/imap-compiler.js +26 -19
- package/node_modules/imapflow/dist/cjs/handler/token-parser.js +127 -51
- package/node_modules/imapflow/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.js +1 -1
- package/node_modules/imapflow/dist/cjs/search-compiler.js +7 -3
- package/node_modules/imapflow/dist/esm/commands/copyuid-parser.js +16 -2
- package/node_modules/imapflow/dist/esm/handler/imap-compiler.js +26 -19
- package/node_modules/imapflow/dist/esm/handler/token-parser.js +127 -51
- package/node_modules/imapflow/dist/esm/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/package-info.js +1 -1
- package/node_modules/imapflow/dist/esm/search-compiler.js +7 -3
- package/node_modules/imapflow/package.json +3 -2
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/agents/frontmatter.d.ts +4 -4
- package/packages/core/dist/host/build.d.ts +8 -1
- package/packages/core/dist/host/build.d.ts.map +1 -1
- package/packages/core/dist/host/build.js +33 -0
- package/packages/core/dist/host/build.js.map +1 -1
- package/packages/core/dist/host/types.d.ts +43 -0
- package/packages/core/dist/host/types.d.ts.map +1 -1
- package/packages/core/dist/index.d.ts +1 -0
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/index.js +1 -0
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/onboarding/index.d.ts +1 -0
- package/packages/core/dist/onboarding/index.d.ts.map +1 -1
- package/packages/core/dist/onboarding/index.js +1 -0
- package/packages/core/dist/onboarding/index.js.map +1 -1
- package/packages/core/dist/plugin/index.d.ts +5 -1
- package/packages/core/dist/plugin/index.d.ts.map +1 -1
- package/packages/core/dist/plugin/index.js.map +1 -1
- package/packages/core/dist/plugin/uses.d.ts +1 -1
- package/packages/core/dist/plugin/uses.d.ts.map +1 -1
- package/packages/core/dist/plugin/uses.js +2 -0
- package/packages/core/dist/plugin/uses.js.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/runtimes/__fixtures__/server.d.ts +26 -0
- package/packages/core/dist/runtimes/__fixtures__/server.d.ts.map +1 -0
- package/packages/core/dist/runtimes/__fixtures__/server.js +93 -0
- package/packages/core/dist/runtimes/__fixtures__/server.js.map +1 -0
- package/packages/core/dist/runtimes/area.d.ts +22 -0
- package/packages/core/dist/runtimes/area.d.ts.map +1 -0
- package/packages/core/dist/runtimes/area.js +127 -0
- package/packages/core/dist/runtimes/area.js.map +1 -0
- package/packages/core/dist/runtimes/config.d.ts +54 -0
- package/packages/core/dist/runtimes/config.d.ts.map +1 -0
- package/packages/core/dist/runtimes/config.js +57 -0
- package/packages/core/dist/runtimes/config.js.map +1 -0
- package/packages/core/dist/runtimes/consent.d.ts +170 -0
- package/packages/core/dist/runtimes/consent.d.ts.map +1 -0
- package/packages/core/dist/runtimes/consent.js +205 -0
- package/packages/core/dist/runtimes/consent.js.map +1 -0
- package/packages/core/dist/runtimes/download.d.ts +95 -0
- package/packages/core/dist/runtimes/download.d.ts.map +1 -0
- package/packages/core/dist/runtimes/download.js +333 -0
- package/packages/core/dist/runtimes/download.js.map +1 -0
- package/packages/core/dist/runtimes/index.d.ts +10 -0
- package/packages/core/dist/runtimes/index.d.ts.map +1 -0
- package/packages/core/dist/runtimes/index.js +10 -0
- package/packages/core/dist/runtimes/index.js.map +1 -0
- package/packages/core/dist/runtimes/models.d.ts +78 -0
- package/packages/core/dist/runtimes/models.d.ts.map +1 -0
- package/packages/core/dist/runtimes/models.js +240 -0
- package/packages/core/dist/runtimes/models.js.map +1 -0
- package/packages/core/dist/runtimes/native.d.ts +49 -0
- package/packages/core/dist/runtimes/native.d.ts.map +1 -0
- package/packages/core/dist/runtimes/native.js +27 -0
- package/packages/core/dist/runtimes/native.js.map +1 -0
- package/packages/core/dist/runtimes/onnx.d.ts +87 -0
- package/packages/core/dist/runtimes/onnx.d.ts.map +1 -0
- package/packages/core/dist/runtimes/onnx.js +582 -0
- package/packages/core/dist/runtimes/onnx.js.map +1 -0
- package/packages/core/dist/runtimes/pins.d.ts +53 -0
- package/packages/core/dist/runtimes/pins.d.ts.map +1 -0
- package/packages/core/dist/runtimes/pins.js +75 -0
- package/packages/core/dist/runtimes/pins.js.map +1 -0
- package/packages/core/dist/scheduler/missions.d.ts +9 -3
- package/packages/core/dist/scheduler/missions.d.ts.map +1 -1
- package/packages/core/dist/scheduler/missions.js +12 -3
- package/packages/core/dist/scheduler/missions.js.map +1 -1
- package/packages/core/dist/scheduler/types.d.ts +8 -3
- package/packages/core/dist/scheduler/types.d.ts.map +1 -1
- package/packages/core/dist/scheduler/types.js +5 -1
- package/packages/core/dist/scheduler/types.js.map +1 -1
- package/packages/core/dist/secrets/approval.d.ts.map +1 -1
- package/packages/core/dist/secrets/approval.js +3 -1
- package/packages/core/dist/secrets/approval.js.map +1 -1
- package/packages/core/dist/secrets/use.d.ts +3 -1
- package/packages/core/dist/secrets/use.d.ts.map +1 -1
- package/packages/core/dist/secrets/use.js +2 -0
- package/packages/core/dist/secrets/use.js.map +1 -1
- package/packages/core/dist/system-context.d.ts +6 -0
- package/packages/core/dist/system-context.d.ts.map +1 -1
- package/packages/core/dist/tools.d.ts +16 -0
- package/packages/core/dist/tools.d.ts.map +1 -1
- package/packages/core/dist/tools.js.map +1 -1
- package/packages/core/dist/views.d.ts +8 -8
- package/packages/core/migrations/079_mission_browser_owner.sql +7 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/agents/catalog.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalog.js +6 -3
- package/packages/gateway/dist/agents/catalog.js.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.d.ts +24 -10
- package/packages/gateway/dist/agents/catalogue-package.d.ts.map +1 -1
- package/packages/gateway/dist/agents/catalogue-package.js +6 -2
- package/packages/gateway/dist/agents/catalogue-package.js.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.d.ts +17 -4
- package/packages/gateway/dist/agents/platform-catalogue.d.ts.map +1 -1
- package/packages/gateway/dist/agents/platform-catalogue.js +25 -5
- package/packages/gateway/dist/agents/platform-catalogue.js.map +1 -1
- package/packages/gateway/dist/browser-host.d.ts +7 -0
- package/packages/gateway/dist/browser-host.d.ts.map +1 -1
- package/packages/gateway/dist/browser-host.js +22 -0
- package/packages/gateway/dist/browser-host.js.map +1 -1
- package/packages/gateway/dist/missions/agent-run.d.ts +6 -0
- package/packages/gateway/dist/missions/agent-run.d.ts.map +1 -1
- package/packages/gateway/dist/missions/agent-run.js +2 -1
- package/packages/gateway/dist/missions/agent-run.js.map +1 -1
- package/packages/gateway/dist/missions/chrome-scope.d.ts +91 -0
- package/packages/gateway/dist/missions/chrome-scope.d.ts.map +1 -0
- package/packages/gateway/dist/missions/chrome-scope.js +194 -0
- package/packages/gateway/dist/missions/chrome-scope.js.map +1 -0
- package/packages/gateway/dist/missions/execute.d.ts +20 -0
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +77 -5
- package/packages/gateway/dist/missions/execute.js.map +1 -1
- package/packages/gateway/dist/missions/reminders.d.ts +11 -2
- package/packages/gateway/dist/missions/reminders.d.ts.map +1 -1
- package/packages/gateway/dist/missions/reminders.js +55 -5
- package/packages/gateway/dist/missions/reminders.js.map +1 -1
- package/packages/gateway/dist/owner-notify.d.ts +0 -11
- package/packages/gateway/dist/owner-notify.d.ts.map +1 -1
- package/packages/gateway/dist/owner-notify.js +3 -1
- package/packages/gateway/dist/owner-notify.js.map +1 -1
- package/packages/gateway/dist/owner-profile-edit.d.ts +3 -2
- package/packages/gateway/dist/owner-profile-edit.d.ts.map +1 -1
- package/packages/gateway/dist/owner-profile-edit.js +4 -2
- package/packages/gateway/dist/owner-profile-edit.js.map +1 -1
- package/packages/gateway/dist/serve.d.ts.map +1 -1
- package/packages/gateway/dist/serve.js +3 -2
- package/packages/gateway/dist/serve.js.map +1 -1
- package/packages/gateway/dist/system-context.d.ts +10 -2
- package/packages/gateway/dist/system-context.d.ts.map +1 -1
- package/packages/gateway/dist/system-context.js +24 -10
- package/packages/gateway/dist/system-context.js.map +1 -1
- package/packages/gateway/dist/telegram/approvals.d.ts +2 -1
- package/packages/gateway/dist/telegram/approvals.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/approvals.js +16 -4
- package/packages/gateway/dist/telegram/approvals.js.map +1 -1
- package/packages/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/packages/gateway/dist/web/api-routes.js +8 -0
- package/packages/gateway/dist/web/api-routes.js.map +1 -1
- package/packages/gateway/dist/web/approval-ask.d.ts +8 -0
- package/packages/gateway/dist/web/approval-ask.d.ts.map +1 -1
- package/packages/gateway/dist/web/approval-ask.js +25 -0
- package/packages/gateway/dist/web/approval-ask.js.map +1 -1
- package/packages/gateway/dist/web/plugins.d.ts.map +1 -1
- package/packages/gateway/dist/web/plugins.js +3 -1
- package/packages/gateway/dist/web/plugins.js.map +1 -1
- package/packages/gateway/dist/web/read.d.ts +2 -0
- package/packages/gateway/dist/web/read.d.ts.map +1 -1
- package/packages/gateway/dist/web/read.js +1 -0
- package/packages/gateway/dist/web/read.js.map +1 -1
- package/packages/gateway/dist/web/runtimes.d.ts +10 -0
- package/packages/gateway/dist/web/runtimes.d.ts.map +1 -0
- package/packages/gateway/dist/web/runtimes.js +25 -0
- package/packages/gateway/dist/web/runtimes.js.map +1 -0
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +20 -2
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/write.d.ts +11 -1
- package/packages/gateway/dist/web/write.d.ts.map +1 -1
- package/packages/gateway/dist/web/write.js +18 -1
- package/packages/gateway/dist/web/write.js.map +1 -1
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/delegate.d.ts.map +1 -1
- package/packages/runtime/dist/delegate.js +1 -0
- package/packages/runtime/dist/delegate.js.map +1 -1
- package/packages/runtime/dist/index.d.ts +1 -0
- package/packages/runtime/dist/index.d.ts.map +1 -1
- package/packages/runtime/dist/index.js +1 -0
- package/packages/runtime/dist/index.js.map +1 -1
- package/packages/runtime/dist/language.d.ts +65 -0
- package/packages/runtime/dist/language.d.ts.map +1 -0
- package/packages/runtime/dist/language.js +191 -0
- package/packages/runtime/dist/language.js.map +1 -0
- package/packages/runtime/dist/loop.d.ts +9 -1
- package/packages/runtime/dist/loop.d.ts.map +1 -1
- package/packages/runtime/dist/loop.js +78 -4
- package/packages/runtime/dist/loop.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/controller.d.ts +5 -0
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +41 -5
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/routes.d.ts +6 -0
- package/packages/tools/browser/dist/routes.d.ts.map +1 -1
- package/packages/tools/browser/dist/routes.js +2 -2
- package/packages/tools/browser/dist/routes.js.map +1 -1
- package/packages/tools/email/dist/.tsbuildinfo +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/mcp/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-C2yWZED2.css → index-CkzsX0YQ.css} +1 -1
- package/packages/web/dist/assets/index-Dg5Dl0iF.js +150 -0
- package/packages/web/dist/assets/{lottie_light-CVXFbeEK.js → lottie_light-vNpJ-Svm.js} +1 -1
- package/packages/web/dist/build.json +1 -1
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/precache.json +4 -4
- package/packages/web/dist/assets/index-CIhME8Ui.js +0 -150
|
@@ -13,7 +13,6 @@ const STATE_NORMAL = 0x003;
|
|
|
13
13
|
const STATE_PARTIAL = 0x004;
|
|
14
14
|
const STATE_SEQUENCE = 0x005;
|
|
15
15
|
const STATE_STRING = 0x006;
|
|
16
|
-
const RE_DIGITS = /^\d+$/;
|
|
17
16
|
const RE_SINGLE_DIGIT = /^\d$/;
|
|
18
17
|
// Prevents stack overflow from maliciously crafted deeply-nested IMAP input (e.g., (((((...))))))
|
|
19
18
|
const MAX_NODE_DEPTH = 25;
|
|
@@ -175,6 +174,63 @@ class TokenParser {
|
|
|
175
174
|
i++;
|
|
176
175
|
}
|
|
177
176
|
};
|
|
177
|
+
// Whether chr is the closing delimiter of node: ")" ends a LIST, "]" ends a SECTION
|
|
178
|
+
const closesNode = (c, node) => !!node && ((c === ')' && node.type === 'LIST') || (c === ']' && node.type === 'SECTION'));
|
|
179
|
+
// Facts about the ATOM, SEQUENCE or PARTIAL token being read, kept up to date as its
|
|
180
|
+
// characters are appended. Reading them back from the value instead (value.at(-1),
|
|
181
|
+
// value.includes('*'), a regex test) makes V8 flatten the string built with += on every
|
|
182
|
+
// character, which is quadratic in the token length, and the server decides that length:
|
|
183
|
+
// a 600 KB ESEARCH result took seconds of event loop time
|
|
184
|
+
let tokenLength = 0;
|
|
185
|
+
let tokenLast = '';
|
|
186
|
+
let tokenPrev = '';
|
|
187
|
+
let tokenDigitsOnly = true;
|
|
188
|
+
let tokenHasStar = false;
|
|
189
|
+
let tokenHasDot = false;
|
|
190
|
+
const appendToToken = (c) => {
|
|
191
|
+
this.currentNode.value += c;
|
|
192
|
+
tokenLength++;
|
|
193
|
+
tokenPrev = tokenLast;
|
|
194
|
+
tokenLast = c;
|
|
195
|
+
tokenDigitsOnly = tokenDigitsOnly && RE_SINGLE_DIGIT.test(c);
|
|
196
|
+
tokenHasStar = tokenHasStar || c === '*';
|
|
197
|
+
tokenHasDot = tokenHasDot || c === '.';
|
|
198
|
+
};
|
|
199
|
+
// A digit-led token is only a guess at a sequence set. ":" and "," are ATOM-CHARs, so a
|
|
200
|
+
// server sends a mailbox name, keyword or label such as "2024:Q1" or "1,a" unquoted, and
|
|
201
|
+
// rejecting it would drop the whole response line: the mailbox missing from LIST, the
|
|
202
|
+
// message missing from FETCH. When the sequence grammar breaks, such a token is read on as
|
|
203
|
+
// an atom, and the atom rules decide whether the current character is acceptable. A token
|
|
204
|
+
// holding "*" can not be an atom ("*" is not an ATOM-CHAR), so it keeps the sequence errors
|
|
205
|
+
const continueAsAtom = () => {
|
|
206
|
+
this.currentNode.type = 'ATOM';
|
|
207
|
+
this.state = STATE_ATOM;
|
|
208
|
+
// read the current character again, in STATE_ATOM
|
|
209
|
+
i--;
|
|
210
|
+
};
|
|
211
|
+
// Starts the value of the current node as a new token, with its first character if any
|
|
212
|
+
const startToken = (first) => {
|
|
213
|
+
this.currentNode.value = '';
|
|
214
|
+
tokenLength = 0;
|
|
215
|
+
tokenLast = tokenPrev = '';
|
|
216
|
+
tokenDigitsOnly = true;
|
|
217
|
+
tokenHasStar = tokenHasDot = false;
|
|
218
|
+
if (first) {
|
|
219
|
+
appendToToken(first);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
// ImapStream supplies one buffer per literal marker it framed, {0} included. A marker
|
|
223
|
+
// without a buffer means the line and its literals do not match up, so fail with a parser
|
|
224
|
+
// error instead of reading a missing buffer or shifting every later literal by one
|
|
225
|
+
const takeLiteral = (literals) => {
|
|
226
|
+
if (!literals.length) {
|
|
227
|
+
let error = new Error(`Literal without data at position ${this.pos + i} [E35]`);
|
|
228
|
+
error.code = 'ParserError35';
|
|
229
|
+
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
return literals.shift();
|
|
233
|
+
};
|
|
178
234
|
// Any ATOM supported char starts a new Atom sequence, otherwise throw an error
|
|
179
235
|
// Allow \ as the first char for atom to support system flags
|
|
180
236
|
// Allow % to support LIST '' %
|
|
@@ -190,7 +246,7 @@ class TokenParser {
|
|
|
190
246
|
}
|
|
191
247
|
this.currentNode = this.createNode(this.currentNode, this.pos + i);
|
|
192
248
|
this.currentNode.type = 'ATOM';
|
|
193
|
-
|
|
249
|
+
startToken(chr);
|
|
194
250
|
this.state = STATE_ATOM;
|
|
195
251
|
};
|
|
196
252
|
for (i = 0, len = this.str.length; i < len; i++) {
|
|
@@ -245,12 +301,13 @@ class TokenParser {
|
|
|
245
301
|
if (this.str.charAt(i - 1) !== ']') {
|
|
246
302
|
this.currentNode = this.createNode(this.currentNode, this.pos + i);
|
|
247
303
|
this.currentNode.type = 'ATOM';
|
|
248
|
-
|
|
304
|
+
startToken(chr);
|
|
249
305
|
this.state = STATE_ATOM;
|
|
250
306
|
}
|
|
251
307
|
else {
|
|
252
308
|
this.currentNode = this.createNode(this.currentNode, this.pos + i);
|
|
253
309
|
this.currentNode.type = 'PARTIAL';
|
|
310
|
+
startToken();
|
|
254
311
|
this.state = STATE_PARTIAL;
|
|
255
312
|
this.currentNode.isClosed = false;
|
|
256
313
|
}
|
|
@@ -260,12 +317,14 @@ class TokenParser {
|
|
|
260
317
|
case '~': {
|
|
261
318
|
let nextChr = this.str.charAt(i + 1);
|
|
262
319
|
if (nextChr !== '{') {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
320
|
+
// '~' is an ATOM-CHAR itself, so when it does not start a literal8
|
|
321
|
+
// it starts an atom, including the one-character atom "~" that a
|
|
322
|
+
// space, the end of the line or a closing delimiter ends
|
|
323
|
+
if (imap_formal_syntax_js_1.default['ATOM-CHAR']().includes(nextChr) ||
|
|
324
|
+
nextChr === ' ' ||
|
|
325
|
+
nextChr === '' ||
|
|
326
|
+
closesNode(nextChr, this.currentNode)) {
|
|
327
|
+
startAtom();
|
|
269
328
|
break;
|
|
270
329
|
}
|
|
271
330
|
let error = new Error(`Unexpected literal8 marker at position ${this.pos + i} [E12]`);
|
|
@@ -291,7 +350,7 @@ class TokenParser {
|
|
|
291
350
|
case '*':
|
|
292
351
|
this.currentNode = this.createNode(this.currentNode, this.pos + i);
|
|
293
352
|
this.currentNode.type = 'SEQUENCE';
|
|
294
|
-
|
|
353
|
+
startToken(chr);
|
|
295
354
|
this.currentNode.isClosed = false;
|
|
296
355
|
this.state = STATE_SEQUENCE;
|
|
297
356
|
break;
|
|
@@ -372,8 +431,7 @@ class TokenParser {
|
|
|
372
431
|
break;
|
|
373
432
|
}
|
|
374
433
|
// ')' or ']' terminates the atom AND closes the enclosing LIST or SECTION
|
|
375
|
-
if (this.currentNode.parentNode
|
|
376
|
-
((chr === ')' && this.currentNode.parentNode.type === 'LIST') || (chr === ']' && this.currentNode.parentNode.type === 'SECTION'))) {
|
|
434
|
+
if (closesNode(chr, this.currentNode.parentNode)) {
|
|
377
435
|
this.currentNode.endPos = this.pos + i - 1;
|
|
378
436
|
this.currentNode = this.currentNode.parentNode;
|
|
379
437
|
this.currentNode.isClosed = true;
|
|
@@ -409,14 +467,16 @@ class TokenParser {
|
|
|
409
467
|
}
|
|
410
468
|
// If the atom so far is all digits and we see ',' or ':', it is actually
|
|
411
469
|
// a sequence set (e.g., "1:5" or "1,3,5"), so reclassify and switch state
|
|
412
|
-
if ((chr === ',' || chr === ':') &&
|
|
470
|
+
if ((chr === ',' || chr === ':') && tokenLength && tokenDigitsOnly) {
|
|
413
471
|
this.currentNode.type = 'SEQUENCE';
|
|
414
472
|
this.currentNode.isClosed = true;
|
|
415
473
|
this.state = STATE_SEQUENCE;
|
|
416
474
|
}
|
|
417
475
|
// [ starts a section group for this element
|
|
418
476
|
// Allowed only for selected elements, otherwise falls through to regular ATOM processing
|
|
419
|
-
if (chr === '[' &&
|
|
477
|
+
if (chr === '[' &&
|
|
478
|
+
tokenLength <= 11 &&
|
|
479
|
+
['BODY', 'BODY.PEEK', 'BINARY', 'BINARY.PEEK'].includes(this.currentNode.value.toUpperCase())) {
|
|
420
480
|
this.currentNode.endPos = this.pos + i;
|
|
421
481
|
this.currentNode = this.createNode(this.currentNode.parentNode, this.pos + i);
|
|
422
482
|
this.currentNode.type = 'SECTION';
|
|
@@ -441,7 +501,7 @@ class TokenParser {
|
|
|
441
501
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
442
502
|
throw error;
|
|
443
503
|
}
|
|
444
|
-
|
|
504
|
+
appendToToken(chr);
|
|
445
505
|
break;
|
|
446
506
|
case STATE_STRING:
|
|
447
507
|
// DQUOTE ends the string sequence
|
|
@@ -468,7 +528,7 @@ class TokenParser {
|
|
|
468
528
|
break;
|
|
469
529
|
case STATE_PARTIAL:
|
|
470
530
|
if (chr === '>') {
|
|
471
|
-
if (
|
|
531
|
+
if (tokenLast === '.') {
|
|
472
532
|
let error = new Error(`Unexpected end of partial at position ${this.pos + i} [E19]`);
|
|
473
533
|
error.code = 'ParserError19';
|
|
474
534
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
@@ -481,7 +541,7 @@ class TokenParser {
|
|
|
481
541
|
checkSP();
|
|
482
542
|
break;
|
|
483
543
|
}
|
|
484
|
-
if (chr === '.' && (
|
|
544
|
+
if (chr === '.' && (!tokenLength || tokenHasDot)) {
|
|
485
545
|
let error = new Error(`Unexpected partial separator . at position ${this.pos + i} [E20]`);
|
|
486
546
|
error.code = 'ParserError20';
|
|
487
547
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
@@ -493,13 +553,13 @@ class TokenParser {
|
|
|
493
553
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
494
554
|
throw error;
|
|
495
555
|
}
|
|
496
|
-
if (
|
|
556
|
+
if (tokenLast === '0' && (tokenLength === 1 || tokenPrev === '.') && chr !== '.') {
|
|
497
557
|
let error = new Error(`Invalid partial at position ${this.pos + i} [E22: ${JSON.stringify(chr)}]`);
|
|
498
558
|
error.code = 'ParserError22';
|
|
499
559
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
500
560
|
throw error;
|
|
501
561
|
}
|
|
502
|
-
|
|
562
|
+
appendToToken(chr);
|
|
503
563
|
break;
|
|
504
564
|
case STATE_LITERAL:
|
|
505
565
|
if (this.currentNode.started) {
|
|
@@ -550,12 +610,10 @@ class TokenParser {
|
|
|
550
610
|
if (!this.currentNode.literalLength) {
|
|
551
611
|
// special case where literal content length is 0
|
|
552
612
|
// close the node right away, do not wait for additional input
|
|
553
|
-
if (this.options.literals
|
|
554
|
-
//
|
|
555
|
-
//
|
|
556
|
-
|
|
557
|
-
// with their markers instead of shifting by one
|
|
558
|
-
this.currentNode.value = this.options.literals.shift();
|
|
613
|
+
if (this.options.literals) {
|
|
614
|
+
// consume the queue entry of the {0} marker too, so later
|
|
615
|
+
// literals in the same response stay aligned with their markers
|
|
616
|
+
this.currentNode.value = takeLiteral(this.options.literals);
|
|
559
617
|
}
|
|
560
618
|
this.currentNode.endPos = this.pos + i;
|
|
561
619
|
this.currentNode.isClosed = true;
|
|
@@ -565,7 +623,7 @@ class TokenParser {
|
|
|
565
623
|
}
|
|
566
624
|
else if (this.options.literals) {
|
|
567
625
|
// use the next precached literal values
|
|
568
|
-
this.currentNode.value = this.options.literals
|
|
626
|
+
this.currentNode.value = takeLiteral(this.options.literals);
|
|
569
627
|
// only APPEND arguments are kept as Buffers
|
|
570
628
|
/*
|
|
571
629
|
if ((this.parent.command || '').toString().toUpperCase() !== 'APPEND') {
|
|
@@ -620,19 +678,24 @@ class TokenParser {
|
|
|
620
678
|
}
|
|
621
679
|
this.currentNode.literalLength = (this.currentNode.literalLength || '') + chr;
|
|
622
680
|
break;
|
|
623
|
-
case STATE_SEQUENCE:
|
|
624
|
-
// space
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
681
|
+
case STATE_SEQUENCE: {
|
|
682
|
+
// A space ends the sequence set, and so does the closing delimiter of the
|
|
683
|
+
// enclosing list or section ("PARTIAL (1:100 5,7,9)", "[COPYUID 1 1:3 4,5]")
|
|
684
|
+
let closesParent = closesNode(chr, this.currentNode.parentNode);
|
|
685
|
+
if (chr === ' ' || closesParent) {
|
|
686
|
+
if (!RE_SINGLE_DIGIT.test(tokenLast) && tokenLast !== '*') {
|
|
687
|
+
if (!tokenHasStar) {
|
|
688
|
+
// a dangling separator, "10:" or "1,"
|
|
689
|
+
continueAsAtom();
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
let error = new Error(`Unexpected end of sequence at position ${this.pos + i} [E27: ${JSON.stringify(chr)}]`);
|
|
628
693
|
error.code = 'ParserError27';
|
|
629
694
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
630
695
|
throw error;
|
|
631
696
|
}
|
|
632
|
-
if (this.currentNode.value !== '*' &&
|
|
633
|
-
this.
|
|
634
|
-
this.currentNode.value.at(-2) !== ':') {
|
|
635
|
-
let error = new Error(`Unexpected whitespace at position ${this.pos + i} [E28]`);
|
|
697
|
+
if (this.currentNode.value !== '*' && tokenLast === '*' && tokenPrev !== ':') {
|
|
698
|
+
let error = new Error(`Unexpected end of sequence at position ${this.pos + i} [E28: ${JSON.stringify(chr)}]`);
|
|
636
699
|
error.code = 'ParserError28';
|
|
637
700
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
638
701
|
throw error;
|
|
@@ -641,20 +704,20 @@ class TokenParser {
|
|
|
641
704
|
this.currentNode.endPos = this.pos + i - 1;
|
|
642
705
|
this.currentNode = this.currentNode.parentNode;
|
|
643
706
|
this.state = STATE_NORMAL;
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
this.currentNode.endPos = this.pos + i;
|
|
651
|
-
this.currentNode = this.currentNode.parentNode;
|
|
652
|
-
this.state = STATE_NORMAL;
|
|
653
|
-
checkSP();
|
|
707
|
+
if (closesParent) {
|
|
708
|
+
this.currentNode.isClosed = true;
|
|
709
|
+
this.currentNode.endPos = this.pos + i;
|
|
710
|
+
this.currentNode = this.currentNode.parentNode;
|
|
711
|
+
checkSP();
|
|
712
|
+
}
|
|
654
713
|
break;
|
|
655
714
|
}
|
|
656
715
|
if (chr === ':') {
|
|
657
|
-
if (!RE_SINGLE_DIGIT.test(
|
|
716
|
+
if (!RE_SINGLE_DIGIT.test(tokenLast) && tokenLast !== '*') {
|
|
717
|
+
if (!tokenHasStar) {
|
|
718
|
+
continueAsAtom();
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
658
721
|
let error = new Error(`Unexpected range separator : at position ${this.pos + i} [E29]`);
|
|
659
722
|
error.code = 'ParserError29';
|
|
660
723
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
@@ -662,7 +725,7 @@ class TokenParser {
|
|
|
662
725
|
}
|
|
663
726
|
}
|
|
664
727
|
else if (chr === '*') {
|
|
665
|
-
if (![',', ':'].includes(
|
|
728
|
+
if (![',', ':'].includes(tokenLast)) {
|
|
666
729
|
let error = new Error(`Unexpected range wildcard at position ${this.pos + i} [E30]`);
|
|
667
730
|
error.code = 'ParserError30';
|
|
668
731
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
@@ -670,13 +733,17 @@ class TokenParser {
|
|
|
670
733
|
}
|
|
671
734
|
}
|
|
672
735
|
else if (chr === ',') {
|
|
673
|
-
if (!RE_SINGLE_DIGIT.test(
|
|
736
|
+
if (!RE_SINGLE_DIGIT.test(tokenLast) && tokenLast !== '*') {
|
|
737
|
+
if (!tokenHasStar) {
|
|
738
|
+
continueAsAtom();
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
674
741
|
let error = new Error(`Unexpected sequence separator , at position ${this.pos + i} [E31]`);
|
|
675
742
|
error.code = 'ParserError31';
|
|
676
743
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
677
744
|
throw error;
|
|
678
745
|
}
|
|
679
|
-
if (
|
|
746
|
+
if (tokenLast === '*' && tokenPrev !== ':') {
|
|
680
747
|
let error = new Error(`Unexpected sequence separator , at position ${this.pos + i} [E32]`);
|
|
681
748
|
error.code = 'ParserError32';
|
|
682
749
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
@@ -684,21 +751,30 @@ class TokenParser {
|
|
|
684
751
|
}
|
|
685
752
|
}
|
|
686
753
|
else if (!RE_SINGLE_DIGIT.test(chr)) {
|
|
754
|
+
if (!tokenHasStar) {
|
|
755
|
+
continueAsAtom();
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
687
758
|
let error = new Error(`Unexpected char at position ${this.pos + i} [E33: ${JSON.stringify(chr)}]`);
|
|
688
759
|
error.code = 'ParserError33';
|
|
689
760
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
690
761
|
throw error;
|
|
691
762
|
}
|
|
692
|
-
if (RE_SINGLE_DIGIT.test(chr) &&
|
|
763
|
+
if (RE_SINGLE_DIGIT.test(chr) && tokenLast === '*') {
|
|
693
764
|
let error = new Error(`Unexpected number at position ${this.pos + i} [E34: ${JSON.stringify(chr)}]`);
|
|
694
765
|
error.code = 'ParserError34';
|
|
695
766
|
error.parserContext = { input: this.str, pos: this.pos + i, chr };
|
|
696
767
|
throw error;
|
|
697
768
|
}
|
|
698
|
-
|
|
769
|
+
appendToToken(chr);
|
|
699
770
|
break;
|
|
771
|
+
}
|
|
700
772
|
}
|
|
701
773
|
}
|
|
774
|
+
// the same applies to a digit-led token that ends the input on a dangling separator ("10:")
|
|
775
|
+
if (this.state === STATE_SEQUENCE && (tokenLast === ':' || tokenLast === ',') && !tokenHasStar) {
|
|
776
|
+
this.currentNode.type = 'ATOM';
|
|
777
|
+
}
|
|
702
778
|
}
|
|
703
779
|
}
|
|
704
780
|
exports.TokenParser = TokenParser;
|
|
@@ -389,8 +389,12 @@ const searchCompiler = (connection, query) => {
|
|
|
389
389
|
}
|
|
390
390
|
break;
|
|
391
391
|
// NOT operator
|
|
392
|
+
// A falsy operand means no NOT clause (`not: cond && {...}`). Any other one goes
|
|
393
|
+
// through walkOperand(), which refuses a value that is not a query object or
|
|
394
|
+
// compiles to nothing: dropping it would turn the filter into a search that
|
|
395
|
+
// matches everything
|
|
392
396
|
case 'NOT':
|
|
393
|
-
if (params[term]
|
|
397
|
+
if (params[term]) {
|
|
394
398
|
attributes.push({ type: 'ATOM', value: 'NOT' });
|
|
395
399
|
walkOperand('NOT', params[term]);
|
|
396
400
|
}
|
|
@@ -403,8 +407,8 @@ const searchCompiler = (connection, query) => {
|
|
|
403
407
|
}
|
|
404
408
|
// Single element - just process it directly
|
|
405
409
|
if (params[term].length === 1) {
|
|
406
|
-
if (
|
|
407
|
-
|
|
410
|
+
if (params[term][0]) {
|
|
411
|
+
walkOperand('OR', params[term][0]);
|
|
408
412
|
}
|
|
409
413
|
break;
|
|
410
414
|
}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { expandRange, parseBigIntValue } from '../tools.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a value is a complete uid-set (RFC 4315): comma separated UIDs and UID ranges. The UID
|
|
4
|
+
* map pairs the source and destination sets by position, so a set with a malformed element must
|
|
5
|
+
* be refused as a whole: skipping the element, as expandRange() does, would shift every UID after
|
|
6
|
+
* it onto the wrong counterpart. Checked per element, as a whole-set regex with an unbounded
|
|
7
|
+
* repeat can overflow the regex engine on very long sets.
|
|
8
|
+
*/
|
|
9
|
+
const UID_SET_ELEMENT = /^\d+(:\d+)?$/;
|
|
10
|
+
const isUidSet = (value) => typeof value === 'string' && value.split(',').every(part => UID_SET_ELEMENT.test(part));
|
|
11
|
+
// The UIDs of a uid-set attribute, or false when the attribute is not a complete uid-set
|
|
12
|
+
const uidSetValues = (attribute) => {
|
|
13
|
+
const value = attribute && attribute.value;
|
|
14
|
+
return isUidSet(value) ? expandRange(value) : false;
|
|
15
|
+
};
|
|
2
16
|
/**
|
|
3
17
|
* Parses COPYUID response code from an IMAP response (RFC 4315).
|
|
4
18
|
* Used by both COPY and MOVE commands to extract the UID mapping
|
|
@@ -21,8 +35,8 @@ export function parseCopyUid(response, map) {
|
|
|
21
35
|
if (uidValidity !== false) {
|
|
22
36
|
map.uidValidity = uidValidity;
|
|
23
37
|
}
|
|
24
|
-
const sourceUids =
|
|
25
|
-
const destinationUids =
|
|
38
|
+
const sourceUids = uidSetValues(codeSection[2]);
|
|
39
|
+
const destinationUids = uidSetValues(codeSection[3]);
|
|
26
40
|
if (sourceUids && destinationUids && sourceUids.length === destinationUids.length) {
|
|
27
41
|
map.uidMap = new Map(sourceUids.map((uid, i) => [uid, destinationUids[i]]));
|
|
28
42
|
}
|
|
@@ -81,28 +81,27 @@ async function compiler(response, options) {
|
|
|
81
81
|
.concat(response.command ? emitEntry(' ' + response.command) : []);
|
|
82
82
|
let val;
|
|
83
83
|
let lastType;
|
|
84
|
+
// Set right after the compiler writes "(" or "[" itself, so the first element inside gets no
|
|
85
|
+
// leading space
|
|
86
|
+
let afterOpener = false;
|
|
84
87
|
let walk = async (node, options) => {
|
|
85
88
|
options = options || {};
|
|
86
|
-
// Determine whether a space separator is needed before this node.
|
|
87
|
-
// Inspect the last byte written to decide context.
|
|
88
|
-
let lastRespEntry = resp.length && resp[resp.length - 1];
|
|
89
|
-
let lastRespByte = (lastRespEntry && lastRespEntry.length && lastRespEntry[lastRespEntry.length - 1]) || '';
|
|
90
|
-
if (typeof lastRespByte === 'number') {
|
|
91
|
-
lastRespByte = String.fromCharCode(lastRespByte);
|
|
92
|
-
}
|
|
93
89
|
// Add a space separator when:
|
|
94
90
|
// - The previous token was a LITERAL. Literal data ends exactly at its declared length, so
|
|
95
91
|
// a following token always needs an explicit separator, even though the last written byte
|
|
96
92
|
// is arbitrary literal content.
|
|
97
|
-
// - Otherwise: there is something written already (resp is not empty) and the
|
|
98
|
-
// not
|
|
93
|
+
// - Otherwise: there is something written already (resp is not empty) and the compiler did
|
|
94
|
+
// not just open a list or a section. This is tracked rather than read back from the last
|
|
95
|
+
// written byte: a token value can itself end in "(", "[" or "<" (an atom such as "X["),
|
|
96
|
+
// and suppressing the space after it would fuse it with the next argument.
|
|
99
97
|
// A sub-array element in a consecutive-list context never gets one (no space between
|
|
100
98
|
// adjacent lists).
|
|
101
|
-
if (lastType === 'LITERAL' || (!
|
|
99
|
+
if (lastType === 'LITERAL' || (!afterOpener && resp.length)) {
|
|
102
100
|
if (!options.subArray) {
|
|
103
101
|
resp.push(emitEntry(' '));
|
|
104
102
|
}
|
|
105
103
|
}
|
|
104
|
+
afterOpener = false;
|
|
106
105
|
if (node && node.buffer && !Buffer.isBuffer(node)) {
|
|
107
106
|
// mongodb binary
|
|
108
107
|
node = node.buffer;
|
|
@@ -110,6 +109,7 @@ async function compiler(response, options) {
|
|
|
110
109
|
if (Array.isArray(node)) {
|
|
111
110
|
lastType = 'LIST';
|
|
112
111
|
resp.push(emitEntry('('));
|
|
112
|
+
afterOpener = true;
|
|
113
113
|
// check if we need to skip separator WS between two arrays
|
|
114
114
|
let subArray = node.length > 1 && Array.isArray(node[0]);
|
|
115
115
|
for (let child of node) {
|
|
@@ -119,6 +119,7 @@ async function compiler(response, options) {
|
|
|
119
119
|
await walk(child, { subArray });
|
|
120
120
|
}
|
|
121
121
|
resp.push(emitEntry(')'));
|
|
122
|
+
afterOpener = false;
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
if (!node && typeof node !== 'string' && typeof node !== 'number' && !Buffer.isBuffer(node)) {
|
|
@@ -194,19 +195,22 @@ async function compiler(response, options) {
|
|
|
194
195
|
// when logging: the incoming token parser accepts sequence-shaped tokens
|
|
195
196
|
// this strict grammar rejects (an ESEARCH set like "1:2:3", a folder
|
|
196
197
|
// name like "12:30:00"), and re-compiling a server response for the log
|
|
197
|
-
// or for error text must never throw.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
// or for error text must never throw. An empty or missing set is refused
|
|
199
|
+
// too: it would put nothing on the wire and leave the next argument in its
|
|
200
|
+
// place.
|
|
201
|
+
// Emitted raw: the validated alphabet cannot contain a line terminator, and
|
|
202
|
+
// re-scanning a potentially multi-megabyte set in the choke point would
|
|
203
|
+
// double the cost of exactly the sets this branch exists for
|
|
204
|
+
if (!isLogging) {
|
|
205
|
+
val = node.value === null || node.value === undefined ? '' : node.value.toString();
|
|
206
|
+
if (!isValidSequenceSet(val)) {
|
|
201
207
|
let error = new Error('Invalid sequence set value');
|
|
202
208
|
error.code = 'InvalidSequenceSet';
|
|
203
209
|
throw error;
|
|
204
210
|
}
|
|
211
|
+
resp.push(emitEntry(val, { raw: true }));
|
|
205
212
|
}
|
|
206
|
-
if (node.value) {
|
|
207
|
-
// raw: the validated alphabet cannot contain a line terminator, and
|
|
208
|
-
// re-scanning a potentially multi-megabyte set in the choke point
|
|
209
|
-
// would double the cost of exactly the sets this branch exists for
|
|
213
|
+
else if (node.value) {
|
|
210
214
|
resp.push(emitEntry(node.value, { raw: true }));
|
|
211
215
|
}
|
|
212
216
|
break;
|
|
@@ -247,10 +251,12 @@ async function compiler(response, options) {
|
|
|
247
251
|
// e.g., BODY[HEADER.FIELDS (Subject)] or BODY[1.MIME]
|
|
248
252
|
if (node.section) {
|
|
249
253
|
resp.push(emitEntry('['));
|
|
254
|
+
afterOpener = true;
|
|
250
255
|
for (let child of node.section) {
|
|
251
256
|
await walk(child);
|
|
252
257
|
}
|
|
253
258
|
resp.push(emitEntry(']'));
|
|
259
|
+
afterOpener = false;
|
|
254
260
|
}
|
|
255
261
|
// Partial range: emit <origin.length> after the section brackets. Coerced
|
|
256
262
|
// rather than joined as-is: this is the last token component written
|
|
@@ -273,6 +279,7 @@ async function compiler(response, options) {
|
|
|
273
279
|
respParts.push(resp);
|
|
274
280
|
}
|
|
275
281
|
const compiled = respParts.map(part => Buffer.concat(part));
|
|
276
|
-
|
|
282
|
+
// without asArray there is a single part, returned as is instead of copied
|
|
283
|
+
return asArray ? compiled : compiled.length === 1 ? compiled[0] : Buffer.concat(compiled);
|
|
277
284
|
}
|
|
278
285
|
export default compiler;
|