@lumerahq/cli 0.32.9-dev.0 → 0.32.9-dev.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  userContextHeaders
3
- } from "./chunk-M7CSPAM2.js";
3
+ } from "./chunk-W57NUJFJ.js";
4
4
  import {
5
5
  fetchWithRetry
6
6
  } from "./chunk-FJFIWC7G.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  createApiClient,
6
6
  isApiErrorStatus
7
- } from "./chunk-M7CSPAM2.js";
7
+ } from "./chunk-W57NUJFJ.js";
8
8
  import {
9
9
  findProjectRoot,
10
10
  getAppName
@@ -285,7 +285,7 @@ var ApiClient = class {
285
285
  const result = await this.request("/api/models");
286
286
  return {
287
287
  models: result.models || [],
288
- deprecated_model_routes: result.deprecated_model_routes || {}
288
+ deprecated_models: result.deprecated_models || []
289
289
  };
290
290
  }
291
291
  async listAgents(opts) {
@@ -2,9 +2,9 @@ import {
2
2
  deps,
3
3
  syncDeps,
4
4
  syncResourceShareDeps
5
- } from "./chunk-7BEMZHHL.js";
5
+ } from "./chunk-5JNNUIVJ.js";
6
6
  import "./chunk-2CR762KB.js";
7
- import "./chunk-M7CSPAM2.js";
7
+ import "./chunk-W57NUJFJ.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-TYMHPKEA.js";
3
+ } from "./chunk-3MAALYAP.js";
4
4
  import {
5
5
  syncDeps
6
- } from "./chunk-7BEMZHHL.js";
6
+ } from "./chunk-5JNNUIVJ.js";
7
7
  import {
8
8
  loadEnv
9
9
  } from "./chunk-2CR762KB.js";
10
10
  import {
11
11
  createApiClient
12
- } from "./chunk-M7CSPAM2.js";
12
+ } from "./chunk-W57NUJFJ.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-XLV3M333.js").then((m) => m.plan(args.slice(1)));
245
+ await import("./resources-IIOCZU23.js").then((m) => m.plan(args.slice(1)));
246
246
  break;
247
247
  case "apply":
248
- await import("./resources-XLV3M333.js").then((m) => m.apply(args.slice(1)));
248
+ await import("./resources-IIOCZU23.js").then((m) => m.apply(args.slice(1)));
249
249
  break;
250
250
  case "pull":
251
- await import("./resources-XLV3M333.js").then((m) => m.pull(args.slice(1)));
251
+ await import("./resources-IIOCZU23.js").then((m) => m.pull(args.slice(1)));
252
252
  break;
253
253
  case "destroy":
254
- await import("./resources-XLV3M333.js").then((m) => m.destroy(args.slice(1)));
254
+ await import("./resources-IIOCZU23.js").then((m) => m.destroy(args.slice(1)));
255
255
  break;
256
256
  case "list":
257
- await import("./resources-XLV3M333.js").then((m) => m.list(args.slice(1)));
257
+ await import("./resources-IIOCZU23.js").then((m) => m.list(args.slice(1)));
258
258
  break;
259
259
  case "show":
260
- await import("./resources-XLV3M333.js").then((m) => m.show(args.slice(1)));
260
+ await import("./resources-IIOCZU23.js").then((m) => m.show(args.slice(1)));
261
261
  break;
262
262
  case "diff":
263
- await import("./resources-XLV3M333.js").then((m) => m.diff(args.slice(1)));
263
+ await import("./resources-IIOCZU23.js").then((m) => m.diff(args.slice(1)));
264
264
  break;
265
265
  // Development
266
266
  case "dev":
267
- await import("./dev-VESXDHC4.js").then((m) => m.dev(args.slice(1)));
267
+ await import("./dev-CGQTW7TN.js").then((m) => m.dev(args.slice(1)));
268
268
  break;
269
269
  case "run":
