githolon 0.90.0 → 0.90.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +9 -4
  2. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -3144,7 +3144,7 @@ async function signAndPostOffer(ws, domain, directiveId, payload, opts) {
3144
3144
  }
3145
3145
  err2(`this cloud has no /v2/stage content-addressed lane \u2014 relaying the ${sealed.intentBytes.length}-char sealed offer inline (a 413 here means the worker needs upgrading to accept law this large signed)`);
3146
3146
  }
3147
- const verdict = await holon.postGovernanceOffer({ directiveId, intentBytes: sealed.intentBytes, ws });
3147
+ const verdict = await holon.postGovernanceOffer({ directiveId, intentBytes: sealed.intentBytes, ws, domain: resolvedDomain });
3148
3148
  return { ...verdict, principal };
3149
3149
  }
3150
3150
  async function relaySealedOfferViaStage(cloud, ws, directiveId, intentBytesB64, fetchImpl) {
@@ -3504,7 +3504,7 @@ async function governanceOffer(ws, directiveId, opts) {
3504
3504
  const domain = await discoverSigningDomain(holon, ws, directiveId, opts.domain);
3505
3505
  const device = await ensureDeviceKey(holon, principal);
3506
3506
  const sealed = await holon.signGovernanceOffer({ domain, directiveId, payload, authorSecret: device.secret, actor: canonicalPrincipal(principal) });
3507
- writeFileSync4(opts.save, JSON.stringify({ ws, directiveId, principal, intentBytes: sealed.intentBytes }, null, 2) + "\n");
3507
+ writeFileSync4(opts.save, JSON.stringify({ ws, domain, directiveId, principal, intentBytes: sealed.intentBytes }, null, 2) + "\n");
3508
3508
  } catch (e) {
3509
3509
  err2(e.message);
3510
3510
  return 1;
@@ -3536,15 +3536,16 @@ async function governanceRelay(ws, file, opts) {
3536
3536
  err2(`cannot read offer file ${file}: ${e.message}`);
3537
3537
  return 1;
3538
3538
  }
3539
- const { directiveId, intentBytes } = saved;
3539
+ const { directiveId, intentBytes, domain } = saved;
3540
3540
  if (typeof directiveId !== "string" || typeof intentBytes !== "string") {
3541
3541
  err2(`${file} is not a saved offer (expected { directiveId, intentBytes })`);
3542
3542
  return 1;
3543
3543
  }
3544
3544
  const cloud = cloudBase(opts.cloud);
3545
+ const route = typeof domain === "string" && domain.length > 0 ? `${encodeURIComponent(domain)}/${encodeURIComponent(directiveId)}` : encodeURIComponent(directiveId);
3545
3546
  let r;
3546
3547
  try {
3547
- r = await fetch(`${cloud}/v2/workspaces/${ws}/${directiveId}`, {
3548
+ r = await fetch(`${cloud}/v2/workspaces/${ws}/${route}`, {
3548
3549
  method: "POST",
3549
3550
  headers: { "content-type": "application/json" },
3550
3551
  body: JSON.stringify({ intentBytes })
@@ -3555,6 +3556,10 @@ async function governanceRelay(ws, file, opts) {
3555
3556
  }
3556
3557
  const text = await r.text();
3557
3558
  if (!r.ok) {
3559
+ if (r.status === 409 && domain === void 0) {
3560
+ err2(`${directiveId} is declared by more than one domain on ${ws} \u2014 re-run \`gov --save\` (it now records the signing domain), or the worker's candidates were: ${text}`);
3561
+ return 1;
3562
+ }
3558
3563
  err2(`${directiveId} refused (${r.status}): ${text}`);
3559
3564
  return 1;
3560
3565
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githolon",
3
- "version": "0.90.0",
3
+ "version": "0.90.1",
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.90.0",
33
- "@githolon/dsl": "^0.90.0",
32
+ "@githolon/client": "^0.90.1",
33
+ "@githolon/dsl": "^0.90.1",
34
34
  "isomorphic-git": "^1.38.4"
35
35
  },
36
36
  "devDependencies": {