dsh-gufa-code 1.3.48 → 1.3.49

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
@@ -86,8 +86,7 @@ dsh plugin add dsh-gufa-code
86
86
  - 菜单栏「古法」图标 / 拖动条右键:也能退出摸鱼。
87
87
  - 选择器底部还有「自由悬浮(不吸附)」:不绑定窗口,自己拖拽缩放(同样带状态、同样可调透明度)。
88
88
  - 平台限制:
89
- - **macOS arm64(Apple Silicon)开箱可用**;
90
- - Intel Mac 需自行编译 helper:`./scripts/build-float-macos.sh`(需要 Xcode Command Line Tools),编译后放在 `desktop/float/bin/`;
89
+ - **macOS Apple Silicon / Intel 都开箱可用**:npm 包内带的是 universal helper(arm64 + x86_64),无需自己编译;
91
90
  - Windows / Linux 暂无悬浮层(其余 IDE 功能正常);
92
91
  - helper 为 ad-hoc 签名;首次启动若被系统拦截,在「隐私与安全性」里允许一次即可。
93
92
 
package/client.js CHANGED
@@ -16,7 +16,7 @@ const GUFA_NS = 'gufa-code'
16
16
  const G = {}
17
17
  G.NS = GUFA_NS
18
18
  /** 客户端构建标记(排查页面是否加载了新代码时看标题栏) */
19
- G.BUILD = '1.3.48'
19
+ G.BUILD = '1.3.49'
20
20
  G.PANEL_ID = 'gufa-code'
21
21
  /** 从哪个工作区点进来的(工作区菜单/节点按钮写入,App 启动时消费)。 */
22
22
  G.pendingEntryWorkspace = null
@@ -7,8 +7,8 @@
7
7
  <key>CFBundleDisplayName</key><string>古法编程悬浮层</string>
8
8
  <key>CFBundleExecutable</key><string>gufa-float</string>
9
9
  <key>CFBundlePackageType</key><string>APPL</string>
10
- <key>CFBundleShortVersionString</key><string>1.3.1</string>
11
- <key>CFBundleVersion</key><string>1.3.1</string>
10
+ <key>CFBundleShortVersionString</key><string>1.3.48</string>
11
+ <key>CFBundleVersion</key><string>1.3.48</string>
12
12
  <key>LSUIElement</key><true/>
13
13
  <key>NSHighResolutionCapable</key><true/>
14
14
  <key>NSPrincipalClass</key><string>NSApplication</string>
package/host/dev.js CHANGED
@@ -29,7 +29,7 @@ const runFile = promisify(execFile)
29
29
  /** 查找当前平台编译好的悬浮层 helper(P0 只支持 macOS)。 */
