@anchrd/intel 0.59.0

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 (364) hide show
  1. package/README.md +496 -0
  2. package/bin/intel.mjs +134 -0
  3. package/dist/adapters/cloudflare/cloudflare-flow-workflow.d.ts +42 -0
  4. package/dist/adapters/cloudflare/cloudflare-flow-workflow.js +89 -0
  5. package/dist/adapters/cloudflare/cloudflare.d.ts +29 -0
  6. package/dist/adapters/cloudflare/cloudflare.js +416 -0
  7. package/dist/adapters/cloudflare/cloudflare.types.d.ts +31 -0
  8. package/dist/adapters/cloudflare/cloudflare.types.js +1 -0
  9. package/dist/adapters/content/content.d.ts +3 -0
  10. package/dist/adapters/content/content.js +128 -0
  11. package/dist/adapters/content/content.types.d.ts +38 -0
  12. package/dist/adapters/content/content.types.js +1 -0
  13. package/dist/adapters/db/db-audit.d.ts +62 -0
  14. package/dist/adapters/db/db-audit.js +150 -0
  15. package/dist/adapters/db/db-boards.d.ts +6 -0
  16. package/dist/adapters/db/db-boards.js +324 -0
  17. package/dist/adapters/db/db-feed.d.ts +30 -0
  18. package/dist/adapters/db/db-feed.js +276 -0
  19. package/dist/adapters/db/db-flows.d.ts +42 -0
  20. package/dist/adapters/db/db-flows.js +1311 -0
  21. package/dist/adapters/db/db-grants.d.ts +133 -0
  22. package/dist/adapters/db/db-grants.js +269 -0
  23. package/dist/adapters/db/db-indexing.d.ts +3 -0
  24. package/dist/adapters/db/db-indexing.js +200 -0
  25. package/dist/adapters/db/db-oauth.d.ts +3 -0
  26. package/dist/adapters/db/db-oauth.js +26 -0
  27. package/dist/adapters/db/db-prompts.d.ts +46 -0
  28. package/dist/adapters/db/db-prompts.js +144 -0
  29. package/dist/adapters/db/db.d.ts +6 -0
  30. package/dist/adapters/db/db.js +1687 -0
  31. package/dist/adapters/db/db.types.d.ts +16 -0
  32. package/dist/adapters/db/db.types.js +1 -0
  33. package/dist/adapters/document-converter/document-converter.d.ts +2 -0
  34. package/dist/adapters/document-converter/document-converter.js +26 -0
  35. package/dist/adapters/document-converter/document-converter.types.d.ts +17 -0
  36. package/dist/adapters/document-converter/document-converter.types.js +1 -0
  37. package/dist/adapters/flow-runtime/flow-runtime.d.ts +3 -0
  38. package/dist/adapters/flow-runtime/flow-runtime.js +22 -0
  39. package/dist/adapters/flow-runtime/flow-runtime.types.d.ts +19 -0
  40. package/dist/adapters/flow-runtime/flow-runtime.types.js +1 -0
  41. package/dist/adapters/index-queue/index-queue.d.ts +10 -0
  42. package/dist/adapters/index-queue/index-queue.js +12 -0
  43. package/dist/adapters/index-queue/index-queue.types.d.ts +11 -0
  44. package/dist/adapters/index-queue/index-queue.types.js +1 -0
  45. package/dist/adapters/json-schema/json-schema.d.ts +2 -0
  46. package/dist/adapters/json-schema/json-schema.js +77 -0
  47. package/dist/adapters/openid/openid.d.ts +5 -0
  48. package/dist/adapters/openid/openid.js +301 -0
  49. package/dist/adapters/portal-tokens/portal-tokens.d.ts +8 -0
  50. package/dist/adapters/portal-tokens/portal-tokens.js +79 -0
  51. package/dist/adapters/remote-tools/remote-tools.d.ts +5 -0
  52. package/dist/adapters/remote-tools/remote-tools.js +129 -0
  53. package/dist/adapters/semantic-index/semantic-index.d.ts +2 -0
  54. package/dist/adapters/semantic-index/semantic-index.js +139 -0
  55. package/dist/adapters/semantic-index/semantic-index.types.d.ts +56 -0
  56. package/dist/adapters/semantic-index/semantic-index.types.js +1 -0
  57. package/dist/adapters/session-cookie/session-cookie.d.ts +5 -0
  58. package/dist/adapters/session-cookie/session-cookie.js +87 -0
  59. package/dist/adapters/tool-source-policy/tool-source-policy.d.ts +1 -0
  60. package/dist/adapters/tool-source-policy/tool-source-policy.js +22 -0
  61. package/dist/audit/audit.d.ts +2 -0
  62. package/dist/audit/audit.js +87 -0
  63. package/dist/audit/audit.types.d.ts +23 -0
  64. package/dist/audit/audit.types.js +1 -0
  65. package/dist/auth/auth.d.ts +2 -0
  66. package/dist/auth/auth.js +284 -0
  67. package/dist/auth/auth.types.d.ts +108 -0
  68. package/dist/auth/auth.types.js +1 -0
  69. package/dist/boards/boards.d.ts +44 -0
  70. package/dist/boards/boards.js +447 -0
  71. package/dist/boards/boards.types.d.ts +117 -0
  72. package/dist/boards/boards.types.js +1 -0
  73. package/dist/build/build.d.ts +2 -0
  74. package/dist/build/build.js +192 -0
  75. package/dist/build/build.types.d.ts +17 -0
  76. package/dist/build/build.types.js +1 -0
  77. package/dist/bundle/bundle.d.ts +4 -0
  78. package/dist/bundle/bundle.js +1194 -0
  79. package/dist/bundle/bundle.types.d.ts +33 -0
  80. package/dist/bundle/bundle.types.js +1 -0
  81. package/dist/cli/cli.d.ts +4 -0
  82. package/dist/cli/cli.js +262 -0
  83. package/dist/cli/cli.types.d.ts +14 -0
  84. package/dist/cli/cli.types.js +1 -0
  85. package/dist/contract/audit.d.ts +50 -0
  86. package/dist/contract/audit.js +72 -0
  87. package/dist/contract/board.d.ts +150 -0
  88. package/dist/contract/board.js +262 -0
  89. package/dist/contract/bundle.d.ts +147 -0
  90. package/dist/contract/bundle.js +139 -0
  91. package/dist/contract/contract.d.ts +112 -0
  92. package/dist/contract/contract.js +143 -0
  93. package/dist/contract/feed.d.ts +126 -0
  94. package/dist/contract/feed.js +149 -0
  95. package/dist/contract/flow-run.d.ts +346 -0
  96. package/dist/contract/flow-run.js +194 -0
  97. package/dist/contract/flow.d.ts +1057 -0
  98. package/dist/contract/flow.js +552 -0
  99. package/dist/contract/node.d.ts +551 -0
  100. package/dist/contract/node.js +456 -0
  101. package/dist/contract/share.d.ts +216 -0
  102. package/dist/contract/share.js +134 -0
  103. package/dist/contract/table.d.ts +171 -0
  104. package/dist/contract/table.js +117 -0
  105. package/dist/contract/tool.d.ts +122 -0
  106. package/dist/contract/tool.js +172 -0
  107. package/dist/feed/feed.d.ts +2 -0
  108. package/dist/feed/feed.js +77 -0
  109. package/dist/feed/feed.types.d.ts +23 -0
  110. package/dist/feed/feed.types.js +1 -0
  111. package/dist/flows/flows.d.ts +41 -0
  112. package/dist/flows/flows.js +2216 -0
  113. package/dist/flows/flows.types.d.ts +339 -0
  114. package/dist/flows/flows.types.js +1 -0
  115. package/dist/http/http.d.ts +9 -0
  116. package/dist/http/http.js +874 -0
  117. package/dist/http/http.types.d.ts +22 -0
  118. package/dist/http/http.types.js +1 -0
  119. package/dist/indexing/indexing.d.ts +6 -0
  120. package/dist/indexing/indexing.js +239 -0
  121. package/dist/indexing/indexing.types.d.ts +11 -0
  122. package/dist/indexing/indexing.types.js +1 -0
  123. package/dist/intel/intel.d.ts +3 -0
  124. package/dist/intel/intel.js +194 -0
  125. package/dist/intel/intel.types.d.ts +24 -0
  126. package/dist/intel/intel.types.js +1 -0
  127. package/dist/mcp/mcp.d.ts +2 -0
  128. package/dist/mcp/mcp.js +1292 -0
  129. package/dist/mcp/mcp.types.d.ts +25 -0
  130. package/dist/mcp/mcp.types.js +1 -0
  131. package/dist/nodes/document-links/document-links.d.ts +20 -0
  132. package/dist/nodes/document-links/document-links.js +57 -0
  133. package/dist/nodes/nodes.d.ts +2 -0
  134. package/dist/nodes/nodes.js +1667 -0
  135. package/dist/nodes/nodes.types.d.ts +511 -0
  136. package/dist/nodes/nodes.types.js +1 -0
  137. package/dist/prepare/prepare.d.ts +4 -0
  138. package/dist/prepare/prepare.js +16 -0
  139. package/dist/prepare/prepare.types.d.ts +9 -0
  140. package/dist/prepare/prepare.types.js +1 -0
  141. package/dist/prompts/prompts.d.ts +2 -0
  142. package/dist/prompts/prompts.js +65 -0
  143. package/dist/prompts/prompts.types.d.ts +71 -0
  144. package/dist/prompts/prompts.types.js +1 -0
  145. package/dist/shared/callers/callers.d.ts +28 -0
  146. package/dist/shared/callers/callers.js +30 -0
  147. package/dist/shared/csv/csv.d.ts +13 -0
  148. package/dist/shared/csv/csv.js +85 -0
  149. package/dist/shared/document-text/document-text.d.ts +21 -0
  150. package/dist/shared/document-text/document-text.js +31 -0
  151. package/dist/shared/gate-authorization/gate-authorization.d.ts +5 -0
  152. package/dist/shared/gate-authorization/gate-authorization.js +26 -0
  153. package/dist/shared/grant-expiry/grant-expiry.d.ts +19 -0
  154. package/dist/shared/grant-expiry/grant-expiry.js +26 -0
  155. package/dist/shared/intel-error/intel-error.d.ts +22 -0
  156. package/dist/shared/intel-error/intel-error.js +27 -0
  157. package/dist/shared/plain-title/plain-title.d.ts +16 -0
  158. package/dist/shared/plain-title/plain-title.js +45 -0
  159. package/dist/shared/problem-details/problem-details.d.ts +30 -0
  160. package/dist/shared/problem-details/problem-details.js +18 -0
  161. package/dist/shared/report-unexpected-error/report-unexpected-error.d.ts +1 -0
  162. package/dist/shared/report-unexpected-error/report-unexpected-error.js +37 -0
  163. package/dist/shared/safe-return-path/safe-return-path.d.ts +2 -0
  164. package/dist/shared/safe-return-path/safe-return-path.js +11 -0
  165. package/dist/shared/sha256/sha256.d.ts +2 -0
  166. package/dist/shared/sha256/sha256.js +14 -0
  167. package/dist/tools/tool-servers/tool-servers.d.ts +46 -0
  168. package/dist/tools/tool-servers/tool-servers.js +177 -0
  169. package/dist/tools/tools.d.ts +2 -0
  170. package/dist/tools/tools.js +207 -0
  171. package/dist/tools/tools.types.d.ts +56 -0
  172. package/dist/tools/tools.types.js +1 -0
  173. package/examples/branding/favicon.svg +5 -0
  174. package/examples/branding/logo.svg +5 -0
  175. package/examples/branding/theme.css +16 -0
  176. package/examples/dev.vars.example +7 -0
  177. package/examples/intel.json +9 -0
  178. package/migrations/0000_intel_foundation.sql +203 -0
  179. package/migrations/0001_portal_native_tools.sql +21 -0
  180. package/migrations/0002_flows_in_the_knowledge_tree.sql +34 -0
  181. package/migrations/0003_folder_permissions.sql +211 -0
  182. package/migrations/0004_subflow_runs.sql +14 -0
  183. package/migrations/0005_flow_node_cleanup.sql +28 -0
  184. package/migrations/0005_tables_in_the_knowledge_tree.sql +68 -0
  185. package/migrations/0006_links_are_written_in_the_text.sql +20 -0
  186. package/migrations/0007_no_node_waits.sql +69 -0
  187. package/migrations/0008_three_layers.sql +130 -0
  188. package/migrations/0009_no_context_policy.sql +48 -0
  189. package/migrations/0010_no_run_waits_a_year.sql +27 -0
  190. package/migrations/0011_one_name_for_the_tree.sql +53 -0
  191. package/migrations/0012_table_snapshots.sql +29 -0
  192. package/migrations/0017_a_vector_per_card.sql +38 -0
  193. package/migrations/0018_no_context_policy_at_last.sql +97 -0
  194. package/migrations/0019_one_name_for_the_grants.sql +52 -0
  195. package/migrations/0020_cascade_purge_replay.sql +11 -0
  196. package/migrations/0021_a_flow_carries_its_own_grant.sql +44 -0
  197. package/migrations/0022_a_cursor_over_the_journal.sql +14 -0
  198. package/migrations/0023_a_board_and_its_tasks.sql +116 -0
  199. package/migrations/0024_the_archive_is_a_column.sql +33 -0
  200. package/migrations/0025_archiving_takes_the_subtree.sql +29 -0
  201. package/migrations/0026_one_feed_over_two_kinds.sql +23 -0
  202. package/migrations/0027_the_runs_of_every_flow.sql +27 -0
  203. package/migrations/0028_a_prompt_name_over_two_kinds.sql +70 -0
  204. package/package.json +118 -0
  205. package/src/contract/CLAUDE.md +152 -0
  206. package/src/contract/README.md +102 -0
  207. package/src/contract/audit.ts +85 -0
  208. package/src/contract/board.ts +306 -0
  209. package/src/contract/bundle.ts +157 -0
  210. package/src/contract/contract.ts +161 -0
  211. package/src/contract/feed.ts +165 -0
  212. package/src/contract/flow-run.ts +241 -0
  213. package/src/contract/flow.ts +675 -0
  214. package/src/contract/node.ts +583 -0
  215. package/src/contract/share.ts +196 -0
  216. package/src/contract/table.ts +178 -0
  217. package/src/contract/tool.ts +202 -0
  218. package/ui/README.md +110 -0
  219. package/ui/components.json +21 -0
  220. package/ui/index.html +13 -0
  221. package/ui/package.json +11 -0
  222. package/ui/scripts/lint-tokens.mjs +187 -0
  223. package/ui/src/access-summary/access-summary.tsx +385 -0
  224. package/ui/src/app/action-slot/action-slot.tsx +27 -0
  225. package/ui/src/app/app-sidebar/app-sidebar.tsx +71 -0
  226. package/ui/src/app/app-tree/app-tree.tsx +1175 -0
  227. package/ui/src/app/app.tsx +87 -0
  228. package/ui/src/app/header-search/header-search.tsx +294 -0
  229. package/ui/src/app/reindex-dialog/reindex-dialog.tsx +79 -0
  230. package/ui/src/app/settings-dialog/settings-dialog.tsx +135 -0
  231. package/ui/src/app/sidebar-preferences/sidebar-preferences.ts +68 -0
  232. package/ui/src/app/sidebar-preferences/sidebar-preferences.types.ts +15 -0
  233. package/ui/src/app/sidebar-resize-handle/sidebar-resize-handle.tsx +86 -0
  234. package/ui/src/app/tree-expansion/tree-expansion.ts +107 -0
  235. package/ui/src/app/tree-expansion/tree-expansion.types.ts +31 -0
  236. package/ui/src/app/tree-move/tree-move.tsx +427 -0
  237. package/ui/src/app/tree-reveal/tree-reveal.ts +64 -0
  238. package/ui/src/app/tree-reveal/tree-reveal.types.ts +16 -0
  239. package/ui/src/app/user-footer/user-footer.tsx +188 -0
  240. package/ui/src/app/view-menu/view-menu.tsx +115 -0
  241. package/ui/src/app-root/app-root.tsx +109 -0
  242. package/ui/src/app-root/app-root.types.ts +27 -0
  243. package/ui/src/archive/archive.tsx +417 -0
  244. package/ui/src/attachment-detail/attachment-detail.ts +52 -0
  245. package/ui/src/attachment-viewer/attachment-viewer.tsx +166 -0
  246. package/ui/src/blocknote-view/blocknote-view.tsx +30 -0
  247. package/ui/src/board/board-assignee/board-assignee-picker.tsx +132 -0
  248. package/ui/src/board/board-assignee/board-assignee.ts +48 -0
  249. package/ui/src/board/board-assignee/board-assignee.tsx +75 -0
  250. package/ui/src/board/board-chip/board-chip.tsx +46 -0
  251. package/ui/src/board/board-crumbs/board-crumbs.ts +56 -0
  252. package/ui/src/board/board-crumbs/board-crumbs.tsx +111 -0
  253. package/ui/src/board/board-data/board-data.ts +195 -0
  254. package/ui/src/board/board-data/board-data.types.ts +38 -0
  255. package/ui/src/board/board-dates/board-dates.ts +40 -0
  256. package/ui/src/board/board-dates/board-dates.tsx +105 -0
  257. package/ui/src/board/board-kanban/board-kanban.ts +162 -0
  258. package/ui/src/board/board-kanban/board-kanban.tsx +680 -0
  259. package/ui/src/board/board-open-task/board-open-task.ts +32 -0
  260. package/ui/src/board/board-panel/board-panel.tsx +259 -0
  261. package/ui/src/board/board-settings/board-settings.tsx +226 -0
  262. package/ui/src/board/board-status/board-status.tsx +60 -0
  263. package/ui/src/board/board-stripes/board-stripes.ts +128 -0
  264. package/ui/src/board/board-table/board-table.ts +53 -0
  265. package/ui/src/board/board-table/board-table.tsx +610 -0
  266. package/ui/src/board/board-task/board-task.ts +108 -0
  267. package/ui/src/board/board-task/board-task.tsx +335 -0
  268. package/ui/src/board/board-title-row/board-title-row.tsx +66 -0
  269. package/ui/src/branding/branding.tsx +17 -0
  270. package/ui/src/branding/custom-logo.ts +1 -0
  271. package/ui/src/branding/favicon.default.svg +5 -0
  272. package/ui/src/branding/favicon.svg +5 -0
  273. package/ui/src/components/ui/avatar.tsx +39 -0
  274. package/ui/src/components/ui/button.tsx +64 -0
  275. package/ui/src/components/ui/collapsible.tsx +20 -0
  276. package/ui/src/components/ui/command.tsx +160 -0
  277. package/ui/src/components/ui/dialog.tsx +143 -0
  278. package/ui/src/components/ui/dropdown-menu.tsx +187 -0
  279. package/ui/src/components/ui/input.tsx +21 -0
  280. package/ui/src/components/ui/popover.tsx +41 -0
  281. package/ui/src/components/ui/select.tsx +163 -0
  282. package/ui/src/components/ui/separator.tsx +26 -0
  283. package/ui/src/components/ui/sheet.tsx +136 -0
  284. package/ui/src/components/ui/sidebar.tsx +693 -0
  285. package/ui/src/components/ui/skeleton.tsx +13 -0
  286. package/ui/src/components/ui/switch.tsx +25 -0
  287. package/ui/src/components/ui/table.tsx +82 -0
  288. package/ui/src/components/ui/tabs.tsx +52 -0
  289. package/ui/src/components/ui/tooltip.tsx +51 -0
  290. package/ui/src/data/intel-data-provider/intel-data-provider.ts +685 -0
  291. package/ui/src/data/intel-data-provider/intel-data-provider.types.ts +266 -0
  292. package/ui/src/data/query-client.ts +18 -0
  293. package/ui/src/data/request-refusal/refusal-notice.tsx +36 -0
  294. package/ui/src/data/request-refusal/request-refusal.ts +51 -0
  295. package/ui/src/data/sign-in/sign-in.ts +97 -0
  296. package/ui/src/data/sign-in/sign-in.types.ts +15 -0
  297. package/ui/src/document-link/document-link.tsx +114 -0
  298. package/ui/src/document-markdown/document-markdown.ts +195 -0
  299. package/ui/src/editor-schema/editor-schema.ts +23 -0
  300. package/ui/src/entry-picker/entry-picker.tsx +238 -0
  301. package/ui/src/feed/feed.tsx +344 -0
  302. package/ui/src/file-preview/file-preview-view.tsx +496 -0
  303. package/ui/src/file-preview/file-preview.tsx +28 -0
  304. package/ui/src/file-preview/pdf-file-preview.tsx +5 -0
  305. package/ui/src/file-preview/presentation-file-preview.tsx +21 -0
  306. package/ui/src/file-preview/spreadsheet-file-preview.tsx +5 -0
  307. package/ui/src/file-preview/word-file-preview.tsx +5 -0
  308. package/ui/src/flow-runs/flow-runs.tsx +238 -0
  309. package/ui/src/flows/flows.tsx +1646 -0
  310. package/ui/src/flows/node-icon/node-icon.ts +34 -0
  311. package/ui/src/flows/node-palette/node-palette.tsx +214 -0
  312. package/ui/src/flows/node-palette/node-palette.types.ts +15 -0
  313. package/ui/src/folder-contents/folder-contents.tsx +321 -0
  314. package/ui/src/folder-index/folder-index.ts +55 -0
  315. package/ui/src/frontmatter/frontmatter.tsx +193 -0
  316. package/ui/src/graph-pane/graph-pane.tsx +53 -0
  317. package/ui/src/hooks/use-mobile.ts +19 -0
  318. package/ui/src/i18n/custom.json +4 -0
  319. package/ui/src/i18n/de.json +609 -0
  320. package/ui/src/i18n/en.json +609 -0
  321. package/ui/src/i18n/es.json +609 -0
  322. package/ui/src/i18n/i18n-context.tsx +65 -0
  323. package/ui/src/i18n/i18n-languages/i18n-languages.ts +83 -0
  324. package/ui/src/i18n/i18n.ts +32 -0
  325. package/ui/src/i18n/i18n.types.ts +49 -0
  326. package/ui/src/kind-icon.ts +97 -0
  327. package/ui/src/lib/utils.ts +6 -0
  328. package/ui/src/main.tsx +68 -0
  329. package/ui/src/modal/modal.tsx +53 -0
  330. package/ui/src/node-details/node-details.tsx +545 -0
  331. package/ui/src/node-editor/node-editor.tsx +304 -0
  332. package/ui/src/node-graph/graph-notice.tsx +21 -0
  333. package/ui/src/node-graph/node-graph.ts +214 -0
  334. package/ui/src/node-graph/node-graph.tsx +295 -0
  335. package/ui/src/node-import/node-import.tsx +418 -0
  336. package/ui/src/node-save-error.ts +46 -0
  337. package/ui/src/node-source/node-source.tsx +128 -0
  338. package/ui/src/node-table/node-table.tsx +107 -0
  339. package/ui/src/nodes/nodes.tsx +240 -0
  340. package/ui/src/rename-resource/rename-resource.ts +80 -0
  341. package/ui/src/resolved-names/resolved-names.tsx +67 -0
  342. package/ui/src/resource-error.ts +33 -0
  343. package/ui/src/resource-menu/resource-menu.tsx +1156 -0
  344. package/ui/src/router/router-context.ts +6 -0
  345. package/ui/src/router/router.tsx +67 -0
  346. package/ui/src/router/router.types.ts +8 -0
  347. package/ui/src/router/selection-search.ts +88 -0
  348. package/ui/src/save-button/save-button.tsx +94 -0
  349. package/ui/src/section-hint/section-hint.tsx +40 -0
  350. package/ui/src/sign-in-refused/sign-in-refused.tsx +35 -0
  351. package/ui/src/styles.css +189 -0
  352. package/ui/src/table-columns/table-columns.tsx +379 -0
  353. package/ui/src/theme/custom.css +1 -0
  354. package/ui/src/theme/theme-context.tsx +89 -0
  355. package/ui/src/theme/theme.ts +70 -0
  356. package/ui/src/time/relative-time.tsx +41 -0
  357. package/ui/src/time/time-context.tsx +78 -0
  358. package/ui/src/time/time.ts +165 -0
  359. package/ui/src/title-row/title-row.tsx +185 -0
  360. package/ui/src/tools/tools.tsx +546 -0
  361. package/ui/src/user-name/user-name.ts +61 -0
  362. package/ui/src/verbatim/verbatim.tsx +68 -0
  363. package/ui/tsconfig.json +17 -0
  364. package/ui/vite.config.ts +129 -0
