@songsid/agend 2.3.5-alpha.6 → 2.3.5-alpha.7

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 (150) hide show
  1. package/dist/auth-api.js +11 -0
  2. package/dist/auth-api.js.map +1 -1
  3. package/dist/authority/web-authority.d.ts +13 -0
  4. package/dist/authority/web-authority.js +12 -0
  5. package/dist/authority/web-authority.js.map +1 -1
  6. package/dist/backend/claude-code.js +47 -9
  7. package/dist/backend/claude-code.js.map +1 -1
  8. package/dist/backend/kiro.js +1 -1
  9. package/dist/backend/kiro.js.map +1 -1
  10. package/dist/build-provenance.json +1 -1
  11. package/dist/channel/access-manager.d.ts +1 -6
  12. package/dist/channel/access-manager.js +4 -94
  13. package/dist/channel/access-manager.js.map +1 -1
  14. package/dist/channel/adapters/discord.d.ts +0 -2
  15. package/dist/channel/adapters/discord.js +0 -8
  16. package/dist/channel/adapters/discord.js.map +1 -1
  17. package/dist/channel/adapters/telegram.d.ts +0 -3
  18. package/dist/channel/adapters/telegram.js +1 -30
  19. package/dist/channel/adapters/telegram.js.map +1 -1
  20. package/dist/channel/types.d.ts +0 -2
  21. package/dist/cli.js +1 -19
  22. package/dist/cli.js.map +1 -1
  23. package/dist/fleet-manager.d.ts +59 -1
  24. package/dist/fleet-manager.js +336 -28
  25. package/dist/fleet-manager.js.map +1 -1
  26. package/dist/general-knowledge/skills/concepts/SKILL.md +22 -7
  27. package/dist/general-knowledge/steering/core-rules.md +6 -4
  28. package/dist/hub/buttons.js +4 -2
  29. package/dist/hub/buttons.js.map +1 -1
  30. package/dist/hub/catalog.d.ts +1 -1
  31. package/dist/hub/catalog.js +82 -15
  32. package/dist/hub/catalog.js.map +1 -1
  33. package/dist/hub/compose/server.d.ts +4 -1
  34. package/dist/hub/compose/server.js +29 -3
  35. package/dist/hub/compose/server.js.map +1 -1
  36. package/dist/hub/directory/directory.d.ts +1 -1
  37. package/dist/hub/directory/directory.js +32 -23
  38. package/dist/hub/directory/directory.js.map +1 -1
  39. package/dist/hub/directory/index.d.ts +1 -1
  40. package/dist/hub/directory/types.d.ts +8 -2
  41. package/dist/hub/directory/types.js.map +1 -1
  42. package/dist/hub/group-policy/admin-context.d.ts +23 -0
  43. package/dist/hub/group-policy/admin-context.js +52 -0
  44. package/dist/hub/group-policy/admin-context.js.map +1 -0
  45. package/dist/hub/group-policy/admin-dto.d.ts +235 -0
  46. package/dist/hub/group-policy/admin-dto.js +55 -0
  47. package/dist/hub/group-policy/admin-dto.js.map +1 -0
  48. package/dist/hub/group-policy/admin-inventory.d.ts +24 -0
  49. package/dist/hub/group-policy/admin-inventory.js +72 -0
  50. package/dist/hub/group-policy/admin-inventory.js.map +1 -0
  51. package/dist/hub/group-policy/admin-read.d.ts +21 -0
  52. package/dist/hub/group-policy/admin-read.js +90 -0
  53. package/dist/hub/group-policy/admin-read.js.map +1 -0
  54. package/dist/hub/group-policy/authorization.d.ts +43 -0
  55. package/dist/hub/group-policy/authorization.js +170 -0
  56. package/dist/hub/group-policy/authorization.js.map +1 -0
  57. package/dist/hub/group-policy/resources.d.ts +9 -1
  58. package/dist/hub/group-policy/resources.js +30 -5
  59. package/dist/hub/group-policy/resources.js.map +1 -1
  60. package/dist/hub/group-policy/store.d.ts +8 -2
  61. package/dist/hub/group-policy/store.js +9 -3
  62. package/dist/hub/group-policy/store.js.map +1 -1
  63. package/dist/hub/http/compose.js +6 -7
  64. package/dist/hub/http/compose.js.map +1 -1
  65. package/dist/hub/http/core.d.ts +23 -3
  66. package/dist/hub/http/core.js +138 -5
  67. package/dist/hub/http/core.js.map +1 -1
  68. package/dist/hub/http/deps.d.ts +3 -0
  69. package/dist/hub/policy.d.ts +3 -1
  70. package/dist/hub/policy.js +13 -6
  71. package/dist/hub/policy.js.map +1 -1
  72. package/dist/hub/rooms.d.ts +1 -0
  73. package/dist/hub/rooms.js +76 -26
  74. package/dist/hub/rooms.js.map +1 -1
  75. package/dist/hub/sessions.js +2 -1
  76. package/dist/hub/sessions.js.map +1 -1
  77. package/dist/hub/types.d.ts +2 -0
  78. package/dist/locale.js +26 -20
  79. package/dist/locale.js.map +1 -1
  80. package/dist/runtime-api.js +10 -2
  81. package/dist/runtime-api.js.map +1 -1
  82. package/dist/settings-api.js +3 -2
  83. package/dist/settings-api.js.map +1 -1
  84. package/dist/settings-change.d.ts +10 -0
  85. package/dist/settings-change.js +17 -1
  86. package/dist/settings-change.js.map +1 -1
  87. package/dist/settings-confirmation.d.ts +25 -1
  88. package/dist/settings-confirmation.js +11 -3
  89. package/dist/settings-confirmation.js.map +1 -1
  90. package/dist/settings-effect.js +18 -6
  91. package/dist/settings-effect.js.map +1 -1
  92. package/dist/settings-http-confirmation.d.ts +21 -0
  93. package/dist/settings-http-confirmation.js +74 -3
  94. package/dist/settings-http-confirmation.js.map +1 -1
  95. package/dist/structured-signin.js +3 -1
  96. package/dist/structured-signin.js.map +1 -1
  97. package/dist/tips.js +4 -4
  98. package/dist/tips.js.map +1 -1
  99. package/dist/types.d.ts +2 -0
  100. package/dist/types.js.map +1 -1
  101. package/dist/ui/accounts-keepalive.js +4 -3
  102. package/dist/ui/accounts-manage.js +2 -2
  103. package/dist/ui/accounts-view.js +18 -7
  104. package/dist/ui/backend-signin.js +12 -3
  105. package/dist/ui/general-location.js +28 -14
  106. package/dist/ui/hub-chat-store.js +2 -1
  107. package/dist/ui/hub-grant-strings.js +13 -0
  108. package/dist/ui/hub-owner-strings.js +6 -2
  109. package/dist/ui/hub-strings.js +4 -2
  110. package/dist/ui/panel-hub.js +68 -23
  111. package/dist/ui/panel-log.js +2 -2
  112. package/dist/ui/panel-runtimes.js +14 -6
  113. package/dist/ui/panel-settings.js +7 -19
  114. package/dist/ui/runtime-cli-install.js +24 -4
  115. package/dist/ui/settings-confirm.js +28 -0
  116. package/dist/ui/settings-devices.js +6 -10
  117. package/dist/ui/settings-hub-membership.js +6 -6
  118. package/dist/ui/settings-hub-section.js +35 -0
  119. package/dist/ui/settings-hub.js +6 -2
  120. package/dist/ui/settings-layout.js +6 -2
  121. package/dist/ui/settings-named-test.js +2 -2
  122. package/dist/ui/settings-outside.js +1 -1
  123. package/dist/ui/settings-quota-notice.js +8 -6
  124. package/dist/ui/settings-registry.js +3 -0
  125. package/dist/ui/settings-strings.js +6 -6
  126. package/dist/ui/shared/app-i18n.js +4 -2
  127. package/dist/ui/shared/app-route.js +1 -1
  128. package/dist/ui/shared/app-shell.js +102 -5
  129. package/dist/ui/shared/app.css +16 -0
  130. package/dist/ui/shared/chat-strings.js +8 -8
  131. package/dist/ui/shared/hub-owner.css +2 -2
  132. package/dist/ui/shared/hub-signin.css +24 -0
  133. package/dist/ui/shared/view-strings.js +4 -4
  134. package/dist/ui/structured-signin.js +16 -8
  135. package/dist/usage/providers.d.ts +1 -0
  136. package/dist/usage/providers.js +13 -9
  137. package/dist/usage/providers.js.map +1 -1
  138. package/dist/web-api.d.ts +5 -0
  139. package/dist/web-api.js +15 -6
  140. package/dist/web-api.js.map +1 -1
  141. package/dist/web-remote-access.d.ts +6 -0
  142. package/dist/web-remote-access.js +10 -1
  143. package/dist/web-remote-access.js.map +1 -1
  144. package/dist/web-shell-routes.d.ts +1 -1
  145. package/dist/web-shell-routes.js +1 -1
  146. package/dist/web-shell-routes.js.map +1 -1
  147. package/dist/windows-cli-api.d.ts +8 -0
  148. package/dist/windows-cli-api.js +10 -0
  149. package/dist/windows-cli-api.js.map +1 -1
  150. package/package.json +2 -1
@@ -14,7 +14,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
14
14
  import { register, t } from "/assets/app-i18n.js";
15
15
  import { appStore, createStore, useStore } from "/assets/app-store.js";
16
16
  import { Dialog } from "/assets/ui-dialog.js";
17
- import { Skeleton } from "/assets/ui-states.js";
17
+ import { ErrorState, Skeleton } from "/assets/ui-states.js";
18
18
  import { CliProductMark, cliLabel } from "./cli-picker.js";
19
19
  import { identityText } from "./account-identity.js";
20
20
  import { openSignIn, refreshSignIn, signInStore } from "./backend-signin.js";
@@ -26,13 +26,13 @@ import { KeepAliveControl } from "./accounts-keepalive.js"; // #3292
26
26
 
27
27
  register("accounts", {
28
28
  en: {
29
- title: "Accounts", hint: "Each CLI's sign-ins on this host: the default one and named accounts (credential profiles), who uses them and their weekly usage.",
29
+ title: "Accounts", hint: "Each CLI's sign-ins on this AgEnD host and on paired computers: the default one and named accounts (credential profiles), who uses them and their weekly usage.",
30
30
  loading: "Reading accounts…", failed: "Could not read the accounts.", empty: "No CLI is installed or used by an agent on this host.",
31
31
  def: "Default sign-in", profile: "Account “{0}”", state_usable: "signed in", state_not_signed_in: "not signed in", state_unknown: "not checked",
32
32
  state_not_installed: "not installed", state_too_old: "too old",
33
33
  usedBy: "used by {0}", usedByNone: "used by no agent", agents: "{0} agents", agent: "1 agent", channels: "{0} ClassicBot rooms", channel: "1 ClassicBot room",
34
34
  fleetDefaultTag: "fleet default", weekly: "{0}% of the week", resets: "resets {0}", stale: "last known",
35
- signIn: "Sign in", signInAgain: "Sign in again", hostCommand: "Sign in on the host", hostCommandHint: "Run this in a terminal on the host running AgEnD.",
35
+ signIn: "Sign in", signInAgain: "Sign in again", hostCommand: "Sign in from chat", hostCommandHint: "This row cannot sign in from the dashboard. Send /login in chat, or ask General.",
36
36
  moveHere: "Move agents here…", moveTitle: "Move agents to {0}", moveLead: "Choose the {0} agents that should use {1}. Each restarts on it when you Save:",
37
37
  carry_claude: "Claude Code carries its conversation over.", carry_codex: "Codex keeps its conversation.", carry_kiro: "Kiro starts a new conversation, with a handover.",
38
38
  moveNone: "Every {0} agent already uses this account.", moveStage: "Stage", cancel: "Cancel", current: "now: {0}",
@@ -52,13 +52,13 @@ register("accounts", {
52
52
  acctDefaultBlocked: "This fleet's default for {0} is “{1}”, so an agent follows it unless it names another account.",
53
53
  },
54
54
  "zh-TW": {
55
- title: "帳號", hint: "這台主機上各 CLI 的登入:預設登入與具名帳號(憑證設定檔)、誰在使用,以及每週用量。",
55
+ title: "帳號", hint: "這台 AgEnD 主機與已配對電腦上各 CLI 的登入:預設登入與具名帳號(憑證設定檔)、誰在使用,以及每週用量。",
56
56
  loading: "正在讀取帳號…", failed: "無法讀取帳號。", empty: "這台主機上沒有安裝或被 Agent 使用的 CLI。",
57
57
  def: "預設登入", profile: "帳號「{0}」", state_usable: "已登入", state_not_signed_in: "尚未登入", state_unknown: "未確認",
58
58
  state_not_installed: "未安裝", state_too_old: "版本太舊",
59
59
  usedBy: "使用者:{0}", usedByNone: "沒有 Agent 使用", agents: "{0} 個 Agent", agent: "1 個 Agent", channels: "{0} 個 ClassicBot 房間", channel: "1 個 ClassicBot 房間",
60
60
  fleetDefaultTag: "Fleet 預設", weekly: "本週已用 {0}%", resets: "{0} 重置", stale: "最後已知",
61
- signIn: "登入", signInAgain: "重新登入", hostCommand: "在主機上登入", hostCommandHint: "請在執行 AgEnD 的主機終端機執行。",
61
+ signIn: "登入", signInAgain: "重新登入", hostCommand: "從聊天登入", hostCommandHint: "這一列無法從儀表板登入。請在聊天傳 /login,或請 General。",
62
62
  moveHere: "把 Agent 移到這裡…", moveTitle: "把 Agent 移到 {0}", moveLead: "選擇要改用 {1} 的 {0} Agent。按「儲存」後,各自會以它重新啟動:",
63
63
  carry_claude: "Claude Code 會帶著對話過去。", carry_codex: "Codex 保留原本的對話。", carry_kiro: "Kiro 會開新對話並附上交接。",
64
64
  moveNone: "所有 {0} Agent 都已經使用這個帳號。", moveStage: "加入待儲存", cancel: "取消", current: "目前:{0}",
@@ -161,6 +161,12 @@ export function accountChoices(view, backend) {
161
161
  * Settings → Agents → Accounts. `stageAgent(name, inst, patch)` and `stageDefault(backend, profile | null)` stage changes;
162
162
  * `openAgent(name)` (#3212 PR 2) opens an agent's own dialog, where its Account is chosen (Remove's Move…).
163
163
  */
164
+ // Ridge #3321 S08: the host's own group head, beside paired computers' "On <computer>".
165
+ register("accounts", {
166
+ en: { onHost: "On this AgEnD host" },
167
+ "zh-TW": { onHost: "在這台 AgEnD 主機上" },
168
+ });
169
+
164
170
  export function AccountsView({ instances, stageAgent, stageDefault, openAgent }) {
165
171
  const { loaded, failed, view } = useStore(accountsStore);
166
172
  // Settings read its data again (after a Save): so does this view.
@@ -189,7 +195,10 @@ export function AccountsView({ instances, stageAgent, stageDefault, openAgent })
189
195
  if (!loaded) return html`<section class="s-group s-accounts" aria-label=${tx("title")}>
190
196
  <header class="s-auth-section-head"><div><h3>${tx("title")}</h3><p>${tx("hint")}</p></div></header>
191
197
  <${Skeleton} variant="cards" lines=${2} label=${tx("loading")} /></section>`;
192
- if (failed && !view) return html`<p class="note" role="alert">${tx("failed")}</p>`;
198
+ // Ridge #3321 S07: a first read that fails keeps the section's heading and says so with Retry (the shared ErrorState).
199
+ if (failed && !view) return html`<section class="s-group s-accounts" aria-label=${tx("title")}>
200
+ <header class="s-auth-section-head"><div><h3>${tx("title")}</h3><p>${tx("hint")}</p></div></header>
201
+ <${ErrorState} message=${tx("failed")} onRetry=${() => void refreshAccounts({ fresh: true })} /></section>`;
193
202
  const clis = (view && view.clis) || [];
194
203
  return html`<section class="s-group s-accounts" aria-label=${tx("title")}>
195
204
  <header class="s-auth-section-head"><div><h3>${tx("title")}</h3><p>${tx("hint")}</p></div></header>
@@ -258,6 +267,8 @@ function Card({ cli, running, onMove, stageDefault, onAdd, onRemove, onSignIn, o
258
267
  return html`<div class="s-account-card" data-backend=${cli.backend}>
259
268
  <div class="s-account-head"><${CliProductMark} id=${cli.backend} size=${24} /><strong>${cliLabel(cli.backend)}</strong>
260
269
  ${cli.profiles && typeof onAdd === "function" ? html`<button type="button" class="btn btn-sm s-account-add" onClick=${() => onAdd()}>${manageWords.add()}</button>` : null}</div>
270
+ ${/* Ridge #3321 S08: beside paired computers' "On <computer>" groups, the host's rows are named as the host's too. */ ""}
271
+ ${machines.size && host.length ? html`<div class="s-account-machine-head s-account-host-head"><strong>${tx("onHost")}</strong></div>` : null}
261
272
  <div class="s-account-rows">${host.map((row) => html`<${Row} key=${row.profile || ""} cli=${cli} row=${row} running=${running} onMove=${onMove} onRemove=${onRemove} onSignIn=${onSignIn} onSignOut=${onSignOut} />`)}</div>
262
273
  ${[...machines.values()].map((m) => html`<${MachineSection} key=${m.scope.id} cli=${cli} m=${m} running=${running} onAdd=${onAdd} onSignIn=${onSignIn} onSignOut=${onSignOut} onRemove=${onRemove} />`)}
263
274
  ${cli.profiles && typeof stageDefault === "function" ? html`<label class="field s-account-default"><span>${tx("fleetDefault", cliLabel(cli.backend))}</span>
@@ -310,7 +321,7 @@ function Row({ cli, row, onMove, onRemove, onSignIn = openSignIn, onSignOut, run
310
321
  ${canSignOut ? html`<button type="button" class="btn btn-sm btn-ghost s-account-signout" disabled=${running} onClick=${() => onSignOut(row, "signout")}>${manageWords.signOut()}</button>` : null}
311
322
  ${manageable && row.profile && typeof onRemove === "function" ? html`<button type="button" class="btn btn-sm btn-ghost s-account-remove" onClick=${() => onRemove(row)}>${manageWords.remove()}</button>` : null}
312
323
  </span>`}
313
- ${!readOnly && !row.signIn && row.hostCommand ? html`<details class="s-host-cli-help"><summary>${machine ? tx("machineCommand") : tx("hostCommand")}</summary><p class="note">${machine ? tx("machineCommandHint", machine.name) : tx("hostCommandHint")}</p><p class="s-host-cli-command"><code>${row.hostCommand}</code></p></details>` : null}
324
+ ${!readOnly && !row.signIn && row.hostCommand ? html`<details class="s-host-cli-help"><summary>${machine ? tx("machineCommand") : tx("hostCommand")}</summary><p class="note">${machine ? tx("machineCommandHint", machine.name) : tx("hostCommandHint")}</p>${machine ? html`<p class="s-host-cli-command"><code>${row.hostCommand}</code></p>` : null}</details>` : null}
314
325
  ${!readOnly && row.keepAlive && (!row.scope || row.scope.kind === "host") ? html`<${KeepAliveControl} row=${row} onSaved=${() => refreshAccounts({ fresh: true })} />` : null}
315
326
  </div>`;
316
327
  }
@@ -10,6 +10,7 @@ import { t, register, lang, onLang } from "/assets/app-i18n.js";
10
10
  import { appStore, createStore, useStore } from "/assets/app-store.js";
11
11
  import { closeDialog, shellStore, showDialog } from "/assets/app-shell.js";
12
12
  import { Dialog } from "/assets/ui-dialog.js";
13
+ import { confirmDialog } from "/assets/ui-confirm.js";
13
14
  import { toast } from "/assets/ui-toast.js";
14
15
  import { mountStructuredSignIns } from "./structured-signin.js";
15
16
  import { CliProductMark, cliLabel } from "./cli-picker.js";
@@ -219,7 +220,9 @@ export function BrowserSignInDialog({ backend, backends, onClose }) {
219
220
  const root = useRef(null), close = onClose || closeDialog;
220
221
  useEffect(() => {
221
222
  let cards, last = "";
222
- cards = mountStructuredSignIns(root.current, { endpoint: "/ui/browser-backend-signins", lang, changed: next => {
223
+ // Ridge #3321 S01: "Sign in again" asks in the dashboard's own confirmation (its title names the CLI), not the browser's.
224
+ const ask = (message, cli) => confirmDialog({ title: t("signin.reloginTitle", cli), message, confirmLabel: t("signin.reloginGo") });
225
+ cards = mountStructuredSignIns(root.current, { endpoint: "/ui/browser-backend-signins", lang, ask, dashboard: true, changed: next => {
223
226
  if (backends) { if (backends.some(b => !next.selected.includes(b))) void cards.addBackends(backends); }
224
227
  else if (!next.selected.includes(backend)) void cards.addBackend(backend);
225
228
  const signature = JSON.stringify([next.login, next.pending]);
@@ -337,13 +340,13 @@ register("signin", {
337
340
  hostTitle: "CLI sign-ins", hostHint: "Accounts used by CLIs on the host running AgEnD.",
338
341
  hostBadge: "AgEnD host", hostProfile: "Credential profile: {0}", hostLoading: "Reading CLI sign-ins…", hostEmpty: "No CLI sign-ins were reported on this host.",
339
342
  installHelp: "Installation instructions", updateHelp: "Update instructions", hostHelp: "Sign-in instructions",
340
- commandHint: "Run these instructions in a terminal on the host running AgEnD.",
343
+ commandHint: "Use Sign in on this page, or send /login in chat.",
341
344
  },
342
345
  "zh-TW": {
343
346
  hostTitle: "CLI 登入", hostHint: "執行 AgEnD 的主機上,各個 CLI 使用的帳號。",
344
347
  hostBadge: "AgEnD 主機", hostProfile: "憑證設定檔:{0}", hostLoading: "正在讀取 CLI 登入狀態…", hostEmpty: "這台主機尚未回報 CLI 登入項目。",
345
348
  installHelp: "安裝說明", updateHelp: "更新說明", hostHelp: "登入說明",
346
- commandHint: "請在執行 AgEnD 的主機終端機中操作。",
349
+ commandHint: "請用這一頁的「登入」,或在聊天傳 /login。",
347
350
  },
348
351
  });
349
352
 
@@ -370,3 +373,9 @@ export function SignInList() {
370
373
  })}</div>`}
371
374
  </section>`;
372
375
  }
376
+
377
+ // Ridge #3321 S01: "Sign in again" — the dashboard's confirmation, titled with the CLI it is for.
378
+ register("signin", {
379
+ en: { reloginTitle: "Sign in to {0} again", reloginGo: "Sign in again" },
380
+ "zh-TW": { reloginTitle: "重新登入 {0}", reloginGo: "重新登入" },
381
+ });
@@ -34,10 +34,14 @@ export function GeneralLocation({ name, attentionOnly = false }) {
34
34
  };
35
35
  useEffect(() => { if (!guestPage()) void read(); }, [name, attentionKey]);
36
36
  if (guestPage()) return null;
37
- return html`<section id="general-location" class="card general-location"><h2>${tr("label")}</h2>
37
+ // alpha.6 feedback (#3): the same card as the Shared agent settings below it (card s-group: a title and its note, then
38
+ // labelled fields in the grid, then the actions) — not a heading, a bare inline select and a full-width button. A select
39
+ // is as wide as its longest option unless bounded: a paired PC's long name ran the card off the right edge.
40
+ const rows = (data?.generals || []).filter(row => !name || row.name === name);
41
+ return html`<section id="general-location" class="card s-group general-location"><div><h3>${tr("label")}</h3>${!attentionOnly ? html`<p class="note">${tr("history")}</p>` : null}</div>
38
42
  ${error ? html`<p role="alert">${error}</p>` : null}
39
- ${(data?.generals || []).filter(row => !name || row.name === name).map(row => html`<${LocationRow} key=${row.name + row.revision} row=${row} machines=${data.machines || []} attentionOnly=${attentionOnly} refresh=${read} />`)}
40
- ${!attentionOnly ? html`<button type="button" class="btn btn-sm" onClick=${read}>${t("settings.refresh")}</button>` : null}
43
+ ${rows.map(row => html`<${LocationRow} key=${row.name + row.revision} row=${row} machines=${data.machines || []} attentionOnly=${attentionOnly} refresh=${read} />`)}
44
+ ${!attentionOnly && !rows.length ? html`<div class="general-location-actions"><button type="button" class="btn btn-sm" onClick=${read}>${t("settings.refresh")}</button></div>` : null}
41
45
  </section>`;
42
46
  }
43
47
  function LocationRow({ row, machines, attentionOnly, refresh }) {
@@ -54,18 +58,28 @@ function LocationRow({ row, machines, attentionOnly, refresh }) {
54
58
  finally { flight.current = false; if (lease.current()) setBusy(false); }
55
59
  };
56
60
  if (attentionOnly && !row.offline && !row.hold) return null;
61
+ const id = `gl-${row.name}`;
62
+ const recover = row.canSwitchBack || row.hold === "start";
57
63
  return html`<div class="general-location-row" data-general=${row.name}>
58
- <strong>${row.displayName}</strong><p>${row.location === "host" ? tr("host") : `${machines.find(item => item.id === row.machineId)?.name || tr("windows")} · ${row.cli}`}</p>
64
+ <p class="general-location-now"><strong>${row.displayName}</strong><span>${row.location === "host" ? tr("host") : `${machines.find(item => item.id === row.machineId)?.name || tr("windows")} · ${row.cli}`}</span></p>
59
65
  ${row.offline || row.hold ? html`<p role="alert">${tr(row.hold || "offline")}</p>` : null}
60
- <p class="note">${tr("history")}</p>
61
- ${row.canSwitchBack ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose({ location: "host" })}>${tr("host")}</button>` : null}
62
- ${row.hold === "start" ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose(row.retryTarget || (row.location === "host" ? { location: "host" } : { location: "windows", machineId: row.machineId, cli: row.cli, model: row.model }))}>${t("chat.start")}</button>` : null}
63
- ${!attentionOnly ? html`<label>${tr("label")}<select value=${target} disabled=${busy || row.switching} onChange=${e => { setTarget(e.target.value); setModel(""); }}>
64
- <option value="host">${tr("host")}</option>${machines.map(item => html`<option value=${item.id} disabled=${!item.online}>${item.name}</option>`)}
65
- </select></label>
66
- ${target !== "host" ? html`<label>${t("settings.backend")}<select value=${cli} onChange=${e => { setCli(e.target.value); setModel(""); }}>
67
- ${["claude-code", "codex"].map(id => html`<option value=${id} disabled=${!machine?.clis.some(item => item.id === id)}>${id}</option>`)}
68
- </select></label><${ModelSelect} value=${model} onChange=${setModel} backend=${cli} runtime="windows" machineId=${target} instance=${row.name} />` : null}
69
- <button type="button" class="btn btn-primary" disabled=${busy || row.switching || target === "host" && !row.canSwitchBack || target !== "host" && (!machine?.online || !machine.clis.some(item => item.id === cli))} onClick=${() => propose(target === "host" ? { location: "host" } : { location: "windows", machineId: target, cli, model })}>${t("settings.save")}</button>` : null}
66
+ ${attentionOnly ? html`<p class="note">${tr("history")}</p>` : null}
67
+ ${recover ? html`<div class="general-location-actions">
68
+ ${row.canSwitchBack ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose({ location: "host" })}>${tr("host")}</button>` : null}
69
+ ${row.hold === "start" ? html`<button type="button" class="btn" disabled=${busy || row.switching} onClick=${() => propose(row.retryTarget || (row.location === "host" ? { location: "host" } : { location: "windows", machineId: row.machineId, cli: row.cli, model: row.model }))}>${t("chat.start")}</button>` : null}
70
+ </div>` : null}
71
+ ${!attentionOnly ? html`<div class="grid2">
72
+ <div class="field"><label for=${`${id}-target`}>${tr("label")}</label><select id=${`${id}-target`} value=${target} disabled=${busy || row.switching} onChange=${e => { setTarget(e.target.value); setModel(""); }}>
73
+ <option value="host">${tr("host")}</option>${machines.map(item => html`<option value=${item.id} disabled=${!item.online}>${item.name}</option>`)}
74
+ </select></div>
75
+ ${target !== "host" ? html`<div class="field"><label for=${`${id}-cli`}>${t("settings.backend")}</label><select id=${`${id}-cli`} value=${cli} onChange=${e => { setCli(e.target.value); setModel(""); }}>
76
+ ${["claude-code", "codex"].map(id => html`<option value=${id} disabled=${!machine?.clis.some(item => item.id === id)}>${id}</option>`)}
77
+ </select></div>` : null}
78
+ </div>
79
+ ${target !== "host" ? html`<${ModelSelect} value=${model} onChange=${setModel} backend=${cli} runtime="windows" machineId=${target} instance=${row.name} />` : null}
80
+ <div class="general-location-actions">
81
+ <button type="button" class="btn btn-sm" onClick=${refresh}>${t("settings.refresh")}</button>
82
+ <button type="button" class="btn btn-primary btn-sm" disabled=${busy || row.switching || target === "host" && !row.canSwitchBack || target !== "host" && (!machine?.online || !machine.clis.some(item => item.id === cli))} onClick=${() => propose(target === "host" ? { location: "host" } : { location: "windows", machineId: target, cli, model })}>${t("settings.save")}</button>
83
+ </div>` : null}
70
84
  </div>`;
71
85
  }
@@ -37,7 +37,8 @@ export function hubEntryToMessages(entry, room, { me = "", reason = (code) => co
37
37
  const id = entry.sequence * 2, out = [];
38
38
  // D: a Hub file in the shared thread's shape (hub-attachments.js); one the renderer cannot take is left out.
39
39
  const files = (list) => { const a = Array.isArray(list) ? list.map(hubFileAttachment).filter(Boolean) : []; return a.length ? { attachments: a } : {}; };
40
- out.push({ boot: "hub", id, role: "user", sender: me, ts: iso(entry.askedAt) ?? iso(at),
40
+ // A closed poll's tally is already in its widget. Its automatic agent prompt was not typed by the asker.
41
+ if (entry.pollResult !== true) out.push({ boot: "hub", id, role: "user", sender: me, ts: iso(entry.askedAt) ?? iso(at),
41
42
  text: entry.expired && entry.question === undefined ? "" : String(entry.question ?? ""), delivery: stageMark(stage),
42
43
  ...files(entry.questionFiles), ...(entry.quote ? { quote: entry.quote } : {}) });
43
44
  if (entry.answer !== undefined) {
@@ -0,0 +1,13 @@
1
+ // Grant feedback lives in a fresh module, including in a tab that cached the older owner dictionary.
2
+ import { register, t } from "/assets/app-i18n.js";
3
+ register("hubGrant", {
4
+ en: {
5
+ recipientRefused: "This account can't be allowed here. Check the sign-in name and that the account is active, then try again.",
6
+ directoryUnavailable: "The directory couldn't be checked. Try again later.",
7
+ },
8
+ "zh-TW": {
9
+ recipientRefused: "目前無法允許這個帳號。請確認登入名稱正確、帳號仍可使用,再試一次。",
10
+ directoryUnavailable: "目前無法查核目錄服務,請稍後再試。",
11
+ },
12
+ });
13
+ export const hg = (key, ...values) => t(`hubGrant.${key}`, ...values);
@@ -5,12 +5,14 @@ import { register, t } from "/assets/app-i18n.js";
5
5
 
6
6
  register("hubOwner", {
7
7
  en: {
8
+ memberAddress: "Member address", memberAddressHint: "Enter this address and the code in your fleet's Settings → Hub → Connect to a Hub. This is separate from the Hub's browser address.",
9
+ memberAddressMissing: "Ask the administrator for the member address; it may use a different port from this page.", copyHandoff: "Copy address and code", handoffCopied: "Address and code copied", handoffCopyFailed: "Couldn't copy. Select the address and code above to copy them.",
8
10
  active: "Active", adminLead: "Pair a fleet with this Hub and see the fleets that are paired. You can't read anyone's chats here.",
9
11
  allow: "Allow…", allowDays: "For", allowGo: "Allow", allowLogin: "Their sign-in name",
10
12
  allowLoginHint: "The account they sign in to this Hub with.", allowTitle: "Allow someone to ask {0}", approveGo: "Approve…",
11
13
  approvedTag: "Approved", backToMine: "My shared agents", codeFor: "Code for {0}", codeUnusedYet: "Not used yet", fleetOf: "{0}'s fleet",
12
14
  makeCode: "Make code", mayAsk: "{0} may ask", mayAskNone: "No one may ask yet", mayAskOne: "1 may ask",
13
- mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings → Access & security.",
15
+ mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings → Hub.",
14
16
  noFleets: "No fleet is paired yet.", ownerChecked: "The owner confirmed", ownerLogin: "Owner's sign-in name", pairSteps: "Pair a fleet",
15
17
  pairedFleets: "Paired fleets · {0}", pauseGo: "Pause…", pauseLead: "No one can ask it until it is shared again. What was asked stays readable.",
16
18
  pauseTitle: "Pause questions", pendingLead: "Check that this fingerprint matches the one your fleet shows, then confirm.",
@@ -24,10 +26,12 @@ register("hubOwner", {
24
26
  untilLeft: "until {0} ({1})", waitingOwner: "Waiting for the owner", whoMayAsk: "Who may ask",
25
27
  },
26
28
  "zh-TW": {
29
+ memberAddress: "成員連線位址", memberAddressHint: "在你 fleet 的「設定 → Hub → 連線到 Hub」輸入這個位址和配對碼。這與 Hub 的瀏覽器位址不同。",
30
+ memberAddressMissing: "請向管理員索取成員連線位址;它的連接埠可能與這個頁面不同。", copyHandoff: "複製位址與配對碼", handoffCopied: "已複製位址與配對碼", handoffCopyFailed: "無法複製。請選取上方的位址與配對碼來複製。",
27
31
  active: "使用中", adminLead: "把 fleet 配對到這個 Hub,並查看已配對的 fleet。這裡看不到任何人的對話。", allow: "允許提問…", allowDays: "期限", allowGo: "允許", allowLogin: "對方的登入名稱",
28
32
  allowLoginHint: "對方登入這個 Hub 用的帳號。", allowTitle: "允許提問 {0}", approveGo: "核准…", approvedTag: "已核准", backToMine: "我分享的 Agent",
29
33
  codeFor: "給 {0} 的配對碼", codeUnusedYet: "還沒使用", fleetOf: "{0} 的 fleet", makeCode: "產生配對碼", mayAsk: "{0} 人可以提問", mayAskNone: "還沒有人可以提問",
30
- mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 fleet 的 設定 → 存取與安全。", noFleets: "還沒有配對的 fleet。",
34
+ mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 fleet 的 設定 → Hub。", noFleets: "還沒有配對的 fleet。",
31
35
  ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 fleet", pairedFleets: "已配對的 fleet · {0}", pauseGo: "暫停…",
32
36
  pauseLead: "重新分享之前,沒有人能再提問。已經問過的內容仍然看得到。", pauseTitle: "暫停提問", pendingLead: "確認這個指紋和你 fleet 上顯示的一致,再按確認。", pendingPairings: "等你核對的配對",
33
37
  recent: "最近的提問", recentLead: "誰問的、什麼時候,有沒有回答。問了什麼留在你 fleet 的聊天裡。", recentNone: "還沒有人問過。", refresh: "重新整理", revokeItem: "撤銷…", revokedTag: "已撤銷",
@@ -5,13 +5,14 @@ import { register, t } from "/assets/app-i18n.js";
5
5
 
6
6
  register("hub", {
7
7
  en: {
8
+ allowOnHub: "Allow someone to ask…",
8
9
  preview: "Preview: the Hub connection isn't available in this build yet, so nothing here leaves this page.",
9
10
  // The member's switcher
10
11
  myFleet: "My fleet", hub: "Hub", openHubTab: "Open {0} in a new tab", switcher: "Workspace",
11
12
  // The Hub's own pages
12
13
  askTitle: "Ask", askEmpty: "No agents you can ask yet", askHint: "When an owner shares an agent with you, it appears here with who allowed it.",
13
14
  exposuresTitle: "My exposures", exposuresEmpty: "You don't share any agents yet",
14
- exposuresHint: "Share an agent from your own fleet: Settings → Access & security → Connect to a Hub.",
15
+ exposuresHint: "Share an agent from your own fleet: Settings → Hub → Connect to a Hub.",
15
16
  adminTitle: "Administration",
16
17
  // The Hub workspace (S3b): sign-in, Ask, My exposures, Administration
17
18
  signedOutHub: "Not signed in", signOut: "Sign out", signInTitle: "Sign in to the Hub",
@@ -79,11 +80,12 @@ register("hub", {
79
80
  errNotPaired: "Connect to a Hub first.", withdrawPending: "Withdrawn here. The Hub will be told when it can be reached.",
80
81
  },
81
82
  "zh-TW": {
83
+ allowOnHub: "允許他人提問…",
82
84
  preview: "預覽:這個版本還不能真正連線到 Hub,這裡的操作不會離開這個頁面。",
83
85
  myFleet: "我的 Fleet", hub: "Hub", openHubTab: "在新分頁開啟 {0}", switcher: "工作區",
84
86
  askTitle: "提問", askEmpty: "目前還沒有你可以提問的 Agent", askHint: "有人把 Agent 開放給你之後,它會出現在這裡,並註明是誰授權的。",
85
87
  exposuresTitle: "我的公開 Agent", exposuresEmpty: "你還沒有公開任何 Agent",
86
- exposuresHint: "請在自己的 Fleet 公開 Agent:設定 → 存取與安全 → 連線到 Hub。",
88
+ exposuresHint: "請在自己的 Fleet 公開 Agent:設定 → Hub → 連線到 Hub。",
87
89
  adminTitle: "管理",
88
90
  signedOutHub: "尚未登入", signOut: "登出", signInTitle: "登入 Hub",
89
91
  signInLead: "請使用組織帳號登入。密碼只送給目錄服務驗證,不會被保存。",
@@ -6,7 +6,7 @@
6
6
  // What people see is what the server says now: every list is read fresh, every change is checked again by the server
7
7
  // (who, the revision shown, the directory), and a conflict reloads the list instead of guessing.
8
8
  import { html, useEffect, useLayoutEffect, useMemo, useRef, useState } from "/assets/app-html.js";
9
- import { PanelHeader, setTitle } from "/assets/app-shell.js";
9
+ import { PanelHeader, closeDrawer, setTitle } from "/assets/app-shell.js";
10
10
  import { lang, t } from "/assets/app-i18n.js";
11
11
  import { createStore, useStore } from "/assets/app-store.js";
12
12
  import { navigate, navStore } from "/assets/app-nav.js";
@@ -26,6 +26,7 @@ import { compareGroups, hubClient } from "./hub-client.js";
26
26
  import { hw, linkHubCss } from "./hub-strings.js";
27
27
  import { hc, linkHubChatCss } from "./hub-chat-strings.js";
28
28
  import { ho, linkHubOwnerCss } from "./hub-owner-strings.js";
29
+ import { hg } from "./hub-grant-strings.js";
29
30
  import { createHubChatStore } from "./hub-chat-store.js";
30
31
  import { QuotaBanner, QuotaCard, QuotaChip, QuotaVisibilityRow } from "./hub-quota.js";
31
32
  import { PageHead } from "/assets/page-head.js";
@@ -82,8 +83,9 @@ export function HubPanel({ route }) {
82
83
  let body = tab === "ask" ? roomParam() ? html`<${HubRoomLoading} />`
83
84
  : html`<${PanelHeader} title=${hc("chats")} /><div class="hub-home"><${Skeleton} variant="rows" lines=${4} /></div>`
84
85
  : html`<${Skeleton} variant="rows" lines=${4} />`;
85
- if (s === null) body = html`<${HubSignIn} />`;
86
- else if (s) body = tab === "ask" ? html`<${HubChats} />` : tab === "exposures" ? html`<${HubMine} />` : html`<${HubAdmin} admin=${!!s.admin} />`;
86
+ // Signed out: the sign-in page alone (no panel header, no chat chrome).
87
+ if (s === null) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-signin"><${HubSignIn} /></div>`;
88
+ if (s) body = tab === "ask" ? html`<${HubChats} />` : tab === "exposures" ? html`<${HubMine} />` : html`<${HubAdmin} admin=${!!s.admin} />`;
87
89
  // The chats draw their own header (the room's); the other pages keep the panel's.
88
90
  if (s !== null && tab === "ask") return html`<div data-effect-panel="hub" class="panel p-hub p-hub-ask"><div data-trust="panel-content" class="panel-body hub-chat-body">${body}</div></div>`;
89
91
  // #3226 C: My shared agents and Administration are Settings-like pages (their own PageHead under the panel's header).
@@ -113,13 +115,44 @@ export function HubSessionMenu() {
113
115
  </div>`;
114
116
  }
115
117
 
118
+ /**
119
+ * alpha.6 feedback: the signed-out Hub is a sign-in page, in AgEnD's own sign-in style (signin.html: one centred card
120
+ * on the page's background, the brand, the fields, a primary button) — none of the chat app around it: while it is on
121
+ * screen the shell's sidebar and tabs are hidden (not just covered, so focus and screen readers skip them too).
122
+ * Its stylesheet is its own (/assets/hub-signin.css): a tab holding an older hub.css still draws it.
123
+ */
124
+ function linkHubSigninCss(doc = typeof document !== "undefined" ? document : null) {
125
+ try {
126
+ if (!doc || !doc.head || doc.querySelector('link[data-hub-signin-css="1"]')) return;
127
+ const link = doc.createElement("link");
128
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub-signin.css"); link.setAttribute("data-hub-signin-css", "1");
129
+ doc.head.appendChild(link);
130
+ } catch { /* the page still works without it */ }
131
+ }
116
132
  function HubSignIn() {
133
+ useEffect(() => {
134
+ linkHubSigninCss();
135
+ // #3318 review F1: signed out from the phone drawer's session menu (or a session that ended while it was open), the
136
+ // drawer would stay open with <main> inert under it — and this page, inside <main>, would take no input while the
137
+ // sidebar and scrim that used to close it are hidden or covered. The sign-in page closes it.
138
+ closeDrawer();
139
+ const body = typeof document !== "undefined" ? document.body : null;
140
+ if (body) body.classList.add("hub-signed-out");
141
+ return () => { if (body) body.classList.remove("hub-signed-out"); };
142
+ }, []);
143
+ const name = typeof document !== "undefined" ? (document.body.dataset.hubName || "") : "";
117
144
  const [form, setForm] = useState({ login: "", password: "" });
118
145
  const [busy, setBusy] = useState(false);
119
146
  const [msg, setMsg] = useState(null);
120
147
  const submit = async (e) => {
121
148
  e.preventDefault();
122
- if (busy || !form.login.trim() || !form.password) return;
149
+ if (busy) return;
150
+ // The button is always ready (a disabled one reads as grey, "broken"): an empty field just takes the focus.
151
+ if (!form.login.trim() || !form.password) {
152
+ const doc = typeof document !== "undefined" ? document : null;
153
+ doc?.getElementById(!form.login.trim() ? "hubLogin" : "hubPassword")?.focus();
154
+ return;
155
+ }
123
156
  setBusy(true); setMsg(null);
124
157
  const r = await hubClient().signIn(form.login.trim(), form.password);
125
158
  setBusy(false);
@@ -127,18 +160,21 @@ function HubSignIn() {
127
160
  setForm((f) => ({ ...f, password: "" }));
128
161
  setMsg(r.code === "backpressure" ? hw("errBusyHub") : r.code === "unavailable" ? hw("errDirectory") : hw("errSignIn"));
129
162
  };
130
- return html`<section class="card hub-signin">
131
- <h2>${hw("signInTitle")}</h2>
132
- <p class="note">${hw("signInLead")}</p>
133
- <form class="form" onSubmit=${submit}>
134
- <label class="field"><span>${hw("login")}</span><input id="hubLogin" autocomplete="username" spellcheck=${false} autocapitalize="none"
135
- value=${form.login} onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, login: v })); }} /></label>
136
- <label class="field"><span>${hw("password")}</span><input id="hubPassword" type="password" autocomplete="current-password"
137
- value=${form.password} onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, password: v })); }} /></label>
138
- <div class="field-row"><button type="submit" class="btn btn-primary" disabled=${busy || !form.login.trim() || !form.password}>${hw("signIn")}</button></div>
163
+ return html`<main class="hub-signin-page"><section class="hub-signin hub-signin-card" aria-labelledby="hubSignInTitle">
164
+ <div class="hub-signin-brand"><strong>${t("hubShell.brand")}</strong>${name ? html`<span>${name}</span>` : null}</div>
165
+ <h1 id="hubSignInTitle">${hw("signInTitle")}</h1>
166
+ <p class="hub-signin-lead">${hw("signInLead")}</p>
167
+ <form class="hub-signin-form" onSubmit=${submit}>
168
+ <label for="hubLogin">${hw("login")}</label>
169
+ <input id="hubLogin" autocomplete="username" spellcheck=${false} autocapitalize="none"
170
+ value=${form.login} onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, login: v })); }} />
171
+ <label for="hubPassword">${hw("password")}</label>
172
+ <input id="hubPassword" type="password" autocomplete="current-password"
173
+ value=${form.password} onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, password: v })); }} />
174
+ <button type="submit" class="hub-signin-go" disabled=${busy}>${hw("signIn")}</button>
139
175
  </form>
140
- ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
141
- </section>`;
176
+ <p class="hub-signin-msg" role=${msg ? "alert" : undefined}>${msg || ""}</p>
177
+ </section></main>`;
142
178
  }
143
179
 
144
180
  /** Load a list from the client; `reload` reads it again. null while loading, { error } on failure. */
@@ -539,10 +575,10 @@ function HubMine() {
539
575
  const [pairings, reloadPairings] = useRead(() => hubClient().pairings());
540
576
  const [msg, setMsg] = useState(null);
541
577
  useEffect(() => { linkHubChatCss(); linkHubOwnerCss(); }, []);
542
- const act = async (fn, after = reload) => {
578
+ const act = async (fn, after = reload, refused = (r) => setMsg(errText(r))) => {
543
579
  setMsg(null);
544
580
  const r = await fn();
545
- if (!r.ok) setMsg(errText(r));
581
+ if (!r.ok) refused(r);
546
582
  await after();
547
583
  return r;
548
584
  };
@@ -576,7 +612,9 @@ function HubMine() {
576
612
 
577
613
  /** One shared agent: who may ask (allow, revoke), whether askers see its quota (G), who asked lately, pause. */
578
614
  function HubAgentPage({ x, act, msg }) {
579
- const [allowing, setAllowing] = useState(false);
615
+ // #3338: this page is reached only through catalog.mine; the link opens a form, never a grant.
616
+ // Read the closed intent once on this keyed agent page, so cancel/save/reloads never reopen it.
617
+ const [allowing, setAllowing] = useState(() => x.state === "published" && new URLSearchParams(location.search).get("grant") === "1");
580
618
  const [activity, reloadActivity] = useRead(() => readActivity(x.id));
581
619
  const revoke = async (g) => {
582
620
  if (!(await confirmDialog({ message: hw("revokeAsk", g.subjectName || g.subjectLogin), confirmLabel: hw("revoke"), danger: true }))) return;
@@ -614,26 +652,30 @@ function HubAgentPage({ x, act, msg }) {
614
652
  ${shared ? html`<section class="card hub-danger"><h3>${ho("pauseTitle")}</h3><p class="note">${ho("pauseLead")}</p>
