@seele00/seele 0.1.92 → 1.0.1

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 (100) hide show
  1. package/README.md +28 -72
  2. package/bin/seele +15 -0
  3. package/host-release-manifest.json +58 -0
  4. package/initial-work.json +8 -0
  5. package/libexec/seele-host +0 -0
  6. package/package.json +3 -8
  7. package/bin/seele-codex +0 -58
  8. package/libexec/seele-server +0 -0
  9. package/libexec/seele-worker +0 -0
  10. package/scripts/deploy/bootstrap.sh +0 -334
  11. package/scripts/deploy/prepare-proxy.sh +0 -273
  12. package/scripts/deploy/seele.env.example +0 -83
  13. package/scripts/deploy/start.sh +0 -101
  14. package/web/dist/assets/abnfDiagram-VRR7QNED-iVbCDf-k.js +0 -1
  15. package/web/dist/assets/arc-JMiJ4rr3.js +0 -1
  16. package/web/dist/assets/architectureDiagram-ZJ3FMSHR-DCm1qEn2.js +0 -36
  17. package/web/dist/assets/bash-BELqPA7S.js +0 -1
  18. package/web/dist/assets/blockDiagram-677ZJIJ3-DREKknbS.js +0 -132
  19. package/web/dist/assets/c4Diagram-LMCZKHZV-CRBVnPzq.js +0 -10
  20. package/web/dist/assets/channel-CGt1ZavO.js +0 -1
  21. package/web/dist/assets/chunk-2Q5K7J3B-CkxEyqvZ.js +0 -1
  22. package/web/dist/assets/chunk-32BRIVSS-CB0yAoU8.js +0 -1
  23. package/web/dist/assets/chunk-5VM5RSS4-mKXpYDxH.js +0 -15
  24. package/web/dist/assets/chunk-EX3LRPZG-By-Z97DF.js +0 -231
  25. package/web/dist/assets/chunk-JWPE2WC7-BwLo02Dp.js +0 -1
  26. package/web/dist/assets/chunk-MOJQB5TN-EbU6MBl6.js +0 -88
  27. package/web/dist/assets/chunk-RYQCIY6F-DD9Y8Wum.js +0 -1
  28. package/web/dist/assets/chunk-V7JOEXUC-DcD81gi4.js +0 -206
  29. package/web/dist/assets/chunk-VR4S4FIN-DWUywtQy.js +0 -1
  30. package/web/dist/assets/chunk-XXDRQBXY-CfbHSkHp.js +0 -1
  31. package/web/dist/assets/classDiagram-OUVF2IWQ-RHNeYK2H.js +0 -1
  32. package/web/dist/assets/classDiagram-v2-EOCWNBFH-RHNeYK2H.js +0 -1
  33. package/web/dist/assets/core-DnwHDF9S.js +0 -12
  34. package/web/dist/assets/cose-bilkent-JH36ORCC-DTMjsSNZ.js +0 -1
  35. package/web/dist/assets/css-CLj8gQPS.js +0 -1
  36. package/web/dist/assets/cynefin-VYW2F7L2-BQScOjLb.js +0 -178
  37. package/web/dist/assets/cynefinDiagram-TSTJHNR4-DsQ_Jv1S.js +0 -62
  38. package/web/dist/assets/cytoscape.esm-DTSO7Bv0.js +0 -331
  39. package/web/dist/assets/dagre-VKFMJZFB-CoBazNSr.js +0 -4
  40. package/web/dist/assets/defaultLocale-DX6XiGOO.js +0 -1
  41. package/web/dist/assets/diagram-FQU43EPY-C2pGJlRE.js +0 -3
  42. package/web/dist/assets/diagram-G47NLZAW-DngV_5ZL.js +0 -24
  43. package/web/dist/assets/diagram-NH7WQ7WH-CbT7cYnb.js +0 -24
  44. package/web/dist/assets/diagram-OA4YK3LP-CQgFDj1M.js +0 -30
  45. package/web/dist/assets/diagram-WEI45ONY-BSceWhV1.js +0 -41
  46. package/web/dist/assets/diff-D97Zzqfu.js +0 -1
  47. package/web/dist/assets/dockerfile-BcOcwvcX.js +0 -1
  48. package/web/dist/assets/ebnfDiagram-CCIWWBDH-DgYBGMFL.js +0 -1
  49. package/web/dist/assets/engine-javascript-DBd1bXLz.js +0 -141
  50. package/web/dist/assets/erDiagram-Q63AITRT-BN2Cy22X.js +0 -85
  51. package/web/dist/assets/flowDiagram-23GEKE2U-fDP66qf3.js +0 -156
  52. package/web/dist/assets/ganttDiagram-NO4QXBWP-C96QkOk8.js +0 -292
  53. package/web/dist/assets/gitGraphDiagram-IHSO6WYX-DutclwE1.js +0 -106
  54. package/web/dist/assets/github-light-DAi9KRSo.js +0 -1
  55. package/web/dist/assets/graph-C9eacEi8.js +0 -1
  56. package/web/dist/assets/html-pp8916En.js +0 -1
  57. package/web/dist/assets/index-B-eg8eRh.css +0 -1
  58. package/web/dist/assets/index-H6j_Btq9.js +0 -131
  59. package/web/dist/assets/infoDiagram-FWYZ7A6U-Cxc3YVQb.js +0 -2
  60. package/web/dist/assets/init-Gi6I4Gst.js +0 -1
  61. package/web/dist/assets/ishikawaDiagram-FXEZZL3T-BEnCjmqJ.js +0 -70
  62. package/web/dist/assets/java-CylS5w8V.js +0 -1
  63. package/web/dist/assets/javascript-wDzz0qaB.js +0 -1
  64. package/web/dist/assets/journeyDiagram-5HDEW3XC-BScd67RO.js +0 -139
  65. package/web/dist/assets/json-Cp-IABpG.js +0 -1
  66. package/web/dist/assets/jsonc-Des-eS-w.js +0 -1
  67. package/web/dist/assets/jsx-g9-lgVsj.js +0 -1
  68. package/web/dist/assets/kanban-definition-HUTT4EX6-BiWAReQL.js +0 -89
  69. package/web/dist/assets/katex-C5jXJg4s.js +0 -257
  70. package/web/dist/assets/layout-DEXfKzaS.js +0 -1
  71. package/web/dist/assets/linear-DgLbqYdz.js +0 -1
  72. package/web/dist/assets/map-Czzmt4hB.js +0 -1
  73. package/web/dist/assets/markdown-Cvjx9yec.js +0 -1
  74. package/web/dist/assets/mermaid.core-ejnGpyjP.js +0 -314
  75. package/web/dist/assets/mindmap-definition-LN4V7U3C-CIktRh3k.js +0 -96
  76. package/web/dist/assets/ordinal-Cboi1Yqb.js +0 -1
  77. package/web/dist/assets/pegDiagram-2B236MQR-C0VgWt36.js +0 -1
  78. package/web/dist/assets/pieDiagram-ENE6RG2P-VGApXGBB.js +0 -39
  79. package/web/dist/assets/python-B6aJPvgy.js +0 -1
  80. package/web/dist/assets/quadrantDiagram-ABIIQ3AL-BZw4Vnp1.js +0 -7
  81. package/web/dist/assets/railroadDiagram-RFXS5EU6-Bh5mwR_2.js +0 -1
  82. package/web/dist/assets/requirementDiagram-TGXJPOKE-CwvsMflb.js +0 -84
  83. package/web/dist/assets/sankeyDiagram-HTMAVEWB-Dg2sPge6.js +0 -40
  84. package/web/dist/assets/sequenceDiagram-DBY2YBRQ-C3mtBN6f.js +0 -162
  85. package/web/dist/assets/sizeCapture-X5ZJPWSS-BOAO9X3V.js +0 -1
  86. package/web/dist/assets/sql-CRqJ_cUM.js +0 -1
  87. package/web/dist/assets/stateDiagram-2N3HPSRC-BMWGawYB.js +0 -1
  88. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-C_CHxKgw.js +0 -1
  89. package/web/dist/assets/swimlanes-5IMT3BWC-eeI5pSHG.js +0 -2
  90. package/web/dist/assets/swimlanesDiagram-G3AALYLV-CNbvemzA.js +0 -8
  91. package/web/dist/assets/timeline-definition-FHXFAJF6-C8wMFR-H.js +0 -120
  92. package/web/dist/assets/toml-vGWfd6FD.js +0 -1
  93. package/web/dist/assets/tsx-COt5Ahok.js +0 -1
  94. package/web/dist/assets/typescript-BPQ3VLAy.js +0 -1
  95. package/web/dist/assets/vennDiagram-L72KCM5P-CCG5V8jY.js +0 -34
  96. package/web/dist/assets/wardleyDiagram-EHGQE667-JUthxPJ1.js +0 -78
  97. package/web/dist/assets/xml-sdJ4AIDG.js +0 -1
  98. package/web/dist/assets/xychartDiagram-FW5EYKEG-DQjrRSzI.js +0 -7
  99. package/web/dist/assets/yaml-Buea-lGh.js +0 -1
  100. package/web/dist/index.html +0 -13
