@primusclaw/personal-agent 0.0.0-stage → 0.1.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 (444) hide show
  1. package/dist/LICENSE +37 -0
  2. package/dist/index.js +31873 -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,71 @@
1
+ import type { Lang } from "../locales/lang.js";
2
+ import type { Clock } from "../ports/clock.js";
3
+ import type { Logger } from "../ports/logger.js";
4
+ import type { Conversation, Envelope, MessageId, OutMessage, UpdateOptions } from "../ports/surface.js";
5
+ import { Receipt, type ReceiptStream } from "./receipt.js";
6
+ /** Opens a live stream under the message being answered with `status` as its first update; undefined where none can be. */
7
+ export type ReceiptOpener = (status: string) => Promise<ReceiptStream | undefined>;
8
+ export declare class Receipts {
9
+ private readonly clock;
10
+ private readonly log;
11
+ /** The reply style has receipts on (`assistant_receipt`). */
12
+ private readonly enabled;
13
+ private readonly open;
14
+ constructor(clock: Clock, log: Logger,
15
+ /** The reply style has receipts on (`assistant_receipt`). */
16
+ enabled?: () => boolean);
17
+ /**
18
+ * Open the assistant's receipt in `conversation`. Undefined when there is none (receipts off, one already open, no stream here,
19
+ * or the channel refused it): the caller shows the typing indicator.
20
+ */
21
+ openIn(conversation: string, lang: Lang, opener: ReceiptOpener): Promise<Receipt | undefined>;
22
+ /** The worker stops: every open receipt is dropped (`Receipt.drop`), so no close timer or follower keeps the process up. */
23
+ stop(): void;
24
+ /** The open receipt of this conversation, left where it is (what follows the turn shows its steps in it). */
25
+ openOf(conversation: string): Receipt | undefined;
26
+ /**
27
+ * The open receipt of this conversation, taken (the first reply closes it). One kept for a handed-back review's answer is
28
+ * taken only by that answer (`reserved`). `reply`: what the assistant said, pushed by Claw, said by the turn `reply.turn`; one
29
+ * that is not the message's own reply leaves the receipt where it is (`Receipt.answeredBy`), as does one that is no turn's
30
+ * answer at all (`reply.foreign`: a task's own notice). The worker's own words in the receipt's place (the message was not
31
+ * taken) pass no `reply` and always take it.
32
+ */
33
+ take(conversation: string, reserved?: Receipt, reply?: {
34
+ readonly turn?: string | undefined;
35
+ readonly foreign?: boolean;
36
+ }): Receipt | undefined;
37
+ /** Keep the open receipt for the answer to a review handed back for the message `replyTo` (only the receipt under it). */
38
+ reserve(conversation: string, replyTo: MessageId): Receipt | undefined;
39
+ }
40
+ /**
41
+ * `message` (a text message) with what the assistant said beside it added at its end, after "另外:" ("Also: " when nothing is
42
+ * Chinese).
43
+ */
44
+ export declare function withPostscript(message: OutMessage, said: readonly string[]): OutMessage;
45
+ /**
46
+ * A conversation whose first text message closes `receipt` in its place under the person's message: the answer to a review the
47
+ * assistant handed back is the one reply to it. A view, and a first message the channel does not take there, are messages of
48
+ * their own. What the assistant said beside the handoff (`postscript`) is added to the first text message.
49
+ */
50
+ export declare class ReceiptConversation implements Conversation {
51
+ private readonly inner;
52
+ private readonly receipts;
53
+ private receipt;
54
+ private postscript;
55
+ constructor(inner: Conversation, receipts: Receipts, receipt: Receipt | undefined, postscript?: readonly string[]);
56
+ get ref(): import("../ports/surface.js").ConversationRef;
57
+ get edited(): ReadonlySet<string>;
58
+ markSettled(id: MessageId): void;
59
+ typing(): Promise<void>;
60
+ send(message: OutMessage): Promise<void>;
61
+ post(message: OutMessage): Promise<MessageId | undefined>;
62
+ update(id: MessageId, message: OutMessage, options?: UpdateOptions): Promise<void>;
63
+ delete(id: MessageId): ReturnType<Conversation["delete"]>;
64
+ outgoing(message: OutMessage): Envelope;
65
+ deliver(envelope: Envelope): Promise<void>;
66
+ openStream(replyTo: MessageId, status: string): ReturnType<Conversation["openStream"]>;
67
+ /** What the assistant said beside the handoff, when no text message carried it: said on its own. */
68
+ sayPostscript(): Promise<void>;
69
+ /** Nothing was said: the receipt is no longer kept, so a reply of the assistant (or its own limit) closes it. */
70
+ release(): void;
71
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The messages for an `assistant.say` or `work_item.needs_you` event, in order (teams_agent/assistant.py `say_activities`).
3
+ *
4
+ * - What was said, whole and once: a long text is split into up to three messages at paragraph breaks, never cut, after what the
5
+ * receipt already shows of it (`shown`). It is an AI answer: the AI label and the thumbs under it, a citation for each source it
6
+ * cites as [n], and the replies to tap under the last of its messages when no card follows.
7
+ * - When the event's item holds a result that waits, a card with Accept and Stop; when it holds a write for the person, a card
8
+ * that lets it through or not; when it puts a command to the person, a card with Run and Cancel (each recorded first, so its
9
+ * buttons mean something). A card holds the words only when they are short and not shown already.
10
+ * - Then a card for each file the item's worker delivered, with Claw's own download link.
11
+ *
12
+ * Every word of this worker's own is in the person's language, never in that of what was said.
13
+ */
14
+ import type { SuggestedReply } from "../direct-chat/direct-chat.js";
15
+ import type { StorePort } from "../ports/store/index.js";
16
+ import type { OutMessage } from "../ports/surface.js";
17
+ export type SayStore = Pick<StorePort, "prefs" | "assistantCards" | "assistantButtons">;
18
+ /** (worker session, delivery id) -> Claw's download link, or null. */
19
+ export type DeliveryLink = (sessionId: string, deliveryId: string) => string | null;
20
+ export interface SayOptions {
21
+ readonly linkFor?: DeliveryLink | undefined;
22
+ /** What the receipt already shows of the words. */
23
+ readonly shown?: string;
24
+ /** The first line of what is said (direct chat: Clawy's head). */
25
+ readonly head?: string;
26
+ /** Suggested replies of the worker's own, before Claw's. */
27
+ readonly replies?: readonly SuggestedReply[];
28
+ }
29
+ export interface SayDeps {
30
+ readonly store: SayStore;
31
+ /** The router's test of a command typed whole (for a command the assistant puts to the person). */
32
+ readonly exactCommand: (text: string) => boolean;
33
+ /** The reply style's switches: citations and suggested replies under what the assistant said. */
34
+ readonly style: () => {
35
+ readonly citations: boolean;
36
+ readonly suggestedReplies: boolean;
37
+ };
38
+ /** The locale of the client the message being handled came from ("" none). */
39
+ readonly clientLocale?: () => string;
40
+ }
41
+ type Event = Readonly<Record<string, unknown>>;
42
+ export declare class SayPlanner {
43
+ private readonly deps;
44
+ constructor(deps: SayDeps);
45
+ /** The messages for `event` to `userId`, in order; [] when the event says nothing. */
46
+ messages(userId: string, event: Event, options?: SayOptions): OutMessage[];
47
+ /** What is said: the event's words (or that its item needs the person), under `head`; the files' names when nothing else says. */
48
+ private words;
49
+ /** A card for each delivered file Claw gives a link for, and the names of all of them. */
50
+ private fileCards;
51
+ /** The replies to tap, under the last of what was said, when no card follows. */
52
+ private withReplies;
53
+ /**
54
+ * The card with buttons the event asks for, recorded first: a result that waits, a write Claw holds, or a command put to the
55
+ * person; undefined for none. `holdsWords`: the card shows the words, which are then not said apart.
56
+ */
57
+ private card;
58
+ /** What was said, as AI answers with thumbs, each with the citations its own words cite (when the whole text cites at all). */
59
+ private said;
60
+ /** A result that waits: Accept and Stop, and (a task whose result names a pull request) auto-reply on or off. */
61
+ private workCard;
62
+ }
63
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Core's wrapper over the Surface's `LiveStream`: what the receipt tracks about a stream (the text streamed so far, its age,
3
+ * whether a final was sent) is kept here, not by the port. The stream's own message id comes from the port: a final the channel
4
+ * refuses is edited into that message, and what the turn amends or replaces after the stream closed edits it too.
5
+ */
6
+ import type { Clock } from "../ports/clock.js";
7
+ import type { Conversation, LiveStream, MessageId, OutMessage, StreamRefused, UpdateOptions } from "../ports/surface.js";
8
+ import type { Result } from "../result.js";
9
+ import type { ReceiptStream } from "./receipt.js";
10
+ export declare class TrackedStream implements ReceiptStream {
11
+ private readonly live;
12
+ private readonly conversation;
13
+ readonly replyTo: MessageId;
14
+ private readonly clock;
15
+ open: boolean;
16
+ streamed: string;
17
+ readonly streamId: MessageId;
18
+ private readonly started;
19
+ constructor(live: LiveStream, conversation: Conversation, replyTo: MessageId, clock: Clock);
20
+ /** A final may still be refused and then edited into place: the channel gave the stream an id and it was not closed. */
21
+ get closable(): boolean;
22
+ ageSeconds(): number;
23
+ inform(text: string, options?: UpdateOptions): Promise<Result<void, StreamRefused>>;
24
+ emit(text: string, options?: UpdateOptions): Promise<Result<void, StreamRefused>>;
25
+ final(message: OutMessage): Promise<Result<void, StreamRefused>>;
26
+ update(id: MessageId, message: OutMessage): Promise<void>;
27
+ delete(id: MessageId): Promise<void>;
28
+ }
29
+ /** Opens the receipt's stream under the person's message `replyTo` in `conversation` (`Receipts.openIn`'s opener). */
30
+ export declare function streamOpener(conversation: Conversation, replyTo: MessageId, clock: Clock): (status: string) => Promise<ReceiptStream | undefined>;
@@ -0,0 +1,25 @@
1
+ import type { ClawSessionsPort } from "../ports/claw/index.js";
2
+ import type { Clock } from "../ports/clock.js";
3
+ import type { Logger } from "../ports/logger.js";
4
+ import type { Receipt } from "./receipt.js";
5
+ /** How long the turn in front of a message is waited for; later, the receipt does without (the first reply closes it). */
6
+ export declare const FRONT_TURN_SECONDS = 2;
7
+ export interface TurnInFrontDeps {
8
+ readonly sessions: Pick<ClawSessionsPort, "turn">;
9
+ readonly clock: Clock;
10
+ readonly logger: Logger;
11
+ }
12
+ export declare class TurnInFront {
13
+ private readonly deps;
14
+ private abandoned;
15
+ private readonly read;
16
+ /** Starts reading which turn holds `sessionId` now: its message id while it runs, else none. */
17
+ constructor(deps: TurnInFrontDeps, credential: string, sessionId: string);
18
+ /**
19
+ * The turn read, just before the message is sent: undefined when this message has no receipt, the session was idle, or Claw
20
+ * did not say within FRONT_TURN_SECONDS (the receipt is then closed by the first reply, as before).
21
+ */
22
+ before(receipt: Receipt | undefined): Promise<string | undefined>;
23
+ /** The message went (or never will): whatever the read still brings is not wanted. */
24
+ abandon(): void;
25
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The assistant's views: a work item that waits for the person, what replaces it once pressed, the board, a command or a write
3
+ * put to the person (the arguments of teams_agent/render.py work_card, work_done_card, note_card with
4
+ * work_buttons, board_card with board_buttons, action_card and confirm_write_card, one for one).
5
+ */
6
+ import type { ReviewAskedOfOther, WorkItem } from "../claw/model.js";
7
+ /** A work item that waits for the person (render.work_card). */
8
+ export interface WorkCardModel {
9
+ readonly item: WorkItem;
10
+ /** What the assistant said about it ("" none). */
11
+ readonly text: string;
12
+ /** The card the worker recorded; the buttons carry only its id. */
13
+ readonly cardId: string;
14
+ /** One bold line when the card replaces an older one ("" none). */
15
+ readonly note: string;
16
+ /** Offer "Auto-reply to PR comments" (a task whose result is a pull request). */
17
+ readonly watch: boolean;
18
+ /** Auto-reply is on: offer to turn it off instead. */
19
+ readonly watching: boolean;
20
+ /** "zh" or "en"; null to follow what was said, or the item's title. */
21
+ readonly lang: string | null;
22
+ }
23
+ /** What replaces a work card after Accept or Stop went through (render.work_done_card). */
24
+ export interface WorkDoneModel {
25
+ /** "Accepted" (the version is said), or how it ended otherwise. */
26
+ readonly verb: string;
27
+ readonly item: WorkItem;
28
+ }
29
+ /** A work card put back after a press that did not go through: the note, then its buttons again (note_card + work_buttons). */
30
+ export interface WorkNoteModel {
31
+ readonly text: string;
32
+ readonly cardId: string;
33
+ readonly version: number;
34
+ readonly canAccept: boolean;
35
+ }
36
+ /** A task the board offers to run again, with the card recorded for its button. */
37
+ export interface BoardRetry {
38
+ readonly cardId: string;
39
+ readonly item: WorkItem;
40
+ }
41
+ /** The person's board (render.board_card, its buttons render.board_buttons). */
42
+ export interface BoardModel {
43
+ readonly items: readonly WorkItem[];
44
+ /** The reviews the person asked of others, shown beside their own. */
45
+ readonly asked: readonly ReviewAskedOfOther[];
46
+ /** Epoch seconds: how long ago each item changed is counted from here. */
47
+ readonly now: number;
48
+ /** The cards recorded for the results that wait (Accept all; none: no button). */
49
+ readonly accept: readonly string[];
50
+ /** Tasks that failed or were stopped (Retry each, within a card's three buttons). */
51
+ readonly retry: readonly BoardRetry[];
52
+ /** "zh" or "en"; null to follow the items' titles. */
53
+ readonly lang: string | null;
54
+ }
55
+ /** A command the assistant put to the person instead of running it (render.action_card). */
56
+ export interface ActionCardModel {
57
+ readonly text: string;
58
+ readonly cardId: string;
59
+ readonly command: string;
60
+ /** "zh" or "en"; null to follow what was said. */
61
+ readonly lang: string | null;
62
+ }
63
+ /** A write Claw holds until the person answers (render.confirm_write_card). */
64
+ export interface ConfirmWriteModel {
65
+ readonly text: string;
66
+ readonly cardId: string;
67
+ /** Claw's word for letting it through ("" for "Confirm"). */
68
+ readonly allowLabel: string;
69
+ readonly lang: string;
70
+ }
71
+ declare module "../ports/surface.js" {
72
+ interface ViewMap {
73
+ actionCard: ActionCardModel;
74
+ board: BoardModel;
75
+ confirmWrite: ConfirmWriteModel;
76
+ workCard: WorkCardModel;
77
+ workDone: WorkDoneModel;
78
+ workNote: WorkNoteModel;
79
+ }
80
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * "Auto-reply to PR comments" and "Turn off auto-reply" under a task's card (teams_agent/assistant.py `_watch`, `_unwatch`).
3
+ *
4
+ * Turning it on watches the pull request the item's worker reported (Claw's own record, never a link the card's words name) with
5
+ * replies allowed, asked as the person signed in (their exchanged token: Claw takes `reply` from nobody else). Turning it off
6
+ * stops every pull request the item watches, asked with the linked key (taking away needs only ownership). The card is put back
7
+ * as it was, and the outcome is said.
8
+ */
9
+ import type { CardClick } from "../approvals/click.js";
10
+ import type { ClawWorkItemsPort } from "../ports/claw/index.js";
11
+ import type { Logger } from "../ports/logger.js";
12
+ import type { StorePort } from "../ports/store/index.js";
13
+ import type { TokenExchange } from "../plugins/token-exchange.js";
14
+ export interface WatchClickDeps {
15
+ readonly store: Pick<StorePort, "assistantCards">;
16
+ readonly claw: Pick<ClawWorkItemsPort, "pulls" | "watches" | "watchPull" | "unwatchPull">;
17
+ /** The identity service's token exchange; disabled: answering on GitHub for the person is not offered. */
18
+ readonly exchange: TokenExchange;
19
+ readonly logger: Logger;
20
+ }
21
+ export declare class WatchClicks {
22
+ private readonly deps;
23
+ constructor(deps: WatchClickDeps);
24
+ private card;
25
+ /** The card again (when it is still open and the item still waits) with what was said under it, else the words alone. */
26
+ private putBack;
27
+ watch(click: CardClick, key: string): Promise<void>;
28
+ private turnOn;
29
+ /** The person's exchanged token; undefined when they are not connected through the identity service. */
30
+ private token;
31
+ /** Whether the item already answers new comments on `pull` unasked; false when Claw cannot be read. */
32
+ private wasOn;
33
+ unwatch(click: CardClick, key: string): Promise<void>;
34
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Presses on Accept and Stop under a work item's card, and on the board's Accept all and Retry (teams_agent/assistant.py
3
+ * `on_click`, `_retry`, `_accept_all`). Cards are not trusted: a button carries the id of the card this worker recorded, and
4
+ * what it means is read from the record; it must be the presser's and not yet used, and of two presses exactly one goes on.
5
+ * Claw is asked as the presser. Accept is pinned to the version the person saw: a newer one gets a card of its own.
6
+ */
7
+ import type { CardClick } from "../approvals/click.js";
8
+ import type { WorkItem } from "../claw/model.js";
9
+ import type { ClawWorkItemsPort } from "../ports/claw/index.js";
10
+ import type { StorePort } from "../ports/store/index.js";
11
+ import type { Board } from "./board.js";
12
+ export type WorkClickStore = Pick<StorePort, "now" | "assistantCards">;
13
+ export interface WorkClickDeps {
14
+ readonly store: WorkClickStore;
15
+ readonly claw: Pick<ClawWorkItemsPort, "get" | "accept" | "stop" | "retry">;
16
+ readonly board: Board;
17
+ /** An item was stopped here: whatever follows its work here ends as stopped. */
18
+ readonly onStopped: (itemId: string) => void;
19
+ }
20
+ /** What a refusal from Claw means for a person who pressed a button. */
21
+ export declare function failureText(status: number, code: string): string;
22
+ /** Where an item stands, for a press that arrived too late (or too early) to do what its card offered. */
23
+ export declare function statusText(item: WorkItem): string;
24
+ export declare class WorkClicks {
25
+ private readonly deps;
26
+ constructor(deps: WorkClickDeps);
27
+ /** The card is the presser's and open, and this press now holds it ("busy"): of two presses exactly one goes on. */
28
+ private take;
29
+ private card;
30
+ /** Accept or Stop under a work item's card. */
31
+ acceptOrStop(click: CardClick, key: string, op: "accept" | "stop"): Promise<void>;
32
+ /** Nothing was done: a 404 ends the card; anything else offers it again, as a new message that can be pressed. */
33
+ private notDecided;
34
+ private decided;
35
+ /** The outcomes of a review's stop, and a merge that cannot be stopped; false when the decision is none of them. */
36
+ private reviewOutcome;
37
+ /** The result changed after the card was made: nothing was accepted, and a card for the current result is sent. */
38
+ private newerVersion;
39
+ /**
40
+ * Retry on the board: the task (failed, or stopped) runs again in its own session; Claw decides whether it may. A stopped task
41
+ * is read first: past RETRY_STOPPED_SECONDS its Retry has expired, as the board would no longer offer it, and Claw is not asked.
42
+ */
43
+ retry(click: CardClick, key: string): Promise<void>;
44
+ /** A Retry pressed after the stop it was drawn for has aged past RETRY_STOPPED_SECONDS: the card is done, Claw is not asked. */
45
+ private retryExpired;
46
+ private retryFailed;
47
+ /**
48
+ * Accept all on the board: each result it listed, at the version it showed (one card each); a result that changed since, or a
49
+ * card already used, is left for its own card. One line says what was accepted.
50
+ */
51
+ acceptAll(click: CardClick, key: string): Promise<void>;
52
+ private acceptOne;
53
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The buttons of work item cards and of the board, for the router (teams_agent/agent.py `_dispatch`, `Assistant.on_click`). A
3
+ * person with no linked key (their review runs on someone else's) presses with their exchanged token instead.
4
+ */
5
+ import type { Logger } from "../ports/logger.js";
6
+ import type { ClickHandler, ClickRoute } from "../ports/routing.js";
7
+ import type { TokenExchange } from "../plugins/token-exchange.js";
8
+ import type { WatchClicks } from "./watch-clicks.js";
9
+ import type { WorkClicks } from "./work-clicks.js";
10
+ export declare class WorkCardClicks implements ClickHandler {
11
+ private readonly work;
12
+ private readonly watch;
13
+ private readonly exchange;
14
+ /** Whether the person has a linked key. */
15
+ private readonly linked;
16
+ private readonly logger;
17
+ readonly verbs: readonly ["work"];
18
+ constructor(work: WorkClicks, watch: WatchClicks, exchange: TokenExchange,
19
+ /** Whether the person has a linked key. */
20
+ linked: (userId: string) => boolean, logger: Logger);
21
+ beforeCredential(click: ClickRoute): Promise<boolean>;
22
+ withCredential(click: ClickRoute, credential: string): Promise<void>;
23
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * What the assistant says about a work item, in words any channel shows (teams_agent/render.py item_label, card_paragraphs,
3
+ * fits_work_card, work_event_text, retryable, board_line, _board_detail, _board_meaning, _ago, asked_line, _asked_meaning and the
4
+ * translation in asked_section). The cards that carry these words are the channel's; these are its pure helpers.
5
+ */
6
+ import type { ReviewAskedOfOther, AskerView, WorkItem } from "../claw/model.js";
7
+ import type { Lang } from "../locales/lang.js";
8
+ /** What the assistant may say at most (Claw refuses a longer one); a card shows all of it. */
9
+ export declare const WORK_TEXT_MAX = 600;
10
+ /** Items listed per section of the board; the rest is one "and N older" line. */
11
+ export declare const BOARD_LINES = 8;
12
+ /** Items waiting for the person that get a card of their own under the board, at most. */
13
+ export declare const BOARD_CARDS = 5;
14
+ /** Retry buttons on the board, beside Accept all within a card's three: tasks that failed or were stopped, newest first. */
15
+ export declare const BOARD_RETRY_MAX = 3;
16
+ /**
17
+ * A stopped task offers Retry only this long after it was stopped. Every stop is the person's own (the Stop button, or the
18
+ * assistant asked to), and the board lists what ended in the last seven days: past this, Retry would keep offering, for days, to
19
+ * undo a decision the person made on purpose. A failed task waits on the person (needs_you) and keeps its Retry while it waits.
20
+ */
21
+ export declare const RETRY_STOPPED_SECONDS = 3600;
22
+ /** Rows a section of the board shows; the rest of BOARD_LINES opens in place. */
23
+ export declare const BOARD_SHOWN: Readonly<Record<string, number>>;
24
+ /** The longest title line a card has (the card kit's TITLE_MAX). */
25
+ export declare const LABEL_MAX = 120;
26
+ /** The longest detail on a board row (a question asked, a progress report). */
27
+ export declare const DETAIL_MAX = 80;
28
+ /** `text` for a card's markdown: its markup characters escaped, so that `__init__.py` is not bold (render._plain). */
29
+ export declare function markdownPlain(text: string): string;
30
+ /** `lang` when it is "zh" or "en", else the language of the first of `texts` that says anything (`pickLang`). */
31
+ export declare function cardLang(lang: string | null | undefined, ...texts: unknown[]): Lang;
32
+ /** `#seq title`, one line. */
33
+ export declare function itemLabel(item: Pick<WorkItem, "seq" | "title">): string;
34
+ /** `text` with every line its own paragraph (a card runs lines that are separated by one newline together). */
35
+ export declare function cardParagraphs(text: string): string;
36
+ /** Whether a work item's card shows all of `text` (as its card lays it out), not clipped. */
37
+ export declare function fitsWorkCard(text: string): boolean;
38
+ /** `text` as a work card shows it (`cardParagraphs`), cut to `limit` with an ellipsis. */
39
+ export declare function workCardText(text: string, limit?: number): string;
40
+ /** What an assistant event says: its own text, or (a fallback notice carries none) that the item needs the person. */
41
+ export declare function workEventText(item: WorkItem | null, text: unknown): string;
42
+ /**
43
+ * A task Claw runs again on Retry (`POST /v1/work-items/:id/retry`): its worker reported failed, or it was stopped in the last
44
+ * RETRY_STOPPED_SECONDS before `now` (seconds since the epoch). A stop whose time (`updatedAt`) is not known is not offered.
45
+ */
46
+ export declare function retryable(item: WorkItem, now: number): boolean;
47
+ /** What matters about an item in its section: what it waits for, or the progress its worker last reported; "" for a done one. */
48
+ export declare function boardDetail(item: WorkItem, lang: Lang): string;
49
+ /** One item on the board as a line of text: `#2 title`, and what matters about it in its column. */
50
+ export declare function boardLine(item: WorkItem, lang?: Lang): string;
51
+ /** The status of a row on the board, as the card kit's meanings name it. */
52
+ export type RowMeaning = "good" | "stopped" | "dropped" | "needs_you" | "question" | "failed" | "review" | "working" | "handoff";
53
+ /** The emoji of an item's row: what state it is in, at a glance. */
54
+ export declare function boardMeaning(item: WorkItem): RowMeaning;
55
+ /** How long ago Claw last changed an item (`updatedAt`, ISO 8601), short: "5 分钟前" / "5 min ago"; "" when not known. */
56
+ export declare function ago(at: string, now: number, lang: Lang): string;
57
+ /** The review is over (Claw no longer lists it as open). */
58
+ export declare function askerFinished(view: AskerView): boolean;
59
+ /** The review waits for its reviewer (a confirmation, a retry, their start). */
60
+ export declare function askerWaits(view: AskerView): boolean;
61
+ /** One review asked of someone else: the pull request, who reviews it, and how it stands (the asker's view only), in English. */
62
+ export declare function askedLine(asked: ReviewAskedOfOther): string;
63
+ /** The emoji of an asked review's row. */
64
+ export declare function askedMeaning(asked: ReviewAskedOfOther): RowMeaning;
65
+ /** An asked review's line split for a board row: (the pull request and its reviewer, how it stands in `lang`). */
66
+ export declare function askedRow(asked: ReviewAskedOfOther, lang: Lang): readonly [string, string];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The user-visible name of the bot. A deployment may name it otherwise (the router's `botName`); every text that names
3
+ * the bot takes the name it is given, and this is the default.
4
+ */
5
+ export declare const BOT_NAME = "Clawy";
@@ -0,0 +1,40 @@
1
+ import type { JsonObject } from "../json.js";
2
+ import type { ClawAssistantPort } from "../ports/claw/assistant.js";
3
+ import type { ClawTriggersPort } from "../ports/claw/settings.js";
4
+ import type { Logger } from "../ports/logger.js";
5
+ import type { CommandHandler, CommandRoute } from "../ports/routing.js";
6
+ import type { LinkRepository } from "../ports/store/link.js";
7
+ import type { PrefsRepository } from "../ports/store/people.js";
8
+ /**
9
+ * `/brief`: the daily brief. `/brief on [HH:MM]` makes (or refreshes) the person's weekday trigger in their time zone,
10
+ * `/brief off` removes it, `/brief` says whether it is on, and with the assistant `/brief` and `/brief now` show the brief
11
+ * itself, put together by Claw at once. A trigger keeps a copy of the key it was made with, so it must be the person's
12
+ * own linked key, never an exchanged token.
13
+ */
14
+ export interface BriefDeps {
15
+ /** Off until Claw's trigger API is deployed: the command then says so. */
16
+ readonly enabled: boolean;
17
+ readonly links: Pick<LinkRepository, "getKey">;
18
+ readonly prefs: Pick<PrefsRepository, "getPrefs" | "setBriefTrigger">;
19
+ readonly triggers: ClawTriggersPort;
20
+ readonly assistant: Pick<ClawAssistantPort, "brief">;
21
+ /** A 1:1 chat that talks to the person's assistant. */
22
+ readonly assistantOn: (userId: string) => boolean;
23
+ /** The brief Claw answered, as the message that shows it (the assistant's view of it). */
24
+ readonly briefMarkdown: (brief: JsonObject) => string;
25
+ readonly log: Logger;
26
+ }
27
+ export declare class DailyBrief implements CommandHandler {
28
+ private readonly deps;
29
+ readonly name = "brief";
30
+ constructor(deps: BriefDeps);
31
+ run(route: CommandRoute, args: string): Promise<boolean>;
32
+ private dispatch;
33
+ /** The person's brief trigger: the one recorded, else one of the brief's name. */
34
+ private find;
35
+ private state;
36
+ /** The brief itself, now, as one message; `/brief` adds whether it comes on its own, `/brief now` is the brief alone. */
37
+ private showNow;
38
+ private turnOn;
39
+ private turnOff;
40
+ }
@@ -0,0 +1,3 @@
1
+ export { briefText } from "../locales/brief.js";
2
+ export * from "./brief.js";
3
+ export * from "./template.js";
@@ -0,0 +1,8 @@
1
+ /** The daily brief's scheduled trigger (the Python worker's `templates/daily-brief.json`). */
2
+ export declare const DAILY_BRIEF: {
3
+ readonly name: "Daily brief";
4
+ readonly defaultTime: "08:30";
5
+ /** Weekdays, as cron's day-of-week field. */
6
+ readonly days: "1-5";
7
+ readonly prompt: string;
8
+ };
@@ -0,0 +1,49 @@
1
+ /** The shape of one entry of the capability registry (`registry.ts`). */
2
+ export type CategoryKey = "chat" | "review" | "settings" | "remote" | "notify" | "feedback";
3
+ export interface Category {
4
+ readonly key: CategoryKey;
5
+ readonly zh: string;
6
+ readonly en: string;
7
+ }
8
+ /** In the order help shows them. */
9
+ export declare const CATEGORIES: readonly Category[];
10
+ /** Where help shows a capability: a 1:1 chat, a group chat, or both. */
11
+ export type Where = "dm" | "group" | "both";
12
+ /** "assistant" only with the assistant on, "session" only without it, "understanding" only for the people the assistant
13
+ * understands every message of, "" either way. */
14
+ export type CapabilityMode = "" | "assistant" | "session" | "understanding";
15
+ /** The parts of the worker a capability needs on: shown only then. */
16
+ export type Part = "github" | "remote" | "brief" | "schedule" | "watch_job";
17
+ export interface Capability {
18
+ readonly key: string;
19
+ /** A CATEGORIES key; "" for help itself (the closing line, not a category). */
20
+ readonly category: CategoryKey | "";
21
+ /** What it is, in a few words. */
22
+ readonly zh: string;
23
+ readonly en: string;
24
+ /** One sentence a person would type for it ("" : it is done with buttons). */
25
+ readonly sayZh: string;
26
+ readonly sayEn: string;
27
+ /**
28
+ * Where the example goes: "turn", "group_review [MODEL]" (one review per pull request it names), "review_mode MODE" (the card
29
+ * to choose it), "unlink_ask", or "<command> [ARG]" as the worker reads it.
30
+ */
31
+ readonly reaches: string;
32
+ /** The code's surfaces it stands for: command:, github:, agent:, card:, setting:, route:. */
33
+ readonly covers: readonly string[];
34
+ readonly where: Where;
35
+ /** Where its example is typed: "dm", or "group" (after an @mention). */
36
+ readonly typedIn: "dm" | "group";
37
+ readonly mode: CapabilityMode;
38
+ /** Whose current value help shows (a key of the `values` help is given). */
39
+ readonly setting: string;
40
+ readonly needs: Part | "";
41
+ /**
42
+ * The assistant may ask the chat to do it (`channelActions`): its command, carried out as if typed. Never one that cannot be
43
+ * undone or that loosens a safety setting (`NOT_ACTIONS`).
44
+ */
45
+ readonly action: boolean;
46
+ }
47
+ type Fields = Pick<Capability, "key" | "category" | "zh" | "en"> & Partial<Capability>;
48
+ export declare function capability(fields: Fields): Capability;
49
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The longest message, as it is read (stripped, its closing punctuation off; in characters, as Python's `len`), that is read
3
+ * for a command said in plain words or a switch to an agent's session. A longer one is no sentence of help's and goes on as
4
+ * the words it is: no pattern runs over it, so no message can make the reading slow (the Python worker's
5
+ * MAX_COMMAND_TEXT_CHARS). A feedback sentence ("反馈:…") is read before this is checked, so a long one is still /feedback.
6
+ */
7
+ export declare const MAX_COMMAND_TEXT_CHARS = 1000;
8
+ /** The same for a sentence about the sessions themselves (`sessionControl`; the Python worker's MAX_SESSION_CONTROL_CHARS). */
9
+ export declare const MAX_SESSION_CONTROL_CHARS = 160;
10
+ /** `flat` (a message as it is read) is no longer than `most` characters. */
11
+ export declare function within(flat: string, most: number): boolean;
@@ -0,0 +1,3 @@
1
+ import { type Capability } from "./capability.js";
2
+ /** The registry's entries for chat and tasks, reviews and merges, in the order help shows them. */
3
+ export declare const CHAT_ENTRIES: readonly Capability[];
@@ -0,0 +1,3 @@
1
+ import { type Capability } from "./capability.js";
2
+ /** The registry's entries for notifications, feedback and help itself, in the order help shows them. */
3
+ export declare const NOTIFY_ENTRIES: readonly Capability[];
@@ -0,0 +1,3 @@
1
+ import { type Capability } from "./capability.js";
2
+ /** The registry's entries for settings and remote agents, in the order help shows them. */
3
+ export declare const SETTINGS_ENTRIES: readonly Capability[];
@@ -0,0 +1,24 @@
1
+ import { type Lang } from "../locales/lang.js";
2
+ import { type Part } from "./registry.js";
3
+ export declare const CURRENT_WORDS: Readonly<Record<Lang, string>>;
4
+ /** A confirmation setting as help says it: [Chinese, English]. */
5
+ export declare const CONFIRM_MODE_WORDS: Readonly<Record<string, readonly [string, string]>>;
6
+ /**
7
+ * The paragraph of help that says what the bot can do and as whom (security review): every action is someone's own, what waits
8
+ * for a person's tap, and that the taps that add authority are limited per person. The review and remote-agent sentences only when
9
+ * those parts are on.
10
+ */
11
+ export declare function authorityText(zh: boolean, parts?: ReadonlySet<Part>): string;
12
+ export interface HelpOptions {
13
+ readonly group?: boolean;
14
+ readonly assistant?: boolean;
15
+ readonly parts?: ReadonlySet<Part>;
16
+ /** This person's settings as help shows them ("当前:..."), by a capability's `setting`. */
17
+ readonly values?: Readonly<Record<string, string>>;
18
+ /** Goes first: which account, where the chat is attached. */
19
+ readonly lead?: string;
20
+ readonly bot?: string;
21
+ readonly understanding?: boolean;
22
+ }
23
+ /** The help for a chat, in `language` ("zh", or anything else for English). */
24
+ export declare function renderHelp(language: string, options?: HelpOptions): string;