Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
77727fc
发问读取实时 PDF 页码并在离开时保存阅读位置
taekchef Sep 26, 2026
95b52b4
重选跨课程共享资料时保留当前阅读页
taekchef Sep 26, 2026
cf3c866
补齐五种文稿的实时阅读位置、精确读取与恢复
taekchef Sep 26, 2026
f8e740d
feat: 统一文件导入确认流程
taekchef Sep 28, 2026
13aa1af
test: 修正导入计划断言
taekchef Sep 28, 2026
d51cfb7
fix: 确认 PDF 恢复页后再消费请求
taekchef Sep 28, 2026
15666b4
fix: 保留 Markdown 分页原文换行
taekchef Sep 28, 2026
0ec638d
fix: 补齐统一导入边界行为
taekchef Sep 28, 2026
eb53832
fix: 根治统一导入剩余边界
taekchef Sep 28, 2026
9ab59c9
fix: 按界面语言显示导入限制
taekchef Sep 28, 2026
945e161
fix: 收紧 PDF 恢复请求生命周期
taekchef Sep 28, 2026
9de7568
fix: 避免 PDF 请求编号遮蔽状态
taekchef Sep 28, 2026
deb71f0
fix: 按导入入口区分 Markdown 资料与笔记
taekchef Sep 28, 2026
2a6cc5e
test: 明确写闸门无基线场景
taekchef Sep 28, 2026
bd2b0e7
收紧统一导入确认面板布局
taekchef Sep 28, 2026
db39261
让导入面板按正文高度收缩
taekchef Sep 28, 2026
e4b556b
修复导入面板固有高度裁切
taekchef Sep 28, 2026
436fb51
同步测量导入面板正文高度
taekchef Sep 29, 2026
2365177
清理导入布局临时诊断
taekchef Sep 29, 2026
be1649b
记录导入弹窗完整尺寸链
taekchef Sep 29, 2026
ec28145
让导入弹窗持续跟随首选尺寸
taekchef Sep 29, 2026
6ce3600
拆分导入弹窗诊断表达式
taekchef Sep 29, 2026
2535bd5
按原生附属窗口同步导入弹窗尺寸
taekchef Sep 29, 2026
7791118
修正 Markdown 文件选择类型
taekchef Sep 29, 2026
a46f083
记录导入附属窗口原生几何
taekchef Sep 29, 2026
e5c78db
按独立场景同步导入弹窗尺寸
taekchef Sep 29, 2026
cddfde2
同步独立场景的导入窗口边界
taekchef Sep 29, 2026
7ad96aa
移除导入弹窗无意义分隔线
taekchef Sep 29, 2026
7ff0ebb
精简新建课程窗口并统一弹窗样式
taekchef Sep 29, 2026
231bf86
清理动态弹窗尺寸诊断
taekchef Sep 29, 2026
812cc6b
精简导入与新建课程弹窗信息层级
taekchef Sep 29, 2026
0920437
精简导入失败结果说明
taekchef Sep 29, 2026
ca05a4b
拒绝过期弹窗尺寸请求
taekchef Sep 29, 2026
953bcc4
恢复连续弹窗尺寸更新
taekchef Sep 29, 2026
4aff336
按内容几何调整弹窗尺寸
taekchef Sep 29, 2026
85de655
收拢确认导入窗口结构
taekchef Sep 29, 2026
741cf6f
移除弹窗尺寸的冗余状态标记
taekchef Sep 29, 2026
dc4a9db
补全导入范围与结果动作语义
taekchef Sep 29, 2026
4efbc81
复用文本父类型覆盖资料格式
taekchef Sep 29, 2026
f061bbb
按自然内容尺寸更新弹窗
taekchef Sep 29, 2026
74d5092
记录弹窗尺寸请求时序
taekchef Sep 29, 2026
778e733
同步弹窗内部视口尺寸
taekchef Sep 29, 2026
98635a2
通知弹窗宿主更新内容尺寸
taekchef Sep 29, 2026
41f8bbd
采样验收弹窗外层原生窗口尺寸
taekchef Sep 29, 2026
b17b1cf
清理弹窗尺寸临时诊断
taekchef Sep 29, 2026
fcef856
refine confirmed import completion flow
taekchef Sep 29, 2026
306bf1c
reveal imported batches in sidebar
taekchef Sep 29, 2026
d912835
修复课程笔记加载完成后仍转圈
taekchef Sep 29, 2026
215bdcf
fix: 发布课程笔记读盘完成状态
taekchef Sep 29, 2026
41fea83
fix: avoid conflicts when note snapshot matches disk
taekchef Sep 29, 2026
a71f324
修复原生选择窗中文件与目录混选
taekchef Sep 29, 2026
14ed00a
把对话设置改成连接卡片,并校正服务商标识。
taekchef Sep 30, 2026
c82ef07
Temporary acceptance: main plus PR #519
Oct 1, 2026
2f254c1
Prepare PR518 against restored main for acceptance
Oct 1, 2026
d690610
fix: validate new connection endpoints before mutation
codex Oct 1, 2026
bb012f4
test: reject cached Codex authentication probe success
Oct 1, 2026
ab1a01f
test: cover confirmed import duplicate recovery boundaries
codex Oct 1, 2026
5e18030
test: cover complete HTML reads and parsed block locations
Oct 1, 2026
aaf18b8
fix: preserve HTML full text and parse exact block aliases
Oct 1, 2026
3e615a0
Merge commit '0dc5238ecc7fce15c2372f1b1c31c54ac2fcb741' into codex/fi…
Oct 1, 2026
765498e
fix: restore connection model entry and current credential checks
Oct 1, 2026
308f89b
fix: preserve endpoint editing and reasoning mappings in connection s…
Oct 1, 2026
ead5649
fix: recover confirmed import duplicates after representative failures
codex Oct 1, 2026
852d776
fix: integrate live model catalog and connection credential state
Oct 1, 2026
44e3e84
Merge branch 'codex/fix-519-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
f7162f4
Merge commit '0dc5238ecc7fce15c2372f1b1c31c54ac2fcb741' into codex/fi…
Oct 1, 2026
8892831
Merge branch 'codex/fix-517-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
aea4746
fix: populate models when selecting saved connection cards
Oct 1, 2026
52e04ea
Merge branch 'codex/fix-519-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
62e2d34
Merge accepted pane and main changes into PR518 repair
codex Oct 1, 2026
f65c7aa
fix: use pinned HTML5 parser for reader block identity
Oct 1, 2026
d2a2a65
Integrate PR513 reading locations with PR515 language updates
Oct 1, 2026
768b5a5
Merge branch 'codex/fix-20261001-pr513' into codex/fix-20261001-pr513…
Oct 1, 2026
45e4f44
fix: refresh saved connection catalog after subscription login
Oct 1, 2026
aad5ee4
Merge branch 'codex/fix-517-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
9908a3b
Merge branch 'codex/fix-519-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
d0146ba
test: render connection cards with a synthetic unlisted model
Oct 1, 2026
ddb7394
Merge branch 'codex/fix-517-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
84508ea
Merge branch 'codex/fix-519-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
7676ecb
Merge branch 'codex/fix-517-20261001' into codex/fix-settings-pair-20…
Oct 1, 2026
d37da73
test: preserve empty catalog feedback and reject superseded model req…
Oct 1, 2026
18e98e7
test: bound asynchronous model request regression waits
Oct 1, 2026
ba20cc0
fix: preserve cold Codex lookup while another provider is refreshing
Oct 1, 2026
b88b528
fix: retain generation guarded cold composer integration
Oct 1, 2026
3da8dde
fix: wire probe state into Catalyst and preserve failed credential edits
Oct 1, 2026
267360a
fix: retain generation guarded paired catalog implementation
Oct 1, 2026
96a7039
Merge branch 'codex/report-package-size-20261001' into codex/prepare-…
Oct 1, 2026
100019f
Merge branch 'codex/report-package-size-20261001' into codex/fix-sett…
Oct 1, 2026
646b0f1
Merge branch 'codex/report-package-size-20261001' into codex/fix-2026…
Oct 1, 2026
fa10670
test: await initial Mermaid preview before measuring typing debounce
Oct 1, 2026
3660a11
Merge remote-tracking branch 'origin/main' into codex/pr519-followup-…
taekchef Oct 2, 2026
e0d908b
Merge branch 'codex/pr515-followup-20261002' into codex/pr513-followu…
taekchef Oct 2, 2026
4dac8fd
fix: bind connection authentication to profiles
taekchef Oct 2, 2026
28da939
test: verify confirmed import through the real Catalyst sheet
taekchef Oct 2, 2026
f9d637e
fix(import): secure confirmed import queue and copying
taekchef Oct 2, 2026
47c7347
fix: persist subscription login outside settings
taekchef Oct 2, 2026
1636396
Merge accepted interaction and floating checks into confirmed import
taekchef Oct 2, 2026
d2350a8
Merge branch 'codex/pr515-followup-20261002' into codex/pr519-followu…
taekchef Oct 2, 2026
5159bf1
test: capture connection cards in the real Catalyst settings window
taekchef Oct 2, 2026
8e655cd
fix: make reading location restoration one-shot
taekchef Oct 2, 2026
17ac64e
test: require fixture credentials for connection model checks
taekchef Oct 2, 2026
291608a
fix: preserve confirmed markdown reading location
taekchef Oct 2, 2026
dcf6639
Keep queued import metadata and verify reopened editor content
taekchef Oct 2, 2026
274901b
Merge remote-tracking branch 'refs/remotes/origin/main' into codex/pr…
taekchef Oct 2, 2026
1b120a3
Merge remote-tracking branch 'refs/remotes/origin/main' into codex/pr…
taekchef Oct 2, 2026
5ef3492
Merge remote-tracking branch 'refs/remotes/origin/main' into codex/pr…
taekchef Oct 2, 2026
95e37fc
Merge branch 'codex/pr513-followup-20261002' into codex/pr519-followu…
taekchef Oct 2, 2026
dda70a9
Integrate import and connection sheets with all acceptance gates
taekchef Oct 2, 2026
2943c37
Merge remote-tracking branch 'refs/remotes/origin/main' into codex/pr…
taekchef Oct 2, 2026
dcd5119
fix(check): observe actual Catalyst sheet hosts
taekchef Oct 2, 2026
e322c6b
fix(ui): update sheet content before resizing its host
taekchef Oct 2, 2026
0cc392c
fix(ui): identify the current sheet instead of counting scene windows
taekchef Oct 3, 2026
f146eac
fix(check): split sheet diagnostics into typed statements
taekchef Oct 3, 2026
614340c
fix(connections): initialize the active default profile from one load
taekchef Oct 3, 2026
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
21 changes: 21 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
| 没有桌面控制能力 | 完成可执行的实现、审查和自动检查;需要真实体验判断的部分明确记为“未验证”。 |