30
30
  function floatBinaryPath() {
31
31
  const arch = process.arch === 'arm64' ? 'arm64' : 'x64'
32
- const candidates = [`gufa-float-macos-${arch}`, 'gufa-float-macos-arm64', 'gufa-float-macos-x64']
32
+ const candidates = [`gufa-float-macos-${arch}`, 'gufa-float-macos-universal', 'gufa-float-macos-arm64', 'gufa-float-macos-x64']
33
33
  for (const name of candidates) {
34
34
  const full = join(PLUGIN_ROOT, 'desktop', 'float', 'bin', name)
35
35
  if (existsSync(full)) return full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gufa-code",
3
- "version": "1.3.48",
3
+ "version": "1.3.49",
4
4
  "description": "古法编程 · AI 辅助:一键把 DSH 主面板变成 VS Code 风格 IDE(Monaco 编辑器、文件树、Git、SSH、真实终端 + 右侧官方会话);主张亲手写、每个改动心中有数,AI 是助理、你是第一责任人",
5
5
  "icon": "icon.svg",
6
6
  "keywords": [
@@ -1,22 +1,50 @@
1
1
  #!/usr/bin/env bash
2
- # 构建 macOS 悬浮层 helper(P0/P1):Objective-C + AppKit + WebKit。
3
- # 产物 1:可直接启动的二进制(Host spawn 用)
4
- # 产物 2:.app bundle(方便用户在「屏幕录制」隐私列表里手动添加)
2
+ # 构建 macOS 悬浮层 helper:Objective-C + AppKit + WebKit。
3
+ # 产物:
4
+ # desktop/float/bin/gufa-float-macos-arm64 (Apple Silicon)
5
+ # desktop/float/bin/gufa-float-macos-x64 (Intel)
6
+ # desktop/float/bin/gufa-float-macos-universal (通用二进制,两个架构都能跑)
7
+ # desktop/float/古法编程悬浮层.app (通用二进制 + ad-hoc 签名)
8
+ # 在 Apple Silicon 上也能交叉编译 x86_64(Xcode CLT 自带两套架构 SDK),
9
+ # 所以 npm 包可以只带 universal 一份、Intel/Apple Silicon 开箱即用。
5
10
  set -euo pipefail
6
11
  cd "$(dirname "$0")/.."
7
12
  mkdir -p desktop/float/bin
8
- ARCH="$(uname -m)"
9
- OUT="desktop/float/bin/gufa-float-macos-${ARCH}"
10
- clang -fobjc-arc -O2 -framework AppKit -framework WebKit -framework Carbon -o "$OUT" desktop/float/GufaFloat.m
11
- chmod +x "$OUT"
12
- # 带稳定的 code identifier 签名(TCC 按它识别,避免每次构建都换身份字符串)
13
- codesign --force --sign - -i com.gufa.float "$OUT" >/dev/null 2>&1 || true
13
+
14
+ VERSION="$(node -p "require('./package.json').version" 2>/dev/null || echo 0.0.0)"
15
+ SRC=desktop/float/GufaFloat.m
16
+ TMP_ARM="$(mktemp /tmp/gufa-float-arm64.XXXXXX)"
17
+ TMP_X64="$(mktemp /tmp/gufa-float-x64.XXXXXX)"
18
+ trap 'rm -f "$TMP_ARM" "$TMP_X64"' EXIT
19
+
20
+ compile_arch() {
21
+ local arch="$1" out="$2"
22
+ clang -fobjc-arc -O2 -arch "$arch" \
23
+ -framework AppKit -framework WebKit -framework Carbon \
24
+ -o "$out" "$SRC"
25
+ }
26
+
27
+ echo "building arm64 slice..."
28
+ compile_arch arm64 "$TMP_ARM"
29
+ echo "building x86_64 slice..."
30
+ compile_arch x86_64 "$TMP_X64"
31
+
32
+ cp "$TMP_ARM" desktop/float/bin/gufa-float-macos-arm64
33
+ cp "$TMP_X64" desktop/float/bin/gufa-float-macos-x64
34
+ lipo -create "$TMP_ARM" "$TMP_X64" -output desktop/float/bin/gufa-float-macos-universal
35
+ chmod +x desktop/float/bin/gufa-float-macos-*.??? 2>/dev/null || true
36
+ chmod +x desktop/float/bin/gufa-float-macos-arm64 desktop/float/bin/gufa-float-macos-x64 desktop/float/bin/gufa-float-macos-universal
37
+
38
+ # 稳定的 code identifier(TCC 按它识别,避免每次构建换身份字符串)
39
+ codesign --force --sign - -i com.gufa.float desktop/float/bin/gufa-float-macos-arm64 >/dev/null 2>&1 || true
40
+ codesign --force --sign - -i com.gufa.float desktop/float/bin/gufa-float-macos-x64 >/dev/null 2>&1 || true
41
+ codesign --force --sign - -i com.gufa.float desktop/float/bin/gufa-float-macos-universal >/dev/null 2>&1 || true
14
42
 
15
43
  APP="desktop/float/古法编程悬浮层.app"
16
44
  rm -rf "$APP"
17
45
  mkdir -p "$APP/Contents/MacOS"
18
- cp "$OUT" "$APP/Contents/MacOS/gufa-float"
19
- cat > "$APP/Contents/Info.plist" <<'PLIST'
46
+ cp desktop/float/bin/gufa-float-macos-universal "$APP/Contents/MacOS/gufa-float"
47
+ cat > "$APP/Contents/Info.plist" <<PLIST
20
48
  <?xml version="1.0" encoding="UTF-8"?>
21
49
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
22
50
  <plist version="1.0">
@@ -26,8 +54,8 @@ cat > "$APP/Contents/Info.plist" <<'PLIST'
26
54
  <key>CFBundleDisplayName</key><string>古法编程悬浮层</string>
27
55
  <key>CFBundleExecutable</key><string>gufa-float</string>
28
56
  <key>CFBundlePackageType</key><string>APPL</string>
29
- <key>CFBundleShortVersionString</key><string>1.3.1</string>
30
- <key>CFBundleVersion</key><string>1.3.1</string>
57
+ <key>CFBundleShortVersionString</key><string>${VERSION}</string>
58
+ <key>CFBundleVersion</key><string>${VERSION}</string>
31
59
  <key>LSUIElement</key><true/>
32
60
  <key>NSHighResolutionCapable</key><true/>
33
61
  <key>NSPrincipalClass</key><string>NSApplication</string>
@@ -35,5 +63,6 @@ cat > "$APP/Contents/Info.plist" <<'PLIST'
35
63
  </plist>
36
64
  PLIST
37
65
  codesign --force --deep --sign - "$APP" >/dev/null 2>&1 || true
38
- echo "built: $OUT"
66
+
67
+ echo "built: desktop/float/bin/gufa-float-macos-universal ($(lipo -archs desktop/float/bin/gufa-float-macos-universal))"
39
68
  echo "built: $APP"