githolon 0.35.0 → 0.37.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +14 -4
  2. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -746,7 +746,14 @@ function setDeviceKey(principal, key) {
746
746
  saveCreds(c);
747
747
  }
748
748
  function principalHeaders(principal) {
749
- return /^[\w-]+\.[\w-]+\.[\w-]+$/.test(principal) ? { "x-nomos-auth": principal } : { "x-nomos-principal": principal };
749
+ if (!/^[\w-]+\.[\w-]+\.[\w-]+$/.test(principal)) return { "x-nomos-principal": principal };
750
+ const headers = { "x-nomos-auth": principal };
751
+ try {
752
+ const payload = JSON.parse(Buffer.from(principal.split(".")[1], "base64url").toString("utf8"));
753
+ if (typeof payload.sub === "string" && payload.sub) headers["x-nomos-principal"] = payload.sub;
754
+ } catch {
755
+ }
756
+ return headers;
750
757
  }
751
758
  function sessionFromGotrue(d) {
752
759
  if (typeof d.access_token !== "string" || typeof d.refresh_token !== "string") return void 0;
@@ -1562,7 +1569,10 @@ function author(eng, ws, domain, directiveId, payload, controllerHash, opts = {}
1562
1569
  queryId: need.queryId,
1563
1570
  paramsJson: JSON.stringify(need.args),
1564
1571
  attestorSecret: secret,
1565
- nowMs: opts.attestNowMs ?? Date.now()
1572
+ nowMs: opts.attestNowMs ?? Date.now(),
1573
+ // K3 (§1.5.3): colocated custody is in-memory — always ask for the carried enrollment
1574
+ // proof; the kernel produces-or-omits under its own bounds (the adapter decides nothing).
1575
+ includeRosterProof: true
1566
1576
  });
1567
1577
  if (!served || served.ok !== true) break;
1568
1578
  envelope.attestations = [...envelope.attestations ?? [], { queryId: need.queryId, result: served.rows, attestation: served.attestation }];
@@ -1688,11 +1698,11 @@ var init_engine = __esm({
1688
1698
  custodyLsRefs = (ledger, prefix = null) => lsRefs(ledger.remote, ledger.headers || {}, { service: "git-upload-pack", prefix });
1689
1699
  qById = (eng, ws, id, principal = "", keys = []) => JSON.parse(call(eng.ex, "query", { repoArg: repoArgOf(ws), workspace: ws, queryBytes: b64Json({ op: "byId", aggregateId: id }), principal, keys, branch: BRANCH }, eng.STDERR));
1690
1700
  query = (eng, ws, queryId, paramsJson, principal = "", keys = []) => JSON.parse(call(eng.ex, "query", { repoArg: repoArgOf(ws), workspace: ws, queryBytes: b64Json({ kind: "query", queryId, paramsJson }), principal, keys, branch: BRANCH }, eng.STDERR));
1691
- attestedRead = (eng, ws, { queryId, paramsJson, attestorSecret, nowMs }) => JSON.parse(call(eng.ex, "query", {
1701
+ attestedRead = (eng, ws, { queryId, paramsJson, attestorSecret, nowMs, includeRosterProof }) => JSON.parse(call(eng.ex, "query", {
1692
1702
  repoArg: repoArgOf(ws),
1693
1703
  workspace: ws,
1694
1704
  branch: BRANCH,
1695
- queryBytes: b64Json({ op: "attestedRead", queryId, paramsJson: paramsJson || "{}", attestorSecret, nowMs: nowMs ?? Date.now(), sourceWorkspace: ws })
1705
+ queryBytes: b64Json({ op: "attestedRead", queryId, paramsJson: paramsJson || "{}", attestorSecret, nowMs: nowMs ?? Date.now(), sourceWorkspace: ws, ...includeRosterProof ? { includeRosterProof: true } : {} })
1696
1706
  }, eng.STDERR));
1697
1707
  cryptoUnwrapKey = (eng, { secret, hpkeEpk, ct }) => JSON.parse(call(eng.ex, "query", { queryBytes: b64Json({ op: "cryptoUnwrapKey", secret, hpkeEpk, ct }) }, eng.STDERR)).scopeKey;
1698
1708
  count = (eng, ws, countId, groupKey, principal = "") => JSON.parse(call(eng.ex, "query", { repoArg: repoArgOf(ws), workspace: ws, queryBytes: b64Json({ op: "count", countId, groupKey }), principal, branch: BRANCH }, eng.STDERR));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githolon",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "type": "module",
5
5
  "description": "githolon — the Nomos developer CLI: Rails-style generators for @githolon/dsl domains + the package compiler. Kernel-independent.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@bjorn3/browser_wasi_shim": "0.4.2",
32
- "@githolon/client": "^0.35.0",
33
- "@githolon/dsl": "^0.35.0",
32
+ "@githolon/client": "^0.37.0",
33
+ "@githolon/dsl": "^0.37.0",
34
34
  "isomorphic-git": "^1.38.4"
35
35
  },
36
36
  "devDependencies": {