@songsid/agend 2.3.5-alpha.12 → 2.3.5-alpha.14

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 (139) hide show
  1. package/THIRD_PARTY_NOTICES.md +4 -0
  2. package/dist/agent-export.d.ts +74 -0
  3. package/dist/agent-export.js +362 -0
  4. package/dist/agent-export.js.map +1 -0
  5. package/dist/agent-workspace.d.ts +1 -2
  6. package/dist/agent-workspace.js +8 -29
  7. package/dist/agent-workspace.js.map +1 -1
  8. package/dist/auth-api.js +3 -1
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/backend/codex.d.ts +7 -14
  11. package/dist/backend/codex.js +25 -29
  12. package/dist/backend/codex.js.map +1 -1
  13. package/dist/backend/grok-mcp.d.ts +5 -0
  14. package/dist/backend/grok-mcp.js +221 -0
  15. package/dist/backend/grok-mcp.js.map +1 -0
  16. package/dist/backend/grok.d.ts +0 -10
  17. package/dist/backend/grok.js +5 -82
  18. package/dist/backend/grok.js.map +1 -1
  19. package/dist/backend/types.d.ts +6 -1
  20. package/dist/backend/types.js.map +1 -1
  21. package/dist/build-provenance.json +1 -1
  22. package/dist/cli.js +45 -12
  23. package/dist/cli.js.map +1 -1
  24. package/dist/codex-pane-ownership.d.ts +13 -0
  25. package/dist/codex-pane-ownership.js +192 -0
  26. package/dist/codex-pane-ownership.js.map +1 -0
  27. package/dist/daemon.d.ts +2 -0
  28. package/dist/daemon.js +89 -8
  29. package/dist/daemon.js.map +1 -1
  30. package/dist/fleet-manager.d.ts +15 -1
  31. package/dist/fleet-manager.js +72 -17
  32. package/dist/fleet-manager.js.map +1 -1
  33. package/dist/hub/client.d.ts +1 -1
  34. package/dist/hub/client.js +11 -0
  35. package/dist/hub/client.js.map +1 -1
  36. package/dist/hub/compose/member.d.ts +2 -2
  37. package/dist/hub/compose/member.js +11 -3
  38. package/dist/hub/compose/member.js.map +1 -1
  39. package/dist/hub/join/local.d.ts +1 -0
  40. package/dist/hub/join/local.js +8 -3
  41. package/dist/hub/join/local.js.map +1 -1
  42. package/dist/hub/member/exposure-api.d.ts +2 -0
  43. package/dist/hub/member/exposure-api.js +4 -2
  44. package/dist/hub/member/exposure-api.js.map +1 -1
  45. package/dist/hub/member/pairing-api.d.ts +2 -2
  46. package/dist/hub/member/pairing-api.js +2 -2
  47. package/dist/hub/member/pairing-api.js.map +1 -1
  48. package/dist/hub/server.js +8 -0
  49. package/dist/hub/server.js.map +1 -1
  50. package/dist/hub-pairing-summary.d.ts +3 -1
  51. package/dist/hub-pairing-summary.js +6 -3
  52. package/dist/hub-pairing-summary.js.map +1 -1
  53. package/dist/install-user-systemd.d.ts +20 -0
  54. package/dist/install-user-systemd.js +55 -0
  55. package/dist/install-user-systemd.js.map +1 -0
  56. package/dist/linux-launchers.d.ts +88 -0
  57. package/dist/linux-launchers.js +296 -0
  58. package/dist/linux-launchers.js.map +1 -0
  59. package/dist/locale.js +91 -4
  60. package/dist/locale.js.map +1 -1
  61. package/dist/runtime-client-store.js +5 -0
  62. package/dist/runtime-client-store.js.map +1 -1
  63. package/dist/runtime-pane-private.d.ts +2 -0
  64. package/dist/runtime-pane-private.js +25 -0
  65. package/dist/runtime-pane-private.js.map +1 -1
  66. package/dist/runtime-pane-private.ps1 +74 -7
  67. package/dist/selection-card.d.ts +4 -3
  68. package/dist/selection-card.js +2 -1
  69. package/dist/selection-card.js.map +1 -1
  70. package/dist/service-installer.js +11 -2
  71. package/dist/service-installer.js.map +1 -1
  72. package/dist/settings-change.d.ts +2 -0
  73. package/dist/settings-change.js +74 -31
  74. package/dist/settings-change.js.map +1 -1
  75. package/dist/settings-confirmation.d.ts +23 -0
  76. package/dist/settings-confirmation.js +13 -2
  77. package/dist/settings-confirmation.js.map +1 -1
  78. package/dist/settings-effect.d.ts +4 -0
  79. package/dist/settings-effect.js +14 -14
  80. package/dist/settings-effect.js.map +1 -1
  81. package/dist/settings-http-confirmation.d.ts +3 -1
  82. package/dist/settings-http-confirmation.js +12 -7
  83. package/dist/settings-http-confirmation.js.map +1 -1
  84. package/dist/settings-summary.d.ts +24 -0
  85. package/dist/settings-summary.js +42 -0
  86. package/dist/settings-summary.js.map +1 -0
  87. package/dist/transcript-delta-reader.d.ts +9 -1
  88. package/dist/transcript-delta-reader.js +37 -8
  89. package/dist/transcript-delta-reader.js.map +1 -1
  90. package/dist/ui/agent-details-settings.js +253 -0
  91. package/dist/ui/agent-export-dialog.js +169 -0
  92. package/dist/ui/agent-export-strings.js +81 -0
  93. package/dist/ui/agent-instructions-field.js +69 -0
  94. package/dist/ui/agent-page-strings.js +148 -0
  95. package/dist/ui/chat-quote.js +12 -17
  96. package/dist/ui/hub-client.js +1 -1
  97. package/dist/ui/hub-company-join-strings.js +1 -1
  98. package/dist/ui/hub-company-join.js +7 -0
  99. package/dist/ui/hub-strings.js +4 -0
  100. package/dist/ui/native-instance-settings.js +47 -14
  101. package/dist/ui/panel-details.js +38 -14
  102. package/dist/ui/panel-fleet.js +2 -2
  103. package/dist/ui/panel-settings.js +12 -9
  104. package/dist/ui/settings-access-overview.js +24 -3
  105. package/dist/ui/settings-confirm.js +5 -5
  106. package/dist/ui/settings-dialogs.js +210 -100
  107. package/dist/ui/settings-hub-company-join.js +69 -14
  108. package/dist/ui/settings-hub.js +13 -5
  109. package/dist/ui/settings-layout.js +0 -2
  110. package/dist/ui/settings-model.js +15 -0
  111. package/dist/ui/shared/access-overview.css +48 -0
  112. package/dist/ui/shared/app-i18n.js +2 -2
  113. package/dist/ui/shared/app-shell.js +144 -3
  114. package/dist/ui/shared/app.css +74 -50
  115. package/dist/ui/shared/instance-nav.js +5 -1
  116. package/dist/ui/shared/view-strings.js +2 -0
  117. package/dist/update-dispatch.d.ts +62 -0
  118. package/dist/update-dispatch.js +69 -2
  119. package/dist/update-dispatch.js.map +1 -1
  120. package/dist/web-api.d.ts +2 -0
  121. package/dist/web-api.js +49 -0
  122. package/dist/web-api.js.map +1 -1
  123. package/dist/web-session.d.ts +4 -2
  124. package/dist/web-session.js +5 -2
  125. package/dist/web-session.js.map +1 -1
  126. package/dist/windows-shortcuts.d.ts +29 -5
  127. package/dist/windows-shortcuts.js +52 -9
  128. package/dist/windows-shortcuts.js.map +1 -1
  129. package/dist/workspace-file-policy.d.ts +2 -0
  130. package/dist/workspace-file-policy.js +31 -0
  131. package/dist/workspace-file-policy.js.map +1 -0
  132. package/dist/workspace-follow.js +2 -1
  133. package/dist/workspace-follow.js.map +1 -1
  134. package/launcher/agend-install.cjs +7 -1
  135. package/package.json +2 -2
  136. package/templates/icons/agend-restart.ico +0 -0
  137. package/templates/icons/agend.ico +0 -0
  138. package/templates/runtime-assets/runtime-pane-private.ps1 +74 -7
  139. package/templates/windows-shortcuts.ps1 +45 -12