- 根据任务和风险决定是否需要真实交互证据,不因为助手能操作桌面就打开 App。自动检查已覆盖的同一行为无需重复人工取证;明显布局、新界面、视觉缺陷或依赖拖动等真实交互的体验结论,需要对应的真实 App 证据。
- 核对界面视觉状态时优先用自有能力直接取证(自截屏、诊断构建、CDP 等),不让用户替你截图、辨认窗口或描述画面。用户反馈“看不见/没有/不一样”时采信用户,重新取当前证据再下结论,不坚持自己对旧截图的解读。
- 截图或录屏只在有助于判断上述结果时提供,不凑窗口、主题和尺寸矩阵;材料不得包含私人内容或凭据。静态预览、编译成功和模拟结果不能冒充真实 App 验收。
- 缺少能力只阻塞依赖该能力的步骤,继续完成其余已授权工作。写清缺少的能力、未验证的场景及已有证据,不为普通开发强迫用户安装桌面工具或中途反复实测。若缺项是本次交付或合并、发布的必要条件,只报告已完成阶段,不能把缺项记为通过。

Expand Down Expand Up @@ -66,3 +67,23 @@
## 规则维护

用户授权修改规则后,将已确认的约定合并到对应章节,写明适用条件;不要在末尾持续追加重复偏好、临时结论和过期事实。路径、命令及实现状态以当前仓库为准。专题细节留在对应文档或代码中,本文件保留必要入口与长期约束。

