@botcord/daemon 0.2.34 → 0.2.36

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/config.d.ts CHANGED
@@ -81,7 +81,7 @@ export interface OpenclawDiscoveryConfig {
81
81
  searchPaths?: string[];
82
82
  /** Overrides the local loopback ports to probe. */
83
83
  defaultPorts?: number[];
84
- /** Defaults to true. When false, discovery only persists gateways. */
84
+ /** Defaults to false. When false, discovery only persists gateways. */
85
85
  autoProvision?: boolean;
86
86
  }
87
87
  export interface DaemonConfig {
@@ -485,5 +485,5 @@ export function openclawDiscoveryConfigEnabled(cfg) {
485
485
  return cfg.openclawDiscovery?.enabled !== false;
486
486
  }
487
487
  export function openclawAutoProvisionEnabled(cfg) {
488
- return cfg.openclawDiscovery?.autoProvision !== false;
488
+ return cfg.openclawDiscovery?.autoProvision === true;
489
489
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botcord/daemon",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "description": "BotCord local daemon — bridges Hub inbox push to local Claude Code / Codex / Gemini CLIs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,6 +8,8 @@ import {
8
8
  defaultOpenclawDiscoveryTokenFilePaths,
9
9
  discoverLocalOpenclawGateways,
10
10
  mergeOpenclawGateways,
11
+ openclawAutoProvisionEnabled,
12
+ openclawDiscoveryConfigEnabled,
11
13
  } from "../openclaw-discovery.js";
12
14
  import type { DaemonConfig } from "../config.js";
13
15
  import type { WsEndpointProbeFn } from "../provision.js";
@@ -32,6 +34,40 @@ function baseConfig(): DaemonConfig {
32
34
  };
33
35
  }
34
36
 
37
+ describe("openclaw discovery config flags", () => {
38
+ it("keeps gateway discovery enabled by default", () => {
39
+ expect(openclawDiscoveryConfigEnabled(baseConfig())).toBe(true);
40
+ expect(
41
+ openclawDiscoveryConfigEnabled({
42
+ ...baseConfig(),
43
+ openclawDiscovery: { enabled: false },
44
+ }),
45
+ ).toBe(false);
46
+ });
47
+
48
+ it("requires explicit opt-in for OpenClaw auto-provision", () => {
49
+ expect(openclawAutoProvisionEnabled(baseConfig())).toBe(false);
50
+ expect(
51
+ openclawAutoProvisionEnabled({
52
+ ...baseConfig(),
53
+ openclawDiscovery: {},
54
+ }),
55
+ ).toBe(false);
56
+ expect(
57
+ openclawAutoProvisionEnabled({
58
+ ...baseConfig(),
59
+ openclawDiscovery: { autoProvision: true },
60
+ }),
61
+ ).toBe(true);
62
+ expect(
63
+ openclawAutoProvisionEnabled({
64
+ ...baseConfig(),
65
+ openclawDiscovery: { autoProvision: false },
66
+ }),
67
+ ).toBe(false);
68
+ });
69
+ });
70
+
35
71
  describe("discoverLocalOpenclawGateways", () => {
36
72
  it("discovers JSON and TOML acp config files", async () => {
37
73
  const dir = tempDir();
package/src/config.ts CHANGED
@@ -95,7 +95,7 @@ export interface OpenclawDiscoveryConfig {
95
95
  searchPaths?: string[];
96
96
  /** Overrides the local loopback ports to probe. */
97
97
  defaultPorts?: number[];
98
- /** Defaults to true. When false, discovery only persists gateways. */
98
+ /** Defaults to false. When false, discovery only persists gateways. */
99
99
  autoProvision?: boolean;
100
100
  }
101
101
 
@@ -525,5 +525,5 @@ export function openclawDiscoveryConfigEnabled(cfg: DaemonConfig): boolean {
525
525
  }
526
526
 
527
527
  export function openclawAutoProvisionEnabled(cfg: DaemonConfig): boolean {
528
- return cfg.openclawDiscovery?.autoProvision !== false;
528
+ return cfg.openclawDiscovery?.autoProvision === true;
529
529
  }