@primusclaw/personal-agent 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (444) hide show
  1. package/dist/LICENSE +37 -0
  2. package/dist/index.js +31875 -0
  3. package/dist/types/approvals/approval-view.d.ts +70 -0
  4. package/dist/types/approvals/click.d.ts +8 -0
  5. package/dist/types/approvals/decide.d.ts +64 -0
  6. package/dist/types/approvals/handler.d.ts +22 -0
  7. package/dist/types/approvals/index.d.ts +9 -0
  8. package/dist/types/approvals/questions.d.ts +36 -0
  9. package/dist/types/approvals/records.d.ts +43 -0
  10. package/dist/types/approvals/sensitive.d.ts +13 -0
  11. package/dist/types/approvals/turn-cards.d.ts +7 -0
  12. package/dist/types/approvals/views.d.ts +67 -0
  13. package/dist/types/assistant/action-handler.d.ts +13 -0
  14. package/dist/types/assistant/actions.d.ts +63 -0
  15. package/dist/types/assistant/auto-reply.d.ts +14 -0
  16. package/dist/types/assistant/board.d.ts +68 -0
  17. package/dist/types/assistant/chat.d.ts +166 -0
  18. package/dist/types/assistant/citation-sources.d.ts +20 -0
  19. package/dist/types/assistant/citations.d.ts +38 -0
  20. package/dist/types/assistant/confirm-outcome.d.ts +11 -0
  21. package/dist/types/assistant/devenv-hide-outcome.d.ts +4 -0
  22. package/dist/types/assistant/events.d.ts +53 -0
  23. package/dist/types/assistant/failures.d.ts +16 -0
  24. package/dist/types/assistant/files.d.ts +37 -0
  25. package/dist/types/assistant/finish.d.ts +8 -0
  26. package/dist/types/assistant/follow.d.ts +75 -0
  27. package/dist/types/assistant/index.d.ts +12 -0
  28. package/dist/types/assistant/informative.d.ts +9 -0
  29. package/dist/types/assistant/item-of.d.ts +2 -0
  30. package/dist/types/assistant/receipt.d.ts +113 -0
  31. package/dist/types/assistant/receipts.d.ts +71 -0
  32. package/dist/types/assistant/say.d.ts +63 -0
  33. package/dist/types/assistant/tracked-stream.d.ts +30 -0
  34. package/dist/types/assistant/turn-in-front.d.ts +25 -0
  35. package/dist/types/assistant/views.d.ts +80 -0
  36. package/dist/types/assistant/watch-clicks.d.ts +34 -0
  37. package/dist/types/assistant/work-clicks.d.ts +53 -0
  38. package/dist/types/assistant/work-handler.d.ts +23 -0
  39. package/dist/types/assistant/work-items.d.ts +66 -0
  40. package/dist/types/branding.d.ts +5 -0
  41. package/dist/types/brief/brief.d.ts +40 -0
  42. package/dist/types/brief/index.d.ts +3 -0
  43. package/dist/types/brief/template.d.ts +8 -0
  44. package/dist/types/capabilities/capability.d.ts +49 -0
  45. package/dist/types/capabilities/command-text.d.ts +11 -0
  46. package/dist/types/capabilities/entries-chat.d.ts +3 -0
  47. package/dist/types/capabilities/entries-notify.d.ts +3 -0
  48. package/dist/types/capabilities/entries-settings.d.ts +3 -0
  49. package/dist/types/capabilities/help.d.ts +24 -0
  50. package/dist/types/capabilities/natural.d.ts +19 -0
  51. package/dist/types/capabilities/phrases.d.ts +42 -0
  52. package/dist/types/capabilities/registry.d.ts +12 -0
  53. package/dist/types/capabilities/sessions-words.d.ts +9 -0
  54. package/dist/types/capabilities/spoken.d.ts +19 -0
  55. package/dist/types/capabilities/visibility.d.ts +32 -0
  56. package/dist/types/claw/credential.d.ts +8 -0
  57. package/dist/types/claw/errors.d.ts +61 -0
  58. package/dist/types/claw/lenient.d.ts +23 -0
  59. package/dist/types/claw/message-text.d.ts +28 -0
  60. package/dist/types/claw/model.d.ts +118 -0
  61. package/dist/types/claw/py-value.d.ts +7 -0
  62. package/dist/types/claw/remote.d.ts +138 -0
  63. package/dist/types/claw/requester-view.d.ts +15 -0
  64. package/dist/types/claw/service-refusal.d.ts +4 -0
  65. package/dist/types/claw/sse.d.ts +12 -0
  66. package/dist/types/claw/started-review.d.ts +7 -0
  67. package/dist/types/claw/work-item.d.ts +25 -0
  68. package/dist/types/commands/agent-args.d.ts +9 -0
  69. package/dist/types/commands/names.d.ts +19 -0
  70. package/dist/types/commands/parse.d.ts +33 -0
  71. package/dist/types/commands/repo.d.ts +17 -0
  72. package/dist/types/config/settings.d.ts +124 -0
  73. package/dist/types/direct-chat/direct-chat.d.ts +73 -0
  74. package/dist/types/direct-chat/index.d.ts +2 -0
  75. package/dist/types/errors.d.ts +15 -0
  76. package/dist/types/feedback/deadline.d.ts +10 -0
  77. package/dist/types/feedback/delivery.d.ts +34 -0
  78. package/dist/types/feedback/exchange.d.ts +19 -0
  79. package/dist/types/feedback/flow.d.ts +36 -0
  80. package/dist/types/feedback/handlers.d.ts +16 -0
  81. package/dist/types/feedback/history.d.ts +20 -0
  82. package/dist/types/feedback/identifiers.d.ts +16 -0
  83. package/dist/types/feedback/index.d.ts +16 -0
  84. package/dist/types/feedback/iso-time.d.ts +2 -0
  85. package/dist/types/feedback/issue-text.d.ts +50 -0
  86. package/dist/types/feedback/log-text.d.ts +13 -0
  87. package/dist/types/feedback/markdown.d.ts +4 -0
  88. package/dist/types/feedback/reporting.d.ts +25 -0
  89. package/dist/types/feedback/scene.d.ts +65 -0
  90. package/dist/types/feedback/service.d.ts +74 -0
  91. package/dist/types/feedback/thumbs.d.ts +59 -0
  92. package/dist/types/feedback/views.d.ts +35 -0
  93. package/dist/types/guardrails/correlation.d.ts +8 -0
  94. package/dist/types/guardrails/guardrails.d.ts +49 -0
  95. package/dist/types/guardrails/index.d.ts +4 -0
  96. package/dist/types/guardrails/operations.d.ts +22 -0
  97. package/dist/types/guardrails/sha256.d.ts +1 -0
  98. package/dist/types/inbound-text/index.d.ts +9 -0
  99. package/dist/types/inbound-text/marked-text.d.ts +20 -0
  100. package/dist/types/inbound-text/quote-block.d.ts +26 -0
  101. package/dist/types/inbound-text/redact.d.ts +8 -0
  102. package/dist/types/inbound-text/when.d.ts +2 -0
  103. package/dist/types/inbound-text/with-links.d.ts +20 -0
  104. package/dist/types/index.d.ts +73 -0
  105. package/dist/types/json.d.ts +5 -0
  106. package/dist/types/language/detect.d.ts +21 -0
  107. package/dist/types/limits/inbound-stats.d.ts +42 -0
  108. package/dist/types/limits/index.d.ts +5 -0
  109. package/dist/types/limits/rate-limiter.d.ts +32 -0
  110. package/dist/types/limits/user-limits.d.ts +18 -0
  111. package/dist/types/limits/wait-words.d.ts +3 -0
  112. package/dist/types/locales/account.d.ts +49 -0
  113. package/dist/types/locales/approval-decisions.d.ts +28 -0
  114. package/dist/types/locales/approval.d.ts +31 -0
  115. package/dist/types/locales/assistant-actions.d.ts +65 -0
  116. package/dist/types/locales/assistant-board.d.ts +14 -0
  117. package/dist/types/locales/assistant-cards.d.ts +81 -0
  118. package/dist/types/locales/assistant-chat.d.ts +13 -0
  119. package/dist/types/locales/assistant-devenv-hide.d.ts +23 -0
  120. package/dist/types/locales/assistant-work-clicks.d.ts +98 -0
  121. package/dist/types/locales/assistant.d.ts +5 -0
  122. package/dist/types/locales/brief.d.ts +29 -0
  123. package/dist/types/locales/catalog.d.ts +24 -0
  124. package/dist/types/locales/claw.d.ts +5 -0
  125. package/dist/types/locales/commands.d.ts +12 -0
  126. package/dist/types/locales/connector-reasons.d.ts +95 -0
  127. package/dist/types/locales/connector-setup.d.ts +20 -0
  128. package/dist/types/locales/feedback.d.ts +75 -0
  129. package/dist/types/locales/group.d.ts +33 -0
  130. package/dist/types/locales/guardrails.d.ts +22 -0
  131. package/dist/types/locales/help-lead.d.ts +15 -0
  132. package/dist/types/locales/index.d.ts +16 -0
  133. package/dist/types/locales/lang.d.ts +9 -0
  134. package/dist/types/locales/limits.d.ts +19 -0
  135. package/dist/types/locales/link.d.ts +40 -0
  136. package/dist/types/locales/observe.d.ts +113 -0
  137. package/dist/types/locales/proactive-lines.d.ts +12 -0
  138. package/dist/types/locales/proactive.d.ts +62 -0
  139. package/dist/types/locales/remote-agents.d.ts +216 -0
  140. package/dist/types/locales/remote-leads.d.ts +13 -0
  141. package/dist/types/locales/remote-window-card.d.ts +46 -0
  142. package/dist/types/locales/remote-window.d.ts +21 -0
  143. package/dist/types/locales/remote.d.ts +365 -0
  144. package/dist/types/locales/review-account.d.ts +43 -0
  145. package/dist/types/locales/review-github.d.ts +19 -0
  146. package/dist/types/locales/review-receipt.d.ts +45 -0
  147. package/dist/types/locales/review-request.d.ts +21 -0
  148. package/dist/types/locales/review-start.d.ts +46 -0
  149. package/dist/types/locales/routing.d.ts +21 -0
  150. package/dist/types/locales/sessions.d.ts +38 -0
  151. package/dist/types/locales/settings.d.ts +46 -0
  152. package/dist/types/locales/steps.d.ts +42 -0
  153. package/dist/types/locales/transparency.d.ts +18 -0
  154. package/dist/types/locales/turn.d.ts +70 -0
  155. package/dist/types/locales/typed-answer.d.ts +32 -0
  156. package/dist/types/note/note.d.ts +22 -0
  157. package/dist/types/observability/ip-address.d.ts +13 -0
  158. package/dist/types/observability/metrics-catalog.d.ts +17 -0
  159. package/dist/types/observability/security-events.d.ts +26 -0
  160. package/dist/types/observability/security-fields.d.ts +8 -0
  161. package/dist/types/observability/security-log.d.ts +21 -0
  162. package/dist/types/observe/board.d.ts +18 -0
  163. package/dist/types/observe/command.d.ts +6 -0
  164. package/dist/types/observe/index.d.ts +6 -0
  165. package/dist/types/observe/observer.d.ts +45 -0
  166. package/dist/types/observe/suggestions.d.ts +16 -0
  167. package/dist/types/observe/views.d.ts +19 -0
  168. package/dist/types/own.d.ts +9 -0
  169. package/dist/types/plugins/feedback-sink.d.ts +31 -0
  170. package/dist/types/plugins/identity-lookup.d.ts +21 -0
  171. package/dist/types/plugins/index.d.ts +31 -0
  172. package/dist/types/plugins/integrations.d.ts +34 -0
  173. package/dist/types/plugins/key-revoker.d.ts +10 -0
  174. package/dist/types/plugins/model-refusal-policy.d.ts +25 -0
  175. package/dist/types/plugins/route-extension.d.ts +27 -0
  176. package/dist/types/plugins/token-exchange.d.ts +36 -0
  177. package/dist/types/ports/claw/assistant.d.ts +55 -0
  178. package/dist/types/ports/claw/index.d.ts +28 -0
  179. package/dist/types/ports/claw/remote-agents.d.ts +53 -0
  180. package/dist/types/ports/claw/sessions.d.ts +105 -0
  181. package/dist/types/ports/claw/settings.d.ts +62 -0
  182. package/dist/types/ports/claw/work-items.d.ts +32 -0
  183. package/dist/types/ports/clock.d.ts +17 -0
  184. package/dist/types/ports/crypto.d.ts +15 -0
  185. package/dist/types/ports/github.d.ts +97 -0
  186. package/dist/types/ports/index.d.ts +18 -0
  187. package/dist/types/ports/logger.d.ts +19 -0
  188. package/dist/types/ports/metrics.d.ts +21 -0
  189. package/dist/types/ports/random.d.ts +15 -0
  190. package/dist/types/ports/request-scope.d.ts +31 -0
  191. package/dist/types/ports/routing.d.ts +107 -0
  192. package/dist/types/ports/secret-source.d.ts +21 -0
  193. package/dist/types/ports/store/approvals.d.ts +47 -0
  194. package/dist/types/ports/store/assistant.d.ts +104 -0
  195. package/dist/types/ports/store/feedback.d.ts +80 -0
  196. package/dist/types/ports/store/github.d.ts +81 -0
  197. package/dist/types/ports/store/idempotency.d.ts +21 -0
  198. package/dist/types/ports/store/index.d.ts +65 -0
  199. package/dist/types/ports/store/json.d.ts +4 -0
  200. package/dist/types/ports/store/link.d.ts +39 -0
  201. package/dist/types/ports/store/notify.d.ts +28 -0
  202. package/dist/types/ports/store/observe.d.ts +53 -0
  203. package/dist/types/ports/store/onboarding.d.ts +49 -0
  204. package/dist/types/ports/store/people.d.ts +77 -0
  205. package/dist/types/ports/store/policy.d.ts +60 -0
  206. package/dist/types/ports/store/remote.d.ts +114 -0
  207. package/dist/types/ports/store/sessions.d.ts +59 -0
  208. package/dist/types/ports/store/turns.d.ts +30 -0
  209. package/dist/types/ports/surface.d.ts +394 -0
  210. package/dist/types/ports/turn-cards.d.ts +52 -0
  211. package/dist/types/proactive/deliver.d.ts +52 -0
  212. package/dist/types/proactive/deps.d.ts +77 -0
  213. package/dist/types/proactive/events.d.ts +10 -0
  214. package/dist/types/proactive/index.d.ts +6 -0
  215. package/dist/types/proactive/proactive.d.ts +62 -0
  216. package/dist/types/proactive/quiet.d.ts +27 -0
  217. package/dist/types/proactive/release.d.ts +24 -0
  218. package/dist/types/proactive/said-memory.d.ts +21 -0
  219. package/dist/types/proactive/views.d.ts +67 -0
  220. package/dist/types/protocol/claw-api/assistant-events.d.ts +223 -0
  221. package/dist/types/protocol/claw-api/index.d.ts +5 -0
  222. package/dist/types/protocol/claw-api/notifications.d.ts +85 -0
  223. package/dist/types/protocol/claw-api/reviews.d.ts +63 -0
  224. package/dist/types/protocol/claw-api/session-events.d.ts +34 -0
  225. package/dist/types/protocol/claw-api/work-items.d.ts +75 -0
  226. package/dist/types/protocol/remote-agents.d.ts +230 -0
  227. package/dist/types/protocol.d.ts +10 -0
  228. package/dist/types/public-error/classify.d.ts +21 -0
  229. package/dist/types/public-error/index.d.ts +4 -0
  230. package/dist/types/public-error/patterns.d.ts +20 -0
  231. package/dist/types/public-error/public-error-log.d.ts +15 -0
  232. package/dist/types/public-error/public-errors.d.ts +20 -0
  233. package/dist/types/remote/actions.d.ts +36 -0
  234. package/dist/types/remote/agents.d.ts +37 -0
  235. package/dist/types/remote/answer.d.ts +9 -0
  236. package/dist/types/remote/board.d.ts +108 -0
  237. package/dist/types/remote/cards.d.ts +4 -0
  238. package/dist/types/remote/chat-key.d.ts +13 -0
  239. package/dist/types/remote/chats.d.ts +76 -0
  240. package/dist/types/remote/clicks-machine.d.ts +24 -0
  241. package/dist/types/remote/clicks-start.d.ts +36 -0
  242. package/dist/types/remote/clicks.d.ts +61 -0
  243. package/dist/types/remote/commands.d.ts +60 -0
  244. package/dist/types/remote/connector/reasons.d.ts +31 -0
  245. package/dist/types/remote/connector/setup.d.ts +62 -0
  246. package/dist/types/remote/context.d.ts +101 -0
  247. package/dist/types/remote/conversations.d.ts +37 -0
  248. package/dist/types/remote/ended.d.ts +25 -0
  249. package/dist/types/remote/events.d.ts +65 -0
  250. package/dist/types/remote/fields.d.ts +7 -0
  251. package/dist/types/remote/follow/control.d.ts +39 -0
  252. package/dist/types/remote/follow/follower.d.ts +85 -0
  253. package/dist/types/remote/follow/inbox.d.ts +16 -0
  254. package/dist/types/remote/follow/speaker.d.ts +122 -0
  255. package/dist/types/remote/follow/steps.d.ts +9 -0
  256. package/dist/types/remote/follow/timings.d.ts +29 -0
  257. package/dist/types/remote/health.d.ts +20 -0
  258. package/dist/types/remote/index.d.ts +21 -0
  259. package/dist/types/remote/inert.d.ts +18 -0
  260. package/dist/types/remote/limits.d.ts +48 -0
  261. package/dist/types/remote/lines.d.ts +66 -0
  262. package/dist/types/remote/links/answer.d.ts +7 -0
  263. package/dist/types/remote/links/domains.d.ts +19 -0
  264. package/dist/types/remote/links/hosts.d.ts +2 -0
  265. package/dist/types/remote/links/scans.d.ts +27 -0
  266. package/dist/types/remote/listing.d.ts +38 -0
  267. package/dist/types/remote/lists.d.ts +56 -0
  268. package/dist/types/remote/machines.d.ts +54 -0
  269. package/dist/types/remote/marks.d.ts +5 -0
  270. package/dist/types/remote/model.d.ts +51 -0
  271. package/dist/types/remote/options.d.ts +20 -0
  272. package/dist/types/remote/permissions.d.ts +41 -0
  273. package/dist/types/remote/ports.d.ts +143 -0
  274. package/dist/types/remote/prompt.d.ts +60 -0
  275. package/dist/types/remote/refusals.d.ts +40 -0
  276. package/dist/types/remote/remote-agents.d.ts +84 -0
  277. package/dist/types/remote/reported.d.ts +8 -0
  278. package/dist/types/remote/session-ops.d.ts +57 -0
  279. package/dist/types/remote/sessions.d.ts +80 -0
  280. package/dist/types/remote/setup.d.ts +26 -0
  281. package/dist/types/remote/state.d.ts +55 -0
  282. package/dist/types/remote/tail.d.ts +63 -0
  283. package/dist/types/remote/targets.d.ts +66 -0
  284. package/dist/types/remote/tasks.d.ts +20 -0
  285. package/dist/types/remote/time.d.ts +15 -0
  286. package/dist/types/remote/turn-state.d.ts +29 -0
  287. package/dist/types/remote/turns/chat-turn.d.ts +50 -0
  288. package/dist/types/remote/turns/display.d.ts +18 -0
  289. package/dist/types/remote/turns/outcome.d.ts +41 -0
  290. package/dist/types/remote/turns/runner.d.ts +55 -0
  291. package/dist/types/remote/turns/signer.d.ts +14 -0
  292. package/dist/types/remote/turns/window-turn.d.ts +29 -0
  293. package/dist/types/remote/views.d.ts +13 -0
  294. package/dist/types/remote/watches.d.ts +64 -0
  295. package/dist/types/remote/window/closer.d.ts +14 -0
  296. package/dist/types/remote/window/index.d.ts +2 -0
  297. package/dist/types/remote/window/output.d.ts +28 -0
  298. package/dist/types/remote/window/view.d.ts +73 -0
  299. package/dist/types/remote-view/agents-view.d.ts +88 -0
  300. package/dist/types/remote-view/conversations-view.d.ts +51 -0
  301. package/dist/types/remote-view/hidden-view.d.ts +20 -0
  302. package/dist/types/remote-view/index.d.ts +40 -0
  303. package/dist/types/remote-view/live-view.d.ts +44 -0
  304. package/dist/types/remote-view/machine-views.d.ts +73 -0
  305. package/dist/types/remote-view/messages.d.ts +3 -0
  306. package/dist/types/remote-view/permission-view.d.ts +55 -0
  307. package/dist/types/remote-view/sessions-view.d.ts +70 -0
  308. package/dist/types/remote-view/status-view.d.ts +52 -0
  309. package/dist/types/remote-view/window-view.d.ts +68 -0
  310. package/dist/types/result.d.ts +31 -0
  311. package/dist/types/review/connect/connections.d.ts +24 -0
  312. package/dist/types/review/connect/github-connect.d.ts +50 -0
  313. package/dist/types/review/connect/questions.d.ts +6 -0
  314. package/dist/types/review/connect/review-ask.d.ts +1 -0
  315. package/dist/types/review/consent.d.ts +13 -0
  316. package/dist/types/review/handoff.d.ts +22 -0
  317. package/dist/types/review/held.d.ts +15 -0
  318. package/dist/types/review/index.d.ts +14 -0
  319. package/dist/types/review/intent-check.d.ts +36 -0
  320. package/dist/types/review/outcome.d.ts +36 -0
  321. package/dist/types/review/progress.d.ts +50 -0
  322. package/dist/types/review/prompts.d.ts +2 -0
  323. package/dist/types/review/receipt.d.ts +45 -0
  324. package/dist/types/review/refusals.d.ts +44 -0
  325. package/dist/types/review/request-parse.d.ts +40 -0
  326. package/dist/types/review/review-turn.d.ts +83 -0
  327. package/dist/types/review/service/account.d.ts +52 -0
  328. package/dist/types/review/service/chat.d.ts +18 -0
  329. package/dist/types/review/service/confirm.d.ts +49 -0
  330. package/dist/types/review/service/deps.d.ts +100 -0
  331. package/dist/types/review/service/follow.d.ts +53 -0
  332. package/dist/types/review/service/github-review.d.ts +72 -0
  333. package/dist/types/review/service/handoff-action.d.ts +32 -0
  334. package/dist/types/review/service/identity.d.ts +27 -0
  335. package/dist/types/review/service/item-cards.d.ts +39 -0
  336. package/dist/types/review/service/items.d.ts +57 -0
  337. package/dist/types/review/service/launch.d.ts +37 -0
  338. package/dist/types/review/service/notices.d.ts +42 -0
  339. package/dist/types/review/service/request.d.ts +58 -0
  340. package/dist/types/review/service/reviewer.d.ts +48 -0
  341. package/dist/types/review/service/routed-turn.d.ts +20 -0
  342. package/dist/types/review/service/start.d.ts +65 -0
  343. package/dist/types/review/service/turns.d.ts +38 -0
  344. package/dist/types/review/summary.d.ts +11 -0
  345. package/dist/types/review/views.d.ts +91 -0
  346. package/dist/types/review-text/asks.d.ts +13 -0
  347. package/dist/types/review-text/bare-numbers.d.ts +29 -0
  348. package/dist/types/review-text/index.d.ts +10 -0
  349. package/dist/types/review-text/markers.d.ts +6 -0
  350. package/dist/types/review-text/names.d.ts +60 -0
  351. package/dist/types/review-text/pull-ref.d.ts +25 -0
  352. package/dist/types/review-text/text/scan.d.ts +19 -0
  353. package/dist/types/review-text/text/unicode.d.ts +22 -0
  354. package/dist/types/routing/admission.d.ts +83 -0
  355. package/dist/types/routing/chat.d.ts +52 -0
  356. package/dist/types/routing/command-table.d.ts +32 -0
  357. package/dist/types/routing/commands-account.d.ts +26 -0
  358. package/dist/types/routing/commands-session.d.ts +40 -0
  359. package/dist/types/routing/commands-settings.d.ts +17 -0
  360. package/dist/types/routing/context.d.ts +38 -0
  361. package/dist/types/routing/credentials.d.ts +53 -0
  362. package/dist/types/routing/deps.d.ts +116 -0
  363. package/dist/types/routing/features.d.ts +256 -0
  364. package/dist/types/routing/group-remote.d.ts +26 -0
  365. package/dist/types/routing/group-router.d.ts +42 -0
  366. package/dist/types/routing/identity.d.ts +18 -0
  367. package/dist/types/routing/index.d.ts +26 -0
  368. package/dist/types/routing/link-commands.d.ts +26 -0
  369. package/dist/types/routing/lock.d.ts +5 -0
  370. package/dist/types/routing/onboarding.d.ts +51 -0
  371. package/dist/types/routing/personal-router.d.ts +34 -0
  372. package/dist/types/routing/personal-text.d.ts +62 -0
  373. package/dist/types/routing/router.d.ts +57 -0
  374. package/dist/types/routing/show-here.d.ts +18 -0
  375. package/dist/types/routing/stop-press.d.ts +19 -0
  376. package/dist/types/routing/time.d.ts +31 -0
  377. package/dist/types/routing/turn-registry.d.ts +71 -0
  378. package/dist/types/routing/turn-runner.d.ts +82 -0
  379. package/dist/types/routing/turn-start.d.ts +81 -0
  380. package/dist/types/routing/views.d.ts +104 -0
  381. package/dist/types/security/redact-scan.d.ts +19 -0
  382. package/dist/types/security/redact-text.d.ts +14 -0
  383. package/dist/types/security/redact.d.ts +2 -0
  384. package/dist/types/subscriptions/event-types.d.ts +29 -0
  385. package/dist/types/subscriptions/index.d.ts +3 -0
  386. package/dist/types/subscriptions/ports.d.ts +9 -0
  387. package/dist/types/subscriptions/subscriptions.d.ts +69 -0
  388. package/dist/types/text/neutral.d.ts +1 -0
  389. package/dist/types/text/plain.d.ts +6 -0
  390. package/dist/types/text/py-chars.d.ts +12 -0
  391. package/dist/types/text/py-json.d.ts +23 -0
  392. package/dist/types/text/py-number.d.ts +18 -0
  393. package/dist/types/text/py-regex-escapes.d.ts +32 -0
  394. package/dist/types/text/py-regex.d.ts +36 -0
  395. package/dist/types/text/py-text.d.ts +64 -0
  396. package/dist/types/turn/answer-parts.d.ts +23 -0
  397. package/dist/types/turn/changes.d.ts +42 -0
  398. package/dist/types/turn/clip.d.ts +6 -0
  399. package/dist/types/turn/deliveries.d.ts +31 -0
  400. package/dist/types/turn/engine/claw-errors.d.ts +7 -0
  401. package/dist/types/turn/engine/consume.d.ts +35 -0
  402. package/dist/types/turn/engine/context.d.ts +157 -0
  403. package/dist/types/turn/engine/extras.d.ts +16 -0
  404. package/dist/types/turn/engine/fallback.d.ts +17 -0
  405. package/dist/types/turn/engine/outcome.d.ts +33 -0
  406. package/dist/types/turn/engine/run-turn.d.ts +22 -0
  407. package/dist/types/turn/engine/submit.d.ts +23 -0
  408. package/dist/types/turn/files.d.ts +10 -0
  409. package/dist/types/turn/github-outcome.d.ts +16 -0
  410. package/dist/types/turn/index.d.ts +26 -0
  411. package/dist/types/turn/json.d.ts +10 -0
  412. package/dist/types/turn/last-answer.d.ts +44 -0
  413. package/dist/types/turn/live-view.d.ts +67 -0
  414. package/dist/types/turn/plan.d.ts +31 -0
  415. package/dist/types/turn/ports.d.ts +15 -0
  416. package/dist/types/turn/progress/answer-messages.d.ts +20 -0
  417. package/dist/types/turn/progress/status-message.d.ts +144 -0
  418. package/dist/types/turn/progress/status-policy.d.ts +66 -0
  419. package/dist/types/turn/progress/status-text.d.ts +10 -0
  420. package/dist/types/turn/progress/stream-handle.d.ts +39 -0
  421. package/dist/types/turn/records.d.ts +10 -0
  422. package/dist/types/turn/runner.d.ts +106 -0
  423. package/dist/types/turn/step-labels.d.ts +28 -0
  424. package/dist/types/turn/step.d.ts +26 -0
  425. package/dist/types/turn/stop-buttons.d.ts +62 -0
  426. package/dist/types/turn/task.d.ts +33 -0
  427. package/dist/types/turn/turn-state.d.ts +70 -0
  428. package/dist/types/turn/views.d.ts +23 -0
  429. package/dist/types/typed-answer/index.d.ts +8 -0
  430. package/dist/types/typed-answer/mode.d.ts +38 -0
  431. package/dist/types/typed-answer/patterns.d.ts +25 -0
  432. package/dist/types/typed-answer/prompt.d.ts +5 -0
  433. package/dist/types/typed-answer/read.d.ts +16 -0
  434. package/dist/types/understanding/commands.d.ts +14 -0
  435. package/dist/types/understanding/context.d.ts +49 -0
  436. package/dist/types/understanding/index.d.ts +11 -0
  437. package/dist/types/understanding/limits.d.ts +6 -0
  438. package/dist/types/understanding/people.d.ts +31 -0
  439. package/dist/types/understanding/record.d.ts +10 -0
  440. package/dist/types/understanding/review-stop.d.ts +7 -0
  441. package/dist/types/understanding/sequence-matcher.d.ts +7 -0
  442. package/dist/types/validate.d.ts +15 -0
  443. package/package.json +35 -4
  444. package/README.md +0 -3
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The agents card (`/agents`): per machine its agents, per online agent a "New session" form (a folder from the roots it reported,
3
+ * a subfolder to type, one button) and the conversations it offers, then the user's sessions with Attach / Detach / Close. Every
4
+ * button carries {"primusclaw": "remote", "op": ...}; the worker checks every click against Claw's own lists, never against the card.
5
+ */
6
+ import type { AgentsInput } from "../remote/ports.js";
7
+ import type { Lang } from "../locales/lang.js";
8
+ import { type RemoteButton } from "../remote/actions.js";
9
+ import { type ApprovalInput } from "./machine-views.js";
10
+ import { type ConversationItem } from "./conversations-view.js";
11
+ /** Where a new session starts: a choice of the roots the agent reported and a subfolder, or (none reported) the whole folder. */
12
+ export type StartFolder = {
13
+ readonly kind: "roots";
14
+ readonly label: string;
15
+ readonly roots: readonly {
16
+ title: string;
17
+ value: string;
18
+ }[];
19
+ readonly subfolder: FolderInput;
20
+ } | {
21
+ readonly kind: "folder";
22
+ readonly input: FolderInput;
23
+ };
24
+ export interface FolderInput {
25
+ readonly label: string;
26
+ readonly placeholder: string;
27
+ readonly maxLength: number;
28
+ }
29
+ /** One online agent's block. Input ids carry the slot: a card's inputs all come back with every button. */
30
+ export interface AgentBlock {
31
+ readonly kind: "agent";
32
+ readonly slot: number;
33
+ /** `icon name`, inert. */
34
+ readonly title: string;
35
+ readonly unattendedNote: string | null;
36
+ /** null for an agent of kind `attach`, which starts no conversation of its own. */
37
+ readonly start: {
38
+ readonly folder: StartFolder;
39
+ readonly approval: ApprovalInput | null;
40
+ readonly button: RemoteButton;
41
+ } | null;
42
+ readonly conversations: readonly ConversationItem[];
43
+ readonly nothingToTakeOver: string | null;
44
+ }
45
+ export interface SessionRow {
46
+ readonly kind: "session";
47
+ readonly number: number;
48
+ readonly line: string;
49
+ readonly buttons: readonly RemoteButton[];
50
+ }
51
+ export type AgentsItem = {
52
+ readonly kind: "lead";
53
+ readonly text: string;
54
+ } | {
55
+ readonly kind: "machine";
56
+ readonly text: string;
57
+ readonly separator: boolean;
58
+ } | {
59
+ readonly kind: "versionNote";
60
+ readonly text: string;
61
+ } | {
62
+ readonly kind: "problems";
63
+ readonly lines: readonly string[];
64
+ } | {
65
+ readonly kind: "subtle";
66
+ readonly text: string;
67
+ } | AgentBlock | {
68
+ readonly kind: "heading";
69
+ readonly text: string;
70
+ } | SessionRow | {
71
+ readonly kind: "plain";
72
+ readonly text: string;
73
+ } | {
74
+ readonly kind: "footer";
75
+ readonly text: string;
76
+ };
77
+ export interface AgentsView {
78
+ readonly lang: Lang;
79
+ /** false: the sessions part alone (`/agent sessions`). */
80
+ readonly machines: boolean;
81
+ readonly title: string;
82
+ readonly items: readonly AgentsItem[];
83
+ readonly actions: readonly RemoteButton[];
84
+ /** The session ids it lists in order: the numbers of `/agent attach N`. */
85
+ readonly listing: readonly string[];
86
+ }
87
+ /** The agents card as a view: what it says and what each button does. */
88
+ export declare function agentsView(input: AgentsInput): AgentsView;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The conversations an agent offers on the agents card, in three groups: those a terminal has open now (shared, never taken from
3
+ * it: Connect or Watch only, or, when this chat is connected to it, that and Disconnect); below them, labelled, those no process
4
+ * runs (Take over) and those the connector cannot tell. One this connector already holds for a session of this chat is not listed.
5
+ */
6
+ import type { Lang } from "../locales/lang.js";
7
+ import { type RemoteButton } from "../remote/actions.js";
8
+ import { type Conversation } from "../remote/conversations.js";
9
+ import type { Agent, Connector } from "../remote/model.js";
10
+ export type ConversationItem =
11
+ /** Its title (inert, or "Untitled") and, under it, its folder and how long ago. */
12
+ {
13
+ readonly kind: "conversation";
14
+ readonly title: string;
15
+ readonly where: string;
16
+ }
17
+ /** A small subtle line right under the conversation. */
18
+ | {
19
+ readonly kind: "note";
20
+ readonly text: string;
21
+ } | {
22
+ readonly kind: "buttons";
23
+ readonly buttons: readonly RemoteButton[];
24
+ }
25
+ /** The label of a group, with a separator above it when something is listed before it. */
26
+ | {
27
+ readonly kind: "group";
28
+ readonly text: string;
29
+ readonly separator: boolean;
30
+ } | {
31
+ readonly kind: "more";
32
+ readonly text: string;
33
+ };
34
+ /** The line under a conversation open in a terminal: what connecting to it does, and when the phone can only watch, why and
35
+ * what to change. */
36
+ export declare function shareNote(agent: Agent, entry: Conversation, lang: Lang): string;
37
+ /** The one button a conversation open in a terminal offers: connect, when what is sent is typed into that terminal; else watch. */
38
+ export declare function shareButton(agent: Agent, entry: Conversation, lang: Lang): {
39
+ title: string;
40
+ style: "positive" | null;
41
+ };
42
+ /** The conversations of one online agent on the agents card. */
43
+ export declare function conversationItems(connector: Connector, agent: Agent, now: number, lang: Lang, joined: {
44
+ readonly connected: ReadonlyMap<string, {
45
+ readonly number: number;
46
+ readonly sessionId: string;
47
+ }>;
48
+ readonly mine: ReadonlySet<string>;
49
+ }): ConversationItem[];
50
+ /** How many of an agent's conversations its owner hid here (Claw leaves them out of the list and counts them), or 0. */
51
+ export declare function hiddenCount(agent: Agent): number;
@@ -0,0 +1,20 @@
1
+ /** The conversations hidden on one machine, each with Unhide; then Unhide all and Back to the list. */
2
+ import type { Lang } from "../locales/lang.js";
3
+ import type { Connector } from "../remote/model.js";
4
+ import { type RemoteButton } from "../remote/actions.js";
5
+ /** Hidden conversations one card lists (a connector reports at most twelve per agent). */
6
+ export declare const HIDDEN_SHOWN = 20;
7
+ export interface HiddenView {
8
+ readonly lang: Lang;
9
+ readonly title: string;
10
+ readonly entries: readonly {
11
+ readonly title: string;
12
+ readonly where: string;
13
+ readonly unhide: RemoteButton;
14
+ }[];
15
+ /** Said when nothing is hidden; null otherwise. */
16
+ readonly nothing: string | null;
17
+ readonly actions: readonly RemoteButton[];
18
+ }
19
+ /** The hidden conversations of `connector` (from a listing with them included). */
20
+ export declare function hiddenView(connector: Connector, now: number, lang?: Lang): HiddenView;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * What a person sees of a remote agent (a coding agent on their own machine, reached through Claw's remote-agents API): reading
3
+ * its events, the live view of a turn, the lines a chat attached to it is told, and the views of its cards. Nothing here talks
4
+ * to Claw or a channel.
5
+ */
6
+ import type { AgentsView } from "./agents-view.js";
7
+ import type { DisconnectView, MachineChoiceView, ModeView, TakeoverView } from "./machine-views.js";
8
+ import type { DecidedView, PermissionView, RemoteAskView } from "./permission-view.js";
9
+ import type { SessionsView } from "./sessions-view.js";
10
+ import type { StatusView } from "./status-view.js";
11
+ import type { HiddenView } from "./hidden-view.js";
12
+ import type { WindowCardView } from "./window-view.js";
13
+ export * from "./agents-view.js";
14
+ export * from "./conversations-view.js";
15
+ export * from "./hidden-view.js";
16
+ export * from "./live-view.js";
17
+ export * from "./machine-views.js";
18
+ export * from "./permission-view.js";
19
+ export * from "./sessions-view.js";
20
+ export * from "./status-view.js";
21
+ export * from "./window-view.js";
22
+ export { remoteHealthText, remoteOffText, remoteQueuedText, remoteStopText, remoteText } from "../locales/remote.js";
23
+ export { remoteWindowCardText } from "../locales/remote-window-card.js";
24
+ declare module "../ports/surface.js" {
25
+ interface ViewMap {
26
+ remoteAgents: AgentsView;
27
+ remoteSessions: SessionsView;
28
+ remoteStatus: StatusView;
29
+ remotePermission: PermissionView;
30
+ remoteAsk: RemoteAskView;
31
+ remoteDecided: DecidedView;
32
+ remoteDisconnect: DisconnectView;
33
+ remoteTakeover: TakeoverView;
34
+ remoteMachineChoice: MachineChoiceView;
35
+ remoteMode: ModeView;
36
+ remoteWindow: WindowCardView;
37
+ remoteHidden: HiddenView;
38
+ }
39
+ }
40
+ export { createRemoteViews } from "./messages.js";
@@ -0,0 +1,44 @@
1
+ /**
2
+ * What a chat shows while a remote agent works: its own text as it streams, its thoughts as dim italic lines, one line for the
3
+ * plan, a line for a step that failed and one running line for the step running now. Bounded like Claw's own live view (the
4
+ * newest part that fits is kept). Credentials are masked at render time over the whole text, so a secret split across two
5
+ * chunks is still caught.
6
+ */
7
+ import type { RemoteStep } from "../remote/events.js";
8
+ import type { Lang } from "../locales/lang.js";
9
+ /** The live view of a turn shows at most this much below its header. */
10
+ export declare const LIVE_MAX_CHARS = 2500;
11
+ /** Blocks a live view keeps (a long turn does not grow it without bound). */
12
+ export declare const LIVE_KEEP_BLOCKS = 40;
13
+ /** The mark of the one line of the step that is running now. */
14
+ export declare const RUNNING_MARK = "\u23F3";
15
+ /** The newest paragraphs that fit `budget` characters, "..." when older ones were left out, and an unclosed code fence closed. */
16
+ export declare function boundedBody(paragraphs: readonly string[], budget: number): string;
17
+ export declare class RemoteLiveView {
18
+ readonly lang: Lang;
19
+ /** The first line of every render: who is working. */
20
+ readonly header: string;
21
+ private readonly blocks;
22
+ /** Tool call id -> title of the steps in flight, oldest first. */
23
+ private readonly active;
24
+ /** The next text starts a new block (a tool ran since the last one). */
25
+ private split;
26
+ /** Why the message waits, while it waits for a terminal on the machine (`terminal_input_queued`, said in the chat's language by
27
+ * the runner): the floating status says it, not only "Thinking…", until anything of the turn shows. */
28
+ private waiting;
29
+ constructor(label: string, lang?: Lang);
30
+ /** Fold one step in; true when what `render` returns changed. */
31
+ apply(step: RemoteStep): boolean;
32
+ /** The few short lines of Teams' floating status while the agent works: why the message still waits for the terminal, where
33
+ * its plan stands, a step that failed last, and the step running now. Its words are streamed into the answer's bubble, not
34
+ * into the status. */
35
+ statusLines(): string[];
36
+ /** The header and the newest part of the turn that fits. */
37
+ render(): string;
38
+ private addText;
39
+ private trackTool;
40
+ private setPlan;
41
+ private runningLine;
42
+ private paragraph;
43
+ private paragraphs;
44
+ }
@@ -0,0 +1,73 @@
1
+ /** The smaller cards of the remote agents: disconnecting a machine, taking over a terminal's conversation, picking an agent on a
2
+ * machine, picking a mode. */
3
+ import type { Lang } from "../locales/lang.js";
4
+ import { type RemoteButton } from "../remote/actions.js";
5
+ import { type Approval } from "../remote/agents.js";
6
+ import type { Conversation } from "../remote/conversations.js";
7
+ import type { Agent, Connector } from "../remote/model.js";
8
+ import type { ConnectorSetupWords } from "../remote/setup.js";
9
+ export interface DisconnectView {
10
+ readonly lang: Lang;
11
+ readonly title: string;
12
+ /** How to connect it again. */
13
+ readonly again: string;
14
+ /** The exact login command (a machine that signed in with login), null for a paired machine. */
15
+ readonly login: string | null;
16
+ readonly connectorId: string;
17
+ readonly confirm: string;
18
+ readonly keep: string;
19
+ }
20
+ /** Asks before a machine is disconnected: it ends every session on it, and says how to connect it again. `paired`: Claw says the
21
+ * machine was connected with a pairing code; a login command is no use there. */
22
+ export declare function disconnectView(host: string, connectorId: string, setup: ConnectorSetupWords, lang?: Lang, paired?: boolean): DisconnectView;
23
+ export interface TakeoverView {
24
+ readonly lang: Lang;
25
+ readonly title: string;
26
+ readonly conversation: string;
27
+ /** `host · folder`. */
28
+ readonly where: string;
29
+ readonly what: string;
30
+ readonly oneSide: string;
31
+ readonly buttons: readonly RemoteButton[];
32
+ }
33
+ /** What a tap on Take over… for a conversation open in a terminal opens: what will happen, in so many words, then Take over and
34
+ * Cancel. `ticket`: what the confirmation carries ("1" when none). */
35
+ export declare function takeoverView(connector: Connector, agent: Agent, entry: Conversation, lang?: Lang, view?: string, ticket?: string): TakeoverView;
36
+ export interface ApprovalInput {
37
+ readonly id: string;
38
+ readonly label: string;
39
+ readonly value: Approval;
40
+ readonly choices: readonly {
41
+ readonly title: string;
42
+ readonly value: Approval;
43
+ }[];
44
+ }
45
+ /** The choice between asking for approval and not, for an agent whose connector lets a client switch; null otherwise. */
46
+ export declare function approvalInput(agent: Agent, slot: number, lang: Lang): ApprovalInput | null;
47
+ export interface MachineChoiceView {
48
+ readonly lang: Lang;
49
+ readonly title: string;
50
+ readonly worksIn: string;
51
+ readonly agents: readonly {
52
+ readonly unattendedNote: string | null;
53
+ readonly approval: ApprovalInput | null;
54
+ readonly button: RemoteButton;
55
+ }[];
56
+ readonly more: string | null;
57
+ }
58
+ /** `/agent new MACHINE PATH` named a machine with more than one online agent: a block per agent, each starting the session in
59
+ * `path`. The folder is not in the buttons: the worker keeps what was typed under `token`, so a card cannot choose it. */
60
+ export declare function machineChoiceView(connector: Connector, agents: readonly Agent[], token: string, path: string, lang?: Lang): MachineChoiceView;
61
+ export interface ModeView {
62
+ readonly lang: Lang;
63
+ readonly title: string;
64
+ readonly value: string;
65
+ readonly choices: readonly {
66
+ readonly title: string;
67
+ readonly value: string;
68
+ }[];
69
+ readonly setMode: RemoteButton;
70
+ readonly back: RemoteButton;
71
+ }
72
+ /** What a tap on Mode opens: the modes the connector reports (one that runs without asking for approval says so), Set mode, Back. */
73
+ export declare function modeView(sessionId: string, current: string | null, modes: readonly string[], unattended?: ReadonlySet<string>, lang?: Lang): ModeView;
@@ -0,0 +1,3 @@
1
+ import type { RemoteViews } from "../remote/ports.js";
2
+ /** The view the assembly gives the remote agents (`RemoteContext.views`). */
3
+ export declare function createRemoteViews(): RemoteViews;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The cards of a remote agent's permission request: the one an attached chat gets (`permissionRequest`), the push of an agent
3
+ * that waits on the user for an instruction the assistant sent (`remote.ask`), and what either becomes once answered. The card is
4
+ * not trusted: the click is checked against the stored options, never against the card.
5
+ */
6
+ import type { Lang } from "../locales/lang.js";
7
+ import type { DecisionButton } from "../remote/actions.js";
8
+ import { type PermissionOption } from "../remote/options.js";
9
+ import type { Reported } from "../remote/reported.js";
10
+ /** The buttons of a permission card: one per offered option, in the fixed order, each carrying the option's own id. */
11
+ export declare function optionButtons(options: readonly PermissionOption[], sessionId: string, actionId: string, lang?: Lang): DecisionButton[];
12
+ export interface PermissionView {
13
+ readonly lang: Lang;
14
+ /** What the agent wants to do (its own title, inert). */
15
+ readonly action: string;
16
+ /** Its input, kept whole but unable to make a link or a tag. */
17
+ readonly input: unknown;
18
+ /** Whose agent asks, and of what kind the request is. */
19
+ readonly asking: string;
20
+ readonly notes: readonly string[];
21
+ readonly buttons: readonly DecisionButton[];
22
+ }
23
+ /** The card for one `permissionRequest`. `who`: whose agent it is; `zone`: the user's time zone (an IANA name). */
24
+ export declare function permissionView(request: Reported, options: readonly PermissionOption[], sessionId: string, who: string, expiresAt: number, zone: string, lang?: Lang): PermissionView;
25
+ export interface RemoteAskView {
26
+ readonly lang: Lang;
27
+ readonly title: string;
28
+ /** The tool, inert, in bold. */
29
+ readonly tool: string;
30
+ /** Whose agent waits, and for which errand. */
31
+ readonly waits: string;
32
+ readonly notes: readonly string[];
33
+ readonly buttons: readonly DecisionButton[];
34
+ }
35
+ export interface RemoteAsk {
36
+ /** The ask as Claw relayed it (`assistant.say` `remote.ask`): its `action_id` and `tool`. */
37
+ readonly ask: Reported;
38
+ readonly options: readonly PermissionOption[];
39
+ readonly sessionId: string;
40
+ readonly machine: string;
41
+ readonly agent: string;
42
+ /** Which errand: `#seq title`. */
43
+ readonly about: string;
44
+ readonly expiresAt: number;
45
+ readonly zone: string;
46
+ }
47
+ /** The push for an agent on the user's machine that waits on them (an instruction the assistant sent). */
48
+ export declare function remoteAskView(input: RemoteAsk, lang?: Lang): RemoteAskView;
49
+ export interface DecidedView {
50
+ readonly lang: Lang;
51
+ readonly title: string;
52
+ readonly allowed: boolean;
53
+ }
54
+ /** What a permission card becomes once the user chose `option` at `when`. */
55
+ export declare function decidedView(option: PermissionOption, when: number, zone: string, lang?: Lang): DecidedView;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The sessions card: every session the user has, per machine (an offline one says since when) and per agent: its active sessions
3
+ * with "Switch to it" (the one the chat is on says so) and Close, then the conversations it offers; one a terminal has open says
4
+ * how it is shared. Whatever needs the user comes first and says so: a session with an approval card open (`waiting`) and a
5
+ * conversation whose terminal waits for its person; a line under the title counts them.
6
+ */
7
+ import type { SessionsInput } from "../remote/ports.js";
8
+ import type { Lang } from "../locales/lang.js";
9
+ import { type RemoteButton } from "../remote/actions.js";
10
+ import type { ConnectSteps } from "../remote/setup.js";
11
+ export type AgentRow =
12
+ /** A session of the user's, numbered (`row-session-N`), and its buttons. */
13
+ {
14
+ readonly kind: "session";
15
+ readonly number: number;
16
+ readonly line: string;
17
+ readonly buttons: readonly RemoteButton[];
18
+ } | {
19
+ readonly kind: "more";
20
+ readonly text: string;
21
+ }
22
+ /** A conversation the agent offers (`row-conv-N`, N counted over the whole card). */
23
+ | {
24
+ readonly kind: "conversation";
25
+ readonly rowId: number;
26
+ readonly line: string;
27
+ } | {
28
+ readonly kind: "buttons";
29
+ readonly buttons: readonly RemoteButton[];
30
+ } | {
31
+ readonly kind: "note";
32
+ readonly text: string;
33
+ };
34
+ export type SessionsItem = {
35
+ readonly kind: "lead";
36
+ readonly text: string;
37
+ } | {
38
+ readonly kind: "badge";
39
+ readonly text: string;
40
+ } | {
41
+ readonly kind: "machine";
42
+ readonly text: string;
43
+ readonly online: boolean;
44
+ } | {
45
+ readonly kind: "versionNote";
46
+ readonly text: string;
47
+ } | {
48
+ readonly kind: "subtle";
49
+ readonly text: string;
50
+ }
51
+ /** One agent (`row-agent-N`): its title and rows. */
52
+ | {
53
+ readonly kind: "agent";
54
+ readonly rowId: number;
55
+ readonly title: string;
56
+ readonly rows: readonly AgentRow[];
57
+ } | {
58
+ readonly kind: "connect";
59
+ readonly steps: ConnectSteps;
60
+ };
61
+ export interface SessionsView {
62
+ readonly lang: Lang;
63
+ readonly title: string;
64
+ readonly items: readonly SessionsItem[];
65
+ readonly actions: readonly RemoteButton[];
66
+ /** The active session ids in the order shown: the numbers of `/agent attach N`. */
67
+ readonly listing: readonly string[];
68
+ }
69
+ /** The sessions card as a view. */
70
+ export declare function sessionsView(input: SessionsInput): SessionsView;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The status card of a chat that talks to a remote session: ONE card that says where its messages go (which machine and agent,
3
+ * the folder, whether the agent is working, and when that was last true). It is sent once, when the chat attaches, and after that
4
+ * only edited in place. Its buttons are the system operations (switch, back to the assistant, stop, mode), so the chat itself
5
+ * holds only the conversation with the agent. Every button names the session, which the worker checks against the chat's own.
6
+ */
7
+ import type { StatusInput } from "../remote/ports.js";
8
+ import type { Lang } from "../locales/lang.js";
9
+ import { type RemoteButton } from "../remote/actions.js";
10
+ /** Each line of the status card, by what it says. */
11
+ export type StatusLine = {
12
+ readonly kind: "lead";
13
+ readonly text: string;
14
+ }
15
+ /** Where the named conversation runs, under the title. */
16
+ | {
17
+ readonly kind: "where";
18
+ readonly text: string;
19
+ } | {
20
+ readonly kind: "lastSession";
21
+ readonly text: string;
22
+ } | {
23
+ readonly kind: "folder";
24
+ readonly text: string;
25
+ } | {
26
+ readonly kind: "phase";
27
+ readonly text: string;
28
+ } | {
29
+ readonly kind: "unattended";
30
+ readonly text: string;
31
+ }
32
+ /** Which messages stay with the assistant. */
33
+ | {
34
+ readonly kind: "assistant";
35
+ readonly text: string;
36
+ } | {
37
+ readonly kind: "updated";
38
+ readonly text: string;
39
+ };
40
+ export interface StatusView {
41
+ readonly lang: Lang;
42
+ readonly title: string;
43
+ /** Attached: the accent band; back at the assistant or ended: none. */
44
+ readonly tone: "accent" | "default";
45
+ /** In order; the lead, when there is one, comes before the title. */
46
+ readonly lines: readonly StatusLine[];
47
+ readonly buttons: readonly RemoteButton[];
48
+ /** The chat's system operations must each stay one tap away: this card alone may carry four. */
49
+ readonly buttonsMax: number;
50
+ }
51
+ /** The chat's status card as a view. */
52
+ export declare function statusView(input: StatusInput): StatusView;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The session card as the window (Python `session_window.window_card`): where the session runs and how it stands, the end of its
3
+ * output (more behind a toggle, the whole as messages), what waits for the person, and the text box while it is idle. Every word
4
+ * an agent or its connector supplied is inert. The window's state and policy (WindowView, takesInput, what is shown of the output)
5
+ * are the remote domain's (`remote/window/`); this says what the card shows.
6
+ */
7
+ import type { WindowInput } from "../remote/ports.js";
8
+ import type { Lang } from "../locales/lang.js";
9
+ import { type DecisionButton, type RemoteButton } from "../remote/actions.js";
10
+ /** The output the card shows at once (a phone screen of it), and behind its "more" toggle. */
11
+ export declare const TAIL_CHARS = 900;
12
+ export declare const TAIL_LINES = 14;
13
+ export declare const MORE_CHARS = 3500;
14
+ export declare const MORE_LINES = 60;
15
+ /** What the person sent from the card, shown back on it. */
16
+ export declare const SENT_SHOWN_CHARS = 200;
17
+ export declare const APPROVALS_SHOWN = 3;
18
+ /** One line of output (a minified file is not one card). */
19
+ export declare const LINE_MAX = 400;
20
+ /** One line of the agent's output as a TextBlock shows it: control characters gone, no link or tag can be built from it (an
21
+ * address in it broken where it stands, as in a short line: the output is shown as the agent wrote it, not made words as an
22
+ * answer is, so a code span made for a host would only show its backticks), the markdown a TextBlock reads escaped, never read
23
+ * as a list item, clipped. */
24
+ export declare function outputLine(raw: string): string;
25
+ export interface WindowOutput {
26
+ /** The end of the output, line by line (inert); empty with `empty` said instead. */
27
+ readonly lines: readonly string[];
28
+ readonly empty: string | null;
29
+ /** The lines before them, behind the toggle (null: nothing more to show). */
30
+ readonly more: readonly string[] | null;
31
+ readonly moreToggle: string;
32
+ /** Full output and Mode, under the output. */
33
+ readonly buttons: readonly RemoteButton[];
34
+ }
35
+ export interface WindowCardView {
36
+ readonly lang: Lang;
37
+ readonly lead: string;
38
+ readonly title: string;
39
+ readonly waiting: boolean;
40
+ /** The conversation, folder and mode, in one subtle line ("" for none). */
41
+ readonly sub: string;
42
+ readonly state: string;
43
+ readonly unattended: string | null;
44
+ readonly sent: string | null;
45
+ readonly output: WindowOutput;
46
+ readonly note: string | null;
47
+ readonly approvals: readonly {
48
+ readonly text: string;
49
+ readonly buttons: readonly DecisionButton[];
50
+ }[];
51
+ readonly moreApprovals: string | null;
52
+ readonly groupNote: string | null;
53
+ /** The text box, while the session takes input; null otherwise. */
54
+ readonly box: {
55
+ readonly id: string;
56
+ readonly placeholder: string;
57
+ readonly value: string;
58
+ readonly maxLength: number;
59
+ } | null;
60
+ readonly boxNote: string | null;
61
+ readonly chatBox: string;
62
+ readonly updated: string;
63
+ readonly actions: readonly RemoteButton[];
64
+ /** Whether the card carries the text box (what a later refresh reads instead of the card's JSON). */
65
+ readonly takesInput: boolean;
66
+ }
67
+ /** The session card as a view. */
68
+ export declare function windowView(input: WindowInput): WindowCardView;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The result of an operation that can fail in a way its caller is expected to handle.
3
+ *
4
+ * The convention for the whole package:
5
+ * - An expected failure (the identity service says "not bound", Teams refuses a stream, a card's data is not what the
6
+ * handler reads) is a value: `Result<T, E>` where `E` is a discriminated union with a `kind` field. The caller has
7
+ * to look at it; the compiler sees a case it forgot.
8
+ * - A broken invariant (a bug, a programming error) is thrown, as an `Error`. Nothing catches it to continue as if the
9
+ * operation had worked; the one place that catches everything (the handler of one inbound event) logs its type and
10
+ * tells the person the request did not finish.
11
+ * - Nothing swallows an error: a `catch` that continues returns or records what it caught.
12
+ */
13
+ export type Result<T, E extends Failure> = Ok<T> | Err<E>;
14
+ /** What every expected failure carries: which one it is. */
15
+ export interface Failure {
16
+ readonly kind: string;
17
+ }
18
+ export interface Ok<T> {
19
+ readonly ok: true;
20
+ readonly value: T;
21
+ }
22
+ export interface Err<E extends Failure> {
23
+ readonly ok: false;
24
+ readonly error: E;
25
+ }
26
+ export declare function ok<T>(value: T): Ok<T>;
27
+ export declare function err<E extends Failure>(error: E): Err<E>;
28
+ /** The value of a result, or `fallback` when it failed. */
29
+ export declare function valueOr<T, E extends Failure>(result: Result<T, E>, fallback: T): T;
30
+ /** A result whose value went through `fn`; a failure passes through unchanged. */
31
+ export declare function mapResult<T, U, E extends Failure>(result: Result<T, E>, fn: (value: T) => U): Result<U, E>;
@@ -0,0 +1,24 @@
1
+ /** What /whoami says the person is connected to: SaFE, GitHub (what Clawy reads it with), the deployment's own lines, memory. */
2
+ import type { GithubConnection } from "../../claw/model.js";
3
+ import type { GithubState } from "../../ports/github.js";
4
+ /** A part that could not be read just now. */
5
+ export declare const UNKNOWN: unique symbol;
6
+ export interface ConnectionsInput {
7
+ /** The SaFE account the chat is linked to; null when it could not be read. */
8
+ readonly safe: {
9
+ readonly name: string;
10
+ } | null;
11
+ /** The binding at the identity service; null: none (or no `/github` here); UNKNOWN. */
12
+ readonly githubState: GithubState | null | typeof UNKNOWN;
13
+ /** Claw's answer; null with `connectionKnown` for a Claw that cannot say, null without it when it could not be asked. */
14
+ readonly connection: GithubConnection | null;
15
+ readonly connectionKnown: boolean;
16
+ readonly githubPart: boolean;
17
+ /** (enabled, available), or UNKNOWN. */
18
+ readonly memory: readonly [boolean, boolean] | typeof UNKNOWN;
19
+ readonly memoryPage: string;
20
+ readonly zh: boolean;
21
+ /** The lines a deployment's integrations add. */
22
+ readonly extraLines: readonly string[];
23
+ }
24
+ export declare function connectionsText(p: ConnectionsInput): string;