@orgsdk/cli 0.2.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/README.md +7 -3
  2. package/bin/configuration.mjs +0 -12
  3. package/bin/options.mjs +6 -5
  4. package/bin/orgsdk.mjs +5 -7
  5. package/bin/supervision.mjs +29 -40
  6. package/dist/THIRD_PARTY_NOTICES.txt +53 -0
  7. package/dist/runtime/README.md +3 -3
  8. package/dist/server/index.js +996 -669
  9. package/dist/server/out/404/index.html +1 -1
  10. package/dist/server/out/404.html +1 -1
  11. package/dist/server/out/__next.!KHdvcmtzcGFjZSk.__PAGE__.txt +34 -33
  12. package/dist/server/out/__next._full.txt +28 -27
  13. package/dist/server/out/__next._tree.txt +1 -1
  14. package/dist/server/out/_next/static/chunks/08j8vkv6c63tl.js +1 -0
  15. package/dist/server/out/_next/static/chunks/08mhtndhqtap6.js +1 -0
  16. package/dist/server/out/_next/static/chunks/0_4g944_32yce.js +1 -0
  17. package/dist/server/out/_next/static/chunks/0ldil27yuop5w.js +1 -0
  18. package/dist/server/out/_next/static/chunks/0ml0xmlylpypc.js +1 -0
  19. package/dist/server/out/_next/static/chunks/0pnz1790dyskl.js +1 -0
  20. package/dist/server/out/_next/static/chunks/0vvzjn6qqroc-.js +1 -0
  21. package/dist/server/out/_next/static/chunks/1-rdwquujn9vu.js +1 -0
  22. package/dist/server/out/_next/static/chunks/{0y5lgqdwpeabb.js → 119rk6qs93dvi.js} +1 -1
  23. package/dist/server/out/_next/static/chunks/1mvslk_7tkoql.js +1 -0
  24. package/dist/server/out/_next/static/chunks/1qo38zfnwh7m8.js +1 -0
  25. package/dist/server/out/_next/static/chunks/1wzgdpm-y6pr7.js +1 -0
  26. package/dist/server/out/_next/static/chunks/1ybinna1i7_ih.js +1 -0
  27. package/dist/server/out/_next/static/chunks/1z4_it-ka8j5y.js +1 -0
  28. package/dist/server/out/_next/static/chunks/{0khjy8qh1ll42.js → 23_jxnb5bd655.js} +1 -1
  29. package/dist/server/out/_next/static/chunks/26xwt7opuq5ra.js +1 -0
  30. package/dist/server/out/_next/static/chunks/2_mjw80no8x2k.js +1 -0
  31. package/dist/server/out/_next/static/chunks/2e3acf42jw52v.js +1 -0
  32. package/dist/server/out/_next/static/chunks/2isb6m1ll4dfq.js +3 -0
  33. package/dist/server/out/_next/static/chunks/2q18r9vstryqj.js +3 -0
  34. package/dist/server/out/_next/static/chunks/2zwn2yzygk1de.js +1 -0
  35. package/dist/server/out/_next/static/chunks/{2z60o39-yshg2.js → 36wd29nar_zo_.js} +1 -1
  36. package/dist/server/out/_next/static/chunks/37a4b-pq_bp3z.js +1 -0
  37. package/dist/server/out/_next/static/chunks/37ulwyxnek-f9.js +1 -0
  38. package/dist/server/out/_next/static/chunks/38qp_i6ue7fcy.js +1 -0
  39. package/dist/server/out/_next/static/chunks/3a4y69p5pl3_7.js +10 -0
  40. package/dist/server/out/_next/static/chunks/3l2yelj-blib4.js +1 -0
  41. package/dist/server/out/_next/static/chunks/3u6154viqt17v.js +1 -0
  42. package/dist/server/out/_next/static/chunks/{2navy2mx7--vk.js → 3w6l6p3ylx6oq.js} +2 -2
  43. package/dist/server/out/_next/static/chunks/{0cwfl2xanfapu.js → 3yetoibj5lso8.js} +1 -1
  44. package/dist/server/out/_next/static/chunks/42mg-r2kufm8n.js +1 -0
  45. package/dist/server/out/_not-found/__next._full.txt +22 -19
  46. package/dist/server/out/_not-found/__next._not-found.__PAGE__.txt +25 -22
  47. package/dist/server/out/_not-found/__next._tree.txt +1 -1
  48. package/dist/server/out/_not-found/index.html +1 -1
  49. package/dist/server/out/_not-found/index.txt +22 -19
  50. package/dist/server/out/accounts/2fa/__next._full.txt +25 -24
  51. package/dist/server/out/accounts/2fa/__next._tree.txt +1 -1
  52. package/dist/server/out/accounts/2fa/__next.accounts.2fa.__PAGE__.txt +28 -27
  53. package/dist/server/out/accounts/2fa/index.html +1 -1
  54. package/dist/server/out/accounts/2fa/index.txt +25 -24
  55. package/dist/server/out/accounts/email/__next._full.txt +25 -24
  56. package/dist/server/out/accounts/email/__next._tree.txt +1 -1
  57. package/dist/server/out/accounts/email/__next.accounts.email.__PAGE__.txt +28 -27
  58. package/dist/server/out/accounts/email/index.html +1 -1
  59. package/dist/server/out/accounts/email/index.txt +25 -24
  60. package/dist/server/out/accounts/login/__next._full.txt +25 -24
  61. package/dist/server/out/accounts/login/__next._tree.txt +1 -1
  62. package/dist/server/out/accounts/login/__next.accounts.login.__PAGE__.txt +28 -27
  63. package/dist/server/out/accounts/login/index.html +1 -1
  64. package/dist/server/out/accounts/login/index.txt +25 -24
  65. package/dist/server/out/accounts/logout/__next._full.txt +25 -24
  66. package/dist/server/out/accounts/logout/__next._tree.txt +1 -1
  67. package/dist/server/out/accounts/logout/__next.accounts.logout.__PAGE__.txt +28 -27
  68. package/dist/server/out/accounts/logout/index.html +1 -1
  69. package/dist/server/out/accounts/logout/index.txt +25 -24
  70. package/dist/server/out/accounts/password/change/__next._full.txt +26 -25
  71. package/dist/server/out/accounts/password/change/__next._tree.txt +1 -1
  72. package/dist/server/out/accounts/password/change/__next.accounts.password.change.__PAGE__.txt +30 -29
  73. package/dist/server/out/accounts/password/change/index.html +1 -1
  74. package/dist/server/out/accounts/password/change/index.txt +26 -25
  75. package/dist/server/out/accounts/password/reset/__next._full.txt +25 -23
  76. package/dist/server/out/accounts/password/reset/__next._tree.txt +1 -1
  77. package/dist/server/out/accounts/password/reset/__next.accounts.password.reset.__PAGE__.txt +29 -27
  78. package/dist/server/out/accounts/password/reset/index.html +1 -1
  79. package/dist/server/out/accounts/password/reset/index.txt +25 -23
  80. package/dist/server/out/accounts/signup/__next._full.txt +25 -24
  81. package/dist/server/out/accounts/signup/__next._tree.txt +1 -1
  82. package/dist/server/out/accounts/signup/__next.accounts.signup.__PAGE__.txt +28 -27
  83. package/dist/server/out/accounts/signup/index.html +1 -1
  84. package/dist/server/out/accounts/signup/index.txt +25 -24
  85. package/dist/server/out/actions/__next.!KHdvcmtzcGFjZSk.actions.__PAGE__.txt +33 -33
  86. package/dist/server/out/actions/__next._full.txt +28 -28
  87. package/dist/server/out/actions/__next._tree.txt +1 -1
  88. package/dist/server/out/actions/index.html +1 -1
  89. package/dist/server/out/actions/index.txt +28 -28
  90. package/dist/server/out/agents/__next.!KHdvcmtzcGFjZSk.agents.__PAGE__.txt +38 -37
  91. package/dist/server/out/agents/__next._full.txt +31 -30
  92. package/dist/server/out/agents/__next._tree.txt +1 -1
  93. package/dist/server/out/agents/index.html +1 -1
  94. package/dist/server/out/agents/index.txt +31 -30
  95. package/dist/server/out/approvals/__next.!KHdvcmtzcGFjZSk.approvals.__PAGE__.txt +38 -37
  96. package/dist/server/out/approvals/__next._full.txt +31 -30
  97. package/dist/server/out/approvals/__next._tree.txt +1 -1
  98. package/dist/server/out/approvals/index.html +1 -1
  99. package/dist/server/out/approvals/index.txt +31 -30
  100. package/dist/server/out/artifacts/__next.!KHdvcmtzcGFjZSk.artifacts.__PAGE__.txt +30 -30
  101. package/dist/server/out/artifacts/__next._full.txt +25 -25
  102. package/dist/server/out/artifacts/__next._tree.txt +1 -1
  103. package/dist/server/out/artifacts/index.html +1 -1
  104. package/dist/server/out/artifacts/index.txt +25 -25
  105. package/dist/server/out/audit/__next.!KHdvcmtzcGFjZSk.audit.__PAGE__.txt +35 -34
  106. package/dist/server/out/audit/__next._full.txt +28 -27
  107. package/dist/server/out/audit/__next._tree.txt +1 -1
  108. package/dist/server/out/audit/index.html +1 -1
  109. package/dist/server/out/audit/index.txt +28 -27
  110. package/dist/server/out/chat/__next.!KHdvcmtzcGFjZSk.chat.__PAGE__.txt +34 -33
  111. package/dist/server/out/chat/__next._full.txt +27 -26
  112. package/dist/server/out/chat/__next._tree.txt +1 -1
  113. package/dist/server/out/chat/index.html +1 -1
  114. package/dist/server/out/chat/index.txt +27 -26
  115. package/dist/server/out/connections/__next.!KHdvcmtzcGFjZSk.connections.__PAGE__.txt +38 -37
  116. package/dist/server/out/connections/__next._full.txt +31 -30
  117. package/dist/server/out/connections/__next._tree.txt +1 -1
  118. package/dist/server/out/connections/index.html +1 -1
  119. package/dist/server/out/connections/index.txt +31 -30
  120. package/dist/server/out/credentials/__next.!KHdvcmtzcGFjZSk.credentials.__PAGE__.txt +29 -29
  121. package/dist/server/out/credentials/__next._full.txt +24 -24
  122. package/dist/server/out/credentials/__next._tree.txt +1 -1
  123. package/dist/server/out/credentials/index.html +1 -1
  124. package/dist/server/out/credentials/index.txt +24 -24
  125. package/dist/server/out/documents/__next.!KHdvcmtzcGFjZSk.documents.__PAGE__.txt +38 -37
  126. package/dist/server/out/documents/__next._full.txt +31 -30
  127. package/dist/server/out/documents/__next._tree.txt +1 -1
  128. package/dist/server/out/documents/index.html +1 -1
  129. package/dist/server/out/documents/index.txt +31 -30
  130. package/dist/server/out/index.html +1 -1
  131. package/dist/server/out/index.txt +28 -27
  132. package/dist/server/out/people/__next.!KHdvcmtzcGFjZSk.people.__PAGE__.txt +38 -37
  133. package/dist/server/out/people/__next._full.txt +31 -30
  134. package/dist/server/out/people/__next._tree.txt +1 -1
  135. package/dist/server/out/people/index.html +1 -1
  136. package/dist/server/out/people/index.txt +31 -30
  137. package/dist/server/out/plugins/__next.!KHdvcmtzcGFjZSk.plugins.__PAGE__.txt +31 -31
  138. package/dist/server/out/plugins/__next._full.txt +26 -26
  139. package/dist/server/out/plugins/__next._tree.txt +1 -1
  140. package/dist/server/out/plugins/icons/SOURCES.md +24 -0
  141. package/dist/server/out/plugins/icons/asana.ico +0 -0
  142. package/dist/server/out/plugins/icons/browser-cdp.png +0 -0
  143. package/dist/server/out/plugins/icons/chromium-license.txt +27 -0
  144. package/dist/server/out/plugins/icons/data.svg +1 -0
  145. package/dist/server/out/plugins/icons/facebook.svg +1 -0
  146. package/dist/server/out/plugins/icons/github.svg +10 -0
  147. package/dist/server/out/plugins/icons/gmail.svg +1 -0
  148. package/dist/server/out/plugins/icons/google-drive.svg +1 -0
  149. package/dist/server/out/plugins/icons/google-sheets.svg +1 -0
  150. package/dist/server/out/plugins/icons/google-tasks.svg +1 -0
  151. package/dist/server/out/plugins/icons/harvest.svg +7 -0
  152. package/dist/server/out/plugins/icons/linkedin.png +0 -0
  153. package/dist/server/out/plugins/icons/llm.svg +1 -0
  154. package/dist/server/out/plugins/icons/lucide-license.txt +43 -0
  155. package/dist/server/out/plugins/icons/serper.png +0 -0
  156. package/dist/server/out/plugins/icons/servicem8.png +0 -0
  157. package/dist/server/out/plugins/icons/shippo.png +0 -0
  158. package/dist/server/out/plugins/icons/shopify.png +0 -0
  159. package/dist/server/out/plugins/icons/twitter.svg +1 -0
  160. package/dist/server/out/plugins/icons/xero.svg +15 -0
  161. package/dist/server/out/plugins/icons/zendesk.svg +6 -0
  162. package/dist/server/out/plugins/index.html +1 -1
  163. package/dist/server/out/plugins/index.txt +26 -26
  164. package/dist/server/out/projects/__next.!KHdvcmtzcGFjZSk.projects.__PAGE__.txt +38 -37
  165. package/dist/server/out/projects/__next._full.txt +31 -30
  166. package/dist/server/out/projects/__next._tree.txt +1 -1
  167. package/dist/server/out/projects/index.html +1 -1
  168. package/dist/server/out/projects/index.txt +31 -30
  169. package/dist/server/out/runs/__next.!KHdvcmtzcGFjZSk.runs.__PAGE__.txt +30 -30
  170. package/dist/server/out/runs/__next._full.txt +25 -25
  171. package/dist/server/out/runs/__next._tree.txt +1 -1
  172. package/dist/server/out/runs/index.html +1 -1
  173. package/dist/server/out/runs/index.txt +25 -25
  174. package/dist/server/out/schedules/__next.!KHdvcmtzcGFjZSk.schedules.__PAGE__.txt +29 -29
  175. package/dist/server/out/schedules/__next._full.txt +24 -24
  176. package/dist/server/out/schedules/__next._tree.txt +1 -1
  177. package/dist/server/out/schedules/index.html +1 -1
  178. package/dist/server/out/schedules/index.txt +24 -24
  179. package/dist/server/out/settings/__next.!KHdvcmtzcGFjZSk.settings.__PAGE__.txt +38 -37
  180. package/dist/server/out/settings/__next._full.txt +31 -30
  181. package/dist/server/out/settings/__next._tree.txt +1 -1
  182. package/dist/server/out/settings/index.html +1 -1
  183. package/dist/server/out/settings/index.txt +31 -30
  184. package/dist/server/out/setup/__next._full.txt +27 -26
  185. package/dist/server/out/setup/__next._tree.txt +1 -1
  186. package/dist/server/out/setup/__next.setup.__PAGE__.txt +30 -29
  187. package/dist/server/out/setup/index.html +1 -1
  188. package/dist/server/out/setup/index.txt +27 -26
  189. package/dist/server/out/studio/approve/__next._full.txt +30 -0
  190. package/dist/server/out/studio/approve/__next._tree.txt +5 -0
  191. package/dist/server/out/studio/approve/__next.studio.approve.__PAGE__.txt +37 -0
  192. package/dist/server/out/studio/approve/index.html +1 -0
  193. package/dist/server/out/studio/approve/index.txt +30 -0
  194. package/dist/server/out/tables/__next.!KHdvcmtzcGFjZSk.tables.__PAGE__.txt +35 -34
  195. package/dist/server/out/tables/__next._full.txt +28 -27
  196. package/dist/server/out/tables/__next._tree.txt +1 -1
  197. package/dist/server/out/tables/index.html +1 -1
  198. package/dist/server/out/tables/index.txt +28 -27
  199. package/dist/server/out/webhooks/__next.!KHdvcmtzcGFjZSk.webhooks.__PAGE__.txt +38 -37
  200. package/dist/server/out/webhooks/__next._full.txt +31 -30
  201. package/dist/server/out/webhooks/__next._tree.txt +1 -1
  202. package/dist/server/out/webhooks/index.html +1 -1
  203. package/dist/server/out/webhooks/index.txt +31 -30
  204. package/dist/server/out/workspaces/invite/__next._full.txt +28 -27
  205. package/dist/server/out/workspaces/invite/__next._tree.txt +1 -1
  206. package/dist/server/out/workspaces/invite/__next.workspaces.invite.__PAGE__.txt +31 -30
  207. package/dist/server/out/workspaces/invite/index.html +1 -1
  208. package/dist/server/out/workspaces/invite/index.txt +28 -27
  209. package/docs/browser-sessions.md +3 -3
  210. package/docs/npm-distribution.md +4 -4
  211. package/docs/studio.md +25 -0
  212. package/package.json +3 -1
  213. package/runtime/README.md +3 -3
  214. package/dist/server/out/_next/static/chunks/0ay0b1lpy734z.js +0 -1
  215. package/dist/server/out/_next/static/chunks/0e7s8ie0wlk66.js +0 -1
  216. package/dist/server/out/_next/static/chunks/0ey-6hb0za4r_.js +0 -1
  217. package/dist/server/out/_next/static/chunks/0r0572w1rwpcv.js +0 -1
  218. package/dist/server/out/_next/static/chunks/0u_9k8f7709np.js +0 -1
  219. package/dist/server/out/_next/static/chunks/0w34iczo7r1v5.js +0 -1
  220. package/dist/server/out/_next/static/chunks/0zfiikazg0_ga.js +0 -1
  221. package/dist/server/out/_next/static/chunks/19ue6x5c3f_38.js +0 -3
  222. package/dist/server/out/_next/static/chunks/1c2xcwifk3vhh.js +0 -1
  223. package/dist/server/out/_next/static/chunks/1dwr62uuyceq-.js +0 -1
  224. package/dist/server/out/_next/static/chunks/1fweh1ttncdlv.js +0 -1
  225. package/dist/server/out/_next/static/chunks/1iklteprcoims.js +0 -1
  226. package/dist/server/out/_next/static/chunks/1qaow7bdy3oid.js +0 -1
  227. package/dist/server/out/_next/static/chunks/1wn9ohqcnx8y8.js +0 -3
  228. package/dist/server/out/_next/static/chunks/1zieh-zxgxmcp.js +0 -1
  229. package/dist/server/out/_next/static/chunks/25qsan0t-_of0.js +0 -1
  230. package/dist/server/out/_next/static/chunks/26yareaaj1kyr.js +0 -1
  231. package/dist/server/out/_next/static/chunks/2bkkmnhngpacd.js +0 -1
  232. package/dist/server/out/_next/static/chunks/2e39uy7huhczu.js +0 -1
  233. package/dist/server/out/_next/static/chunks/2rp65hq6bmpxv.js +0 -1
  234. package/dist/server/out/_next/static/chunks/3_d6w25_b15kx.js +0 -1
  235. package/dist/server/out/_next/static/chunks/3d8gkwu9nszjk.js +0 -1
  236. package/dist/server/out/_next/static/chunks/3l-16g1y6k5rs.js +0 -1
  237. package/dist/server/out/_next/static/chunks/3obu_9-ka7u_h.js +0 -1
  238. package/dist/server/out/_next/static/chunks/3u7q5w03st-rs.js +0 -1
  239. /package/dist/server/out/_next/static/{pj0R4_8zvgkN95QPXRHgC → EF7eiGRF-6pU64XbVOn6f}/_buildManifest.js +0 -0
  240. /package/dist/server/out/_next/static/{pj0R4_8zvgkN95QPXRHgC → EF7eiGRF-6pU64XbVOn6f}/_clientMiddlewareManifest.js +0 -0
  241. /package/dist/server/out/_next/static/{pj0R4_8zvgkN95QPXRHgC → EF7eiGRF-6pU64XbVOn6f}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -11,7 +11,7 @@ npm install -g @orgsdk/cli
