@songsid/agend 2.3.5-beta.2 → 2.3.5-beta.3

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.
Files changed (135) hide show
  1. package/dist/agent-cli-instructions.md +2 -2
  2. package/dist/auth-api.d.ts +2 -0
  3. package/dist/auth-api.js +5 -1
  4. package/dist/auth-api.js.map +1 -1
  5. package/dist/backend/claude-code.d.ts +2 -0
  6. package/dist/backend/claude-code.js +16 -3
  7. package/dist/backend/claude-code.js.map +1 -1
  8. package/dist/backend/cli-env-probe.js +6 -2
  9. package/dist/backend/cli-env-probe.js.map +1 -1
  10. package/dist/backend/codex.d.ts +5 -3
  11. package/dist/backend/codex.js +31 -13
  12. package/dist/backend/codex.js.map +1 -1
  13. package/dist/backend/kiro.js +1 -1
  14. package/dist/backend/kiro.js.map +1 -1
  15. package/dist/backend/types.d.ts +5 -1
  16. package/dist/backend/types.js.map +1 -1
  17. package/dist/bundled-tmux-guard.d.ts +4 -0
  18. package/dist/bundled-tmux-guard.js +7 -0
  19. package/dist/bundled-tmux-guard.js.map +1 -1
  20. package/dist/cache-service.d.ts +6 -0
  21. package/dist/cache-service.js +105 -0
  22. package/dist/cache-service.js.map +1 -1
  23. package/dist/channel/mcp-tools.js +2 -2
  24. package/dist/channel/mcp-tools.js.map +1 -1
  25. package/dist/daemon.d.ts +3 -0
  26. package/dist/daemon.js +17 -2
  27. package/dist/daemon.js.map +1 -1
  28. package/dist/fleet-manager.d.ts +71 -0
  29. package/dist/fleet-manager.js +393 -92
  30. package/dist/fleet-manager.js.map +1 -1
  31. package/dist/fleet-process-handlers.d.ts +1 -1
  32. package/dist/fleet-process-handlers.js +3 -2
  33. package/dist/fleet-process-handlers.js.map +1 -1
  34. package/dist/general-knowledge/skills/concepts/SKILL.md +11 -12
  35. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +9 -1
  36. package/dist/general-knowledge/skills/fleet-config/SKILL.md +12 -0
  37. package/dist/general-knowledge/skills/fleet-health/SKILL.md +1 -1
  38. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +4 -0
  39. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +16 -11
  40. package/dist/instance-lifecycle.d.ts +1 -1
  41. package/dist/instance-lifecycle.js +16 -1
  42. package/dist/instance-lifecycle.js.map +1 -1
  43. package/dist/instructions.js +29 -6
  44. package/dist/instructions.js.map +1 -1
  45. package/dist/kiro-history-scan.d.ts +26 -0
  46. package/dist/kiro-history-scan.js +141 -0
  47. package/dist/kiro-history-scan.js.map +1 -0
  48. package/dist/kiro-history-worker.d.ts +1 -0
  49. package/dist/kiro-history-worker.js +9 -0
  50. package/dist/kiro-history-worker.js.map +1 -0
  51. package/dist/kiro-history.d.ts +20 -0
  52. package/dist/kiro-history.js +96 -0
  53. package/dist/kiro-history.js.map +1 -0
  54. package/dist/kiro-usage-run.d.ts +2 -0
  55. package/dist/kiro-usage-run.js +4 -1
  56. package/dist/kiro-usage-run.js.map +1 -1
  57. package/dist/locale.js +67 -67
  58. package/dist/locale.js.map +1 -1
  59. package/dist/login-flows.d.ts +4 -0
  60. package/dist/login-flows.js +8 -4
  61. package/dist/login-flows.js.map +1 -1
  62. package/dist/office-levels.d.ts +4 -3
  63. package/dist/office-levels.js +3 -3
  64. package/dist/office-levels.js.map +1 -1
  65. package/dist/outbound-handlers.js +32 -12
  66. package/dist/outbound-handlers.js.map +1 -1
  67. package/dist/outbound-schemas.d.ts +14 -0
  68. package/dist/outbound-schemas.js +4 -0
  69. package/dist/outbound-schemas.js.map +1 -1
  70. package/dist/setup-i18n.js +4 -4
  71. package/dist/setup-i18n.js.map +1 -1
  72. package/dist/subagent-records.d.ts +42 -0
  73. package/dist/subagent-records.js +159 -0
  74. package/dist/subagent-records.js.map +1 -0
  75. package/dist/subagent-service.d.ts +27 -0
  76. package/dist/subagent-service.js +199 -0
  77. package/dist/subagent-service.js.map +1 -0
  78. package/dist/tool-permissions.d.ts +2 -3
  79. package/dist/tool-permissions.js +3 -3
  80. package/dist/tool-permissions.js.map +1 -1
  81. package/dist/ui/backend-signin.js +62 -62
  82. package/dist/ui/chat-commands.js +7 -0
  83. package/dist/ui/chat-store.js +9 -4
  84. package/dist/ui/chat-strings.js +18 -18
  85. package/dist/ui/fleet-cache.js +3 -3
  86. package/dist/ui/fleet-canvas.js +2 -2
  87. package/dist/ui/fleet-office-editor.js +1 -1
  88. package/dist/ui/fleet-office.js +1 -1
  89. package/dist/ui/fleet-org.js +2 -2
  90. package/dist/ui/fleet-task-card.js +1 -1
  91. package/dist/ui/fleet-task-common.js +7 -7
  92. package/dist/ui/model-picker.js +64 -0
  93. package/dist/ui/panel-chat.js +47 -16
  94. package/dist/ui/panel-fleet.js +8 -8
  95. package/dist/ui/panel-needs.js +3 -3
  96. package/dist/ui/panel-settings.js +16 -6
  97. package/dist/ui/settings-catalog.js +19 -4
  98. package/dist/ui/settings-dialogs.js +25 -8
  99. package/dist/ui/settings-guests.js +1 -1
  100. package/dist/ui/settings-registry.js +3 -1
  101. package/dist/ui/settings-strings.js +30 -26
  102. package/dist/ui/settings-update.js +69 -0
  103. package/dist/ui/shared/app-i18n.js +8 -4
  104. package/dist/ui/shared/app-shell.js +2 -0
  105. package/dist/ui/shared/app-update.js +215 -0
  106. package/dist/ui/shared/app.css +48 -2
  107. package/dist/ui/shared/instance-nav.js +1 -1
  108. package/dist/ui/shared/model-picker.css +21 -0
  109. package/dist/ui/shared/setup-host-text.js +4 -4
  110. package/dist/ui/shared/signin.js +32 -16
  111. package/dist/ui/shared/subagent-row.css +15 -0
  112. package/dist/ui/shared/view-strings.js +17 -17
  113. package/dist/ui/structured-signin.js +26 -26
  114. package/dist/ui/subagent-row.js +64 -0
  115. package/dist/ui/web-terminal/terminal.js +9 -9
  116. package/dist/update-marker.d.ts +2 -2
  117. package/dist/update-marker.js +4 -3
  118. package/dist/update-marker.js.map +1 -1
  119. package/dist/usage/providers.js +2 -2
  120. package/dist/usage/providers.js.map +1 -1
  121. package/dist/usage-rollup.d.ts +3 -0
  122. package/dist/usage-rollup.js +2 -0
  123. package/dist/usage-rollup.js.map +1 -1
  124. package/dist/web-api.d.ts +14 -0
  125. package/dist/web-api.js +216 -2
  126. package/dist/web-api.js.map +1 -1
  127. package/dist/web-auth.js +2 -1
  128. package/dist/web-auth.js.map +1 -1
  129. package/dist/web-commands.d.ts +8 -0
  130. package/dist/web-commands.js +6 -0
  131. package/dist/web-commands.js.map +1 -1
  132. package/dist/web-update.d.ts +77 -0
  133. package/dist/web-update.js +102 -0
  134. package/dist/web-update.js.map +1 -0
  135. package/package.json +2 -2
