@scotthuang/agent-knock-knock 0.12.11 → 0.12.13

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 (344) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +43 -30
  3. package/dist/src/approval-policy.d.ts +11 -2
  4. package/dist/src/approval-policy.js +33 -7
  5. package/dist/src/approval-policy.js.map +1 -1
  6. package/dist/src/callback-cli-adapter.d.ts +47 -0
  7. package/dist/src/callback-cli-adapter.js +156 -0
  8. package/dist/src/callback-cli-adapter.js.map +1 -0
  9. package/dist/src/callback-outbox-policy.d.ts +95 -0
  10. package/dist/src/callback-outbox-policy.js +149 -0
  11. package/dist/src/callback-outbox-policy.js.map +1 -0
  12. package/dist/src/callback-outbox-service.d.ts +247 -0
  13. package/dist/src/callback-outbox-service.js +1053 -0
  14. package/dist/src/callback-outbox-service.js.map +1 -0
  15. package/dist/src/callback-outbox-settlement.d.ts +54 -0
  16. package/dist/src/callback-outbox-settlement.js +241 -0
  17. package/dist/src/callback-outbox-settlement.js.map +1 -0
  18. package/dist/src/canonical-json.d.ts +1 -0
  19. package/dist/src/canonical-json.js +14 -0
  20. package/dist/src/canonical-json.js.map +1 -0
  21. package/dist/src/claude-lifecycle-compatibility.js +15 -0
  22. package/dist/src/claude-lifecycle-compatibility.js.map +1 -1
  23. package/dist/src/claude-local-transcript-provider.d.ts +82 -1
  24. package/dist/src/claude-local-transcript-provider.js +873 -23
  25. package/dist/src/claude-local-transcript-provider.js.map +1 -1
  26. package/dist/src/cli-command-runtime.d.ts +14 -0
  27. package/dist/src/cli-command-runtime.js +164 -0
  28. package/dist/src/cli-command-runtime.js.map +1 -0
  29. package/dist/src/cli-core.d.ts +4 -42
  30. package/dist/src/cli-core.js +958 -28684
  31. package/dist/src/cli-core.js.map +1 -1
  32. package/dist/src/cli-runtime-context.d.ts +57 -0
  33. package/dist/src/cli-runtime-context.js +118 -0
  34. package/dist/src/cli-runtime-context.js.map +1 -0
  35. package/dist/src/codex-lifecycle-compatibility.js +2 -1
  36. package/dist/src/codex-lifecycle-compatibility.js.map +1 -1
  37. package/dist/src/codex-local-session-provider.d.ts +18 -0
  38. package/dist/src/codex-local-session-provider.js +67 -0
  39. package/dist/src/codex-local-session-provider.js.map +1 -1
  40. package/dist/src/codex-session-provider.js +1 -3
  41. package/dist/src/codex-session-provider.js.map +1 -1
  42. package/dist/src/conversation-trace.d.ts +30 -0
  43. package/dist/src/conversation-trace.js +185 -0
  44. package/dist/src/conversation-trace.js.map +1 -0
  45. package/dist/src/deferred-foreground-application-service.d.ts +84 -0
  46. package/dist/src/deferred-foreground-application-service.js +742 -0
  47. package/dist/src/deferred-foreground-application-service.js.map +1 -0
  48. package/dist/src/deferred-foreground-authority-cli-adapter.d.ts +78 -0
  49. package/dist/src/deferred-foreground-authority-cli-adapter.js +795 -0
  50. package/dist/src/deferred-foreground-authority-cli-adapter.js.map +1 -0
  51. package/dist/src/deferred-foreground-boundary.d.ts +61 -0
  52. package/dist/src/deferred-foreground-boundary.js +2 -0
  53. package/dist/src/deferred-foreground-boundary.js.map +1 -0
  54. package/dist/src/deferred-foreground-capability.d.ts +4 -0
  55. package/dist/src/deferred-foreground-capability.js +184 -0
  56. package/dist/src/deferred-foreground-capability.js.map +1 -0
  57. package/dist/src/deferred-foreground-preparation-cli-adapter.d.ts +53 -0
  58. package/dist/src/deferred-foreground-preparation-cli-adapter.js +210 -0
  59. package/dist/src/deferred-foreground-preparation-cli-adapter.js.map +1 -0
  60. package/dist/src/deferred-foreground-preparation-service.d.ts +72 -0
  61. package/dist/src/deferred-foreground-preparation-service.js +179 -0
  62. package/dist/src/deferred-foreground-preparation-service.js.map +1 -0
  63. package/dist/src/deferred-foreground-recovery-cli-adapter.d.ts +139 -0
  64. package/dist/src/deferred-foreground-recovery-cli-adapter.js +1125 -0
  65. package/dist/src/deferred-foreground-recovery-cli-adapter.js.map +1 -0
  66. package/dist/src/deferred-foreground-recovery-service.d.ts +48 -0
  67. package/dist/src/deferred-foreground-recovery-service.js +91 -0
  68. package/dist/src/deferred-foreground-recovery-service.js.map +1 -0
  69. package/dist/src/deferred-foreground-transfer-policy.d.ts +2 -0
  70. package/dist/src/deferred-foreground-transfer-policy.js +10 -0
  71. package/dist/src/deferred-foreground-transfer-policy.js.map +1 -0
  72. package/dist/src/deferred-foreground-transfer.js +46 -105
  73. package/dist/src/deferred-foreground-transfer.js.map +1 -1
  74. package/dist/src/doctor-capabilities.d.ts +9 -0
  75. package/dist/src/doctor-capabilities.js +22 -0
  76. package/dist/src/doctor-capabilities.js.map +1 -1
  77. package/dist/src/durable-json-file.d.ts +22 -0
  78. package/dist/src/durable-json-file.js +127 -0
  79. package/dist/src/durable-json-file.js.map +1 -0
  80. package/dist/src/file-lock-cli-adapter.d.ts +43 -0
  81. package/dist/src/file-lock-cli-adapter.js +150 -0
  82. package/dist/src/file-lock-cli-adapter.js.map +1 -0
  83. package/dist/src/herdr-terminal-control-provider.js +1 -3
  84. package/dist/src/herdr-terminal-control-provider.js.map +1 -1
  85. package/dist/src/install-doctor-command-adapter.d.ts +17 -0
  86. package/dist/src/install-doctor-command-adapter.js +225 -0
  87. package/dist/src/install-doctor-command-adapter.js.map +1 -0
  88. package/dist/src/live-lifecycle-evidence.js +76 -46
  89. package/dist/src/live-lifecycle-evidence.js.map +1 -1
  90. package/dist/src/live-lifecycle-smoke.js +74 -50
  91. package/dist/src/live-lifecycle-smoke.js.map +1 -1
  92. package/dist/src/managed-session.d.ts +2 -0
  93. package/dist/src/managed-session.js +24 -0
  94. package/dist/src/managed-session.js.map +1 -1
  95. package/dist/src/managed-turn-recovery-service.d.ts +86 -0
  96. package/dist/src/managed-turn-recovery-service.js +145 -0
  97. package/dist/src/managed-turn-recovery-service.js.map +1 -0
  98. package/dist/src/mutation-transaction.d.ts +48 -0
  99. package/dist/src/mutation-transaction.js +73 -0
  100. package/dist/src/mutation-transaction.js.map +1 -0
  101. package/dist/src/native-thread-lifecycle-cli-adapter.d.ts +154 -0
  102. package/dist/src/native-thread-lifecycle-cli-adapter.js +786 -0
  103. package/dist/src/native-thread-lifecycle-cli-adapter.js.map +1 -0
  104. package/dist/src/native-thread-lifecycle-ledger-cli-adapter.d.ts +25 -0
  105. package/dist/src/native-thread-lifecycle-ledger-cli-adapter.js +50 -0
  106. package/dist/src/native-thread-lifecycle-ledger-cli-adapter.js.map +1 -0
  107. package/dist/src/native-thread-lifecycle-query-service.d.ts +75 -0
  108. package/dist/src/native-thread-lifecycle-query-service.js +297 -0
  109. package/dist/src/native-thread-lifecycle-query-service.js.map +1 -0
  110. package/dist/src/native-thread-lifecycle-recovery-adapter.d.ts +45 -0
  111. package/dist/src/native-thread-lifecycle-recovery-adapter.js +154 -0
  112. package/dist/src/native-thread-lifecycle-recovery-adapter.js.map +1 -0
  113. package/dist/src/native-thread-lifecycle-recovery-service.d.ts +211 -0
  114. package/dist/src/native-thread-lifecycle-recovery-service.js +1093 -0
  115. package/dist/src/native-thread-lifecycle-recovery-service.js.map +1 -0
  116. package/dist/src/native-thread-resume-snapshot-policy.d.ts +73 -0
  117. package/dist/src/native-thread-resume-snapshot-policy.js +218 -0
  118. package/dist/src/native-thread-resume-snapshot-policy.js.map +1 -0
  119. package/dist/src/native-thread-resume-snapshot.d.ts +3 -61
  120. package/dist/src/native-thread-resume-snapshot.js +2 -143
  121. package/dist/src/native-thread-resume-snapshot.js.map +1 -1
  122. package/dist/src/native-thread-transition-application.d.ts +147 -0
  123. package/dist/src/native-thread-transition-application.js +974 -0
  124. package/dist/src/native-thread-transition-application.js.map +1 -0
  125. package/dist/src/native-thread-transition-policy.d.ts +127 -0
  126. package/dist/src/native-thread-transition-policy.js +154 -0
  127. package/dist/src/native-thread-transition-policy.js.map +1 -0
  128. package/dist/src/native-thread-transition-resource-adapter.d.ts +12 -0
  129. package/dist/src/native-thread-transition-resource-adapter.js +44 -0
  130. package/dist/src/native-thread-transition-resource-adapter.js.map +1 -0
  131. package/dist/src/native-thread-transition-settlement-service.d.ts +94 -0
  132. package/dist/src/native-thread-transition-settlement-service.js +134 -0
  133. package/dist/src/native-thread-transition-settlement-service.js.map +1 -0
  134. package/dist/src/native-thread-transition-verification-adapter.d.ts +62 -0
  135. package/dist/src/native-thread-transition-verification-adapter.js +451 -0
  136. package/dist/src/native-thread-transition-verification-adapter.js.map +1 -0
  137. package/dist/src/openclaw-callback-transport.d.ts +69 -0
  138. package/dist/src/openclaw-callback-transport.js +583 -0
  139. package/dist/src/openclaw-callback-transport.js.map +1 -0
  140. package/dist/src/openclaw-plugin-callback-adapter.d.ts +1 -0
  141. package/dist/src/openclaw-plugin-callback-adapter.js +423 -0
  142. package/dist/src/openclaw-plugin-callback-adapter.js.map +1 -0
  143. package/dist/src/openclaw-plugin-command-adapter.d.ts +16 -0
  144. package/dist/src/openclaw-plugin-command-adapter.js +1868 -0
  145. package/dist/src/openclaw-plugin-command-adapter.js.map +1 -0
  146. package/dist/src/openclaw-plugin-helpers.d.ts +27 -4
  147. package/dist/src/openclaw-plugin-helpers.js +356 -81
  148. package/dist/src/openclaw-plugin-helpers.js.map +1 -1
  149. package/dist/src/openclaw-plugin-schemas.d.ts +358 -0
  150. package/dist/src/openclaw-plugin-schemas.js +366 -0
  151. package/dist/src/openclaw-plugin-schemas.js.map +1 -0
  152. package/dist/src/openclaw-plugin-supervisor.d.ts +6 -0
  153. package/dist/src/openclaw-plugin-supervisor.js +123 -0
  154. package/dist/src/openclaw-plugin-supervisor.js.map +1 -0
  155. package/dist/src/openclaw-plugin.js +7 -2212
  156. package/dist/src/openclaw-plugin.js.map +1 -1
  157. package/dist/src/openclaw-private-authority-offers.d.ts +22 -0
  158. package/dist/src/openclaw-private-authority-offers.js +177 -0
  159. package/dist/src/openclaw-private-authority-offers.js.map +1 -0
  160. package/dist/src/protocol.d.ts +5 -0
  161. package/dist/src/protocol.js +59 -3
  162. package/dist/src/protocol.js.map +1 -1
  163. package/dist/src/session-store.d.ts +1 -0
  164. package/dist/src/session-store.js +84 -106
  165. package/dist/src/session-store.js.map +1 -1
  166. package/dist/src/store.d.ts +1 -0
  167. package/dist/src/store.js +5 -2
  168. package/dist/src/store.js.map +1 -1
  169. package/dist/src/terminal-acceptance-application-service.d.ts +65 -0
  170. package/dist/src/terminal-acceptance-application-service.js +63 -0
  171. package/dist/src/terminal-acceptance-application-service.js.map +1 -0
  172. package/dist/src/terminal-acceptance-cli-adapter.d.ts +210 -0
  173. package/dist/src/terminal-acceptance-cli-adapter.js +957 -0
  174. package/dist/src/terminal-acceptance-cli-adapter.js.map +1 -0
  175. package/dist/src/terminal-action-projection.d.ts +309 -0
  176. package/dist/src/terminal-action-projection.js +376 -0
  177. package/dist/src/terminal-action-projection.js.map +1 -0
  178. package/dist/src/terminal-agent-bridge.d.ts +3 -0
  179. package/dist/src/terminal-agent-bridge.js +29 -8
  180. package/dist/src/terminal-agent-bridge.js.map +1 -1
  181. package/dist/src/terminal-authority-policy.d.ts +141 -0
  182. package/dist/src/terminal-authority-policy.js +367 -0
  183. package/dist/src/terminal-authority-policy.js.map +1 -0
  184. package/dist/src/terminal-binding-authority.d.ts +118 -0
  185. package/dist/src/terminal-binding-authority.js +245 -0
  186. package/dist/src/terminal-binding-authority.js.map +1 -0
  187. package/dist/src/terminal-binding-reconciliation-service.d.ts +75 -0
  188. package/dist/src/terminal-binding-reconciliation-service.js +73 -0
  189. package/dist/src/terminal-binding-reconciliation-service.js.map +1 -0
  190. package/dist/src/terminal-command-cli-adapter.d.ts +380 -0
  191. package/dist/src/terminal-command-cli-adapter.js +3288 -0
  192. package/dist/src/terminal-command-cli-adapter.js.map +1 -0
  193. package/dist/src/terminal-control-ref.d.ts +4 -0
  194. package/dist/src/terminal-control-ref.js +11 -8
  195. package/dist/src/terminal-control-ref.js.map +1 -1
  196. package/dist/src/terminal-delegate-cli-adapter.d.ts +41 -0
  197. package/dist/src/terminal-delegate-cli-adapter.js +242 -0
  198. package/dist/src/terminal-delegate-cli-adapter.js.map +1 -0
  199. package/dist/src/terminal-dispatch-abort.d.ts +22 -0
  200. package/dist/src/terminal-dispatch-abort.js +30 -0
  201. package/dist/src/terminal-dispatch-abort.js.map +1 -0
  202. package/dist/src/terminal-dispatch-application.d.ts +115 -0
  203. package/dist/src/terminal-dispatch-application.js +478 -0
  204. package/dist/src/terminal-dispatch-application.js.map +1 -0
  205. package/dist/src/terminal-dispatch-capability.d.ts +63 -0
  206. package/dist/src/terminal-dispatch-capability.js +133 -0
  207. package/dist/src/terminal-dispatch-capability.js.map +1 -0
  208. package/dist/src/terminal-dispatch-completion-cli-adapter.d.ts +22 -0
  209. package/dist/src/terminal-dispatch-completion-cli-adapter.js +96 -0
  210. package/dist/src/terminal-dispatch-completion-cli-adapter.js.map +1 -0
  211. package/dist/src/terminal-dispatch-composition.d.ts +79 -0
  212. package/dist/src/terminal-dispatch-composition.js +2 -0
  213. package/dist/src/terminal-dispatch-composition.js.map +1 -0
  214. package/dist/src/terminal-dispatch-execution.d.ts +290 -0
  215. package/dist/src/terminal-dispatch-execution.js +916 -0
  216. package/dist/src/terminal-dispatch-execution.js.map +1 -0
  217. package/dist/src/terminal-dispatch-ledger-codec.d.ts +110 -0
  218. package/dist/src/terminal-dispatch-ledger-codec.js +399 -0
  219. package/dist/src/terminal-dispatch-ledger-codec.js.map +1 -0
  220. package/dist/src/terminal-dispatch-policy.d.ts +93 -0
  221. package/dist/src/terminal-dispatch-policy.js +122 -0
  222. package/dist/src/terminal-dispatch-policy.js.map +1 -0
  223. package/dist/src/terminal-dispatch-presenter.d.ts +65 -0
  224. package/dist/src/terminal-dispatch-presenter.js +258 -0
  225. package/dist/src/terminal-dispatch-presenter.js.map +1 -0
  226. package/dist/src/terminal-dispatch-receipt.d.ts +79 -0
  227. package/dist/src/terminal-dispatch-receipt.js +314 -0
  228. package/dist/src/terminal-dispatch-receipt.js.map +1 -0
  229. package/dist/src/terminal-dispatch-recovery-cli-adapter.d.ts +132 -0
  230. package/dist/src/terminal-dispatch-recovery-cli-adapter.js +1330 -0
  231. package/dist/src/terminal-dispatch-recovery-cli-adapter.js.map +1 -0
  232. package/dist/src/terminal-dispatch-recovery-service.d.ts +271 -0
  233. package/dist/src/terminal-dispatch-recovery-service.js +374 -0
  234. package/dist/src/terminal-dispatch-recovery-service.js.map +1 -0
  235. package/dist/src/terminal-dispatch-repository-cli-adapter.d.ts +35 -0
  236. package/dist/src/terminal-dispatch-repository-cli-adapter.js +483 -0
  237. package/dist/src/terminal-dispatch-repository-cli-adapter.js.map +1 -0
  238. package/dist/src/terminal-handoff-application-service.d.ts +7 -0
  239. package/dist/src/terminal-handoff-application-service.js +18 -0
  240. package/dist/src/terminal-handoff-application-service.js.map +1 -0
  241. package/dist/src/terminal-handoff-cli-adapter.d.ts +229 -0
  242. package/dist/src/terminal-handoff-cli-adapter.js +1389 -0
  243. package/dist/src/terminal-handoff-cli-adapter.js.map +1 -0
  244. package/dist/src/terminal-handoff-facts.d.ts +12 -0
  245. package/dist/src/terminal-handoff-facts.js +16 -0
  246. package/dist/src/terminal-handoff-facts.js.map +1 -0
  247. package/dist/src/terminal-identity-authority-cli-adapter.d.ts +318 -0
  248. package/dist/src/terminal-identity-authority-cli-adapter.js +1072 -0
  249. package/dist/src/terminal-identity-authority-cli-adapter.js.map +1 -0
  250. package/dist/src/terminal-identity-authority-service.d.ts +48 -0
  251. package/dist/src/terminal-identity-authority-service.js +45 -0
  252. package/dist/src/terminal-identity-authority-service.js.map +1 -0
  253. package/dist/src/terminal-list-cli-adapter.d.ts +274 -0
  254. package/dist/src/terminal-list-cli-adapter.js +2444 -0
  255. package/dist/src/terminal-list-cli-adapter.js.map +1 -0
  256. package/dist/src/terminal-list-renderer.d.ts +34 -0
  257. package/dist/src/terminal-list-renderer.js +643 -0
  258. package/dist/src/terminal-list-renderer.js.map +1 -0
  259. package/dist/src/terminal-maintenance-cli-adapter.d.ts +102 -0
  260. package/dist/src/terminal-maintenance-cli-adapter.js +1059 -0
  261. package/dist/src/terminal-maintenance-cli-adapter.js.map +1 -0
  262. package/dist/src/terminal-monitor-application-service.d.ts +275 -0
  263. package/dist/src/terminal-monitor-application-service.js +982 -0
  264. package/dist/src/terminal-monitor-application-service.js.map +1 -0
  265. package/dist/src/terminal-monitor-cli-adapter.d.ts +130 -0
  266. package/dist/src/terminal-monitor-cli-adapter.js +442 -0
  267. package/dist/src/terminal-monitor-cli-adapter.js.map +1 -0
  268. package/dist/src/terminal-monitor-decision-policy.d.ts +98 -0
  269. package/dist/src/terminal-monitor-decision-policy.js +246 -0
  270. package/dist/src/terminal-monitor-decision-policy.js.map +1 -0
  271. package/dist/src/terminal-monitor-launch-plan.d.ts +45 -0
  272. package/dist/src/terminal-monitor-launch-plan.js +94 -0
  273. package/dist/src/terminal-monitor-launch-plan.js.map +1 -0
  274. package/dist/src/terminal-monitor-ownership-policy.d.ts +31 -0
  275. package/dist/src/terminal-monitor-ownership-policy.js +64 -0
  276. package/dist/src/terminal-monitor-ownership-policy.js.map +1 -0
  277. package/dist/src/terminal-monitor-poll-policy.d.ts +48 -0
  278. package/dist/src/terminal-monitor-poll-policy.js +67 -0
  279. package/dist/src/terminal-monitor-poll-policy.js.map +1 -0
  280. package/dist/src/terminal-monitor-reconciliation-eligibility.d.ts +53 -0
  281. package/dist/src/terminal-monitor-reconciliation-eligibility.js +114 -0
  282. package/dist/src/terminal-monitor-reconciliation-eligibility.js.map +1 -0
  283. package/dist/src/terminal-monitor-state-cli-adapter.d.ts +106 -0
  284. package/dist/src/terminal-monitor-state-cli-adapter.js +1492 -0
  285. package/dist/src/terminal-monitor-state-cli-adapter.js.map +1 -0
  286. package/dist/src/terminal-monitor-state-reconciliation-service.d.ts +87 -0
  287. package/dist/src/terminal-monitor-state-reconciliation-service.js +106 -0
  288. package/dist/src/terminal-monitor-state-reconciliation-service.js.map +1 -0
  289. package/dist/src/terminal-monitor-supervision-cli-adapter.d.ts +122 -0
  290. package/dist/src/terminal-monitor-supervision-cli-adapter.js +685 -0
  291. package/dist/src/terminal-monitor-supervision-cli-adapter.js.map +1 -0
  292. package/dist/src/terminal-process-facts.d.ts +2 -0
  293. package/dist/src/terminal-process-facts.js +19 -0
  294. package/dist/src/terminal-process-facts.js.map +1 -0
  295. package/dist/src/terminal-process-source.d.ts +6 -4
  296. package/dist/src/terminal-process-source.js +25 -20
  297. package/dist/src/terminal-process-source.js.map +1 -1
  298. package/dist/src/terminal-runtime-cli-adapter.d.ts +80 -0
  299. package/dist/src/terminal-runtime-cli-adapter.js +488 -0
  300. package/dist/src/terminal-runtime-cli-adapter.js.map +1 -0
  301. package/dist/src/terminal-scoped-approval-authority.d.ts +62 -0
  302. package/dist/src/terminal-scoped-approval-authority.js +281 -0
  303. package/dist/src/terminal-scoped-approval-authority.js.map +1 -0
  304. package/dist/src/terminal-selector-projection-service.d.ts +26 -0
  305. package/dist/src/terminal-selector-projection-service.js +81 -0
  306. package/dist/src/terminal-selector-projection-service.js.map +1 -0
  307. package/dist/src/terminal-status-cli-adapter.d.ts +126 -0
  308. package/dist/src/terminal-status-cli-adapter.js +577 -0
  309. package/dist/src/terminal-status-cli-adapter.js.map +1 -0
  310. package/dist/src/terminal-status-facts.d.ts +56 -0
  311. package/dist/src/terminal-status-facts.js +199 -0
  312. package/dist/src/terminal-status-facts.js.map +1 -0
  313. package/dist/src/terminal-submission-acceptance.d.ts +62 -145
  314. package/dist/src/terminal-submission-acceptance.js +555 -222
  315. package/dist/src/terminal-submission-acceptance.js.map +1 -1
  316. package/dist/src/terminal-submission-facts.d.ts +123 -0
  317. package/dist/src/terminal-submission-facts.js +205 -0
  318. package/dist/src/terminal-submission-facts.js.map +1 -0
  319. package/dist/src/terminal-turn-binding-authority-cli-adapter.d.ts +14 -0
  320. package/dist/src/terminal-turn-binding-authority-cli-adapter.js +90 -0
  321. package/dist/src/terminal-turn-binding-authority-cli-adapter.js.map +1 -0
  322. package/dist/src/terminal-watch-callback-cli-adapter.d.ts +20 -0
  323. package/dist/src/terminal-watch-callback-cli-adapter.js +55 -0
  324. package/dist/src/terminal-watch-callback-cli-adapter.js.map +1 -0
  325. package/dist/src/terminal-watch-cli-adapter.d.ts +64 -0
  326. package/dist/src/terminal-watch-cli-adapter.js +508 -0
  327. package/dist/src/terminal-watch-cli-adapter.js.map +1 -0
  328. package/dist/src/terminal-watch-service.d.ts +97 -0
  329. package/dist/src/terminal-watch-service.js +714 -0
  330. package/dist/src/terminal-watch-service.js.map +1 -0
  331. package/dist/src/terminal-watch-store.d.ts +149 -0
  332. package/dist/src/terminal-watch-store.js +861 -0
  333. package/dist/src/terminal-watch-store.js.map +1 -0
  334. package/dist/src/value-guards.d.ts +4 -0
  335. package/dist/src/value-guards.js +12 -0
  336. package/dist/src/value-guards.js.map +1 -0
  337. package/dist/src/verified-dead-agent-policy.d.ts +192 -0
  338. package/dist/src/verified-dead-agent-policy.js +262 -0
  339. package/dist/src/verified-dead-agent-policy.js.map +1 -0
  340. package/docs/quickstart-herdr.md +8 -0
  341. package/docs/quickstart-tmux.md +33 -6
  342. package/openclaw.plugin.json +11 -3
  343. package/package.json +3 -1
  344. package/templates/openclaw-skills/agent-knock-knock/SKILL.md +58 -40
