@aitne/daemon 0.1.7 → 0.1.8
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/dist/adapters/dashboard-adapter.d.ts +18 -2
- package/dist/adapters/dashboard-adapter.d.ts.map +1 -1
- package/dist/adapters/dashboard-adapter.js +101 -51
- package/dist/adapters/dashboard-adapter.js.map +1 -1
- package/dist/adapters/discord.d.ts +8 -0
- package/dist/adapters/discord.d.ts.map +1 -1
- package/dist/adapters/discord.js +100 -21
- package/dist/adapters/discord.js.map +1 -1
- package/dist/adapters/message-hub.d.ts.map +1 -1
- package/dist/adapters/message-hub.js +7 -1
- package/dist/adapters/message-hub.js.map +1 -1
- package/dist/adapters/notification-manager.d.ts +102 -2
- package/dist/adapters/notification-manager.d.ts.map +1 -1
- package/dist/adapters/notification-manager.js +228 -8
- package/dist/adapters/notification-manager.js.map +1 -1
- package/dist/adapters/outbound-text.d.ts +16 -0
- package/dist/adapters/outbound-text.d.ts.map +1 -1
- package/dist/adapters/outbound-text.js +118 -1
- package/dist/adapters/outbound-text.js.map +1 -1
- package/dist/adapters/primary-platform-resolver.d.ts +69 -0
- package/dist/adapters/primary-platform-resolver.d.ts.map +1 -0
- package/dist/adapters/primary-platform-resolver.js +55 -0
- package/dist/adapters/primary-platform-resolver.js.map +1 -0
- package/dist/adapters/slack-adapter.d.ts +28 -0
- package/dist/adapters/slack-adapter.d.ts.map +1 -1
- package/dist/adapters/slack-adapter.js +134 -35
- package/dist/adapters/slack-adapter.js.map +1 -1
- package/dist/adapters/telegram-adapter.d.ts +7 -1
- package/dist/adapters/telegram-adapter.d.ts.map +1 -1
- package/dist/adapters/telegram-adapter.js +49 -18
- package/dist/adapters/telegram-adapter.js.map +1 -1
- package/dist/adapters/whatsapp-adapter.d.ts +33 -0
- package/dist/adapters/whatsapp-adapter.d.ts.map +1 -1
- package/dist/adapters/whatsapp-adapter.js +84 -0
- package/dist/adapters/whatsapp-adapter.js.map +1 -1
- package/dist/api/directory-picker.d.ts.map +1 -1
- package/dist/api/directory-picker.js +14 -0
- package/dist/api/directory-picker.js.map +1 -1
- package/dist/api/env-writer.d.ts.map +1 -1
- package/dist/api/env-writer.js +6 -1
- package/dist/api/env-writer.js.map +1 -1
- package/dist/api/helpers/agent-errors.d.ts +2600 -0
- package/dist/api/helpers/agent-errors.d.ts.map +1 -0
- package/dist/api/helpers/agent-errors.js +2506 -0
- package/dist/api/helpers/agent-errors.js.map +1 -0
- package/dist/api/integration-route-gate.d.ts.map +1 -1
- package/dist/api/integration-route-gate.js +10 -3
- package/dist/api/integration-route-gate.js.map +1 -1
- package/dist/api/routes/agent-schedule-plan-match.d.ts +5 -0
- package/dist/api/routes/agent-schedule-plan-match.d.ts.map +1 -0
- package/dist/api/routes/agent-schedule-plan-match.js +101 -0
- package/dist/api/routes/agent-schedule-plan-match.js.map +1 -0
- package/dist/api/routes/agent-schedule.d.ts +4 -0
- package/dist/api/routes/agent-schedule.d.ts.map +1 -0
- package/dist/api/routes/agent-schedule.js +750 -0
- package/dist/api/routes/agent-schedule.js.map +1 -0
- package/dist/api/routes/agent.d.ts.map +1 -1
- package/dist/api/routes/agent.js +209 -366
- package/dist/api/routes/agent.js.map +1 -1
- package/dist/api/routes/apple-calendar.d.ts.map +1 -1
- package/dist/api/routes/apple-calendar.js +109 -27
- package/dist/api/routes/apple-calendar.js.map +1 -1
- package/dist/api/routes/attachments.d.ts.map +1 -1
- package/dist/api/routes/attachments.js +113 -21
- package/dist/api/routes/attachments.js.map +1 -1
- package/dist/api/routes/backends.d.ts.map +1 -1
- package/dist/api/routes/backends.js +100 -4
- package/dist/api/routes/backends.js.map +1 -1
- package/dist/api/routes/books.d.ts.map +1 -1
- package/dist/api/routes/books.js +58 -18
- package/dist/api/routes/books.js.map +1 -1
- package/dist/api/routes/calendar.d.ts +3 -2
- package/dist/api/routes/calendar.d.ts.map +1 -1
- package/dist/api/routes/calendar.js +330 -55
- package/dist/api/routes/calendar.js.map +1 -1
- package/dist/api/routes/commands.d.ts.map +1 -1
- package/dist/api/routes/commands.js +20 -1
- package/dist/api/routes/commands.js.map +1 -1
- package/dist/api/routes/context/index.d.ts +33 -0
- package/dist/api/routes/context/index.d.ts.map +1 -0
- package/dist/api/routes/context/index.js +193 -0
- package/dist/api/routes/context/index.js.map +1 -0
- package/dist/api/routes/context/locks.d.ts +4 -0
- package/dist/api/routes/context/locks.d.ts.map +1 -0
- package/dist/api/routes/context/locks.js +136 -0
- package/dist/api/routes/context/locks.js.map +1 -0
- package/dist/api/routes/context/path-resolve.d.ts +15 -0
- package/dist/api/routes/context/path-resolve.d.ts.map +1 -0
- package/dist/api/routes/context/path-resolve.js +109 -0
- package/dist/api/routes/context/path-resolve.js.map +1 -0
- package/dist/api/routes/context/permissions.d.ts +35 -0
- package/dist/api/routes/context/permissions.d.ts.map +1 -0
- package/dist/api/routes/context/permissions.js +192 -0
- package/dist/api/routes/context/permissions.js.map +1 -0
- package/dist/api/routes/context/read.d.ts +4 -0
- package/dist/api/routes/context/read.d.ts.map +1 -0
- package/dist/api/routes/context/read.js +295 -0
- package/dist/api/routes/context/read.js.map +1 -0
- package/dist/api/routes/context/repair.d.ts +4 -0
- package/dist/api/routes/context/repair.d.ts.map +1 -0
- package/dist/api/routes/context/repair.js +114 -0
- package/dist/api/routes/context/repair.js.map +1 -0
- package/dist/api/routes/context/snapshots.d.ts +4 -0
- package/dist/api/routes/context/snapshots.d.ts.map +1 -0
- package/dist/api/routes/context/snapshots.js +177 -0
- package/dist/api/routes/context/snapshots.js.map +1 -0
- package/dist/api/routes/context/write.d.ts +4 -0
- package/dist/api/routes/context/write.d.ts.map +1 -0
- package/dist/api/routes/context/write.js +570 -0
- package/dist/api/routes/context/write.js.map +1 -0
- package/dist/api/routes/context.d.ts +2 -43
- package/dist/api/routes/context.d.ts.map +1 -1
- package/dist/api/routes/context.js +415 -558
- package/dist/api/routes/context.js.map +1 -1
- package/dist/api/routes/dashboard/config.d.ts +4 -0
- package/dist/api/routes/dashboard/config.d.ts.map +1 -0
- package/dist/api/routes/dashboard/config.js +499 -0
- package/dist/api/routes/dashboard/config.js.map +1 -0
- package/dist/api/routes/dashboard/conversations.d.ts +4 -0
- package/dist/api/routes/dashboard/conversations.d.ts.map +1 -0
- package/dist/api/routes/dashboard/conversations.js +309 -0
- package/dist/api/routes/dashboard/conversations.js.map +1 -0
- package/dist/api/routes/dashboard/cost-approvals.d.ts +29 -0
- package/dist/api/routes/dashboard/cost-approvals.d.ts.map +1 -0
- package/dist/api/routes/dashboard/cost-approvals.js +259 -0
- package/dist/api/routes/dashboard/cost-approvals.js.map +1 -0
- package/dist/api/routes/dashboard/index.d.ts +27 -0
- package/dist/api/routes/dashboard/index.d.ts.map +1 -0
- package/dist/api/routes/dashboard/index.js +47 -0
- package/dist/api/routes/dashboard/index.js.map +1 -0
- package/dist/api/routes/dashboard/messaging.d.ts +4 -0
- package/dist/api/routes/dashboard/messaging.d.ts.map +1 -0
- package/dist/api/routes/dashboard/messaging.js +351 -0
- package/dist/api/routes/dashboard/messaging.js.map +1 -0
- package/dist/api/routes/dashboard/notifications.d.ts +4 -0
- package/dist/api/routes/dashboard/notifications.d.ts.map +1 -0
- package/dist/api/routes/dashboard/notifications.js +109 -0
- package/dist/api/routes/dashboard/notifications.js.map +1 -0
- package/dist/api/routes/dashboard/oauth-google.d.ts +4 -0
- package/dist/api/routes/dashboard/oauth-google.d.ts.map +1 -0
- package/dist/api/routes/dashboard/oauth-google.js +293 -0
- package/dist/api/routes/dashboard/oauth-google.js.map +1 -0
- package/dist/api/routes/dashboard/schedule-readonly.d.ts +4 -0
- package/dist/api/routes/dashboard/schedule-readonly.d.ts.map +1 -0
- package/dist/api/routes/dashboard/schedule-readonly.js +46 -0
- package/dist/api/routes/dashboard/schedule-readonly.js.map +1 -0
- package/dist/api/routes/dashboard/secrets.d.ts +24 -0
- package/dist/api/routes/dashboard/secrets.d.ts.map +1 -0
- package/dist/api/routes/dashboard/secrets.js +307 -0
- package/dist/api/routes/dashboard/secrets.js.map +1 -0
- package/dist/api/routes/dashboard/snapshots.d.ts +4 -0
- package/dist/api/routes/dashboard/snapshots.d.ts.map +1 -0
- package/dist/api/routes/dashboard/snapshots.js +33 -0
- package/dist/api/routes/dashboard/snapshots.js.map +1 -0
- package/dist/api/routes/dashboard.d.ts.map +1 -1
- package/dist/api/routes/dashboard.js +20 -12
- package/dist/api/routes/dashboard.js.map +1 -1
- package/dist/api/routes/delegated.d.ts +5 -4
- package/dist/api/routes/delegated.d.ts.map +1 -1
- package/dist/api/routes/delegated.js +6 -5
- package/dist/api/routes/delegated.js.map +1 -1
- package/dist/api/routes/docs.d.ts.map +1 -1
- package/dist/api/routes/docs.js +72 -9
- package/dist/api/routes/docs.js.map +1 -1
- package/dist/api/routes/entities.d.ts.map +1 -1
- package/dist/api/routes/entities.js +112 -43
- package/dist/api/routes/entities.js.map +1 -1
- package/dist/api/routes/fs.d.ts.map +1 -1
- package/dist/api/routes/fs.js +27 -12
- package/dist/api/routes/fs.js.map +1 -1
- package/dist/api/routes/git-templates.d.ts.map +1 -1
- package/dist/api/routes/git-templates.js +107 -27
- package/dist/api/routes/git-templates.js.map +1 -1
- package/dist/api/routes/git.d.ts.map +1 -1
- package/dist/api/routes/git.js +55 -11
- package/dist/api/routes/git.js.map +1 -1
- package/dist/api/routes/github.d.ts.map +1 -1
- package/dist/api/routes/github.js +110 -17
- package/dist/api/routes/github.js.map +1 -1
- package/dist/api/routes/integrations/crud-patch.d.ts +17 -0
- package/dist/api/routes/integrations/crud-patch.d.ts.map +1 -0
- package/dist/api/routes/integrations/crud-patch.js +600 -0
- package/dist/api/routes/integrations/crud-patch.js.map +1 -0
- package/dist/api/routes/integrations/crud.d.ts +16 -0
- package/dist/api/routes/integrations/crud.d.ts.map +1 -0
- package/dist/api/routes/integrations/crud.js +158 -0
- package/dist/api/routes/integrations/crud.js.map +1 -0
- package/dist/api/routes/integrations/exec.d.ts +23 -0
- package/dist/api/routes/integrations/exec.d.ts.map +1 -0
- package/dist/api/routes/integrations/exec.js +356 -0
- package/dist/api/routes/integrations/exec.js.map +1 -0
- package/dist/api/routes/integrations/index.d.ts +62 -0
- package/dist/api/routes/integrations/index.d.ts.map +1 -0
- package/dist/api/routes/integrations/index.js +70 -0
- package/dist/api/routes/integrations/index.js.map +1 -0
- package/dist/api/routes/integrations/integrations/crud.d.ts +16 -0
- package/dist/api/routes/integrations/integrations/crud.d.ts.map +1 -0
- package/dist/api/routes/integrations/integrations/crud.js +158 -0
- package/dist/api/routes/integrations/integrations/crud.js.map +1 -0
- package/dist/api/routes/integrations/integrations/index.d.ts +55 -0
- package/dist/api/routes/integrations/integrations/index.d.ts.map +1 -0
- package/dist/api/routes/integrations/integrations/index.js +65 -0
- package/dist/api/routes/integrations/integrations/index.js.map +1 -0
- package/dist/api/routes/integrations/integrations/invoke.d.ts +38 -0
- package/dist/api/routes/integrations/integrations/invoke.d.ts.map +1 -0
- package/dist/api/routes/integrations/integrations/invoke.js +320 -0
- package/dist/api/routes/integrations/integrations/invoke.js.map +1 -0
- package/dist/api/routes/integrations/integrations/probe.d.ts +21 -0
- package/dist/api/routes/integrations/integrations/probe.d.ts.map +1 -0
- package/dist/api/routes/integrations/integrations/probe.js +247 -0
- package/dist/api/routes/integrations/integrations/probe.js.map +1 -0
- package/dist/api/routes/integrations/invoke.d.ts +38 -0
- package/dist/api/routes/integrations/invoke.d.ts.map +1 -0
- package/dist/api/routes/integrations/invoke.js +320 -0
- package/dist/api/routes/integrations/invoke.js.map +1 -0
- package/dist/api/routes/integrations/probe.d.ts +21 -0
- package/dist/api/routes/integrations/probe.d.ts.map +1 -0
- package/dist/api/routes/integrations/probe.js +247 -0
- package/dist/api/routes/integrations/probe.js.map +1 -0
- package/dist/api/routes/integrations.d.ts.map +1 -1
- package/dist/api/routes/integrations.js +65 -13
- package/dist/api/routes/integrations.js.map +1 -1
- package/dist/api/routes/knowledge.d.ts.map +1 -1
- package/dist/api/routes/knowledge.js +13 -2
- package/dist/api/routes/knowledge.js.map +1 -1
- package/dist/api/routes/mail/_pa_wip_mail/app-password.d.ts +4 -0
- package/dist/api/routes/mail/_pa_wip_mail/app-password.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/app-password.js +192 -0
- package/dist/api/routes/mail/_pa_wip_mail/app-password.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/body-helpers.d.ts +55 -0
- package/dist/api/routes/mail/_pa_wip_mail/body-helpers.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/body-helpers.js +91 -0
- package/dist/api/routes/mail/_pa_wip_mail/body-helpers.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/dependencies.d.ts +36 -0
- package/dist/api/routes/mail/_pa_wip_mail/dependencies.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/dependencies.js +2 -0
- package/dist/api/routes/mail/_pa_wip_mail/dependencies.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/gating.d.ts +45 -0
- package/dist/api/routes/mail/_pa_wip_mail/gating.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/gating.js +98 -0
- package/dist/api/routes/mail/_pa_wip_mail/gating.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/accounts.d.ts +4 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/accounts.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/accounts.js +289 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/accounts.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/app-password.d.ts +4 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/app-password.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/app-password.js +192 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/app-password.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/body-helpers.d.ts +55 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/body-helpers.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/body-helpers.js +91 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/body-helpers.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/dependencies.d.ts +36 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/dependencies.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/dependencies.js +2 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/dependencies.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/drafts.d.ts +5 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/drafts.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/drafts.js +139 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/drafts.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/gating.d.ts +45 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/gating.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/gating.js +98 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/gating.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/index.d.ts +18 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/index.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/index.js +40 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/index.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/messages.d.ts +15 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/messages.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/messages.js +239 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/messages.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/outlook-config.d.ts +4 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/outlook-config.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/outlook-config.js +73 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/outlook-config.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/provider-resolver.d.ts +64 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/provider-resolver.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/provider-resolver.js +286 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/provider-resolver.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/providers.d.ts +4 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/providers.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/providers.js +73 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/providers.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/tags-folders.d.ts +5 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/tags-folders.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/tags-folders.js +35 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/tags-folders.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/validators.d.ts +23 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/validators.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/validators.js +131 -0
- package/dist/api/routes/mail/_pa_wip_mail/mail/validators.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/provider-resolver.d.ts +64 -0
- package/dist/api/routes/mail/_pa_wip_mail/provider-resolver.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/provider-resolver.js +286 -0
- package/dist/api/routes/mail/_pa_wip_mail/provider-resolver.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/search-health.d.ts +4 -0
- package/dist/api/routes/mail/_pa_wip_mail/search-health.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/search-health.js +131 -0
- package/dist/api/routes/mail/_pa_wip_mail/search-health.js.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/validators.d.ts +23 -0
- package/dist/api/routes/mail/_pa_wip_mail/validators.d.ts.map +1 -0
- package/dist/api/routes/mail/_pa_wip_mail/validators.js +131 -0
- package/dist/api/routes/mail/_pa_wip_mail/validators.js.map +1 -0
- package/dist/api/routes/mail/accounts.d.ts +4 -0
- package/dist/api/routes/mail/accounts.d.ts.map +1 -0
- package/dist/api/routes/mail/accounts.js +289 -0
- package/dist/api/routes/mail/accounts.js.map +1 -0
- package/dist/api/routes/mail/app-password.d.ts +4 -0
- package/dist/api/routes/mail/app-password.d.ts.map +1 -0
- package/dist/api/routes/mail/app-password.js +192 -0
- package/dist/api/routes/mail/app-password.js.map +1 -0
- package/dist/api/routes/mail/body-helpers.d.ts +56 -0
- package/dist/api/routes/mail/body-helpers.d.ts.map +1 -0
- package/dist/api/routes/mail/body-helpers.js +91 -0
- package/dist/api/routes/mail/body-helpers.js.map +1 -0
- package/dist/api/routes/mail/dependencies.d.ts +36 -0
- package/dist/api/routes/mail/dependencies.d.ts.map +1 -0
- package/dist/api/routes/mail/dependencies.js +2 -0
- package/dist/api/routes/mail/dependencies.js.map +1 -0
- package/dist/api/routes/mail/drafts.d.ts +5 -0
- package/dist/api/routes/mail/drafts.d.ts.map +1 -0
- package/dist/api/routes/mail/drafts.js +139 -0
- package/dist/api/routes/mail/drafts.js.map +1 -0
- package/dist/api/routes/mail/gating.d.ts +45 -0
- package/dist/api/routes/mail/gating.d.ts.map +1 -0
- package/dist/api/routes/mail/gating.js +99 -0
- package/dist/api/routes/mail/gating.js.map +1 -0
- package/dist/api/routes/mail/index.d.ts +18 -0
- package/dist/api/routes/mail/index.d.ts.map +1 -0
- package/dist/api/routes/mail/index.js +40 -0
- package/dist/api/routes/mail/index.js.map +1 -0
- package/dist/api/routes/mail/messages.d.ts +15 -0
- package/dist/api/routes/mail/messages.d.ts.map +1 -0
- package/dist/api/routes/mail/messages.js +239 -0
- package/dist/api/routes/mail/messages.js.map +1 -0
- package/dist/api/routes/mail/outlook-config.d.ts +4 -0
- package/dist/api/routes/mail/outlook-config.d.ts.map +1 -0
- package/dist/api/routes/mail/outlook-config.js +73 -0
- package/dist/api/routes/mail/outlook-config.js.map +1 -0
- package/dist/api/routes/mail/provider-resolver.d.ts +64 -0
- package/dist/api/routes/mail/provider-resolver.d.ts.map +1 -0
- package/dist/api/routes/mail/provider-resolver.js +286 -0
- package/dist/api/routes/mail/provider-resolver.js.map +1 -0
- package/dist/api/routes/mail/providers.d.ts +4 -0
- package/dist/api/routes/mail/providers.d.ts.map +1 -0
- package/dist/api/routes/mail/providers.js +73 -0
- package/dist/api/routes/mail/providers.js.map +1 -0
- package/dist/api/routes/mail/search-health.d.ts +4 -0
- package/dist/api/routes/mail/search-health.d.ts.map +1 -0
- package/dist/api/routes/mail/search-health.js +131 -0
- package/dist/api/routes/mail/search-health.js.map +1 -0
- package/dist/api/routes/mail/tags-folders.d.ts +5 -0
- package/dist/api/routes/mail/tags-folders.d.ts.map +1 -0
- package/dist/api/routes/mail/tags-folders.js +35 -0
- package/dist/api/routes/mail/tags-folders.js.map +1 -0
- package/dist/api/routes/mail/validators.d.ts +23 -0
- package/dist/api/routes/mail/validators.d.ts.map +1 -0
- package/dist/api/routes/mail/validators.js +131 -0
- package/dist/api/routes/mail/validators.js.map +1 -0
- package/dist/api/routes/mail.d.ts.map +1 -1
- package/dist/api/routes/mail.js +259 -67
- package/dist/api/routes/mail.js.map +1 -1
- package/dist/api/routes/managed-tasks.d.ts.map +1 -1
- package/dist/api/routes/managed-tasks.js +142 -54
- package/dist/api/routes/managed-tasks.js.map +1 -1
- package/dist/api/routes/mcp.d.ts.map +1 -1
- package/dist/api/routes/mcp.js +115 -47
- package/dist/api/routes/mcp.js.map +1 -1
- package/dist/api/routes/metrics.d.ts +1 -1
- package/dist/api/routes/metrics.js +2 -2
- package/dist/api/routes/notion.d.ts.map +1 -1
- package/dist/api/routes/notion.js +230 -54
- package/dist/api/routes/notion.js.map +1 -1
- package/dist/api/routes/observations.d.ts.map +1 -1
- package/dist/api/routes/observations.js +40 -169
- package/dist/api/routes/observations.js.map +1 -1
- package/dist/api/routes/obsidian.d.ts.map +1 -1
- package/dist/api/routes/obsidian.js +193 -32
- package/dist/api/routes/obsidian.js.map +1 -1
- package/dist/api/routes/profile-questions.d.ts.map +1 -1
- package/dist/api/routes/profile-questions.js +19 -3
- package/dist/api/routes/profile-questions.js.map +1 -1
- package/dist/api/routes/receipts.d.ts.map +1 -1
- package/dist/api/routes/receipts.js +64 -24
- package/dist/api/routes/receipts.js.map +1 -1
- package/dist/api/routes/recurring-schedules.d.ts.map +1 -1
- package/dist/api/routes/recurring-schedules.js +243 -13
- package/dist/api/routes/recurring-schedules.js.map +1 -1
- package/dist/api/routes/repositories.d.ts.map +1 -1
- package/dist/api/routes/repositories.js +278 -104
- package/dist/api/routes/repositories.js.map +1 -1
- package/dist/api/routes/schedule-model-resolver.d.ts +153 -0
- package/dist/api/routes/schedule-model-resolver.d.ts.map +1 -0
- package/dist/api/routes/schedule-model-resolver.js +282 -0
- package/dist/api/routes/schedule-model-resolver.js.map +1 -0
- package/dist/api/routes/schedule-options.d.ts +25 -0
- package/dist/api/routes/schedule-options.d.ts.map +1 -0
- package/dist/api/routes/schedule-options.js +77 -0
- package/dist/api/routes/schedule-options.js.map +1 -0
- package/dist/api/routes/schedule-validation.d.ts +146 -0
- package/dist/api/routes/schedule-validation.d.ts.map +1 -0
- package/dist/api/routes/schedule-validation.js +153 -0
- package/dist/api/routes/schedule-validation.js.map +1 -0
- package/dist/api/routes/setup.d.ts.map +1 -1
- package/dist/api/routes/setup.js +100 -26
- package/dist/api/routes/setup.js.map +1 -1
- package/dist/api/routes/skills.d.ts.map +1 -1
- package/dist/api/routes/skills.js +81 -30
- package/dist/api/routes/skills.js.map +1 -1
- package/dist/api/routes/sot-bindings.d.ts.map +1 -1
- package/dist/api/routes/sot-bindings.js +46 -11
- package/dist/api/routes/sot-bindings.js.map +1 -1
- package/dist/api/routes/sse.d.ts.map +1 -1
- package/dist/api/routes/sse.js +6 -1
- package/dist/api/routes/sse.js.map +1 -1
- package/dist/api/routes/system.d.ts.map +1 -1
- package/dist/api/routes/system.js +15 -2
- package/dist/api/routes/system.js.map +1 -1
- package/dist/api/routes/travel-bookings.d.ts.map +1 -1
- package/dist/api/routes/travel-bookings.js +26 -9
- package/dist/api/routes/travel-bookings.js.map +1 -1
- package/dist/api/routes/travel-time.d.ts.map +1 -1
- package/dist/api/routes/travel-time.js +50 -10
- package/dist/api/routes/travel-time.js.map +1 -1
- package/dist/api/routes/wiki.d.ts.map +1 -1
- package/dist/api/routes/wiki.js +49 -8
- package/dist/api/routes/wiki.js.map +1 -1
- package/dist/api/server.d.ts +15 -3
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +32 -10
- package/dist/api/server.js.map +1 -1
- package/dist/bootstrap/adapters.d.ts.map +1 -1
- package/dist/bootstrap/adapters.js +7 -4
- package/dist/bootstrap/adapters.js.map +1 -1
- package/dist/bootstrap/api.d.ts +205 -0
- package/dist/bootstrap/api.d.ts.map +1 -0
- package/dist/bootstrap/api.js +443 -0
- package/dist/bootstrap/api.js.map +1 -0
- package/dist/bootstrap/db.d.ts +119 -0
- package/dist/bootstrap/db.d.ts.map +1 -0
- package/dist/bootstrap/db.js +294 -0
- package/dist/bootstrap/db.js.map +1 -0
- package/dist/bootstrap/event-pipeline.d.ts +308 -0
- package/dist/bootstrap/event-pipeline.d.ts.map +1 -0
- package/dist/bootstrap/event-pipeline.js +704 -0
- package/dist/bootstrap/event-pipeline.js.map +1 -0
- package/dist/bootstrap/observers.d.ts +148 -0
- package/dist/bootstrap/observers.d.ts.map +1 -0
- package/dist/bootstrap/observers.js +558 -0
- package/dist/bootstrap/observers.js.map +1 -0
- package/dist/bootstrap/schedule-helpers.d.ts +122 -0
- package/dist/bootstrap/schedule-helpers.d.ts.map +1 -1
- package/dist/bootstrap/schedule-helpers.js +202 -4
- package/dist/bootstrap/schedule-helpers.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +20 -3
- package/dist/config.js.map +1 -1
- package/dist/core/abort-utils.d.ts +14 -0
- package/dist/core/abort-utils.d.ts.map +1 -0
- package/dist/core/abort-utils.js +36 -0
- package/dist/core/abort-utils.js.map +1 -0
- package/dist/core/agent-core.d.ts +22 -3
- package/dist/core/agent-core.d.ts.map +1 -1
- package/dist/core/agent-core.js +3 -1
- package/dist/core/agent-core.js.map +1 -1
- package/dist/core/backends/auth-health-monitor.js +2 -3
- package/dist/core/backends/auth-health-monitor.js.map +1 -1
- package/dist/core/backends/backend-router.d.ts +11 -1
- package/dist/core/backends/backend-router.d.ts.map +1 -1
- package/dist/core/backends/backend-router.js +97 -2
- package/dist/core/backends/backend-router.js.map +1 -1
- package/dist/core/backends/claude-code-core.d.ts +51 -0
- package/dist/core/backends/claude-code-core.d.ts.map +1 -1
- package/dist/core/backends/claude-code-core.js +134 -11
- package/dist/core/backends/claude-code-core.js.map +1 -1
- package/dist/core/backends/claude-tool-collection.js +1 -1
- package/dist/core/backends/codex-core.d.ts +13 -1
- package/dist/core/backends/codex-core.d.ts.map +1 -1
- package/dist/core/backends/codex-core.js +436 -22
- package/dist/core/backends/codex-core.js.map +1 -1
- package/dist/core/backends/gemini-cli-core.d.ts +5 -1
- package/dist/core/backends/gemini-cli-core.d.ts.map +1 -1
- package/dist/core/backends/gemini-cli-core.js +298 -15
- package/dist/core/backends/gemini-cli-core.js.map +1 -1
- package/dist/core/backends/install-methods.d.ts.map +1 -1
- package/dist/core/backends/install-methods.js +22 -0
- package/dist/core/backends/install-methods.js.map +1 -1
- package/dist/core/backends/model-registry.d.ts +9 -4
- package/dist/core/backends/model-registry.d.ts.map +1 -1
- package/dist/core/backends/model-registry.js +153 -23
- package/dist/core/backends/model-registry.js.map +1 -1
- package/dist/core/backends/native-skill-discovery-probe.d.ts +80 -0
- package/dist/core/backends/native-skill-discovery-probe.d.ts.map +1 -0
- package/dist/core/backends/native-skill-discovery-probe.js +175 -0
- package/dist/core/backends/native-skill-discovery-probe.js.map +1 -0
- package/dist/core/backends/opencode-basic-auth-fetch.d.ts +27 -0
- package/dist/core/backends/opencode-basic-auth-fetch.d.ts.map +1 -0
- package/dist/core/backends/opencode-basic-auth-fetch.js +40 -0
- package/dist/core/backends/opencode-basic-auth-fetch.js.map +1 -0
- package/dist/core/backends/opencode-config-builder.d.ts +86 -0
- package/dist/core/backends/opencode-config-builder.d.ts.map +1 -0
- package/dist/core/backends/opencode-config-builder.js +172 -0
- package/dist/core/backends/opencode-config-builder.js.map +1 -0
- package/dist/core/backends/opencode-core.d.ts +316 -0
- package/dist/core/backends/opencode-core.d.ts.map +1 -0
- package/dist/core/backends/opencode-core.js +1502 -0
- package/dist/core/backends/opencode-core.js.map +1 -0
- package/dist/core/backends/opencode-event-mapper.d.ts +133 -0
- package/dist/core/backends/opencode-event-mapper.d.ts.map +1 -0
- package/dist/core/backends/opencode-event-mapper.js +198 -0
- package/dist/core/backends/opencode-event-mapper.js.map +1 -0
- package/dist/core/backends/opencode-mcp.d.ts +82 -0
- package/dist/core/backends/opencode-mcp.d.ts.map +1 -0
- package/dist/core/backends/opencode-mcp.js +165 -0
- package/dist/core/backends/opencode-mcp.js.map +1 -0
- package/dist/core/backends/opencode-server-manager.d.ts +114 -0
- package/dist/core/backends/opencode-server-manager.d.ts.map +1 -0
- package/dist/core/backends/opencode-server-manager.js +222 -0
- package/dist/core/backends/opencode-server-manager.js.map +1 -0
- package/dist/core/backends/opencode-types.d.ts +46 -0
- package/dist/core/backends/opencode-types.d.ts.map +1 -0
- package/dist/core/backends/opencode-types.js +14 -0
- package/dist/core/backends/opencode-types.js.map +1 -0
- package/dist/core/backends/plan-presets.d.ts +18 -5
- package/dist/core/backends/plan-presets.d.ts.map +1 -1
- package/dist/core/backends/plan-presets.js +144 -23
- package/dist/core/backends/plan-presets.js.map +1 -1
- package/dist/core/backends/process-config-cascade.d.ts +35 -0
- package/dist/core/backends/process-config-cascade.d.ts.map +1 -1
- package/dist/core/backends/process-config-cascade.js +35 -1
- package/dist/core/backends/process-config-cascade.js.map +1 -1
- package/dist/core/backends/prompt-utils.d.ts.map +1 -1
- package/dist/core/backends/prompt-utils.js +0 -2
- package/dist/core/backends/prompt-utils.js.map +1 -1
- package/dist/core/backends/quota-reset-hints.d.ts +44 -0
- package/dist/core/backends/quota-reset-hints.d.ts.map +1 -0
- package/dist/core/backends/quota-reset-hints.js +117 -0
- package/dist/core/backends/quota-reset-hints.js.map +1 -0
- package/dist/core/bang-commands/commands-close.d.ts +24 -0
- package/dist/core/bang-commands/commands-close.d.ts.map +1 -0
- package/dist/core/bang-commands/commands-close.js +24 -0
- package/dist/core/bang-commands/commands-close.js.map +1 -0
- package/dist/core/bang-commands/commands-cost.d.ts.map +1 -1
- package/dist/core/bang-commands/commands-cost.js +13 -0
- package/dist/core/bang-commands/commands-cost.js.map +1 -1
- package/dist/core/bang-commands/commands-help.d.ts.map +1 -1
- package/dist/core/bang-commands/commands-help.js +44 -5
- package/dist/core/bang-commands/commands-help.js.map +1 -1
- package/dist/core/bang-commands/commands-report.d.ts.map +1 -1
- package/dist/core/bang-commands/commands-report.js +1 -0
- package/dist/core/bang-commands/commands-report.js.map +1 -1
- package/dist/core/bang-commands/commands-stop-start.d.ts.map +1 -1
- package/dist/core/bang-commands/commands-stop-start.js +2 -0
- package/dist/core/bang-commands/commands-stop-start.js.map +1 -1
- package/dist/core/bang-commands/commands-wiki.d.ts.map +1 -1
- package/dist/core/bang-commands/commands-wiki.js +12 -1
- package/dist/core/bang-commands/commands-wiki.js.map +1 -1
- package/dist/core/bang-commands/format-utils.d.ts +13 -1
- package/dist/core/bang-commands/format-utils.d.ts.map +1 -1
- package/dist/core/bang-commands/format-utils.js +21 -2
- package/dist/core/bang-commands/format-utils.js.map +1 -1
- package/dist/core/bang-commands/index.d.ts +1 -0
- package/dist/core/bang-commands/index.d.ts.map +1 -1
- package/dist/core/bang-commands/index.js +3 -0
- package/dist/core/bang-commands/index.js.map +1 -1
- package/dist/core/bang-commands/registry.d.ts +50 -0
- package/dist/core/bang-commands/registry.d.ts.map +1 -1
- package/dist/core/bang-commands/registry.js +164 -19
- package/dist/core/bang-commands/registry.js.map +1 -1
- package/dist/core/channel-timeline.d.ts +18 -1
- package/dist/core/channel-timeline.d.ts.map +1 -1
- package/dist/core/channel-timeline.js +44 -0
- package/dist/core/channel-timeline.js.map +1 -1
- package/dist/core/context/activity-view-runner.js +9 -1
- package/dist/core/context/activity-view-runner.js.map +1 -1
- package/dist/core/context/default-schedules-runner.js +44 -4
- package/dist/core/context/default-schedules-runner.js.map +1 -1
- package/dist/core/context/domain-index-runner.js +9 -1
- package/dist/core/context/domain-index-runner.js.map +1 -1
- package/dist/core/context/entity-source-rename.d.ts.map +1 -1
- package/dist/core/context/entity-source-rename.js +9 -1
- package/dist/core/context/entity-source-rename.js.map +1 -1
- package/dist/core/context/policy-index-runner.js +9 -1
- package/dist/core/context/policy-index-runner.js.map +1 -1
- package/dist/core/context/reconciler-runner.js +9 -1
- package/dist/core/context/reconciler-runner.js.map +1 -1
- package/dist/core/context-builder.d.ts +97 -2
- package/dist/core/context-builder.d.ts.map +1 -1
- package/dist/core/context-builder.js +303 -30
- package/dist/core/context-builder.js.map +1 -1
- package/dist/core/context-frontmatter.d.ts +6 -0
- package/dist/core/context-frontmatter.d.ts.map +1 -1
- package/dist/core/context-frontmatter.js +120 -8
- package/dist/core/context-frontmatter.js.map +1 -1
- package/dist/core/context-health.js +21 -9
- package/dist/core/context-health.js.map +1 -1
- package/dist/core/context-validation/_pa_wip_context_validation/index.d.ts +19 -0
- package/dist/core/context-validation/_pa_wip_context_validation/index.d.ts.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/index.js +19 -0
- package/dist/core/context-validation/_pa_wip_context_validation/index.js.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/prepare-write.d.ts +94 -0
- package/dist/core/context-validation/_pa_wip_context_validation/prepare-write.d.ts.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/prepare-write.js +130 -0
- package/dist/core/context-validation/_pa_wip_context_validation/prepare-write.js.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/routine-rulebook.d.ts +60 -0
- package/dist/core/context-validation/_pa_wip_context_validation/routine-rulebook.d.ts.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/routine-rulebook.js +156 -0
- package/dist/core/context-validation/_pa_wip_context_validation/routine-rulebook.js.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/section.d.ts +41 -0
- package/dist/core/context-validation/_pa_wip_context_validation/section.d.ts.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/section.js +82 -0
- package/dist/core/context-validation/_pa_wip_context_validation/section.js.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/snapshot-debounce.d.ts +52 -0
- package/dist/core/context-validation/_pa_wip_context_validation/snapshot-debounce.d.ts.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/snapshot-debounce.js +110 -0
- package/dist/core/context-validation/_pa_wip_context_validation/snapshot-debounce.js.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/today.d.ts +85 -0
- package/dist/core/context-validation/_pa_wip_context_validation/today.d.ts.map +1 -0
- package/dist/core/context-validation/_pa_wip_context_validation/today.js +162 -0
- package/dist/core/context-validation/_pa_wip_context_validation/today.js.map +1 -0
- package/dist/core/context-validation/index.d.ts +19 -0
- package/dist/core/context-validation/index.d.ts.map +1 -0
- package/dist/core/context-validation/index.js +19 -0
- package/dist/core/context-validation/index.js.map +1 -0
- package/dist/core/context-validation/prepare-write.d.ts +95 -0
- package/dist/core/context-validation/prepare-write.d.ts.map +1 -0
- package/dist/core/context-validation/prepare-write.js +135 -0
- package/dist/core/context-validation/prepare-write.js.map +1 -0
- package/dist/core/context-validation/routine-rulebook.d.ts +60 -0
- package/dist/core/context-validation/routine-rulebook.d.ts.map +1 -0
- package/dist/core/context-validation/routine-rulebook.js +156 -0
- package/dist/core/context-validation/routine-rulebook.js.map +1 -0
- package/dist/core/context-validation/section.d.ts +41 -0
- package/dist/core/context-validation/section.d.ts.map +1 -0
- package/dist/core/context-validation/section.js +82 -0
- package/dist/core/context-validation/section.js.map +1 -0
- package/dist/core/context-validation/snapshot-debounce.d.ts +52 -0
- package/dist/core/context-validation/snapshot-debounce.d.ts.map +1 -0
- package/dist/core/context-validation/snapshot-debounce.js +110 -0
- package/dist/core/context-validation/snapshot-debounce.js.map +1 -0
- package/dist/core/context-validation/today.d.ts +85 -0
- package/dist/core/context-validation/today.d.ts.map +1 -0
- package/dist/core/context-validation/today.js +168 -0
- package/dist/core/context-validation/today.js.map +1 -0
- package/dist/core/daemon-api-cli.d.ts +6 -5
- package/dist/core/daemon-api-cli.d.ts.map +1 -1
- package/dist/core/daemon-api-cli.js +73 -32
- package/dist/core/daemon-api-cli.js.map +1 -1
- package/dist/core/dispatcher-error-handling.d.ts +13 -0
- package/dist/core/dispatcher-error-handling.d.ts.map +1 -1
- package/dist/core/dispatcher-error-handling.js +69 -0
- package/dist/core/dispatcher-error-handling.js.map +1 -1
- package/dist/core/dispatcher-hourly-check.d.ts +73 -1
- package/dist/core/dispatcher-hourly-check.d.ts.map +1 -1
- package/dist/core/dispatcher-hourly-check.js +249 -151
- package/dist/core/dispatcher-hourly-check.js.map +1 -1
- package/dist/core/dispatcher-message-handler.d.ts +11 -1
- package/dist/core/dispatcher-message-handler.d.ts.map +1 -1
- package/dist/core/dispatcher-message-handler.js +165 -47
- package/dist/core/dispatcher-message-handler.js.map +1 -1
- package/dist/core/dispatcher-morning-routine.d.ts +38 -30
- package/dist/core/dispatcher-morning-routine.d.ts.map +1 -1
- package/dist/core/dispatcher-morning-routine.js +162 -104
- package/dist/core/dispatcher-morning-routine.js.map +1 -1
- package/dist/core/dispatcher-prompt.d.ts +4 -1
- package/dist/core/dispatcher-prompt.d.ts.map +1 -1
- package/dist/core/dispatcher-prompt.js +18 -2
- package/dist/core/dispatcher-prompt.js.map +1 -1
- package/dist/core/dispatcher-repository-helpers.d.ts.map +1 -1
- package/dist/core/dispatcher-repository-helpers.js +5 -1
- package/dist/core/dispatcher-repository-helpers.js.map +1 -1
- package/dist/core/dispatcher-result-processor.d.ts.map +1 -1
- package/dist/core/dispatcher-result-processor.js +9 -4
- package/dist/core/dispatcher-result-processor.js.map +1 -1
- package/dist/core/dispatcher-scheduled-tasks.d.ts +1 -1
- package/dist/core/dispatcher-scheduled-tasks.d.ts.map +1 -1
- package/dist/core/dispatcher-scheduled-tasks.js +79 -16
- package/dist/core/dispatcher-scheduled-tasks.js.map +1 -1
- package/dist/core/dispatcher-types.d.ts +84 -12
- package/dist/core/dispatcher-types.d.ts.map +1 -1
- package/dist/core/dispatcher-types.js.map +1 -1
- package/dist/core/dispatcher.d.ts +50 -1
- package/dist/core/dispatcher.d.ts.map +1 -1
- package/dist/core/dispatcher.js +143 -8
- package/dist/core/dispatcher.js.map +1 -1
- package/dist/core/dm-freshness-metrics.d.ts +6 -5
- package/dist/core/dm-freshness-metrics.d.ts.map +1 -1
- package/dist/core/dm-freshness-metrics.js +7 -6
- package/dist/core/dm-freshness-metrics.js.map +1 -1
- package/dist/core/evening-review-verify.d.ts +164 -0
- package/dist/core/evening-review-verify.d.ts.map +1 -0
- package/dist/core/evening-review-verify.js +637 -0
- package/dist/core/evening-review-verify.js.map +1 -0
- package/dist/core/fetch-window-prompt-loader.d.ts +47 -0
- package/dist/core/fetch-window-prompt-loader.d.ts.map +1 -0
- package/dist/core/fetch-window-prompt-loader.js +72 -0
- package/dist/core/fetch-window-prompt-loader.js.map +1 -0
- package/dist/core/management-md.d.ts.map +1 -1
- package/dist/core/management-md.js +23 -9
- package/dist/core/management-md.js.map +1 -1
- package/dist/core/management-registry.d.ts +13 -21
- package/dist/core/management-registry.d.ts.map +1 -1
- package/dist/core/management-registry.js +27 -48
- package/dist/core/management-registry.js.map +1 -1
- package/dist/core/metrics.d.ts +88 -1
- package/dist/core/metrics.d.ts.map +1 -1
- package/dist/core/metrics.js +78 -2
- package/dist/core/metrics.js.map +1 -1
- package/dist/core/morning/agent-journal-appender.d.ts +197 -0
- package/dist/core/morning/agent-journal-appender.d.ts.map +1 -0
- package/dist/core/morning/agent-journal-appender.js +458 -0
- package/dist/core/morning/agent-journal-appender.js.map +1 -0
- package/dist/core/morning/handoff-parser.d.ts +45 -0
- package/dist/core/morning/handoff-parser.d.ts.map +1 -0
- package/dist/core/morning/handoff-parser.js +117 -0
- package/dist/core/morning/handoff-parser.js.map +1 -0
- package/dist/core/morning/journal-skeleton-builder.d.ts +157 -0
- package/dist/core/morning/journal-skeleton-builder.d.ts.map +1 -0
- package/dist/core/morning/journal-skeleton-builder.js +303 -0
- package/dist/core/morning/journal-skeleton-builder.js.map +1 -0
- package/dist/core/morning/orchestrator.d.ts +312 -0
- package/dist/core/morning/orchestrator.d.ts.map +1 -0
- package/dist/core/morning/orchestrator.js +827 -0
- package/dist/core/morning/orchestrator.js.map +1 -0
- package/dist/core/morning/parent-audit-emitter.d.ts +82 -0
- package/dist/core/morning/parent-audit-emitter.d.ts.map +1 -0
- package/dist/core/morning/parent-audit-emitter.js +120 -0
- package/dist/core/morning/parent-audit-emitter.js.map +1 -0
- package/dist/core/morning/roadmap-skeleton-builder.d.ts +159 -0
- package/dist/core/morning/roadmap-skeleton-builder.d.ts.map +1 -0
- package/dist/core/morning/roadmap-skeleton-builder.js +338 -0
- package/dist/core/morning/roadmap-skeleton-builder.js.map +1 -0
- package/dist/core/output-language-policy.js +1 -1
- package/dist/core/output-language-policy.js.map +1 -1
- package/dist/core/policy-files.d.ts +19 -2
- package/dist/core/policy-files.d.ts.map +1 -1
- package/dist/core/policy-files.js +65 -7
- package/dist/core/policy-files.js.map +1 -1
- package/dist/core/pre-pass-freshness.d.ts +28 -0
- package/dist/core/pre-pass-freshness.d.ts.map +1 -0
- package/dist/core/pre-pass-freshness.js +10 -0
- package/dist/core/pre-pass-freshness.js.map +1 -0
- package/dist/core/previous-week-digest.d.ts +130 -0
- package/dist/core/previous-week-digest.d.ts.map +1 -0
- package/dist/core/previous-week-digest.js +257 -0
- package/dist/core/previous-week-digest.js.map +1 -0
- package/dist/core/prompts.js +3 -3
- package/dist/core/prompts.js.map +1 -1
- package/dist/core/quiet-hours-sync.d.ts.map +1 -1
- package/dist/core/quiet-hours-sync.js +7 -0
- package/dist/core/quiet-hours-sync.js.map +1 -1
- package/dist/core/recurrence.d.ts +13 -0
- package/dist/core/recurrence.d.ts.map +1 -1
- package/dist/core/recurrence.js +108 -13
- package/dist/core/recurrence.js.map +1 -1
- package/dist/core/release-assets.d.ts +21 -1
- package/dist/core/release-assets.d.ts.map +1 -1
- package/dist/core/release-assets.js +58 -3
- package/dist/core/release-assets.js.map +1 -1
- package/dist/core/repository-management-docs.d.ts.map +1 -1
- package/dist/core/repository-management-docs.js +14 -4
- package/dist/core/repository-management-docs.js.map +1 -1
- package/dist/core/review-context.d.ts.map +1 -1
- package/dist/core/review-context.js +29 -1
- package/dist/core/review-context.js.map +1 -1
- package/dist/core/roadmap-maintenance.d.ts +213 -0
- package/dist/core/roadmap-maintenance.d.ts.map +1 -0
- package/dist/core/roadmap-maintenance.js +706 -0
- package/dist/core/roadmap-maintenance.js.map +1 -0
- package/dist/core/roadmap-validate.d.ts +5 -0
- package/dist/core/roadmap-validate.d.ts.map +1 -1
- package/dist/core/roadmap-validate.js +6 -69
- package/dist/core/roadmap-validate.js.map +1 -1
- package/dist/core/routine-acquisition-plan.d.ts +43 -7
- package/dist/core/routine-acquisition-plan.d.ts.map +1 -1
- package/dist/core/routine-acquisition-plan.js +99 -8
- package/dist/core/routine-acquisition-plan.js.map +1 -1
- package/dist/core/routine-fetch-window-retry.d.ts +41 -2
- package/dist/core/routine-fetch-window-retry.d.ts.map +1 -1
- package/dist/core/routine-fetch-window-retry.js +91 -8
- package/dist/core/routine-fetch-window-retry.js.map +1 -1
- package/dist/core/routine-fetch-window-runner.d.ts +55 -21
- package/dist/core/routine-fetch-window-runner.d.ts.map +1 -1
- package/dist/core/routine-fetch-window-runner.js +258 -35
- package/dist/core/routine-fetch-window-runner.js.map +1 -1
- package/dist/core/routine-windows.d.ts +17 -13
- package/dist/core/routine-windows.d.ts.map +1 -1
- package/dist/core/routine-windows.js +78 -36
- package/dist/core/routine-windows.js.map +1 -1
- package/dist/core/scheduler.d.ts +121 -37
- package/dist/core/scheduler.d.ts.map +1 -1
- package/dist/core/scheduler.js +359 -80
- package/dist/core/scheduler.js.map +1 -1
- package/dist/core/session-manager.d.ts +25 -6
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +32 -15
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/skeleton.d.ts.map +1 -1
- package/dist/core/skeleton.js +23 -23
- package/dist/core/skeleton.js.map +1 -1
- package/dist/core/skills-compiler.d.ts +275 -25
- package/dist/core/skills-compiler.d.ts.map +1 -1
- package/dist/core/skills-compiler.js +844 -205
- package/dist/core/skills-compiler.js.map +1 -1
- package/dist/core/skills-manifest.d.ts +104 -0
- package/dist/core/skills-manifest.d.ts.map +1 -1
- package/dist/core/skills-manifest.js +350 -39
- package/dist/core/skills-manifest.js.map +1 -1
- package/dist/core/wiki/git-precompile.d.ts +9 -0
- package/dist/core/wiki/git-precompile.d.ts.map +1 -1
- package/dist/core/wiki/git-precompile.js +7 -1
- package/dist/core/wiki/git-precompile.js.map +1 -1
- package/dist/core/workdir.d.ts +30 -1
- package/dist/core/workdir.d.ts.map +1 -1
- package/dist/core/workdir.js +140 -15
- package/dist/core/workdir.js.map +1 -1
- package/dist/db/entities-store.d.ts +5 -5
- package/dist/db/entities-store.js +5 -5
- package/dist/db/hourly-check-signals.d.ts.map +1 -1
- package/dist/db/hourly-check-signals.js +121 -35
- package/dist/db/hourly-check-signals.js.map +1 -1
- package/dist/db/observations.d.ts +1 -1
- package/dist/db/observations.js +1 -1
- package/dist/db/observations.js.map +1 -1
- package/dist/db/recurring-schedules.d.ts +32 -1
- package/dist/db/recurring-schedules.d.ts.map +1 -1
- package/dist/db/recurring-schedules.js +29 -10
- package/dist/db/recurring-schedules.js.map +1 -1
- package/dist/db/repositories-store.d.ts +2 -1
- package/dist/db/repositories-store.d.ts.map +1 -1
- package/dist/db/repositories-store.js +38 -3
- package/dist/db/repositories-store.js.map +1 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +157 -51
- package/dist/db/schema.js.map +1 -1
- package/dist/db/wiki-store.d.ts.map +1 -1
- package/dist/db/wiki-store.js +3 -0
- package/dist/db/wiki-store.js.map +1 -1
- package/dist/index.js +308 -1480
- package/dist/index.js.map +1 -1
- package/dist/messaging/magic-phrase.d.ts +16 -0
- package/dist/messaging/magic-phrase.d.ts.map +1 -1
- package/dist/messaging/magic-phrase.js +53 -0
- package/dist/messaging/magic-phrase.js.map +1 -1
- package/dist/messaging/owner-channels.d.ts +24 -0
- package/dist/messaging/owner-channels.d.ts.map +1 -1
- package/dist/messaging/owner-channels.js +38 -0
- package/dist/messaging/owner-channels.js.map +1 -1
- package/dist/observers/calendar-poller.d.ts +2 -0
- package/dist/observers/calendar-poller.d.ts.map +1 -1
- package/dist/observers/calendar-poller.js +76 -54
- package/dist/observers/calendar-poller.js.map +1 -1
- package/dist/observers/delegated-sync-worker.d.ts +62 -0
- package/dist/observers/delegated-sync-worker.d.ts.map +1 -1
- package/dist/observers/delegated-sync-worker.js +128 -1
- package/dist/observers/delegated-sync-worker.js.map +1 -1
- package/dist/observers/git-watcher.d.ts +22 -0
- package/dist/observers/git-watcher.d.ts.map +1 -1
- package/dist/observers/git-watcher.js +31 -7
- package/dist/observers/git-watcher.js.map +1 -1
- package/dist/observers/imminent-event-scheduler.d.ts +2 -0
- package/dist/observers/imminent-event-scheduler.d.ts.map +1 -1
- package/dist/observers/imminent-event-scheduler.js +29 -0
- package/dist/observers/imminent-event-scheduler.js.map +1 -1
- package/dist/observers/notion-poller.d.ts +2 -0
- package/dist/observers/notion-poller.d.ts.map +1 -1
- package/dist/observers/notion-poller.js +44 -6
- package/dist/observers/notion-poller.js.map +1 -1
- package/dist/observers/poll-guard.d.ts +63 -0
- package/dist/observers/poll-guard.d.ts.map +1 -0
- package/dist/observers/poll-guard.js +89 -0
- package/dist/observers/poll-guard.js.map +1 -0
- package/dist/safety/absolute-block-audit.d.ts +17 -0
- package/dist/safety/absolute-block-audit.d.ts.map +1 -1
- package/dist/safety/absolute-block-audit.js +28 -2
- package/dist/safety/absolute-block-audit.js.map +1 -1
- package/dist/safety/agent-write-tracker.d.ts +42 -1
- package/dist/safety/agent-write-tracker.d.ts.map +1 -1
- package/dist/safety/agent-write-tracker.js +81 -1
- package/dist/safety/agent-write-tracker.js.map +1 -1
- package/dist/safety/always-disallowed.d.ts +34 -0
- package/dist/safety/always-disallowed.d.ts.map +1 -1
- package/dist/safety/always-disallowed.js +114 -7
- package/dist/safety/always-disallowed.js.map +1 -1
- package/dist/safety/audit.d.ts +20 -0
- package/dist/safety/audit.d.ts.map +1 -1
- package/dist/safety/audit.js +126 -0
- package/dist/safety/audit.js.map +1 -1
- package/dist/safety/risk-classifier.d.ts +17 -1
- package/dist/safety/risk-classifier.d.ts.map +1 -1
- package/dist/safety/risk-classifier.js +75 -7
- package/dist/safety/risk-classifier.js.map +1 -1
- package/dist/safety/subprocess-block-scanner.d.ts +89 -0
- package/dist/safety/subprocess-block-scanner.d.ts.map +1 -0
- package/dist/safety/subprocess-block-scanner.js +177 -0
- package/dist/safety/subprocess-block-scanner.js.map +1 -0
- package/dist/scheduler/hourly-check-gate.d.ts +23 -9
- package/dist/scheduler/hourly-check-gate.d.ts.map +1 -1
- package/dist/scheduler/hourly-check-gate.js +11 -6
- package/dist/scheduler/hourly-check-gate.js.map +1 -1
- package/dist/secrets/backend-api-key-env.d.ts.map +1 -1
- package/dist/secrets/backend-api-key-env.js +1 -0
- package/dist/secrets/backend-api-key-env.js.map +1 -1
- package/dist/services/delegated-backend-invoker.d.ts.map +1 -1
- package/dist/services/delegated-backend-invoker.js +8 -1
- package/dist/services/delegated-backend-invoker.js.map +1 -1
- package/dist/services/delegated-invoker-audit.d.ts.map +1 -1
- package/dist/services/delegated-invoker-audit.js +5 -1
- package/dist/services/delegated-invoker-audit.js.map +1 -1
- package/dist/services/delegated-proxy-config.d.ts +3 -2
- package/dist/services/delegated-proxy-config.d.ts.map +1 -1
- package/dist/services/delegated-proxy-config.js.map +1 -1
- package/dist/services/integrations/extract-write-item-id.d.ts +5 -2
- package/dist/services/integrations/extract-write-item-id.d.ts.map +1 -1
- package/dist/services/integrations/extract-write-item-id.js.map +1 -1
- package/dist/services/mcp/generators/index.d.ts +1 -0
- package/dist/services/mcp/generators/index.d.ts.map +1 -1
- package/dist/services/mcp/generators/index.js +3 -0
- package/dist/services/mcp/generators/index.js.map +1 -1
- package/dist/services/mcp/sdk-observations-server.d.ts +60 -0
- package/dist/services/mcp/sdk-observations-server.d.ts.map +1 -0
- package/dist/services/mcp/sdk-observations-server.js +161 -0
- package/dist/services/mcp/sdk-observations-server.js.map +1 -0
- package/dist/services/mcp/session-materializer.d.ts.map +1 -1
- package/dist/services/mcp/session-materializer.js +13 -9
- package/dist/services/mcp/session-materializer.js.map +1 -1
- package/dist/services/mcp/types.d.ts +1 -0
- package/dist/services/mcp/types.d.ts.map +1 -1
- package/dist/services/notion.d.ts +19 -1
- package/dist/services/notion.d.ts.map +1 -1
- package/dist/services/notion.js +41 -2
- package/dist/services/notion.js.map +1 -1
- package/dist/services/observations-batch.d.ts +100 -0
- package/dist/services/observations-batch.d.ts.map +1 -0
- package/dist/services/observations-batch.js +258 -0
- package/dist/services/observations-batch.js.map +1 -0
- package/dist/services/voice/transcriber.d.ts +23 -0
- package/dist/services/voice/transcriber.d.ts.map +1 -1
- package/dist/services/voice/transcriber.js +55 -0
- package/dist/services/voice/transcriber.js.map +1 -1
- package/dist/settings/runtime-settings.d.ts +9 -6
- package/dist/settings/runtime-settings.d.ts.map +1 -1
- package/dist/settings/runtime-settings.js +50 -17
- package/dist/settings/runtime-settings.js.map +1 -1
- package/package.json +3 -2
- package/dist/api/delegated-proxy-helper.d.ts +0 -33
- package/dist/api/delegated-proxy-helper.d.ts.map +0 -1
- package/dist/api/delegated-proxy-helper.js +0 -54
- package/dist/api/delegated-proxy-helper.js.map +0 -1
- package/dist/core/roadmap-merge.d.ts +0 -7
- package/dist/core/roadmap-merge.d.ts.map +0 -1
- package/dist/core/roadmap-merge.js +0 -187
- package/dist/core/roadmap-merge.js.map +0 -1
- package/dist/db/test-schemas.d.ts +0 -23
- package/dist/db/test-schemas.d.ts.map +0 -1
- package/dist/db/test-schemas.js +0 -111
- package/dist/db/test-schemas.js.map +0 -1
package/dist/core/scheduler.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import cron from "node-cron";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { createEvent, EventPriority, formatSqliteDatetime, getAgentDayBoundsUtc, nowInTimezone, } from "@aitne/shared";
|
|
3
|
+
import { createEvent, EventPriority, formatSqliteDatetime, getAgentDayBoundsUtc, getAgentDayDateStr, isBackendId, isProcessTier, nowInTimezone, } from "@aitne/shared";
|
|
4
4
|
import { runRetentionCleanup } from "./retention.js";
|
|
5
5
|
import { cleanupSessionWorkdir, cleanupStaleWorkdirs, getSessionWorkdirPath } from "./workdir.js";
|
|
6
6
|
import { discardStalePendingSchedules } from "./schedule-maintenance.js";
|
|
7
7
|
import { createLogger } from "../logging.js";
|
|
8
8
|
import { reconcileRecurringSchedules } from "../db/recurring-schedules.js";
|
|
9
|
+
import { getStalledMorningRoutineWake, readMorningRoutineStallThresholdMinutes, } from "../bootstrap/schedule-helpers.js";
|
|
10
|
+
import { readRuntimeState, writeRuntimeState } from "../db/runtime-state.js";
|
|
11
|
+
import { recordProactiveForwardDeliveries } from "./channel-timeline.js";
|
|
12
|
+
/**
|
|
13
|
+
* Runtime-state key holding the agent-day date string (`YYYY-MM-DD`) on
|
|
14
|
+
* which the watchdog last sent an owner DM about the morning routine
|
|
15
|
+
* being stuck. Per-day dedup: the watchdog fires at most once per
|
|
16
|
+
* agent-day even if the cron tick that owns it runs every minute.
|
|
17
|
+
*/
|
|
18
|
+
const MORNING_ROUTINE_STALL_ALERT_KEY = "morning_routine.stall_alert_day";
|
|
9
19
|
const logger = createLogger("scheduler");
|
|
10
20
|
/**
|
|
11
21
|
* True iff `intervalMinutes` cleanly fits inside an hour, so the firing
|
|
@@ -105,6 +115,16 @@ export function buildUserProfileSweepMorningCronExpr(dayBoundaryHour) {
|
|
|
105
115
|
* track the same config knob in lockstep.
|
|
106
116
|
*/
|
|
107
117
|
export const USER_PROFILE_SWEEP_EVENING_CRON_EXPR = "50 17 * * *";
|
|
118
|
+
/**
|
|
119
|
+
* Cron expression for the daemon-side roadmap mechanical maintenance
|
|
120
|
+
* pass: fixed at 17:45 local — 15 min before Evening Review's fixed
|
|
121
|
+
* 18:00 and 5 min before the evening user-profile sweep at 17:50.
|
|
122
|
+
* The ordering matters: this job must release its lock before the
|
|
123
|
+
* surviving evening_review Step 2 (Long-term Plans promotion + Review:
|
|
124
|
+
* fire) acquires `roadmap_write_lock`. See
|
|
125
|
+
* `docs/design/appendices/evening-review-slimdown.md` §2.2.
|
|
126
|
+
*/
|
|
127
|
+
export const ROADMAP_MAINTENANCE_CRON_EXPR = "45 17 * * *";
|
|
108
128
|
/**
|
|
109
129
|
* AgentScheduler — manages recurring cron jobs and the DB-driven ScheduleWatcher.
|
|
110
130
|
*
|
|
@@ -152,6 +172,17 @@ export class AgentScheduler {
|
|
|
152
172
|
* morning flow reads it. The observer owns the run-once guard.
|
|
153
173
|
*/
|
|
154
174
|
onContextIndexReconcile = null;
|
|
175
|
+
/**
|
|
176
|
+
* Evening-review slimdown §2.2 — daily mechanical roadmap.md
|
|
177
|
+
* maintenance pass at 17:45 local, 15 min before evening_review.
|
|
178
|
+
* Wraps `runRoadmapMechanicalMaintenance` so substeps 2a / 2b / 2d
|
|
179
|
+
* run in-process inside the daemon rather than inside a Sonnet
|
|
180
|
+
* routine that would otherwise re-derive the same date math. The
|
|
181
|
+
* callback is fire-and-forget (no return value contract): the
|
|
182
|
+
* implementation owns its own lock acquisition, audit emission, and
|
|
183
|
+
* agent/journal.md append.
|
|
184
|
+
*/
|
|
185
|
+
onRoadmapMaintenance = null;
|
|
155
186
|
/**
|
|
156
187
|
* Setup gate — returns a skip reason when autonomous work should be
|
|
157
188
|
* paused (initial setup incomplete, or setup conversation active).
|
|
@@ -162,26 +193,32 @@ export class AgentScheduler {
|
|
|
162
193
|
autonomousGate = () => null;
|
|
163
194
|
lastGateBlockLoggedAt = 0;
|
|
164
195
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
196
|
+
* Single source of truth for the ScheduleWatcher's between-poll wake
|
|
197
|
+
* signaling, unifying what was previously a (pollAbort: AbortController
|
|
198
|
+
* + hasPendingNudge: boolean) pair (v4.14 audit, Task #3).
|
|
168
199
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
200
|
+
* Mechanics:
|
|
201
|
+
* - `nudgeSeq` is monotonically incremented by every `nudgeWatcher()`
|
|
202
|
+
* call (and `stop()` reuses it to break the sleep too).
|
|
203
|
+
* - `observedSeq` is advanced when a nudge has been consumed —
|
|
204
|
+
* either at the top of `sleepInterruptible` (between-sleep case)
|
|
205
|
+
* or by the resolver path inside `nudgeWatcher()` / `stop()` when
|
|
206
|
+
* they wake an in-flight sleep.
|
|
207
|
+
* - `sleepWaiter` holds the resolver + timer for the currently-pending
|
|
208
|
+
* sleep, if any. The ScheduleWatcher loop awaits sequentially, so
|
|
209
|
+
* at most one waiter exists at a time.
|
|
210
|
+
*
|
|
211
|
+
* Why this replaces the AbortController pair: with a monotonic counter
|
|
212
|
+
* we cannot lose a nudge across a sleep boundary — a `nudgeWatcher()`
|
|
213
|
+
* call that arrives between two sleeps simply leaves `nudgeSeq >
|
|
214
|
+
* observedSeq`, and the next sleep entry consumes it. The two-stage
|
|
215
|
+
* (flag + signal) scheme was correct on paper but required readers to
|
|
216
|
+
* trace the precise synchronous ordering of three branches in
|
|
217
|
+
* `sleepInterruptible`; the counter compresses that to one branch.
|
|
183
218
|
*/
|
|
184
|
-
|
|
219
|
+
nudgeSeq = 0;
|
|
220
|
+
observedSeq = 0;
|
|
221
|
+
sleepWaiter = null;
|
|
185
222
|
constructor(eventBus, db, config) {
|
|
186
223
|
this.eventBus = eventBus;
|
|
187
224
|
this.db = db;
|
|
@@ -221,6 +258,16 @@ export class AgentScheduler {
|
|
|
221
258
|
setContextIndexReconcilerCallback(fn) {
|
|
222
259
|
this.onContextIndexReconcile = fn;
|
|
223
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Register the daily roadmap mechanical maintenance callback. Called
|
|
263
|
+
* at 17:45 local; the callback is fire-and-forget — it owns its own
|
|
264
|
+
* lock acquisition, validation, audit emission, and journal append.
|
|
265
|
+
* Failures are logged but do NOT cascade into the 18:00
|
|
266
|
+
* evening_review.
|
|
267
|
+
*/
|
|
268
|
+
setRoadmapMaintenanceCallback(fn) {
|
|
269
|
+
this.onRoadmapMaintenance = fn;
|
|
270
|
+
}
|
|
224
271
|
/**
|
|
225
272
|
* Register the autonomous-work gate. Returning null allows autonomous work;
|
|
226
273
|
* any non-null string is treated as a skip reason and surfaced in logs.
|
|
@@ -236,6 +283,112 @@ export class AgentScheduler {
|
|
|
236
283
|
this.lastGateBlockLoggedAt = now;
|
|
237
284
|
logger.info({ ...context, reason }, "Autonomous work paused (setup gate)");
|
|
238
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* In-process re-entrance mutex for the stall watchdog. The hourly cron
|
|
288
|
+
* fires the watchdog as a fire-and-forget promise; a slow `sendDm`
|
|
289
|
+
* (DM hub latency, owner channel reconnect) could overlap with the
|
|
290
|
+
* next hourly tick. Without serialization both invocations would pass
|
|
291
|
+
* the dedup-marker read (the marker isn't written until AFTER the DM
|
|
292
|
+
* succeeds, see below) and emit duplicate alerts. The mutex is
|
|
293
|
+
* process-local — fine, since a single scheduler instance is the only
|
|
294
|
+
* watchdog firing path.
|
|
295
|
+
*/
|
|
296
|
+
morningStallWatchdogRunning = false;
|
|
297
|
+
/**
|
|
298
|
+
* Watchdog for the silent-stall pattern documented in the v4.14 audit
|
|
299
|
+
* (CLAUDE.md "morning_routine wake stall"). When the morning routine
|
|
300
|
+
* never writes an `agent_actions.result='success'` row, the dedup
|
|
301
|
+
* inside `queueMorningRoutineWake` keeps the stuck wake row pinned in
|
|
302
|
+
* `pending`/`running` and the hourly-check pre-routine gate silently
|
|
303
|
+
* skips every subsequent autonomous tick. The user gets no morning
|
|
304
|
+
* brief, no evening review, no hourly check, and no error — the
|
|
305
|
+
* system is functionally dead until the wake row clears.
|
|
306
|
+
*
|
|
307
|
+
* Detection: oldest `task_type='wake'` row tied to
|
|
308
|
+
* `routine='morning_routine'` older than the configured threshold (see
|
|
309
|
+
* `readMorningRoutineStallThresholdMinutes`) with no matching
|
|
310
|
+
* `agent_actions.result='success'` row in the current agent-day window.
|
|
311
|
+
*
|
|
312
|
+
* Delivery & dedup: DM-then-mark, NOT mark-then-DM. A failed DM (DM
|
|
313
|
+
* hub error, missing owner channel) leaves the marker empty so the
|
|
314
|
+
* next hourly tick retries. Repeat alerts on a chronically-broken DM
|
|
315
|
+
* channel are accepted as the lesser evil vs. a silent miss. The
|
|
316
|
+
* `morningStallWatchdogRunning` mutex serialises overlapping
|
|
317
|
+
* invocations so a slow DM cannot produce duplicate alerts.
|
|
318
|
+
*
|
|
319
|
+
* Fire-and-forget: returns nothing, surfaces all failures via logger.
|
|
320
|
+
* The owner DM is best-effort — a sendDm failure logs and does NOT
|
|
321
|
+
* re-throw, so a missing or broken message hub cannot cascade into a
|
|
322
|
+
* cron-callback exception.
|
|
323
|
+
*/
|
|
324
|
+
async checkMorningRoutineStall(now) {
|
|
325
|
+
if (this.morningStallWatchdogRunning) {
|
|
326
|
+
logger.debug("Morning routine stall watchdog already running — skipping overlap");
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
this.morningStallWatchdogRunning = true;
|
|
330
|
+
try {
|
|
331
|
+
let stalled;
|
|
332
|
+
try {
|
|
333
|
+
const thresholdMinutes = readMorningRoutineStallThresholdMinutes(this.db);
|
|
334
|
+
stalled = getStalledMorningRoutineWake(this.db, this.config, thresholdMinutes, now);
|
|
335
|
+
}
|
|
336
|
+
catch (err) {
|
|
337
|
+
logger.warn({ err }, "Morning routine stall watchdog query failed");
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (!stalled)
|
|
341
|
+
return;
|
|
342
|
+
let today;
|
|
343
|
+
try {
|
|
344
|
+
today = getAgentDayDateStr(this.config.timezone || undefined, this.config.dayBoundaryHour, now);
|
|
345
|
+
}
|
|
346
|
+
catch (err) {
|
|
347
|
+
// getAgentDayDateStr can throw on invalid timezone config. Surface
|
|
348
|
+
// and bail rather than mis-key the dedup marker.
|
|
349
|
+
logger.warn({ err }, "Morning routine stall watchdog: agent-day resolution failed");
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const lastAlertDay = readRuntimeState(this.db, MORNING_ROUTINE_STALL_ALERT_KEY);
|
|
353
|
+
if (lastAlertDay === today) {
|
|
354
|
+
logger.debug({ today, stalledRowId: stalled.id, ageMinutes: stalled.ageMinutes }, "Morning routine stall watchdog already alerted today");
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
logger.warn({
|
|
358
|
+
stalledRowId: stalled.id,
|
|
359
|
+
ageMinutes: stalled.ageMinutes,
|
|
360
|
+
status: stalled.status,
|
|
361
|
+
scheduledFor: stalled.scheduledFor,
|
|
362
|
+
}, "Morning routine stall detected — alerting owner");
|
|
363
|
+
if (!this.sendDm) {
|
|
364
|
+
logger.warn({ stalledRowId: stalled.id }, "Morning routine stall watchdog: sendDm callback not registered; will retry next tick");
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const message = `Aitne: morning routine stalled ${stalled.ageMinutes} min `
|
|
368
|
+
+ `(wake #${stalled.id}, status=${stalled.status}). Hourly check + `
|
|
369
|
+
+ `evening review blocked. Check logs or \`aitne restart\`.`;
|
|
370
|
+
try {
|
|
371
|
+
await this.sendDm(message);
|
|
372
|
+
}
|
|
373
|
+
catch (err) {
|
|
374
|
+
logger.warn({ err, stalledRowId: stalled.id }, "Morning routine stall watchdog: sendDm failed; dedup marker NOT set — next tick will retry");
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
// Mark dedup ONLY after a successful DM. A persistence failure here
|
|
378
|
+
// would produce one duplicate DM on the next tick — acceptable, and
|
|
379
|
+
// strictly better than the alternative (alert lost forever on
|
|
380
|
+
// transient sendDm failures).
|
|
381
|
+
try {
|
|
382
|
+
writeRuntimeState(this.db, MORNING_ROUTINE_STALL_ALERT_KEY, today);
|
|
383
|
+
}
|
|
384
|
+
catch (err) {
|
|
385
|
+
logger.warn({ err }, "Morning routine stall watchdog: failed to persist dedup marker; next tick may re-alert");
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
finally {
|
|
389
|
+
this.morningStallWatchdogRunning = false;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
239
392
|
start() {
|
|
240
393
|
this.setupRecurringJobs();
|
|
241
394
|
this.startScheduleWatcher();
|
|
@@ -243,9 +396,12 @@ export class AgentScheduler {
|
|
|
243
396
|
}
|
|
244
397
|
stop() {
|
|
245
398
|
this.shutdown = true;
|
|
246
|
-
// Wake up the ScheduleWatcher's poll sleep so the loop returns
|
|
247
|
-
// instead of waiting for the next interval tick.
|
|
248
|
-
|
|
399
|
+
// Wake up the ScheduleWatcher's poll sleep so the loop returns
|
|
400
|
+
// immediately instead of waiting for the next interval tick. The
|
|
401
|
+
// sleepInterruptible body re-checks `shutdown` before re-entering
|
|
402
|
+
// its `new Promise` block, so simply resolving any in-flight waiter
|
|
403
|
+
// is enough — no need to broadcast through the nudge counter.
|
|
404
|
+
this.consumeWaiter();
|
|
249
405
|
this.stopCronJobs();
|
|
250
406
|
logger.info("Scheduler stopped");
|
|
251
407
|
}
|
|
@@ -256,17 +412,35 @@ export class AgentScheduler {
|
|
|
256
412
|
*
|
|
257
413
|
* Safe to call any time after `start()` (and a no-op before): the public
|
|
258
414
|
* surface is idempotent — multiple rapid calls coalesce into a single
|
|
259
|
-
* extra wake at the next sleep boundary.
|
|
260
|
-
* the
|
|
261
|
-
*
|
|
415
|
+
* extra wake at the next sleep boundary. Between-sleep nudges land on
|
|
416
|
+
* the monotonic `nudgeSeq` counter and are consumed at the top of the
|
|
417
|
+
* next `sleepInterruptible`; in-flight nudges resolve the active
|
|
418
|
+
* waiter directly. Both paths advance `observedSeq` so a single nudge
|
|
419
|
+
* skips exactly one sleep, never two.
|
|
262
420
|
*
|
|
263
421
|
* Wired today from `queueMorningRoutineWake` (post-setup, post-Google-auth,
|
|
264
422
|
* catchup); other `INSERT INTO agent_schedule` sites use future-dated rows
|
|
265
423
|
* and do not need a nudge.
|
|
266
424
|
*/
|
|
267
425
|
nudgeWatcher() {
|
|
268
|
-
this.
|
|
269
|
-
this.
|
|
426
|
+
this.nudgeSeq += 1;
|
|
427
|
+
if (this.sleepWaiter) {
|
|
428
|
+
this.observedSeq = this.nudgeSeq;
|
|
429
|
+
this.consumeWaiter();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Resolve and clear the active `sleepWaiter`, if any. Used by both
|
|
434
|
+
* `stop()` and `nudgeWatcher()` to break a running sleep. Safe to call
|
|
435
|
+
* when no waiter exists — it's a no-op.
|
|
436
|
+
*/
|
|
437
|
+
consumeWaiter() {
|
|
438
|
+
const waiter = this.sleepWaiter;
|
|
439
|
+
if (!waiter)
|
|
440
|
+
return;
|
|
441
|
+
this.sleepWaiter = null;
|
|
442
|
+
clearTimeout(waiter.timer);
|
|
443
|
+
waiter.resolve();
|
|
270
444
|
}
|
|
271
445
|
/** Hot-reload cron schedules (e.g. after dayBoundaryHour changes) */
|
|
272
446
|
reloadCrons() {
|
|
@@ -341,9 +515,33 @@ export class AgentScheduler {
|
|
|
341
515
|
this.emitRoutine("user_profile_sweep", { phase: "evening" });
|
|
342
516
|
}, { timezone: tz });
|
|
343
517
|
this.cronJobs.push(sweepEveningJob);
|
|
344
|
-
//
|
|
518
|
+
// Roadmap mechanical maintenance (evening-review slimdown §2.2):
|
|
519
|
+
// 17:45 local, 15 min before evening_review's 18:00 fire. Runs the
|
|
520
|
+
// typed in-process pass (substeps 2a / 2b / 2d) that legacy
|
|
521
|
+
// evening_review used to do via a Sonnet routine. The job is gated
|
|
522
|
+
// by `autonomousGate` like every other autonomous cron, but
|
|
523
|
+
// intentionally does NOT inherit the `morning_routine_pending_for_today`
|
|
524
|
+
// skip — mechanical roadmap maintenance is independent of whether
|
|
525
|
+
// the morning routine ran, and inheriting the gate would block
|
|
526
|
+
// maintenance on the very days the operator needs roadmap.md to
|
|
527
|
+
// stay clean.
|
|
528
|
+
const roadmapMaintenanceJob = cron.schedule(ROADMAP_MAINTENANCE_CRON_EXPR, () => {
|
|
529
|
+
const gateReason = this.autonomousGate();
|
|
530
|
+
if (gateReason !== null) {
|
|
531
|
+
this.logGateBlock(gateReason, { cron: "roadmap_maintenance" });
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
try {
|
|
535
|
+
this.onRoadmapMaintenance?.();
|
|
536
|
+
}
|
|
537
|
+
catch (err) {
|
|
538
|
+
logger.warn({ err }, "Roadmap maintenance callback threw");
|
|
539
|
+
}
|
|
540
|
+
}, { timezone: tz });
|
|
541
|
+
this.cronJobs.push(roadmapMaintenanceJob);
|
|
542
|
+
// Weekly Review: Friday at 19:00 (one hour after evening_review)
|
|
345
543
|
// Emits a separate routine event so the prompt can generate weekly/YYYY-Www.md
|
|
346
|
-
const weeklyJob = cron.schedule("0
|
|
544
|
+
const weeklyJob = cron.schedule("0 19 * * 5", () => {
|
|
347
545
|
const gateReason = this.autonomousGate();
|
|
348
546
|
if (gateReason !== null) {
|
|
349
547
|
this.logGateBlock(gateReason, { cron: "weekly_review" });
|
|
@@ -354,8 +552,19 @@ export class AgentScheduler {
|
|
|
354
552
|
this.cronJobs.push(weeklyJob);
|
|
355
553
|
// Monthly Review: last day of month at 18:00
|
|
356
554
|
// node-cron doesn't directly support "last day of month",
|
|
357
|
-
// so we run daily at 18:00 and check if tomorrow is the 1st
|
|
555
|
+
// so we run daily at 18:00 and check if tomorrow is the 1st.
|
|
556
|
+
//
|
|
557
|
+
// Default OFF pre-release (see runtime-settings.ts:monthlyReviewEnabled).
|
|
558
|
+
// The cron is always registered, but the callback consults
|
|
559
|
+
// `this.config.monthlyReviewEnabled` at fire time so a runtime PATCH
|
|
560
|
+
// takes effect on the next month-end without restart — that is also
|
|
561
|
+
// why this key is intentionally absent from SCHEDULE_KEYS in
|
|
562
|
+
// dashboard/config.ts (no cron rebuild needed). The routine itself
|
|
563
|
+
// (task-flow, context-builder branch, retention coupling) stays in
|
|
564
|
+
// tree as a concept pending the Mirror+Prune redesign.
|
|
358
565
|
const monthlyJob = cron.schedule("0 18 * * *", () => {
|
|
566
|
+
if (!this.config.monthlyReviewEnabled)
|
|
567
|
+
return;
|
|
359
568
|
// Check if tomorrow (in configured timezone) is the 1st
|
|
360
569
|
const tomorrow = new Date();
|
|
361
570
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
@@ -431,6 +640,13 @@ export class AgentScheduler {
|
|
|
431
640
|
logger.warn({ err }, "Auth probe callback failed");
|
|
432
641
|
});
|
|
433
642
|
}
|
|
643
|
+
// Morning-routine stall watchdog. Runs alongside the auth probe
|
|
644
|
+
// because both are observability hooks that should fire even
|
|
645
|
+
// when the hourly check itself gets gated (e.g., the gate
|
|
646
|
+
// skip is the *symptom* the watchdog needs to catch).
|
|
647
|
+
void this.checkMorningRoutineStall(now).catch((err) => {
|
|
648
|
+
logger.warn({ err }, "Morning routine stall watchdog threw");
|
|
649
|
+
});
|
|
434
650
|
if (this.onHourlyCheck) {
|
|
435
651
|
void this.onHourlyCheck("cron");
|
|
436
652
|
}
|
|
@@ -537,11 +753,34 @@ export class AgentScheduler {
|
|
|
537
753
|
postCatchupHourlyCheck: mergedHourlyCheck,
|
|
538
754
|
importance: "low",
|
|
539
755
|
};
|
|
756
|
+
// Bump `scheduled_for` forward when the new caller's NOW lies
|
|
757
|
+
// after the existing row's stored timestamp. Closes a narrow but
|
|
758
|
+
// silent race around the agent-day boundary:
|
|
759
|
+
//
|
|
760
|
+
// - existing wake row was inserted just before the boundary
|
|
761
|
+
// (e.g. 03:59:59 local) with `scheduled_for = 03:59:59`;
|
|
762
|
+
// - this caller (the 04:00 cron, or any post-boundary trigger)
|
|
763
|
+
// dedup-merges instead of inserting;
|
|
764
|
+
// - without bumping `scheduled_for`, the merged row keeps the
|
|
765
|
+
// pre-boundary timestamp and the next ScheduleWatcher tick
|
|
766
|
+
// marks it `skipped` via `discardStalePendingSchedules`
|
|
767
|
+
// (which discards `pending` rows with `scheduled_for <
|
|
768
|
+
// currentAgentDayStartUtc`), silently losing the wake.
|
|
769
|
+
//
|
|
770
|
+
// `MAX(scheduled_for, ?)` keeps legitimate future-dated retry
|
|
771
|
+
// rows (scheduleMorningRetry inserts with a +5/10/15 min back-
|
|
772
|
+
// off) at their original time — the retry chain's exponential
|
|
773
|
+
// back-off is preserved. Only past-dated rows get pulled forward,
|
|
774
|
+
// which is exactly the boundary-race shape this guards against.
|
|
775
|
+
// Both timestamps are produced by `formatSqliteDatetime` (the
|
|
776
|
+
// `YYYY-MM-DD HH:MM:SS` zero-padded form), so SQLite's string
|
|
777
|
+
// comparison ranks them chronologically.
|
|
540
778
|
this.db
|
|
541
779
|
.prepare(`UPDATE agent_schedule
|
|
542
|
-
SET task_context =
|
|
780
|
+
SET task_context = ?,
|
|
781
|
+
scheduled_for = MAX(scheduled_for, ?)
|
|
543
782
|
WHERE id = ?`)
|
|
544
|
-
.run(JSON.stringify(mergedContext), existing.id);
|
|
783
|
+
.run(JSON.stringify(mergedContext), scheduledFor, existing.id);
|
|
545
784
|
return { inserted: false, existingId: existing.id };
|
|
546
785
|
}
|
|
547
786
|
this.db
|
|
@@ -574,7 +813,6 @@ export class AgentScheduler {
|
|
|
574
813
|
* UPDATE ... SET status='running' WHERE status='pending' succeeds.
|
|
575
814
|
*/
|
|
576
815
|
startScheduleWatcher() {
|
|
577
|
-
this.pollAbort = new AbortController();
|
|
578
816
|
const loop = async () => {
|
|
579
817
|
while (!this.shutdown) {
|
|
580
818
|
try {
|
|
@@ -644,16 +882,30 @@ export class AgentScheduler {
|
|
|
644
882
|
taskContext: JSON.parse(row.task_context ?? "{}"),
|
|
645
883
|
correlationId: row.correlation_id ?? base.correlationId,
|
|
646
884
|
scheduleId: row.id,
|
|
647
|
-
//
|
|
648
|
-
//
|
|
649
|
-
//
|
|
650
|
-
//
|
|
651
|
-
//
|
|
652
|
-
|
|
885
|
+
// Tier override takes precedence over the legacy model
|
|
886
|
+
// field at dispatch (the dispatcher inspects
|
|
887
|
+
// requestedTier ahead of requestedModel). The schema
|
|
888
|
+
// CHECK already constrains the column to lite/medium/high,
|
|
889
|
+
// so the in-cast is safe.
|
|
890
|
+
...(isProcessTier(row.tier_override)
|
|
891
|
+
? { requestedTier: row.tier_override }
|
|
892
|
+
: {}),
|
|
893
|
+
// `agent_schedule.model` is operator-supplied. Three
|
|
894
|
+
// resolution branches (SCHEDULE_API_REDESIGN_PLAN §4.3a):
|
|
895
|
+
// 1. legacy alias 'sonnet' / 'opus' → `requestedModel`
|
|
896
|
+
// 2. registered model id paired with backend_id →
|
|
897
|
+
// emit BOTH `requestedBackendId` and
|
|
898
|
+
// `requestedModelId` so the dispatcher's override
|
|
899
|
+
// block (which guards on both fields together)
|
|
900
|
+
// actually fires. Without the backend companion the
|
|
901
|
+
// pin is silently dropped.
|
|
902
|
+
// 3. model present but backend_id NULL (legacy rows or
|
|
903
|
+
// pure-tier rows) → fall through to no-override so
|
|
904
|
+
// the row resolves via process-key defaults.
|
|
653
905
|
...(row.model === "sonnet" || row.model === "opus"
|
|
654
906
|
? { requestedModel: row.model }
|
|
655
|
-
: row.model
|
|
656
|
-
? { requestedModelId: row.model }
|
|
907
|
+
: row.model && row.backend_id && isBackendId(row.backend_id)
|
|
908
|
+
? { requestedBackendId: row.backend_id, requestedModelId: row.model }
|
|
657
909
|
: {}),
|
|
658
910
|
};
|
|
659
911
|
await this.eventBus.put(event);
|
|
@@ -689,16 +941,22 @@ export class AgentScheduler {
|
|
|
689
941
|
...(liftedReplyTarget
|
|
690
942
|
? { data: { ...base.data, reply_target: liftedReplyTarget } }
|
|
691
943
|
: {}),
|
|
692
|
-
//
|
|
693
|
-
//
|
|
694
|
-
//
|
|
695
|
-
//
|
|
696
|
-
|
|
697
|
-
|
|
944
|
+
// Tier override takes precedence over the legacy model
|
|
945
|
+
// field at dispatch (the dispatcher inspects
|
|
946
|
+
// requestedTier ahead of requestedModel). The schema
|
|
947
|
+
// CHECK already constrains the column to lite/medium/high.
|
|
948
|
+
...(isProcessTier(row.tier_override)
|
|
949
|
+
? { requestedTier: row.tier_override }
|
|
950
|
+
: {}),
|
|
951
|
+
// `agent_schedule.model` is operator-supplied. See the
|
|
952
|
+
// scheduled.dm branch above (SCHEDULE_API_REDESIGN_PLAN
|
|
953
|
+
// §4.3a) for the three resolution branches. Same shape —
|
|
954
|
+
// a registered full model id requires the `backend_id`
|
|
955
|
+
// companion or it falls through to process-key defaults.
|
|
698
956
|
...(row.model === "sonnet" || row.model === "opus"
|
|
699
957
|
? { requestedModel: row.model }
|
|
700
|
-
: row.model
|
|
701
|
-
? { requestedModelId: row.model }
|
|
958
|
+
: row.model && row.backend_id && isBackendId(row.backend_id)
|
|
959
|
+
? { requestedBackendId: row.backend_id, requestedModelId: row.model }
|
|
702
960
|
: {}),
|
|
703
961
|
};
|
|
704
962
|
await this.eventBus.put(event);
|
|
@@ -741,50 +999,47 @@ export class AgentScheduler {
|
|
|
741
999
|
void loop();
|
|
742
1000
|
}
|
|
743
1001
|
/**
|
|
744
|
-
* Sleep for `ms` milliseconds, but resolve early
|
|
745
|
-
* Used by the ScheduleWatcher between polls so
|
|
746
|
-
*
|
|
1002
|
+
* Sleep for `ms` milliseconds, but resolve early when `stop()` or
|
|
1003
|
+
* `nudgeWatcher()` fire. Used by the ScheduleWatcher between polls so
|
|
1004
|
+
* shutdown / "wake now" signals interrupt the wait.
|
|
747
1005
|
*
|
|
748
|
-
* Resolution order:
|
|
1006
|
+
* Resolution order (single linear sequence — no branch fan-out):
|
|
749
1007
|
* 1. `shutdown` → immediate resolve.
|
|
750
|
-
* 2.
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
* 4. otherwise wait for either the timer or a fresh abort.
|
|
1008
|
+
* 2. `nudgeSeq > observedSeq` → consume + immediate resolve. Covers
|
|
1009
|
+
* every nudge that arrived while no sleep was active (before the
|
|
1010
|
+
* first sleep ever ran, or between two consecutive sleeps).
|
|
1011
|
+
* 3. otherwise install a `sleepWaiter` with a setTimeout and wait;
|
|
1012
|
+
* the resolver is invoked either by the timer or by a subsequent
|
|
1013
|
+
* `stop()` / `nudgeWatcher()` via `consumeWaiter()`.
|
|
757
1014
|
*
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
* `nudgeWatcher
|
|
761
|
-
*
|
|
762
|
-
*
|
|
1015
|
+
* Invariant: `observedSeq` only advances on consumption, so a `nudgeSeq`
|
|
1016
|
+
* bump that arrives during the active sleep is observed by the caller
|
|
1017
|
+
* (`nudgeWatcher`) which advances `observedSeq` AND resolves the waiter
|
|
1018
|
+
* in the same synchronous block. A bump that arrives between sleeps is
|
|
1019
|
+
* still visible (`nudgeSeq > observedSeq`) on the next entry and gets
|
|
1020
|
+
* consumed there. The counter therefore cannot lose a nudge across the
|
|
1021
|
+
* sleep boundary that the previous AbortController scheme had to guard
|
|
1022
|
+
* against with a separate `hasPendingNudge` flag.
|
|
763
1023
|
*/
|
|
764
1024
|
sleepInterruptible(ms) {
|
|
765
1025
|
if (this.shutdown)
|
|
766
1026
|
return Promise.resolve();
|
|
767
|
-
if (this.
|
|
768
|
-
this.
|
|
1027
|
+
if (this.nudgeSeq > this.observedSeq) {
|
|
1028
|
+
this.observedSeq = this.nudgeSeq;
|
|
769
1029
|
return Promise.resolve();
|
|
770
1030
|
}
|
|
771
|
-
if (this.pollAbort?.signal.aborted) {
|
|
772
|
-
this.pollAbort = new AbortController();
|
|
773
|
-
return Promise.resolve();
|
|
774
|
-
}
|
|
775
|
-
this.pollAbort = this.pollAbort ?? new AbortController();
|
|
776
|
-
const signal = this.pollAbort.signal;
|
|
777
1031
|
return new Promise((resolve) => {
|
|
778
|
-
const onAbort = () => {
|
|
779
|
-
this.hasPendingNudge = false;
|
|
780
|
-
clearTimeout(timer);
|
|
781
|
-
resolve();
|
|
782
|
-
};
|
|
783
1032
|
const timer = setTimeout(() => {
|
|
784
|
-
|
|
1033
|
+
// Natural timer expiry. Clear the waiter ONLY if it still points
|
|
1034
|
+
// at this resolver — defensive against a `nudgeWatcher()` /
|
|
1035
|
+
// `stop()` that interleaved between `setTimeout` firing and this
|
|
1036
|
+
// callback running (the race window is microscopic but real).
|
|
1037
|
+
if (this.sleepWaiter?.resolve === resolve) {
|
|
1038
|
+
this.sleepWaiter = null;
|
|
1039
|
+
}
|
|
785
1040
|
resolve();
|
|
786
1041
|
}, ms);
|
|
787
|
-
|
|
1042
|
+
this.sleepWaiter = { resolve, timer };
|
|
788
1043
|
});
|
|
789
1044
|
}
|
|
790
1045
|
/**
|
|
@@ -828,6 +1083,30 @@ export class AgentScheduler {
|
|
|
828
1083
|
for (const item of delivery) {
|
|
829
1084
|
insert.run(dispatchId, item.platform, item.channel, item.messageId ?? null, summary);
|
|
830
1085
|
}
|
|
1086
|
+
// DM-HISTORY-CONTINUITY-FIX H-1 — also record the dispatch into
|
|
1087
|
+
// `messages` via the shared channel-timeline path. `notification_log`
|
|
1088
|
+
// remains the source of truth for delivery telemetry / retry dedup;
|
|
1089
|
+
// `messages` is the source of truth for conversational continuity
|
|
1090
|
+
// (consumed by `<conversation_history>` and the cross-session bridge
|
|
1091
|
+
// when the owner replies). Wrapped in its own try/catch so a
|
|
1092
|
+
// messages-write failure cannot mask an otherwise-successful DM:
|
|
1093
|
+
// the user already received the message, we only lose history
|
|
1094
|
+
// continuity for this single turn.
|
|
1095
|
+
try {
|
|
1096
|
+
recordProactiveForwardDeliveries({
|
|
1097
|
+
db: this.db,
|
|
1098
|
+
config: this.config,
|
|
1099
|
+
deliveries: delivery,
|
|
1100
|
+
content: row.task_description ?? "",
|
|
1101
|
+
dispatchId,
|
|
1102
|
+
dispatchIds: [dispatchId],
|
|
1103
|
+
originSessionIds: [],
|
|
1104
|
+
notificationType: "scheduled_dm",
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
catch (recErr) {
|
|
1108
|
+
logger.warn({ err: recErr, taskId: row.id, dispatchId }, "Failed to record scheduled DM into messages — delivery already succeeded");
|
|
1109
|
+
}
|
|
831
1110
|
this.db
|
|
832
1111
|
.prepare("UPDATE agent_schedule SET status = 'completed' WHERE id = ?")
|
|
833
1112
|
.run(row.id);
|