keragi 1.1.6__py3-none-any.whl

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.
keragi/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """Keragi Linux server installer."""
2
+
3
+ __version__ = "1.1.6"
keragi/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())
keragi/cli.py ADDED
@@ -0,0 +1,143 @@
1
+ """Command-line entry point for the Keragi Linux installer."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ import sys
8
+ from pathlib import Path
9
+
10
+ from . import __version__
11
+ from .releases import (
12
+ CLIENT_IDS,
13
+ PRESETS,
14
+ KeragiError,
15
+ download_file,
16
+ install_server,
17
+ latest_release,
18
+ release_files,
19
+ )
20
+
21
+
22
+ def _build_parser() -> argparse.ArgumentParser:
23
+ parser = argparse.ArgumentParser(
24
+ prog="keragi",
25
+ description="Keragi Linux server installer and client downloader. Host, WASM resources and client packages come from the official site.",
26
+ )
27
+ parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
28
+ sub = parser.add_subparsers(dest="command")
29
+
30
+ install = sub.add_parser("install", help="安装 Linux x86_64 服务端")
31
+ install.add_argument("directory", nargs="?", default="./keragi-deploy", help="部署目录(默认 ./keragi-deploy)")
32
+ install.add_argument(
33
+ "--preset",
34
+ default="full",
35
+ choices=sorted(PRESETS),
36
+ help="资源组合(默认 full)",
37
+ )
38
+ install.add_argument("--force", action="store_true", help="允许写入非空目录/覆盖已有宿主")
39
+ install.add_argument("--dry-run", action="store_true", help="只显示下载计划,不下载")
40
+ install.add_argument("--json", action="store_true", help="以 JSON 输出结果")
41
+
42
+ release = sub.add_parser("release", help="查看官方发布信息")
43
+ release_sub = release.add_subparsers(dest="release_command")
44
+ info = release_sub.add_parser("info", help="显示 latest 版本与文件")
45
+ info.add_argument("--json", action="store_true", help="以 JSON 输出")
46
+
47
+ client = sub.add_parser("client", help="下载官网最新客户端安装包")
48
+ client.add_argument("platform", nargs="?", choices=sorted(CLIENT_IDS))
49
+ client.add_argument("--dir", default=".", help="下载目录(默认当前目录)")
50
+ client.add_argument("--info", action="store_true", help="只显示客户端文件")
51
+
52
+ sub.add_parser("version", help="显示安装器版本")
53
+ return parser
54
+
55
+
56
+ def main(argv: list[str] | None = None) -> int:
57
+ parser = _build_parser()
58
+ args = parser.parse_args(argv)
59
+
60
+ if args.command in (None, "help"):
61
+ parser.print_help()
62
+ return 0
63
+ if args.command == "version":
64
+ print(f"keragi {__version__}")
65
+ return 0
66
+
67
+ try:
68
+ if args.command == "release" and args.release_command == "info":
69
+ release = latest_release()
70
+ files = release_files(release)
71
+ if args.json:
72
+ print(json.dumps({"version": release.get("version"), "date": release.get("date"), "files": files}, ensure_ascii=False, indent=2))
73
+ return 0
74
+ print(f"Keragi {release.get('version')} ({release.get('date', 'unknown')})")
75
+ for artifact_id, item in files.items():
76
+ print(f" {artifact_id:28} {item.get('file')} {item.get('sizeBytes', '?')} bytes")
77
+ return 0
78
+
79
+ if args.command == "client":
80
+ release = latest_release()
81
+ files = release_files(release)
82
+ if args.info:
83
+ print(f"Keragi {release.get('version')} ({release.get('date', 'unknown')})")
84
+ for name, artifact_id in CLIENT_IDS.items():
85
+ item = files.get(artifact_id)
86
+ if item:
87
+ print(f" {name:17} {item.get('file')} {item.get('sizeBytes', '?')} bytes")
88
+ return 0
89
+ platform_name = args.platform
90
+ if platform_name is None:
91
+ platform_name = "windows" if sys.platform.startswith("win") else "linux" if sys.platform.startswith("linux") else "web"
92
+ artifact_id = CLIENT_IDS[platform_name]
93
+ item = files.get(artifact_id)
94
+ if not item:
95
+ raise KeragiError(f"官网清单缺少 {artifact_id}")
96
+ target = Path(args.dir).expanduser() / Path(str(item["file"])).name
97
+ digest = download_file(str(item["file"]), target, expected_size=item.get("sizeBytes"))
98
+ print(f"已保存 {target}")
99
+ print(f"SHA-256 {digest}")
100
+ if platform_name == "linux":
101
+ print(f"安装:sudo apt install {target}")
102
+ elif platform_name == "windows":
103
+ print("运行该安装包完成安装。")
104
+ elif platform_name == "windows-portable":
105
+ print("解压后运行,无需管理员权限。")
106
+ elif platform_name == "android":
107
+ print("传到 Android 设备后按系统提示安装。")
108
+ else:
109
+ print("解压后由静态服务器托管。")
110
+ return 0
111
+
112
+ if args.command == "install":
113
+ result = install_server(
114
+ Path(args.directory),
115
+ preset=args.preset,
116
+ force=args.force,
117
+ dry_run=args.dry_run,
118
+ )
119
+ if args.json:
120
+ print(json.dumps(result, ensure_ascii=False, indent=2))
121
+ elif not args.dry_run:
122
+ print("")
123
+ print("安装完成。下一步:")
124
+ print(f" cd {result['destination']}")
125
+ print(" edit .env # 填写 JWT_SECRET、管理员账号与服务地址")
126
+ print(" ./start.sh")
127
+ print(" wasmx status # 如果已安装 wasmx 管理壳")
128
+ print("")
129
+ print("文档:https://www.keragi.com/docs/getting-started/install/")
130
+ return 0
131
+ except KeragiError as exc:
132
+ print(f"keragi: {exc}", file=sys.stderr)
133
+ return 1
134
+ except KeyboardInterrupt:
135
+ print("keragi: 已取消", file=sys.stderr)
136
+ return 130
137
+
138
+ parser.print_help()
139
+ return 0
140
+
141
+
142
+ if __name__ == "__main__":
143
+ raise SystemExit(main())
keragi/releases.py ADDED
@@ -0,0 +1,344 @@
1
+ """Official Keragi release discovery, download and Linux extraction."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import hashlib
6
+ import json
7
+ import os
8
+ import platform
9
+ import shutil
10
+ import sys
11
+ import tarfile
12
+ import tempfile
13
+ import urllib.error
14
+ import urllib.request
15
+ from pathlib import Path
16
+ from typing import Callable, Iterable
17
+
18
+ from . import __version__
19
+
20
+ BASE_URL = "https://www.keragi.com/downloads"
21
+ USER_AGENT = f"KeragiPython/{__version__}"
22
+
23
+ HOST_ID = "wasmx-host-linux-x64"
24
+ RESOURCE_IDS = {
25
+ "resx": "resx",
26
+ "msgx": "msgx",
27
+ "userx": "userx",
28
+ "conn": "conn",
29
+ "agix": "agix",
30
+ }
31
+ CLIENT_IDS = {
32
+ "web": "app-web",
33
+ "linux": "app-linux",
34
+ "windows": "app-windows-installer",
35
+ "windows-portable": "app-windows-portable",
36
+ "android": "app-android-arm64",
37
+ }
38
+ PRESETS = {
39
+ "full": ["resx", "msgx", "userx", "conn", "agix"],
40
+ "main": ["resx", "msgx", "userx"],
41
+ "connector": ["conn"],
42
+ "user": ["userx"],
43
+ "message": ["msgx"],
44
+ "ai": ["agix"],
45
+ }
46
+
47
+
48
+ class KeragiError(RuntimeError):
49
+ """A user-facing installation or download error."""
50
+
51
+
52
+ def _request(path: str) -> urllib.request.Request:
53
+ return urllib.request.Request(
54
+ f"{BASE_URL.rstrip('/')}/{path.lstrip('/')}",
55
+ headers={
56
+ "User-Agent": USER_AGENT,
57
+ "Accept": "application/json, application/octet-stream, */*",
58
+ },
59
+ )
60
+
61
+
62
+ def fetch_json(path: str) -> object:
63
+ try:
64
+ with urllib.request.urlopen(_request(path), timeout=30) as response:
65
+ return json.load(response)
66
+ except (urllib.error.URLError, TimeoutError, ValueError) as exc:
67
+ raise KeragiError(f"无法读取官方发布信息 {path}: {exc}") from exc
68
+
69
+
70
+ def latest_release() -> dict:
71
+ data = fetch_json("downloads-versions.json")
72
+ if not isinstance(data, list):
73
+ raise KeragiError("官方发布清单格式无效。")
74
+ for release in data:
75
+ if isinstance(release, dict) and release.get("latest"):
76
+ return release
77
+ raise KeragiError("官方发布清单中没有 latest 版本。")
78
+
79
+
80
+ def release_files(release: dict) -> dict[str, dict]:
81
+ files = {}
82
+ for item in release.get("files", []):
83
+ if isinstance(item, dict) and item.get("id") and item.get("file"):
84
+ files[str(item["id"])] = item
85
+ return files
86
+
87
+
88
+ def preset_resources(preset: str) -> list[str]:
89
+ try:
90
+ return list(PRESETS[preset])
91
+ except KeyError as exc:
92
+ choices = ", ".join(PRESETS)
93
+ raise KeragiError(f"未知 preset: {preset};可选: {choices}") from exc
94
+
95
+
96
+ def platform_guard() -> None:
97
+ system = platform.system().lower()
98
+ machine = platform.machine().lower()
99
+ if system != "linux" or machine not in {"x86_64", "amd64"}:
100
+ raise KeragiError(
101
+ "本安装器当前仅支持 Linux x86_64;"
102
+ "Windows x64 请从 https://www.keragi.com/downloads/ 使用服务端 zip。"
103
+ )
104
+
105
+
106
+ def sha256_file(path: Path) -> str:
107
+ digest = hashlib.sha256()
108
+ with path.open("rb") as handle:
109
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
110
+ digest.update(chunk)
111
+ return digest.hexdigest()
112
+
113
+
114
+ def download_file(
115
+ remote_file: str,
116
+ destination: Path,
117
+ *,
118
+ expected_size: int | None = None,
119
+ on_progress: Callable[[str], None] | None = None,
120
+ ) -> str:
121
+ destination.parent.mkdir(parents=True, exist_ok=True)
122
+ temporary = destination.with_name(destination.name + ".part")
123
+ digest = hashlib.sha256()
124
+ received = 0
125
+ try:
126
+ with urllib.request.urlopen(_request(remote_file), timeout=60) as response:
127
+ with temporary.open("wb") as handle:
128
+ while True:
129
+ chunk = response.read(1024 * 1024)
130
+ if not chunk:
131
+ break
132
+ handle.write(chunk)
133
+ digest.update(chunk)
134
+ received += len(chunk)
135
+ if expected_size is not None and received != expected_size:
136
+ raise KeragiError(
137
+ f"下载大小不一致: {remote_file} 期望 {expected_size},实际 {received}"
138
+ )
139
+ temporary.replace(destination)
140
+ except (urllib.error.URLError, TimeoutError, OSError) as exc:
141
+ temporary.unlink(missing_ok=True)
142
+ raise KeragiError(f"下载失败 {remote_file}: {exc}") from exc
143
+ return digest.hexdigest()
144
+
145
+
146
+ def _safe_members(tar: tarfile.TarFile) -> Iterable[tarfile.TarInfo]:
147
+ for member in tar.getmembers():
148
+ name = member.name
149
+ if name.startswith("/") or ".." in Path(name).parts:
150
+ raise KeragiError(f"官方压缩包包含不安全路径: {name}")
151
+ yield member
152
+
153
+
154
+ def _read_json_member(tar: tarfile.TarFile, name: str) -> dict:
155
+ try:
156
+ extracted = tar.extractfile(name)
157
+ except KeyError as exc:
158
+ raise KeragiError(f"官方压缩包缺少 {name}") from exc
159
+ if extracted is None:
160
+ raise KeragiError(f"无法读取官方压缩包中的 {name}")
161
+ try:
162
+ data = json.load(extracted)
163
+ except ValueError as exc:
164
+ raise KeragiError(f"官方压缩包中的 {name} 不是有效 JSON") from exc
165
+ if not isinstance(data, dict):
166
+ raise KeragiError(f"官方压缩包中的 {name} 不是 JSON 对象")
167
+ return data
168
+
169
+
170
+ def extract_host(archive: Path, destination: Path, *, force: bool = False) -> dict:
171
+ destination.mkdir(parents=True, exist_ok=True)
172
+ with tarfile.open(archive, "r:gz") as tar:
173
+ host = next((m for m in _safe_members(tar) if m.name == "package/vendor/wasmx"), None)
174
+ if host is None:
175
+ raise KeragiError("宿主包缺少 package/vendor/wasmx")
176
+ target = destination / "wasmx"
177
+ if target.exists() and not force:
178
+ raise KeragiError(f"{target} 已存在;使用 --force 覆盖。")
179
+ source = tar.extractfile(host)
180
+ if source is None:
181
+ raise KeragiError("无法读取宿主二进制")
182
+ target.write_bytes(source.read())
183
+ target.chmod(0o755)
184
+
185
+ templates = [
186
+ ("package/templates/wasmx.json", "wasmx.json"),
187
+ ("package/templates/start.sh", "start.sh"),
188
+ ("package/templates/stop.sh", "stop.sh"),
189
+ ("package/templates/env.example", ".env.example"),
190
+ ]
191
+ for member_name, output_name in templates:
192
+ member = next((m for m in _safe_members(tar) if m.name == member_name), None)
193
+ if member is None:
194
+ raise KeragiError(f"宿主包缺少 {member_name}")
195
+ content = tar.extractfile(member)
196
+ if content is None:
197
+ raise KeragiError(f"无法读取 {member_name}")
198
+ output = destination / output_name
199
+ if output.exists() and not force:
200
+ raise KeragiError(f"{output} 已存在;使用 --force 覆盖。")
201
+ output.write_bytes(content.read())
202
+ if output_name.endswith(".sh"):
203
+ output.chmod(0o755)
204
+
205
+ config = _read_json_member(tar, "package/templates/wasmx.json")
206
+
207
+ (destination / "wasm").mkdir(exist_ok=True)
208
+ (destination / "data").mkdir(exist_ok=True)
209
+ env_example = destination / ".env.example"
210
+ env_file = destination / ".env"
211
+ if env_example.exists() and not env_file.exists():
212
+ shutil.copyfile(env_example, env_file)
213
+ env_file.chmod(0o600)
214
+ config.setdefault("resources", [])
215
+ return config
216
+
217
+
218
+ def extract_resource(archive: Path, name: str, destination: Path, config: dict) -> None:
219
+ with tarfile.open(archive, "r:gz") as tar:
220
+ manifest = _read_json_member(tar, "package/wasmx.resource.json")
221
+ resources = config.setdefault("resources", [])
222
+ for resource in manifest.get("resources", []):
223
+ if not isinstance(resource, dict) or not resource.get("name") or not resource.get("file"):
224
+ raise KeragiError(f"{name}: 资源声明缺少 name/file")
225
+ source_name = f"package/wasm/{resource['file']}"
226
+ member = next((m for m in _safe_members(tar) if m.name == source_name), None)
227
+ if member is None:
228
+ raise KeragiError(f"{name}: 缺少 {source_name}")
229
+ content = tar.extractfile(member)
230
+ if content is None:
231
+ raise KeragiError(f"{name}: 无法读取 {source_name}")
232
+ output = destination / "wasm" / resource["file"]
233
+ output.write_bytes(content.read())
234
+ entry = {
235
+ "name": resource["name"],
236
+ "path": f"wasm/{resource['file']}",
237
+ }
238
+ entry.update(resource.get("config") or {})
239
+ existing = next(
240
+ (i for i, item in enumerate(resources) if item.get("name") == entry["name"]),
241
+ None,
242
+ )
243
+ if existing is None:
244
+ resources.append(entry)
245
+ else:
246
+ resources[existing] = entry
247
+
248
+ for asset in manifest.get("assets", []):
249
+ source_prefix = f"package/{asset.get('from', '').strip('/')}/"
250
+ destination_root = destination / str(asset.get("to", "")).strip("/")
251
+ if not asset.get("from") or not asset.get("to"):
252
+ raise KeragiError(f"{name}: assets 条目缺少 from/to")
253
+ for member in _safe_members(tar):
254
+ if not member.isfile() or not member.name.startswith(source_prefix):
255
+ continue
256
+ relative = member.name[len(source_prefix):]
257
+ if not relative:
258
+ continue
259
+ content = tar.extractfile(member)
260
+ if content is None:
261
+ continue
262
+ output = destination_root / relative
263
+ output.parent.mkdir(parents=True, exist_ok=True)
264
+ output.write_bytes(content.read())
265
+
266
+
267
+ def write_config(destination: Path, config: dict) -> None:
268
+ output = destination / "wasmx.json"
269
+ output.write_text(json.dumps(config, ensure_ascii=False, indent=2) + "\n")
270
+
271
+
272
+ def write_package_stub(destination: Path) -> None:
273
+ output = destination / "package.json"
274
+ if output.exists():
275
+ return
276
+ output.write_text(
277
+ json.dumps(
278
+ {"name": "keragi-deploy", "private": True, "version": __version__},
279
+ ensure_ascii=False,
280
+ indent=2,
281
+ )
282
+ + "\n"
283
+ )
284
+
285
+
286
+ def install_server(
287
+ destination: Path,
288
+ *,
289
+ preset: str = "full",
290
+ force: bool = False,
291
+ dry_run: bool = False,
292
+ on_event: Callable[[str], None] = print,
293
+ ) -> dict:
294
+ platform_guard()
295
+ resources = preset_resources(preset)
296
+ release = latest_release()
297
+ files = release_files(release)
298
+ required_ids = [HOST_ID, *[RESOURCE_IDS[name] for name in resources]]
299
+ missing = [item for item in required_ids if item not in files]
300
+ if missing:
301
+ raise KeragiError(f"官方发布清单缺少: {', '.join(missing)}")
302
+
303
+ destination = destination.expanduser().resolve()
304
+ if destination.exists() and any(destination.iterdir()) and not force:
305
+ raise KeragiError(f"目标目录非空: {destination};确认后使用 --force。")
306
+
307
+ on_event(f"Keragi {release.get('version', 'latest')} → {destination}")
308
+ on_event(f"preset: {preset} ({', '.join(resources)})")
309
+ for artifact_id in required_ids:
310
+ item = files[artifact_id]
311
+ on_event(f" {artifact_id}: {item['file']} ({item.get('sizeBytes', '?')} bytes)")
312
+ if dry_run:
313
+ on_event("dry run:未下载、未写入。")
314
+ return {"version": release.get("version"), "destination": str(destination), "files": required_ids}
315
+
316
+ with tempfile.TemporaryDirectory(prefix="keragi-install-") as tmp_dir:
317
+ tmp = Path(tmp_dir)
318
+ archives: dict[str, Path] = {}
319
+ for artifact_id in required_ids:
320
+ item = files[artifact_id]
321
+ target = tmp / f"{artifact_id}.tgz"
322
+ on_event(f"下载 {item['file']} ...")
323
+ digest = download_file(
324
+ str(item["file"]),
325
+ target,
326
+ expected_size=item.get("sizeBytes"),
327
+ )
328
+ on_event(f" SHA-256 {digest}")
329
+ archives[artifact_id] = target
330
+
331
+ on_event("解压宿主 ...")
332
+ config = extract_host(archives[HOST_ID], destination, force=force)
333
+ for resource_name in resources:
334
+ on_event(f"安装 {resource_name} ...")
335
+ extract_resource(archives[RESOURCE_IDS[resource_name]], resource_name, destination, config)
336
+ write_config(destination, config)
337
+ write_package_stub(destination)
338
+
339
+ return {
340
+ "version": release.get("version"),
341
+ "destination": str(destination),
342
+ "preset": preset,
343
+ "resources": resources,
344
+ }
@@ -0,0 +1,351 @@
1
+ Metadata-Version: 2.5
2
+ Name: keragi
3
+ Version: 1.1.6
4
+ Summary: Keragi Linux server installer and client downloader. Host, WASM resources and client packages come from the official site. 私有化 AI 协作与私有即时通讯安装与客户端下载工具。
5
+ Project-URL: Homepage, https://www.keragi.com/
6
+ Project-URL: Documentation, https://www.keragi.com/docs/
7
+ Project-URL: Downloads, https://www.keragi.com/downloads/
8
+ Author-email: Keragi <showdom@keragi.com>
9
+ License: KERAGI PROPRIETARY SOFTWARE LICENSE
10
+ Version 1.1 — 2026-11-06
11
+
12
+ Copyright (c) 2026 Keragi. All rights reserved.
13
+
14
+ THIS IS A PROPRIETARY SOFTWARE LICENSE. IT GRANTS ONLY THE RIGHTS
15
+ EXPRESSLY STATED BELOW. NO OWNERSHIP OF THE SOFTWARE IS TRANSFERRED.
16
+ NO SOURCE CODE LICENSE IS GRANTED.
17
+
18
+ 1. DEFINITIONS
19
+
20
+ "Software" means the Keragi wasmx host, WASM resources, templates,
21
+ scripts, configuration examples, documentation, and any updates or
22
+ supplements provided under this Agreement.
23
+
24
+ "Licensor" means Keragi, or the legal entity or individual that provides
25
+ the Software to you under this Agreement.
26
+
27
+ "Paid Feature" means any feature, resource, edition, capacity or service
28
+ that Licensor identifies as paid, subscription-based, or requiring a
29
+ separate commercial license.
30
+
31
+ 2. ACCEPTANCE
32
+
33
+ By downloading, installing, copying or using the Software, you agree to
34
+ this Agreement. If you do not agree, do not install or use the Software
35
+ and delete any copies you have obtained.
36
+
37
+ If you use the Software on behalf of an organization, you represent that
38
+ you have authority to bind that organization, and "you" includes that
39
+ organization.
40
+
41
+ 3. LICENSE GRANT
42
+
43
+ Subject to this Agreement, Licensor grants you a limited, non-exclusive,
44
+ non-transferable, non-sublicensable and revocable license to install and
45
+ use the Software on servers or devices that you own or control, for your
46
+ personal use or internal business purposes.
47
+
48
+ Unless a separate order, invoice or written agreement states otherwise,
49
+ the version made available to you is provided free of charge. This
50
+ Agreement does not transfer ownership of the Software or any intellectual
51
+ property rights in it. No right to receive, use or modify source code is
52
+ granted.
53
+
54
+ 4. RESTRICTIONS
55
+
56
+ You must not, and must not permit any third party to:
57
+
58
+ (a) redistribute, sublicense, sell, rent, lease, lend or otherwise make
59
+ the Software available to third parties, except as expressly
60
+ permitted in writing by Licensor;
61
+
62
+ (b) provide the Software to third parties as a hosted service, managed
63
+ service or service bureau, unless you hold a separate commercial
64
+ license for that purpose;
65
+
66
+ (c) modify, adapt, translate or create derivative works of the Software,
67
+ except to the extent permitted by mandatory law;
68
+
69
+ (d) reverse engineer, decompile or disassemble the Software, except to
70
+ the extent permitted by mandatory law;
71
+
72
+ (e) remove, obscure or alter any copyright, trademark, license or other
73
+ proprietary notice;
74
+
75
+ (f) circumvent, disable or interfere with any license check, paid
76
+ feature control, usage limit or technical protection measure;
77
+
78
+ (g) use the Software to infringe the rights of others or in violation of
79
+ applicable law; or
80
+
81
+ (h) use the Software in a way that could damage, disable, overburden or
82
+ impair the Software or any network or system.
83
+
84
+ 5. FREE AND PAID EDITIONS; SUBSCRIPTIONS
85
+
86
+ Licensor may offer free and paid editions, resources or features. Paid
87
+ Features require a separate order, subscription or commercial license.
88
+ The scope, price, billing period, trial terms, auto-renewal and
89
+ cancellation terms, and refund policy will be stated in the applicable
90
+ order or release notice.
91
+
92
+ Unless you purchase a Paid Feature or renew a subscription, you will not
93
+ be automatically converted to a paid edition. If a subscription ends,
94
+ Paid Features may stop working; the remaining functionality is governed
95
+ by the applicable subscription terms and the license in effect for that
96
+ version.
97
+
98
+ Licensor may change which features or resources are free or paid in
99
+ future releases. Such changes apply to future releases and do not
100
+ retroactively alter the rights you received for a version you lawfully
101
+ obtained, unless you choose to upgrade to a release governed by new
102
+ terms.
103
+
104
+ 6. UPDATES AND SUPPORT
105
+
106
+ Licensor is not obligated to provide updates, upgrades, maintenance or
107
+ support unless a separate agreement says otherwise. Updates provided by
108
+ Licensor are governed by this Agreement or by terms accompanying the
109
+ update. Paid support is governed by the applicable order.
110
+
111
+ 7. THIRD-PARTY COMPONENTS
112
+
113
+ The Software may include third-party components. Those components are
114
+ governed by their respective licenses and notices, which prevail over
115
+ this Agreement for those components. Nothing in this Agreement limits any
116
+ rights you may have under those third-party licenses. Where required,
117
+ third-party notices are provided with the Software or on the website.
118
+
119
+ 8. INTELLECTUAL PROPERTY
120
+
121
+ Licensor and its licensors retain all right, title and interest in and to
122
+ the Software, including all intellectual property rights. All rights not
123
+ expressly granted are reserved.
124
+
125
+ 9. DATA, PRIVACY AND SECURITY
126
+
127
+ You are responsible for the data you process, store or transmit using the
128
+ Software and for configuring access control, backups and security in your
129
+ deployment. If you self-host the Software, you are the operator of that
130
+ deployment and are responsible for compliance with applicable data
131
+ protection and privacy laws.
132
+
133
+ Keragi's Privacy Policy applies to personal data that Licensor processes
134
+ in connection with the Software and the website. The Software is not
135
+ designed to guarantee absolute security; see Sections 10 and 12.
136
+
137
+ 10. NO WARRANTY
138
+
139
+ THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE". TO THE MAXIMUM
140
+ EXTENT PERMITTED BY LAW, LICENSOR DISCLAIMS ALL WARRANTIES, EXPRESS OR
141
+ IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
142
+ PURPOSE, TITLE, NON-INFRINGEMENT, SECURITY, ACCURACY, AND UNINTERRUPTED
143
+ OR ERROR-FREE OPERATION. YOU ARE RESPONSIBLE FOR TESTING THE SOFTWARE,
144
+ VERIFYING ITS SUITABILITY FOR YOUR USE, AND MAINTAINING YOUR OWN BACKUPS.
145
+
146
+ 11. LIMITATION OF LIABILITY
147
+
148
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, LICENSOR WILL NOT BE LIABLE FOR
149
+ ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR
150
+ FOR LOSS OF DATA, PROFITS, REVENUE OR BUSINESS, ARISING OUT OF OR RELATED
151
+ TO THE SOFTWARE OR THIS AGREEMENT, EVEN IF ADVISED OF THE POSSIBILITY OF
152
+ SUCH DAMAGES.
153
+
154
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, LICENSOR'S TOTAL AGGREGATE
155
+ LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE AMOUNT YOU PAID TO
156
+ LICENSOR FOR THE SOFTWARE IN THE TWELVE (12) MONTHS PRECEDING THE CLAIM,
157
+ OR USD 100 IF YOU PAID NOTHING.
158
+
159
+ NOTHING IN THIS AGREEMENT EXCLUDES OR LIMITS LIABILITY THAT CANNOT BE
160
+ EXCLUDED OR LIMITED UNDER APPLICABLE LAW, INCLUDING LIABILITY FOR DEATH
161
+ OR PERSONAL INJURY CAUSED BY NEGLIGENCE, FRAUD OR WILLFUL MISCONDUCT,
162
+ WHERE SUCH LIMITATION IS PROHIBITED BY LAW.
163
+
164
+ 12. HIGH-RISK USE
165
+
166
+ THE SOFTWARE IS NOT DESIGNED, TESTED OR CERTIFIED FOR USE IN LIFE
167
+ SUPPORT, MEDICAL, NUCLEAR, AVIATION, EMERGENCY, INDUSTRIAL SAFETY OR
168
+ OTHER HIGH-RISK ENVIRONMENTS WHERE FAILURE COULD CAUSE DEATH, PERSONAL
169
+ INJURY, ENVIRONMENTAL DAMAGE OR SIGNIFICANT PROPERTY LOSS. YOU MUST
170
+ OBTAIN INDEPENDENT SAFETY CERTIFICATION AND IMPLEMENT FAIL-SAFE CONTROLS
171
+ BEFORE USING THE SOFTWARE IN SUCH ENVIRONMENTS.
172
+
173
+ 13. TERM AND TERMINATION
174
+
175
+ This Agreement is effective until terminated. Your rights terminate
176
+ automatically if you materially breach this Agreement. Licensor may also
177
+ terminate this Agreement if required by law or if continued provision of
178
+ the Software becomes unlawful.
179
+
180
+ On termination you must stop using the Software and delete all copies in
181
+ your possession or control. Sections 4, 7, 8, 9, 10, 11, 12, 13 and 15
182
+ survive termination.
183
+
184
+ 14. COMPLIANCE
185
+
186
+ You must comply with all laws and regulations applicable to your use of
187
+ the Software, including export control, sanctions and data protection
188
+ laws. You may not use the Software in any country or context prohibited
189
+ by applicable law.
190
+
191
+ 15. GOVERNING LAW AND DISPUTES
192
+
193
+ This Agreement is governed by the laws of the jurisdiction in which the
194
+ Licensor is established or, if the Licensor is an individual, in which
195
+ the Licensor resides, without regard to conflict-of-law rules. Disputes
196
+ will be resolved by the competent courts at the Licensor's principal
197
+ place of business or, for an individual, place of residence, unless
198
+ mandatory consumer protection law provides otherwise.
199
+
200
+ Nothing in this Section prevents either party from seeking injunctive or
201
+ other equitable relief in any competent court.
202
+
203
+ 16. GENERAL
204
+
205
+ This Agreement is the entire agreement between you and Licensor regarding
206
+ the Software and supersedes prior discussions on the same subject. If any
207
+ provision is held unenforceable, the remaining provisions remain in
208
+ effect. A failure to enforce a provision is not a waiver. You may not
209
+ assign this Agreement without Licensor's written consent. Licensor may
210
+ assign this Agreement to an affiliate or successor.
211
+
212
+ The English version of this Agreement prevails over any translation. The
213
+ Chinese translation is provided for reference only.
214
+
215
+ 17. CONTACT
216
+
217
+ Licensor: Keragi (the individual developer or legal entity identified
218
+ in the applicable order, invoice or license notice)
219
+ Website: https://www.keragi.com
220
+ License-File: LICENSE
221
+ License-File: LICENSE.zh-CN.md
222
+ Keywords: AI助手,AI协作平台,AI客户端,ESP32,STM32,ai-assistant,ai-client,ai-collaboration,connector,dev-board,device-access,esp32,hardware,im,installer,keragi,learning-kit,message-session,on-premise,peripherals,private-im,self-hosted,sensor,stm32,wasm,wasmx,传感器,外围设备,学习板,开发板,消息会话,硬件接入,私有化部署,私有即时通讯,设备接入,连接器
223
+ Classifier: Development Status :: 4 - Beta
224
+ Classifier: Environment :: Console
225
+ Classifier: Intended Audience :: System Administrators
226
+ Classifier: License :: Other/Proprietary License
227
+ Classifier: Operating System :: POSIX :: Linux
228
+ Classifier: Programming Language :: Python :: 3
229
+ Classifier: Programming Language :: Python :: 3 :: Only
230
+ Classifier: Topic :: Communications :: Chat
231
+ Classifier: Topic :: System :: Installation/Setup
232
+ Requires-Python: >=3.9
233
+ Description-Content-Type: text/markdown
234
+
235
+ # keragi
236
+
237
+ **Keragi 私有化 AI 协作平台与私有即时通讯(IM)的 Linux 服务端安装器和客户端下载器。**
238
+
239
+ `keragi` 是一个轻量 Python CLI:从 Keragi 官网下载服务端宿主和所需的 WASM 资源,解压到部署目录,合并资源声明并生成启动配置;也可以下载官方客户端安装包。**WASM 资源和客户端二进制不打进本包**,始终从官网 `/downloads/latest/*` 获取,便于独立升级和审计。
240
+
241
+ **核心关键词**:Keragi、私有化部署、私有即时通讯、IM、AI 协作平台、AI 助手、AI 客户端、连接器、STM32、ESP32、开发板、学习板、外围设备、硬件接入、传感器、设备接入、消息会话。
242
+
243
+ ## 软件功能
244
+
245
+ - **私有化部署**:服务、数据和文件留在自己的服务器,适合内网、专有网络和受控环境。
246
+ - **私有即时通讯(IM)**:私聊、群聊、项目组,支持 AI 助手、连接器与子账号进入会话。
247
+ - **AI 协作**:AI 助手进入会话;连接器复用受信任主机上的本地 AI CLI。
248
+ - **客户端**:一条命令下载 Web、Linux、Android、Windows 官方客户端包。
249
+ - **E2EE 边界**:私聊/群聊文本可选端到端加密,默认关闭;频道、媒体、设备和连接器数据不在同一加密边界内。
250
+ - **资源化服务端**:wasmx 宿主 + resx/msgx/userx/conn/agix;默认单机 SQLite,也支持 HelixDB。
251
+ - **统一安装**:宿主与资源从官网下载,Python 包不捆绑 `.wasm` 或客户端二进制。
252
+
253
+ ## 硬件规划
254
+
255
+ - 硬件产品线**即将推出**:首批为 ESP32-S3 多功能 AI 控制板,面向开发板/学习板、传感器采集、告警、语音交互与设备/网关场景。
256
+ - 后续方向包含 STM32 工业节点、传感器/外围设备与网关;设备可通过子账号、网关或本地桥接参与协作。
257
+ - 具体 SKU、认证、售价与交付时间以官网正式发布页为准;当前不把规划写成已交付产品。
258
+
259
+ ## 安装
260
+
261
+ ```bash
262
+ pip install keragi
263
+ ```
264
+
265
+ 要求 Python 3.9+,服务器为 Linux x86_64。
266
+
267
+ ## 快速开始
268
+
269
+ ```bash
270
+ keragi install ./keragi-deploy
271
+ cd keragi-deploy
272
+ edit .env # 填写 JWT_SECRET、管理员账号与服务地址
273
+ ./start.sh
274
+ ```
275
+
276
+ 默认安装 `full`:宿主 + `resx` + `msgx` + `userx` + `conn` + `agix`。
277
+
278
+ 只安装主服务器核心资源:
279
+
280
+ ```bash
281
+ keragi install ./keragi-deploy --preset main
282
+ ```
283
+
284
+ 查看下载计划但不写入:
285
+
286
+ ```bash
287
+ keragi install ./keragi-deploy --preset main --dry-run
288
+ ```
289
+
290
+ 已有目录中重新安装/覆盖宿主:
291
+
292
+ ```bash
293
+ keragi install ./keragi-deploy --preset main --force
294
+ ```
295
+
296
+ ## 命令
297
+
298
+ | 命令 | 作用 |
299
+ | --- | --- |
300
+ | `keragi install [目录]` | 下载并安装宿主与资源,默认 `full` |
301
+ | `keragi install --preset main` | 安装主服务器核心资源 |
302
+ | `keragi install --dry-run` | 只显示官方下载计划 |
303
+ | `keragi client [平台]` | 下载官网最新客户端安装包 |
304
+ | `keragi client --info` | 查看客户端最新版本与文件 |
305
+ | `keragi release info` | 查看官方 latest 版本与文件 |
306
+ | `keragi version` | 查看安装器版本 |
307
+
308
+ ## 客户端
309
+
310
+ 客户端安装包从官网下载,不在 PyPI 包内捆绑:
311
+
312
+ ```bash
313
+ keragi client linux # 下载 Linux deb
314
+ keragi client windows # 下载 Windows 安装版
315
+ keragi client windows-portable # 下载 Windows 绿色版
316
+ keragi client android # 下载 Android APK
317
+ keragi client web # 下载 Web 客户端
318
+ keragi client --dir ./downloads # 指定下载目录
319
+ keragi client --info # 查看最新版本与文件
320
+ ```
321
+
322
+ 下载完成后按提示安装:Linux 使用 `sudo apt install <deb>`;Windows 运行安装包;Android 传到设备安装;Web 解压后由静态服务器托管。
323
+
324
+ ## 预设组合
325
+
326
+ | preset | 资源 |
327
+ | --- | --- |
328
+ | `full` | 宿主 + `resx` + `msgx` + `userx` + `conn` + `agix` |
329
+ | `main` | 宿主 + `resx` + `msgx` + `userx` |
330
+ | `connector` | 宿主 + `conn` |
331
+ | `user` | 宿主 + `userx` |
332
+ | `message` | 宿主 + `msgx` |
333
+ | `ai` | 宿主 + `agix` |
334
+
335
+ ## 平台与安全边界
336
+
337
+ - **平台**:Linux x86_64。Windows x64 请从官网下载服务端 zip;macOS/ARM64 服务端暂不在本安装器范围。
338
+ - **资源来源**:宿主和 WASM 资源均从 `https://www.keragi.com/downloads/latest/*` 下载;本包不携带资源文件。
339
+ - **E2EE**:私聊/群聊文本为可选端到端加密,默认关闭;服务端设置 `E2EE_ENABLED=true` 后启用。频道、媒体、设备数据和连接器数据不在同一加密边界内。
340
+ - **部署责任**:反向代理、TLS、访问控制、备份和合规由部署方负责;不要把管理接口直接暴露到不可信网络。
341
+ - **执行器**:涉及继电器、电机、阀门等执行器时,必须有失效安全、急停、人工确认和独立安全措施,不替代 PLC/SCADA/消防/医疗等系统。
342
+ - **硬件**:Keragi 也面向 STM32、ESP32 等设备接入场景;硬件产品线即将推出,具体以正式发布为准。
343
+
344
+ ## 文档与许可
345
+
346
+ - 产品与文档:https://www.keragi.com/docs/
347
+ - 安装文档:https://www.keragi.com/docs/getting-started/install/
348
+ - 下载页:https://www.keragi.com/downloads/
349
+ - 许可说明:https://www.keragi.com/docs/licensing/
350
+
351
+ 本包为专有软件,仅授予随附 `LICENSE` 明确写明的权利;当前版本免费使用,后续版本可能对特定功能或资源采用订阅或商业授权。中文参考译文见 `LICENSE.zh-CN.md`。
@@ -0,0 +1,10 @@
1
+ keragi/__init__.py,sha256=WrtzNhHoTVEmiQ0Wy5X8Wwxtj5qD2KQN77vtht4SqMs,60
2
+ keragi/__main__.py,sha256=k1ocEWawweo1qCJWNFAAvyxz3tcY13dzvCenHszij30,48
3
+ keragi/cli.py,sha256=vq3I5wbvf3xyQeBoEbZlCK72-O9Bseeh4G7tnTxXvZU,5876
4
+ keragi/releases.py,sha256=JAIIsnM4OeX8mWFsT-q59er7PxvCs1XyPqUji5qzx4M,12659
5
+ keragi-1.1.6.dist-info/METADATA,sha256=NPTLHFCzQWmiadkHMn2HiB-AiX0GYQQqQDwuevkfFyI,17439
6
+ keragi-1.1.6.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
7
+ keragi-1.1.6.dist-info/entry_points.txt,sha256=IW0K_rQLTJ8wGe5ydU9m4mnQCjEk-8rkGfEPwa3fH58,43
8
+ keragi-1.1.6.dist-info/licenses/LICENSE,sha256=bgFdA495oXB0A9-pDEf3y-g0XcGsWBPFGKfft925lUY,8840
9
+ keragi-1.1.6.dist-info/licenses/LICENSE.zh-CN.md,sha256=niXiYOTQOqcccIwt2pY6NpSruDZppu0_EKFTkpN6zkU,7125
10
+ keragi-1.1.6.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ keragi = keragi.cli:main
@@ -0,0 +1,211 @@
1
+ KERAGI PROPRIETARY SOFTWARE LICENSE
2
+ Version 1.1 — 2026-11-06
3
+
4
+ Copyright (c) 2026 Keragi. All rights reserved.
5
+
6
+ THIS IS A PROPRIETARY SOFTWARE LICENSE. IT GRANTS ONLY THE RIGHTS
7
+ EXPRESSLY STATED BELOW. NO OWNERSHIP OF THE SOFTWARE IS TRANSFERRED.
8
+ NO SOURCE CODE LICENSE IS GRANTED.
9
+
10
+ 1. DEFINITIONS
11
+
12
+ "Software" means the Keragi wasmx host, WASM resources, templates,
13
+ scripts, configuration examples, documentation, and any updates or
14
+ supplements provided under this Agreement.
15
+
16
+ "Licensor" means Keragi, or the legal entity or individual that provides
17
+ the Software to you under this Agreement.
18
+
19
+ "Paid Feature" means any feature, resource, edition, capacity or service
20
+ that Licensor identifies as paid, subscription-based, or requiring a
21
+ separate commercial license.
22
+
23
+ 2. ACCEPTANCE
24
+
25
+ By downloading, installing, copying or using the Software, you agree to
26
+ this Agreement. If you do not agree, do not install or use the Software
27
+ and delete any copies you have obtained.
28
+
29
+ If you use the Software on behalf of an organization, you represent that
30
+ you have authority to bind that organization, and "you" includes that
31
+ organization.
32
+
33
+ 3. LICENSE GRANT
34
+
35
+ Subject to this Agreement, Licensor grants you a limited, non-exclusive,
36
+ non-transferable, non-sublicensable and revocable license to install and
37
+ use the Software on servers or devices that you own or control, for your
38
+ personal use or internal business purposes.
39
+
40
+ Unless a separate order, invoice or written agreement states otherwise,
41
+ the version made available to you is provided free of charge. This
42
+ Agreement does not transfer ownership of the Software or any intellectual
43
+ property rights in it. No right to receive, use or modify source code is
44
+ granted.
45
+
46
+ 4. RESTRICTIONS
47
+
48
+ You must not, and must not permit any third party to:
49
+
50
+ (a) redistribute, sublicense, sell, rent, lease, lend or otherwise make
51
+ the Software available to third parties, except as expressly
52
+ permitted in writing by Licensor;
53
+
54
+ (b) provide the Software to third parties as a hosted service, managed
55
+ service or service bureau, unless you hold a separate commercial
56
+ license for that purpose;
57
+
58
+ (c) modify, adapt, translate or create derivative works of the Software,
59
+ except to the extent permitted by mandatory law;
60
+
61
+ (d) reverse engineer, decompile or disassemble the Software, except to
62
+ the extent permitted by mandatory law;
63
+
64
+ (e) remove, obscure or alter any copyright, trademark, license or other
65
+ proprietary notice;
66
+
67
+ (f) circumvent, disable or interfere with any license check, paid
68
+ feature control, usage limit or technical protection measure;
69
+
70
+ (g) use the Software to infringe the rights of others or in violation of
71
+ applicable law; or
72
+
73
+ (h) use the Software in a way that could damage, disable, overburden or
74
+ impair the Software or any network or system.
75
+
76
+ 5. FREE AND PAID EDITIONS; SUBSCRIPTIONS
77
+
78
+ Licensor may offer free and paid editions, resources or features. Paid
79
+ Features require a separate order, subscription or commercial license.
80
+ The scope, price, billing period, trial terms, auto-renewal and
81
+ cancellation terms, and refund policy will be stated in the applicable
82
+ order or release notice.
83
+
84
+ Unless you purchase a Paid Feature or renew a subscription, you will not
85
+ be automatically converted to a paid edition. If a subscription ends,
86
+ Paid Features may stop working; the remaining functionality is governed
87
+ by the applicable subscription terms and the license in effect for that
88
+ version.
89
+
90
+ Licensor may change which features or resources are free or paid in
91
+ future releases. Such changes apply to future releases and do not
92
+ retroactively alter the rights you received for a version you lawfully
93
+ obtained, unless you choose to upgrade to a release governed by new
94
+ terms.
95
+
96
+ 6. UPDATES AND SUPPORT
97
+
98
+ Licensor is not obligated to provide updates, upgrades, maintenance or
99
+ support unless a separate agreement says otherwise. Updates provided by
100
+ Licensor are governed by this Agreement or by terms accompanying the
101
+ update. Paid support is governed by the applicable order.
102
+
103
+ 7. THIRD-PARTY COMPONENTS
104
+
105
+ The Software may include third-party components. Those components are
106
+ governed by their respective licenses and notices, which prevail over
107
+ this Agreement for those components. Nothing in this Agreement limits any
108
+ rights you may have under those third-party licenses. Where required,
109
+ third-party notices are provided with the Software or on the website.
110
+
111
+ 8. INTELLECTUAL PROPERTY
112
+
113
+ Licensor and its licensors retain all right, title and interest in and to
114
+ the Software, including all intellectual property rights. All rights not
115
+ expressly granted are reserved.
116
+
117
+ 9. DATA, PRIVACY AND SECURITY
118
+
119
+ You are responsible for the data you process, store or transmit using the
120
+ Software and for configuring access control, backups and security in your
121
+ deployment. If you self-host the Software, you are the operator of that
122
+ deployment and are responsible for compliance with applicable data
123
+ protection and privacy laws.
124
+
125
+ Keragi's Privacy Policy applies to personal data that Licensor processes
126
+ in connection with the Software and the website. The Software is not
127
+ designed to guarantee absolute security; see Sections 10 and 12.
128
+
129
+ 10. NO WARRANTY
130
+
131
+ THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE". TO THE MAXIMUM
132
+ EXTENT PERMITTED BY LAW, LICENSOR DISCLAIMS ALL WARRANTIES, EXPRESS OR
133
+ IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
134
+ PURPOSE, TITLE, NON-INFRINGEMENT, SECURITY, ACCURACY, AND UNINTERRUPTED
135
+ OR ERROR-FREE OPERATION. YOU ARE RESPONSIBLE FOR TESTING THE SOFTWARE,
136
+ VERIFYING ITS SUITABILITY FOR YOUR USE, AND MAINTAINING YOUR OWN BACKUPS.
137
+
138
+ 11. LIMITATION OF LIABILITY
139
+
140
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, LICENSOR WILL NOT BE LIABLE FOR
141
+ ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR
142
+ FOR LOSS OF DATA, PROFITS, REVENUE OR BUSINESS, ARISING OUT OF OR RELATED
143
+ TO THE SOFTWARE OR THIS AGREEMENT, EVEN IF ADVISED OF THE POSSIBILITY OF
144
+ SUCH DAMAGES.
145
+
146
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, LICENSOR'S TOTAL AGGREGATE
147
+ LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE AMOUNT YOU PAID TO
148
+ LICENSOR FOR THE SOFTWARE IN THE TWELVE (12) MONTHS PRECEDING THE CLAIM,
149
+ OR USD 100 IF YOU PAID NOTHING.
150
+
151
+ NOTHING IN THIS AGREEMENT EXCLUDES OR LIMITS LIABILITY THAT CANNOT BE
152
+ EXCLUDED OR LIMITED UNDER APPLICABLE LAW, INCLUDING LIABILITY FOR DEATH
153
+ OR PERSONAL INJURY CAUSED BY NEGLIGENCE, FRAUD OR WILLFUL MISCONDUCT,
154
+ WHERE SUCH LIMITATION IS PROHIBITED BY LAW.
155
+
156
+ 12. HIGH-RISK USE
157
+
158
+ THE SOFTWARE IS NOT DESIGNED, TESTED OR CERTIFIED FOR USE IN LIFE
159
+ SUPPORT, MEDICAL, NUCLEAR, AVIATION, EMERGENCY, INDUSTRIAL SAFETY OR
160
+ OTHER HIGH-RISK ENVIRONMENTS WHERE FAILURE COULD CAUSE DEATH, PERSONAL
161
+ INJURY, ENVIRONMENTAL DAMAGE OR SIGNIFICANT PROPERTY LOSS. YOU MUST
162
+ OBTAIN INDEPENDENT SAFETY CERTIFICATION AND IMPLEMENT FAIL-SAFE CONTROLS
163
+ BEFORE USING THE SOFTWARE IN SUCH ENVIRONMENTS.
164
+
165
+ 13. TERM AND TERMINATION
166
+
167
+ This Agreement is effective until terminated. Your rights terminate
168
+ automatically if you materially breach this Agreement. Licensor may also
169
+ terminate this Agreement if required by law or if continued provision of
170
+ the Software becomes unlawful.
171
+
172
+ On termination you must stop using the Software and delete all copies in
173
+ your possession or control. Sections 4, 7, 8, 9, 10, 11, 12, 13 and 15
174
+ survive termination.
175
+
176
+ 14. COMPLIANCE
177
+
178
+ You must comply with all laws and regulations applicable to your use of
179
+ the Software, including export control, sanctions and data protection
180
+ laws. You may not use the Software in any country or context prohibited
181
+ by applicable law.
182
+
183
+ 15. GOVERNING LAW AND DISPUTES
184
+
185
+ This Agreement is governed by the laws of the jurisdiction in which the
186
+ Licensor is established or, if the Licensor is an individual, in which
187
+ the Licensor resides, without regard to conflict-of-law rules. Disputes
188
+ will be resolved by the competent courts at the Licensor's principal
189
+ place of business or, for an individual, place of residence, unless
190
+ mandatory consumer protection law provides otherwise.
191
+
192
+ Nothing in this Section prevents either party from seeking injunctive or
193
+ other equitable relief in any competent court.
194
+
195
+ 16. GENERAL
196
+
197
+ This Agreement is the entire agreement between you and Licensor regarding
198
+ the Software and supersedes prior discussions on the same subject. If any
199
+ provision is held unenforceable, the remaining provisions remain in
200
+ effect. A failure to enforce a provision is not a waiver. You may not
201
+ assign this Agreement without Licensor's written consent. Licensor may
202
+ assign this Agreement to an affiliate or successor.
203
+
204
+ The English version of this Agreement prevails over any translation. The
205
+ Chinese translation is provided for reference only.
206
+
207
+ 17. CONTACT
208
+
209
+ Licensor: Keragi (the individual developer or legal entity identified
210
+ in the applicable order, invoice or license notice)
211
+ Website: https://www.keragi.com
@@ -0,0 +1,109 @@
1
+ # Keragi 专有软件许可协议(中文参考译文)
2
+
3
+ 版本 1.1 — 2026-11-06
4
+
5
+ > 本文件是英文版 `LICENSE` 的参考译文,仅供理解。英文版与中文译文不一致时,以英文版为准。
6
+
7
+ 版权所有 (c) 2026 Keragi。保留一切权利。
8
+
9
+ 这是**专有软件许可协议**,仅授予本协议明确写明的权利,不转移软件所有权,也不授予任何源码许可。
10
+
11
+ ## 1. 定义
12
+
13
+ - **软件**:Keragi wasmx 宿主、WASM 资源、模板、脚本、配置示例、文档,以及依据本协议提供的更新或补充。
14
+ - **许可方**:Keragi,或依据本协议向你提供软件的合法主体或个人开发者。
15
+ - **付费功能**:许可方明确标注为收费、订阅制或需要单独商业授权的功能、资源、版本、容量或服务。
16
+
17
+ ## 2. 接受
18
+
19
+ 下载、安装、复制或使用软件,即表示你同意本协议。如不同意,请勿安装或使用软件,并删除已获得的副本。
20
+
21
+ 如你代表组织使用软件,你声明有权使该组织受本协议约束,且“你”包括该组织。
22
+
23
+ ## 3. 授权
24
+
25
+ 在遵守本协议的前提下,许可方授予你一项**有限、非独占、不可转让、不可再许可、可撤销**的许可,允许你在自己拥有或控制的服务器或设备上安装和使用软件,用于个人用途或内部业务。
26
+
27
+ 除非单独的订单、发票或书面协议另有约定,提供给你的版本免费。本协议不转移软件的所有权或知识产权,也不授予你获取、使用或修改源码的任何权利。
28
+
29
+ ## 4. 限制
30
+
31
+ 你不得,也不得允许第三方:
32
+
33
+ 1. 再分发、再许可、出售、出租、出借软件,或使第三方获得软件,除非许可方书面明确允许;
34
+ 2. 将软件作为托管服务、管理服务或服务局提供给第三方,除非你持有相应的商业许可;
35
+ 3. 修改、改编、翻译软件或创作衍生作品,但法律强制允许的除外;
36
+ 4. 反向工程、反编译或反汇编软件,但法律强制允许的除外;
37
+ 5. 移除、遮蔽或修改版权、商标、许可或其他权利声明;
38
+ 6. 绕过、禁用或干扰许可校验、付费功能控制、使用限制或技术保护措施;
39
+ 7. 使用软件侵犯他人权利或违反适用法律;
40
+ 8. 以可能损坏、禁用、过载或影响软件、网络或系统的方式使用软件。
41
+
42
+ ## 5. 免费版、付费版与订阅
43
+
44
+ 许可方可能提供免费版、付费版、资源或功能。付费功能需要单独的订单、订阅或商业许可;范围、价格、计费周期、试用、自动续订与取消、退款政策以订单或发布说明为准。
45
+
46
+ 除非你购买付费功能或续订订阅,不会自动转为付费版。订阅结束后,付费功能可能停止工作;其余功能以订阅条款和该版本适用的许可证为准。
47
+
48
+ 许可方可能在未来版本中调整哪些功能或资源免费或收费。此类调整适用于未来版本,不追溯改变你合法获得的某个版本已取得的权利,除非你主动升级到适用新条款的版本。
49
+
50
+ ## 6. 更新与支持
51
+
52
+ 除非另有单独协议,许可方没有义务提供更新、升级、维护或支持。许可方提供的更新适用本协议或随更新附带的条款;付费支持以订单为准。
53
+
54
+ ## 7. 第三方组件
55
+
56
+ 软件可能包含第三方组件,这些组件适用其各自的许可证和声明;就该等组件而言,第三方许可证优先于本协议。本协议不限制你在第三方许可证下可能享有的权利。需要时,第三方声明随软件提供或在网站上公布。
57
+
58
+ ## 8. 知识产权
59
+
60
+ 许可方及其许可人保留软件的全部权利、所有权和利益,包括所有知识产权。未明确授予的权利均予保留。
61
+
62
+ ## 9. 数据、隐私与安全
63
+
64
+ 你对自己使用软件处理、存储或传输的数据负责,并负责部署中的访问控制、备份和安全配置。如果你自行部署软件,你是该部署的运营者,应遵守适用的数据保护和隐私法律。
65
+
66
+ Keragi 的隐私政策适用于许可方就软件与网站处理的个人数据。软件并非旨在保证绝对安全,详见第 10、12 条。
67
+
68
+ ## 10. 无担保
69
+
70
+ 软件按“现状”和“可用”状态提供。在法律允许的最大范围内,许可方不提供任何明示或默示担保,包括适销性、特定用途适用性、权利完整性、不侵权、安全性、准确性、不中断或无错误运行的担保。你有责任自行测试软件、确认其适用于你的用途,并维护自己的备份。
71
+
72
+ ## 11. 责任限制
73
+
74
+ 在法律允许的最大范围内,许可方不对任何间接、附带、特殊、后果性或惩罚性损害,或数据、利润、收入、业务损失承担责任,即使已被告知可能发生此类损害。
75
+
76
+ 在法律允许的最大范围内,许可方在本协议下的总责任不超过你在索赔发生前十二(12)个月内为软件支付的金额;如果未付费,则为 100 美元。
77
+
78
+ 本协议不排除或限制依法不得排除或限制的责任,包括因过失、欺诈或故意不当行为导致死亡或人身伤害的责任(在相关法律禁止限制的范围内)。
79
+
80
+ ## 12. 高风险用途
81
+
82
+ 软件并非为生命支持、医疗、核设施、航空、应急、工业安全或其他高风险环境设计、测试或认证;在这些环境中,故障可能导致死亡、人身伤害、环境破坏或重大财产损失。你必须在此类环境中使用前取得独立安全认证并实现失效安全控制。
83
+
84
+ ## 13. 期限与终止
85
+
86
+ 本协议自生效之日起持续,直至终止。如果你实质违反本协议,你的权利自动终止。如法律要求,或继续提供软件变得不合法,许可方也可终止本协议。
87
+
88
+ 终止后,你必须停止使用软件并删除你持有或控制的所有副本。第 4、7、8、9、10、11、12、13、15 条在终止后继续有效。
89
+
90
+ ## 14. 合规
91
+
92
+ 你应遵守适用于软件使用的所有法律和法规,包括出口管制、制裁和数据保护法律。你不得在适用法律禁止的国家或场景中使用软件。
93
+
94
+ ## 15. 适用法律与争议
95
+
96
+ 本协议适用许可方设立地(注册地)法律;许可方为个人的,适用其居住地法律;排除冲突法规则。争议由许可方主要营业地有管辖权的法院解决;许可方为个人的,由其居住地有管辖权的法院解决,除非强制性消费者保护法律另有规定。
97
+
98
+ 本条不影响任何一方在任何有管辖权的法院申请禁令或其他衡平救济。
99
+
100
+ ## 16. 一般条款
101
+
102
+ 本协议构成你与许可方之间关于软件的完整协议,并取代此前关于同一主题的讨论。若任何条款被认定不可执行,其余条款继续有效。未执行某一条款不构成放弃。未经许可方书面同意,你不得转让本协议;许可方可向关联方或承继方转让本协议。
103
+
104
+ 本协议英文版优先于任何译文。中文译文仅供参考。
105
+
106
+ ## 17. 联系方式
107
+
108
+ 许可方:Keragi(以订单、发票或许可通知中载明的个人开发者或法律主体为准)
109
+ 网站:https://www.keragi.com