cicy-desktop 2.1.280 → 2.1.285

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.280",
3
+ "version": "2.1.285",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -0,0 +1,43 @@
1
+ @echo off
2
+ setlocal
3
+ rem ============================================================
4
+ rem CiCy Desktop - add a team by deeplink
5
+ rem
6
+ rem Usage:
7
+ rem add-team.bat -> uses the values below
8
+ rem add-team.bat <url> [title] [token]
9
+ rem
10
+ rem Works with the installed CiCy Desktop (registers cicy-desktop://).
11
+ rem If the app is not running it is launched; if it is running the
12
+ rem team is added to the running instance. No login is required:
13
+ rem the team is stored locally (teams.json) and appears in "我的团队".
14
+ rem ============================================================
15
+
16
+ rem ---- defaults (edit these before distributing) ----
17
+ set "TEAM_URL=http://127.0.0.1:8008"
18
+ set "TEAM_TITLE=My Team"
19
+ set "TEAM_TOKEN="
20
+
21
+ if not "%~1"=="" set "TEAM_URL=%~1"
22
+ if not "%~2"=="" set "TEAM_TITLE=%~2"
23
+ if not "%~3"=="" set "TEAM_TOKEN=%~3"
24
+
25
+ rem URL-encode the pieces with PowerShell (handles spaces, Chinese, & etc.)
26
+ for /f "usebackq delims=" %%E in (`powershell -NoProfile -Command "[uri]::EscapeDataString('%TEAM_URL%')"`) do set "ENC_URL=%%E"
27
+ for /f "usebackq delims=" %%E in (`powershell -NoProfile -Command "[uri]::EscapeDataString('%TEAM_TITLE%')"`) do set "ENC_TITLE=%%E"
28
+ set "ENC_TOKEN="
29
+ if not "%TEAM_TOKEN%"=="" for /f "usebackq delims=" %%E in (`powershell -NoProfile -Command "[uri]::EscapeDataString('%TEAM_TOKEN%')"`) do set "ENC_TOKEN=%%E"
30
+
31
+ set "LINK=cicy-desktop://addTeam?title=%ENC_TITLE%&url=%ENC_URL%"
32
+ if not "%ENC_TOKEN%"=="" set "LINK=%LINK%&token=%ENC_TOKEN%"
33
+
34
+ echo Adding team "%TEAM_TITLE%" (%TEAM_URL%) ...
35
+ start "" "%LINK%"
36
+ if errorlevel 1 (
37
+ echo Failed to open %LINK%
38
+ echo Is CiCy Desktop installed? ^(it registers the cicy-desktop:// protocol on first launch^)
39
+ pause
40
+ exit /b 1
41
+ )
42
+ echo Done. The team will show up in CiCy Desktop ^> 我的团队.
43
+ endlocal
@@ -0,0 +1,54 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>添加团队到 CiCy Desktop</title>
6
+ <style>
7
+ body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;background:#0a0a0a;color:#e6e6e9;font:15px/1.5 system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif}
8
+ .card{width:420px;max-width:92vw;background:#141416;border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:26px 24px;box-shadow:0 20px 60px rgba(0,0,0,.5)}
9
+ h1{font-size:18px;margin:0 0 4px}
10
+ p.sub{margin:0 0 18px;color:#8b8b92;font-size:13px}
11
+ label{display:block;font-size:12px;color:#8b8b92;margin:10px 0 4px}
12
+ input{width:100%;box-sizing:border-box;height:36px;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:#0a0a0a;color:#e6e6e9;padding:0 10px;font:13px ui-monospace,monospace;outline:0}
13
+ input:focus{border-color:#3b82f6}
14
+ button{margin-top:18px;width:100%;height:44px;border:0;border-radius:10px;background:#3b82f6;color:#fff;font-size:16px;font-weight:600;cursor:pointer}
15
+ button:hover{filter:brightness(1.08)}
16
+ .hint{margin-top:12px;font-size:12px;color:#8b8b92}
17
+ .hint code{color:#b4b4bb}
18
+ a{color:#9db0ff}
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <div class="card">
23
+ <h1>添加团队到 CiCy Desktop</h1>
24
+ <p class="sub">点一下按钮即可;需先安装并至少启动过一次 CiCy Desktop。</p>
25
+ <label>团队地址 URL</label>
26
+ <input id="url" value="http://127.0.0.1:8008" spellcheck="false">
27
+ <label>名称</label>
28
+ <input id="title" value="My Team" spellcheck="false">
29
+ <label>Token(可选)</label>
30
+ <input id="token" value="" spellcheck="false" placeholder="留空则不带">
31
+ <button id="go">添加到 CiCy Desktop</button>
32
+ <div class="hint" id="hint">未登录也可以:团队只存本地,会出现在「我的团队」里。</div>
33
+ </div>
34
+ <script>
35
+ // 用 ?url=&title=&token= 预填,方便做成固定链接分发
36
+ const q = new URLSearchParams(location.search);
37
+ for (const k of ["url","title","token"]) if (q.get(k)) document.getElementById(k).value = q.get(k);
38
+ function link(){
39
+ const url = document.getElementById("url").value.trim();
40
+ const title = document.getElementById("title").value.trim();
41
+ const token = document.getElementById("token").value.trim();
42
+ let s = "cicy-desktop://addTeam?title=" + encodeURIComponent(title) + "&url=" + encodeURIComponent(url);
43
+ if (token) s += "&token=" + encodeURIComponent(token);
44
+ return s;
45
+ }
46
+ document.getElementById("go").onclick = () => {
47
+ const s = link();
48
+ document.getElementById("hint").innerHTML = "已请求打开 <code>" + s.replace(/&token=[^&]*/, "&token=***") + "</code><br>没反应?说明 CiCy Desktop 还没安装或没启动过一次。";
49
+ location.href = s;
50
+ };
51
+ if (q.get("auto") === "1") document.getElementById("go").click();
52
+ </script>
53
+ </body>
54
+ </html>