@vellumai/assistant 0.10.7-dev.202607101554.2aa9767 → 0.10.7-dev.202607101836.11f2eba

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.
Files changed (643) hide show
  1. package/docs/workspace-tools.md +2 -3
  2. package/eslint-rules/__tests__/cli-no-daemon-internals.test.ts +62 -360
  3. package/eslint-rules/cli-no-daemon-internals.js +91 -275
  4. package/eslint.config.mjs +4 -4
  5. package/package.json +1 -1
  6. package/src/__tests__/activation-early-marking.test.ts +1 -8
  7. package/src/__tests__/actor-token-service.test.ts +0 -7
  8. package/src/__tests__/add-message-preassigned-id.test.ts +1 -1
  9. package/src/__tests__/agent-loop-callsite-precedence.test.ts +0 -5
  10. package/src/__tests__/agent-loop-mutable-latest-user-message.test.ts +0 -6
  11. package/src/__tests__/agent-loop-override-profile.test.ts +0 -6
  12. package/src/__tests__/agent-loop-pushes-post-hook-prompt.test.ts +0 -8
  13. package/src/__tests__/agent-loop-set-system-prompt.test.ts +0 -6
  14. package/src/__tests__/annotate-activity-metadata.test.ts +4 -10
  15. package/src/__tests__/annotate-risk-options.test.ts +4 -10
  16. package/src/__tests__/app-bundler.test.ts +0 -8
  17. package/src/__tests__/app-conversation-ids-backfill.test.ts +1 -8
  18. package/src/__tests__/app-routes-csp.test.ts +0 -8
  19. package/src/__tests__/approval-cascade.test.ts +0 -21
  20. package/src/__tests__/approval-interception-trust-gates.test.ts +0 -7
  21. package/src/__tests__/approval-primitive.test.ts +1 -9
  22. package/src/__tests__/approval-routes-http.test.ts +0 -7
  23. package/src/__tests__/assistant-event-hub-machine-name.test.ts +0 -7
  24. package/src/__tests__/assistant-events-sse-hardening.test.ts +0 -7
  25. package/src/__tests__/attachment-stored-path-annotation.test.ts +0 -7
  26. package/src/__tests__/attachment-upload-trusted-source.test.ts +0 -7
  27. package/src/__tests__/attachments-store-heic-normalize.test.ts +0 -7
  28. package/src/__tests__/attachments-store.test.ts +0 -7
  29. package/src/__tests__/audit-log-rotation.test.ts +1 -9
  30. package/src/__tests__/auth-fallback-events-store.test.ts +0 -7
  31. package/src/__tests__/avatar-generator.test.ts +0 -9
  32. package/src/__tests__/background-shell-host-bash.test.ts +0 -7
  33. package/src/__tests__/browser-fill-credential.test.ts +0 -7
  34. package/src/__tests__/browser-manager.test.ts +1 -8
  35. package/src/__tests__/btw-routes.test.ts +0 -7
  36. package/src/__tests__/build-persisted-content.test.ts +0 -8
  37. package/src/__tests__/call-controller.test.ts +36 -34
  38. package/src/__tests__/call-conversation-messages.test.ts +2 -9
  39. package/src/__tests__/call-domain.test.ts +7 -24
  40. package/src/__tests__/call-pointer-message-composer.test.ts +0 -8
  41. package/src/__tests__/call-pointer-messages.test.ts +1 -8
  42. package/src/__tests__/call-recovery.test.ts +1 -8
  43. package/src/__tests__/call-routes-http.test.ts +0 -7
  44. package/src/__tests__/call-site-routing-provider.test.ts +0 -5
  45. package/src/__tests__/call-state.test.ts +1 -8
  46. package/src/__tests__/call-store.test.ts +1 -8
  47. package/src/__tests__/cancel-resolves-conversation-key.test.ts +0 -7
  48. package/src/__tests__/canonical-guardian-store.test.ts +1 -8
  49. package/src/__tests__/catalog-cache.test.ts +0 -8
  50. package/src/__tests__/catalog-files.test.ts +0 -8
  51. package/src/__tests__/catalog-install-normalize.test.ts +0 -7
  52. package/src/__tests__/ces-rpc-credential-backend.test.ts +0 -7
  53. package/src/__tests__/channel-approval-routes.test.ts +0 -7
  54. package/src/__tests__/channel-approvals.test.ts +0 -7
  55. package/src/__tests__/channel-delivery-store.test.ts +0 -7
  56. package/src/__tests__/channel-guardian.test.ts +0 -7
  57. package/src/__tests__/channel-inbound-disk-pressure.test.ts +0 -7
  58. package/src/__tests__/channel-reply-delivery.test.ts +18 -5
  59. package/src/__tests__/channel-retry-sweep.test.ts +0 -7
  60. package/src/__tests__/clawhub-files.test.ts +0 -8
  61. package/src/__tests__/clawhub.test.ts +0 -7
  62. package/src/__tests__/clear-all-lexical.test.ts +0 -6
  63. package/src/__tests__/client-os-metadata-persistence.test.ts +0 -5
  64. package/src/__tests__/compaction-events.test.ts +0 -21
  65. package/src/__tests__/compaction-ledger-store.test.ts +1 -7
  66. package/src/__tests__/compaction-summary-head-persisted-count.test.ts +0 -21
  67. package/src/__tests__/compaction-trail-store.test.ts +0 -7
  68. package/src/__tests__/compaction.benchmark.test.ts +0 -5
  69. package/src/__tests__/compactor-call-site-logging.test.ts +0 -21
  70. package/src/__tests__/compactor-fixed-boundary.test.ts +0 -21
  71. package/src/__tests__/compactor-low-watermark-cut.test.ts +0 -21
  72. package/src/__tests__/compactor-media-strip.test.ts +0 -21
  73. package/src/__tests__/compactor-preserved-tail-count.test.ts +0 -21
  74. package/src/__tests__/compactor-summary-call-truncation.test.ts +0 -21
  75. package/src/__tests__/compactor-web-search-strip.test.ts +0 -21
  76. package/src/__tests__/config-get-vision-flag.test.ts +0 -6
  77. package/src/__tests__/config-loader-backfill.test.ts +0 -21
  78. package/src/__tests__/config-loader-platform-defaults.test.ts +0 -21
  79. package/src/__tests__/config-schema.test.ts +1 -22
  80. package/src/__tests__/config-set-route.test.ts +0 -6
  81. package/src/__tests__/config-watcher-cleanup-throttle.test.ts +0 -8
  82. package/src/__tests__/config-watcher-skill-reseed.test.ts +0 -8
  83. package/src/__tests__/config-watcher.test.ts +0 -8
  84. package/src/__tests__/confirmation-request-guardian-bridge.test.ts +0 -8
  85. package/src/__tests__/contact-store-interaction-info.test.ts +1 -8
  86. package/src/__tests__/contact-store-user-file.test.ts +1 -8
  87. package/src/__tests__/contacts-tools.test.ts +0 -7
  88. package/src/__tests__/contacts-write.test.ts +1 -8
  89. package/src/__tests__/context-search-memory-v2-source.test.ts +0 -6
  90. package/src/__tests__/context-window-manager-compact-retry.test.ts +0 -21
  91. package/src/__tests__/context-window-manager-overflow-rung.test.ts +0 -21
  92. package/src/__tests__/conversation-abort-tool-results.test.ts +0 -5
  93. package/src/__tests__/conversation-agent-loop-disk-pressure.test.ts +0 -7
  94. package/src/__tests__/conversation-agent-loop-inference-profile.test.ts +0 -6
  95. package/src/__tests__/conversation-agent-loop-overflow.test.ts +0 -5
  96. package/src/__tests__/conversation-agent-loop.test.ts +0 -5
  97. package/src/__tests__/conversation-app-control-instantiation.test.ts +0 -5
  98. package/src/__tests__/conversation-app-control-lifecycle.test.ts +0 -5
  99. package/src/__tests__/conversation-attachments.test.ts +0 -7
  100. package/src/__tests__/conversation-attention-store.test.ts +1 -9
  101. package/src/__tests__/conversation-attention-telegram.test.ts +0 -8
  102. package/src/__tests__/conversation-clear-safety.test.ts +0 -7
  103. package/src/__tests__/conversation-confirmation-signals.test.ts +0 -21
  104. package/src/__tests__/conversation-crud-enabled-plugins.test.ts +1 -7
  105. package/src/__tests__/conversation-crud-inference-profile.test.ts +1 -7
  106. package/src/__tests__/conversation-delete-schedule-cleanup.test.ts +0 -7
  107. package/src/__tests__/conversation-disk-view-integration.test.ts +0 -7
  108. package/src/__tests__/conversation-disk-view.test.ts +0 -7
  109. package/src/__tests__/conversation-enabledplugins-route.test.ts +2 -8
  110. package/src/__tests__/conversation-fork-crud.test.ts +34 -32
  111. package/src/__tests__/conversation-fork-retrospective.test.ts +8 -12
  112. package/src/__tests__/conversation-fork-route.test.ts +0 -7
  113. package/src/__tests__/conversation-history-web-search.test.ts +20 -13
  114. package/src/__tests__/conversation-inference-profile-list.test.ts +0 -6
  115. package/src/__tests__/conversation-inference-profile-route.test.ts +0 -5
  116. package/src/__tests__/conversation-key-store-disk-view.test.ts +0 -7
  117. package/src/__tests__/conversation-lifecycle.test.ts +63 -65
  118. package/src/__tests__/conversation-list-source.test.ts +0 -7
  119. package/src/__tests__/conversation-load-history-repair.test.ts +39 -53
  120. package/src/__tests__/conversation-load-history-stripped.test.ts +12 -19
  121. package/src/__tests__/conversation-loop-db-lock-resilience.test.ts +0 -8
  122. package/src/__tests__/conversation-message-id-uuidv7.test.ts +0 -7
  123. package/src/__tests__/conversation-pairing.test.ts +0 -7
  124. package/src/__tests__/conversation-process-app-control-preactivation.test.ts +0 -5
  125. package/src/__tests__/conversation-process-callsite.test.ts +0 -5
  126. package/src/__tests__/conversation-provider-retry-repair.test.ts +0 -5
  127. package/src/__tests__/conversation-queue.test.ts +0 -21
  128. package/src/__tests__/conversation-routes-disk-view.test.ts +0 -7
  129. package/src/__tests__/conversation-routes-enabled-plugins.test.ts +2 -10
  130. package/src/__tests__/conversation-routes-guardian-reply.test.ts +2 -10
  131. package/src/__tests__/conversation-routes-hidden-queue.test.ts +2 -10
  132. package/src/__tests__/conversation-routes-slash-commands.test.ts +0 -7
  133. package/src/__tests__/conversation-runtime-assembly.test.ts +6 -3
  134. package/src/__tests__/conversation-skill-tools.test.ts +0 -9
  135. package/src/__tests__/conversation-slash-queue.test.ts +0 -5
  136. package/src/__tests__/conversation-slash-unknown.test.ts +0 -5
  137. package/src/__tests__/conversation-speed-override.test.ts +0 -21
  138. package/src/__tests__/conversation-starter-routes.test.ts +0 -7
  139. package/src/__tests__/conversation-store.test.ts +9 -12
  140. package/src/__tests__/conversation-summarize-route.test.ts +0 -7
  141. package/src/__tests__/conversation-summarize-up-to.test.ts +4 -25
  142. package/src/__tests__/conversation-surfaces-activation-emit.test.ts +0 -8
  143. package/src/__tests__/conversation-surfaces-data-persist.test.ts +4 -2
  144. package/src/__tests__/conversation-title-service.test.ts +0 -7
  145. package/src/__tests__/conversation-unread-route.test.ts +0 -7
  146. package/src/__tests__/conversation-usage.test.ts +0 -7
  147. package/src/__tests__/conversation-wait-for-idle.test.ts +0 -21
  148. package/src/__tests__/conversation-workspace-cache-state.test.ts +0 -5
  149. package/src/__tests__/conversation-workspace-injection.test.ts +0 -5
  150. package/src/__tests__/conversation-workspace-tool-tracking.test.ts +0 -5
  151. package/src/__tests__/conversations-import-system-filter.test.ts +0 -7
  152. package/src/__tests__/credential-broker-browser-fill.test.ts +0 -9
  153. package/src/__tests__/credential-broker-server-use.test.ts +0 -9
  154. package/src/__tests__/credential-health-service.test.ts +0 -9
  155. package/src/__tests__/credential-metadata-store.test.ts +0 -8
  156. package/src/__tests__/credential-prompt-route.test.ts +0 -7
  157. package/src/__tests__/credential-resolve.test.ts +0 -8
  158. package/src/__tests__/credential-security-invariants.test.ts +0 -7
  159. package/src/__tests__/credential-token-resolver.test.ts +0 -9
  160. package/src/__tests__/daemon-assistant-events.test.ts +1 -9
  161. package/src/__tests__/daemon-credential-client.test.ts +0 -7
  162. package/src/__tests__/db-conversation-fork-lineage-migration.test.ts +1 -8
  163. package/src/__tests__/db-conversation-inference-profile-migration.test.ts +1 -7
  164. package/src/__tests__/db-llm-request-log-provider-migration.test.ts +0 -8
  165. package/src/__tests__/db-readiness-http-gate.test.ts +0 -7
  166. package/src/__tests__/db-rename-inference-profile-snake-case-migration.test.ts +1 -7
  167. package/src/__tests__/delete-managed-skill-tool.test.ts +0 -7
  168. package/src/__tests__/delete-propagation.test.ts +0 -7
  169. package/src/__tests__/deterministic-verification-control-plane.test.ts +0 -7
  170. package/src/__tests__/device-id.test.ts +1 -9
  171. package/src/__tests__/dm-backfill.test.ts +0 -7
  172. package/src/__tests__/dm-persistence.test.ts +0 -5
  173. package/src/__tests__/docker-signing-key-bootstrap.test.ts +1 -8
  174. package/src/__tests__/drain-requeue-on-contention.test.ts +1 -8
  175. package/src/__tests__/dynamic-skill-background-guard.test.ts +0 -8
  176. package/src/__tests__/edit-propagation.test.ts +1 -8
  177. package/src/__tests__/embedding-managed-proxy-selection.test.ts +0 -8
  178. package/src/__tests__/emit-signal-routing-intent.test.ts +0 -7
  179. package/src/__tests__/encrypted-store.test.ts +0 -9
  180. package/src/__tests__/ensure-conversation-exists.test.ts +0 -7
  181. package/src/__tests__/events-client-registration.test.ts +0 -7
  182. package/src/__tests__/events-dev-bypass-actor.test.ts +0 -7
  183. package/src/__tests__/events-tail-route.test.ts +1 -8
  184. package/src/__tests__/followup-tools.test.ts +0 -7
  185. package/src/__tests__/guardian-action-sweep.test.ts +0 -7
  186. package/src/__tests__/guardian-binding-drift-heal.test.ts +0 -7
  187. package/src/__tests__/guardian-card-withdrawal.test.ts +0 -8
  188. package/src/__tests__/guardian-decision-primitive-canonical.test.ts +1 -9
  189. package/src/__tests__/guardian-dispatch.test.ts +0 -7
  190. package/src/__tests__/guardian-expiry-notifier.test.ts +0 -9
  191. package/src/__tests__/guardian-outbound-http.test.ts +0 -7
  192. package/src/__tests__/guardian-principal-id-roundtrip.test.ts +1 -8
  193. package/src/__tests__/guardian-routing-invariants.test.ts +0 -8
  194. package/src/__tests__/guardian-routing-state.test.ts +0 -8
  195. package/src/__tests__/guardian-verification-voice-binding.test.ts +0 -7
  196. package/src/__tests__/handlers-skills-memory-v2-reseed.test.ts +0 -2
  197. package/src/__tests__/headless-browser-interactions.test.ts +0 -7
  198. package/src/__tests__/headless-browser-mode.test.ts +0 -9
  199. package/src/__tests__/headless-browser-navigate.test.ts +0 -7
  200. package/src/__tests__/headless-browser-read-tools.test.ts +0 -7
  201. package/src/__tests__/headless-browser-snapshot.test.ts +0 -7
  202. package/src/__tests__/heartbeat-disk-pressure.test.ts +0 -9
  203. package/src/__tests__/host-browser-proxy.test.ts +15 -20
  204. package/src/__tests__/host-shell-tool.test.ts +0 -7
  205. package/src/__tests__/http-conversation-lineage.test.ts +0 -7
  206. package/src/__tests__/http-user-message-parity.test.ts +0 -7
  207. package/src/__tests__/identity-routes.test.ts +1 -9
  208. package/src/__tests__/inbound-admitted-introduction-nudge.test.ts +0 -7
  209. package/src/__tests__/inbound-invite-redemption.test.ts +0 -7
  210. package/src/__tests__/inbound-slack-persistence.test.ts +0 -5
  211. package/src/__tests__/inbound-trust-verdict.test.ts +0 -7
  212. package/src/__tests__/inference-profile-reaper.test.ts +1 -7
  213. package/src/__tests__/inference-profile-session-handler.test.ts +0 -6
  214. package/src/__tests__/inference-profile-session-ipc.test.ts +0 -6
  215. package/src/__tests__/ingress-url-consistency.test.ts +1 -23
  216. package/src/__tests__/inline-command-runner.test.ts +0 -7
  217. package/src/__tests__/inline-skill-load-permissions.test.ts +0 -7
  218. package/src/__tests__/internal-telemetry-routes.test.ts +0 -7
  219. package/src/__tests__/interrupted-turn-reconciler.test.ts +1 -8
  220. package/src/__tests__/introduction-card-resolver.test.ts +0 -8
  221. package/src/__tests__/invite-redeemed-ipc.test.ts +0 -7
  222. package/src/__tests__/invite-routes-http.test.ts +0 -7
  223. package/src/__tests__/jobs-store-qdrant-breaker.test.ts +0 -7
  224. package/src/__tests__/jobs-store-upsert-debounced.test.ts +0 -7
  225. package/src/__tests__/lexical-index-dual-write.test.ts +0 -6
  226. package/src/__tests__/list-messages-attachments.test.ts +0 -7
  227. package/src/__tests__/list-messages-background-tool-completion.test.ts +0 -7
  228. package/src/__tests__/list-messages-client-message-id.test.ts +0 -7
  229. package/src/__tests__/list-messages-hidden-metadata.test.ts +0 -7
  230. package/src/__tests__/list-messages-page-latest.test.ts +0 -7
  231. package/src/__tests__/list-messages-queued.test.ts +0 -7
  232. package/src/__tests__/list-messages-tool-merge.test.ts +0 -7
  233. package/src/__tests__/llm-context-route-provider.test.ts +1 -8
  234. package/src/__tests__/llm-request-log-agent-loop-exit-reason.test.ts +0 -7
  235. package/src/__tests__/llm-request-log-call-site.test.ts +0 -7
  236. package/src/__tests__/llm-request-log-clickhouse-routing.test.ts +7 -7
  237. package/src/__tests__/llm-request-log-clickhouse-writer-guards.test.ts +115 -0
  238. package/src/__tests__/llm-request-log-disabled-writes.test.ts +0 -7
  239. package/src/__tests__/llm-request-log-sink-clickhouse.test.ts +15 -23
  240. package/src/__tests__/llm-request-log-source-clickhouse.test.ts +1 -22
  241. package/src/__tests__/llm-request-log-source-factory.test.ts +0 -21
  242. package/src/__tests__/llm-request-log-turn-query.test.ts +0 -7
  243. package/src/__tests__/llm-usage-store.test.ts +1 -7
  244. package/src/__tests__/log-export-routes.test.ts +0 -7
  245. package/src/__tests__/log-export-workspace.test.ts +0 -7
  246. package/src/__tests__/managed-profile-guard.test.ts +0 -6
  247. package/src/__tests__/managed-skill-lifecycle.test.ts +0 -7
  248. package/src/__tests__/managed-store.test.ts +1 -16
  249. package/src/__tests__/mcp-auth-routes.test.ts +1 -8
  250. package/src/__tests__/media-stream-output.test.ts +0 -9
  251. package/src/__tests__/media-stream-server-integration.test.ts +3 -11
  252. package/src/__tests__/media-stream-stt-session.test.ts +0 -10
  253. package/src/__tests__/memory-jobs-worker-backoff.test.ts +0 -7
  254. package/src/__tests__/memory-jobs-worker-cleanup-cadence.test.ts +0 -7
  255. package/src/__tests__/memory-jobs-worker-lanes.test.ts +0 -7
  256. package/src/__tests__/memory-recall-log-store.test.ts +0 -7
  257. package/src/__tests__/memory-upsert-concurrency.test.ts +0 -7
  258. package/src/__tests__/messages-after-tiebreaker.test.ts +1 -7
  259. package/src/__tests__/messaging-send-tool.test.ts +0 -7
  260. package/src/__tests__/migration-cross-version-compatibility.test.ts +0 -7
  261. package/src/__tests__/migration-export-http.test.ts +10 -12
  262. package/src/__tests__/migration-export-streaming.test.ts +0 -7
  263. package/src/__tests__/migration-export-to-gcs.test.ts +0 -7
  264. package/src/__tests__/migration-import-commit-http.test.ts +11 -12
  265. package/src/__tests__/migration-import-from-gcs.test.ts +0 -7
  266. package/src/__tests__/migration-import-from-url.test.ts +0 -7
  267. package/src/__tests__/migration-import-preflight-http.test.ts +10 -11
  268. package/src/__tests__/migration-jobs-status.test.ts +8 -11
  269. package/src/__tests__/migration-validate-http.test.ts +2 -8
  270. package/src/__tests__/non-member-access-request.test.ts +0 -7
  271. package/src/__tests__/notification-broadcaster.test.ts +0 -7
  272. package/src/__tests__/notification-candidate-guardian-context.test.ts +1 -8
  273. package/src/__tests__/notification-decision-fallback.test.ts +0 -7
  274. package/src/__tests__/notification-decision-identity.test.ts +0 -7
  275. package/src/__tests__/notification-decision-recipient-context.test.ts +0 -7
  276. package/src/__tests__/notification-deep-link.test.ts +0 -7
  277. package/src/__tests__/notification-guardian-path.test.ts +0 -7
  278. package/src/__tests__/notification-platform-adapter.test.ts +0 -7
  279. package/src/__tests__/notification-routing-intent.test.ts +1 -9
  280. package/src/__tests__/notification-schedule-notify-dedup.test.ts +1 -9
  281. package/src/__tests__/notification-telegram-adapter.test.ts +0 -7
  282. package/src/__tests__/oauth-connect-orchestrator.test.ts +0 -8
  283. package/src/__tests__/oauth-connect-routes.test.ts +19 -18
  284. package/src/__tests__/oauth-provider-profiles.test.ts +0 -7
  285. package/src/__tests__/oauth-provider-visibility.test.ts +0 -7
  286. package/src/__tests__/oauth-store.test.ts +0 -7
  287. package/src/__tests__/outbound-slack-persistence.test.ts +0 -7
  288. package/src/__tests__/outlook-email-watcher.test.ts +0 -9
  289. package/src/__tests__/path-policy.test.ts +0 -7
  290. package/src/__tests__/persist-media-references.test.ts +1 -6
  291. package/src/__tests__/persist-unsendable-image-downscale.test.ts +1 -3
  292. package/src/__tests__/persist-unsendable-image.test.ts +1 -3
  293. package/src/__tests__/persistence-secret-redaction.test.ts +0 -7
  294. package/src/__tests__/platform-bash-auto-approve.test.ts +0 -8
  295. package/src/__tests__/platform-callback-registration.test.ts +10 -9
  296. package/src/__tests__/platform-proxy-context.test.ts +0 -8
  297. package/src/__tests__/playbook-execution.test.ts +0 -7
  298. package/src/__tests__/playbook-tools.test.ts +0 -7
  299. package/src/__tests__/process-message-background-slack.test.ts +0 -5
  300. package/src/__tests__/process-message-display-content.test.ts +0 -5
  301. package/src/__tests__/processing-flag-persist-failure.test.ts +0 -5
  302. package/src/__tests__/provider-commit-message-generator.test.ts +0 -7
  303. package/src/__tests__/provider-error-scenarios.test.ts +5 -6
  304. package/src/__tests__/provider-send-message-override-profile.test.ts +0 -6
  305. package/src/__tests__/provider-streaming.benchmark.test.ts +1 -6
  306. package/src/__tests__/provider-usage-tracking.test.ts +0 -6
  307. package/src/__tests__/proxy-approval-callback.test.ts +0 -5
  308. package/src/__tests__/prune-old-conversations-job.test.ts +1 -9
  309. package/src/__tests__/prune-old-tool-invocations-job.test.ts +1 -9
  310. package/src/__tests__/public-ingress-urls.test.ts +1 -24
  311. package/src/__tests__/qdrant-collection-migration.test.ts +0 -7
  312. package/src/__tests__/qdrant-manager.test.ts +0 -8
  313. package/src/__tests__/ratelimit.test.ts +1 -8
  314. package/src/__tests__/reaction-persistence.test.ts +0 -7
  315. package/src/__tests__/rebuild-index-graph-nodes.test.ts +0 -7
  316. package/src/__tests__/request-secret-standalone-channel-gate.test.ts +0 -7
  317. package/src/__tests__/require-fresh-approval.test.ts +0 -8
  318. package/src/__tests__/retry-openrouter-only-normalization.test.ts +0 -5
  319. package/src/__tests__/retry-thinking-adaptive-only.test.ts +0 -5
  320. package/src/__tests__/retry-thinking-tool-choice.test.ts +0 -5
  321. package/src/__tests__/retry-verbosity-normalization.test.ts +0 -5
  322. package/src/__tests__/runtime-attachment-metadata.test.ts +0 -7
  323. package/src/__tests__/runtime-events-sse-bilingual.test.ts +0 -7
  324. package/src/__tests__/runtime-events-sse-parity.test.ts +0 -7
  325. package/src/__tests__/runtime-events-sse-reconnect.test.ts +0 -7
  326. package/src/__tests__/runtime-events-sse.test.ts +0 -7
  327. package/src/__tests__/scaffold-managed-skill-tool.test.ts +0 -7
  328. package/src/__tests__/schedule-retry.test.ts +0 -8
  329. package/src/__tests__/schedule-routes-workflow-validation.test.ts +0 -7
  330. package/src/__tests__/schedule-routes.test.ts +0 -7
  331. package/src/__tests__/schedule-store.test.ts +0 -8
  332. package/src/__tests__/schedule-tools.test.ts +0 -7
  333. package/src/__tests__/scheduler-disk-pressure.test.ts +0 -10
  334. package/src/__tests__/scheduler-recurrence.test.ts +0 -8
  335. package/src/__tests__/scheduler-reuse-conversation.test.ts +0 -8
  336. package/src/__tests__/scheduler-wake.test.ts +0 -8
  337. package/src/__tests__/scheduler-worker-standdown.test.ts +0 -8
  338. package/src/__tests__/scoped-approval-grants.test.ts +1 -9
  339. package/src/__tests__/scoped-grant-security-matrix.test.ts +1 -9
  340. package/src/__tests__/secret-allowlist.test.ts +1 -8
  341. package/src/__tests__/secret-ingress-channel.test.ts +0 -7
  342. package/src/__tests__/secret-ingress-cli.test.ts +0 -7
  343. package/src/__tests__/secret-ingress-http.test.ts +2 -10
  344. package/src/__tests__/secret-routes-platform-proxy.test.ts +0 -7
  345. package/src/__tests__/secure-keys-managed-failover.test.ts +0 -7
  346. package/src/__tests__/secure-keys.test.ts +0 -9
  347. package/src/__tests__/send-endpoint-busy.test.ts +0 -7
  348. package/src/__tests__/sequence-store.test.ts +0 -9
  349. package/src/__tests__/server-history-render.test.ts +1 -8
  350. package/src/__tests__/set-permission-mode.test.ts +0 -7
  351. package/src/__tests__/settings-routes.test.ts +0 -7
  352. package/src/__tests__/shell-credential-ref.test.ts +0 -8
  353. package/src/__tests__/shell-tool-proxy-mode.test.ts +0 -7
  354. package/src/__tests__/skill-projection-feature-flag.test.ts +0 -9
  355. package/src/__tests__/skill-projection.benchmark.test.ts +0 -5
  356. package/src/__tests__/skill-script-runner-sandbox.test.ts +0 -7
  357. package/src/__tests__/skills-files-catalog-fallback.test.ts +0 -7
  358. package/src/__tests__/slack-inbound-verification.test.ts +0 -7
  359. package/src/__tests__/slack-reaction-canonical-approval.test.ts +0 -8
  360. package/src/__tests__/slim-skill-category.test.ts +0 -7
  361. package/src/__tests__/stale-approval-dedup.test.ts +0 -7
  362. package/src/__tests__/subagent-call-site-routing.test.ts +0 -5
  363. package/src/__tests__/subagent-detail.test.ts +1 -1
  364. package/src/__tests__/subagent-fork-prompt-role.test.ts +0 -5
  365. package/src/__tests__/subagent-spawn-and-await.test.ts +0 -5
  366. package/src/__tests__/subagent-tools.test.ts +77 -36
  367. package/src/__tests__/suggestion-routes.test.ts +28 -42
  368. package/src/__tests__/summarize-boundary.test.ts +2 -1
  369. package/src/__tests__/task-compiler.test.ts +0 -7
  370. package/src/__tests__/task-management-tools.test.ts +0 -7
  371. package/src/__tests__/task-memory-cleanup.test.ts +0 -7
  372. package/src/__tests__/task-scheduler.test.ts +0 -7
  373. package/src/__tests__/telegram-bot-username-resolution.test.ts +0 -8
  374. package/src/__tests__/thread-backfill.test.ts +0 -7
  375. package/src/__tests__/token-manager.test.ts +0 -9
  376. package/src/__tests__/tool-approval-handler.test.ts +0 -8
  377. package/src/__tests__/tool-execution-abort-cleanup.test.ts +0 -7
  378. package/src/__tests__/tool-execution-pipeline.benchmark.test.ts +0 -8
  379. package/src/__tests__/tool-executor-lifecycle-events.test.ts +0 -8
  380. package/src/__tests__/tool-executor.test.ts +0 -8
  381. package/src/__tests__/tool-grant-request-escalation.test.ts +0 -8
  382. package/src/__tests__/tool-preview-lifecycle.test.ts +0 -8
  383. package/src/__tests__/tool-result-metadata-plumbing.test.ts +0 -8
  384. package/src/__tests__/tool-start-timestamp.test.ts +4 -10
  385. package/src/__tests__/trusted-contact-inline-approval-integration.test.ts +0 -8
  386. package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +0 -7
  387. package/src/__tests__/trusted-contact-multichannel.test.ts +0 -7
  388. package/src/__tests__/trusted-contact-verification.test.ts +1 -9
  389. package/src/__tests__/turn-boundary-resolution.test.ts +0 -7
  390. package/src/__tests__/turn-events-store.test.ts +1 -7
  391. package/src/__tests__/turn-outcome-read.test.ts +1 -7
  392. package/src/__tests__/twilio-config.test.ts +0 -7
  393. package/src/__tests__/twilio-provider.test.ts +0 -7
  394. package/src/__tests__/twilio-routes-twiml.test.ts +1 -8
  395. package/src/__tests__/twilio-validation.test.ts +0 -7
  396. package/src/__tests__/usage-cache-backfill-migration.test.ts +0 -7
  397. package/src/__tests__/usage-routes.test.ts +1 -8
  398. package/src/__tests__/vbundle-pax-and-symlink.test.ts +0 -7
  399. package/src/__tests__/vercel-config.test.ts +0 -7
  400. package/src/__tests__/verification-control-plane-policy.test.ts +0 -8
  401. package/src/__tests__/voice-approval-resolver-relay.test.ts +3 -9
  402. package/src/__tests__/voice-config-update.test.ts +1 -22
  403. package/src/__tests__/voice-scoped-grant-consumer.test.ts +0 -8
  404. package/src/__tests__/voice-session-bridge-processing-wait.test.ts +0 -7
  405. package/src/__tests__/voice-session-bridge.test.ts +0 -7
  406. package/src/__tests__/workspace-migration-009-backfill-conversation-disk-view.test.ts +0 -7
  407. package/src/__tests__/workspace-migration-013-repair-conversation-disk-view.test.ts +0 -7
  408. package/src/__tests__/workspace-migration-028-recover-conversations-from-disk-view.test.ts +0 -7
  409. package/src/a2a/__tests__/e2e-a2a-channel.test.ts +1 -9
  410. package/src/a2a/__tests__/task-store.test.ts +0 -9
  411. package/src/acp/__tests__/session-manager-persistence.test.ts +1 -8
  412. package/src/acp/__tests__/session-manager-resume.test.ts +0 -7
  413. package/src/acp/__tests__/session-manager-startup.test.ts +1 -8
  414. package/src/background-wake/wake-intent-hooks.test.ts +0 -10
  415. package/src/calls/__tests__/call-setup-router.test.ts +84 -71
  416. package/src/calls/__tests__/fish-audio-client.test.ts +6 -11
  417. package/src/calls/__tests__/voice-session-bridge.test.ts +3 -8
  418. package/src/cli/AGENTS.md +59 -51
  419. package/src/cli/commands/browser.ts +15 -3
  420. package/src/cli/commands/contacts.ts +11 -24
  421. package/src/cli/commands/db/repair-step-conversation-backfill.ts +19 -9
  422. package/src/cli/commands/memory/memory-v2-compare-render.ts +2 -2
  423. package/src/cli/commands/oauth/shared.ts +1 -1
  424. package/src/cli/commands/oauth/status.test.ts +6 -6
  425. package/src/cli/commands/oauth/status.ts +12 -6
  426. package/src/cli/commands/plugins.ts +3 -3
  427. package/src/cli/commands/ui.ts +2 -3
  428. package/src/cli/lib/publish-plugin.ts +3 -3
  429. package/src/cli.ts +22 -13
  430. package/src/config/__tests__/default-provider.test.ts +0 -21
  431. package/src/config/__tests__/deployment-context-defaults.test.ts +0 -21
  432. package/src/config/__tests__/loader-callsite-strip-fallback.test.ts +0 -21
  433. package/src/config/__tests__/loader-last-known-good.test.ts +0 -21
  434. package/src/config/__tests__/loader-sparse-array-cleanup.test.ts +0 -21
  435. package/src/config/__tests__/seed-default-provider.test.ts +0 -21
  436. package/src/config/__tests__/sync-gated-profiles.test.ts +0 -21
  437. package/src/config/bundled-skills/transcribe/tools/transcribe-media.test.ts +0 -7
  438. package/src/config/feature-flag-registry.json +2 -2
  439. package/src/conversations/__tests__/message-consolidation.test.ts +6 -5
  440. package/src/conversations/message-consolidation.ts +34 -112
  441. package/src/daemon/__tests__/inference-profile-notification.test.ts +0 -8
  442. package/src/daemon/__tests__/native-web-search-metadata.test.ts +0 -8
  443. package/src/daemon/__tests__/wake-conversation-ops-completion.test.ts +0 -6
  444. package/src/daemon/__tests__/web-search-status-text.test.ts +0 -8
  445. package/src/daemon/conversation-agent-loop-handlers.ts +3 -18
  446. package/src/daemon/conversation-history.ts +6 -12
  447. package/src/daemon/conversation-runtime-assembly.ts +148 -52
  448. package/src/daemon/conversation-surfaces.ts +141 -75
  449. package/src/daemon/conversation.ts +8 -16
  450. package/src/daemon/event-loop-watchdog.test.ts +1 -6
  451. package/src/daemon/external-plugins-bootstrap.ts +0 -7
  452. package/src/daemon/handlers/__tests__/config-a2a-accept.test.ts +0 -7
  453. package/src/daemon/handlers/__tests__/config-a2a-complete.test.ts +1 -8
  454. package/src/daemon/handlers/__tests__/config-a2a-invite.test.ts +1 -8
  455. package/src/daemon/handlers/__tests__/config-a2a-redeem.test.ts +1 -8
  456. package/src/daemon/handlers/__tests__/config-a2a.test.ts +1 -8
  457. package/src/daemon/handlers/conversation-history.ts +6 -4
  458. package/src/daemon/orphan-reaper.test.ts +1 -6
  459. package/src/daemon/sqlite-corruption-watchdog.test.ts +0 -6
  460. package/src/documents/document-comments-store.test.ts +1 -7
  461. package/src/export/__tests__/transcript-formatter.test.ts +8 -8
  462. package/src/export/formatter.ts +8 -17
  463. package/src/export/transcript-formatter.ts +4 -1
  464. package/src/heartbeat/__tests__/heartbeat-run-store.test.ts +0 -9
  465. package/src/heartbeat/__tests__/heartbeat-service.test.ts +0 -2
  466. package/src/home/__tests__/home-content-refresh.test.ts +0 -7
  467. package/src/home/__tests__/suggested-prompts.test.ts +0 -7
  468. package/src/ipc/__tests__/contacts-info-ipc.test.ts +12 -10
  469. package/src/ipc/assistant-server.ts +10 -22
  470. package/src/ipc/routes/__tests__/guardian-label-ipc-routes.test.ts +74 -0
  471. package/src/ipc/routes/__tests__/invite-ipc-routes.test.ts +0 -7
  472. package/src/ipc/routes/guardian-label-ipc-routes.ts +42 -0
  473. package/src/live-voice/__tests__/live-voice-archive.test.ts +1 -8
  474. package/src/live-voice/__tests__/runtime-websocket-shell.test.ts +0 -7
  475. package/src/mcp/__tests__/mcp-auth-orchestrator.test.ts +3 -7
  476. package/src/messaging/providers/a2a/__tests__/deliver.test.ts +0 -9
  477. package/src/messaging/providers/slack/__tests__/download.test.ts +1 -8
  478. package/src/messaging/providers/slack/send.test.ts +0 -7
  479. package/src/messaging/providers/slack/withdraw.test.ts +0 -6
  480. package/src/messaging/providers/telegram-bot/send.test.ts +0 -7
  481. package/src/notifications/__tests__/broadcaster.test.ts +4 -17
  482. package/src/notifications/__tests__/connected-channels.test.ts +11 -8
  483. package/src/notifications/__tests__/decision-engine.test.ts +0 -7
  484. package/src/notifications/__tests__/destination-resolver.test.ts +18 -12
  485. package/src/notifications/__tests__/deterministic-checks.test.ts +1 -9
  486. package/src/oauth/byo-connection.test.ts +0 -9
  487. package/src/oauth/connection-resolver.test.ts +0 -7
  488. package/src/onboarding/__tests__/onboarding-events-store.test.ts +0 -8
  489. package/src/permissions/checker.test.ts +0 -8
  490. package/src/permissions/gateway-threshold-reader.test.ts +0 -8
  491. package/src/persistence/__tests__/bulk-write-gate.test.ts +1 -7
  492. package/src/persistence/__tests__/conversation-queries-search.test.ts +0 -7
  493. package/src/persistence/__tests__/message-content-file.test.ts +25 -59
  494. package/src/persistence/conversation-crud.ts +11 -10
  495. package/src/persistence/conversation-disk-view.ts +32 -15
  496. package/src/persistence/conversation-group-migration.test.ts +1 -8
  497. package/src/persistence/conversation-title-service.ts +59 -22
  498. package/src/persistence/embeddings/__tests__/messages-lexical-index.test.ts +0 -7
  499. package/src/persistence/job-handlers/__tests__/message-lexical-backfill.test.ts +0 -7
  500. package/src/persistence/job-handlers/__tests__/message-lexical-enqueue.test.ts +0 -6
  501. package/src/persistence/job-handlers/__tests__/message-lexical.test.ts +0 -7
  502. package/src/persistence/llm-request-log-sink-clickhouse.ts +43 -24
  503. package/src/persistence/llm-request-log-store.ts +182 -135
  504. package/src/persistence/llm-request-log-writer-types.ts +80 -0
  505. package/src/persistence/message-content-file.ts +37 -48
  506. package/src/persistence/message-content.ts +18 -10
  507. package/src/persistence/schema/conversations.ts +3 -3
  508. package/src/platform/consent-cache.test.ts +0 -7
  509. package/src/plugins/defaults/image-recovery/recover.ts +36 -18
  510. package/src/plugins/defaults/memory/__tests__/activation-session-store.test.ts +1 -8
  511. package/src/plugins/defaults/memory/__tests__/clear-stale-processing-flags.test.ts +1 -8
  512. package/src/plugins/defaults/memory/__tests__/conversation-queries.test.ts +1 -8
  513. package/src/plugins/defaults/memory/__tests__/conversation-row-batch-delete.test.ts +0 -6
  514. package/src/plugins/defaults/memory/__tests__/embedding-cache.test.ts +0 -6
  515. package/src/plugins/defaults/memory/__tests__/find-most-recent-retrospective-for.test.ts +1 -8
  516. package/src/plugins/defaults/memory/__tests__/fork-message-copy.test.ts +0 -6
  517. package/src/plugins/defaults/memory/__tests__/jobs-store-enqueue-gate.test.ts +0 -8
  518. package/src/plugins/defaults/memory/__tests__/jobs-worker-memory-disabled.test.ts +0 -7
  519. package/src/plugins/defaults/memory/__tests__/jobs-worker-v2-graph-trigger-embed.test.ts +0 -5
  520. package/src/plugins/defaults/memory/__tests__/memory-retrospective-enqueue.test.ts +0 -7
  521. package/src/plugins/defaults/memory/__tests__/memory-retrospective-job.test.ts +0 -7
  522. package/src/plugins/defaults/memory/__tests__/memory-retrospective-skill-card.test.ts +0 -7
  523. package/src/plugins/defaults/memory/__tests__/memory-retrospective-startup-cleanup.test.ts +0 -7
  524. package/src/plugins/defaults/memory/__tests__/memory-retrospective-state.test.ts +0 -6
  525. package/src/plugins/defaults/memory/__tests__/memory-retrospective-trigger-check.test.ts +0 -7
  526. package/src/plugins/defaults/memory/__tests__/memory-v2-activation-log-store.test.ts +0 -7
  527. package/src/plugins/defaults/memory/__tests__/memory-v2-concept-frequency.test.ts +0 -7
  528. package/src/plugins/defaults/memory/graph/graph-search.test.ts +0 -6
  529. package/src/plugins/defaults/memory/graph/tool-handlers.test.ts +0 -6
  530. package/src/plugins/defaults/memory/indexer.ts +2 -1
  531. package/src/plugins/defaults/memory/job-handlers/embedding.test.ts +0 -7
  532. package/src/plugins/defaults/memory/jobs/__tests__/embed-concept-page.test.ts +0 -7
  533. package/src/plugins/defaults/memory/jobs/embed-pkb-file.test.ts +0 -7
  534. package/src/plugins/defaults/memory/memory-retrospective-job.ts +9 -6
  535. package/src/plugins/defaults/memory/memory-retrospective-skill-card.ts +9 -6
  536. package/src/plugins/defaults/memory/message-media.ts +2 -2
  537. package/src/plugins/defaults/memory/pkb/pkb-index.test.ts +0 -6
  538. package/src/plugins/defaults/memory/pkb/pkb-reconcile.test.ts +0 -6
  539. package/src/plugins/defaults/memory/pkb/pkb-search.test.ts +0 -6
  540. package/src/plugins/defaults/memory/routes/__tests__/memory-v2-simulate-route.test.ts +0 -9
  541. package/src/plugins/defaults/memory/routes/memory-item-routes.test.ts +0 -7
  542. package/src/plugins/defaults/memory/v2/__tests__/activation.test.ts +0 -5
  543. package/src/plugins/defaults/memory/v2/__tests__/backfill-jobs.test.ts +0 -6
  544. package/src/plugins/defaults/memory/v2/__tests__/cli-command-store.test.ts +0 -6
  545. package/src/plugins/defaults/memory/v2/__tests__/consolidation-job.test.ts +0 -6
  546. package/src/plugins/defaults/memory/v2/__tests__/harness-compare.test.ts +0 -5
  547. package/src/plugins/defaults/memory/v2/__tests__/harness-oracle.test.ts +0 -5
  548. package/src/plugins/defaults/memory/v2/__tests__/harness-replay-input.test.ts +0 -5
  549. package/src/plugins/defaults/memory/v2/__tests__/injection-events.test.ts +1 -7
  550. package/src/plugins/defaults/memory/v2/__tests__/injection.test.ts +0 -5
  551. package/src/plugins/defaults/memory/v2/__tests__/migration.test.ts +0 -6
  552. package/src/plugins/defaults/memory/v2/__tests__/page-index.test.ts +0 -5
  553. package/src/plugins/defaults/memory/v2/__tests__/qdrant.test.ts +3 -6
  554. package/src/plugins/defaults/memory/v2/__tests__/reranker.test.ts +3 -5
  555. package/src/plugins/defaults/memory/v2/__tests__/sim.test.ts +0 -5
  556. package/src/plugins/defaults/memory/v2/__tests__/skill-store.test.ts +0 -5
  557. package/src/plugins/defaults/memory/v2/__tests__/sweep-job.test.ts +0 -6
  558. package/src/plugins/defaults/memory/v2/memory-v2-startup.test.ts +0 -5
  559. package/src/plugins/defaults/memory/v3/__tests__/dense.test.ts +0 -5
  560. package/src/plugins/defaults/memory/v3/__tests__/section-dense-store.test.ts +0 -5
  561. package/src/providers/__tests__/connection-model-compat.test.ts +0 -5
  562. package/src/providers/__tests__/count-tokens-forwarding.test.ts +1 -21
  563. package/src/providers/__tests__/dispatch-connection-routing.test.ts +0 -5
  564. package/src/providers/__tests__/retry-callsite.test.ts +0 -6
  565. package/src/providers/__tests__/satellite-connection-routing.test.ts +0 -5
  566. package/src/providers/__tests__/vellum-mismatch-routing.test.ts +0 -5
  567. package/src/providers/inference/__tests__/codex-token-refresh.test.ts +1 -15
  568. package/src/runtime/__tests__/actor-trust-resolver.test.ts +2 -8
  569. package/src/runtime/__tests__/guardian-vellum-migration.test.ts +0 -5
  570. package/src/runtime/__tests__/member-verdict-cache.test.ts +2 -9
  571. package/src/runtime/auth/__tests__/middleware.test.ts +1 -10
  572. package/src/runtime/auth/__tests__/route-policy.test.ts +0 -7
  573. package/src/runtime/auth/__tests__/token-service.test.ts +1 -8
  574. package/src/runtime/channel-reply-delivery.ts +38 -19
  575. package/src/runtime/routes/__tests__/acp-routes.test.ts +0 -7
  576. package/src/runtime/routes/__tests__/backup-routes.test.ts +0 -7
  577. package/src/runtime/routes/__tests__/client-routes.test.ts +0 -7
  578. package/src/runtime/routes/__tests__/connection-routes-vs-cli-parity.test.ts +0 -5
  579. package/src/runtime/routes/__tests__/consolidation-routes.test.ts +1 -8
  580. package/src/runtime/routes/__tests__/content-source-routes.test.ts +0 -7
  581. package/src/runtime/routes/__tests__/conversation-compaction-routes.test.ts +0 -7
  582. package/src/runtime/routes/__tests__/conversation-list-routes.test.ts +0 -7
  583. package/src/runtime/routes/__tests__/conversation-management-routes.test.ts +0 -7
  584. package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +0 -7
  585. package/src/runtime/routes/__tests__/conversation-surface-routes.test.ts +0 -7
  586. package/src/runtime/routes/__tests__/inference-profiles-routes.test.ts +4 -6
  587. package/src/runtime/routes/__tests__/inference-provider-connection-routes.test.ts +0 -5
  588. package/src/runtime/routes/__tests__/retrospective-routes.test.ts +1 -8
  589. package/src/runtime/routes/__tests__/sanity-routes.test.ts +0 -7
  590. package/src/runtime/routes/__tests__/stt-routes.test.ts +0 -9
  591. package/src/runtime/routes/__tests__/suggest-trust-rule-routes.test.ts +0 -7
  592. package/src/runtime/routes/__tests__/task-routes.test.ts +0 -2
  593. package/src/runtime/routes/__tests__/tts-routes.test.ts +0 -7
  594. package/src/runtime/routes/__tests__/user-route-dispatcher.test.ts +1 -9
  595. package/src/runtime/routes/__tests__/wake-conversation-routes.test.ts +0 -7
  596. package/src/runtime/routes/conversation-attention-routes.ts +1 -1
  597. package/src/runtime/routes/conversation-cli-routes.ts +1 -1
  598. package/src/runtime/routes/conversation-routes.ts +56 -35
  599. package/src/runtime/routes/inbound-stages/acl-enforcement.test.ts +0 -5
  600. package/src/runtime/routes/inbound-stages/background-dispatch.test.ts +0 -7
  601. package/src/runtime/routes/inbound-stages/bootstrap-intercept.test.ts +0 -5
  602. package/src/runtime/routes/inbound-stages/edit-intercept.ts +5 -1
  603. package/src/runtime/routes/inbound-stages/escalation-intercept.test.ts +0 -5
  604. package/src/runtime/routes/inbound-stages/guardian-activation-intercept.test.ts +0 -9
  605. package/src/runtime/routes/inbound-stages/guardian-reply-intercept.test.ts +0 -9
  606. package/src/runtime/routes/inbound-stages/transcribe-audio.test.ts +0 -9
  607. package/src/runtime/routes/playground/__tests__/reset-circuit.test.ts +0 -7
  608. package/src/runtime/routes/subagents-routes.ts +17 -18
  609. package/src/runtime/routes/work-items-routes.test.ts +0 -7
  610. package/src/runtime/routes/work-items-routes.ts +54 -21
  611. package/src/runtime/services/__tests__/auto-analysis-guard.test.ts +1 -8
  612. package/src/security/__tests__/oauth2-device-code.test.ts +12 -60
  613. package/src/security/__tests__/provider-key-env-fallback.test.ts +0 -10
  614. package/src/sequence/engine.ts +15 -6
  615. package/src/telemetry/__tests__/config-setting-events-store.test.ts +0 -8
  616. package/src/telemetry/__tests__/watchdog-events-store.test.ts +0 -8
  617. package/src/telemetry/skill-loaded-events-store.test.ts +0 -8
  618. package/src/telemetry/tool-executed-events-store.test.ts +0 -8
  619. package/src/telemetry/turn-trace-store.test.ts +0 -6
  620. package/src/telemetry/usage-telemetry-reporter.test.ts +0 -7
  621. package/src/telemetry/watchdog-direct-emit.test.ts +0 -5
  622. package/src/tools/acp/spawn.test.ts +0 -7
  623. package/src/tools/browser/cdp-client/__tests__/cdp-inspect-client.test.ts +1 -11
  624. package/src/tools/browser/cdp-client/__tests__/local-cdp-client.test.ts +0 -10
  625. package/src/tools/browser/network-recorder.test.ts +0 -11
  626. package/src/tools/document/document-comment-tool.test.ts +1 -7
  627. package/src/tools/host-terminal/host-shell.test.ts +0 -7
  628. package/src/tools/registry.ts +16 -88
  629. package/src/tools/skills/find-similar-skills.test.ts +0 -7
  630. package/src/tools/subagent/read.ts +6 -4
  631. package/src/tools/subagent/spawn.ts +13 -18
  632. package/src/tools/terminal/safe-env.ts +7 -2
  633. package/src/tools/tool-manifest.ts +0 -6
  634. package/src/tts/__tests__/provider-adapters.test.ts +0 -7
  635. package/src/util/logger.ts +8 -3
  636. package/src/util/platform.ts +0 -60
  637. package/src/workflows/engine-integration.test.ts +0 -6
  638. package/src/workflows/engine.test.ts +1 -9
  639. package/src/workflows/journal-store.test.ts +1 -9
  640. package/src/workflows/leaf-runner.test.ts +0 -6
  641. package/src/workflows/library.test.ts +1 -9
  642. package/src/workflows/run-manager.test.ts +1 -9
  643. package/src/__tests__/skill-runtime-path.test.ts +0 -63
