{"_id":"@agent-hubs/runtime-client","_rev":"3-a1eefe0a78b2e90c9099f6580b296d14","name":"@agent-hubs/runtime-client","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@agent-hubs/runtime-client","version":"0.1.0","keywords":["agent-hub","codex","runtime-client","gateway"],"_id":"@agent-hubs/runtime-client@0.1.0","maintainers":[{"name":"itwangxw","email":"itwangxw@gmail.com"}],"bin":{"gateway":"dist/main.js","agent-runtime":"dist/main.js"},"dist":{"shasum":"28eb5b1a0a1b06b309dde688d818dd5646bf1766","tarball":"https://registry.npmjs.org/@agent-hubs/runtime-client/-/runtime-client-0.1.0.tgz","fileCount":7,"integrity":"sha512-THt6qG7OOQA9EtgTUa06Gx+4ZtL6kX5fOb2jCkyF1AM9eB4fbnMqPtL6LGXfmHQqXcGqCQ+VXM27C8PvBZRHlA==","signatures":[{"sig":"MEQCIH5hHV3JcpMMjuari2j/9N3bGmunzG81w8sEzYzdjnraAiALHpB9zrNp9r6A1eGwWXsHes5O13XR0j0IV3zfxpuHaA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29572},"type":"module","engines":{"node":">=20"},"gitHead":"300c65dd6ed11b297c6a3df8aa939af2a894fc05","private":false,"scripts":{"build":"tsc -p tsconfig.json","start":"node dist/main.js","prepack":"npm run build"},"_npmUser":{"name":"itwangxw","email":"itwangxw@gmail.com"},"_npmVersion":"10.9.4","description":"Agent Hub local runtime client for connecting local Codex CLI to a shared Gateway.","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.6.2","@types/node":"22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/runtime-client_0.1.0_1776221926890_0.6524143424390769","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agent-hubs/runtime-client","version":"0.1.1","keywords":["agent-hub","codex","runtime-client","gateway"],"_id":"@agent-hubs/runtime-client@0.1.1","maintainers":[{"name":"itwangxw","email":"itwangxw@gmail.com"}],"bin":{"gateway":"dist/main.js","agent-runtime":"dist/main.js"},"dist":{"shasum":"daaa410e64427532b9feda396a95af05e9647543","tarball":"https://registry.npmjs.org/@agent-hubs/runtime-client/-/runtime-client-0.1.1.tgz","fileCount":7,"integrity":"sha512-tSLbbh3yU7k6V9XM8PpUyOhVBT7dwzTTXevudDSoeCfCz55hGU5D909wTivOi8PYyDRnYeKa2nAn8t2GQquynA==","signatures":[{"sig":"MEQCIHGO3+OyvNlnDIj5ve2/Re8uk0N8u6BQ2tZBOiiBRIKpAiAJBU9wgHyipwovCYnKwephHDfBJMuLsdn63AI+xDKUuQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32450},"type":"module","engines":{"node":">=20"},"gitHead":"4e76cd34d9642c6b8d806a717b8e8b5b9f601ae3","private":false,"scripts":{"build":"tsc -p tsconfig.json","start":"node dist/main.js","prepack":"npm run build"},"_npmUser":{"name":"itwangxw","email":"itwangxw@gmail.com"},"_npmVersion":"10.9.4","description":"Agent Hub local runtime client for connecting local Codex CLI to a shared Gateway.","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.6.2","@types/node":"22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/runtime-client_0.1.1_1776232898343_0.3642767909427531","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@agent-hubs/runtime-client","private":false,"version":"0.1.2","description":"Agent Hub local runtime client for connecting local Codex CLI to a shared Gateway.","type":"module","bin":{"agent-runtime":"dist/main.js","gateway":"dist/main.js"},"scripts":{"build":"tsc -p tsconfig.json","prepack":"npm run build","start":"node dist/main.js"},"engines":{"node":">=20"},"keywords":["agent-hub","codex","runtime-client","gateway"],"devDependencies":{"@types/node":"22.7.4","typescript":"5.6.2"},"_id":"@agent-hubs/runtime-client@0.1.2","gitHead":"57d99fcb7d0f584abbf5b198bb80c8493b2763ac","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-zs2oTVAb47qt2dmrbphmTV8G8IUfxFDCYed5mu+c6Jr/+wtgH7mwS+x8xhLVAi7s0N7KHsdRmsy+yEeCIZsgyw==","shasum":"ddba27a984788395a62b82fcb053c133b161897f","tarball":"https://registry.npmjs.org/@agent-hubs/runtime-client/-/runtime-client-0.1.2.tgz","fileCount":7,"unpackedSize":80061,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAFpyLLJaEVXfX+JwxqFZiuIT75YFGdLbegIHGjelhQoAiBici9DCVKvF7bnqBCBOKg7wmg3FRstnn2aUOFszzcw1g=="}]},"_npmUser":{"name":"itwangxw","email":"itwangxw@gmail.com"},"directories":{},"maintainers":[{"name":"itwangxw","email":"itwangxw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/runtime-client_0.1.2_1780038137067_0.43160611184420494"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-15T02:58:46.816Z","modified":"2026-05-29T07:02:17.358Z","0.1.0":"2026-04-15T02:58:47.028Z","0.1.1":"2026-04-15T06:01:38.524Z","0.1.2":"2026-05-29T07:02:17.222Z"},"keywords":["agent-hub","codex","runtime-client","gateway"],"description":"Agent Hub local runtime client for connecting local Codex CLI to a shared Gateway.","maintainers":[{"name":"itwangxw","email":"itwangxw@gmail.com"}],"readme":"# @agent-hubs/runtime-client\n\nAgent Hub 本机 Runtime Client，用于把本机 Codex CLI 接入共享 Gateway。\n\n安装后会提供两个命令：\n\n- `agent-runtime`：推荐正式命令\n- `gateway`：兼容旧脚本的别名\n\n## 前置要求\n\n- Node.js `>=20`\n- 本机已安装并登录 Codex CLI\n\n先确认本机能执行：\n\n```bash\ncodex --help\n```\n\nWindows：\n\n```cmd\nwhere codex\ncodex --help\n```\n\n## 安装\n\n正式安装方式：\n\n```bash\nnpm install -g @agent-hubs/runtime-client\n```\n\n安装后验证：\n\n```bash\nagent-runtime --help\n```\n\n如果使用本地 tarball 调试：\n\n```bash\nnpm install -g agent-hubs-runtime-client-0.1.0.tgz\n```\n\n## 启动本机 Runtime Client\n\nMac/Linux：\n\n```bash\nagent-runtime runtime serve --provider codex --gateway-url http://<gateway-host>:3010\n```\n\nWindows CMD：\n\n```cmd\nagent-runtime runtime serve --provider codex --gateway-url http://<gateway-host>:3010\n```\n\n启动后会自动：\n\n- 探测本机 `codex` 可执行文件\n- 执行 `codex --help` 自检\n- 注册到共享 Gateway\n- 定时发送心跳\n- 领取任务并在本机执行 Codex CLI\n- 执行中每 `20s` 续租一次任务 lease，保持 Platform 侧任务所有权\n- 执行中每 `3s` 查询一次任务 control-state；用户取消后会尝试终止本机 Codex/Provider 子进程\n- 回传结果\n\n任务 lease 规则：\n\n- 每次领取获得 `60s` lease，本机执行期间定时续租。\n- 如果 Gateway 或网络故障超过 lease 窗口，Platform liveness sweep 会将任务安全标记为失败并隔离 thread，不自动重复执行；恢复后需要从会话异常任务入口人工重放。\n\n## 绑定机器人\n\n先在平台机器人编辑页重新签发 `botKey`，然后在同一台 runtime 机器上执行：\n\n交互式引导：\n\n```bash\nagent-runtime onboard\n```\n\n执行后会依次提示：\n\n1. 选择 Agent 类型：`codex / claude_code / custom`\n2. 输入 `Gateway URL`\n3. 输入 `Platform API URL`\n4. 输入 `botKey`\n\n非交互式命令：\n\n```bash\nagent-runtime onboard \\\n  --provider codex \\\n  --gateway-url http://<gateway-host>:3010 \\\n  --platform-url http://<api-host>:3001/api/v1 \\\n  --bot-key botkey_xxx\n```\n\nWindows CMD 单行：\n\n```cmd\nagent-runtime onboard --provider codex --gateway-url http://<gateway-host>:3010 --platform-url http://<api-host>:3001/api/v1 --bot-key botkey_xxx\n```\n\n## 发布与升级\n\n维护者发布新版本前先升级版本号：\n\n```bash\nnpm version patch --workspace @agent-hubs/runtime-client\n```\n\n发布到 npm registry：\n\n```bash\nnpm publish --workspace @agent-hubs/runtime-client --access public --otp <6位验证码>\n```\n\n发布成功后验证：\n\n```bash\nnpm view @agent-hubs/runtime-client version\nnpm install -g @agent-hubs/runtime-client\nagent-runtime --help\n```\n\n说明：\n\n- `@agent-hubs/runtime-client` 是 npm 包名。\n- `agent-runtime` 是安装后提供的命令名。\n- 如果 npm 账号开启了发布 2FA，发布时需要传 `--otp`。\n\n## 查看状态\n\n```bash\nagent-runtime sessions --provider codex --gateway-url http://<gateway-host>:3010\n```\n\n## 解绑\n\n```bash\nagent-runtime unbind --provider codex --gateway-url http://<gateway-host>:3010 --session-id codex-session-xxx\n```\n\n## 环境变量\n\n- `AGENT_HUB_GATEWAY_URL`\n- `AGENT_HUB_PLATFORM_URL`\n- `GATEWAY_CODEX_TIMEOUT_MS`\n\n示例：\n\n```bash\nAGENT_HUB_GATEWAY_URL=http://127.0.0.1:3010 agent-runtime runtime serve --provider codex\n```\n","readmeFilename":"README.md"}