@lumerahq/cli 0.18.5 → 0.18.6
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/{chunk-V6OFDP2Q.js → chunk-EOLZMVP4.js} +1 -1
- package/dist/{chunk-G7427W43.js → chunk-FX257H2D.js} +5 -0
- package/dist/{chunk-YIQRLXEN.js → chunk-NBEXK55Z.js} +1 -1
- package/dist/{deps-K54NOIZY.js → deps-XI64AAZY.js} +2 -2
- package/dist/{dev-THJOTVJF.js → dev-RJSD2D6X.js} +2 -2
- package/dist/index.js +12 -12
- package/dist/{init-ZDOPG3KN.js → init-4YEIRRDO.js} +3 -1
- package/dist/{register-COESODY2.js → register-MUONGCPF.js} +1 -1
- package/dist/{resources-LRWBA2RN.js → resources-BSEQZA6O.js} +64 -3
- package/dist/{run-6ULEFGHJ.js → run-GCGFVDSL.js} +1 -1
- package/package.json +1 -1
|
@@ -175,7 +175,7 @@ async function dev(options) {
|
|
|
175
175
|
)
|
|
176
176
|
);
|
|
177
177
|
const runner = detectRunner(projectRoot);
|
|
178
|
-
const viteArgs = ["vite", "--port", String(port)];
|
|
178
|
+
const viteArgs = ["vite", "--port", String(port), "--strictPort"];
|
|
179
179
|
const sandboxConfig = resolve(projectRoot, "vite.sandbox.config.ts");
|
|
180
180
|
if (existsSync(sandboxConfig)) {
|
|
181
181
|
viteArgs.push("--config", "vite.sandbox.config.ts");
|
|
@@ -184,6 +184,11 @@ var ApiClient = class {
|
|
|
184
184
|
method: "DELETE"
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
+
// MCP Servers
|
|
188
|
+
async listMCPServers() {
|
|
189
|
+
const result = await this.request("/api/mcp-servers");
|
|
190
|
+
return result.servers || [];
|
|
191
|
+
}
|
|
187
192
|
// Agent Skills (for slug-to-ID resolution)
|
|
188
193
|
async listAgentSkills() {
|
|
189
194
|
const result = await this.request("/api/lm_agent_skills?limit=100");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deps,
|
|
3
3
|
syncDeps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NBEXK55Z.js";
|
|
5
5
|
import "./chunk-2CR762KB.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FX257H2D.js";
|
|
7
7
|
import "./chunk-ZH3NVYEQ.js";
|
|
8
8
|
import "./chunk-PNKVD2UK.js";
|
|
9
9
|
export {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dev
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EOLZMVP4.js";
|
|
4
4
|
import {
|
|
5
5
|
loadEnv
|
|
6
6
|
} from "./chunk-2CR762KB.js";
|
|
7
7
|
import {
|
|
8
8
|
createApiClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FX257H2D.js";
|
|
10
10
|
import {
|
|
11
11
|
findProjectRoot,
|
|
12
12
|
getApiUrl,
|
package/dist/index.js
CHANGED
|
@@ -216,39 +216,39 @@ async function main() {
|
|
|
216
216
|
switch (command) {
|
|
217
217
|
// Resource commands
|
|
218
218
|
case "plan":
|
|
219
|
-
await import("./resources-
|
|
219
|
+
await import("./resources-BSEQZA6O.js").then((m) => m.plan(args.slice(1)));
|
|
220
220
|
break;
|
|
221
221
|
case "apply":
|
|
222
|
-
await import("./resources-
|
|
222
|
+
await import("./resources-BSEQZA6O.js").then((m) => m.apply(args.slice(1)));
|
|
223
223
|
break;
|
|
224
224
|
case "pull":
|
|
225
|
-
await import("./resources-
|
|
225
|
+
await import("./resources-BSEQZA6O.js").then((m) => m.pull(args.slice(1)));
|
|
226
226
|
break;
|
|
227
227
|
case "destroy":
|
|
228
|
-
await import("./resources-
|
|
228
|
+
await import("./resources-BSEQZA6O.js").then((m) => m.destroy(args.slice(1)));
|
|
229
229
|
break;
|
|
230
230
|
case "list":
|
|
231
|
-
await import("./resources-
|
|
231
|
+
await import("./resources-BSEQZA6O.js").then((m) => m.list(args.slice(1)));
|
|
232
232
|
break;
|
|
233
233
|
case "show":
|
|
234
|
-
await import("./resources-
|
|
234
|
+
await import("./resources-BSEQZA6O.js").then((m) => m.show(args.slice(1)));
|
|
235
235
|
break;
|
|
236
236
|
case "diff":
|
|
237
|
-
await import("./resources-
|
|
237
|
+
await import("./resources-BSEQZA6O.js").then((m) => m.diff(args.slice(1)));
|
|
238
238
|
break;
|
|
239
239
|
// Development
|
|
240
240
|
case "dev":
|
|
241
|
-
await import("./dev-
|
|
241
|
+
await import("./dev-RJSD2D6X.js").then((m) => m.dev(args.slice(1)));
|
|
242
242
|
break;
|
|
243
243
|
case "run":
|
|
244
|
-
await import("./run-
|
|
244
|
+
await import("./run-GCGFVDSL.js").then((m) => m.run(args.slice(1)));
|
|
245
245
|
break;
|
|
246
246
|
// Project
|
|
247
247
|
case "init":
|
|
248
|
-
await import("./init-
|
|
248
|
+
await import("./init-4YEIRRDO.js").then((m) => m.init(args.slice(1)));
|
|
249
249
|
break;
|
|
250
250
|
case "register":
|
|
251
|
-
await import("./register-
|
|
251
|
+
await import("./register-MUONGCPF.js").then((m) => m.register(args.slice(1)));
|
|
252
252
|
break;
|
|
253
253
|
case "templates":
|
|
254
254
|
await import("./templates-ESFQ4QO4.js").then((m) => m.templates(subcommand, args.slice(2)));
|
|
@@ -265,7 +265,7 @@ async function main() {
|
|
|
265
265
|
break;
|
|
266
266
|
// Dependencies
|
|
267
267
|
case "deps":
|
|
268
|
-
await import("./deps-
|
|
268
|
+
await import("./deps-XI64AAZY.js").then((m) => m.deps(args.slice(1)));
|
|
269
269
|
break;
|
|
270
270
|
// Auth
|
|
271
271
|
case "login":
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-BHYDYR75.js";
|
|
8
8
|
import {
|
|
9
9
|
createApiClient
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FX257H2D.js";
|
|
11
11
|
import {
|
|
12
12
|
getToken,
|
|
13
13
|
init_auth,
|
|
@@ -326,6 +326,8 @@ async function init(args) {
|
|
|
326
326
|
const sourceName = templatePkg.name || "my-lumera-app";
|
|
327
327
|
const sourceTitle = templatePkg.lumera?.name || toTitleCase(sourceName);
|
|
328
328
|
const replacements = [
|
|
329
|
+
["{{projectName}}", projectName],
|
|
330
|
+
["{{projectTitle}}", projectTitle],
|
|
329
331
|
[sourceName, projectName],
|
|
330
332
|
[sourceTitle, projectTitle]
|
|
331
333
|
];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
syncDeps
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NBEXK55Z.js";
|
|
4
4
|
import {
|
|
5
5
|
deploy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EOLZMVP4.js";
|
|
7
7
|
import {
|
|
8
8
|
loadEnv
|
|
9
9
|
} from "./chunk-2CR762KB.js";
|
|
10
10
|
import {
|
|
11
11
|
createApiClient
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FX257H2D.js";
|
|
13
13
|
import {
|
|
14
14
|
findProjectRoot,
|
|
15
15
|
getApiUrl,
|
|
@@ -1333,6 +1333,17 @@ async function planAgents(api, localAgents, projectId) {
|
|
|
1333
1333
|
} catch {
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
+
let mcpNameToId = /* @__PURE__ */ new Map();
|
|
1337
|
+
let mcpIdToName = /* @__PURE__ */ new Map();
|
|
1338
|
+
const hasMcpRefs = localAgents.some((a) => a.agent.mcp_servers && a.agent.mcp_servers.length > 0) || remoteAgents.some((a) => a.mcp_server_ids && a.mcp_server_ids.length > 0);
|
|
1339
|
+
if (hasMcpRefs) {
|
|
1340
|
+
try {
|
|
1341
|
+
const servers = await api.listMCPServers();
|
|
1342
|
+
mcpNameToId = new Map(servers.map((s) => [s.name, s.id]));
|
|
1343
|
+
mcpIdToName = new Map(servers.map((s) => [s.id, s.name]));
|
|
1344
|
+
} catch {
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1336
1347
|
for (const { agent, systemPrompt, policyScript } of localAgents) {
|
|
1337
1348
|
const remote = remoteByExternalId.get(agent.external_id);
|
|
1338
1349
|
if (!remote) {
|
|
@@ -1356,6 +1367,16 @@ async function planAgents(api, localAgents, projectId) {
|
|
|
1356
1367
|
if (removedSlugs.length) parts.push(`-${removedSlugs.join(", -")}`);
|
|
1357
1368
|
diffs.push(`skills (${parts.join(", ")})`);
|
|
1358
1369
|
}
|
|
1370
|
+
const localMcpIds = (agent.mcp_servers || []).map((n) => mcpNameToId.get(n) || n).sort();
|
|
1371
|
+
const remoteMcpIds = [...remote.mcp_server_ids || []].sort();
|
|
1372
|
+
if (localMcpIds.join(",") !== remoteMcpIds.join(",")) {
|
|
1373
|
+
const addedNames = localMcpIds.filter((id) => !remoteMcpIds.includes(id)).map((id) => mcpIdToName.get(id) || id);
|
|
1374
|
+
const removedNames = remoteMcpIds.filter((id) => !localMcpIds.includes(id)).map((id) => mcpIdToName.get(id) || id);
|
|
1375
|
+
const parts = [];
|
|
1376
|
+
if (addedNames.length) parts.push(`+${addedNames.join(", +")}`);
|
|
1377
|
+
if (removedNames.length) parts.push(`-${removedNames.join(", -")}`);
|
|
1378
|
+
diffs.push(`mcp_servers (${parts.join(", ")})`);
|
|
1379
|
+
}
|
|
1359
1380
|
if (diffs.length > 0) {
|
|
1360
1381
|
const textDiffs = [];
|
|
1361
1382
|
if (diffs.includes("system_prompt")) {
|
|
@@ -1386,6 +1407,16 @@ async function applyAgents(api, localAgents, projectId) {
|
|
|
1386
1407
|
console.log(pc.yellow(` \u26A0 Could not fetch skills for resolution: ${e}`));
|
|
1387
1408
|
}
|
|
1388
1409
|
}
|
|
1410
|
+
let mcpMap = /* @__PURE__ */ new Map();
|
|
1411
|
+
const hasMcpRefs = localAgents.some((a) => a.agent.mcp_servers && a.agent.mcp_servers.length > 0);
|
|
1412
|
+
if (hasMcpRefs) {
|
|
1413
|
+
try {
|
|
1414
|
+
const servers = await api.listMCPServers();
|
|
1415
|
+
mcpMap = new Map(servers.map((s) => [s.name, s.id]));
|
|
1416
|
+
} catch (e) {
|
|
1417
|
+
console.log(pc.yellow(` \u26A0 Could not fetch MCP servers for resolution: ${e}`));
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1389
1420
|
for (const { agent, systemPrompt, policyScript } of localAgents) {
|
|
1390
1421
|
const remote = remoteByExternalId.get(agent.external_id);
|
|
1391
1422
|
const skillIds = [];
|
|
@@ -1399,6 +1430,17 @@ async function applyAgents(api, localAgents, projectId) {
|
|
|
1399
1430
|
}
|
|
1400
1431
|
}
|
|
1401
1432
|
}
|
|
1433
|
+
const mcpServerIds = [];
|
|
1434
|
+
if (agent.mcp_servers) {
|
|
1435
|
+
for (const name of agent.mcp_servers) {
|
|
1436
|
+
const id = mcpMap.get(name);
|
|
1437
|
+
if (id) {
|
|
1438
|
+
mcpServerIds.push(id);
|
|
1439
|
+
} else {
|
|
1440
|
+
console.log(pc.yellow(` \u26A0 MCP server "${name}" not found, skipping`));
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1402
1444
|
const payload = {
|
|
1403
1445
|
external_id: agent.external_id,
|
|
1404
1446
|
name: agent.name,
|
|
@@ -1406,6 +1448,7 @@ async function applyAgents(api, localAgents, projectId) {
|
|
|
1406
1448
|
system_prompt: systemPrompt,
|
|
1407
1449
|
model: agent.model || "",
|
|
1408
1450
|
skill_ids: skillIds,
|
|
1451
|
+
mcp_server_ids: mcpServerIds,
|
|
1409
1452
|
policy_script: policyScript || "",
|
|
1410
1453
|
policy_enabled: agent.policy_enabled || false,
|
|
1411
1454
|
policy_description: agent.policy_description || ""
|
|
@@ -1436,6 +1479,12 @@ async function pullAgents(api, platformDir, filterName, projectId) {
|
|
|
1436
1479
|
skillIdToSlug = new Map(skills.map((s) => [s.id, s.slug]));
|
|
1437
1480
|
} catch {
|
|
1438
1481
|
}
|
|
1482
|
+
let mcpIdToName = /* @__PURE__ */ new Map();
|
|
1483
|
+
try {
|
|
1484
|
+
const servers = await api.listMCPServers();
|
|
1485
|
+
mcpIdToName = new Map(servers.map((s) => [s.id, s.name]));
|
|
1486
|
+
} catch {
|
|
1487
|
+
}
|
|
1439
1488
|
for (const agent of agents) {
|
|
1440
1489
|
if (!agent.external_id || agent.managed) continue;
|
|
1441
1490
|
if (filterName && agent.external_id !== filterName && agent.name !== filterName) {
|
|
@@ -1451,6 +1500,13 @@ async function pullAgents(api, platformDir, filterName, projectId) {
|
|
|
1451
1500
|
if (slug) skillSlugs.push(slug);
|
|
1452
1501
|
}
|
|
1453
1502
|
}
|
|
1503
|
+
const mcpServerNames = [];
|
|
1504
|
+
if (agent.mcp_server_ids) {
|
|
1505
|
+
for (const id of agent.mcp_server_ids) {
|
|
1506
|
+
const name = mcpIdToName.get(id);
|
|
1507
|
+
if (name) mcpServerNames.push(name);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1454
1510
|
const config = {
|
|
1455
1511
|
external_id: agent.external_id,
|
|
1456
1512
|
name: agent.name
|
|
@@ -1458,6 +1514,7 @@ async function pullAgents(api, platformDir, filterName, projectId) {
|
|
|
1458
1514
|
if (agent.description) config.description = agent.description;
|
|
1459
1515
|
if (agent.model) config.model = agent.model;
|
|
1460
1516
|
if (skillSlugs.length > 0) config.skills = skillSlugs;
|
|
1517
|
+
if (mcpServerNames.length > 0) config.mcp_servers = mcpServerNames;
|
|
1461
1518
|
if (agent.policy_enabled) config.policy_enabled = true;
|
|
1462
1519
|
writeFileSync(join(agentDir, "config.json"), JSON.stringify(config, null, 2) + "\n");
|
|
1463
1520
|
writeFileSync(join(agentDir, "system_prompt.md"), agent.system_prompt || "");
|
|
@@ -1985,6 +2042,10 @@ async function showResource(api, platformDir, resourceType, resourceName, appNam
|
|
|
1985
2042
|
const skills = local?.agent.skills || remote?.skill_ids || [];
|
|
1986
2043
|
console.log(` Skills: ${skills.join(", ")}`);
|
|
1987
2044
|
}
|
|
2045
|
+
if (local?.agent.mcp_servers?.length || remote?.mcp_server_ids?.length) {
|
|
2046
|
+
const mcps = local?.agent.mcp_servers || remote?.mcp_server_ids || [];
|
|
2047
|
+
console.log(` MCP Servers: ${mcps.join(", ")}`);
|
|
2048
|
+
}
|
|
1988
2049
|
console.log();
|
|
1989
2050
|
} else if (resourceType === "app") {
|
|
1990
2051
|
const projectRoot = findProjectRoot();
|