@@ -1,310 +1,126 @@
1
- // Import prefixes allowed for each transport class. Entries cover both
2
- // depth-1 (e.g. `commands/foo.ts`) and depth-2 (e.g. `commands/oauth/bar.ts`)
3
- // relative paths so nested command directories don't false-positive.
4
- //
5
- // Adding a new entry: prefer the narrowest match that captures the legitimate
6
- // case. Daemon-internal modules (`runtime/`, `services/`, `agents/`, `llm/`,
7
- // `skills/`, etc.) MUST remain off the allowlist for `ipc`-tagged commands.
8
- const ALLOWED_PREFIXES = {
9
- ipc: [
10
- "node:",
11
- "bun:",
12
- "commander",
13
- // Sibling subcommand composition (e.g. oauth/index.ts -> ./connect.js).
14
- // The imported file is itself a command and the rule will check its
15
- // imports independently, so this can't be used to smuggle daemon
16
- // internals through a sibling re-export.
17
- "./",
18
- // IPC client at depth-1 and depth-2.
19
- "../../ipc/cli-client",
20
- "../../../ipc/cli-client",
21
- // Status command's daemon-down fallback needs socket path + platform.
22
- "../../ipc/socket-path",
23
- "../../util/platform",
24
- // App version constant (leaf module; reads package.json/env, no daemon
25
- // deps) — status prints it to surface CLI-vs-runtime version drift.
26
- "../../version",
27
- "../../../version",
28
- // Robust stdin reader (leaf module; only node:fs, no daemon deps) —
29
- // commands that accept piped payloads read fd 0 through it at depth-1
30
- // and depth-2.
31
- "../../util/read-stdin",
32
- "../../../util/read-stdin",
33
- // Logger / output at depth-1 and depth-2.
34
- "../logger",
35
- "../output",
36
- "../../logger",
37
- "../../output",
38
- // Shared CLI lib / utils at depth-1 and depth-2.
39
- "../lib/",
40
- "../../lib/",
41
- "../utils/",
42
- "../../utils/",
43
- // Environment access for commands that need to read VELLUM_* env vars
44
- // before issuing IPC calls (e.g. email, domain).
45
- "../../config/env",
46
- // Browser command's operation metadata (drives subcommand generation).
47
- // Deliberately the meta-only module: `../../browser/operations` would
48
- // pull the Playwright-backed execution stack into every CLI start.
49
- "../../browser/operation-meta",
50
- ],
51
- local: [
52
- "node:",
53
- "bun:",
54
- "commander",
55
- "zod",
56
- // Sibling helpers + cross-namespace helper for config.ts managed-mode
57
- // check (see commands/oauth/shared.ts docstring).
58
- "./",
59
- // Config schema/loader at depth-1 and depth-2.
60
- "../../config/loader",
61
- "../../../config/loader",
62
- "../../config/schema",
63
- "../../config/env",
64
- "../../util/platform",
65
- "../../../util/platform",
66
- // Memory retrospective — the retrospective CLI runs the fork-based
67
- // retrospective in-process (no daemon, no IPC), so it imports the
68
- // job handler directly from the default-memory plugin. Depth-2 for
69
- // commands/memory/ nesting.
70
- "../../plugins/defaults/memory/memory-retrospective-job",
71
- "../../../plugins/defaults/memory/memory-retrospective-job",
72
- // Memory nodes CRUD — `memory nodes list/delete/update` invoke the graph
73
- // tool-handlers directly in-process (no IPC, no daemon dependency).
74
- // Depth-3 for commands/memory/ nesting.
75
- "../../../plugins/defaults/memory/graph/tool-handlers",
76
- // Standalone tool execution — `tools run` executes a single tool
77
- // in-process from the filesystem (no daemon, no IPC), so it imports the
78
- // standalone runner directly. Depth-2 for commands/ nesting.
79
- "../../tools/run-standalone",
80
- "../../../tools/run-standalone",
81
- "../logger",
82
- "../output",
83
- "../../logger",
84
- "../../output",
85
- "../lib/",
86
- "../../lib/",
87
- "../utils/",
88
- "../../utils/",
89
- // Secure key storage (keys.ts) needs direct security module access —
90
- // by design, the secure-key helpers run in-process (not over IPC).
91
- "../../security/",
92
- // Canonical API-key provider list (keys.ts help text + validation) —
93
- // a static metadata catalog with no daemon state.
94
- "../../providers/provider-secret-catalog",
95
- // CES bridge (credential-execution.ts) speaks to the CES sidecar via
96
- // service-contracts RPC; daemon is not involved.
97
- "../../credential-execution/",
98
- "@vellumai/service-contracts",
99
- ],
100
- bootstrap: [
101
- "node:",
102
- "bun:",
103
- "commander",
104
- "./",
105
- "../../config/loader",
106
- "../../config/schema",
107
- "../../config/env",
108
- "../../util/platform",
109
- "../logger",
110
- "../output",
111
- "../../logger",
112
- "../../output",
113
- "../lib/",
114
- "../../lib/",
115
- "../utils/",
116
- "../../utils/",
117
- ],
118
- };
1
+ import path from "node:path";
119
2
 