@@ -0,0 +1,148 @@
1
+ // the words of the agent's "Details & settings" page (agent-details-settings.js) and the ⓘ beside each setting the
2
+ // agent dialogs show. A file of its own, with its own namespace, so no tab holding an older settings-strings.js can be
3
+ // missing them (see settings-shared-strings.js for why): every module that reads `agentPage.*` imports this file.
4
+ import { register, t } from "/assets/app-i18n.js";
5
+
6
+ register("agentPage", {
7
+ en: {
8
+ // The page
9
+ title: "Settings", groupStatus: "Status", groupSettings: "Settings", onlyThis: "Only affects {0}",
10
+ leadOverview: "This agent's status, usage and recent activity. To change a setting, pick a category.",
11
+ leadSection: "Changes are staged first and written when you press Save. Each setting says when it takes effect.",
12
+ loading: "Reading this agent's settings…", loadFailed: "Could not read this agent's settings.", notConfigured: "This agent is not in fleet.yaml, so it has no settings to edit here.",
13
+ checkEnable: "Enable", unsavedDot: "Has unapplied changes", nativeLimits: "Windows native agents have no auto-pause, hang detection, tool sets or channel binding (they never did); this page shows only what the agent supports.",
14
+ classicNote: "A ClassicBot room: its settings live in classicBot.yaml, not fleet.yaml.",
15
+ actions: "Actions", actionsNote: "The same actions as the ⋯ menu in the header (which also has the identity colour and the web theme lock).",
16
+ // Categories
17
+ cat_overview: "Overview", cat_basic: "Basic info", cat_runtime: "Runtime & model", cat_work: "Workspace", cat_channel: "Channels", cat_adv: "Advanced",
18
+ cat_classicChannel: "Channels & replies", openSettings: "Settings",
19
+ // Cards
20
+ cardName: "Name & description", cardRuntime: "Runtime & CLI", cardModel: "Model", cardWorkdir: "Working directory", cardIdle: "Idle & protection", cardTools: "Tools & modes",
21
+ cardChannel: "Channel & visibility", cardEmojis: "Status emojis", cardSystemPrompt: "System prompt — existing field", cardLogging: "Logging & recovery", cardBoard: "Task board",
22
+ cardDashboard: "Dashboard access", cardElsewhere: "Other settings live elsewhere", cardDanger: "Danger zone", cardWorkspace: "Workspace & permissions",
23
+ cardReplies: "Reply behaviour", cardCollab: "Collaboration & web",
24
+ // Labels of the three settings the page never showed
25
+ lbl_resumeWork: "Resume interrupted work", lbl_mcpProxy: "MCP proxy reply", lbl_boardCards: "Board cards at once",
26
+ mustBePositiveInteger: "Enter a whole number of at least 1.",
27
+ // Field help (the ⓘ)
28
+ tip_displayName: "The name this agent goes by in chat, the agent list and other agents' eyes.",
29
+ tip_tags: "Used to group and search agents in the list. The AI does not read them.",
30
+ tip_description: "One sentence on what this agent is for. It shows in the agent list, and the next time the agent starts it is put at the top of the AI's instructions as its \"Role\".",
31
+ note_description: "The AI reads it when the agent next starts; a session already running does not re-read it.",
32
+ tip_account: "Which of the CLI's named sign-ins this agent uses. Empty follows the fleet default. Changing it starts a new conversation.",
33
+ tip_model: "The model this agent runs. The list is the models AgEnD has cached for this CLI and account.",
34
+ tip_codexSpeed: "Standard or Fast (Fast costs more). Codex only.",
35
+ tip_failover: "Used automatically when the main model's quota runs out or it is unavailable. None means no fallback.",
36
+ note_effort: "Reasoning effort is not set here: switch it live in the model menu above the chat box (no restart).",
37
+ tip_workingDir: "The folder the agent's CLI runs in; it only reads and writes files there. AgEnD also puts the AI's instruction files here (such as AGENTS.md).",
38
+ note_workdir: "A new agent can only be created where Shared agent settings → Project folders allows.",
39
+ tip_autoPause: "Pause the agent after it has been idle this long, to save resources; the next message wakes it. 0 means never pause.",
40
+ tip_hang: "If there is no progress for this long, the agent is judged stuck and you are told.",
41
+ tip_toolSet: "Which AgEnD tools this agent may use (worker the fewest, coordinator can hand out work, full everything).",
42
+ tip_agentMode: "mcp: the AI calls AgEnD through MCP tools. cli: it uses the agend-agent command instead.",
43
+ tip_replyGuard: "On: when the AI ends a turn without having answered with reply, AgEnD reminds it to.",
44
+ tip_lightweight: "Loads fewer tools and less guidance to save tokens; fits an agent that only does simple work.",
45
+ tip_channel: "Which Discord or Telegram connection's channel this agent receives and sends messages in. Unbound means web chat only.",
46
+ tip_general: "Make this agent the General: it receives the bound connection's general messages and hands work to other agents.",
47
+ tip_toolProgress: "Whether progress messages appear in the channel while the AI uses tools: off none, standard a summary, verbose in full.",
48
+ tip_visibility: "How much of this agent's messages with other agents shows in the channel: full all of it, summary one line, hidden nothing. They are always delivered.",
49
+ tip_emojis: "Only affects Discord and Telegram channels; the web chat never posts emoji.",
50
+ emojisWhat: "What this is: after this agent receives a message you sent in Discord or Telegram, AgEnD puts an emoji on that message to report progress (👀 received, ⏳ queued, ✅ delivered, ❌ failed, plus a prefix on progress messages and badges for photos and files). The web chat does not do this. The AI is also told to avoid these symbols, so changing them restarts the agent. Empty uses the platform's default.",
51
+ tip_systemPrompt: "The existing field, unchanged: text, or file:path to a file under the working directory (commas join several). It is appended to the AI's instructions.",
52
+ note_systemPrompt: "This is the existing field; its behaviour and how it reaches the AI are unchanged.",
53
+ // Agent instructions: the editor of systemPrompt (formerly "System prompt"), in Basic info
54
+ cardInstructions: "Agent instructions", lbl_instructions: "Instructions",
55
+ tip_instructions: "Markdown you write for this agent: who it is, how it should work, the rules it follows. This is the field Settings used to call \"System prompt\" (`systemPrompt` in fleet.yaml) — the same field, so nothing was moved or changed for an agent that already has one. Write the text, or `file:path` for a file under the working directory (commas join several). It goes into the AI's instructions the next time the agent starts.",
56
+ note_instructions: "Plain Markdown. The AI reads it when the agent next starts — a session already running keeps what it has. Formerly \"System prompt\".",
57
+ instrEdit: "Edit", instrPreview: "Preview", instrPlaceholder: "# Role\n\nWhat this agent is for, how it should work, rules it must follow…\n\n(or file:prompts/dev.md)",
58
+ instrPreviewEmpty: "Nothing to preview yet.", instrFileRead: "a file, read when the agent starts",
59
+ instrSize: "{0} / {1} characters · {2} bytes", instrTooLong: "{0} characters — {1} is the most. Shorten it to save.",
60
+ instrCodex: "Codex reads at most 32 KiB of AGENTS.md in total, and AgEnD's own guidance already takes about 12 KiB of it.",
61
+ instrCodexNear: "Over about 16 KiB, Codex (32 KiB of AGENTS.md in total, about 12 KiB of it AgEnD's own guidance) may cut off the end of these instructions.",
62
+ instrCodexFiles: "A file's text is added when the agent starts and counts too: Codex reads at most 32 KiB of AGENTS.md in total, and AgEnD's own guidance already takes about 12 KiB of it.",
63
+ tip_logLevel: "How much detail this agent's daemon writes to its log. Raise it only to debug.",
64
+ tip_resumeWork: "After a restart or an interruption, the agent picks its unfinished work up by itself. On by default.",
65
+ tip_mcpProxy: "When the MCP server is down and the agent answered through no channel tool, the daemon posts the last text on the agent's screen to the channel (marked as a proxy reply). Off by default, and turning it on asks you to confirm: the screen text can contain secrets that AgEnD's redaction does not recognise, so only turn it on for an agent whose screen is safe to show in the channel.",
66
+ confirmMcpProxy: "Turn on the MCP proxy reply? When the MCP server is down, AgEnD will post the last text on this agent's screen to the channel. That text can contain secrets that AgEnD's redaction does not recognise. Continue?",
67
+ tip_boardCards: "How many task-board cards this agent may have in progress at once (at least 1).",
68
+ elsewhere: "Usage reminders (each agent's rule) → Settings › Notifications; fleet-wide defaults and workspace rules → Settings › Shared agent settings; fields only fleet.yaml has (restart policy, cost guard…) → Settings › Advanced › Configuration editor.",
69
+ deleteAgent: "Delete agent…", deleteNote: "You are asked to confirm first (the same flow as the agent list's More menu), and the deletion is staged until you press Save.",
70
+ tip_workdirNative: "A Windows native agent's workspace is managed by AgEnD, so it is read-only here.",
71
+ tip_sandbox: "read-only: the agent can only read. workspace-write: it may write in the workspace. Some CLIs do not support read-only.",
72
+ tip_systemPromptNative: "The existing field, unchanged: the system prompt of a Windows native agent, up to 8,000 characters.",
73
+ // ClassicBot
74
+ tip_classicBackend: "Which CLI this room uses.", tip_classicModel: "The model this room runs.", tip_classicAutoPause: "Pause the room's agent after it has been idle this long; 0 never pauses.",
75
+ tip_classicToolProgress: "Whether progress messages show in the room while the AI uses tools.", tip_classicReplyGuard: "On: when the AI ends a turn without answering with reply, AgEnD reminds it to.",
76
+ tip_classicReplyTriggers: "Off: only @bot triggers the room; on: a single-level reply to the bot counts too.", tip_classicCollab: "Let the bots in this room work with each other.",
77
+ tip_classicWebEcho: "Also post messages sent from the web chat into this room.", tip_classicContext: "How many recent chat lines are sent along with each message.",
78
+ },
79
+ "zh-TW": {
80
+ title: "設定", groupStatus: "狀態", groupSettings: "設定", onlyThis: "只影響 {0}",
81
+ leadOverview: "這個 Agent 目前的狀態、用量與最近活動。要改設定請從分類選擇。",
82
+ leadSection: "改動會先暫存,按「儲存」才寫入;每個欄位旁標明生效時機。",
83
+ loading: "正在讀取這個 Agent 的設定…", loadFailed: "讀不到這個 Agent 的設定。", notConfigured: "這個 Agent 不在 fleet.yaml 裡,沒有可在這裡編輯的設定。",
84
+ checkEnable: "啟用", unsavedDot: "有尚未套用的變更", nativeLimits: "Windows 原生 Agent 沒有自動暫停、卡住偵測、工具組與頻道綁定(原本就沒有);這一頁只顯示它支援的設定。",
85
+ classicNote: "ClassicBot 房間:設定存在 classicBot.yaml,不是 fleet.yaml。",
86
+ actions: "動作", actionsNote: "與標題列「⋯」選單同一組動作(那裡另有識別顏色、鎖定/重設網頁主題)。",
87
+ cat_overview: "概覽", cat_basic: "基本資料", cat_runtime: "Runtime 與模型", cat_work: "工作目錄", cat_channel: "頻道", cat_adv: "進階",
88
+ cat_classicChannel: "頻道與回覆", openSettings: "設定",
89
+ cardName: "名稱與描述", cardRuntime: "Runtime 與 CLI", cardModel: "模型", cardWorkdir: "工作目錄", cardIdle: "閒置與保護", cardTools: "工具與模式",
90
+ cardChannel: "頻道與可見度", cardEmojis: "Status emojis", cardSystemPrompt: "System prompt(原有欄位)", cardLogging: "記錄與恢復", cardBoard: "任務看板",
91
+ cardDashboard: "儀表板權限", cardElsewhere: "其他設定在別處", cardDanger: "危險操作", cardWorkspace: "工作區與權限",
92
+ cardReplies: "回覆行為", cardCollab: "協作與網頁",
93
+ lbl_resumeWork: "中斷後自動接續工作", lbl_mcpProxy: "MCP 代為回覆", lbl_boardCards: "同時處理的看板卡片數",
94
+ mustBePositiveInteger: "請輸入至少為 1 的整數。",
95
+ tip_displayName: "Agent 在聊天室、Agent 清單與其他 Agent 眼中的名字。",
96
+ tip_tags: "用來在 Agent 清單分類與搜尋;AI 不會讀到。",
97
+ tip_description: "一句話說明這個 Agent 負責什麼。會顯示在 Agent 清單,也會在 Agent 下次啟動時,以「Role」段落放進 AI 看到的指令最前面。",
98
+ note_description: "AI 在下次啟動時讀到;已在跑的 session 不會重讀。",
99
+ tip_account: "這個 Agent 用哪一組 CLI 登入(具名帳號)。留空=跟隨 Fleet 預設。更換帳號會開始新的對話。",
100
+ tip_model: "這個 Agent 使用的模型。清單來自 AgEnD 快取的 CLI/帳號模型清單。",
101
+ tip_codexSpeed: "標準或快速(Fast 較貴);只有 Codex 才有。",
102
+ tip_failover: "主要模型額度用完或不可用時,自動換用這個。留空表示不備援。",
103
+ note_effort: "推理強度不在這裡設定:在對話輸入框上方的模型/強度選單即時切換(不用重啟)。",
104
+ tip_workingDir: "Agent 的 CLI 在這個資料夾裡執行,檔案只讀寫這裡。AgEnD 也會把給 AI 的指令檔放在這裡(如 AGENTS.md)。",
105
+ note_workdir: "新 Agent 只能在「Shared agent settings → 專案資料夾」允許的位置建立。",
106
+ tip_autoPause: "閒置超過這段時間就暫停 Agent 以節省資源,下次有訊息會自動喚醒。0 = 不暫停。",
107
+ tip_hang: "超過這段時間沒有進展,就判定 Agent 卡住並通知你。",
108
+ tip_toolSet: "決定這個 Agent 能用哪些 AgEnD 工具(worker 最少、coordinator 可派工、full 全部)。",
109
+ tip_agentMode: "mcp:AI 用 MCP 工具呼叫 AgEnD;cli:改用 agend-agent 指令。",
110
+ tip_replyGuard: "On:AI 沒有用 reply 回覆就結束一輪時,AgEnD 會提醒它補上。",
111
+ tip_lightweight: "載入較少的工具與說明,省 token,適合只做單純工作的 Agent。",
112
+ tip_channel: "這個 Agent 在哪個 Discord/Telegram 連線的頻道裡收發訊息。「未綁定」表示只能在網頁聊天。",
113
+ tip_general: "讓這個 Agent 當 General——負責接收綁定連線的一般訊息並派工給其他 Agent。",
114
+ tip_toolProgress: "AI 用工具時,是否在頻道裡顯示進度訊息:off 不顯示、standard 摘要、verbose 完整。",
115
+ tip_visibility: "此 Agent 與其他 Agent 往來的訊息,在頻道裡顯示多少:full 全部、summary 摘要、hidden 隱藏。訊息一律會送達。",
116
+ tip_emojis: "只影響 Discord 與 Telegram 頻道;網頁聊天室不會貼 emoji。",
117
+ emojisWhat: "這是什麼:Agent 收到你在 Discord/Telegram 發的訊息後,AgEnD 會在那則訊息上貼 emoji 回報進度(👀 收到、⏳ 排隊、✅ 已送達、❌ 失敗,另有進度訊息的前綴與照片/附件章)。網頁聊天室不會貼。AI 也會被告知避開這些符號,所以改了要重啟 Agent。留空 = 用平台預設。",
118
+ tip_systemPrompt: "原有欄位,讀法與給 AI 的方式完全不變:可填文字,或 file:路徑 引用工作目錄下的檔案(逗號可串多份)。會接在給 AI 的指令裡。",
119
+ note_systemPrompt: "這是原有的欄位,行為與給 AI 的方式都沒有改變。",
120
+ // Agent 指示:systemPrompt(以前叫「System prompt」)的編輯器,放在基本資料
121
+ cardInstructions: "Agent 指示", lbl_instructions: "指示",
122
+ tip_instructions: "寫給這個 Agent 的 Markdown:它是誰、怎麼做事、要遵守的規則。這就是設定裡以前叫「System prompt」的欄位(fleet.yaml 的 `systemPrompt`)——同一個欄位,已經填過的 Agent 沒有任何搬移或改動。可以直接寫文字,或用 `file:路徑` 引用工作目錄下的檔案(逗號可串多份)。Agent 下次啟動時放進給 AI 的指令裡。",
123
+ note_instructions: "純 Markdown。AI 在 Agent 下次啟動時讀到;正在跑的對話不會重讀。以前叫「System prompt」。",
124
+ instrEdit: "編輯", instrPreview: "預覽", instrPlaceholder: "# 角色\n\n這個 Agent 負責什麼、怎麼做事、必須遵守的規則…\n\n(或寫 file:prompts/dev.md)",
125
+ instrPreviewEmpty: "還沒有內容可以預覽。", instrFileRead: "檔案,Agent 啟動時讀取",
126
+ instrSize: "{0} / {1} 字元 · {2} bytes", instrTooLong: "{0} 字元,上限 {1}。請縮短後才能儲存。",
127
+ instrCodex: "Codex 讀 AGENTS.md 一共最多 32 KiB,而 AgEnD 自己的指引已經用掉約 12 KiB。",
128
+ instrCodexNear: "超過約 16 KiB 時,Codex(AGENTS.md 一共 32 KiB,其中約 12 KiB 是 AgEnD 自己的指引)可能會把這份指示的結尾截掉。",
129
+ instrCodexFiles: "檔案的內容會在 Agent 啟動時加進來,也算在內:Codex 讀 AGENTS.md 一共最多 32 KiB,而 AgEnD 自己的指引已經用掉約 12 KiB。",
130
+ tip_logLevel: "這個 Agent 的 daemon 寫進紀錄檔的詳細程度。除錯時才調高。",
131
+ tip_resumeWork: "Agent 重啟或被打斷後,主動繼續未完成的工作。預設開。",
132
+ tip_mcpProxy: "MCP 伺服器掛掉、Agent 又沒用任何頻道工具回覆時,由 daemon 把畫面最後的文字轉貼到頻道(標示為代回覆)。預設關,開啟時會再請你確認:畫面文字可能含 AgEnD 的遮罩認不出的機密,只有畫面內容可以安全顯示在頻道的 Agent 才建議開。",
133
+ confirmMcpProxy: "要開啟 MCP 代為回覆嗎?MCP 伺服器掛掉時,AgEnD 會把這個 Agent 畫面最後的文字貼到頻道;那段文字可能含 AgEnD 的遮罩認不出的機密。要繼續嗎?",
134
+ tip_boardCards: "這個 Agent 同時最多可進行幾張看板卡片(至少 1)。",
135
+ elsewhere: "用量提醒(每個 Agent 的規則)→ 設定 › 通知;全隊預設值與工作區規則 → 設定 › Shared agent settings;只有 fleet.yaml 才有的欄位(重啟策略、成本護欄等)→ 設定 › 進階 › 設定檔編輯器。",
136
+ deleteAgent: "刪除 Agent…", deleteNote: "刪除前會再確認(與 Agent 清單「更多」選單的刪除同一流程),並先暫存,按「儲存」才會刪。",
137
+ tip_workdirNative: "Windows 原生 Agent 的工作區由 AgEnD 管理,這裡只讀。",
138
+ tip_sandbox: "read-only:只能讀;workspace-write:可寫入工作區。部分 CLI 不支援唯讀。",
139
+ tip_systemPromptNative: "原有欄位,行為不變:Windows 原生 Agent 的系統提示,上限 8,000 字。",
140
+ tip_classicBackend: "這個房間用哪一個 CLI。", tip_classicModel: "這個房間使用的模型。", tip_classicAutoPause: "房間的 Agent 閒置超過這段時間就暫停;0 = 不暫停。",
141
+ tip_classicToolProgress: "AI 用工具時,是否在房間裡顯示進度訊息。", tip_classicReplyGuard: "On:AI 沒有用 reply 回覆就結束一輪時,AgEnD 會提醒它補上。",
142
+ tip_classicReplyTriggers: "Off:只有 @bot 才觸發房間;On:也接受對該 bot 的單層回覆。", tip_classicCollab: "讓房間內的多個 bot 互相協作。",
143
+ tip_classicWebEcho: "把網頁聊天室送出的訊息也貼到這個房間。", tip_classicContext: "每次送給 AI 時附上的最近聊天行數。",
144
+ },
145
+ });
146
+
147
+ /** A word of this page (agentPage.*). */
148
+ export const pt = (key, ...values) => t(`agentPage.${key}`, ...values);
@@ -2,9 +2,9 @@
2
2
  // → a small 「引用」 pill → the passage goes into the composer as a Markdown quote ("> …") at the caret, on its own lines,