270
- await import("./run-EQOUWJZO.js").then((m) => m.run(args.slice(1)));
270
+ await import("./run-4XFA5ZDJ.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-UOZJIP4S.js").then((m) => m.init(args.slice(1)));
284
+ await import("./init-S42P4A5J.js").then((m) => m.init(args.slice(1)));
285
285
  break;
286
286
  case "register":
287
- await import("./register-M2W24E24.js").then((m) => m.register(args.slice(1)));
287
+ await import("./register-GMWA4D4C.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-L42NUTNQ.js").then((m) => m.deps(args.slice(1)));
304
+ await import("./deps-TNGT6JVD.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-M7CSPAM2.js";
15
+ } from "./chunk-W57NUJFJ.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-M7CSPAM2.js";
10
+ } from "./chunk-W57NUJFJ.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-TYMHPKEA.js";
4
+ } from "./chunk-3MAALYAP.js";
5
5
  import {
6
6
  syncDeps
7
- } from "./chunk-7BEMZHHL.js";
7
+ } from "./chunk-5JNNUIVJ.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-M7CSPAM2.js";
16
+ } from "./chunk-W57NUJFJ.js";
17
17
  import {
18
18
  findProjectRoot,
19
19
  getApiUrl,
@@ -1000,84 +1000,84 @@ function buildHookTargets(platformDir, filterName) {
1000
1000
  }
1001
1001
  return targets;
1002
1002
  }
