@openclaw/lobster 2026.9.4 → 2026.9.6

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 (367) hide show
  1. package/assets/activity.svg +4 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/index.js +39 -10
  4. package/node_modules/@clawdbot/lobster/README.md +129 -131
  5. package/node_modules/@clawdbot/lobster/VISION.md +15 -238
  6. package/node_modules/@clawdbot/lobster/bin/clawd.invoke.js +2 -15
  7. package/node_modules/@clawdbot/lobster/bin/invoke.js +19 -0
  8. package/node_modules/@clawdbot/lobster/bin/lobster.js +2 -21
  9. package/node_modules/@clawdbot/lobster/bin/openclaw.invoke.js +2 -18
  10. package/node_modules/@clawdbot/lobster/dist/src/abortable_process.js +297 -0
  11. package/node_modules/@clawdbot/lobster/dist/src/abortable_process.js.map +1 -0
  12. package/node_modules/@clawdbot/lobster/dist/src/cli.js +128 -296
  13. package/node_modules/@clawdbot/lobster/dist/src/cli.js.map +1 -1
  14. package/node_modules/@clawdbot/lobster/dist/src/command_tokens.js +81 -0
  15. package/node_modules/@clawdbot/lobster/dist/src/command_tokens.js.map +1 -0
  16. package/node_modules/@clawdbot/lobster/dist/src/commands/commands_list.js.map +1 -1
  17. package/node_modules/@clawdbot/lobster/dist/src/commands/registry.js +2 -0
  18. package/node_modules/@clawdbot/lobster/dist/src/commands/registry.js.map +1 -1
  19. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/approve.js +2 -0
  20. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/approve.js.map +1 -1
  21. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/ask.js +3 -1
  22. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/ask.js.map +1 -1
  23. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/dedupe.js +1 -12
  24. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/dedupe.js.map +1 -1
  25. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/diff_last.js +6 -1
  26. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/diff_last.js.map +1 -1
  27. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/email_triage.js.map +1 -1
  28. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/exec.js +30 -34
  29. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/exec.js.map +1 -1
  30. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/gog_gmail_search.js +12 -25
  31. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/gog_gmail_search.js.map +1 -1
  32. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/gog_gmail_send.js +19 -25
  33. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/gog_gmail_send.js.map +1 -1
  34. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/group_by.js +2 -14
  35. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/group_by.js.map +1 -1
  36. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/head.js.map +1 -1
  37. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/json.js.map +1 -1
  38. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/llm_invoke.js +260 -42
  39. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/llm_invoke.js.map +1 -1
  40. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/map.js +2 -13
  41. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/map.js.map +1 -1
  42. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/openclaw_agent.js +139 -0
  43. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/openclaw_agent.js.map +1 -0
  44. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/openclaw_invoke.js +20 -2
  45. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/openclaw_invoke.js.map +1 -1
  46. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/pick.js.map +1 -1
  47. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/sort.js +4 -21
  48. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/sort.js.map +1 -1
  49. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/state.js +48 -20
  50. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/state.js.map +1 -1
  51. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/table.js.map +1 -1
  52. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/template.js +2 -13
  53. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/template.js.map +1 -1
  54. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/where.js.map +1 -1
  55. package/node_modules/@clawdbot/lobster/dist/src/commands/workflows/workflows_list.js.map +1 -1
  56. package/node_modules/@clawdbot/lobster/dist/src/commands/workflows/workflows_run.js +0 -18
  57. package/node_modules/@clawdbot/lobster/dist/src/commands/workflows/workflows_run.js.map +1 -1
  58. package/node_modules/@clawdbot/lobster/dist/src/core/cost_tracker.js +45 -3
  59. package/node_modules/@clawdbot/lobster/dist/src/core/cost_tracker.js.map +1 -1
  60. package/node_modules/@clawdbot/lobster/dist/src/core/filters.js.map +1 -1
  61. package/node_modules/@clawdbot/lobster/dist/src/core/llm_accounting.js +304 -0
  62. package/node_modules/@clawdbot/lobster/dist/src/core/llm_accounting.js.map +1 -0
  63. package/node_modules/@clawdbot/lobster/dist/src/core/retry.js.map +1 -1
  64. package/node_modules/@clawdbot/lobster/dist/src/core/tool_runtime.js +147 -21
  65. package/node_modules/@clawdbot/lobster/dist/src/core/tool_runtime.js.map +1 -1
  66. package/node_modules/@clawdbot/lobster/dist/src/core/value_path.js +11 -0
  67. package/node_modules/@clawdbot/lobster/dist/src/core/value_path.js.map +1 -0
  68. package/node_modules/@clawdbot/lobster/dist/src/input_request.js +4 -2
  69. package/node_modules/@clawdbot/lobster/dist/src/input_request.js.map +1 -1
  70. package/node_modules/@clawdbot/lobster/dist/src/parser.js +5 -69
  71. package/node_modules/@clawdbot/lobster/dist/src/parser.js.map +1 -1
  72. package/node_modules/@clawdbot/lobster/dist/src/pipeline_resume_state.js +241 -74
  73. package/node_modules/@clawdbot/lobster/dist/src/pipeline_resume_state.js.map +1 -1
  74. package/node_modules/@clawdbot/lobster/dist/src/read_line.js +52 -7
  75. package/node_modules/@clawdbot/lobster/dist/src/read_line.js.map +1 -1
  76. package/node_modules/@clawdbot/lobster/dist/src/read_response_text.js +86 -0
  77. package/node_modules/@clawdbot/lobster/dist/src/read_response_text.js.map +1 -0
  78. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/index.js +1 -1
  79. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/pr-monitor.js +9 -66
  80. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/pr-monitor.js.map +1 -1
  81. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/read_pr.js +45 -0
  82. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/read_pr.js.map +1 -0
  83. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/snapshot.js +45 -0
  84. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/snapshot.js.map +1 -0
  85. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/stages/pr-view.js +13 -65
  86. package/node_modules/@clawdbot/lobster/dist/src/recipes/github/stages/pr-view.js.map +1 -1
  87. package/node_modules/@clawdbot/lobster/dist/src/recipes/registry.js.map +1 -1
  88. package/node_modules/@clawdbot/lobster/dist/src/renderers/json.js.map +1 -1
  89. package/node_modules/@clawdbot/lobster/dist/src/resume.js.map +1 -1
  90. package/node_modules/@clawdbot/lobster/dist/src/runtime.js +187 -17
  91. package/node_modules/@clawdbot/lobster/dist/src/runtime.js.map +1 -1
  92. package/node_modules/@clawdbot/lobster/dist/src/sdk/Lobster.js +25 -134
  93. package/node_modules/@clawdbot/lobster/dist/src/sdk/Lobster.js.map +1 -1
  94. package/node_modules/@clawdbot/lobster/dist/src/sdk/index.js +1 -1
  95. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/approve.js +1 -2
  96. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/approve.js.map +1 -1
  97. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/diff.js +11 -86
  98. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/diff.js.map +1 -1
  99. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/exec.js +20 -96
  100. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/exec.js.map +1 -1
  101. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/state.js +8 -106
  102. package/node_modules/@clawdbot/lobster/dist/src/sdk/primitives/state.js.map +1 -1
  103. package/node_modules/@clawdbot/lobster/dist/src/sdk/runtime.js +2 -13
  104. package/node_modules/@clawdbot/lobster/dist/src/sdk/runtime.js.map +1 -1
  105. package/node_modules/@clawdbot/lobster/dist/src/sdk/state_env.js +6 -0
  106. package/node_modules/@clawdbot/lobster/dist/src/sdk/state_env.js.map +1 -0
  107. package/node_modules/@clawdbot/lobster/dist/src/shell.js.map +1 -1
  108. package/node_modules/@clawdbot/lobster/dist/src/state/atomic_file.js +192 -0
  109. package/node_modules/@clawdbot/lobster/dist/src/state/atomic_file.js.map +1 -0
  110. package/node_modules/@clawdbot/lobster/dist/src/state/store.js +550 -136
  111. package/node_modules/@clawdbot/lobster/dist/src/state/store.js.map +1 -1
  112. package/node_modules/@clawdbot/lobster/dist/src/token.js.map +1 -1
  113. package/node_modules/@clawdbot/lobster/dist/src/validation.js.map +1 -1
  114. package/node_modules/@clawdbot/lobster/dist/src/workflows/dry_run.js +262 -0
  115. package/node_modules/@clawdbot/lobster/dist/src/workflows/dry_run.js.map +1 -0
  116. package/node_modules/@clawdbot/lobster/dist/src/workflows/expressions.js +345 -0
  117. package/node_modules/@clawdbot/lobster/dist/src/workflows/expressions.js.map +1 -0
  118. package/node_modules/@clawdbot/lobster/dist/src/workflows/file.js +950 -1285
  119. package/node_modules/@clawdbot/lobster/dist/src/workflows/file.js.map +1 -1
  120. package/node_modules/@clawdbot/lobster/dist/src/workflows/github_pr_monitor.js +20 -90
  121. package/node_modules/@clawdbot/lobster/dist/src/workflows/github_pr_monitor.js.map +1 -1
  122. package/node_modules/@clawdbot/lobster/dist/src/workflows/graph.js +9 -8
  123. package/node_modules/@clawdbot/lobster/dist/src/workflows/graph.js.map +1 -1
  124. package/node_modules/@clawdbot/lobster/dist/src/workflows/load.js +347 -0
  125. package/node_modules/@clawdbot/lobster/dist/src/workflows/load.js.map +1 -0
  126. package/node_modules/@clawdbot/lobster/dist/src/workflows/registry.js.map +1 -1
  127. package/node_modules/@clawdbot/lobster/dist/src/workflows/types.js +2 -0
  128. package/node_modules/@clawdbot/lobster/dist/src/workflows/types.js.map +1 -0
  129. package/node_modules/@clawdbot/lobster/dist/src/workflows/values.js +93 -0
  130. package/node_modules/@clawdbot/lobster/dist/src/workflows/values.js.map +1 -0
  131. package/node_modules/@clawdbot/lobster/dist/test/approval_id.test.js.map +1 -1
  132. package/node_modules/@clawdbot/lobster/dist/test/approve_preview.test.js.map +1 -1
  133. package/node_modules/@clawdbot/lobster/dist/test/bin_smoke.test.js +25 -0
  134. package/node_modules/@clawdbot/lobster/dist/test/bin_smoke.test.js.map +1 -0
  135. package/node_modules/@clawdbot/lobster/dist/test/cancellation.test.js +5171 -0
  136. package/node_modules/@clawdbot/lobster/dist/test/cancellation.test.js.map +1 -0
  137. package/node_modules/@clawdbot/lobster/dist/test/clawd_invoke.test.js +22 -0
  138. package/node_modules/@clawdbot/lobster/dist/test/clawd_invoke.test.js.map +1 -1
  139. package/node_modules/@clawdbot/lobster/dist/test/clawd_invoke_legacy.test.js.map +1 -1
  140. package/node_modules/@clawdbot/lobster/dist/test/cli_run_errors.test.js +53 -0
  141. package/node_modules/@clawdbot/lobster/dist/test/cli_run_errors.test.js.map +1 -0
  142. package/node_modules/@clawdbot/lobster/dist/test/cli_run_file_args_json.test.js.map +1 -1
  143. package/node_modules/@clawdbot/lobster/dist/test/command_arguments.test.js +82 -0
  144. package/node_modules/@clawdbot/lobster/dist/test/command_arguments.test.js.map +1 -0
  145. package/node_modules/@clawdbot/lobster/dist/test/commands_list.test.js.map +1 -1
  146. package/node_modules/@clawdbot/lobster/dist/test/condition_comparison.test.js.map +1 -1
  147. package/node_modules/@clawdbot/lobster/dist/test/core_tool_runtime.test.js.map +1 -1
  148. package/node_modules/@clawdbot/lobster/dist/test/cost_tracker.test.js +1774 -12
  149. package/node_modules/@clawdbot/lobster/dist/test/cost_tracker.test.js.map +1 -1
  150. package/node_modules/@clawdbot/lobster/dist/test/dedupe.test.js.map +1 -1
  151. package/node_modules/@clawdbot/lobster/dist/test/diff_last.test.js.map +1 -1
  152. package/node_modules/@clawdbot/lobster/dist/test/doctor.test.js.map +1 -1
  153. package/node_modules/@clawdbot/lobster/dist/test/dry_run.test.js.map +1 -1
  154. package/node_modules/@clawdbot/lobster/dist/test/email_triage.test.js.map +1 -1
  155. package/node_modules/@clawdbot/lobster/dist/test/exec_stdin.test.js.map +1 -1
  156. package/node_modules/@clawdbot/lobster/dist/test/for_each.test.js +254 -0
  157. package/node_modules/@clawdbot/lobster/dist/test/for_each.test.js.map +1 -1
  158. package/node_modules/@clawdbot/lobster/dist/test/github_pr_notify_format.test.js.map +1 -1
  159. package/node_modules/@clawdbot/lobster/dist/test/github_pr_summary.test.js.map +1 -1
  160. package/node_modules/@clawdbot/lobster/dist/test/github_pr_view.test.js +176 -0
  161. package/node_modules/@clawdbot/lobster/dist/test/github_pr_view.test.js.map +1 -0
  162. package/node_modules/@clawdbot/lobster/dist/test/gog_gmail_send.test.js +100 -0
  163. package/node_modules/@clawdbot/lobster/dist/test/gog_gmail_send.test.js.map +1 -0
  164. package/node_modules/@clawdbot/lobster/dist/test/group_by.test.js.map +1 -1
  165. package/node_modules/@clawdbot/lobster/dist/test/helpers/node_shell_fixture.js +17 -0
  166. package/node_modules/@clawdbot/lobster/dist/test/helpers/node_shell_fixture.js.map +1 -0
  167. package/node_modules/@clawdbot/lobster/dist/test/helpers/wait_for_pid.js +19 -0
  168. package/node_modules/@clawdbot/lobster/dist/test/helpers/wait_for_pid.js.map +1 -0
  169. package/node_modules/@clawdbot/lobster/dist/test/http_response_body_cap.test.js +318 -0
  170. package/node_modules/@clawdbot/lobster/dist/test/http_response_body_cap.test.js.map +1 -0
  171. package/node_modules/@clawdbot/lobster/dist/test/llm_invoke.test.js +948 -1
  172. package/node_modules/@clawdbot/lobster/dist/test/llm_invoke.test.js.map +1 -1
  173. package/node_modules/@clawdbot/lobster/dist/test/llm_task_invoke.test.js +103 -0
  174. package/node_modules/@clawdbot/lobster/dist/test/llm_task_invoke.test.js.map +1 -1
  175. package/node_modules/@clawdbot/lobster/dist/test/map.test.js.map +1 -1
  176. package/node_modules/@clawdbot/lobster/dist/test/multi_approval_resume.test.js.map +1 -1
  177. package/node_modules/@clawdbot/lobster/dist/test/on_error.test.js.map +1 -1
  178. package/node_modules/@clawdbot/lobster/dist/test/openclaw_agent.test.js +169 -0
  179. package/node_modules/@clawdbot/lobster/dist/test/openclaw_agent.test.js.map +1 -0
  180. package/node_modules/@clawdbot/lobster/dist/test/openclaw_dispatch_retry.test.js +96 -0
  181. package/node_modules/@clawdbot/lobster/dist/test/openclaw_dispatch_retry.test.js.map +1 -0
  182. package/node_modules/@clawdbot/lobster/dist/test/openclaw_invoke_alias.test.js.map +1 -1
  183. package/node_modules/@clawdbot/lobster/dist/test/parallel.test.js.map +1 -1
  184. package/node_modules/@clawdbot/lobster/dist/test/parser.test.js +57 -0
  185. package/node_modules/@clawdbot/lobster/dist/test/parser.test.js.map +1 -1
  186. package/node_modules/@clawdbot/lobster/dist/test/pipeline_resume_state.test.js +65 -0
  187. package/node_modules/@clawdbot/lobster/dist/test/pipeline_resume_state.test.js.map +1 -0
  188. package/node_modules/@clawdbot/lobster/dist/test/process_output_limit.test.js +175 -0
  189. package/node_modules/@clawdbot/lobster/dist/test/process_output_limit.test.js.map +1 -0
  190. package/node_modules/@clawdbot/lobster/dist/test/read_line.test.js +54 -0
  191. package/node_modules/@clawdbot/lobster/dist/test/read_line.test.js.map +1 -1
  192. package/node_modules/@clawdbot/lobster/dist/test/release_changelog.test.js +39 -0
  193. package/node_modules/@clawdbot/lobster/dist/test/release_changelog.test.js.map +1 -0
  194. package/node_modules/@clawdbot/lobster/dist/test/request_input.test.js +1 -1
  195. package/node_modules/@clawdbot/lobster/dist/test/request_input.test.js.map +1 -1
  196. package/node_modules/@clawdbot/lobster/dist/test/resume.test.js.map +1 -1
  197. package/node_modules/@clawdbot/lobster/dist/test/sdk_exec.test.js +248 -0
  198. package/node_modules/@clawdbot/lobster/dist/test/sdk_exec.test.js.map +1 -0
  199. package/node_modules/@clawdbot/lobster/dist/test/sdk_lobster.test.js.map +1 -1
  200. package/node_modules/@clawdbot/lobster/dist/test/shell.test.js.map +1 -1
  201. package/node_modules/@clawdbot/lobster/dist/test/sort.test.js.map +1 -1
  202. package/node_modules/@clawdbot/lobster/dist/test/state.test.js +584 -1
  203. package/node_modules/@clawdbot/lobster/dist/test/state.test.js.map +1 -1
  204. package/node_modules/@clawdbot/lobster/dist/test/step_retry.test.js.map +1 -1
  205. package/node_modules/@clawdbot/lobster/dist/test/step_stdin_epipe.test.js +44 -0
  206. package/node_modules/@clawdbot/lobster/dist/test/step_stdin_epipe.test.js.map +1 -0
  207. package/node_modules/@clawdbot/lobster/dist/test/step_timeout.test.js +67 -1
  208. package/node_modules/@clawdbot/lobster/dist/test/step_timeout.test.js.map +1 -1
  209. package/node_modules/@clawdbot/lobster/dist/test/template.test.js.map +1 -1
  210. package/node_modules/@clawdbot/lobster/dist/test/template_filters.test.js +37 -0
  211. package/node_modules/@clawdbot/lobster/dist/test/template_filters.test.js.map +1 -1
  212. package/node_modules/@clawdbot/lobster/dist/test/tool_envelope_version.test.js.map +1 -1
  213. package/node_modules/@clawdbot/lobster/dist/test/tool_mode.test.js.map +1 -1
  214. package/node_modules/@clawdbot/lobster/dist/test/validation.test.js.map +1 -1
  215. package/node_modules/@clawdbot/lobster/dist/test/where.test.js +94 -0
  216. package/node_modules/@clawdbot/lobster/dist/test/where.test.js.map +1 -0
  217. package/node_modules/@clawdbot/lobster/dist/test/workflow_args_env.test.js +5 -3
  218. package/node_modules/@clawdbot/lobster/dist/test/workflow_args_env.test.js.map +1 -1
  219. package/node_modules/@clawdbot/lobster/dist/test/workflow_composition.test.js.map +1 -1
  220. package/node_modules/@clawdbot/lobster/dist/test/workflow_file.test.js +647 -1
  221. package/node_modules/@clawdbot/lobster/dist/test/workflow_file.test.js.map +1 -1
  222. package/node_modules/@clawdbot/lobster/dist/test/workflow_graph.test.js +13 -3
  223. package/node_modules/@clawdbot/lobster/dist/test/workflow_graph.test.js.map +1 -1
  224. package/node_modules/@clawdbot/lobster/dist/test/workflows.test.js.map +1 -1
  225. package/node_modules/@clawdbot/lobster/package.json +72 -73
  226. package/node_modules/typebox/build/compile/validator.d.mts +1 -1
  227. package/node_modules/typebox/build/compile/validator.mjs +1 -1
  228. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
  229. package/node_modules/typebox/build/format/iri.mjs +5 -1
  230. package/node_modules/typebox/build/guard/emit.mjs +2 -4
  231. package/node_modules/typebox/build/guard/guard.mjs +6 -18
  232. package/node_modules/typebox/build/guard/string.mjs +16 -24
  233. package/node_modules/typebox/build/schema/build.mjs +2 -2
  234. package/node_modules/typebox/build/schema/check.mjs +1 -1
  235. package/node_modules/typebox/build/schema/compile.d.mts +3 -2
  236. package/node_modules/typebox/build/schema/compile.mjs +8 -8
  237. package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
  238. package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
  239. package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
  240. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  241. package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
  242. package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
  243. package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
  244. package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
  245. package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
  246. package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
  247. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
  248. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
  249. package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
  250. package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
  251. package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
  252. package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
  253. package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
  254. package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
  255. package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
  256. package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
  257. package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
  258. package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
  259. package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
  260. package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
  261. package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
  262. package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
  263. package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
  264. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
  265. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
  266. package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
  267. package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
  268. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
  269. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
  270. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
  271. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
  272. package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
  273. package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
  274. package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
  275. package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
  276. package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
  277. package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
  278. package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
  279. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
  280. package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
  281. package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
  282. package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
  283. package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
  284. package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
  285. package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
  286. package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
  287. package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
  288. package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
  289. package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
  290. package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
  291. package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
  292. package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
  293. package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
  294. package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
  295. package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
  296. package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
  297. package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
  298. package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
  299. package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
  300. package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
  301. package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
  302. package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
  303. package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
  304. package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
  305. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
  306. package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
  307. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
  308. package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
  309. package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
  310. package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
  311. package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
  312. package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
  313. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
  314. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
  315. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
  316. package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
  317. package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
  318. package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
  319. package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
  320. package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
  321. package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
  322. package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
  323. package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
  324. package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
  325. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
  326. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
  327. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
  328. package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
  329. package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
  330. package/node_modules/typebox/build/schema/errors.d.mts +2 -2
  331. package/node_modules/typebox/build/schema/errors.mjs +8 -14
  332. package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
  333. package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
  334. package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
  335. package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
  336. package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
  337. package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
  338. package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
  339. package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
  340. package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
  341. package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
  342. package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
  343. package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
  344. package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
  345. package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
  346. package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
  347. package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
  348. package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
  349. package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
  350. package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
  351. package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
  352. package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
  353. package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
  354. package/node_modules/typebox/build/schema/parse.d.mts +1 -0
  355. package/node_modules/typebox/build/schema/parse.mjs +10 -5
  356. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
  357. package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
  358. package/node_modules/typebox/build/schema/schema.d.mts +2 -0
  359. package/node_modules/typebox/build/schema/schema.mjs +2 -0
  360. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
  361. package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
  362. package/node_modules/typebox/package.json +1 -1
  363. package/node_modules/typebox/readme.md +59 -89
  364. package/openclaw.plugin.json +1 -1
  365. package/package.json +10 -7
  366. package/node_modules/@clawdbot/lobster/dist/src/sdk/token.js +0 -9
  367. package/node_modules/@clawdbot/lobster/dist/src/sdk/token.js.map +0 -1
@@ -1,249 +1,26 @@
1
- # Lobster: Vision & Value Proposition
1
+ # Lobster
2
2
 
3
- ## One-liner
3
+ Lobster executes repeatable workflows for OpenClaw. The host chooses a workflow, presents requests for approval or structured input, and resumes with the user's decision. Lobster owns deterministic execution and saved continuation state.
4
4
 
5
- **Lobster is safe automation for OpenClaw — workflows that ask before acting.**
5
+ ## Responsibilities
6
6
 
7
- ---
7
+ - Compose JSON pipelines and workflow files with shell commands, native stages, conditions, loops, and parallel branches.
8
+ - Pause at explicit approval or input gates and return a continuation token.
9
+ - Persist snapshots and resume state locally, with atomic publication and cancellation-aware cleanup.
10
+ - Report estimated LLM spend and enforce configured workflow cost limits.
8
11
 
9
- ## What is Lobster?
12
+ Approvals are explicit workflow steps. They protect actions placed after the gate; they are not an automatic sandbox for arbitrary shell commands or tool calls. Workflow authors must put gates before actions that require user consent.
10
13
 
11
- Lobster is a workflow runtime for OpenClaw. It lets you define multi-step automations that:
14
+ ## Host boundary
12
15
 
13
- - Run deterministically (no LLM re-planning each step)
14
- - Halt at checkpoints and ask for approval before side effects
15
- - Resume exactly where they left off
16
- - Remember what they've already processed
16
+ OpenClaw owns intent, user interaction, authentication, provider integration, and tool execution policy. Lobster orchestrates those capabilities. It does not own OAuth or a credential store.
17
17
 
18
- Think of it as **IFTTT/Zapier for OpenClaw, but with human checkpoints**.
18
+ The intended inference direction is gateway-only, as recorded in [#135](https://github.com/openclaw/lobster/issues/135). Current releases still support OpenClaw, Pi, HTTP, and injected adapters. The gateway contract and compatibility window must be settled before those configurations are retired; no new vendor adapters belong in the engine.
19
19
 
20
- ---
20
+ Lobster currently renders static workflow graphs in Mermaid, DOT, and ASCII. A live dashboard and retained run history are separate product decisions, tracked in [#163](https://github.com/openclaw/lobster/issues/163).
21
21
 
22
- ## The Problem Lobster Solves
22
+ ## Use
23
23
 
24
- ### Today's workflow in OpenClaw
24
+ Use a direct tool call for a one-off action. Use Lobster when a sequence is repeatable, needs saved state, or includes a human checkpoint. Deterministic steps avoid repeatedly asking a model to reconstruct the same execution sequence; model calls remain explicit stages where judgment is needed.
25
25
 
26
- ```
27
- User: "Check my email, draft replies to anything urgent, and send them"
28
-
29
- What happens:
30
- 1. LLM plans: "I should search emails first"
31
- 2. Tool call: gmail.search
32
- 3. LLM interprets results, plans next step
33
- 4. Tool call: gmail.get (for each email)
34
- 5. LLM drafts replies
35
- 6. LLM decides to send
36
- 7. Tool call: gmail.send
37
- ... repeat for each email
38
- ```
39
-
40
- **Problems:**
41
- - Many tool calls = many tokens = expensive
42
- - LLM decides when to send = risky (what if it misunderstands?)
43
- - No memory = tomorrow it re-triages the same emails
44
- - Not repeatable = you can't save this as an automation
45
-
46
- ### With Lobster
47
-
48
- ```
49
- OpenClaw calls: lobster.run("email.triage")
50
-
51
- What happens:
52
- 1. Lobster fetches emails (deterministic)
53
- 2. Lobster classifies them (rule-based)
54
- 3. Lobster drafts replies (optional LLM step)
55
- 4. Lobster HALTS: "Send 3 drafts? [approve/reject]"
56
- 5. User approves
57
- 6. Lobster sends
58
-
59
- Tomorrow: Lobster remembers cursor, only processes new emails
60
- ```
61
-
62
- **One call. Deterministic. Safe. Stateful.**
63
-
64
- ---
65
-
66
- ## Why Lobster Makes OpenClaw Better
67
-
68
- | Without Lobster | With Lobster |
69
- |-----------------|--------------|
70
- | LLM orchestrates every step | Deterministic pipeline, LLM only for judgment |
71
- | 10+ tool calls per workflow | 1 call to Lobster |
72
- | "Don't send until I confirm" (hope it listens) | `approve` halts execution until explicit resume |
73
- | Forgets what it did yesterday | Stateful — tracks cursors/checkpoints |
74
- | Hard to share automations | Workflows are code — shareable, versionable |
75
-
76
- ### Token savings (real)
77
- A 10-step workflow today might cost 10 tool calls × LLM planning overhead.
78
- With Lobster: 1 tool call + compact structured output.
79
-
80
- ### Safety (the killer feature)
81
- The `approve` primitive isn't a prompt hint — it's a **hard stop**. The workflow literally cannot continue until you resume it. No "oops, it sent 50 emails."
82
-
83
- ### Memory (underrated)
84
- Workflows can persist state: "last processed email ID", "last PR SHA seen", etc. Tomorrow's run picks up where yesterday left off.
85
-
86
- ---
87
-
88
- ## How Lobster Fits with OpenClaw
89
-
90
- ```
91
- ┌─────────────────────────────────────────────────┐
92
- │ User │
93
- │ "triage my email daily" │
94
- └─────────────────────┬───────────────────────────┘
95
- │
96
- ▼
97
- ┌─────────────────────────────────────────────────┐
98
- │ OpenClaw │
99
- │ - Understands intent │
100
- │ - Chooses appropriate tool/workflow │
101
- │ - Presents results and approval prompts │
102
- └─────────────────────┬───────────────────────────┘
103
- │ lobster.run("email.triage")
104
- ▼
105
- ┌─────────────────────────────────────────────────┐
106
- │ Lobster │
107
- │ - Executes deterministic pipeline │
108
- │ - Calls OpenClaw tools (gmail, trello, etc) │
109
- │ - Halts at approval checkpoints │
110
- │ - Returns structured result + resume token │
111
- └─────────────────────────────────────────────────┘
112
- ```
113
-
114
- **Key insight:** Lobster doesn't replace OpenClaw. It's the execution layer that makes OpenClaw's automations safe and efficient.
115
-
116
- - **OpenClaw** = the brain (understands what you want)
117
- - **Lobster** = the hands (executes workflows safely)
118
- - **Tools/Skills** = the capabilities (gmail, trello, github, etc.)
119
-
120
- ---
121
-
122
- ## Who Should Use Lobster?
123
-
124
- ### Average OpenClaw users (invisible benefit)
125
- They don't need to know Lobster exists. They just notice:
126
- - "Set up daily email triage" works better
127
- - Automations ask before sending/posting
128
- - Things don't get re-processed every day
129
-
130
- ### Power users / tinkerers
131
- They can:
132
- - Customize workflows ("I want triage to also create Trello cards")
133
- - Write new workflows for their specific needs
134
- - Share workflows with the community
135
-
136
- ### The OpenClaw ecosystem
137
- - Workflow recipes become a new category of shareable assets
138
- - Skills stay simple (just expose APIs)
139
- - Lobster handles the orchestration layer
140
-
141
- ---
142
-
143
- ## Analogies That Work
144
-
145
- | If you know... | Lobster is like... |
146
- |----------------|-------------------|
147
- | IFTTT/Zapier | Multi-step version with approval checkpoints |
148
- | GitHub Actions | But for personal automation, not CI/CD |
149
- | AWS Step Functions | But local-first and human-in-the-loop |
150
- | Unix pipes | But for JSON objects, not text bytes |
151
- | Temporal | But 80/20 version for personal workflows |
152
-
153
- **Best analogy for most people:**
154
- > "Lobster is Zapier for OpenClaw, except it asks you before doing anything irreversible."
155
-
156
- ---
157
-
158
- ## Why Not Build This Into OpenClaw Core?
159
-
160
- It could be. But the plugin architecture is intentional:
161
-
162
- 1. **Core stays small** — OpenClaw is already complex
163
- 2. **Faster iteration** — Lobster can evolve without core releases
164
- 3. **Opt-in** — Not everyone needs workflow automation
165
- 4. **Community** — Easier to contribute workflows than core changes
166
- 5. **Ecosystem proof** — If plugins work for Lobster, they work for other capabilities
167
-
168
- OpenClaw explicitly provides a plugin boundary to enable this pattern. Lobster is the first proof that it works.
169
-
170
- ---
171
-
172
- ## Example Workflows
173
-
174
- ### Email triage (flagship)
175
- ```
176
- gog.gmail.search --query "newer_than:1d"
177
- | email.normalize
178
- | email.classify
179
- | where bucket==needs_reply
180
- | draft.reply
181
- | approve --prompt "Send N replies?"
182
- | gog.gmail.send
183
- ```
184
-
185
- ### PR monitor
186
- ```
187
- github.pr.get --repo org/repo --pr 123
188
- | diff.last
189
- | where changed==true
190
- | notify --channel telegram --message "PR updated: {summary}"
191
- ```
192
-
193
- ### Daily planning
194
- ```
195
- calendar.today
196
- | join tasks.today
197
- | prioritize
198
- | format.plan
199
- | approve --prompt "Post to #daily?"
200
- | message.send --channel slack --to "#daily"
201
- ```
202
-
203
- ### Inbox → Trello
204
- ```
205
- email.triage
206
- | where bucket==needs_action
207
- | to.trelloCard
208
- | approve --prompt "Create N cards?"
209
- | trello.card.create --list "Inbox"
210
- ```
211
-
212
- ---
213
-
214
- ## The USP (Unique Selling Proposition)
215
-
216
- **"Automations that ask before acting."**
217
-
218
- Other automation tools either:
219
- - Run blindly (IFTTT, Zapier) — scary for important actions
220
- - Require complex configuration for approvals
221
- - Don't integrate with your AI assistant
222
-
223
- Lobster is:
224
- - Native to OpenClaw (uses the same tools you already have)
225
- - Safe by default (approvals are a language primitive)
226
- - Invisible when you want (OpenClaw uses it automatically)
227
- - Customizable when you need (write your own workflows)
228
-
229
- ---
230
-
231
- ## What Lobster Is NOT
232
-
233
- - **Not a terminal replacement** — You don't switch your shell to Lobster
234
- - **Not a general programming language** — It's for workflows, not apps
235
- - **Not trying to replace OpenClaw** — It makes OpenClaw better
236
- - **Not managing your secrets** — OpenClaw handles auth, Lobster orchestrates
237
-
238
- ---
239
-
240
- ## Summary
241
-
242
- | Question | Answer |
243
- |----------|--------|
244
- | What is it? | Workflow runtime for OpenClaw |
245
- | One-liner? | Safe automation — workflows that ask before acting |
246
- | Why use it? | Cheaper, safer, stateful automations |
247
- | Who uses it? | Everyone (invisibly) or power users (directly) |
248
- | Why not in core? | Plugin architecture — core stays small, capabilities are extensions |
249
- | Best analogy? | Zapier for OpenClaw, but with approval checkpoints |
26
+ See the [README](README.md) for working commands, workflow syntax, cancellation, output limits, and SDK examples.
@@ -1,18 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawnSync } from 'node:child_process';
3
+ import { runInvoke } from "./invoke.js";
4
4
 
5
- function shellQuote(arg) {
6
- if (/^[A-Za-z0-9_\-./:=@]+$/.test(arg)) return arg;
7
- return `'${String(arg).replace(/'/g, `'\\''`)}'`;
8
- }
9
-
10
- const argv = process.argv.slice(2);
11
- const pipeline = ['clawd.invoke', ...argv.map(shellQuote)].join(' ');
12
-
13
- const res = spawnSync('lobster', [pipeline], {
14
- stdio: 'inherit',
15
- env: process.env,
16
- });
17
-
18
- process.exit(res.status ?? 1);
5
+ runInvoke("clawd.invoke");
@@ -0,0 +1,19 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { fileURLToPath } from "node:url";
3
+
4
+ function quotePipelineArgument(value) {
5
+ // Escape for Lobster's double-quoted token syntax, not for a shell.
6
+ return `"${String(value).replace(/[\\"$`]/g, "\\$&")}"`;
7
+ }
8
+
9
+ export function runInvoke(commandName) {
10
+ const pipeline = [commandName, ...process.argv.slice(2).map(quotePipelineArgument)].join(" ");
11
+ const result = spawnSync(
12
+ process.execPath,
13
+ [fileURLToPath(new URL("./lobster.js", import.meta.url)), pipeline],
14
+ { stdio: "inherit", env: process.env },
15
+ );
16
+ if (result.error)
17
+ console.error(`${commandName} failed to spawn lobster: ${result.error.message}`);
18
+ process.exit(result.status ?? 1);
19
+ }
@@ -1,24 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { existsSync } from "node:fs";
4
- import { fileURLToPath, pathToFileURL } from "node:url";
5
- import { dirname, join } from "node:path";
3
+ import { runCli } from "../dist/src/cli.js";
6
4
 
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = dirname(__filename);
9
-
10
- async function load() {
11
- const distEntry = join(__dirname, "../dist/src/cli.js");
12
- if (existsSync(distEntry)) {
13
- return import(pathToFileURL(distEntry).href);
14
- }
15
- const srcEntry = join(__dirname, "../src/cli.js");
16
- return import(pathToFileURL(srcEntry).href);
17
- }
18
-
19
- const mod = await load();
20
- if (typeof mod.runCli !== "function") {
21
- throw new Error("lobster CLI entrypoint missing runCli()");
22
- }
23
-
24
- await mod.runCli(process.argv.slice(2));
5
+ await runCli(process.argv.slice(2));
@@ -1,21 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawnSync } from 'node:child_process';
3
+ import { runInvoke } from "./invoke.js";
4
4
 
