@aitne/daemon 0.1.9 → 0.1.11
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/adapter-watchdog.d.ts +70 -0
- package/dist/adapters/adapter-watchdog.js +115 -0
- package/dist/adapters/discord.d.ts +17 -1
- package/dist/adapters/discord.js +33 -0
- package/dist/adapters/notification-manager.d.ts +27 -1
- package/dist/adapters/notification-manager.js +54 -39
- package/dist/adapters/slack-adapter.d.ts +26 -1
- package/dist/adapters/slack-adapter.js +41 -0
- package/dist/adapters/telegram-adapter.d.ts +18 -1
- package/dist/adapters/telegram-adapter.js +41 -2
- package/dist/adapters/types.d.ts +20 -0
- package/dist/adapters/whatsapp-adapter.d.ts +26 -7
- package/dist/adapters/whatsapp-adapter.js +74 -21
- package/dist/api/env-writer.d.ts +1 -0
- package/dist/api/env-writer.js +17 -7
- package/dist/api/helpers/agent-errors-registry.d.ts +5 -5
- package/dist/api/helpers/agent-errors-registry.js +5 -5
- package/dist/api/routes/agent-schedule.js +5 -1
- package/dist/api/routes/agent.js +33 -12
- package/dist/api/routes/agents/index.js +75 -16
- package/dist/api/routes/agents/views.d.ts +37 -2
- package/dist/api/routes/agents/views.js +64 -2
- package/dist/api/routes/apple-calendar.js +4 -1
- package/dist/api/routes/background-task.d.ts +22 -0
- package/dist/api/routes/background-task.js +338 -0
- package/dist/api/routes/browser-history.js +9 -1
- package/dist/api/routes/calendar.js +12 -2
- package/dist/api/routes/context/path-resolve.js +6 -1
- package/dist/api/routes/context/permissions.js +12 -2
- package/dist/api/routes/context/snapshots.js +0 -3
- package/dist/api/routes/context/write.js +3 -17
- package/dist/api/routes/dashboard/config.js +58 -12
- package/dist/api/routes/dashboard/cost-approvals.js +66 -0
- package/dist/api/routes/dashboard/notifications.js +9 -9
- package/dist/api/routes/dashboard/oauth-google.js +5 -3
- package/dist/api/routes/feedback.d.ts +3 -0
- package/dist/api/routes/feedback.js +349 -0
- package/dist/api/routes/git.js +10 -3
- package/dist/api/routes/github.js +5 -1
- package/dist/api/routes/integrations/crud-patch.js +5 -1
- package/dist/api/routes/integrations-reconcile.js +2 -2
- package/dist/api/routes/mcp.js +65 -13
- package/dist/api/routes/notion.d.ts +1 -1
- package/dist/api/routes/observations.js +7 -7
- package/dist/api/routes/obsidian.d.ts +1 -1
- package/dist/api/routes/receipts.js +5 -1
- package/dist/api/routes/setup-migrate.js +1 -1
- package/dist/api/routes/setup.js +1 -1
- package/dist/api/routes/task-flows.d.ts +1 -1
- package/dist/api/routes/task-flows.js +1 -1
- package/dist/api/routes/tuning.d.ts +29 -0
- package/dist/api/routes/tuning.js +304 -0
- package/dist/api/server.d.ts +44 -16
- package/dist/api/server.js +12 -0
- package/dist/bootstrap/adapters.d.ts +19 -0
- package/dist/bootstrap/adapters.js +61 -0
- package/dist/bootstrap/api.d.ts +5 -3
- package/dist/bootstrap/api.js +45 -13
- package/dist/bootstrap/catchup.d.ts +1 -1
- package/dist/bootstrap/catchup.js +11 -11
- package/dist/bootstrap/event-pipeline.d.ts +11 -0
- package/dist/bootstrap/event-pipeline.js +246 -8
- package/dist/bootstrap/observers.js +9 -6
- package/dist/bootstrap/schedule-helpers.d.ts +104 -6
- package/dist/bootstrap/schedule-helpers.js +172 -19
- package/dist/config.js +32 -12
- package/dist/core/agent-core.d.ts +33 -1
- package/dist/core/agent-core.js +36 -1
- package/dist/core/agents/activity-scan-cadence.d.ts +103 -0
- package/dist/core/agents/activity-scan-cadence.js +127 -0
- package/dist/core/agents/agent-route-override.d.ts +53 -0
- package/dist/core/agents/agent-route-override.js +69 -0
- package/dist/core/agents/builtin-registry.d.ts +51 -14
- package/dist/core/agents/builtin-registry.js +92 -15
- package/dist/core/agents/config-gate-reconcile.d.ts +38 -0
- package/dist/core/agents/config-gate-reconcile.js +51 -0
- package/dist/core/agents/cron-substitute.d.ts +1 -1
- package/dist/core/agents/cron-substitute.js +1 -1
- package/dist/core/agents/custom-routine-migration.d.ts +60 -0
- package/dist/core/agents/custom-routine-migration.js +149 -0
- package/dist/core/agents/firing-blocked.d.ts +1 -1
- package/dist/core/agents/hourly-cadence.d.ts +102 -0
- package/dist/core/agents/hourly-cadence.js +126 -0
- package/dist/core/agents/loader-boot.js +23 -0
- package/dist/core/agents/loader.d.ts +19 -0
- package/dist/core/agents/loader.js +34 -2
- package/dist/core/agents/override-merge.d.ts +1 -1
- package/dist/core/agents/override-merge.js +9 -1
- package/dist/core/agents/recurrence-convert.d.ts +1 -1
- package/dist/core/agents/recurrence-convert.js +1 -1
- package/dist/core/agents/recurring-schedule-adapter.js +8 -0
- package/dist/core/alerts.js +6 -6
- package/dist/core/backends/auth-health-monitor.d.ts +2 -2
- package/dist/core/backends/auth-health-monitor.js +1 -1
- package/dist/core/backends/backend-router.d.ts +27 -1
- package/dist/core/backends/backend-router.js +165 -1
- package/dist/core/backends/claude-code-core.d.ts +71 -31
- package/dist/core/backends/claude-code-core.js +282 -54
- package/dist/core/backends/cli-quota-guards.d.ts +29 -1
- package/dist/core/backends/cli-quota-guards.js +40 -5
- package/dist/core/backends/codex-core.d.ts +6 -0
- package/dist/core/backends/codex-core.js +22 -6
- package/dist/core/backends/failure-spend.d.ts +58 -0
- package/dist/core/backends/failure-spend.js +137 -0
- package/dist/core/backends/gemini-cli-core.d.ts +6 -0
- package/dist/core/backends/gemini-cli-core.js +38 -6
- package/dist/core/backends/model-registry.d.ts +1 -1
- package/dist/core/backends/model-registry.js +4 -4
- package/dist/core/backends/opencode-core.d.ts +1 -1
- package/dist/core/backends/opencode-core.js +5 -5
- package/dist/core/backends/plan-presets.js +47 -18
- package/dist/core/bang-commands/commands-cost.js +3 -1
- package/dist/core/bang-commands/commands-report.js +4 -3
- package/dist/core/bang-commands/commands-research.js +4 -1
- package/dist/core/bang-commands/commands-revert-tuning.d.ts +18 -0
- package/dist/core/bang-commands/commands-revert-tuning.js +63 -0
- package/dist/core/bang-commands/commands-stop-start.js +3 -3
- package/dist/core/bang-commands/commands-task-control.d.ts +19 -0
- package/dist/core/bang-commands/commands-task-control.js +147 -0
- package/dist/core/bang-commands/commands-wiki.js +5 -5
- package/dist/core/bang-commands/index.d.ts +2 -0
- package/dist/core/bang-commands/index.js +12 -0
- package/dist/core/bang-commands/registry.d.ts +12 -0
- package/dist/core/browser-history/research-cluster-fanout.d.ts +28 -14
- package/dist/core/browser-history/research-cluster-fanout.js +39 -16
- package/dist/core/channel-timeline.d.ts +5 -1
- package/dist/core/channel-timeline.js +13 -0
- package/dist/core/context/index-reconciler.js +5 -2
- package/dist/core/context/policy-index-reconciler.d.ts +6 -4
- package/dist/core/context/policy-index-runner.js +25 -6
- package/dist/core/context-builder-calendar.js +10 -2
- package/dist/core/context-builder-conversation.d.ts +8 -1
- package/dist/core/context-builder-conversation.js +41 -7
- package/dist/core/context-builder-yesterday.js +4 -3
- package/dist/core/context-builder.d.ts +7 -2
- package/dist/core/context-builder.js +193 -5
- package/dist/core/context-file-serializer.d.ts +1 -1
- package/dist/core/context-file-serializer.js +1 -1
- package/dist/core/context-health.js +2 -2
- package/dist/core/context-paths.d.ts +11 -1
- package/dist/core/context-paths.js +17 -1
- package/dist/core/context-validation/prepare-write.js +1 -1
- package/dist/core/context-validation/routine-rulebook.d.ts +1 -1
- package/dist/core/context-vault-aliases.d.ts +0 -13
- package/dist/core/context-vault-aliases.js +37 -0
- package/dist/core/custom-routines.d.ts +99 -0
- package/dist/core/custom-routines.js +187 -0
- package/dist/core/daemon-api-cli.js +50 -1
- package/dist/core/day-boundary.d.ts +46 -0
- package/dist/core/day-boundary.js +40 -0
- package/dist/core/dispatcher-activity-scan.d.ts +221 -0
- package/dist/core/dispatcher-activity-scan.js +775 -0
- package/dist/core/dispatcher-error-handling.d.ts +6 -11
- package/dist/core/dispatcher-error-handling.js +38 -62
- package/dist/core/dispatcher-hourly-check.js +6 -1
- package/dist/core/dispatcher-message-handler.d.ts +10 -0
- package/dist/core/dispatcher-message-handler.js +24 -0
- package/dist/core/dispatcher-morning-routine.d.ts +6 -6
- package/dist/core/dispatcher-morning-routine.js +13 -13
- package/dist/core/dispatcher-result-processor.d.ts +33 -0
- package/dist/core/dispatcher-result-processor.js +167 -11
- package/dist/core/dispatcher-scheduled-background-task.d.ts +42 -0
- package/dist/core/dispatcher-scheduled-background-task.js +89 -0
- package/dist/core/dispatcher-scheduled-tasks.d.ts +104 -1
- package/dist/core/dispatcher-scheduled-tasks.js +480 -8
- package/dist/core/dispatcher-task-delivery.d.ts +105 -0
- package/dist/core/dispatcher-task-delivery.js +555 -0
- package/dist/core/dispatcher-types.d.ts +48 -9
- package/dist/core/dispatcher-types.js +3 -3
- package/dist/core/dispatcher.d.ts +112 -31
- package/dist/core/dispatcher.js +297 -60
- package/dist/core/dm-freshness-metrics.d.ts +1 -1
- package/dist/core/drift-effects.js +2 -2
- package/dist/core/feedback/consolidation-prep.d.ts +94 -0
- package/dist/core/feedback/consolidation-prep.js +254 -0
- package/dist/core/feedback/eviction-scorer.d.ts +81 -0
- package/dist/core/feedback/eviction-scorer.js +136 -0
- package/dist/core/feedback/lesson-format.d.ts +79 -0
- package/dist/core/feedback/lesson-format.js +199 -0
- package/dist/core/feedback/lesson-injection.d.ts +98 -0
- package/dist/core/feedback/lesson-injection.js +174 -0
- package/dist/core/feedback/lesson-merge.d.ts +51 -0
- package/dist/core/feedback/lesson-merge.js +88 -0
- package/dist/core/feedback/lesson-store-overview.d.ts +46 -0
- package/dist/core/feedback/lesson-store-overview.js +42 -0
- package/dist/core/feedback/promotion-gate.d.ts +69 -0
- package/dist/core/feedback/promotion-gate.js +117 -0
- package/dist/core/feedback/regeneralization-prep.d.ts +87 -0
- package/dist/core/feedback/regeneralization-prep.js +152 -0
- package/dist/core/feedback/scope-parser.d.ts +86 -0
- package/dist/core/feedback/scope-parser.js +141 -0
- package/dist/core/feedback/self-performance-prep.d.ts +186 -0
- package/dist/core/feedback/self-performance-prep.js +541 -0
- package/dist/core/feedback/tuning-actuator.d.ts +198 -0
- package/dist/core/feedback/tuning-actuator.js +432 -0
- package/dist/core/feedback/tuning-recommender.d.ts +247 -0
- package/dist/core/feedback/tuning-recommender.js +580 -0
- package/dist/core/feedback/tuning-revert-monitor.d.ts +90 -0
- package/dist/core/feedback/tuning-revert-monitor.js +213 -0
- package/dist/core/health-monitor.d.ts +6 -0
- package/dist/core/health-monitor.js +1 -1
- package/dist/core/injection-policy.d.ts +83 -1
- package/dist/core/injection-policy.js +61 -3
- package/dist/core/integration-main-backend.js +4 -0
- package/dist/core/management-md.d.ts +2 -2
- package/dist/core/management-md.js +51 -13
- package/dist/core/morning/orchestrator.d.ts +2 -2
- package/dist/core/morning/orchestrator.js +2 -2
- package/dist/core/notification-gate.d.ts +64 -0
- package/dist/core/notification-gate.js +51 -0
- package/dist/core/notification-rate-limit.d.ts +40 -0
- package/dist/core/notification-rate-limit.js +50 -0
- package/dist/core/policy-files.d.ts +1 -1
- package/dist/core/policy-files.js +2 -2
- package/dist/core/pre-pass-freshness.d.ts +4 -4
- package/dist/core/retention.d.ts +5 -0
- package/dist/core/retention.js +20 -4
- package/dist/core/review-context.d.ts +1 -1
- package/dist/core/review-context.js +10 -5
- package/dist/core/roadmap-write-lock.d.ts +2 -1
- package/dist/core/roadmap-write-lock.js +15 -10
- package/dist/core/routine-acquisition-plan.d.ts +47 -1
- package/dist/core/routine-acquisition-plan.js +78 -20
- package/dist/core/routine-fetch-window-retry.js +7 -4
- package/dist/core/routine-fetch-window-runner.d.ts +39 -3
- package/dist/core/routine-fetch-window-runner.js +264 -13
- package/dist/core/routine-windows.d.ts +2 -2
- package/dist/core/routine-windows.js +8 -5
- package/dist/core/scheduler.d.ts +175 -16
- package/dist/core/scheduler.js +559 -102
- package/dist/core/signal-detector.d.ts +51 -1
- package/dist/core/signal-detector.js +321 -24
- package/dist/core/skills-compiler-denied-tools.js +2 -2
- package/dist/core/skills-compiler-skill-index.d.ts +2 -2
- package/dist/core/skills-compiler-skill-index.js +2 -2
- package/dist/core/skills-compiler-variants.d.ts +1 -1
- package/dist/core/skills-compiler-variants.js +8 -0
- package/dist/core/skills-compiler.d.ts +29 -26
- package/dist/core/skills-compiler.js +117 -81
- package/dist/core/skills-manifest.d.ts +37 -0
- package/dist/core/skills-manifest.js +73 -2
- package/dist/core/sleep-inhibitor.d.ts +79 -0
- package/dist/core/sleep-inhibitor.js +132 -0
- package/dist/core/slim-system-prompt-loader.d.ts +77 -0
- package/dist/core/slim-system-prompt-loader.js +141 -0
- package/dist/core/spawn-gates.d.ts +126 -0
- package/dist/core/spawn-gates.js +180 -0
- package/dist/core/today-direct-writer.d.ts +60 -14
- package/dist/core/today-direct-writer.js +90 -13
- package/dist/core/today-write-lock.d.ts +4 -2
- package/dist/core/today-write-lock.js +30 -20
- package/dist/core/wake-detector.d.ts +55 -0
- package/dist/core/wake-detector.js +80 -0
- package/dist/core/wiki/compile-lock.d.ts +1 -1
- package/dist/core/wiki/compile-lock.js +1 -1
- package/dist/core/wiki/wiki-fts.js +13 -6
- package/dist/core/workdir.js +15 -6
- package/dist/db/activity-scan-signals.d.ts +77 -0
- package/dist/db/activity-scan-signals.js +378 -0
- package/dist/db/agents-store.d.ts +28 -0
- package/dist/db/agents-store.js +62 -0
- package/dist/db/background-task-clarifications-store.d.ts +81 -0
- package/dist/db/background-task-clarifications-store.js +152 -0
- package/dist/db/background-task-store.d.ts +207 -0
- package/dist/db/background-task-store.js +380 -0
- package/dist/db/browser-history-store.d.ts +39 -6
- package/dist/db/browser-history-store.js +51 -7
- package/dist/db/browser-task-clarifications-store.d.ts +12 -0
- package/dist/db/browser-task-clarifications-store.js +35 -5
- package/dist/db/browser-task-store.d.ts +3 -0
- package/dist/db/browser-task-store.js +29 -4
- package/dist/db/deferred-dm.d.ts +86 -0
- package/dist/db/deferred-dm.js +199 -0
- package/dist/db/feedback-signals-store.d.ts +77 -0
- package/dist/db/feedback-signals-store.js +144 -0
- package/dist/db/migrations.js +380 -0
- package/dist/db/observations.d.ts +2 -2
- package/dist/db/observations.js +3 -3
- package/dist/db/schema.js +260 -22
- package/dist/db/voice-transcripts-store.d.ts +1 -1
- package/dist/index.js +86 -29
- package/dist/messaging/browser-task-mcp-notifier.d.ts +12 -70
- package/dist/messaging/browser-task-mcp-notifier.js +30 -151
- package/dist/messaging/browser-task-screenshot-attachment.d.ts +15 -0
- package/dist/messaging/browser-task-screenshot-attachment.js +63 -0
- package/dist/observers/delegated-sync-worker.d.ts +6 -6
- package/dist/observers/delegated-sync-worker.js +10 -10
- package/dist/observers/git-delegated-cron.d.ts +1 -1
- package/dist/observers/git-delegated-cron.js +2 -2
- package/dist/observers/github-poller-classifier.d.ts +3 -3
- package/dist/observers/github-poller-classifier.js +3 -3
- package/dist/observers/imminent-event-scheduler.d.ts +1 -1
- package/dist/observers/imminent-event-scheduler.js +1 -1
- package/dist/observers/mail-poller.d.ts +1 -0
- package/dist/observers/mail-poller.js +42 -3
- package/dist/observers/observation-summarizer/summarizer-client.d.ts +2 -2
- package/dist/observers/observation-summarizer/summarizer-client.js +2 -2
- package/dist/observers/observation-summarizer/worker.d.ts +2 -2
- package/dist/observers/observation-summarizer/worker.js +4 -4
- package/dist/observers/obsidian-watcher.d.ts +1 -1
- package/dist/observers/obsidian-watcher.js +1 -1
- package/dist/safety/agent-write-tracker.d.ts +4 -4
- package/dist/safety/agent-write-tracker.js +4 -4
- package/dist/safety/always-disallowed.d.ts +1 -1
- package/dist/safety/always-disallowed.js +39 -0
- package/dist/safety/audit.d.ts +43 -5
- package/dist/safety/audit.js +86 -18
- package/dist/safety/risk-classifier.d.ts +6 -0
- package/dist/safety/risk-classifier.js +97 -18
- package/dist/scheduler/activity-scan-gate.d.ts +86 -0
- package/dist/scheduler/activity-scan-gate.js +132 -0
- package/dist/services/background-task/background-task-budget.d.ts +80 -0
- package/dist/services/background-task/background-task-budget.js +91 -0
- package/dist/services/background-task/background-task-driver.d.ts +105 -0
- package/dist/services/background-task/background-task-driver.js +416 -0
- package/dist/services/background-task/background-task-runner.d.ts +96 -0
- package/dist/services/background-task/background-task-runner.js +673 -0
- package/dist/services/background-task/background-task-tools.d.ts +84 -0
- package/dist/services/background-task/background-task-tools.js +247 -0
- package/dist/services/background-task/background-task-transition-events.d.ts +43 -0
- package/dist/services/background-task/background-task-transition-events.js +54 -0
- package/dist/services/browser-history/automation/egress-denylist.d.ts +1 -1
- package/dist/services/browser-history/automation/egress-denylist.js +34 -8
- package/dist/services/browser-history/lifecycle/platform.js +44 -2
- package/dist/services/browser-history/managed-chromium/sandbox-launcher.js +0 -1
- package/dist/services/browser-task/browser-task-runner.js +53 -8
- package/dist/services/mcp/probe.js +30 -8
- package/dist/services/observations-batch.d.ts +1 -1
- package/dist/services/observations-batch.js +2 -2
- package/dist/settings/runtime-settings.d.ts +45 -12
- package/dist/settings/runtime-settings.js +215 -40
- package/dist/settings/settings-store.js +11 -3
- package/package.json +4 -4
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { ADVISOR_ALLOWED_MODELS, DEFAULT_AGENT_DISPLAY_NAME, EXECUTION_PERMISSION_MODES, INTEGRATION_KEYS, browserHistoryBrowserOverrideSchema, browserHistoryCategorySchema, browserHistoryLifecycleConfigSchema, isAdvisorModel, isSupportedVoiceLanguage, validateAgentDisplayName, } from "@aitne/shared";
|
|
3
3
|
import { NOTIFICATION_DESTINATION_PLATFORMS, isNotificationDestinationPlatform, } from "../messaging/constants.js";
|
|
4
4
|
import { ALWAYS_DISALLOWED_TOOLS } from "../safety/always-disallowed.js";
|
|
5
|
+
import { PREVENT_SLEEP_MODES } from "../core/sleep-inhibitor.js";
|
|
5
6
|
/**
|
|
6
7
|
* The secret-exfiltration / credential-tampering subset of the absolute-block
|
|
7
8
|
* layer now lives in `safety/always-disallowed.ts` (EXECUTION-MODE-DESIGN.md
|
|
@@ -268,6 +269,24 @@ export const runtimeSettingsSchema = z.object({
|
|
|
268
269
|
dmStalenessStrict: z.boolean().default(false),
|
|
269
270
|
proactiveForwardChannelTimelineEnabled: z.boolean().default(true),
|
|
270
271
|
proactiveForwardForceFreshSession: z.boolean().default(false),
|
|
272
|
+
feedbackLearningEnabled: z.boolean().default(true),
|
|
273
|
+
/**
|
|
274
|
+
* SELF_TUNING_REVIEW_CYCLE_DESIGN.md §6 — actuation gate for the
|
|
275
|
+
* self-tuning loop's Phase 3 Actuate stage. While `false` (the shipped
|
|
276
|
+
* default), the loop runs in shadow mode: the weekly Recommend pre-step
|
|
277
|
+
* still generates `<tuning_recommendations>` and `POST
|
|
278
|
+
* /api/tuning/verdicts` still records apply/reject/defer verdicts, but
|
|
279
|
+
* nothing is written through the `applyConfigUpdates` chokepoint.
|
|
280
|
+
* Whether this ever flips to default-true is conditional on the Phase 2
|
|
281
|
+
* shadow-period results — a loop that edits spend-affecting knobs
|
|
282
|
+
* autonomously may reasonably stay opt-in permanently (§8).
|
|
283
|
+
*/
|
|
284
|
+
selfTuningEnabled: z.boolean().default(false),
|
|
285
|
+
feedbackPromotionThreshold: z.number().int().min(1).max(10).default(2),
|
|
286
|
+
feedbackLessonMaxBytesGlobal: z.number().int().min(1024).max(32768).default(8192),
|
|
287
|
+
feedbackLessonMaxBytesPerAgent: z.number().int().min(512).max(16384).default(4096),
|
|
288
|
+
feedbackLessonStaleDays: z.number().int().min(7).max(365).default(60),
|
|
289
|
+
feedbackSignalRetentionDays: z.number().int().min(30).max(365).default(180),
|
|
271
290
|
agentDisplayName: z.string().default(DEFAULT_AGENT_DISPLAY_NAME).refine((value) => validateAgentDisplayName(value) === null, { message: "PA_AGENT_DISPLAY_NAME must be a single line, 40 characters or fewer" }),
|
|
272
291
|
/**
|
|
273
292
|
* User-defined communication style / persona. See docs/design/15-character.md.
|
|
@@ -309,9 +328,13 @@ export const runtimeSettingsSchema = z.object({
|
|
|
309
328
|
// poor in the current shape; the routine stays in-tree as a concept
|
|
310
329
|
// pending the Mirror+Prune redesign (one trend observation + aged
|
|
311
330
|
// carry-over kill/keep decisions, scoped to feed day-1-of-month
|
|
312
|
-
// morning_routine).
|
|
313
|
-
//
|
|
314
|
-
//
|
|
331
|
+
// morning_routine).
|
|
332
|
+
//
|
|
333
|
+
// DEPRECATED (Agents-hub redesign, AGENTS_HUB_REDESIGN_PLAN.md §2): the
|
|
334
|
+
// monthly-review AGENT row's `enabled` is the single switch now — enable
|
|
335
|
+
// from /agents/monthly-review. This key stays parseable so previously
|
|
336
|
+
// persisted values survive (a one-time boot reconcile carries a `true`
|
|
337
|
+
// onto the agent row); the scheduler no longer reads it.
|
|
315
338
|
monthlyReviewEnabled: z.boolean().default(false),
|
|
316
339
|
/**
|
|
317
340
|
* BROWSER_TASK_REDESIGN_PLAN.md §5.1 — global concurrency cap for the
|
|
@@ -375,31 +398,118 @@ export const runtimeSettingsSchema = z.object({
|
|
|
375
398
|
.array(z.string().min(1).max(253))
|
|
376
399
|
.max(500)
|
|
377
400
|
.default([]),
|
|
378
|
-
|
|
401
|
+
/**
|
|
402
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §10.3 — global concurrency cap for
|
|
403
|
+
* the generic background-task runner. Each worker is a fresh SDK
|
|
404
|
+
* session (no resident browser), so the ceiling is cost/quota driven
|
|
405
|
+
* rather than RAM driven. Range [1, 5], default 3.
|
|
406
|
+
*/
|
|
407
|
+
backgroundTaskMaxConcurrent: z.number().int().min(1).max(5).default(3),
|
|
408
|
+
/**
|
|
409
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §6 / §10.6 — clarification TTL. A
|
|
410
|
+
* parked background task waits this long for the owner's `ask_user`
|
|
411
|
+
* reply before the housekeeping tick transitions it to `timeout`. No
|
|
412
|
+
* browser resource is held while parked, so the default is far longer
|
|
413
|
+
* than browser-task's fixed 5 min. Range [5, 1440] minutes, default 60.
|
|
414
|
+
*/
|
|
415
|
+
backgroundTaskClarificationTtlMinutes: z
|
|
416
|
+
.number()
|
|
417
|
+
.int()
|
|
418
|
+
.min(5)
|
|
419
|
+
.max(1440)
|
|
420
|
+
.default(60),
|
|
421
|
+
/**
|
|
422
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §10.3 — safety valve for a task that
|
|
423
|
+
* sits `pending` behind the concurrency cap too long. After this many
|
|
424
|
+
* minutes a queued task transitions to `timeout` (fail-loud). Range
|
|
425
|
+
* [5, 180], default 120 (background tasks queue longer than browser
|
|
426
|
+
* tasks because they run longer). The reused slot-manager sweep
|
|
427
|
+
* (`clampPendingQueueTimeoutMinutes`) caps at 180, so the range matches.
|
|
428
|
+
*/
|
|
429
|
+
backgroundTaskPendingQueueTimeoutMinutes: z
|
|
430
|
+
.number()
|
|
431
|
+
.int()
|
|
432
|
+
.min(5)
|
|
433
|
+
.max(180)
|
|
434
|
+
.default(120),
|
|
435
|
+
/**
|
|
436
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §10.5 — cadence (hours) of the
|
|
437
|
+
* filed-results digest ("filed N background results since yesterday").
|
|
438
|
+
* Consumed by the Phase 3 digest surface; the setting lands here so the
|
|
439
|
+
* runtime schema parses it on upgrade. Range [1, 168], default 24.
|
|
440
|
+
*/
|
|
441
|
+
backgroundTaskDigestCadenceHours: z
|
|
442
|
+
.number()
|
|
443
|
+
.int()
|
|
444
|
+
.min(1)
|
|
445
|
+
.max(168)
|
|
446
|
+
.default(24),
|
|
447
|
+
/**
|
|
448
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §10.3 / Phase 4 — brief-dedup window
|
|
449
|
+
* (minutes). A `POST /api/background-task` whose `brief` + `tier` exactly
|
|
450
|
+
* match a still-relevant task (not a FAIL terminal) created within this
|
|
451
|
+
* window collapses onto that task instead of spawning a second worker —
|
|
452
|
+
* the runaway fan-out guard (a replayed trigger POSTing the same brief
|
|
453
|
+
* many times in minutes). Range [0, 1440]; `0` disables dedup. Default 10.
|
|
454
|
+
*/
|
|
455
|
+
backgroundTaskDedupWindowMinutes: z
|
|
456
|
+
.number()
|
|
457
|
+
.int()
|
|
458
|
+
.min(0)
|
|
459
|
+
.max(1440)
|
|
460
|
+
.default(10),
|
|
461
|
+
/**
|
|
462
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §10.2 / Phase 4 — true mid-flight
|
|
463
|
+
* resume across a daemon restart. When `true`, a non-terminal task that
|
|
464
|
+
* captured an SDK session id (`backend_session_id`) is resumed via
|
|
465
|
+
* `query({resume})` on boot (warm session, no re-work); resume failures
|
|
466
|
+
* fall back to re-dispatch-from-brief. When `false`, every non-terminal
|
|
467
|
+
* task is re-dispatched from its (self-contained) brief — the v1 floor.
|
|
468
|
+
* Default `true`.
|
|
469
|
+
*/
|
|
470
|
+
backgroundTaskResumeAcrossRestart: z.boolean().default(true),
|
|
471
|
+
/**
|
|
472
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §2.3 / §13 Decision 4 (Phase 4,
|
|
473
|
+
* opt-in) — when `true`, a routine autonomous forward to the owner DM is
|
|
474
|
+
* routed through the task-delivery gate + activity-branch machinery: an
|
|
475
|
+
* active owner gets a woven delivery turn (the real DM agent weaves the
|
|
476
|
+
* forward into the live conversation) instead of a verbatim dump; an idle
|
|
477
|
+
* owner gets the verbatim send (as today). Default `false` — the design
|
|
478
|
+
* deliberately scoped rev3 to task delivery only; this opens the same
|
|
479
|
+
* machinery to autonomous forwards for operators who want it.
|
|
480
|
+
*/
|
|
481
|
+
autonomousForwardNaturalDelivery: z.boolean().default(false),
|
|
482
|
+
// DEPRECATED (Agents-hub redesign, AGENTS_HUB_REDESIGN_PLAN.md §2): the
|
|
483
|
+
// activity-scan AGENT row's `enabled` is the single switch now (a one-time
|
|
484
|
+
// boot reconcile carries a persisted `false` onto the agent row). The
|
|
485
|
+
// cadence keys below remain the per-field FALLBACK under the agent row's
|
|
486
|
+
// `runtime_window` overrides (core/agents/activity-scan-cadence.ts) — edit the
|
|
487
|
+
// cadence from /agents/activity-scan, not here.
|
|
488
|
+
activityScanEnabled: z.boolean().default(true),
|
|
379
489
|
// Any positive integer in [1, 1440] minutes (1 minute up to 24 hours).
|
|
380
|
-
//
|
|
381
|
-
// range to balance observation latency against quota
|
|
382
|
-
// is anchored to `
|
|
383
|
-
//
|
|
490
|
+
// The shipped default is 120 (every 2 hours); the operator can dial this
|
|
491
|
+
// anywhere in that range to balance observation latency against quota
|
|
492
|
+
// burn. The cadence is anchored to `activityScanActiveStartHour` (see
|
|
493
|
+
// shouldFireActivityScanTickAt in scheduler.ts), so the first fire of each
|
|
384
494
|
// agent-day lands at the start of the active window. The upper bound
|
|
385
495
|
// is 1440 because the modulo gate runs against minutes-since-midnight,
|
|
386
496
|
// which cannot represent multi-day cadence — operators wanting weekly
|
|
387
497
|
// or monthly cadence should use the dedicated review routines.
|
|
388
|
-
|
|
498
|
+
activityScanIntervalMinutes: z
|
|
389
499
|
.number()
|
|
390
500
|
.int()
|
|
391
|
-
.min(1, { message: "
|
|
392
|
-
.max(1440, { message: "
|
|
393
|
-
.default(
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
501
|
+
.min(1, { message: "PA_ACTIVITY_SCAN_INTERVAL_MINUTES must be >= 1" })
|
|
502
|
+
.max(1440, { message: "PA_ACTIVITY_SCAN_INTERVAL_MINUTES must be <= 1440 (one day)" })
|
|
503
|
+
.default(120),
|
|
504
|
+
activityScanActiveStartHour: z.number().int().min(0).max(23).default(4),
|
|
505
|
+
activityScanActiveEndHour: z.number().int().min(1).max(24).default(24),
|
|
506
|
+
activityScanMinObservations: z.number().int().nonnegative().default(1),
|
|
397
507
|
/**
|
|
398
508
|
* cost-reduction-structural §B — flag for the optional Stage 2 lite-tier
|
|
399
509
|
* triage. Default `false` so cost remains bounded to Stage 0/1 + Stage 3
|
|
400
510
|
* until shadow telemetry justifies the lite triage budget.
|
|
401
511
|
*/
|
|
402
|
-
|
|
512
|
+
activityScanStage2Enabled: z.boolean().default(false),
|
|
403
513
|
/**
|
|
404
514
|
* cost-reduction-structural §B — heartbeat window for the gate. Even on
|
|
405
515
|
* a string of quiet ticks, the gate force-runs Stage 2 (or Stage 3 if
|
|
@@ -407,7 +517,7 @@ export const runtimeSettingsSchema = z.object({
|
|
|
407
517
|
* exercised end-to-end and a signal misclassification can't trap the
|
|
408
518
|
* routine in `stage0_silent` indefinitely.
|
|
409
519
|
*/
|
|
410
|
-
|
|
520
|
+
activityScanHeartbeatHours: z.number().int().min(1).max(48).default(4),
|
|
411
521
|
/**
|
|
412
522
|
* cost-reduction-structural §B — pending-observation ceiling under
|
|
413
523
|
* which low-signal cases still route to Stage 0 silent. The default 0
|
|
@@ -415,7 +525,7 @@ export const runtimeSettingsSchema = z.object({
|
|
|
415
525
|
* Stage 2 / Stage 3); operators who notice the gate over-escalating on
|
|
416
526
|
* journal noise can dial this up.
|
|
417
527
|
*/
|
|
418
|
-
|
|
528
|
+
activityScanLowSignalPendingCeiling: z
|
|
419
529
|
.number()
|
|
420
530
|
.int()
|
|
421
531
|
.nonnegative()
|
|
@@ -424,25 +534,30 @@ export const runtimeSettingsSchema = z.object({
|
|
|
424
534
|
/**
|
|
425
535
|
* HOURLY_CHECK_GATE_REDESIGN_PLAN.md §3.4 — minimum minutes between
|
|
426
536
|
* pre-pass spawns for the same integration. The `harvestForGate`
|
|
427
|
-
* step in `
|
|
537
|
+
* step in `ActivityScanCoordinator.trigger` reads
|
|
428
538
|
* `runtime_state.pre_pass_last_run:<integrationKey>` and skips
|
|
429
539
|
* pre-pass when the prior successful run is more recent than this
|
|
430
|
-
* window. Default 30 —
|
|
431
|
-
*
|
|
432
|
-
*
|
|
540
|
+
* window. Default 30 — comfortably below the default 120-min scan
|
|
541
|
+
* interval, so a default install runs the pre-pass on every tick;
|
|
542
|
+
* the gate only bites when an operator dials the interval down or
|
|
543
|
+
* another routine's pre-pass ran recently.
|
|
433
544
|
*
|
|
434
|
-
* Bounded [0,
|
|
545
|
+
* Bounded [0, 480]. `0` disables the freshness gate (pre-pass fires
|
|
435
546
|
* on every tick); 240 (4h) approximates "only fire when the
|
|
436
|
-
* heartbeat would have anyway" for cost-minimal deployments.
|
|
547
|
+
* heartbeat would have anyway" for cost-minimal deployments. The cap
|
|
548
|
+
* was widened 240 → 480 for the self-tuning R1 ladder
|
|
549
|
+
* (120/240/360/480 — SELF_TUNING_REVIEW_CYCLE_DESIGN.md §3.2 / D2;
|
|
550
|
+
* a compatible widening, every previously persisted value still
|
|
551
|
+
* parses). Twin bound: `env-writer.ts:NUMERIC_RANGE`.
|
|
437
552
|
*
|
|
438
553
|
* `forced` runs (`POST /api/agent/run-now`) bypass the gate
|
|
439
554
|
* unconditionally — manual triggers explicitly want a fresh fetch.
|
|
440
555
|
*/
|
|
441
|
-
|
|
556
|
+
activityScanPrePassFreshnessMinutes: z
|
|
442
557
|
.number()
|
|
443
558
|
.int()
|
|
444
559
|
.min(0)
|
|
445
|
-
.max(
|
|
560
|
+
.max(480)
|
|
446
561
|
.default(30),
|
|
447
562
|
/**
|
|
448
563
|
* Phase 4 auth health probe kill switch — corresponds to
|
|
@@ -471,6 +586,13 @@ export const runtimeSettingsSchema = z.object({
|
|
|
471
586
|
* /api/config; tunable per user's tolerance for chatty mornings.
|
|
472
587
|
*/
|
|
473
588
|
maxBriefingDelayMinutes: z.number().int().nonnegative().default(30),
|
|
589
|
+
/**
|
|
590
|
+
* BACKGROUND_TASK_RUNNER_DESIGN.md §2.6 — deterministic branch used by
|
|
591
|
+
* task.delivery to decide whether a finished task should be woven into
|
|
592
|
+
* an active owner conversation or sent as a standalone draft. Reads the
|
|
593
|
+
* most recent inbound owner DM across messaging + dashboard scopes.
|
|
594
|
+
*/
|
|
595
|
+
ownerActivityIdleThresholdMinutes: z.number().int().min(1).max(60).default(5),
|
|
474
596
|
maxNotificationsPerHour: z.number().int().positive().default(3),
|
|
475
597
|
maxNotificationsPerDay: z.number().int().positive().default(12),
|
|
476
598
|
quietHoursStart: z.string().default("22:00"),
|
|
@@ -519,6 +641,19 @@ export const runtimeSettingsSchema = z.object({
|
|
|
519
641
|
.url()
|
|
520
642
|
.default("http://127.0.0.1:4096"),
|
|
521
643
|
opencodeServerUsername: z.string().min(1).default("opencode"),
|
|
644
|
+
/**
|
|
645
|
+
* Keep-awake posture while the daemon runs (macOS only; no-op elsewhere).
|
|
646
|
+
* Every daemon timer freezes during host sleep, so a sleeping laptop
|
|
647
|
+
* turns the 04:00 day-boundary flow into hours of wake-catchup replays
|
|
648
|
+
* riding macOS maintenance DarkWakes — with cold prompt caches making
|
|
649
|
+
* each replay ~10× the normal cost. `"ac"` (default) holds a
|
|
650
|
+
* `caffeinate -s` assertion: system sleep is inhibited only while on AC
|
|
651
|
+
* power, so battery drain stays impossible. `"always"` adds `-i` (idle
|
|
652
|
+
* sleep inhibited on battery too); `"off"` restores OS-managed sleep.
|
|
653
|
+
* Lid-close sleep is NOT overridden (that needs root). Read once at
|
|
654
|
+
* boot — see RESTART_REQUIRED_KEY_TUPLE.
|
|
655
|
+
*/
|
|
656
|
+
preventSleepMode: z.enum(PREVENT_SLEEP_MODES).default("ac"),
|
|
522
657
|
obsidianDebounceSeconds: z.number().positive().default(5.0),
|
|
523
658
|
gitPollIntervalSeconds: z.number().int().positive().default(3600),
|
|
524
659
|
/**
|
|
@@ -647,7 +782,7 @@ export const runtimeSettingsSchema = z.object({
|
|
|
647
782
|
mailIdleFallbackRecoveryMinutes: z.number().int().positive().default(60),
|
|
648
783
|
mailMaxMessagesPerPoll: z.number().int().min(1).max(100).default(20),
|
|
649
784
|
mailAuthFailureRetryHours: z.number().int().positive().default(6),
|
|
650
|
-
|
|
785
|
+
activityScanObservationCharBudget: z.number().int().positive().default(8000),
|
|
651
786
|
/**
|
|
652
787
|
* docs/design/appendices/pre-pass-fan-out.md §6 — retry and budget controls for the
|
|
653
788
|
* `routine.fetch_window` fan-out coordinator. Fan-out is now the only
|
|
@@ -683,7 +818,7 @@ export const runtimeSettingsSchema = z.object({
|
|
|
683
818
|
/**
|
|
684
819
|
* cost-reduction-structural §A — observation summarizer kill switch +
|
|
685
820
|
* tunables. The summarizer runs out-of-band: when disabled, observation
|
|
686
|
-
* rows stay `summary_status='pending'` and
|
|
821
|
+
* rows stay `summary_status='pending'` and activity_scan falls back to
|
|
687
822
|
* the legacy fetch-on-doubt pattern (no regression in correctness; only
|
|
688
823
|
* loss of cost savings).
|
|
689
824
|
*/
|
|
@@ -708,7 +843,7 @@ export const runtimeSettingsSchema = z.object({
|
|
|
708
843
|
* Safety net for autonomous session cost. When set, the dispatcher skips
|
|
709
844
|
* autonomous sessions whose cumulative daily cost exceeds this cap.
|
|
710
845
|
* Reactive sessions (DMs, mentions) always pass through.
|
|
711
|
-
* Degradation priority:
|
|
846
|
+
* Degradation priority: activity_scan → roadmap_refresh → evening_review →
|
|
712
847
|
* morning_routine (last to be cut).
|
|
713
848
|
* Distinct from the removed Phase 9 `maxDailyCostUsd` which blanket-blocked
|
|
714
849
|
* all sessions including reactive DMs — see p9-polling-pivot.md.
|
|
@@ -773,7 +908,7 @@ export const runtimeSettingsSchema = z.object({
|
|
|
773
908
|
* Voice transcription opt-in (see docs/design/appendices/voice-transcription.md).
|
|
774
909
|
* Default `false`: inbound audio attachments pass through as file paths
|
|
775
910
|
* without local Whisper inference, and no model weights are downloaded.
|
|
776
|
-
* Flipping to `true` from `/settings/
|
|
911
|
+
* Flipping to `true` from `/settings/infrastructure` triggers a one-time model
|
|
777
912
|
* download via `POST /api/voice/install`; the daemon auto-restarts on
|
|
778
913
|
* success so the transcriber initializes with the flag observed.
|
|
779
914
|
*/
|
|
@@ -900,6 +1035,13 @@ export const RUNTIME_SETTING_KEYS = [
|
|
|
900
1035
|
"dmStalenessStrict",
|
|
901
1036
|
"proactiveForwardChannelTimelineEnabled",
|
|
902
1037
|
"proactiveForwardForceFreshSession",
|
|
1038
|
+
"feedbackLearningEnabled",
|
|
1039
|
+
"selfTuningEnabled",
|
|
1040
|
+
"feedbackPromotionThreshold",
|
|
1041
|
+
"feedbackLessonMaxBytesGlobal",
|
|
1042
|
+
"feedbackLessonMaxBytesPerAgent",
|
|
1043
|
+
"feedbackLessonStaleDays",
|
|
1044
|
+
"feedbackSignalRetentionDays",
|
|
903
1045
|
"agentDisplayName",
|
|
904
1046
|
"character",
|
|
905
1047
|
"timezone",
|
|
@@ -909,19 +1051,27 @@ export const RUNTIME_SETTING_KEYS = [
|
|
|
909
1051
|
"browserTaskPendingQueueTimeoutMinutes",
|
|
910
1052
|
"browserTaskRespectQuietHours",
|
|
911
1053
|
"browserTaskHostnameDenylist",
|
|
912
|
-
"
|
|
913
|
-
"
|
|
914
|
-
"
|
|
915
|
-
"
|
|
916
|
-
"
|
|
917
|
-
"
|
|
918
|
-
"
|
|
919
|
-
"
|
|
920
|
-
"
|
|
1054
|
+
"backgroundTaskMaxConcurrent",
|
|
1055
|
+
"backgroundTaskClarificationTtlMinutes",
|
|
1056
|
+
"backgroundTaskPendingQueueTimeoutMinutes",
|
|
1057
|
+
"backgroundTaskDigestCadenceHours",
|
|
1058
|
+
"backgroundTaskDedupWindowMinutes",
|
|
1059
|
+
"backgroundTaskResumeAcrossRestart",
|
|
1060
|
+
"autonomousForwardNaturalDelivery",
|
|
1061
|
+
"activityScanEnabled",
|
|
1062
|
+
"activityScanIntervalMinutes",
|
|
1063
|
+
"activityScanActiveStartHour",
|
|
1064
|
+
"activityScanActiveEndHour",
|
|
1065
|
+
"activityScanMinObservations",
|
|
1066
|
+
"activityScanStage2Enabled",
|
|
1067
|
+
"activityScanHeartbeatHours",
|
|
1068
|
+
"activityScanLowSignalPendingCeiling",
|
|
1069
|
+
"activityScanPrePassFreshnessMinutes",
|
|
921
1070
|
"authProbeDisabled",
|
|
922
1071
|
"authPreflightFreshnessMs",
|
|
923
1072
|
"schedulePollIntervalSeconds",
|
|
924
1073
|
"maxBriefingDelayMinutes",
|
|
1074
|
+
"ownerActivityIdleThresholdMinutes",
|
|
925
1075
|
"maxNotificationsPerHour",
|
|
926
1076
|
"maxNotificationsPerDay",
|
|
927
1077
|
"quietHoursStart",
|
|
@@ -937,6 +1087,7 @@ export const RUNTIME_SETTING_KEYS = [
|
|
|
937
1087
|
"opencodeExecutionPermissionMode",
|
|
938
1088
|
"opencodeBaseUrl",
|
|
939
1089
|
"opencodeServerUsername",
|
|
1090
|
+
"preventSleepMode",
|
|
940
1091
|
"obsidianDebounceSeconds",
|
|
941
1092
|
"gitPollIntervalSeconds",
|
|
942
1093
|
"gitPushOverdueMinutes",
|
|
@@ -962,7 +1113,7 @@ export const RUNTIME_SETTING_KEYS = [
|
|
|
962
1113
|
"mailIdleFallbackRecoveryMinutes",
|
|
963
1114
|
"mailMaxMessagesPerPoll",
|
|
964
1115
|
"mailAuthFailureRetryHours",
|
|
965
|
-
"
|
|
1116
|
+
"activityScanObservationCharBudget",
|
|
966
1117
|
"prePassMaxAttemptsPerIntegration",
|
|
967
1118
|
"prePassBackoffMs",
|
|
968
1119
|
"prePassRetryEscalationTier",
|
|
@@ -999,3 +1150,27 @@ const _assertRuntimeSettingCoverage = true;
|
|
|
999
1150
|
export function isRuntimeSettingKey(value) {
|
|
1000
1151
|
return runtimeSettingKeySet.has(value);
|
|
1001
1152
|
}
|
|
1153
|
+
/**
|
|
1154
|
+
* v0.1.10 → v0.1.11: the "Hourly Check" agent became "Activity Scan" and its
|
|
1155
|
+
* settings keys moved from `hourlyCheck*` / `hourlyObservationCharBudget` to
|
|
1156
|
+
* `activityScan*`. Migration `0010-hourly-check-to-activity-scan` renames the
|
|
1157
|
+
* persisted `settings` rows, but `loadPersistedSettings` runs BEFORE
|
|
1158
|
+
* `runMigrations` (the merge is load-bearing for `getContextDir`, see
|
|
1159
|
+
* bootstrap/db.ts), so on the first post-upgrade boot the rows still carry the
|
|
1160
|
+
* legacy names when they are parsed. This map lets the settings store read
|
|
1161
|
+
* them under the canonical key for that one boot (and tolerates DBs restored
|
|
1162
|
+
* from old backups). Drop after a deprecation window once the migration has
|
|
1163
|
+
* been in the wild for a few releases.
|
|
1164
|
+
*/
|
|
1165
|
+
export const LEGACY_RUNTIME_SETTING_KEY_ALIASES = {
|
|
1166
|
+
hourlyCheckEnabled: "activityScanEnabled",
|
|
1167
|
+
hourlyCheckIntervalMinutes: "activityScanIntervalMinutes",
|
|
1168
|
+
hourlyCheckActiveStartHour: "activityScanActiveStartHour",
|
|
1169
|
+
hourlyCheckActiveEndHour: "activityScanActiveEndHour",
|
|
1170
|
+
hourlyCheckMinObservations: "activityScanMinObservations",
|
|
1171
|
+
hourlyCheckStage2Enabled: "activityScanStage2Enabled",
|
|
1172
|
+
hourlyCheckHeartbeatHours: "activityScanHeartbeatHours",
|
|
1173
|
+
hourlyCheckLowSignalPendingCeiling: "activityScanLowSignalPendingCeiling",
|
|
1174
|
+
hourlyCheckPrePassFreshnessMinutes: "activityScanPrePassFreshnessMinutes",
|
|
1175
|
+
hourlyObservationCharBudget: "activityScanObservationCharBudget",
|
|
1176
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RUNTIME_SETTING_KEYS, isRuntimeSettingKey, runtimeSettingsSchema, } from "./runtime-settings.js";
|
|
1
|
+
import { LEGACY_RUNTIME_SETTING_KEY_ALIASES, RUNTIME_SETTING_KEYS, isRuntimeSettingKey, runtimeSettingsSchema, } from "./runtime-settings.js";
|
|
2
2
|
class SqliteSettingsStore {
|
|
3
3
|
db;
|
|
4
4
|
constructor(db) {
|
|
@@ -8,11 +8,19 @@ class SqliteSettingsStore {
|
|
|
8
8
|
const rows = this.db.prepare("SELECT key, value_json FROM settings").all();
|
|
9
9
|
const rawValues = {};
|
|
10
10
|
for (const row of rows) {
|
|
11
|
-
|
|
11
|
+
// Legacy rows (pre-rename key names) are read under their canonical
|
|
12
|
+
// key until migration 0010 has rewritten them — but never shadow a
|
|
13
|
+
// canonical row that already exists.
|
|
14
|
+
const aliased = LEGACY_RUNTIME_SETTING_KEY_ALIASES[row.key];
|
|
15
|
+
const key = aliased !== undefined ? aliased : row.key;
|
|
16
|
+
if (!isRuntimeSettingKey(key)) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (aliased !== undefined && key in rawValues) {
|
|
12
20
|
continue;
|
|
13
21
|
}
|
|
14
22
|
try {
|
|
15
|
-
rawValues[
|
|
23
|
+
rawValues[key] = JSON.parse(row.value_json);
|
|
16
24
|
}
|
|
17
25
|
catch {
|
|
18
26
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aitne/daemon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Aitne daemon — long-running TypeScript service that hosts the event bus, scheduler, observers, safety layer, and HTTP API. Consumed by the `aitne` CLI; not intended for standalone use.",
|
|
5
5
|
"homepage": "https://github.com/Aitne-sh/Aitne#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@octokit/rest": "^22.0.1",
|
|
38
38
|
"@opencode-ai/sdk": "1.14.50",
|
|
39
39
|
"@slack/bolt": "^4.7.0",
|
|
40
|
-
"@whiskeysockets/baileys": "7.0.0-
|
|
40
|
+
"@whiskeysockets/baileys": "7.0.0-rc13",
|
|
41
41
|
"ajv": "^8.20.0",
|
|
42
42
|
"better-sqlite3": "^12.8.0",
|
|
43
43
|
"busboy": "^1.6.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"google-auth-library": "^10.6.2",
|
|
50
50
|
"googleapis": "^171.4.0",
|
|
51
51
|
"heap-js": "^2.7.1",
|
|
52
|
-
"hono": "^4.12.
|
|
52
|
+
"hono": "^4.12.25",
|
|
53
53
|
"html-to-text": "^9.0.5",
|
|
54
54
|
"ical.js": "^2.2.1",
|
|
55
55
|
"imapflow": "^1.3.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"telegraf": "^4.16.3",
|
|
67
67
|
"tsdav": "^2.1.8",
|
|
68
68
|
"zod": "^4.3.6",
|
|
69
|
-
"@aitne/shared": "0.1.
|
|
69
|
+
"@aitne/shared": "0.1.11"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/better-sqlite3": "^7.6.13",
|