@crewx/sdk 0.9.0-rc.20 → 0.9.0-rc.201

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 (411) hide show
  1. package/README.md +1 -1
  2. package/dist/account/auth-client.d.ts +61 -0
  3. package/dist/account/auth-json-v2.d.ts +1 -0
  4. package/dist/account/auth-json.d.ts +30 -0
  5. package/dist/account/config.d.ts +37 -0
  6. package/dist/account/env-bootstrap.d.ts +11 -0
  7. package/dist/account/errors.d.ts +24 -0
  8. package/dist/account/index.d.ts +12 -0
  9. package/dist/account/index.js +2 -0
  10. package/dist/account/session-manager.d.ts +47 -0
  11. package/dist/activity-log/builder.d.ts +59 -6
  12. package/dist/agent/agent-list-view.d.ts +19 -0
  13. package/dist/agent-interceptor/chain.d.ts +25 -0
  14. package/dist/agent-interceptor/index.d.ts +6 -0
  15. package/dist/agent-interceptor/model-runner.d.ts +19 -0
  16. package/dist/agent-interceptor/program-runner.d.ts +13 -0
  17. package/dist/agent-interceptor/protocol.d.ts +68 -0
  18. package/dist/agent-interceptor/run-stop.d.ts +3 -0
  19. package/dist/agent-interceptor/schema.d.ts +267 -0
  20. package/dist/agent-interceptor/types.d.ts +88 -0
  21. package/dist/app/app-files/args.d.ts +12 -0
  22. package/dist/app/app-files/errors.d.ts +6 -0
  23. package/dist/app/app-files/index.d.ts +35 -0
  24. package/dist/app/app-files/lock.d.ts +26 -0
  25. package/dist/app/app-files/root.d.ts +22 -0
  26. package/dist/app/app-files/store.d.ts +48 -0
  27. package/dist/app/app-files/write.child.d.ts +1 -0
  28. package/dist/app/app.d.ts +168 -0
  29. package/dist/app/backend-env.d.ts +3 -0
  30. package/dist/app/content-media-types.d.ts +2 -0
  31. package/dist/app/context.d.ts +2 -0
  32. package/dist/app/entry.d.ts +9 -0
  33. package/dist/app/frame.d.ts +55 -0
  34. package/dist/app/index.d.ts +20 -0
  35. package/dist/app/index.js +13 -0
  36. package/dist/app/job-bridge.child.d.ts +1 -0
  37. package/dist/app/job-bridge.d.ts +67 -0
  38. package/dist/app/job-bridge.drain.child.d.ts +1 -0
  39. package/dist/app/job-bridge.example.d.ts +11 -0
  40. package/dist/app/job-contract.d.ts +40 -0
  41. package/dist/app/job-wire.d.ts +149 -0
  42. package/dist/app/protocol.d.ts +9 -0
  43. package/dist/app/runtime.d.ts +23 -0
  44. package/dist/app/schedule-contract.d.ts +59 -0
  45. package/dist/app/tool-mode.d.ts +3 -0
  46. package/dist/app-artifact-policy/check.d.ts +2 -0
  47. package/dist/app-artifact-policy/contract.d.ts +54 -0
  48. package/dist/app-artifact-policy/helper.d.ts +15 -0
  49. package/dist/app-artifact-policy/index.d.ts +3 -0
  50. package/dist/app-artifact-policy/index.js +18 -0
  51. package/dist/app-artifact-policy/paths.d.ts +24 -0
  52. package/dist/app-artifact-policy/scan.d.ts +47 -0
  53. package/dist/app-ui/index.d.ts +95 -0
  54. package/dist/app-ui/index.js +1 -0
  55. package/dist/attachment-receive/index.d.ts +76 -0
  56. package/dist/attachment-receive/index.js +2 -0
  57. package/dist/boxing/box.types.d.ts +4 -0
  58. package/dist/config/canonicalize-agent-options.d.ts +2 -0
  59. package/dist/config/default-agent-models.d.ts +11 -0
  60. package/dist/config/global-settings.d.ts +33 -0
  61. package/dist/config/migrate-grok-mode.d.ts +6 -0
  62. package/dist/config/model-compat.d.ts +31 -0
  63. package/dist/config/models.generated.d.ts +38 -0
  64. package/dist/config/models.remote.d.ts +1 -0
  65. package/dist/config/overdrive.d.ts +7 -0
  66. package/dist/config/pricing.d.ts +6 -3
  67. package/dist/config/pricing.generated.d.ts +4 -0
  68. package/dist/config/pricing.types.d.ts +4 -0
  69. package/dist/config/timeout.config.d.ts +4 -0
  70. package/dist/config/wi-boards.d.ts +19 -0
  71. package/dist/context/GoalLoader.d.ts +6 -0
  72. package/dist/context-budget/continuity.d.ts +64 -0
  73. package/dist/context-budget/fixed-slot-shrink.d.ts +97 -0
  74. package/dist/context-budget/index.d.ts +168 -0
  75. package/dist/conversation/index.d.ts +1 -1
  76. package/dist/conversation/sqlite-provider.d.ts +6 -3
  77. package/dist/conversation/to-template-messages.d.ts +9 -0
  78. package/dist/conversation/types.d.ts +86 -1
  79. package/dist/desktop/command-runner.d.ts +4 -0
  80. package/dist/desktop/default-adapters.d.ts +4 -0
  81. package/dist/desktop/global-install.d.ts +19 -0
  82. package/dist/desktop/index.d.ts +3 -0
  83. package/dist/desktop/index.js +3 -0
  84. package/dist/desktop/install.d.ts +5 -0
  85. package/dist/desktop/lnk.d.ts +22 -0
  86. package/dist/desktop/manifest.d.ts +21 -0
  87. package/dist/desktop/types.d.ts +67 -0
  88. package/dist/desktop/version.d.ts +1 -0
  89. package/dist/desktop/windows-paths.d.ts +21 -0
  90. package/dist/desktop/wrapper.d.ts +18 -0
  91. package/dist/esm/account/index.js +2 -0
  92. package/dist/esm/app/index.js +13 -0
  93. package/dist/esm/app-artifact-policy/index.js +18 -0
  94. package/dist/esm/attachment-receive/index.js +2 -0
  95. package/dist/esm/desktop/index.js +3 -0
  96. package/dist/esm/history-snapshot/index.js +16 -0
  97. package/dist/esm/index.js +1362 -224
  98. package/dist/esm/node/index.js +2 -0
  99. package/dist/esm/plugins/index.js +532 -214
  100. package/dist/esm/process/index.js +1 -0
  101. package/dist/esm/publish/index.js +2 -0
  102. package/dist/esm/repository/index.js +792 -207
  103. package/dist/esm/skills/index.js +2 -0
  104. package/dist/esm/testing/index.js +1 -1
  105. package/dist/events/types.d.ts +44 -0
  106. package/dist/facade/Crewx.d.ts +78 -5
  107. package/dist/facade/task-ticket.d.ts +14 -0
  108. package/dist/highlight/thread-highlight-prompt.d.ts +2 -0
  109. package/dist/highlight/thread-highlighter.d.ts +326 -0
  110. package/dist/history-snapshot/index.d.ts +82 -0
  111. package/dist/history-snapshot/index.js +16 -0
  112. package/dist/index.browser.d.ts +26 -1
  113. package/dist/index.browser.js +6 -2
  114. package/dist/index.d.ts +165 -18
  115. package/dist/index.js +1362 -224
  116. package/dist/internal/console-decoder.d.ts +38 -0
  117. package/dist/internal/windows-spawn.d.ts +10 -0
  118. package/dist/layout/types.d.ts +18 -1
  119. package/dist/lifecycle/process-lease.d.ts +80 -0
  120. package/dist/lifecycle/process-owner.d.ts +20 -0
  121. package/dist/lifecycle/task-heartbeat.d.ts +41 -0
  122. package/dist/lifecycle/task-stop.d.ts +112 -0
  123. package/dist/lifecycle/update-admission.d.ts +45 -0
  124. package/dist/local-server/base-url.d.ts +18 -0
  125. package/dist/local-server/index.d.ts +8 -0
  126. package/dist/local-server/opencode.d.ts +8 -0
  127. package/dist/local-server/probe.d.ts +3 -0
  128. package/dist/local-server/runtime.d.ts +26 -0
  129. package/dist/local-server/types.d.ts +43 -0
  130. package/dist/mcp-app/agent-access.d.ts +33 -0
  131. package/dist/mcp-app/app-handoff.d.ts +109 -0
  132. package/dist/mcp-app/app-icon-read.d.ts +7 -0
  133. package/dist/mcp-app/app-job-bridge.d.ts +30 -0
  134. package/dist/mcp-app/app-job-bridge.example.d.ts +36 -0
  135. package/dist/mcp-app/app-job.d.ts +168 -0
  136. package/dist/mcp-app/app-schedule.d.ts +85 -0
  137. package/dist/mcp-app/apps-context.d.ts +32 -0
  138. package/dist/mcp-app/bundle-provenance.d.ts +3 -0
  139. package/dist/mcp-app/candidate-registration.d.ts +4 -0
  140. package/dist/mcp-app/card-handler.d.ts +7 -0
  141. package/dist/mcp-app/catalog.d.ts +7 -0
  142. package/dist/mcp-app/content-channel.d.ts +86 -0
  143. package/dist/mcp-app/content-declarations.d.ts +31 -0
  144. package/dist/mcp-app/dev-checks.d.ts +31 -0
  145. package/dist/mcp-app/diagnostic-reason.d.ts +3 -0
  146. package/dist/mcp-app/discovery.d.ts +164 -0
  147. package/dist/mcp-app/errors.d.ts +7 -0
  148. package/dist/mcp-app/index.d.ts +46 -0
  149. package/dist/mcp-app/installed-app-ref.d.ts +25 -0
  150. package/dist/mcp-app/model-context.d.ts +29 -0
  151. package/dist/mcp-app/node-app-discovery-fs.d.ts +23 -0
  152. package/dist/mcp-app/product-bundle-assets.d.ts +27 -0
  153. package/dist/mcp-app/product-bundle-loader.d.ts +53 -0
  154. package/dist/mcp-app/projection.d.ts +14 -0
  155. package/dist/mcp-app/prompt-cards.d.ts +28 -0
  156. package/dist/mcp-app/registry.d.ts +28 -0
  157. package/dist/mcp-app/skill-backend.d.ts +141 -0
  158. package/dist/mcp-app/state-set.d.ts +9 -0
  159. package/dist/mcp-app/types.d.ts +501 -0
  160. package/dist/mcp-app/view-call.d.ts +7 -0
  161. package/dist/mcp-app/workspace-app-assets.d.ts +42 -0
  162. package/dist/mcp-app/workspace-app-scan-cache.d.ts +27 -0
  163. package/dist/mcp-app/workspace-snapshot.d.ts +81 -0
  164. package/dist/migrations/0011_far_black_tarantula.sql +1 -0
  165. package/dist/migrations/0012_blue_turbo.sql +23 -0
  166. package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
  167. package/dist/migrations/0014_organic_mongu.sql +73 -0
  168. package/dist/migrations/0015_panoramic_gorilla_man.sql +71 -0
  169. package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
  170. package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
  171. package/dist/migrations/0018_bored_jackal.sql +33 -0
  172. package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
  173. package/dist/migrations/0020_useful_iron_lad.sql +55 -0
  174. package/dist/migrations/0021_dashing_peter_quill.sql +51 -0
  175. package/dist/migrations/0022_wandering_bucky.sql +1 -0
  176. package/dist/migrations/0023_red_payback.sql +1 -0
  177. package/dist/migrations/0024_storage_metadata.sql +262 -0
  178. package/dist/migrations/0025_task_heartbeat.sql +8 -0
  179. package/dist/migrations/0025_thread_app_instance_ledger.sql +2 -0
  180. package/dist/migrations/0026_mcp_action_source.sql +47 -0
  181. package/dist/migrations/0027_task_stop_scope_cleanup.sql +5 -0
  182. package/dist/migrations/0027_ui_instance_active_unique.sql +2 -0
  183. package/dist/migrations/0029_nice_rhino.sql +1 -0
  184. package/dist/migrations/0031_petite_arclight.sql +6 -0
  185. package/dist/migrations/0032_ui_instance_opened_by.sql +1 -0
  186. package/dist/migrations/0033_thread_creator_boundary_guard.sql +38 -0
  187. package/dist/migrations/0034_keen_fallen_one.sql +36 -0
  188. package/dist/migrations/0035_request_log_daily.sql +11 -0
  189. package/dist/migrations/0036_ui_definition_archive.sql +8 -0
  190. package/dist/migrations/0037_ui_instance_agent_open_request.sql +1 -0
  191. package/dist/migrations/0038_task_rating.sql +3 -0
  192. package/dist/migrations/0039_aspiring_purifiers.sql +9 -0
  193. package/dist/migrations/0040_task_provider_inputs.sql +53 -0
  194. package/dist/migrations/0041_tranquil_vivisector.sql +54 -0
  195. package/dist/migrations/0042_breezy_blue_shield.sql +31 -0
  196. package/dist/migrations/0043_nervous_darkstar.sql +1 -0
  197. package/dist/migrations/0044_military_galactus.sql +8 -0
  198. package/dist/migrations/0045_task_pid_started_at.sql +1 -0
  199. package/dist/migrations/0046_acoustic_karnak.sql +49 -0
  200. package/dist/migrations/0047_doc_sync_connect_requests.sql +18 -0
  201. package/dist/migrations/0048_smart_gertrude_yorkes.sql +47 -0
  202. package/dist/migrations/meta/0011_snapshot.json +1342 -0
  203. package/dist/migrations/meta/0012_snapshot.json +1494 -0
  204. package/dist/migrations/meta/0013_snapshot.json +1592 -0
  205. package/dist/migrations/meta/0014_snapshot.json +1975 -0
  206. package/dist/migrations/meta/0015_snapshot.json +2315 -0
  207. package/dist/migrations/meta/0016_snapshot.json +2419 -0
  208. package/dist/migrations/meta/0017_snapshot.json +2419 -0
  209. package/dist/migrations/meta/0018_snapshot.json +2570 -0
  210. package/dist/migrations/meta/0020_snapshot.json +2895 -0
  211. package/dist/migrations/meta/0021_snapshot.json +3031 -0
  212. package/dist/migrations/meta/0022_snapshot.json +3039 -0
  213. package/dist/migrations/meta/0023_snapshot.json +3047 -0
  214. package/dist/migrations/meta/0029_snapshot.json +3206 -0
  215. package/dist/migrations/meta/0031_snapshot.json +3251 -0
  216. package/dist/migrations/meta/0034_snapshot.json +3473 -0
  217. package/dist/migrations/meta/0035_snapshot.json +3547 -0
  218. package/dist/migrations/meta/0036_snapshot.json +3591 -0
  219. package/dist/migrations/meta/0037_snapshot.json +3598 -0
  220. package/dist/migrations/meta/0038_snapshot.json +3626 -0
  221. package/dist/migrations/meta/0039_snapshot.json +3684 -0
  222. package/dist/migrations/meta/0040_snapshot.json +3759 -0
  223. package/dist/migrations/meta/0041_snapshot.json +4156 -0
  224. package/dist/migrations/meta/0042_snapshot.json +4383 -0
  225. package/dist/migrations/meta/0043_snapshot.json +4390 -0
  226. package/dist/migrations/meta/0044_snapshot.json +4435 -0
  227. package/dist/migrations/meta/0045_snapshot.json +4442 -0
  228. package/dist/migrations/meta/0046_snapshot.json +4733 -0
  229. package/dist/migrations/meta/0047_snapshot.json +4832 -0
  230. package/dist/migrations/meta/0048_snapshot.json +5128 -0
  231. package/dist/migrations/meta/_journal.json +266 -0
  232. package/dist/node/index.d.ts +1 -0
  233. package/dist/node/index.js +2 -0
  234. package/dist/paths.d.ts +1 -0
  235. package/dist/plugin/types.d.ts +1 -0
  236. package/dist/plugins/index.d.ts +1 -1
  237. package/dist/plugins/index.js +532 -214
  238. package/dist/plugins/sqlite-tracing.d.ts +46 -0
  239. package/dist/process/index.d.ts +2 -0
  240. package/dist/process/index.js +1 -0
  241. package/dist/process/process-control.d.ts +74 -0
  242. package/dist/prompt/tag-names.d.ts +22 -0
  243. package/dist/provider/acp/adapter.d.ts +37 -2
  244. package/dist/provider/acp/adapters/antigravity-account.d.ts +4 -0
  245. package/dist/provider/acp/completion-observer.d.ts +24 -0
  246. package/dist/provider/acp/connection.d.ts +69 -3
  247. package/dist/provider/acp/index.d.ts +3 -3
  248. package/dist/provider/acp/meta.d.ts +11 -0
  249. package/dist/provider/acp/register.d.ts +1 -0
  250. package/dist/provider/acp/runtime.d.ts +1 -0
  251. package/dist/provider/acp/types.d.ts +31 -4
  252. package/dist/provider/bridge.browser.d.ts +3 -0
  253. package/dist/provider/bridge.d.ts +25 -3
  254. package/dist/provider/classify-task-error.d.ts +2 -0
  255. package/dist/provider/claude-agent-env.d.ts +1 -0
  256. package/dist/provider/cli/adapter.types.d.ts +26 -2
  257. package/dist/provider/cli/adapters/agent-call.util.d.ts +1 -1
  258. package/dist/provider/cli/adapters/antigravity-stream.d.ts +27 -0
  259. package/dist/provider/cli/adapters/antigravity.d.ts +1 -0
  260. package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -0
  261. package/dist/provider/cli/adapters/codex-item.d.ts +1 -0
  262. package/dist/provider/cli/adapters/event-timestamp.util.d.ts +1 -0
  263. package/dist/provider/cli/adapters/grok.d.ts +2 -0
  264. package/dist/provider/cli/adapters/index.d.ts +5 -0
  265. package/dist/provider/cli/index.d.ts +3 -2
  266. package/dist/provider/cli/meta.d.ts +5 -0
  267. package/dist/provider/cli/protocol-envelope.d.ts +3 -0
  268. package/dist/provider/errors.d.ts +5 -1
  269. package/dist/provider/idle-watchdog.d.ts +19 -0
  270. package/dist/provider/models.d.ts +17 -12
  271. package/dist/provider/order.d.ts +1 -1
  272. package/dist/provider/parse-usage.d.ts +6 -0
  273. package/dist/provider/provider-selection.d.ts +8 -0
  274. package/dist/provider/redact-technical-message.d.ts +1 -0
  275. package/dist/provider/task-error.types.d.ts +17 -0
  276. package/dist/provider-account/accounts.d.ts +15 -0
  277. package/dist/provider-account/antigravity-acp/auth.d.ts +29 -0
  278. package/dist/provider-account/antigravity-acp/browser.d.ts +4 -0
  279. package/dist/provider-account/antigravity-acp/install.d.ts +42 -0
  280. package/dist/provider-account/antigravity-acp/lease.d.ts +23 -0
  281. package/dist/provider-account/antigravity-acp/lifecycle.d.ts +76 -0
  282. package/dist/provider-account/antigravity-acp/manifest.d.ts +76 -0
  283. package/dist/provider-account/antigravity-acp/profile.d.ts +4 -0
  284. package/dist/provider-account/capabilities.d.ts +6 -0
  285. package/dist/provider-account/index.d.ts +13 -0
  286. package/dist/provider-account/registry.d.ts +30 -0
  287. package/dist/provider-account/types.d.ts +47 -0
  288. package/dist/publish/constants.d.ts +6 -0
  289. package/dist/publish/errors.d.ts +7 -0
  290. package/dist/publish/index.d.ts +55 -0
  291. package/dist/publish/index.js +2 -0
  292. package/dist/publish/manifest.d.ts +47 -0
  293. package/dist/publish/marketplace-api.constants.d.ts +1 -0
  294. package/dist/publish/pack.d.ts +6 -0
  295. package/dist/publish/scan.d.ts +10 -0
  296. package/dist/publish/secrets.d.ts +6 -0
  297. package/dist/publish/upload.d.ts +19 -0
  298. package/dist/remote/execution-profile.d.ts +9 -0
  299. package/dist/remote/index.d.ts +1 -0
  300. package/dist/remote/types.d.ts +28 -0
  301. package/dist/repository/agent-send-history.repository.d.ts +23 -0
  302. package/dist/repository/agent-suggestion.repository.d.ts +34 -0
  303. package/dist/repository/base-sqlite-repository.d.ts +1 -0
  304. package/dist/repository/common-code.repository.d.ts +45 -0
  305. package/dist/repository/db.d.ts +13 -1
  306. package/dist/repository/index.d.ts +62 -6
  307. package/dist/repository/index.js +792 -207
  308. package/dist/repository/logs-db.d.ts +12 -0
  309. package/dist/repository/notification.repository.d.ts +58 -0
  310. package/dist/repository/project.repository.d.ts +90 -0
  311. package/dist/repository/public-task-answer.d.ts +24 -0
  312. package/dist/repository/request-log-mover.d.ts +70 -0
  313. package/dist/repository/request-log.repository.d.ts +7 -3
  314. package/dist/repository/run-columns.d.ts +10 -0
  315. package/dist/repository/run-history.repository.d.ts +112 -0
  316. package/dist/repository/schedule-run.repository.d.ts +103 -0
  317. package/dist/repository/sidebar-tab.repository.d.ts +86 -0
  318. package/dist/repository/storage-metadata.repository.d.ts +64 -0
  319. package/dist/repository/task-log-migration.d.ts +74 -0
  320. package/dist/repository/task-log.repository.d.ts +47 -0
  321. package/dist/repository/task-status.d.ts +21 -0
  322. package/dist/repository/task.repository.d.ts +330 -8
  323. package/dist/repository/thread-history.repository.d.ts +193 -0
  324. package/dist/repository/thread-origin-verdict.d.ts +27 -0
  325. package/dist/repository/thread-title.types.d.ts +29 -0
  326. package/dist/repository/thread.repository.d.ts +134 -5
  327. package/dist/repository/usage-backfill.d.ts +62 -0
  328. package/dist/repository/usage-from-logs.d.ts +22 -0
  329. package/dist/repository/workflow-anchor-kinds.d.ts +4 -0
  330. package/dist/repository/workspace.repository.d.ts +3 -0
  331. package/dist/route/decide.d.ts +54 -0
  332. package/dist/route/eligibility.d.ts +11 -0
  333. package/dist/route/errors.d.ts +11 -0
  334. package/dist/route/index.d.ts +14 -0
  335. package/dist/route/runner.d.ts +15 -0
  336. package/dist/route/sqlite-store.d.ts +17 -0
  337. package/dist/route/store.d.ts +45 -0
  338. package/dist/route/strategies.d.ts +4 -0
  339. package/dist/route/types.d.ts +212 -0
  340. package/dist/schema/agent-send-history.d.ts +85 -0
  341. package/dist/schema/agent-suggestions.d.ts +199 -0
  342. package/dist/schema/common-codes.d.ts +216 -0
  343. package/dist/schema/doc-sync-connect-requests.d.ts +140 -0
  344. package/dist/schema/doc-sync-links.d.ts +481 -0
  345. package/dist/schema/index.d.ts +21 -0
  346. package/dist/schema/model-routes.d.ts +581 -0
  347. package/dist/schema/notifications.d.ts +303 -0
  348. package/dist/schema/projects.d.ts +610 -0
  349. package/dist/schema/request-log-daily.d.ts +151 -0
  350. package/dist/schema/run-column-backfill.d.ts +81 -0
  351. package/dist/schema/schedule-runs.d.ts +451 -0
  352. package/dist/schema/sidebar-tabs.d.ts +466 -0
  353. package/dist/schema/storage-metadata.d.ts +181 -0
  354. package/dist/schema/task-log-events.d.ts +119 -0
  355. package/dist/schema/task-provider-inputs.d.ts +100 -0
  356. package/dist/schema/tasks.d.ts +1172 -1
  357. package/dist/schema/thread-creator-unverified.d.ts +45 -0
  358. package/dist/schema/thread-history.d.ts +734 -0
  359. package/dist/schema/threads.d.ts +59 -0
  360. package/dist/schema/ui-action-receipts.d.ts +358 -0
  361. package/dist/schema/ui-definition-archive.d.ts +63 -0
  362. package/dist/schema/ui-instance-repins.d.ts +222 -0
  363. package/dist/schema/ui-instances.d.ts +324 -0
  364. package/dist/schema/workspaces.d.ts +17 -0
  365. package/dist/skills/index.d.ts +15 -0
  366. package/dist/skills/index.js +2 -0
  367. package/dist/skills/types.d.ts +18 -0
  368. package/dist/task-log/anchor-child-tasks.d.ts +7 -0
  369. package/dist/task-log/delegation-trailer.d.ts +34 -0
  370. package/dist/template/engine.d.ts +2 -2
  371. package/dist/template/helpers/exec.browser.d.ts +4 -3
  372. package/dist/template/helpers/exec.d.ts +4 -3
  373. package/dist/template/helpers/format-conversation.d.ts +1 -0
  374. package/dist/template/types.d.ts +20 -0
  375. package/dist/testing/index.js +1 -1
  376. package/dist/types/index.d.ts +3493 -93
  377. package/dist/types/task-log.types.d.ts +6 -1
  378. package/dist/ui-card/index.d.ts +2 -0
  379. package/dist/ui-card/legacy-card-parser.d.ts +11 -0
  380. package/dist/ui-instance/definition.d.ts +6 -0
  381. package/dist/ui-instance/errors.d.ts +18 -0
  382. package/dist/ui-instance/index.d.ts +11 -0
  383. package/dist/ui-instance/json.d.ts +19 -0
  384. package/dist/ui-instance/lineage.d.ts +24 -0
  385. package/dist/ui-instance/runtime.d.ts +19 -0
  386. package/dist/ui-instance/store.d.ts +216 -0
  387. package/dist/ui-instance/types.d.ts +384 -0
  388. package/dist/ui-plugin/app-icon.d.ts +50 -0
  389. package/dist/ui-plugin/app-manifest.d.ts +64 -0
  390. package/dist/ui-plugin/csp.d.ts +28 -0
  391. package/dist/ui-plugin/index.d.ts +8 -0
  392. package/dist/ui-plugin/limits.d.ts +27 -0
  393. package/dist/ui-plugin/manifest.d.ts +3 -0
  394. package/dist/ui-plugin/types.d.ts +220 -0
  395. package/dist/ui-plugin/validator.d.ts +18 -0
  396. package/dist/utils/crewx-executable.d.ts +76 -0
  397. package/dist/utils/crewx-home.d.ts +1 -0
  398. package/dist/utils/env-defaults.d.ts +3 -0
  399. package/dist/utils/id.d.ts +1 -1
  400. package/dist/utils/local-identity.d.ts +2 -0
  401. package/dist/utils/runner-env.d.ts +3 -0
  402. package/dist/utils/timestamp.d.ts +1 -0
  403. package/dist/utils/workspace.d.ts +1 -0
  404. package/dist/wi/create.d.ts +48 -0
  405. package/dist/wi/select.d.ts +20 -0
  406. package/package.json +83 -3
  407. package/templates/agents/default.yaml +311 -128
  408. package/templates/documents/crewx-manual.md +138 -138
  409. package/templates/documents/crewx-quick-guide.md +8 -7
  410. package/templates/workflows/wi-default-flow.yaml +65 -0
  411. package/templates/workflows/wi-plan-flow.yaml +140 -0