11
11
  orgsdk start
12
12
  ```
13
13
 
14
- Open `http://127.0.0.1:8080` and create your workspace and account. The command starts the platform and a separate executor manager. It connects a local runner for each enabled project, so code, validation and action tests can run without a separate registration command. Neither Bun nor Docker is required for this local mode. Code and plugins run with your current user's host privileges; use trusted code and clients. This mode is not an operating-system sandbox.
14
+ Open the installation URL printed at startup and create your workspace and account. The command starts the platform and a separate executor manager. It connects a local runner for each enabled project, so code, validation and action tests can run without a separate registration command. Neither Bun nor Docker is required for this local mode. Code and plugins run with your current user's host privileges; use trusted code and clients. This mode is not an operating-system sandbox.
15
15
 
16
16
  `orgsdk start --data /path/to/installation --port 8081` selects another installation. Data defaults to `~/.local/share/orgsdk`, outside the npm package: the database and encryption key are in that directory, and executor project folders are under `executor/agents/`. Stopping with Ctrl+C stops the supervised processes. Reinstalling the package does not remove installation data; back up that directory before upgrading.
17
17
 
@@ -19,15 +19,19 @@ Use `orgsdk server` to run only the platform, or `orgsdk executor --help` to reg
19
19
 
20
20
  See [distribution and verification](docs/npm-distribution.md) for pinned installation, upgrades, recovery and release checks.
