@nettee/beacon 0.3.5 → 0.3.6

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
@@ -36,7 +36,7 @@ deployment names its configuration explicitly:
36
36
 
37
37
  ```sh
38
38
  beacon doctor
39
- beacon serve --config /Users/USERNAME/.beacon/config.yaml
39
+ beacon serve
40
40
  ```
41
41
 
42
42
  `doctor` validates every Profile and credential, obtains a Feishu tenant token, and runs a real Pi RPC smoke test. It does not create Beacon state records.
@@ -319,17 +319,19 @@ same host. Expose only the event endpoint, not Beacon's unauthenticated Dashboar
319
319
  ## Commands
320
320
 
321
321
  ```text
322
- beacon serve --config <absolute-path>
322
+ beacon serve [--config <absolute-path>]
323
323
  beacon doctor [--config <absolute-path>]
324
324
  beacon trigger [--config <absolute-path>] --profile <id> --input -
325
325
  beacon schedule trigger [--config <absolute-path>] --profile <id> --schedule <id>
326
326
  beacon version
327
327
  ```
328
328
 
329
- Operator commands use `~/.beacon/config.yaml` when `--config` is omitted.
330
- An explicit override must still be an absolute path. `serve` keeps requiring an
331
- explicit absolute config path so service definitions identify their deployment
332
- configuration unambiguously.
329
+ `serve`, `doctor`, `trigger`, and `schedule trigger` use `~/.beacon/config.yaml`
330
+ in the current running user's home directory when `--config` is omitted,
331
+ regardless of the working directory. An explicit override must be an absolute
332
+ path, for example `beacon serve --config /opt/beacon/config.yaml`.
333
+ Missing or invalid configuration and required dependency failures are reported
334
+ as errors with a nonzero exit status; Beacon does not fall back to another config.
333
335
 
334
336
  An operator can run one Profile without Feishu delivery by piping input to `trigger`; the Final Outcome is printed to stdout:
335
337
 
@@ -448,7 +450,7 @@ Secrets and ephemeral Run Capability tokens are excluded from persisted records
448
450
 
449
451
  ## launchd
450
452
 
451
- Edit [`deploy/io.nettee.beacon.plist.example`](deploy/io.nettee.beacon.plist.example) so every executable, config, working-directory, and log path is absolute. Create the log directory, copy the plist to `~/Library/LaunchAgents/io.nettee.beacon.plist`, then validate and load it:
453
+ Edit [`deploy/io.nettee.beacon.plist.example`](deploy/io.nettee.beacon.plist.example) so every executable, working-directory, and log path is absolute. The example runs `beacon serve` and loads the running user's `~/.beacon/config.yaml`; add `--config` and an absolute path to `ProgramArguments` to override it. Create the log directory, copy the plist to `~/Library/LaunchAgents/io.nettee.beacon.plist`, then validate and load it:
452
454
 
453
455
  Use `command -v beacon` after the global npm installation to find the absolute
454
456
  CLI path for `ProgramArguments`. A Node version-manager upgrade can change that
@@ -8,8 +8,6 @@
8
8
  <array>
9
9
  <string>/usr/local/bin/beacon</string>
10
10
  <string>serve</string>
11
- <string>--config</string>
12
- <string>/Users/USERNAME/.beacon/config.yaml</string>
13
11
  </array>
14
12
  <key>WorkingDirectory</key>
15
13
  <string>/Users/USERNAME/.beacon</string>
package/dist/cli-app.js CHANGED
@@ -3,18 +3,14 @@ import { isAbsolute, join } from "node:path";
3
3
  export const defaultConfigPath = join(homedir(), ".beacon", "config.yaml");
4
4
  function usage() {
5
5
  throw new Error(`Usage:
6
- beacon serve --config <absolute-path>
6
+ beacon serve [--config <absolute-path>]
7
7
  beacon doctor [--config <absolute-path>]
8
8
  beacon trigger [--config <absolute-path>] --profile <id> --input -
9
9
  beacon schedule trigger [--config <absolute-path>] --profile <id> --schedule <id>
10
- beacon version`);
11
- }
12
- function requiredConfig(args) {
13
- if (args.length !== 2 || args[0] !== "--config" || !args[1])
14
- usage();
15
- if (!isAbsolute(args[1]))
16
- throw new Error("Config path must be absolute");
17
- return args[1];
10
+ beacon version
11
+
12
+ Config defaults to ~/.beacon/config.yaml in the current user's home directory.
13
+ An explicit --config path must be absolute.`);
18
14
  }
19
15
  function options(args) {
20
16
  if (args.length % 2 !== 0)
@@ -42,10 +38,7 @@ export function parseCli(args) {
42
38
  usage();
43
39
  return { command: "version" };
44
40
  }
45
- if (command === "serve") {
46
- return { command, config: requiredConfig(rest) };
47
- }
48
- if (command === "doctor") {
41
+ if (command === "serve" || command === "doctor") {
49
42
  const values = options(rest);
50
43
  if ([...values.keys()].some((key) => key !== "--config"))
51
44
  usage();