120
3
  /**
121
- * Walks the program AST looking for a `registerCommand({ transport: ... })`
122
- * call. Returns:
123
- * - the transport string when registerCommand is called with a string
124
- * transport prop ("ipc" / "local" / "bootstrap")
125
- * - "MISSING_TRANSPORT" when registerCommand is called but no string
126
- * transport prop is present
127
- * - null when no registerCommand call is found at all (helper module —
128
- * not a command entry, no checks apply)
4
+ * `cli/no-daemon-internals`
5
+ *
6
+ * Forbids CLI command files from *hoisting* (statically importing at module
7
+ * top level) any module that lives outside the CLI's own tree or the shared
8
+ * leaf zones. Top-level imports load on every `assistant …` invocation, so
9
+ * pulling a daemon subsystem into the static graph inflates the memory
10
+ * footprint of every command — including the bash-tool fast path that only
11
+ * meant to run one small verb.
12
+ *
13
+ * The rule is purely structural — no per-module allowlist. Hoisted imports may
14
+ * resolve only to:
15
+ * - non-relative specifiers (Node/npm/`bun:`/scoped packages), or
16
+ * - the CLI's own tree (`src/cli/**`), or
17
+ * - the shared non-daemon leaf zones below (`util/`, `ipc/`, `types/`,
18
+ * `version`), which carry no daemon runtime graph.
19
+ *
20
+ * Everything else under `src/` is daemon-internal and must be reached with a
21
+ * dynamic `import()` inside the action, so it loads only when the command
22
+ * actually runs. Type-only imports are always fine — they are erased at
23
+ * compile time and cost nothing at runtime. Dynamic `import()` expressions are
24
+ * not `ImportDeclaration`s, so they are never flagged.
129
25
  */