615
653
  <div class="field-row"><button type="button" class="btn btn-sm btn-danger" onClick=${freeze}>${ho("pauseGo")}</button></div></section>` : null}
616
654
  </div>
617
- ${allowing ? html`<${AllowDialog} x=${x} act=${act} onClose=${() => setAllowing(false)} />` : null}
655
+ ${allowing && shared ? html`<${AllowDialog} x=${x} act=${act} onClose=${() => setAllowing(false)} />` : null}
618
656
  </div>`;
619
657
  }
620
658
 
621
659
  function AllowDialog({ x, act, onClose }) {
622
660
  const [form, setForm] = useState({ login: "", days: 7 });
623
661
  const [busy, setBusy] = useState(false);
662
+ const [error, setError] = useState(null);
624
663
  const submit = async (e) => {
625
664
  e && e.preventDefault && e.preventDefault();
626
665
  if (busy || !form.login.trim()) return;
666
+ setError(null);
627
667
  setBusy(true);
628
- const r = await act(() => hubClient().grant({ exposureId: x.id, exposureRevision: x.revision, login: form.login.trim(), days: form.days }));
668
+ const r = await act(() => hubClient().grant({ exposureId: x.id, exposureRevision: x.revision, login: form.login.trim(), days: form.days }), undefined,
669
+ (r) => setError(r.code === "not-found" ? hg("recipientRefused") : r.code === "unavailable" ? hg("directoryUnavailable") : errText(r)));
629
670
  setBusy(false);
630
671
  if (r && r.ok) onClose();
631
672
  };
632
673
  return html`<${Dialog} title=${ho("allowTitle", x.displayName)} onClose=${onClose}
633
674
  actions=${html`<button type="button" class="btn" onClick=${onClose}>${hw("pickCancel")}</button><button type="button" class="btn btn-primary" disabled=${busy || !form.login.trim()} onClick=${submit}>${ho("allowGo")}</button>`}>
634
675
  <form class="form hub-grant" onSubmit=${submit}>
676
+ ${error ? html`<p class="err" role="alert">${error}</p>` : null}
635
677
  <label class="field"><span>${ho("allowLogin")}</span><input autocomplete="off" spellcheck=${false} autocapitalize="none" value=${form.login}
636
- onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, login: v })); }} /><small class="note">${ho("allowLoginHint")}</small></label>
678
+ onInput=${(e) => { const v = e.target.value; setError(null); setForm((f) => ({ ...f, login: v })); }} /><small class="note">${ho("allowLoginHint")}</small></label>
637
679
  <label class="field"><span>${ho("allowDays")}</span><select value=${String(form.days)} onChange=${(e) => { const v = Number(e.target.value); setForm((f) => ({ ...f, days: v })); }}>
638
680
  ${DAYS.map((d) => html`<option value=${String(d)}>${hw("days", d)}</option>`)}</select></label>
639
681
  </form>
@@ -657,7 +699,7 @@ function HubAdminPage() {
657
699
  setMsg(null);
658
700
  const r = await hubClient().createPairing(login.trim());
659
701
  if (!r.ok) { setMsg(errText(r)); return; }
660
- setOffer({ code: r.code, expiresAt: r.expiresAt, login: login.trim() }); setLogin(""); reload();
702
+ setOffer({ code: r.code, expiresAt: r.expiresAt, memberOrigin: r.memberOrigin, login: login.trim() }); setLogin(""); reload();
661
703
  };
662
704
  const approve = async (p) => {
663
705
  if (!(await confirmDialog({ message: hw("approveAsk", compareGroups(p.fingerprint)), confirmLabel: hw("approve") }))) return;
@@ -686,7 +728,10 @@ function HubAdminPage() {
686
728
  <li class=${offer || pairings.length ? "done" : "now"}><div class="hub-step-body"><span><b>${ho("stepCode")}</b><small class="note">${ho("stepCodeHint")}</small></span>
687
729
  <form class="hub-step-form" onSubmit=${create}><label class="field"><span class="sr-only">${ho("ownerLogin")}</span><input placeholder=${ho("ownerLogin")} autocomplete="off" spellcheck=${false} autocapitalize="none" value=${login} onInput=${(e) => setLogin(e.target.value)} /></label>
688
730
  <button type="submit" class="btn btn-sm" disabled=${!login.trim()}>${ho("makeCode")}</button></form>
689
- ${offer ? html`<div class="hub-offer" role="status"><small class="note">${ho("codeFor", offer.login)}</small><code class="hub-code">${offer.code}</code><small class="note">${hw("expires", when(offer.expiresAt))}</small></div>` : null}</div></li>
731
+ ${offer ? html`<div class="hub-offer" role="status"><small class="note">${ho("codeFor", offer.login)}</small><code class="hub-code">${offer.code}</code><small class="note">${hw("expires", when(offer.expiresAt))}</small>
732
+ ${offer.memberOrigin ? html`<div class="field"><span>${ho("memberAddress")}</span><span class="hub-origin"><code>${offer.memberOrigin}</code></span><small class="note">${ho("memberAddressHint")}</small></div>
733
+ <button type="button" class="btn btn-sm" onClick=${async () => { const ok = await copyText(`${ho("memberAddress")}: ${offer.memberOrigin}\n${ho("codeFor", offer.login)}: ${offer.code}\n${hw("expires", when(offer.expiresAt))}`); toast(ho(ok ? "handoffCopied" : "handoffCopyFailed"), !ok); }}><${Icon} name="copy" size=${14} />${ho("copyHandoff")}</button>`
734
+ : html`<small class="note">${ho("memberAddressMissing")}</small>`}</div>` : null}</div></li>
690
735
  <li class=${pairings.some((p) => p.ownerConfirmed) ? "done" : pairings.length ? "now" : ""}><div class="hub-step-body"><span><b>${ho("stepOwner")}</b><small class="note">${ho("stepOwnerHint")}</small></span></div></li>
691
736
  <li class=${pairings.some((p) => p.ownerConfirmed && !p.adminApproved) ? "now" : ""}><div class="hub-step-body"><span><b>${ho("stepApprove")}</b><small class="note">${ho("stepApproveHint")}</small></span></div></li>
692
737
  </ol>
@@ -29,7 +29,7 @@ register("log", {
29
29
  en: {
30
30
  offTitle: "The Log is off",
31
31
  offBody: "Turn it on to see each agent's work step by step: what it was asked, its replies, every tool call with its arguments and result, errors, and fleet events. It reads the agent's own transcript only while this tab is open, and masks secret values.",
32
- enable: "Turn on the Log", enabling: "Waiting for a fleet admin to confirm it in chat (General topic) or on the host…", enabled: "The Log is on.",
32
+ enable: "Turn on the Log", enabling: "Waiting for a fleet admin to confirm it — the confirmation card says where…", enabled: "The Log is on.",
33
33
  enableFailed: "The Log was not turned on: {0}", offPublic: "A fleet admin can turn it on in Settings → Web dashboard.",
34
34
  unsupported: "{0} has no transcript AgEnD can read, so this Log shows fleet events only. View shows its screen.",
35
35
  kiroWhy: "kiro's own steps are shown only when AgEnD can prove which conversation it is in now. {0} Fleet events are shown meanwhile.",
@@ -68,7 +68,7 @@ register("log", {
68
68
  "zh-TW": {
69
69
  offTitle: "紀錄未開啟",
70
70
  offBody: "開啟後可逐步看到每個 agent 的工作:收到的要求、回覆、每次工具呼叫的參數與結果、錯誤,以及 fleet 事件。只在這個分頁開著時讀取 agent 自己的對話紀錄,機密值會遮蔽。",
71
- enable: "開啟紀錄", enabling: "等待 fleet admin 在聊天(General topic)或主機上確認…", enabled: "紀錄已開啟。",
71
+ enable: "開啟紀錄", enabling: "等待 fleet admin 確認,確認卡片上有說明確認方式…", enabled: "紀錄已開啟。",
72
72
  enableFailed: "紀錄沒有開啟:{0}", offPublic: "fleet admin 可以在「設定 → 網頁儀表板」開啟。",
73
73
  unsupported: "{0} 沒有 AgEnD 讀得到的對話紀錄,所以這裡只顯示 fleet 事件。「檢視」可以看它的畫面。",
74
74
  kiroWhy: "只有在 AgEnD 能證明 kiro 目前所在的對話時,才會顯示它自己的步驟。{0}目前先顯示 fleet 事件。",