3
3
  // the caret left on the next line for the answer. Repeatable: quote, answer, quote the next passage, answer…
4
4
  //
5
- // - Desktop: the pill is anchored to where the selection ends (a pointer at the exact spot), above that line — or below
6
- // it when that covers less of the neighbouring lines' text (the passage itself never counts). After a quote the
7
- // composer takes the focus.
5
+ // - Desktop: the pill is anchored to where the selection ends (a pointer at the exact spot), below that line — clear of
6
+ // the browser's own menu above a selection (Edge's mini menu sits there, and a page can't turn it off; M-2872) — and
7
+ // above it only when there is no room below in the thread's visible box. After a quote the composer takes the focus.
8
8
  // - Phone (a coarse pointer): the pill 「引用選取的文字」 docks above the composer's whole box inside the 16-px gutter — clear
9
9
  // of the system's own copy toolbar (above a selection) and of the finger — or at the top of the thread when the
10
10
  // passage sits there. The keyboard does NOT open after a quote (the user's choice): more passages can be selected;
@@ -177,21 +177,16 @@ export function installQuoteSelection(list, deps) {
177
177
  const last = rects[rects.length - 1];
178
178
  let left, top, tip = null;
179
179
  if (!phone) {
180
- // The other lines of the message (the passage's own never count as covered).
181
- const lines = [];
182
- if (typeof doc.createTreeWalker === "function" && typeof doc.createRange === "function") {
183
- const w = doc.createTreeWalker(passage.el, 4 /* text */);
184
- while (w.nextNode()) {
185
- const rg = doc.createRange(); rg.selectNodeContents(w.currentNode);
186
- for (const z of rg.getClientRects()) if (z.width > 0 && !rects.some((q) => overlap(q, z) > 0)) lines.push(z);
187
- }
188
- }
180
+ // Room is the thread's visible box (the chat scroller, above the composer), within the window.
181
+ const th = deps.threadBox?.()?.getBoundingClientRect?.();
182
+ const vh = win?.innerHeight ?? 800;
183
+ const box = th && th.bottom > th.top ? th : { top: 0, bottom: vh };
184
+ const floor = Math.min(vh, box.bottom) - 4, ceil = Math.max(0, box.top) + 4;
189
185
  left = Math.max(8, Math.min(last.right - pr.width / 2, vw - pr.width - 8));
190
- const above = { left, right: left + pr.width, top: last.top - pr.height - 10, bottom: last.top - 10 };
191
- const below = { left, right: left + pr.width, top: last.bottom + 10, bottom: last.bottom + 10 + pr.height };
192
- const cover = (a) => lines.reduce((n, z) => n + overlap(a, z), 0);
193
- const under = cover(below) < cover(above) || above.top < 4;
194
- top = under ? below.top : above.top;
186
+ const aboveTop = last.top - pr.height - 10, belowTop = last.bottom + 10;
187
+ // Below unless it would run out of the box and above fits (with no room either side, below).
188
+ const under = belowTop + pr.height <= floor || aboveTop < ceil;
189
+ top = under ? belowTop : aboveTop;
195
190
  tip = { side: under ? "up" : "down", x: Math.max(10, Math.min(last.right - left - 5, pr.width - 20)) };
196
191
  } else {
197
192
  const box = deps.composerBox?.()?.getBoundingClientRect?.();
@@ -43,7 +43,7 @@ export function hubName(doc = typeof document !== "undefined" ? document : null)
43
43
  * - { state: "key_changed", hub: {…approved, fingerprint (hub-key)}, offered (hub-key) }
44
44
  * nothing connects; the offered value is never accepted automatically — re-pair or disconnect
45
45
  * - { state: "held", hold, memberOrigin? }
46
- * a safety hold, visible: hold ∈ "unknown_outcome" | "expired" | "unsaved" | "refused" | "revoked" | "disconnected"
46
+ * a safety hold, visible: hold ∈ "unknown_outcome" | "expired" | "unsaved" | "refused" | "revoked" | "rejected" | "disconnected"
47
47
  * — never shown as paired, never as a successful unpair ("unavailable": an older host, shown as one line, not a hold)
48
48
  * @typedef {object} HubPairingView
49
49
  */
@@ -34,7 +34,7 @@ register("companyJoin", {
34
34
  },
35
35
  "zh-TW": {
36
36
  title: "連接 Hub", lead: "使用公司帳號登入,連接成功後會啟用成員功能,不會分享任何 Agent。",
37
- address: "Hub 位址或公司連結", addressHint: "貼上 Hub 管理員提供的公司連結,或輸入 Hub 網頁位址。",
37
+ address: "Hub 位址或公司連結", addressHint: "貼上 Hub 管理員提供的公司連結,或輸入 Hub 網址。",
38
38
  fleetName: "Fleet 名稱", defaultFleet: "我的 Fleet", start: "以公司帳號登入", pending: "等待本機授權確認…", loading: "正在讀取連線狀態…",
39
39
  joining: "正在連接 Fleet…", awaiting: "請在 Hub 頁面完成公司帳號登入。", saved: "Fleet 已連接", offline: "連線資料已儲存,正在等待 Hub 連線…",
40
40
  stop: "取消連接", resume: "恢復這次連接", retry: "再次檢查", held: "連接需要處理", cancelled: "已取消連接",
@@ -1,3 +1,4 @@
1
+ import { register, t } from "/assets/app-i18n.js";
1
2
  /** Hub-only join page and Administration contents; the shell remains panel-hub's. */
2
3
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
3
4
  import { Skeleton, ErrorState } from "/assets/ui-states.js";
@@ -79,6 +80,11 @@ export function HubCompanyJoinPage({ session }) {
79
80
  ${error ? html`<${ErrorState} message=${error} onRetry=${() => { setError(null); retry(); }} />` : null}
80
81
  </section></div></div>`;
81
82
  }
83
+ register("companyJoin", {
84
+ en: { "guide.title": "How colleagues connect", "guide.one": "Copy the colleague connection link here.", "guide.two": "In their Fleet’s Settings → Hub, paste the link and choose {0}.", "guide.three": "Sign in on the Hub and choose Sign in and connect Fleet. Allowed groups need no further approval." },
85
+ "zh-TW": { "guide.title": "同仁如何連接", "guide.one": "在這裡複製同仁連線連結。", "guide.two": "在自己的 Fleet「設定 → Hub」貼上連結,按「{0}」。", "guide.three": "在 Hub 登入並按「登入並連接 Fleet」。允許的群組不需要另外核准。" },
86
+ });
87
+ const guide = (key, ...args) => t(`companyJoin.guide.${key}`, ...args);
82
88
  export const companyJoinAdminEntryV1 = entryWords.companyAdminStringsV1 === true;
83
89
  export function CompanyJoinAdminCard({ entry = false, groups = false } = {}) {
84
90
  const [view, setView] = useState(null), [error, setError] = useState(null), [busy, setBusy] = useState(false), [copied, setCopied] = useState(false);
@@ -110,6 +116,7 @@ export function CompanyJoinAdminCard({ entry = false, groups = false } = {}) {
110
116
  <p class="note">${hj("accessLead")}</p>
111
117
  <div class="field-row">${groups ? html`<a class="btn btn-primary" href="/ui/hub/admin?view=groups">${hj("groupOpen")}</a>` : null}
112
118
  <button type="button" class="btn" disabled=${!view?.enabled || !view?.companyLink || busy || !!error} aria-describedby="hubColleagueLinkHint" onClick=${async () => { try { await navigator.clipboard.writeText(view.companyLink); if (live.current) setCopied(true); } catch { if (live.current) setError(hj("copyFailed")); } }}>${hj(copied ? "copied" : "colleagueCopy")}</button></div>
119
+ <div class="form hub-company-guide"><h4>${guide("title")}</h4><ol class="note"><li>${guide("one")}</li><li>${guide("two", hj("start"))}</li><li>${guide("three")}</li></ol></div>
113
120
  <p class="note" id="hubColleagueLinkHint">${hj(view ? view.enabled ? "colleagueHint" : "offHint" : "loading")}</p>
114
121
  ${!view && !error ? html`<${Skeleton} variant="form" lines=${3} />` : null}
115
122
  ${error ? html`<${ErrorState} message=${error} onRetry=${read} />` : null}
@@ -63,6 +63,8 @@ register("hub", {
63
63
  heldTitle: "On hold", holdClear: "Start over",
64
64
  hold_unknown_outcome: "The last pairing step's result is unknown. Nothing runs until it is checked.",
65
65
  hold_expired: "The pairing request expired.", hold_unsaved: "This fleet couldn't save its Hub settings. Nothing connects until they can be saved.",
66
+ offlineRecovery: "A temporary outage reconnects automatically. If the Hub was restored or no longer recognises this fleet, pair again.",
67
+ hold_rejected: "The Hub cannot resume this fleet’s saved connection. It may have been restored to an older state or no longer recognise this fleet. Pair again to reconnect.",
66
68
  hold_refused: "The Hub refused the pairing.", hold_revoked: "The Hub revoked this fleet's pairing.", hold_other: "Pairing is on hold.",
67
69
  sharedTitle: "Shared agents",
68
70
  sharedLead: "Every agent is private unless you share it. Only an agent that can run in a restricted, read-only mode can be shared.",
@@ -134,6 +136,8 @@ register("hub", {
134
136
  heldTitle: "暫停中", holdClear: "重新開始",
135
137
  hold_unknown_outcome: "最後一個配對步驟的結果不明,確認之前不會執行任何工作。",
136
138
  hold_expired: "配對請求已過期。", hold_unsaved: "這個 Fleet 無法儲存 Hub 設定,可以儲存之前不會連線。",
139
+ offlineRecovery: "暫時離線會自動重新連線。若 Hub 已還原,或不再接受這個 Fleet,請重新配對。",
140
+ hold_rejected: "Hub 無法繼續使用這個 Fleet 儲存的連接。Hub 可能已還原至較舊的狀態,或不再接受這個 Fleet;請重新配對。",
137
141
  hold_refused: "Hub 拒絕了這次配對。", hold_revoked: "Hub 已撤銷這個 Fleet 的配對。", hold_other: "配對已暫停。",
138
142
  sharedTitle: "公開的 Agent",
139
143
  sharedLead: "每個 Agent 預設都不公開。只有能在受限、唯讀模式下執行的 Agent 才能公開。",
@@ -1,14 +1,24 @@
1
1
  // Windows uses the same staged instance settings flow, with its runtime's supported fields.
2
+ // the form is a hook (useNativeForm) and its fields are grouped by category (NativeFields), so the Settings dialog
3
+ // and the Details & settings page (agent-details-settings.js) draw the same fields, each with its ⓘ.
2
4
  import { html, useState } from "/assets/app-html.js";
3
5
  import { t } from "/assets/app-i18n.js";
4
6
  import { Dialog } from "/assets/ui-dialog.js";
5
7
  import { ChipList, ModelSelect } from "./settings-dialogs.js";
8
+ import { InfoTip } from "./settings-shared.js";
6
9
  import { useWindowsCliCatalog } from "./windows-cli-catalog.js";
7
10
  import { useRuntimeCatalog, instanceMachineId } from "./runtime-catalog.js";
8
11
  import { NativeAgendToolsHint, tr } from "./agent-runtime.js";
9
12
  import {AgentRuntimeSettings} from "./agent-runtime-settings.js";
13
+ import "./agent-page-strings.js";
14
+ import { pt } from "./agent-page-strings.js";
10
15
  const tn = key => t(`settings.${key}`);
11
- export function NativeInstanceSettings({ name, inst, ctx, onClose }) {
16
+ /** The categories a Windows native agent has (it has no channel binding, tool sets or idle settings: the page shows only these). */
17
+ export const NATIVE_CATEGORIES = ["basic", "runtime", "work", "adv"];
18
+ const Lab = ({ id, text, tip }) => html`<div class="s-lab"><label for=${id}>${text}</label><${InfoTip} text=${tip} name=${text} /></div>`;
19
+ const Card = ({ title, span, children }) => html`<section class=${`card${span ? " ap-span2" : ""}`}><h3>${title}</h3>${children}</section>`;
20
+
21
+ export function useNativeForm({ name, inst, ctx }) {
12
22
  const machineId = instanceMachineId(inst);
13
23
  const catalog = useWindowsCliCatalog(!machineId), machines = useRuntimeCatalog(!!machineId);
14
24
  const machine = machines.data?.machines?.find(item => item.id === machineId);
@@ -17,28 +27,51 @@ export function NativeInstanceSettings({ name, inst, ctx, onClose }) {
17
27
  const set = key => value => setForm(current => ({...current,[key]:value}));
18
28
  const dirty=Object.entries(form).some(([key,value])=>JSON.stringify(typeof value==="string"?value.trim():value)!==JSON.stringify(key==="display_name"?inst.display_name||name:key==="native_sandbox"?inst.native_sandbox||"read-only":key==="tags"?inst.tags||[]:inst[key]||""));
19
29
  const ready = !!form.display_name.trim() && !(form.native_sandbox === "read-only" && native?.readOnlySupport === false);
20
- const stage = () => {
21
- if (!ready) return;
30
+ const pending = () => {
22
31
  const patch = {};
23
32
  for (const [key,value] of Object.entries(form)) {
24
33
  const before = key === "display_name" ? inst.display_name || name : key === "native_sandbox" ? inst.native_sandbox || "read-only" : key === "tags" ? inst.tags || [] : inst[key] || "";
25
34
  const next = typeof value === "string" ? value.trim() : value;
26
35
  if (JSON.stringify(next) !== JSON.stringify(before)) patch[key] = next;
27
36
  }
37
+ return patch;
38
+ };
39
+ const stage = done => {
40
+ if (!ready) return;
41
+ const patch = pending();
28
42
  if (Object.keys(patch).length) ctx.stageAgent(name,inst,patch);
29
- onClose();
43
+ if (done) done();
30
44
  };
31
- return html`<${Dialog} title=${ctx.shortName(name,inst)} onClose=${onClose} wide=${true} drawer=${true} actions=${html`<button type="button" class="btn" onClick=${onClose}>${tn("cancel")}</button><button type="button" class="btn btn-primary" disabled=${!ready} onClick=${stage}>${tn("modalDone")}</button>`}>
32
- <div class="form native-instance-settings"><${AgentRuntimeSettings} name=${name} inst=${{...inst,machine_name:machine?.name||inst.machine_name,machine_status:machine?.status||inst.machine_status,machine_missing:!!machineId&&!!machines.data&&machines.data.enabled!==false&&!machine}} disabled=${dirty||ctx.staged?.size>0} onChanged=${()=>{ctx.reload();onClose();}}/>
33
- <label class="field"><span>${tn("displayName")}</span><input value=${form.display_name} maxLength=${64} onInput=${event => set("display_name")(event.target.value)} /></label>
34
- <label class="field"><span>${tn("description")}</span><input value=${form.description} maxLength=${512} onInput=${event => set("description")(event.target.value)} /></label>
35
- <div class="field"><label for="native-instance-model">${tn("model")}</label><${ModelSelect} id="native-instance-model" value=${form.model} onChange=${set("model")} backend=${inst.backend} instance=${name} runtime="windows" machineId=${machineId} inherit=${tr("model")} /></div>
36
- <label class="field"><span>${tn("workingDir")}</span><input value=${inst.working_directory || ""} readOnly=${true} aria-readonly="true" /><small>${t("nativeInstance.workspace")}</small></label>
37
- <label class="field"><span>${tr("access")}</span><select value=${form.native_sandbox} onChange=${event => set("native_sandbox")(event.target.value)}><option value="read-only" disabled=${native?.readOnlySupport === false}>${tr("read")}</option><option value="workspace-write">${tr("write")}</option></select></label>
45
+ return { name, inst, ctx, form, set, dirty, ready, native, machine, machines, machineId, pending, stage };
46
+ }
47
+
48
+ export function NativeFields({ m, cat }) {
49
+ const { name, inst, ctx, form, set, dirty, ready, native, machine, machines, machineId } = m;
50
+ if (cat === "basic") return html`<div class="ap-grid"><${Card} title=${pt("cardName")} span=${true}>
51
+ <div class="grid2">
52
+ <div class="field"><${Lab} id="ni-dn" text=${tn("displayName")} tip=${pt("tip_displayName")} /><input id="ni-dn" value=${form.display_name} maxLength=${64} onInput=${event => set("display_name")(event.target.value)} /></div>
53
+ <div class="field"><${Lab} id="ni-tags" text=${tn("tags")} tip=${pt("tip_tags")} /><${ChipList} items=${form.tags} onChange=${set("tags")} placeholder=${tn("tagPlaceholder")} label=${tn("tags")} /></div>
54
+ </div>
55
+ <div class="field"><${Lab} id="ni-desc" text=${tn("description")} tip=${pt("tip_description")} /><input id="ni-desc" value=${form.description} maxLength=${512} onInput=${event => set("description")(event.target.value)} /><p class="note">${pt("note_description")}</p></div></${Card}></div>`;
56
+ if (cat === "runtime") return html`<div class="ap-grid">
57
+ <${Card} title=${pt("cardRuntime")}><${AgentRuntimeSettings} name=${name} inst=${{...inst,machine_name:machine?.name||inst.machine_name,machine_status:machine?.status||inst.machine_status,machine_missing:!!machineId&&!!machines.data&&machines.data.enabled!==false&&!machine}} disabled=${dirty||ctx.staged?.size>0} onChanged=${()=>{ctx.reload();if(m.onChanged)m.onChanged();}}/></${Card}>
58
+ <${Card} title=${pt("cardModel")}><div class="field"><${Lab} id="native-instance-model" text=${tn("model")} tip=${pt("tip_model")} /><${ModelSelect} id="native-instance-model" value=${form.model} onChange=${set("model")} backend=${inst.backend} instance=${name} runtime="windows" machineId=${machineId} inherit=${tr("model")} /></div></${Card}></div>`;
59
+ if (cat === "work") return html`<div class="ap-grid"><${Card} title=${pt("cardWorkspace")} span=${true}>
60
+ <div class="field"><${Lab} id="ni-wd" text=${tn("workingDir")} tip=${pt("tip_workdirNative")} /><input id="ni-wd" value=${inst.working_directory || ""} readOnly=${true} aria-readonly="true" /><small>${t("nativeInstance.workspace")}</small></div>
61
+ <div class="field"><${Lab} id="ni-sb" text=${tr("access")} tip=${pt("tip_sandbox")} /><select id="ni-sb" value=${form.native_sandbox} onChange=${event => set("native_sandbox")(event.target.value)}><option value="read-only" disabled=${native?.readOnlySupport === false}>${tr("read")}</option><option value="workspace-write">${tr("write")}</option></select></div>
38
62
  <${NativeAgendToolsHint} cli=${native} sandbox=${form.native_sandbox} />
39
63
  ${!ready && form.native_sandbox === "read-only" && native?.readOnlySupport === false ? html`<p class="note">${tr("noReadOnly")}</p>` : null}
40
- <label class="field"><span>${tn("systemPrompt")}</span><textarea rows="5" maxLength=${8000} value=${form.systemPrompt} onInput=${event => set("systemPrompt")(event.target.value)} /></label>
41
- <div class="field"><span>${tn("tags")}</span><${ChipList} items=${form.tags} onChange=${set("tags")} placeholder=${tn("tagPlaceholder")} label=${tn("tags")} /></div>
42
- </div>
64
+ <p class="s-info"><span aria-hidden="true">ⓘ</span><span>${pt("nativeLimits")}</span></p></${Card}></div>`;
65
+ return html`<div class="ap-grid"><${Card} title=${pt("cardSystemPrompt")} span=${true}>
66
+ <div class="field"><${Lab} id="ni-sys" text=${tn("systemPrompt")} tip=${pt("tip_systemPromptNative")} /><textarea id="ni-sys" rows="5" maxLength=${8000} value=${form.systemPrompt} onInput=${event => set("systemPrompt")(event.target.value)} /></div>
67
+ <p class="note">${pt("note_systemPrompt")}</p></${Card}></div>`;
68
+ }
69
+
70
+ export function NativeInstanceSettings({ name, inst, ctx, onClose }) {
71
+ const m = useNativeForm({ name, inst, ctx });
72
+ m.onChanged = onClose;
73
+ const stage = () => m.stage(onClose);
74
+ return html`<${Dialog} title=${ctx.shortName(name,inst)} onClose=${onClose} wide=${true} drawer=${true} actions=${html`<button type="button" class="btn" onClick=${onClose}>${tn("cancel")}</button><button type="button" class="btn btn-primary" disabled=${!m.ready} onClick=${stage}>${tn("modalDone")}</button>`}>
75
+ <div class="form native-instance-settings">${NATIVE_CATEGORIES.map(cat => html`<${NativeFields} key=${cat} m=${m} cat=${cat} />`)}</div>
43
76
  </${Dialog}>`;
44
77
  }
@@ -2,8 +2,9 @@ import { NativePaneRecovery } from "./native-pane-recovery.js";
2
2
  // #1523 N2 (§3.3, Q1 = B): Details — "the Fleet side of one instance", at /ui/fleet/agent/<name>. Behind the session
3
3
  // gate (/ui/js/). What it holds:
4
4
  // - runtime and recent activity (what Chat's details dialog showed, now a page);
5
- // - a read-only config summary — directory, binding, tags, description — with "Edit in Settings" (that agent's
6
- // Settings dialog: Settings' own staged Apply and confirmations; nothing is edited here);
5
+ // - a read-only config summary — directory, binding, tags, description — in the Overview;
6
+ // - "Details & settings" — the settings of that agent beside it, by category (agent-details-settings.js), with
7
+ // Settings' own staged Apply and confirmations;
7
8
  // - the instance's actions (⋯), carried over with their calls and confirmations, none new: start / restart / stop (Chat's
8
9
  // ⋯), pause / wake (Settings' agent row). Deletion stays where it already lives (Chat's ⋯, Settings).
9
10
  // One read of /ui/instance/<name> when it opens (#1374: nothing recurring); the live status is the app's.
@@ -13,7 +14,7 @@ import { appStore, useStore } from "/assets/app-store.js";
13
14
  import { useLease } from "/assets/app-ctx.js";
14
15
  import { PanelHeader, setTitle, statusClass, statusLabel, openDrawer } from "/assets/app-shell.js";
15
16
  import { navigate } from "/assets/app-nav.js";
16
- import { sectionPath } from "/assets/app-route.js";
17
+ import { detailsPath } from "/assets/app-route.js";
17
18
  import { InstanceSwitch } from "/assets/instance-switch.js";
18
19
  import { modelText } from "/assets/instance-nav.js";
19
20
  import { HeaderTools } from "/assets/header-tools.js";
@@ -27,7 +28,10 @@ import { toast } from "/assets/ui-toast.js";
27
28
  import "/assets/chat-strings.js";
28
29
  import { api } from "./settings-confirm.js";
29
30
  import { InstanceBoardWork } from "./fleet-task-work.js";
30
- import { requestAgentSettings } from "./settings-request.js";
31
+ import { Icon } from "/assets/ui-icons.js";
32
+ import { AgentCategoryNav, AgentPageHead, AgentSettingsPanels, agentKind, categoryFromSearch, categoryLabel, useAgentSettings } from "./agent-details-settings.js";
33
+ import "./agent-page-strings.js";
34
+ import { pt } from "./agent-page-strings.js";
31
35
 
32
36
  export function DetailsPanel({ route, navKey }) {
33
37
  const app = useStore(appStore);
@@ -53,6 +57,15 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
53
57
  const [failed, setFailed] = useState(false);
54
58
  const [busy, setBusy] = useState("");
55
59
  const body = useRef(null);
60
+ // the category the address names (`?cat=`); none is Overview on a wide screen, the list of categories on a phone.
61
+ const [opened, setOpened] = useState(false);
62
+ const [dirty, setDirty] = useState(() => new Set());
63
+ const kind = agentKind(d, inst);
64
+ const cat = categoryFromSearch(kind);
65
+ const shownCat = cat || "overview";
66
+ useEffect(() => { if (d && cat && cat !== "overview") setOpened(true); }, [!!d, cat]);
67
+ const sess = useAgentSettings({ name, lease, enabled: opened, navKey });
68
+ const onDirty = (next) => setDirty((cur) => (cur.size === next.size && [...cur].every((c) => next.has(c)) ? cur : next));
56
69
  // Each read is numbered: only the latest one (on this page) may set what is shown — a Retry still on its way never
57
70
  // overwrites a newer answer, failed or not (#1561 review).
58
71
  const reads = useRef(0);
@@ -95,17 +108,14 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
95
108
  // A ClassicBot room (classicBot.yaml) keeps Classic's split: its own Settings dialog, and only the actions Settings'
96
109
  // Classic rows have (pause / wake) — never the fleet agent's (#1561 review).
97
110
  const classic = !!(d && d.kind === "classic");
98
- const editInSettings = () => { requestAgentSettings(name, classic ? "classic" : "agent"); navigate(sectionPath(classic ? "classic" : undefined)); };
99
111
  const st = inst.status;
100
112
  // Until its read is in, the page does not know which kind it is: no actions yet (only Edit is offered once known).
101
113
  const items = !d ? [] : classic ? [
102
- { key: "edit", label: t("chat.dEditInSettings"), icon: "settings", onSelect: editInSettings },
103
114
  st === "running" ? { key: "pause", label: t("chat.dPause"), icon: "pause", disabled: !!busy, onSelect: () => pauseWake("pause") } : null,
104
115
  st === "paused" ? { key: "wake", label: t("chat.dWake"), icon: "play", disabled: !!busy, onSelect: () => pauseWake("wake") } : null,
105
116
  colorMenuItem(name, inst), // #1958
106
117
  ...themeMenuItems(name), // #1629
107
118
  ] : [
108
- { key: "edit", label: t("chat.dEditInSettings"), icon: "settings", onSelect: editInSettings },
109
119
  st === "running" ? null : st === "paused" ? null : { key: "start", label: t("chat.start"), icon: "play", disabled: !!busy, onSelect: () => lifecycle("start") },
110
120
  st === "running" ? { key: "restart", label: t("chat.restart"), icon: "restart", disabled: !!busy, onSelect: () => lifecycle("restart") } : null,
111
121
  st === "running" ? { key: "stop", label: t("chat.stopInstance"), icon: "stop", disabled: !!busy, onSelect: () => lifecycle("stop") } : null,
@@ -117,7 +127,9 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
117
127
  ];
118
128
 
119
129
  const cls = statusClass(inst, exec, awaiting);
120
- const sub = html`<span class="status"><span class=${`dot ${cls}`} aria-hidden="true"></span>${statusLabel(inst, exec, awaiting)}</span>`;
130
+ // On a phone the header shows only the dot (the name needs the room): the word is in `title` and the accessible name.
131
+ const statusText = statusLabel(inst, exec, awaiting);
132
+ const sub = html`<span class="status" role="img" title=${statusText} aria-label=${statusText}><span class=${`dot ${cls}`} aria-hidden="true"></span><span class="status-text">${statusText}</span></span>`;
121
133
  const src = (s) => (s === "instance" ? ` ${t("chat.configured")}` : s === "fleet-default" ? ` ${t("chat.fleetDefault")}` : "");
122
134
  const bar = (pct, level) => html`<span class="progress-bar"><span class=${`progress-fill${level ? ` ${level}` : ""}`} data-pct=${Math.max(0, Math.min(Number(pct) || 0, 100))}></span></span>`;
123
135
  const row = (k, v) => html`<div class="kv"><span class="k">${k}</span><span class="v">${v}</span></div>`;
@@ -141,9 +153,7 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
141
153
  ${row(t("chat.dDescription"), d.description || "--")}
142
154
  ${d.working_directory ? row(t("chat.dDirectory"), html`<span class="mono">${d.working_directory}</span>`) : null}
143
155
  ${row(t("chat.dBinding"), binding)}
144
- ${row(t("chat.dTags"), Array.isArray(d.tags) && d.tags.length ? html`<span class="d-tags">${d.tags.map((x) => html`<span key=${x} class="tag">${x}</span>`)}</span>` : "--")}
145
- <div class="d-edit"><span class="note">${t("chat.dReadOnly")}</span>
146
- <button type="button" class="btn btn-sm d-edit-settings" onClick=${editInSettings}>${t("chat.dEditInSettings")}</button></div></section>
156
+ ${row(t("chat.dTags"), Array.isArray(d.tags) && d.tags.length ? html`<span class="d-tags">${d.tags.map((x) => html`<span key=${x} class="tag">${x}</span>`)}</span>` : "--")}</section>
147
157
  <section class="card"><h3>${t("chat.dRuntime")}</h3>
148
158
  ${row(t("chat.dBackend"), d.backend || "--")}
149
159
  ${row(t("chat.dModel"), `${(d.model && modelText(d)) || sl.model?.display_name || "--"}${d.model_source === "live" ? "" : src(d.model_source)}`)}
@@ -157,9 +167,23 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
157
167
  <span class="mono muted">${a.timestamp ? new Date(`${a.timestamp.replace(" ", "T")}Z`).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ""}</span>
158
168
  <span class="ev">${a.event}</span> ${a.summary || ""}</div>`) : html`<p class="note">${t("chat.dNoActivity")}</p>`}</section>`;
159
169
  }
160
- return html`<div data-effect-panel="details" class="panel p-details">
170
+ const actions = items.filter((i) => i && ["start", "restart", "stop", "pause", "wake"].includes(i.key));
171
+ const overview = html`<${NativePaneRecovery} name=${name} inst=${inst} lease=${lease} />${busy ? html`<p class="note" role="status">${t("chat.dWorking")}</p>` : null}<${IdentityCard} name=${name} card=${card} />
172
+ <${AgentWidget} slot="details" widget=${widgetFor(name, "details")} binds=${instanceBinds(inst, exec, awaiting)} />${content}
173
+ ${actions.length ? html`<section class="card d-actions"><h3>${pt("actions")}</h3><div class="field-row">${actions.map((i) => html`<button key=${i.key} type="button" class="btn btn-sm" disabled=${i.disabled} onClick=${i.onSelect}>${i.label}</button>`)}</div>
174
+ <p class="note">${pt("actionsNote")}</p></section>` : null}`;
175
+ const Pending = sess.mod && sess.mod.PendingBar, OpCard = sess.mod && sess.mod.OperationCard;
176
+ return html`<div data-effect-panel="details" class="panel p-details p-settings p-agent-page" data-view=${cat ? "section" : "index"}>
161
177
  <${PanelHeader} title=${name} sub=${sub} nav=${html`<${InstanceSwitch} name=${name} current="details" />`}><${HeaderTools} navKey=${navKey} /><${Menu} items=${items} label=${t("app.more")} /></${PanelHeader}>
162
- <div data-trust="panel-content" class="panel-body"><div class="col" ref=${body}><${NativePaneRecovery} name=${name} inst=${inst} lease=${lease} />${busy ? html`<p class="note" role="status">${t("chat.dWorking")}</p>` : null}<${IdentityCard} name=${name} card=${card} />
163
- <${AgentWidget} slot="details" widget=${widgetFor(name, "details")} binds=${instanceBinds(inst, exec, awaiting)} />${content}</div></div>
178
+ <${AgentCategoryNav} name=${name} kind=${kind} cat=${shownCat} dirty=${dirty} />
179
+ <div data-trust="panel-content" class="panel-body"><div class="col" ref=${body}>
180
+ <a class="s-back" href=${detailsPath(name)}><${Icon} name="back" size=${16} /><span>${t("app.details")}</span><span class="s-back-here">${categoryLabel(kind, shownCat)}</span></a>
181
+ <${AgentPageHead} name=${name} kind=${kind} cat=${shownCat} inst=${null} />
182
+ ${OpCard && sess.op ? html`<${OpCard} op=${sess.op} schema=${sess.data && sess.data.schema} />` : null}
183
+ <div class="s-section-layout" data-agent-category=${shownCat}>
184
+ <div class="ap-panel" id="ap-panel-overview" hidden=${shownCat !== "overview"}>${overview}</div>
185
+ ${opened ? html`<${AgentSettingsPanels} name=${name} kind=${kind} cat=${shownCat} sess=${sess} onDirty=${onDirty} />` : null}
186
+ </div></div></div>
187
+ ${sess.staged.size && Pending ? html`<${Pending} staged=${sess.staged} busy=${!!sess.op && ["writing", "posting", "watching"].includes(sess.op.phase)} onApply=${sess.apply} onDiscard=${sess.discard} section="agents" />` : null}
164
188
  </div>`;
165
189
  }
@@ -67,7 +67,7 @@ register("fleet", {
67
67
  backend: "Backend",
68
68
  newInstance: "New instance", directory: "Directory", directoryHint: "Optional — a workspace is created if empty", topic: "Name", topicHint: "From the directory name",
69
69
  topicRequired: "Name is required when Directory is empty", description: "Description", descriptionHint: "What this instance does", model: "Model", modelHint: "e.g. sonnet, opus, gpt-5",
70
- branch: "Branch (git worktree)", branchHint: "e.g. feature-x", tags: "Tags", tagsHint: "comma-separated, e.g. dev, review", systemPrompt: "System prompt", systemPromptHint: "Custom instructions for this instance",
70
+ branch: "Branch (git worktree)", branchHint: "e.g. feature-x", tags: "Tags", tagsHint: "comma-separated, e.g. dev, review", systemPrompt: "Agent instructions", systemPromptHint: "Custom instructions for this instance (formerly “System prompt”)",
71
71
  fleetDefault: "Use the fleet default", notInstalled: "(not installed)", notSignedIn: "(not signed in — use /login)", tooOld: "(needs {0} or newer)", unchecked: "(not checked yet)", deprecated: "(deprecated)", instanceCreated: "Instance created",
72
72
  },
73
73
  "zh-TW": {
@@ -94,7 +94,7 @@ register("fleet", {
94
94
  backend: "Backend",
95
95
  newInstance: "新增 Agent", directory: "目錄", directoryHint: "可留空——留空會自動建立工作區", topic: "名稱", topicHint: "預設取自目錄名稱",
96
96
  topicRequired: "目錄留空時必須填寫名稱", description: "說明", descriptionHint: "這個 Agent 做什麼", model: "模型", modelHint: "例如 sonnet、opus、gpt-5",
97
- branch: "分支(git worktree)", branchHint: "例如 feature-x", tags: "標籤", tagsHint: "以逗號分隔,例如 dev, review", systemPrompt: "System prompt", systemPromptHint: "這個 Agent 的自訂指示",
97
+ branch: "分支(git worktree)", branchHint: "例如 feature-x", tags: "標籤", tagsHint: "以逗號分隔,例如 dev, review", systemPrompt: "Agent 指示", systemPromptHint: "這個 Agent 的自訂指示(以前叫「System prompt」)",
98
98
  fleetDefault: "使用 fleet 預設", notInstalled: "(未安裝)", notSignedIn: "(未登入,請用 /login)", tooOld: "(需要 {0} 以上版本)", unchecked: "(尚未檢查)", deprecated: "(已淘汰)", instanceCreated: "Agent 已建立",
99
99
  },
100
100
  });