@@ -42,7 +42,7 @@ register("cache", {
42
42
  fleetExpiry: "過期成本", fleetSaving: "保溫可省", fleetRecommended: "建議保溫", ofN: "{1} 個中的 {0} 個",
43
43
  pricesNote: "牌價查證日期:{0}。", quotaNote: "訂閱方案:Anthropic 與 OpenAI 未公布快取讀取如何計入方案額度,因此節省金額以牌價計算為準,換算成額度則是估算。",
44
44
  estimateNote: "估算:Codex 不記錄快取寫入,寫入量以該次請求未命中快取的輸入估算。",
45
- notPricedNote: "有些模型不在價目表中,這些 instance 以「輸入價格單位」比較。",
45
+ notPricedNote: "有些模型不在價目表中,這些 Agent 以「輸入價格單位」比較。",
46
46
  scanning: "仍在讀取 transcript——還剩 {0}。重新整理可看到更多。", scanningFirst: "第一次讀取 transcript 中——重新整理可看到更多。", refresh: "重新整理",
47
47
  keepWarm: "建議保溫", leaveOff: "不需保溫", estimate: "估算", notPriced: "未定價",
48
48
  requests: "請求數", pastTtl: "超過 TTL({0})", expired: "已過期(重寫)", rewritten: "重寫的 token",
@@ -56,12 +56,12 @@ register("cache", {
56
56
  costsMoreUnits: "每次過期約需送 {0} 次 ping——保溫的花費比省下的多。",
57
57
  unavailable: "不提供", creditBilled: "以 credit 計費,沒有快取資料", unsupported: "這個 CLI 沒有快取資料", noData: "尚未讀到任何請求",
58
58
  shared: "與 {0} 共用工作目錄,無法分辨各自的 transcript",
59
- empty: "沒有 instance", emptyHint: "fleet 有 instance 後會顯示在這裡。",
59
+ empty: "沒有 Agent", emptyHint: "fleet 有 Agent 後會顯示在這裡。",
60
60
  b0: "≤5分", b1: "≤30分", b2: "≤1時", b3: "≤2時", b4: "≤6時", b5: "≤24時", b6: ">24時", tokensUnit: "輸入 token 當量",
61
61
  writeMix: "快取寫入 5 分 / 1 時", effectiveTtl: "實際存活", gapMiss: "{1} 個 5–60 分鐘空檔中有 {0} 個重寫", gapMissNone: "還沒有 5–60 分鐘的空檔",
62
62
  effMeasured: "{0}(實測)", effLabel: "{0}(依寫入標記)", effUnproven: "尚無法判斷",
63
63
  fleetSwitch: "建議改用 1 小時快取",
64
- switchTo1h: "它的 5 分鐘快取確實會過期:{1} 個 5–60 分鐘空檔中有 {0} 個重寫。請為這個 instance 設定 prompt_cache_ttl: \"1h\"(backend_options.claude-code),而不是保溫。",
64
+ switchTo1h: "它的 5 分鐘快取確實會過期:{1} 個 5–60 分鐘空檔中有 {0} 個重寫。請為這個 Agent 設定 prompt_cache_ttl: \"1h\"(backend_options.claude-code),而不是保溫。",
65
65
  unproven: "以 5 分鐘 TTL 寫入,但目前只有 {0} 個 5–60 分鐘空檔,太少,無法判斷實際存活多久。保溫的數字以 5 分鐘估算。",
66
66
  },
67
67
  });
@@ -47,9 +47,9 @@ register("orgc", {
47
47
  lgWork: "in progress (until its report)", lgReturn: "done (report back)", lgStale: "no report yet",
48
48
  },
49
49
  "zh-TW": {
50
- view: "檢視", canvas: "畫布", list: "清單", office: "辦公室", find: "尋找 instance", findShort: "尋找", found: "找到 {0} 個", foundOne: "找到 1 個", noMatch: "沒有符合的",
50
+ view: "檢視", canvas: "畫布", list: "清單", office: "辦公室", find: "尋找 Agent", findShort: "尋找", found: "找到 {0} 個", foundOne: "找到 1 個", noMatch: "沒有符合的",
51
51
  zoomIn: "放大", zoomOut: "縮小", fit: "符合畫面",
52
- label: "組織圖畫布。用 Tab 或方向鍵在 instance 之間移動,Enter 開啟聊天,+ 和 − 縮放,0 顯示整個 fleet。",
52
+ label: "組織圖畫布。用 Tab 或方向鍵在 Agent 之間移動,Enter 開啟聊天,+ 和 − 縮放,0 顯示整個 fleet。",
53
53
  expand: "展開", collapse: "收合", members: "{0} 名成員", member: "1 名成員", inFolded: "找到 {0} 個 · 展開", noMembers: "沒有成員",
54
54
  openChat: "開啟聊天", minimap: "總覽:點一下移到那裡",
55
55
  live: "即時", liveOn: "隱藏即時往來", liveOff: "顯示即時往來", lgTask: "delegate_task", lgSend: "send_to_instance",
@@ -44,7 +44,7 @@ register("orge", {
44
44
  add: "新增辦公室", newName: "新辦公室", name: "名稱", styleLabel: "風格", members: "成員", membersN: "已選 {0} 個", everyone: "全部",
45
45
  picked: "指定", nobody: "沒有人(只有 NPC)", pickSome: "還沒選任何人:選人之前會顯示全部。",
46
46
  nobodyNote: "這裡不坐任何 agent,只有風格裡的 NPC。",
47
- teams: "Team", instances: "Instance", remove: "刪除", save: "儲存", cancel: "取消", saved: "辦公室已儲存。",
47
+ teams: "Team", instances: "Agent", remove: "刪除", save: "儲存", cancel: "取消", saved: "辦公室已儲存。",
48
48
  none: "還沒有辦公室:辦公室檢視會顯示整個 fleet。", nameNeeded: "每個辦公室都需要名稱。", tooMany: "最多 {0} 個辦公室。",
49
49
  changed: "有人在這期間修改了辦公室,你的編輯沒有儲存。你可以保留你的編輯(儲存時會取代對方的修改),或載入對方的版本。",
50
50
  changedUnread: "有人在這期間修改了辦公室,你的編輯沒有儲存,也無法讀取目前的清單。請再試一次。",
@@ -101,7 +101,7 @@ register("orgo", {
101
101
  tileLabel: "{0} ({1})", openOffice: "Open the office {0}", lobbyTile: "Lobby tile (in no office)", lobbyEveryone: "Everyone is in an office", overviewNoEdit: "Pick one office to edit offices or a layout",
102
102
  },
103
103
  "zh-TW": {
104
- label: "辦公室:每個 team 是一間房間,每個 instance 一張桌子;General 和未加入 team 的 instance 在大廳。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示整個場景,F 切換全螢幕。",
104
+ label: "辦公室:每個 team 是一間房間,每個 Agent 一張桌子;General 和未加入 team 的 Agent 在大廳。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示整個場景,F 切換全螢幕。",
105
105
  office: "辦公室", allOffice: "整個 fleet", show: "顯示", allTeams: "所有 team", lobby: "大廳(General、未加入 team)", lobbyRoom: "大廳",
106
106
  people: "成員", peopleN: "成員({0})", findPerson: "尋找成員", everyone: "顯示全部", nobody: "沒有符合這個篩選的成員。",
107
107
  unseated: "{0} 位沒有座位", skinUnknown: "這裡沒有它的風格「{0}」:以辦公桌顯示。", closed: "休息中", desks: "桌子", tapAgain: "再點一下開啟聊天",
@@ -23,10 +23,10 @@ register("org", {
23
23
  sending: "Sending:", queuedNote: "(queued)", workingNote: "(in progress)",
24
24
  },
25
25
  "zh-TW": {
26
- starting: "啟動中", queued: "等待啟動", title: "組織圖", general: "General", unteamed: "未加入 team", members: "{0} 名成員", member: "1 名成員", instances: "{0} 個 instance", instance: "1 個 instance",
26
+ starting: "啟動中", queued: "等待啟動", title: "組織圖", general: "General", unteamed: "未加入 team", members: "{0} 名成員", member: "1 名成員", instances: "{0} 個 Agent", instance: "1 個 Agent",
27
27
  needs: "等你回應", working: "工作中", idle: "閒置", stuck: "似乎卡住", paused: "已暫停", stopped: "已停止", crashed: "已當掉",
28
28
  missing: "不在 fleet 中", thread_discord: "Discord 討論串", thread_telegram: "Telegram topic", openChat: "開啟聊天",
29
- classic: "ClassicBot 頻道", empty: "還沒有 instance", emptyHint: "fleet 有 instance 和 team 後會顯示在這裡。",
29
+ classic: "ClassicBot 頻道", empty: "還沒有 Agent", emptyHint: "fleet 有 Agent 和 team 後會顯示在這裡。",
30
30
  noTeams: "還沒有 team——到 Fleet → Teams 定義後,組織圖會依 team 分組。", newTab: "(在新分頁開啟)",
31
31
  sending: "傳送中:", queuedNote: "(排隊中)", workingNote: "(進行中)",
32
32
  },
@@ -41,7 +41,7 @@ register("taskcard", {
41
41
  conflict: "{0} 在你編輯時被改過了。已載入最新內容,你的修改還在,再存一次就會覆蓋。",
42
42
  moveTo: "移到…", moveLabel: "改狀態", followsSubs: "有子任務,狀態會跟著子任務自動變化",
43
43
  reopen: "重新打開", cancelCard: "取消這張卡", confirmMain: "確認主任務",
44
- assignee: "負責人", nobody: "沒人負責", unassign: "(不指派)", other: "其他…", otherTitle: "指派給其他 instance", otherLabel: "instance 名稱",
44
+ assignee: "負責人", nobody: "沒人負責", unassign: "(不指派)", other: "其他…", otherTitle: "指派給其他 Agent", otherLabel: "Agent 名稱",
45
45
  change: "改…", project: "專案", priority: "優先度", size: "大小", review: "你確認", reviewBox: "做完要停在待確認,等我確認",
46
46
  reviewOn: "做完會停在待確認,等你確認", reviewOff: "做完直接完成,不等你確認",
47
47
  parent: "主任務", deps: "相依", none: "沒有", edit: "編輯", depsTitle: "{0} 的相依", depsLabel: "要先完成的卡號,用逗號或空白分開(留空=沒有相依)",
@@ -92,7 +92,7 @@ register("tasks", {
92
92
  projects: "專案", noProject: "未分類", noProjectDesc: "fleet 在專案以外開的 task",
93
93
  newProject: "新增專案", newMain: "主任務", archived: "已封存", archive: "封存", restore: "恢復",
94
94
  rename: "編輯專案", projectName: "名稱", projectDesc: "說明",
95
- projectLead: "負責的 instance", projectLeadNone: "無(General)", projectLeadHint: "這個專案裡等你處理的卡片(待確認或卡住)會在負責 instance 的頻道顯示按鈕;若卡片是某個 instance 派出的,則顯示在派出者的頻道。", projectLeadGone: "{0}(已不在 fleet 中)", projectLeadChip: "負責:{0}", create: "建立", save: "儲存", cancel: "取消",
95
+ projectLead: "負責的 Agent", projectLeadNone: "無(General)", projectLeadHint: "這個專案裡等你處理的卡片(待確認或卡住)會在負責 Agent 的頻道顯示按鈕;若卡片是某個 Agent 派出的,則顯示在派出者的頻道。", projectLeadGone: "{0}(已不在 fleet 中)", projectLeadChip: "負責:{0}", create: "建立", save: "儲存", cancel: "取消",
96
96
  projectCreated: "專案已建立", projectSaved: "專案已儲存",
97
97
  noProjects: "還沒有專案", noProjectsHint: "專案是一組相關的工作:先建立專案,再在裡面開主任務。",
98
98
  mainCount: "{0} 個主任務", mainOne: "1 個主任務", waiting: "等你確認 {0}", blockedN: "卡住 {0}", lastActivity: "最後動態 {0}",
@@ -101,9 +101,9 @@ register("tasks", {
101
101
  everyone: "全部負責人", nobody: "沒人負責", filterLabel: "依負責人篩選",
102
102
  recent: "近 7 天", all: "全部", toggleDone: "切換:只看近 7 天/全部",
103
103
  emptyBoard: "這個專案還沒有主任務", emptyFiltered: "沒有符合篩選的主任務",
104
- emptyBoardHint: "主任務是你要的成果,可大可小。指派給 instance,它會自己決定直接做,或先拆成子任務。",
104
+ emptyBoardHint: "主任務是你要的成果,可大可小。指派給 Agent,它會自己決定直接做,或先拆成子任務。",
105
105
  subProgress: "子任務 {0}/{1}", showSubs: "展開子任務", hideSubs: "收起子任務", olderSubs: "另有 {0} 張比較早完成",
106
- acceptance: "驗收條件", definition: "完成定義", waitsFor: "等 {0} 完成", comments: "留言", agentReplied: "instance 有新回覆",
106
+ acceptance: "驗收條件", definition: "完成定義", waitsFor: "等 {0} 完成", comments: "留言", agentReplied: "Agent 有新回覆",
107
107
  needsReview: "需確認", needsReviewTitle: "做完要停在待確認,等你確認", urgentTag: "緊急", highTag: "優先",
108
108
  waitingTitle: "待你處理", waitingEmpty: "沒有等你處理的事。", confirm: "確認", sendBack: "退回", answer: "回覆",
109
109
  confirmed: "已確認 {0}", sentBack: "已退回 {0}", answered: "已回覆 {0}",
@@ -116,8 +116,8 @@ register("tasks", {
116
116
  goal: "目標", goalHint: "為什麼做、做完是什麼樣子", scope: "範圍", scopeHint: "做:…/不做:…",
117
117
  definitionHint: "一行一項:能客觀判斷是否達成的條件", acceptanceHint: "一行一項",
118
118
  context: "背景", contextHint: "檔案路徑、相關卡號、已經做的決定(只放指引)",
119
- assignee: "負責人", assigneeHint: "交給哪個 instance", project: "專案", size: "大小", priority: "優先度",
120
- boardOff: "{0}(看板已關閉)", boardOffHint: "關閉任務看板的 instance 不能被派卡:它沒有 task 工具,讀不到卡片。",
119
+ assignee: "負責人", assigneeHint: "交給哪個 Agent", project: "專案", size: "大小", priority: "優先度",
120
+ boardOff: "{0}(看板已關閉)", boardOffHint: "關閉任務看板的 Agent 不能被派卡:它沒有 task 工具,讀不到卡片。",
121
121
  reviewBox: "做完要停在待確認,等我確認", created: "已開 {0}", titleRequired: "標題必填",
122
122
  search: "搜尋卡片", searchHint: "搜尋標題、各欄位、驗收條件和留言", searchEmpty: "沒有符合的卡片", inField: "在{0}",
123
123
  fieldgoal: "目標", fieldscope: "範圍", fieldcontext: "背景", fieldstate: "目前狀態", fieldresult: "產出", fieldblockedReason: "卡住原因",
@@ -134,7 +134,7 @@ register("tasks", {
134
134
  "err.too_long": "{0}太長:{1} 字,上限 {2} 字", "err.state_lines": "目前狀態最多 {0} 行(現在 {1} 行)",
135
135
  "err.acceptance_empty": "驗收條件不能是空的", "err.acceptance_max": "驗收條件最多 {0} 項",
136
136
  "err.acceptance_no_item": "驗收條件沒有第 {0} 項(共 {1} 項)", "err.project_not_found": "找不到專案「{0}」",
137
- "err.project_name_empty": "專案名稱不能是空的", "err.project_name_digits": "專案名稱不能只有數字", "err.lead_not_instance": "負責人必須是 fleet 裡的 instance",
137
+ "err.project_name_empty": "專案名稱不能是空的", "err.project_name_digits": "專案名稱不能只有數字", "err.lead_not_instance": "負責人必須是 fleet 裡的 Agent",
138
138
  "err.project_name_taken": "已經有專案叫「{0}」", "err.project_archived": "專案「{0}」已封存,不能再開主任務",
139
139
  "err.card_not_found": "找不到 {0}", "err.title_empty": "標題不能是空的", "err.scope_main_only": "範圍只用在主任務",
140
140
  "err.blocked_reason_not_blocked": "只有卡住的卡才有卡住原因", "err.block_reason": "卡住要寫原因:需要誰回答什麼",
@@ -152,7 +152,7 @@ register("tasks", {
152
152
  "note.back_to": "{0} 又有沒完成的子任務,已回到{1}", "note.deps_done": "{0} 的相依都完成了,可以開始",
153
153
  "note.deps_unmet": "提醒:{0} 還沒完成",
154
154
  // #2246 step 3:誰在做什麼(fleet-task-work.js)
155
- instances: "Instance", instancesTip: "fleet 有哪些 instance、各在做什麼", instancesHead: "{0} 個 · 工作中 {1}",
155
+ instances: "Agent", instancesTip: "fleet 有哪些 Agent、各在做什麼", instancesHead: "{0} 個 · 工作中 {1}",
156
156
  workSentBack: "被退回", workDoing: "進行中", workBlocked: "卡住", workReview: "待確認", workMain: "負責",
157
157
  workReady: "可以開始", workWaiting: "等前置", workSubs: "子任務 {0}/{1}", workClaimable: "沒人負責,可領",
158
158
  workWaitsFor: "等 {0}", workNone: "看板上沒有它的卡", workNewComments: "有它還沒看過的留言",
@@ -0,0 +1,64 @@
1
+ // M-2731: feature-owned words/styles travel with lazy panels, including tabs with an older shell/catalog module.
2
+ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
3
+ import { register, t } from "/assets/app-i18n.js";
4
+ import { Icon } from "/assets/ui-icons.js";
5
+ import { ErrorState } from "/assets/ui-states.js";
6
+ import * as catalogStore from "./settings-catalog.js";
7
+ register("modelPicker", {
8
+ en: { refresh: "Refresh models", refreshing: "Refreshing models…", refreshed: "Model list refreshed.", failed: "Could not refresh models. The previous list and selection are kept.", more: "More models…", backend: "Choose backend", model: "Choose model", next: "Choose a backend; next choose its model and reasoning effort.", current: "Selected", keep: "Refreshing keeps the selected model.", selectionHint: "Refresh keeps your selection; choose a model to apply it." },
9
+ "zh-TW": { refresh: "重新整理模型", refreshing: "正在重新整理模型…", refreshed: "模型清單已更新。", failed: "無法重新整理模型。已保留原清單與選擇。", more: "更多模型…", backend: "選擇後端", model: "選擇模型", next: "選擇後端;下一步選模型與推理強度", current: "已選擇", keep: "重新整理會保留已選模型。", selectionHint: "重新整理只更新清單;選擇模型才會套用。" },
10
+ });
11
+ export const mw = key => t(`modelPicker.${key}`);
12
+ export function modelPickerStyles() {
13
+ if (typeof document === "undefined" || !document.head || document.querySelector('link[href="/assets/model-picker.css"]')) return;
14
+ const link = document.createElement("link"); link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/model-picker.css"); document.head.appendChild(link);
15
+ }
16
+ const answers = new Map(); // share only in-flight passive reads; the server owns catalog freshness
17
+ export function forgetModelPickerCatalogs() { answers.clear(); catalogStore.forgetCatalogs?.(); }
18
+ /** Selection remains owned by the form; rediscovery never calls its onChange or stages a change. */
19
+ export function useRefreshableModels(backend, instance) {
20
+ const target = { backend, ...(instance ? {instance} : {}) };
21
+ const key = JSON.stringify(target);
22
+ const [state, set] = useState({ key, models: [], phase: "loading" });
23
+ const generation = useRef(0);
24
+ const current = useRef(key), flight = useRef(null), mounted = useRef(true);
25
+ current.current = key;
26
+ useEffect(() => { mounted.current = true; return () => { mounted.current = false; }; }, []);
27
+ useEffect(() => {
28
+ let live = true; const gen = ++generation.current;
29
+ const url = `/ui/models?backend=${encodeURIComponent(backend || "")}${instance ? `&instance=${encodeURIComponent(instance)}` : ""}`;
30
+ const hit = answers.get(key), fresh = !!hit;
31
+ const promise = fresh ? hit.promise : typeof catalogStore.readModelCatalog === "function" ? catalogStore.readModelCatalog(target) : fetch(url, { credentials: "same-origin" }).then(async r => { if (!r.ok) throw Error(); const data = await r.json(); return Array.isArray(data.models) ? data.models : []; });
32
+ if (!fresh) { answers.set(key, { promise }); if (answers.size > 64) answers.delete(answers.keys().next().value); }
33
+ set({ key, models: [], phase: "loading" }); flight.current = null;
34
+ promise.finally(() => { if (answers.get(key)?.promise === promise) answers.delete(key); }).catch(() => {});
35
+ promise.then(models => { if (live && gen === generation.current) set({ key, models, phase: "idle" }); }, () => { if (answers.get(key)?.promise === promise) answers.delete(key); if (live && gen === generation.current) set({ key, models: [], phase: "error" }); });
36
+ return () => { live = false; };
37
+ }, [key]);
38
+ const shown = state.key === key ? state : { key, models: [], phase: "loading" };
39
+ async function refresh() {
40
+ if (flight.current || !backend) return;
41
+ const token = {}; flight.current = token; generation.current++;
42
+ set({ ...shown, phase: "busy" });
43
+ try {
44
+ const r = await fetch("/ui/models/refresh", { method: "POST", credentials: "same-origin", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ backend, ...(instance ? { instance } : {}) }) });
45
+ const data = await r.json();
46
+ if (!r.ok || data.refreshed !== true || !Array.isArray(data.models)) throw Error();
47
+ if (!mounted.current || current.current !== key || flight.current !== token) return;
48
+ answers.delete(key); // Retire the earlier passive flight before a remount can borrow it.
49
+ catalogStore.rememberModelCatalog?.(target, data);
50
+ set({ key, models: data.models, phase: "done" });
51
+ } catch { if (mounted.current && current.current === key && flight.current === token) set({ ...shown, phase: "error" }); }
52
+ finally { if (flight.current === token) flight.current = null; }
53
+ }
54
+ return { ...shown, refresh };
55
+ }
56
+ export function ModelRefresh({ state, disabled }) {
57
+ modelPickerStyles();
58
+ return html`<div class="model-refresh"><button type="button" class="btn" disabled=${disabled || state.phase === "busy"} onClick=${state.refresh}>
59
+ <${Icon} name="restart" size=${16} />${mw(state.phase === "busy" ? "refreshing" : "refresh")}</button>
60
+ <p class="note">${mw("keep")}</p>
61
+ ${state.phase === "error" ? html`<${ErrorState} message=${mw("failed")} onRetry=${disabled ? undefined : state.refresh} />`
62
+ : state.phase === "done" ? html`<p class="note" role="status">${mw("refreshed")}</p>` : null}</div>`;
63
+ }
64
+ export const modelLabel = value => ({ sonnet: "Sonnet", opus: "Opus", haiku: "Haiku" }[value] || value);
@@ -6,12 +6,12 @@
6
6
  // right, the agent's at full width, and one rounded composer pinned below with attach, Stop reply and Send inside it.
7
7
  // The instance's own actions (details, start, stop, restart, delete) are in the header's ⋯ menu, and only the ones
8
8
  // that apply to its state are offered (#1408 rough edges 4 and 7).
9
- import { html, useEffect, useLayoutEffect, useRef, useState } from "/assets/app-html.js";
9
+ import { html, Fragment, useEffect, useLayoutEffect, useRef, useState } from "/assets/app-html.js";
10
10
  import { lang, t } from "/assets/app-i18n.js";
11
11
  import { appStore, createStore, guestPage, guestTrusted, useStore } from "/assets/app-store.js";
12
12
  import { ComposerAuth } from "/assets/web-authorize.js";
13
13
  import { useLease } from "/assets/app-ctx.js";
14
- import { modelText, namesOf, namesStore, navStore as instanceNavStore } from "/assets/instance-nav.js";
14
+ import { backendLabel, modelText, namesOf, namesStore, navStore as instanceNavStore } from "/assets/instance-nav.js";
15
15
  import { PanelHeader, onPanelKey, setTitle, statusClass, statusLabel, openDrawer, requestNewInstance } from "/assets/app-shell.js";
16
16
  import { detailsPath, textLinkSegments } from "/assets/app-route.js";
17
17
  import { InstanceSwitch } from "/assets/instance-switch.js";
@@ -23,7 +23,9 @@ import { Empty, Skeleton } from "/assets/ui-states.js";
23
23
  import { Icon } from "/assets/ui-icons.js";
24
24
  import { recordEdit } from "/assets/text-undo.js";
25
25
  import { toast } from "/assets/ui-toast.js";
26
+ import { openUpdateDialog } from "/assets/app-update.js";
26
27
  import { confirmDialog } from "/assets/ui-confirm.js";
28
+ import { modelLabel, modelPickerStyles, mw } from "./model-picker.js";
27
29
  import { savePref } from "/assets/app-prefs.js";
28
30
  import { applyTheme, clearAmbient, resolvedMode, themeFor, themeImageUrl, themeMenuItems, themesStore } from "/assets/app-themes.js";
29
31
  import { colorMenuItem } from "/assets/identity-color.js";
@@ -78,7 +80,7 @@ import { pollPublicPreview } from "./preview-status.js";
78
80
  import { createMentionIndex } from "./chat-mentions.js";
79
81
  import { setPanelFeedback } from "./preview-panel-actions.js";
80
82
  import { PreviewPanel, claimPanel, openMarkdown, openPanel, panelClaims, panelStore, panelVersion, shownKey } from "./preview-panel.js";
81
- import { needsArgument, paletteFor, parseCommandLine } from "./chat-commands.js";
83
+ import { isUpdateLine, needsArgument, paletteFor, parseCommandLine, UPDATE_COMMAND } from "./chat-commands.js";
82
84
  import { installTour, refreshTourSpot } from "./chat-tour.js";
83
85
  import { LightboxHost, openLightbox } from "./image-lightbox.js";
84
86
  import { AmbientMotionNote, ChatAmbient, ambientMenuItems } from "./chat-ambient.js";
@@ -336,8 +338,10 @@ function ChatView({ name, inst, lease, navKey, exec, awaiting }) {
336
338
  const guest = guestPage();
337
339
  // #1269 quick actions: the model and effort it runs, each a way to /model or /effort (the same pick list).
338
340
  const pick = (command) => store.runCommand(name, command, "", { alive: () => lease.current() });
341
+ modelPickerStyles();
339
342
  const sub = html`<span class="status"><span class=${`dot ${cls}`} aria-hidden="true"></span>${statusLabel(inst, exec, awaiting)}</span>
340
- ${inst.model ? html`<button type="button" class="hd-chip" title=${t("chat.chipModel", modelText(inst))} aria-label=${t("chat.chipModel", modelText(inst))} onClick=${() => pick("model")}>${modelText(inst)}</button>` : null}
343
+ ${!guest ? html`<button type="button" class="hd-chip chat-model-entry" title=${mw("backend")} aria-label=${mw("backend")} onClick=${() => pick("backend")}>${backendLabel(inst.backend)} ▾</button>
344
+ <button type="button" class="hd-chip chat-model-entry" title=${t("chat.chipModel", modelText(inst))} aria-label=${t("chat.chipModel", modelText(inst))} onClick=${() => pick("model")}>${modelLabel(inst.model || modelText(inst))} ▾</button>` : null}
341
345
  ${inst.effort ? html`<button type="button" class="hd-chip" title=${t("chat.chipEffort", inst.effort)} aria-label=${t("chat.chipEffort", inst.effort)} onClick=${() => pick("effort")}>${inst.effort}</button>` : null}`;
342
346
  return html`<div class=${`panel p-chat${wrap ? " wrap-code" : ""}`} data-width=${wide ? "full" : undefined} ref=${view}>
343
347
  <${PanelHeader} title=${headerName(namesOf(inst || { name }, names.primary))} sub=${sub} nav=${guest ? (guestTrusted() ? html`<${InstanceSwitch} name=${name} current="chat" guest=${true} />` : null) : html`<${InstanceSwitch} name=${name} current="chat" />`}><${CardMenu} card=${card} /><${HeaderTools} navKey=${navKey} />${guest ? null : html`<${Menu} items=${items} label=${t("app.more")} />`}</${PanelHeader}>
@@ -526,13 +530,26 @@ function Thread({ name, th }) {
526
530
  else letGo(e, false); // let go meanwhile (a new language)
527
531
  };
528
532
  }, [name]);
529
- return html`<div class="scroller" ref=${scroller}>
533
+ return html`<${Fragment}><div class="scroller" ref=${scroller}>
530
534
  <div class="thread-host" ref=${host}></div>
531
535
  ${empty === "hidden" ? html`<${Empty} icon="chat" title=${t("chat.guestAllHidden")} hint=${t("chat.guestAllHiddenHint")} />`
532
536
  : empty ? html`<${Empty} icon="chat" title=${t("chat.noMessages")} />` : null}
533
- <div class="jump-dock">${jump.show ? html`<button data-trust="thread-control" type="button" class="jump-latest" onClick=${() => th.current && th.current.jumpLatest()}>
537
+ </div><div class="jump-dock">${jump.show ? html`<button data-trust="thread-control" type="button" class="jump-latest" onClick=${() => th.current && th.current.jumpLatest()}>
534
538
  <${Icon} name="down" size=${16} />${jump.unseen > 0 ? t("chat.newBelow", jump.unseen) : t("chat.jumpLatest")}</button>` : null}</div>
535
- </div>`;
539
+ </${Fragment}>`;
540
+ }
541
+
542
+ // Missing optional chunks on an older server never prevent chat from loading. No shared export added.
543
+ function SubagentProgress({ name }) {
544
+ const [Component, setComponent] = useState(null);
545
+ const offered = typeof document !== "undefined" && document.body?.dataset.subagents === "1" && !guestPage() && !publicLinkPage();
546
+ useEffect(() => {
547
+ if (!offered) return;
548
+ let live = true;
549
+ import("./subagent-row.js").then(m => { if (live && typeof m.SubagentRow === "function") setComponent(() => m.SubagentRow); }, () => {});
550
+ return () => { live = false; };
551
+ }, [offered]);
552
+ return offered && Component ? html`<${Component} key=${name} name=${name} />` : null;
536
553
  }
537
554
 
538
555
  /** Everything under the thread: prompts, the working line, a failed send, files waiting, and the composer. */
@@ -541,11 +558,12 @@ function Dock({ name, inst, lease, exec, awaiting, workingLabel }) {
541
558
  const s = store.state;
542
559
  return html`<div data-trust="composer" class="dock"><div class="dock-col">
543
560
  <${Prompts} name=${name} />
561
+ <${SubagentProgress} name=${name} />
544
562
  <${WorkBar} name=${name} lease=${lease} exec=${exec} awaiting=${awaiting} workingLabel=${workingLabel} />
545
563
  <${CommandCard} name=${name} lease=${lease} />
546
564
  <${QuickActions} name=${name} inst=${inst} lease=${lease} />
547
565
  ${s.waking[name] ? html`<p class="send-waking" role="status">${t("chat.waking", name)}</p>` : null}
548
- <${Composer} name=${name} label=${composerLabel(inst, name)} lease=${lease} busy=${R().isBusy(exec)} />
566
+ <${Composer} name=${name} inst=${inst} label=${composerLabel(inst, name)} lease=${lease} busy=${R().isBusy(exec)} />
549
567
  <div class="composer-row">${guestPage() ? html`<span class="guest-note" title=${t("chat.guestNote")}>${t("chat.guestNote")}</span>` : html`<${ComposerAuth} />`}<span
550
568
  class="hint" title=${t(guestPage() ? "chat.guestMore" : "chat.composerMore")}>${t(touchScreen() ? "chat.composerHintTouch" : "chat.composerHint")}</span></div>
551
569
  </div></div>`;
@@ -562,20 +580,27 @@ function openBackendSignIn(backend) {
562
580
  function CommandCard({ name, lease }) {
563
581
  const c = store.state.commands[name];
564
582
  if (!c) return null;
565
- const run = (args) => store.runCommand(name, c.command, args, { alive: () => lease.current() });
566
- return html`<div class=${`cmd-card${c.error ? " bad" : ""}`} role=${c.error ? "alert" : "status"}>
567
- <div class="cmd-head"><span class="cmd-name mono">/${c.command}</span>
583
+ const run = (args, action) => store.runCommand(name, c.command, args, { alive: () => lease.current(), ...(action ? { action } : {}) });
584
+ const actions = c.choices?.actions || [];
585
+ const refresh = actions.find(a => a === "refresh" || a === "refreshAll");
586
+ return html`<div class=${`cmd-card${c.command === "model" ? " cmd-model" : ""}${c.error ? " bad" : ""}`} role=${c.error ? "alert" : "status"}>
587
+ <div class="cmd-head"><span class="cmd-name mono">/${c.command}${c.command === "model" || c.choices?.step === "model" ? html` · ${mw("model")}` : null}</span>
588
+ <div class="cmd-head-actions">${refresh ? html`<button type="button" class="icon-btn" data-model-action=${refresh} title=${mw("refresh")} aria-label=${mw("refresh")} disabled=${c.busy}
589
+ onClick=${() => run(c.choices.args || "", refresh)}><${Icon} name="restart" size=${16} /></button>` : null}
568
590
  ${c.busy ? html`<span class="wait">${t("chat.cmdRunning", c.command)}</span>` : html`<button type="button" class="icon-btn" title=${t("chat.cmdDismiss")}
569
- aria-label=${t("chat.cmdDismiss")} onClick=${() => store.dismissCommand(name)}><${Icon} name="close" size=${14} /></button>`}</div>
591
+ aria-label=${t("chat.cmdDismiss")} onClick=${() => store.dismissCommand(name)}><${Icon} name="close" size=${14} /></button>`}</div></div>
570
592
  ${c.error ? html`<p class="cmd-text">${c.error}</p>` : null}
571
593
  ${c.text ? html`<pre class="cmd-text">${c.text}</pre>` : null}
572
594
  ${c.compact ? html`<p class="cmd-text cmd-phase">${c.compact === "running" ? t("chat.compactRunning")
573
595
  : c.compact === "done" ? t("chat.compactDone") : c.compact === "timeout" ? t("chat.compactTimeout", "10")
574
596
  : c.compact === "lost" ? t("chat.compactLost") : c.compact === "not_compacted" ? t("chat.compactNotCompacted") : t("chat.compactUnknown")}</p>` : null}
575
- ${c.choices && c.choices.prompt ? html`<pre class="cmd-text">${c.choices.prompt}</pre>` : null}
597
+ ${c.choices?.step === "backend" ? html`<p class="note">${mw("next")}</p>` : null}
598
+ ${c.choices && c.choices.prompt ? html`<pre class="cmd-text">${c.choices.prompt}</pre>` : null}
576
599
  ${c.choices ? html`<div class="cmd-choices" role="group" aria-label=${t("chat.cmdChoose")}>${c.choices.options.map((o) => html`<button key=${o.id} type="button"
577
600
  class=${`btn btn-sm${o.id === c.choices.current ? " current" : ""}`} aria-current=${o.id === c.choices.current ? "true" : undefined}
578
- disabled=${!!o.disabled} title=${o.disabled || undefined} onClick=${() => { if (!o.disabled) run(o.id); }}>${o.label}</button>`)}</div>` : null}
601
+ disabled=${c.busy || !!o.disabled} title=${o.disabled || undefined} onClick=${() => { if (!o.disabled) run(o.id); }}>${c.choices.step === "backend" ? html`<span>${backendLabel(o.id)}</span>${o.disabled ? html`<span class="note">${o.disabled}</span>` : null}` : modelLabel(c.command === "model" ? o.label.replace(/^✓\s*/, "") : o.label)}</button>`)}</div>` : null}
602
+ ${c.command === "model" && c.choices ? html`<p class="note">${mw("selectionHint")}</p>` : null}
603
+ ${actions.includes("more") ? html`<div class="cmd-model-more"><button type="button" class="btn btn-sm btn-ghost" data-model-action="more" disabled=${c.busy} onClick=${() => run("", "more")}>${mw("more")}</button></div>` : null}
579
604
  ${c.choices && c.choices.options.some((o) => o.signIn) && !publicLinkPage() ? html`<div class="cmd-choices" role="group" aria-label=${t("chat.cmdSignIn")}>${c.choices.options.filter((o) => o.signIn).map((o) => html`<button
580
605
  key=${`signin:${o.signIn}`} type="button" class="btn btn-sm btn-primary" onClick=${() => openBackendSignIn(o.signIn)}>${t("chat.cmdSignInTo", o.signIn)}</button>`)}</div>` : null}
581
606
  </div>`;
@@ -642,7 +667,7 @@ function replySnippet(r) {
642
667
  return text || (r.media === "photo" ? t("chat.replyPhoto") : r.media === "document" ? t("chat.replyFile") : "");
643
668
  }
644
669
 
645
- function Composer({ name, label = name, lease, busy }) {
670
+ function Composer({ name, inst, label = name, lease, busy }) {
646
671
  const s = store.state;
647
672
  const input = useRef(null), fileIn = useRef(null);
648
673
  const [, tick] = useState(0);
@@ -663,7 +688,9 @@ function Composer({ name, label = name, lease, busy }) {
663
688
  const guest = guestPage();
664
689
  const app = useStore(appStore);
665
690
  const guestAllowed = guest ? (app.instances.find((i) => i.name === name)?.commands ?? []) : null;
666
- const palette = files.length || closedFor === value || (guest && !guestAllowed.length) ? null : paletteFor(value, guestAllowed || undefined);
691
+ const palette0 = files.length || closedFor === value || (guest && !guestAllowed.length) ? null : paletteFor(value, guestAllowed || undefined);
692
+ // M-2738 (D3): /update is the fleet's, not the agent's: offered (never to a guest) and it opens the app's Update dialog.
693
+ const palette = palette0 && !guest && UPDATE_COMMAND.name.startsWith(value.slice(1)) ? [...palette0, UPDATE_COMMAND] : palette0;
667
694
  const pick = palette && palette.length ? palette[Math.min(sel, palette.length - 1)] : null;
668
695
  // Grow with the text, up to a limit: set through the CSSOM, never a style attribute (#1300). Empty, it is one line
669
696
  // (#2478 — a long name's placeholder made the box two lines tall).
@@ -685,6 +712,7 @@ function Composer({ name, label = name, lease, busy }) {
685
712
  // #2342: a completion is a step Ctrl+Z goes back from (to what was typed); a command that runs consumes the line.
686
713
  const complete = (c) => { recordEdit(input.current); setValue(`/${c.name}${c.arg ? " " : ""}`); };
687
714
  const submit = () => {
715
+ if (!guest && !files.length && isUpdateLine(value)) { setValue(""); openUpdateDialog(); return; }
688
716
  if (pick) {
689
717
  if (value === `/${pick.name}` && !needsArgument(pick.name)) runLine({ command: pick.name, args: "" });
690
718
  else complete(pick);
@@ -725,6 +753,9 @@ function Composer({ name, label = name, lease, busy }) {
725
753
  };
726
754
  const optId = (c) => `cmd-${c.name}`;
727
755
  return html`<div class="composer-box">
756
+ ${!guestPage() ? html`<div class="model-entry-row" role="group" aria-label=${mw("model")}>
757
+ <button type="button" class="btn btn-sm" onClick=${() => store.runCommand(name, "backend", "", { alive: () => lease.current() })}>${backendLabel(inst?.backend)} ▾</button>
758
+ <button type="button" class="btn btn-sm" onClick=${() => store.runCommand(name, "model", "", { alive: () => lease.current() })}>${modelLabel(inst?.model || modelText(inst || {}))} ▾</button></div>` : null}
728
759
  ${palette ? html`<ul data-trust="palette" class="cmd-palette" id="cmdPalette" role="listbox" aria-label=${t("chat.cmdCommands")}>
729
760
  ${palette.length ? palette.map((c) => html`<li key=${c.name} id=${optId(c)} role="option" aria-selected=${c === pick ? "true" : "false"}
730
761
  class=${c === pick ? "on" : ""} onMouseDown=${(e) => { e.preventDefault(); complete(c); }}>
@@ -66,29 +66,29 @@ register("fleet", {
66
66
  "zh-TW": {
67
67
  hostMemory_elevated: "主機記憶體壓力偏高:新的 agent 一次啟動一個,至少間隔 5 秒",
68
68
  hostMemory_critical: "主機記憶體壓力嚴重:新的 agent 會等記憶體恢復再啟動",
69
- hostMemory_top: "最大:{0}", hostMemory_ownerFleet: "fleet 本身", hostMemory_ownerTmux: "tmux", hostMemory_ownerOther: "不屬於任何 instance",
69
+ hostMemory_top: "最大:{0}", hostMemory_ownerFleet: "fleet 本身", hostMemory_ownerTmux: "tmux", hostMemory_ownerOther: "不屬於任何 Agent",
70
70
  title: "Fleet", tasks: "Tasks", schedules: "排程", teams: "Teams", org: "組織圖", cache: "快取", usage: "用量",
71
71
  docs: "文件", docsNewTab: "文件(在新分頁開啟)",
72
72
  newSchedule: "新增排程", newTeam: "新增 team",
73
73
  noSchedules: "還沒有排程", noSchedulesHint: "用 cron 自動執行例行工作。",
74
- noTeams: "還沒有 team", noTeamsHint: "把 instance 分組一起工作。", countSchedules: "{0} 個排程", countTeams: "{0} 個 team", countSchedule: "1 個排程", countTeam: "1 個 team",
74
+ noTeams: "還沒有 team", noTeamsHint: "把 Agent 分組一起工作。", countSchedules: "{0} 個排程", countTeams: "{0} 個 team", countSchedule: "1 個排程", countTeam: "1 個 team",
75
75
  delete: "刪除", on: "開", off: "關", cancel: "取消", create: "建立", creating: "建立中…", save: "儲存變更",
76
- taskDesc: "說明", cron: "Cron 表示式", message: "訊息", target: "目標 instance", label: "標籤", teamName: "Team 名稱", members: "成員",
76
+ taskDesc: "說明", cron: "Cron 表示式", message: "訊息", target: "目標 Agent", label: "標籤", teamName: "Team 名稱", members: "成員",
77
77
  schedOnce: "一次 · {0}", schedNext: "下次 {0}", schedRetrying: "重試中", schedDisabled: "已停用", schedSilent: "靜默", schedTz: "時區:{0}",
78
78
  editSchedule: "編輯排程", edit: "編輯", scheduleSaved: "已儲存排程", schedRepeat: "重複", schedOnceMode: "一次",
79
79
  schedWhen: "日期與時間", schedTimezone: "時區", schedEnabled: "啟用", schedWhenIn: "以 {0} 時間", schedWhenRequired: "請選擇日期與時間",
80
80
  schedTzBad: "不認得的時區:{0}",
81
81
  cronEveryMinute: "每分鐘", cronEveryMinutes: "每 {0} 分鐘", cronEveryHours: "每 {0} 小時", cronDaily: "每天 {0}",
82
82
  cronWeekdays: "每週一到五 {0}", cronDays: "每週{0} {1}", cronMonthly: "每月 {0} 日 {1}", dayNames: "日,一,二,三,四,五,六", dayJoin: "、",
83
- scheduleFieldsRequired: "必須填寫 Cron、訊息與目標 instance", teamFieldsRequired: "必須填寫名稱並選擇至少一名成員",
83
+ scheduleFieldsRequired: "必須填寫 Cron、訊息與目標 Agent", teamFieldsRequired: "必須填寫名稱並選擇至少一名成員",
84
84
  deleteSchedule: "確定刪除此排程嗎?", deleteTeam: "確定刪除 team「{0}」嗎?", scheduleCreated: "排程已建立", scheduleDeleted: "排程已刪除",
85
85
  teamCreated: "Team 已建立", teamDeleted: "Team 已刪除", teamUpdated: "Team 已更新", edit: "編輯", editTeam: "編輯 team",
86
86
  teamNoRename: "不支援重新命名:請建立新的 team,再刪除這個。",
87
87
  backend: "Backend",
88
- newInstance: "新增 instance", directory: "目錄", directoryHint: "可留空——留空會自動建立工作區", topic: "名稱", topicHint: "預設取自目錄名稱",
89
- topicRequired: "目錄留空時必須填寫名稱", description: "說明", descriptionHint: "這個 instance 做什麼", model: "模型", modelHint: "例如 sonnet、opus、gpt-5",
90
- branch: "分支(git worktree)", branchHint: "例如 feature-x", tags: "標籤", tagsHint: "以逗號分隔,例如 dev, review", systemPrompt: "System prompt", systemPromptHint: "這個 instance 的自訂指示",
91
- fleetDefault: "使用 fleet 預設", notInstalled: "(未安裝)", notSignedIn: "(未登入,請用 /login)", tooOld: "(需要 {0} 以上版本)", unchecked: "(尚未檢查)", deprecated: "(已淘汰)", instanceCreated: "Instance 已建立",
88
+ newInstance: "新增 Agent", directory: "目錄", directoryHint: "可留空——留空會自動建立工作區", topic: "名稱", topicHint: "預設取自目錄名稱",
89
+ topicRequired: "目錄留空時必須填寫名稱", description: "說明", descriptionHint: "這個 Agent 做什麼", model: "模型", modelHint: "例如 sonnet、opus、gpt-5",
90
+ branch: "分支(git worktree)", branchHint: "例如 feature-x", tags: "標籤", tagsHint: "以逗號分隔,例如 dev, review", systemPrompt: "System prompt", systemPromptHint: "這個 Agent 的自訂指示",
91
+ fleetDefault: "使用 fleet 預設", notInstalled: "(未安裝)", notSignedIn: "(未登入,請用 /login)", tooOld: "(需要 {0} 以上版本)", unchecked: "(尚未檢查)", deprecated: "(已淘汰)", instanceCreated: "Agent 已建立",
92
92
  },
93
93
  });
94
94
 
@@ -25,7 +25,7 @@ import { openSignIn, signInOffered } from "./backend-signin.js";
25
25
  register("needs", {
26
26
  en: {
27
27
  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.",
28
- open: "Open chat", kiroOpen: "Open agent", kiroMigration: "Migration instructions", openCard: "Open the card", noAssignee: "Task board (nobody assigned)", fleetSignIns: "Fleet sign-ins", signIn: "Sign in",
28
+ open: "Open chat", kiroOpen: "Open agent", kiroMigration: "Migration instructions", openCard: "Open the card", noAssignee: "Task board (nobody assigned)", fleetSignIns: "AI accounts", signIn: "Connect account",
29
29
  gap: "not wrapped up: {0}", gapUnchecked: "{0} checklist item(s) unchecked", gapNoResult: "no result", gapJoin: ", ", acknowledge: "Acknowledge", acknowledging: "Acknowledging…", answering: "Answering…",
30
30
  ageNow: "just now", ageMin: "{0} min", ageHour: "{0} h", ageDay: "{0} d",
31
31
  notifyTitle: "Notify me on this device", notifyOn: "Notifications are on for this browser while a tab is open.",
@@ -38,7 +38,7 @@ register("needs", {
38
38
  },
39
39
  "zh-TW": {
40
40
  title: "等你處理", empty: "目前沒有需要你處理的事", emptyHint: "agent 在等你時,會出現在這裡——也會出現在聊天 app 的 General。", emptyHintWeb: "agent 在等你時,會出現在這裡。",
41
- open: "開啟聊天", kiroOpen: "開啟 Agent", kiroMigration: "遷移說明", openCard: "打開卡片", noAssignee: "任務看板(沒有負責人)", fleetSignIns: "Fleet 登入", signIn: "登入",
41
+ open: "開啟聊天", kiroOpen: "開啟 Agent", kiroMigration: "遷移說明", openCard: "打開卡片", noAssignee: "任務看板(沒有負責人)", fleetSignIns: "AI 帳號", signIn: "連接帳號",
42
42
  gap: "還沒補齊:{0}", gapUnchecked: "還有 {0} 項沒勾", gapNoResult: "沒有產出總結", gapJoin: "、", acknowledge: "確認", acknowledging: "確認中…", answering: "回覆中…",
43
43
  ageNow: "剛剛", ageMin: "{0} 分鐘", ageHour: "{0} 小時", ageDay: "{0} 天",
44
44
  notifyTitle: "在這台裝置通知我", notifyOn: "這個瀏覽器的通知已開啟(需要開著分頁)。",
@@ -47,7 +47,7 @@ register("needs", {
47
47
  notifyMobile: "在手機上請以聊天 app 的通知為主:每個新項目都會在 General 發一則新訊息。", notifyMobileWeb: "在手機上請打開這個頁面查看等你處理的事。",
48
48
  notifyInsecure: "通知需要安全的網址(localhost 或 HTTPS 公開連結),區網的一般 HTTP 網址不行。",
49
49
  notifyUnsupported: "這個瀏覽器無法顯示通知。", turnOn: "開啟", turnOff: "關閉",
50
- typePrompt: "Fleet 提示", typeAwaiting: "在終端機上", typeInstance: "Instance", typeDelivery: "傳送", typeMissed: "離線時錯過",
50
+ typePrompt: "Fleet 提示", typeAwaiting: "在終端機上", typeInstance: "Agent", typeDelivery: "傳送", typeMissed: "離線時錯過",
51
51
  },
52
52
  });
53
53
  const tn = (k, ...v) => t(`needs.${k}`, ...v);
@@ -25,6 +25,7 @@ import { Menu } from "/assets/ui-menu.js";
25
25
  import { toast } from "/assets/ui-toast.js";
26
26
  import { GroupMark, groupLabel, groupOf as navGroupOf, modelText } from "/assets/instance-nav.js";
27
27
  import "./settings-strings.js";
28
+ import { UpdatePillMark, UpdateSection } from "./settings-update.js";
28
29
  import { api, attach, confirmedWrite, newKey } from "./settings-confirm.js";
29
30
  import { dismissOperation, operationActive, restartFleet, startOperation, takeLeftover } from "./settings-apply.js";
30
31
  import {
@@ -56,6 +57,15 @@ import { NamedLinkTest, setTypedTunnelToken } from "./settings-named-test.js";
56
57
  import { SignInList } from "./backend-signin.js";
57
58
 
58
59
  const tn = (k, ...v) => k === "sec_notifications" ? quotaNoticeText().title : t(`settings.${k}`, ...v);
60
+ /**
61
+ * M-2733: the config words of tool_progress / cross_instance_visibility, in the page's language (the value saved is the
62
+ * word). Local, not imported: an open tab may keep an older settings-dialogs.js, and a new named import would fail this
63
+ * lazily loaded panel. A word with no translation shows as itself.
64
+ */
65
+ const choiceOptions = (field, values) => values.map((v) => {
66
+ const key = `settings.choice_${field}_${v}`, said = t(key);
67
+ return { value: v, label: said === key ? v : said };
68
+ });
59
69
  /** What a refused change says to a person: the server's code in words (the code itself only for one not listed). */
60
70
  const APPLY_ERRORS = new Set(["unsupported_sensitive_effect", "confirmation_diff_too_large", "session_required", "admin_required", "settings_changed",
61
71
  "request_no_longer_current", "too_many_pending_changes", "fleet_unavailable", "invalid_settings_effect", "settings_confirmation_unavailable", "failed"]);
@@ -391,7 +401,7 @@ export function SettingsPanel({ route, navKey }) {
391
401
  <${General} key=${formKey} ctx=${ctx} part="classic" /></div>`
392
402
  : section === "web-dashboard" ? html`<${WebSection} key=${formKey} ctx=${ctx} staged=${staged} part="dashboard" /><${AppearanceSection} ...${you} part="dashboard" />`
393
403
  : section === "access" ? html`<${WebSection} key=${formKey} ctx=${ctx} staged=${staged} part="access" />`
394
- : html`<${Developer} key=${`dev:${draftEpoch}`} ctx=${ctx} /><${WebSection} key=${formKey} ctx=${ctx} staged=${staged} part="readonly" />`;
404
+ : html`<${UpdateSection} /><${Developer} key=${`dev:${draftEpoch}`} ctx=${ctx} /><${WebSection} key=${formKey} ctx=${ctx} staged=${staged} part="readonly" />`;
395
405
  // #2347 §6: the setting a search result opened — brought into view once its section is drawn (its data may still be
396
406
  // on its way), focused, and flashed for 2 s.
397
407
  const wanted = useRef(null);
@@ -461,7 +471,7 @@ export function SettingsPanel({ route, navKey }) {
461
471
  // Which one is shown is the root's data-view: its class stays exactly the effects producer's ("panel p-settings", #1629).
462
472
  const atList = typeof location !== "undefined" && location.pathname === "/settings";
463
473
  return html`<div data-effect-panel="settings" class="panel p-settings" data-view=${atList ? "index" : "section"}>
464
- <${PanelHeader} title=${tn("title")} sub=${data && data.version ? html`<a class="pill ver" href=${data.version.includes("-") ? `${RELEASES}/latest` : `${RELEASES}/tag/v${data.version}`} target="_blank" rel="noopener">v${data.version}</a>` : null}>
474
+ <${PanelHeader} title=${tn("title")} sub=${data && data.version ? html`<a class="pill ver" href=${data.version.includes("-") ? `${RELEASES}/latest` : `${RELEASES}/tag/v${data.version}`} target="_blank" rel="noopener">v${data.version}</a><${UpdatePillMark} />` : null}>
465
475
  <button type="button" class="btn btn-ghost btn-sm" disabled=${!ctx || yamlStaged(staged)} title=${ctx && yamlStaged(staged) ? tn("yamlUnsaved") : undefined} onClick=${openWizard}><${Icon} name="wand" size=${16} /><span class="hide-narrow">${tn("wizardButton")}</span></button>
466
476
  <button type="button" class="icon-btn" aria-label=${tn("helpButton")} title=${tn("helpButton")} onClick=${() => setDialog({ kind: "help", key: navKey })}><${Icon} name="info" /></button>
467
477
  </${PanelHeader}>
@@ -1082,7 +1092,7 @@ function General({ ctx, part = "all" }) {
1082
1092
  concurrency: !hasOwn(startup, "concurrency"), stagger: !hasOwn(startup, "stagger_delay_ms"),
1083
1093
  };
1084
1094
  const dm = (k) => (unset[k] && sameValue(f[k], base[k]) ? html`<${DefaultMark} />` : null);
1085
- const fromDefaults = (k, value, target) => ({ text: valueText(value), builtin: !hasOwn(d, k), from: inAgentDefaults(target) });
1095
+ const fromDefaults = (k, value, target) => ({ text: valueText(value, k), builtin: !hasOwn(d, k), from: inAgentDefaults(target) });
1086
1096
  const L = (text, field, id, k) => html`<${Label} text=${text} schema=${schema} field=${field} htmlFor=${id} mark=${k ? dm(k) : null} />`;
1087
1097
  const fleetReply = replyGuardSupported(f.backend, f.agent_mode, d.kiro_ui) ? tn("replyGuardSupported") : tn("replyGuardUnsupported", f.backend, f.agent_mode);
1088
1098
  const classicReply = replyGuardSupported(f.classicBackend, f.agent_mode, d.kiro_ui) ? tn("replyGuardSupported") : tn("replyGuardUnsupported", f.classicBackend, f.agent_mode);
@@ -1097,8 +1107,8 @@ function General({ ctx, part = "all" }) {
1097
1107
  <div class=${fc("field", "model")}>${L(tn("defaultModel"), "defaults.model", "g-model", "model")}<${ModelSelect} id="g-model" value=${f.model} onChange=${set("model")}
1098
1108
  backend=${f.backend || "claude-code"} inherit=${tn("modelCliDefault")} /></div>
1099
1109
  <div class=${fc("field", "auto")}>${L(`${tn("autoPause")} (${tn("minutes")})`, "defaults.auto_pause_after", "g-auto", "auto")}<input id="g-auto" type="number" min="0" step="1" class=${errors.auto ? "invalid" : ""} value=${f.auto} onInput=${(e) => set("auto")(e.target.value)} /><${Feedback} error=${errors.auto} /></div>
1100
- <div class=${fc("field", "tool_progress")}>${L(tn("toolProgress"), "defaults.tool_progress", "g-tp", "tool_progress")}<${Select} id="g-tp" value=${f.tool_progress} onChange=${set("tool_progress")} options=${TOOL_PROGRESS} /></div>
1101
- <div class=${fc("field", "visibility")}>${L(tn("crossInstanceVisibility"), "defaults.cross_instance_visibility", "g-vis", "visibility")}<${Select} id="g-vis" value=${f.visibility} onChange=${set("visibility")} options=${VISIBILITY_MODES} />
1110
+ <div class=${fc("field", "tool_progress")}>${L(tn("toolProgress"), "defaults.tool_progress", "g-tp", "tool_progress")}<${Select} id="g-tp" value=${f.tool_progress} onChange=${set("tool_progress")} options=${choiceOptions("tool_progress", TOOL_PROGRESS)} /></div>
1111
+ <div class=${fc("field", "visibility")}>${L(tn("crossInstanceVisibility"), "defaults.cross_instance_visibility", "g-vis", "visibility")}<${Select} id="g-vis" value=${f.visibility} onChange=${set("visibility")} options=${choiceOptions("cross_instance_visibility", VISIBILITY_MODES)} />
1102
1112
  <p class="note">${tn("crossInstanceVisibilityHint")}</p></div>
1103
1113
  <div class=${fc("field", "tips")}>${L(tn("dailyTips"), "defaults.tips", "g-tips", "tips")}<${Select} id="g-tips" value=${f.tips} onChange=${set("tips")} options=${noticeChoices()} /><${InEffect} text=${noticeLabel(noticeMode(f.tips))} /><p class="note">${tn("dailyTipsHint")}</p></div>
1104
1114
  <div class=${fc("field", "replyTriggers")}><label class="check"><input id="g-reply-triggers" type="checkbox" checked=${f.replyTriggers} onChange=${(e) => set("replyTriggers")(e.target.checked)} /><span>${tn("replyTriggers")}</span>${dm("replyTriggers")}<${Impact} schema=${schema} field="defaults.reply_triggers" /></label><p class="note">${tn("replyTriggersHint")}</p></div>
@@ -1117,7 +1127,7 @@ function General({ ctx, part = "all" }) {
1117
1127
  ${!c.backend && f.classicBackend === base.classicBackend ? html`<${Inherited} text=${valueText(f.classicBackend, "backend")} builtin=${!d.backend} from=${inAgentDefaults("#g-be")} />` : null}</div>
1118
1128
  <div class=${fc("field", "classicToolProgress", "classicToolProgressInherit")}>${L(tn("toolProgress"), "classic_defaults.tool_progress", "g-ctp")}
1119
1129
  <${Override} inherit=${f.classicToolProgressInherit} onInherit=${set("classicToolProgressInherit")} inherited=${fromDefaults("tool_progress", d.tool_progress ?? "off", "#g-tp")}>
1120
- <${Select} id="g-ctp" disabled=${f.classicToolProgressInherit} value=${f.classicToolProgressInherit ? (d.tool_progress ?? "off") : f.classicToolProgress} onChange=${set("classicToolProgress")} options=${TOOL_PROGRESS} /></${Override}></div>
1130
+ <${Select} id="g-ctp" disabled=${f.classicToolProgressInherit} value=${f.classicToolProgressInherit ? (d.tool_progress ?? "off") : f.classicToolProgress} onChange=${set("classicToolProgress")} options=${choiceOptions("tool_progress", TOOL_PROGRESS)} /></${Override}></div>
1121
1131
  <div class=${fc("field", "classicReplyTriggers", "classicReplyTriggersInherit")}>${L(tn("replyTriggers"), "classic_defaults.reply_triggers")}
1122
1132
  <${Override} inherit=${f.classicReplyTriggersInherit} onInherit=${set("classicReplyTriggersInherit")} inherited=${fromDefaults("reply_triggers", Boolean(d.reply_triggers ?? schema.reply_triggers_default), "#g-reply-triggers")}>
1123
1133
  <label class="check"><input id="g-creply-triggers" type="checkbox" disabled=${f.classicReplyTriggersInherit} checked=${f.classicReplyTriggersInherit ? Boolean(d.reply_triggers ?? schema.reply_triggers_default) : f.classicReplyTriggers} onChange=${(e) => set("classicReplyTriggers")(e.target.checked)} /><span>${tn("replyTriggers")}</span></label></${Override}><p class="note">${tn("replyTriggersHint")}</p></div>
@@ -16,9 +16,14 @@ async function getJson(url) {
16
16
  function cached(url) {
17
17
  const hit = cache.get(url), now = performance.now();
18
18
  if (hit && (hit.pending || now - hit.at < TTL_MS)) return hit.pending ?? Promise.resolve(hit.value);
19
- const pending = getJson(url).then((value) => { cache.set(url, { at: performance.now(), value, pending: null }); return value; })
20
- .catch(() => { cache.delete(url); return null; });
21
- cache.set(url, { at: now, value: null, pending });
19
+ const entry = { at: now, value: null, pending: null };
20
+ const pending = getJson(url).then((value) => {
21
+ // Explicit rediscovery/reset may have replaced this request while it waited.
22
+ if (cache.get(url) === entry) cache.set(url, { at: performance.now(), value, pending: null });
23
+ return value;
24
+ }).catch(() => { if (cache.get(url) === entry) cache.delete(url); return null; });
25
+ entry.pending = pending;
26
+ cache.set(url, entry);
22
27
  return pending;
23
28
  }
24
29
  /**
@@ -53,6 +58,15 @@ export function useModelCatalog(backend, instance) {
53
58
  return answer && Array.isArray(answer.models) ? answer.models : [];
54
59
  }
55
60
 
61
+ /** Shared snapshot cache for upgraded fields; accessed through a namespace so old held modules still load. */
62
+ export function readModelCatalog(target) {
63
+ const url = `/ui/models?${new URLSearchParams(target)}`;
64
+ return cached(url).then(answer => { if (!answer || !Array.isArray(answer.models)) throw Error("Model catalog unavailable"); return answer.models; });
65
+ }
66
+ export function rememberModelCatalog(target, answer) {
67
+ cache.set(`/ui/models?${new URLSearchParams(target)}`, { at: performance.now(), value: answer, pending: null });
68
+ }
69
+
56
70
  /** A state that keeps a backend from being chosen (shown, disabled, with why); "unknown" never does. */
57
71
  export const BLOCKING_STATES = ["not_installed", "not_signed_in", "too_old"];
58
72
 
@@ -68,7 +82,8 @@ export function backendChoices(known, rows, value, words) {
68
82
  const blocked = !!state && BLOCKING_STATES.includes(state) && name !== value;
69
83
  const note = state === "not_installed" ? words.notInstalled : state === "not_signed_in" ? words.notSignedIn
70
84
  : state === "too_old" ? words.tooOld(row.minVersion ?? "?") : state === "unknown" && name !== value ? words.unchecked : "";
71
- return { value: name, label: note ? `${name} — ${note}` : name, disabled: blocked };
85
+ const shown = words.name ? words.name(name) : name; // M-2733: its product name ("Claude Code"); the value stays the id
86
+ return { value: name, label: note ? `${shown} — ${note}` : shown, disabled: blocked };
72
87
  };
73
88
  const list = known.map(choice);
74
89
  return known.includes(value) || !value ? list : [{ value, label: words.removed(value), disabled: false }, ...list];