package/README.md CHANGED
@@ -1,82 +1,38 @@
1
- # Seele Codex npm Package
1
+ # Seele Host npm artifact
2
2
 
3
- This package is the prebuilt Linux x64 Seele service. Its backend is the Rust
4
- `seele-server`/`seele-worker` runtime, statically linked against musl so it does
5
- not depend on the target host's glibc version. Node.js 24 LTS and npm are
6
- retained for installing and updating the Seele-managed Codex CLI; the target
7
- host does not need Rust, pnpm, TypeScript, or Vite.
3
+ This package contains Seele Host, the long-lived supervisor and recovery control plane exposed by
4
+ the `seele` command. The Host semantic contract starts at major version 1. Seele Work remains a
5
+ separately versioned immutable artifact in `@seele00/seele-work`; Host downloads, verifies, retains,
6
+ and activates Work versions.
8
7
 
9
- The web output is path-independent. `SEELE_PUBLIC_BASE_PATH` selects the public
10
- path when the service starts; changing it does not require another build.
8
+ The package contains only:
11
9
 
12
- ## Required Deployment Values
10
+ - `bin/seele`, a thin launcher for Seele Host;
11
+ - `libexec/seele-host`, a statically linked Linux x64 Host binary;
12
+ - `host-release-manifest.json`, with source provenance, target details, and a SHA-256 digest for
13
+ every other packaged file;
14
+ - `initial-work.json`, which pins the exact verified `@seele00/seele-work` version, npm SRI,
15
+ release-manifest digest, and build commit used for first startup;
16
+ - `README.md`, `LEGAL.md`, and `package.json`.
13
17
 