@@ -0,0 +1,33 @@
1
+ import type { BundleImportResult, BundleManifest } from "../contract/bundle.js";
2
+ import type { FlowRepository } from "../flows/flows.types.js";
3
+ import type { Actor, ContentStore, NodeRepository } from "../nodes/nodes.types.js";
4
+ export interface BundleActor extends Actor {
5
+ canReadFlows: boolean;
6
+ canCreateFlows?: boolean;
7
+ }
8
+ export interface BundleDeps {
9
+ repository: Pick<NodeRepository, "getVisible" | "listVisibleSubtree" | "listVersionContentKeys" | "can" | "importTree" | "findImportReplay" | "resolveVisibleTitles">;
10
+ flows: Pick<FlowRepository, "listVisible" | "getVisible" | "getVersions">;
11
+ content: Pick<ContentStore, "get" | "getStream" | "put" | "putBytes" | "delete">;
12
+ id(): string;
13
+ now(): Date;
14
+ hash(content: string | Uint8Array): Promise<string>;
15
+ indexing: {
16
+ enqueue(versionId: string): Promise<void>;
17
+ };
18
+ }
19
+ export interface BundleExport {
20
+ filename: string;
21
+ stream: ReadableStream<Uint8Array>;
22
+ }
23
+ export interface BundleImportInput {
24
+ targetNodeId: string | null;
25
+ zip: ReadableStream<Uint8Array> | Uint8Array;
26
+ idempotencyKey: string;
27
+ }
28
+ export interface BundleService {
29
+ exportSubtree(actor: BundleActor, rootId: string | null): Promise<BundleExport>;
30
+ exportFlow(actor: BundleActor, flowId: string): Promise<BundleExport>;
31
+ manifest(actor: BundleActor, rootId: string | null): Promise<BundleManifest>;
32
+ importBundle(actor: BundleActor, input: BundleImportInput): Promise<BundleImportResult>;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { CliDeps } from "./cli.types.js";
2
+ export declare function createCli(deps: CliDeps): {
3
+ run(argv: string[]): Promise<number>;
4
+ };
@@ -0,0 +1,262 @@
1
+ import { createBuild } from "../build/build.js";
2
+ import { createPrepare } from "../prepare/prepare.js";
3
+ const interfaces = [
4
+ // ⚠️ No `use`. Nothing asked it (#475): every door in Intel asks a concrete capability —
5
+ // `nodes:read`, `flows:run`, `mcp:connect` — and a coarse "may use Intel at all" beside them is a
6
+ // permission an operator sets and nothing consults. Worse than useless: somebody granted only
7
+ // `intel:use` gets the empty screen the README warns about and reads it as a defect.
8
+ // `admin` stays and is the opposite case — it is the one way into a tree that carries no grant
9
+ // yet (ADR-0004 §6), read in ten places.
10
+ { handle: "intel", functions: ["admin"] },
11
+ // ⚠️ `nodes`, not `knowledge` — and the rename cost something, which is why it needed its own
12
+ // ticket (#152) five months after #125 renamed everything else. This handle is only half Intel's:
13
+ // `bootstrap` DECLARES it in Gate and touches no grant on an interface it does not name, so to
14
+ // Gate a renamed handle is a NEW one. Every grant on the old name keeps pointing at the old name,
15
+ // and everybody loses access at once, silently, until an operator hands the permissions out again.
16
+ //
17
+ // It was done in the one window where that is free: the installation on anchrd.sh was being
18
+ // rebuilt anyway (#385, anchrd/core#93) and there is no other. Doing it later would mean doing it
19
+ // to somebody.
20
+ //
21
+ // ⚠️ The old `knowledge` interface stays declared in Gate — bootstrap declares only the handles in
22
+ // this list and never revokes a whole INTERFACE. It is a harmless leftover on installations that
23
+ // have it, and nothing in Intel asks about it any more; removing it is an act in Gate, by hand,
24
+ // when somebody is sure nothing else uses it.
25
+ { handle: "nodes", functions: ["read", "create", "write", "share"] },
26
+ // ⚠️ No `approve`. The approval node is gone (#73), and this list is what Intel declares to Gate:
27
+ // a function nobody asks about is a permission an operator has to decide on for no reason.
28
+ //
29
+ // ⚠️ Dropping a FUNCTION from a still-declared interface is not the harmless leftover the two
30
+ // blocks around this one describe (#474). `gate.set` is `PUT /api/v1/service/interfaces/:handle`,
31
+ // an upsert that REPLACES the function list, and in the same batch Gate runs `obsoleteGrants` —
32
+ // `DELETE FROM grants WHERE interface_id = ? AND function NOT IN (…)`. Gate holds that down with
33
+ // a test of its own (`service-interfaces.int.ts`, "scoped set/remove per App-Key und entfernt
34
+ // Grants gestrichener Funktionen"), and it is right to: catalog and grants are one change against
35
+ // Gate's own reasoning above `obsoleteGrants`. So an installation that granted `approve` does
36
+ // NOT keep it — the next bootstrap deletes every role assignment on it. That is why bootstrap
37
+ // reads the current list before it writes and names what it takes away.
38
+ {
39
+ handle: "flows",
40
+ functions: ["read", "create", "write", "publish", "run", "share"],
41
+ },
42
+ // ⚠️ No `admin`. Nothing asked it either (#475), and here the reason is architectural rather than
43
+ // an oversight: the Cloudflare MCP Portal owns which servers exist and who may reach each one, and
44
+ // Intel stores no tool permissions at all — the catalog is a live `tools/list` with the asking
45
+ // person's token. There is no administration of tools inside Intel for the function to guard, so
46
+ // it cannot grow a reader later without that boundary moving first.
47
+ { handle: "tools", functions: ["read", "test", "execute"] },
48
+ // ⚠️ `agents:run` is deliberately NOT here any more (#390). The whole `agents` handle left the
49
+ // list, and bootstrap writes only the handles it names, so an installation that has that
50
+ // interface keeps it and its grants as a harmless leftover — but a new one is not asked to decide
51
+ // about a permission nothing reads. ⚠️ This holds because a whole INTERFACE went; a single
52
+ // function taken out of a handle that is still listed here is deleted along with its grants, see
53
+ // the block above (#474).
54
+ // `mcp:connect` means the same thing at every MCP service of this installation. A separate name
55
+ // for the same thing forces the operator to check, service by service, which permission carries
56
+ // portal access.
57
+ { handle: "mcp", functions: ["connect"] },
58
+ ];
59
+ // What Intel used to declare and no longer does, keyed by handle for a whole interface and by
60
+ // `handle:function` for a single function.
61
+ //
62
+ // ⚠️ It exists because "surplus: approve" is not actionable on its own (#466). An operator who reads
63
+ // only the name has to decide whether somebody meant it, and the cheapest way out of that decision
64
+ // is to leave it standing — which is how `approve` outlived #73 by months. The reason is the half
65
+ // that turns the note into a decision instead of a puzzle, so a new retirement belongs in here in
66
+ // the same pull request that takes its entry out of `interfaces` above.
67
+ const retired = {
68
+ knowledge: "the whole interface became `nodes` (#152, after #125).",
69
+ agents: "the whole interface went when Agents left the surface (#390, #388).",
70
+ "flows:approve": "the approval node is gone (#73).",
71
+ "intel:use": "no door ever asked it; every one of them asks a concrete capability (#475).",
72
+ "tools:admin": "the portal owns tool administration, so Intel never had anything to guard (#475).",
73
+ };
74
+ // An unlisted surplus gets a sentence too. "no reason recorded" is an answer an operator can act on;
75
+ // an empty dash reads as an omission and sends them looking for the missing half.
76
+ function reason(key) {
77
+ return retired[key] ?? "no reason is recorded here, so read the history before removing it.";
78
+ }
79
+ const usage = `Usage: intel <prepare|bootstrap|build|doctor|reindex>
80
+ intel prepare Copy versioned D1 migrations to .intel/migrations
81
+ intel bootstrap Idempotently declare Intel interfaces in Gate
82
+ intel build Apply intel.json and atomically build the customer UI
83
+ intel doctor Check packages, environment, migrations, UI, and Gate interfaces
84
+ intel reindex Request a full authorized search-index rebuild`;
85
+ export function createCli(deps) {
86
+ const envValue = (name) => deps.env[name]?.trim() || null;
87
+ const fail = (message) => {
88
+ deps.log(`Error: ${message}`);
89
+ return 1;
90
+ };
91
+ const within = async (work, milliseconds = 10_000) => {
92
+ let timer;
93
+ try {
94
+ return await Promise.race([
95
+ work,
96
+ new Promise((_resolve, reject) => {
97
+ timer = setTimeout(() => reject(new Error("operation timed out")), milliseconds);
98
+ }),
99
+ ]);
100
+ }
101
+ finally {
102
+ if (timer)
103
+ clearTimeout(timer);
104
+ }
105
+ };
106
+ async function bootstrap() {
107
+ const gateUrl = envValue("GATE_URL");
108
+ const serviceKey = envValue("GATE_SERVICE_KEY") ?? envValue("GATE_KEY");
109
+ if (!gateUrl || !serviceKey) {
110
+ return fail("GATE_URL and GATE_SERVICE_KEY must be set.");
111
+ }
112
+ const gate = deps.createGateInterfaces(gateUrl, serviceKey);
113
+ // ⚠️ Read before writing, and refuse if the read fails. The current list is the only place the
114
+ // functions Gate is about to lose are named; `set` replaces it, and afterwards nothing can say
115
+ // which grants went with them (#474). A run that writes anyway takes permissions away and has
116
+ // nothing left to report — the old "No grants were changed." in exactly the shape that made it
117
+ // wrong. Bootstrap is idempotent, so refusing costs a second run.
118
+ let current;
119
+ try {
120
+ current = await within(gate.list());
121
+ }
122
+ catch {
123
+ return fail("Gate interfaces could not be read, so bootstrap cannot say which grants it would delete.");
124
+ }
125
+ let removed = 0;
126
+ for (const entry of interfaces) {
127
+ const declared = entry.functions;
128
+ const dropped = (current.find((row) => row.handle === entry.handle)?.functions ?? []).filter((fn) => !declared.includes(fn));
129
+ await gate.set(entry.handle, [...entry.functions]);
130
+ // Logged per interface, right after its own write returned, so a run that fails halfway still
131
+ // named every deletion it actually caused.
132
+ if (dropped.length) {
133
+ removed += dropped.length;
134
+ const names = dropped.map((fn) => `${entry.handle}:${fn}`).join(", ");
135
+ deps.log(`Removed ${names} from Gate; every grant on ${dropped.length === 1 ? "it" : "them"} was deleted with it.`);
136
+ }
137
+ }
138
+ deps.log(`Declared ${interfaces.length} Intel interfaces in Gate.`);
139
+ if (!removed)
140
+ deps.log("No declared function was dropped, so Gate deleted no grant.");
141
+ return 0;
142
+ }
143
+ async function doctor() {
144
+ const failures = [];
145
+ // A surplus hinders nothing, so it is never a `FAIL`: a doctor one knows red is a doctor nobody
146
+ // reads, and then the next real failure goes with it (#466).
147
+ const notes = [];
148
+ const gateUrl = envValue("GATE_URL");
149
+ const intelUrl = envValue("INTEL_URL");
150
+ const serviceKey = envValue("GATE_SERVICE_KEY") ?? envValue("GATE_KEY");
151
+ const sessionSecret = envValue("INTEL_SESSION_SECRET");
152
+ const toolSourceOrigins = envValue("TOOL_SOURCE_ORIGINS");
153
+ const portalUrl = envValue("MCP_PORTAL_URL");
154
+ if (!gateUrl)
155
+ failures.push("GATE_URL is missing");
156
+ if (!intelUrl)
157
+ failures.push("INTEL_URL is missing");
158
+ if (!serviceKey)
159
+ failures.push("GATE_SERVICE_KEY is missing");
160
+ if (!toolSourceOrigins)
161
+ failures.push("TOOL_SOURCE_ORIGINS is missing");
162
+ // Tools are optional for a deployment that only uses nodes and Flows, so a missing portal
163
+ // is reported as a warning rather than a failure.
164
+ if (!portalUrl) {
165
+ deps.log("Note: MCP_PORTAL_URL is unset, so the Tools area stays empty.");
166
+ }
167
+ else if (toolSourceOrigins && !toolSourceOrigins.includes(new URL(portalUrl).origin)) {
168
+ failures.push("MCP_PORTAL_URL origin is missing from TOOL_SOURCE_ORIGINS");
169
+ }
170
+ if (!sessionSecret || new TextEncoder().encode(sessionSecret).byteLength < 32) {
171
+ failures.push("INTEL_SESSION_SECRET must contain at least 32 bytes");
172
+ }
173
+ if (!(await deps.resolveUi()))
174
+ failures.push("the Intel UI is not installed (@anchrd/intel/ui)");
175
+ if (!(await deps.resolveMigrations()))
176
+ failures.push("Intel migrations are not installed");
177
+ if (gateUrl && serviceKey) {
178
+ try {
179
+ const current = await within(deps.createGateInterfaces(gateUrl, serviceKey).list());
180
+ let surplusFunction = false;
181
+ for (const expected of interfaces) {
182
+ const actual = current.find((entry) => entry.handle === expected.handle);
183
+ const missing = expected.functions.filter((fn) => !actual?.functions.includes(fn));
184
+ if (missing.length)
185
+ failures.push(`Gate interface ${expected.handle} misses ${missing}`);
186
+ const declared = expected.functions;
187
+ for (const fn of actual?.functions ?? []) {
188
+ if (declared.includes(fn))
189
+ continue;
190
+ surplusFunction = true;
191
+ notes.push(`Gate carries ${expected.handle}:${fn}, which Intel does not declare — ${reason(`${expected.handle}:${fn}`)}`);
192
+ }
193
+ }
194
+ // ⚠️ The other direction, and it is the half a loop over `interfaces` can never reach: a
195
+ // handle Intel stopped declaring appears in no expectation, so it is never looked up. The
196
+ // comparison runs both ways or it does not run (#466).
197
+ const declaredHandles = interfaces.map((entry) => entry.handle);
198
+ const surplusHandles = current.filter((row) => !declaredHandles.includes(row.handle));
199
+ for (const row of surplusHandles) {
200
+ notes.push(`Gate carries the interface ${row.handle} (${row.functions.join(", ")}), which Intel does not declare — ${reason(row.handle)}`);
201
+ }
202
+ // What to do about it, once per kind — because the two kinds need opposite acts. A surplus
203
+ // FUNCTION on a still-declared handle disappears by itself on the next `bootstrap`, grants
204
+ // and all (#474); a surplus HANDLE is never written and therefore never goes away on its own.
205
+ if (surplusFunction) {
206
+ notes.push("The next `intel bootstrap` removes a surplus function and every grant on it (#474). Take the grant away in Gate first if anybody should keep it.");
207
+ }
208
+ if (surplusHandles.length) {
209
+ notes.push("`bootstrap` never touches an interface Intel does not declare, so a surplus one stays until somebody removes it in Gate by hand — which takes its grants with it.");
210
+ }
211
+ }
212
+ catch {
213
+ failures.push("Gate interface check failed");
214
+ }
215
+ }
216
+ for (const note of notes)
217
+ deps.log(`NOTE ${note}`);
218
+ if (failures.length) {
219
+ for (const failure of failures)
220
+ deps.log(`FAIL ${failure}`);
221
+ return 1;
222
+ }
223
+ deps.log("OK Intel packages, configuration, and Gate interfaces are ready.");
224
+ return 0;
225
+ }
226
+ async function reindex() {
227
+ const intelUrl = envValue("INTEL_URL")?.replace(/\/+$/, "");
228
+ const token = envValue("INTEL_OPERATOR_TOKEN");
229
+ if (!intelUrl || !token) {
230
+ return fail("INTEL_URL and a short-lived INTEL_OPERATOR_TOKEN must be set.");
231
+ }
232
+ const response = await deps.fetch(`${intelUrl}/api/v1/nodes/reindex`, {
233
+ method: "POST",
234
+ headers: { authorization: `Bearer ${token}`, "content-type": "application/json" },
235
+ body: "{}",
236
+ signal: AbortSignal.timeout(10_000),
237
+ });
238
+ if (!response.ok)
239
+ return fail(`reindex responded with ${response.status}`);
240
+ deps.log("Intel accepted the reindex request.");
241
+ return 0;
242
+ }
243
+ return {
244
+ async run(argv) {
245
+ switch (argv[0]) {
246
+ case "prepare":
247
+ return await createPrepare(deps).prepare();
248
+ case "bootstrap":
249
+ return await bootstrap();
250
+ case "build":
251
+ return await createBuild(deps).build();
252
+ case "doctor":
253
+ return await doctor();
254
+ case "reindex":
255
+ return await reindex();
256
+ default:
257
+ deps.log(usage);
258
+ return argv[0] ? 1 : 0;
259
+ }
260
+ },
261
+ };
262
+ }
@@ -0,0 +1,14 @@
1
+ import type { BuildDeps } from "../build/build.types.js";
2
+ import type { PrepareDeps } from "../prepare/prepare.types.js";
3
+ export interface GateInterfaces {
4
+ list(): Promise<Array<{
5
+ handle: string;
6
+ functions: string[];
7
+ }>>;
8
+ set(handle: string, functions: string[]): Promise<unknown>;
9
+ }
10
+ export interface CliDeps extends BuildDeps, PrepareDeps {
11
+ env: Record<string, string | undefined>;
12
+ fetch: typeof fetch;
13
+ createGateInterfaces(url: string, serviceKey: string): GateInterfaces;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ export declare const AuditResourceType: z.ZodEnum<{
3
+ flow: "flow";
4
+ node: "node";
5
+ "flow-run": "flow-run";
6
+ }>;
7
+ export type AuditResourceType = z.infer<typeof AuditResourceType>;
8
+ export declare const AuditEvent: z.ZodObject<{
9
+ id: z.ZodString;
10
+ actorId: z.ZodString;
11
+ action: z.ZodString;
12
+ resourceType: z.ZodEnum<{
13
+ flow: "flow";
14
+ node: "node";
15
+ "flow-run": "flow-run";
16
+ }>;
17
+ resourceId: z.ZodString;
18
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
19
+ occurredAt: z.ZodISODateTime;
20
+ }, z.core.$strict>;
21
+ export type AuditEvent = z.infer<typeof AuditEvent>;
22
+ export declare const AuditCursor: z.ZodString;
23
+ export declare const AuditListRequest: z.ZodObject<{
24
+ resourceType: z.ZodEnum<{
25
+ flow: "flow";
26
+ node: "node";
27
+ "flow-run": "flow-run";
28
+ }>;
29
+ after: z.ZodOptional<z.ZodString>;
30
+ limit: z.ZodDefault<z.ZodNumber>;
31
+ }, z.core.$strict>;
32
+ export type AuditListRequest = z.infer<typeof AuditListRequest>;
33
+ export declare const AuditListResponse: z.ZodObject<{
34
+ events: z.ZodArray<z.ZodObject<{
35
+ id: z.ZodString;
36
+ actorId: z.ZodString;
37
+ action: z.ZodString;
38
+ resourceType: z.ZodEnum<{
39
+ flow: "flow";
40
+ node: "node";
41
+ "flow-run": "flow-run";
42
+ }>;
43
+ resourceId: z.ZodString;
44
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
45
+ occurredAt: z.ZodISODateTime;
46
+ }, z.core.$strict>>;
47
+ nextCursor: z.ZodNullable<z.ZodString>;
48
+ hasMore: z.ZodBoolean;
49
+ }, z.core.$strict>;
50
+ export type AuditListResponse = z.infer<typeof AuditListResponse>;
@@ -0,0 +1,72 @@
1
+ import { z } from "zod";
2
+ import { IntelId, IsoDateTime } from "./contract.js";
3
+ // Which kind of resource an event is about — all three the column carries, since #774.
4
+ //
5
+ // ⚠️ It was `["node"]` alone until then, and that was a decision rather than a gap (#620): each
6
+ // kind needs a DIFFERENT visibility check, and asking for one that had none was REFUSED rather than
7
+ // answered with an empty list. An empty list reads as "nothing happened", and a consumer built on
8
+ // that would miss every flow event without ever learning they exist.
9
+ //
10
+ // What changed is that the other two checks now exist. `flow` walks the folder a flow hangs in
11
+ // (`flowInSubtree`), and `flow-run` walks one join further — run → flow → folder — which #767 built
12
+ // for the feed. **Widening the enum without those walks would have been the silent answer the
13
+ // original decision refused**, so the order matters: the check first, the enum second.
14
+ export const AuditResourceType = z.enum(["node", "flow", "flow-run"]);
15
+ // One line of the change journal. `resourceId` is the node the event is about; `actorId` is who
16
+ // caused it. `metadata` is whatever the write site recorded — its shape belongs to `action` and is
17
+ // deliberately not typed here, because a schema per action would have to be kept in step with 11
18
+ // write sites and would go stale in silence.
19
+ export const AuditEvent = z.strictObject({
20
+ id: IntelId,
21
+ actorId: z.string().min(1),
22
+ action: z.string().min(1),
23
+ resourceType: AuditResourceType,
24
+ resourceId: IntelId,
25
+ metadata: z.record(z.string(), z.unknown()),
26
+ occurredAt: IsoDateTime,
27
+ });
28
+ // ⚠️ Opaque BY CONTRACT, not merely by encoding. The reader gets a string back and hands the same
29
+ // string in again; it must not take it apart, and it must not build one.
30
+ //
31
+ // The reason is that the cursor is a PAIR — `(occurredAt, id)` — and the pair is the whole point.
32
+ // A timestamp alone cannot separate two events written in the same millisecond, which for a batch
33
+ // is the normal case rather than the exception; a reader continuing on `occurredAt > X` skips the
34
+ // second one silently. If the cursor were two fields, a caller would eventually send only the
35
+ // timestamp, and the loss would look like nothing at all: no error, no log, just an event that
36
+ // never arrived.
37
+ export const AuditCursor = z.string().min(1).max(400);
38
+ export const AuditListRequest = z.strictObject({
39
+ resourceType: AuditResourceType.describe("Which kind of resource to read events about: `node` for documents, folders, tables and attachments, `flow` for changes to a flow itself, `flow-run` for its runs. One kind per call — the three are separate journals with separate cursors."),
40
+ after: AuditCursor.optional().describe("Where to continue: the `nextCursor` of a previous answer, passed back unchanged. Omit it to start at the oldest event you may see. Do not build one — it is opaque on purpose."),
41
+ limit: z
42
+ .number()
43
+ .int()
44
+ .min(1)
45
+ .max(200)
46
+ .default(50)
47
+ .describe("How many events to return at most. The answer may be shorter."),
48
+ });
49
+ // `nextCursor` is the cursor of the LAST returned row — a position, not a page number. A reader
50
+ // stores it and sends it back as `after`.
51
+ //
52
+ // ⚠️ **It answers WHERE THE READER GOT TO, never whether more is waiting.** Those are two questions,
53
+ // and for a while one field answered both: the cursor was omitted whenever no further page followed,
54
+ // so a reader that was catching up got fifty events and no position, started over on its next run,
55
+ // and would have delivered the same fifty for ever. Measured against the running installation
56
+ // (`#793`); a reader paging through never notices, because it always asks for a full page.
57
+ //
58
+ // ⚠️ **`hasMore` is the other question, and it is a MAY, not a promise.** The journal is a live table
59
+ // and the rows a reader may see can shrink between calls. Treating `hasMore` as "there is data" is a
60
+ // fair reading; treating an empty answer as "the feed ended" is not.
61
+ export const AuditListResponse = z.strictObject({
62
+ events: z.array(AuditEvent),
63
+ // `null` only when nothing was returned: no rows, no position.
64
+ nextCursor: AuditCursor.nullable(),
65
+ /**
66
+ * ⚠️ **Added rather than repurposed** (`#793`). A reader written against the old shape reads
67
+ * "cursor present" as "more may follow"; it now sees a cursor on the last page as well and asks
68
+ * once more, which answers empty. That costs one request and loses nothing — whereas changing what
69
+ * `nextCursor` MEANS would have made those readers skip.
70
+ */
71
+ hasMore: z.boolean(),
72
+ });
@@ -0,0 +1,150 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The id of the archive column, on every board (D68, #674).
4
+ *
5
+ * ⚠️ **It is derived, never stored.** A card sits in it because `nodes.archived_at` is set, and
6
+ * `board_tasks.status` keeps naming the working column it came from — that is what lets a card
7
+ * pulled back out land where it was. A configured column may not claim this id; `board_update`
8
+ * refuses it, because two columns with one id means every card in them lands in whichever the view
9
+ * draws first.
10
+ */
11
+ export declare const ARCHIVE_COLUMN_ID = "archived";
12
+ /**
13
+ * What a colour picker starts on for a column that has none (#725).
14
+ *
15
+ * ⚠️ **Here rather than in the browser package, and that is not tidiness.** The token linter refuses
16
+ * a hard-coded hex in `packages/intel/ui`, and it is right to: a colour written into a component bypasses
17
+ * the theme. This one is not a theme colour, it is DATA — the value a person is about to choose
18
+ * from and the api writes as a default — so it belongs where both sides may read it, which is here.
19
+ *
20
+ * ⚠️ **It is the widget's starting point, never a written value.** `color` stays absent until
21
+ * somebody picks one, so opening the dialog does not repaint a board that predates colours.
22
+ */
23
+ export declare const DEFAULT_COLUMN_COLOR = "#9ca3af";
24
+ export declare const BoardColumn: z.ZodObject<{
25
+ id: z.ZodString;
26
+ title: z.ZodString;
27
+ terminal: z.ZodDefault<z.ZodBoolean>;
28
+ color: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strict>;
30
+ export type BoardColumn = z.infer<typeof BoardColumn>;
31
+ export declare const BoardTask: z.ZodObject<{
32
+ id: z.ZodString;
33
+ title: z.ZodString;
34
+ status: z.ZodString;
35
+ assigneeId: z.ZodNullable<z.ZodString>;
36
+ labels: z.ZodArray<z.ZodString>;
37
+ startDate: z.ZodNullable<z.ZodISODateTime>;
38
+ dueDate: z.ZodNullable<z.ZodISODateTime>;
39
+ dependsOn: z.ZodNullable<z.ZodString>;
40
+ parentTaskId: z.ZodNullable<z.ZodString>;
41
+ position: z.ZodNumber;
42
+ archivedAt: z.ZodNullable<z.ZodISODateTime>;
43
+ }, z.core.$strict>;
44
+ export type BoardTask = z.infer<typeof BoardTask>;
45
+ export declare const BoardTaskFilter: z.ZodObject<{
46
+ status: z.ZodOptional<z.ZodString>;
47
+ assigneeId: z.ZodOptional<z.ZodString>;
48
+ dueBefore: z.ZodOptional<z.ZodISODateTime>;
49
+ dependsOn: z.ZodOptional<z.ZodString>;
50
+ includeArchived: z.ZodDefault<z.ZodBoolean>;
51
+ }, z.core.$strict>;
52
+ export type BoardTaskFilter = z.infer<typeof BoardTaskFilter>;
53
+ export declare const BoardGetInput: z.ZodObject<{
54
+ status: z.ZodOptional<z.ZodString>;
55
+ assigneeId: z.ZodOptional<z.ZodString>;
56
+ dueBefore: z.ZodOptional<z.ZodISODateTime>;
57
+ dependsOn: z.ZodOptional<z.ZodString>;
58
+ includeArchived: z.ZodDefault<z.ZodBoolean>;
59
+ boardId: z.ZodString;
60
+ }, z.core.$strict>;
61
+ export type BoardGetInput = z.infer<typeof BoardGetInput>;
62
+ export declare const BoardView: z.ZodObject<{
63
+ boardId: z.ZodString;
64
+ title: z.ZodString;
65
+ columns: z.ZodArray<z.ZodObject<{
66
+ id: z.ZodString;
67
+ title: z.ZodString;
68
+ terminal: z.ZodDefault<z.ZodBoolean>;
69
+ color: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strict>>;
71
+ archiveVisible: z.ZodBoolean;
72
+ tasks: z.ZodArray<z.ZodObject<{
73
+ id: z.ZodString;
74
+ title: z.ZodString;
75
+ status: z.ZodString;
76
+ assigneeId: z.ZodNullable<z.ZodString>;
77
+ labels: z.ZodArray<z.ZodString>;
78
+ startDate: z.ZodNullable<z.ZodISODateTime>;
79
+ dueDate: z.ZodNullable<z.ZodISODateTime>;
80
+ dependsOn: z.ZodNullable<z.ZodString>;
81
+ parentTaskId: z.ZodNullable<z.ZodString>;
82
+ position: z.ZodNumber;
83
+ archivedAt: z.ZodNullable<z.ZodISODateTime>;
84
+ }, z.core.$strict>>;
85
+ }, z.core.$strict>;
86
+ export type BoardView = z.infer<typeof BoardView>;
87
+ export declare const BoardUpdateInput: z.ZodObject<{
88
+ boardId: z.ZodString;
89
+ columns: z.ZodArray<z.ZodObject<{
90
+ id: z.ZodString;
91
+ title: z.ZodString;
92
+ terminal: z.ZodDefault<z.ZodBoolean>;
93
+ color: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$strict>>;
95
+ archiveVisible: z.ZodOptional<z.ZodBoolean>;
96
+ idempotencyKey: z.ZodString;
97
+ }, z.core.$strict>;
98
+ export type BoardUpdateInput = z.infer<typeof BoardUpdateInput>;
99
+ export declare const BoardTaskCreateInput: z.ZodObject<{
100
+ boardId: z.ZodString;
101
+ title: z.ZodString;
102
+ status: z.ZodOptional<z.ZodString>;
103
+ assigneeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
104
+ labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
105
+ startDate: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
106
+ dueDate: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
107
+ dependsOn: z.ZodDefault<z.ZodNullable<z.ZodString>>;
108
+ parentTaskId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
109
+ idempotencyKey: z.ZodString;
110
+ }, z.core.$strict>;
111
+ export type BoardTaskCreateInput = z.infer<typeof BoardTaskCreateInput>;
112
+ export declare const BoardTaskUpdateInput: z.ZodObject<{
113
+ taskId: z.ZodString;
114
+ title: z.ZodOptional<z.ZodString>;
115
+ status: z.ZodOptional<z.ZodString>;
116
+ position: z.ZodOptional<z.ZodNumber>;
117
+ assigneeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
+ labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
+ startDate: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
120
+ dueDate: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
121
+ dependsOn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
+ idempotencyKey: z.ZodString;
123
+ }, z.core.$strict>;
124
+ export type BoardTaskUpdateInput = z.infer<typeof BoardTaskUpdateInput>;
125
+ export declare const DirectoryPerson: z.ZodObject<{
126
+ id: z.ZodString;
127
+ name: z.ZodString;
128
+ email: z.ZodEmail;
129
+ isMachine: z.ZodBoolean;
130
+ }, z.core.$strict>;
131
+ export type DirectoryPerson = z.infer<typeof DirectoryPerson>;
132
+ export declare const BoardAssigneeSearchInput: z.ZodObject<{
133
+ boardId: z.ZodString;
134
+ query: z.ZodString;
135
+ }, z.core.$strict>;
136
+ export type BoardAssigneeSearchInput = z.infer<typeof BoardAssigneeSearchInput>;
137
+ export declare const DirectoryResolveInput: z.ZodObject<{
138
+ ids: z.ZodArray<z.ZodString>;
139
+ }, z.core.$strict>;
140
+ export type DirectoryResolveInput = z.infer<typeof DirectoryResolveInput>;
141
+ export declare const DirectoryPersonList: z.ZodObject<{
142
+ items: z.ZodArray<z.ZodObject<{
143
+ id: z.ZodString;
144
+ name: z.ZodString;
145
+ email: z.ZodEmail;
146
+ isMachine: z.ZodBoolean;
147
+ }, z.core.$strict>>;
148
+ more: z.ZodDefault<z.ZodNumber>;
149
+ }, z.core.$strict>;
150
+ export type DirectoryPersonList = z.infer<typeof DirectoryPersonList>;