@@ -1,13 +1,21 @@
1
+ import type { AgentListSnapshot } from '../agent/agent-list-view';
2
+ import { type InterceptorLaneRun, type InterceptorPhase } from '../agent-interceptor';
1
3
  import { TypedEventEmitter } from '../events/TypedEventEmitter';
2
4
  import type { CrewxPlugin } from '../plugin';
3
5
  import type { IFsAdapter } from '../platform/IFsAdapter';
4
6
  import type { ChannelAdapterRegistration } from '../adapter/types';
5
- import type { CrewxProjectConfig, AgentConfig, CrewxOptions, QueryOptions, QueryResult, ExecuteOptions, ExecuteResult } from '../types';
6
- import type { TemplateContext } from '../template/types';
7
- import type { CustomLayoutDefinition } from '../layout/types';
8
- import type { TemplateMessage } from '../conversation/types';
7
+ import type { CrewxProjectConfig, AgentConfig, CrewxOptions, QueryOptions, QueryResult, ExecuteOptions, ExecuteResult, CanResumeSessionParams, CanResumeSessionResult } from '../types';
8
+ import type { PromptListResolver, TemplateContext } from '../template/types';
9
+ import type { CustomLayoutDefinition, LayoutCapabilities } from '../layout/types';
10
+ import type { ConversationThreadState, SemanticContinuityContext, TemplateMessage } from '../conversation/types';
9
11
  import type { HandlerOptions, CrewxHandler } from '../server/handler';