130
- function findTransport(program) {
131
- const worklist = [...program.body];
132
- const seen = new WeakSet();
133
- let registerCommandCalled = false;
134
26
 
135
- while (worklist.length > 0) {
136
- const node = worklist.pop();
27
+ // Top-level `src/` directories that hold no daemon runtime graph and may be
28
+ // hoisted into the CLI's static import graph. These are whole non-daemon
29
+ // categories, not carve-outs for individual daemon modules: the CLI itself,
30
+ // shared leaf utilities, the IPC transport (client + socket path), and type
31
+ // declarations.
32
+ const SAFE_DIRS = new Set(["cli", "util", "ipc", "types"]);
33
+ // Individual leaf files directly under `src/` that may be hoisted (e.g. the
34
+ // app version constant `src/version.ts`).
35
+ const SAFE_ROOT_FILES = new Set(["version"]);
137
36
 
138
- if (!node || typeof node !== "object" || seen.has(node)) {
139
- continue;
140
- }
141
- seen.add(node);
37
+ /**
38
+ * Given the importing file and an import specifier, decide whether hoisting it
39
+ * is allowed. Returns true (allowed) for anything that is not a
40
+ * daemon-internal module.
41
+ */
42
+ function isHoistAllowed(filename, specifier) {
43
+ // Non-relative specifiers are packages (Node/npm/bun/scoped) — always fine.
44
+ if (!specifier.startsWith(".")) {
45
+ return true;
46
+ }
142
47
 
143
- if (
144
- node.type === "CallExpression" &&
145
- node.callee.type === "Identifier" &&
146
- node.callee.name === "registerCommand"
147
- ) {
148
- registerCommandCalled = true;
149
- for (const arg of node.arguments) {
150
- if (arg.type === "ObjectExpression") {
151
- for (const prop of arg.properties) {
152
- if (
153
- prop.type === "Property" &&
154
- prop.key.type === "Identifier" &&
155
- prop.key.name === "transport" &&
156
- prop.value.type === "Literal" &&
157
- typeof prop.value.value === "string"
158
- ) {
159
- return prop.value.value;
160
- }
161
- }
162
- }
163
- }
164
- }
48
+ // Locate the `.../src/cli/` prefix of the importing file to anchor `src/`.
49
+ const marker = `${path.sep}src${path.sep}cli${path.sep}`;
50
+ const markerIdx = filename.indexOf(marker);
51
+ if (markerIdx === -1) {
52
+ // Not a file under src/cli — the rule's file glob shouldn't match it, so
53
+ // be conservative and don't flag.
54
+ return true;
55
+ }
56
+ const srcRoot = filename.slice(0, markerIdx) + `${path.sep}src`;
165
57
 
166
- switch (node.type) {
167
- case "ExpressionStatement":
168
- worklist.push(node.expression);
169
- break;
170
- case "CallExpression":
171
- // Enqueue both arguments AND the callee so chained patterns like
172
- // `registerCommand(...).command(...).description(...)` are walked.
173
- // The outer call's callee is a MemberExpression whose object is the
174
- // inner CallExpression; without traversing the callee we'd never
175
- // reach the inner `registerCommand` invocation and findTransport()
176
- // would return null, silently skipping all checks.
177
- worklist.push(node.callee);
178
- for (const arg of node.arguments) {
179
- worklist.push(arg);
180
- }
181
- break;
182
- case "MemberExpression":
183
- // Reach through `.foo` chains so we can walk into the receiver.
184
- worklist.push(node.object);
185
- break;
186
- case "FunctionDeclaration":
187
- case "FunctionExpression":
188
- case "ArrowFunctionExpression":
189
- if (node.body) worklist.push(node.body);
190
- break;
191
- case "BlockStatement":
192
- for (const stmt of node.body) {
193
- worklist.push(stmt);
194
- }
195
- break;
196
- case "ReturnStatement":
197
- if (node.argument) worklist.push(node.argument);
198
- break;
199
- case "ExportNamedDeclaration":
200
- case "ExportDefaultDeclaration":
201
- if (node.declaration) worklist.push(node.declaration);
202
- break;
203
- case "VariableDeclaration":
204
- for (const decl of node.declarations) {
205
- if (decl.init) worklist.push(decl.init);
206
- }
207
- break;
208
- case "ObjectExpression":
209
- for (const prop of node.properties) {
210
- if (prop.type === "Property") {
211
- worklist.push(prop.value);
212
- }
213
- }
214
- break;
215
- default:
216
- break;
217
- }
58
+ const resolved = path.resolve(path.dirname(filename), specifier);
59
+ const relFromSrc = path.relative(srcRoot, resolved);
60
+
61
+ // Resolves outside `src/` entirely (unusual for a relative import) — leave
62
+ // it alone; it isn't a daemon-internal module.
63
+ if (relFromSrc.startsWith("..")) {
64
+ return true;
65
+ }
66
+
67
+ const segments = relFromSrc.split(path.sep);
68
+ const firstSegment = segments[0];
69
+
70
+ // A leaf file directly under src/ (e.g. `version.js`).
71
+ if (segments.length === 1) {
72
+ return SAFE_ROOT_FILES.has(firstSegment.replace(/\.[jt]s$/, ""));
218
73
  }
219
74
 
220
- return registerCommandCalled ? "MISSING_TRANSPORT" : null;
75
+ return SAFE_DIRS.has(firstSegment);
221
76
  }
222
77
 
223
78
  const rule = {
224
79
  meta: {
225
- type: "suggestion",
80
+ type: "problem",
226
81
  docs: {
227
82
  description:
228
- "Enforce import allowlists for CLI commands by transport class",
83
+ "Forbid CLI command files from hoisting daemon-internal imports (lazy-import them inside the action instead)",
229
84
  },
230
85
  messages: {
231
- missingTransport:
232
- "CLI command file must call registerCommand({ transport: ... }) to declare its transport class.",
233
- forbiddenImport:
234
- "'{{transport}}'-tagged CLI command imports forbidden module '{{source}}'. See src/cli/AGENTS.md for allowed imports.",
86
+ hoistedDaemonImport:
87
+ "CLI command hoists daemon-internal module '{{source}}'. Import it lazily inside the action (`await import(...)`) so it stays out of the CLI's static graph. See src/cli/AGENTS.md.",
235
88
  },
236
89
  schema: [],
237
90
  },
238
91
 
239
92
  create(context) {
240
- const importNodes = [];
93
+ const filename = context.filename ?? context.getFilename();
241
94
 
242
95
  return {
243
96
  ImportDeclaration(node) {
244
- importNodes.push(node);
245
- },
246
-
247
- "Program:exit"(program) {
248
- if (importNodes.length === 0) {
97
+ // `import type { … } from "…"` — erased at compile time. Skip.
98
+ if (node.importKind === "type") {
249
99
  return;
250
100
  }
251
-
252
- const transport = findTransport(program);
253
-
254
- // Helper modules (no registerCommand call) are not command entries —
255
- // skip them. Command files that call registerCommand without a string
256
- // transport prop still trip missingTransport.
257
- if (transport === null) {
101
+ // Inline-type form `import { type A, type B } from "…"`: when *every*
102
+ // named specifier is type-only the whole import is erased. Skip those.
103
+ // Side-effect-only imports (`import "x"`) have no specifiers and run at
104
+ // load time — do not skip those.
105
+ if (
106
+ node.specifiers.length > 0 &&
107
+ node.specifiers.every(
108
+ (s) => s.type === "ImportSpecifier" && s.importKind === "type",
109
+ )
110
+ ) {
258
111
  return;
259
112
  }
260
113
 
261
- if (transport === "MISSING_TRANSPORT") {
262
- context.report({
263
- node: program,
264
- messageId: "missingTransport",
265
- });
114
+ const source = node.source.value;
115
+ if (typeof source !== "string") {
266
116
  return;
267
117
  }
268
-
269
- const allowedPrefixes = ALLOWED_PREFIXES[transport];
270
- if (!allowedPrefixes) {
271
- return;
272
- }
273
-
274
- for (const importNode of importNodes) {
275
- // `import type {...}` is erased at compile time — top-level type
276
- // import kind is set to "type" on the declaration. Skip.
277
- if (importNode.importKind === "type") {
278
- continue;
279
- }
280
- // Inline-type form `import { type X, type Y } from "..."` keeps
281
- // the declaration `importKind === "value"` while marking each
282
- // ImportSpecifier with `importKind === "type"`. When *every*
283
- // specifier is type-only the entire import is erased. Skip those
284
- // too. Side-effect-only imports (`import "x"`) have an empty
285
- // specifiers list and run at module load — must NOT skip.
286
- if (
287
- importNode.specifiers.length > 0 &&
288
- importNode.specifiers.every(
289
- (s) => s.type === "ImportSpecifier" && s.importKind === "type",
290
- )
291
- ) {
292
- continue;
293
- }
294
- const source = importNode.source.value;
295
- const allowed = allowedPrefixes.some((prefix) =>
296
- source.startsWith(prefix),
297
- );
298
- if (!allowed) {
299
- context.report({
300
- node: importNode,
301
- messageId: "forbiddenImport",
302
- data: {
303
- transport,
304
- source,
305
- },
306
- });
307
- }
118
+ if (!isHoistAllowed(filename, source)) {
119
+ context.report({
120
+ node,
121
+ messageId: "hoistedDaemonImport",
122
+ data: { source },
123
+ });
308
124
  }
309
125
  },
310
126
  };
package/eslint.config.mjs CHANGED
@@ -49,10 +49,10 @@ const eslintConfig = defineConfig([
49
49
  "@typescript-eslint/no-explicit-any": "off",
50
50
  },
51
51
  },
52
- // `cli/no-daemon-internals` enforces the CLI ↔ daemon import boundary
53
- // that the CLI → IPC refactor is built on. Keep at `"error"`: a soft
54
- // rule here would let daemon-internal imports re-enter the CLI bundle,
55
- // which is the regression class this rule exists to prevent.
52
+ // `cli/no-daemon-internals` keeps daemon-internal modules out of the CLI's
53
+ // static import graph, so `assistant …` invocations (including the bash-tool
54
+ // fast path) don't pay the memory cost of loading daemon subsystems. Keep at
55
+ // `"error"`: a soft rule would let hoisted daemon imports creep back in.
56
56
  {
57
57
  files: ["src/cli/commands/**/*.ts"],
58
58
  ignores: ["src/cli/commands/**/__tests__/**"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/assistant",
3
- "version": "0.10.7-dev.202607101554.2aa9767",
3
+ "version": "0.10.7-dev.202607101836.11f2eba",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,17 +16,10 @@
16
16
 
17
17
  import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
18
18
  import { join } from "node:path";
19
- import { beforeEach, describe, expect, mock, test } from "bun:test";
19
+ import { beforeEach, describe, expect, test } from "bun:test";
20
20
 
21
21
  const TEST_DIR = process.env.VELLUM_WORKSPACE_DIR!;
22
22
 
23
- mock.module("../util/logger.js", () => ({
24
- getLogger: () =>
25
- new Proxy({} as Record<string, unknown>, {
26
- get: () => () => {},
27
- }),
28
- }));
29
-
30
23
  const { applyBootstrapTemplate } = await import("../prompts/system-prompt.js");
31
24
  const { isActivationSession } =
32
25
  await import("../plugins/defaults/memory/activation-session-store.js");
@@ -13,13 +13,6 @@
13
13
  */
14
14
  import { beforeEach, describe, expect, mock, test } from "bun:test";
15
15
 
16
- mock.module("../util/logger.js", () => ({
17
- getLogger: () =>
18
- new Proxy({} as Record<string, unknown>, {
19
- get: () => () => {},
20
- }),
21
- }));
22
-
23
16
  mock.module("../config/env.js", () => ({
24
17
  isHttpAuthDisabled: () => false,
25
18
  getInternalGatewayTarget: () => "http://localhost:7822",
@@ -40,7 +40,7 @@ describe("addMessage pre-assigned id", () => {
40
40
  const msgs = getMessages("conv-preassigned-id");
41
41
  const found = msgs.find((m) => m.id === customId);
42
42
  expect(found).toBeDefined();
43
- expect(found?.content).toBe("hello");
43
+ expect(found?.content).toEqual([{ type: "text", text: "hello" }]);
44
44
  });
45
45
 
46
46
  test("generates a uuid when no id is provided", async () => {
@@ -21,11 +21,6 @@
21
21
 
22
22
  import { beforeEach, describe, expect, mock, test } from "bun:test";
23
23
 
24
- mock.module("../util/logger.js", () => ({
25
- getLogger: () =>
26
- new Proxy({} as Record<string, unknown>, { get: () => () => {} }),
27
- }));
28
-
29
24
  let mockLlmConfig: Record<string, unknown> = {};
30
25
 
31
26
  mock.module("../config/loader.js", () => ({
@@ -13,12 +13,6 @@
13
13
 
14
14
  import { afterEach, describe, expect, mock, test } from "bun:test";
15
15
 
16
- import { makeMockLogger } from "./helpers/mock-logger.js";
17
-
18
- mock.module("../util/logger.js", () => ({
19
- getLogger: () => makeMockLogger(),
20
- }));
21
-
22
16
  // AgentLoop reads the v3-live gate (`config.memory.v3.live`) via
23
17
  // `isMemoryV3Live` to decide the cache-anchor signal; drive it per-test.
24
18
  let memoryV3LiveSlot = false;
@@ -26,12 +26,6 @@ beforeAll(() => {
26
26
  setOverridesForTesting({ "override-or-default-resolution": false });
27
27
  });
28
28
 
29
- import { makeMockLogger } from "./helpers/mock-logger.js";
30
-
31
- mock.module("../util/logger.js", () => ({
32
- getLogger: () => makeMockLogger(),
33
- }));
34
-
35
29
  import { AgentLoop } from "../agent/loop.js";
36
30
  import type {
37
31
  Message,
@@ -9,14 +9,6 @@
9
9
 
10
10
  import { beforeEach, describe, expect, mock, test } from "bun:test";
11
11
 
12
- // ── Stub pipes ──────────────────────────────────────────────────────
13
- // Same logger-stub shape as the rest of the test suite — pino pulls are
14
- // agent-loop-time too, but we silence them so the test stays deterministic.
15
- mock.module("../util/logger.js", () => ({
16
- getLogger: () =>
17
- new Proxy({} as Record<string, unknown>, { get: () => () => {} }),
18
- }));
19
-
20
12
  // Mock plugin pipeline. Two modes:
21
13
  // - return mode (default): returns `hookResponse` as the hook result.
22
14
  // - in-place mode: mutates ctx.systemPrompt directly and returns the same
@@ -13,12 +13,6 @@
13
13
 
14
14
  import { beforeEach, describe, expect, mock, test } from "bun:test";
15
15
 
16
- // Standard logger stub (same shape as the rest of the suite).
17
- mock.module("../util/logger.js", () => ({
18
- getLogger: () =>
19
- new Proxy({} as Record<string, unknown>, { get: () => () => {} }),
20
- }));
21
-
22
16
  // Pass-through plugin pipeline: the `pre-model-call` hook returns its context
23
17
  // unchanged, so `providerOptions.systemPrompt` stays exactly the prompt the
24
18
  // loop snapshotted for the run.
@@ -22,14 +22,6 @@
22
22
  */
23
23
  import { beforeEach, describe, expect, mock, test } from "bun:test";
24
24
 
25
- // ── Mock platform (must precede imports that read it) ─────────────────────────
26
- mock.module("../util/logger.js", () => ({
27
- getLogger: () =>
28
- new Proxy({} as Record<string, unknown>, {
29
- get: () => () => {},
30
- }),
31
- }));
32
-
33
25
  mock.module("../config/loader.js", () => ({
34
26
  getConfig: () => ({
35
27
  skills: {
@@ -59,7 +51,7 @@ mock.module("../persistence/conversation-crud.js", () => ({
59
51
  isConversationProcessing: () => false,
60
52
  addMessage: () => ({ id: "mock-msg-id" }),
61
53
  getMessageById: (id: string) =>
62
- mockedRowContent ? { id, content: mockedRowContent } : null,
54
+ mockedRowContent ? { id, content: JSON.parse(mockedRowContent) } : null,
63
55
  updateMessageContent: (id: string, content: string) => {
64
56
  updates.push({ id, content });
65
57
  },
@@ -129,7 +121,9 @@ function findBlockById(
129
121
  ): Record<string, unknown> {
130
122
  const parsed = JSON.parse(rawContent) as Array<Record<string, unknown>>;
131
123
  const block = parsed.find((b) => b.id === id);
132
- if (!block) throw new Error(`block ${id} not found`);
124
+ if (!block) {
125
+ throw new Error(`block ${id} not found`);
126
+ }
133
127
  return block;
134
128
  }
135
129
 
@@ -17,14 +17,6 @@
17
17
  */
18
18
  import { beforeEach, describe, expect, mock, test } from "bun:test";
19
19
 
20
- // ── Mock platform (must precede imports that read it) ─────────────────────────
21
- mock.module("../util/logger.js", () => ({
22
- getLogger: () =>
23
- new Proxy({} as Record<string, unknown>, {
24
- get: () => () => {},
25
- }),
26
- }));
27
-
28
20
  mock.module("../config/loader.js", () => ({
29
21
  getConfig: () => ({
30
22
  skills: {
@@ -54,7 +46,7 @@ mock.module("../persistence/conversation-crud.js", () => ({
54
46
  isConversationProcessing: () => false,
55
47
  addMessage: () => ({ id: "mock-msg-id" }),
56
48
  getMessageById: (id: string) =>
57
- mockedRowContent ? { id, content: mockedRowContent } : null,
49
+ mockedRowContent ? { id, content: JSON.parse(mockedRowContent) } : null,
58
50
  updateMessageContent: (id: string, content: string) => {
59
51
  updates.push({ id, content });
60
52
  },
@@ -123,7 +115,9 @@ function findPersistedToolUse(
123
115
  ): Record<string, unknown> {
124
116
  const parsed = JSON.parse(rawContent) as Array<Record<string, unknown>>;
125
117
  const block = parsed.find((b) => b.type === "tool_use" && b.id === toolUseId);
126
- if (!block) throw new Error(`tool_use block ${toolUseId} not found`);
118
+ if (!block) {
119
+ throw new Error(`tool_use block ${toolUseId} not found`);
120
+ }
127
121
  return block;
128
122
  }
129
123
 
@@ -12,14 +12,6 @@ import { afterEach, describe, expect, mock, test } from "bun:test";
12
12
 
13
13
  import JSZip from "jszip";
14
14
 
15
- // Mock the logger before importing the module under test
16
- mock.module("../util/logger.js", () => ({
17
- getLogger: () =>
18
- new Proxy({} as Record<string, unknown>, {
19
- get: () => () => {},
20
- }),
21
- }));
22
-
23
15
  // Temp directory for fake app data used in packageApp tests
24
16
  const testAppsDir = join(tmpdir(), `app-bundler-test-${Date.now()}`);
25
17
 
@@ -1,14 +1,7 @@
1
1
  import { existsSync, rmSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { join } from "node:path";
4
- import { afterEach, beforeEach, describe, expect, mock, test } from "bun:test";
5
-
6
- mock.module("../util/logger.js", () => ({
7
- getLogger: () =>
8
- new Proxy({} as Record<string, unknown>, {
9
- get: () => () => {},
10
- }),
11
- }));
4
+ import { afterEach, beforeEach, describe, expect, test } from "bun:test";
12
5
 
13
6
  import {
14
7
  addAppConversationId,