@lumerahq/cli 0.30.3-dev.2 → 0.30.5
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-FLFEF2BN.js → chunk-LDDGLPAZ.js} +8 -1
- package/dist/{functions-55J6E2RF.js → functions-NE5PVRQU.js} +1 -1
- package/dist/index.js +9 -9
- package/dist/{project-6POVRBZL.js → project-M4PV6OBO.js} +5 -8
- package/dist/{resources-WUHGNK7K.js → resources-PHBQEMKZ.js} +18 -3
- package/package.json +1 -1
- package/templates/default/pyproject.toml +1 -1
|
@@ -3,8 +3,14 @@ import { spawn } from "child_process";
|
|
|
3
3
|
import { existsSync } from "fs";
|
|
4
4
|
import { join, resolve } from "path";
|
|
5
5
|
import pc from "picocolors";
|
|
6
|
+
|
|
7
|
+
// src/lib/functions-sdk.ts
|
|
8
|
+
var FUNCTIONS_SDK_VERSION_RANGE = ">=0.34.0,<0.35.0";
|
|
9
|
+
var FUNCTIONS_SDK_REQUIREMENT = `lumera[functions]${FUNCTIONS_SDK_VERSION_RANGE}`;
|
|
10
|
+
var RELEASE_SDK_REQUIREMENT = `lumera[release]${FUNCTIONS_SDK_VERSION_RANGE}`;
|
|
11
|
+
|
|
12
|
+
// src/commands/functions.ts
|
|
6
13
|
var SUPPORTED_SUBCOMMANDS = /* @__PURE__ */ new Set(["list", "inspect", "invoke", "test"]);
|
|
7
|
-
var FUNCTIONS_SDK_REQUIREMENT = "lumera[functions]>=0.33.0,<0.34.0";
|
|
8
14
|
var FUNCTIONS_RUNNER_PROTOCOL_VERSION = 1;
|
|
9
15
|
function errorMessage(error, fallback) {
|
|
10
16
|
return error instanceof Error && error.message ? error.message : fallback;
|
|
@@ -215,6 +221,7 @@ async function functions(subcommand, args, dependencies = {}) {
|
|
|
215
221
|
}
|
|
216
222
|
|
|
217
223
|
export {
|
|
224
|
+
RELEASE_SDK_REQUIREMENT,
|
|
218
225
|
emitFunctionCliFailure,
|
|
219
226
|
findFunctionsProjectRoot,
|
|
220
227
|
buildFunctionRunnerArgs,
|
package/dist/index.js
CHANGED
|
@@ -240,25 +240,25 @@ async function main() {
|
|
|
240
240
|
switch (command) {
|
|
241
241
|
// Resource commands
|
|
242
242
|
case "plan":
|
|
243
|
-
await import("./resources-
|
|
243
|
+
await import("./resources-PHBQEMKZ.js").then((m) => m.plan(args.slice(1)));
|
|
244
244
|
break;
|
|
245
245
|
case "apply":
|
|
246
|
-
await import("./resources-
|
|
246
|
+
await import("./resources-PHBQEMKZ.js").then((m) => m.apply(args.slice(1)));
|
|
247
247
|
break;
|
|
248
248
|
case "pull":
|
|
249
|
-
await import("./resources-
|
|
249
|
+
await import("./resources-PHBQEMKZ.js").then((m) => m.pull(args.slice(1)));
|
|
250
250
|
break;
|
|
251
251
|
case "destroy":
|
|
252
|
-
await import("./resources-
|
|
252
|
+
await import("./resources-PHBQEMKZ.js").then((m) => m.destroy(args.slice(1)));
|
|
253
253
|
break;
|
|
254
254
|
case "list":
|
|
255
|
-
await import("./resources-
|
|
255
|
+
await import("./resources-PHBQEMKZ.js").then((m) => m.list(args.slice(1)));
|
|
256
256
|
break;
|
|
257
257
|
case "show":
|
|
258
|
-
await import("./resources-
|
|
258
|
+
await import("./resources-PHBQEMKZ.js").then((m) => m.show(args.slice(1)));
|
|
259
259
|
break;
|
|
260
260
|
case "diff":
|
|
261
|
-
await import("./resources-
|
|
261
|
+
await import("./resources-PHBQEMKZ.js").then((m) => m.diff(args.slice(1)));
|
|
262
262
|
break;
|
|
263
263
|
// Development
|
|
264
264
|
case "dev":
|
|
@@ -268,12 +268,12 @@ async function main() {
|
|
|
268
268
|
await import("./run-EBTA3FKD.js").then((m) => m.run(args.slice(1)));
|
|
269
269
|
break;
|
|
270
270
|
case "functions":
|
|
271
|
-
await import("./functions-
|
|
271
|
+
await import("./functions-NE5PVRQU.js").then(
|
|
272
272
|
(m) => m.functions(subcommand, args.slice(2))
|
|
273
273
|
);
|
|
274
274
|
break;
|
|
275
275
|
case "project":
|
|
276
|
-
await import("./project-
|
|
276
|
+
await import("./project-M4PV6OBO.js").then(
|
|
277
277
|
(m) => m.project(subcommand, args.slice(2))
|
|
278
278
|
);
|
|
279
279
|
break;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
+
RELEASE_SDK_REQUIREMENT,
|
|
2
3
|
findFunctionsProjectRoot
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LDDGLPAZ.js";
|
|
4
5
|
import "./chunk-PNKVD2UK.js";
|
|
5
6
|
|
|
6
7
|
// src/commands/project.ts
|
|
7
8
|
import { spawn } from "child_process";
|
|
8
9
|
import pc from "picocolors";
|
|
9
|
-
var RELEASE_SDK_REQUIREMENT = "lumera[release]>=0.33.0,<0.34.0";
|
|
10
10
|
var RELEASE_PROTOCOL_VERSION = 1;
|
|
11
11
|
var RELEASE_COMMANDS = /* @__PURE__ */ new Set([
|
|
12
12
|
"build",
|
|
13
13
|
"inspect",
|
|
14
14
|
"contract-test",
|
|
15
15
|
"deploy",
|
|
16
|
-
"
|
|
17
|
-
"activate"
|
|
16
|
+
"deploy-runtime"
|
|
18
17
|
]);
|
|
19
18
|
function showHelp() {
|
|
20
19
|
console.log(`
|
|
@@ -23,13 +22,11 @@ ${pc.dim("Usage:")}
|
|
|
23
22
|
lumera project release inspect <archive> [--expected-digest <sha256>]
|
|
24
23
|
lumera project release contract-test <archive> [--mode api|worker|all]
|
|
25
24
|
lumera project release deploy <archive> --project <project-id>
|
|
26
|
-
lumera project release
|
|
27
|
-
lumera project release activate <deployment-id> --project <project-id> --expected-generation <n>
|
|
25
|
+
lumera project release deploy-runtime <release-id> --project <project-id>
|
|
28
26
|
|
|
29
27
|
${pc.dim("Description:")}
|
|
30
28
|
Build, verify, and contract-test immutable Python 3.13/Linux/ARM64 project
|
|
31
|
-
releases, upload an inactive resource,
|
|
32
|
-
it atomically with an expected generation.
|
|
29
|
+
releases, upload an inactive resource, and deploy it to the project's runtime.
|
|
33
30
|
`);
|
|
34
31
|
}
|
|
35
32
|
function buildReleaseRunnerArgs(command, args, projectRoot) {
|
|
@@ -78,11 +78,22 @@ var agentPolicyCompileRule = {
|
|
|
78
78
|
description: "Verifies agent policy scripts compile with the backend runtime compiler.",
|
|
79
79
|
appliesTo: ["agent-policy"],
|
|
80
80
|
async check(target, ctx) {
|
|
81
|
-
if (!target.source.trim()
|
|
81
|
+
if (!target.source.trim()) {
|
|
82
|
+
const policyEnabled = !!target.config && typeof target.config === "object" && target.config.policyEnabled === true;
|
|
83
|
+
if (!policyEnabled) return [];
|
|
84
|
+
return [{
|
|
85
|
+
ruleId: "agent-policy-compile",
|
|
86
|
+
target,
|
|
87
|
+
severity: "error",
|
|
88
|
+
message: "policy.js must not be empty when policy_enabled is true"
|
|
89
|
+
}];
|
|
90
|
+
}
|
|
91
|
+
if (!ctx.api) return [];
|
|
82
92
|
const script = ctx.appName ? target.source.replaceAll("{{app}}", ctx.appName) : target.source;
|
|
83
93
|
try {
|
|
84
94
|
await ctx.api.compileAgentPolicy(script);
|
|
85
95
|
} catch (err) {
|
|
96
|
+
if (err instanceof ApiError && err.status === 404) return [];
|
|
86
97
|
const diagnostics = err instanceof ApiError ? apiCompileDiagnostics(err) : [{ message: err instanceof Error ? err.message : String(err) }];
|
|
87
98
|
return diagnostics.map((diagnostic) => compileError(target, diagnostic));
|
|
88
99
|
}
|
|
@@ -950,9 +961,10 @@ function buildAgentPolicyTargets(platformDir, filterName, appName) {
|
|
|
950
961
|
if (!entry.isDirectory()) continue;
|
|
951
962
|
const agentDir = join(agentsDir, entry.name);
|
|
952
963
|
const policyPath = join(agentDir, "policy.js");
|
|
953
|
-
|
|
964
|
+
const hasPolicyFile = existsSync(policyPath);
|
|
954
965
|
let externalID = appName ? `${appName}:${entry.name}` : "";
|
|
955
966
|
let displayName = "";
|
|
967
|
+
let policyEnabled = false;
|
|
956
968
|
const configPath = join(agentDir, "config.json");
|
|
957
969
|
if (existsSync(configPath)) {
|
|
958
970
|
try {
|
|
@@ -963,9 +975,11 @@ function buildAgentPolicyTargets(platformDir, filterName, appName) {
|
|
|
963
975
|
if (typeof config.name === "string") {
|
|
964
976
|
displayName = config.name;
|
|
965
977
|
}
|
|
978
|
+
policyEnabled = config.policy_enabled === true;
|
|
966
979
|
} catch {
|
|
967
980
|
}
|
|
968
981
|
}
|
|
982
|
+
if (!hasPolicyFile && !policyEnabled) continue;
|
|
969
983
|
if (filterName && entry.name !== filterName && externalID !== filterName && displayName !== filterName) {
|
|
970
984
|
continue;
|
|
971
985
|
}
|
|
@@ -973,7 +987,8 @@ function buildAgentPolicyTargets(platformDir, filterName, appName) {
|
|
|
973
987
|
kind: "agent-policy",
|
|
974
988
|
name: externalID || displayName || entry.name,
|
|
975
989
|
filePath: policyPath,
|
|
976
|
-
source: readFileSync(policyPath, "utf-8")
|
|
990
|
+
source: hasPolicyFile ? readFileSync(policyPath, "utf-8") : "",
|
|
991
|
+
config: { policyEnabled }
|
|
977
992
|
});
|
|
978
993
|
}
|
|
979
994
|
return targets;
|
package/package.json
CHANGED