@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.
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  createApiClient,
6
6
  isApiErrorStatus
7
- } from "./chunk-ZJ7M7JD3.js";
7
+ } from "./chunk-M7CSPAM2.js";
8
8
  import {
9
9
  findProjectRoot,
10
10
  getAppName
@@ -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);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  userContextHeaders
3
- } from "./chunk-ZJ7M7JD3.js";
3
+ } from "./chunk-M7CSPAM2.js";
4
4
  import {
5
5
  fetchWithRetry
6
6
  } from "./chunk-FJFIWC7G.js";
@@ -2,9 +2,9 @@ import {
2
2
  deps,
3
3
  syncDeps,
4
4
  syncResourceShareDeps
5
- } from "./chunk-HS63O4MH.js";
5
+ } from "./chunk-7BEMZHHL.js";
6
6
  import "./chunk-2CR762KB.js";
7
- import "./chunk-ZJ7M7JD3.js";
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-KE26WWAQ.js";
3
+ } from "./chunk-TYMHPKEA.js";
4
4
  import {
5
5
  syncDeps
6
- } from "./chunk-HS63O4MH.js";
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-ZJ7M7JD3.js";
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-G4EVBRZV.js").then((m) => m.plan(args.slice(1)));
245
+ await import("./resources-XLV3M333.js").then((m) => m.plan(args.slice(1)));
246
246
  break;
247
247
  case "apply":
248
- await import("./resources-G4EVBRZV.js").then((m) => m.apply(args.slice(1)));
248
+ await import("./resources-XLV3M333.js").then((m) => m.apply(args.slice(1)));
249
249
  break;
250
250
  case "pull":
251
- await import("./resources-G4EVBRZV.js").then((m) => m.pull(args.slice(1)));
251
+ await import("./resources-XLV3M333.js").then((m) => m.pull(args.slice(1)));
252
252
  break;
253
253
  case "destroy":
254
- await import("./resources-G4EVBRZV.js").then((m) => m.destroy(args.slice(1)));
254
+ await import("./resources-XLV3M333.js").then((m) => m.destroy(args.slice(1)));
255
255
  break;
256
256
  case "list":
257
- await import("./resources-G4EVBRZV.js").then((m) => m.list(args.slice(1)));
257
+ await import("./resources-XLV3M333.js").then((m) => m.list(args.slice(1)));
258
258
  break;
259
259
  case "show":
260
- await import("./resources-G4EVBRZV.js").then((m) => m.show(args.slice(1)));
260
+ await import("./resources-XLV3M333.js").then((m) => m.show(args.slice(1)));
261
261
  break;
262
262
  case "diff":
263
- await import("./resources-G4EVBRZV.js").then((m) => m.diff(args.slice(1)));
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-ANVS25HB.js").then((m) => m.dev(args.slice(1)));
267
+ await import("./dev-VESXDHC4.js").then((m) => m.dev(args.slice(1)));
268
268
  break;
269
269
  case "run":
270
- await import("./run-7KJPBOIY.js").then((m) => m.run(args.slice(1)));
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-KACYHD23.js").then((m) => m.init(args.slice(1)));
284
+ await import("./init-UOZJIP4S.js").then((m) => m.init(args.slice(1)));
285
285
  break;
286
286
  case "register":
287
- await import("./register-ZXNNU3NJ.js").then((m) => m.register(args.slice(1)));
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-SIZ77NYE.js").then((m) => m.deps(args.slice(1)));
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":
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  createApiClient,
14
14
  validateProjectNameLength
15
- } from "./chunk-ZJ7M7JD3.js";
15
+ } from "./chunk-M7CSPAM2.js";
16
16
  import {
17
17
  getToken,
18
18
  init_auth,
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  createApiClient,
9
9
  validateProjectExternalId
10
- } from "./chunk-ZJ7M7JD3.js";
10
+ } from "./chunk-M7CSPAM2.js";
11
11
  import {
12
12
  findProjectRoot,
13
13
  getAppName,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  deploy,
3
3
  deployAppAPI
4
- } from "./chunk-KE26WWAQ.js";
4
+ } from "./chunk-TYMHPKEA.js";
5
5
  import {
6
6
  syncDeps
7
- } from "./chunk-HS63O4MH.js";
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-ZJ7M7JD3.js";
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 lintAgentPolicyFiles(api, projectRoot, platformDir, appName, filterName) {
1069
- const result = await safeLintPass("agent policy", async () => {
1070
- const targets = buildAgentPolicyTargets(platformDir, filterName, appName);
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
- return runLint({ projectRoot, targets, api, appName });
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
- safePrintLint(result.issues, projectRoot);
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 policy lint error(s)`);
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 lintAgentPolicyFiles(api, projectRoot, platformDir, appName, name || void 0);
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 = await safeLint(projectRoot, localAutomations);
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 lintAgentPolicyFiles(api, projectRoot, platformDir, appName, name || void 0);
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,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2CR762KB.js";
4
4
  import {
5
5
  createApiClient
6
- } from "./chunk-ZJ7M7JD3.js";
6
+ } from "./chunk-M7CSPAM2.js";
7
7
  import {
8
8
  findProjectRoot,
9
9
  getApiUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.32.8",
3
+ "version": "0.32.9-dev.0",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {