@oxagen/cli 2.1.5-88 → 2.1.5-91
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/oxagen.mjs +18 -8
- package/package.json +1 -1
package/oxagen.mjs
CHANGED
|
@@ -26722,7 +26722,7 @@ import { readFileSync as readFileSync10 } from "node:fs";
|
|
|
26722
26722
|
import { dirname as dirname9, resolve as resolve3 } from "node:path";
|
|
26723
26723
|
import { fileURLToPath } from "node:url";
|
|
26724
26724
|
function readVersion() {
|
|
26725
|
-
if (true) return "2.1.5-
|
|
26725
|
+
if (true) return "2.1.5-91";
|
|
26726
26726
|
try {
|
|
26727
26727
|
const here = dirname9(fileURLToPath(import.meta.url));
|
|
26728
26728
|
const pkg = JSON.parse(
|
|
@@ -63510,7 +63510,7 @@ var init_package = __esm({
|
|
|
63510
63510
|
"package.json"() {
|
|
63511
63511
|
package_default = {
|
|
63512
63512
|
name: "@oxagen/cli",
|
|
63513
|
-
version: "2.1.5-
|
|
63513
|
+
version: "2.1.5-91",
|
|
63514
63514
|
description: "Oxagen governance CLI \u2014 spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
|
|
63515
63515
|
type: "module",
|
|
63516
63516
|
main: "./dist/index.js",
|
|
@@ -134158,6 +134158,18 @@ async function treeFacts(tree, deps) {
|
|
|
134158
134158
|
const tools = deps.tools ? await deps.tools(tree) : await compiledTools(tree, deps.compiler ?? compileServerFolder);
|
|
134159
134159
|
return { cedar, workspace, agents: treeAgents(tree), tools };
|
|
134160
134160
|
}
|
|
134161
|
+
function noCedarHooks(trees) {
|
|
134162
|
+
const read2 = new Set(trees);
|
|
134163
|
+
const none = (tree) => {
|
|
134164
|
+
if (!read2.has(tree)) throw new Error(UNREAD_TREE);
|
|
134165
|
+
return [];
|
|
134166
|
+
};
|
|
134167
|
+
return {
|
|
134168
|
+
parse: () => [],
|
|
134169
|
+
validate: (_policies, _schema, tree) => none(tree),
|
|
134170
|
+
test: (_policies, _schema, _tests, tree) => none(tree)
|
|
134171
|
+
};
|
|
134172
|
+
}
|
|
134161
134173
|
function files(texts) {
|
|
134162
134174
|
return [...texts].map(([path2, text5]) => ({ path: path2, text: text5 }));
|
|
134163
134175
|
}
|
|
@@ -134165,6 +134177,7 @@ function cedarIssue(issue) {
|
|
|
134165
134177
|
return { path: issue.path, line: issue.line, message: issue.message };
|
|
134166
134178
|
}
|
|
134167
134179
|
async function steeringCedarHooks(trees, deps = {}) {
|
|
134180
|
+
if (!trees.some(hasCedarFiles)) return noCedarHooks(trees);
|
|
134168
134181
|
const runtime = await (deps.cedar ?? loadCedarRuntime)();
|
|
134169
134182
|
if (runtime === null) {
|
|
134170
134183
|
const refuse4 = () => {
|
|
@@ -134177,11 +134190,7 @@ async function steeringCedarHooks(trees, deps = {}) {
|
|
|
134177
134190
|
const now = deps.now ?? Date.now;
|
|
134178
134191
|
const factsOf = (tree) => {
|
|
134179
134192
|
const found = facts.get(tree);
|
|
134180
|
-
if (found === void 0)
|
|
134181
|
-
throw new Error(
|
|
134182
|
-
"The Cedar hooks were called for a tree they did not read. Pass every tree the checks run on to steeringCedarHooks."
|
|
134183
|
-
);
|
|
134184
|
-
}
|
|
134193
|
+
if (found === void 0) throw new Error(UNREAD_TREE);
|
|
134185
134194
|
return found;
|
|
134186
134195
|
};
|
|
134187
134196
|
return {
|
|
@@ -134232,7 +134241,7 @@ function cedarPolicyGate(deps = {}) {
|
|
|
134232
134241
|
});
|
|
134233
134242
|
};
|
|
134234
134243
|
}
|
|
134235
|
-
var CHECK_WORKSPACE, NO_EVALUATOR;
|
|
134244
|
+
var CHECK_WORKSPACE, NO_EVALUATOR, UNREAD_TREE;
|
|
134236
134245
|
var init_cedar_hooks = __esm({
|
|
134237
134246
|
"../../packages/steering-bundle/src/cedar-hooks.ts"() {
|
|
134238
134247
|
"use strict";
|
|
@@ -134244,6 +134253,7 @@ var init_cedar_hooks = __esm({
|
|
|
134244
134253
|
init_tree();
|
|
134245
134254
|
CHECK_WORKSPACE = "steering-check";
|
|
134246
134255
|
NO_EVALUATOR = "Cedar's evaluator did not load, so Oxagen could not check the Cedar policies";
|
|
134256
|
+
UNREAD_TREE = "The Cedar hooks were called for a tree they did not read. Pass every tree the checks run on to steeringCedarHooks.";
|
|
134247
134257
|
}
|
|
134248
134258
|
});
|
|
134249
134259
|
|
package/package.json
CHANGED