@orgsdk/cli 1.0.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.
- package/README.md +5 -3
- package/bin/configuration.mjs +0 -12
- package/bin/options.mjs +6 -5
- package/bin/orgsdk.mjs +5 -7
- package/bin/supervision.mjs +29 -40
- package/dist/THIRD_PARTY_NOTICES.txt +53 -0
- package/dist/runtime/README.md +3 -3
- package/dist/server/index.js +935 -650
- package/dist/server/out/404/index.html +1 -1
- package/dist/server/out/404.html +1 -1
- package/dist/server/out/__next.!KHdvcmtzcGFjZSk.__PAGE__.txt +34 -33
- package/dist/server/out/__next._full.txt +28 -27
- package/dist/server/out/__next._tree.txt +1 -1
- package/dist/server/out/_next/static/chunks/08j8vkv6c63tl.js +1 -0
- package/dist/server/out/_next/static/chunks/08mhtndhqtap6.js +1 -0
- package/dist/server/out/_next/static/chunks/0_4g944_32yce.js +1 -0
- package/dist/server/out/_next/static/chunks/0ldil27yuop5w.js +1 -0
- package/dist/server/out/_next/static/chunks/0ml0xmlylpypc.js +1 -0
- package/dist/server/out/_next/static/chunks/0pnz1790dyskl.js +1 -0
- package/dist/server/out/_next/static/chunks/0vvzjn6qqroc-.js +1 -0
- package/dist/server/out/_next/static/chunks/1-rdwquujn9vu.js +1 -0
- package/dist/server/out/_next/static/chunks/{0y5lgqdwpeabb.js → 119rk6qs93dvi.js} +1 -1
- package/dist/server/out/_next/static/chunks/1mvslk_7tkoql.js +1 -0
- package/dist/server/out/_next/static/chunks/1qo38zfnwh7m8.js +1 -0
- package/dist/server/out/_next/static/chunks/1wzgdpm-y6pr7.js +1 -0
- package/dist/server/out/_next/static/chunks/1ybinna1i7_ih.js +1 -0
- package/dist/server/out/_next/static/chunks/1z4_it-ka8j5y.js +1 -0
- package/dist/server/out/_next/static/chunks/{0khjy8qh1ll42.js → 23_jxnb5bd655.js} +1 -1
- package/dist/server/out/_next/static/chunks/26xwt7opuq5ra.js +1 -0
- package/dist/server/out/_next/static/chunks/2_mjw80no8x2k.js +1 -0
- package/dist/server/out/_next/static/chunks/2e3acf42jw52v.js +1 -0
- package/dist/server/out/_next/static/chunks/2isb6m1ll4dfq.js +3 -0
- package/dist/server/out/_next/static/chunks/2q18r9vstryqj.js +3 -0
- package/dist/server/out/_next/static/chunks/2zwn2yzygk1de.js +1 -0
- package/dist/server/out/_next/static/chunks/{2z60o39-yshg2.js → 36wd29nar_zo_.js} +1 -1
- package/dist/server/out/_next/static/chunks/37a4b-pq_bp3z.js +1 -0
- package/dist/server/out/_next/static/chunks/37ulwyxnek-f9.js +1 -0
- package/dist/server/out/_next/static/chunks/38qp_i6ue7fcy.js +1 -0
- package/dist/server/out/_next/static/chunks/3a4y69p5pl3_7.js +10 -0
- package/dist/server/out/_next/static/chunks/3l2yelj-blib4.js +1 -0
- package/dist/server/out/_next/static/chunks/3u6154viqt17v.js +1 -0
- package/dist/server/out/_next/static/chunks/{2navy2mx7--vk.js → 3w6l6p3ylx6oq.js} +2 -2
- package/dist/server/out/_next/static/chunks/{0cwfl2xanfapu.js → 3yetoibj5lso8.js} +1 -1
- package/dist/server/out/_next/static/chunks/42mg-r2kufm8n.js +1 -0
- package/dist/server/out/_not-found/__next._full.txt +22 -19
- package/dist/server/out/_not-found/__next._not-found.__PAGE__.txt +25 -22
- package/dist/server/out/_not-found/__next._tree.txt +1 -1
- package/dist/server/out/_not-found/index.html +1 -1
- package/dist/server/out/_not-found/index.txt +22 -19
- package/dist/server/out/accounts/2fa/__next._full.txt +25 -24
- package/dist/server/out/accounts/2fa/__next._tree.txt +1 -1
- package/dist/server/out/accounts/2fa/__next.accounts.2fa.__PAGE__.txt +28 -27
- package/dist/server/out/accounts/2fa/index.html +1 -1
- package/dist/server/out/accounts/2fa/index.txt +25 -24
- package/dist/server/out/accounts/email/__next._full.txt +25 -24
- package/dist/server/out/accounts/email/__next._tree.txt +1 -1
- package/dist/server/out/accounts/email/__next.accounts.email.__PAGE__.txt +28 -27
- package/dist/server/out/accounts/email/index.html +1 -1
- package/dist/server/out/accounts/email/index.txt +25 -24
- package/dist/server/out/accounts/login/__next._full.txt +25 -24
- package/dist/server/out/accounts/login/__next._tree.txt +1 -1
- package/dist/server/out/accounts/login/__next.accounts.login.__PAGE__.txt +28 -27
- package/dist/server/out/accounts/login/index.html +1 -1
- package/dist/server/out/accounts/login/index.txt +25 -24
- package/dist/server/out/accounts/logout/__next._full.txt +25 -24
- package/dist/server/out/accounts/logout/__next._tree.txt +1 -1
- package/dist/server/out/accounts/logout/__next.accounts.logout.__PAGE__.txt +28 -27
- package/dist/server/out/accounts/logout/index.html +1 -1
- package/dist/server/out/accounts/logout/index.txt +25 -24
- package/dist/server/out/accounts/password/change/__next._full.txt +26 -25
- package/dist/server/out/accounts/password/change/__next._tree.txt +1 -1
- package/dist/server/out/accounts/password/change/__next.accounts.password.change.__PAGE__.txt +30 -29
- package/dist/server/out/accounts/password/change/index.html +1 -1
- package/dist/server/out/accounts/password/change/index.txt +26 -25
- package/dist/server/out/accounts/password/reset/__next._full.txt +25 -23
- package/dist/server/out/accounts/password/reset/__next._tree.txt +1 -1
- package/dist/server/out/accounts/password/reset/__next.accounts.password.reset.__PAGE__.txt +29 -27
- package/dist/server/out/accounts/password/reset/index.html +1 -1
- package/dist/server/out/accounts/password/reset/index.txt +25 -23
- package/dist/server/out/accounts/signup/__next._full.txt +25 -24
- package/dist/server/out/accounts/signup/__next._tree.txt +1 -1
- package/dist/server/out/accounts/signup/__next.accounts.signup.__PAGE__.txt +28 -27
- package/dist/server/out/accounts/signup/index.html +1 -1
- package/dist/server/out/accounts/signup/index.txt +25 -24
- package/dist/server/out/actions/__next.!KHdvcmtzcGFjZSk.actions.__PAGE__.txt +33 -33
- package/dist/server/out/actions/__next._full.txt +28 -28
- package/dist/server/out/actions/__next._tree.txt +1 -1
- package/dist/server/out/actions/index.html +1 -1
- package/dist/server/out/actions/index.txt +28 -28
- package/dist/server/out/agents/__next.!KHdvcmtzcGFjZSk.agents.__PAGE__.txt +38 -37
- package/dist/server/out/agents/__next._full.txt +31 -30
- package/dist/server/out/agents/__next._tree.txt +1 -1
- package/dist/server/out/agents/index.html +1 -1
- package/dist/server/out/agents/index.txt +31 -30
- package/dist/server/out/approvals/__next.!KHdvcmtzcGFjZSk.approvals.__PAGE__.txt +38 -37
- package/dist/server/out/approvals/__next._full.txt +31 -30
- package/dist/server/out/approvals/__next._tree.txt +1 -1
- package/dist/server/out/approvals/index.html +1 -1
- package/dist/server/out/approvals/index.txt +31 -30
- package/dist/server/out/artifacts/__next.!KHdvcmtzcGFjZSk.artifacts.__PAGE__.txt +30 -30
- package/dist/server/out/artifacts/__next._full.txt +25 -25
- package/dist/server/out/artifacts/__next._tree.txt +1 -1
- package/dist/server/out/artifacts/index.html +1 -1
- package/dist/server/out/artifacts/index.txt +25 -25
- package/dist/server/out/audit/__next.!KHdvcmtzcGFjZSk.audit.__PAGE__.txt +35 -34
- package/dist/server/out/audit/__next._full.txt +28 -27
- package/dist/server/out/audit/__next._tree.txt +1 -1
- package/dist/server/out/audit/index.html +1 -1
- package/dist/server/out/audit/index.txt +28 -27
- package/dist/server/out/chat/__next.!KHdvcmtzcGFjZSk.chat.__PAGE__.txt +34 -33
- package/dist/server/out/chat/__next._full.txt +27 -26
- package/dist/server/out/chat/__next._tree.txt +1 -1
- package/dist/server/out/chat/index.html +1 -1
- package/dist/server/out/chat/index.txt +27 -26
- package/dist/server/out/connections/__next.!KHdvcmtzcGFjZSk.connections.__PAGE__.txt +38 -37
- package/dist/server/out/connections/__next._full.txt +31 -30
- package/dist/server/out/connections/__next._tree.txt +1 -1
- package/dist/server/out/connections/index.html +1 -1
- package/dist/server/out/connections/index.txt +31 -30
- package/dist/server/out/credentials/__next.!KHdvcmtzcGFjZSk.credentials.__PAGE__.txt +29 -29
- package/dist/server/out/credentials/__next._full.txt +24 -24
- package/dist/server/out/credentials/__next._tree.txt +1 -1
- package/dist/server/out/credentials/index.html +1 -1
- package/dist/server/out/credentials/index.txt +24 -24
- package/dist/server/out/documents/__next.!KHdvcmtzcGFjZSk.documents.__PAGE__.txt +38 -37
- package/dist/server/out/documents/__next._full.txt +31 -30
- package/dist/server/out/documents/__next._tree.txt +1 -1
- package/dist/server/out/documents/index.html +1 -1
- package/dist/server/out/documents/index.txt +31 -30
- package/dist/server/out/index.html +1 -1
- package/dist/server/out/index.txt +28 -27
- package/dist/server/out/people/__next.!KHdvcmtzcGFjZSk.people.__PAGE__.txt +38 -37
- package/dist/server/out/people/__next._full.txt +31 -30
- package/dist/server/out/people/__next._tree.txt +1 -1
- package/dist/server/out/people/index.html +1 -1
- package/dist/server/out/people/index.txt +31 -30
- package/dist/server/out/plugins/__next.!KHdvcmtzcGFjZSk.plugins.__PAGE__.txt +31 -31
- package/dist/server/out/plugins/__next._full.txt +26 -26
- package/dist/server/out/plugins/__next._tree.txt +1 -1
- package/dist/server/out/plugins/index.html +1 -1
- package/dist/server/out/plugins/index.txt +26 -26
- package/dist/server/out/projects/__next.!KHdvcmtzcGFjZSk.projects.__PAGE__.txt +38 -37
- package/dist/server/out/projects/__next._full.txt +31 -30
- package/dist/server/out/projects/__next._tree.txt +1 -1
- package/dist/server/out/projects/index.html +1 -1
- package/dist/server/out/projects/index.txt +31 -30
- package/dist/server/out/runs/__next.!KHdvcmtzcGFjZSk.runs.__PAGE__.txt +30 -30
- package/dist/server/out/runs/__next._full.txt +25 -25
- package/dist/server/out/runs/__next._tree.txt +1 -1
- package/dist/server/out/runs/index.html +1 -1
- package/dist/server/out/runs/index.txt +25 -25
- package/dist/server/out/schedules/__next.!KHdvcmtzcGFjZSk.schedules.__PAGE__.txt +29 -29
- package/dist/server/out/schedules/__next._full.txt +24 -24
- package/dist/server/out/schedules/__next._tree.txt +1 -1
- package/dist/server/out/schedules/index.html +1 -1
- package/dist/server/out/schedules/index.txt +24 -24
- package/dist/server/out/settings/__next.!KHdvcmtzcGFjZSk.settings.__PAGE__.txt +38 -37
- package/dist/server/out/settings/__next._full.txt +31 -30
- package/dist/server/out/settings/__next._tree.txt +1 -1
- package/dist/server/out/settings/index.html +1 -1
- package/dist/server/out/settings/index.txt +31 -30
- package/dist/server/out/setup/__next._full.txt +27 -26
- package/dist/server/out/setup/__next._tree.txt +1 -1
- package/dist/server/out/setup/__next.setup.__PAGE__.txt +30 -29
- package/dist/server/out/setup/index.html +1 -1
- package/dist/server/out/setup/index.txt +27 -26
- package/dist/server/out/studio/approve/__next._full.txt +30 -0
- package/dist/server/out/studio/approve/__next._tree.txt +5 -0
- package/dist/server/out/studio/approve/__next.studio.approve.__PAGE__.txt +37 -0
- package/dist/server/out/studio/approve/index.html +1 -0
- package/dist/server/out/studio/approve/index.txt +30 -0
- package/dist/server/out/tables/__next.!KHdvcmtzcGFjZSk.tables.__PAGE__.txt +35 -34
- package/dist/server/out/tables/__next._full.txt +28 -27
- package/dist/server/out/tables/__next._tree.txt +1 -1
- package/dist/server/out/tables/index.html +1 -1
- package/dist/server/out/tables/index.txt +28 -27
- package/dist/server/out/webhooks/__next.!KHdvcmtzcGFjZSk.webhooks.__PAGE__.txt +38 -37
- package/dist/server/out/webhooks/__next._full.txt +31 -30
- package/dist/server/out/webhooks/__next._tree.txt +1 -1
- package/dist/server/out/webhooks/index.html +1 -1
- package/dist/server/out/webhooks/index.txt +31 -30
- package/dist/server/out/workspaces/invite/__next._full.txt +28 -27
- package/dist/server/out/workspaces/invite/__next._tree.txt +1 -1
- package/dist/server/out/workspaces/invite/__next.workspaces.invite.__PAGE__.txt +31 -30
- package/dist/server/out/workspaces/invite/index.html +1 -1
- package/dist/server/out/workspaces/invite/index.txt +28 -27
- package/docs/browser-sessions.md +3 -3
- package/docs/npm-distribution.md +4 -4
- package/docs/studio.md +25 -0
- package/package.json +3 -1
- package/runtime/README.md +3 -3
- package/dist/server/out/_next/static/chunks/0ay0b1lpy734z.js +0 -1
- package/dist/server/out/_next/static/chunks/0e7s8ie0wlk66.js +0 -1
- package/dist/server/out/_next/static/chunks/0ey-6hb0za4r_.js +0 -1
- package/dist/server/out/_next/static/chunks/0r0572w1rwpcv.js +0 -1
- package/dist/server/out/_next/static/chunks/0rghk0nc6wr4-.js +0 -3
- package/dist/server/out/_next/static/chunks/0u_9k8f7709np.js +0 -1
- package/dist/server/out/_next/static/chunks/0w34iczo7r1v5.js +0 -1
- package/dist/server/out/_next/static/chunks/0zfiikazg0_ga.js +0 -1
- package/dist/server/out/_next/static/chunks/1c2xcwifk3vhh.js +0 -1
- package/dist/server/out/_next/static/chunks/1clfpekejl_sp.js +0 -1
- package/dist/server/out/_next/static/chunks/1dwr62uuyceq-.js +0 -1
- package/dist/server/out/_next/static/chunks/1fweh1ttncdlv.js +0 -1
- package/dist/server/out/_next/static/chunks/1iklteprcoims.js +0 -1
- package/dist/server/out/_next/static/chunks/1zieh-zxgxmcp.js +0 -1
- package/dist/server/out/_next/static/chunks/25q38gki_yyde.js +0 -3
- package/dist/server/out/_next/static/chunks/25qsan0t-_of0.js +0 -1
- package/dist/server/out/_next/static/chunks/26yareaaj1kyr.js +0 -1
- package/dist/server/out/_next/static/chunks/2bkkmnhngpacd.js +0 -1
- package/dist/server/out/_next/static/chunks/2e39uy7huhczu.js +0 -1
- package/dist/server/out/_next/static/chunks/2rp65hq6bmpxv.js +0 -1
- package/dist/server/out/_next/static/chunks/3_d6w25_b15kx.js +0 -1
- package/dist/server/out/_next/static/chunks/3d8gkwu9nszjk.js +0 -1
- package/dist/server/out/_next/static/chunks/3l-16g1y6k5rs.js +0 -1
- package/dist/server/out/_next/static/chunks/3obu_9-ka7u_h.js +0 -1
- package/dist/server/out/_next/static/chunks/3u7q5w03st-rs.js +0 -1
- /package/dist/server/out/_next/static/{USFNp_mjuU8VbaPftn8uI → EF7eiGRF-6pU64XbVOn6f}/_buildManifest.js +0 -0
- /package/dist/server/out/_next/static/{USFNp_mjuU8VbaPftn8uI → EF7eiGRF-6pU64XbVOn6f}/_clientMiddlewareManifest.js +0 -0
- /package/dist/server/out/_next/static/{USFNp_mjuU8VbaPftn8uI → 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
|
|
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,6 +19,8 @@ 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
|
|
|
24
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,9 +29,9 @@ Use an external MCP client to iterate on a live browser with persistent TypeScri
|
|
|
27
29
|
|
|
28
30
|
## Build and run locally
|
|
29
31
|
|
|
30
|
-
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
|
|
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`.
|
|
31
33
|
|
|
32
|
-
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.
|
|
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.
|
|
33
35
|
|
|
34
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.
|
|
35
37
|
|
package/bin/configuration.mjs
CHANGED
|
@@ -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
|
|
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 ||
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
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
|
|
package/bin/supervision.mjs
CHANGED
|
@@ -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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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(
|
|
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
|
|
package/dist/runtime/README.md
CHANGED
|
@@ -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
|
|
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-1.
|
|
53
|
-
sudo bash package/scripts/install-service.sh "$PWD/orgsdk-executor-1.
|
|
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
|