@ours.network/cli 0.5.0 → 1.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/dist/main.js CHANGED
@@ -4,20 +4,20 @@ import {
4
4
  writeResult
5
5
  } from "./chunk-YC7QBGVC.js";
6
6
  import {
7
- createLinuxUserSystemdAdapter
8
- } from "./chunk-227DBTDK.js";
7
+ createServiceAdapter
8
+ } from "./chunk-TNNBVUKK.js";
9
9
  import {
10
10
  instanceNameFromStateDir
11
- } from "./chunk-3RLAHOPS.js";
11
+ } from "./chunk-UZQWSOUB.js";
12
12
  import {
13
13
  setupConfig,
14
14
  showConfig
15
- } from "./chunk-G2GHHOYX.js";
15
+ } from "./chunk-DRQEV4SN.js";
16
16
  import {
17
17
  helpHint,
18
18
  helpRequestPath,
19
19
  renderHelp
20
- } from "./chunk-VGWQD7CJ.js";
20
+ } from "./chunk-ZFE47KH3.js";
21
21
  import {
22
22
  invokeOperation,
23
23
  isOperationName,
@@ -29,7 +29,6 @@ import {
29
29
  } from "./chunk-QRNZFPNJ.js";
30
30
  import {
31
31
  CliUsageError,
32
- parseBoolean,
33
32
  parseFlags,
34
33
  parseInteger
35
34
  } from "./chunk-6NFATG6P.js";
@@ -38,24 +37,24 @@ import {
38
37
  IDENTITY_PREBIND_EXCEPTIONS,
39
38
  commandSpec,
40
39
  isCommandGroup
41
- } from "./chunk-YSHMCQ2B.js";
40
+ } from "./chunk-SDNTPCKW.js";
42
41
  import {
43
42
  inspectDaemon,
44
43
  serveDaemon,
45
44
  startDaemonManaged,
46
45
  stopDaemonManaged
47
- } from "./chunk-4IFFMMQO.js";
46
+ } from "./chunk-QZIL3IT7.js";
48
47
  import {
49
48
  attachClient,
50
49
  defaultConfigPath,
51
50
  resolveSelection
52
- } from "./chunk-6W3RHW3C.js";
51
+ } from "./chunk-6K2JBKHI.js";
53
52
 
54
53
  // src/main.ts
55
54
  import { existsSync, readFileSync } from "node:fs";
56
55
  import { homedir } from "node:os";
57
56
  import { join, resolve } from "node:path";
58
- var CLI_VERSION = false ? "0.0.0-dev" : "0.5.0";
57
+ var CLI_VERSION = false ? "0.0.0-dev" : "1.0.0";
59
58
  var COMMON_VALUES = /* @__PURE__ */ new Set(["--endpoint", "--port", "--state-dir", "--config", "--identity"]);
60
59
  var COMMON_BOOLEANS = /* @__PURE__ */ new Set(["--json", "--yes", "--help"]);
61
60
  function selectionFrom(values) {
@@ -163,7 +162,7 @@ async function runGrouped(group, args, io) {
163
162
  return 0;
164
163
  }
165
164
  async function runConfig(args, io) {
166
- const values = /* @__PURE__ */ new Set([...COMMON_VALUES, "--broker-url", "--gc-interval-ms", "--auto-start", "--api-visibility"]);
165
+ const values = /* @__PURE__ */ new Set([...COMMON_VALUES, "--broker-url", "--gc-interval-ms", "--api-visibility"]);
167
166
  const flags = parseFlags(args, values, /* @__PURE__ */ new Set(["--json", "--dry-run", "--help"]));
168
167
  const action = flags.positionals[0];
169
168
  const spec = action === void 0 ? void 0 : commandSpec("config", action);
@@ -178,7 +177,6 @@ async function runConfig(args, io) {
178
177
  if (flags.values["--port"]) patch.port = parseInteger(flags.values["--port"], "--port", 1, 65535);
179
178
  if (flags.values["--state-dir"]) patch.stateDir = resolve(flags.values["--state-dir"]);
180
179
  if (flags.values["--gc-interval-ms"]) patch.gcIntervalMs = parseInteger(flags.values["--gc-interval-ms"], "--gc-interval-ms", 1);
181
- if (flags.values["--auto-start"]) patch.autoStart = parseBoolean(flags.values["--auto-start"], "--auto-start");
182
180
  if (flags.values["--api-visibility"]) {
183
181
  const visibility = flags.values["--api-visibility"];
184
182
  if (!["owner", "shared", "open"].includes(visibility)) throw new CliUsageError("--api-visibility must be owner, shared, or open");
@@ -227,7 +225,7 @@ async function runDaemon(args, io) {
227
225
  const derived = instanceNameFromStateDir(target.stateDir);
228
226
  if (!derived.ok) throw new CliUsageError(derived.reason ?? `cannot derive a service name from ${target.stateDir}`);
229
227
  assertPortAgrees(selection.port, target);
230
- const adapter = createLinuxUserSystemdAdapter();
228
+ const adapter = createServiceAdapter();
231
229
  const context = { cliPath: process.argv[1], configPath: target.unitConfigPath, stateDir: target.stateDir, dryRun, force: flags.booleans.has("--force") };
232
230
  const result = handler === "install-service" ? await adapter.install(context) : await adapter.uninstall(context);
233
231
  writeResult(io, result, json, handler);