@rogatio/cli 4.0.0 → 5.0.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
@@ -39,7 +39,7 @@ rogatio <command> [options]
39
39
  | `rogatio edit [path]` | Launch the browser editor for `.rogatio.json`. |
40
40
  | `rogatio verify [path]` | Validate a `.rogatio.json` file (schema + compiler). |
41
41
  | `rogatio test [path] [url...]` | Run offline dry-run tests against `.rogatio.json`. |
42
- | `rogatio runtime <install\|untrust\|uninstall>` | Register the native-messaging host (and, on capable platforms, the device-local CA) in one transactional install; `untrust` removes CA trust; `uninstall` removes the host. |
42
+ | `rogatio runtime <install\|uninstall>` | Register the native-messaging host (and, on capable platforms, the device-local CA) in one transactional install; `uninstall` removes the host manifest, the device-local CA files, and the CA trust installation (idempotent). |
43
43
  | `rogatio runtime host <path>` | Run the consolidated native-messaging host for the project (mock/pair/authorize over stdio). Normally launched by the browser; run manually only for debugging. |
44
44
 
45
45
  Global options: `--help, -h` and `--version, -v`. Run `rogatio <command> --help`
@@ -4361,14 +4361,25 @@ function createRequestBodyTrustController(options = {}) {
4361
4361
  installerCalled = true;
4362
4362
  }
4363
4363
  }
4364
+ async function removeCa() {
4365
+ const caWasPresent = await existsFile(caKeyFile);
4366
+ await rm(caKeyFile, { force: true });
4367
+ await rm(caPubFile, { force: true });
4368
+ await rm(caCertFile, { force: true });
4369
+ if (caWasPresent && caTrustRemover) {
4370
+ await caTrustRemover();
4371
+ }
4372
+ }
4364
4373
  async function uninstall() {
4365
4374
  try {
4366
4375
  await rm(manifestPath(), { force: true });
4376
+ await removeCa();
4377
+ installerCalled = false;
4367
4378
  } catch (error) {
4368
4379
  return {
4369
4380
  ok: false,
4370
4381
  state: "unsupported",
4371
- reasons: [codeOf(error, "trust.write-failed")]
4382
+ reasons: [error instanceof Error ? error.message : String(error)]
4372
4383
  };
4373
4384
  }
4374
4385
  return { ok: true, state: "uninstalled" };
@@ -4385,24 +4396,6 @@ function createRequestBodyTrustController(options = {}) {
4385
4396
  }
4386
4397
  return { ok: true, state: "trusted" };
4387
4398
  }
4388
- async function untrust() {
4389
- try {
4390
- if (await existsFile(caKeyFile) && caTrustRemover) {
4391
- await caTrustRemover();
4392
- }
4393
- await rm(caKeyFile, { force: true });
4394
- await rm(caPubFile, { force: true });
4395
- await rm(caCertFile, { force: true });
4396
- installerCalled = false;
4397
- } catch (error) {
4398
- return {
4399
- ok: false,
4400
- state: "unsupported",
4401
- reasons: [codeOf(error, "trust.internal")]
4402
- };
4403
- }
4404
- return { ok: true, state: "untrusted" };
4405
- }
4406
4399
  async function status() {
4407
4400
  let installed = false;
4408
4401
  try {
@@ -4420,7 +4413,7 @@ function createRequestBodyTrustController(options = {}) {
4420
4413
  capabilityReasons: caps.reasons
4421
4414
  };
4422
4415
  }
4423
- return { install, uninstall, untrust, status };
4416
+ return { install, uninstall, status };
4424
4417
  }
4425
4418
 
4426
4419
  // packages/cli/src/commands/runtime.ts
@@ -4435,8 +4428,7 @@ consolidated native-messaging host (spec REQ-001..REQ-005).
4435
4428
  Request-body trust commands:
4436
4429
  install Install the native-messaging host manifest and (on capable
4437
4430
  platforms) provision the device-local CA (requires --extension-id)
