openclaw-sync-assistant 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/index.js +9 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -148,7 +148,15 @@ module.exports = {
148
148
  } else if (syncMethod === "github") {
149
149
  githubRepo = await text({
150
150
  message: "请输入用于同步的 GitHub 仓库地址:",
151
- placeholder: "例如: https://github.com/... (直接回车可跳过)",
151
+ placeholder: "例如: https://github.com/user/repo.git (直接回车可跳过)",
152
+ validate(value) {
153
+ if (!value || value.trim() === "") return;
154
+ const githubRegex =
155
+ /^(https:\/\/github\.com\/|git@github\.com:)[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+(\.git)?$/;
156
+ if (!githubRegex.test(value.trim())) {
157
+ return "请输入有效的 GitHub 仓库地址,例如: https://github.com/user/repo.git";
158
+ }
159
+ },
152
160
  });
153
161
  if (typeof githubRepo === "symbol") return;
154
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-sync-assistant",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "An OpenClaw plugin for P2P file and data synchronization using Hyperswarm and Hyperdrive ecosystem.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",