@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,122 @@
1
+ import type { SseEvent } from "../../claw/model.js";
2
+ import type { JsonObject } from "../../json.js";
3
+ import type { Lang } from "../../locales/lang.js";
4
+ import type { Clock } from "../../ports/clock.js";
5
+ import type { Logger } from "../../ports/logger.js";
6
+ import type { ConversationRefRepository } from "../../ports/store/people.js";
7
+ import type { RemoteStateRepository } from "../../ports/store/remote.js";
8
+ import { type Conversation } from "../../ports/surface.js";
9
+ import { type RemoteStep } from "../events.js";
10
+ import { type RemoteTurnState } from "../turn-state.js";
11
+ import { type FollowTimings } from "./timings.js";
12
+ /** Whether a person may be woken now, and where what they may not be told yet is held (`proactive`). */
13
+ export interface FollowReach {
14
+ reachable(chatKey: string): boolean;
15
+ /** "paused" when the person paused proactive messages (`/pause`); anything else is not a pause. */
16
+ muted(chatKey: string): string | null;
17
+ /**
18
+ * Hold what was not said for the assistant's release. `eventId`: the id of the last event the held text came with (the assistant
19
+ * holds one burst once, whoever holds it again).
20
+ */
21
+ holdRemote(chatKey: string, label: string, text: string, eventId: string): void;
22
+ }
23
+ /** What the speaker needs: where to say it, whether it may, and how. */
24
+ export interface SpeakerDeps {
25
+ readonly clock: Clock;
26
+ readonly logger: Logger;
27
+ readonly timings: FollowTimings;
28
+ readonly reach: FollowReach;
29
+ readonly remoteState: RemoteStateRepository;
30
+ readonly references: ConversationRefRepository;
31
+ /** The conversation a stored reference posts to. */
32
+ conversationFor(reference: JsonObject): Conversation;
33
+ showPermission(chatKey: string, sessionId: string, request: Readonly<Record<string, unknown>>, to: Conversation): Promise<void>;
34
+ lang(): Lang;
35
+ /** The chat is the agent's window itself (`direct-chat`): what the agent says is signed with its head. */
36
+ direct(): boolean;
37
+ /** The paragraph that says the session ended and why (the reason a connector gave). */
38
+ describeEnd?: (reason: string) => Promise<string>;
39
+ /** The chat's session card, when it is the window: the text so far (`final` false) or the burst (`final` true); false when
40
+ * the chat shows no window. */
41
+ window?: (text: string, final: boolean) => Promise<boolean>;
42
+ /** The card is told once what the burst came to has been taken in. */
43
+ windowSettled?: () => Promise<void>;
44
+ }
45
+ /** When the text that waits is due, from what the reader knows. */
46
+ export interface DueContext {
47
+ readonly lastEvent: number;
48
+ /** A step this reader saw begin, or a permission request, is open. */
49
+ readonly busy: boolean;
50
+ readonly now: number;
51
+ }
52
+ export declare class BurstSpeaker {
53
+ private readonly chatKey;
54
+ private readonly sessionId;
55
+ private readonly deps;
56
+ private readonly turn;
57
+ /** Aborted when the reader is cancelled: a send still in flight is given up (Python's task cancel cuts it off). */
58
+ private readonly cutOff?;
59
+ /** The read position before which no text waits: what may be written as the cursor. */
60
+ safe: string;
61
+ private pendingSince;
62
+ private lastPush;
63
+ private retryAt;
64
+ private sent;
65
+ private typedTurn;
66
+ private settle;
67
+ private lastTextEvent;
68
+ constructor(chatKey: string, sessionId: string, deps: SpeakerDeps, turn: RemoteTurnState,
69
+ /** Aborted when the reader is cancelled: a send still in flight is given up (Python's task cancel cuts it off). */
70
+ cutOff?: AbortSignal | undefined);
71
+ /** Text of the agent's is waiting to be said. */
72
+ get waiting(): boolean;
73
+ feed(event: SseEvent): RemoteStep;
74
+ settleAt(cursor: string): void;
75
+ /** Milliseconds until the text that waits is due, 0 when it is, null when none waits (then only an event can matter). */
76
+ dueInMs(at: DueContext): number | null;
77
+ /** A message chunk: the burst began now, and the session card shows the text so far. */
78
+ noteText(step: RemoteStep, now: number): Promise<void>;
79
+ /**
80
+ * Say the text that waits (held in quiet hours or a pause, unless `force`), and move the safe position to `cursor`. When it
81
+ * cannot be sent: tried again after a while, or (`holdOnFailure`, for a reader being stopped) held for the sweep. True when the
82
+ * safe position moved (the caller writes it).
83
+ */
84
+ flush(how: {
85
+ readonly force: boolean;
86
+ readonly holdOnFailure: boolean;
87
+ }, cursor: string): Promise<boolean>;
88
+ /**
89
+ * The reader was cancelled because it did not stop in time, so a send of its was cut off: what it was saying is held for the
90
+ * sweep (at least once, never lost), and the read position moves past it. The safe position, for the caller to write.
91
+ */
92
+ abandon(cursor: string): string;
93
+ private forget;
94
+ private mayWake;
95
+ /** Deliver `text`; false when it could not be sent (it is kept and tried again). `force` lifts quiet hours, never a pause. */
96
+ private say;
97
+ /** The burst into the session card when it is the window: true shown, false failed, null no window. */
98
+ private intoWindow;
99
+ /** One message per part: headed with who said it, or signed with the agent's head in a chat that is its window. */
100
+ private messages;
101
+ private signed;
102
+ private langOr;
103
+ /** How many leading parts of `raw` were delivered already. */
104
+ private delivered;
105
+ /** Hold what has not been delivered of `text` for the sweep. */
106
+ private hold;
107
+ settleWindow(): Promise<void>;
108
+ /** A permission request gets its card at once, and none while the person may not be woken. */
109
+ ask(request: Readonly<Record<string, unknown>>): Promise<void>;
110
+ /** A prompt typed at the terminal the chat shares: one message, so the reply that follows reads as its answer. */
111
+ typed(text: string): Promise<void>;
112
+ /** The connector restarted and this session is back: one line, never to wake anyone. */
113
+ recovered(interrupted: boolean, continuing: boolean): Promise<void>;
114
+ /**
115
+ * The session ended while the chat was idle: say so and send the chat's messages to the assistant again. Nothing is said, and
116
+ * nothing changed, for a person who may not be woken: their next message is told that the session has ended.
117
+ */
118
+ ended(reason: string): Promise<void>;
119
+ /** The chat to tell now, or null: nobody to tell, or (`unlessPaused`: also a pause) the person may not be woken. */
120
+ private reachable;
121
+ private tell;
122
+ }
@@ -0,0 +1,9 @@
1
+ import { type ToolUpdate } from "../events.js";
2
+ /** Steps remembered as running (a connector that never ends its steps cannot grow this). */
3
+ export declare const STEPS_KEPT = 200;
4
+ /**
5
+ * Fold one tool event into the steps that have begun and not ended: the follower's, and the one made of a session's events when
6
+ * a chat attaches (`tail.ts`), so that both say the same of the same events. The value says whether this reader read the step's
7
+ * beginning (a step running when the chat attached holds no text back).
8
+ */
9
+ export declare function noteStep(steps: Map<string, boolean>, tool: ToolUpdate): void;
@@ -0,0 +1,29 @@
1
+ /** When a burst of what an agent says on its own is over (milliseconds). Tests use short ones. */
2
+ export interface FollowTimings {
3
+ /** No event for this long, and no step or permission request open: the burst is over. */
4
+ readonly quietMs: number;
5
+ /** ... when one is open: the agent may be waiting for a long step. */
6
+ readonly toolQuietMs: number;
7
+ /** At most one message per this long (what comes in between is said with the next one). */
8
+ readonly gapMs: number;
9
+ /** The longest text waits for a pause, however busy the agent is. */
10
+ readonly maxAgeMs: number;
11
+ /** First wait before reading again after a stream ended (it doubles, up to `RECONNECT_MAX_MS`). */
12
+ readonly reconnectMs: number;
13
+ /** After a message failed to go out, the wait before it is tried again (`RETRY_MS` when not given). */
14
+ readonly retryMs?: number;
15
+ /** How long a stop waits for the reader to deliver what it read (`STOP_WAIT_MS` when not given). */
16
+ readonly stopWaitMs?: number;
17
+ }
18
+ export declare const DEFAULT_TIMINGS: FollowTimings;
19
+ /** How a watched conversation (open in a terminal, read-only) is followed: told after a few quiet seconds, not half a minute. */
20
+ export declare const WATCH_TIMINGS: FollowTimings;
21
+ export declare const RECONNECT_MAX_MS = 60000;
22
+ /** A message that could not be sent is tried again after this long. */
23
+ export declare const RETRY_MS = 15000;
24
+ /** `stop` waits this long for the reader to finish what it was doing. */
25
+ export declare const STOP_WAIT_MS = 15000;
26
+ /** Events between two writes of the read position (a write also follows every delivery). */
27
+ export declare const CURSOR_EVERY = 25;
28
+ /** The wait before reading again after `failures` failed reads in a row. */
29
+ export declare function reconnectDelayMs(timings: FollowTimings, failures: number): number;
@@ -0,0 +1,20 @@
1
+ import type { Lang } from "../locales/lang.js";
2
+ import type { Agent, Connector } from "./model.js";
3
+ export interface MachineProblem {
4
+ /** The agent it is about, or null for one of the machine as a whole (said once). */
5
+ readonly agent: Agent | null;
6
+ readonly code: string;
7
+ /** A failure, not a warning. */
8
+ readonly fail: boolean;
9
+ readonly detail: unknown;
10
+ readonly fix: unknown;
11
+ }
12
+ /** The machine's problems, failures first, a machine-wide one once, and when they were checked; null when no agent reports
13
+ * health (an older connector: unknown, not fine). */
14
+ export declare function machineProblems(connector: Connector): {
15
+ problems: MachineProblem[];
16
+ checked: string | null;
17
+ } | null;
18
+ /** One line per problem of the machine (at most HEALTH_LINES_MAX, then how many more): what is wrong and the command that fixes it
19
+ * on that machine. [] when it reports none or no health at all. */
20
+ export declare function healthLines(connector: Connector, lang?: Lang): string[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The remote agents' domain as other packages see it (`remoteDomain` of the core entry): what a connector reports and how it is
3
+ * read, the session's events, the limits, the reasons, the lines said in a chat, and the inputs of the cards (`RemoteViews`).
4
+ * The view (core/src/remote-view, `remoteView`) builds on these and never passes them on.
5
+ */
6
+ export * from "./actions.js";
7
+ export * from "./agents.js";
8
+ export * from "./answer.js";
9
+ export * from "./conversations.js";
10
+ export * from "./events.js";
11
+ export * from "./health.js";
12
+ export { defang, lit, neutral, plain } from "./inert.js";
13
+ export * from "./limits.js";
14
+ export { breakAddresses, inertAnswer } from "./links/answer.js";
15
+ export * from "./lines.js";
16
+ export * from "./listing.js";
17
+ export * from "./options.js";
18
+ export type { Reported } from "./reported.js";
19
+ export * from "./setup.js";
20
+ export * from "./turn-state.js";
21
+ export type { AgentsInput, SessionsInput, StatusInput, WindowApproval, WindowInput } from "./ports.js";
@@ -0,0 +1,18 @@
1
+ /** `text` for a card TextBlock, which reads markdown: its markup characters escaped, so that `__init__.py` is not bold. */
2
+ export declare function plain(text: string): string;
3
+ /** One short line of untrusted text, safe in a card or a list (`text/neutral`), from whatever a connector reported: a value that
4
+ * is not text is read as Python's `str(value or "")` would. */
5
+ export declare function neutral(text: unknown, limit?: number): string;
6
+ /** `text` with no address a client links by itself (`https://`, `www.`, a bare domain, a mail address, escaped or not): a
7
+ * zero-width space breaks each, which no one sees. Where the text is shown as it is (a short line, the window card's output, the
8
+ * full output), not made words as an answer is. */
9
+ export declare function breakLinks(text: string): string;
10
+ /** `neutral`, then markup escaped: text supplied by an agent, a machine or a session as it goes into a card TextBlock. */
11
+ export declare function lit(text: unknown, limit: number): string;
12
+ /** `text` whole, but unable to make a markdown link or image (`](` gets a zero-width space inside) or a tag (`<`/`>` look-alikes). */
13
+ export declare function inertLinks(text: string): string;
14
+ /** A copy of an agent's JSON with every string unable to make a link or a tag: `](` gets a zero-width space inside, and
15
+ * `<`/`>` become look-alikes. Unlike `neutral` it keeps the text whole. */
16
+ export declare function defang(value: unknown): unknown;
17
+ /** `text` with credential-shaped values masked. */
18
+ export declare function masked(text: string): string;
@@ -0,0 +1,48 @@
1
+ /** How much of what an agent or a connector reports is read, kept and shown. */
2
+ /** A phone screen holds this many buttons under a card. */
3
+ export declare const OPTION_BUTTONS_MAX = 4;
4
+ /** A permission request that names no timeout lives this long, as long as the connector keeps it. */
5
+ export declare const PERMISSION_DEFAULT_SECONDS = 600;
6
+ export declare const BUTTON_TITLE_MAX = 40;
7
+ export declare const TOOL_TITLE_MAX = 100;
8
+ export declare const THOUGHT_MAX = 200;
9
+ export declare const SESSIONS_SHOWN = 8;
10
+ export declare const ANSWER_MESSAGES_MAX = 3;
11
+ export declare const ANSWER_CHARS_MAX = 3000;
12
+ /** The answer is cut to about 9000 characters on its way out: no point holding more of it. */
13
+ export declare const SEGMENT_KEEP_CHARS = 12000;
14
+ /** The answer is the last text; the stretches before it are narration. */
15
+ export declare const SEGMENTS_KEPT = 4;
16
+ /** Event ids remembered for dropping a repeat (a reconnect resumes after the last event anyway). */
17
+ export declare const SEEN_KEPT = 2000;
18
+ /** Steps shown as running at once (a connector that never ends its steps cannot grow the view). */
19
+ export declare const ACTIVE_STEPS_MAX = 40;
20
+ /** A block of the live view keeps this much of its end (the view shows the newest 2500 anyway). */
21
+ export declare const BLOCK_KEEP_CHARS = 3000;
22
+ export declare const OPTION_ID_MAX = 128;
23
+ /** Online agents that get a "New session" block on the agents card. */
24
+ export declare const AGENT_BLOCKS_MAX = 6;
25
+ /** Sessions the agents card lists, newest first. */
26
+ export declare const SESSION_CARD_MAX = 5;
27
+ /** Folders a connector reports per agent. */
28
+ export declare const ROOTS_MAX = 8;
29
+ export declare const ROOT_MAX = 300;
30
+ export declare const SUBFOLDER_MAX = 200;
31
+ /** Conversations of one agent the agents card offers to take over (a connector reports at most twelve). */
32
+ export declare const RESUMABLE_SHOWN = 5;
33
+ /** Of them, the ones no process runs (listed after those a terminal has open, in a group of their own). */
34
+ export declare const IDLE_SHOWN = 2;
35
+ /** What Claw accepts as a resume_ref. */
36
+ export declare const RESUME_REF_MAX = 128;
37
+ /** Conversations a connector reports per agent. */
38
+ export declare const RESUMABLE_READ_MAX = 12;
39
+ export declare const WAITING_FOR_MAX = 60;
40
+ export declare const TYPED_LINES_MAX = 40;
41
+ /** Problems one machine shows on the agents card. */
42
+ export declare const HEALTH_LINES_MAX = 4;
43
+ /** Problems read from one agent's report (Claw caps capabilities at 4 KiB; this bounds the rest). */
44
+ export declare const HEALTH_READ_MAX = 16;
45
+ /** Sessions of one agent the sessions card lists, newest first. */
46
+ export declare const SESSIONS_PER_AGENT = 5;
47
+ /** Conversations of one agent the sessions card offers to take over. */
48
+ export declare const CONVERSATIONS_PER_AGENT = 3;
@@ -0,0 +1,66 @@
1
+ /** The one-line messages of a chat attached to a remote session: where it is, what happened, what a refusal means. */
2
+ import type { Lang } from "../locales/lang.js";
3
+ /** What Claw writes for an instruction or a start its machine never got (a reason code, said by the connector reasons). */
4
+ export declare const NOT_DELIVERED = "not_delivered";
5
+ /** ... or, when Claw cannot tell (the machine was alive moments before it was queued): it may have run. */
6
+ export declare const DELIVERY_UNCONFIRMED = "delivery_unconfirmed";
7
+ /** The connector's and Claw's refusal of input to a watched session. */
8
+ export declare const READ_ONLY_REASONS: readonly string[];
9
+ /** A watched conversation's terminal let it go: the watch is over. */
10
+ export declare const TERMINAL_CLOSED = "terminal_closed";
11
+ /** The connector's own word for a turn it ended because it restarted. */
12
+ export declare const CONNECTOR_RESTARTED = "connector_restarted";
13
+ /** A terminal's permission modes in which Claude Code acts without asking, and what they are called. */
14
+ export declare const NO_ASK_MODES: Readonly<Record<string, string>>;
15
+ /** The warning for a terminal whose mode does not ask, or null for one that asks (or whose mode is not known). */
16
+ export declare function noAskLine(mode: string | null, lang: Lang): string | null;
17
+ export type StopReason = "cancelled" | "max_tokens" | "max_turn_requests" | "refusal";
18
+ /** Whether `reason` is a way a turn stopped that has a line of its own. */
19
+ export declare function isStopReason(reason: string): reason is StopReason;
20
+ /** The line for how a turn stopped. */
21
+ export declare function stopNote(reason: StopReason, lang?: Lang): string;
22
+ /** What a new session is called once something was sent to it: its first line, at most 30 characters. */
23
+ export declare function sessionTitle(text: string): string;
24
+ /** The last part of a folder (`…/repo`), which tells two sessions apart better than the whole path does (inert, for a card). */
25
+ export declare function placeOf(cwd: unknown, lit: (text: unknown, limit: number) => string): string;
26
+ /** A typed line is cut at this many characters: well under what the rich text converts, past which the message would go as plain
27
+ * markdown (where a reference link could be live). */
28
+ export declare const TYPED_CHARS_MAX = 4000;
29
+ /** How a prompt typed at the terminal shows in the chat: said as the terminal's, quoted, credentials masked, and unable to make a
30
+ * link, an image or a tag, nor an address the rich text links by itself (whoever types at that terminal reaches the chat through the
31
+ * connector: what they typed is shown, never followed). */
32
+ export declare function typedLine(text: string, lang: Lang): string;
33
+ /**
34
+ * Teams' floating status (an informative update) is cut on a phone after a few characters. Microsoft documents only an upper
35
+ * bound (1000 characters) and no display width; the one measurement is a phone on 2026-11-10, which showed four Chinese
36
+ * characters after the icon. So a line saying why a message still waits for its terminal is at most WAIT_LINE_MAX_ZH code points
37
+ * in Chinese and WAIT_LINE_MAX_EN in English, the "⏳ " included.
38
+ */
39
+ export declare const WAIT_LINE_MAX_ZH = 6;
40
+ export declare const WAIT_LINE_MAX_EN = 16;
41
+ /** What a message for a conversation open in a terminal waits for (`terminal_input_queued`), in the chat's language: one short
42
+ * line within WAIT_LINE_MAX_ZH / WAIT_LINE_MAX_EN, so that a phone shows all of it. */
43
+ export declare function queuedLine(reason: string, lang: Lang): string;
44
+ /** What a message to a watched session is answered with: it was not sent, and what makes sending possible without taking the
45
+ * conversation from the terminal; `takeover`: the status card also offers Take over…, which ends the terminal's session. */
46
+ export declare function readOnlyRefused(lang: Lang, takeover?: boolean): string;
47
+ /** The watch is over because the terminal let the conversation go. */
48
+ export declare function terminalClosedLine(lang: Lang): string;
49
+ /** `dev-pod · 🟠 Claude Code`: which session a chat talks to, in one line. */
50
+ export declare function whereLine(label: string, host: string): string;
51
+ /** The short line a switch leaves in the chat, so that on a phone the two stretches of conversation can be told apart. */
52
+ export declare function switchedLine(label: string, host: string, lang: Lang): string;
53
+ /** What a chat is told, once, when the connector on the machine restarted and its session is back: whether a turn was cut off,
54
+ * and whether the agent goes on with it by itself or waits for a word. */
55
+ export declare function recoveredLine(label: string, host: string, lang: Lang, interrupted: boolean, continuing: boolean): string;
56
+ export declare function backLine(lang: Lang): string;
57
+ /** Which messages of an attached chat stay with the assistant: said on the status card, where the person looks. */
58
+ export declare function clawyLine(lang: Lang, bot: string): string;
59
+ /** How to connect a machine with the one command line Claw gave (`claw-connector pair`): run it there, it does the rest. */
60
+ export declare function pairText(command: string, minutes: number, lang: Lang, lead?: string): string;
61
+ /** The disconnect card's title. */
62
+ export declare function disconnectTitle(host: unknown, lang?: Lang): string;
63
+ /** What the disconnect card becomes once the machine is disconnected. A paired machine is told only the pairing way back. */
64
+ export declare function disconnectedText(host: unknown, login: string, lang?: Lang, paired?: boolean): string;
65
+ /** Where the chat's session stands, as its status card says it. */
66
+ export type StatusPhase = "idle" | "working" | "starting" | "offline" | "detached" | "ended" | "watching";
@@ -0,0 +1,7 @@
1
+ /** What the chat's rich text drops before it reads anything: controls and bidi overrides (the rich text's own set). */
2
+ export declare const DROPPED_BY_RICH_TEXT: RegExp;
3
+ /** `text` with a zero-width space after every `www` of a `www.` and every `:` of a `://`, also when a markdown escape stands in
4
+ * either (`www\.`, `:\/\/`): no client takes what is left for an address. Its other text is unchanged. */
5
+ export declare function breakAddresses(text: string): string;
6
+ /** `text` with every link, image and address made words. Applying it again leaves no link either. */
7
+ export declare function inertAnswer(text: string): string;
@@ -0,0 +1,19 @@
1
+ /** Bare domains (`example.com/path`) in a remote agent's text, the ones a client that links fuzzy domains would link. */
2
+ /** Where a code span this scan made opens or closes (a backtick in the end, see `answer.ts`): the scans after it read it as the
3
+ * backtick it will be, and an agent's own backtick left in the prose is told apart from it. */
4
+ export declare const CODE = "\u0002";
5
+ /** Whether a port, a path, a query or a fragment starts at `at` (`:`, `/`, `?`, `#`), escaped too (`\/`: the client shows `/`). */
6
+ export declare function tailAt(text: string, at: number): boolean;
7
+ /** The bare domains of one text, found left to right: [start, end of its run of labels] each. */
8
+ export declare function domains(text: string, from?: number): Generator<[number, number]>;
9
+ /** Where the next bare domain of one text starts at or after `from`, for a `from` that never goes back (one pass in all). */
10
+ export declare class DomainFinder {
11
+ private readonly found;
12
+ private next;
13
+ private started;
14
+ constructor(text: string);
15
+ at(from: number): number;
16
+ private step;
17
+ /** Where the run of labels of the domain that starts at `start` ends, -1 when no domain starts there. */
18
+ runEnd(start: number): number;
19
+ }
@@ -0,0 +1,2 @@
1
+ /** The host name an address points at, "" when it names none (a relative path, `javascript:`, a fragment, a host that is not one). */
2
+ export declare function hostOf(address: string): string;
@@ -0,0 +1,27 @@
1
+ export { CODE } from "./domains.js";
2
+ /** What a link becomes, given its words and its address. */
3
+ export type Mark = (label: string, address: string) => string;
4
+ /** `[label]: url` at the start of a line: its brackets escaped (no `[words][label]` can use it) and the address made words. */
5
+ export declare function referenceDefinitions(text: string, mark: Mark): string;
6
+ /** Every `[words](dest)` and `![alt](dest)`, brackets and parentheses balanced (within the limits, inside one paragraph), the
7
+ * words made words themselves (a link in a link's words, two levels deep). */
8
+ export declare function links(text: string, mark: Mark, depth?: number): string;
9
+ /** `<a href=...>words</a>` as its words and host, `<img src=... alt=...>` as `🖼 alt` and host, `<scheme:...>` as its host; any
10
+ * other tag as it is. */
11
+ export declare function tags(text: string, mark: Mark): string;
12
+ /** An address without the punctuation that ends its sentence, or the closing parentheses it did not open (counted once). One
13
+ * pass from the end, sliced once. */
14
+ export declare function trim(address: string): string;
15
+ /** Every bare address as its host (in a code span whole when it names none), without the punctuation that ends its sentence or
16
+ * a closing parenthesis it did not open; read with any markdown escape in it taken out, as the rich text reads it. */
17
+ export declare function bare(text: string, mark: Mark): string;
18
+ /** Every mail address `name@host.tld` (a client makes a mail link of one) in a code span; not looked for inside a code span an
19
+ * earlier scan made (one there is code already, and a span opened inside it would cross it). */
20
+ export declare function emails(text: string): string;
21
+ /** A short line with no bare domain or mail address a client could link: a zero-width space before the dot of a domain's last
22
+ * label (`example\u200b.com`) and right after the `@` of a mail address. Neither shows. */
23
+ export declare function breakDomainsAndMails(text: string): string;
24
+ /** A bare domain left in prose next to a code span or a host made here: the scans read `docs.evil.mdmailto:` as one word, but
25
+ * once `mailto:` is code the client sees `docs.evil.md` on its own. Each stretch of prose between spans is read again for bare
26
+ * domains, its ends as a start and an end. */
27
+ export declare function leftoverDomains(text: string): string;
@@ -0,0 +1,38 @@
1
+ import type { Lang } from "../locales/lang.js";
2
+ import { type Conversation } from "./conversations.js";
3
+ import type { Connector, Session } from "./model.js";
4
+ import type { ConnectorSetupWords } from "./setup.js";
5
+ /** How an offline machine is shown: when it was last seen, in UTC (`last_seen_at`, else its last heartbeat). */
6
+ export declare function offlineSince(connector: Connector, lang?: Lang): string;
7
+ /** Sessions newest first (by `updated_at` as Claw wrote it), the order kept among equals. */
8
+ export declare function newestFirst(sessions: readonly Session[]): Session[];
9
+ /** The active sessions (a closed one can be neither attached nor closed). */
10
+ export declare function activeSessions(sessions: readonly Session[]): Session[];
11
+ /** The sessions the agents card lists: the active ones, newest first, at most SESSION_CARD_MAX. */
12
+ export declare function shownSessions(sessions: readonly Session[]): Session[];
13
+ /** The connectors by id. */
14
+ export declare function byConnector(connectors: readonly Connector[]): Map<string, Connector>;
15
+ export interface SessionFacts {
16
+ /** `icon name` of its agent. */
17
+ readonly who: string;
18
+ /** The machine's name. */
19
+ readonly host: string;
20
+ /** `attached, active, 2 h ago`. */
21
+ readonly facts: string;
22
+ }
23
+ /** Who, where and how one session of a listing is. A status Claw has no words for here is shown as it came, made inert. */
24
+ export declare function sessionFacts(session: Session, connectors: ReadonlyMap<string, Connector>, attached: string | null, now: number, lang?: Lang): SessionFacts;
25
+ /** `/agents` as text. With no machine: the exact commands that connect one (markdown, for a rich message). */
26
+ export declare function agentsText(connectors: readonly Connector[], setup: ConnectorSetupWords, lang?: Lang): string;
27
+ /** The message, and the session ids in the order shown: the newest sessions first, numbered for `/agent attach N`. */
28
+ export declare function sessionsText(sessions: readonly Session[], connectors: readonly Connector[], attached: string | null, now: number, lang?: Lang): {
29
+ text: string;
30
+ listing: string[];
31
+ };
32
+ /** One conversation of the machine's own: what its terminal is doing first (waiting for you, with what for; working), then its
33
+ * title, folder and last activity. */
34
+ export declare function conversationLine(entry: Conversation, now: number, lang: Lang): string;
35
+ /** The console has a page per remote session, and the list of them, under this path. */
36
+ export declare const SESSION_PAGE_PATH = "/primus-claw/agent-sessions";
37
+ /** The console page of one session (or of the list, with no id); "" with no base (the worker was not told where it is). */
38
+ export declare function sessionPageUrl(base: string, sessionId?: string): string;
@@ -0,0 +1,56 @@
1
+ import type { RemoteConnector, RemoteSession } from "../claw/remote.js";
2
+ import type { Lang } from "../locales/lang.js";
3
+ import { ConnectorSetup } from "./connector/setup.js";
4
+ import type { RemoteContext } from "./context.js";
5
+ import { type Connector, type Session } from "./model.js";
6
+ /** Claw answered 404 to a route that exists whenever remote agents are on: they are off on this PrimusClaw. */
7
+ export declare class RemoteOff extends Error {
8
+ readonly name = "RemoteOff";
9
+ }
10
+ /** What `/agents` shows: a card, or a text (rich: it holds commands to copy). */
11
+ export type AgentsAnswer = {
12
+ readonly kind: "card";
13
+ readonly message: import("../ports/surface.js").OutMessage;
14
+ } | {
15
+ readonly kind: "rich";
16
+ readonly text: string;
17
+ } | {
18
+ readonly kind: "text";
19
+ readonly text: string;
20
+ };
21
+ /** The machines and sessions as Claw listed them, read with the worker's defaults (`model.ts`). */
22
+ export interface Machines {
23
+ readonly raw: readonly RemoteConnector[];
24
+ readonly connectors: readonly Connector[];
25
+ }
26
+ export interface Sessions {
27
+ readonly raw: readonly RemoteSession[];
28
+ readonly sessions: readonly Session[];
29
+ }
30
+ export declare class Lists {
31
+ private readonly ctx;
32
+ constructor(ctx: RemoteContext);
33
+ private now;
34
+ /** The person's machines; `includeHidden`: the conversations they hid are listed too, marked hidden. */
35
+ machines(key: string, includeHidden?: boolean): Promise<Machines>;
36
+ sessions(key: string): Promise<Sessions>;
37
+ /**
38
+ * What connecting a machine takes here: Claw's own answer, else the same commands made from the address this worker reaches
39
+ * Claw at (an older Claw has no such route).
40
+ */
41
+ setup(key: string): Promise<ConnectorSetup>;
42
+ /**
43
+ * The pairing command for a new machine (`claw-connector pair`), or null when this Claw cannot give one: the caller then gives
44
+ * the sign-in steps. The line a person pastes into a shell is rebuilt here, never taken as Claw wrote it.
45
+ */
46
+ pairView(key: string, lang: Lang, lead?: string): Promise<string | null>;
47
+ /** The line of a card with no machine to show. */
48
+ noMachineLead(lang: Lang, lead: string): string;
49
+ /**
50
+ * What `/agents` shows: the agents card (`machines` false: its sessions part alone), or a text when there is nothing to tap.
51
+ * The sessions listed are remembered as the numbers of `/agent attach N`. `lead` is one line on top.
52
+ */
53
+ agentsView(chatKey: string, key: string, lang: Lang, lead?: string, machines?: boolean): Promise<AgentsAnswer>;
54
+ /** Every session the user has, on every machine; its active ones are the numbers of `/agent attach N` from now on. */
55
+ sessionsView(chatKey: string, key: string, lang: Lang, lead?: string): Promise<import("../ports/surface.js").OutMessage>;
56
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Which of the user's machines and agents a typed name means, and how an offline machine is told. People name a machine
3
+ * (`dev-pod`), an agent by its id or by what it is (`codex`, `claude`), or both (`dev-pod/codex`); a name that more than one
4
+ * online machine answers to must be qualified. A machine that is offline but was heard from moments ago is reconnecting by
5
+ * itself (a PrimusClaw release ends every connection for a few seconds): it is tried, and never told to be restarted.
6
+ */
7
+ import type { Lang } from "../locales/lang.js";
8
+ import type { Agent, Connector, Session } from "./model.js";
9
+ /** What a user types to name an agent: `machine/id`, inert, with no backtick to end the code span it is shown in. */
10
+ export declare function agentRefOf(connector: Connector, agent: Agent): string;
11
+ /** A machine last seen this recently is reconnecting, not gone. */
12
+ export declare const RECONNECT_WINDOW_SECONDS = 120;
13
+ /** An agent on a machine: what a name resolves to. */
14
+ export interface AgentOnMachine {
15
+ readonly kind: "agent";
16
+ readonly connector: Connector;
17
+ readonly agent: Agent;
18
+ }
19
+ /** A name that is a machine's, not an agent's, and the machine has more than one agent to choose from. */
20
+ export interface MachineChoice {
21
+ readonly kind: "machine";
22
+ readonly connector: Connector;
23
+ readonly agents: readonly Agent[];
24
+ }
25
+ /** Why nothing was found, as the sentence to say. */
26
+ export interface Unresolved {
27
+ readonly kind: "refusal";
28
+ readonly text: string;
29
+ }
30
+ export type Resolved = AgentOnMachine | MachineChoice | Unresolved;
31
+ /**
32
+ * The machine is offline but was heard from moments ago: its connector is most likely reconnecting by itself, and restarting it
33
+ * is not what to do. `now`: wall-clock seconds.
34
+ */
35
+ export declare function reconnecting(connector: Connector, now: number): boolean;
36
+ /** Why nothing can be started on an offline machine, and what to do: wait a moment when it is reconnecting, else start it. */
37
+ export declare function offlineText(connector: Connector, now: number, lang?: Lang): string;
38
+ /** The sentence `resolveAgent` gives when nothing the user has is called `ref`. */
39
+ export declare function noAgentCalled(ref: string, lang?: Lang): string;
40
+ /**
41
+ * The agent a user named, or why none: `AGENT` is an agent id (or what people call it), `MACHINE/AGENT` names the machine as
42
+ * well, and a name that more than one online machine has must be qualified. A bare name that is no agent's but a machine's is
43
+ * read as the machine. `now`: wall-clock seconds.
44
+ */
45
+ export declare function resolveAgent(connectors: readonly Connector[], ref: string, now: number, lang?: Lang): Resolved;
46
+ /**
47
+ * The title and ref of the existing conversation a session of `agent` continues (or watches), as its connector lists it now: the
48
+ * one entry it says this connector holds (`attached`; for a watch, the one a terminal has open, `live`) in the session's folder.
49
+ * Both '' when that is not exactly one: a title is shown only when it is certain.
50
+ */
51
+ export declare function conversationOf(agent: Agent, session: Session, readOnly: boolean): {
52
+ title: string;
53
+ ref: string;
54
+ };
@@ -0,0 +1,5 @@
1
+ /** The marks a line of a list starts with, the same emoji every card uses for the meaning. */
2
+ export declare const MARKS: {
3
+ readonly needsYou: "⚠️";
4
+ readonly working: "⏳";
5
+ };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The user's machines (connectors), the agents each reports and their remote sessions, as the remote-agent domain reads them:
3
+ * Claw's answers as the Claw client parsed them (`claw/remote.ts`, where a field that is absent or of another type is
4
+ * `undefined`), with the defaults the Python worker read them with (`dict.get(...)` and its fallbacks). Text stays as it came:
5
+ * whatever shows it makes it inert. An agent's `capabilities` stay opaque (the connector's own keys, read one by one where they
6
+ * are used), and times stay the strings Claw sent (they are compared and aged as written).
7
+ */
8
+ import type { RemoteAgent, RemoteConnector, RemoteSession } from "../claw/remote.js";
9
+ /** An agent a machine reports. */
10
+ export type Agent = {
11
+ readonly agentId: string;
12
+ readonly kind: string;
13
+ readonly name: string;
14
+ readonly capabilities: Readonly<Record<string, unknown>>;
15
+ };
16
+ /** One of the user's machines: its connector, whether it is online now, and the agents it reports. */
17
+ export type Connector = {
18
+ readonly connectorId: string;
19
+ readonly name: string;
20
+ readonly online: boolean;
21
+ /** The connector's version as it reported it ("" not said). */
22
+ readonly version: string;
23
+ /** Claw's word on that version: current | outdated | unsupported | unknown ("" not said). */
24
+ readonly versionStatus: string;
25
+ /** When Claw last heard from it, ISO 8601 as Claw wrote it ("" not said); `heartbeatAt` is the older field of the same. */
26
+ readonly lastSeenAt: string;
27
+ readonly heartbeatAt: string;
28
+ /** Joined with a pairing code (`claw-connector pair`) rather than a sign-in. */
29
+ readonly paired: boolean;
30
+ readonly agents: readonly Agent[];
31
+ };
32
+ /** One of the user's remote sessions. */
33
+ export type Session = {
34
+ readonly sessionId: string;
35
+ readonly connectorId: string;
36
+ readonly agentId: string;
37
+ readonly cwd: string;
38
+ /** active | closed (another word from a newer Claw is kept as it came). */
39
+ readonly status: string;
40
+ /** The session only watches a conversation open in a terminal (null: not said). */
41
+ readonly readOnly: boolean | null;
42
+ /** When it last changed, as Claw wrote it ("" not said): the newest is the one an agent's name attaches to. */
43
+ readonly updatedAt: string;
44
+ };
45
+ export declare function agentFrom(raw: RemoteAgent): Agent;
46
+ export declare function connectorFrom(raw: RemoteConnector): Connector;
47
+ export declare function sessionFrom(raw: RemoteSession): Session;
48
+ /** The connector `connectorId` names, or undefined. */
49
+ export declare function connectorById(connectors: readonly Connector[], connectorId: string): Connector | undefined;
50
+ /** The agent `agentId` names on `connector`, or undefined. */
51
+ export declare function agentById(connector: Connector | undefined, agentId: string): Agent | undefined;