dsh-remote-plugin 0.8.3 → 0.8.4
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/apk/dsh-remote.apk +0 -0
- package/approval-summary.mjs +115 -0
- package/gateway.cjs +642 -16
- package/index.mjs +12 -0
- package/insights.mjs +1 -1
- package/package.json +2 -1
- package/plugin-center.mjs +88 -17
- package/plugin-transaction.mjs +19 -3
- package/public/admin.html +30 -28
- package/public/admin.js +1 -1
- package/public/announcements.json +31 -0
- package/public/app.js +40 -47
- package/public/approval-summary.js +78 -0
- package/public/build.json +2 -2
- package/public/cache-upgrade.js +51 -0
- package/public/chat-copy.js +34 -21
- package/public/desktop/desktop.css +18 -39
- package/public/desktop/desktop.html +70 -96
- package/public/desktop/desktop.js +15 -42
- package/public/e2ee-transport.js +147 -0
- package/public/extensions.js +6 -6
- package/public/history.js +48 -1
- package/public/index.html +74 -93
- package/public/md.js +36 -18
- package/public/motion.js +1 -1
- package/public/plugin-center.css +1 -0
- package/public/plugin-center.js +92 -11
- package/public/plugin.html +25 -24
- package/public/relay-devices.js +74 -0
- package/public/relay-settings.css +7 -0
- package/public/relay-settings.js +11 -4
- package/public/session-deck.css +7 -1
- package/public/session-deck.js +1 -1
- package/public/skins/blue-fish/preview.html +3 -2
- package/public/skins/bocchi/preview.html +5 -4
- package/public/skins/kita/preview.html +6 -5
- package/public/skins/nijika/preview.html +6 -5
- package/public/skins/penguin/preview.html +3 -2
- package/public/skins/ryo/preview.html +6 -5
- package/public/sponsor-entry.js +20 -21
- package/public/styles.css +24 -24
- package/public/teams.js +2 -2
- package/public/update.json +8 -8
- package/public/version.json +1 -1
- package/public/workflow.js +3 -4
- package/skills/dsh-remote-doctor/references/wiki/plugins.md +1 -1
- package/task-board.mjs +2 -2
- package/teams.mjs +7 -2
package/public/styles.css
CHANGED
|
@@ -81,8 +81,6 @@ button {
|
|
|
81
81
|
line-height: 1; vertical-align: middle; flex-shrink: 0;
|
|
82
82
|
}
|
|
83
83
|
.topbar-right .topbar-btn.icon-btn { width: 44px; padding: 0; font-size: 19px; border-radius: 12px; }
|
|
84
|
-
.topbar-right #btn-donate { color: var(--dsr-accent-2); }
|
|
85
|
-
.topbar-right #btn-feedback { color: var(--dsr-info); }
|
|
86
84
|
.topbar-right #btn-plugin-shortcuts { color: var(--dsr-accent-strong); }
|
|
87
85
|
.topbar-right .conn-badge:active { filter: brightness(.92); }
|
|
88
86
|
.topbar-right .topbar-btn.conn-badge { padding: 0 14px; border-radius: 999px; font-size: 12.5px; }
|
|
@@ -1040,23 +1038,6 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
|
|
|
1040
1038
|
}
|
|
1041
1039
|
.sheet-handle { width: 38px; height: 4px; border-radius: 999px; background: var(--dsr-line); margin: 2px auto 10px; }
|
|
1042
1040
|
.sheet-title { font-size: 14px; font-weight: 700; padding: 0 6px 8px; }
|
|
1043
|
-
.sheet-item {
|
|
1044
|
-
width: 100%; min-height: 52px; display: flex; align-items: center; gap: 11px;
|
|
1045
|
-
padding: 9px 10px; border-radius: 13px; border: none; background: transparent; color: var(--dsr-text);
|
|
1046
|
-
font: inherit; text-align: left; cursor: pointer; text-decoration: none;
|
|
1047
|
-
}
|
|
1048
|
-
.sheet-item:hover, .sheet-item:focus-visible { background: var(--dsr-bg); }
|
|
1049
|
-
.sheet-item.primary { background: var(--dsr-accent-soft); border: 1px solid var(--dsr-accent-line); }
|
|
1050
|
-
.sheet-item.primary:hover { background: var(--dsr-accent-soft); filter: brightness(1.03); }
|
|
1051
|
-
.sheet-ico {
|
|
1052
|
-
width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
|
|
1053
|
-
display: grid; place-items: center; background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-accent-strong);
|
|
1054
|
-
}
|
|
1055
|
-
.sheet-item.primary .sheet-ico { background: var(--dsr-accent-strong); border-color: var(--dsr-accent-strong); color: var(--dsr-on-accent); }
|
|
1056
|
-
.sheet-ico svg { width: 18px; height: 18px; fill: currentColor; }
|
|
1057
|
-
.sheet-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
1058
|
-
.sheet-item-name { font-size: 14px; font-weight: 600; }
|
|
1059
|
-
.sheet-item-desc { font-size: 12px; color: var(--dsr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1060
1041
|
|
|
1061
1042
|
/* ---------- 应用内选择抽屉 ---------- */
|
|
1062
1043
|
.custom-select-native {
|
|
@@ -1187,6 +1168,14 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
|
|
|
1187
1168
|
.archive-confirm-btn { flex: 1; padding: 11px 14px; border-radius: 12px; font-size: 15px; font-weight: 700; border: 1px solid var(--dsr-error); background: var(--dsr-error); color: #fff; }
|
|
1188
1169
|
.archive-confirm-btn:active { filter: brightness(.9); }
|
|
1189
1170
|
.announcement-card { border-top: 3px solid var(--dsr-accent); }
|
|
1171
|
+
.cache-upgrade-notice { position:fixed; z-index:39; top:calc(var(--dsr-safe-top,0px) + 8px); left:12px; right:12px; display:flex; gap:10px; align-items:center; padding:12px; border:1px solid var(--dsr-accent-line); border-radius:12px; background:var(--dsr-panel); color:var(--dsr-text); box-shadow:0 4px 18px var(--dsr-shadow); font-size:13px; }
|
|
1172
|
+
.cache-upgrade-notice span { flex:1; min-width:0; }
|
|
1173
|
+
.cache-upgrade-notice button { min-height:44px; flex:none; border:1px solid var(--dsr-line); border-radius:8px; background:var(--dsr-bg-2); color:inherit; padding:8px; font:inherit; }
|
|
1174
|
+
#modal-announcement { box-sizing:border-box; padding:max(12px,var(--dsr-safe-top)) 12px max(12px,var(--dsr-safe-b)); }
|
|
1175
|
+
#modal-announcement .announcement-card { display:flex; flex-direction:column; min-height:0; max-height:100%; overflow:hidden; box-sizing:border-box; }
|
|
1176
|
+
.announcement-scroll { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
|
|
1177
|
+
.announcement-card > .announcement-kicker,.announcement-card > .announcement-pagination,.announcement-card > .modal-actions { flex-shrink:0; }
|
|
1178
|
+
.announcement-card > .modal-actions { padding-top:10px; margin-top:8px; border-top:1px solid var(--dsr-line); }
|
|
1190
1179
|
.announcement-kicker { color: var(--dsr-accent-strong); font-size: 12px; font-weight: 700; letter-spacing: .04em; margin-bottom: 6px; }
|
|
1191
1180
|
.announcement-pagination { display:flex; align-items:center; justify-content:flex-end; gap:8px; margin:-2px 0 8px; color:var(--dsr-muted); font-size:12px; font-weight:650; }
|
|
1192
1181
|
.announcement-pagination .mini-btn { min-width:34px; min-height:30px; padding:2px 9px; font-size:19px; line-height:1; }
|
|
@@ -1434,10 +1423,21 @@ body.in-session #session-sub { min-height:32px; padding:4px 2px; }
|
|
|
1434
1423
|
|
|
1435
1424
|
/* Conversation copy controls remain reachable on touch and keyboard. */
|
|
1436
1425
|
.msg .role { display:flex; align-items:center; justify-content:space-between; gap:12px; opacity:1; }
|
|
1437
|
-
.chat-
|
|
1438
|
-
.chat-
|
|
1439
|
-
.chat-
|
|
1440
|
-
.chat-
|
|
1441
|
-
.chat-
|
|
1426
|
+
.chat-code { margin:10px 0; min-width:0; max-width:100%; border:1px solid var(--dsr-line); border-radius:10px; background:var(--dsr-code-bg); overflow:hidden; }
|
|
1427
|
+
.chat-code-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:40px; padding:0 3px 0 12px; border-bottom:1px solid var(--dsr-line); white-space:normal; }
|
|
1428
|
+
.chat-code-language { color:var(--dsr-muted); font:500 11px/1.4 ui-monospace,monospace; letter-spacing:.02em; }
|
|
1429
|
+
.chat-copy-button { position:relative; display:inline-flex; flex:none; align-items:center; justify-content:center; width:44px; height:44px; min-height:44px; padding:12px; margin:0; border:0; border-radius:7px; background:transparent; color:var(--dsr-muted); box-shadow:none; font:inherit; cursor:pointer; touch-action:manipulation; }
|
|
1430
|
+
.chat-copy-button svg { display:block; width:18px; height:18px; flex:none; pointer-events:none; }
|
|
1431
|
+
.chat-copy-button .chat-copy-check { display:none; }
|
|
1432
|
+
.chat-copy-button:hover { color:var(--dsr-accent-strong,var(--dsr-accent)); background:var(--dsr-accent-soft); }
|
|
1433
|
+
.chat-copy-button:focus-visible { outline:2px solid var(--dsr-accent); outline-offset:-3px; }
|
|
1434
|
+
.chat-copy-button:disabled { opacity:.55; cursor:wait; }
|
|
1435
|
+
.chat-copy-button[data-copy-state=copied] { color:var(--dsr-success,var(--dsr-accent-strong,var(--dsr-accent))); }
|
|
1436
|
+
.chat-copy-button[data-copy-state=copied] .chat-copy-icon { display:none; }
|
|
1437
|
+
.chat-copy-button[data-copy-state=copied] .chat-copy-check { display:block; }
|
|
1438
|
+
.chat-copy-status { position:absolute; right:42px; padding:3px 6px; border-radius:4px; background:var(--dsr-code-bg); color:inherit; font-size:11px; line-height:1.4; white-space:nowrap; pointer-events:none; }
|
|
1439
|
+
.chat-copy-status:empty { display:none; }
|
|
1440
|
+
.chat-code > pre { margin:0; border:0; border-radius:0; padding:12px 14px; background:transparent; white-space:pre; word-break:normal; }
|
|
1441
|
+
.chat-code > pre > code { display:block; padding:0; border-radius:0; background:transparent; color:inherit; white-space:pre; overflow-wrap:normal; word-break:normal; }
|
|
1442
1442
|
.feedback-length { margin:4px 0; color:var(--dsr-muted); font-size:12px; }
|
|
1443
1443
|
#fb-msg[aria-invalid="true"] { outline:2px solid var(--dsr-danger, #dc4444); }
|
package/public/teams.js
CHANGED
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
if (!valid() || request !== s.request) return
|
|
64
64
|
if (body.length > 2 * 1024 * 1024) throw Error('large')
|
|
65
65
|
const data = JSON.parse(body)
|
|
66
|
-
if (!response.ok || data.ok !== true) { root.DshExtensions?.reportAvailability?.(config, 'teams', { code: response.status === 401 || response.status === 403 ? 'host-denied' : data.code || (response.status === 404 ? '
|
|
66
|
+
if (!response.ok || data.ok !== true) { root.DshExtensions?.reportAvailability?.(config, 'teams', { code: response.status === 401 || response.status === 403 ? 'host-denied' : data.code || (response.status === 404 ? 'endpoint-missing' : 'read-failed') }); throw Error('read') }
|
|
67
67
|
if (data.schema !== 1 || data.available !== false && (!Array.isArray(data.teams) || data.workspaceId !== s.workspaceId)) throw Error('schema')
|
|
68
68
|
root.DshExtensions?.reportAvailability?.(config, 'teams', data)
|
|
69
|
-
if (data.available === false) { s.data = null; s.renderKey = ''; content.replaceChildren(); note.textContent = text('主机未提供兼容的智能体团队接口。','No compatible AgentTeams endpoint on this host.'); return }
|
|
69
|
+
if (data.available === false) { s.data = null; s.renderKey = ''; content.replaceChildren(); note.textContent = data.code === 'endpoint-missing' ? text('主机团队接口尚未挂载。请核对插件是否启用,必要时重启 DSH 后刷新。','The host team endpoint is not mounted. Check that the plugin is enabled; restart DSH if needed, then refresh.') : text('主机未提供兼容的智能体团队接口。','No compatible AgentTeams endpoint on this host.'); return }
|
|
70
70
|
render(data); s.data = data
|
|
71
71
|
note.textContent = data.truncated ? text('团队较多,仅显示前 40 个。','Showing the first 40 teams.') : `${data.teams.length} ${text('个团队 · 已更新','teams · Updated')}`
|
|
72
72
|
} catch (error) {
|
package/public/update.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
2
|
+
"version": "0.8.4",
|
|
3
3
|
"apkUrl": "dsh-remote.apk",
|
|
4
|
-
"sha256": "
|
|
5
|
-
"releasedAt": "2026-
|
|
6
|
-
"notes": "0.8.
|
|
4
|
+
"sha256": "d91f6504d0228afc24497437ef04f1f318329d5550780a6b4370b97357cf461d",
|
|
5
|
+
"releasedAt": "2026-11-03T09:49:38.250Z",
|
|
6
|
+
"notes": "0.8.4:新增 Android 试验性端到端加密中转、独立设备配对与到期撤销,关闭加密需逐次确认,连接失败不自动降级;新增按需生成的审批中文摘要,确认后调用当前会话模型并提示 token 消耗,摘要仅供参考;新增主机插件一键更新,失败停止并保留恢复入口,Remote 最后更新;完善旧历史缓存迁移、界面资源更新检测和升级时配置保留;修复 Windows 并发读取导致插件任务元数据原子替换偶发 EPERM,只对元数据改名做有界重试;优化审批及长公告操作栏,复制 md/markdown 块内原文并提供块内轻量复制按钮。浏览器和鸿蒙暂不支持新配对加密入口,基础赞助档仍不包含文件传输。",
|
|
7
7
|
"history": [
|
|
8
|
+
{
|
|
9
|
+
"version": "0.8.4",
|
|
10
|
+
"notes": "0.8.4:新增 Android 试验性端到端加密中转、独立设备配对与到期撤销,关闭加密需逐次确认,连接失败不自动降级;新增按需生成的审批中文摘要,确认后调用当前会话模型并提示 token 消耗,摘要仅供参考;新增主机插件一键更新,失败停止并保留恢复入口,Remote 最后更新;完善旧历史缓存迁移、界面资源更新检测和升级时配置保留;修复 Windows 并发读取导致插件任务元数据原子替换偶发 EPERM,只对元数据改名做有界重试;优化审批及长公告操作栏,复制 md/markdown 块内原文并提供块内轻量复制按钮。浏览器和鸿蒙暂不支持新配对加密入口,基础赞助档仍不包含文件传输。"
|
|
11
|
+
},
|
|
8
12
|
{
|
|
9
13
|
"version": "0.8.3",
|
|
10
14
|
"notes": "0.8.3:新增企鹅女管昼夜主题和孤独摇滚四人角色皮肤,皮肤选择器支持按IP分组与图片预览;新增对话消息和代码块复制;新增对话图片持久缓存、按连接隔离、缓存占用查看及图片/历史分别清理;反馈正文扩展至20000字符,超限和发送结果不确定时保留全文,完善收集器保存回执与兼容提示;优化插件安装预检的registry元数据读取和关联请求超时处理;修复角色皮肤设置页贴纸导致的横向溢出。"
|
|
@@ -40,10 +44,6 @@
|
|
|
40
44
|
{
|
|
41
45
|
"version": "0.7.1",
|
|
42
46
|
"notes": "适配 DSH 0.2.0-rc.2 的 Inbox 队列、后台任务流与子代理目录,修复子代理接口 404 和归档后刷新状态滞后,保留旧版实时通道兼容;修复 Desktop 插件面板被标题栏遮挡、收起后阴影残留及更新说明响应校验。合入鸿蒙插件中心、长按发送和主题改进,并修复切换连接时的旧确认卡、误发送及迟到回执问题;鸿蒙本次仅更新源码,暂不提供安装包。"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"version": "0.7.0",
|
|
46
|
-
"notes": "0.7.0:Windows 上未注册为服务的 DSH 可由 Remote 网关按已检查的 CLI 启动配置受控启动;已有 Windows 服务仍优先使用,网关只重启自己启动并持有句柄的进程。手机发送图片遇到 DSH 明确拒绝(当前模型不支持图片)时,可通过已启用的 dsh-image-vision 插件桥接附件;桥接失败不会提交不完整消息。保留长按插队发送、跨设备接续、鸿蒙客户端源码与平板分栏、网关 WebSocket Ping 分帧修复等 0.7.0 RC 功能。本次提供 Android APK 与 Windows/Linux 网关,不提供鸿蒙 HAP。"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
49
|
}
|
package/public/version.json
CHANGED
package/public/workflow.js
CHANGED
|
@@ -187,7 +187,8 @@
|
|
|
187
187
|
const language=$('btn-lang')?.closest('.setting-row,.ds-setting-row')
|
|
188
188
|
if(language&&home.contains(language))general?.append(language)
|
|
189
189
|
const about=$('settings-page-about'),servers=$('settings-page-servers')
|
|
190
|
-
if(about&&config.feedback)
|
|
190
|
+
if(about&&config.feedback){const feedback=button('提交反馈','Send feedback',config.feedback);feedback.id='btn-feedback-open';about.append(feedback)}
|
|
191
|
+
if(about&&config.doctor){const doctor=button('AI 医生','AI Doctor',config.doctor);doctor.id='btn-doctor-open';about.append(doctor)}
|
|
191
192
|
if(about&&root.DshDiagnostics)about.append(button('本地操作日志','Local operation logs',()=>root.DshDiagnostics.show()))
|
|
192
193
|
for(const id of ['btn-dsh-start','btn-host-describe']){const row=$(id)?.closest('.setting-row,.ds-setting-row');if(row&&about?.contains(row))servers?.append(row)}
|
|
193
194
|
const support=home.querySelector('.feedback-card');if(support)about?.append(support)
|
|
@@ -363,7 +364,7 @@
|
|
|
363
364
|
sheet.addEventListener('close',()=>{if(!sheet.open){restoreAttention();operationList=null}})
|
|
364
365
|
setupMore();setupStart();setupComposer();config.start?.()
|
|
365
366
|
const relaySettings=$('relay-settings')
|
|
366
|
-
if(relaySettings){$('settings-page-servers')?.append(relaySettings);root.DshRelaySettings?.mount(relaySettings,{connection:config.relay||config.operations})}
|
|
367
|
+
if(relaySettings){$('settings-page-servers')?.append(relaySettings);root.DshRelaySettings?.mount(relaySettings,{connection:config.relay||config.operations});root.DshE2eeTransport?.mount(relaySettings,{connection:config.relay||config.operations,onConnect:config.e2eeConnect,onModeChange:config.e2eeModeChange})}
|
|
367
368
|
setupSecondaryPages()
|
|
368
369
|
const overview=$('view-activity');if(overview)overview.dataset.workflowLegacy='overview'
|
|
369
370
|
if(!config.desktop){
|
|
@@ -372,13 +373,11 @@
|
|
|
372
373
|
for(const el of document.querySelectorAll('.bottom-nav [data-view="view-activity"],.bottom-nav [data-view="view-plugins"],nav [data-view="view-activity"],nav [data-view="view-plugins"]'))el.remove()
|
|
373
374
|
rename(document.querySelector('nav [data-view="view-settings"] [data-i18n]'),'更多','More')
|
|
374
375
|
if(badge)document.querySelector('nav [data-view="view-home"]')?.append(badge)
|
|
375
|
-
for(const id of ['btn-donate','btn-feedback']){const el=$(id);if(el)el.hidden=true}
|
|
376
376
|
}else{
|
|
377
377
|
const sessions=document.querySelector('.ds-nav-item[data-view="view-overview"]')
|
|
378
378
|
if(sessions){sessions.dataset.view='view-sessions';rename(sessions.querySelector('[data-i18n]'),'会话','Conversations')}
|
|
379
379
|
for(const el of document.querySelectorAll('.ds-nav-item[data-view="view-plugins"]'))el.hidden=true
|
|
380
380
|
rename(document.querySelector('[data-view="view-settings"] [data-i18n]'),'更多','More')
|
|
381
|
-
const feedback=$('btn-feedback');if(feedback)feedback.hidden=true
|
|
382
381
|
}
|
|
383
382
|
new MutationObserver(update).observe(document.documentElement,{attributes:true,attributeFilter:['lang']})
|
|
384
383
|
root.addEventListener('dsh-operation-change',update)
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
|
|
57
57
|
## KB-PLUGIN-05:任务看板、费用或团队数据显示不完整
|
|
58
58
|
|
|
59
|
-
**任务看板:**
|
|
59
|
+
**任务看板:** 开发源码适配 `@linxin666/dsh-client-ui-task-board` 的只读 `taskBoard.snapshot()`、schema 6/7(0.4.8/0.4.13);已发布 Remote 0.8.3 只支持 schema 6。先确认插件已启用且运行,再在其卡片打开看板并选已注册工作区。只展示该工作区的任务;未绑定、其他工作区、隐藏任务不展示,归档需勾选。最多 200 条,活跃与最近任务优先。新 schema 的电源控制、外部 provider 凭据及卡片默认提示不转发;未知后续 schema 仍明确返回不兼容,不自行读取账本文件。
|
|
60
60
|
|
|
61
61
|
**执行与验收:** 看板列是任务状态,最近执行是执行记录,验收是另一个结果,三者不能互相替代。外部报告和不属于主机登记工作区的执行会话不提供跳转。计划时间使用规则/主机时区;没有下次时间保持未知。
|
|
62
62
|
|
package/task-board.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* Read-only taskBoard service adapter
|
|
1
|
+
/* Read-only taskBoard service adapter for the published schema 6 and 7. */
|
|
2
2
|
const text = (value, max = 200) => typeof value === 'string' ? value.slice(0, max) : ''
|
|
3
3
|
const number = value => typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null
|
|
4
4
|
const record = value => value && typeof value === 'object' && !Array.isArray(value) ? value : {}
|
|
5
5
|
const id = value => typeof value === 'string' && value.length > 0 && value.length <= 200 && !/[\x00-\x20]/.test(value) ? value : ''
|
|
6
6
|
const statuses = new Set(['backlog','todo','running','done','failed'])
|
|
7
7
|
export function summarizeTaskBoard(raw, workspace) {
|
|
8
|
-
if (raw?.schemaVersion
|
|
8
|
+
if (![6, 7].includes(raw?.schemaVersion) || !Array.isArray(raw.tasks) || raw.tasks.length > 10000 || !Number.isSafeInteger(raw.revision) || raw.revision < 0) throw Error('unsupported')
|
|
9
9
|
const members = new Set(workspace.sessionIds || [])
|
|
10
10
|
const matching = raw.tasks.filter(task => task && task.workspaceId === workspace.id && task.hidden !== true)
|
|
11
11
|
.sort((a,b) => Number(number(a.archivedAt) > 0) - Number(number(b.archivedAt) > 0)
|
package/teams.mjs
CHANGED
|
@@ -31,11 +31,16 @@ export async function readTeamInsights(ctx, query, fetchState) {
|
|
|
31
31
|
try {
|
|
32
32
|
const registry = ctx.get?.('workspaceRegistry') ?? ctx.get?.('workspace')
|
|
33
33
|
if (!registry || typeof registry.list !== 'function') return { status: 503, body: { ok: false, code: 'workspace-unavailable' } }
|
|
34
|
-
const
|
|
34
|
+
const workspaces = await registry.list()
|
|
35
|
+
if (!Array.isArray(workspaces)) return { status: 503, body: { ok: false, code: 'workspace-unavailable' } }
|
|
36
|
+
const workspace = workspaces.find(row => row.id === id)
|
|
35
37
|
if (!workspace) return { status: 404, body: { ok: false, code: 'workspace-not-found' } }
|
|
36
38
|
// Upstream owns team assembly. Never scan client-supplied paths or forward controls.
|
|
37
39
|
const response = await fetchState(archived === '1')
|
|
38
|
-
|
|
40
|
+
// A missing native route is not evidence that the package is uninstalled:
|
|
41
|
+
// it may be loaded before Web services bind, or await a host restart.
|
|
42
|
+
if (response.status === 404) return { status: 200, body: { ok: true, schema: 1, available: false, code: 'endpoint-missing' } }
|
|
43
|
+
if (response.status === 401 || response.status === 403) return { status: 502, body: { ok: false, code: 'host-denied' } }
|
|
39
44
|
if (!response.ok) return { status: 502, body: { ok: false, code: 'teams-unavailable' } }
|
|
40
45
|
const reader = response.body.getReader(), chunks = []
|
|
41
46
|
let size = 0
|