@primusclaw/personal-agent 0.0.0-stage → 0.1.1

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 (444) hide show
  1. package/dist/LICENSE +37 -0
  2. package/dist/index.js +31875 -0
  3. package/dist/types/approvals/approval-view.d.ts +70 -0
  4. package/dist/types/approvals/click.d.ts +8 -0
  5. package/dist/types/approvals/decide.d.ts +64 -0
  6. package/dist/types/approvals/handler.d.ts +22 -0
  7. package/dist/types/approvals/index.d.ts +9 -0
  8. package/dist/types/approvals/questions.d.ts +36 -0
  9. package/dist/types/approvals/records.d.ts +43 -0
  10. package/dist/types/approvals/sensitive.d.ts +13 -0
  11. package/dist/types/approvals/turn-cards.d.ts +7 -0
  12. package/dist/types/approvals/views.d.ts +67 -0
  13. package/dist/types/assistant/action-handler.d.ts +13 -0
  14. package/dist/types/assistant/actions.d.ts +63 -0
  15. package/dist/types/assistant/auto-reply.d.ts +14 -0
  16. package/dist/types/assistant/board.d.ts +68 -0
  17. package/dist/types/assistant/chat.d.ts +166 -0
  18. package/dist/types/assistant/citation-sources.d.ts +20 -0
  19. package/dist/types/assistant/citations.d.ts +38 -0
  20. package/dist/types/assistant/confirm-outcome.d.ts +11 -0
  21. package/dist/types/assistant/devenv-hide-outcome.d.ts +4 -0
  22. package/dist/types/assistant/events.d.ts +53 -0
  23. package/dist/types/assistant/failures.d.ts +16 -0
  24. package/dist/types/assistant/files.d.ts +37 -0
  25. package/dist/types/assistant/finish.d.ts +8 -0
  26. package/dist/types/assistant/follow.d.ts +75 -0
  27. package/dist/types/assistant/index.d.ts +12 -0
  28. package/dist/types/assistant/informative.d.ts +9 -0
  29. package/dist/types/assistant/item-of.d.ts +2 -0
  30. package/dist/types/assistant/receipt.d.ts +113 -0
  31. package/dist/types/assistant/receipts.d.ts +71 -0
  32. package/dist/types/assistant/say.d.ts +63 -0
  33. package/dist/types/assistant/tracked-stream.d.ts +30 -0
  34. package/dist/types/assistant/turn-in-front.d.ts +25 -0
  35. package/dist/types/assistant/views.d.ts +80 -0
  36. package/dist/types/assistant/watch-clicks.d.ts +34 -0
  37. package/dist/types/assistant/work-clicks.d.ts +53 -0
  38. package/dist/types/assistant/work-handler.d.ts +23 -0
  39. package/dist/types/assistant/work-items.d.ts +66 -0
  40. package/dist/types/branding.d.ts +5 -0
  41. package/dist/types/brief/brief.d.ts +40 -0
  42. package/dist/types/brief/index.d.ts +3 -0
  43. package/dist/types/brief/template.d.ts +8 -0
  44. package/dist/types/capabilities/capability.d.ts +49 -0
  45. package/dist/types/capabilities/command-text.d.ts +11 -0
  46. package/dist/types/capabilities/entries-chat.d.ts +3 -0
  47. package/dist/types/capabilities/entries-notify.d.ts +3 -0
  48. package/dist/types/capabilities/entries-settings.d.ts +3 -0
  49. package/dist/types/capabilities/help.d.ts +24 -0
  50. package/dist/types/capabilities/natural.d.ts +19 -0
  51. package/dist/types/capabilities/phrases.d.ts +42 -0
  52. package/dist/types/capabilities/registry.d.ts +12 -0
  53. package/dist/types/capabilities/sessions-words.d.ts +9 -0
  54. package/dist/types/capabilities/spoken.d.ts +19 -0
  55. package/dist/types/capabilities/visibility.d.ts +32 -0
  56. package/dist/types/claw/credential.d.ts +8 -0
  57. package/dist/types/claw/errors.d.ts +61 -0
  58. package/dist/types/claw/lenient.d.ts +23 -0
  59. package/dist/types/claw/message-text.d.ts +28 -0
  60. package/dist/types/claw/model.d.ts +118 -0
  61. package/dist/types/claw/py-value.d.ts +7 -0
  62. package/dist/types/claw/remote.d.ts +138 -0
  63. package/dist/types/claw/requester-view.d.ts +15 -0
  64. package/dist/types/claw/service-refusal.d.ts +4 -0
  65. package/dist/types/claw/sse.d.ts +12 -0
  66. package/dist/types/claw/started-review.d.ts +7 -0
  67. package/dist/types/claw/work-item.d.ts +25 -0
  68. package/dist/types/commands/agent-args.d.ts +9 -0
  69. package/dist/types/commands/names.d.ts +19 -0
  70. package/dist/types/commands/parse.d.ts +33 -0
  71. package/dist/types/commands/repo.d.ts +17 -0
  72. package/dist/types/config/settings.d.ts +124 -0
  73. package/dist/types/direct-chat/direct-chat.d.ts +73 -0
  74. package/dist/types/direct-chat/index.d.ts +2 -0
  75. package/dist/types/errors.d.ts +15 -0
  76. package/dist/types/feedback/deadline.d.ts +10 -0
  77. package/dist/types/feedback/delivery.d.ts +34 -0
  78. package/dist/types/feedback/exchange.d.ts +19 -0
  79. package/dist/types/feedback/flow.d.ts +36 -0
  80. package/dist/types/feedback/handlers.d.ts +16 -0
  81. package/dist/types/feedback/history.d.ts +20 -0
  82. package/dist/types/feedback/identifiers.d.ts +16 -0
  83. package/dist/types/feedback/index.d.ts +16 -0
  84. package/dist/types/feedback/iso-time.d.ts +2 -0
  85. package/dist/types/feedback/issue-text.d.ts +50 -0
  86. package/dist/types/feedback/log-text.d.ts +13 -0
  87. package/dist/types/feedback/markdown.d.ts +4 -0
  88. package/dist/types/feedback/reporting.d.ts +25 -0
  89. package/dist/types/feedback/scene.d.ts +65 -0
  90. package/dist/types/feedback/service.d.ts +74 -0
  91. package/dist/types/feedback/thumbs.d.ts +59 -0
  92. package/dist/types/feedback/views.d.ts +35 -0
  93. package/dist/types/guardrails/correlation.d.ts +8 -0
  94. package/dist/types/guardrails/guardrails.d.ts +49 -0
  95. package/dist/types/guardrails/index.d.ts +4 -0
  96. package/dist/types/guardrails/operations.d.ts +22 -0
  97. package/dist/types/guardrails/sha256.d.ts +1 -0
  98. package/dist/types/inbound-text/index.d.ts +9 -0
  99. package/dist/types/inbound-text/marked-text.d.ts +20 -0
  100. package/dist/types/inbound-text/quote-block.d.ts +26 -0
  101. package/dist/types/inbound-text/redact.d.ts +8 -0
  102. package/dist/types/inbound-text/when.d.ts +2 -0
  103. package/dist/types/inbound-text/with-links.d.ts +20 -0
  104. package/dist/types/index.d.ts +73 -0
  105. package/dist/types/json.d.ts +5 -0
  106. package/dist/types/language/detect.d.ts +21 -0
  107. package/dist/types/limits/inbound-stats.d.ts +42 -0
  108. package/dist/types/limits/index.d.ts +5 -0
  109. package/dist/types/limits/rate-limiter.d.ts +32 -0
  110. package/dist/types/limits/user-limits.d.ts +18 -0
  111. package/dist/types/limits/wait-words.d.ts +3 -0
  112. package/dist/types/locales/account.d.ts +49 -0
  113. package/dist/types/locales/approval-decisions.d.ts +28 -0
  114. package/dist/types/locales/approval.d.ts +31 -0
  115. package/dist/types/locales/assistant-actions.d.ts +65 -0
  116. package/dist/types/locales/assistant-board.d.ts +14 -0
  117. package/dist/types/locales/assistant-cards.d.ts +81 -0
  118. package/dist/types/locales/assistant-chat.d.ts +13 -0
  119. package/dist/types/locales/assistant-devenv-hide.d.ts +23 -0
  120. package/dist/types/locales/assistant-work-clicks.d.ts +98 -0
  121. package/dist/types/locales/assistant.d.ts +5 -0
  122. package/dist/types/locales/brief.d.ts +29 -0
  123. package/dist/types/locales/catalog.d.ts +24 -0
  124. package/dist/types/locales/claw.d.ts +5 -0
  125. package/dist/types/locales/commands.d.ts +12 -0
  126. package/dist/types/locales/connector-reasons.d.ts +95 -0
  127. package/dist/types/locales/connector-setup.d.ts +20 -0
  128. package/dist/types/locales/feedback.d.ts +75 -0
  129. package/dist/types/locales/group.d.ts +33 -0
  130. package/dist/types/locales/guardrails.d.ts +22 -0
  131. package/dist/types/locales/help-lead.d.ts +15 -0
  132. package/dist/types/locales/index.d.ts +16 -0
  133. package/dist/types/locales/lang.d.ts +9 -0
  134. package/dist/types/locales/limits.d.ts +19 -0
  135. package/dist/types/locales/link.d.ts +40 -0
  136. package/dist/types/locales/observe.d.ts +113 -0
  137. package/dist/types/locales/proactive-lines.d.ts +12 -0
  138. package/dist/types/locales/proactive.d.ts +62 -0
  139. package/dist/types/locales/remote-agents.d.ts +216 -0
  140. package/dist/types/locales/remote-leads.d.ts +13 -0
  141. package/dist/types/locales/remote-window-card.d.ts +46 -0
  142. package/dist/types/locales/remote-window.d.ts +21 -0
  143. package/dist/types/locales/remote.d.ts +365 -0
  144. package/dist/types/locales/review-account.d.ts +43 -0
  145. package/dist/types/locales/review-github.d.ts +19 -0
  146. package/dist/types/locales/review-receipt.d.ts +45 -0
  147. package/dist/types/locales/review-request.d.ts +21 -0
  148. package/dist/types/locales/review-start.d.ts +46 -0
  149. package/dist/types/locales/routing.d.ts +21 -0
  150. package/dist/types/locales/sessions.d.ts +38 -0
  151. package/dist/types/locales/settings.d.ts +46 -0
  152. package/dist/types/locales/steps.d.ts +42 -0
  153. package/dist/types/locales/transparency.d.ts +18 -0
  154. package/dist/types/locales/turn.d.ts +70 -0
  155. package/dist/types/locales/typed-answer.d.ts +32 -0
  156. package/dist/types/note/note.d.ts +22 -0
  157. package/dist/types/observability/ip-address.d.ts +13 -0
  158. package/dist/types/observability/metrics-catalog.d.ts +17 -0
  159. package/dist/types/observability/security-events.d.ts +26 -0
  160. package/dist/types/observability/security-fields.d.ts +8 -0
  161. package/dist/types/observability/security-log.d.ts +21 -0
  162. package/dist/types/observe/board.d.ts +18 -0
  163. package/dist/types/observe/command.d.ts +6 -0
  164. package/dist/types/observe/index.d.ts +6 -0
  165. package/dist/types/observe/observer.d.ts +45 -0
  166. package/dist/types/observe/suggestions.d.ts +16 -0
  167. package/dist/types/observe/views.d.ts +19 -0
  168. package/dist/types/own.d.ts +9 -0
  169. package/dist/types/plugins/feedback-sink.d.ts +31 -0
  170. package/dist/types/plugins/identity-lookup.d.ts +21 -0
  171. package/dist/types/plugins/index.d.ts +31 -0
  172. package/dist/types/plugins/integrations.d.ts +34 -0
  173. package/dist/types/plugins/key-revoker.d.ts +10 -0
  174. package/dist/types/plugins/model-refusal-policy.d.ts +25 -0
  175. package/dist/types/plugins/route-extension.d.ts +27 -0
  176. package/dist/types/plugins/token-exchange.d.ts +36 -0
  177. package/dist/types/ports/claw/assistant.d.ts +55 -0
  178. package/dist/types/ports/claw/index.d.ts +28 -0
  179. package/dist/types/ports/claw/remote-agents.d.ts +53 -0
  180. package/dist/types/ports/claw/sessions.d.ts +105 -0
  181. package/dist/types/ports/claw/settings.d.ts +62 -0
  182. package/dist/types/ports/claw/work-items.d.ts +32 -0
  183. package/dist/types/ports/clock.d.ts +17 -0
  184. package/dist/types/ports/crypto.d.ts +15 -0
  185. package/dist/types/ports/github.d.ts +97 -0
  186. package/dist/types/ports/index.d.ts +18 -0
  187. package/dist/types/ports/logger.d.ts +19 -0
  188. package/dist/types/ports/metrics.d.ts +21 -0
  189. package/dist/types/ports/random.d.ts +15 -0
  190. package/dist/types/ports/request-scope.d.ts +31 -0
  191. package/dist/types/ports/routing.d.ts +107 -0
  192. package/dist/types/ports/secret-source.d.ts +21 -0
  193. package/dist/types/ports/store/approvals.d.ts +47 -0
  194. package/dist/types/ports/store/assistant.d.ts +104 -0
  195. package/dist/types/ports/store/feedback.d.ts +80 -0
  196. package/dist/types/ports/store/github.d.ts +81 -0
  197. package/dist/types/ports/store/idempotency.d.ts +21 -0
  198. package/dist/types/ports/store/index.d.ts +65 -0
  199. package/dist/types/ports/store/json.d.ts +4 -0
  200. package/dist/types/ports/store/link.d.ts +39 -0
  201. package/dist/types/ports/store/notify.d.ts +28 -0
  202. package/dist/types/ports/store/observe.d.ts +53 -0
  203. package/dist/types/ports/store/onboarding.d.ts +49 -0
  204. package/dist/types/ports/store/people.d.ts +77 -0
  205. package/dist/types/ports/store/policy.d.ts +60 -0
  206. package/dist/types/ports/store/remote.d.ts +114 -0
  207. package/dist/types/ports/store/sessions.d.ts +59 -0
  208. package/dist/types/ports/store/turns.d.ts +30 -0
  209. package/dist/types/ports/surface.d.ts +394 -0
  210. package/dist/types/ports/turn-cards.d.ts +52 -0
  211. package/dist/types/proactive/deliver.d.ts +52 -0
  212. package/dist/types/proactive/deps.d.ts +77 -0
  213. package/dist/types/proactive/events.d.ts +10 -0
  214. package/dist/types/proactive/index.d.ts +6 -0
  215. package/dist/types/proactive/proactive.d.ts +62 -0
  216. package/dist/types/proactive/quiet.d.ts +27 -0
  217. package/dist/types/proactive/release.d.ts +24 -0
  218. package/dist/types/proactive/said-memory.d.ts +21 -0
  219. package/dist/types/proactive/views.d.ts +67 -0
  220. package/dist/types/protocol/claw-api/assistant-events.d.ts +223 -0
  221. package/dist/types/protocol/claw-api/index.d.ts +5 -0
  222. package/dist/types/protocol/claw-api/notifications.d.ts +85 -0
  223. package/dist/types/protocol/claw-api/reviews.d.ts +63 -0
  224. package/dist/types/protocol/claw-api/session-events.d.ts +34 -0
  225. package/dist/types/protocol/claw-api/work-items.d.ts +75 -0
  226. package/dist/types/protocol/remote-agents.d.ts +230 -0
  227. package/dist/types/protocol.d.ts +10 -0
  228. package/dist/types/public-error/classify.d.ts +21 -0
  229. package/dist/types/public-error/index.d.ts +4 -0
  230. package/dist/types/public-error/patterns.d.ts +20 -0
  231. package/dist/types/public-error/public-error-log.d.ts +15 -0
  232. package/dist/types/public-error/public-errors.d.ts +20 -0
  233. package/dist/types/remote/actions.d.ts +36 -0
  234. package/dist/types/remote/agents.d.ts +37 -0
  235. package/dist/types/remote/answer.d.ts +9 -0
  236. package/dist/types/remote/board.d.ts +108 -0
  237. package/dist/types/remote/cards.d.ts +4 -0
  238. package/dist/types/remote/chat-key.d.ts +13 -0
  239. package/dist/types/remote/chats.d.ts +76 -0
  240. package/dist/types/remote/clicks-machine.d.ts +24 -0
  241. package/dist/types/remote/clicks-start.d.ts +36 -0
  242. package/dist/types/remote/clicks.d.ts +61 -0
  243. package/dist/types/remote/commands.d.ts +60 -0
  244. package/dist/types/remote/connector/reasons.d.ts +31 -0
  245. package/dist/types/remote/connector/setup.d.ts +62 -0
  246. package/dist/types/remote/context.d.ts +101 -0
  247. package/dist/types/remote/conversations.d.ts +37 -0
  248. package/dist/types/remote/ended.d.ts +25 -0
  249. package/dist/types/remote/events.d.ts +65 -0
  250. package/dist/types/remote/fields.d.ts +7 -0
  251. package/dist/types/remote/follow/control.d.ts +39 -0
  252. package/dist/types/remote/follow/follower.d.ts +85 -0
  253. package/dist/types/remote/follow/inbox.d.ts +16 -0
  254. package/dist/types/remote/follow/speaker.d.ts +122 -0
  255. package/dist/types/remote/follow/steps.d.ts +9 -0
  256. package/dist/types/remote/follow/timings.d.ts +29 -0
  257. package/dist/types/remote/health.d.ts +20 -0
  258. package/dist/types/remote/index.d.ts +21 -0
  259. package/dist/types/remote/inert.d.ts +18 -0
  260. package/dist/types/remote/limits.d.ts +48 -0
  261. package/dist/types/remote/lines.d.ts +66 -0
  262. package/dist/types/remote/links/answer.d.ts +7 -0
  263. package/dist/types/remote/links/domains.d.ts +19 -0
  264. package/dist/types/remote/links/hosts.d.ts +2 -0
  265. package/dist/types/remote/links/scans.d.ts +27 -0
  266. package/dist/types/remote/listing.d.ts +38 -0
  267. package/dist/types/remote/lists.d.ts +56 -0
  268. package/dist/types/remote/machines.d.ts +54 -0
  269. package/dist/types/remote/marks.d.ts +5 -0
  270. package/dist/types/remote/model.d.ts +51 -0
  271. package/dist/types/remote/options.d.ts +20 -0
  272. package/dist/types/remote/permissions.d.ts +41 -0
  273. package/dist/types/remote/ports.d.ts +143 -0
  274. package/dist/types/remote/prompt.d.ts +60 -0
  275. package/dist/types/remote/refusals.d.ts +40 -0
  276. package/dist/types/remote/remote-agents.d.ts +84 -0
  277. package/dist/types/remote/reported.d.ts +8 -0
  278. package/dist/types/remote/session-ops.d.ts +57 -0
  279. package/dist/types/remote/sessions.d.ts +80 -0
  280. package/dist/types/remote/setup.d.ts +26 -0
  281. package/dist/types/remote/state.d.ts +55 -0
  282. package/dist/types/remote/tail.d.ts +63 -0
  283. package/dist/types/remote/targets.d.ts +66 -0
  284. package/dist/types/remote/tasks.d.ts +20 -0
  285. package/dist/types/remote/time.d.ts +15 -0
  286. package/dist/types/remote/turn-state.d.ts +29 -0
  287. package/dist/types/remote/turns/chat-turn.d.ts +50 -0
  288. package/dist/types/remote/turns/display.d.ts +18 -0
  289. package/dist/types/remote/turns/outcome.d.ts +41 -0
  290. package/dist/types/remote/turns/runner.d.ts +55 -0
  291. package/dist/types/remote/turns/signer.d.ts +14 -0
  292. package/dist/types/remote/turns/window-turn.d.ts +29 -0
  293. package/dist/types/remote/views.d.ts +13 -0
  294. package/dist/types/remote/watches.d.ts +64 -0
  295. package/dist/types/remote/window/closer.d.ts +14 -0
  296. package/dist/types/remote/window/index.d.ts +2 -0
  297. package/dist/types/remote/window/output.d.ts +28 -0
  298. package/dist/types/remote/window/view.d.ts +73 -0
  299. package/dist/types/remote-view/agents-view.d.ts +88 -0
  300. package/dist/types/remote-view/conversations-view.d.ts +51 -0
  301. package/dist/types/remote-view/hidden-view.d.ts +20 -0
  302. package/dist/types/remote-view/index.d.ts +40 -0
  303. package/dist/types/remote-view/live-view.d.ts +44 -0
  304. package/dist/types/remote-view/machine-views.d.ts +73 -0
  305. package/dist/types/remote-view/messages.d.ts +3 -0
  306. package/dist/types/remote-view/permission-view.d.ts +55 -0
  307. package/dist/types/remote-view/sessions-view.d.ts +70 -0
  308. package/dist/types/remote-view/status-view.d.ts +52 -0
  309. package/dist/types/remote-view/window-view.d.ts +68 -0
  310. package/dist/types/result.d.ts +31 -0
  311. package/dist/types/review/connect/connections.d.ts +24 -0
  312. package/dist/types/review/connect/github-connect.d.ts +50 -0
  313. package/dist/types/review/connect/questions.d.ts +6 -0
  314. package/dist/types/review/connect/review-ask.d.ts +1 -0
  315. package/dist/types/review/consent.d.ts +13 -0
  316. package/dist/types/review/handoff.d.ts +22 -0
  317. package/dist/types/review/held.d.ts +15 -0
  318. package/dist/types/review/index.d.ts +14 -0
  319. package/dist/types/review/intent-check.d.ts +36 -0
  320. package/dist/types/review/outcome.d.ts +36 -0
  321. package/dist/types/review/progress.d.ts +50 -0
  322. package/dist/types/review/prompts.d.ts +2 -0
  323. package/dist/types/review/receipt.d.ts +45 -0
  324. package/dist/types/review/refusals.d.ts +44 -0
  325. package/dist/types/review/request-parse.d.ts +40 -0
  326. package/dist/types/review/review-turn.d.ts +83 -0
  327. package/dist/types/review/service/account.d.ts +52 -0
  328. package/dist/types/review/service/chat.d.ts +18 -0
  329. package/dist/types/review/service/confirm.d.ts +49 -0
  330. package/dist/types/review/service/deps.d.ts +100 -0
  331. package/dist/types/review/service/follow.d.ts +53 -0
  332. package/dist/types/review/service/github-review.d.ts +72 -0
  333. package/dist/types/review/service/handoff-action.d.ts +32 -0
  334. package/dist/types/review/service/identity.d.ts +27 -0
  335. package/dist/types/review/service/item-cards.d.ts +39 -0
  336. package/dist/types/review/service/items.d.ts +57 -0
  337. package/dist/types/review/service/launch.d.ts +37 -0
  338. package/dist/types/review/service/notices.d.ts +42 -0
  339. package/dist/types/review/service/request.d.ts +58 -0
  340. package/dist/types/review/service/reviewer.d.ts +48 -0
  341. package/dist/types/review/service/routed-turn.d.ts +20 -0
  342. package/dist/types/review/service/start.d.ts +65 -0
  343. package/dist/types/review/service/turns.d.ts +38 -0
  344. package/dist/types/review/summary.d.ts +11 -0
  345. package/dist/types/review/views.d.ts +91 -0
  346. package/dist/types/review-text/asks.d.ts +13 -0
  347. package/dist/types/review-text/bare-numbers.d.ts +29 -0
  348. package/dist/types/review-text/index.d.ts +10 -0
  349. package/dist/types/review-text/markers.d.ts +6 -0
  350. package/dist/types/review-text/names.d.ts +60 -0
  351. package/dist/types/review-text/pull-ref.d.ts +25 -0
  352. package/dist/types/review-text/text/scan.d.ts +19 -0
  353. package/dist/types/review-text/text/unicode.d.ts +22 -0
  354. package/dist/types/routing/admission.d.ts +83 -0
  355. package/dist/types/routing/chat.d.ts +52 -0
  356. package/dist/types/routing/command-table.d.ts +32 -0
  357. package/dist/types/routing/commands-account.d.ts +26 -0
  358. package/dist/types/routing/commands-session.d.ts +40 -0
  359. package/dist/types/routing/commands-settings.d.ts +17 -0
  360. package/dist/types/routing/context.d.ts +38 -0
  361. package/dist/types/routing/credentials.d.ts +53 -0
  362. package/dist/types/routing/deps.d.ts +116 -0
  363. package/dist/types/routing/features.d.ts +256 -0
  364. package/dist/types/routing/group-remote.d.ts +26 -0
  365. package/dist/types/routing/group-router.d.ts +42 -0
  366. package/dist/types/routing/identity.d.ts +18 -0
  367. package/dist/types/routing/index.d.ts +26 -0
  368. package/dist/types/routing/link-commands.d.ts +26 -0
  369. package/dist/types/routing/lock.d.ts +5 -0
  370. package/dist/types/routing/onboarding.d.ts +51 -0
  371. package/dist/types/routing/personal-router.d.ts +34 -0
  372. package/dist/types/routing/personal-text.d.ts +62 -0
  373. package/dist/types/routing/router.d.ts +57 -0
  374. package/dist/types/routing/show-here.d.ts +18 -0
  375. package/dist/types/routing/stop-press.d.ts +19 -0
  376. package/dist/types/routing/time.d.ts +31 -0
  377. package/dist/types/routing/turn-registry.d.ts +71 -0
  378. package/dist/types/routing/turn-runner.d.ts +82 -0
  379. package/dist/types/routing/turn-start.d.ts +81 -0
  380. package/dist/types/routing/views.d.ts +104 -0
  381. package/dist/types/security/redact-scan.d.ts +19 -0
  382. package/dist/types/security/redact-text.d.ts +14 -0
  383. package/dist/types/security/redact.d.ts +2 -0
  384. package/dist/types/subscriptions/event-types.d.ts +29 -0
  385. package/dist/types/subscriptions/index.d.ts +3 -0
  386. package/dist/types/subscriptions/ports.d.ts +9 -0
  387. package/dist/types/subscriptions/subscriptions.d.ts +69 -0
  388. package/dist/types/text/neutral.d.ts +1 -0
  389. package/dist/types/text/plain.d.ts +6 -0
  390. package/dist/types/text/py-chars.d.ts +12 -0
  391. package/dist/types/text/py-json.d.ts +23 -0
  392. package/dist/types/text/py-number.d.ts +18 -0
  393. package/dist/types/text/py-regex-escapes.d.ts +32 -0
  394. package/dist/types/text/py-regex.d.ts +36 -0
  395. package/dist/types/text/py-text.d.ts +64 -0
  396. package/dist/types/turn/answer-parts.d.ts +23 -0
  397. package/dist/types/turn/changes.d.ts +42 -0
  398. package/dist/types/turn/clip.d.ts +6 -0
  399. package/dist/types/turn/deliveries.d.ts +31 -0
  400. package/dist/types/turn/engine/claw-errors.d.ts +7 -0
  401. package/dist/types/turn/engine/consume.d.ts +35 -0
  402. package/dist/types/turn/engine/context.d.ts +157 -0
  403. package/dist/types/turn/engine/extras.d.ts +16 -0
  404. package/dist/types/turn/engine/fallback.d.ts +17 -0
  405. package/dist/types/turn/engine/outcome.d.ts +33 -0
  406. package/dist/types/turn/engine/run-turn.d.ts +22 -0
  407. package/dist/types/turn/engine/submit.d.ts +23 -0
  408. package/dist/types/turn/files.d.ts +10 -0
  409. package/dist/types/turn/github-outcome.d.ts +16 -0
  410. package/dist/types/turn/index.d.ts +26 -0
  411. package/dist/types/turn/json.d.ts +10 -0
  412. package/dist/types/turn/last-answer.d.ts +44 -0
  413. package/dist/types/turn/live-view.d.ts +67 -0
  414. package/dist/types/turn/plan.d.ts +31 -0
  415. package/dist/types/turn/ports.d.ts +15 -0
  416. package/dist/types/turn/progress/answer-messages.d.ts +20 -0
  417. package/dist/types/turn/progress/status-message.d.ts +144 -0
  418. package/dist/types/turn/progress/status-policy.d.ts +66 -0
  419. package/dist/types/turn/progress/status-text.d.ts +10 -0
  420. package/dist/types/turn/progress/stream-handle.d.ts +39 -0
  421. package/dist/types/turn/records.d.ts +10 -0
  422. package/dist/types/turn/runner.d.ts +106 -0
  423. package/dist/types/turn/step-labels.d.ts +28 -0
  424. package/dist/types/turn/step.d.ts +26 -0
  425. package/dist/types/turn/stop-buttons.d.ts +62 -0
  426. package/dist/types/turn/task.d.ts +33 -0
  427. package/dist/types/turn/turn-state.d.ts +70 -0
  428. package/dist/types/turn/views.d.ts +23 -0
  429. package/dist/types/typed-answer/index.d.ts +8 -0
  430. package/dist/types/typed-answer/mode.d.ts +38 -0
  431. package/dist/types/typed-answer/patterns.d.ts +25 -0
  432. package/dist/types/typed-answer/prompt.d.ts +5 -0
  433. package/dist/types/typed-answer/read.d.ts +16 -0
  434. package/dist/types/understanding/commands.d.ts +14 -0
  435. package/dist/types/understanding/context.d.ts +49 -0
  436. package/dist/types/understanding/index.d.ts +11 -0
  437. package/dist/types/understanding/limits.d.ts +6 -0
  438. package/dist/types/understanding/people.d.ts +31 -0
  439. package/dist/types/understanding/record.d.ts +10 -0
  440. package/dist/types/understanding/review-stop.d.ts +7 -0
  441. package/dist/types/understanding/sequence-matcher.d.ts +7 -0
  442. package/dist/types/validate.d.ts +15 -0
  443. package/package.json +35 -4
  444. package/README.md +0 -3
