Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 1 addition & 58 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,64 +219,7 @@ jobs:
run: cargo run --locked --manifest-path src-tauri/Cargo.toml --example credential_probe
- name: Build unsigned macOS app and DMG
id: macos_build
shell: bash
run: |
mkdir -p .artifacts
set -euo pipefail
capture_macos_state() {
state_log="$1"
{
printf 'captured_at=%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo '## macOS'
sw_vers || true
uname -a || true
echo '## Xcode'
xcodebuild -version || true
echo '## toolchain'
node --version || true
pnpm --version || true
rustc --version || true
cargo --version || true
echo '## attached disk images'
hdiutil info || true
echo '## disks'
diskutil list || true
echo '## mounts'
mount || true
echo '## bundle files'
find src-tauri/target/release/bundle -maxdepth 4 -print || true
} >"$state_log" 2>&1
}
: > .artifacts/macos-build.log
for attempt in 1 2 3; do
attempt_log=".artifacts/macos-build-attempt-${attempt}.log"
if pnpm tauri build --ci --verbose -- --locked 2>&1 | tee "$attempt_log" | tee -a .artifacts/macos-build.log; then
break
else
build_status=$?
fi
capture_macos_state ".artifacts/macos-build-attempt-${attempt}-state.log"
# Both image creation and detach can encounter transient DiskImages locks.
if [ "$attempt" -eq 3 ] || ! grep -Eq "hdiutil: (create failed - Resource busy|couldn't eject .* - Resource busy)" "$attempt_log"; then
exit "$build_status"
fi
echo 'retried=true' >> "$GITHUB_OUTPUT"
echo "::warning::DMG creation or unmount found a busy resource; retrying after $((attempt * 5)) seconds (attempt $attempt of 3)."
sleep "$((attempt * 5))"
done
- name: Collect macOS packaging diagnostics
if: ${{ always() && steps.macos_build.outcome == 'failure' }}
timeout-minutes: 2
shell: bash
run: |
mkdir -p .artifacts
{
sw_vers || true
uname -m || true
df -h . "$RUNNER_TEMP" || true
hdiutil info || true
diskutil list || true
} > .artifacts/macos-packaging-diagnostics.log 2>&1
run: python3 scripts/build_macos.py
Comment thread
knqiufan marked this conversation as resolved.
Resolved
- name: Upload macOS build diagnostics
if: ${{ failure() || steps.macos_build.outputs.retried == 'true' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
Expand Down
20 changes: 14 additions & 6 deletions desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,25 @@ Saving, checking and activating a profile are separate actions with distinct pro

Opening the global Scope picker elsewhere keeps the current page after selection and restores focus to its selector. Cancelling draft confirmation preserves the current input. Confirming a successful Scope switch discards the old Memory or connection-editor draft. Native states rejected as stale cannot open the activation guide or finish Scope navigation. Empty results offer another title, an access request or another connection; loading, permission, authentication and compatibility failures remain separate.

Reopening Desktop loads saved profiles without activating a private session. The local setup entry continues to point to Local Server guidance; approved installer results and default-Scope handoff remain owned with #2117.
Reopening Desktop loads saved profiles without activating a private session. Local setup offers separately approved installation and service plans, followed by a native handoff into the public default Scope.

## Local Server preparation
## Local Server setup and management

Overview remains the initial page. Its **Get started with PowerContext** guide offers **View local setup** and **Add connection**. Local setup opens and focuses the same **Settings & diagnostics → Local Server** preparation page; installation and recovery remain unavailable in this preview pending [#2306](https://github.com/oceanbase/powercontext/pull/2306). Adding a connection opens the existing editor. A saved-profile selector opens the exact selected profile for review, checking and explicit activation; reopening never restores a private connection or Scope.
Overview remains the initial page. Its **Get started with PowerContext** guide offers **View local setup** and **Add connection**. Local setup opens and focuses the same **Settings & diagnostics → Local Server** management page; opening it only inspects local facts and retained operation references. Adding a connection opens the existing editor. A saved-profile selector opens the exact selected profile for review, checking and explicit activation; reopening never restores a private connection or Scope.

After activation, the guide opens the shared exact-Scope picker and continues to Memories only after an explicit successful selection. With a selected Scope, it displays the actual connection and full `scope_id`, opens the existing save/search/exact-read/copy workspace, and explains unavailable operations. The three steps describe the journey; they do not track first-memory completion, usage counts or a complete inventory. **Dismiss guide** collapses the tutorial while preserving next actions and recovery; **Revisit guide** restores it. This preference lasts only until Desktop closes. Keyboard focus, existing draft-discard guards, English/Chinese and theme settings apply to these entries.

In disconnected Memories, **Set up locally** opens and focuses **Settings & diagnostics → Local Server**; **Connect an existing Server** opens the existing connection editor. Selecting either path does not install software, activate a connection, run diagnostics or probe readiness.

The Local Server guidance is also available by opening Settings directly, including when native state is loading or unavailable. It explicitly marks Desktop installation, recovery and service management as unavailable; that status makes no claim about an actual local installation or running service. Settings stays at the bottom of the sidebar.
With distributor-provisioned trusted Installer/Ops resources, choose install, repair, start, stop, restart, login startup or service-registration removal. Review the actual program/configuration/data locations, endpoint, pinned Server version, space requirement and service effects, then explicitly approve the one-shot plan. Installation phases, configuration, registration, process state, liveness and readiness are shown separately. Missing resources leave local controls unavailable and preserve existing-Server access.

Prepare a Server independently using [Install and run](../docs/en/docs/get-started/install-and-run.md) and [Deploy the Server](../docs/en/docs/operate/deploy-server.md), observing their platform limits. Confirm the actual address, authentication and a qualified Desktop compatibility profile, then save and explicitly activate the connection and select an exact Scope. A running Server alone does not establish Desktop compatibility. Existing independently running Servers do not need to be reinstalled. The in-app Usage help provides a copyable address for this guide.
Operations retain native references across Desktop exit. Reopening queries the selected operation's authoritative Ops status without replay. An interrupted/failed attempt can offer a fresh approved recovery plan for the original action/options. An unknown live executor is query-only; cancellation is a request, not confirmation of rollback or completion. Records from older bridges remain queryable, but missing action metadata cannot authorize resume.

After setup, explicitly choose **Connect and open default Scope**. Native code rechecks actual ownership, service/configuration/resource facts and the returned endpoint. A pinned managed catalog must name a bundled, current-contract Desktop qualification in `qualification_ref`; unqualified candidate references are rejected. The actual discovery package version must match the resource version. The ordinary connection manager then verifies identity/compatibility and resolves the public default Scope before opening Memory. This action discloses its readiness probe; application reopen never activates a session automatically.

Registration removal preserves configuration and data and does not uninstall Desktop. The OS-managed Server survives Desktop exit. Unfinished installation is not promised to continue after Quit; query its durable result on reopen. Signed Windows/macOS packages, published qualified resources and clean-machine installed acceptance remain release responsibilities under #2108/#2109/#2112.

See [the local setup contract](../docs/en/development/desktop-local-server.md) and [independent Server installation](../docs/en/docs/get-started/install-and-run.md).

## Run the installed preview

Expand Down Expand Up @@ -267,4 +273,6 @@ launcher with an absolute interpreter path; launchers that locate dependencies r
are unsuitable. The CLI must not depend on a shell profile or an interactive terminal.
Diagnostics keep the existing output limits and deadlines and terminate their private process group
on completion, timeout and cancellation. Before normal application exit, Desktop rejects new diagnostics,
cancels active work and waits for process-group cleanup and launcher reaping. The app does not install or manage a LaunchAgent.
cancels active work and waits for process-group cleanup and launcher reaping. Read-only diagnostics do not manage LaunchAgents; explicit Local Server actions use trusted independent Ops.

A pending local connection handoff may update the observed connection state after navigation. It opens Memories only while the initiating UI intent remains current; later navigation or editing keeps the current page, input and discard guard intact.
22 changes: 15 additions & 7 deletions desktop/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,25 @@ Scope 选择也具有应用层等待状态。Escape、关闭按钮及遮罩可

从其他位置打开全局 Scope 选择器,选择后仍停留在当前页面,焦点返回选择器。取消草稿确认会保留当前输入;确认切换且选择成功后,会丢弃旧记忆草稿或连接编辑草稿。被判为过期的原生状态不能打开激活引导或触发后续 Scope 导航。空结果提供修改标题、申请访问权限或选择其他连接的恢复方向;加载、权限、认证及兼容性错误继续分别呈现。

重新打开 Desktop 只加载已保存配置,不会激活私有会话。本地设置入口继续指向 Local Server 说明;经批准的安装结果与默认 Scope 交接仍需与 #2117 一起完成。
重新打开 Desktop 只加载已保存配置,不会激活私有会话。本地设置提供独立批准的安装与服务计划,并通过原生交接进入公开默认 Scope。

## Local Server 准备说明
## Local Server 安装与管理

默认启动页为总览。顶部“开始使用 PowerContext”引导提供“查看本机设置”和“添加连接”。前者打开并聚焦同一个“设置与诊断 → Local Server”准备说明页;当前预览尚未接入安装和恢复,相关集成仍由 [#2306](https://github.com/oceanbase/powercontext/pull/2306) 推进。后者进入现有连接编辑器。已保存配置可通过选择器精确打开,核对、检查后再明确启用;重新打开 Desktop 不会恢复私有连接或 Scope。
默认启动页为总览。顶部“开始使用 PowerContext”引导提供“查看本机设置”和“添加连接”。前者打开并聚焦同一个“设置与诊断 → Local Server”管理页;打开页面只检查本机事实和保留的操作引用。后者进入现有连接编辑器。已保存配置可通过选择器精确打开,核对、检查后再明确启用;重新打开 Desktop 不会恢复私有连接或 Scope。

连接激活后,引导打开共享的精确 Scope 选择器,只有明确选择成功才进入记忆页。已有 Scope 时,显示实际连接和完整 `scope_id`,提供现有保存、搜索、精确读取和复制流程的入口,并说明不可用操作。“连接之后”三步卡描述操作路径,不追踪首次记忆完成情况、使用次数或完整库存。“收起引导”会收起教程并保留下一步操作和恢复入口,“重新查看引导”可展开;该偏好仅保留到 Desktop 关闭。入口沿用键盘焦点、草稿丢弃确认、中英文和主题设置。

记忆页未连接时,“本地设置”进入并聚焦“设置与诊断 → Local Server”;“连接已有 Server”进入现有连接编辑器。选择任一路径都不会安装软件、激活连接、执行诊断或探测就绪状态。

也可直接进入设置查看 Local Server 说明;即使原生状态正在加载或不可用,说明仍可访问。区域明确标注 Desktop 安装、恢复及服务管理尚未接入,不据此判断本机是否已安装 Server 或服务是否运行。侧栏设置入口保持在底部。
发行方提供可信 Installer/Ops 资源后,可选择安装、修复、启动、停止、重启、登录启动设置或移除服务注册。查看实际程序、配置和数据位置、地址、固定 Server 版本、空间需求及服务影响,再明确批准一次性计划。安装阶段、配置、注册、进程、存活和就绪状态分别显示。缺少资源时,本地控制不可用,已有 Server 连接仍可使用。

请按[安装与运行](../docs/zh/docs/get-started/install-and-run.md)及[部署 Server](../docs/zh/docs/operate/deploy-server.md)独立准备 Server,并遵守文档中的平台适用范围。确认实际地址、认证方式和经过验证的 Desktop 兼容配置,再保存、显式激活连接并选择精确 Scope。Server 已运行不代表 Desktop 兼容性已验证;已有独立运行的 Server 无需重复安装。应用内“使用帮助”可复制本说明的文档地址。
操作引用跨 Desktop 退出保留。重开后查询所选操作的权威 Ops 状态,不会重放。中断或失败的尝试可对原操作及选项重新预检并批准恢复计划;执行进程仍不确定时只能查询。取消只是请求,不代表回滚或操作已经结束。旧 bridge 的记录仍可查询,但没有操作描述时不能授权恢复。

安装后明确选择“连接并进入默认 Scope”。原生代码重新检查实际归属、服务、配置、资源及返回的地址。固定 managed catalog 的 `qualification_ref` 必须指向内置且匹配当前契约的 Desktop 资格记录;未验证的候选引用会被拒绝。实际发现的 Server 版本须匹配资源版本。随后复用连接管理器检查身份和兼容性,通过公共接口解析默认 Scope 后进入记忆。此动作会说明就绪探测的影响;重开应用不会自动激活会话。

移除注册保留配置和数据,也不卸载 Desktop。操作系统管理的 Server 独立于 Desktop 存活。不能保证尚未完成的安装在退出后继续,应在重开后查询持久结果。正式签名的 Windows/macOS 安装包、已发布的资格资源和干净机器安装验收仍由 #2108/#2109/#2112 负责。

详见[本地设置契约](../docs/zh/development/desktop-local-server.md)及[独立安装 Server](../docs/zh/docs/get-started/install-and-run.md)。

## 直接运行安装版

Expand Down Expand Up @@ -138,7 +144,7 @@ pnpm --dir desktop desktop:dev
- 连接超时 5 秒、完整请求超时 15 秒、响应上限 1 MiB、每个客户端最多 4 个并发读取;超限明确失败。
- 主窗口可调用明确列出的连接、Scope、记忆和诊断命令;没有通用 fetch、shell、文件、数据库或读取秘密的 IPC。

应用不启动 Server、不管理服务、不持久化正文或查询;关闭窗口即退出。当前语言和主题也仅保留于会话内。
普通连接和 Memory 操作不会启动或管理 Server;本地服务修改必须通过明确批准的 Ops 计划。应用不持久化正文或查询,关闭窗口即退出。当前语言和主题也仅保留于会话内。

[安全边界](SECURITY.md)记录具体约束;[验证说明](VALIDATION.md)列出测试范围和仍未满足的 P0 门槛。构建成功、Mock 测试和当前用户机器上的运行都不能代替标准用户、签名、通知冷启动激活、独立服务和 Agent 宿主验收。

Expand Down Expand Up @@ -220,4 +226,6 @@ pnpm desktop:build

构建产物是未签名的内部预览。Developer ID 签名、公证、干净机器上的 Gatekeeper、辅助功能权限、真实输入法输入以及安装版钥匙串弹窗仍需单独验收。macOS CI 任务会测试 Apple Silicon 和 Intel 构建,但任务本身的存在不代表运行已通过。

macOS 本机诊断读取 `~/Library/Application Support/com.powercontext.desktop.preview/diagnostic-cli.json`。登记与 Windows 使用相同的 JSON 契约:绝对路径的 `powercontext` 可执行文件、经核对的 SHA-256 摘要和 `source: "explicit_local_installation"`。渲染进程无法提供可执行文件或参数。原生适配器只执行经过核验的 launcher 的私有只读副本。请使用自包含可执行文件,或解释器路径为绝对路径的 launcher;以自身位置查找依赖的 launcher 不适用。CLI 不能依赖 shell 配置或交互式终端。诊断沿用既有的输出上限与超时,并在完成、超时和取消时终止自己的私有进程组。应用正常退出前会拒绝新诊断、取消当前诊断,并等待进程组清理和 launcher 回收完成。应用不会安装或管理 LaunchAgent。
macOS 本机诊断读取 `~/Library/Application Support/com.powercontext.desktop.preview/diagnostic-cli.json`。登记与 Windows 使用相同的 JSON 契约:绝对路径的 `powercontext` 可执行文件、经核对的 SHA-256 摘要和 `source: "explicit_local_installation"`。渲染进程无法提供可执行文件或参数。原生适配器只执行经过核验的 launcher 的私有只读副本。请使用自包含可执行文件,或解释器路径为绝对路径的 launcher;以自身位置查找依赖的 launcher 不适用。CLI 不能依赖 shell 配置或交互式终端。诊断沿用既有的输出上限与超时,并在完成、超时和取消时终止自己的私有进程组。应用正常退出前会拒绝新诊断、取消当前诊断,并等待进程组清理和 launcher 回收完成。只读诊断不管理 LaunchAgent;明确批准的 Local Server 操作通过可信的独立 Ops 执行。

本地连接交接等待期间发生页面切换后,晚到结果仍可更新连接状态。只有发起交接时的界面意图仍然有效,才自动进入记忆页;后续导航或编辑会保留当前页面、输入及丢弃确认保护。
Loading
Loading