@songsid/agend 2.4.0-beta.22 → 2.4.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-cli-instructions.md +4 -3
- package/dist/agent-cli.js +32 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-file-read.js +2 -2
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-whats-new.js +17 -1
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.d.ts +2 -0
- package/dist/auth-api.js +5 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/web-authority.d.ts +17 -3
- package/dist/authority/web-authority.js +56 -3
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.d.ts +15 -0
- package/dist/backend/claude-code.js +8 -3
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-mcp-carry.d.ts +63 -0
- package/dist/backend/claude-mcp-carry.js +242 -0
- package/dist/backend/claude-mcp-carry.js.map +1 -0
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +15 -7
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +1 -1
- package/dist/classic-channel-manager.js +2 -2
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/config-validator.js +6 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/contact-auth-api.js +3 -1
- package/dist/contact-auth-api.js.map +1 -1
- package/dist/contact-auth-service.js +1 -1
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.d.ts +28 -2
- package/dist/contact-auth-store.js +72 -4
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-change-proposals.d.ts +18 -1
- package/dist/contact-change-proposals.js +38 -4
- package/dist/contact-change-proposals.js.map +1 -1
- package/dist/contact-state-view.d.ts +103 -0
- package/dist/contact-state-view.js +80 -0
- package/dist/contact-state-view.js.map +1 -0
- package/dist/daemon.d.ts +11 -0
- package/dist/daemon.js +66 -15
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +8 -0
- package/dist/dashboard-permissions.js +8 -0
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-outbox.d.ts +15 -1
- package/dist/delivery-outbox.js +60 -2
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +157 -15
- package/dist/fleet-manager.js +522 -78
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/admin/SKILL.md +52 -0
- package/dist/general-knowledge/skills/concepts/SKILL.md +31 -21
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +6 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -3
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +3 -3
- package/dist/general-knowledge/skills/hub/SKILL.md +6 -1
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
- package/dist/general-knowledge/skills/task-board/SKILL.md +17 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +75 -12
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/hub/client.js +6 -1
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +2 -1
- package/dist/hub/compose/member.js +3 -2
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +2 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.js +5 -0
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/protocol.d.ts +21 -0
- package/dist/hub/protocol.js +3 -0
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/question-close-model.d.ts +17 -0
- package/dist/hub/question-close-model.js +7 -0
- package/dist/hub/question-close-model.js.map +1 -0
- package/dist/hub/representative.d.ts +5 -0
- package/dist/hub/representative.js +51 -1
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/rooms/direct-view.js +1 -0
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +1 -1
- package/dist/hub/rooms.d.ts +3 -0
- package/dist/hub/rooms.js +27 -1
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/server.js +6 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +2 -2
- package/dist/human-delivery-receipts.d.ts +12 -2
- package/dist/human-delivery-receipts.js +19 -4
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +2 -0
- package/dist/instance-lifecycle.js +29 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +1 -1
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +110 -12
- package/dist/locale.js.map +1 -1
- package/dist/needs-you-hub.d.ts +3 -0
- package/dist/needs-you-hub.js +31 -5
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +16 -1
- package/dist/needs-you.js +7 -1
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +2 -2
- package/dist/office-share-page.js.map +1 -1
- package/dist/office-share.js +2 -1
- package/dist/office-share.js.map +1 -1
- package/dist/outbound-handlers.d.ts +4 -0
- package/dist/outbound-handlers.js +69 -11
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +5 -1
- package/dist/outbound-schemas.js +10 -7
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +21 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +2 -1
- package/dist/reply-buttons-controller.js +1 -1
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/request-context-compatibility.d.ts +20 -0
- package/dist/request-context-compatibility.js +74 -0
- package/dist/request-context-compatibility.js.map +1 -0
- package/dist/request-context-protocol.d.ts +137 -0
- package/dist/request-context-protocol.js +38 -0
- package/dist/request-context-protocol.js.map +1 -0
- package/dist/request-context-store.d.ts +25 -0
- package/dist/request-context-store.js +137 -0
- package/dist/request-context-store.js.map +1 -0
- package/dist/scheduler/db.js +26 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-text.d.ts +2 -0
- package/dist/scheduler/task-board-text.js +12 -0
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +102 -2
- package/dist/scheduler/task-board.js +242 -24
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/scheduler/task-files.d.ts +80 -0
- package/dist/scheduler/task-files.js +357 -0
- package/dist/scheduler/task-files.js.map +1 -0
- package/dist/settings-api.d.ts +2 -0
- package/dist/settings-api.js +6 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +1 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +5 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/task-attach-client.d.ts +43 -0
- package/dist/task-attach-client.js +125 -0
- package/dist/task-attach-client.js.map +1 -0
- package/dist/task-board-tool.d.ts +12 -0
- package/dist/task-board-tool.js +107 -6
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-file-limits.d.ts +15 -0
- package/dist/task-file-limits.js +21 -0
- package/dist/task-file-limits.js.map +1 -0
- package/dist/tool-permissions.d.ts +32 -0
- package/dist/tool-permissions.js +64 -1
- package/dist/tool-permissions.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/ui/accounts-keepalive.js +2 -1
- package/dist/ui/agent-details-settings.js +7 -5
- package/dist/ui/agent-who-can-use-strings.js +125 -0
- package/dist/ui/agent-who-can-use.js +238 -0
- package/dist/ui/chat-activity.js +2 -1
- package/dist/ui/chat-pins.js +2 -1
- package/dist/ui/claude-credentials.js +2 -1
- package/dist/ui/contact-auth-strings.js +28 -17
- package/dist/ui/contact-authorizations.js +6 -4
- package/dist/ui/contact-needs.js +6 -1
- package/dist/ui/contact-permissions.js +6 -4
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/contact-verify-need.js +46 -0
- package/dist/ui/fleet-cache.js +2 -1
- package/dist/ui/fleet-office-card.js +23 -5
- package/dist/ui/fleet-office-editor.js +5 -5
- package/dist/ui/fleet-office-pack.d.ts +10 -0
- package/dist/ui/fleet-office-pack.js +65 -2
- package/dist/ui/fleet-office-skin.js +52 -14
- package/dist/ui/fleet-office-store.js +33 -2
- package/dist/ui/fleet-office-vehicles.js +130 -0
- package/dist/ui/fleet-office-zones.js +27 -10
- package/dist/ui/fleet-office.js +128 -40
- package/dist/ui/fleet-org.js +6 -1
- package/dist/ui/fleet-tab-icons.js +19 -0
- package/dist/ui/fleet-task-activity.js +11 -83
- package/dist/ui/fleet-task-archive.js +111 -0
- package/dist/ui/fleet-task-card.js +6 -4
- package/dist/ui/fleet-task-common.js +2 -2
- package/dist/ui/fleet-task-edit.js +8 -1
- package/dist/ui/fleet-task-files.js +196 -0
- package/dist/ui/fleet-task-md.js +98 -0
- package/dist/ui/fleet-task-menu.js +1 -1
- package/dist/ui/fleet-task-stats.js +2 -2
- package/dist/ui/fleet-task-view.js +14 -9
- package/dist/ui/fleet-tasks.js +42 -18
- package/dist/ui/fleet-usage.js +2 -1
- package/dist/ui/hub-admin-overview.js +2 -1
- package/dist/ui/hub-agent-intro.js +2 -1
- package/dist/ui/hub-assistant-admin.js +2 -1
- package/dist/ui/hub-directory-notices.js +2 -1
- package/dist/ui/hub-enrolment-code.js +2 -1
- package/dist/ui/hub-my-agents.js +2 -1
- package/dist/ui/hub-quick-pairing.js +2 -1
- package/dist/ui/hub-role-audit.js +2 -1
- package/dist/ui/hub-role-forms.js +3 -2
- package/dist/ui/hub-role-view.js +3 -2
- package/dist/ui/hub-roles.js +2 -1
- package/dist/ui/hub-room-agent-strings.js +2 -1
- package/dist/ui/hub-room-list.js +2 -1
- package/dist/ui/hub-room-owner-requests.js +2 -1
- package/dist/ui/hub-room-pins.js +2 -1
- package/dist/ui/hub-room-strings.js +2 -2
- package/dist/ui/hub-room-thread.js +1 -1
- package/dist/ui/log-row.js +4 -3
- package/dist/ui/office-share-dialog.js +2 -1
- package/dist/ui/office-share-page.js +2 -1
- package/dist/ui/page-share-dialog.js +3 -2
- package/dist/ui/panel-chat.js +2 -1
- package/dist/ui/panel-details.js +5 -2
- package/dist/ui/panel-fleet.js +10 -5
- package/dist/ui/panel-hub.js +2 -1
- package/dist/ui/panel-needs.js +34 -6
- package/dist/ui/panel-notices.js +2 -1
- package/dist/ui/panel-runtimes.js +2 -1
- package/dist/ui/panel-settings.js +15 -1
- package/dist/ui/panel-windows-cli.js +3 -2
- package/dist/ui/runtime-cli-install.js +2 -1
- package/dist/ui/settings-appearance.js +2 -1
- package/dist/ui/settings-guests.js +4 -3
- package/dist/ui/settings-hub-member-address.js +2 -1
- package/dist/ui/settings-hub-setup.js +2 -1
- package/dist/ui/settings-hub-web-address.js +2 -1
- package/dist/ui/settings-hub.js +2 -1
- package/dist/ui/settings-registry.js +1 -0
- package/dist/ui/settings-shared-strings.js +9 -0
- package/dist/ui/settings-shared.js +6 -1
- package/dist/ui/settings-update.js +2 -1
- package/dist/ui/settings-web-authority.js +2 -1
- package/dist/ui/shared/agent-sheet.js +2 -1
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +8 -1
- package/dist/ui/shared/app-session.js +4 -3
- package/dist/ui/shared/app-shell.js +6 -2
- package/dist/ui/shared/app.css +93 -11
- package/dist/ui/shared/chat-strings.js +4 -4
- package/dist/ui/shared/chat-time.js +7 -4
- package/dist/ui/shared/clock-text.js +57 -0
- package/dist/ui/shared/device-roles.js +6 -5
- package/dist/ui/shared/instance-nav.js +17 -22
- package/dist/ui/shared/task-board.css +64 -0
- package/dist/ui/shared/usage-dialog.js +2 -1
- package/dist/ui/shared/view-strings.js +0 -14
- package/dist/ui/shared/web-authorize.js +3 -2
- package/dist/ui/subagent-row.js +2 -1
- package/dist/web-api.d.ts +18 -2
- package/dist/web-api.js +159 -27
- package/dist/web-api.js.map +1 -1
- package/dist/web-login.d.ts +6 -1
- package/dist/web-login.js +8 -3
- package/dist/web-login.js.map +1 -1
- package/dist/web-office-acts.d.ts +16 -0
- package/dist/web-office-acts.js +27 -9
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-office-pack-read.js +1 -1
- package/dist/web-office-pack-read.js.map +1 -1
- package/dist/web-office-skins.d.ts +5 -3
- package/dist/web-office-skins.js +20 -16
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-session-authorization.d.ts +3 -0
- package/dist/web-session-authorization.js +1 -1
- package/dist/web-session-authorization.js.map +1 -1
- package/dist/web-settings-patch.d.ts +27 -0
- package/dist/web-settings-patch.js +67 -0
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/workflow-templates/default.md +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// M-3734 (#4459, the user's 2X): the words of an agent page's "Who can use" (agent-who-can-use.js). Their own module and
|
|
2
|
+
// namespace: a tab that still holds an older strings module gets these too (upgrade skew). The guest levels, the people
|
|
3
|
+
// search and the sign-in state keep Settings → Guests' own words (settings.*), so both places say the same thing.
|
|
4
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
5
|
+
|
|
6
|
+
register("agentWhoCanUse", {
|
|
7
|
+
en: {
|
|
8
|
+
tab: "Who can use",
|
|
9
|
+
lead: "Who can chat with this agent on the web as a guest, and who may ask it on the Hub.",
|
|
10
|
+
adminsNote: "Fleet admins can always use every agent. Who can talk to the bot in Discord or Telegram is the bot's own setting (its allowed users) and isn't changed here.",
|
|
11
|
+
agentLabel: "{0} ({1})",
|
|
12
|
+
guestsTitle: "Web guests",
|
|
13
|
+
guestsLead: "People you let sign in to this dashboard as guests. It's the same list as Settings → Guests: a change made in either place shows in both.",
|
|
14
|
+
openGuests: "Open Settings → Guests",
|
|
15
|
+
guestsOff: "Guest sign-in is off, so no one below can sign in until it's turned on in Settings → Guests.",
|
|
16
|
+
notAdmin: "Only a fleet admin can see and change who can use this agent.",
|
|
17
|
+
notGrantable: "Guests can't be given this agent.",
|
|
18
|
+
none: "No guest can use this agent.",
|
|
19
|
+
derived: "Right now guests can use the agents they've talked to in chat. Nothing is chosen per agent yet, so this list can't be changed.",
|
|
20
|
+
convertHint: "“Start from today's guests” saves that access as each guest's own choices: everyone keeps exactly the agents they can use now, nothing more. After that, a guest can use this agent only if you add them here or in Settings → Guests. Saving it needs a fleet admin's confirmation, like adding someone.",
|
|
21
|
+
derivedList: "Can use it today:",
|
|
22
|
+
convert: "Start from today's guests",
|
|
23
|
+
convertTitle: "Choose who can use each agent?",
|
|
24
|
+
convertConfirm: "Each guest keeps exactly the agents they can use now. After this, a guest can use an agent only when you add them to it. Saving it needs a fleet admin's confirmation.",
|
|
25
|
+
levelAll: "{0}'s level (Chat or Trusted) applies to all {1} agents they can use, not only this one.",
|
|
26
|
+
changed: "This person's access changed since this list was read, so nothing was saved. The list is up to date now: check it and try again.",
|
|
27
|
+
changedAll: "Guests' access changed since this list was read, so nothing was saved. The list is up to date now: check it and try again.",
|
|
28
|
+
alsoUses: "Can also use: {0}",
|
|
29
|
+
level: "Level",
|
|
30
|
+
remove: "Remove",
|
|
31
|
+
removeTitle: "Remove {0}?",
|
|
32
|
+
removeConfirm: "{0} will no longer be able to use {1}.",
|
|
33
|
+
removeLast: "{0} will no longer be able to use {1}. It's the only agent they can use, so their guest access ends and they're signed out.",
|
|
34
|
+
add: "Add a person",
|
|
35
|
+
addHint: "People who have messaged one of your agents in Discord or Telegram. Fleet admins aren't listed: they can already use every agent.",
|
|
36
|
+
addMissing: "Not in the list? Ask them to send any of your agents a message once, then look again.",
|
|
37
|
+
addConfirm: "Adding someone, or making them Trusted, needs a fleet admin's confirmation. Signed in here as an admin, you can confirm it yourself on the confirm card at the top of this page (Apply now, or your authenticator code if you require one). Otherwise an admin presses Confirm on the card in General.",
|
|
38
|
+
searchLabel: "Search people who have messaged your agents",
|
|
39
|
+
noPeople: "No one matches. A person must have messaged one of your agents first.",
|
|
40
|
+
trustedHint: "Trusted can also watch these agents' screens (read-only) and search their chats. The screen shows everything the agent's terminal does: other people's messages to it, commands and their output, which can include secrets. Chat and search stay limited to what this person may see.",
|
|
41
|
+
addOne: "Add",
|
|
42
|
+
searchShort: "Search by name",
|
|
43
|
+
adding: "Adding…",
|
|
44
|
+
waiting: "Sent for confirmation: confirm it on the card at the top of this page (or in General). It applies once confirmed.",
|
|
45
|
+
saved: "Saved.",
|
|
46
|
+
saveFailed: "Couldn't save: {0}",
|
|
47
|
+
refused: "AgEnD can't give this person access: {0}",
|
|
48
|
+
unknown: "The change isn't confirmed. Check the list before trying again.",
|
|
49
|
+
hubTitle: "Hub",
|
|
50
|
+
hubLead: "Who may ask this agent on the Hub (people or directory groups, each until a date you choose) is set on the Hub itself.",
|
|
51
|
+
hubWhere: "“Choose who may ask on the Hub” opens the Hub's own page. That page opens only on the internal network: it won't open outside the internal network (for example, at home).",
|
|
52
|
+
hubChoose: "Choose who may ask on the Hub",
|
|
53
|
+
hubSettings: "Open Settings → Hub",
|
|
54
|
+
hubNone: "This Fleet isn't connected to a Hub.",
|
|
55
|
+
hubNotPaired: "This Fleet isn't connected to its Hub right now.",
|
|
56
|
+
hubOffline: "This Fleet can't reach its Hub right now. The Hub page may still open where the Hub can be reached.",
|
|
57
|
+
hubNotShared: "This agent isn't shared on the Hub, so no one there can ask it. Share it in Settings → Hub first.",
|
|
58
|
+
hubPending: "Sharing this agent is waiting for confirmation.",
|
|
59
|
+
hubLapsed: "This agent's share needs renewing: use Share again in Settings → Hub.",
|
|
60
|
+
hubRefused: "The Hub refused this agent's share. See Settings → Hub.",
|
|
61
|
+
hubFrozen: "This agent's share is paused on the Hub.",
|
|
62
|
+
hubShared: "Shared on the Hub.",
|
|
63
|
+
hubLoadFailed: "Couldn't read this agent's Hub sharing.",
|
|
64
|
+
},
|
|
65
|
+
"zh-TW": {
|
|
66
|
+
tab: "誰能用",
|
|
67
|
+
lead: "誰能以訪客身分在網頁上和這個 Agent 聊天,以及誰可以在 Hub 上問它。",
|
|
68
|
+
adminsNote: "Fleet 管理員一律可以使用每個 Agent。誰能在 Discord 或 Telegram 和機器人對話是機器人本身的設定(允許的使用者),這裡不會改動。",
|
|
69
|
+
agentLabel: "{0}({1})",
|
|
70
|
+
guestsTitle: "網頁訪客",
|
|
71
|
+
guestsLead: "你允許以訪客身分登入這個儀表板的人。和「設定 → 訪客」是同一份清單:在任一處修改,兩邊都會看到。",
|
|
72
|
+
openGuests: "開啟「設定 → 訪客」",
|
|
73
|
+
guestsOff: "訪客登入目前關閉,下面的人都要等到在「設定 → 訪客」開啟後才能登入。",
|
|
74
|
+
notAdmin: "只有 Fleet 管理員可以查看和修改誰能用這個 Agent。",
|
|
75
|
+
notGrantable: "這個 Agent 無法開放給訪客。",
|
|
76
|
+
none: "目前沒有訪客可以使用這個 Agent。",
|
|
77
|
+
derived: "目前訪客可以使用他們在聊天中互動過的 Agent。還沒有逐一選擇,所以這份名單無法修改。",
|
|
78
|
+
convertHint: "按「從現有訪客開始」會把這些存取存成每位訪客自己的授權:每個人都只保留他們現在能用的 Agent,不會多。之後,訪客只有在你從這裡或「設定 → 訪客」加入後,才能使用這個 Agent。儲存前需要 Fleet 管理員確認,和新增人員一樣。",
|
|
79
|
+
derivedList: "目前能用的人:",
|
|
80
|
+
convert: "從現有訪客開始",
|
|
81
|
+
convertTitle: "要改成逐一選擇誰能用每個 Agent 嗎?",
|
|
82
|
+
convertConfirm: "每位訪客都保留他們現在能用的 Agent。之後,訪客只有在你把他們加進某個 Agent 時才能使用它。儲存前需要 Fleet 管理員確認。",
|
|
83
|
+
levelAll: "{0} 的等級(聊天或信任)套用到他們能用的全部 {1} 個 Agent,不只這一個。",
|
|
84
|
+
changed: "這個人的權限在讀取清單後有變動,所以沒有儲存。清單已更新:請確認後再試一次。",
|
|
85
|
+
changedAll: "訪客的權限在讀取清單後有變動,所以沒有儲存。清單已更新:請確認後再試一次。",
|
|
86
|
+
alsoUses: "也可以用:{0}",
|
|
87
|
+
level: "等級",
|
|
88
|
+
remove: "移除",
|
|
89
|
+
removeTitle: "要移除 {0} 嗎?",
|
|
90
|
+
removeConfirm: "{0} 將無法再使用 {1}。",
|
|
91
|
+
removeLast: "{0} 將無法再使用 {1}。這是他們唯一能用的 Agent,所以他們的訪客權限會結束並被登出。",
|
|
92
|
+
add: "新增人員",
|
|
93
|
+
addHint: "在 Discord 或 Telegram 傳過訊息給你任一個 Agent 的人。Fleet 管理員不會列出,因為他們本來就能用每個 Agent。",
|
|
94
|
+
addMissing: "名單裡沒有?請對方先傳一則訊息給你任一個 Agent,再回來看。",
|
|
95
|
+
addConfirm: "新增人員或改為「信任」需要 Fleet 管理員確認。你在這裡以管理員身分登入時,可以在本頁上方的確認卡自己確認(按「立即套用」,或輸入驗證器 App 的 6 位數驗證碼);否則由管理員在 General 的確認卡上按「確認」。",
|
|
96
|
+
searchLabel: "搜尋傳過訊息給你的 Agent 的人",
|
|
97
|
+
noPeople: "沒有符合的人。對方必須先傳過訊息給你的某個 Agent。",
|
|
98
|
+
trustedHint: "信任另外可以:觀看這些 Agent 的畫面(唯讀),以及搜尋它們的聊天。畫面會顯示 Agent 終端上的一切:別人傳給它的訊息、指令和它們的輸出,其中可能有機密。聊天和搜尋仍只限這個人看得到的內容。",
|
|
99
|
+
addOne: "新增",
|
|
100
|
+
searchShort: "以名稱搜尋",
|
|
101
|
+
adding: "新增中…",
|
|
102
|
+
waiting: "已送出確認:請在本頁上方的確認卡(或 General)確認,確認後才會套用。",
|
|
103
|
+
saved: "已儲存。",
|
|
104
|
+
saveFailed: "無法儲存:{0}",
|
|
105
|
+
refused: "AgEnD 無法開放權限給這個人:{0}",
|
|
106
|
+
unknown: "尚未確認變更,請先檢查清單再試一次。",
|
|
107
|
+
hubTitle: "Hub",
|
|
108
|
+
hubLead: "誰可以在 Hub 上問這個 Agent(人或目錄群組,各自有你選的到期日)是在 Hub 上設定的。",
|
|
109
|
+
hubWhere: "「到 Hub 選擇誰可以問」會開啟 Hub 自己的頁面。這個頁面只在內部網路內打得開,在內部網路以外(例如在家)打不開。",
|
|
110
|
+
hubChoose: "到 Hub 選擇誰可以問",
|
|
111
|
+
hubSettings: "開啟「設定 → Hub」",
|
|
112
|
+
hubNone: "這個 Fleet 沒有連接 Hub。",
|
|
113
|
+
hubNotPaired: "這個 Fleet 目前沒有連上它的 Hub。",
|
|
114
|
+
hubOffline: "這個 Fleet 目前連不到它的 Hub。在連得到 Hub 的地方,Hub 頁面可能仍然打得開。",
|
|
115
|
+
hubNotShared: "這個 Agent 沒有在 Hub 上分享,所以 Hub 上沒有人能問它。請先在「設定 → Hub」分享它。",
|
|
116
|
+
hubPending: "分享這個 Agent 正在等待確認。",
|
|
117
|
+
hubLapsed: "這個 Agent 的分享需要更新:請在「設定 → Hub」按「重新分享」。",
|
|
118
|
+
hubRefused: "Hub 拒絕了這個 Agent 的分享。請看「設定 → Hub」。",
|
|
119
|
+
hubFrozen: "這個 Agent 的分享在 Hub 上已暫停。",
|
|
120
|
+
hubShared: "已在 Hub 上分享。",
|
|
121
|
+
hubLoadFailed: "無法讀取這個 Agent 在 Hub 上的分享狀態。",
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export const wc = (k, ...v) => t(`agentWhoCanUse.${k}`, ...v);
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// M-3734 (#4459, the user's 2X): an agent page's "Who can use" (agent-details-settings.js, category "access"). One place
|
|
2
|
+
// that lists and edits the two existing records of who can use this agent — no third permission model:
|
|
3
|
+
// - Web guests: web.guests.grants (Settings → Guests' own data, read with GET /api/settings/guests). Each change writes one
|
|
4
|
+
// person's whole grant with PUT /api/settings/fleet/web { guests: { grants: { <account>: grant | null } } } — the same
|
|
5
|
+
// write as Settings → Guests' Save, through the same Settings confirmation: adding a person or an agent, or making them
|
|
6
|
+
// Trusted, waits for a fleet admin (202, followed by settings-confirm.js); taking away applies at once. Each write is made
|
|
7
|
+
// from the grant this page shows and carries it as `if_grants` (Prism #4461 P2): the server refuses it (409) when that
|
|
8
|
+
// grant changed since — checked as it is admitted and again as it applies after a confirmation — so a change made
|
|
9
|
+
// meanwhile in Settings → Guests is never written over, and Remove's question is about exactly what is written.
|
|
10
|
+
// While the fleet still uses #1920's derived access (no grants saved), the list is read-only, and "Start from today's
|
|
11
|
+
// guests" saves each guest's current reach as a grant (Settings → Guests' own button, one write here, `if_grants: "unset"`):
|
|
12
|
+
// the server takes it only while it is exactly each guest's derived access then (Prism #4461 R1) — never access narrowed since.
|
|
13
|
+
// - Hub: who may ask is kept only on the Hub (its grants: people or AD groups, each with an expiry); the Fleet never reads
|
|
14
|
+
// or writes it. This says whether the agent is shared and links to the Hub page that chooses who may ask
|
|
15
|
+
// (`?agent=<exposureId>&grant=1`, as Settings → Hub does) — on the Hub's own address, so only where the Hub is reachable.
|
|
16
|
+
// Discord / Telegram allowed_users is the whole bot's setting and stays as it is. Its own reads and writes (like
|
|
17
|
+
// Permissions, contact-permissions.js) — never staged with the page's settings Save. The server decides who may see or
|
|
18
|
+
// change anything: a session that isn't a fleet admin's gets 403 and is told so.
|
|
19
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
20
|
+
import { t } from "/assets/app-i18n.js";
|
|
21
|
+
import { Skeleton } from "/assets/ui-states.js";
|
|
22
|
+
import { toast } from "/assets/ui-toast.js";
|
|
23
|
+
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
24
|
+
import { settingsPath } from "/assets/app-route.js";
|
|
25
|
+
import { api, confirmedWrite } from "./settings-confirm.js";
|
|
26
|
+
import "./settings-strings.js";
|
|
27
|
+
import { hubClient, hubMarks, safeWebOrigin } from "./hub-client.js";
|
|
28
|
+
import { wc } from "./agent-who-can-use-strings.js";
|
|
29
|
+
|
|
30
|
+
const tn = (k, ...v) => t(`settings.${k}`, ...v);
|
|
31
|
+
const PLATFORMS = { discord: "Discord", telegram: "Telegram" };
|
|
32
|
+
const accountKey = (g) => `${g.adapterId}:${g.userId}`;
|
|
33
|
+
const levelOf = (g) => (g && g.level === "trusted" ? "trusted" : "chat");
|
|
34
|
+
/** A grant as written: chat is the default level, never written (settings-guests.js grantOf). */
|
|
35
|
+
export const grantOf = (v) => ({ ...(v.name ? { name: v.name } : {}), instances: [...v.instances], ...(v.level === "trusted" ? { level: "trusted" } : {}) });
|
|
36
|
+
const GUESTS_URL = "/api/settings/guests";
|
|
37
|
+
const WRITE_URL = "/api/settings/fleet/web";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The people this page lists for `name`, from the guests overview: with grants saved, each one whose grant names it (`editable`);
|
|
41
|
+
* before that (#1920's derived access), each guest who can use it today, read-only.
|
|
42
|
+
*/
|
|
43
|
+
export function whoCanUse(overview, name) {
|
|
44
|
+
const guests = (overview && Array.isArray(overview.guests) && overview.guests) || [];
|
|
45
|
+
if (overview && overview.explicit) return guests.filter((g) => g.grant && Array.isArray(g.grant.instances) && g.grant.instances.includes(name));
|
|
46
|
+
return guests.filter((g) => Array.isArray(g.scope) && g.scope.includes(name));
|
|
47
|
+
}
|
|
48
|
+
/** Whether a guest may be given `name` at all: one of fleet.yaml's instances, or a ClassicBot room (#2667). */
|
|
49
|
+
export const grantable = (overview, name) => !!overview && ((overview.instances || []).includes(name) || (overview.rooms || []).some((r) => r.name === name));
|
|
50
|
+
/** Each guest's current reach as a grant — Settings → Guests' "Start from today's guests". */
|
|
51
|
+
export function todaysGrants(overview) {
|
|
52
|
+
const out = {};
|
|
53
|
+
for (const g of (overview && overview.guests) || []) if (Array.isArray(g.scope) && g.scope.length) out[accountKey(g)] = { ...(g.name ? { name: g.name } : {}), instances: [...g.scope] };
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* One person's grant after a change on this page, from the grant saved now (null: none): "add" adds `name` (a new grant
|
|
58
|
+
* when there is none, at the Chat level), "remove" takes it away (no agent left: the grant goes, null), "level" sets it.
|
|
59
|
+
*/
|
|
60
|
+
export function nextGrant(saved, name, change, extra = {}) {
|
|
61
|
+
const base = saved ? grantOf(saved) : { ...(extra.name ? { name: extra.name } : {}), instances: [] };
|
|
62
|
+
if (change === "add") return base.instances.includes(name) ? base : { ...base, instances: [...base.instances, name] };
|
|
63
|
+
if (change === "remove") { const instances = base.instances.filter((n) => n !== name); return instances.length ? { ...base, instances } : null; }
|
|
64
|
+
if (change === "level") return saved ? grantOf({ ...base, level: extra.level === "trusted" ? "trusted" : undefined }) : null;
|
|
65
|
+
return base;
|
|
66
|
+
}
|
|
67
|
+
const roomName = (overview, n) => { const r = ((overview && overview.rooms) || []).find((x) => x.name === n); return (r && r.display_name) || n; };
|
|
68
|
+
|
|
69
|
+
export function WhoCanUsePanel({ name, display }) {
|
|
70
|
+
// The agent as people know it — its display name, with the name the page heading uses beside it when they differ.
|
|
71
|
+
const shown = display && display !== name ? wc("agentLabel", display, name) : name;
|
|
72
|
+
return html`<div class="ap-who">
|
|
73
|
+
<p class="note ap-who-admins">${wc("adminsNote")}</p>
|
|
74
|
+
<${GuestsCard} name=${name} shown=${shown} />
|
|
75
|
+
<${HubCard} name=${name} />
|
|
76
|
+
</div>`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function GuestsCard({ name, shown }) {
|
|
80
|
+
const [overview, setOverview] = useState(null), [state, setState] = useState("loading"); // loading | ready | denied | failed
|
|
81
|
+
const [people, setPeople] = useState(null), [query, setQuery] = useState("");
|
|
82
|
+
const [busy, setBusy] = useState(null), [msg, setMsg] = useState(null);
|
|
83
|
+
const live = useRef(true), seq = useRef(0);
|
|
84
|
+
const read = async () => {
|
|
85
|
+
const n = ++seq.current;
|
|
86
|
+
let r = null;
|
|
87
|
+
try { r = await api(GUESTS_URL); } catch { r = null; }
|
|
88
|
+
if (!live.current || n !== seq.current) return null;
|
|
89
|
+
if (r && r.ok && r.body) { setOverview(r.body); setState("ready"); return r.body; }
|
|
90
|
+
setState(r && (r.status === 401 || r.status === 403) ? "denied" : "failed");
|
|
91
|
+
return null;
|
|
92
|
+
};
|
|
93
|
+
const readPeople = async () => {
|
|
94
|
+
let r = null;
|
|
95
|
+
try { r = await api(`${GUESTS_URL}/people`); } catch { r = null; }
|
|
96
|
+
if (live.current) setPeople(r && r.ok && r.body && Array.isArray(r.body.people) ? r.body.people : []);
|
|
97
|
+
};
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
live.current = true; void read();
|
|
100
|
+
const onShow = () => { if (document.visibilityState === "visible") void read(); };
|
|
101
|
+
document.addEventListener("visibilitychange", onShow);
|
|
102
|
+
return () => { live.current = false; seq.current++; document.removeEventListener("visibilitychange", onShow); };
|
|
103
|
+
}, [name]);
|
|
104
|
+
|
|
105
|
+
/** One write of Settings → Guests' own shape; `body` is the guests patch. Says how it went. */
|
|
106
|
+
const write = async (key, guests) => {
|
|
107
|
+
setBusy(key); setMsg(null);
|
|
108
|
+
try {
|
|
109
|
+
const r = await confirmedWrite(WRITE_URL, { method: "PUT", body: { guests }, resendable: true, label: wc("guestsTitle"),
|
|
110
|
+
onPending: () => { if (live.current) setMsg({ waiting: true }); } });
|
|
111
|
+
if (!live.current) return;
|
|
112
|
+
if (r.ok) { setMsg(null); toast(wc("saved")); }
|
|
113
|
+
else if (r.ambiguous) setMsg({ error: wc("unknown") });
|
|
114
|
+
else if (r.status === 409 && r.body && (r.body.key === "guest_grant_changed" || r.body.error === "guest_grant_changed")) setMsg({ error: wc(key === "--convert" ? "changedAll" : "changed") });
|
|
115
|
+
else if (r.body && r.body.key === "guest_grant_refused") setMsg({ error: wc("refused", r.body.error || "") });
|
|
116
|
+
else setMsg({ error: wc("saveFailed", (r.body && r.body.error) || r.status) });
|
|
117
|
+
} catch { if (live.current) setMsg({ error: wc("unknown") }); }
|
|
118
|
+
finally { if (live.current) { setBusy(null); await read(); } }
|
|
119
|
+
};
|
|
120
|
+
/** One person's change, made from their grant as this page shows it (`shown`: null, none), on condition it is still that. */
|
|
121
|
+
const change = async (key, shownGrant, kind, extra) => {
|
|
122
|
+
if (busy || !overview || !overview.explicit) return;
|
|
123
|
+
const next = nextGrant(shownGrant, name, kind, extra);
|
|
124
|
+
await write(key, { grants: { [key]: next }, if_grants: { [key]: shownGrant ? grantOf(shownGrant) : null } });
|
|
125
|
+
};
|
|
126
|
+
const shownGrantOf = (key) => { const g = ((overview && overview.guests) || []).find((x) => accountKey(x) === key); return (g && g.grant) || null; };
|
|
127
|
+
const remove = async (g) => {
|
|
128
|
+
// Asked about the grant shown, and written only if it is still that one (if_grants): the warning is about what is written.
|
|
129
|
+
const last = !!g.grant && g.grant.instances.length === 1;
|
|
130
|
+
const yes = await confirmDialog({ title: wc("removeTitle", g.name), message: wc(last ? "removeLast" : "removeConfirm", g.name, shown), confirmLabel: wc("remove"), danger: true });
|
|
131
|
+
if (yes) await change(accountKey(g), g.grant, "remove");
|
|
132
|
+
};
|
|
133
|
+
const convert = async () => {
|
|
134
|
+
if (!overview || overview.explicit) return;
|
|
135
|
+
const yes = await confirmDialog({ title: wc("convertTitle"), message: wc("convertConfirm"), confirmLabel: wc("convert") });
|
|
136
|
+
if (!yes) return;
|
|
137
|
+
await write("--convert", { grants: todaysGrants(overview), if_grants: "unset" });
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const head = html`<h3>${wc("guestsTitle")}</h3><p class="note">${wc("guestsLead")}</p>
|
|
141
|
+
<div class="field-row"><a class="btn btn-sm ap-who-go" href=${`${settingsPath("access")}#guests`}>${wc("openGuests")}</a></div>`;
|
|
142
|
+
if (state === "loading") return html`<section class="card ap-who-guests" id="who-guests">${head}<${Skeleton} variant="rows" lines=${3} /></section>`;
|
|
143
|
+
if (state === "denied") return html`<section class="card ap-who-guests" id="who-guests">${head}<p class="note" role="status">${wc("notAdmin")}</p></section>`;
|
|
144
|
+
if (state === "failed") return html`<section class="card ap-who-guests" id="who-guests">${head}<p class="note" role="status">${tn("guestsLoadFailed")} <button type="button" class="btn btn-sm" onClick=${read}>${t("app.retry")}</button></p></section>`;
|
|
145
|
+
if (!grantable(overview, name)) return html`<section class="card ap-who-guests" id="who-guests">${head}<p class="note">${wc("notGrantable")}</p></section>`;
|
|
146
|
+
|
|
147
|
+
const rows = whoCanUse(overview, name);
|
|
148
|
+
const explicit = !!overview.explicit;
|
|
149
|
+
const listed = new Set(rows.map(accountKey));
|
|
150
|
+
const q = query.trim().toLowerCase();
|
|
151
|
+
const candidates = (people || []).filter((p) => !listed.has(accountKey(p)))
|
|
152
|
+
.filter((p) => !q || [p.name, p.username, p.userId].some((x) => typeof x === "string" && x.toLowerCase().includes(q))).slice(0, 8);
|
|
153
|
+
const others = (g) => (g.grant ? g.grant.instances : g.scope || []).filter((n) => n !== name).map((n) => roomName(overview, n));
|
|
154
|
+
const row = (g) => {
|
|
155
|
+
const key = accountKey(g), levelId = `who-level-${key.replace(/[^A-Za-z0-9_-]/g, "_")}`, level = levelOf(g.grant), on = g.sessions || g.devices, mine = busy === key, also = others(g);
|
|
156
|
+
return html`<li key=${key} class="ap-who-row" data-account=${key}>
|
|
157
|
+
<span class="ap-who-av" aria-hidden="true">${(g.name || "?").slice(0, 1).toUpperCase()}</span>
|
|
158
|
+
<div class="ap-who-id"><strong>${g.name || g.userId}</strong> <span class="note">${PLATFORMS[g.platform] || g.platform || ""}</span>
|
|
159
|
+
<div class="note ap-who-state">${on ? tn("grantsSignedIn", g.devices || g.sessions) : tn("grantsNotSignedIn")}${also.length ? html` · ${wc("alsoUses", also.join(", "))}` : null}</div></div>
|
|
160
|
+
${explicit ? html`<div class="ap-who-actions">
|
|
161
|
+
<span class="note ap-who-level-label" id=${levelId}>${wc("level")}</span>
|
|
162
|
+
<div class="seg-inline" role="group" aria-labelledby=${levelId}>${["chat", "trusted"].map((l) => html`<button key=${l} type="button"
|
|
163
|
+
class=${`btn btn-sm${level === l ? " btn-primary" : ""}`} aria-pressed=${level === l ? "true" : "false"} data-level=${l} disabled=${!!busy}
|
|
164
|
+
onClick=${() => { if (level !== l) void change(key, g.grant, "level", { level: l }); }}>${tn(l === "trusted" ? "grantsLevelTrusted" : "grantsLevelChat")}</button>`)}</div>
|
|
165
|
+
<button type="button" class="btn btn-sm btn-danger ap-who-remove" disabled=${!!busy} aria-busy=${mine ? "true" : undefined} onClick=${() => remove(g)}>${wc("remove")}</button>
|
|
166
|
+
</div>${also.length ? html`<p class="note ap-who-level-all">${wc("levelAll", g.name, also.length + 1)}</p>` : null}` : html`<span class="note ap-who-level">${tn(level === "trusted" ? "grantsLevelTrusted" : "grantsLevelChat")}</span>`}
|
|
167
|
+
</li>`;
|
|
168
|
+
};
|
|
169
|
+
return html`<section class="card ap-who-guests" id="who-guests">${head}
|
|
170
|
+
${!overview.enabled ? html`<p class="note ap-who-off" role="note">${wc("guestsOff")}</p>` : null}
|
|
171
|
+
${!explicit ? html`<div class="ap-who-derived"><p class="note">${wc("derived")}</p><p class="note">${wc("convertHint")}</p>
|
|
172
|
+
<button type="button" class="btn btn-sm" id="whoConvert" disabled=${!!busy} onClick=${convert}>${wc("convert")}</button></div>` : null}
|
|
173
|
+
${!explicit && rows.length ? html`<p class="note">${wc("derivedList")}</p>` : null}
|
|
174
|
+
${rows.length ? html`<ul class="ap-who-list">${rows.map(row)}</ul>` : html`<p class="note" id="whoNone">${wc("none")}</p>`}
|
|
175
|
+
${rows.some((g) => levelOf(g.grant) === "trusted") ? html`<p class="note ap-who-trusted">${wc("trustedHint")}</p>` : null}
|
|
176
|
+
${explicit ? html`<details class="ap-who-add" onToggle=${(e) => { if (e.target.open && people === null) void readPeople(); }}><summary>${wc("add")}</summary>
|
|
177
|
+
<p class="note">${wc("addHint")} ${wc("addMissing")}</p>
|
|
178
|
+
<p class="note ap-who-confirm-note">${wc("addConfirm")}</p>
|
|
179
|
+
<input type="search" class="input" id="whoSearch" value=${query} aria-label=${wc("searchLabel")} placeholder=${wc("searchShort")} onInput=${(e) => setQuery(e.target.value)} />
|
|
180
|
+
${people === null ? html`<${Skeleton} variant="rows" lines=${2} />` : !candidates.length ? html`<p class="note" id="whoNoPeople">${wc("noPeople")}</p>`
|
|
181
|
+
: html`<ul class="ap-who-list ap-who-pick">${candidates.map((p) => { const key = accountKey(p); return html`<li key=${key} class="ap-who-row" data-account=${key}>
|
|
182
|
+
<span class="ap-who-av" aria-hidden="true">${(p.name || "?").slice(0, 1).toUpperCase()}</span>
|
|
183
|
+
<div class="ap-who-id"><strong>${p.name}</strong> <span class="note">${PLATFORMS[p.platform] || p.platform}${p.username ? ` · @${p.username}` : ""}</span></div>
|
|
184
|
+
<div class="ap-who-actions"><button type="button" class="btn btn-sm" disabled=${!!busy} onClick=${() => change(key, shownGrantOf(key), "add", { name: p.name })}>${busy === key ? wc("adding") : wc("addOne")}</button></div></li>`; })}</ul>`}
|
|
185
|
+
</details>` : null}
|
|
186
|
+
${msg && msg.waiting ? html`<p class="note ap-who-msg" role="status">${wc("waiting")}</p>` : null}
|
|
187
|
+
${msg && msg.error ? html`<p class="note err ap-who-msg" role="alert">${msg.error}</p>` : null}
|
|
188
|
+
</section>`;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** The Hub's part: this agent's share, as Settings → Hub reads it, and the way to the Hub page that chooses who may ask. */
|
|
192
|
+
export function hubState(marks, pairing, rows, name) {
|
|
193
|
+
if (!marks || !marks.member) return { kind: "none" };
|
|
194
|
+
if (!pairing) return { kind: "loading" };
|
|
195
|
+
if (pairing.state !== "paired") return { kind: "notPaired" };
|
|
196
|
+
if (!rows) return { kind: "loading" };
|
|
197
|
+
const row = rows.find((r) => r && r.agent === name);
|
|
198
|
+
const origin = safeWebOrigin(pairing), offline = pairing.link === "offline";
|
|
199
|
+
const link = row && origin && /^[a-f0-9-]{36}$/.test(row.exposureId || "") ? `${origin}/ui/hub/exposures?agent=${encodeURIComponent(row.exposureId)}&grant=1` : null;
|
|
200
|
+
if (!row) return { kind: "notShared", offline };
|
|
201
|
+
if (row.pending) return { kind: "pending", offline };
|
|
202
|
+
if (row.state === "frozen") return { kind: "frozen", offline };
|
|
203
|
+
if (row.state !== "published") return { kind: "notShared", offline };
|
|
204
|
+
if (row.reason === "hub_refused") return { kind: "refused", offline };
|
|
205
|
+
if (row.reason === "republish_required" || row.reason === "share_lapsed") return { kind: "lapsed", offline, link };
|
|
206
|
+
return { kind: "shared", offline, link };
|
|
207
|
+
}
|
|
208
|
+
const HUB_WORDS = { none: "hubNone", notPaired: "hubNotPaired", notShared: "hubNotShared", pending: "hubPending", frozen: "hubFrozen", refused: "hubRefused", lapsed: "hubLapsed", shared: "hubShared", failed: "hubLoadFailed" };
|
|
209
|
+
|
|
210
|
+
function HubCard({ name }) {
|
|
211
|
+
const marks = hubMarks();
|
|
212
|
+
const [pairing, setPairing] = useState(null), [rows, setRows] = useState(null), [failed, setFailed] = useState(false);
|
|
213
|
+
const live = useRef(true);
|
|
214
|
+
const read = async () => {
|
|
215
|
+
if (!marks.member) return;
|
|
216
|
+
setFailed(false);
|
|
217
|
+
try {
|
|
218
|
+
const client = hubClient();
|
|
219
|
+
const p = await client.pairing();
|
|
220
|
+
if (!live.current) return;
|
|
221
|
+
setPairing(p);
|
|
222
|
+
if (p && p.state === "paired") { const r = await client.exposures(); if (live.current) setRows(Array.isArray(r) ? r : []); }
|
|
223
|
+
} catch { if (live.current) setFailed(true); }
|
|
224
|
+
};
|
|
225
|
+
useEffect(() => { live.current = true; void read(); return () => { live.current = false; }; }, [name]);
|
|
226
|
+
const s = failed ? { kind: "failed" } : hubState(marks, pairing, rows, name);
|
|
227
|
+
return html`<section class="card ap-who-hub" id="who-hub" data-hub-state=${s.kind}><h3>${wc("hubTitle")}</h3>
|
|
228
|
+
<p class="note">${wc("hubLead")}</p>
|
|
229
|
+
${s.kind === "loading" ? html`<${Skeleton} variant="rows" lines=${1} />` : html`<p class="ap-who-hub-state" role="status">${wc(HUB_WORDS[s.kind])}</p>`}
|
|
230
|
+
${s.offline ? html`<p class="note">${wc("hubOffline")}</p>` : null}
|
|
231
|
+
${s.kind === "failed" ? html`<button type="button" class="btn btn-sm" onClick=${read}>${t("app.retry")}</button>` : null}
|
|
232
|
+
${s.link ? html`<p class="note ap-who-hub-where">${wc("hubWhere")}</p>` : null}
|
|
233
|
+
<div class="field-row">
|
|
234
|
+
${s.link ? html`<a class="btn btn-sm btn-primary" id="whoHubChoose" href=${s.link} target="_blank" rel="noopener noreferrer">${wc("hubChoose")}<span aria-hidden="true"> ↗</span></a>` : null}
|
|
235
|
+
${s.kind !== "loading" ? html`<a class="btn btn-sm" href=${settingsPath("hub")}>${wc("hubSettings")}</a>` : null}
|
|
236
|
+
</div>
|
|
237
|
+
</section>`;
|
|
238
|
+
}
|
package/dist/ui/chat-activity.js
CHANGED
|
@@ -18,6 +18,7 @@ import { html, render, useEffect, useState } from "/assets/app-html.js";
|
|
|
18
18
|
import { register, t } from "/assets/app-i18n.js";
|
|
19
19
|
import { createStore } from "/assets/app-store.js";
|
|
20
20
|
import { Icon } from "/assets/ui-icons.js";
|
|
21
|
+
import { unitText } from "/assets/clock-text.js";
|
|
21
22
|
import { CAT_ICON, KIND_ICON, LogRow, collapse, mergeSteps, stepLine, tl } from "./log-row.js";
|
|
22
23
|
import { composeRows, groupSteps } from "./chat-activity-groups.js";
|
|
23
24
|
|
|
@@ -112,7 +113,7 @@ const thinkingOffered = () => globalThis.document?.body?.dataset?.logThinking ==
|
|
|
112
113
|
function elapsed(ms) {
|
|
113
114
|
if (!(ms >= 1000)) return "";
|
|
114
115
|
const s = Math.round(ms / 1000);
|
|
115
|
-
return s < 60 ?
|
|
116
|
+
return s < 60 ? unitText(s, "s") : `${unitText(Math.floor(s / 60), "m")} ${unitText(s % 60, "s")}`;
|
|
116
117
|
}
|
|
117
118
|
const countOf = (rows) => rows.reduce((n, x) => n + (x.repeat || 1), 0);
|
|
118
119
|
/** Tool calls in `rows` (a repeated call counts each time): thinking and "said" lines are steps, not tools. */
|
package/dist/ui/chat-pins.js
CHANGED
|
@@ -11,6 +11,7 @@ import { useCanCreate } from "/assets/app-shell.js";
|
|
|
11
11
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
12
12
|
import { Icon } from "/assets/ui-icons.js";
|
|
13
13
|
import { toast } from "/assets/ui-toast.js";
|
|
14
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
14
15
|
|
|
15
16
|
/** Pins per agent (web-pin-store.ts PINS_MAX): the host says pins_full past it. */
|
|
16
17
|
export const PINS_MAX = 50;
|
|
@@ -67,7 +68,7 @@ export function usePins(name) {
|
|
|
67
68
|
return all[name] || { offered: false, pins: [] };
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
const when = (ts) => { const d = new Date(ts); return Number.isFinite(d.getTime()) ? d
|
|
71
|
+
const when = (ts) => { const d = new Date(ts); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "medium", timeStyle: "short" }, lang()) : ""; };
|
|
71
72
|
const snippet = (s, n = 40) => { const one = String(s || "").replace(/\s+/g, " ").trim(); return one.length > n ? `${one.slice(0, n - 1)}…` : one; };
|
|
72
73
|
|
|
73
74
|
/** The header's 📌 with the count: only when this agent has a pin. `onOpen` opens the list (the chat panel's). */
|
|
@@ -8,6 +8,7 @@ import { confirmDialog } from "/assets/ui-confirm.js";
|
|
|
8
8
|
import { Icon } from "/assets/ui-icons.js";
|
|
9
9
|
import { Skeleton, ErrorState } from "/assets/ui-states.js";
|
|
10
10
|
import { toast } from "/assets/ui-toast.js";
|
|
11
|
+
import { clockFormat } from "/assets/clock-text.js";
|
|
11
12
|
register("claudeCredentials", {
|
|
12
13
|
en: {
|
|
13
14
|
title: "Connect Claude Code", profile: "Account", default: "Default connection",
|
|
@@ -54,7 +55,7 @@ export function credentialRequestState(metadata){
|
|
|
54
55
|
return ["needs-replacement","unknown"].includes(metadata.state)?metadata.state:"saved-unverified";
|
|
55
56
|
}
|
|
56
57
|
export function credentialStatusText(metadata){const state=credentialRequestState(metadata);return credentialText(state==="verified"?"verified":state==="needs-replacement"?"needsReplacement":state==="unknown"?"requestUnknown":"notChecked");}
|
|
57
|
-
export function credentialVerificationTime(metadata){return credentialRequestState(metadata)==="verified"?credentialText("verifiedAt",
|
|
58
|
+
export function credentialVerificationTime(metadata){return credentialRequestState(metadata)==="verified"?credentialText("verifiedAt",clockFormat({year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}, lang()==="zh-TW"?"zh-TW":"en").format(new Date(metadata.verifiedAt))):null;}
|
|
58
59
|
export function credentialRequestHint(metadata){const state=credentialRequestState(metadata);return state==="needs-replacement"?credentialText("authHint"):state==="unknown"?credentialText("requestUnknownHint"):null;}
|
|
59
60
|
|
|
60
61
|
const e=key=>t("claudeCredentialErrors."+key);
|
|
@@ -4,20 +4,23 @@
|
|
|
4
4
|
* zh-TW (admin is 管理員). A module of its own (namespace contactAuth); imports only app-i18n.
|
|
5
5
|
*/
|
|
6
6
|
import { register, t, lang } from "/assets/app-i18n.js";
|
|
7
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
7
8
|
|
|
8
9
|
register("contactAuth", {
|
|
9
10
|
en: {
|
|
10
11
|
tab: "Permissions", lead: "Who may ask this agent to forward requests to other agents, and what this room may use.",
|
|
11
12
|
loading: "Loading permissions…", loadFailed: "Couldn't load permissions.", retry: "Try again",
|
|
12
|
-
forbidden: "Only this agent's managers can see its permissions.",
|
|
13
|
+
forbidden: "Only this agent's managers can see its permissions.",
|
|
14
|
+
verifyFirst: "Permissions and contact requests need a verified administrator. Verify your identity in Sign-in status (Authorize this browser), then try again.",
|
|
15
|
+
unavailable: "Permissions are unavailable right now. Try again in a moment.",
|
|
13
16
|
stale: "Someone changed these permissions just now. They have been reloaded — check them and try again.",
|
|
14
17
|
saved: "Saved.", saveFailed: "Couldn't save.", readOnly: "You can see these permissions but not change them.",
|
|
15
18
|
// Mode (a ClassicBot room)
|
|
16
|
-
modeTitle: "Room mode", modeRestricted: "Restricted", modeLegacy: "
|
|
19
|
+
modeTitle: "Room mode", modeRestricted: "Restricted", modeLegacy: "Free",
|
|
17
20
|
modeRestrictedNote: "Requests from people who aren't admins to other agents wait for approval before anything is sent.",
|
|
18
|
-
modeLegacyNote: "
|
|
19
|
-
switchRestricted: "Switch to restricted", switchLegacy: "
|
|
20
|
-
confirmRestricted: "Switch this room to restricted mode?", confirmLegacy: "
|
|
21
|
+
modeLegacyNote: "In Free mode, requests from this room go to other agents without approval.",
|
|
22
|
+
switchRestricted: "Switch to restricted", switchLegacy: "Switch to Free",
|
|
23
|
+
confirmRestricted: "Switch this room to restricted mode?", confirmLegacy: "Switch this room to Free? Requests from this room will go to other agents without approval. Work already handed to another agent stays as it is.",
|
|
21
24
|
wouldDisableTitle: "These tools will stop in this room:", wouldDisableNone: "No tool this room uses now will stop.",
|
|
22
25
|
// M-3387: what stops, by kind and layer.
|
|
23
26
|
toolsLostTitle: "AgEnD tools this room loses ({0}):", toolGroupLine: "• {0} ({1})",
|
|
@@ -39,9 +42,9 @@ register("contactAuth", {
|
|
|
39
42
|
guardTitle: "Command-line guard", guard_ready: "Active", "guard_restart-required": "Restart needed", "guard_not-covered": "Not covered", guard_failed: "Failed",
|
|
40
43
|
guardNote: "The guard limits what the backend's own tools can do in this room. It is a policy control, not a security boundary on this computer.",
|
|
41
44
|
notCoveredWarning: "This AI tool or version isn't covered by the guard: it runs with its normal permissions; only contact approval applies.",
|
|
42
|
-
newRoomsRestricted: "
|
|
45
|
+
newRoomsRestricted: "At /start you choose Free or Restricted before the room is created. For a fleet admin, Free comes first and is recommended; Restricted is still a choice, and the tap is still required. Anyone else is offered Restricted only. Change it later in the room's Settings → Permissions, or from General's contact-change card. Where the guard doesn't cover a room's AI tool or version, that tool runs with its normal permissions; only contact approval applies.",
|
|
43
46
|
guardBackend: "Backend: {0}", guardReasonOther: "The guard reported a state this page doesn't know.",
|
|
44
|
-
"guardReason_legacy-mode": "This room
|
|
47
|
+
"guardReason_legacy-mode": "This room is in Free mode, so the guard isn't used.",
|
|
45
48
|
"guardReason_unsupported-backend": "This backend isn't covered by the guard.",
|
|
46
49
|
"guardReason_unsupported-platform": "The guard isn't available on this computer's system.",
|
|
47
50
|
"guardReason_unsupported-version": "This version of the backend isn't covered by the guard.",
|
|
@@ -85,8 +88,11 @@ register("contactAuth", {
|
|
|
85
88
|
from: "From {0}", via: "Via {0}", to: "To {0}", origin_unknown: "Origin unknown", origin_mixed: "Earlier non-admin request",
|
|
86
89
|
"reason_earlier-non-admin": "This agent's retained history includes non-admin input, so this contact needs approval.",
|
|
87
90
|
"reason_unknown-origin": "This agent's retained history has an unknown origin, so this contact needs approval.",
|
|
91
|
+
"request_reason_earlier-non-admin": "{0}'s retained history includes non-admin input, so this contact needs approval.",
|
|
92
|
+
"request_reason_unknown-origin": "{0}'s retained history has an unknown origin, so this contact needs approval.",
|
|
88
93
|
// M-3385: under the reason — what an approval leaves as it is, and the one way this agent stops needing approval.
|
|
89
|
-
|
|
94
|
+
requestRecoveryNote: "Approving forwards only this request and leaves the receiving agent's origin unchanged. To accept {0}'s current conversation as its own work, open {0} → Settings → Permissions and press Clear retained origin. It never resets on its own.",
|
|
95
|
+
resetNote: "Approving forwards only this request and leaves the receiving agent's origin unchanged. To accept the sending agent's current conversation as their own work, a verified managing admin can use its Permissions → Clear retained origin. It never resets on its own.",
|
|
90
96
|
created: "Asked {0}", expires: "Expires {0}", decided: "{0} by {1}",
|
|
91
97
|
|
|
92
98
|
grantFutureExpiry: "Choose an expiry in the future.", grantValidUses: "Set a use limit from 1 to 10,000, or leave it empty for unlimited uses.",
|
|
@@ -136,14 +142,16 @@ register("contactAuth", {
|
|
|
136
142
|
"zh-TW": {
|
|
137
143
|
tab: "權限", lead: "誰可以請這個 Agent 把請求轉交給其他 Agent,以及這個房間可以使用什麼。",
|
|
138
144
|
loading: "正在載入權限…", loadFailed: "無法載入權限。", retry: "重試",
|
|
139
|
-
forbidden: "只有這個 Agent 的管理員可以查看權限。",
|
|
145
|
+
forbidden: "只有這個 Agent 的管理員可以查看權限。",
|
|
146
|
+
verifyFirst: "權限和聯絡申請需要已驗證的管理員。請先在「登入狀態」按「授權這個瀏覽器」驗證身分,再試一次。",
|
|
147
|
+
unavailable: "目前無法取得權限,請稍後再試。",
|
|
140
148
|
stale: "剛才有人修改了這些權限,已重新載入,請確認後再試一次。",
|
|
141
149
|
saved: "已儲存。", saveFailed: "無法儲存。", readOnly: "你可以查看這些權限,但無法修改。",
|
|
142
|
-
modeTitle: "房間模式", modeRestricted: "受限模式", modeLegacy: "
|
|
150
|
+
modeTitle: "房間模式", modeRestricted: "受限模式", modeLegacy: "自由模式",
|
|
143
151
|
modeRestrictedNote: "非管理員對其他 Agent 的請求,要先經過核准才會送出。",
|
|
144
|
-
modeLegacyNote: "
|
|
145
|
-
switchRestricted: "切換為受限模式", switchLegacy: "
|
|
146
|
-
confirmRestricted: "要將這個房間切換為受限模式嗎?", confirmLegacy: "
|
|
152
|
+
modeLegacyNote: "自由模式下,這個房間的請求會直接送給其他 Agent,不需核准。",
|
|
153
|
+
switchRestricted: "切換為受限模式", switchLegacy: "切換為自由模式",
|
|
154
|
+
confirmRestricted: "要將這個房間切換為受限模式嗎?", confirmLegacy: "要將這個房間切換為自由模式嗎?這個房間的請求將直接送給其他 Agent,不需核准。已交給其他 Agent 的工作不會因此改變。",
|
|
147
155
|
wouldDisableTitle: "這個房間將停用下列工具:", wouldDisableNone: "這個房間目前使用的工具都不會停用。",
|
|
148
156
|
toolsLostTitle: "這個房間會失去的 AgEnD 工具({0} 個):", toolGroupLine: "• {0}({1})",
|
|
149
157
|
toolGroup_fleet: "Fleet 狀態與設定", toolGroup_agents: "建立、啟動與停止 Agent 和團隊", toolGroup_usage: "用量與紀錄",
|
|
@@ -162,9 +170,9 @@ register("contactAuth", {
|
|
|
162
170
|
guardTitle: "命令列防護", guard_ready: "已啟用", "guard_restart-required": "需要重新啟動", "guard_not-covered": "未涵蓋", guard_failed: "失敗",
|
|
163
171
|
guardNote: "防護會限制後端內建工具在這個房間能做的事。這是政策控制,不是這台電腦上的安全邊界。",
|
|
164
172
|
notCoveredWarning: "這個 AI 工具或版本不在防護範圍內:它會以原本的權限執行,只有聯絡申請需要核准。",
|
|
165
|
-
newRoomsRestricted: "
|
|
173
|
+
newRoomsRestricted: "執行 /start 時,房間建立前要選擇自由模式或受限模式。Fleet 管理員會先看到自由模式(建議),受限模式仍是一個按鈕,仍要點選。其他人只會看到受限模式。之後可在房間的設定 → 權限,或從 General 的聯絡變更卡片更改。若防護不涵蓋房間的 AI 工具或版本,該工具會以原本的權限執行,只有聯絡申請需要核准。",
|
|
166
174
|
guardBackend: "後端:{0}", guardReasonOther: "防護回報了這個頁面不認得的狀態。",
|
|
167
|
-
"guardReason_legacy-mode": "
|
|
175
|
+
"guardReason_legacy-mode": "這個房間是自由模式,因此不使用防護。",
|
|
168
176
|
"guardReason_unsupported-backend": "防護不支援這個後端。",
|
|
169
177
|
"guardReason_unsupported-platform": "這台電腦的系統無法使用防護。",
|
|
170
178
|
"guardReason_unsupported-version": "防護不支援這個版本的後端。",
|
|
@@ -204,7 +212,10 @@ register("contactAuth", {
|
|
|
204
212
|
from: "來自 {0}", via: "經由 {0}", to: "給 {0}", origin_unknown: "來源不明", origin_mixed: "先前有非管理員的請求",
|
|
205
213
|
"reason_earlier-non-admin": "這個 Agent 保留的歷史含有非管理員輸入,因此這次聯絡需要核准。",
|
|
206
214
|
"reason_unknown-origin": "這個 Agent 保留的歷史來源不明,因此這次聯絡需要核准。",
|
|
207
|
-
|
|
215
|
+
"request_reason_earlier-non-admin": "{0} 保留的歷史含有非管理員輸入,因此這次聯絡需要核准。",
|
|
216
|
+
"request_reason_unknown-origin": "{0} 保留的歷史來源不明,因此這次聯絡需要核准。",
|
|
217
|
+
requestRecoveryNote: "核准只會轉交這一筆,接收 Agent 的來源維持原狀。若要接受 {0} 目前的對話作為它自己的工作,請到 {0} 的「設定」→「權限」,按「清除保留的來源」。來源不會自動重設。",
|
|
218
|
+
resetNote: "核准只會轉交這一筆,接收 Agent 的來源維持原狀。若要接受發送 Agent 目前的對話作為自己的工作,管理它的已驗證管理員可以到「權限」→「清除保留的來源」確認。來源不會自動重設。",
|
|
208
219
|
created: "{0} 提出", expires: "{0} 到期", decided: "{1} 於 {0} 處理",
|
|
209
220
|
|
|
210
221
|
grantFutureExpiry: "請選擇未來的到期時間。", grantValidUses: "請設定 1 至 10,000 次,或留空表示不限次數。",
|
|
@@ -253,4 +264,4 @@ export const ca = (k, ...a) => t(`contactAuth.${k}`, ...a);
|
|
|
253
264
|
|
|
254
265
|
export const contactPlatformLabel = platform => ({ discord: "Discord", telegram: "Telegram" }[platform] || platform);
|
|
255
266
|
export const contactPersonLabel = person => person?.platform === "host" && person?.userId === "operator" ? ca("operator") : person?.label || person?.userId || "";
|
|
256
|
-
export const contactWhen = value => { const d = new Date(value); return Number.isFinite(d.getTime()) ? d
|
|
267
|
+
export const contactWhen = value => { const d = new Date(value); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "long", timeStyle: "short" }, lang() === "zh-TW" ? "zh-TW" : "en") : ""; };
|
|
@@ -18,11 +18,12 @@ import { ContactGrantEditor } from "./contact-grant-editor.js";
|
|
|
18
18
|
import { InfoTip } from "/assets/info-tip.js";
|
|
19
19
|
import { ca } from "./contact-auth-strings.js";
|
|
20
20
|
import { decideTicket, getTicket, listTickets, personKey, shortTicketId } from "./contact-auth-client.js";
|
|
21
|
+
import { dateTimeText } from "/assets/clock-text.js";
|
|
21
22
|
|
|
22
23
|
// The Fleet tab's own label (panel-fleet.js reads fleet.<tab>).
|
|
23
24
|
register("fleet", { en: { authorizations: "Authorizations" }, "zh-TW": { authorizations: "授權" } });
|
|
24
25
|
|
|
25
|
-
const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d
|
|
26
|
+
const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "medium", timeStyle: "short" }, []) : ""; };
|
|
26
27
|
/** The server's reason codes (ContactTicket.reason, ContactPermissions.originRestriction.reason). */
|
|
27
28
|
export const REASONS = new Set(["earlier-non-admin", "unknown-origin"]);
|
|
28
29
|
const TONE = { pending: "warn", approved: "ok", delivered: "ok", declined: "bad", expired: "muted", unknown: "bad" };
|
|
@@ -51,7 +52,7 @@ export function TicketCard({ ticket, onChange, onPerson, focus = false }) {
|
|
|
51
52
|
if (again.ok) onChange?.(again.data);
|
|
52
53
|
return false;
|
|
53
54
|
}
|
|
54
|
-
toast(ca(r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "decideFailed"), false);
|
|
55
|
+
toast(ca(r.code === "verification-required" ? "verifyFirst" : r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "decideFailed"), false);
|
|
55
56
|
};
|
|
56
57
|
const people = tk.origin?.people || [];
|
|
57
58
|
const grantable = ["human", "mixed"].includes(tk.origin?.kind) && people.length > 0 && people.length <= 16;
|
|
@@ -74,7 +75,7 @@ export function TicketCard({ ticket, onChange, onPerson, focus = false }) {
|
|
|
74
75
|
<div class="contact-ticket-times"><span class="contact-time-item" title=${ca("created", when(tk.createdAt))}>${ca("created", when(tk.createdAt))}</span>
|
|
75
76
|
<span class=${`contact-time-item${!tk.decidedAt && st === "pending" && waitMinutes(tk) ? " contact-time-wait" : ""}`} title=${endsText}>${endsText}</span></div>
|
|
76
77
|
${st === "delivered" ? html`<p class="note">${ca("deliveryNote")}</p>` : null}
|
|
77
|
-
${REASONS.has(tk.reason) ? html`<p class="note contact-reason" data-reason=${tk.reason}>${ca(`
|
|
78
|
+
${REASONS.has(tk.reason) ? html`<p class="note contact-reason" data-reason=${tk.reason}>${ca(`request_reason_${tk.reason}`, agentLabel(tk.source))}${st === "pending" ? html`${lang() === "zh-TW" ? "" : " "}${ca("requestRecoveryNote", agentLabel(tk.source))}` : null}</p>` : null}
|
|
78
79
|
</div>
|
|
79
80
|
${tk.grantIds?.length ? html`<p><a class="st-link" href=${`${detailsPath(tk.target)}?cat=permissions`}>${ca("grantView")}</a></p>` : null}
|
|
80
81
|
${tk.canDecide && st === "pending" ? html`<div class="contact-decide">
|
|
@@ -131,7 +132,8 @@ export function ContactAuthorizations() {
|
|
|
131
132
|
</div>
|
|
132
133
|
${focus ? html`<${TicketCard} ticket=${focus} focus=${true} onChange=${replace} onPerson=${setPerson} />` : null}
|
|
133
134
|
${page.loading ? html`<${Skeleton} variant="cards" lines=${2} label=${ca("loading")} />`
|
|
134
|
-
: page.error && !page.items.length ? (page.error === "
|
|
135
|
+
: page.error && !page.items.length ? (page.error === "verification-required" ? html`<p class="note contact-verify">${ca("verifyFirst")}</p>`
|
|
136
|
+
: page.error === "forbidden" ? html`<p class="note">${ca("forbidden")}</p>` : html`<${ErrorState} message=${ca(page.error === "unavailable" ? "unavailable" : "loadFailed")} onRetry=${() => void read()} />`)
|
|
135
137
|
: !list.length && !focus ? html`<${Empty} icon="key" title=${ca(status === "pending" ? "emptyPending" : "empty")} hint=${ca("emptyHint")} action=${status === "pending" ? html`<button type="button" class="btn btn-sm" onClick=${() => setStatus("all")}>${ca("viewAll")}</button>` : null} />`
|
|
136
138
|
: html`<div class="contact-ticket-list">${list.map((tk) => html`<${TicketCard} key=${tk.id} ticket=${tk} onChange=${replace} onPerson=${setPerson} />`)}</div>`}
|
|
137
139
|
${page.next ? html`<div class="field-row"><button type="button" class="btn btn-sm" onClick=${() => void read(page.next)}>${ca("more")}</button></div>` : null}
|