1003
- function buildAgentConfigTargets(platformDir, filterName, appName) {
1003
+ function resolveAgentLintFiles(platformDir, filterName, appName) {
1004
1004
  const agentsDir = join(platformDir, "agents");
1005
1005
  if (!existsSync(agentsDir)) return [];
1006
- const targets = [];
1006
+ const agents = [];
1007
1007
  for (const entry of readdirSync(agentsDir, { withFileTypes: true })) {
1008
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");
1009
+ const directoryPath = join(agentsDir, entry.name);
1010
+ const configPath = join(directoryPath, "config.json");
1011
+ let configSource;
1012
1012
  let config;
1013
1013
  let externalID = appName ? `${appName}:${entry.name}` : "";
1014
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;
1015
+ let policyEnabled = false;
1016
+ if (existsSync(configPath)) {
1017
+ configSource = readFileSync(configPath, "utf-8");
1018
+ try {
1019
+ config = JSON.parse(configSource);
1020
+ if (typeof config === "object" && config !== null && !Array.isArray(config)) {
1021
+ const values = config;
1022
+ if (typeof values.external_id === "string" && values.external_id.trim()) {
1023
+ externalID = values.external_id;
1024
+ }
1025
+ if (typeof values.name === "string") {
1026
+ displayName = values.name;
1027
+ }
1028
+ policyEnabled = values.policy_enabled === true;
1024
1029
  }
1030
+ } catch {
1025
1031
  }
1026
- } catch {
1027
1032
  }
1028
1033
  if (filterName && entry.name !== filterName && externalID !== filterName && displayName !== filterName) {
1029
1034
  continue;
1030
1035
  }
1036
+ agents.push({
1037
+ directoryPath,
1038
+ configPath,
1039
+ configSource,
1040
+ config,
1041
+ name: externalID || displayName || entry.name,
1042
+ policyEnabled
1043
+ });
1044
+ }
1045
+ return agents;
1046
+ }
1047
+ function agentConfigTargets(agents) {
1048
+ const targets = [];
1049
+ for (const agent of agents) {
1050
+ if (agent.configSource === void 0) continue;
1031
1051
  targets.push({
1032
1052
  kind: "agent-config",
1033
- name: externalID || displayName || entry.name,
1034
- filePath: configPath,
1035
- source,
1036
- config
1053
+ name: agent.name,
1054
+ filePath: agent.configPath,
1055
+ source: agent.configSource,
1056
+ config: agent.config
1037
1057
  });
1038
1058
  }
1039
1059
  return targets;
1040
1060
  }
1041
- function buildAgentPolicyTargets(platformDir, filterName, appName) {
1042
- const agentsDir = join(platformDir, "agents");
1043
- if (!existsSync(agentsDir)) return [];
1061
+ function agentPolicyTargets(agents) {
1044
1062
  const targets = [];
1045
- for (const entry of readdirSync(agentsDir, { withFileTypes: true })) {
1046
- if (!entry.isDirectory()) continue;
1047
- const agentDir = join(agentsDir, entry.name);
1048
- const policyPath = join(agentDir, "policy.js");
1063
+ for (const agent of agents) {
1064
+ const policyPath = join(agent.directoryPath, "policy.js");
1049
1065
  const hasPolicyFile = existsSync(policyPath);
1050
- let externalID = appName ? `${appName}:${entry.name}` : "";
1051
- let displayName = "";
1052
- let policyEnabled = false;
1053
- const configPath = join(agentDir, "config.json");
1054
- if (existsSync(configPath)) {
1055
- try {
1056
- const config = JSON.parse(readFileSync(configPath, "utf-8"));
1057
- if (typeof config.external_id === "string" && config.external_id.trim()) {
1058
- externalID = config.external_id;
1059
- }
1060
- if (typeof config.name === "string") {
1061
- displayName = config.name;
1062
- }
1063
- policyEnabled = config.policy_enabled === true;
1064
- } catch {
1065
- }
1066
- }
1067
- if (!hasPolicyFile && !policyEnabled) continue;
1068
- if (filterName && entry.name !== filterName && externalID !== filterName && displayName !== filterName) {
1069
- continue;
1070
- }
1066
+ if (!hasPolicyFile && !agent.policyEnabled) continue;
1071
1067
  targets.push({
1072
1068
  kind: "agent-policy",
1073
- name: externalID || displayName || entry.name,
1069
+ name: agent.name,
1074
1070
  filePath: policyPath,
1075
1071
  source: hasPolicyFile ? readFileSync(policyPath, "utf-8") : "",
1076
- config: { policyEnabled }
1072
+ config: { policyEnabled: agent.policyEnabled }
1077
1073
  });
1078
1074
  }
1079
1075
  return targets;
1080
1076
  }
1077
+ function buildAgentTargets(platformDir, filterName, appName) {
1078
+ const agents = resolveAgentLintFiles(platformDir, filterName, appName);
1079
+ return [...agentConfigTargets(agents), ...agentPolicyTargets(agents)];
1080
+ }
1081
1081
 
1082
1082
  // src/commands/resources.ts
1083
1083
  init_auth();
@@ -1131,14 +1131,13 @@ async function lintHookFiles(api, projectRoot, platformDir, appName, filterName)
1131
1131
  }
1132
1132
  async function lintAgentFiles(api, projectRoot, platformDir, appName, filterName, printWarnings = true) {
1133
1133
  const result = await safeLintPass("agent", async () => {
1134
- const targets = [
1135
- ...buildAgentConfigTargets(platformDir, filterName, appName),
1136
- ...buildAgentPolicyTargets(platformDir, filterName, appName)
1137
- ];
1134
+ const targets = buildAgentTargets(platformDir, filterName, appName);
1138
1135
  if (targets.length === 0) return [];
1139
- let deprecatedModelRoutes = {};
1136
+ const deprecatedModelRoutes = {};
1140
1137
  try {
1141
- deprecatedModelRoutes = (await api.getModels()).deprecated_model_routes;
1138
+ for (const model of (await api.getModels()).deprecated_models) {
1139
+ deprecatedModelRoutes[model.id] = model.routed_to;
1140
+ }
1142
1141
  } catch (err) {
1143
1142
  if (process.env.LUMERA_DEBUG) {
1144
1143
  console.error("[lint] unable to load deprecated model routes:", err);
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2CR762KB.js";
4
4
  import {
5
5
  createApiClient
6
- } from "./chunk-M7CSPAM2.js";
6
+ } from "./chunk-W57NUJFJ.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.9-dev.0",
3
+ "version": "0.32.9-dev.1",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {