happy2 0.0.9 → 0.0.11

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 (235) hide show
  1. package/README.md +19 -0
  2. package/package.json +7 -3
  3. package/packages/happy2-server/PLUGINS.md +330 -0
  4. package/packages/happy2-server/README.md +28 -0
  5. package/packages/happy2-server/dist/index.d.ts +6 -0
  6. package/packages/happy2-server/dist/index.d.ts.map +1 -1
  7. package/packages/happy2-server/dist/index.js +4 -0
  8. package/packages/happy2-server/dist/index.js.map +1 -1
  9. package/packages/happy2-server/dist/modules/agents/daemon.d.ts +10 -13
  10. package/packages/happy2-server/dist/modules/agents/daemon.d.ts.map +1 -1
  11. package/packages/happy2-server/dist/modules/agents/daemon.js +19 -5
  12. package/packages/happy2-server/dist/modules/agents/daemon.js.map +1 -1
  13. package/packages/happy2-server/dist/modules/agents/service.d.ts +9 -1
  14. package/packages/happy2-server/dist/modules/agents/service.d.ts.map +1 -1
  15. package/packages/happy2-server/dist/modules/agents/service.js +59 -2
  16. package/packages/happy2-server/dist/modules/agents/service.js.map +1 -1
  17. package/packages/happy2-server/dist/modules/chat/types.d.ts +1 -1
  18. package/packages/happy2-server/dist/modules/chat/types.d.ts.map +1 -1
  19. package/packages/happy2-server/dist/modules/config/defaults.d.ts.map +1 -1
  20. package/packages/happy2-server/dist/modules/config/defaults.js +3 -0
  21. package/packages/happy2-server/dist/modules/config/defaults.js.map +1 -1
  22. package/packages/happy2-server/dist/modules/config/loader.d.ts.map +1 -1
  23. package/packages/happy2-server/dist/modules/config/loader.js +4 -0
  24. package/packages/happy2-server/dist/modules/config/loader.js.map +1 -1
  25. package/packages/happy2-server/dist/modules/config/paths.d.ts +1 -0
  26. package/packages/happy2-server/dist/modules/config/paths.d.ts.map +1 -1
  27. package/packages/happy2-server/dist/modules/config/paths.js +1 -0
  28. package/packages/happy2-server/dist/modules/config/paths.js.map +1 -1
  29. package/packages/happy2-server/dist/modules/config/paths.test.js +1 -0
  30. package/packages/happy2-server/dist/modules/config/paths.test.js.map +1 -1
  31. package/packages/happy2-server/dist/modules/config/type.d.ts +3 -0
  32. package/packages/happy2-server/dist/modules/config/type.d.ts.map +1 -1
  33. package/packages/happy2-server/dist/modules/integrations/transport.d.ts.map +1 -1
  34. package/packages/happy2-server/dist/modules/integrations/transport.js +8 -1
  35. package/packages/happy2-server/dist/modules/integrations/transport.js.map +1 -1
  36. package/packages/happy2-server/dist/modules/integrations/types.d.ts +2 -0
  37. package/packages/happy2-server/dist/modules/integrations/types.d.ts.map +1 -1
  38. package/packages/happy2-server/dist/modules/integrations/types.js.map +1 -1
  39. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts +13 -0
  40. package/packages/happy2-server/dist/modules/plugin/catalog.d.ts.map +1 -0
  41. package/packages/happy2-server/dist/modules/plugin/catalog.js +359 -0
  42. package/packages/happy2-server/dist/modules/plugin/catalog.js.map +1 -0
  43. package/packages/happy2-server/dist/modules/plugin/catalog.test.d.ts +2 -0
  44. package/packages/happy2-server/dist/modules/plugin/catalog.test.d.ts.map +1 -0
  45. package/packages/happy2-server/dist/modules/plugin/catalog.test.js +139 -0
  46. package/packages/happy2-server/dist/modules/plugin/catalog.test.js.map +1 -0
  47. package/packages/happy2-server/dist/modules/plugin/functions.test.d.ts +2 -0
  48. package/packages/happy2-server/dist/modules/plugin/functions.test.d.ts.map +1 -0
  49. package/packages/happy2-server/dist/modules/plugin/functions.test.js +123 -0
  50. package/packages/happy2-server/dist/modules/plugin/functions.test.js.map +1 -0
  51. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts +19 -0
  52. package/packages/happy2-server/dist/modules/plugin/httpBridge.d.ts.map +1 -0
  53. package/packages/happy2-server/dist/modules/plugin/httpBridge.js +206 -0
  54. package/packages/happy2-server/dist/modules/plugin/httpBridge.js.map +1 -0
  55. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts +3 -0
  56. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.d.ts.map +1 -0
  57. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js +47 -0
  58. package/packages/happy2-server/dist/modules/plugin/impl/asInstallation.js.map +1 -0
  59. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts +3 -0
  60. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.d.ts.map +1 -0
  61. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js +69 -0
  62. package/packages/happy2-server/dist/modules/plugin/impl/asPlugin.js.map +1 -0
  63. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts +288 -0
  64. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.d.ts.map +1 -0
  65. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js +19 -0
  66. package/packages/happy2-server/dist/modules/plugin/impl/installationSelection.js.map +1 -0
  67. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts +3 -0
  68. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.d.ts.map +1 -0
  69. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js +52 -0
  70. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.js.map +1 -0
  71. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.d.ts +2 -0
  72. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.d.ts.map +1 -0
  73. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js +17 -0
  74. package/packages/happy2-server/dist/modules/plugin/impl/installedManifest.test.js.map +1 -0
  75. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.d.ts +3 -0
  76. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.d.ts.map +1 -0
  77. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.js +16 -0
  78. package/packages/happy2-server/dist/modules/plugin/impl/pluginFunctionResult.js.map +1 -0
  79. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.d.ts +339 -0
  80. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.d.ts.map +1 -0
  81. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.js +22 -0
  82. package/packages/happy2-server/dist/modules/plugin/impl/pluginSelection.js.map +1 -0
  83. package/packages/happy2-server/dist/modules/plugin/index.d.ts +3 -0
  84. package/packages/happy2-server/dist/modules/plugin/index.d.ts.map +1 -0
  85. package/packages/happy2-server/dist/modules/plugin/index.js +3 -0
  86. package/packages/happy2-server/dist/modules/plugin/index.js.map +1 -0
  87. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts +15 -0
  88. package/packages/happy2-server/dist/modules/plugin/packageStore.d.ts.map +1 -0
  89. package/packages/happy2-server/dist/modules/plugin/packageStore.js +90 -0
  90. package/packages/happy2-server/dist/modules/plugin/packageStore.js.map +1 -0
  91. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.d.ts +7 -0
  92. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.d.ts.map +1 -0
  93. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js +9 -0
  94. package/packages/happy2-server/dist/modules/plugin/pluginAuthorizeManagement.js.map +1 -0
  95. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts +9 -0
  96. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.d.ts.map +1 -0
  97. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js +50 -0
  98. package/packages/happy2-server/dist/modules/plugin/pluginCatalogList.js.map +1 -0
  99. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts +9 -0
  100. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.d.ts.map +1 -0
  101. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js +15 -0
  102. package/packages/happy2-server/dist/modules/plugin/pluginFindBySource.js.map +1 -0
  103. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.d.ts +23 -0
  104. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.d.ts.map +1 -0
  105. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.js +54 -0
  106. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultAcquire.js.map +1 -0
  107. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.d.ts +13 -0
  108. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.d.ts.map +1 -0
  109. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.js +37 -0
  110. package/packages/happy2-server/dist/modules/plugin/pluginFunctionResultComplete.js.map +1 -0
  111. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.d.ts +17 -0
  112. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.d.ts.map +1 -0
  113. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js +29 -0
  114. package/packages/happy2-server/dist/modules/plugin/pluginGetImage.js.map +1 -0
  115. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts +27 -0
  116. package/packages/happy2-server/dist/modules/plugin/pluginInstall.d.ts.map +1 -0
  117. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js +175 -0
  118. package/packages/happy2-server/dist/modules/plugin/pluginInstall.js.map +1 -0
  119. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts +9 -0
  120. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.d.ts.map +1 -0
  121. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js +111 -0
  122. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetRuntimeConfiguration.js.map +1 -0
  123. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.d.ts +11 -0
  124. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.d.ts.map +1 -0
  125. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.js +18 -0
  126. package/packages/happy2-server/dist/modules/plugin/pluginInstallationGetStatus.js.map +1 -0
  127. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.d.ts +8 -0
  128. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.d.ts.map +1 -0
  129. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js +19 -0
  130. package/packages/happy2-server/dist/modules/plugin/pluginInstallationList.js.map +1 -0
  131. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.d.ts +7 -0
  132. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.d.ts.map +1 -0
  133. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.js +13 -0
  134. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListIds.js.map +1 -0
  135. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.d.ts +7 -0
  136. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.d.ts.map +1 -0
  137. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.js +16 -0
  138. package/packages/happy2-server/dist/modules/plugin/pluginInstallationListReadyMcpIds.js.map +1 -0
  139. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.d.ts +15 -0
  140. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.d.ts.map +1 -0
  141. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.js +37 -0
  142. package/packages/happy2-server/dist/modules/plugin/pluginInstallationUpdateStatus.js.map +1 -0
  143. package/packages/happy2-server/dist/modules/plugin/pluginList.d.ts +8 -0
  144. package/packages/happy2-server/dist/modules/plugin/pluginList.d.ts.map +1 -0
  145. package/packages/happy2-server/dist/modules/plugin/pluginList.js +17 -0
  146. package/packages/happy2-server/dist/modules/plugin/pluginList.js.map +1 -0
  147. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.d.ts +14 -0
  148. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.d.ts.map +1 -0
  149. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.js +51 -0
  150. package/packages/happy2-server/dist/modules/plugin/pluginRemoveMissingBuiltins.js.map +1 -0
  151. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts +37 -0
  152. package/packages/happy2-server/dist/modules/plugin/runtime.d.ts.map +1 -0
  153. package/packages/happy2-server/dist/modules/plugin/runtime.js +62 -0
  154. package/packages/happy2-server/dist/modules/plugin/runtime.js.map +1 -0
  155. package/packages/happy2-server/dist/modules/plugin/secrets.d.ts +17 -0
  156. package/packages/happy2-server/dist/modules/plugin/secrets.d.ts.map +1 -0
  157. package/packages/happy2-server/dist/modules/plugin/secrets.js +56 -0
  158. package/packages/happy2-server/dist/modules/plugin/secrets.js.map +1 -0
  159. package/packages/happy2-server/dist/modules/plugin/secrets.test.d.ts +2 -0
  160. package/packages/happy2-server/dist/modules/plugin/secrets.test.d.ts.map +1 -0
  161. package/packages/happy2-server/dist/modules/plugin/secrets.test.js +14 -0
  162. package/packages/happy2-server/dist/modules/plugin/secrets.test.js.map +1 -0
  163. package/packages/happy2-server/dist/modules/plugin/service.d.ts +52 -0
  164. package/packages/happy2-server/dist/modules/plugin/service.d.ts.map +1 -0
  165. package/packages/happy2-server/dist/modules/plugin/service.js +538 -0
  166. package/packages/happy2-server/dist/modules/plugin/service.js.map +1 -0
  167. package/packages/happy2-server/dist/modules/plugin/types.d.ts +157 -0
  168. package/packages/happy2-server/dist/modules/plugin/types.d.ts.map +1 -0
  169. package/packages/happy2-server/dist/modules/plugin/types.js +9 -0
  170. package/packages/happy2-server/dist/modules/plugin/types.js.map +1 -0
  171. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.d.ts +19 -0
  172. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.d.ts.map +1 -0
  173. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.js +97 -0
  174. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.js.map +1 -0
  175. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.d.ts +2 -0
  176. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.d.ts.map +1 -0
  177. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.js +74 -0
  178. package/packages/happy2-server/dist/modules/plugin/utils/ndjsonStreamTransport.test.js.map +1 -0
  179. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.d.ts +29 -0
  180. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.d.ts.map +1 -0
  181. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.js +126 -0
  182. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.js.map +1 -0
  183. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.d.ts +2 -0
  184. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.d.ts.map +1 -0
  185. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.js +75 -0
  186. package/packages/happy2-server/dist/modules/plugin/utils/remoteMcpTransport.test.js.map +1 -0
  187. package/packages/happy2-server/dist/modules/sandbox/index.d.ts +1 -1
  188. package/packages/happy2-server/dist/modules/sandbox/index.d.ts.map +1 -1
  189. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts +2 -1
  190. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.d.ts.map +1 -1
  191. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js +117 -3
  192. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.js.map +1 -1
  193. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js +81 -2
  194. package/packages/happy2-server/dist/modules/sandbox/localOciSandboxProvider.test.js.map +1 -1
  195. package/packages/happy2-server/dist/modules/sandbox/types.d.ts +8 -0
  196. package/packages/happy2-server/dist/modules/sandbox/types.d.ts.map +1 -1
  197. package/packages/happy2-server/dist/modules/schema.d.ts +7486 -5588
  198. package/packages/happy2-server/dist/modules/schema.d.ts.map +1 -1
  199. package/packages/happy2-server/dist/modules/schema.js +72 -1
  200. package/packages/happy2-server/dist/modules/schema.js.map +1 -1
  201. package/packages/happy2-server/dist/modules/sync/syncGetDifference.d.ts.map +1 -1
  202. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js +2 -0
  203. package/packages/happy2-server/dist/modules/sync/syncGetDifference.js.map +1 -1
  204. package/packages/happy2-server/dist/routes/plugins.d.ts +8 -0
  205. package/packages/happy2-server/dist/routes/plugins.d.ts.map +1 -0
  206. package/packages/happy2-server/dist/routes/plugins.js +186 -0
  207. package/packages/happy2-server/dist/routes/plugins.js.map +1 -0
  208. package/packages/happy2-server/dist/runner.js +45 -19
  209. package/packages/happy2-server/dist/runner.js.map +1 -1
  210. package/packages/happy2-server/dist/server.d.ts +6 -0
  211. package/packages/happy2-server/dist/server.d.ts.map +1 -1
  212. package/packages/happy2-server/dist/server.js +46 -3
  213. package/packages/happy2-server/dist/server.js.map +1 -1
  214. package/packages/happy2-server/dist/systemService.d.ts +48 -0
  215. package/packages/happy2-server/dist/systemService.d.ts.map +1 -0
  216. package/packages/happy2-server/dist/systemService.js +308 -0
  217. package/packages/happy2-server/dist/systemService.js.map +1 -0
  218. package/packages/happy2-server/dist/systemService.test.d.ts +2 -0
  219. package/packages/happy2-server/dist/systemService.test.d.ts.map +1 -0
  220. package/packages/happy2-server/dist/systemService.test.js +266 -0
  221. package/packages/happy2-server/dist/systemService.test.js.map +1 -0
  222. package/packages/happy2-server/dist/web/assets/index-9SGCQLg7.js +46 -0
  223. package/packages/happy2-server/dist/web/assets/{index-DZ1uRLgV.css → index-DWXBQDJB.css} +1 -1
  224. package/packages/happy2-server/dist/web/index.html +2 -2
  225. package/packages/happy2-server/drizzle/0020_plugins.sql +61 -0
  226. package/packages/happy2-server/drizzle/0021_plugin_function_results.sql +11 -0
  227. package/packages/happy2-server/drizzle/meta/_journal.json +14 -0
  228. package/packages/happy2-server/happy2.example.toml +5 -0
  229. package/packages/happy2-server/plugins/README.md +7 -0
  230. package/packages/happy2-server/plugins/hello/container/Dockerfile +6 -0
  231. package/packages/happy2-server/plugins/hello/plugin.json +16 -0
  232. package/packages/happy2-server/plugins/hello/plugin.png +0 -0
  233. package/packages/happy2-server/plugins/hello/server.mjs +75 -0
  234. package/packages/happy2-server/plugins/hello/skills/hello/SKILL.md +11 -0
  235. package/packages/happy2-server/dist/web/assets/index-DH1SOwNV.js +0 -46
package/README.md CHANGED
@@ -49,6 +49,25 @@ Open [http://127.0.0.1:3000](http://127.0.0.1:3000) in your browser. Happy (2)
49
49
  stores its database, files, generated secrets, agent workspaces, and private Rig
50
50
  runtime under `.happy2` in the directory where you start it.
51
51
 
52
+ Keep Happy (2) running across reboots with:
53
+
54
+ ```sh
55
+ npx happy2 service start
56
+ npx happy2 service stop
57
+ ```
58
+
59
+ On macOS this installs a per-user LaunchAgent without `sudo`; it starts when the
60
+ user logs in. On Linux it writes and prints `./happy2.service`, then shows the
61
+ exact `sudo` commands you can run to install and start it as a system-wide
62
+ systemd unit. `service stop` prints the corresponding systemd removal commands;
63
+ it never invokes `sudo` itself. The generated file remains in the current
64
+ directory so you can inspect or reinstall it. Add
65
+ `--config /absolute/or/relative/happy2.toml` to `service start` to preserve an
66
+ explicit configuration file; otherwise the service keeps the current directory
67
+ as its working directory and uses its `.happy2` state. When started through
68
+ `npx`, the generated service runs `npx --yes happy2` instead of depending on an
69
+ evictable `_npx` cache path.
70
+
52
71
  ## Why Happy (2)?
53
72
 
54
73
  - **People and agents share the same workspace.** Conversations, threads,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "happy2",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Happy (2) desktop web app and server bundle",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,8 +13,10 @@
13
13
  "packages/happy2-server/bin/happy2.js",
14
14
  "packages/happy2-server/dist",
15
15
  "packages/happy2-server/drizzle",
16
+ "packages/happy2-server/plugins",
16
17
  "packages/happy2-server/happy2.example.toml",
17
18
  "packages/happy2-server/README.md",
19
+ "packages/happy2-server/PLUGINS.md",
18
20
  "packages/happy2-server/Dockerfile"
19
21
  ],
