@scopebond/hook 0.13.0 → 0.15.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.
package/README.md CHANGED
@@ -208,7 +208,7 @@ In Windows PowerShell, use `npx.cmd` instead of `npx` if script execution policy
208
208
  last problem. Records are never dropped from the queue while they wait: a long outage only makes
209
209
  the queue longer. If the workspace refuses this computer's connection (it was revoked, replaced or
210
210
  removed), `status` says **NOT DELIVERING** with the time it stopped and the one command that fixes
211
- it, which is signing in again. `doctor` also checks that the workspace still accepts the connection,
211
+ it, which is signing in again. `status --json` prints the same in one machine-readable shape (`scopebond.status.v1`) for tools and support. `doctor` also checks that the workspace still accepts the connection,
212
212
  not only that it is reachable, and fails when it does not.
213
213
 
214
214
  The connection renews itself: in the last 30 days of its 90-day credential the hook renews it during its rules check, proving it still holds the key it enrolled with. With each rules check it also tells the workspace how many records wait to send (counts and one error line, never a record), so the portal can show a computer that checks in but is not delivering.
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAmqBA,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,GAAG,IAAI,CAS7F"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAoqBA,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,GAAG,IAAI,CAS7F"}
package/dist/cli.js CHANGED
@@ -54,6 +54,7 @@ import { ensureDurableRuntime, pinnedCliPath, isEphemeralPath } from "./runtime-
54
54
  import { cliCommand, hookCommand, hookVersion } from "./version.js";
55
55
  import { recordRulesCredential } from "./delivery-state.js";
56
56
  import { describeDelivery } from "./delivery-report.js";
57
+ import { buildStatusJson } from "./status-json.js";
57
58
  import { computeManifest, renderManifest } from "./capabilities.js";
58
59
  import { runProofFixtures, loadProofs, saveProofs, proofPassed, deliverProofReceipts } from "./proof.js";
59
60
  import { fileURLToPath } from "node:url";
@@ -1383,7 +1384,18 @@ function describeStore(dbPath) {
1383
1384
  }
1384
1385
  return count === null ? human : `${count} receipt(s), ${human}`;
1385
1386
  }
1386
- function runStatus() {
1387
+ function runStatus(args = []) {
1388
+ if (args.includes("--json")) {
1389
+ const cwd = process.cwd();
1390
+ const active = resolveConfigDir(cwd);
1391
+ const configured = (h) => !!harnessScopeLabel(harnessScopes(h, cwd));
1392
+ console.log(JSON.stringify(buildStatusJson({
1393
+ version: hookVersion(), activeDir: active, candidateDirs: [userHome(), join(cwd, ".scopebond")],
1394
+ hasPolicy: existsSync(join(active, "policy.json")),
1395
+ agents: { claude: configured("claude"), cursor: configured("cursor"), codex: configured("codex") },
1396
+ }), null, 2));
1397
+ return;
1398
+ }
1387
1399
  const home = userHome();
1388
1400
  const installed = existsSync(join(home, "policy.json"));
1389
1401
  // Both scopes, always: `init` writes the project config and `install` writes the
@@ -1942,7 +1954,7 @@ else if (cmd === "recover") {
1942
1954
  await runRecover(rest);
1943
1955
  }
1944
1956
  else if (cmd === "status") {
1945
- runStatus();
1957
+ runStatus(rest);
1946
1958
  }
1947
1959
  else if (cmd === "doctor") {
1948
1960
  await runDoctor();