@@ -0,0 +1,366 @@
1
+ import { EXECUTOR_KINDS } from "./executors.js";
2
+ export const sendParameters = {
3
+ type: "object",
4
+ additionalProperties: false,
5
+ required: ["request"],
6
+ not: { required: ["session_id", "terminal_id"] },
7
+ properties: {
8
+ session_id: {
9
+ type: "string",
10
+ minLength: 1,
11
+ description: "Strict session-scoped AKK id only when the current list action prefills it. This preserves that exact native context and never follows the pane after a human switches threads. A rollout-backed Codex Session is a continuing context label but is not a direct ordinary-send target; use that terminal row's follow-current selector action instead. Discovery selectors, terminal ids, and turn ids are never session_id destinations."
12
+ },
13
+ terminal_id: {
14
+ type: "string",
15
+ minLength: 1,
16
+ pattern: "^terminal:v[0-9]+:\\S+$",
17
+ description: "Exact full terminal_id from the current terminal-scoped send action. AKK derives and revalidates current terminal authority internally. Human discovery selectors remain slash-command inputs and are not structured-tool authority. Omit both target fields only when AKK should attach the unique eligible idle pane."
18
+ },
19
+ request: {
20
+ type: "string",
21
+ minLength: 1,
22
+ description: "Message for the coding agent. Each accepted ordinary send creates a new turn inside the selected session without clearing native agent context."
23
+ },
24
+ type: {
25
+ type: "string",
26
+ enum: ["task"],
27
+ description: "Ordinary sends always create a task turn. Use agent_knock_knock_respond for an answer to an in-flight turn."
28
+ },
29
+ idleTimeoutMinutes: {
30
+ type: "number",
31
+ description: "Minutes an idle or completed AKK Turn record is retained before controlled reconciliation closes it."
32
+ },
33
+ agentTimeoutMinutes: {
34
+ type: "number",
35
+ description: "Callback timeout in minutes; terminal bridge tasks treat it as an inactivity timeout."
36
+ },
37
+ agentHardTimeoutMinutes: {
38
+ type: "number",
39
+ exclusiveMinimum: 0,
40
+ description: "Maximum terminal monitor lifetime in minutes."
41
+ }
42
+ }
43
+ };
44
+ export const respondParameters = {
45
+ type: "object",
46
+ additionalProperties: false,
47
+ required: ["turn_id", "request"],
48
+ properties: {
49
+ turn_id: {
50
+ type: "string",
51
+ description: "Authoritative AKK turn id from a question or blocked callback, never a discovery selector or terminal id. A response continues this exact in-flight turn and does not create a new turn."
52
+ },
53
+ request: {
54
+ type: "string",
55
+ description: "Answer or decision for the coding agent's exact in-flight turn."
56
+ }
57
+ }
58
+ };
59
+ export const listParameters = {
60
+ type: "object",
61
+ additionalProperties: false,
62
+ properties: {
63
+ agent: {
64
+ type: "string",
65
+ enum: EXECUTOR_KINDS
66
+ },
67
+ status: {
68
+ type: "string"
69
+ },
70
+ all: {
71
+ type: "boolean"
72
+ },
73
+ noApprovalScan: {
74
+ type: "boolean",
75
+ description: "When true, list live terminals without scanning their panes for approval prompts."
76
+ },
77
+ terminalDebug: {
78
+ type: "boolean",
79
+ description: "When true, include terminal-provider discovery diagnostics for debugging Gateway environment issues."
80
+ },
81
+ idleTimeoutMinutes: {
82
+ type: "number"
83
+ }
84
+ }
85
+ };
86
+ export const watchParameters = {
87
+ type: "object",
88
+ additionalProperties: false,
89
+ required: ["terminal_id"],
90
+ properties: {
91
+ terminal_id: {
92
+ type: "string",
93
+ minLength: 1,
94
+ pattern: "^terminal:v[0-9]+:\\S+$",
95
+ description: "Exact full terminal_id from the current watch action. The task must already have been started by the human in this terminal. AKK resolves and revalidates current observation authority internally."
96
+ },
97
+ hardTimeoutMinutes: {
98
+ type: "number",
99
+ exclusiveMinimum: 0,
100
+ description: "Optional maximum lifetime for observing this external terminal task."
101
+ }
102
+ }
103
+ };
104
+ export const unwatchParameters = {
105
+ type: "object",
106
+ additionalProperties: false,
107
+ required: ["watch_id"],
108
+ properties: {
109
+ watch_id: {
110
+ type: "string",
111
+ minLength: 1,
112
+ description: "Authoritative Terminal Watch id returned by watch or prefilled by list/status."
113
+ }
114
+ }
115
+ };
116
+ export const listResumableThreadsParameters = {
117
+ type: "object",
118
+ additionalProperties: false,
119
+ required: ["terminal_id"],
120
+ properties: {
121
+ terminal_id: {
122
+ type: "string",
123
+ minLength: 1,
124
+ pattern: "^terminal:v[0-9]+:\\S+$",
125
+ description: "Exact full terminal_id from the selected terminal row's current available_actions. Do not use a short ref, session id, turn id, or constructed selector."
126
+ }
127
+ }
128
+ };
129
+ export const nativeInspectParameters = {
130
+ type: "object",
131
+ additionalProperties: false,
132
+ required: ["terminal_id", "inspection"],
133
+ properties: {
134
+ terminal_id: {
135
+ type: "string",
136
+ minLength: 1,
137
+ pattern: "^terminal:v[0-9]+:\\S+$",
138
+ description: "Exact full terminal_id from the current native_inspect action. Never use a short ref, Session id, Turn id, or constructed selector. AKK refreshes and revalidates the binding internally."
139
+ },
140
+ inspection: {
141
+ type: "string",
142
+ enum: ["status"],
143
+ description: "Closed adapter-owned inspection kind. Exact Codex 0.146.0/0.146.1/0.147.0/0.148.0 and Claude Code 2.1.218/2.1.226/2.1.237 /status profiles are supported; this is never an arbitrary native command string."
144
+ }
145
+ }
146
+ };
147
+ export const newThreadParameters = {
148
+ type: "object",
149
+ additionalProperties: false,
150
+ required: ["terminal_id"],
151
+ properties: {
152
+ terminal_id: {
153
+ type: "string",
154
+ minLength: 1,
155
+ pattern: "^terminal:v[0-9]+:\\S+$",
156
+ description: "Exact full terminal_id from the current new_thread action. AKK refreshes and revalidates the lifecycle binding internally."
157
+ }
158
+ }
159
+ };
160
+ export const reconcileBindingParameters = {
161
+ type: "object",
162
+ additionalProperties: false,
163
+ required: [
164
+ "terminal_id",
165
+ "conflicting_session_id"
166
+ ],
167
+ properties: {
168
+ terminal_id: {
169
+ type: "string",
170
+ minLength: 1,
171
+ pattern: "^terminal:v[0-9]+:\\S+$",
172
+ description: "Exact full terminal_id from the current reconcile_binding action."
173
+ },
174
+ conflicting_session_id: {
175
+ type: "string",
176
+ minLength: 1,
177
+ description: "Exact conflicting managed Session id prefilled by AKK list. Never choose or construct one independently."
178
+ }
179
+ }
180
+ };
181
+ export const resumeThreadParameters = {
182
+ type: "object",
183
+ additionalProperties: false,
184
+ required: [
185
+ "terminal_id",
186
+ "native_thread_id"
187
+ ],
188
+ properties: {
189
+ terminal_id: {
190
+ type: "string",
191
+ minLength: 1,
192
+ pattern: "^terminal:v[0-9]+:\\S+$",
193
+ description: "Exact full terminal_id passed to agent_knock_knock_list_resumable_threads."
194
+ },
195
+ native_thread_id: {
196
+ type: "string",
197
+ pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
198
+ description: "Complete native thread UUID from a resumable=true row returned for this exact terminal. Never truncate, guess, or select an unavailable row."
199
+ }
200
+ }
201
+ };
202
+ export const renewParameters = {
203
+ type: "object",
204
+ additionalProperties: false,
205
+ not: { required: ["turn_id", "conversation_id"] },
206
+ anyOf: [
207
+ { required: ["turn_id"] },
208
+ { required: ["conversation_id"] }
209
+ ],
210
+ properties: {
211
+ turn_id: {
212
+ type: "string",
213
+ description: "Authoritative AKK turn id whose monitoring should be renewed."
214
+ },
215
+ conversation_id: {
216
+ type: "string",
217
+ deprecated: true,
218
+ description: "Deprecated compatibility alias for turn_id."
219
+ },
220
+ minutes: {
221
+ type: "number",
222
+ exclusiveMinimum: 0,
223
+ description: "New terminal inactivity timeout in minutes."
224
+ }
225
+ }
226
+ };
227
+ export const retryCallbackParameters = {
228
+ type: "object",
229
+ additionalProperties: false,
230
+ not: { required: ["turn_id", "conversation_id"] },
231
+ anyOf: [
232
+ { required: ["turn_id"] },
233
+ { required: ["conversation_id"] }
234
+ ],
235
+ properties: {
236
+ turn_id: {
237
+ type: "string",
238
+ description: "Authoritative AKK turn id whose persisted callback should be retried."
239
+ },
240
+ conversation_id: {
241
+ type: "string",
242
+ deprecated: true,
243
+ description: "Deprecated compatibility alias for turn_id."
244
+ }
245
+ }
246
+ };
247
+ export const statusParameters = {
248
+ type: "object",
249
+ additionalProperties: false,
250
+ not: {
251
+ anyOf: [
252
+ { required: ["turn_id", "conversation_id"] },
253
+ { required: ["turn_id", "watch_id"] },
254
+ { required: ["conversation_id", "watch_id"] }
255
+ ]
256
+ },
257
+ anyOf: [
258
+ { required: ["turn_id"] },
259
+ { required: ["conversation_id"] },
260
+ { required: ["watch_id"] }
261
+ ],
262
+ properties: {
263
+ turn_id: {
264
+ type: "string",
265
+ description: "Authoritative AKK turn id to inspect."
266
+ },
267
+ conversation_id: {
268
+ type: "string",
269
+ deprecated: true,
270
+ description: "Deprecated legacy Turn alias, or the exact raw-terminal selector prefilled by that terminal row's available status action. Managed Turn status must use turn_id; never construct or guess a raw-terminal selector."
271
+ },
272
+ watch_id: {
273
+ type: "string",
274
+ minLength: 1,
275
+ description: "Authoritative Terminal Watch id prefilled by a current watch row. This inspects externally started work and is mutually exclusive with Turn targets."
276
+ },
277
+ idleTimeoutMinutes: {
278
+ type: "number"
279
+ },
280
+ trace: {
281
+ type: "boolean",
282
+ description: "Include a safe executor trace summary with tool calls, permission requests, monitor events, and redacted thinking markers."
283
+ }
284
+ }
285
+ };
286
+ export const cancelParameters = {
287
+ type: "object",
288
+ additionalProperties: false,
289
+ not: { required: ["turn_id", "conversation_id"] },
290
+ anyOf: [
291
+ { required: ["turn_id"] },
292
+ { required: ["conversation_id"] }
293
+ ],
294
+ properties: {
295
+ turn_id: {
296
+ type: "string",
297
+ description: "Authoritative AKK turn id to interrupt."
298
+ },
299
+ conversation_id: {
300
+ type: "string",
301
+ deprecated: true,
302
+ description: "Deprecated legacy Turn alias, or the exact raw-terminal selector prefilled by that terminal row's available cancel action. Managed Turn cancellation must use turn_id; never construct or guess a raw-terminal selector."
303
+ },
304
+ idleTimeoutMinutes: {
305
+ type: "number"
306
+ }
307
+ }
308
+ };
309
+ export const closeParameters = {
310
+ type: "object",
311
+ additionalProperties: false,
312
+ not: {
313
+ anyOf: [
314
+ { required: ["turn_id", "conversation_id"] },
315
+ { required: ["expected_message_id", "expected_transition_id"] }
316
+ ]
317
+ },
318
+ anyOf: [
319
+ { required: ["turn_id"] },
320
+ { required: ["conversation_id"] }
321
+ ],
322
+ properties: {
323
+ turn_id: {
324
+ type: "string",
325
+ description: "Authoritative AKK turn id whose managed record should be closed."
326
+ },
327
+ conversation_id: {
328
+ type: "string",
329
+ deprecated: true,
330
+ description: "Deprecated legacy Turn alias, or an exact list-prefilled raw-terminal/orphan recovery selector. Managed Turn close must use turn_id; never construct or guess a raw-terminal selector."
331
+ },
332
+ reason: {
333
+ type: "string"
334
+ },
335
+ expected_message_id: {
336
+ type: "string",
337
+ description: "Required only to clear an orphaned terminal dispatch shown by AKK list. Must exactly match that entry's current message_id and must not be combined with expected_transition_id."
338
+ },
339
+ expected_transition_id: {
340
+ type: "string",
341
+ description: "Required only to recover an unresolved native-thread lifecycle transition shown by AKK list. Must exactly match that entry's current transition_id and must not be combined with expected_message_id."
342
+ }
343
+ }
344
+ };
345
+ export const approveParameters = {
346
+ type: "object",
347
+ additionalProperties: false,
348
+ not: { required: ["turn_id", "terminal_id"] },
349
+ anyOf: [
350
+ { required: ["turn_id"] },
351
+ { required: ["terminal_id"] }
352
+ ],
353
+ properties: {
354
+ turn_id: {
355
+ type: "string",
356
+ description: "Authoritative AKK turn id containing the approval prompt."
357
+ },
358
+ terminal_id: {
359
+ type: "string",
360
+ minLength: 1,
361
+ pattern: "^terminal:v[0-9]+:\\S+$",
362
+ description: "Exact full terminal_id from the current terminal-scoped approval action. Managed Turn approval must use turn_id. AKK binds the user's reviewed prompt and revalidates terminal authority internally."
363
+ }
364
+ }
365
+ };
366
+ //# sourceMappingURL=openclaw-plugin-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openclaw-plugin-schemas.js","sourceRoot":"","sources":["../../src/openclaw-plugin-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,SAAS,CAAC;IACrB,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE;IAChD,UAAU,EAAE;QACV,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,CAAC;YACZ,WAAW,EACT,2aAA2a;SAC9a;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,yBAAyB;YAClC,WAAW,EACT,yTAAyT;SAC5T;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,CAAC;YACZ,WAAW,EACT,iJAAiJ;SACpJ;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,WAAW,EACT,6GAA6G;SAChH;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sGAAsG;SACzG;QACD,mBAAmB,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uFAAuF;SACrG;QACD,uBAAuB,EAAE;YACvB,IAAI,EAAE,QAAQ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E,QAAQ,EAAE,CAAC,iBAAiB,CAAC,EAAE;KAClC;IACD,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kEAAkE;SAChF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,IAAI;YAChB,WAAW,EACT,wLAAwL;SAC3L;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;SACf;QACD,mBAAmB,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kLAAkL;SACrL;QACD,sBAAsB,EAAE;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,uMAAuM;SAC1M;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE;IAC7C,KAAK,EAAE;QACL,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE;QACzB,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,EAAE;KAC9B;IACD,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2DAA2D;SACzE;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,yBAAyB;YAClC,WAAW,EACT,sMAAsM;SACzM;KACF;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const MONITOR_SUPERVISOR_INTERVAL_MS = 5000;
2
+ export declare function createMonitorReconciliationService(api: any, configuredIntervalMs: number): {
3
+ id: string;
4
+ start(): void;
5
+ stop(): Promise<void>;
6
+ };
@@ -0,0 +1,123 @@
1
+ import { pushOptional, runCliAsync } from "./openclaw-plugin-command-adapter.js";
2
+ import { resolvePluginStoreDir } from "./openclaw-plugin-helpers.js";
3
+ import { isRecord } from "./value-guards.js";
4
+ export const MONITOR_SUPERVISOR_INTERVAL_MS = 5_000;
5
+ export function createMonitorReconciliationService(api, configuredIntervalMs) {
6
+ const intervalMs = Number.isFinite(configuredIntervalMs) &&
7
+ configuredIntervalMs > 0
8
+ ? Math.max(50, Math.ceil(configuredIntervalMs))
9
+ : MONITOR_SUPERVISOR_INTERVAL_MS;
10
+ let stopped = true;
11
+ let timer;
12
+ let inFlight;
13
+ const reconciliationArgs = (reason) => {
14
+ const config = isRecord(api.pluginConfig) ? api.pluginConfig : {};
15
+ const args = ["reconcile-monitors", "--reason", reason];
16
+ if (reason === "monitor_supervision") {
17
+ args.push("--terminal-monitors-only");
18
+ }
19
+ pushOptional(args, "--store-dir", resolvePluginStoreDir(config));
20
+ return args;
21
+ };
22
+ const watchReconciliationArgs = () => {
23
+ const config = isRecord(api.pluginConfig) ? api.pluginConfig : {};
24
+ const args = ["reconcile-watches"];
25
+ pushOptional(args, "--store-dir", resolvePluginStoreDir(config));
26
+ return args;
27
+ };
28
+ const report = (result, reason) => {
29
+ if (reason === "startup_reconciliation" ||
30
+ Number(result.launched ?? 0) > 0 ||
31
+ Number(result.errors ?? 0) > 0) {
32
+ const label = reason === "startup_reconciliation"
33
+ ? "monitor reconciliation"
34
+ : `monitor ${reason}`;
35
+ api.logger.info?.(`agent-knock-knock ${label}: ` +
36
+ `checked=${result.checked ?? 0} launched=${result.launched ?? 0} ` +
37
+ `already_running=${result.already_running ?? 0} skipped=${result.skipped ?? 0} ` +
38
+ `errors=${result.errors ?? 0}`);
39
+ }
40
+ };
41
+ const reportWatches = (result, reason) => {
42
+ if (reason === "startup_reconciliation" ||
43
+ Number(result.changed ?? 0) > 0 ||
44
+ Number(result.callbacks_delivered ?? 0) > 0 ||
45
+ Number(result.errors ?? 0) > 0) {
46
+ api.logger.info?.(`agent-knock-knock Terminal Watch ${reason}: ` +
47
+ `checked=${result.checked ?? 0} changed=${result.changed ?? 0} ` +
48
+ `callbacks_delivered=${result.callbacks_delivered ?? 0} ` +
49
+ `errors=${result.errors ?? 0}`);
50
+ }
51
+ };
52
+ const schedule = () => {
53
+ if (stopped) {
54
+ return;
55
+ }
56
+ timer = setTimeout(() => {
57
+ timer = undefined;
58
+ inFlight = supervise().finally(() => {
59
+ inFlight = undefined;
60
+ schedule();
61
+ });
62
+ }, intervalMs);
63
+ timer.unref?.();
64
+ };
65
+ const supervise = async () => {
66
+ try {
67
+ const result = await runCliAsync(api, reconciliationArgs("monitor_supervision"));
68
+ report(result, "monitor_supervision");
69
+ }
70
+ catch (error) {
71
+ const message = error instanceof Error ? error.message : String(error);
72
+ api.logger.warn?.(`agent-knock-knock monitor supervision deferred after error: ${message}`);
73
+ }
74
+ try {
75
+ const watches = await runCliAsync(api, watchReconciliationArgs());
76
+ reportWatches(watches, "watch_supervision");
77
+ }
78
+ catch (error) {
79
+ const message = error instanceof Error ? error.message : String(error);
80
+ api.logger.warn?.(`agent-knock-knock Terminal Watch supervision deferred after error: ${message}`);
81
+ }
82
+ };
83
+ const reconcileStartup = async () => {
84
+ try {
85
+ const result = await runCliAsync(api, reconciliationArgs("startup_reconciliation"));
86
+ report(result, "startup_reconciliation");
87
+ }
88
+ catch (error) {
89
+ const message = error instanceof Error ? error.message : String(error);
90
+ api.logger.warn?.(`agent-knock-knock monitor reconciliation skipped after startup error: ${message}`);
91
+ }
92
+ try {
93
+ const watches = await runCliAsync(api, watchReconciliationArgs());
94
+ reportWatches(watches, "startup_reconciliation");
95
+ }
96
+ catch (error) {
97
+ const message = error instanceof Error ? error.message : String(error);
98
+ api.logger.warn?.(`agent-knock-knock Terminal Watch reconciliation skipped after startup error: ${message}`);
99
+ }
100
+ };
101
+ return {
102
+ id: "agent-knock-knock-monitor-reconciliation",
103
+ start() {
104
+ if (!stopped) {
105
+ return;
106
+ }
107
+ stopped = false;
108
+ inFlight = reconcileStartup().finally(() => {
109
+ inFlight = undefined;
110
+ schedule();
111
+ });
112
+ },
113
+ async stop() {
114
+ stopped = true;
115
+ if (timer) {
116
+ clearTimeout(timer);
117
+ timer = undefined;
118
+ }
119
+ await inFlight;
120
+ }
121
+ };
122
+ }
123
+ //# sourceMappingURL=openclaw-plugin-supervisor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openclaw-plugin-supervisor.js","sourceRoot":"","sources":["../../src/openclaw-plugin-supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,CAAC;AAEpD,MAAM,UAAU,kCAAkC,CAChD,GAAG,EACH,oBAA4B;IAE5B,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QACtD,oBAAoB,GAAG,CAAC;QACxB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC/C,CAAC,CAAC,8BAA8B,CAAC;IACnC,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,KAAgD,CAAC;IACrD,IAAI,QAAmC,CAAC;IAExC,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAY,EAAE;QACtD,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,GAAG,CAAC,oBAAoB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QACxD,IAAI,MAAM,KAAK,qBAAqB,EAAE,CAAC;YACrC,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACxC,CAAC;QACD,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,qBAAqB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