## Learned User Preferences

- 改原生 Agent 的模型协议时,从各家协议共同遵守的规则出发,不能只把 DeepSeek 补对;其他实际使用的模型和协议也要一起满足。
- 推送、开合并请求和合入走命令行,不去浏览器网页里找按钮点;需要用户手动配置的步骤尽量由助手代为执行。
- 用户明确要求从零重做官网、宣传片等视觉物料时,不参考、不沿用旧版本。
- 宣传片这类对外动态视觉要体现真实产品交互(栏布局切换、拉拽、沉浸等),不要做成 PPT 式切片加字幕;迭代时另存新成片,不覆盖旧输出。
- 连接设置卡片要跟已定案原型一致:选中与否同等宽度、整卡可点、悬停有明显阴影;选中动效不要又重又钝,也不要一下跳过去显得廉价。
- 不要把小对话框塞进大白底里。Mac Catalyst 上 `.sheet` 本身是大白窗口,不会跟着内容的 `frame(width:)` 缩小;小对话框要让 sheet 贴合内容,并且只留一层纸色底。
- 连接卡片上的测活是图标加悬停说明,悬停必须能看出当前状态;不要直接写「测活」两个字。
- 测活时整张卡片边缘要有光效萦绕,活着显绿、不行显红;观感要现代,不要塑料廉价的小球或短线段。
- 每张连接卡片的测活状态互相独立,不能串到别的卡片;离开再回来不要还停在上次的成功绿态。

