@ystemsrx/cfshare 0.1.3 → 0.1.4

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
@@ -193,6 +193,9 @@ cfshare exposure_stop '{"id":"all"}'
193
193
  `expose_port` and `expose_files` keep the process alive by default so the tunnel stays active.
194
194
  Use `--no-keep-alive` if you only want to print the result and exit.
195
195
 
196
+ When running as CLI, CFShare uses `~/.cfshare` by default for state, workspaces, policy, and audit files.
197
+ This is isolated from plugin mode (`~/.openclaw/cfshare`) so both can coexist safely.
198
+
196
199
  ---
197
200
 
198
201
  ## ⚙️ Configuration (Optional)
package/README.zh.md CHANGED
@@ -193,6 +193,9 @@ cfshare exposure_stop '{"id":"all"}'
193
193
  `expose_port` 与 `expose_files` 默认会保持进程运行以维持隧道。
194
194
  如果你只想输出结果后立即退出,可加 `--no-keep-alive`。
195
195
 
196
+ 以 CLI 方式运行时,CFShare 默认使用 `~/.cfshare` 保存状态、workspace、策略和审计文件。
197
+ 它与插件模式(`~/.openclaw/cfshare`)完全隔离,可同时存在、互不干扰。
198
+
196
199
  ---
197
200
 
198
201
  ## ⚙️ 配置(可选)
package/dist/src/cli.js CHANGED
@@ -16,6 +16,7 @@ const TOOL_NAMES = new Set([
16
16
  "audit_query",
17
17
  "audit_export",
18
18
  ]);
19
+ const CLI_DEFAULT_STATE_DIR = "~/.cfshare";
19
20
  function normalizeCommand(input) {
20
21
  return input.trim().toLowerCase().replace(/-/g, "_");
21
22
  }
@@ -201,10 +202,14 @@ function createRuntimeApi(config) {
201
202
  }
202
203
  },
203
204
  };
205
+ const runtimeConfig = {
206
+ stateDir: CLI_DEFAULT_STATE_DIR,
207
+ ...config,
208
+ };
204
209
  return {
205
210
  logger,
206
211
  resolvePath: resolvePathFromCwd,
207
- pluginConfig: config,
212
+ pluginConfig: runtimeConfig,
208
213
  };
209
214
  }
210
215
  function shouldKeepAlive(command, keepAliveFlag) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ystemsrx/cfshare",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin to safely expose local ports/files via Cloudflare Quick Tunnel",
6
6
  "license": "MIT",
package/src/cli.ts CHANGED
@@ -33,6 +33,8 @@ const TOOL_NAMES = new Set([
33
33
  "audit_export",
34
34
  ]);
35
35
 
36
+ const CLI_DEFAULT_STATE_DIR = "~/.cfshare";
37
+
36
38
  function normalizeCommand(input: string): string {
37
39
  return input.trim().toLowerCase().replace(/-/g, "_");
38
40
  }
@@ -231,10 +233,15 @@ function createRuntimeApi(config: CfsharePluginConfig): CfshareRuntimeApi {
231
233
  },
232
234
  } as unknown as CfshareRuntimeApi["logger"];
233
235
 
236
+ const runtimeConfig: CfsharePluginConfig = {
237
+ stateDir: CLI_DEFAULT_STATE_DIR,
238
+ ...config,
239
+ };
240
+
234
241
  return {
235
242
  logger,
236
243
  resolvePath: resolvePathFromCwd,
237
- pluginConfig: config,
244
+ pluginConfig: runtimeConfig,
238
245
  };
239
246
  }
240
247