@arcships/morula-runtime 0.1.0-alpha.0 → 0.1.0-alpha.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/dist/index.js +15 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -753,9 +753,8 @@ import { homedir as homedir7 } from "node:os";
|
|
|
753
753
|
import { join as join11 } from "node:path";
|
|
754
754
|
function dimSqlitePath(env) {
|
|
755
755
|
const home = env?.DIMCODE_HOME?.trim();
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
return existsSync9(p) ? p : null;
|
|
756
|
+
const candidates = home && home !== "" ? [join11(home, "v2", "dimcode.sqlite"), join11(home, "dimcode.sqlite")] : [join11(homedir7(), ".dimcode", "v2", "dimcode.sqlite")];
|
|
757
|
+
return candidates.find((p) => existsSync9(p)) ?? null;
|
|
759
758
|
}
|
|
760
759
|
function listDimModels(dimPath = "dim", env) {
|
|
761
760
|
const fromSqlite = listDimModelsFromSqlite(env);
|
|
@@ -1641,9 +1640,9 @@ function page(ok, message) {
|
|
|
1641
1640
|
var BUILD_CONTEXTS = {
|
|
1642
1641
|
"local": "http://localhost:8080/api",
|
|
1643
1642
|
"test": "https://morula.basecastle.com/api",
|
|
1644
|
-
"prod": "https://morula.
|
|
1643
|
+
"prod": "https://morula.fazhiplus.com/api"
|
|
1645
1644
|
};
|
|
1646
|
-
var BUILD_DEFAULT_CONTEXT = "
|
|
1645
|
+
var BUILD_DEFAULT_CONTEXT = "prod";
|
|
1647
1646
|
|
|
1648
1647
|
// ../morula-api-client/dist/attachment.js
|
|
1649
1648
|
var AttachmentApi = class {
|
|
@@ -2409,7 +2408,7 @@ function redactInputSummary(value) {
|
|
|
2409
2408
|
}
|
|
2410
2409
|
|
|
2411
2410
|
// src/build-env.ts
|
|
2412
|
-
var BUILD_VERSION2 = "0.1.0-alpha.
|
|
2411
|
+
var BUILD_VERSION2 = "0.1.0-alpha.1";
|
|
2413
2412
|
|
|
2414
2413
|
// src/commands/daemon.ts
|
|
2415
2414
|
import { existsSync as existsSync14, mkdirSync as mkdirSync10, readFileSync as readFileSync7, rmSync as rmSync6, writeFileSync as writeFileSync8 } from "node:fs";
|
|
@@ -4038,7 +4037,7 @@ var DimAgentAdapter = class {
|
|
|
4038
4037
|
}
|
|
4039
4038
|
async listModels(input = {}) {
|
|
4040
4039
|
const { listDimModels: listDimModels2 } = await Promise.resolve().then(() => (init_dim_model(), dim_model_exports));
|
|
4041
|
-
return listDimModels2(this.dimPath).map((m) => ({
|
|
4040
|
+
return listDimModels2(this.dimPath, this.probeEnv()).map((m) => ({
|
|
4042
4041
|
id: m.id,
|
|
4043
4042
|
name: m.name,
|
|
4044
4043
|
// 模型所属 Provider(前端模型下拉区分同名模型,如 deepseek-v4-flash 存在多 provider 变体)
|
|
@@ -4235,7 +4234,10 @@ async function probeProviderInventory(options = {}) {
|
|
|
4235
4234
|
if (INVENTORY_EXCLUDED.has(key))
|
|
4236
4235
|
continue;
|
|
4237
4236
|
try {
|
|
4238
|
-
const adapter = requireProviderAdapter(key
|
|
4237
|
+
const adapter = requireProviderAdapter(key, {
|
|
4238
|
+
...options.dimPath ? { dimPath: options.dimPath } : {},
|
|
4239
|
+
...options.isolatedDimEnv ? { isolatedDimEnv: options.isolatedDimEnv } : {}
|
|
4240
|
+
});
|
|
4239
4241
|
const probe = await adapter.probe({ cwd: options.cwd });
|
|
4240
4242
|
let models2 = probe.models ?? [];
|
|
4241
4243
|
if (probe.status === "available" && models2.length === 0 && typeof adapter.listModels === "function") {
|
|
@@ -4636,7 +4638,11 @@ var DaemonRunner = class {
|
|
|
4636
4638
|
try {
|
|
4637
4639
|
inventory = await probeProviderInventory({
|
|
4638
4640
|
maxConcurrentTasks: cfg.maxConcurrent,
|
|
4639
|
-
cwd: cfg.workdir
|
|
4641
|
+
cwd: cfg.workdir,
|
|
4642
|
+
// 探测与执行路径一致:显式 dim 绝对路径 + 独立空间 env
|
|
4643
|
+
// (PATH 裁剪 / 默认路径多拼一层 v2 会导致模型上报为空,见 daemon-model-report-empty)
|
|
4644
|
+
dimPath: this.dimPath,
|
|
4645
|
+
isolatedDimEnv: this.isolatedDimEnv
|
|
4640
4646
|
});
|
|
4641
4647
|
} catch (error) {
|
|
4642
4648
|
this.log(`[daemon] Provider inventory \u63A2\u6D4B\u5931\u8D25: ${error instanceof Error ? error.message : String(error)}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcships/morula-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-alpha.
|
|
4
|
+
"version": "0.1.0-alpha.1",
|
|
5
5
|
"description": "Device-level CLI for the Morula local agent runtime (daemon/portal/models/auth), distributed via npm",
|
|
6
6
|
"bin": {
|
|
7
7
|
"morula-runtime": "./bin/morula-runtime.js"
|