@lumerahq/cli 0.32.8 → 0.32.9-dev.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/dist/{chunk-HS63O4MH.js → chunk-7BEMZHHL.js} +1 -1
- package/dist/{chunk-ZJ7M7JD3.js → chunk-M7CSPAM2.js} +7 -0
- package/dist/{chunk-KE26WWAQ.js → chunk-TYMHPKEA.js} +1 -1
- package/dist/{deps-SIZ77NYE.js → deps-L42NUTNQ.js} +2 -2
- package/dist/{dev-ANVS25HB.js → dev-VESXDHC4.js} +3 -3
- package/dist/index.js +12 -12
- package/dist/{init-KACYHD23.js → init-UOZJIP4S.js} +1 -1
- package/dist/{register-ZXNNU3NJ.js → register-M2W24E24.js} +1 -1
- package/dist/{resources-G4EVBRZV.js → resources-XLV3M333.js} +103 -13
- package/dist/{run-7KJPBOIY.js → run-EQOUWJZO.js} +1 -1
- package/package.json +1 -1
|
@@ -281,6 +281,13 @@ var ApiClient = class {
|
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
// Agents
|
|
284
|
+
async getModels() {
|
|
285
|
+
const result = await this.request("/api/models");
|
|
286
|
+
return {
|
|
287
|
+
models: result.models || [],
|
|
288
|
+
deprecated_model_routes: result.deprecated_model_routes || {}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
284
291
|
async listAgents(opts) {
|
|
285
292
|
const params = new URLSearchParams({ limit: "100" });
|
|
286
293
|
if (opts?.project_id) params.set("project_id", opts.project_id);
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
deps,
|
|
3
3
|
syncDeps,
|
|
4
4
|
syncResourceShareDeps
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7BEMZHHL.js";
|
|
6
6
|
import "./chunk-2CR762KB.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-M7CSPAM2.js";
|
|
8
8
|
import "./chunk-JLVVHTBY.js";
|
|
9
9
|
import "./chunk-FJFIWC7G.js";
|
|
10
10
|
import "./chunk-PNKVD2UK.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dev
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TYMHPKEA.js";
|
|
4
4
|
import {
|
|
5
5
|
syncDeps
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7BEMZHHL.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-M7CSPAM2.js";
|
|
13
13
|
import {
|
|
14
14
|
findProjectRoot,
|
|
15
15
|
getApiUrl,
|
package/dist/index.js
CHANGED
|
@@ -242,32 +242,32 @@ async function main() {
|
|
|
242
242
|
switch (command) {
|
|
243
243
|
// Resource commands
|
|
244
244
|
case "plan":
|
|
245
|
-
await import("./resources-
|
|
245
|
+
await import("./resources-XLV3M333.js").then((m) => m.plan(args.slice(1)));
|
|
246
246
|
break;
|
|
247
247
|
case "apply":
|
|
248
|
-
await import("./resources-
|
|
248
|
+
await import("./resources-XLV3M333.js").then((m) => m.apply(args.slice(1)));
|
|
249
249
|
break;
|
|
250
250
|
case "pull":
|
|
251
|
-
await import("./resources-
|
|
251
|
+
await import("./resources-XLV3M333.js").then((m) => m.pull(args.slice(1)));
|
|
252
252
|
break;
|
|
253
253
|
case "destroy":
|
|
254
|
-
await import("./resources-
|
|
254
|
+
await import("./resources-XLV3M333.js").then((m) => m.destroy(args.slice(1)));
|
|
255
255
|
break;
|
|
256
256
|
case "list":
|
|
257
|
-
await import("./resources-
|
|
257
|
+
await import("./resources-XLV3M333.js").then((m) => m.list(args.slice(1)));
|
|
258
258
|
break;
|
|
259
259
|
case "show":
|
|
260
|
-
await import("./resources-
|
|
260
|
+
await import("./resources-XLV3M333.js").then((m) => m.show(args.slice(1)));
|
|
261
261
|
break;
|
|
262
262
|
case "diff":
|
|
263
|
-
await import("./resources-
|
|
263
|
+
await import("./resources-XLV3M333.js").then((m) => m.diff(args.slice(1)));
|
|
264
264
|
break;
|
|
265
265
|
// Development
|
|
266
266
|
case "dev":
|
|
267
|
-
await import("./dev-
|
|
267
|
+
await import("./dev-VESXDHC4.js").then((m) => m.dev(args.slice(1)));
|
|
268
268
|
break;
|
|
269
269
|
case "run":
|
|
270
|
-
await import("./run-
|
|
270
|
+
await import("./run-EQOUWJZO.js").then((m) => m.run(args.slice(1)));
|
|
271
271
|
break;
|
|
272
272
|
case "functions":
|
|
273
273
|
await import("./functions-PH4ZJA7U.js").then(
|
|
@@ -281,10 +281,10 @@ async function main() {
|
|
|
281
281
|
break;
|
|
282
282
|
// Project
|
|
283
283
|
case "init":
|
|
284
|
-
await import("./init-
|
|
284
|
+
await import("./init-UOZJIP4S.js").then((m) => m.init(args.slice(1)));
|
|
285
285
|
break;
|
|
286
286
|
case "register":
|
|
287
|
-
await import("./register-
|
|
287
|
+
await import("./register-M2W24E24.js").then((m) => m.register(args.slice(1)));
|
|
288
288
|
break;
|
|
289
289
|
case "templates":
|
|
290
290
|
await import("./templates-LNUOTNLN.js").then((m) => m.templates(subcommand, args.slice(2)));
|
|
@@ -301,7 +301,7 @@ async function main() {
|
|
|
301
301
|
break;
|
|
302
302
|
// Dependencies
|
|
303
303
|
case "deps":
|
|
304
|
-
await import("./deps-
|
|
304
|
+
await import("./deps-L42NUTNQ.js").then((m) => m.deps(args.slice(1)));
|
|
305
305
|
break;
|
|
306
306
|
// Feature flags (read the in-sandbox snapshot)
|
|
307
307
|
case "flags":
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deploy,
|
|
3
3
|
deployAppAPI
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TYMHPKEA.js";
|
|
5
5
|
import {
|
|
6
6
|
syncDeps
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7BEMZHHL.js";
|
|
8
8
|
import {
|
|
9
9
|
loadEnv
|
|
10
10
|
} from "./chunk-2CR762KB.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
createApiClient,
|
|
14
14
|
isApiErrorStatus,
|
|
15
15
|
validateCollectionNameLength
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-M7CSPAM2.js";
|
|
17
17
|
import {
|
|
18
18
|
findProjectRoot,
|
|
19
19
|
getApiUrl,
|
|
@@ -40,6 +40,31 @@ import { dirname as dirname2, join as join2, resolve } from "path";
|
|
|
40
40
|
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
41
41
|
import { basename, dirname, join } from "path";
|
|
42
42
|
|
|
43
|
+
// src/lib/lint/rules/agent-deprecated-model.ts
|
|
44
|
+
function configuredModel(config) {
|
|
45
|
+
if (typeof config !== "object" || config === null || Array.isArray(config)) {
|
|
46
|
+
return "";
|
|
47
|
+
}
|
|
48
|
+
const model = config.model;
|
|
49
|
+
return typeof model === "string" ? model.trim() : "";
|
|
50
|
+
}
|
|
51
|
+
var agentDeprecatedModelRule = {
|
|
52
|
+
id: "agent-deprecated-model",
|
|
53
|
+
description: "Warns when an agent model is internally routed to a replacement model.",
|
|
54
|
+
appliesTo: ["agent-config"],
|
|
55
|
+
check(target, ctx) {
|
|
56
|
+
const model = configuredModel(target.config);
|
|
57
|
+
const targetModel = ctx.deprecatedModelRoutes?.[model];
|
|
58
|
+
if (!model || !targetModel) return [];
|
|
59
|
+
return [{
|
|
60
|
+
ruleId: "agent-deprecated-model",
|
|
61
|
+
target,
|
|
62
|
+
severity: "warning",
|
|
63
|
+
message: `Model \`${model}\` is deprecated and internally routed to \`${targetModel}\`. Update this agent's config.json to use the replacement model.`
|
|
64
|
+
}];
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
43
68
|
// src/lib/lint/compile-diagnostics.ts
|
|
44
69
|
function compileDiagnostic(value) {
|
|
45
70
|
if (!value || typeof value !== "object") return void 0;
|
|
@@ -860,6 +885,7 @@ var llmImportRule = {
|
|
|
860
885
|
|
|
861
886
|
// src/lib/lint/registry.ts
|
|
862
887
|
var ALL_RULES = [
|
|
888
|
+
agentDeprecatedModelRule,
|
|
863
889
|
agentPolicyCompileRule,
|
|
864
890
|
automationConfigRule,
|
|
865
891
|
automationMainGuardRule,
|
|
@@ -974,6 +1000,44 @@ function buildHookTargets(platformDir, filterName) {
|
|
|
974
1000
|
}
|
|
975
1001
|
return targets;
|
|
976
1002
|
}
|
|
1003
|
+
function buildAgentConfigTargets(platformDir, filterName, appName) {
|
|
1004
|
+
const agentsDir = join(platformDir, "agents");
|
|
1005
|
+
if (!existsSync(agentsDir)) return [];
|
|
1006
|
+
const targets = [];
|
|
1007
|
+
for (const entry of readdirSync(agentsDir, { withFileTypes: true })) {
|
|
1008
|
+
if (!entry.isDirectory()) continue;
|
|
1009
|
+
const configPath = join(agentsDir, entry.name, "config.json");
|
|
1010
|
+
if (!existsSync(configPath)) continue;
|
|
1011
|
+
const source = readFileSync(configPath, "utf-8");
|
|
1012
|
+
let config;
|
|
1013
|
+
let externalID = appName ? `${appName}:${entry.name}` : "";
|
|
1014
|
+
let displayName = "";
|
|
1015
|
+
try {
|
|
1016
|
+
config = JSON.parse(source);
|
|
1017
|
+
if (typeof config === "object" && config !== null && !Array.isArray(config)) {
|
|
1018
|
+
const values = config;
|
|
1019
|
+
if (typeof values.external_id === "string" && values.external_id.trim()) {
|
|
1020
|
+
externalID = values.external_id;
|
|
1021
|
+
}
|
|
1022
|
+
if (typeof values.name === "string") {
|
|
1023
|
+
displayName = values.name;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
} catch {
|
|
1027
|
+
}
|
|
1028
|
+
if (filterName && entry.name !== filterName && externalID !== filterName && displayName !== filterName) {
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
targets.push({
|
|
1032
|
+
kind: "agent-config",
|
|
1033
|
+
name: externalID || displayName || entry.name,
|
|
1034
|
+
filePath: configPath,
|
|
1035
|
+
source,
|
|
1036
|
+
config
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
return targets;
|
|
1040
|
+
}
|
|
977
1041
|
function buildAgentPolicyTargets(platformDir, filterName, appName) {
|
|
978
1042
|
const agentsDir = join(platformDir, "agents");
|
|
979
1043
|
if (!existsSync(agentsDir)) return [];
|
|
@@ -1065,17 +1129,31 @@ async function lintHookFiles(api, projectRoot, platformDir, appName, filterName)
|
|
|
1065
1129
|
throw new Error(`Found ${result.errors.length} hook lint error(s)`);
|
|
1066
1130
|
}
|
|
1067
1131
|
}
|
|
1068
|
-
async function
|
|
1069
|
-
const result = await safeLintPass("agent
|
|
1070
|
-
const targets =
|
|
1132
|
+
async function lintAgentFiles(api, projectRoot, platformDir, appName, filterName, printWarnings = true) {
|
|
1133
|
+
const result = await safeLintPass("agent", async () => {
|
|
1134
|
+
const targets = [
|
|
1135
|
+
...buildAgentConfigTargets(platformDir, filterName, appName),
|
|
1136
|
+
...buildAgentPolicyTargets(platformDir, filterName, appName)
|
|
1137
|
+
];
|
|
1071
1138
|
if (targets.length === 0) return [];
|
|
1072
|
-
|
|
1139
|
+
let deprecatedModelRoutes = {};
|
|
1140
|
+
try {
|
|
1141
|
+
deprecatedModelRoutes = (await api.getModels()).deprecated_model_routes;
|
|
1142
|
+
} catch (err) {
|
|
1143
|
+
if (process.env.LUMERA_DEBUG) {
|
|
1144
|
+
console.error("[lint] unable to load deprecated model routes:", err);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return runLint({ projectRoot, targets, api, appName, deprecatedModelRoutes });
|
|
1073
1148
|
});
|
|
1074
|
-
if (!result || result.issues.length === 0) return;
|
|
1075
|
-
|
|
1149
|
+
if (!result || result.issues.length === 0) return [];
|
|
1150
|
+
if (printWarnings || result.errors.length > 0) {
|
|
1151
|
+
safePrintLint(result.issues, projectRoot);
|
|
1152
|
+
}
|
|
1076
1153
|
if (result.errors.length > 0) {
|
|
1077
|
-
throw new Error(`Found ${result.errors.length} agent
|
|
1154
|
+
throw new Error(`Found ${result.errors.length} agent lint error(s)`);
|
|
1078
1155
|
}
|
|
1156
|
+
return result.issues;
|
|
1079
1157
|
}
|
|
1080
1158
|
var PACKAGE_MANAGERS = ["bun", "pnpm", "yarn", "npm"];
|
|
1081
1159
|
var PACKAGE_MANAGER_VALUE_FLAGS = /* @__PURE__ */ new Set(["--package-manager"]);
|
|
@@ -4233,8 +4311,16 @@ async function plan(args) {
|
|
|
4233
4311
|
if (!type || type === "hooks") {
|
|
4234
4312
|
await lintHookFiles(api, projectRoot, platformDir, appName, name || void 0);
|
|
4235
4313
|
}
|
|
4314
|
+
let agentLintWarnings = [];
|
|
4236
4315
|
if (!type || type === "agents") {
|
|
4237
|
-
await
|
|
4316
|
+
agentLintWarnings = await lintAgentFiles(
|
|
4317
|
+
api,
|
|
4318
|
+
projectRoot,
|
|
4319
|
+
platformDir,
|
|
4320
|
+
appName,
|
|
4321
|
+
name || void 0,
|
|
4322
|
+
false
|
|
4323
|
+
);
|
|
4238
4324
|
}
|
|
4239
4325
|
await syncDeps(projectRoot, { ignorePermissionDenied: true });
|
|
4240
4326
|
const allChanges = [];
|
|
@@ -4290,7 +4376,10 @@ async function plan(args) {
|
|
|
4290
4376
|
allChanges.push(...changes);
|
|
4291
4377
|
}
|
|
4292
4378
|
}
|
|
4293
|
-
const lintWarnings =
|
|
4379
|
+
const lintWarnings = [
|
|
4380
|
+
...agentLintWarnings,
|
|
4381
|
+
...await safeLint(projectRoot, localAutomations)
|
|
4382
|
+
];
|
|
4294
4383
|
if (allChanges.length === 0) {
|
|
4295
4384
|
if (jsonOutput) {
|
|
4296
4385
|
console.log(JSON.stringify({ changes: [], warnings: [], validationErrors: planValidationErrors, lintWarnings: serializeLintWarnings(lintWarnings, projectRoot) }));
|
|
@@ -4418,7 +4507,7 @@ async function apply(args) {
|
|
|
4418
4507
|
await lintHookFiles(api, projectRoot, platformDir, appName, name || void 0);
|
|
4419
4508
|
}
|
|
4420
4509
|
if (!type || type === "agents") {
|
|
4421
|
-
await
|
|
4510
|
+
await lintAgentFiles(api, projectRoot, platformDir, appName, name || void 0);
|
|
4422
4511
|
}
|
|
4423
4512
|
await syncDeps(projectRoot, { ignorePermissionDenied: true });
|
|
4424
4513
|
let collections;
|
|
@@ -5064,6 +5153,7 @@ export {
|
|
|
5064
5153
|
convertCollectionToApiFormat,
|
|
5065
5154
|
destroy,
|
|
5066
5155
|
diff,
|
|
5156
|
+
lintAgentFiles,
|
|
5067
5157
|
list,
|
|
5068
5158
|
loadLocalCollections,
|
|
5069
5159
|
loadLocalSkills,
|