@seele00/seele-runtime-host 0.0.0-stage → 0.1.0-experimental.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.
package/README.md CHANGED
@@ -1,3 +1,51 @@
1
- # Temporary Holding Version
1
+ # Seele Runtime Host (experimental)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 独立云端推理托管进程。与现有云端 Seele Work 同机运行;复用现有账户登录、凭据租约和续期服务。没有新登录页面,不要求重新登录。不会替换现有 Work/Host,也不会自动把现有 workspace 改成远程模式。
4
+
5
+ 本实验包首先用于部署托管端。Work 远程模式接入尚未交付,不能用现有 Work 直接提交远程任务。原型执行器不是生产沙箱。
6
+
7
+ ## 安装和启动
8
+
9
+ Linux x86_64,Node.js 24+。包固定依赖 Codex CLI 0.167.2;它与 Work 自身的 CLI 升级独立。不要在企业执行端安装这个包。
10
+
11
+ ```sh
12
+ npm install -g @seele00/seele-runtime-host@0.1.0-experimental.1
13
+ seele-runtime-host --version
14
+ seele-runtime-host --config /path/to/runtime-host.json
15
+ ```
16
+
17
+ 配置示例(路径按现有云端实例调整):
18
+
19
+ ```json
20
+ {
21
+ "listen": "127.0.0.1:3020",
22
+ "stateDir": "/data/seele/.runtime/hosting",
23
+ "accountsRoot": "/data/seele/.runtime/codex-home/.seele/accounts",
24
+ "deployments": {
25
+ "existing-deployment-id": {"tokenFile": "/path/to/private-deployment-token"}
26
+ },
27
+ "maxSessions": 8
28
+ }
29
+ ```
30
+
31
+ `accountsRoot` 直接引用云端 Work 现有账户目录;同一 Unix 用户运行,以复用 Work 已有的本机凭据续期接口。不要复制 auth.json、单独登录或手动创建账户。托管内容目录与原有 Work 内容目录分开,账号身份不变。
32
+
33
+ 部署访问 token 文件权限须为 0600,使用独立随机凭证(至少32字符);不是 Codex 凭据,不向模型或执行脚本传递。公网入口由现有 HTTPS/WSS 反代提供,转发 `/v1/connect`,支持 WebSocket upgrade,保留 Authorization。企业端只发起出站连接。`/healthz` 只报告服务健康/版本,不表示模型账户与执行端全部就绪。
34
+
35
+ 进程收到 SIGTERM/SIGINT 后会撤销连接并停止持有的 Codex 进程。状态目录持久化;禁止多个进程同时使用同一目录。停止服务不删除历史线程。
36
+
37
+ ## 当前协议和边界
38
+
39
+ 协议版本1:`session.open`、`turn.start`、`turn.status`、`turn.interrupt`;执行端响应走同连接 `exec.response`。所有会话请求含字符串 `id`。`turn.start` 还必须提供稳定 `requestKey`,相同请求键和输入只执行一次;键冲突报错。账户选择使用现有 saved account ID,不接收账户密码或 token。
40
+
41
+ 会话由部署身份和 workspace ID 隔离。执行回调为平台内部协议,不是任意 TCP 转发。连接关闭中断推理,不自动重放命令。最终消息/终态持久化,可通过 `turn.status` 查询;进程重启时未完成请求标为 interrupted。
42
+
43
+ 目前尚不支持完整 Work 平台动态工具/审批/图片等端到端业务;需要后续 Work 适配和完整独立执行端。不能把实验包上线当成远程 workspace 已可用。
44
+
45
+ 连接心跳每15秒一次,45秒无入站消息则回收连接。每次运行实例具有独立 `executionId`;本地执行端必须原样回传,旧实例迟到的响应不会进入新实例。执行端须按此生命周期管理自己的进程组,不得把旧进程的输出重新标为新实例。
46
+
47
+ `turn.status` 可传 `afterSequence`(默认0),每页最多100条且约4MiB,返回 `nextSequence` 和 `more`;顺序读取直到 `more=false`。单条超限结果会明确报错,不静默截断。`session.close` 释放云端进程并保留持久线程,空闲客户端应及时关闭会话;重新打开仍使用原 sessionId。
48
+
49
+ 每次 turn 显式绑定企业执行环境,包含恢复线程之后的 turn。不要省略这一要求,也不能因为环境不可用而改成本地执行。
50
+
51
+ 需要网络代理时沿用现有 Host 提供的本机代理,通过服务进程环境设置 `SEELE_PROXY`;不在账号页面新建代理配置,也不复制上游代理密码到 workspace。托管服务复用 worker 既有的代理校验和凭据刷新逻辑。
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { dirname, resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { spawn } from 'node:child_process';
6
+ const require = createRequire(import.meta.url);
7
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
8
+ const codex = resolve(dirname(require.resolve('@openai/codex/package.json')), 'bin/codex.js');
9
+ const child = spawn(resolve(root, 'libexec/seele-runtime-host'), process.argv.slice(2), {
10
+ stdio: 'inherit', env: { ...process.env, SEELE_HOSTED_CODEX_BIN: codex },
11
+ });
12
+ for (const signal of ['SIGINT', 'SIGTERM']) process.on(signal, () => child.kill(signal));
13
+ child.on('error', () => { console.error('Unable to start Seele runtime host executable.'); process.exitCode = 1; });
14
+ child.on('exit', (code, signal) => { process.exitCode = code ?? (signal === 'SIGINT' ? 130 : 143); });
Binary file
package/package.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "name": "@seele00/seele-runtime-host",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-experimental.1",
4
+ "description": "Seele cloud inference hosting service",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "bin": { "seele-runtime-host": "bin/seele-runtime-host.mjs" },
8
+ "files": ["bin", "libexec", "README.md", "release-info.json"],
9
+ "engines": { "node": ">=24" },
10
+ "os": ["linux"],
11
+ "cpu": ["x64"],
12
+ "dependencies": { "@openai/codex": "0.167.2" }
13
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "version": "0.1.0-experimental.1",
3
+ "commit": "3ebf61de5310fc18ee43ddcf425334511e2e62e8",
4
+ "sourceSha256": "f33390d6933536532de23030b39efab8fa0682e7d830bb52bff4b3042744592c",
5
+ "sourceDirty": false,
6
+ "protocol": 1,
7
+ "codex": "0.167.2"
8
+ }