@arcships/morula-runtime 0.1.0-alpha.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 ADDED
@@ -0,0 +1,82 @@
1
+ # @arcships/morula-runtime
2
+
3
+ Morula 本地智能体运行时的设备端 CLI:登录、守护进程(daemon)启停、本地助手门户与模型清单。通过 npm 全局安装,无需单独下载二进制。
4
+
5
+ ## 环境要求
6
+
7
+ - 本机需安装 **Node.js >= 20**
8
+ - 可访问 Morula 服务端(默认测试环境 `https://morula.basecastle.com`)
9
+
10
+ ## 安装
11
+
12
+ ```bash
13
+ npm i -g @arcships/morula-runtime
14
+ ```
15
+
16
+ > 默认安装最新版(latest dist-tag 跟随最新发布);历史版本可用 `@alpha` 等 tag 安装。
17
+ > 安装后使用命令:`morula-runtime`
18
+
19
+ ## 快速开始
20
+
21
+ ```bash
22
+ # 1. 登录(自动打开浏览器完成 SkyDoor SSO)
23
+ morula-runtime auth login
24
+
25
+ # 2. 启动 daemon(后台运行)
26
+ morula-runtime daemon start
27
+
28
+ # 3. 可选:启动本地助手门户(浏览器访问 http://127.0.0.1:23491,可一键启停 daemon)
29
+ morula-runtime daemon portal --autostart on
30
+ ```
31
+
32
+ 验证:
33
+
34
+ ```bash
35
+ morula-runtime --version # 输出版本号
36
+ morula-runtime daemon status # daemon 运行状态
37
+ ```
38
+
39
+ ## 常用命令
40
+
41
+ | 命令 | 说明 |
42
+ |---|---|
43
+ | `morula-runtime auth login` | 登录(浏览器 SSO) |
44
+ | `morula-runtime auth logout` | 退出登录 |
45
+ | `morula-runtime auth status` | 查看登录状态与当前环境 |
46
+ | `morula-runtime daemon start` | 后台启动 daemon |
47
+ | `morula-runtime daemon stop` | 停止 daemon |
48
+ | `morula-runtime daemon status` | daemon 状态 |
49
+ | `morula-runtime daemon models` | 本机可用模型清单 |
50
+ | `morula-runtime daemon portal` | 运行本地助手门户(`--autostart on` 开机自启) |
51
+
52
+ 命令输出为 JSON;错误也会以 JSON 输出到 stderr。
53
+
54
+ ## 配置
55
+
56
+ - 配置文件:`~/.morula-cli/config.yaml`(登录后自动生成;与业务 CLI `morula` 共用)
57
+ - 默认连接测试环境;切换环境/服务地址:
58
+
59
+ ```bash
60
+ morula-runtime --env prod <命令>
61
+ morula-runtime --url https://你的服务地址/api <命令>
62
+ morula-runtime --token <token> <命令> # 仅本次生效,不落盘
63
+ ```
64
+
65
+ ## 卸载
66
+
67
+ ```bash
68
+ morula-runtime daemon portal --autostart off # 如已开启自启
69
+ morula-runtime daemon stop
70
+ npm rm -g @arcships/morula-runtime
71
+ ```
72
+
73
+ ## 常见问题
74
+
75
+ - **登录失败或已失效**:重新执行 `morula-runtime auth login`。
76
+ - **daemon 启动报未登录**:先完成登录再 `morula-runtime daemon start`。
77
+ - **连接环境不对**:用 `--env` / `--url` 指定,或检查 `~/.morula-cli/config.yaml`。
78
+
79
+ ## 相关
80
+
81
+ - Morula 平台(服务端 + Web)
82
+ - 业务命令 CLI:`morula`(随智能体插件提供,与 `morula-runtime` 共用登录态)
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * 运行时角色发布入口:`morula-runtime` = Morula 本地 Agent 运行时 CLI。
4
+ * 通过 `npm i -g @arcships/morula-runtime` 全局安装,bin 指向本文件的 dist 产物
5
+ * (build:dist 用 esbuild 把 workspace 共享包 bundle 进 dist/index.js,
6
+ * 外部依赖 socket.io-client/js-yaml 按 package.json dependencies 正常安装)。
7
+ * 本地开发走 `pnpm dev`(tsx src/index.ts),不经过本文件。
8
+ */
9
+ import '../dist/index.js'