附加目录--add-dir,让 claude 能读写工作区之外的目录
让 claude 能读写工作区之外的目录。这些目录同时会成为文件浏览器的快捷入口。
diff --git a/gateway/web/lang-en.js b/gateway/web/lang-en.js
index 282416f7..711f38ed 100644
--- a/gateway/web/lang-en.js
+++ b/gateway/web/lang-en.js
@@ -2091,6 +2091,13 @@ window.I18N_DICT.en = {
"{v} 有已知问题:{why}\n\n仍然换到这一版?": "{v} has a known issue: {why}\n\nSwitch to this version anyway?",
"等 {n} 台": "({n} devices)",
"统计字数…": "Counting words…",
+ "工作岛(实时状态)": "Work Island (Live Status)",
+ "通过伴侣应用显示 Claude 的工作状态": "Show Claude's work status through a companion app",
+ "支持的小米设备由 cccodroid 直接发送实时通知;ColorOS 仍使用原工作岛。": "cccodroid posts live updates directly on supported Xiaomi devices. ColorOS still uses the Work Island companion.",
+ "试播 15 秒": "Preview for 15 seconds",
+ "小米原生超级岛:联调设备需加入小米设备白名单;正式版需获小米场景权限。未启用原生模式时使用 Android 实时通知。": "Xiaomi Super Island: test devices must be on Xiaomi’s device allowlist; release builds need Xiaomi scenario approval. Android Live Updates are used when native mode is unavailable.",
+ "工作岛回复预览": "Work Island reply previews",
+ "开启后,符合条件的回复正文摘要可能显示在系统通知中。仅在支持原生工作岛且工作岛已开启时生效。": "Show a short excerpt of eligible replies in system notifications. Only applies when native Work Island is supported and turned on.",
"工作岛(ColorOS 灵动岛)": "Work Island (ColorOS)",
"把 Claude 的工作状态显示在 ColorOS 16 的流体云 / 灵动岛上": "Show what Claude is doing in ColorOS 16's Fluid Cloud",
"需要另外安装「工作岛」应用。开启后,正在干活、等待确认、任务完成会出现在岛上的胶囊里;完成后 8 秒自动收起。目前仅在 ColorOS 16 / Android 16 上测试过。": "Requires the separate Work Island app. When on, “working”, “waiting for you” and “done” appear in the island capsule, which hides itself 8 seconds after a task finishes. Only tested on ColorOS 16 / Android 16 so far.",
diff --git a/gateway/web/theme.js b/gateway/web/theme.js
index 1a8567e5..9cfa52ff 100644
--- a/gateway/web/theme.js
+++ b/gateway/web/theme.js
@@ -23,7 +23,7 @@
try { if (k) sessionStorage.setItem("cc.bk", k); else k = sessionStorage.getItem("cc.bk") || ""; } catch {}
const PLAIN = ["hasPane", "paneCanBack", "whatsNew", "nightMode", "keyed", "wallColor"];
const KEYED = ["privShot", "openUrl", "paneOpen", "paneBounds", "paneGoBack", "paneClose", "openBrowser", "shareText", "copyText",
- "pickDevkit", "uninstall", "unfreeze", "ensureGateway", "whatsNewSeen", "setBars", "skinPref", "accentPref", "langPref", "themePref", "saveAs", "previewNet", "skinPal", "gcPal", "shareDone", "inputFocus"];
+ "pickDevkit", "uninstall", "unfreeze", "ensureGateway", "whatsNewSeen", "setBars", "skinPref", "accentPref", "langPref", "islandAvatar", "themePref", "saveAs", "previewNet", "skinPal", "gcPal", "shareDone", "inputFocus"];
const w = {};
for (const m of PLAIN) if (typeof raw[m] === "function") w[m] = (...a) => raw[m](...a);
for (const m of KEYED) if (typeof raw[m] === "function") w[m] = (...a) => raw[m](k, ...a);
diff --git a/scripts/build.sh b/scripts/build.sh
index 29a0ab58..2c133a1c 100644
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -159,6 +159,26 @@ if [ -n "$TARGET_SDK" ]; then
grep -q "android:targetSdkVersion=\"$TARGET_SDK\"" "$MANIFEST" || { echo "✗ 清单里改不动 targetSdkVersion"; exit 1; }
echo " targetSdk $TARGET_SDK"
fi
+# Optional Xiaomi local Super Island identity. Keep the checked-in manifest unconfigured.
+if [ -n "${XIAOMI_ISLAND_APP_ID:-}${XIAOMI_ISLAND_BUSINESS:-}${XIAOMI_ISLAND_DEBUG:-}" ]; then
+ node --input-type=module - "$MANIFEST" "$A/build/AndroidManifest.xml" <<'JS'
+import fs from 'node:fs';
+const { XIAOMI_ISLAND_APP_ID: id, XIAOMI_ISLAND_BUSINESS: business, XIAOMI_ISLAND_DEBUG: debug } = process.env;
+if (!/^[0-9]{1,32}$/.test(id ?? '') || !/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/.test(business ?? '') || !['true', 'false'].includes(debug)) {
+ console.error('小米超级岛:必须同时配置有效的 App ID、场景编码和 Debug 标识。');
+ process.exit(1);
+}
+const xml = fs.readFileSync(process.argv[2], 'utf8');
+if ((xml.match(/<\/application>/g) ?? []).length !== 1) throw new Error('Invalid application manifest');
+fs.writeFileSync(process.argv[3], xml.replace('', [
+ `
`,
+ `
`,
+ `
`,
+ '',
+].join('\n ')));
+JS
+ MANIFEST="$A/build/AndroidManifest.xml"
+fi
$AAPT2 link -o "$A/build/unsigned.apk" -I "$AJAR" \
--manifest "$MANIFEST" -A "$A/assets" "$A/build/res.zip"
# FILES 里的每个文件都得真进了包(aapt2 会丢点开头的、_ 开头目录这类):少一个,装好后 AppFiles 每次启动都判「被改过」、整个重铺