## Learned Workspace Facts

- 命令行访问 Codeberg 用的是 macOS 钥匙串里的凭据,与 Chrome 网页登录无关。不要执行 `git credential reject`,它会把钥匙串里的 Codeberg 登录删掉,导致后续推送和合入失败。
- Mac 版走 Mac Catalyst 目标;Swift 包编译通过不代表 Catalyst 能编过,打候选包前要单独编 Catalyst。同一时间只能跑一路 `xcodebuild` 打包,并行会锁住编译数据库。
- `check-ci.sh` 会弹出独立测试窗口(约两分钟),会打扰用户桌面;没跑时如实记为未运行。
- 对话设置里的连接同时支持账号登录(订阅/浏览器登录)和 API 密钥;改连接卡片或添加流程时两套都要保留,不能只留下填密钥。
- 模型名单与连接测活共用同一次鉴权拉取;菜单只列服务商返回的模型 id;令牌或登录失败不要写成网络失败;只允许最新一次进行中的名单请求写入列表。
9 changes: 9 additions & 0 deletions App/Dependencies.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"swiftPackages": [
{
"identity": "swiftsoup",
"kind": "remoteSourceControl",
"location": "https://github.com/scinfu/SwiftSoup.git",
"state": {
"revision": "18b80329749eca5ea29fc50211dca5c7eff5bfec",
"version": "2.13.9"
}
},
{
"identity": "highlightr",
"kind": "remoteSourceControl",
Expand Down
26 changes: 26 additions & 0 deletions App/Resources/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2199,3 +2199,29 @@ ReportLab 4.4.9 — BSD; Symbol byte-to-Unicode facts derived from its SymbolEnc
# SUCH DAMAGE.
#
#####################################################################################


SwiftSoup/LICENSE
============================================================
The MIT License

Copyright (c) 2009-2025 Jonathan Hedley <https://jsoup.org/>
Copyright (c) 2016-2025 Nabil Chatbi (Swift port)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 3 additions & 1 deletion App/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
func saveWorkspace() {
guard !Self.usesFixture else { return }
guard saveTask == nil else { return }
Self.workspace.commitCurrentReaderLocation()
backgroundTask = UIApplication.shared.beginBackgroundTask(withName: "保存魏碑工作台") { [weak self] in
MainActor.assumeIsolated {
self?.saveTask?.cancel()
Expand Down Expand Up @@ -355,6 +356,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {
guard !Self.usesFixture else { return }
Self.workspace.cancelAllAgentRequests()
Self.workspace.commitCurrentReaderLocation()
_ = Self.workspace.flushPendingWorkspaceSave()
Self.workspace.shutdownAgentRuntime()
}
Expand Down Expand Up @@ -394,7 +396,7 @@ struct CatalystWeiBeiApp: App {
private var workspaceContent: some View {
// Native size restrictions own the minimum; scrolling panes extend under the toolbar.
CatalystWorkspaceRoot(store: AppDelegate.workspace, appDelegate: appDelegate)
.onOpenURL { AppDelegate.workspace.importFiles([$0]) }
.onOpenURL { AppDelegate.workspace.receiveExternalFileForConfirmedImport($0) }
#if WEIBEI_ACCEPTANCE_CHECKS
.task {
if CommandLine.arguments.contains("--drag-profile"),
Expand Down
127 changes: 122 additions & 5 deletions App/Sources/CatalystBusinessCheck.swift
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ enum CatalystBusinessCheck {
store.continueLastWork()
store.ensureAllStudySessionMessagesLoaded()
try await until("reopened note editor") { !store.activeNoteIsLoading && store.noteText.contains(noteMarker) }
let renderedMarker = String(decoding: try JSONEncoder().encode(finalMarker), as: UTF8.self)
try await until("reopened note editor content") {
guard let webView = await editor(documentID: store.activeNoteEditorDocumentID) else { return false }
return (try? await webView.evaluateJavaScript("document.querySelector('.ProseMirror')?.textContent?.includes(\(renderedMarker)) === true") as? Bool) == true
}
let history = store.studySessions.flatMap(\.messages)
try check("reopen_original_note_and_session_files",
store.noteText.contains(finalMarker) && history.contains { $0.text.contains(finalMarker) && $0.completionState == .completed }
Expand Down Expand Up @@ -432,12 +437,49 @@ enum CatalystBusinessCheck {
try "# 阅读位置\n\n候选独立合成资料:内容增长时保留同一处文字。材料标记 WB452_SOURCE。\n".write(to: materialURL, atomically: true, encoding: .utf8)
let noteURL = inputs.appendingPathComponent("候选验证笔记.md")
try "# 候选验证笔记\n\n这是独立测试资料,不是用户笔记。\n".write(to: noteURL, atomically: true, encoding: .utf8)
let materials: [StudyItem] = await withCheckedContinuation { done in
store.importFiles([materialURL]) { done.resume(returning: $0) }
var confirmedItems: [StudyItem] = []
let importSheet = {
// Catalyst can host the sheet outside connectedScenes.windows.
CatalystIndependentSheetSizingProbe.Probe.checkInstances.allObjects
.first { $0.window?.isHidden == false && !$0.isHidden && $0.contentSize != nil }
}
let notes: [StudyItem] = await withCheckedContinuation { done in
store.importFiles([noteURL], markdownAsNotes: true) { done.resume(returning: $0) }
for (url, asNotes) in [(materialURL, false), (noteURL, true)] {
let previousIDs = Set(store.importedItems.map(\.id))
store.prepareConfirmedFileImport([url], asNotes: asNotes)
try await until("confirmed import review") {
store.confirmedFileImport?.stage == .reviewing
}
try await until("confirmed import fitted native sheet") {
guard let sheet = importSheet(), let size = sheet.contentSize,
let window = sheet.window, !window.isHidden,
let sceneSize = window.windowScene?.effectiveGeometry.systemFrame.size else { return false }
return abs(window.bounds.width - size.width) < 1
&& abs(window.bounds.height - size.height) < 1
&& abs(sceneSize.width - size.width) < 1
&& abs(sceneSize.height - size.height) < 1
&& size.width > 100 && size.height > 100
}
if !asNotes, let window = importSheet()?.window {
let snapshot = UIGraphicsImageRenderer(bounds: window.bounds).image { _ in
window.drawHierarchy(in: window.bounds, afterScreenUpdates: true)
}
try snapshot.pngData()?.write(to: LabMetrics.directory.appendingPathComponent("confirmed-import.png"))
}
store.confirmFileImport()
try await until("confirmed import completes and dismisses") {
store.confirmedFileImport == nil && importSheet() == nil
}
let added = store.importedItems.filter { !previousIDs.contains($0.id) }
guard added.count == 1, let imported = added.first,
let copiedURL = store.resolvedLibraryURL(for: imported),
try Data(contentsOf: copiedURL) == Data(contentsOf: url) else {
throw Failure("confirmed import did not preserve the material/note")
}
confirmedItems.append(imported)
}
let materials = Array(confirmedItems.prefix(1))
let notes = Array(confirmedItems.suffix(1))
try check("confirmed_import_review_copy_and_dismiss", confirmedItems.count == 2)
guard let material = materials.first, let note = notes.first,
let persistedNote = store.resolvedLibraryURL(for: note) else { throw Failure("original import returned no material/note") }
store.openCourseNote(note.id)
Expand Down Expand Up @@ -506,6 +548,38 @@ enum CatalystBusinessCheck {
try Data(contentsOf: Bundle.main.url(forResource: "landscape", withExtension: "png")!).write(to: imageURL, options: .atomic)
store.setAgentProviderID(.custom); store.updateAgentBaseURL(endpoint); store.updateModelName("catalyst-local-check")
AgentAccountService.shared.startAPIKeyLogin("catalyst-test-only", provider: .custom, baseURL: endpoint)
let activeConnection = store.activeAgentProfileID
try check("active_connection_profile_matches_configuration", store.agentCredentialProfiles.contains {
$0.id == activeConnection && $0.provider == .custom && $0.authMethod == .apiKey
&& $0.baseURL == endpoint && $0.modelName == "catalyst-local-check"
})
_ = try store.createAgentConnection(provider: .openaiCodex, authMethod: .subscription, baseURL: "")
store.selectAgentCredentialProfile(activeConnection)
try check("connection_profile_switch_back", store.activeAgentProfileID == activeConnection
&& store.agentProviderID == .custom && store.agentAuthMethod == .apiKey
&& store.agentBaseURL == endpoint && store.modelName == "catalyst-local-check")
NotificationCenter.default.post(name: .weibeiOpenSettings, object: nil)
let settingsScene = {
UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }
.first { ($0.session.userInfo?["weibei-settings"] as? Bool) == true }
}
try await until("connection cards in the real settings window") {
guard let window = settingsScene()?.windows.first(where: { !$0.isHidden }) else { return false }
return window.bounds.width >= 700 && window.bounds.height >= 600
&& !AgentAccountService.shared.isRefreshingModels
&& AgentAccountService.shared.hasLoadedModels(provider: .custom)
&& AgentAccountService.shared.liveModelIDs.contains("catalyst-local-check")
}
guard let scene = settingsScene(), let window = scene.windows.first(where: { !$0.isHidden }) else {
throw Failure("connection settings window disappeared")
}
let settingsSnapshot = UIGraphicsImageRenderer(bounds: window.bounds).image { _ in
window.drawHierarchy(in: window.bounds, afterScreenUpdates: true)
}
try settingsSnapshot.pngData()?.write(to: LabMetrics.directory.appendingPathComponent("connection-cards.png"))
try check("connection_cards_settings_and_authenticated_models", true)
UIApplication.shared.requestSceneSessionDestruction(scene.session, options: nil, errorHandler: nil)
try await until("settings window closes") { settingsScene() == nil }
store.select(itemID: material.id)
try await until("original composer mounted") {
AgentProviderReadiness.isConfigured(for: store)
Expand Down Expand Up @@ -636,7 +710,49 @@ enum CatalystBusinessCheck {
if CommandLine.arguments.contains("--exit-after-check") { exit(0) }
} catch {
result["failure"] = error.localizedDescription
result["connection_state"] = [
"provider": store.agentProviderID.rawValue,
"auth_method": store.agentAuthMethod.rawValue,
"model_list_failure": String(describing: AgentAccountService.shared.modelListFailure),
"live_models": AgentAccountService.shared.liveModelIDs.joined(separator: ","),
"is_refreshing": String(AgentAccountService.shared.isRefreshingModels)
]
let windows = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.flatMap(\.windows)
let sheetProbes = CatalystIndependentSheetSizingProbe.Probe.checkInstances.allObjects
let sheetProbeStates: [[String: String]] = sheetProbes.map { probe in
let window = probe.window
let scene = window?.windowScene
let root = window?.rootViewController
let rootView = root?.viewIfLoaded
let presentation = root?.presentationController
var state: [String: String] = [:]
state["frame"] = String(describing: probe.frame)
state["hidden"] = String(probe.isHidden)
state["content_size"] = String(describing: probe.contentSize)
state["window_bounds"] = String(describing: window?.bounds)
state["window_hidden"] = String(describing: window?.isHidden)
state["root_controller"] = root.map { String(reflecting: type(of: $0)) } ?? "nil"
state["root_preferred_size"] = String(describing: root?.preferredContentSize)
state["root_contains_probe"] = String(rootView.map { probe.isDescendant(of: $0) } ?? false)
state["root_view_window_matches"] = String(window != nil && rootView?.window === window)
state["presented_root_matches"] = String(root != nil && presentation?.presentedViewController === root)
state["root_has_presented_child"] = String(root?.presentedViewController != nil)
state["presentation_controller"] = presentation.map { String(reflecting: type(of: $0)) } ?? "nil"
state["rooted_window_count"] = String(scene?.windows.filter { $0.rootViewController != nil }.count ?? 0)
state["scene_minimum_size"] = String(describing: scene?.sizeRestrictions?.minimumSize)
state["scene_maximum_size"] = String(describing: scene?.sizeRestrictions?.maximumSize)
state["geometry_request"] = probe.checkGeometryRequest ?? ""
state["geometry_error"] = probe.checkGeometryError ?? ""
state["scene_frame"] = String(describing: scene?.effectiveGeometry.systemFrame)
state["scene_connected"] = String(scene.map { UIApplication.shared.connectedScenes.contains($0) } ?? false)
return state
}
result["confirmed_import_state"] = [
"stage": store.confirmedFileImport.map { String(describing: $0.stage) } ?? "dismissed",
"destination_error": store.confirmedFileImport?.destinationError ?? "",
"candidate_count": store.confirmedFileImport?.candidates.count ?? 0,
"sheet_probes": sheetProbeStates
]
result["failure_state"] = [
"application_state": UIApplication.shared.applicationState.rawValue,
"scene_states": UIApplication.shared.connectedScenes.map { $0.activationState.rawValue },
Expand Down Expand Up @@ -667,7 +783,8 @@ enum CatalystBusinessCheck {
"follows_latest": controller.followsLatest
]
}
if let window = conversation()?.view.window ?? windows.first {
if let window = sheetProbes.first(where: { $0.window?.isHidden == false })?.window
?? conversation()?.view.window ?? windows.first {
let snapshot = UIGraphicsImageRenderer(bounds: window.bounds).image { _ in
window.drawHierarchy(in: window.bounds, afterScreenUpdates: true)
}
Expand Down
Loading
Loading