21
21
 
22
+ Open [OrgSDK Studio](https://studio.orgsdk.ai) and choose **Connect to this computer**. Studio discovers your local installation and asks you to approve access. You can also use the local dashboard printed by the CLI. See [Studio connections](docs/studio.md) for browser support and remote installations.
23
+
22
24
  ## Browser discovery sessions
23
25
 
26
+ OrgSDK workspace access tokens for MCP and tRPC begin with `orgsdk_mcp_`. Send the full value in the `Authorization: Bearer` header. After upgrading the platform, prepend `orgsdk_mcp_` to any unprefixed workspace token saved in a client. Its grants, revocation status and activity history carry over.
27
+
24
28
  Use an external MCP client to iterate on a live browser with persistent TypeScript variables, then validate, test and replay the steps as a versioned action. See the [local browser session guide](docs/browser-sessions.md) for setup, example cells and a reproducible end-to-end check.
25
29
 
26
30
  ## Build and run locally
27
31
 
28
- Install Bun 1.4, Node.js 22.22.0 or newer and npm, then run `npm run setup` and `npm run build`. Start `dist/orgsdk` and open `http://127.0.0.1:8080`. The executable embeds the frontend, including Monaco, and does not require Bun or Node at runtime. `HOST`, `PORT`, and `ORGSDK_DATA_DIR` configure listening and storage. The default data directory is `~/.local/share/orgsdk`.
32
+ Install Bun 1.4, Node.js 22.22.0 or newer and npm, then run `npm run setup` and `npm run build`. Start `dist/orgsdk` and open the URL it prints. The executable embeds the frontend, including Monaco, and does not require Bun or Node at runtime. `HOST`, `PORT`, and `ORGSDK_DATA_DIR` configure listening and storage. The default data directory is `~/.local/share/orgsdk`.
29
33
 
30
- To build the npm package, run `npm run build:npm`, then `npm pack --ignore-scripts`. The tarball includes the platform JavaScript, frontend, migrations and executor workers. `npm pack` without `--ignore-scripts` builds those assets automatically. Use `npm run test:distribution -- ./orgsdk-cli-0.2.0.tgz` to install and verify the actual tarball with temporary data and a Node-only runtime path. Replace the tarball argument with `@orgsdk/cli@VERSION` to verify the registry release.
34
+ To build the npm package, run `npm run build:npm`, then `npm pack --ignore-scripts`. The tarball includes the platform JavaScript, frontend, migrations and executor workers. `npm pack` without `--ignore-scripts` builds those assets automatically. Use `npm run test:distribution -- ./orgsdk-cli-1.1.0.tgz` to install and verify the actual tarball with temporary data and a Node-only runtime path. Replace the tarball argument with `@orgsdk/cli@VERSION` to verify the registry release.
31
35
 
32
36
  Both release builds generate `dist/THIRD_PARTY_NOTICES.txt` from the installed dependencies. It is included in the npm tarball; distribute it alongside `dist/orgsdk` when sharing the standalone executable. The notice text is generated during packaging and is not stored in the source tree or served as frontend assets.
33
37
 
@@ -1,7 +1,6 @@
1
1
  import { randomBytes } from "node:crypto";
2
2
  import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
- import { createServer } from "node:net";
5
4
 
6
5
  export function requireDockerConfiguration(env) {
7
6
  for (const name of ["EXECUTOR_IMAGE", "EXECUTION_NETWORK"]) {
@@ -16,17 +15,6 @@ export function requireDockerConfiguration(env) {
16
15
  }
17
16
  }
18
17
 
19
- export async function requireAvailablePort(host, port) {
20
- const probe = createServer();
21
- await new Promise((resolve, reject) => {
22
- probe.once("error", reject);
23
- probe.listen({ host, port: Number(port), exclusive: true }, resolve);
24
- });
25
- await new Promise((resolve, reject) => {
26
- probe.close((error) => (error ? reject(error) : resolve()));
27
- });
28
- }
29
-
30
18
  export async function bootstrapToken(dataDirectory) {
31
19
  await mkdir(dataDirectory, { recursive: true, mode: 0o700 });
32
20
  const filename = join(dataDirectory, "local-executor.token");
package/bin/options.mjs CHANGED
@@ -17,7 +17,7 @@ Commands:
17
17
  Options:
18
18
  --data DIR Installation data (default: ~/.local/share/orgsdk)
19
19
  --host HOST Listen address (default: 127.0.0.1)
20
- --port PORT Listen port (default: 8080)
20
+ --port PORT Exact listen port (new local installations try 28940–28947)
21
21
  --mode host|docker Executor mode for start (default: host)
22
22
  --help, -h Show this help
23
23
  --version, -v Show the package version
@@ -63,7 +63,7 @@ export function parseArguments(args, env = process.env) {
63
63
  command,
64
64
  data,
65
65
  host: env.HOST || "127.0.0.1",
66
- port: env.PORT || "8080",
66
+ port: env.PORT || undefined,
67
67
  mode: "host",
68
68
  args: [],
69
69
  };
@@ -105,9 +105,10 @@ export function parseArguments(args, env = process.env) {
105
105
  throw new Error(`Missing argument for ${command}. Use orgsdk --help.`);
106
106
  }
107
107
  if (
108
- !/^\d+$/.test(options.port) ||
109
- Number(options.port) < 1 ||
110
- Number(options.port) > 65535
108
+ options.port !== undefined &&
109
+ (!/^\d+$/.test(options.port) ||
110
+ Number(options.port) < 1 ||
111
+ Number(options.port) > 65535)
111
112
  ) {
112
113
  throw new Error("PORT must be between 1 and 65535.");
113
114
  }
package/bin/orgsdk.mjs CHANGED
@@ -6,8 +6,6 @@ import process from "node:process";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import {
8
8
  bootstrapToken,
9
- localAddress,
10
- requireAvailablePort,
11
9
  requireDockerConfiguration,
12
10
  } from "./configuration.mjs";
13
11
  import { help, parseArguments } from "./options.mjs";
@@ -56,7 +54,11 @@ async function main() {
56
54
  return supervise({ server: executor, serverArgs: options.args, env });
57
55
  }
58
56
  env.HOST = options.host;
59
- env.PORT = options.port;
57
+ if (options.port) {
58
+ env.PORT = options.port;
59
+ } else {
60
+ delete env.PORT;
61
+ }
60
62
  if (options.command !== "start") {
61
63
  return supervise({
62
64
  server,
@@ -67,11 +69,8 @@ async function main() {
67
69
  if (options.mode === "docker") {
68
70
  requireDockerConfiguration(env);
69
71
  }
70
- await requireAvailablePort(options.host, options.port);
71
72
  env.LOCAL_EXECUTOR_BOOTSTRAP_TOKEN = await bootstrapToken(options.data);
72
73
  env.EXECUTOR_DATA_DIR ||= join(options.data, "executor");
73
- const address = localAddress(options.host, options.port);
74
- env.ORGSDK_SERVER_URL = address;
75
74
  if (options.mode === "host") {
76
75
  console.log(
77
76
  "Local executor: project code runs with your current user's host privileges. Use trusted code and clients only.",
@@ -83,7 +82,6 @@ async function main() {
83
82
  executor,
84
83
  executorArgs: ["manage", "--mode", options.mode],
85
84
  env,
86
- address,
87
85
  });
88
86
  }
89
87
 
@@ -1,10 +1,11 @@
1
+ import { once } from "node:events";
2
+ import { localAddress } from "./configuration.mjs";
1
3
  import { spawn } from "node:child_process";
2
4
  import process from "node:process";
3
- import { setTimeout as delay } from "node:timers/promises";
4
5
 
5
- function launch(entry, args, env) {
6
+ function launch(entry, args, env, ipc = false) {
6
7
  const child = spawn(process.execPath, [entry, ...args], {
7
- stdio: "inherit",
8
+ stdio: ipc ? ["inherit", "inherit", "inherit", "ipc"] : "inherit",
8
9
  env,
9
10
  detached: process.platform !== "win32",
10
11
  });
@@ -39,41 +40,12 @@ function exitStatus(result) {
39
40
  return result.signal === "SIGINT" ? 130 : 143;
40
41
  }
41
42
 
42
- async function waitForServer(address, signal, publicOrigin) {
43
- const deadline = Date.now() + 20_000;
44
- while (Date.now() < deadline) {
45
- signal.throwIfAborted();
46
- try {
47
- const response = await fetch(`${address}/trpc/system.health`, {
48
- signal: AbortSignal.any([signal, AbortSignal.timeout(1000)]),
49
- ...(publicOrigin
50
- ? { headers: { Host: new URL(publicOrigin).host } }
51
- : {}),
52
- });
53
- if (response.ok) {
54
- const health = await response.json();
55
- if (health?.result?.data?.status === "ok") {
56
- return;
57
- }
58
- }
59
- } catch (error) {
60
- signal.throwIfAborted();
61
- if (!(error instanceof Error)) {
62
- throw error;
63
- }
64
- }
65
- await delay(200, undefined, { signal });
66
- }
67
- throw new Error("Platform did not become ready within 20 seconds.");
68
- }
69
-
70
43
  export async function supervise({
71
44
  server,
72
45
  executor,
73
46
  serverArgs = ["server"],
74
47
  executorArgs = ["manage"],
75
48
  env,
76
- address,
77
49
  }) {
78
50
  const children = [];
79
51
  const controller = new AbortController();
@@ -116,25 +88,42 @@ export async function supervise({
116
88
  process.once("SIGINT", onInterrupt);
117
89
  process.once("SIGTERM", onTerminate);
118
90
  try {
119
- const platform = launch(server, serverArgs, env);
91
+ const platform = launch(server, serverArgs, env, Boolean(executor));
120
92
  children.push(platform);
121
93
  if (executor) {
122
94
  const readiness = await Promise.race([
123
- waitForServer(
124
- address,
125
- controller.signal,
126
- env.ORGSDK_PUBLIC_ORIGIN,
127
- ).then(() => undefined),
95
+ once(platform.child, "message", {
96
+ signal: AbortSignal.any([
97
+ controller.signal,
98
+ AbortSignal.timeout(20_000),
99
+ ]),
100
+ }).then(([message]) => {
101
+ if (
102
+ !Number.isInteger(message?.port) ||
103
+ message.port < 1 ||
104
+ message.port > 65535
105
+ ) {
106
+ throw new Error("Invalid platform listener.");
107
+ }
108
+ return {
109
+ address: localAddress(env.HOST ?? "127.0.0.1", message.port),
110
+ };
111
+ }),
128
112
  platform.closed,
129
113
  ]);
130
- if (readiness) {
114
+ if (!("address" in readiness)) {
131
115
  if (readiness.error) {
132
116
  throw readiness.error;
133
117
  }
134
118
  return requestedStatus ?? (exitStatus(readiness) || 1);
135
119
  }
136
120
  controller.signal.throwIfAborted();
137
- children.push(launch(executor, executorArgs, env));
121
+ children.push(
122
+ launch(executor, executorArgs, {
123
+ ...env,
124
+ ORGSDK_SERVER_URL: readiness.address,
125
+ }),
126
+ );
138
127
  }
139
128
  const result = await Promise.race(children.map(({ closed }) => closed));
140
129
  if (result.error) {
@@ -225,6 +225,59 @@ CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for
225
225
  the full license text.
226
226
 
227
227
 
228
+ ==============================================================================
229
+ eventsource@4.1.1
230
+
231
+ The MIT License
232
+
233
+ Copyright (c) EventSource GitHub organisation
234
+
235
+ Permission is hereby granted, free of charge, to any person obtaining
236
+ a copy of this software and associated documentation files (the
237
+ "Software"), to deal in the Software without restriction, including
238
+ without limitation the rights to use, copy, modify, merge, publish,
239
+ distribute, sublicense, and/or sell copies of the Software, and to
240
+ permit persons to whom the Software is furnished to do so, subject to
241
+ the following conditions:
242
+
243
+ The above copyright notice and this permission notice shall be
244
+ included in all copies or substantial portions of the Software.
245
+
246
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
247
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
248
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
249
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
250
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
251
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
252
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
253
+
254
+
255
+ ==============================================================================
256
+ eventsource-parser@3.1.1
257
+
258
+ MIT License
259
+
260
+ Copyright (c) 2026 Espen Hovlandsdal <espen@hovlandsdal.com>
261
+
262
+ Permission is hereby granted, free of charge, to any person obtaining a copy
263
+ of this software and associated documentation files (the "Software"), to deal
264
+ in the Software without restriction, including without limitation the rights
265
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
266
+ copies of the Software, and to permit persons to whom the Software is
267
+ furnished to do so, subject to the following conditions:
268
+
269
+ The above copyright notice and this permission notice shall be included in all
270
+ copies or substantial portions of the Software.
271
+
272
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
273
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
274
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
275
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
276
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
277
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
278
+ SOFTWARE.
279
+
280
+
228
281
  ==============================================================================
229
282
  monaco-editor@0.52.2
230
283
 
@@ -35,7 +35,7 @@ For an existing plugin checkout using the canonical `.plugin.json` with `name`,
35
35
 
36
36
  Use this optional systemd service to run a project executor on a local Linux machine.
37
37
  The service communicates with the application over HTTP and never accesses the application database.
38
- Use `http://localhost:8080` when the service runs on the server machine, or the
38
+ Use the loopback URL printed by OrgSDK when the service runs on the server machine, or the
39
39
  server's reachable local network address when using another machine. Docker
40
40
  jobs also need a server address reachable from their container; container
41
41
  `localhost` refers to the job container itself. Allow outbound access to the
@@ -49,8 +49,8 @@ Docker mode also needs Docker
49
49
  Engine. Extract the installer from the tarball and run it as root:
50
50
 
51
51
  ```sh
52
- tar -xzf orgsdk-executor-0.2.0.tgz package/scripts/install-service.sh
53
- sudo bash package/scripts/install-service.sh "$PWD/orgsdk-executor-0.2.0.tgz" researcher docker
52
+ tar -xzf orgsdk-executor-1.1.0.tgz package/scripts/install-service.sh
53
+ sudo bash package/scripts/install-service.sh "$PWD/orgsdk-executor-1.1.0.tgz" researcher docker
54
54
  ```
55
55
 
56
56
  The installer creates `/opt/orgsdk-executor`, the `orgsdk-researcher` system