@@ -0,0 +1,42 @@
1
+ /** A label: `one` for a step, `many` for the same step repeated ("Reading files (3)"); Chinese has one form. */
2
+ export declare const stepText: import("./catalog.js").Catalog<{
3
+ read: string;
4
+ reads: string;
5
+ edit: string;
6
+ edits: string;
7
+ shell: string;
8
+ shells: string;
9
+ search: string;
10
+ web: string;
11
+ task: string;
12
+ tasks: string;
13
+ boardRead: string;
14
+ boardReads: string;
15
+ safe: string;
16
+ boardList: (p: {
17
+ what: string;
18
+ }) => string;
19
+ /** "Listing board issues" names what is listed in English. */
20
+ boardListWhat: (p: {
21
+ verb: string;
22
+ }) => string;
23
+ skill: (p: {
24
+ skill: string;
25
+ }) => string;
26
+ generic: (p: {
27
+ what: string;
28
+ }) => string;
29
+ failed: (p: {
30
+ label: string;
31
+ }) => string;
32
+ safeQuery: (p: {
33
+ what: string;
34
+ }) => string;
35
+ query: (p: {
36
+ server: string;
37
+ }) => string;
38
+ }>;
39
+ /** What a SaFE read is about, by the first word of its name (`node_list` -> nodes): (English, Chinese). */
40
+ export declare const SAFE_OBJECTS: Readonly<Record<string, readonly [string, string]>>;
41
+ /** The assistant's own tools (`mcp__assistant__*`), by what the person sees it do: (English, Chinese). */
42
+ export declare const ASSISTANT_STEPS: Readonly<Record<string, readonly [string, string]>>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * What the bot tells people about its answers and their data (security review). One place for the wording, so that help, the first
3
+ * 1:1 message and the connect cards say the same thing. Each text is plain and short so it translates line by line.
4
+ *
5
+ * The numbers were checked against the code and the live configuration: the worker keeps its copy of a delivered problem report for
6
+ * 30 days (the store's feedback retention); Claw keeps a session until its owner deletes it; database backups go back about a week.
7
+ * A change to any of these is a change to this text.
8
+ */
9
+ import { type Lang } from "./lang.js";
10
+ /** One text in each language. */
11
+ export type Phrase = Readonly<Record<Lang, string>>;
12
+ export declare const AI_NOTICE: Phrase;
13
+ export declare const DATA_TITLE: Phrase;
14
+ export declare const DATA_LINES: Readonly<Record<Lang, readonly string[]>>;
15
+ /** Only where remote agents are on (a 1:1 chat): an attached chat's messages go to the person's own machine, not to PrimusClaw. */
16
+ export declare const REMOTE_LINE: Phrase;
17
+ /** The section of help about answers and data, in `lang`; `remote`: remote agents are on in this chat. */
18
+ export declare function dataStatement(lang: string, remote?: boolean): string;
@@ -0,0 +1,70 @@
1
+ import type { SuggestedReply } from "../ports/surface.js";
2
+ import type { Lang } from "./lang.js";
3
+ /** Said in the person's language. */
4
+ export declare const turnText: import("./catalog.js").Catalog<{
5
+ /** The progress message's first line. */
6
+ liveHeader: string;
7
+ preparing: string;
8
+ planHead: (p: {
9
+ done: number;
10
+ total: number;
11
+ }) => string;
12
+ planAllDone: (p: {
13
+ total: number;
14
+ }) => string;
15
+ planMore: (p: {
16
+ n: number;
17
+ done: number;
18
+ todo: number;
19
+ }) => string;
20
+ /** A floating status before anything happened. */
21
+ thinking: string;
22
+ /** A turn still running when its stream has to close: the answer follows as a message of its own. */
23
+ stillWorking: string;
24
+ interrupted: string;
25
+ /** The final message of a stream whose turn ended with nothing to say (it is never empty). */
26
+ doneShort: string;
27
+ /** What a failed turn says; the error itself, and its reference, go to the log only. */
28
+ taskFailed: string;
29
+ openSession: string;
30
+ queuedNotice: string;
31
+ stillRunning: (p: {
32
+ minutes: number;
33
+ }) => string;
34
+ stillRunningNotify: string;
35
+ stillRunningOpen: string;
36
+ }>;
37
+ /** Suggested replies under a finished answer in a 1:1 chat: what the button says, and what it sends. */
38
+ export declare const SUGGESTED_REPLIES: Readonly<Record<Lang, readonly SuggestedReply[]>>;
39
+ /** Said in English in every chat (the Python worker has them in English only). */
40
+ export declare const turnEnglish: {
41
+ /** The one line the progress message is edited down to where it cannot be deleted. */
42
+ readonly doneLine: "Done — answer below";
43
+ readonly noTextOutput: "Done. There was no text output.";
44
+ readonly shortened: "... (shortened)";
45
+ readonly openFullAnswer: "Open the full answer";
46
+ readonly onlyTheAsker: " (only the person who asked can open it)";
47
+ readonly wholeCutNote: "\n\n… (the rest did not fit in three messages)";
48
+ readonly couldNotLoad: (name: string, count: number) => string;
49
+ readonly stopped: "Stopped.";
50
+ readonly lostConnection: "I lost the connection to PrimusClaw before the task finished.";
51
+ readonly openSessionLink: "Open the session";
52
+ readonly keyRejected: "PrimusClaw rejected your linked key (it may have expired or been deleted). Send /unlink, then link again.";
53
+ readonly clawBusy: "PrimusClaw is busy right now. Please try again in a minute.";
54
+ readonly clawRequestFailed: (status: number, ref: string) => string;
55
+ readonly nothingStarted: "Nothing was started.";
56
+ /** Both languages in one line: the group of a review is told, whatever its language. */
57
+ readonly reviewRefused: "没能开始 review:请求人的 PrimusClaw 凭据没有被接受,我已私信请求人说明。 / The review did not start: PrimusClaw did not accept the asker's credentials; I told them in their own chat.";
58
+ readonly filesNotPassed: (list: string) => string;
59
+ readonly anImage: "an image";
60
+ readonly aFile: "a file";
61
+ readonly filesNotTaken: "this worker does not take files";
62
+ readonly clawDidNotTake: "Claw did not take it";
63
+ readonly deliveryLine: (name: string, size: string, caption: string, url: string) => string;
64
+ };
65
+ /** The Stop card of a turn from a phone (stop_button.py); what a press is answered with is in locales/routing.ts. */
66
+ export declare const stopText: import("./catalog.js").Catalog<{
67
+ card: string;
68
+ button: string;
69
+ notChecked: string;
70
+ }>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * What a typed answer is asked back with (`typed-answer/`). Each says it in Chinese and English at once, in one
3
+ * message: a typed answer comes from a person whose language this agent has not settled, so both are written, as the
4
+ * Python worker wrote them.
5
+ */
6
+ export declare const typedAnswerText: {
7
+ readonly nothingWaits: "现在没有在等你确认的合入或 review(可能已经处理过,或已过期)。 / Nothing is waiting for your confirmation now.";
8
+ readonly notWaiting: (p: {
9
+ name: string;
10
+ listing: string;
11
+ }) => string;
12
+ readonly whichRepo: (p: {
13
+ name: string;
14
+ count: number;
15
+ listing: string;
16
+ repo: string;
17
+ number: number;
18
+ }) => string;
19
+ readonly which: (p: {
20
+ listing: string;
21
+ first: number;
22
+ }) => string;
23
+ readonly heldTwice: (p: {
24
+ pull: string;
25
+ held: string;
26
+ pr: number;
27
+ }) => string;
28
+ readonly heldMerge: "合入";
29
+ readonly heldReview: (p: {
30
+ event: string;
31
+ }) => string;
32
+ };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A short note, under an optional headline, with the buttons that go with it: what replaces a card the person just
3
+ * clicked (the outcome of the click, and the buttons again when it has to be repeated), and any other "a line and a
4
+ * button" message (render.py's note_card). Every line uses this view for that shape.
5
+ */
6
+ import type { OutMessage, ViewButton } from "../ports/surface.js";
7
+ /** How the note's headline reads: its colour and its emoji. */
8
+ export type NoteTone = "default" | "good" | "attention" | "warning" | "accent";
9
+ export interface NoteModel {
10
+ readonly text: string;
11
+ /** A headline over the note (none: the note alone). */
12
+ readonly title?: string;
13
+ readonly tone?: NoteTone;
14
+ readonly buttons?: readonly ViewButton[];
15
+ }
16
+ declare module "../ports/surface.js" {
17
+ interface ViewMap {
18
+ note: NoteModel;
19
+ }
20
+ }
21
+ /** The note as a message; a client that cannot draw it shows its text. */
22
+ export declare function noteMessage(model: NoteModel): OutMessage;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * IP addresses parsed and written the way Python's `ipaddress.ip_address` and `str()` do (core cannot use `node:net`,
3
+ * and the logged form has to stay the one SIEM rules were written against): strict dotted IPv4 (no leading zeros), IPv6
4
+ * with at most one `::` and an optional dotted IPv4 tail, written lower-case with the first longest run of two or more
5
+ * zero groups compressed, and an IPv4-mapped address as `::ffff:a.b.c.d`. No scope id (`%zone`).
6
+ */
7
+ /** An address as Python writes it, and, for an IPv4-mapped IPv6 address, the IPv4 address it maps. */
8
+ export interface IpAddress {
9
+ readonly address: string;
10
+ readonly mappedV4: string | null;
11
+ }
12
+ /** `text` as an IP address the way Python's `ipaddress` reads and writes it, or null when it is not one. */
13
+ export declare function parseIpAddress(text: string): IpAddress | null;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The closed lists every metric label value comes from, so the number of series is fixed and no label names a person,
3
+ * a conversation or anything a person chose.
4
+ */
5
+ /** The category fields of a security event that become labels of `clawy_security_events_total`, in this order. */
6
+ export declare const SECURITY_EVENT_LABELS: readonly ["scope", "outcome", "reason"];
7
+ /** Why a message or task was refused by a per-person limit. */
8
+ export declare const LIMIT_REASONS: readonly ["user_limit", "concurrency_limit"];
9
+ export type LimitReason = (typeof LIMIT_REASONS)[number];
10
+ /** The event types from Claw that are labels as themselves; any other is counted as "other". */
11
+ export declare const DELIVERED_EVENT_TYPES: readonly ["approval.requested", "work_item.needs_you", "assistant.say", "assistant.action", "run.completed", "run.failed", "other"];
12
+ /**
13
+ * Where a file a person sent did not reach Claw: the assistant path, a session turn, a chat attached to a remote agent,
14
+ * a review request, and a file the channel gave no way to fetch. Every one is also said to the person.
15
+ */
16
+ export declare const FILES_DROPPED_PATHS: readonly ["assistant", "session", "remote_agent", "review", "unreadable"];
17
+ export type FilesDroppedPath = (typeof FILES_DROPPED_PATHS)[number];
@@ -0,0 +1,26 @@
1
+ /** The security events, their log levels (a closed list: SIEM rules match on these names). */
2
+ export declare const SECURITY_EVENTS: {
3
+ readonly link_attempt: "info";
4
+ readonly link_lockout: "warn";
5
+ readonly token_rejected: "warn";
6
+ readonly approval_answered: "info";
7
+ readonly merge_confirmed: "info";
8
+ readonly pr_merged: "info";
9
+ readonly rate_limited: "warn";
10
+ readonly key_unlinked: "info";
11
+ readonly on_behalf_message: "info";
12
+ };
13
+ export type SecurityEventName = keyof typeof SECURITY_EVENTS;
14
+ /** One logged security event: `event` first, then only allow-listed, shape-checked fields, and `dropped` field names. */
15
+ export type SecurityEventRecord = Readonly<{
16
+ event: SecurityEventName;
17
+ dropped?: readonly string[];
18
+ } & Record<string, unknown>>;
19
+ /** What the log of security events is called (the Python worker's logger name, which SIEM rules select on). */
20
+ export declare const SECURITY_LOGGER = "clawy.security";
21
+ /**
22
+ * The record of one security event. `event` must be one of SECURITY_EVENTS (anything else is a bug: InvariantError). A
23
+ * field whose value is null or undefined is left out. A field whose value does not fit its shape is dropped and its
24
+ * name listed in `dropped`; a field that is not one of SECURITY_FIELDS is listed as `<unknown_field>` (its name could be text).
25
+ */
26
+ export declare function securityEventRecord(event: SecurityEventName, fields?: Readonly<Record<string, unknown>>): SecurityEventRecord;
@@ -0,0 +1,8 @@
1
+ /** A field's check: the value to log, or undefined when it must not be logged. */
2
+ export type FieldCheck = (value: unknown) => unknown;
3
+ /** Whether `value` holds a `/link` code, as printed, as typed or inside a longer value. */
4
+ export declare function holdsALinkCode(value: string): boolean;
5
+ /** Category field -> the values it takes. Categories are chosen by the code, never by a person. */
6
+ export declare const SECURITY_FIELD_CATEGORIES: Readonly<Record<string, ReadonlySet<string>>>;
7
+ /** Field name -> its check. */
8
+ export declare const SECURITY_FIELDS: Readonly<Record<string, FieldCheck>>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Security events: one structured log line per security-relevant decision, for SIEM detection rules, counted into the
3
+ * metrics as well. The line's message is the record as compact JSON whose first key is `event` (the same line the Python
4
+ * worker wrote), on the logger named SECURITY_LOGGER.
5
+ */
6
+ import type { Logger } from "../ports/logger.js";
7
+ import type { MetricsPort } from "../ports/metrics.js";
8
+ import { type RequestScope } from "../ports/request-scope.js";
9
+ import { type SecurityEventName, type SecurityEventRecord } from "./security-events.js";
10
+ export declare class SecurityLog {
11
+ private readonly metrics;
12
+ private readonly scope;
13
+ private readonly log;
14
+ constructor(logger: Logger, metrics: MetricsPort, scope?: RequestScope);
15
+ /**
16
+ * Logs and counts one security event; the record that was logged (see `securityEventRecord`). A caller that names no
17
+ * `activity_id` gets the activity being handled, after its own fields; one that names it, even as null, keeps its own
18
+ * (Python guardrails.audit).
19
+ */
20
+ event(event: SecurityEventName, fields?: Readonly<Record<string, unknown>>): SecurityEventRecord;
21
+ }
@@ -0,0 +1,18 @@
1
+ import type { ClawAssistantPort } from "../ports/claw/assistant.js";
2
+ import type { Logger } from "../ports/logger.js";
3
+ import type { ObserveRepository } from "../ports/store/observe.js";
4
+ import { type Conversation } from "../ports/surface.js";
5
+ export interface BoardDeps {
6
+ readonly observe: ObserveRepository;
7
+ readonly assistant: Pick<ClawAssistantPort, "observations">;
8
+ readonly log: Logger;
9
+ }
10
+ export declare class ObserveBoard {
11
+ private readonly deps;
12
+ constructor(deps: BoardDeps);
13
+ show(userId: string, key: string, conversation: Conversation): Promise<void>;
14
+ /** A group's record; one that cannot be read is left out of this board. */
15
+ private record;
16
+ /** The calls of one recorded message that are suggestions and are not settled yet. */
17
+ private suggestionsOf;
18
+ }
@@ -0,0 +1,6 @@
1
+ /** `/observe on | off | status`, said to the bot in a group; with 开/关/状态 as well. */
2
+ export type ObserveVerb = "on" | "off" | "status" | "usage";
3
+ /** The command's verb, `usage` for a malformed one, undefined when the text is not this command. */
4
+ export declare function parseObserve(text: string): ObserveVerb | undefined;
5
+ /** The scope a group chat is to Claw, or undefined when its id cannot be one. */
6
+ export declare function scopeOf(conversationId: string): string | undefined;
@@ -0,0 +1,6 @@
1
+ export { OBSERVE_TEXT, observeText } from "../locales/observe.js";
2
+ export * from "./command.js";
3
+ export * from "./suggestions.js";
4
+ export * from "./board.js";
5
+ export * from "./observer.js";
6
+ export * from "./views.js";
@@ -0,0 +1,45 @@
1
+ import type { JsonObject } from "../json.js";
2
+ import type { ClawAssistantPort } from "../ports/claw/assistant.js";
3
+ import type { Logger } from "../ports/logger.js";
4
+ import type { ClickHandler, MessageInterceptor } from "../ports/routing.js";
5
+ import type { LinkRepository } from "../ports/store/link.js";
6
+ import type { ObserveRepository } from "../ports/store/observe.js";
7
+ import { type Conversation, type InboundMessage } from "../ports/surface.js";
8
+ import type { Observing } from "../routing/features.js";
9
+ export interface ObserverDeps {
10
+ readonly observe: ObserveRepository;
11
+ readonly links: Pick<LinkRepository, "getKey">;
12
+ readonly assistant: Pick<ClawAssistantPort, "observeScope" | "observe" | "observations" | "session" | "send">;
13
+ /** Who may turn it on (TEAMS_OBSERVE_USERS, any case); empty: nobody. */
14
+ readonly users: readonly string[];
15
+ /** A conversation from the reference the store kept for a group (the channel's `ConversationRef.wire`). */
16
+ readonly conversationOf: (wire: JsonObject) => Conversation;
17
+ /** CLAW_PLUGIN_ID, named on the request an accepted suggestion becomes. */
18
+ readonly pluginId: number | undefined;
19
+ readonly log: Logger;
20
+ }
21
+ export declare class Observer implements Observing {
22
+ private readonly deps;
23
+ private readonly users;
24
+ private readonly boardReader;
25
+ constructor(deps: ObserverDeps);
26
+ get enabled(): boolean;
27
+ mayTurnOn(userId: string): boolean;
28
+ /** `/observe on|off|status` in a group (before the account check: on needs the person's key, off and status none). */
29
+ readonly interceptor: MessageInterceptor;
30
+ /** Accept and Dismiss under a suggestion card (1:1, with the person's key). */
31
+ readonly clicks: ClickHandler;
32
+ board(userId: string, credential: string, conversation: Conversation): Promise<void>;
33
+ private command;
34
+ private turnOn;
35
+ /**
36
+ * A group message not addressed to the bot. In a group nobody observes: nothing (not read, kept or logged). In an
37
+ * observed one: to the observer's assistant with the observer's key, as who said it and what.
38
+ */
39
+ forward(message: InboundMessage): Promise<void>;
40
+ /** A press under a suggestion card: only its own person's, and of two presses one is carried out. */
41
+ private onClick;
42
+ private postReply;
43
+ /** Anything but a reply: the person's own request to their own assistant, which answers in their 1:1 chat. */
44
+ private handOver;
45
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * What an observer turn would have done, as a suggestion: which recorded tool calls are suggestions at all, and how one
3
+ * is shown on its card and carried out on Accept (exactly as shown).
4
+ */
5
+ /** `pass` (it would do nothing) and the lookups an observer turn makes on its way to a decision: nothing to accept. */
6
+ export declare const NOT_SUGGESTIONS: ReadonlySet<string>;
7
+ /** The assistant tool's own name, without the MCP prefix. */
8
+ export declare function toolOf(raw: unknown): string;
9
+ export interface Suggestion {
10
+ /** What kind of thing it would have done. */
11
+ readonly kind: string;
12
+ /** What exactly: the reply's text, the task's title and brief, else the call's arguments. */
13
+ readonly what: string;
14
+ }
15
+ /** The suggestion a recorded call `tool(args)` is. */
16
+ export declare function describe(tool: string, args: unknown): Suggestion;
@@ -0,0 +1,19 @@
1
+ import type { ViewButton, OutMessage } from "../ports/surface.js";
2
+ /** One suggestion of an observed group, on the observer's /board: what their assistant would have done there. */
3
+ export interface ObserveSuggestionView {
4
+ readonly cardId: string;
5
+ /** The group's name ("" when the channel gave none). */
6
+ readonly group: string;
7
+ /** What was said in the group. */
8
+ readonly message: string;
9
+ readonly kind: string;
10
+ readonly what: string;
11
+ }
12
+ declare module "../ports/surface.js" {
13
+ interface ViewMap {
14
+ observeSuggestion: ObserveSuggestionView;
15
+ }
16
+ }
17
+ /** Accept (the primary button) and Dismiss: what a suggestion card has, and what a press that did nothing puts back. */
18
+ export declare function suggestionButtons(cardId: string): ViewButton[];
19
+ export declare function suggestionMessage(model: ObserveSuggestionView): OutMessage;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Lookups in a plain object by a key that is not a literal. A plain object inherits Object.prototype, so `table[key]`
3
+ * answers `table.constructor` for the key "constructor" and `"toString" in table` is true, where the Python dict the
4
+ * code was ported from has no such keys. The lint rule `own-keys/no-prototype-keys` refuses the bare forms; these are
5
+ * the forms it accepts (or use a Map, or build a table with `Object.fromEntries`, which keeps a "__proto__" key as an
6
+ * own key).
7
+ */
8
+ /** `table.get(key)` of a Python dict: the table's own value for `key`, else undefined. */
9
+ export declare function own<V>(table: Readonly<Record<string, V>>, key: string): V | undefined;
@@ -0,0 +1,31 @@
1
+ import { type Result } from "../result.js";
2
+ /**
3
+ * Where `/feedback` reports go (the Python worker's `feedback.GitHubIssues`: issues in one repository). The report is
4
+ * recorded before it is delivered, and a hidden marker in the issue or comment lets a retry find what an earlier
5
+ * attempt delivered without an answer, so nothing is filed twice.
6
+ */
7
+ export interface IssueRef {
8
+ readonly number: number;
9
+ readonly url: string;
10
+ }
11
+ /** The sink could not do it: the HTTP status it got (0 when nothing answered) and a short code; never a body. */
12
+ export interface SinkFailed {
13
+ readonly kind: "sink_failed";
14
+ readonly status: number;
15
+ readonly code: string;
16
+ }
17
+ /** No sink is configured: reports are recorded and not delivered. */
18
+ export interface SinkNotConfigured {
19
+ readonly kind: "sink_not_configured";
20
+ }
21
+ export type SinkError = SinkFailed | SinkNotConfigured;
22
+ export interface FeedbackSink {
23
+ createIssue(title: string, body: string, labels: readonly string[]): Promise<Result<IssueRef, SinkError>>;
24
+ /** The report issue whose body carries `marker`, created since `sinceEpochMs`; undefined when there is none. */
25
+ findIssue(marker: string, sinceEpochMs: number): Promise<Result<IssueRef | undefined, SinkError>>;
26
+ /** Whether a comment on issue `issue` since `sinceEpochMs` carries `marker`. */
27
+ hasComment(issue: number, marker: string, sinceEpochMs: number): Promise<Result<boolean, SinkError>>;
28
+ comment(issue: number, body: string): Promise<Result<void, SinkError>>;
29
+ }
30
+ /** No sink: every call says so, and the report stays recorded. */
31
+ export declare const noFeedbackSink: FeedbackSink;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Who a Claw key belongs to, asked of the platform that issued it (the Python worker's `safe.whoami`, `safe.safe_user`
3
+ * and `safe.user_id_of`: one `/users/self` call made with the key itself). Used when a person links a key, to record
4
+ * whose it is, and to check that a key presented later is the same person's.
5
+ */
6
+ export interface KeyOwner {
7
+ /** The platform's user id ("" when it gave none). */
8
+ readonly id: string;
9
+ /** The display name ("" when it gave none). */
10
+ readonly name: string;
11
+ /** "" when it gave none. */
12
+ readonly email: string;
13
+ /** The account type, lower case ("sso", "default", ...; "" when it gave none). */
14
+ readonly accountType: string;
15
+ }
16
+ export interface IdentityLookup {
17
+ /** The owner of `key`; undefined on any failure (unreachable, rejected, malformed answer): the caller says so. */
18
+ ownerOfKey(key: string): Promise<KeyOwner | undefined>;
19
+ }
20
+ /** No platform to ask: nobody is known. */
21
+ export declare const noIdentityLookup: IdentityLookup;
@@ -0,0 +1,31 @@
1
+ import { type FeedbackSink } from "./feedback-sink.js";
2
+ import { type IdentityLookup } from "./identity-lookup.js";
3
+ import { type Integrations } from "./integrations.js";
4
+ import { type KeyRevoker } from "./key-revoker.js";
5
+ import { type ModelRefusalPolicy } from "./model-refusal-policy.js";
6
+ import { type RouteExtension } from "./route-extension.js";
7
+ import { type TokenExchange } from "./token-exchange.js";
8
+ /**
9
+ * What a deployment plugs in. The public build runs with the neutral defaults (`neutralPlugins`); a deployment's own
10
+ * assembly passes its implementations (an identity platform, a model gateway's refusal rules, extra routes). Core
11
+ * depends on these interfaces only.
12
+ */
13
+ export interface Plugins {
14
+ readonly identityLookup: IdentityLookup;
15
+ readonly keyRevoker: KeyRevoker;
16
+ readonly feedbackSink: FeedbackSink;
17
+ readonly modelRefusalPolicy: ModelRefusalPolicy;
18
+ readonly tokenExchange: TokenExchange;
19
+ readonly routeExtensions: readonly RouteExtension[];
20
+ /** The deployment's MCP servers and /whoami lines (`integrations.ts`); none in the public build. */
21
+ readonly integrations: Integrations;
22
+ }
23
+ /** Every plugin at its neutral default, with `overrides` in their place. */
24
+ export declare function neutralPlugins(overrides?: Partial<Plugins>): Plugins;
25
+ export * from "./feedback-sink.js";
26
+ export * from "./identity-lookup.js";
27
+ export * from "./key-revoker.js";
28
+ export * from "./model-refusal-policy.js";
29
+ export * from "./route-extension.js";
30
+ export * from "./token-exchange.js";
31
+ export * from "./integrations.js";
@@ -0,0 +1,34 @@
1
+ import type { Lang } from "../locales/lang.js";
2
+ import type { KeyOwner } from "./identity-lookup.js";
3
+ /**
4
+ * Services of one deployment that the worker names, registered here so that the worker's own code names none of them
5
+ * (the Python worker's `integrations.py`). A deployment may run MCP servers of its own whose steps should read as
6
+ * "Querying <name>", and may have accounts whose kind decides what else a person can use, said as one more line of
7
+ * /whoami. Those names and lines come from the deployment's assembly (`register(registry)`), never from core.
8
+ */
9
+ export interface IntegrationRegistry {
10
+ /**
11
+ * An MCP server (its name lower case as Claw's tool names carry it, `mcp__<server>__<verb>`) people see as `shown`;
12
+ * with `query`, its `get_*` / `list_*` steps read as "Querying <shown>" in progress lines.
13
+ */
14
+ addMcpServer(name: string, shown: string, options?: {
15
+ readonly query?: boolean;
16
+ }): void;
17
+ /**
18
+ * One line of /whoami's connections, after GitHub's: a function of the key's owner (undefined when it could not be
19
+ * read) and the language of the chat.
20
+ */
21
+ addConnectionLine(line: (owner: KeyOwner | undefined, lang: Lang) => string): void;
22
+ }
23
+ /** What a registry holds, as the features that use it read it. */
24
+ export interface Integrations {
25
+ /** MCP server name (lower case) -> the name people see. */
26
+ readonly mcpServers: ReadonlyMap<string, string>;
27
+ /** The servers whose reads a progress line names ("Querying <name>"). */
28
+ readonly queryServers: ReadonlySet<string>;
29
+ readonly connectionLines: readonly ((owner: KeyOwner | undefined, lang: Lang) => string)[];
30
+ }
31
+ /** A registry, and what has been registered in it. */
32
+ export declare function integrationRegistry(): IntegrationRegistry & Integrations;
33
+ /** No integrations: the public build names no deployment's services. */
34
+ export declare const noIntegrations: Integrations;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Deleting a person's own key when they unlink (the Python worker's `safe.revoke_own_key`: authenticate with the key,
3
+ * find its id, delete it). Best effort: the link is removed whatever this answers.
4
+ */
5
+ export interface KeyRevoker {
6
+ /** True when the key was deleted; false on any failure (the caller tells the person to delete it themselves). */
7
+ revoke(key: string): Promise<boolean>;
8
+ }
9
+ /** Nothing to revoke at: every revoke reports that the key is still there. */
10
+ export declare const noKeyRevoker: KeyRevoker;
@@ -0,0 +1,25 @@
1
+ import type { Lang } from "../locales/lang.js";
2
+ /**
3
+ * A turn the model gateway refused for a reason the person can fix (the Python worker's `apim_key`: no key bound for
4
+ * the model, or one the gateway no longer accepts). The turn engine asks the policy whether the answer is such a
5
+ * refusal; if it is, the turn runs once more on the fallback model (when one is configured), the answer is led by
6
+ * `fallbackLead`, and when there is no fallback or it fails too the person is told `guidance` instead of a raw error.
7
+ */
8
+ export interface ModelRefusal {
9
+ /** Which refusal, in the policy's own words ("missing", "invalid", ...). */
10
+ readonly kind: string;
11
+ }
12
+ export interface ModelRefusalPolicy {
13
+ /**
14
+ * Whether the turn's whole answer is such a refusal. `failed` is how Claw ended the turn: undefined while not known
15
+ * (the live view: the whole message has to be the error), true (it is the error text, beginning with it is enough),
16
+ * false (Claw says it succeeded, so it is an answer).
17
+ */
18
+ classify(answer: string, failed: boolean | undefined): ModelRefusal | undefined;
19
+ /** What the person is told instead of the refused answer (markdown, in `lang`). */
20
+ guidance(refusal: ModelRefusal, lang: Lang): string;
21
+ /** The line in front of an answer the fallback model gave (markdown, in `lang`). */
22
+ fallbackLead(refusal: ModelRefusal, lang: Lang): string;
23
+ }
24
+ /** No gateway refusal is recognised: every answer is an answer. */
25
+ export declare const noModelRefusalPolicy: ModelRefusalPolicy;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * An HTTP route a deployment adds to the worker's server (the Python worker's `POST /primus-claw-agent/on-behalf`:
3
+ * a request a person's coordinator sends into the person's own 1:1 chat). The runtime's server mounts every extension
4
+ * it is given; the extension is built by the deployment's assembly, with whatever core services it needs.
5
+ *
6
+ * The body is unvalidated: the extension reads it through its own schema. The response body is JSON.
7
+ */
8
+ import type { JsonValue } from "../json.js";
9
+ export interface RouteRequest {
10
+ /** Header names lower case. */
11
+ readonly headers: Readonly<Record<string, string>>;
12
+ /** The bearer token of the Authorization header ("" when there is none). */
13
+ readonly bearer: string;
14
+ readonly body: unknown;
15
+ }
16
+ export interface RouteResponse {
17
+ readonly status: number;
18
+ readonly body: JsonValue;
19
+ }
20
+ export interface RouteExtension {
21
+ readonly method: "GET" | "POST" | "PUT" | "DELETE";
22
+ /** Absolute path, e.g. "/personal-agent/on-behalf". */
23
+ readonly path: string;
24
+ handle(request: RouteRequest): Promise<RouteResponse>;
25
+ }
26
+ /** No extensions: the server has only its own routes. */
27
+ export declare const noRouteExtensions: readonly RouteExtension[];
@@ -0,0 +1,36 @@
1
+ import { type Result } from "../result.js";
2
+ /**
3
+ * Short-lived tokens that act as a person, from an identity service's token exchange (RFC 8693; the Python worker's
4
+ * `exchange.ExchangeClient`). The person's channel identity is traded for a token; nothing long-lived is stored. A
5
+ * person with no confirmed binding gets `not_bound` and is offered a one-time binding link (`bindingRequest`).
6
+ */
7
+ export interface NotBound {
8
+ readonly kind: "not_bound";
9
+ }
10
+ /** The exchange could not be done (service down, client rejected, malformed reply); `reason` is status and code only. */
11
+ export interface ExchangeFailed {
12
+ readonly kind: "exchange_failed";
13
+ readonly reason: string;
14
+ }
15
+ /** No exchange is configured in this deployment. */
16
+ export interface ExchangeUnavailable {
17
+ readonly kind: "exchange_unavailable";
18
+ }
19
+ export type ExchangeError = NotBound | ExchangeFailed | ExchangeUnavailable;
20
+ /** A one-time link that binds this channel user to the account that confirms it. */
21
+ export interface BindingRequest {
22
+ readonly confirmUrl: string;
23
+ readonly expiresInSeconds: number;
24
+ }
25
+ export interface TokenExchange {
26
+ /** False when no exchange is configured: the flows that need one are not offered. */
27
+ readonly enabled: boolean;
28
+ /** A token acting as the person bound to channel user `userId`. */
29
+ tokenFor(userId: string): Promise<Result<string, ExchangeError>>;
30
+ /** The confirm link for `userId`; `email`, when the channel supplied one, restricts who can confirm it. */
31
+ bindingRequest(userId: string, email: string): Promise<Result<BindingRequest, ExchangeFailed | ExchangeUnavailable>>;
32
+ /** Forget the cached token and the cached "not bound" of `userId` (after the person says they confirmed). */
33
+ invalidate(userId: string): void;
34
+ }
35
+ /** No exchange configured. */
36
+ export declare const noTokenExchange: TokenExchange;