@arcships/morula-runtime 0.1.0-alpha.2 → 0.1.0-alpha.20
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 +18 -0
- package/bin/morula-runtime.js +0 -0
- package/bin/morula.js +9 -0
- package/dist/index.js +11242 -3527
- package/dist/morula.js +4645 -0
- package/dist/plugin/plugin.json +10 -0
- package/dist/plugin/skills/morula-cli/SKILL.md +217 -0
- package/dist/plugin/skills/morula-cli/references/authentication.md +21 -0
- package/dist/plugin/skills/morula-cli/references/commands.md +1756 -0
- package/dist/plugin/skills/morula-cli/references/eval-scenarios.md +42 -0
- package/dist/plugin/skills/morula-platform/SKILL.md +42 -0
- package/dist/plugin/skills/morula-platform/references/delivery.md +60 -0
- package/dist/plugin/skills/morula-platform/references/git-workflow.md +98 -0
- package/dist/plugin/skills/morula-platform/references/observability.md +33 -0
- package/dist/plugin/skills/morula-platform/references/task-protocols.md +110 -0
- package/dist/plugin/skills/morula-platform/references/working-on-issues-source-map.md +103 -0
- package/dist/plugin/skills/morula-platform/references/workspace.md +79 -0
- package/dist/plugin/skills/morula-working-on-issues/SKILL.md +19 -0
- package/package.json +11 -5
- package/scripts/postinstall.mjs +46 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: morula-working-on-issues
|
|
3
|
+
description: "Superseded by the morula-platform skill — load that instead. This stub only records where the Morula task contracts moved to."
|
|
4
|
+
user-invocable: false
|
|
5
|
+
allowed-tools: Bash(morula *), Bash(git *), Bash(gh *)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Moved into `morula-platform`
|
|
9
|
+
|
|
10
|
+
Morula 的任务协作契约已并入 `morula-platform` skill(开篇分工 + Routing + 按域手册):
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
morula-platform → SKILL.md(路由表)+ references/{workspace, git-workflow, task-protocols, delivery, observability}.md
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
契约核心(不变量 + 机器协议命令索引 + 手册路由)随工作区根 `AGENTS.md`「Morula 平台协作契约」段恒定生效。
|
|
17
|
+
旧 brief / 旧插件副本可能仍指名本 skill——按上面的新入口读取即可,不要重复学习两份契约。
|
|
18
|
+
|
|
19
|
+
> 本副本随 CLI 插件分发;daemon 注入工作区的权威版本结构相同。
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcships/morula-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-alpha.
|
|
5
|
-
"description": "Device-level CLI for the Morula local agent runtime (daemon/portal/models/auth), distributed via npm",
|
|
4
|
+
"version": "0.1.0-alpha.20",
|
|
5
|
+
"description": "Device-level CLI for the Morula local agent runtime (daemon/portal/models/auth) and the Morula business CLI (morula), distributed via npm",
|
|
6
6
|
"bin": {
|
|
7
|
-
"morula-runtime": "./bin/morula-runtime.js"
|
|
7
|
+
"morula-runtime": "./bin/morula-runtime.js",
|
|
8
|
+
"morula": "./bin/morula.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|
|
10
11
|
"dist",
|
|
11
|
-
"bin"
|
|
12
|
+
"bin",
|
|
13
|
+
"scripts/postinstall.mjs"
|
|
12
14
|
],
|
|
13
15
|
"engines": {
|
|
14
16
|
"node": ">=20"
|
|
@@ -18,10 +20,13 @@
|
|
|
18
20
|
"build:env": "node scripts/gen-build-env.mjs",
|
|
19
21
|
"build:dist": "node scripts/build-dist.mjs",
|
|
20
22
|
"gen:plugin-skill": "tsx scripts/gen-plugin-skill.mts",
|
|
23
|
+
"gen:cli-skill": "tsx scripts/gen-cli-skill.mts",
|
|
21
24
|
"prepublishOnly": "pnpm run gen-build-env && pnpm run build:dist",
|
|
25
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
22
26
|
"dev": "tsx src/index.ts",
|
|
27
|
+
"dev:morula": "pnpm --filter @morula/morula-cli run dev",
|
|
23
28
|
"lint:type": "tsc --noEmit -p tsconfig.json",
|
|
24
|
-
"test": "tsx --test --test-concurrency=1 test/*.test.ts",
|
|
29
|
+
"test": "tsx --test --test-concurrency=1 test/*.test.ts src/**/*.spec.ts",
|
|
25
30
|
"smoke": "tsx src/index.ts --help"
|
|
26
31
|
},
|
|
27
32
|
"dependencies": {
|
|
@@ -30,6 +35,7 @@
|
|
|
30
35
|
},
|
|
31
36
|
"devDependencies": {
|
|
32
37
|
"@morula/morula-api-client": "workspace:*",
|
|
38
|
+
"@morula/morula-cli": "workspace:*",
|
|
33
39
|
"@morula/morula-cli-core": "workspace:*",
|
|
34
40
|
"@types/js-yaml": "^4.0.9",
|
|
35
41
|
"@types/node": "^24.2.0",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* postinstall:尽力把 Dim 插件目录物化到本机(docs/features/single-package-cli-distribution.md)。
|
|
4
|
+
*
|
|
5
|
+
* 为什么放在 postinstall:用户的目标是「装一个包就能用」。skills 与 agent 执行 PATH 上的
|
|
6
|
+
* `morula` 只能由 Dim 的插件根提供,所以安装时直接注册一次。
|
|
7
|
+
*
|
|
8
|
+
* 物化范围(acp-provider-generalization U16 / D-k):**只服务 dim 插件**——
|
|
9
|
+
* 本脚本只写 `<DIMCODE_HOME>/plugins/morula-cli`。平台**不代装 AI CLI**(claude / codex 等
|
|
10
|
+
* 由用户自行安装),也**不为非 dim provider 做任何宿主侧投影**(非 dim provider 的投影只落在
|
|
11
|
+
* 任务工作区,见 providers/**)。因此「非 dim provider 的 CLI 缺失」不是安装问题,而是运行期
|
|
12
|
+
* 的可诊断结论:`morula-runtime daemon doctor --probe` 会给出 `<KEY>_CLI_NOT_FOUND` /
|
|
13
|
+
* `<KEY>_PROBE_FAILED` 与对应的下一步。本脚本**不得**为此新增任何向宿主写 provider 文件的行为。
|
|
14
|
+
*
|
|
15
|
+
* 硬约束:**绝不阻断安装**。
|
|
16
|
+
* - 任何失败(资产缺失、权限、非交互环境、`--ignore-scripts` 之外的意外)只 warn + exit 0;
|
|
17
|
+
* - 失败后可随时手动补:`morula-runtime setup`;
|
|
18
|
+
* - 只跑本包的 `setup` 命令(注册逻辑单一来源),不在这里复制一份实现。
|
|
19
|
+
*/
|
|
20
|
+
import { execFileSync } from 'node:child_process'
|
|
21
|
+
import { existsSync } from 'node:fs'
|
|
22
|
+
import { dirname, join } from 'node:path'
|
|
23
|
+
import { fileURLToPath } from 'node:url'
|
|
24
|
+
|
|
25
|
+
const root = dirname(dirname(fileURLToPath(import.meta.url)))
|
|
26
|
+
const entry = join(root, 'dist', 'index.js')
|
|
27
|
+
|
|
28
|
+
/** 静默跳过(源码 checkout 未构建 / 无 dist 产物):不是错误,不给噪音 */
|
|
29
|
+
if (!existsSync(entry)) {
|
|
30
|
+
process.exit(0)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
const output = execFileSync(process.execPath, [entry, 'setup'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] })
|
|
35
|
+
const result = JSON.parse(output)
|
|
36
|
+
const legacy = result.legacyRoot ? `;检测到旧插件目录 ${result.legacyRoot},建议删除(Dim 优先命中 ${result.pluginRoot})` : ''
|
|
37
|
+
console.error(`[morula-runtime] 插件已注册:${result.pluginRoot}(skills: ${(result.skills ?? []).join(', ')})${legacy}`)
|
|
38
|
+
console.error('[morula-runtime] 只物化 Dim 插件:平台不代装 AI CLI(claude / codex 等需自行安装),也不为非 dim provider 做宿主侧投影')
|
|
39
|
+
console.error('[morula-runtime] Dim 会在**新 session** 加载插件;手动重注册:morula-runtime setup')
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const detail = error instanceof Error ? error.message.split('\n')[0] : String(error)
|
|
43
|
+
console.error(`[morula-runtime] 插件注册跳过(不影响安装):${detail}`)
|
|
44
|
+
console.error('[morula-runtime] 可随时手动重试:morula-runtime setup')
|
|
45
|
+
}
|
|
46
|
+
process.exit(0)
|