14
- Before installation, confirm all of these values with the package owner or
15
- target-environment owner. Do not invent or silently default them:
18
+ It has no npm dependencies and no lifecycle scripts.
16
19
 
17
- - `SEELE_ROOT`: persistent root containing `.runtime` and `workspaces`.
18
- - `SEELE_CODEX_HOST`: service listen address.
19
- - `SEELE_CODEX_PORT`: service listen port.
20
- - `SEELE_PUBLIC_BASE_PATH`: externally visible path prefix, such as `/`.
21
- - `SEELE_PROXY`: local no-auth proxy URL consumed by Codex.
22
- - `SEELE_UPSTREAM_PROXY`: authenticated upstream proxy URL consumed by gost.
23
- - `SEELE_AUTH_PASSWORD`: initial admin password for a non-loopback listener.
20
+ ## Release handoff
24
21
 
25
- `SEELE_UPSTREAM_PROXY` has the form
26
- `socks5h://username:password@hostname:port`. Ask the package owner for the
27
- complete secret value. Do not reconstruct it from the example.
22
+ This archive was created as a release candidate by the repository's locked, offline Host packaging
23
+ lane. That lane requires a clean Git worktree, a configured local upstream, a `HEAD` that is not
24
+ ahead of that upstream, a Linux x64 builder, and two byte-identical `npm pack` results. It does not
25
+ contact the npm registry, publish a package, or change a dist-tag.
28
26
 
29
- ## Install
27
+ The archive must travel with its npm pack, verifier, provenance, integrity, and handoff JSON files.
28
+ A designated release owner must independently review that handoff before performing any publication
29
+ from the dedicated publishing instance. Possession of this archive is not publication authorization.
30
30
 
31
- Keep npm's cache under the persistent Seele root so later installs and upgrades
32
- can reuse downloaded packages:
31
+ An archive can be verified without extracting it:
33
32
 