5
- function shellQuote(arg) {
6
- // Conservative POSIX-ish quoting for embedding argv into a single pipeline string.
7
- // Lobster's pipeline parser preserves quoted substrings.
8
- if (/^[A-Za-z0-9_\-./:=@]+$/.test(arg)) return arg;
9
- // single-quote, escaping embedded single quotes: ' -> '\''
10
- return `'${String(arg).replace(/'/g, `'\\''`)}'`;
11
- }
12
-
13
- const argv = process.argv.slice(2);
14
- const pipeline = ['openclaw.invoke', ...argv.map(shellQuote)].join(' ');
15
-
16
- const res = spawnSync('lobster', [pipeline], {
17
- stdio: 'inherit',
18
- env: process.env,
19
- });
20
-
21
- process.exit(res.status ?? 1);
5
+ runInvoke("openclaw.invoke");
@@ -0,0 +1,297 @@
1
+ import { spawn } from "node:child_process";
2
+ import { StringDecoder } from "node:string_decoder";
3
+ import { resolveInlineShellCommand } from "./shell.js";
4
+ const ABORT_FORCE_KILL_AFTER_MS = 250;
5
+ const forceTerminationCallbacks = new WeakMap();
6
+ // Capped direct SDK calls have no host AbortSignal, but their isolated children
7
+ // must still receive terminal interrupts and be killed if the host exits.
8
+ const interruptSignals = { SIGINT: 130, SIGTERM: 143, SIGHUP: 129, SIGQUIT: 131 };
9
+ const interruptTargets = new Set();
10
+ const interruptHandlers = new Map();
11
+ const killOnExit = () => {
12
+ for (const target of interruptTargets)
13
+ target.kill();
14
+ };
15
+ function registerInterruptTarget(target) {
16
+ if (interruptTargets.size === 0) {
17
+ process.on("exit", killOnExit);
18
+ for (const signal of Object.keys(interruptSignals)) {
19
+ const handler = () => {
20
+ const defaultExit = process.listenerCount(signal) === 1;
21
+ void Promise.allSettled([...interruptTargets].map((item) => item.stop(signal))).then(() => {
22
+ if (defaultExit)
23
+ process.exit(interruptSignals[signal]);
24
+ });
25
+ };
26
+ interruptHandlers.set(signal, handler);
27
+ // Observe existing once-handlers before EventEmitter removes them.
28
+ process.prependListener(signal, handler);
29
+ }
30
+ }
31
+ interruptTargets.add(target);
32
+ return () => {
33
+ interruptTargets.delete(target);
34
+ if (interruptTargets.size === 0) {
35
+ process.removeListener("exit", killOnExit);
36
+ for (const [signal, handler] of interruptHandlers)
37
+ process.removeListener(signal, handler);
38
+ interruptHandlers.clear();
39
+ }
40
+ };
41
+ }
42
+ function outputLimitFromEnv(env) {
43
+ const raw = env.LOBSTER_MAX_OUTPUT_BYTES?.trim();
44
+ if (!raw)
45
+ return undefined;
46
+ const value = Number(raw);
47
+ if (!/^\d+$/.test(raw) || !Number.isSafeInteger(value) || value <= 0) {
48
+ throw new Error("LOBSTER_MAX_OUTPUT_BYTES must be a positive safe integer (bytes)");
49
+ }
50
+ return value;
51
+ }
52
+ export function forceTerminateAbortableProcesses(signal) {
53
+ for (const terminate of forceTerminationCallbacks.get(signal) ?? [])
54
+ terminate();
55
+ }
56
+ function abortError(signal) {
57
+ if (signal.reason instanceof Error)
58
+ return signal.reason;
59
+ const error = new Error("This operation was aborted");
60
+ error.name = "AbortError";
61
+ return error;
62
+ }
63
+ function terminateProcessTree(child, signal) {
64
+ if (!child.pid)
65
+ return Promise.resolve();
66
+ if (process.platform === "win32") {
67
+ return new Promise((resolve) => {
68
+ const taskkill = spawn("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
69
+ stdio: "ignore",
70
+ windowsHide: true,
71
+ });
72
+ taskkill.once("error", () => {
73
+ child.kill(signal);
74
+ resolve();
75
+ });
76
+ taskkill.once("close", resolve);
77
+ });
78
+ }
79
+ try {
80
+ process.kill(-child.pid, signal);
81
+ }
82
+ catch {
83
+ child.kill(signal);
84
+ }
85
+ return Promise.resolve();
86
+ }
87
+ export function runAbortableProcess(options) {
88
+ const { env, cwd, stdin, signal, forceTerminationSignal, killSignal, maxOutputBytes: requestedMaxOutputBytes, outputLimitMessage, notFoundMessage, } = options;
89
+ return new Promise((resolve, reject) => {
90
+ if (requestedMaxOutputBytes !== undefined &&
91
+ (!Number.isSafeInteger(requestedMaxOutputBytes) || requestedMaxOutputBytes < 0)) {
92
+ reject(new Error("maxOutputBytes must be a non-negative safe integer"));
93
+ return;
94
+ }
95
+ const envLimit = outputLimitFromEnv(env);
96
+ const maxOutputBytes = envLimit === undefined
97
+ ? requestedMaxOutputBytes
98
+ : requestedMaxOutputBytes === undefined
99
+ ? envLimit
100
+ : Math.min(envLimit, requestedMaxOutputBytes);
101
+ try {
102
+ signal?.throwIfAborted();
103
+ }
104
+ catch (err) {
105
+ reject(err);
106
+ return;
107
+ }
108
+ const spawnOptions = {
109
+ env,
110
+ cwd,
111
+ shell: false,
112
+ stdio: "pipe",
113
+ // A finite cap also owns termination, including background descendants.
114
+ detached: process.platform !== "win32" && (signal !== undefined || maxOutputBytes !== undefined),
115
+ };
116
+ // Keep direct argv and shell command dataflow at distinct spawn sites.
117
+ // Merging them makes shell interpretation leak into direct executable callers.
118
+ const child = "shellCommand" in options
119
+ ? (() => {
120
+ const shell = resolveInlineShellCommand({ command: options.shellCommand, env });
121
+ return spawn(shell.command, shell.argv, spawnOptions);
122
+ })()
123
+ : spawn(options.command, options.argv, spawnOptions);
124
+ const stdoutDecoder = new StringDecoder("utf8");
125
+ const stderrDecoder = new StringDecoder("utf8");
126
+ let stdout = "";
127
+ let stderr = "";
128
+ let stdoutBytes = 0;
129
+ let stderrBytes = 0;
130
+ let terminationError;
131
+ let forceKillTimer;
132
+ let processClosed = false;
133
+ let forceKillRequested = false;
134
+ let forceKillIssued = false;
135
+ let settled = false;
136
+ const forceTerminationRegistrations = [];
137
+ let forceTerminate;
138
+ let unregisterInterruptTarget;
139
+ let resolveStopped;
140
+ const stopped = new Promise((resolve) => {
141
+ resolveStopped = resolve;
142
+ });
143
+ const cleanup = () => {
144
+ unregisterInterruptTarget?.();
145
+ resolveStopped();
146
+ signal?.removeEventListener("abort", onAbort);
147
+ if (forceKillTimer)
148
+ clearTimeout(forceKillTimer);
149
+ if (forceTerminate) {
150
+ for (const listeners of forceTerminationRegistrations)
151
+ listeners.delete(forceTerminate);
152
+ }
153
+ };
154
+ const failTerminationWhenTreeIsStopped = () => {
155
+ if (!terminationError || !processClosed || !forceKillIssued || settled)
156
+ return;
157
+ settled = true;
158
+ cleanup();
159
+ reject(terminationError);
160
+ };
161
+ const fail = (error) => {
162
+ if (settled)
163
+ return;
164
+ settled = true;
165
+ cleanup();
166
+ reject(error);
167
+ };
168
+ const forceKill = () => {
169
+ if (forceKillRequested)
170
+ return;
171
+ forceKillRequested = true;
172
+ void terminateProcessTree(child, "SIGKILL").finally(() => {
173
+ forceKillIssued = true;
174
+ failTerminationWhenTreeIsStopped();
175
+ });
176
+ };
177
+ const startTermination = (error, receivedSignal) => {
178
+ if (settled || terminationError)
179
+ return;
180
+ terminationError = error;
181
+ const initialKillSignal = receivedSignal ??
182
+ (typeof killSignal === "function" ? killSignal() : killSignal) ??
183
+ "SIGTERM";
184
+ if (initialKillSignal === "SIGKILL") {
185
+ forceKill();
186
+ return;
187
+ }
188
+ void terminateProcessTree(child, initialKillSignal);
189
+ forceKillTimer = setTimeout(() => {
190
+ forceKillTimer = undefined;
191
+ forceKill();
192
+ }, ABORT_FORCE_KILL_AFTER_MS);
193
+ };
194
+ forceTerminate = () => {
195
+ if (settled)
196
+ return;
197
+ if (!terminationError) {
198
+ terminationError = signal ? abortError(signal) : new Error("Process termination requested");
199
+ }
200
+ if (forceKillTimer) {
201
+ clearTimeout(forceKillTimer);
202
+ forceKillTimer = undefined;
203
+ }
204
+ forceKill();
205
+ };
206
+ const onAbort = () => {
207
+ if (!signal)
208
+ return;
209
+ startTermination(abortError(signal));
210
+ };
211
+ const appendOutput = (stream, data) => {
212
+ if (terminationError || settled)
213
+ return;
214
+ const bytes = data.byteLength;
215
+ const total = stream === "stdout" ? stdoutBytes + bytes : stderrBytes + bytes;
216
+ if (maxOutputBytes !== undefined && total > maxOutputBytes) {
217
+ startTermination(new Error((maxOutputBytes === requestedMaxOutputBytes ? outputLimitMessage : undefined) ??
218
+ `Process output exceeded ${maxOutputBytes} bytes`));
219
+ return;
220
+ }
221
+ if (stream === "stdout") {
222
+ stdoutBytes = total;
223
+ stdout += stdoutDecoder.write(data);
224
+ }
225
+ else {
226
+ stderrBytes = total;
227
+ stderr += stderrDecoder.write(data);
228
+ }
229
+ };
230
+ child.stdout?.on("data", (data) => appendOutput("stdout", data));
231
+ child.stderr?.on("data", (data) => appendOutput("stderr", data));
232
+ child.stdin?.on("error", () => { });
233
+ if (typeof stdin === "string")
234
+ child.stdin?.write(stdin);
235
+ child.stdin?.end();
236
+ child.on("error", (error) => {
237
+ if (terminationError) {
238
+ processClosed = true;
239
+ failTerminationWhenTreeIsStopped();
240
+ return;
241
+ }
242
+ if (error.code === "ENOENT") {
243
+ fail(new Error(notFoundMessage));
244
+ return;
245
+ }
246
+ fail(error);
247
+ });
248
+ child.on("close", (code) => {
249
+ if (settled)
250
+ return;
251
+ processClosed = true;
252
+ if (terminationError) {
253
+ failTerminationWhenTreeIsStopped();
254
+ return;
255
+ }
256
+ settled = true;
257
+ cleanup();
258
+ resolve({ stdout: stdout + stdoutDecoder.end(), stderr: stderr + stderrDecoder.end(), code });
259
+ });
260
+ for (const registrationSignal of new Set([signal, forceTerminationSignal].filter((candidate) => candidate !== undefined))) {
261
+ let listeners = forceTerminationCallbacks.get(registrationSignal);
262
+ if (!listeners) {
263
+ listeners = new Set();
264
+ forceTerminationCallbacks.set(registrationSignal, listeners);
265
+ }
266
+ listeners.add(forceTerminate);
267
+ forceTerminationRegistrations.push(listeners);
268
+ }
269
+ if (spawnOptions.detached && signal === undefined) {
270
+ unregisterInterruptTarget = registerInterruptTarget({
271
+ stop(receivedSignal) {
272
+ if (terminationError)
273
+ forceKill();
274
+ else
275
+ startTermination(new Error(`Received ${receivedSignal}`), receivedSignal);
276
+ return stopped;
277
+ },
278
+ kill() {
279
+ if (child.pid) {
280
+ try {
281
+ process.kill(-child.pid, "SIGKILL");
282
+ }
283
+ catch {
284
+ /* Already exited. */
285
+ }
286
+ }
287
+ },
288
+ });
289
+ }
290
+ if (signal) {
291
+ signal.addEventListener("abort", onAbort, { once: true });
292
+ if (signal.aborted)
293
+ onAbort();
294
+ }
295
+ });
296
+ }
297
+ //# sourceMappingURL=abortable_process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abortable_process.js","sourceRoot":"","sources":["../../src/abortable_process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoD,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,yBAAyB,GAAG,IAAI,OAAO,EAAgC,CAAC;AAE9E,gFAAgF;AAChF,0EAA0E;AAC1E,MAAM,gBAAgB,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAW,CAAC;AAG3F,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAmB,CAAC;AACpD,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA+B,CAAC;AACjE,MAAM,UAAU,GAAG,GAAG,EAAE;IACvB,KAAK,MAAM,MAAM,IAAI,gBAAgB;QAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AACtD,CAAC,CAAC;AAEF,SAAS,uBAAuB,CAAC,MAAuB;IACvD,IAAI,gBAAgB,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAC/B,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAsB,EAAE,CAAC;YACzE,MAAM,OAAO,GAAG,GAAG,EAAE;gBACpB,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACxD,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,E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