@songsid/agend 2.4.0-beta.17 → 2.4.0-beta.18
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/dist/backend/claude-code.js +6 -2
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-transcript-errors.d.ts +4 -0
- package/dist/backend/claude-transcript-errors.js +5 -1
- package/dist/backend/claude-transcript-errors.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/cli-audited.js +6 -5
- package/dist/cli-audited.js.map +1 -1
- package/dist/daemon.d.ts +8 -0
- package/dist/daemon.js +62 -13
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-context.d.ts +1 -0
- package/dist/fleet-manager.d.ts +15 -1
- package/dist/fleet-manager.js +96 -9
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +1 -1
- package/dist/fleet-windows-runtime.js +1 -1
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/fleet-yaml-stringify.d.ts +3 -0
- package/dist/fleet-yaml-stringify.js +79 -0
- package/dist/fleet-yaml-stringify.js.map +1 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +10 -2
- package/dist/host-monitoring-alert-policy.d.ts +71 -0
- package/dist/host-monitoring-alert-policy.js +150 -0
- package/dist/host-monitoring-alert-policy.js.map +1 -0
- package/dist/host-monitoring-alert-resources.d.ts +11 -0
- package/dist/host-monitoring-alert-resources.js +16 -0
- package/dist/host-monitoring-alert-resources.js.map +1 -0
- package/dist/host-monitoring-alert-settings.d.ts +14 -0
- package/dist/host-monitoring-alert-settings.js +63 -0
- package/dist/host-monitoring-alert-settings.js.map +1 -0
- package/dist/host-monitoring-alert-store.d.ts +49 -0
- package/dist/host-monitoring-alert-store.js +228 -0
- package/dist/host-monitoring-alert-store.js.map +1 -0
- package/dist/host-monitoring-alert-text.d.ts +7 -0
- package/dist/host-monitoring-alert-text.js +10 -0
- package/dist/host-monitoring-alert-text.js.map +1 -0
- package/dist/host-monitoring-alerts.d.ts +76 -0
- package/dist/host-monitoring-alerts.js +261 -0
- package/dist/host-monitoring-alerts.js.map +1 -0
- package/dist/host-monitoring-footprint-policy.d.ts +45 -0
- package/dist/host-monitoring-footprint-policy.js +150 -0
- package/dist/host-monitoring-footprint-policy.js.map +1 -0
- package/dist/host-monitoring-footprint.d.ts +42 -0
- package/dist/host-monitoring-footprint.js +169 -0
- package/dist/host-monitoring-footprint.js.map +1 -0
- package/dist/host-monitoring-history-policy.d.ts +2 -0
- package/dist/host-monitoring-history-policy.js +16 -2
- package/dist/host-monitoring-history-policy.js.map +1 -1
- package/dist/host-monitoring-history-store.js +8 -6
- package/dist/host-monitoring-history-store.js.map +1 -1
- package/dist/host-monitoring-history-worker.js +19 -3
- package/dist/host-monitoring-history-worker.js.map +1 -1
- package/dist/host-monitoring-history.d.ts +9 -0
- package/dist/host-monitoring-history.js +45 -9
- package/dist/host-monitoring-history.js.map +1 -1
- package/dist/host-monitoring-process-identity.d.ts +8 -0
- package/dist/host-monitoring-process-identity.js +81 -0
- package/dist/host-monitoring-process-identity.js.map +1 -0
- package/dist/host-monitoring-runtime.d.ts +8 -0
- package/dist/host-monitoring-runtime.js +18 -3
- package/dist/host-monitoring-runtime.js.map +1 -1
- package/dist/host-monitoring.d.ts +2 -0
- package/dist/host-monitoring.js.map +1 -1
- package/dist/instance-lifecycle.js +2 -2
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/needs-you-hub.d.ts +1 -0
- package/dist/needs-you-hub.js +1 -0
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +3 -2
- package/dist/needs-you.js +1 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/public-web-gateway.js +7 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/runtime-cli-install.js +9 -9
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/settings-api.d.ts +2 -0
- package/dist/settings-api.js +56 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.js +5 -4
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +20 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/topic-commands.js +4 -0
- package/dist/topic-commands.js.map +1 -1
- package/dist/ui/chat-store.js +21 -4
- package/dist/ui/host-alerts.js +23 -0
- package/dist/ui/host-footprint.js +17 -0
- package/dist/ui/host-health.js +17 -12
- package/dist/ui/host-time.js +5 -0
- package/dist/ui/panel-chat.js +2 -0
- package/dist/ui/panel-needs.js +27 -16
- package/dist/ui/panel-settings.js +1 -0
- package/dist/ui/settings-host-alerts.js +22 -0
- package/dist/ui/settings-host-monitoring.js +8 -7
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app.css +50 -9
- package/dist/ui/shared/chat-render.js +24 -9
- package/dist/ui/shared/chat-strings.js +2 -2
- package/dist/ui/shared/chat-thread.js +3 -1
- package/dist/web-api.d.ts +2 -1
- package/dist/web-api.js +197 -6
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +40 -1
- package/dist/web-chat-history.js +131 -9
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-guest-access.js +4 -4
- package/dist/web-guest-access.js.map +1 -1
- package/dist/web-upload.d.ts +1 -1
- package/dist/web-upload.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/host-health.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {HostFootprintView,footprintText} from './host-footprint.js';
|
|
2
|
+
import {hostTime} from './host-time.js';
|
|
3
|
+
import {HostAlerts} from './host-alerts.js';
|
|
1
4
|
import {html,useEffect,useRef,useState} from '/assets/app-html.js';
|
|
2
5
|
import {register,t,lang} from '/assets/app-i18n.js';
|
|
3
6
|
import {PageHead} from '/assets/page-head.js';
|
|
@@ -7,11 +10,11 @@ import {sectionPath} from '/assets/app-route.js';
|
|
|
7
10
|
import {HOST_RANGES,numberOrNull,metricState,displayBytes,storageRows,historySeries,chartData,sampleCoverage} from './host-health-model.js';
|
|
8
11
|
|
|
9
12
|
register('hostHealth',{
|
|
10
|
-
en:{title:'Host health',computer:'This computer',lead:'CPU, memory and storage from the latest recorded samples.',settings:'Monitoring settings',refresh:'Refresh',refreshing:'Refreshing…',unsupported:'Host monitoring is not available on this computer.',off:'Host monitoring is off',offHint:'Turn it on in Settings to collect samples and keep bounded local history.',admin:'Administrator sign-in required',adminHint:'Sign in as a Fleet administrator to see host metrics.',starting:'Waiting for the first samples',stopping:'Stopping monitoring',failedHint:'Monitoring could not complete. Check its settings and local storage permissions; history cleanup may still need attention.',failed:'Monitoring needs attention',unavailable:'Not available',stale:'Stale',lastLabel:'Last successful sample:',last:'Last successful sample: {0}',none:'No successful sample yet',wsl:'WSL 2',linux:'Linux',darwin:'macOS',wslNote:'CPU and memory describe WSL, not the physical Windows computer. The Windows backing drive is shown separately.',macNote:'APFS volumes may share free space. Do not add their free space together. Available memory is an estimate; pressure is shown separately.',linuxNote:'Local Linux filesystems and available memory. Unavailable fields are not treated as zero.',runtimeNote:'Paired Windows Runtimes are separate computers and are not included in these totals.',storage:'Storage',root:'Linux filesystem',state:'Fleet state',backing:'Windows backing drive',volume:'Local volume',drive:' ({0}:)',shared:'Shared APFS capacity',sharedHint:'Do not add free space across volumes.',free:'{0} available',used:'{0}% used',unknownDrive:'Windows drive not identified',chooseDrive:'Choose drive in Settings',unknownHint:'Linux free space alone does not show whether the Windows drive holding WSL has room.',cpu:'CPU',wslCpu:'WSL CPU',wslMemory:'WSL memory',cpuUsed:'{0}% used',cores:'{0} logical CPUs',loadLabel:'Load average:',load:'Load average: {0}',memory:'Memory',available:'{0} available of {1}',pressureLabel:'Memory pressure:',pressure:'Memory pressure: {0}',normal:'Normal',elevated:'Elevated',critical:'Critical',unknown:'Unknown',swap:'Swap free: {0}',history:'History',range:'History range',coverageSummary:'{0} of {1} readings have fresh data',collecting:'Collecting history…',noHistory:'No recorded samples in this range',historyUnavailable:'Recorded history is temporarily unavailable. Refresh to try again.',historyLoading:'Loading recorded history…',historyWaiting:'History has not started recording yet.',historyPaused:'History recording is paused.',historyFailed:'History could not be recorded. Current samples remain available.',lowSpace:'Low storage: keeping current samples in memory only.',recovering:'Waiting for both storage volumes to stay above 4 GiB for ten minutes.',diskUnavailable:'Storage data is unavailable; history is paused.',backingUnknown:'Identify the Windows backing drive before history can be recorded.',clockChanged:'The computer clock moved backwards; recording is waiting for it to catch up.',historyBusy:'History storage is busy; no additional write is queued.',minimum:'Minimum: {0}',maximum:'Peak: {0}',coverage:'{0} of {1} chart buckets contain recorded samples',gaps:'Gaps mean no sample was recorded; they are not zero.',retention:'History is capped at 64 MiB, with up to 24 hours of raw samples and 30 days of rollups. Older samples may be pruned earlier.',
|
|
11
|
-
'zh-TW':{title:'主機狀態',computer:'這台電腦',lead:'依最新記錄的取樣查看 CPU、記憶體與儲存空間。',settings:'監測設定',refresh:'重新整理',refreshing:'重新整理中…',unsupported:'這台電腦尚未提供主機監測。',off:'主機監測已關閉',offHint:'請在設定中開啟,開始取樣並保留容量受限的本機歷史。',admin:'需要管理員登入',adminHint:'請以 Fleet 管理員身分登入,才能查看主機資料。',starting:'等待第一筆取樣',stopping:'正在停止監測',failedHint:'主機監測未能完成操作,請檢查設定與本機儲存空間權限;歷史資料可能仍需清理。',failed:'主機監測需要處理',unavailable:'無法取得',stale:'資料已過期',lastLabel:'最後成功取樣:',last:'最後成功取樣:{0}',none:'尚無成功的取樣',wsl:'WSL 2',linux:'Linux',darwin:'macOS',wslNote:'CPU 與記憶體代表 WSL,不是實體 Windows 電腦。存放 WSL 的 Windows 磁碟會另外列出。',macNote:'APFS 磁碟區可能共用空間,請勿把可用空間相加。可用記憶體是估算值,記憶體壓力會另外顯示。',linuxNote:'本機 Linux 檔案系統與可用記憶體。無法取得的欄位不會當作零。',runtimeNote:'配對的 Windows 電腦是另一台,不算在這裡的數字裡。',storage:'儲存空間',root:'Linux 檔案系統',state:'Fleet 狀態資料',backing:'存放 WSL 的 Windows 磁碟',volume:'本機磁碟區',drive:'({0}:)',shared:'共用 APFS 容量',sharedHint:'請勿把各磁碟區的可用空間相加。',free:'可用 {0}',used:'已使用 {0}%',unknownDrive:'尚未確認 Windows 磁碟',chooseDrive:'到設定選擇磁碟',unknownHint:'只有 Linux 的可用空間,無法判斷存放 WSL 的 Windows 磁碟是否還有空間。',cpu:'CPU',wslCpu:'WSL CPU',wslMemory:'WSL 記憶體',cpuUsed:'使用率 {0}%',cores:'{0} 個邏輯 CPU',loadLabel:'平均負載:',load:'平均負載:{0}',memory:'記憶體',available:'可用 {0},共 {1}',pressureLabel:'記憶體壓力:',pressure:'記憶體壓力:{0}',normal:'正常',elevated:'偏高',critical:'嚴重',unknown:'未知',swap:'Swap 可用:{0}',history:'歷史紀錄',range:'歷史期間',coverageSummary:'{1} 項讀數中,{0} 項有最新資料',collecting:'正在累積歷史紀錄…',noHistory:'這段期間尚無記錄的取樣',historyUnavailable:'暫時無法取得歷史紀錄,請重新整理再試。',historyLoading:'正在載入歷史紀錄…',historyWaiting:'歷史紀錄尚未開始取樣。',historyPaused:'歷史紀錄已暫停。',historyFailed:'無法記錄歷史,目前的取樣仍可查看。',lowSpace:'儲存空間不足:目前取樣只保留在記憶體中。',recovering:'等待兩個儲存空間持續十分鐘都超過 4 GiB。',diskUnavailable:'無法取得儲存空間資料,歷史紀錄已暫停。',backingUnknown:'請先確認存放 WSL 的 Windows 磁碟,再記錄歷史。',clockChanged:'電腦時間往回調整,正在等待時間追上後再記錄。',historyBusy:'歷史儲存空間忙碌中,不會排入額外的寫入。',minimum:'最低:{0}',maximum:'最高:{0}',coverage:'{1} 個圖表區間中,{0} 個有記錄取樣',gaps:'缺口代表沒有記錄取樣,不是零。',retention:'歷史資料最多 64 MiB;原始取樣最多保留 24 小時,彙整最多 30 天。較舊的取樣可能提早清除。',
|
|
13
|
+
en:{title:'Host health',computer:'This computer',lead:'CPU, memory and storage from the latest recorded samples.',settings:'Monitoring settings',refresh:'Refresh',refreshing:'Refreshing…',unsupported:'Host monitoring is not available on this computer.',off:'Host monitoring is off',offHint:'Turn it on in Settings to collect samples and keep bounded local history.',admin:'Administrator sign-in required',adminHint:'Sign in as a Fleet administrator to see host metrics.',starting:'Waiting for the first samples',stopping:'Stopping monitoring',failedHint:'Monitoring could not complete. Check its settings and local storage permissions; history cleanup may still need attention.',failed:'Monitoring needs attention',unavailable:'Not available',stale:'Stale',lastLabel:'Last successful sample:',last:'Last successful sample: {0}',none:'No successful sample yet',wsl:'WSL 2',linux:'Linux',darwin:'macOS',wslNote:'CPU and memory describe WSL, not the physical Windows computer. The Windows backing drive is shown separately.',macNote:'APFS volumes may share free space. Do not add their free space together. Available memory is an estimate; pressure is shown separately.',linuxNote:'Local Linux filesystems and available memory. Unavailable fields are not treated as zero.',runtimeNote:'Paired Windows Runtimes are separate computers and are not included in these totals.',storage:'Storage',root:'Linux filesystem',state:'Fleet state',backing:'Windows backing drive',volume:'Local volume',drive:' ({0}:)',shared:'Shared APFS capacity',sharedHint:'Do not add free space across volumes.',free:'{0} available',used:'{0}% used',unknownDrive:'Windows drive not identified',chooseDrive:'Choose drive in Settings',unknownHint:'Linux free space alone does not show whether the Windows drive holding WSL has room.',cpu:'CPU',wslCpu:'WSL CPU',wslMemory:'WSL memory',cpuUsed:'{0}% used',cores:'{0} logical CPUs',loadLabel:'Load average:',load:'Load average: {0}',memory:'Memory',available:'{0} available of {1}',pressureLabel:'Memory pressure:',pressure:'Memory pressure: {0}',normal:'Normal',elevated:'Elevated',critical:'Critical',unknown:'Unknown',swap:'Swap free: {0}',history:'History',range:'History range',coverageSummary:'{0} of {1} readings have fresh data',collecting:'Collecting history…',noHistory:'No recorded samples in this range',historyUnavailable:'Recorded history is temporarily unavailable. Refresh to try again.',historyLoading:'Loading recorded history…',historyWaiting:'History has not started recording yet.',historyPaused:'History recording is paused.',historyFailed:'History could not be recorded. Current samples remain available.',lowSpace:'Low storage: keeping current samples in memory only.',recovering:'Waiting for both storage volumes to stay above 4 GiB for ten minutes.',diskUnavailable:'Storage data is unavailable; history is paused.',backingUnknown:'Identify the Windows backing drive before history can be recorded.',clockChanged:'The computer clock moved backwards; recording is waiting for it to catch up.',historyBusy:'History storage is busy; no additional write is queued.',minimum:'Minimum: {0}',maximum:'Peak: {0}',coverage:'{0} of {1} chart buckets contain recorded samples',gaps:'Gaps mean no sample was recorded; they are not zero.',retention:'History is capped at 64 MiB, with up to 24 hours of raw samples and 30 days of rollups. Older samples may be pruned earlier.',snapshotOnly:'Refresh reads saved snapshots. It does not start a new probe.',samples:'Host every 30 s · storage every 60 s',chart:'{0} history',usedHistory:'Storage used',freeHistory:'Available space trend',notMeasured:'Not measured'},
|
|
14
|
+
'zh-TW':{title:'主機狀態',computer:'這台電腦',lead:'依最新記錄的取樣查看 CPU、記憶體與儲存空間。',settings:'監測設定',refresh:'重新整理',refreshing:'重新整理中…',unsupported:'這台電腦尚未提供主機監測。',off:'主機監測已關閉',offHint:'請在設定中開啟,開始取樣並保留容量受限的本機歷史。',admin:'需要管理員登入',adminHint:'請以 Fleet 管理員身分登入,才能查看主機資料。',starting:'等待第一筆取樣',stopping:'正在停止監測',failedHint:'主機監測未能完成操作,請檢查設定與本機儲存空間權限;歷史資料可能仍需清理。',failed:'主機監測需要處理',unavailable:'無法取得',stale:'資料已過期',lastLabel:'最後成功取樣:',last:'最後成功取樣:{0}',none:'尚無成功的取樣',wsl:'WSL 2',linux:'Linux',darwin:'macOS',wslNote:'CPU 與記憶體代表 WSL,不是實體 Windows 電腦。存放 WSL 的 Windows 磁碟會另外列出。',macNote:'APFS 磁碟區可能共用空間,請勿把可用空間相加。可用記憶體是估算值,記憶體壓力會另外顯示。',linuxNote:'本機 Linux 檔案系統與可用記憶體。無法取得的欄位不會當作零。',runtimeNote:'配對的 Windows 電腦是另一台,不算在這裡的數字裡。',storage:'儲存空間',root:'Linux 檔案系統',state:'Fleet 狀態資料',backing:'存放 WSL 的 Windows 磁碟',volume:'本機磁碟區',drive:'({0}:)',shared:'共用 APFS 容量',sharedHint:'請勿把各磁碟區的可用空間相加。',free:'可用 {0}',used:'已使用 {0}%',unknownDrive:'尚未確認 Windows 磁碟',chooseDrive:'到設定選擇磁碟',unknownHint:'只有 Linux 的可用空間,無法判斷存放 WSL 的 Windows 磁碟是否還有空間。',cpu:'CPU',wslCpu:'WSL CPU',wslMemory:'WSL 記憶體',cpuUsed:'使用率 {0}%',cores:'{0} 個邏輯 CPU',loadLabel:'平均負載:',load:'平均負載:{0}',memory:'記憶體',available:'可用 {0},共 {1}',pressureLabel:'記憶體壓力:',pressure:'記憶體壓力:{0}',normal:'正常',elevated:'偏高',critical:'嚴重',unknown:'未知',swap:'Swap 可用:{0}',history:'歷史紀錄',range:'歷史期間',coverageSummary:'{1} 項讀數中,{0} 項有最新資料',collecting:'正在累積歷史紀錄…',noHistory:'這段期間尚無記錄的取樣',historyUnavailable:'暫時無法取得歷史紀錄,請重新整理再試。',historyLoading:'正在載入歷史紀錄…',historyWaiting:'歷史紀錄尚未開始取樣。',historyPaused:'歷史紀錄已暫停。',historyFailed:'無法記錄歷史,目前的取樣仍可查看。',lowSpace:'儲存空間不足:目前取樣只保留在記憶體中。',recovering:'等待兩個儲存空間持續十分鐘都超過 4 GiB。',diskUnavailable:'無法取得儲存空間資料,歷史紀錄已暫停。',backingUnknown:'請先確認存放 WSL 的 Windows 磁碟,再記錄歷史。',clockChanged:'電腦時間往回調整,正在等待時間追上後再記錄。',historyBusy:'歷史儲存空間忙碌中,不會排入額外的寫入。',minimum:'最低:{0}',maximum:'最高:{0}',coverage:'{1} 個圖表區間中,{0} 個有記錄取樣',gaps:'缺口代表沒有記錄取樣,不是零。',retention:'歷史資料最多 64 MiB;原始取樣最多保留 24 小時,彙整最多 30 天。較舊的取樣可能提早清除。',snapshotOnly:'重新整理只讀取已保存的取樣,不會啟動新的探測。',samples:'主機每 30 秒 · 儲存空間每 60 秒',chart:'{0} 歷史',usedHistory:'儲存空間使用率',freeHistory:'可用空間趨勢',notMeasured:'未量測'}
|
|
12
15
|
});
|
|
13
16
|
const text=(key,...values)=>t(`hostHealth.${key}`,...values);
|
|
14
|
-
const date=value=>numberOrNull(value)===null?text('none'):
|
|
17
|
+
const date=value=>numberOrNull(value)===null?text('none'):hostTime(value);
|
|
15
18
|
const sampleTime=value=>html`${text('lastLabel')}${lang()==='zh-TW'?'':' '}<span class="host-sample-time">${date(value)}</span>`;
|
|
16
19
|
const settingLink=()=>sectionPath('notifications')+'#host-monitoring';
|
|
17
20
|
const metricLabel=(metric,interval)=>metricState(metric,interval)==='ok'?null:text(metricState(metric,interval));
|
|
@@ -22,7 +25,7 @@ export function historyMessage(status){
|
|
|
22
25
|
function HistoryChart({answer,id,label,unit='percent'}){
|
|
23
26
|
const model=chartData(answer?.series?.find(s=>s.id===id)?.buckets);
|
|
24
27
|
const value=n=>n===null?text('unavailable'):unit==='bytes'?displayBytes(n):unit==='pressure'?text(({1:'normal',2:'elevated',3:'critical'})[Math.round(n)]||'unknown'):`${n.toFixed(1)}%`;
|
|
25
|
-
return html`<figure class="host-chart"><figcaption>${text('chart',label)}</figcaption>${model.covered>=4?html`<svg viewBox="0 0 600 110" role="img" aria-label=${`${text('chart',label)}. ${text('minimum',value(model.min))}. ${text('maximum',value(model.max))}. ${text('coverage',model.covered,model.total)}`}><line x1="0" x2="600" y1="100" y2="100" />${model.segments.map((points,i)=>html`<polyline key=${i} points=${points} />`)}${model.dots.map((point,i)=>html`<circle key=${i} cx=${point.x} cy=${point.y} r="2.5"/>`)}</svg><p class="note">${text('minimum',value(model.min))} · ${text('maximum',value(model.max))}</p><p class="note">${text('coverage',model.covered,model.total)}</p>`:html`<p class="note host-no-history">${text(answer===undefined?'historyLoading':answer?.unavailable?'historyUnavailable':model.covered?'collecting':'noHistory')}</p>`}</figure>`;
|
|
28
|
+
return html`<figure class="host-chart"><figcaption>${label===text('freeHistory')?label:text('chart',label)}</figcaption>${model.covered>=4?html`<svg viewBox="0 0 600 110" role="img" aria-label=${`${label===text('freeHistory')?label:text('chart',label)}. ${text('minimum',value(model.min))}. ${text('maximum',value(model.max))}. ${text('coverage',model.covered,model.total)}`}><line x1="0" x2="600" y1="100" y2="100" />${model.segments.map((points,i)=>html`<polyline key=${i} points=${points} />`)}${model.dots.map((point,i)=>html`<circle key=${i} cx=${point.x} cy=${point.y} r="2.5"/>`)}</svg><p class="note">${text('minimum',value(model.min))} · ${text('maximum',value(model.max))}</p><p class="note">${text('coverage',model.covered,model.total)}</p>`:html`<p class="note host-no-history">${text(answer===undefined?'historyLoading':answer?.unavailable?'historyUnavailable':model.covered?'collecting':'noHistory')}</p>`}</figure>`;
|
|
26
29
|
}
|
|
27
30
|
function ValueState({metric,interval}){const state=metricLabel(metric,interval);return state?html`<span class="tag">${state}</span>`:null;}
|
|
28
31
|
function Storage({health,history}){
|
|
@@ -33,31 +36,33 @@ function Storage({health,history}){
|
|
|
33
36
|
return html`<article key=${v.id} class="host-volume"><div class="host-row"><h4>${name}${/^[A-Z]$/.test(v.drive||'')?html`<span class="note">${text('drive',v.drive)}</span>`:null}</h4>${state!=='ok'||!known?html`<span class="tag">${text(state==='stale'?'stale':'unavailable')}</span>`:null}</div><p class="host-value">${numberOrNull(v.availableBytes)!==null?text('free',displayBytes(v.availableBytes)):text('unavailable')}</p><p class="note">${numberOrNull(v.usedPercent,100)!==null?text('used',v.usedPercent.toFixed(1)):text('unavailable')} · ${sampleTime(v.sampledAt)}</p>${numberOrNull(v.usedPercent,100)===null?null:html`<progress class="host-space-meter" value=${v.usedPercent} max="100" aria-label=${text('used',v.usedPercent.toFixed(1))}></progress>`}${health.platform==='darwin'&&v.shared?html`<p class="note">${text('shared')} · ${text('sharedHint')}</p>`:null}<${HistoryChart} answer=${history} id=${`disk.${v.id}.available`} label=${text('freeHistory')} unit="bytes" /></article>`;
|
|
34
37
|
})}</section>`;
|
|
35
38
|
}
|
|
36
|
-
export function HostHealthView({health,history,busy,range,onRange,onRefresh}){
|
|
39
|
+
export function HostHealthView({health,history,busy,range,onRange,onRefresh,agentOffset=0,onAgentOffset,selectedAgent,onSelectedAgent}){
|
|
37
40
|
const at=[health?.cpu?.sampledAt,health?.memory?.sampledAt,health?.disks?.sampledAt].filter(v=>numberOrNull(v)!==null),last=at.length?Math.max(...at):null;
|
|
38
41
|
const cpu=health?.cpu?.value,memory=health?.memory?.value,coverage=sampleCoverage(health);
|
|
39
42
|
const populated=health?.enabled&&health?.platformSupported!==false,platform=text(['wsl','linux','darwin'].includes(health?.platform)?health.platform:'unavailable');
|
|
40
|
-
return html`<section class="host-health" aria-busy=${busy}><${PageHead} title=${text('title')} scope=${text('computer')+(populated?' · '+platform:'')} lead=${text('lead')} note=${html`${last===null?text('none'):sampleTime(last)}${populated?
|
|
43
|
+
return html`<section class="host-health" aria-busy=${busy}><${PageHead} title=${text('title')} scope=${text('computer')+(populated?' · '+platform:'')} lead=${text('lead')} note=${html`${last===null?text('none'):sampleTime(last)}${populated?html` <span class="host-coverage">${text('coverageSummary',coverage.covered,coverage.total)}</span>`:''}`}><button type="button" class="btn btn-sm" disabled=${busy} onClick=${onRefresh}><${Icon} name="restart" size=${15}/>${text(busy?'refreshing':'refresh')}</button>${health?.platformSupported===false?null:html`<a class="btn btn-sm" href=${settingLink()}>${text('settings')}</a>`}</${PageHead}>
|
|
41
44
|
${!populated?html`<p class="note">${text('snapshotOnly')}</p>`:null}
|
|
42
45
|
${health?.platformSupported===false?html`<section class="card"><h3>${text('unsupported')}</h3></section>`:!health?.enabled?html`<section class="card host-off"><h3>${text(health?.state==='failed'?'failed':health?.state==='stopping'?'stopping':'off')}</h3><p>${text(health?.state==='failed'?'failedHint':health?.state==='stopping'?'stopping':'offHint')}</p><a class="btn btn-primary" href=${settingLink()}>${text('settings')}</a></section>`:html`
|
|
43
46
|
${health.state!=='sampling'?html`<div class="notice" role="status">${text(({starting:'starting',stopping:'stopping',failed:'failed'})[health.state]||'unavailable')}</div>`:null}
|
|
44
47
|
${health.history?.state!=='recording'?html`<p class="notice" role="status">${historyMessage(health.history)}</p>`:null}
|
|
48
|
+
<${HostAlerts} alerts=${health.alerts} onChange=${onRefresh}/>
|
|
45
49
|
<div class="host-range" role="group" aria-label=${text('range')}>${HOST_RANGES.map(r=>html`<button type="button" class=${`btn btn-sm${range===r?' active':''}`} aria-pressed=${range===r} onClick=${()=>onRange(r)}>${r}</button>`)}</div>
|
|
46
50
|
<div class="host-grid"><div class="host-compute"><section class="card"><div class="host-row"><h3>${text(health.platform==='wsl'?'wslCpu':'cpu')}</h3><${ValueState} metric=${health.cpu} interval=${30000}/></div><p class="host-value">${numberOrNull(cpu?.usedPercent,100)===null?text('unavailable'):text('cpuUsed',cpu.usedPercent.toFixed(1))}</p><p class="note">${numberOrNull(cpu?.logicalCpus)!==null?text('cores',cpu.logicalCpus):text('unavailable')}</p>${Array.isArray(cpu?.loadAverage)?html`<p class="note">${text('loadLabel')}${lang()==='zh-TW'?'':' '}<span class="host-load-value">${cpu.loadAverage.slice(0,3).map(n=>numberOrNull(n)===null?'—':n.toFixed(2)).join(' / ')}</span></p>`:null}<p class="note">${sampleTime(health.cpu?.sampledAt)}</p><${HistoryChart} answer=${history} id="cpu.used" label=${text('cpu')}/></section>
|
|
47
51
|
<section class="card"><div class="host-row"><h3>${text(health.platform==='wsl'?'wslMemory':'memory')}</h3><${ValueState} metric=${health.memory} interval=${30000}/></div><p class="host-value">${text('pressureLabel')}${lang()==='zh-TW'?'':' '}<span class="host-pressure-value">${text(metricState(health.memory,30000)==='ok'&&['normal','elevated','critical'].includes(memory?.pressure)?memory.pressure:'unknown')}</span></p><p class="note">${numberOrNull(memory?.availableBytes)===null?text('unavailable'):text('available',displayBytes(memory.availableBytes),displayBytes(memory.totalBytes)||text('unavailable'))}</p><p class="note">${text('swap',displayBytes(memory?.swapFreeBytes)||text('unavailable'))}</p><p class="note">${sampleTime(health.memory?.sampledAt)}</p><${HistoryChart} answer=${history} id="memory.available" label=${text('memory')} unit="bytes" /></section></div>
|
|
48
|
-
<${Storage} health=${health} history=${history}/></div><p class="note">${text(health.platform==='wsl'?'wslNote':health.platform==='darwin'?'macNote':'linuxNote')}</p><p class="note">${text('samples')} · ${text('snapshotOnly')}</p><p class="note">${text('runtimeNote')}</p><p class="note">${text('gaps')}</p><p class="note">${text('retention')}</p
|
|
52
|
+
<${Storage} health=${health} history=${history}/></div><p class="note">${text(health.platform==='wsl'?'wslNote':health.platform==='darwin'?'macNote':'linuxNote')}</p><p class="note">${text('samples')} · ${text('snapshotOnly')}</p><p class="note">${text('runtimeNote')}</p><p class="note">${text('gaps')}</p><p class="note">${text('retention')}</p><${HostFootprintView} snapshot=${health.footprint} offset=${agentOffset} onOffset=${onAgentOffset} onSelect=${onSelectedAgent} selected=${selectedAgent} charts=${selectedAgent&&health.footprint?.enabled?html`<${HistoryChart} answer=${history} id=${`agent.${selectedAgent}.cpu`} label=${footprintText('agentCpu')}/><${HistoryChart} answer=${history} id=${`agent.${selectedAgent}.rss`} label=${footprintText('agentMemory')} unit="bytes"/>`:null}/>`}
|
|
49
53
|
</section>`;
|
|
50
54
|
}
|
|
51
55
|
export function HostHealth({lease}){
|
|
56
|
+
const [agentOffset,setAgentOffset]=useState(0),[selectedAgent,setSelectedAgent]=useState(null);
|
|
52
57
|
const [data,setData]=useState(null),[history,setHistory]=useState(null),[range,setRange]=useState('1h'),[busy,setBusy]=useState(false),[error,setReadState]=useState(null),seq=useRef(0),inflight=useRef(false),pending=useRef(false),latest=useRef(null),alive=useRef(true);
|
|
53
58
|
const load=async()=>{
|
|
54
59
|
if(!alive.current||!lease.current())return;if(inflight.current){pending.current=true;return;}inflight.current=true;const mine=++seq.current;setBusy(true);
|
|
55
60
|
try{
|
|
56
|
-
const response=await lease.fetch('/ui/host-health',{cache:'no-store'});if(!alive.current||!lease.current()||mine!==seq.current)return;
|
|
61
|
+
const response=await lease.fetch('/ui/host-health'+(agentOffset?'?agentOffset='+agentOffset:''),{cache:'no-store'});if(!alive.current||!lease.current()||mine!==seq.current)return;
|
|
57
62
|
if(response.status===401||response.status===403){setData(null);setHistory(null);setReadState('admin');return;}if(!response.ok)throw Error('read failed');
|
|
58
63
|
const health=await response.json();if(!alive.current||!lease.current()||mine!==seq.current)return;setData(health);setReadState(null);
|
|
59
64
|
if(!health.enabled||health.history?.state!=='recording'){setHistory(null);return;}
|
|
60
|
-
const params=new URLSearchParams({range});for(const id of historySeries(health))params.append('series',id);
|
|
65
|
+
const params=new URLSearchParams({range});for(const id of [...historySeries(health),...(selectedAgent?[`agent.${selectedAgent}.cpu`,`agent.${selectedAgent}.rss`]:[])])params.append('series',id);
|
|
61
66
|
const r=await lease.fetch('/ui/host-history?'+params,{cache:'no-store'});if(!alive.current||!lease.current()||mine!==seq.current)return;
|
|
62
67
|
if(r.status===401||r.status===403){setData(null);setHistory(null);setReadState('admin');return;}
|
|
63
68
|
const result=r.ok?await r.json():null;if(alive.current&&lease.current()&&mine===seq.current)setHistory({range,value:result?.ok?result.value:{unavailable:true}});
|
|
@@ -65,10 +70,10 @@ export function HostHealth({lease}){
|
|
|
65
70
|
};
|
|
66
71
|
latest.current=load;
|
|
67
72
|
useEffect(()=>{alive.current=true;return()=>{alive.current=false;seq.current++;};},[lease]);
|
|
68
|
-
useEffect(()=>{seq.current++;void load();},[lease,range]);
|
|
73
|
+
useEffect(()=>{seq.current++;void load();},[lease,range,agentOffset,selectedAgent]);
|
|
69
74
|
// Only an enabled visible page refreshes its cache. Off/unmounted pages own no monitoring poll.
|
|
70
|
-
useEffect(()=>{if(!data?.enabled)return;const timer=lease.interval(()=>{if(typeof document==='undefined'||!document.hidden)void
|
|
75
|
+
useEffect(()=>{if(!data?.enabled)return;const timer=lease.interval(()=>{if(typeof document==='undefined'||!document.hidden)void latest.current?.();},30000);return()=>lease.clear(timer);},[lease,data?.enabled,range]);
|
|
71
76
|
if(error==='admin')return html`<section class="card"><h2>${text('admin')}</h2><p>${text('adminHint')}</p></section>`;
|
|
72
77
|
if(!data)return error?html`<${ErrorState} onRetry=${load}/>`:html`<${Skeleton} lines=${5}/>`;
|
|
73
|
-
return html`<div>${error?html`<${ErrorState} onRetry=${load}/>`:null}<${HostHealthView} health=${data} history=${history?.range===range?history.value:busy?undefined:null} range=${range} onRange=${setRange} onRefresh=${load} busy=${busy}/></div>`;
|
|
78
|
+
return html`<div>${error?html`<${ErrorState} onRetry=${load}/>`:null}<${HostHealthView} health=${data} history=${history?.range===range?history.value:busy?undefined:null} agentOffset=${agentOffset} onAgentOffset=${value=>{setAgentOffset(value);setSelectedAgent(null);}} selectedAgent=${selectedAgent} onSelectedAgent=${setSelectedAgent} range=${range} onRange=${setRange} onRefresh=${load} busy=${busy}/></div>`;
|
|
74
79
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {lang} from '/assets/app-i18n.js';
|
|
2
|
+
/** Shared compact host timestamp: one local 24-hour format on cards and incident updates. */
|
|
3
|
+
export function hostTime(value){
|
|
4
|
+
return new Date(value).toLocaleString(lang()==='zh-TW'?'zh-TW':'en-GB',{month:'short',day:'numeric',hour:'2-digit',minute:'2-digit',second:'2-digit',hour12:false});
|
|
5
|
+
}
|
package/dist/ui/panel-chat.js
CHANGED
|
@@ -782,6 +782,8 @@ function threadEntry(name, doc) {
|
|
|
782
782
|
setPreviewOptIn, copyText, download: downloadHtml, toggleWrap,
|
|
783
783
|
clickReplyButton: (id, index) => store.clickReplyButton(name, id, index), // #1266
|
|
784
784
|
contactBadge: (x) => { installBadgeRefresh(); return contactBadgeHtml(x); }, // M-3339: 聯絡申請 #R… / 已准轉交 #R… (kept current)
|
|
785
|
+
canResend: (message) => store.canResend(name, message),
|
|
786
|
+
resendMessage: (key) => store.resendMessage(name, key),
|
|
785
787
|
retryOutgoing: (clientId) => store.retryOutgoing(name, clientId), // a failed send's Retry and Delete
|
|
786
788
|
deleteOutgoing: (clientId) => store.deleteOutgoing(name, clientId),
|
|
787
789
|
putBackOutgoing: (clientId) => { recordEdit(composerField(name)); store.putBackOutgoing(name, clientId); }, // undoable, as typing
|
package/dist/ui/panel-needs.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {HostAlertActions,hostAlertText,hostAlertName,hostAlertDescription} from './host-alerts.js';
|
|
1
2
|
import { modelSwitchText } from "/assets/model-observation.js";
|
|
2
3
|
// #1408 step 4 = #1386 part (b): the "Needs you" panel (/ui/needs) — everything waiting on the person, from every
|
|
3
4
|
// world, in one list. Behind the session gate (/ui/js/), loaded the first time it is opened.
|
|
@@ -18,7 +19,7 @@ import { t, register } from "/assets/app-i18n.js";
|
|
|
18
19
|
import { appStore, createStore, useStore } from "/assets/app-store.js";
|
|
19
20
|
import { useLease } from "/assets/app-ctx.js";
|
|
20
21
|
import { PanelHeader, setTitle } from "/assets/app-shell.js";
|
|
21
|
-
import { chatPath } from "/assets/app-route.js";
|
|
22
|
+
import { fleetPath, chatPath } from "/assets/app-route.js";
|
|
22
23
|
import { namesOf, namesStore } from "/assets/instance-nav.js";
|
|
23
24
|
import { Empty, Skeleton } from "/assets/ui-states.js";
|
|
24
25
|
import { Icon } from "/assets/ui-icons.js";
|
|
@@ -33,8 +34,8 @@ import { HostDirectoryNotices, hostDirectoryNoticesOffered } from "./hub-host-se
|
|
|
33
34
|
|
|
34
35
|
// A pre-upgrade tab retains app-i18n.js. Register these reasons when the updated panel is loaded, too.
|
|
35
36
|
register("app", {
|
|
36
|
-
en: { needs_reason_stale_auth: "Codex needs a restart", needs_stale_auth_detail: "Codex cannot refresh this agent’s current sign-in. Restart the agent; sign in again only if Codex asks.", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_tmux_hold: "Held: an old tmux server or window" },
|
|
37
|
-
"zh-TW": { needs_reason_stale_auth: "Codex 需要重新啟動", needs_stale_auth_detail: "Codex 無法更新這個 Agent 執行中使用的登入。請重新啟動 Agent;只有 Codex 要求時才需要重新登入。", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_tmux_hold: "已暫停:舊的 tmux 伺服器或視窗" },
|
|
37
|
+
en: { needs_reason_host_health: "Host health", needs_reason_stale_auth: "Codex needs a restart", needs_stale_auth_detail: "Codex cannot refresh this agent’s current sign-in. Restart the agent; sign in again only if Codex asks.", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_tmux_hold: "Held: an old tmux server or window" },
|
|
38
|
+
"zh-TW": { needs_reason_host_health: "主機狀態", needs_reason_stale_auth: "Codex 需要重新啟動", needs_stale_auth_detail: "Codex 無法更新這個 Agent 執行中使用的登入。請重新啟動 Agent;只有 Codex 要求時才需要重新登入。", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_tmux_hold: "已暫停:舊的 tmux 伺服器或視窗" },
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
register("needs", {
|
|
@@ -42,8 +43,8 @@ register("needs", {
|
|
|
42
43
|
otherEmpty: "No other items are waiting for you.", title: "Needs you", empty: "Nothing needs you right now", emptyHint: "When an agent waits for you, it shows here — and in your chat app's General.", emptyHintWeb: "When an agent waits for you, it shows here.",
|
|
43
44
|
open: "Open chat", kiroOpen: "Open agent", kiroMigration: "Migration instructions", openCard: "Open the card", noAssignee: "Task board (nobody assigned)", fleetSignIns: "AI accounts", signIn: "Connect account",
|
|
44
45
|
gap: "not wrapped up: {0}", gapUnchecked: "{0} checklist item(s) unchecked", gapNoResult: "no result", gapJoin: ", ", acknowledge: "Acknowledge", acknowledging: "Acknowledging…", answering: "Answering…",
|
|
45
|
-
ageNow: "just now", ageMin: "{0} min", ageHour: "{0} h", ageDay: "{0} d",
|
|
46
|
-
notifyTitle: "Notify me on this device", notifyOn: "Notifications are on for this browser while a tab is open.",
|
|
46
|
+
ageNow: "just now", ageMin: "{0} min ago", ageHour: "{0} h ago", ageDay: "{0} d ago",
|
|
47
|
+
notifySection: "This device", notifyTitle: "Notify me on this device", notifyOn: "Notifications are on for this browser while a tab is open.",
|
|
47
48
|
notifyOff: "Get a desktop notification when something new needs you while this tab is in the background.",
|
|
48
49
|
notifyDenied: "This browser blocked notifications for AgEnD. Allow them in the site settings to turn this on.",
|
|
49
50
|
notifyMobile: "On a phone, rely on your chat app's notification: a new item is a new post in General.", notifyMobileWeb: "On a phone, open this page to see what needs you.",
|
|
@@ -67,8 +68,8 @@ register("needs", {
|
|
|
67
68
|
otherEmpty: "沒有其他待處理事項。", title: "等你處理", empty: "目前沒有需要你處理的事", emptyHint: "agent 在等你時,會出現在這裡——也會出現在聊天 app 的 General。", emptyHintWeb: "agent 在等你時,會出現在這裡。",
|
|
68
69
|
open: "開啟聊天", kiroOpen: "開啟 Agent", kiroMigration: "遷移說明", openCard: "打開卡片", noAssignee: "任務看板(沒有負責人)", fleetSignIns: "AI 帳號", signIn: "連接帳號",
|
|
69
70
|
gap: "還沒補齊:{0}", gapUnchecked: "還有 {0} 項沒勾", gapNoResult: "沒有產出總結", gapJoin: "、", acknowledge: "確認", acknowledging: "確認中…", answering: "回覆中…",
|
|
70
|
-
ageNow: "剛剛", ageMin: "{0}
|
|
71
|
-
notifyTitle: "在這台裝置通知我", notifyOn: "這個瀏覽器的通知已開啟(需要開著分頁)。",
|
|
71
|
+
ageNow: "剛剛", ageMin: "{0} 分鐘前", ageHour: "{0} 小時前", ageDay: "{0} 天前",
|
|
72
|
+
notifySection: "這台裝置", notifyTitle: "在這台裝置通知我", notifyOn: "這個瀏覽器的通知已開啟(需要開著分頁)。",
|
|
72
73
|
notifyOff: "分頁在背景時,有新的事等你處理就跳出桌面通知。",
|
|
73
74
|
notifyDenied: "這個瀏覽器封鎖了 AgEnD 的通知。請在網站設定中允許後再開啟。",
|
|
74
75
|
notifyMobile: "在手機上請以聊天 app 的通知為主:每個新項目都會在 General 發一則新訊息。", notifyMobileWeb: "在手機上請打開這個頁面查看等你處理的事。",
|
|
@@ -165,7 +166,7 @@ export function groupNeeds(items) {
|
|
|
165
166
|
const groups = new Map();
|
|
166
167
|
for (const item of items) {
|
|
167
168
|
// Configuration issues belong to Settings, not the unassigned task/sign-in group.
|
|
168
|
-
const key = JSON.stringify([item.instance, !item.instance && item.type === "config"]);
|
|
169
|
+
const key = JSON.stringify([item.instance, !item.instance && item.type === "config",item.type==='host']);
|
|
169
170
|
const group = groups.get(key);
|
|
170
171
|
if (group) group.items.push(item);
|
|
171
172
|
else groups.set(key, { instance: item.instance, items: [item] });
|
|
@@ -217,8 +218,8 @@ export function NeedsPanel({ navKey }) {
|
|
|
217
218
|
</section>` : null}
|
|
218
219
|
${(!ready || needsLoaded === false) && !items.length && !asks.length ? html`<${Skeleton} variant="rows" lines=${3} />`
|
|
219
220
|
: !items.length && !asks.length && !decidedHere.length ? hostDirectoryNoticesOffered() ? html`<p class="muted">${tn("otherEmpty")}</p>` : html`<${Empty} icon="check" title=${tn("empty")} hint=${tn(chatApp ? "emptyHint" : "emptyHintWeb")} />`
|
|
220
|
-
: groups.map((g) => html`<section key=${JSON.stringify([g.instance, g.items[0]?.type === "config", !!g.items[0]?.runtimeUpdate])} class="n-group" aria-label=${g.items[0]?.runtimeUpdate ? runtimeUpdateText("attention") : g.instance}>
|
|
221
|
-
<h2 class="n-group-head">${g.items[0]?.runtimeUpdate ? runtimeUpdateText("attention") : g.instance ? html`<a href=${chatPath(g.instance)} title=${g.instance}>${nameFor(g.instance)}</a>` : g.items[0]?.type === "config" ? t("app.settings") : tn(g.items.some(i => i.type === "backend") ? "fleetSignIns" : "noAssignee")}</h2>
|
|
221
|
+
: groups.map((g) => html`<section key=${JSON.stringify([g.instance, g.items[0]?.type === "config",g.items[0]?.type === 'host', !!g.items[0]?.runtimeUpdate])} class="n-group" aria-label=${g.items[0]?.runtimeUpdate ? runtimeUpdateText("attention") : g.instance}>
|
|
222
|
+
<h2 class="n-group-head">${g.items[0]?.runtimeUpdate ? runtimeUpdateText("attention") : g.instance ? html`<a href=${chatPath(g.instance)} title=${g.instance}>${nameFor(g.instance)}</a>` : g.items[0]?.type==='host'?hostAlertText('title'):g.items[0]?.type === "config" ? t("app.settings") : tn(g.items.some(i => i.type === "backend") ? "fleetSignIns" : "noAssignee")}</h2>
|
|
222
223
|
${g.items.map((item) => item.type === "contact"
|
|
223
224
|
// M-3339: a contact request or the restricted-mode suggestion — its own card (contact-needs.js; references only).
|
|
224
225
|
? html`<${ContactNeedsItem} key=${item.id} item=${item} />`
|
|
@@ -272,10 +273,11 @@ function NeedsItem({ item, nowMs, owner }) {
|
|
|
272
273
|
return html`<article data-trust="permission" class=${`n-item${BAD.has(item.reason) ? " bad" : ""}`}>
|
|
273
274
|
<span class="n-icon"><${Icon} name=${ICON[item.type] || "alert"} size=${18} /></span>
|
|
274
275
|
<div class="n-body">
|
|
275
|
-
<div class="n-title"><strong>${itemReason(item)}</strong><span class="n-age">${age(item.since, nowMs)}</span></div>
|
|
276
|
-
${
|
|
276
|
+
<div class="n-title"><strong>${item.type==='host'?hostAlertName(item.hostAlert):itemReason(item)}</strong><span class="n-age">${item.type==='host'?hostAlertText('started')+age(item.since, nowMs):age(item.since, nowMs)}</span></div>
|
|
277
|
+
${item.type==='host'&&item.hostAlert?html`<p class="n-detail">${hostAlertText(item.hostAlert.level)} · ${hostAlertDescription(item.hostAlert)}</p>`:item.type==='host'?html`<p class="n-detail">${hostAlertText('failed')}</p>`:detailOf(item)?html`<p class="n-detail">${detailOf(item)}</p>`:null}
|
|
277
278
|
${item.type === "hub" && item.hubProposal ? html`<p class="n-detail">${item.hubProposal.action}</p><pre>${item.hubProposal.arguments}</pre><p class="n-detail">${item.hubProposal.consequences}</p>` : null}
|
|
278
279
|
${item.generalLocation ? html`<${GeneralLocation} name=${item.instance} attentionOnly=${true} />` : null}
|
|
280
|
+
${item.type==='host'?(item.hostAlert?html`<${HostAlertActions} record=${item.hostAlert}/>`:html`<a class="btn btn-sm" href=${fleetPath('host-health')}>${hostAlertText('open')}</a>`):null}
|
|
279
281
|
<div class="n-actions">
|
|
280
282
|
${item.type === "prompt" && Array.isArray(item.actions) ? item.actions.filter((a) => !a.input).map((a) => html`<button key=${a.id} type="button" class="btn btn-sm"
|
|
281
283
|
disabled=${promptBusy} onClick=${() => answer(a.id)}>${(p ? p.busy : fallback === "busy") ? tn("answering") : a.label}</button>`) : null}
|
|
@@ -405,9 +407,18 @@ function NotifyToggle() {
|
|
|
405
407
|
const { connections } = useStore(appStore);
|
|
406
408
|
const note = support === "mobile" ? tn(connections > 0 ? "notifyMobile" : "notifyMobileWeb") : support === "insecure" ? tn("notifyInsecure")
|
|
407
409
|
: support !== "ok" ? tn("notifyUnsupported") : state === "denied" ? tn("notifyDenied") : on ? tn("notifyOn") : tn("notifyOff");
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
// M-3503 (the user): a setting of this device, not an item waiting — its own section under the list (a rule above it,
|
|
411
|
+
// its own heading), drawn as an item row (icon, then the words and the button) so every card's text and buttons share
|
|
412
|
+
// one edge. Its own class names (styled with the items' in app.css): nothing that counts the items counts it.
|
|
413
|
+
return html`<section class="n-settings" aria-labelledby="n-settings-head"><h2 class="n-settings-head" id="n-settings-head">${tn("notifySection")}</h2>
|
|
414
|
+
<article class="n-notify">
|
|
415
|
+
<span class="n-notify-icon"><${Icon} name="bell" size=${18} /></span>
|
|
416
|
+
<div class="n-notify-body">
|
|
417
|
+
<div class="n-notify-title"><strong>${tn("notifyTitle")}</strong></div>
|
|
418
|
+
<p class="n-notify-note note">${note}</p>
|
|
419
|
+
${support === "ok" ? html`<div class="n-notify-actions"><button type="button" class=${`btn btn-sm${on ? "" : " btn-primary"}`} aria-pressed=${on ? "true" : "false"} disabled=${asking} onClick=${toggle}>
|
|
420
|
+
<${Icon} name="bell" size=${14} />${on ? tn("turnOff") : tn("turnOn")}</button></div>` : null}
|
|
421
|
+
</div>
|
|
422
|
+
</article>
|
|
412
423
|
</section>`;
|
|
413
424
|
}
|
|
@@ -119,6 +119,7 @@ export async function loadAll(lease) {
|
|
|
119
119
|
if (!lease.current()) return null;
|
|
120
120
|
if (!fleet.ok) return { error: true };
|
|
121
121
|
out.fleet = fleet.body || {};
|
|
122
|
+
if(out.schema?.host_alert_defaults){const alerts=await read(lease,'/api/settings/fleet/host-alerts');if(!lease.current())return null;out.hostAlerts=alerts.ok?alerts.body:null;}
|
|
122
123
|
const classic = await read(lease, "/api/settings/classic");
|
|
123
124
|
if (!lease.current()) return null;
|
|
124
125
|
out.classic = classic.body || {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {html,useEffect} from '/assets/app-html.js';
|
|
2
|
+
import {register,t} from '/assets/app-i18n.js';
|
|
3
|
+
import {useDraft,syncStage} from './settings-draft.js';
|
|
4
|
+
import {hostAlertText,hostAlertDrive,hostAlertName} from './host-alerts.js';
|
|
5
|
+
register('hostAlertSettings',{
|
|
6
|
+
en:{title:'Host alert settings',needs:'Show in Needs you',general:'Send summaries to General',handoff:'General is off initially. The existing disk-watch script keeps sending its own alerts, so turning General on may send duplicate alerts.',resource:'Resource',warning:'Warning',urgent:'Urgent',clear:'Recovery',percent:'Percent used',gib:'GiB available',fixed:'Memory thresholds use the existing Normal / Elevated / Critical pressure states.',defaults:'Restore defaults',holds:'Threshold holds and recovery delays keep brief spikes from becoming alerts. Acknowledgment does not hide a problem; snooze it from Host health.',off:'Rules are saved while monitoring is off. No alert checks, notification retries or incident files run while off.'},
|
|
7
|
+
'zh-TW':{title:'主機警示設定',needs:'顯示在「等你處理」',general:'傳送摘要至 General',handoff:'General 通知預設關閉。現有 disk-watch 腳本仍會傳送自己的警示,開啟 General 通知可能會收到重複提醒。',resource:'監測項目',warning:'注意',urgent:'緊急',clear:'恢復',percent:'使用率(%)',gib:'可用 GiB',fixed:'記憶體門檻沿用正常/偏高/嚴重的壓力狀態。',defaults:'還原預設值',holds:'門檻持續時間與恢復延遲可避免短暫尖峰觸發警示。標記已看過不會隱藏問題;可在主機狀態暫停提醒。',off:'監測關閉時仍可儲存規則,但不會執行警示檢查、通知重試或建立問題檔案。'}
|
|
8
|
+
});
|
|
9
|
+
const text=k=>t('hostAlertSettings.'+k);
|
|
10
|
+
export function HostAlertSettings({ctx,health}){
|
|
11
|
+
const defaults=ctx.schema?.host_alert_defaults,base=ctx.hostAlerts;
|
|
12
|
+
const [form,setForm]=useDraft(ctx,'host-alerts',()=>base||{version:1,needsYou:true,general:false,rules:{}});
|
|
13
|
+
useEffect(()=>{syncStage(ctx,'host-alerts',base&&defaults&&JSON.stringify(form)!==JSON.stringify(base)?{label:text('title'),impact:'now',request:{method:'PUT',url:'/api/settings/fleet/host-alerts',body:form}}:null);},[form,base,defaults]);
|
|
14
|
+
if(!base||!defaults)return null;
|
|
15
|
+
const disks=(health?.disks?.value?.volumes||[]).slice(0,62),resources=[{key:'cpu',kind:'cpu',name:hostAlertText('cpu')},{key:'memory',kind:'memory',name:hostAlertText('memory')},...disks.map(v=>({key:'disk:'+v.id,kind:v.roles.includes('wsl-backing')?'backing-drive':'filesystem',name:hostAlertName({key:'disk:'+v.id,kind:v.roles.includes('wsl-backing')?'backing-drive':'filesystem'})+hostAlertDrive(v.drive)}))];
|
|
16
|
+
for(const [key,rule] of Object.entries(form.rules))if(!resources.some(r=>r.key===key))resources.push({key,kind:rule.kind,name:hostAlertText(rule.kind==='backing-drive'?'backing':'filesystem')+' · '+key.slice(-6)});
|
|
17
|
+
const update=(key,kind,field,value)=>setForm(f=>({...f,rules:{...f.rules,[key]:{...defaults[kind],...f.rules[key],[field]:value}}}));
|
|
18
|
+
const reset=()=>setForm(f=>({...f,rules:{}}));
|
|
19
|
+
const choice=(key,label)=>html`<div class="s-setting-row"><div class="s-setting-copy"><label for=${'hostAlert-'+key}>${text(label)}</label></div><input id=${'hostAlert-'+key} class="s-ui-toggle" type="checkbox" role="switch" checked=${form[key]} onChange=${e=>setForm(f=>({...f,[key]:e.target.checked}))}/></div>`;
|
|
20
|
+
return html`<div class="host-alert-settings"><h4>${text('title')}</h4>${choice('needsYou','needs')}${choice('general','general')}<p class="note">${text('handoff')}</p>
|
|
21
|
+
<details><summary>${text('resource')}</summary>${resources.map(resource=>{const rule=form.rules[resource.key]||defaults[resource.kind],factor=resource.kind==='backing-drive'?1024**3:1;return html`<fieldset class="field" key=${resource.key}><legend>${resource.name}</legend>${resource.kind==='memory'?html`<p class="note">${text('fixed')}</p>`:html`<p class="note">${text(resource.kind==='backing-drive'?'gib':'percent')}</p><div class="grid2">${['warning','urgent','clear'].map(field=>html`<div class="field"><label for=${'alert-'+resource.key+'-'+field}>${text(field)}</label><input id=${'alert-'+resource.key+'-'+field} type="number" min="0" step=${resource.kind==='backing-drive'?'1':'0.1'} value=${rule[field]/factor} onInput=${e=>update(resource.key,resource.kind,field,Number(e.target.value)*factor)}/></div>`)}</div>`}</fieldset>`;})}<button class="btn btn-sm" type="button" onClick=${reset}>${text('defaults')}</button></details><p class="note">${text('holds')}</p><p class="note">${text('off')}</p></div>`;
|
|
22
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {HostAlertSettings} from './settings-host-alerts.js';
|
|
1
2
|
import { html, useEffect, useRef, useState } from '/assets/app-html.js';
|
|
2
3
|
import { register, t } from '/assets/app-i18n.js';
|
|
3
4
|
import { confirmDialog } from '/assets/ui-confirm.js';
|
|
@@ -6,16 +7,16 @@ import { fleetPath } from '/assets/app-route.js';
|
|
|
6
7
|
import { hostMonitoringVisible } from './settings-capabilities.js';
|
|
7
8
|
register('hostMonitoring', {
|
|
8
9
|
en: { open:'View host health',title:'Host monitoring', enabled:'Monitor this computer', agents:'Include agent footprint',
|
|
9
|
-
hint:'Samples every 30–60 seconds; keeps up to 64 MiB locally. Memory and
|
|
10
|
-
agentHint:'Optional
|
|
10
|
+
hint:'Samples every 30–60 seconds with a background history worker; keeps up to 64 MiB locally. Memory and writes vary by computer.',
|
|
11
|
+
agentHint:'Optional: samples agent CPU and memory every minute, up to 128 agents and 4096 processes on this computer. Above either limit, the sample is unavailable. Cost grows with agent and process counts; reads known file metadata without scanning workspaces.',
|
|
11
12
|
off:'Off by default. While off, there is no monitoring collector, timer or history file.',
|
|
12
13
|
agentUnavailable:'Agent footprint is not available in this version of AgEnD.',
|
|
13
14
|
stopTitle:'Turn off host monitoring?', stopBody:'This stops monitoring and its alerts, and removes the recorded host history. Turning it on again starts a new history.', stop:'Turn off',
|
|
14
15
|
drive:'Windows drive holding this WSL distribution', auto:'Identify automatically', refresh:'Refresh drive list', driveHint:'If automatic identification is unavailable, choose the drive that holds this distribution’s virtual disk. Mounted local drives are listed from the latest sample while monitoring is on; Refresh reads that sample without starting a probe.', },
|
|
15
16
|
'zh-TW': { open:'查看主機狀態',title:'主機監測', enabled:'監測這台電腦', agents:'包含 Agent 資源用量',
|
|
16
|
-
hint:'每 30–60
|
|
17
|
-
agentHint:'
|
|
18
|
-
off:'
|
|
17
|
+
hint:'每 30–60 秒取樣並在背景保存歷史,本機資料最多 64 MiB。記憶體與寫入量依電腦而異。',
|
|
18
|
+
agentHint:'選用:每分鐘讀取 Agent 的 CPU 和記憶體用量,每次最多 128 個 Agent、全機 4096 個行程。超過任一上限時,該次讀數會顯示無法取得。Agent 與行程越多,耗用的資源越多;只讀已知檔案的資訊,不掃描工作區。',
|
|
19
|
+
off:'預設關閉。關閉時不會取樣、啟動監測計時器或建立歷史檔案。',
|
|
19
20
|
agentUnavailable:'這個 AgEnD 版本尚未提供 Agent 資源用量。',
|
|
20
21
|
stopTitle:'關閉主機監測?', stopBody:'這會停止監測與通知,並移除已記錄的主機歷史。重新開啟時會建立新的歷史。', stop:'關閉',
|
|
21
22
|
drive:'這個 WSL 發行版本的 Windows 磁碟', auto:'自動辨識', refresh:'重新整理磁碟清單', driveHint:'無法自動辨識時,請選擇存放這個發行版本虛擬磁碟的磁碟。監測開啟後會依最新取樣列出已掛載的本機磁碟;重新整理只讀取該取樣,不會啟動探測。', },
|
|
@@ -23,7 +24,7 @@ register('hostMonitoring', {
|
|
|
23
24
|
const copy = k => t(`hostMonitoring.${k}`);
|
|
24
25
|
export function HostMonitoringSettings({ ctx }) {
|
|
25
26
|
const available = hostMonitoringVisible(ctx.schema);
|
|
26
|
-
useEffect(() => { if (!available) syncStage(ctx, 'host-monitoring', null); }, [available]);
|
|
27
|
+
useEffect(() => { if (!available) {syncStage(ctx, 'host-monitoring', null);syncStage(ctx,'host-alerts',null);} }, [available]);
|
|
27
28
|
// A collector alone is not a visible feature: S-207 must provide its page too.
|
|
28
29
|
// A separate child keeps hook order stable across capability transitions.
|
|
29
30
|
return available ? html`<${AvailableHostMonitoringSettings} ctx=${ctx} />` : null;
|
|
@@ -65,5 +66,5 @@ function AvailableHostMonitoringSettings({ ctx }) {
|
|
|
65
66
|
<option value="">${copy('auto')}</option>${[...new Set([...(health?.disks?.value?.availableDrives ?? []),form.wsl_drive])].filter(v=>typeof v==='string'&&/^[A-Z]$/.test(v)).slice(0,26).map(d=>html`<option value=${d}>${d}:</option>`)}</select>
|
|
66
67
|
<p class="note">${copy('driveHint')}</p><button type="button" class="btn btn-sm" disabled=${reading} onClick=${refresh}>${copy('refresh')}</button></div>` : null}
|
|
67
68
|
${!agentsAvailable ? html`<p class="note">${copy('agentUnavailable')}</p>` : null}
|
|
68
|
-
<p class="note">${copy('off')}</p
|
|
69
|
+
<p class="note">${copy('off')}</p><${HostAlertSettings} ctx=${ctx} health=${health}/></section>`;
|
|
69
70
|
}
|
|
@@ -121,7 +121,7 @@ register("app", {
|
|
|
121
121
|
confirmTitle: "Please confirm", confirmOk: "Continue", cancel: "Cancel",
|
|
122
122
|
sidePanelLeave: "Leave {0} without saving? Your changes there will be lost.", sidePanelDiscard: "Discard changes",
|
|
123
123
|
// The server's own wording (src/locale.ts needs.reason.*), so the web says what Discord says.
|
|
124
|
-
needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_stale_auth: "Codex needs a restart", needs_stale_auth_detail: "Codex cannot refresh this agent’s current sign-in. Restart the agent; sign in again only if Codex asks.", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_general_windows_offline: "General’s Windows PC is offline", needs_reason_general_location_hold: "Run General on", needs_reason_native_pane_hold: "Windows agent needs attention", needs_reason_model_switch: "Claude model switched", needs_reason_crashed: "Crashed", needs_reason_backend_missing: "AI CLI not installed", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you", needs_reason_task_stalled: "Its assignee went quiet",
|
|
124
|
+
needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_host_health: "Host health", needs_reason_stale_auth: "Codex needs a restart", needs_stale_auth_detail: "Codex cannot refresh this agent’s current sign-in. Restart the agent; sign in again only if Codex asks.", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_general_windows_offline: "General’s Windows PC is offline", needs_reason_general_location_hold: "Run General on", needs_reason_native_pane_hold: "Windows agent needs attention", needs_reason_model_switch: "Claude model switched", needs_reason_crashed: "Crashed", needs_reason_backend_missing: "AI CLI not installed", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you", needs_reason_task_stalled: "Its assignee went quiet",
|
|
125
125
|
},
|
|
126
126
|
"zh-TW": {
|
|
127
127
|
brand: "AgEnD", fleet: "Fleet", fleetOverview: "Fleet 概覽", view: "檢視", settings: "設定", instances: "Agent", newInstance: "新增 Agent", newAgent: "新增 Agent",
|
|
@@ -171,6 +171,6 @@ register("app", {
|
|
|
171
171
|
search: "搜尋", searchTitle: "搜尋聊天、agent 之間的訊息與任務({0})",
|
|
172
172
|
confirmTitle: "請確認", confirmOk: "繼續", cancel: "取消",
|
|
173
173
|
sidePanelLeave: "不儲存就離開「{0}」?你在那裡的修改會遺失。", sidePanelDiscard: "捨棄修改",
|
|
174
|
-
needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_stale_auth: "Codex 需要重新啟動", needs_stale_auth_detail: "Codex 無法更新這個 Agent 執行中使用的登入。請重新啟動 Agent;只有 Codex 要求時才需要重新登入。", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_general_windows_offline: "General 所在的 Windows 電腦已離線", needs_reason_general_location_hold: "General 執行位置", needs_reason_native_pane_hold: "Windows Agent 需要處理", needs_reason_model_switch: "Claude 模型已切換", needs_reason_crashed: "已崩潰", needs_reason_backend_missing: "AI CLI 沒有安裝", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你", needs_reason_task_stalled: "接手者很久沒有動靜",
|
|
174
|
+
needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_host_health: "主機狀態", needs_reason_stale_auth: "Codex 需要重新啟動", needs_stale_auth_detail: "Codex 無法更新這個 Agent 執行中使用的登入。請重新啟動 Agent;只有 Codex 要求時才需要重新登入。", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_general_windows_offline: "General 所在的 Windows 電腦已離線", needs_reason_general_location_hold: "General 執行位置", needs_reason_native_pane_hold: "Windows Agent 需要處理", needs_reason_model_switch: "Claude 模型已切換", needs_reason_crashed: "已崩潰", needs_reason_backend_missing: "AI CLI 沒有安裝", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你", needs_reason_task_stalled: "接手者很久沒有動靜",
|
|
175
175
|
},
|
|
176
176
|
});
|
package/dist/ui/shared/app.css
CHANGED
|
@@ -962,6 +962,8 @@ html:has(.shell), html:has(.shell) body { overflow: hidden; }
|
|
|
962
962
|
.msg.status-line .st-more { border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: var(--fs-xs); padding: var(--s-1) 0 0 var(--s-3); }
|
|
963
963
|
.msg.status-line.folded .st-more { flex: none; padding: 0 var(--s-2) 0 0; white-space: nowrap; }
|
|
964
964
|
.msg.status-line .st-more:hover { color: var(--text); }
|
|
965
|
+
.msg-resend { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }
|
|
966
|
+
@media (pointer: coarse), (max-width: 899px) { .msg-resend .btn { min-height: var(--tap); min-width: var(--tap); } }
|
|
965
967
|
.msg-tools { display: flex; gap: var(--s-1); margin-top: var(--s-1); opacity: 0; transition: opacity var(--t-fast); }
|
|
966
968
|
/* #2147: bounded stock toolbar paint, including fixed descendants. Padding preserves focus outlines. */
|
|
967
969
|
.shell .thread .msg-tools { contain: paint; overflow: clip; overflow-clip-margin: 0px; padding: 4px; margin: 0 -4px -4px; }
|
|
@@ -2291,21 +2293,39 @@ textarea.s-yaml { white-space: pre; overflow-x: auto; }
|
|
|
2291
2293
|
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--danger-fill); color: var(--on-danger);
|
|
2292
2294
|
font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
|
|
2293
2295
|
.n-group { margin-bottom: var(--s-4); }
|
|
2294
|
-
.n-group-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-1); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
|
|
2296
|
+
.n-group-head, .n-settings-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-1); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
|
|
2295
2297
|
.n-group-head a { color: inherit; }
|
|
2296
2298
|
.n-group-head a:hover { text-decoration: underline; }
|
|
2297
2299
|
/* M-3381: the rooms' restricted-mode suggestions, one closed group: its heading opens it. */
|
|
2298
2300
|
.n-suggestions > summary { cursor: pointer; }
|
|
2299
|
-
.n-item { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface); margin-bottom: 2px; }
|
|
2300
|
-
.n-icon { flex: none; margin-top: 2px; color: var(--warn); }
|
|
2301
|
+
.n-item, .n-notify { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface); margin-bottom: 2px; }
|
|
2302
|
+
.n-icon, .n-notify-icon { flex: none; margin-top: 2px; color: var(--warn); }
|
|
2301
2303
|
.n-item.bad .n-icon { color: var(--danger); }
|
|
2302
|
-
.n-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
|
|
2303
|
-
.n-title { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
|
|
2304
|
-
.n-title strong { font-size: var(--fs-sm); }
|
|
2304
|
+
.n-body, .n-notify-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
|
|
2305
|
+
.n-title, .n-notify-title { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
|
|
2306
|
+
.n-title strong, .n-notify-title strong { font-size: var(--fs-sm); }
|
|
2305
2307
|
.n-age { color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
|
|
2306
|
-
.n-detail { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
2307
|
-
.n-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-1); }
|
|
2308
|
-
|
|
2308
|
+
.n-detail, .n-notify-note { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
2309
|
+
.n-actions, .n-notify-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-1); }
|
|
2310
|
+
/* M-3503: a text button in Needs you lines up with the text above it on every width (a phone already did, below). */
|
|
2311
|
+
.n-actions > .btn-ghost { padding-left: 0; padding-right: 0; margin-left: -1px; }
|
|
2312
|
+
/* M-3503 (the user): this device's notify setting is not an item waiting — a section of its own under the list, a rule
|
|
2313
|
+
above it; drawn as an item row (its bell in the icon's place, neutral), so text and buttons share the items' edge. */
|
|
2314
|
+
.n-settings { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--border); }
|
|
2315
|
+
.n-notify .n-notify-icon { color: var(--text-2); }
|
|
2316
|
+
/* M-3503: no word left alone on the note's last line (a phone's zh line ended with 「知。」 by itself). */
|
|
2317
|
+
.n-notify-note { text-wrap: balance; }
|
|
2318
|
+
/* M-3503: one left edge and one rhythm. The column starts at the header's leading edge (its title on a desk with the
|
|
2319
|
+
sidebar open; its ☰/‹ button otherwise, as on a phone), not centred away from it; the first section label sits one
|
|
2320
|
+
step under the header, a label one small step above its cards, sections one step apart. */
|
|
2321
|
+
.p-needs > .panel-body > .col { margin-inline: 0; padding-top: var(--s-3); padding-inline: max(var(--s-3), env(safe-area-inset-left)) max(var(--s-3), env(safe-area-inset-right)); }
|
|
2322
|
+
/* A plain heading only: the suggestions group's head is its <summary>, a control that keeps its own padding (and a
|
|
2323
|
+
phone's tap height, below). */
|
|
2324
|
+
.p-needs :is(h2.n-group-head, .n-settings-head) { padding: 0 0 var(--s-2); }
|
|
2325
|
+
@media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
|
|
2326
|
+
.p-needs > .panel-body > .col { padding-inline: max(var(--s-4), env(safe-area-inset-left)) max(var(--s-4), env(safe-area-inset-right)); }
|
|
2327
|
+
.p-needs .n-suggestions > summary { min-height: var(--tap); }
|
|
2328
|
+
}
|
|
2309
2329
|
/* #2910 D2: Notices (a web-only fleet's General) — the Needs you rows; a new one has an accent edge and a "New" tag. */
|
|
2310
2330
|
.n-item.notice.unread { box-shadow: inset 3px 0 0 var(--accent); }
|
|
2311
2331
|
.n-item.notice:not(.bad) .n-icon { color: var(--text-2); }
|
|
@@ -5104,6 +5124,7 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
|
|
|
5104
5124
|
.host-health { min-width: 0; }
|
|
5105
5125
|
.host-health .s-page-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
|
|
5106
5126
|
.host-health :is(.host-sample-time, .host-load-value) { display: inline-block; white-space: nowrap; overflow-wrap: normal; }
|
|
5127
|
+
.host-health .host-coverage { display: inline-block; white-space: nowrap; overflow-wrap: normal; }
|
|
5107
5128
|
.host-health .host-pressure-value { white-space: nowrap; overflow-wrap: normal; }
|
|
5108
5129
|
.host-health .host-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
|
|
5109
5130
|
.host-health .host-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
|
|
@@ -5125,8 +5146,28 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
|
|
|
5125
5146
|
.host-health .host-chart .note { margin: 4px 0; }
|
|
5126
5147
|
.host-health .host-no-history { padding: 20px 0; }
|
|
5127
5148
|
@media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
|
|
5149
|
+
.p-settings #host-monitoring :is(select, input[type="number"], summary) { min-height: var(--tap); min-width: var(--tap); font-size: max(1rem, var(--fs-sm)); }
|
|
5128
5150
|
.host-health .host-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
|
|
5129
5151
|
.host-health .host-storage { grid-row: 1; grid-column: 1 / -1; }
|
|
5130
5152
|
.host-health .s-page-actions { width: 100%; }
|
|
5131
5153
|
.host-health .btn { min-height: 44px; min-width: 44px; }
|
|
5132
5154
|
}
|
|
5155
|
+
|
|
5156
|
+
/* Bounded agent table: scroll is confined to the table, never the page. */
|
|
5157
|
+
.host-footprint .table-wrap { max-width: 100%; overflow-x: auto; }
|
|
5158
|
+
.host-footprint table { width: 100%; border-collapse: collapse; text-align: start; }
|
|
5159
|
+
.host-footprint th, .host-footprint td { padding: var(--s-2); border-bottom: 1px solid var(--border); vertical-align: middle; }
|
|
5160
|
+
.host-footprint td { white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
5161
|
+
.host-footprint th:first-child { min-width: 8rem; }
|
|
5162
|
+
.host-footprint th .btn { white-space: normal; overflow-wrap: anywhere; text-align: start; }
|
|
5163
|
+
.host-footprint [aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
|
|
5164
|
+
|
|
5165
|
+
@media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
|
|
5166
|
+
.host-footprint th:first-child { min-width: 6rem; }
|
|
5167
|
+
.host-footprint th, .host-footprint td { padding: var(--s-1); }
|
|
5168
|
+
}
|
|
5169
|
+
|
|
5170
|
+
.host-footprint-sample { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
|
|
5171
|
+
.host-footprint-memory { white-space: nowrap; }
|
|
5172
|
+
|
|
5173
|
+
.host-footprint-managed { white-space: nowrap; }
|
|
@@ -416,8 +416,8 @@
|
|
|
416
416
|
if (seen[k] !== undefined) {
|
|
417
417
|
// The same message again (history after the stream): the copy that got further shows its ticks.
|
|
418
418
|
var had = out[seen[k]];
|
|
419
|
-
var
|
|
420
|
-
if (
|
|
419
|
+
var updated = deliveryMessage(had, m);
|
|
420
|
+
if (updated !== had) out[seen[k]] = had = updated;
|
|
421
421
|
// #1266: …and the copy whose buttons got further (open → chosen / expired) shows them.
|
|
422
422
|
if (m.buttons && (!had.buttons || buttonsRank(m.buttons) > buttonsRank(had.buttons) || (buttonsRank(m.buttons) === buttonsRank(had.buttons) && m.buttons.poll && had.buttons.poll && m.buttons.poll.rev > had.buttons.poll.rev))) out[seen[k]] = Object.assign({}, had, { buttons: m.buttons });
|
|
423
423
|
return;
|
|
@@ -450,15 +450,30 @@
|
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
/** The list after a delivery report for `messageId`: the same list when nothing moved, else a copy. */
|
|
453
|
-
function
|
|
453
|
+
function deliveryMessage(had, update) {
|
|
454
|
+
var retry = update.retry, old = had.retry;
|
|
455
|
+
if (retry && typeof retry.owner === "string" && Number.isSafeInteger(retry.attempt) && retry.attempt >= 0) {
|
|
456
|
+
if (old && (old.owner !== retry.owner || retry.attempt < old.attempt)) return had;
|
|
457
|
+
if (old && retry.attempt === old.attempt && update.messageId !== had.messageId) return had;
|
|
458
|
+
var newer = !old || retry.attempt > old.attempt;
|
|
459
|
+
var next = newer ? nextDeliveryState(undefined, update.delivery) : nextDeliveryState(had.delivery, update.delivery);
|
|
460
|
+
if (!next) return had;
|
|
461
|
+
if (!newer && next === had.delivery && update.delivery !== had.delivery) return had;
|
|
462
|
+
if (!newer && next === had.delivery && JSON.stringify(retry) === JSON.stringify(old)) return had;
|
|
463
|
+
return Object.assign({}, had, { messageId: update.messageId, delivery: next, retry: Object.assign({}, retry) });
|
|
464
|
+
}
|
|
465
|
+
if (had.retry && update.messageId && update.messageId !== had.messageId) return had;
|
|
466
|
+
var next = nextDeliveryState(had.delivery, update.delivery);
|
|
467
|
+
return next === had.delivery ? had : Object.assign({}, had, { delivery: next });
|
|
468
|
+
}
|
|
469
|
+
function applyDelivery(list, messageId, delivery, update) {
|
|
454
470
|
var msgs = list || [];
|
|
455
471
|
for (var i = msgs.length - 1; i >= 0; i--) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
out
|
|
461
|
-
return out;
|
|
472
|
+
var sameRow = update && update.retry && msgs[i] && msgs[i].boot === update.boot && msgs[i].id === update.id;
|
|
473
|
+
if (!msgs[i] || (!sameRow && msgs[i].messageId !== messageId)) continue;
|
|
474
|
+
var next = deliveryMessage(msgs[i], Object.assign({}, update || {}, { messageId: messageId, delivery: delivery }));
|
|
475
|
+
if (next === msgs[i]) return msgs;
|
|
476
|
+
var out = msgs.slice(); out[i] = next; return out;
|
|
462
477
|
}
|
|
463
478
|
return msgs;
|
|
464
479
|
}
|
|
@@ -145,7 +145,7 @@ register("chat", {
|
|
|
145
145
|
previews: "Allow HTML previews",
|
|
146
146
|
clicked: "Clicked:", clickShow: "Show the message these buttons were on",
|
|
147
147
|
copy: "Copy", copyMessage: "Copy this reply", copied: "Copied", copyFailed: "Copy failed", wrap: "Wrap", showAll: "Show all {0} lines", showMore: "Show more", showLess: "Show less", showAllShort: "All {0} lines", showMoreShort: "More", jumpLatest: "Latest", newBelow: "{0} new",
|
|
148
|
-
disconnected: "disconnected", tick_queued: "Waiting behind another message", tick_processing: "Handed to the agent", tick_delivered: "The agent has it", tick_failed: "Not delivered", tick_cancelled: "Dropped by Stop", reactedBy: "{0} reacted",
|
|
148
|
+
disconnected: "disconnected", tick_queued: "Waiting behind another message", tick_processing: "Handed to the agent", tick_delivered: "The agent has it", tick_failed: "Not delivered", resend: "Resend", resending: "Resending…", resendFailed: "The message could not be resent. Try again.", resendAttachmentGone: "An attached file is no longer available. Write a new message and attach it again.", resendReplyGone: "The quoted message is no longer available. Write a new message without the quote.", tick_cancelled: "Dropped by Stop", reactedBy: "{0} reacted",
|
|
149
149
|
promptAnswering: "Answering…", promptGone: "This prompt is no longer open", promptTextPlaceholder: "Your answer", promptTextSend: "Send answer", promptFor: "{0}: {1}",
|
|
150
150
|
working: "{0} is working…", stuck: "{0} looks stuck",
|
|
151
151
|
metaWorking: "Working", metaStuck: "Looks stuck", metaStopping: "Stopping…", metaAwaiting: "Waiting for you", stopReply: "Stop reply", stopReplyTitle: "Stop the current reply (like Esc) and drop the messages still waiting. The instance keeps running.", stopSent: "Stopped",
|
|
@@ -318,7 +318,7 @@ register("chat", {
|
|
|
318
318
|
previews: "允許預覽 HTML",
|
|
319
319
|
clicked: "點選了:", clickShow: "顯示這些按鈕所在的訊息",
|
|
320
320
|
copy: "複製", copyMessage: "複製這則回覆", copied: "已複製", copyFailed: "複製失敗", wrap: "換行", showAll: "展開全部 {0} 行", showMore: "顯示更多", showLess: "收合", showAllShort: "全部 {0} 行", showMoreShort: "更多", jumpLatest: "最新", newBelow: "{0} 則新訊息",
|
|
321
|
-
disconnected: "已斷線", tick_queued: "排在前一則訊息之後", tick_processing: "已交給 agent", tick_delivered: "agent 已收到", tick_failed: "
|
|
321
|
+
disconnected: "已斷線", tick_queued: "排在前一則訊息之後", tick_processing: "已交給 agent", tick_delivered: "agent 已收到", tick_failed: "沒有送到", resend: "重新傳送", resending: "正在重新傳送…", resendFailed: "無法重新傳送這則訊息,請再試一次。", resendAttachmentGone: "附件已無法使用。請寫一則新訊息,重新附上檔案。", resendReplyGone: "引用的訊息已無法使用。請寫一則不含引用的新訊息。", tick_cancelled: "已被中止取消", reactedBy: "{0} 的回應",
|
|
322
322
|
promptAnswering: "回覆中…", promptGone: "這個提示已經結束", promptTextPlaceholder: "你的回答", promptTextSend: "送出回答", promptFor: "{0}:{1}",
|
|
323
323
|
working: "{0} 處理中…", stuck: "{0} 似乎卡住了",
|
|
324
324
|
metaWorking: "處理中", metaStuck: "似乎卡住了", metaStopping: "停止中…", metaAwaiting: "等你回應", stopReply: "停止回覆", stopReplyTitle: "停止目前的回覆(同 Esc),並取消還在排隊的訊息。Agent 會繼續運行。", stopSent: "已中止",
|