34
- ```bash
35
- npm install --global @seele00/seele@latest \
36
- --registry=https://registry.npmmirror.com/ \
37
- --cache "$SEELE_ROOT/.runtime/npm-cache"
33
+ ```sh
34
+ node scripts/deploy/verify-seele-host-npm.mjs \
35
+ --mode release-candidate \
36
+ --archive seele00-seele-1.0.1.tgz \
37
+ --expected-version 1.0.1
38
38
  ```
39
-
40
- Copy and edit the environment template:
41
-
42
- ```bash
43
- cp "$(seele env-example)" "$SEELE_ROOT/seele.env"
44
- vi "$SEELE_ROOT/seele.env"
45
- ```
46
-
47
- On the first installation, prepare the Seele-managed Codex CLI, authenticate
48
- with a headless device code, and start the service:
49
-
50
- ```bash
51
- seele bootstrap \
52
- --env "$SEELE_ROOT/seele.env" \
53
- --auth device \
54
- --start
55
- ```
56
-
57
- The command prints a URL and one-time device code. Complete authentication in
58
- a browser on another machine. No browser is required on the Linux host.
59
-
60
- ## Start And Upgrade
61
-
62
- For normal service starts after bootstrap:
63
-
64
- ```bash
65
- seele start --env "$SEELE_ROOT/seele.env"
66
- ```
67
-
68
- `seele start` does not install, configure, or validate Codex CLI. It starts the
69
- platform even when the CLI is absent so CLI lifecycle handling can remain inside
70
- the platform.
71
-
72
- Upgrade the npm package without rebuilding Seele on the target host:
73
-
74
- ```bash
75
- npm install --global @seele00/seele@<new-version> \
76
- --registry=https://registry.npmmirror.com/ \
77
- --cache "$SEELE_ROOT/.runtime/npm-cache"
78
- seele start --env "$SEELE_ROOT/seele.env"
79
- ```
80
-
81
- Package upgrades do not update an existing Codex CLI. Use Seele's runtime
82
- settings UI for later Codex CLI updates.
package/bin/seele ADDED
@@ -0,0 +1,15 @@
1
+ #!/bin/sh
2
+ set -eu
3
+
4
+ SOURCE="$0"
5
+ while [ -L "$SOURCE" ]; do
6
+ SOURCE_DIR="$(CDPATH= cd -- "$(dirname -- "$SOURCE")" && pwd)"
7
+ SOURCE="$(readlink "$SOURCE")"
8
+ case "$SOURCE" in
9
+ /*) ;;
10
+ *) SOURCE="$SOURCE_DIR/$SOURCE" ;;
11
+ esac
12
+ done
13
+ PACKAGE_ROOT="$(CDPATH= cd -- "$(dirname -- "$SOURCE")/.." && pwd)"
14
+
15
+ exec "$PACKAGE_ROOT/libexec/seele-host" "$@"
@@ -0,0 +1,58 @@
1
+ {
2
+ "manifestVersion": 1,
3
+ "product": "seele-host",
4
+ "packageName": "@seele00/seele",
5
+ "version": "1.0.1",
6
+ "buildCommit": "1016611b273e7a0c20042aee5bd948a966512fa7",
7
+ "sourceDateEpoch": 1787123166,
8
+ "sourceDirty": false,
9
+ "target": {
10
+ "os": "linux",
11
+ "architecture": "x86_64",
12
+ "rustTarget": "x86_64-unknown-linux-musl",
13
+ "linkage": "static-musl"
14
+ },
15
+ "entrypoints": {
16
+ "host": "libexec/seele-host",
17
+ "cli": "bin/seele"
18
+ },
19
+ "files": [
20
+ {
21
+ "path": "LEGAL.md",
22
+ "sha256": "adba50d9794b9ef3f7ec8cbc680f7f1fa3fbf9df0ac8d1f9b9ccab6d941bc11b",
23
+ "size": 572,
24
+ "executable": false
25
+ },
26
+ {
27
+ "path": "README.md",
28
+ "sha256": "1a395c8ce8c2f94704c7c20f5f1edd478d4ecfb73845db3f3f24cc4fa3d7caf2",
29
+ "size": 1772,
30
+ "executable": false
31
+ },
32
+ {
33
+ "path": "bin/seele",
34
+ "sha256": "f1bcb888f2b35d80afcec240f149e4c7d20e048aaa6410d7d6d810e1d8a1b610",
35
+ "size": 352,
36
+ "executable": true
37
+ },
38
+ {
39
+ "path": "initial-work.json",
40
+ "sha256": "333fdc3f31fd51d8980e6d69fc5b5eb8e593d7ee021740b8d9ea1d7ae6fd4372",
41
+ "size": 354,
42
+ "executable": false
43
+ },
44
+ {
45
+ "path": "libexec/seele-host",
46
+ "sha256": "f41dbbe63cc3e77900810a1aac5e03e56b593bfee6c17e6081e09c9cb4496d15",
47
+ "size": 13551888,
48
+ "executable": true
49
+ },
50
+ {
51
+ "path": "package.json",
52
+ "sha256": "151d2bac97dc7a877bdf163335a7aef5f8135c09cee9809873e7390248f726ab",
53
+ "size": 263,
54
+ "executable": false
55
+ }
56
+ ],
57
+ "artifactMode": "release-candidate"
58
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "packageName": "@seele00/seele-work",
4
+ "version": "0.1.93",
5
+ "npmIntegrity": "sha512-Ofk/0bmk1myRiDS0Uva09AHN3wO548HNIMuokJO81kQfPlYZfzTM/y4FQpfjB1Rz6vbdXzcCCBNdS/r9Ut0bwA==",
6
+ "manifestDigest": "73b4418a03057d2326a08de53ac646435e19e3b2b889f3a8d6b6987c6e0b7d8a",
7
+ "buildCommit": "859e1ca5ea25b010c1f4c0a7706557f24587f45c"
8
+ }
Binary file
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@seele00/seele",
3
- "version": "0.1.92",
4
- "description": "Browser UI and server runtime for Seele Codex",
3
+ "version": "1.0.1",
4
+ "description": "Seele Host supervisor and recovery control plane",
5
5
  "private": false,
6
- "type": "module",
7
6
  "license": "UNLICENSED",
8
7
  "os": [
9
8
  "linux"
@@ -11,11 +10,7 @@
11
10
  "cpu": [
12
11
  "x64"
13
12
  ],
14
- "engines": {
15
- "node": ">=24 <25"
16
- },
17
13
  "bin": {
18
- "seele": "bin/seele-codex",
19
- "seele-codex": "bin/seele-codex"
14
+ "seele": "bin/seele"
20
15
  }
21
16
  }
package/bin/seele-codex DELETED
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- SOURCE="${BASH_SOURCE[0]}"
5
- while [ -h "$SOURCE" ]; do
6
- SOURCE_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
7
- SOURCE="$(readlink "$SOURCE")"
8
- case "$SOURCE" in
9
- /*) ;;
10
- *) SOURCE="$SOURCE_DIR/$SOURCE" ;;
11
- esac
12
- done
13
- PACKAGE_ROOT="$(cd -P "$(dirname "$SOURCE")/.." && pwd)"
14
-
15
- usage() {
16
- cat <<'EOF'
17
- Usage: seele-codex <command> [options]
18
-
19
- Commands:
20
- bootstrap Prepare Codex CLI/authentication, then optionally start Seele.
21
- start Start the Seele web and API service.
22
- doctor Check the configured Seele runtime.
23
- env-example Print the installed environment-file template path.
24
- version Print the installed Seele package version.
25
- EOF
26
- }
27
-
28
- COMMAND="${1:-}"
29
- if [ -n "$COMMAND" ]; then
30
- shift
31
- fi
32
-
33
- case "$COMMAND" in
34
- bootstrap)
35
- exec "$PACKAGE_ROOT/scripts/deploy/bootstrap.sh" --skip-build "$@"
36
- ;;
37
- start)
38
- exec "$PACKAGE_ROOT/scripts/deploy/start.sh" "$@"
39
- ;;
40
- doctor)
41
- export SEELE_CODEX_WEB_DIST="${SEELE_CODEX_WEB_DIST:-$PACKAGE_ROOT/web/dist}"
42
- exec "$PACKAGE_ROOT/libexec/seele-server" doctor "$@"
43
- ;;
44
- env-example)
45
- printf '%s\n' "$PACKAGE_ROOT/scripts/deploy/seele.env.example"
46
- ;;
47
- version|--version|-v)
48
- exec node -e 'console.log(require(process.argv[1]).version)' "$PACKAGE_ROOT/package.json"
49
- ;;
50
- help|--help|-h|"")
51
- usage
52
- ;;
53
- *)
54
- echo "Unknown command: $COMMAND" >&2
55
- usage >&2
56
- exit 1
57
- ;;
58
- esac
Binary file
Binary file
@@ -1,334 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5
- cd "$ROOT_DIR"
6
-
7
- ENV_FILE=""
8
- CLI_AUTH_MODE=""
9
- START_AFTER=0
10
- SKIP_BUILD=0
11
-
12
- usage() {
13
- cat <<'EOF'
14
- Usage: ./scripts/deploy/bootstrap.sh [options]
15
-
16
- Options:
17
- --env PATH Load deployment environment variables from PATH.
18
- --auth MODE device | auth-json | token | none. Defaults to none.
19
- --start Start Seele Codex after bootstrap succeeds.
20
- --skip-build Skip pnpm install/build.
21
- -h, --help Show this help.
22
-
23
- Typical first run:
24
-
25
- cp scripts/deploy/seele.env.example seele.env
26
- ./scripts/deploy/bootstrap.sh --env ./seele.env --start
27
- EOF
28
- }
29
-
30
- main() {
31
- while [ "$#" -gt 0 ]; do
32
- case "$1" in
33
- --env)
34
- ENV_FILE="${2:-}"
35
- shift 2
36
- ;;
37
- --auth)
38
- CLI_AUTH_MODE="${2:-}"
39
- shift 2
40
- ;;
41
- --start)
42
- START_AFTER=1
43
- shift
44
- ;;
45
- --skip-build)
46
- SKIP_BUILD=1
47
- shift
48
- ;;
49
- -h|--help)
50
- usage
51
- exit 0
52
- ;;
53
- *)
54
- echo "Unknown option: $1" >&2
55
- usage >&2
56
- exit 1
57
- ;;
58
- esac
59
- done
60
-
61
- if [ -n "$ENV_FILE" ]; then
62
- if [ ! -f "$ENV_FILE" ]; then
63
- echo "Environment file not found: $ENV_FILE" >&2
64
- exit 1
65
- fi
66
- set -a
67
- # shellcheck disable=SC1090
68
- . "$ENV_FILE"
69
- set +a
70
- fi
71
-
72
- if [ -z "${SEELE_ROOT:-}" ]; then
73
- echo "SEELE_ROOT is required for this deployment test." >&2
74
- echo "Ask the package owner or target-environment owner for the Seele root directory and put it in seele.env." >&2
75
- exit 1
76
- fi
77
- if [ -z "${SEELE_CLOUD_URL:-}" ]; then
78
- echo "SEELE_CLOUD_URL is required for deployment authorization." >&2
79
- echo "Ask the deployment owner for the reachable cloud Seele URL and put it in seele.env." >&2
80
- exit 1
81
- fi
82
- export SEELE_ROOT
83
- AUTH_MODE="${CLI_AUTH_MODE:-${SEELE_DEPLOY_AUTH_MODE:-none}}"
84
- RUNTIME_DIR="${SEELE_RUNTIME_DIR:-$SEELE_ROOT/.runtime}"
85
- export SEELE_RUNTIME_DIR="$RUNTIME_DIR"
86
- export CODEX_HOME="${CODEX_HOME:-$RUNTIME_DIR/codex-home}"
87
- export CODEX_INSTALL_DIR="$RUNTIME_DIR/bin"
88
- export SEELE_CODEX_WORKSPACE_ROOT="${SEELE_CODEX_WORKSPACE_ROOT:-$SEELE_ROOT/workspaces}"
89
- export SEELE_CODEX_WEB_DIST="${SEELE_CODEX_WEB_DIST:-$ROOT_DIR/web/dist}"
90
- export SEELE_PUBLIC_BASE_PATH="$(normalize_base_path "${SEELE_PUBLIC_BASE_PATH:-/}")"
91
- export PATH="$CODEX_INSTALL_DIR:$PATH"
92
-
93
- if [ -z "${SEELE_PROXY:-}" ]; then
94
- echo "SEELE_PROXY is required for this deployment test." >&2
95
- echo "Ask the package owner for the proxy value, put it in seele.env, then rerun bootstrap." >&2
96
- exit 1
97
- fi
98
-
99
- normalize_proxy_env
100
-
101
- mkdir -p "$RUNTIME_DIR" "$CODEX_HOME" "$CODEX_INSTALL_DIR" "$SEELE_CODEX_WORKSPACE_ROOT"
102
- chmod 700 "$CODEX_HOME"
103
-
104
- ensure_node
105
- ensure_codex_cli
106
- write_codex_config
107
- authenticate_codex "$AUTH_MODE"
108
-
109
- if [ "$SKIP_BUILD" -eq 0 ]; then
110
- ensure_rust
111
- ensure_pnpm
112
- pnpm install --frozen-lockfile
113
- pnpm --filter @seele-codex/web build
114
- cargo build --locked --release --manifest-path "$ROOT_DIR/Cargo.toml" \
115
- -p seele-server -p seele-worker
116
- fi
117
-
118
- cat <<EOF
119
- Seele Codex bootstrap completed.
120
-
121
- Runtime directory: $RUNTIME_DIR
122
- Codex home: $CODEX_HOME
123
- Codex install dir: $CODEX_INSTALL_DIR
124
- Workspace root: $SEELE_CODEX_WORKSPACE_ROOT
125
- EOF
126
-
127
- if [ "$START_AFTER" -eq 1 ]; then
128
- if [ -n "$ENV_FILE" ]; then
129
- exec "$ROOT_DIR/scripts/deploy/start.sh" --env "$ENV_FILE"
130
- fi
131
- exec "$ROOT_DIR/scripts/deploy/start.sh"
132
- fi
133
- }
134
-
135
- normalize_proxy_env() {
136
- export NO_PROXY="${NO_PROXY:-127.0.0.1,localhost,.svc,.cluster.local}"
137
- export no_proxy="$NO_PROXY"
138
- }
139
-
140
- with_runtime_proxy() {
141
- if [ -n "${SEELE_PROXY:-}" ]; then
142
- ALL_PROXY="$SEELE_PROXY" \
143
- HTTP_PROXY="$SEELE_PROXY" \
144
- HTTPS_PROXY="$SEELE_PROXY" \
145
- all_proxy="$SEELE_PROXY" \
146
- http_proxy="$SEELE_PROXY" \
147
- https_proxy="$SEELE_PROXY" \
148
- "$@"
149
- return
150
- fi
151
-
152
- "$@"
153
- }
154
-
155
- normalize_base_path() {
156
- local value="$1"
157
- if [ -z "$value" ]; then
158
- value="/"
159
- fi
160
- value="/${value#/}"
161
- value="${value%/}/"
162
- printf '%s' "$value"
163
- }
164
-
165
- replace_path_atomically() {
166
- node -e 'require("node:fs").renameSync(process.argv[1], process.argv[2])' "$1" "$2"
167
- }
168
-
169
- ensure_node() {
170
- if ! command -v node >/dev/null 2>&1; then
171
- echo "node is required. Install Node.js 24 LTS before running this script." >&2
172
- exit 1
173
- fi
174
-
175
- node -e 'const major = Number(process.versions.node.split(".")[0]); if (major !== 24) { console.error(`Node.js 24 LTS is required. Current: ${process.version}`); process.exit(1); }'
176
- }
177
-
178
- ensure_rust() {
179
- if ! command -v cargo >/dev/null 2>&1; then
180
- echo "Rust/Cargo is required to build Seele from source." >&2
181
- exit 1
182
- fi
183
- }
184
-
185
- ensure_pnpm() {
186
- if command -v pnpm >/dev/null 2>&1; then
187
- return
188
- fi
189
-
190
- if ! command -v corepack >/dev/null 2>&1; then
191
- echo "pnpm is required, or corepack must be available to install pnpm." >&2
192
- exit 1
193
- fi
194
-
195
- corepack enable
196
- corepack prepare pnpm@9.15.0 --activate
197
- }
198
-
199
- ensure_codex_cli() {
200
- if [ -x "$CODEX_INSTALL_DIR/codex" ]; then
201
- local current_version_output=""
202
- if current_version_output="$("$CODEX_INSTALL_DIR/codex" --version 2>/dev/null)"; then
203
- echo "Using Seele-managed Codex CLI: $current_version_output"
204
- return
205
- fi
206
- echo "WARNING: The existing Seele-managed Codex CLI is not runnable on this platform." >&2
207
- echo "Start Seele, open Settings > Runtime > Check Update, and explicitly start the reinstall." >&2
208
- return
209
- fi
210
-
211
- if ! command -v npm >/dev/null 2>&1; then
212
- echo "npm is required to install Codex CLI automatically." >&2
213
- exit 1
214
- fi
215
-
216
- local codex_root="$RUNTIME_DIR/codex"
217
- local versions_dir="$codex_root/versions"
218
- local staging_dir="$codex_root/.staging-bootstrap-$$"
219
- mkdir -p "$versions_dir"
220
- rm -rf "$staging_dir"
221
-
222
- echo "Installing Codex CLI into staging: $staging_dir"
223
- with_runtime_proxy npm install \
224
- --global \
225
- --prefix "$staging_dir" \
226
- --no-audit \
227
- --no-fund \
228
- @openai/codex@latest
229
-
230
- local staging_bin="$staging_dir/bin/codex"
231
- if [ ! -x "$staging_bin" ]; then
232
- echo "Codex CLI installation completed, but the staged binary was not found at $staging_bin." >&2
233
- exit 1
234
- fi
235
-
236
- local version_output
237
- local version
238
- version_output="$("$staging_bin" --version)"
239
- version="${version_output#codex-cli }"
240
- case "$version" in
241
- ""|*[!0-9A-Za-z._-]*)
242
- echo "Unable to determine a safe Codex CLI version from: $version_output" >&2
243
- exit 1
244
- ;;
245
- esac
246
-
247
- local platform
248
- local architecture
249
- platform="$(node -p 'process.platform')"
250
- architecture="$(node -p 'process.arch')"
251
- local version_key="$version-$platform-$architecture"
252
- local version_dir="$versions_dir/$version_key"
253
- if [ -e "$version_dir" ]; then
254
- if [ ! -x "$version_dir/bin/codex" ] || [ "$("$version_dir/bin/codex" --version)" != "$version_output" ]; then
255
- echo "Existing Codex CLI version directory is invalid: $version_dir" >&2
256
- exit 1
257
- fi
258
- rm -rf "$staging_dir"
259
- else
260
- mv "$staging_dir" "$version_dir"
261
- fi
262
-
263
- local current_next="$codex_root/current.next-$$"
264
- local launcher_next="$CODEX_INSTALL_DIR/codex.next-$$"
265
- ln -s "versions/$version_key" "$current_next"
266
- replace_path_atomically "$current_next" "$codex_root/current"
267
- ln -s "../codex/current/bin/codex" "$launcher_next"
268
- replace_path_atomically "$launcher_next" "$CODEX_INSTALL_DIR/codex"
269
- hash -r
270
-
271
- if [ ! -x "$CODEX_INSTALL_DIR/codex" ]; then
272
- echo "Codex CLI activation failed at $CODEX_INSTALL_DIR/codex." >&2
273
- exit 1
274
- fi
275
- echo "Codex CLI: $("$CODEX_INSTALL_DIR/codex" --version)"
276
- }
277
-
278
- write_codex_config() {
279
- local config_file="$CODEX_HOME/config.toml"
280
- if [ -f "$config_file" ]; then
281
- return
282
- fi
283
-
284
- cat > "$config_file" <<'EOF'
285
- cli_auth_credentials_store = "file"
286
- EOF
287
- chmod 600 "$config_file"
288
- }
289
-
290
- authenticate_codex() {
291
- local mode="$1"
292
- local auth_file="$CODEX_HOME/auth.json"
293
-
294
- if [ "${SEELE_FORCE_CODEX_LOGIN:-0}" != "1" ] && [ -s "$auth_file" ]; then
295
- echo "Codex auth cache already exists at $auth_file; skipping login."
296
- return
297
- fi
298
-
299
- case "$mode" in
300
- device)
301
- echo "Starting Codex device-code login."
302
- echo "Open the printed URL in your local browser and enter the code shown by Codex."
303
- with_runtime_proxy codex login --device-auth
304
- ;;
305
- auth-json)
306
- if [ -z "${CODEX_AUTH_JSON:-}" ]; then
307
- echo "CODEX_AUTH_JSON is required when --auth auth-json is used." >&2
308
- exit 1
309
- fi
310
- if [ ! -f "$CODEX_AUTH_JSON" ]; then
311
- echo "CODEX_AUTH_JSON file not found: $CODEX_AUTH_JSON" >&2
312
- exit 1
313
- fi
314
- cp "$CODEX_AUTH_JSON" "$auth_file"
315
- chmod 600 "$auth_file"
316
- ;;
317
- token)
318
- if [ -z "${CODEX_ACCESS_TOKEN:-}" ]; then
319
- echo "CODEX_ACCESS_TOKEN is required when --auth token is used." >&2
320
- exit 1
321
- fi
322
- printf '%s' "$CODEX_ACCESS_TOKEN" | with_runtime_proxy codex login --with-access-token
323
- ;;
324
- none)
325
- echo "Skipping Codex authentication."
326
- ;;
327
- *)
328
- echo "Unknown auth mode: $mode" >&2
329
- exit 1
330
- ;;
331
- esac
332
- }
333
-
334
- main "$@"