10
12
  import type { RemoteProviderConfig } from '../remote/types.js';
13
+ import type { McpAppLayoutSnapshot, McpAppStateDescriptor } from '../mcp-app/types.js';
14
+ import type { McpAppModelContext } from '../mcp-app/model-context.js';
15
+ import type { CrewxAppCatalogOptions, CrewxAppCatalogResult } from '../mcp-app/types.js';
16
+ import type { McpAppsContext } from '../mcp-app/apps-context.js';
17
+ import type { UiRuntimeFacade, UiRuntimeOptions } from '../ui-instance/types.js';
18
+ import type { CrewxEventName, CrewxEventPayload } from '../events/types';
11
19
  export interface ToolDefinition {
12
20
  name: string;
13
21
  description: string;
@@ -19,6 +27,7 @@ export type LayoutSpec = string | {
19
27
  props?: Record<string, any>;
20
28
  } | {
21
29
  template: string;
30
+ capabilities?: LayoutCapabilities;
22
31
  };
23
32
  export interface SkillEntry {
24
33
  metadata: {
@@ -28,6 +37,7 @@ export interface SkillEntry {
28
37
  };
29
38
  filePath: string;
30
39
  }
40
+ export declare function loadAgentSkills(projectRoot?: string): SkillEntry[];
31
41
  export interface RenderAgentPromptOptions {
32
42
  layout?: LayoutSpec;
33
43
  session?: {
@@ -39,6 +49,12 @@ export interface RenderAgentPromptOptions {
39
49
  vars?: Record<string, unknown>;
40
50
  skills?: SkillEntry[];
41
51
  messages?: TemplateMessage[];
52
+ semanticContinuity?: SemanticContinuityContext;
53
+ threadState?: ConversationThreadState;
54
+ mcpAppProjections?: readonly McpAppStateDescriptor[];
55
+ mcpAppModelContext?: McpAppModelContext;
56
+ appLayoutSnapshot?: McpAppLayoutSnapshot;
57
+ mcpAppAvailable?: McpAppsContext['available'];
42
58
  threadId?: string;
43
59
  }
44
60
  export declare class Crewx extends TypedEventEmitter {
@@ -56,22 +72,35 @@ export declare class Crewx extends TypedEventEmitter {
56
72
  private readonly _activeAdapters;
57
73
  private readonly _pendingThreads;
58
74
  private readonly _activeTasks;
75
+ private readonly _activeInterceptorPids;
76
+ private readonly _interceptorRunTaskIds;
59
77
  private readonly _remoteFactory?;
78
+ private readonly _taskTicketIssuer?;
60
79
  private readonly _remoteTargets;
80
+ private readonly _detachedRemoteTargets;
61
81
  private readonly _additionalArgsProvider?;
82
+ private readonly _onRateLimitObserved?;
83
+ private _globalSettings?;
84
+ private readonly _routeDecisionService;
85
+ private readonly _callerIdentityOverrides;
62
86
  private constructor();
63
87
  private resolveFileRemoteTarget;
88
+ private _readRemoteTargetStat;
64
89
  private static loadBuiltInConfig;
65
90
  private static mergeCrewxConfig;
66
91
  static loadYaml(path: string | undefined, options?: CrewxOptions, fsAdapter?: IFsAdapter): Promise<Crewx>;
67
- static fromConfig(config: CrewxProjectConfig, options?: CrewxOptions, projectRoot?: string, fsAdapter?: IFsAdapter): Promise<Crewx>;
92
+ static fromConfig(config: CrewxProjectConfig, options?: Omit<CrewxOptions, 'taskTicketIssuer'>, projectRoot?: string, fsAdapter?: IFsAdapter): Promise<Crewx>;
68
93
  get agents(): ReadonlyMap<string, AgentConfig>;
69
94
  get config(): CrewxProjectConfig | undefined;
70
95
  get plugins(): readonly CrewxPlugin[];
71
96
  get tools(): ReadonlyMap<string, ToolDefinition>;
97
+ listApps(options?: CrewxAppCatalogOptions): Promise<CrewxAppCatalogResult>;
98
+ listWorkspaceApps(options?: CrewxAppCatalogOptions): Promise<CrewxAppCatalogResult>;
72
99
  get workspaceId(): string;
100
+ createUiRuntime(options: UiRuntimeOptions): UiRuntimeFacade;
73
101
  get workspaceName(): string;
74
102
  getAgent(agentRef: string): AgentConfig | undefined;
103
+ canResumeSession(agentRef: string, params: CanResumeSessionParams): Promise<CanResumeSessionResult>;
75
104
  getRemoteProviderConfig(providerId: string): RemoteProviderConfig | undefined;
76
105
  private computeTaskLogPath;
77
106
  registerTool(name: string, definition: Omit<ToolDefinition, 'name'>): void;
@@ -90,6 +119,14 @@ export declare class Crewx extends TypedEventEmitter {
90
119
  team?: string;
91
120
  provider?: string;
92
121
  }): AgentConfig[];
122
+ private readonly _promptListProviders;
123
+ registerPromptListProvider(resolver: PromptListResolver): void;
124
+ static readAgentListSnapshot(options: {
125
+ cwd: string;
126
+ env: Record<string, string>;
127
+ configPath?: string;
128
+ }): AgentListSnapshot;
129
+ static createAgentListPromptResolver(configPath?: string): PromptListResolver;
93
130
  renderAgentPrompt(agentId: string): string;
94
131
  renderPrompt(template: string, context?: TemplateContext): Promise<string>;
95
132
  registerLayout(name: string, template: string | CustomLayoutDefinition): void;
@@ -98,16 +135,52 @@ export declare class Crewx extends TypedEventEmitter {
98
135
  private _resolveLayoutSpec;
99
136
  private _extractLayoutId;
100
137
  private _extractLayoutProps;
138
+ private _resolveLayoutContinuityCapability;
101
139
  private _getConversationProvider;
140
+ private _filterActivityLogByTaskIds;
102
141
  private _fetchHistoryMessages;
142
+ private _resolveFreshProvider;
143
+ private _resolveLocalServerRuntime;
144
+ private _readInputBudgetPercent;
145
+ private _resolveBudgetModel;
146
+ private _planFreshHistorySnapshot;
147
+ private _writeAndVerifyHistorySnapshot;
148
+ private _resolveContextMode;
149
+ private _buildInstructionOnlyResumeManifest;
150
+ private _buildInstructionOnlyContinuity;
151
+ private _prepareInstructionOnlyResumeWithBudget;
152
+ private _activityLogEntryCounts;
153
+ private _byteBudgetActivityEntryCounts;
154
+ private _buildUnresolvedContextBudgetManifest;
155
+ private _prepareUnresolvedFreshPromptWithByteBudget;
156
+ private _buildResolvedContextBudgetManifest;
157
+ private _renderFreshPromptVariant;
158
+ private _prepareFreshPromptWithBudget;
159
+ private _prepareFreshPromptWithBudgetImpl;
160
+ private _recountFreshProviderInitialInput;
161
+ private _validateFreshProviderInitialInputBudget;
103
162
  private _resolveTimeout;
163
+ private _resolveIdleTimeout;
104
164
  private _lookupCliAdapter;
165
+ private _resolveEffectiveCost;
105
166
  private _resolveEffectiveCwd;
106
167
  private _buildFileRemoteOptions;
168
+ private _registerCallerIdentityOverride;
169
+ private _clearCallerIdentityOverride;
170
+ private _rewriteCallerFacingPayload;
171
+ protected emit<K extends CrewxEventName>(event: K, payload: CrewxEventPayload<K>): void;
107
172
  private emitToolEvents;
108
173
  private emitTaskLogEntries;
174
+ private emitInterceptorSteps;
175
+ private interceptorRunContext;
109
176
  private tryParseJson;
177
+ private _resolveRunAccount;
178
+ private _reportRateLimit;
179
+ private _routeRunMetadata;
180
+ private _emitRouteDecisionActivity;
181
+ private _recordRoutedQuotaFailure;
110
182
  query(agentRef: string, message: string, options?: QueryOptions): Promise<QueryResult>;
183
+ testAgentInterceptors(agentRef: string, phase: InterceptorPhase, text: string): Promise<InterceptorLaneRun | undefined>;
111
184
  continueQuery(threadId: string, toolResults: Array<{
112
185
  toolCallId: string;
113
186
  result: unknown;
@@ -0,0 +1,14 @@
1
+ export interface TaskTicketRequest {
2
+ readonly taskId: string;
3
+ readonly agentId: string;
4
+ readonly threadId: string;
5
+ readonly workspaceId: string;
6
+ readonly runEpoch: number;
7
+ }
8
+ export interface TaskTicketGrant {
9
+ readonly ticket: string;
10
+ readonly endpoint: string;
11
+ readonly workspaceSlug: string;
12
+ }
13
+ export type TaskTicketIssuer = (request: TaskTicketRequest) => Promise<TaskTicketGrant | null>;
14
+ export declare function resolveTaskTicketEnv(issuer: TaskTicketIssuer | undefined, request: TaskTicketRequest, parentEnv?: NodeJS.ProcessEnv): Promise<Record<string, string>>;
@@ -0,0 +1,2 @@
1
+ export declare const THREAD_HIGHLIGHT_PROMPT_INSTRUCTIONS: string;
2
+ export declare const THREAD_HIGHLIGHT_CONSOLIDATION_PROMPT_INSTRUCTIONS: string;
@@ -0,0 +1,326 @@
1
+ import { z } from 'zod';
2
+ import type { ThreadHighlight } from '../schema/thread-history.js';
3
+ import type { ProviderRuntime } from '../provider/bridge.js';
4
+ import type { CreateThreadHighlightInput, ThreadHighlightRegenerationCandidate } from '../repository/thread-history.repository.js';
5
+ export { THREAD_HIGHLIGHT_CONSOLIDATION_PROMPT_INSTRUCTIONS, THREAD_HIGHLIGHT_PROMPT_INSTRUCTIONS, } from './thread-highlight-prompt.js';
6
+ export declare const THREAD_HIGHLIGHTER_AGENT_ID: "thread_highlighter";
7
+ export declare const THREAD_HIGHLIGHTER_PROVIDER_ORDER: readonly ["cli/claude", "cli/opencode", "cli/copilot", "cli/codex"];
8
+ export type ThreadHighlightProviderId = (typeof THREAD_HIGHLIGHTER_PROVIDER_ORDER)[number];
9
+ export declare const MAX_THREAD_HIGHLIGHT_TURN_TEXT_LENGTH = 4000;
10
+ export declare const MAX_THREAD_HIGHLIGHT_PROMPT_LENGTH = 32000;
11
+ export declare const MAX_THREAD_HIGHLIGHTS_PER_RUN = 3;
12
+ export declare const MAX_THREAD_HIGHLIGHTS_PER_THREAD = 10;
13
+ export declare const MAX_THREAD_HIGHLIGHT_INPUT_TURNS = 100;
14
+ export declare const MAX_THREAD_HIGHLIGHT_REGENERATION_CANDIDATES = 40;
15
+ export declare const MAX_THREAD_HIGHLIGHT_ALREADY_RECORDED_COUNT = 20;
16
+ export declare const MAX_THREAD_HIGHLIGHT_ALREADY_RECORDED_TEXT_LENGTH = 160;
17
+ export declare const MAX_THREAD_HIGHLIGHT_ALREADY_RECORDED_TOTAL_LENGTH = 4000;
18
+ export declare const ThreadHighlightItemSchema: z.ZodObject<{
19
+ kind: z.ZodEnum<["decision", "judgment", "issue", "result", "pivot"]>;
20
+ text: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
21
+ anchorTaskId: z.ZodString;
22
+ coversFromTaskId: z.ZodString;
23
+ coversToTaskId: z.ZodString;
24
+ }, "strict", z.ZodTypeAny, {
25
+ text: string;
26
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
27
+ anchorTaskId: string;
28
+ coversFromTaskId: string;
29
+ coversToTaskId: string;
30
+ }, {
31
+ text: string;
32
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
33
+ anchorTaskId: string;
34
+ coversFromTaskId: string;
35
+ coversToTaskId: string;
36
+ }>;
37
+ export declare const ThreadHighlightResponseSchema: z.ZodObject<{
38
+ highlights: z.ZodArray<z.ZodObject<{
39
+ kind: z.ZodEnum<["decision", "judgment", "issue", "result", "pivot"]>;
40
+ text: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
41
+ anchorTaskId: z.ZodString;
42
+ coversFromTaskId: z.ZodString;
43
+ coversToTaskId: z.ZodString;
44
+ }, "strict", z.ZodTypeAny, {
45
+ text: string;
46
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
47
+ anchorTaskId: string;
48
+ coversFromTaskId: string;
49
+ coversToTaskId: string;
50
+ }, {
51
+ text: string;
52
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
53
+ anchorTaskId: string;
54
+ coversFromTaskId: string;
55
+ coversToTaskId: string;
56
+ }>, "many">;
57
+ }, "strict", z.ZodTypeAny, {
58
+ highlights: {
59
+ text: string;
60
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
61
+ anchorTaskId: string;
62
+ coversFromTaskId: string;
63
+ coversToTaskId: string;
64
+ }[];
65
+ }, {
66
+ highlights: {
67
+ text: string;
68
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
69
+ anchorTaskId: string;
70
+ coversFromTaskId: string;
71
+ coversToTaskId: string;
72
+ }[];
73
+ }>;
74
+ export declare const ThreadHighlightConsolidationItemSchema: z.ZodObject<{
75
+ id: z.ZodOptional<z.ZodString>;
76
+ source: z.ZodOptional<z.ZodEnum<["auto", "manual"]>>;
77
+ status: z.ZodOptional<z.ZodEnum<["active", "dismissed"]>>;
78
+ kind: z.ZodEnum<["decision", "judgment", "issue", "result", "pivot"]>;
79
+ text: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
80
+ anchorTaskId: z.ZodString;
81
+ coversFromTaskId: z.ZodString;
82
+ coversToTaskId: z.ZodString;
83
+ }, "strict", z.ZodTypeAny, {
84
+ text: string;
85
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
86
+ anchorTaskId: string;
87
+ coversFromTaskId: string;
88
+ coversToTaskId: string;
89
+ id?: string | undefined;
90
+ status?: "active" | "dismissed" | undefined;
91
+ source?: "auto" | "manual" | undefined;
92
+ }, {
93
+ text: string;
94
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
95
+ anchorTaskId: string;
96
+ coversFromTaskId: string;
97
+ coversToTaskId: string;
98
+ id?: string | undefined;
99
+ status?: "active" | "dismissed" | undefined;
100
+ source?: "auto" | "manual" | undefined;
101
+ }>;
102
+ export declare const ThreadHighlightConsolidationResponseSchema: z.ZodObject<{
103
+ highlights: z.ZodArray<z.ZodObject<{
104
+ id: z.ZodOptional<z.ZodString>;
105
+ source: z.ZodOptional<z.ZodEnum<["auto", "manual"]>>;
106
+ status: z.ZodOptional<z.ZodEnum<["active", "dismissed"]>>;
107
+ kind: z.ZodEnum<["decision", "judgment", "issue", "result", "pivot"]>;
108
+ text: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
109
+ anchorTaskId: z.ZodString;
110
+ coversFromTaskId: z.ZodString;
111
+ coversToTaskId: z.ZodString;
112
+ }, "strict", z.ZodTypeAny, {
113
+ text: string;
114
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
115
+ anchorTaskId: string;
116
+ coversFromTaskId: string;
117
+ coversToTaskId: string;
118
+ id?: string | undefined;
119
+ status?: "active" | "dismissed" | undefined;
120
+ source?: "auto" | "manual" | undefined;
121
+ }, {
122
+ text: string;
123
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
124
+ anchorTaskId: string;
125
+ coversFromTaskId: string;
126
+ coversToTaskId: string;
127
+ id?: string | undefined;
128
+ status?: "active" | "dismissed" | undefined;
129
+ source?: "auto" | "manual" | undefined;
130
+ }>, "many">;
131
+ }, "strict", z.ZodTypeAny, {
132
+ highlights: {
133
+ text: string;
134
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
135
+ anchorTaskId: string;
136
+ coversFromTaskId: string;
137
+ coversToTaskId: string;
138
+ id?: string | undefined;
139
+ status?: "active" | "dismissed" | undefined;
140
+ source?: "auto" | "manual" | undefined;
141
+ }[];
142
+ }, {
143
+ highlights: {
144
+ text: string;
145
+ kind: "result" | "decision" | "judgment" | "issue" | "pivot";
146
+ anchorTaskId: string;
147
+ coversFromTaskId: string;
148
+ coversToTaskId: string;
149
+ id?: string | undefined;
150
+ status?: "active" | "dismissed" | undefined;
151
+ source?: "auto" | "manual" | undefined;
152
+ }[];
153
+ }>;
154
+ export type ThreadHighlightItem = z.infer<typeof ThreadHighlightItemSchema>;
155
+ export type ThreadHighlightResponse = z.infer<typeof ThreadHighlightResponseSchema>;
156
+ export type ThreadHighlightConsolidationResponse = z.infer<typeof ThreadHighlightConsolidationResponseSchema>;
157
+ export interface ThreadHighlightTaskTurn {
158
+ taskId?: string;
159
+ task_id?: string;
160
+ id?: string;
161
+ prompt: string;
162
+ result?: string | null;
163
+ response?: string | null;
164
+ status?: string | null;
165
+ startedAt?: string | null;
166
+ started_at?: string | null;
167
+ completedAt?: string | null;
168
+ completed_at?: string | null;
169
+ }
170
+ export interface ThreadHighlightAlreadyRecorded {
171
+ kind: ThreadHighlight['kind'];
172
+ text: string;
173
+ }
174
+ export interface ThreadHighlightGenerationInput {
175
+ threadId: string;
176
+ agentId?: string;
177
+ workspaceId?: string;
178
+ turns: readonly ThreadHighlightTaskTurn[];
179
+ alreadyRecorded?: readonly ThreadHighlightAlreadyRecorded[];
180
+ already_recorded?: readonly ThreadHighlightAlreadyRecorded[];
181
+ coversFromTaskId?: string;
182
+ coversToTaskId?: string;
183
+ covers_from_task_id?: string;
184
+ covers_to_task_id?: string;
185
+ detectorVersion?: string;
186
+ detector_version?: string;
187
+ }
188
+ export interface ThreadHighlightConsolidationItem {
189
+ id?: string | null;
190
+ source?: string | null;
191
+ status?: string | null;
192
+ kind: ThreadHighlight['kind'];
193
+ text: string | null;
194
+ anchorTaskId?: string | null;
195
+ coversFromTaskId?: string | null;
196
+ coversToTaskId?: string | null;
197
+ sourceTaskId?: string | null;
198
+ covers_from_task_id?: string | null;
199
+ covers_to_task_id?: string | null;
200
+ source_task_id?: string | null;
201
+ contentFingerprint?: string | null;
202
+ content_fingerprint?: string | null;
203
+ }
204
+ export interface ThreadHighlightConsolidationInput {
205
+ threadId?: string;
206
+ agentId?: string;
207
+ workspaceId?: string;
208
+ detectorVersion?: string;
209
+ detector_version?: string;
210
+ currentHighlights?: readonly ThreadHighlightConsolidationItem[];
211
+ currentAutoHighlights?: readonly ThreadHighlightConsolidationItem[];
212
+ current?: readonly ThreadHighlightConsolidationItem[];
213
+ existingHighlights?: readonly ThreadHighlightConsolidationItem[];
214
+ existingAutoHighlights?: readonly ThreadHighlightConsolidationItem[];
215
+ existing?: readonly ThreadHighlightConsolidationItem[];
216
+ newCandidates?: readonly ThreadHighlightConsolidationItem[];
217
+ candidates?: readonly ThreadHighlightConsolidationItem[];
218
+ newHighlights?: readonly ThreadHighlightConsolidationItem[];
219
+ manualHighlights?: readonly ThreadHighlightConsolidationItem[];
220
+ manual?: readonly ThreadHighlightConsolidationItem[];
221
+ }
222
+ export interface ThreadHighlightWriter {
223
+ resolveWorkspaceId?(threadId: string): string | null | Promise<string | null>;
224
+ createHighlight(input: CreateThreadHighlightInput): ThreadHighlight | Promise<ThreadHighlight>;
225
+ }
226
+ export interface ThreadHighlightGeneratorOptions {
227
+ repository: ThreadHighlightWriter;
228
+ workspaceId?: string;
229
+ providerFactory?: (provider: ThreadHighlightProviderId) => ProviderRuntime;
230
+ providers?: Partial<Record<ThreadHighlightProviderId, ProviderRuntime>>;
231
+ }
232
+ export interface ThreadHighlightBatchDetectorOptions {
233
+ providerFactory?: (provider: ThreadHighlightProviderId) => ProviderRuntime;
234
+ providers?: Partial<Record<ThreadHighlightProviderId, ProviderRuntime>>;
235
+ }
236
+ export interface ThreadHighlightConsolidationOptions {
237
+ providerFactory?: (provider: ThreadHighlightProviderId) => ProviderRuntime;
238
+ providers?: Partial<Record<ThreadHighlightProviderId, ProviderRuntime>>;
239
+ }
240
+ export type ThreadHighlightProviderAttemptOutcome = 'provider_error' | 'invalid_output';
241
+ export interface ThreadHighlightProviderAttempt {
242
+ provider: ThreadHighlightProviderId;
243
+ outcome: ThreadHighlightProviderAttemptOutcome;
244
+ batchIndex?: number;
245
+ }
246
+ export type ThreadHighlightFailureCode = 'INVALID_INPUT' | 'PROVIDER_EXHAUSTED' | 'INVALID_OUTPUT' | 'REPOSITORY_FAILED' | 'THREAD_HIGHLIGHT_REGENERATION_NO_ELIGIBLE_TURNS' | 'THREAD_HIGHLIGHT_REGENERATION_DETECTION_FAILED';
247
+ export interface ThreadHighlightGenerationFailure {
248
+ code: ThreadHighlightFailureCode;
249
+ message: string;
250
+ retryable: boolean;
251
+ attempts: readonly ThreadHighlightProviderAttempt[];
252
+ }
253
+ export interface ThreadHighlightGenerationSuccess {
254
+ ok: true;
255
+ provider: ThreadHighlightProviderId;
256
+ highlights: ThreadHighlight[];
257
+ attempts: readonly ThreadHighlightProviderAttempt[];
258
+ }
259
+ export interface ThreadHighlightGenerationFailureResult {
260
+ ok: false;
261
+ failure: ThreadHighlightGenerationFailure;
262
+ }
263
+ export type ThreadHighlightGenerationResult = ThreadHighlightGenerationSuccess | ThreadHighlightGenerationFailureResult;
264
+ export interface ThreadHighlightRegenerationInput extends Omit<ThreadHighlightGenerationInput, 'turns'> {
265
+ turns: readonly ThreadHighlightTaskTurn[];
266
+ }
267
+ export interface ThreadHighlightBatchDetectionSuccess {
268
+ ok: true;
269
+ provider: ThreadHighlightProviderId;
270
+ candidates: readonly ThreadHighlightRegenerationCandidate[];
271
+ batchCount: number;
272
+ attempts: readonly ThreadHighlightProviderAttempt[];
273
+ }
274
+ export type ThreadHighlightBatchDetectionResult = ThreadHighlightBatchDetectionSuccess | ThreadHighlightGenerationFailureResult;
275
+ export interface ThreadHighlightConsolidationHighlight extends ThreadHighlightRegenerationCandidate {
276
+ id?: string;
277
+ source: 'auto';
278
+ status: 'active';
279
+ }
280
+ export interface ThreadHighlightConsolidationSuccess {
281
+ ok: true;
282
+ provider: ThreadHighlightProviderId | null;
283
+ highlights: readonly ThreadHighlightConsolidationHighlight[];
284
+ candidates: readonly ThreadHighlightRegenerationCandidate[];
285
+ dismissedHighlightIds: readonly string[];
286
+ attempts: readonly ThreadHighlightProviderAttempt[];
287
+ }
288
+ export type ThreadHighlightConsolidationResult = ThreadHighlightConsolidationSuccess | ThreadHighlightGenerationFailureResult;
289
+ export declare class ThreadHighlightGenerationError extends Error {
290
+ readonly failure: ThreadHighlightGenerationFailure;
291
+ readonly name = "ThreadHighlightGenerationError";
292
+ constructor(failure: ThreadHighlightGenerationFailure);
293
+ }
294
+ export declare class ThreadHighlightOutputValidationError extends Error {
295
+ readonly issuePaths: readonly string[];
296
+ readonly name = "ThreadHighlightOutputValidationError";
297
+ constructor(issuePaths: readonly string[]);
298
+ }
299
+ export declare class ThreadHighlightInputValidationError extends Error {
300
+ readonly field: string;
301
+ readonly name = "ThreadHighlightInputValidationError";
302
+ constructor(field: string);
303
+ }
304
+ export declare function redactThreadHighlightSecrets(value: string): string;
305
+ export declare function buildThreadHighlightPrompt(input: ThreadHighlightGenerationInput): string;
306
+ export declare function buildThreadHighlightConsolidationPrompt(input: ThreadHighlightConsolidationInput): string;
307
+ export declare function parseThreadHighlightResponse(raw: unknown): ThreadHighlightResponse;
308
+ export declare function parseThreadHighlightConsolidationResponse(raw: unknown): ThreadHighlightConsolidationResponse;
309
+ export declare class ThreadHighlightGenerator {
310
+ private readonly repository;
311
+ private readonly workspaceId?;
312
+ private readonly providerFactory;
313
+ private readonly providers;
314
+ constructor(options: ThreadHighlightGeneratorOptions);
315
+ private detectBatch;
316
+ detectBatches(input: ThreadHighlightRegenerationInput): Promise<ThreadHighlightBatchDetectionResult>;
317
+ consolidate(input: ThreadHighlightConsolidationInput): Promise<ThreadHighlightConsolidationResult>;
318
+ consolidateHighlights(input: ThreadHighlightConsolidationInput): Promise<ThreadHighlightConsolidationResult>;
319
+ generate(input: ThreadHighlightGenerationInput): Promise<ThreadHighlightGenerationResult>;
320
+ generateOrThrow(input: ThreadHighlightGenerationInput): Promise<ThreadHighlightGenerationSuccess>;
321
+ }
322
+ export declare function generateThreadHighlights(input: ThreadHighlightGenerationInput, options: ThreadHighlightGeneratorOptions): Promise<ThreadHighlightGenerationResult>;
323
+ export declare function consolidateThreadHighlights(input: ThreadHighlightConsolidationInput, options?: ThreadHighlightConsolidationOptions): Promise<ThreadHighlightConsolidationResult>;
324
+ export declare function detectThreadHighlightBatches(input: ThreadHighlightRegenerationInput, options: ThreadHighlightBatchDetectorOptions): Promise<ThreadHighlightBatchDetectionResult>;
325
+ export declare const generateThreadHighlightBatches: typeof detectThreadHighlightBatches;
326
+ export declare const ThreadHighlighter: typeof ThreadHighlightGenerator;
@@ -0,0 +1,82 @@
1
+ import type { ConversationHighlight, TemplateMessage } from '../conversation/types.js';
2
+ export type HistoryEntryKind = 'message' | 'activity' | 'highlight';
3
+ export interface HistorySnapshotScope {
4
+ readonly workspaceRealPath: string;
5
+ readonly agentId: string;
6
+ readonly threadId: string;
7
+ readonly taskId: string;
8
+ }
9
+ export type HistoryActivityCoverage = Readonly<Record<string, unknown>>;
10
+ export interface HistorySnapshotInput {
11
+ readonly scope: HistorySnapshotScope;
12
+ readonly runEpoch: number;
13
+ readonly preparedAtMs: number;
14
+ readonly messages: readonly TemplateMessage[];
15
+ readonly activityByTask: ReadonlyMap<string, string>;
16
+ readonly highlights: readonly ConversationHighlight[];
17
+ readonly activityCoverage?: HistoryActivityCoverage;
18
+ }
19
+ export interface HistorySnapshotPlan {
20
+ readonly ref: string;
21
+ readonly expiresAtMs: number;
22
+ readonly bytes: Buffer;
23
+ }
24
+ export interface HistorySnapshotRef {
25
+ readonly ref: string;
26
+ readonly entries: number;
27
+ readonly bytes: number;
28
+ readonly expiresAtMs: number;
29
+ }
30
+ export type HistorySnapshotErrorCode = 'INVALID_REF' | 'NOT_FOUND' | 'EXPIRED' | 'SCOPE_MISMATCH' | 'IDENTITY_MISSING' | 'TAMPERED' | 'UNSAFE_FILE' | 'TOO_LARGE' | 'IO_ERROR';
31
+ export declare class HistorySnapshotError extends Error {
32
+ readonly code: HistorySnapshotErrorCode;
33
+ constructor(code: HistorySnapshotErrorCode);
34
+ }
35
+ export type HistoryOperation = 'toc' | 'search' | 'read';
36
+ export interface HistoryEmissionRange {
37
+ readonly entry: number;
38
+ readonly startByte: number;
39
+ readonly endByte: number;
40
+ }
41
+ export interface HistoryPage {
42
+ readonly text: string;
43
+ readonly nextCommand?: string;
44
+ readonly snapshotRef: string;
45
+ readonly operation: HistoryOperation;
46
+ readonly entries: readonly number[];
47
+ readonly ranges: readonly HistoryEmissionRange[];
48
+ readonly byteCount: number;
49
+ }
50
+ export interface HistoryAuditRecord {
51
+ readonly version: 1;
52
+ readonly timestampMs: number;
53
+ readonly operation: HistoryOperation;
54
+ readonly taskId: string;
55
+ readonly entries: readonly number[];
56
+ readonly ranges: readonly HistoryEmissionRange[];
57
+ readonly byteCount: number;
58
+ }
59
+ export declare const MAX_PAGE_BYTES = 8000;
60
+ export declare const MAX_PAGE_LINES = 1000;
61
+ export declare const MAX_SNAPSHOT_BYTES: number;
62
+ export declare const MAX_AUDIT_BYTES: number;
63
+ export declare const MAX_AUDIT_RECORD_BYTES = 512;
64
+ export declare function planHistorySnapshot(input: HistorySnapshotInput): HistorySnapshotPlan;
65
+ export declare function writeHistorySnapshot(projectRoot: string, plan: HistorySnapshotPlan): Promise<HistorySnapshotRef>;
66
+ export declare function scopeFromEnv(env: NodeJS.ProcessEnv, workspaceRealPath: string): HistorySnapshotScope;
67
+ export declare function tocHistory(projectRoot: string, ref: string, scope: HistorySnapshotScope, options?: {
68
+ readonly from?: number;
69
+ readonly limit?: number;
70
+ }): Promise<HistoryPage>;
71
+ export declare function searchHistory(projectRoot: string, ref: string, scope: HistorySnapshotScope, options: {
72
+ readonly query: string;
73
+ readonly limit?: number;
74
+ readonly cursor?: string;
75
+ }): Promise<HistoryPage>;
76
+ export declare function readHistory(projectRoot: string, ref: string, scope: HistorySnapshotScope, options: {
77
+ readonly entry: number;
78
+ readonly offset?: number;
79
+ readonly bytes?: number;
80
+ }): Promise<HistoryPage>;
81
+ export declare function recordHistoryEmission(projectRoot: string, ref: string, scope: HistorySnapshotScope, page: HistoryPage): Promise<void>;
82
+ export declare function readHistoryAudit(projectRoot: string, ref: string, scope: HistorySnapshotScope): Promise<readonly HistoryAuditRecord[]>;