4438
- untrust Remove the device-local CA trust (idempotent)
4439
- uninstall Uninstall the native-messaging host manifest (idempotent)
4431
+ uninstall Remove the native-messaging host manifest and the device-local CA trust (idempotent)
4440
4432
 
4441
4433
  Native host command:
4442
4434
  host [path] Run the consolidated native-messaging runtime host. The browser
@@ -4522,7 +4514,7 @@ function reportTrust(subcommand, result, okMessage) {
4522
4514
  return 0;
4523
4515
  }
4524
4516
  console.error(
4525
- `trust ${subcommand} failed: ${(result.reasons ?? ["unknown"]).join(", ")}`
4517
+ `runtime ${subcommand} failed: ${(result.reasons ?? ["unknown"]).join(", ")}`
4526
4518
  );
4527
4519
  return 1;
4528
4520
  }
@@ -4552,17 +4544,11 @@ async function trustRuntimeCommand(args) {
4552
4544
  await controller.install(extensionId ?? ""),
4553
4545
  "runtime install complete: manifest + device-local CA trusted"
4554
4546
  );
4555
- case "untrust":
4556
- return reportTrust(
4557
- "untrust",
4558
- await controller.untrust(),
4559
- "trust removed"
4560
- );
4561
4547
  case "uninstall":
4562
4548
  return reportTrust(
4563
4549
  "uninstall",
4564
4550
  await controller.uninstall(),
4565
- "trust manifest uninstalled"
4551
+ "runtime uninstall complete: manifest + device-local CA removed"
4566
4552
  );
4567
4553
  default:
4568
4554
  console.error(`Error: unknown runtime subcommand: ${subcommand ?? ""}`);
@@ -4669,11 +4655,11 @@ async function runtimeCommand(args, _options = {}) {
4669
4655
  return 0;
4670
4656
  }
4671
4657
  const first = args[0];
4672
- if (first === "install" || first === "trust" || first === "untrust" || first === "uninstall")
4658
+ if (first === "install" || first === "trust" || first === "uninstall")
4673
4659
  return trustRuntimeCommand(args);
4674
4660
  if (first === "host") return runtimeHostCommand(args.slice(1));
4675
4661
  console.error(
4676
- `Error: 'rogatio runtime' no longer starts or stops the runtime. Use 'rogatio runtime install|untrust|uninstall' to manage the host manifest and request-body trust, or 'rogatio runtime host [path]' to run the native-messaging host. Start/stop is driven from the extension's controls.`
4662
+ `Error: 'rogatio runtime' no longer starts or stops the runtime. Use 'rogatio runtime install|uninstall' to manage the host manifest and request-body trust, or 'rogatio runtime host [path]' to run the native-messaging host. Start/stop is driven from the extension's controls.`
4677
4663
  );
4678
4664
  showRuntimeHelp();
4679
4665
  return 2;
@@ -5199,7 +5185,7 @@ Commands:
5199
5185
  edit [path] Launch browser editor for .rogatio.json
5200
5186
  test [path] [url...] Run offline dry-run tests against .rogatio.json
5201
5187
  verify [path] Validate .rogatio.json file
5202
- runtime <install|untrust|uninstall|host> Native messaging runtime control and request-body trust management
5188
+ runtime <install|uninstall|host> Native messaging runtime control and request-body trust management
5203
5189
  runtime host [path] Run the consolidated native-messaging runtime host
5204
5190
 
5205
5191
  Global Options:
@@ -5253,8 +5239,7 @@ consolidated native-messaging host (spec REQ-001..REQ-005).
5253
5239
  Request-body trust commands:
5254
5240
  install Install the native-messaging host manifest and (on capable
5255
5241
  platforms) provision the device-local CA (requires --extension-id)
5256
- untrust Remove the device-local CA trust (idempotent)
5257
- uninstall Uninstall the native-messaging host manifest (idempotent)
5242
+ uninstall Remove the native-messaging host manifest and the device-local CA trust (idempotent)
5258
5243
 
5259
5244
  Native host command:
5260
5245
  host [path] Run the consolidated native-messaging runtime host. The browser
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogatio/cli",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Local-first browser request and response rules — editor host, file verification, test runner, and runtime dispatch.",