20
22
  "type": "module",
@@ -67,15 +69,17 @@
67
69
  "@fastify/multipart": "^10.1.0",
68
70
  "@fastify/static": "^10.1.0",
69
71
  "@libsql/client": "^0.17.4",
72
+ "@modelcontextprotocol/sdk": "^1.29.0",
70
73
  "@paralleldrive/cuid2": "^3.3.0",
71
- "@slopus/rig": "^0.0.17",
74
+ "@slopus/rig": "^0.0.24",
72
75
  "drizzle-orm": "^0.45.2",
73
76
  "fastify": "^5.8.2",
74
77
  "jose": "^6.1.3",
75
78
  "nodemailer": "^7.0.13",
76
79
  "sharp": "^0.35.3",
77
80
  "smol-toml": "^1.4.2",
78
- "thumbhash": "^0.1.1"
81
+ "thumbhash": "^0.1.1",
82
+ "yaml": "^2.9.0"
79
83
  },
80
84
  "devDependencies": {
81
85
  "@eslint/css": "^1.4.0",
@@ -0,0 +1,330 @@
1
+ # Server plugins
2
+
3
+ Happy (2) plugins package Agent Skills, an MCP server, or both. This first
4
+ server-side implementation installs only packages bundled with the server. It
5
+ already keeps catalog discovery, durable system plugins, immutable package/image
6
+ snapshots, and independent runtime installations separate so a later remote
7
+ catalog/download step can reuse the same boundaries.
8
+
9
+ Plugin management is system-wide and administrator-only. The first installation
10
+ of a catalog package creates one durable system-plugin record and one immutable
11
+ package snapshot; later installations reuse that plugin identity and snapshot.
12
+ Every installation has its own CUID2, variables, selected image, lifecycle, and
13
+ dedicated container when it is a local stdio MCP. Remote MCP configuration is
14
+ persisted and health-checked independently per installation. Ready MCP
15
+ installations expose their tools to Rig as durable external functions on every
16
+ agent submission. Happy executes each durable call against the originating
17
+ installation and resolves the result back into the paused Rig run. This feature
18
+ does not yet inject installed skills, and it does not yet implement upgrade,
19
+ uninstall, marketplace download, or OAuth flows.
20
+
21
+ Tool discovery is bounded to 15 seconds per agent submission, and one MCP tool
22
+ execution is bounded to 30 seconds so a stalled plugin cannot indefinitely block
23
+ turn submission or Rig's global event consumer. Before execution, Happy claims a
24
+ 45-second database lease keyed by Rig session and call ID. Other server instances
25
+ wait for that lease or replay its completed result instead of concurrently
26
+ invoking the same tool. The first terminal outcome, including an MCP error or
27
+ timeout, is persisted and reused for every later event delivery; Happy does not
28
+ automatically retry an ambiguous failure because the first request may already
29
+ have produced an external side effect. A process crash after the MCP side effect
30
+ but before the outcome is committed can still cause one lease-expiry replay, so
31
+ plugin tools with external side effects should themselves be idempotent.
32
+
33
+ Rig sessions use Full access so durable external functions are executable without
34
+ an unresolved permission prompt. Agent code still runs inside Happy's dedicated,
35
+ restricted OCI sandbox; plugin processes remain isolated in their own containers,
36
+ and only Happy crosses the boundary after matching the durable function identity
37
+ to a ready installation.
38
+
39
+ ## Package anatomy
40
+
41
+ Each built-in package is a directory below `packages/happy2-server/plugins`:
42
+
43
+ ```text
44
+ example-plugin/
45
+ ├── plugin.json
46
+ ├── plugin.png
47
+ ├── container/ # optional; used by bundled stdio runtimes
48
+ │ └── Dockerfile
49
+ └── skills/ # optional
50
+ └── example-skill/
51
+ ├── SKILL.md
52
+ ├── scripts/ # optional Agent Skills resources
53
+ ├── references/
54
+ └── assets/
55
+ ```
56
+
57
+ `plugin.png` is required and must be a square PNG no larger than 4096×4096. A
58
+ 1024×1024 source is preferred; smaller square icons remain valid. Catalog
59
+ validation calculates its byte size, dimensions, SHA-256 checksum, and
60
+ thumbhash. When the plugin first enters the system, those fields are persisted
61
+ on the plugin record and the exact PNG remains in the private package snapshot
62
+ on the filesystem.
63
+
64
+ Every direct child of `skills/` must follow the
65
+ [Agent Skills specification](https://agentskills.io/specification). In
66
+ particular, it needs `SKILL.md` with YAML frontmatter containing `name` and
67
+ `description`; `name` must match the skill directory. Package loading rejects
68
+ symlinks, unsafe relative paths, duplicate names, oversized packages, malformed
69
+ frontmatter, and unexpected manifest fields before the catalog becomes
70
+ available.
71
+
72
+ `plugin.json` uses schema version 1:
73
+
74
+ ```json
75
+ {
76
+ "schemaVersion": 1,
77
+ "version": "1.2.3",
78
+ "displayName": "Project Search",
79
+ "shortName": "project-search",
80
+ "description": "Searches source code and project documentation.",
81
+ "variables": [
82
+ {
83
+ "key": "PROJECT_API_TOKEN",
84
+ "displayName": "API token",
85
+ "description": "Token used by the MCP server.",
86
+ "kind": "secret"
87
+ },
88
+ {
89
+ "key": "PROJECT_REGION",
90
+ "displayName": "Region",
91
+ "description": "Region used for project queries.",
92
+ "kind": "text"
93
+ }
94
+ ]
95
+ }
96
+ ```
97
+
98
+ `version` uses `x.y.z` SemVer syntax. `shortName` is the stable catalog/package
99
+ link and must match the package directory; it is not an installation identity.
100
+ The durable system plugin and every installation receive separate CUID2 IDs.
101
+ Variable keys are environment variable names. Every declared variable is
102
+ required for each installation. Secret values are encrypted with AES-256-GCM
103
+ and are never returned by catalog or installation reads; text values are stored
104
+ as ordinary configuration. Both kinds are supplied to a stdio process as
105
+ environment variables.
106
+
107
+ A package must contain at least one skill or an `mcp` definition.
108
+
109
+ The bundled `hello` package is the minimal skill-plus-MCP example. It declares no
110
+ variables or MCP authentication, so an administrator can install it with an
111
+ empty POST body; each call still creates a separate installation and bundled
112
+ container.
113
+
114
+ ## Stdio MCP with a bundled container
115
+
116
+ ```json
117
+ {
118
+ "mcp": {
119
+ "type": "stdio",
120
+ "command": "/plugin/bin/project-mcp",
121
+ "args": ["--stdio"],
122
+ "container": {
123
+ "dockerfile": "container/Dockerfile"
124
+ }
125
+ }
126
+ }
127
+ ```
128
+
129
+ The Dockerfile path is package-relative. Creating the durable system plugin
130
+ copies the entire package once to `plugins.directory` before writing its
131
+ database record. Each installation lifecycle builds or resolves that exact
132
+ snapshot with the selected local Docker or Podman provider, using a
133
+ content-addressed `happy2-plugin:<sha256>` tag. It then creates a dedicated,
134
+ read-only container named from the installation CUID2, with `init`, all Linux capabilities
135
+ dropped, privilege escalation disabled, bounded shared memory, and ephemeral
136
+ `/tmp` and `/run` filesystems. Runtime resources are capped at 1 GiB of memory,
137
+ one CPU, and 256 processes per plugin container.
138
+
139
+ The resulting image must provide `/bin/sh`; Happy uses it only as the inert
140
+ container keepalive before starting the manifest command with OCI `exec`. A
141
+ bundled Dockerfile is responsible for copying or installing its MCP executable
142
+ and dependencies into the image. The MCP command itself must use newline-
143
+ delimited JSON-RPC on stdin/stdout and must not write non-protocol output to
144
+ stdout.
145
+ The fixed `HOME`, `TMPDIR`, and working directory are `/tmp`, so tools that
146
+ need a cache can still run without making the image root writable.
147
+
148
+ Each installation container stays alive as that installation's plugin runtime.
149
+ Each HTTP MCP session starts
150
+ the configured command with `docker exec`/`podman exec`; variables reach that
151
+ process through Docker/Podman's environment-copy option. Values are never placed
152
+ in command arguments, Happy's process environment, the long-lived container
153
+ definition, or the image build; they exist only in the short-lived OCI CLI child
154
+ and the MCP process. Variables that could alter the OCI client itself, such as
155
+ `DOCKER_*`, proxy, loader, or executable-path settings, are rejected. Happy
156
+ transparently bridges newline-delimited stdio JSON-RPC to MCP Streamable HTTP, so
157
+ the plugin itself does not need an HTTP server.
158
+
159
+ ## Stdio MCP using a selected container image
160
+
161
+ Omit `mcp.container` when the plugin does not bundle its own Dockerfile:
162
+
163
+ ```json
164
+ {
165
+ "mcp": {
166
+ "type": "stdio",
167
+ "command": "npx",
168
+ "args": ["-y", "@example/project-mcp"]
169
+ }
170
+ }
171
+ ```
172
+
173
+ The install request must then include `containerImageId`. It must identify an
174
+ agent image whose build status is already `ready`. The selected image belongs
175
+ only to that installation and creates that installation's dedicated container;
176
+ it does not share an agent container or another plugin installation's container.
177
+
178
+ ## Remote MCP
179
+
180
+ ```json
181
+ {
182
+ "mcp": {
183
+ "type": "remote",
184
+ "url": "https://mcp.example.com/mcp",
185
+ "headers": {
186
+ "Authorization": "Bearer ${PROJECT_API_TOKEN}",
187
+ "X-Project-Region": "${PROJECT_REGION}"
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ Remote URLs must be public HTTPS URLs without embedded credentials or fragments.
194
+ Header templates may reference only declared variables. The health worker
195
+ resolves templates in memory, rejects newline-bearing resolved values, applies
196
+ the same public-address/DNS-rebinding policy used by outgoing webhooks, pins the
197
+ approved destination address, and sends an MCP `initialize` request. The remote
198
+ URL and templates are persisted; resolved secret headers are not.
199
+
200
+ Remote MCP remains remote: Happy does not create a container or proxy its normal
201
+ traffic. OAuth is intentionally unsupported. Authentication is limited to the
202
+ custom static headers described above. Production remote requests are capped at
203
+ 1,000,000 bytes and responses at 256,000 bytes, matching the bounded webhook
204
+ transport used for SSRF-safe address pinning.
205
+
206
+ ## Installation and lifecycle
207
+
208
+ `POST /v0/admin/plugins/:shortName/installPlugin` accepts:
209
+
210
+ ```json
211
+ {
212
+ "variables": {
213
+ "PROJECT_API_TOKEN": "secret value",
214
+ "PROJECT_REGION": "us-west"
215
+ },
216
+ "containerImageId": "optional-ready-image-id"
217
+ }
218
+ ```
219
+
220
+ The request body may be omitted when the manifest declares no variables and
221
+ does not require a selected container image.
222
+
223
+ `containerImageId` is required only for stdio manifests without a bundled
224
+ container, and it is rejected in every other case. Unknown, missing, empty, or
225
+ oversized variable values are rejected. The endpoint returns HTTP 202 after the
226
+ durable system plugin (created once), immutable package/image snapshot, new
227
+ installation, variables, audit entry, initial state, and sync event are durable.
228
+ Calling it again for the same `shortName` creates another installation with a
229
+ new CUID2 and its own parameters and runtime. Container preparation continues
230
+ asynchronously.
231
+
232
+ If the catalog later advertises an update, additional installations remain
233
+ pinned to the existing system plugin's immutable manifest and package until an
234
+ explicit upgrade action exists. Catalog reads therefore project the stored
235
+ variable and MCP requirements for the install form while retaining the newer
236
+ catalog version and `updateAvailable` indicator.
237
+
238
+ An installation has one of these durable health states:
239
+
240
+ - `preparing`: copying/reconciling package and image/container state.
241
+ - `starting`: the container exists or remote endpoint is selected and MCP
242
+ initialization/health checking is in progress.
243
+ - `ready`: the MCP server completed initialization and ping (local), or returned
244
+ a valid initialization response (remote). A skills-only plugin becomes ready
245
+ immediately after its durable install.
246
+ - `broken_configuration`: stored variables, selected image state, manifest
247
+ material, or resolved headers cannot form a valid runtime configuration.
248
+ - `failed`: package integrity, image build, container creation, process startup,
249
+ protocol health, DNS, or network execution failed. `lastError` contains bounded
250
+ diagnostic text.
251
+
252
+ Every transition updates `plugin_installations`, appends a `plugin.*` sync
253
+ event, and publishes the normal server SSE hint with the `plugins` area. Clients
254
+ must reconcile the durable catalog after a hint; the event itself is not state.
255
+ On server restart, every installation is reconciled again. Its package path and
256
+ SHA-256 digest are revalidated first; local containers are then recreated from
257
+ the installed snapshot, and remote endpoints are rechecked.
258
+
259
+ ## Read and MCP endpoints
260
+
261
+ - `GET /v0/admin/plugins` lists the validated built-in catalog, requirements,
262
+ skill summaries, and MCP/container mode. When a catalog package exists in the
263
+ system, `systemPlugin` contains its CUID2, persisted image metadata and URL,
264
+ `updateAvailable`, and every independent installation with current health. It
265
+ requires an active server administrator and never returns configured values.
266
+ - `GET /v0/admin/plugins/:shortName/icon` returns the package PNG to an active
267
+ server administrator using the catalog link.
268
+ - `GET /v0/admin/systemPlugins` lists persisted system plugins independently of
269
+ the catalog, including image metadata and every linked installation.
270
+ - `GET /v0/admin/systemPlugins/:pluginId/image` returns the persisted system
271
+ plugin PNG from its private filesystem snapshot after validating the package
272
+ digest, storage key, byte size, and image checksum.
273
+ - `POST /v0/admin/plugins/:shortName/installPlugin` performs the durable install
274
+ and queues lifecycle work. It may be called any number of times; each call
275
+ creates a distinct installation linked to the same system plugin.
276
+ - `GET|POST /v0/pluginInstallations/:installationId/mcp` is the authenticated
277
+ Streamable HTTP bridge for one ready local stdio installation. It follows MCP
278
+ session semantics via `Mcp-Session-Id`. Happy’s existing bearer session is
279
+ required; there is no plugin-specific OAuth exchange.
280
+
281
+ The bridge allows at most 128 simultaneous sessions server-wide and 16 per
282
+ authenticated user. Idle sessions close after 15 minutes; inbound requests and
283
+ outbound server messages both renew that lifetime. A session is bound to the
284
+ authenticated user who initialized it and cannot be reused by another user.
285
+
286
+ Only GET and POST are exposed. MCP session DELETE is optional in the protocol
287
+ and is not enabled by this API; server shutdown and transport closure clean up
288
+ processes and sessions.
289
+
290
+ ## Persistence and future upgrades
291
+
292
+ `plugins` records the durable CUID2, catalog short name, display metadata, source
293
+ kind/reference and installed version, package SHA-256 digest, exact manifest,
294
+ persistent snapshot directory, installer, and timestamps. Its image columns
295
+ persist the filesystem storage key, content type, byte size, width, height,
296
+ thumbhash, and SHA-256 checksum.
297
+
298
+ `plugin_installations` records a separate CUID2 and foreign key to `plugins`,
299
+ plus that instance's container/image choice, lifecycle state, error detail,
300
+ installer, and timestamps. `plugin_installation_variables` records each declared
301
+ value for one installation; secret rows contain authenticated ciphertext rather
302
+ than plaintext. No installation uses `shortName` as identity.
303
+
304
+ The built-in catalog and durable system plugin are deliberately independent.
305
+ Persisted rows use `source_kind = 'builtin'` as their built-in marker. During
306
+ startup, the server compares those rows with the current built-in catalog. If a
307
+ bundle was removed from the server, its installations, encrypted variables,
308
+ system-plugin row, private package/image snapshot, and any named local containers
309
+ are removed before the remaining runtimes start. Remotely sourced plugins will
310
+ not participate in this catalog-pruning rule.
311
+
312
+ When the catalog contains a different digest for a persisted plugin's
313
+ `shortName`, reads set `updateAvailable: true`; they do not mutate or restart its
314
+ installations. A future upgrade action can download/validate a remote package
315
+ into the same package abstraction, stage a new immutable package/image snapshot,
316
+ and atomically replace the system plugin version before reconciling all linked
317
+ installations. Until that action exists, upgrades are advertised only and the
318
+ old snapshot continues to run.
319
+
320
+ Configured installed-package storage:
321
+
322
+ ```toml
323
+ [plugins]
324
+ directory = "/var/lib/happy2/plugins"
325
+ ```
326
+
327
+ The directory must be persistent and private. Plugin variables share the
328
+ server’s generated recoverable-secret master key but use a plugin-specific
329
+ authenticated-encryption context bound to the installation ID and variable key,
330
+ so ciphertext cannot be replayed across integrations, installations, or fields.
@@ -14,6 +14,10 @@ npx happy2-server --config ./happy2.toml
14
14
  # Published all-in-one web app and API on http://127.0.0.1:3000
15
15
  npx happy2
16
16
 
17
+ # Install or remove automatic startup for the all-in-one app
18
+ npx happy2 service start --config ./happy2.toml
19
+ npx happy2 service stop
20
+
17
21
  # Development, with reload and no configuration file:
18
22
  pnpm dev:server
19
23
 
@@ -46,6 +50,27 @@ package never connects to the user's global Rig daemon. Provide
46
50
  `--config /path/to/happy2.toml` or
47
51
  `HAPPY2_CONFIG=/path/to/happy2.toml` to override the defaults.
48
52
 
53
+ `happy2 service start` keeps the all-in-one app running across restarts. On
54
+ macOS it installs `~/Library/LaunchAgents/com.slopus.happy2.plist` without
55
+ `sudo`, starts at login, and writes logs under `~/Library/Logs/Happy2`. On Linux
56
+ it writes `happy2.service` in the current directory, prints the complete unit,
57
+ and prints the exact `sudo install` and `systemctl` commands required to install
58
+ and enable it. The command never invokes `sudo`. The Linux unit is system-wide
59
+ but runs the process as the user who generated it; logs go to the systemd
60
+ journal. The generated file remains in the current directory for inspection or
61
+ reinstallation. `happy2 service stop` directly stops and removes the macOS LaunchAgent,
62
+ while on Linux it prints the `sudo` commands that stop, disable, and remove the
63
+ systemd unit.
64
+
65
+ The service preserves the installation-time working directory, `PATH`, and
66
+ optional `RIG_HOME`. When `--config` is supplied, its path is made
67
+ absolute before installation. Put service secrets and SMTP environment values
68
+ in the private `.env` beside the TOML configuration rather than expecting an
69
+ interactive shell environment to exist during boot. An npx invocation generates
70
+ a service that runs `npx --yes happy2`, avoiding a dependency on the disposable
71
+ `_npx` cache directory. A global installation resolves `happy2` from the saved
72
+ `PATH`; regenerate and reinstall the service after changing that path.
73
+
49
74
  Clients can discover the selected authentication method at `GET /v0/auth/methods`.
50
75
  The response includes the server role, the durable `registration` availability
51
76
  (`bootstrap`, `open`, or `closed`), and one `method` value: `password`,
@@ -53,6 +78,9 @@ The response includes the server role, the durable `registration` availability
53
78
  Password responses also report the derived `signupEnabled`; OIDC responses report
54
79
  `oidcProvider`.
55
80
 
81
+ The built-in plugin package, installation, container lifecycle, health, and MCP
82
+ HTTP contracts are documented in [`PLUGINS.md`](./PLUGINS.md).
83
+
56
84
  ## Server and user onboarding
57
85
 
58
86
  Every new database begins with durable server onboarding. `GET /v0/setup/status`
@@ -16,6 +16,7 @@ export { syncInitialize } from "./modules/sync/syncInitialize.js";
16
16
  export { AesGcmSecretProtector } from "./modules/integrations/secrets.js";
17
17
  export { NodeWebhookTransport } from "./modules/integrations/transport.js";
18
18
  export * from "./modules/integrations/types.js";
19
+ export type { ResolvedWebhookUrl, WebhookUrlPolicy } from "./modules/integrations/ssrf.js";
19
20
  export * from "./modules/operations/types.js";
20
21
  export { FileStorage, type FileStorageFileSystem } from "./modules/files/storage.js";
21
22
  export * from "./modules/chat/types.js";
@@ -24,5 +25,10 @@ export * from "./modules/setup/index.js";
24
25
  export * from "./modules/sandbox/index.js";
25
26
  export { userOnboardingUpdateStep } from "./modules/user/userOnboardingUpdateStep.js";
26
27
  export * from "./modules/workspace/index.js";
28
+ export * from "./modules/plugin/index.js";
29
+ export { AesGcmPluginSecretProtector } from "./modules/plugin/secrets.js";
30
+ export type { PluginSecretProtector } from "./modules/plugin/secrets.js";
31
+ export { PluginPackageStore } from "./modules/plugin/packageStore.js";
32
+ export { SandboxPluginMcpRuntime, type PluginLocalOpenInput, type PluginLocalPrepareInput, type PluginMcpRuntime, } from "./modules/plugin/runtime.js";
27
33
  export { buildServer } from "./server.js";
28
34
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B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AC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EACH,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -21,5 +21,9 @@ export * from "./modules/setup/index.js";
21
21
  export * from "./modules/sandbox/index.js";
22
22
  export { userOnboardingUpdateStep } from "./modules/user/userOnboardingUpdateStep.js";
23
23
  export * from "./modules/workspace/index.js";
24
+ export * from "./modules/plugin/index.js";
25
+ export { AesGcmPluginSecretProtector } from "./modules/plugin/secrets.js";
26
+ export { PluginPackageStore } from "./modules/plugin/packageStore.js";
27
+ export { SandboxPluginMcpRuntime, } from "./modules/plugin/runtime.js";
24
28
  export { buildServer } from "./server.js";
25
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAA6B,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAyB,MAAM,iBAAiB,CAAC;AAI/E,OAAO,EAAE,cAAc,EAAwB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,O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EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,cAAc,iCAAiC,CAAC;AAEhD,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,WAAW,EAA8B,MAAM,4BAA4B,CAAC;AACrF,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EACH,uBAAuB,GAI1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -1,3 +1,5 @@
1
+ import type { RegisterSecretRequest, ResolveExternalToolCallResponse, SecretSummary } from "@slopus/rig/dist/protocol/index.js";
2
+ import type { ExternalToolCall, ExternalToolCallResolution, ExternalToolDefinition } from "@slopus/rig/dist/external-tools/index.js";
1
3
  export interface RigDaemonConfig {
2
4
  directory: string;
3
5
  socketPath: string;
@@ -11,7 +13,7 @@ interface RigBlock {
11
13
  interface RigMessage {
12
14
  role: "agent" | "system" | "user";
13
15
  id?: string;
14
- blocks: RigBlock[];
16
+ blocks: readonly RigBlock[];
15
17
  usage?: RigUsage;
16
18
  }
17
19
  interface RigUsage {
@@ -21,16 +23,8 @@ export interface RigEffortConfiguration {
21
23
  effort: string;
22
24
  options: string[];
23
25
  }
24
- export interface RigSecretRegistration {
25
- description: string;
26
- environment: Record<string, string>;
27
- id: string;
28
- }
29
- export interface RigSecretSummary {
30
- description: string;
31
- environmentVariables: string[];
32
- id: string;
33
- }
26
+ export type RigSecretRegistration = RegisterSecretRequest;
27
+ export type RigSecretSummary = SecretSummary;
34
28
  export interface RigSessionSecretPlan {
35
29
  desiredSecretIds: readonly string[];
36
30
  managedSecretIds: readonly string[];
@@ -57,6 +51,7 @@ export interface RigEvent {
57
51
  data: {
58
52
  errorMessage?: string;
59
53
  event?: RigAgentLoopEvent;
54
+ call?: ExternalToolCall;
60
55
  message?: RigMessage;
61
56
  runId?: string;
62
57
  };
@@ -89,7 +84,8 @@ export declare class RigDaemonClient {
89
84
  }>;
90
85
  effortConfiguration(sessionId: string, signal?: AbortSignal): Promise<RigEffortConfiguration>;
91
86
  changeEffort(sessionId: string, effort: string, signal?: AbortSignal): Promise<RigEffortConfiguration>;
92
- listSecrets(signal?: AbortSignal): Promise<RigSecretSummary[]>;
87
+ ensureFunctionPermission(sessionId: string, signal?: AbortSignal): Promise<void>;
88
+ listSecrets(signal?: AbortSignal): Promise<readonly RigSecretSummary[]>;
93
89
  registerSecret(secret: RigSecretRegistration, signal?: AbortSignal): Promise<RigSecretSummary>;
94
90
  unregisterSecret(secretId: string, signal?: AbortSignal): Promise<boolean>;
95
91
  reconcileSessionSecrets(sessionId: string, loadPlan: () => Promise<RigSessionSecretPlan>, signal?: AbortSignal): Promise<void>;
@@ -102,10 +98,11 @@ export declare class RigDaemonClient {
102
98
  }>;
103
99
  submittedTurnBaseline(sessionId: string, text: string, signal?: AbortSignal): Promise<number>;
104
100
  inspectTurn(sessionId: string, baselineMessageCount: number, text: string, signal?: AbortSignal): Promise<RigTurnInspection>;
105
- submitTurn(sessionId: string, text: string, signal?: AbortSignal): Promise<{
101
+ submitTurn(sessionId: string, text: string, externalTools: readonly ExternalToolDefinition[], signal?: AbortSignal): Promise<{
106
102
  eventId: string;
107
103
  runId: string;
108
104
  }>;
105
+ resolveExternalToolCall(sessionId: string, callId: string, resolution: ExternalToolCallResolution, signal?: AbortSignal): Promise<ResolveExternalToolCallResponse>;
109
106
  private session;
110
107
  private connectedRequest;
111
108
  private ensureReady;
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../sources/modules/agents/daemon.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,QAAQ;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,UAAU;IAChB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,QAAQ,CAAC;CACpB;AAED,UAAU,QAAQ;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAqBD,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACjC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,UAAU,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W;YAUL,OAAO;YAoBP,OAAO;IASrB,OAAO,CAAC,OAAO;IAmFf,OAAO,CAAC,MAAM;IAuEd,OAAO,CAAC,aAAa;CAuExB;AAqFD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK3D"}
@@ -13,14 +13,19 @@ export class RigDaemonClient {
13
13
  const current = await this.connectedRequest("GET", "/config", undefined, signal);
14
14
  if (current.config.settings.durableGlobalEventQueue)
15
15
  return;
16
- await this.connectedRequest("PATCH", "/config", { settings: { durableGlobalEventQueue: true } }, signal);
16
+ await this.connectedRequest("PATCH", "/config", {
17
+ settings: { durableGlobalEventQueue: true },
18
+ }, signal);
17
19
  }
18
20
  async createSession(cwd, containerName, effort, signal) {
19
21
  const response = await this.connectedRequest("POST", "/sessions", {
20
22
  cwd,
21
23
  docker: { container: containerName, workingDirectory: "/workspace" },
22
24
  ...(effort ? { effort } : {}),
23
- permissionMode: "workspace_write",
25
+ // Rig's durable external functions intentionally require Full access. The
26
+ // agent remains bounded by Happy's dedicated OCI sandbox and cannot reach
27
+ // the plugin process directly; Happy owns and resolves every function call.
28
+ permissionMode: "full_access",
24
29
  }, signal);
25
30
  return { id: response.session.id, effort: sessionEffort(response.session).effort };
26
31
  }
@@ -31,6 +36,12 @@ export class RigDaemonClient {
31
36
  const response = await this.connectedRequest("PATCH", `/sessions/${encodeURIComponent(sessionId)}/effort`, { effort }, signal);
32
37
  return sessionEffort(response.session);
33
38
  }
39
+ async ensureFunctionPermission(sessionId, signal) {
40
+ const current = await this.session(sessionId, signal);
41
+ if (current.permissionMode === "full_access")
42
+ return;
43
+ await this.connectedRequest("PATCH", `/sessions/${encodeURIComponent(sessionId)}/permissions`, { permissionMode: "full_access" }, signal);
44
+ }
34
45
  async listSecrets(signal) {
35
46
  const response = await this.connectedRequest("GET", "/secrets", undefined, signal);
36
47
  return response.secrets;
@@ -150,8 +161,11 @@ export class RigDaemonClient {
150
161
  kind: "failed",
151
162
  };
152
163
  }
153
- async submitTurn(sessionId, text, signal) {
154
- return this.connectedRequest("POST", `/sessions/${encodeURIComponent(sessionId)}/messages`, { text }, signal);
164
+ async submitTurn(sessionId, text, externalTools, signal) {
165
+ return this.connectedRequest("POST", `/sessions/${encodeURIComponent(sessionId)}/messages`, { text, externalTools }, signal);
166
+ }
167
+ async resolveExternalToolCall(sessionId, callId, resolution, signal) {
168
+ return this.connectedRequest("POST", `/sessions/${encodeURIComponent(sessionId)}/external-tool-calls/${encodeURIComponent(callId)}`, resolution, signal);
155
169
  }
156
170
  session(sessionId, signal) {
157
171
  return this.connectedRequest("GET", `/sessions/${encodeURIComponent(sessionId)}`, undefined, signal).then((response) => response.session);
@@ -203,7 +217,7 @@ export class RigDaemonClient {
203
217
  async healthy() {
204
218
  try {
205
219
  const health = await this.request("GET", "/health");
206
- return health.healthy && health.ready;
220
+ return health.status === "ready";
207
221
  }
208
222
  catch {
209
223
  return false;