@oxagen/cli 2.1.5-88 → 2.1.5-97

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.
Files changed (2) hide show
  1. package/oxagen.mjs +37 -8
  2. 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-88";
26725
+ if (true) return "2.1.5-97";
26726
26726
  try {
26727
26727
  const here = dirname9(fileURLToPath(import.meta.url));
26728
26728
  const pkg = JSON.parse(
@@ -50886,6 +50886,13 @@ function asJson(value) {
50886
50886
  function argumentsHashOf(args) {
50887
50887
  return digestJcs(asJson(args));
50888
50888
  }
50889
+ function launchDigestOf(launch) {
50890
+ return digestJcs({
50891
+ command: launch.command,
50892
+ args: [...launch.args],
50893
+ env: [...launch.env]
50894
+ });
50895
+ }
50889
50896
  function envelopeSigningBytes(envelope2) {
50890
50897
  const { signature: _signature, ...signed } = envelope2;
50891
50898
  return new TextEncoder().encode(jcs(asJson(signed)));
@@ -50926,6 +50933,7 @@ var init_wire2 = __esm({
50926
50933
  definition_hash: sha256Schema,
50927
50934
  package_digest: sha256Schema,
50928
50935
  arguments_hash: sha256Schema,
50936
+ launch_digest: sha256Schema,
50929
50937
  deadline_ms: external_exports.number().int().min(1).max(3e5).optional(),
50930
50938
  machine: machineIdSchema,
50931
50939
  nonce: nonceSchema,
@@ -51448,6 +51456,14 @@ function verifyCallDelivery(delivery, options) {
51448
51456
  )
51449
51457
  );
51450
51458
  }
51459
+ const launchDigest = launchDigestOf(delivery.launch);
51460
+ if (launchDigest !== envelope2.launch_digest) {
51461
+ return refuse2(
51462
+ launchMismatch(
51463
+ `the launch's command, args, and env names hash to ${launchDigest}, and the envelope signs ${envelope2.launch_digest}`
51464
+ )
51465
+ );
51466
+ }
51451
51467
  if (argumentsHashOf(delivery.arguments) !== envelope2.arguments_hash) {
51452
51468
  return refuse2(argumentsMismatch());
51453
51469
  }
@@ -63510,7 +63526,7 @@ var init_package = __esm({
63510
63526
  "package.json"() {
63511
63527
  package_default = {
63512
63528
  name: "@oxagen/cli",
63513
- version: "2.1.5-88",
63529
+ version: "2.1.5-97",
63514
63530
  description: "Oxagen governance CLI \u2014 spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
63515
63531
  type: "module",
63516
63532
  main: "./dist/index.js",
@@ -92732,6 +92748,9 @@ var init_local_call_envelope = __esm({
92732
92748
  arguments_hash: sha256Schema2.describe(
92733
92749
  "SHA-256 over the RFC 8785 form of the upstream arguments, after the input was shaped."
92734
92750
  ),
92751
+ launch_digest: sha256Schema2.describe(
92752
+ "SHA-256 over the RFC 8785 form of the launch's command, args with each ${NAME} unfilled, and env names. The local gateway refuses a launch that does not match."
92753
+ ),
92735
92754
  deadline_ms: envelopeDeadlineSchema.describe(
92736
92755
  `How long the local gateway lets the call run before it stops it. ${DEFAULT_DEADLINE_MS2} when omitted.`
92737
92756
  ),
@@ -134158,6 +134177,18 @@ async function treeFacts(tree, deps) {
134158
134177
  const tools = deps.tools ? await deps.tools(tree) : await compiledTools(tree, deps.compiler ?? compileServerFolder);
134159
134178
  return { cedar, workspace, agents: treeAgents(tree), tools };
134160
134179
  }
134180
+ function noCedarHooks(trees) {
134181
+ const read2 = new Set(trees);
134182
+ const none = (tree) => {
134183
+ if (!read2.has(tree)) throw new Error(UNREAD_TREE);
134184
+ return [];
134185
+ };
134186
+ return {
134187
+ parse: () => [],
134188
+ validate: (_policies, _schema, tree) => none(tree),
134189
+ test: (_policies, _schema, _tests, tree) => none(tree)
134190
+ };
134191
+ }
134161
134192
  function files(texts) {
134162
134193
  return [...texts].map(([path2, text5]) => ({ path: path2, text: text5 }));
134163
134194
  }
@@ -134165,6 +134196,7 @@ function cedarIssue(issue) {
134165
134196
  return { path: issue.path, line: issue.line, message: issue.message };
134166
134197
  }
134167
134198
  async function steeringCedarHooks(trees, deps = {}) {
134199
+ if (!trees.some(hasCedarFiles)) return noCedarHooks(trees);
134168
134200
  const runtime = await (deps.cedar ?? loadCedarRuntime)();
134169
134201
  if (runtime === null) {
134170
134202
  const refuse4 = () => {
@@ -134177,11 +134209,7 @@ async function steeringCedarHooks(trees, deps = {}) {
134177
134209
  const now = deps.now ?? Date.now;
134178
134210
  const factsOf = (tree) => {
134179
134211
  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
- }
134212
+ if (found === void 0) throw new Error(UNREAD_TREE);
134185
134213
  return found;
134186
134214
  };
134187
134215
  return {
@@ -134232,7 +134260,7 @@ function cedarPolicyGate(deps = {}) {
134232
134260
  });
134233
134261
  };
134234
134262
  }
134235
- var CHECK_WORKSPACE, NO_EVALUATOR;
134263
+ var CHECK_WORKSPACE, NO_EVALUATOR, UNREAD_TREE;
134236
134264
  var init_cedar_hooks = __esm({
134237
134265
  "../../packages/steering-bundle/src/cedar-hooks.ts"() {
134238
134266
  "use strict";
@@ -134244,6 +134272,7 @@ var init_cedar_hooks = __esm({
134244
134272
  init_tree();
134245
134273
  CHECK_WORKSPACE = "steering-check";
134246
134274
  NO_EVALUATOR = "Cedar's evaluator did not load, so Oxagen could not check the Cedar policies";
134275
+ UNREAD_TREE = "The Cedar hooks were called for a tree they did not read. Pass every tree the checks run on to steeringCedarHooks.";
134247
134276
  }
134248
134277
  });
134249
134278
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxagen/cli",
3
- "version": "2.1.5-88",
3
+ "version": "2.1.5-97",
4
4
  "description": "Oxagen governance CLI — spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
5
5
  "type": "module",
6
6
  "bin": {