@songsid/agend 2.3.5-alpha.5 → 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.
- package/THIRD_PARTY_NOTICES.md +0 -1
- package/dist/accounts-profiles.d.ts +96 -0
- package/dist/accounts-profiles.js +178 -0
- package/dist/accounts-profiles.js.map +1 -0
- package/dist/accounts-signout.d.ts +59 -0
- package/dist/accounts-signout.js +184 -0
- package/dist/accounts-signout.js.map +1 -0
- package/dist/accounts-view.d.ts +54 -0
- package/dist/accounts-view.js +55 -11
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-workspace.d.ts +11 -0
- package/dist/agent-workspace.js +28 -0
- package/dist/agent-workspace.js.map +1 -1
- package/dist/auth-api.js +38 -5
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/session-authorizations.d.ts +2 -0
- package/dist/authority/session-authorizations.js +7 -1
- package/dist/authority/session-authorizations.js.map +1 -1
- package/dist/authority/web-authority.d.ts +13 -0
- package/dist/authority/web-authority.js +12 -0
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.js +47 -9
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex.js +1 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/kiro.js +1 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/types.d.ts +2 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/bundled-tmux-guard.d.ts +19 -0
- package/dist/bundled-tmux-guard.js +83 -0
- package/dist/bundled-tmux-guard.js.map +1 -0
- package/dist/channel/access-manager.d.ts +1 -6
- package/dist/channel/access-manager.js +4 -94
- package/dist/channel/access-manager.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +0 -2
- package/dist/channel/adapters/discord.js +0 -8
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +0 -3
- package/dist/channel/adapters/telegram.js +1 -30
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/types.d.ts +0 -2
- package/dist/classic-bindings.d.ts +13 -0
- package/dist/classic-bindings.js +28 -2
- package/dist/classic-bindings.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +2 -0
- package/dist/classic-channel-manager.js +5 -1
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/cli.js +117 -30
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +11 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +3 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +27 -2
- package/dist/daemon.js +107 -6
- package/dist/daemon.js.map +1 -1
- package/dist/doctor.js +3 -4
- package/dist/doctor.js.map +1 -1
- package/dist/e2e-isolation.js +5 -2
- package/dist/e2e-isolation.js.map +1 -1
- package/dist/fleet-control-audit.d.ts +1 -1
- package/dist/fleet-manager.d.ts +188 -1
- package/dist/fleet-manager.js +1059 -79
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +22 -7
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +10 -0
- package/dist/general-knowledge/steering/core-rules.md +6 -4
- package/dist/hub/buttons.js +4 -2
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +1 -1
- package/dist/hub/catalog.js +82 -15
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/compose/server.d.ts +4 -1
- package/dist/hub/compose/server.js +30 -3
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/directory.d.ts +1 -1
- package/dist/hub/directory/directory.js +142 -21
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/groups.d.ts +29 -0
- package/dist/hub/directory/groups.js +29 -0
- package/dist/hub/directory/groups.js.map +1 -0
- package/dist/hub/directory/index.d.ts +2 -1
- package/dist/hub/directory/types.d.ts +12 -2
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/group-policy/admin-context.d.ts +23 -0
- package/dist/hub/group-policy/admin-context.js +52 -0
- package/dist/hub/group-policy/admin-context.js.map +1 -0
- package/dist/hub/group-policy/admin-dto.d.ts +235 -0
- package/dist/hub/group-policy/admin-dto.js +55 -0
- package/dist/hub/group-policy/admin-dto.js.map +1 -0
- package/dist/hub/group-policy/admin-inventory.d.ts +24 -0
- package/dist/hub/group-policy/admin-inventory.js +72 -0
- package/dist/hub/group-policy/admin-inventory.js.map +1 -0
- package/dist/hub/group-policy/admin-read.d.ts +21 -0
- package/dist/hub/group-policy/admin-read.js +90 -0
- package/dist/hub/group-policy/admin-read.js.map +1 -0
- package/dist/hub/group-policy/authorization.d.ts +43 -0
- package/dist/hub/group-policy/authorization.js +170 -0
- package/dist/hub/group-policy/authorization.js.map +1 -0
- package/dist/hub/group-policy/model.d.ts +56 -0
- package/dist/hub/group-policy/model.js +46 -0
- package/dist/hub/group-policy/model.js.map +1 -0
- package/dist/hub/group-policy/resources.d.ts +60 -0
- package/dist/hub/group-policy/resources.js +191 -0
- package/dist/hub/group-policy/resources.js.map +1 -0
- package/dist/hub/group-policy/store.d.ts +58 -0
- package/dist/hub/group-policy/store.js +155 -0
- package/dist/hub/group-policy/store.js.map +1 -0
- package/dist/hub/http/compose.js +9 -9
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +23 -3
- package/dist/hub/http/core.js +138 -5
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +3 -0
- package/dist/hub/pairing.d.ts +3 -1
- package/dist/hub/pairing.js +6 -3
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/policy.d.ts +3 -1
- package/dist/hub/policy.js +13 -6
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/rooms.d.ts +1 -0
- package/dist/hub/rooms.js +76 -26
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/server.d.ts +2 -0
- package/dist/hub/server.js +12 -2
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sessions.js +2 -1
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/types.d.ts +2 -0
- package/dist/instance-config-impact.js +4 -3
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +17 -0
- package/dist/instance-lifecycle.js +38 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +45 -18
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +5 -0
- package/dist/login-controller.js +11 -0
- package/dist/login-controller.js.map +1 -1
- package/dist/login-window-lock.d.ts +2 -1
- package/dist/login-window-lock.js.map +1 -1
- package/dist/ls-rows.d.ts +1 -1
- package/dist/ls-rows.js +1 -1
- package/dist/ls-rows.js.map +1 -1
- package/dist/machine-accounts.d.ts +110 -0
- package/dist/machine-accounts.js +229 -0
- package/dist/machine-accounts.js.map +1 -0
- package/dist/machine-signins.d.ts +89 -0
- package/dist/machine-signins.js +182 -0
- package/dist/machine-signins.js.map +1 -0
- package/dist/muse-usage-relay.d.ts +2 -0
- package/dist/muse-usage-relay.js +5 -3
- package/dist/muse-usage-relay.js.map +1 -1
- package/dist/needs-you-hub.d.ts +3 -0
- package/dist/needs-you-hub.js +13 -3
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +35 -2
- package/dist/needs-you.js +19 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/quickstart.js +7 -18
- package/dist/quickstart.js.map +1 -1
- package/dist/quiet-run.d.ts +31 -0
- package/dist/quiet-run.js +50 -0
- package/dist/quiet-run.js.map +1 -0
- package/dist/quota-notice-config.d.ts +22 -0
- package/dist/quota-notice-config.js +41 -0
- package/dist/quota-notice-config.js.map +1 -0
- package/dist/runtime-api.d.ts +13 -0
- package/dist/runtime-api.js +134 -2
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-build-info.d.ts +2 -1
- package/dist/runtime-build-info.js +7 -3
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli-install.d.ts +153 -0
- package/dist/runtime-cli-install.js +675 -0
- package/dist/runtime-cli-install.js.map +1 -0
- package/dist/runtime-cli.js +157 -12
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client.d.ts +64 -2
- package/dist/runtime-client.js +277 -20
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +10 -1
- package/dist/runtime-coordinator.js +93 -2
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-credential-profiles.d.ts +11 -2
- package/dist/runtime-credential-profiles.js +28 -4
- package/dist/runtime-credential-profiles.js.map +1 -1
- package/dist/runtime-install.js +9 -6
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-pane-link.js +2 -1
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-service.js +2 -2
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-store.d.ts +10 -0
- package/dist/runtime-pane-store.js +13 -1
- package/dist/runtime-pane-store.js.map +1 -1
- package/dist/runtime-profile-ownership.d.ts +66 -0
- package/dist/runtime-profile-ownership.js +391 -0
- package/dist/runtime-profile-ownership.js.map +1 -0
- package/dist/runtime-protocol.d.ts +88 -2
- package/dist/runtime-protocol.js +40 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-remote-accounts.d.ts +197 -0
- package/dist/runtime-remote-accounts.js +663 -0
- package/dist/runtime-remote-accounts.js.map +1 -0
- package/dist/runtime-remote-setup.d.ts +105 -0
- package/dist/runtime-remote-setup.js +529 -0
- package/dist/runtime-remote-setup.js.map +1 -0
- package/dist/runtime-signin-transport.d.ts +39 -0
- package/dist/runtime-signin-transport.js +110 -0
- package/dist/runtime-signin-transport.js.map +1 -0
- package/dist/runtime-signin.d.ts +132 -0
- package/dist/runtime-signin.js +289 -0
- package/dist/runtime-signin.js.map +1 -0
- package/dist/runtime-update-attention.d.ts +4 -0
- package/dist/runtime-update-attention.js +11 -0
- package/dist/runtime-update-attention.js.map +1 -0
- package/dist/runtime-update-controller.d.ts +75 -0
- package/dist/runtime-update-controller.js +691 -0
- package/dist/runtime-update-controller.js.map +1 -0
- package/dist/runtime-update-ipc.d.ts +42 -0
- package/dist/runtime-update-ipc.js +144 -0
- package/dist/runtime-update-ipc.js.map +1 -0
- package/dist/runtime-update-journal.d.ts +5 -0
- package/dist/runtime-update-journal.js +7 -0
- package/dist/runtime-update-journal.js.map +1 -1
- package/dist/runtime-update-lock.js +17 -2
- package/dist/runtime-update-lock.js.map +1 -1
- package/dist/runtime-update-status.d.ts +30 -0
- package/dist/runtime-update-status.js +31 -0
- package/dist/runtime-update-status.js.map +1 -0
- package/dist/settings-api.js +6 -2
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.d.ts +10 -0
- package/dist/settings-change.js +25 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +25 -1
- package/dist/settings-confirmation.js +11 -3
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.js +18 -6
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +21 -0
- package/dist/settings-http-confirmation.js +74 -3
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-instance-patch.js +1 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/setup-wizard.js +3 -5
- package/dist/setup-wizard.js.map +1 -1
- package/dist/signin-keepalive.d.ts +203 -0
- package/dist/signin-keepalive.js +652 -0
- package/dist/signin-keepalive.js.map +1 -0
- package/dist/structured-signin-transport.js +4 -0
- package/dist/structured-signin-transport.js.map +1 -1
- package/dist/structured-signin.d.ts +7 -0
- package/dist/structured-signin.js +4 -2
- package/dist/structured-signin.js.map +1 -1
- package/dist/tips.js +4 -4
- package/dist/tips.js.map +1 -1
- package/dist/tmux-binary.d.ts +23 -23
- package/dist/tmux-binary.js +35 -46
- package/dist/tmux-binary.js.map +1 -1
- package/dist/tmux-exec-helper.js +3 -3
- package/dist/tmux-exec-helper.js.map +1 -1
- package/dist/tmux-legacy.d.ts +94 -0
- package/dist/tmux-legacy.js +309 -0
- package/dist/tmux-legacy.js.map +1 -0
- package/dist/tmux-manager.d.ts +7 -1
- package/dist/tmux-manager.js +21 -11
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-rollback.d.ts +31 -0
- package/dist/tmux-rollback.js +72 -0
- package/dist/tmux-rollback.js.map +1 -0
- package/dist/tmux-server.d.ts +102 -0
- package/dist/tmux-server.js +248 -0
- package/dist/tmux-server.js.map +1 -0
- package/dist/transcript-monitor.js +43 -5
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-records.d.ts +2 -1
- package/dist/transcript-records.js +3 -0
- package/dist/transcript-records.js.map +1 -1
- package/dist/transcript-sources.js +3 -0
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +113 -0
- package/dist/ui/accounts-manage.js +237 -0
- package/dist/ui/accounts-view.js +191 -36
- package/dist/ui/agent-runtime-settings.js +2 -1
- package/dist/ui/app.html +8 -1
- package/dist/ui/backend-signin.js +12 -3
- package/dist/ui/general-location.js +28 -14
- package/dist/ui/hub-attachments.js +90 -0
- package/dist/ui/hub-chat-store.js +11 -5
- package/dist/ui/hub-client.js +20 -1
- package/dist/ui/hub-grant-strings.js +13 -0
- package/dist/ui/hub-owner-strings.js +6 -2
- package/dist/ui/hub-preview.js +101 -0
- package/dist/ui/hub-strings.js +4 -2
- package/dist/ui/machine-signin.js +56 -0
- package/dist/ui/panel-fleet.js +1 -1
- package/dist/ui/panel-hub.js +194 -54
- package/dist/ui/panel-log.js +2 -2
- package/dist/ui/panel-needs.js +14 -8
- package/dist/ui/panel-notices.js +4 -3
- package/dist/ui/panel-runtimes.js +32 -11
- package/dist/ui/panel-settings.js +18 -24
- package/dist/ui/panel-windows-agent.js +2 -1
- package/dist/ui/preview-pages.js +3 -41
- package/dist/ui/preview-panel-actions.js +3 -161
- package/dist/ui/preview-panel.js +10 -557
- package/dist/ui/preview-versions.js +3 -155
- package/dist/ui/runtime-cli-install.js +134 -0
- package/dist/ui/runtime-update-commands.d.ts +2 -0
- package/dist/ui/runtime-update-commands.js +11 -0
- package/dist/ui/runtime-update-status.js +53 -0
- package/dist/ui/search-dialog.js +3 -2
- package/dist/ui/settings-confirm.js +28 -0
- package/dist/ui/settings-devices.js +6 -10
- package/dist/ui/settings-guests.js +3 -2
- package/dist/ui/settings-hub-browser-certificate.js +2 -0
- package/dist/ui/settings-hub-membership.js +17 -11
- package/dist/ui/settings-hub-retention.js +2 -0
- package/dist/ui/settings-hub-section.js +35 -0
- package/dist/ui/settings-hub.js +17 -5
- package/dist/ui/settings-layout.js +6 -2
- package/dist/ui/settings-named-test.js +2 -2
- package/dist/ui/settings-outside.js +1 -1
- package/dist/ui/settings-quota-notice.js +102 -0
- package/dist/ui/settings-registry.js +4 -0
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/settings-web-authority.js +2 -1
- package/dist/ui/shared/accounts-keepalive.css +7 -0
- package/dist/ui/shared/accounts.css +13 -0
- package/dist/ui/shared/app-i18n.js +4 -2
- package/dist/ui/shared/app-route.js +1 -1
- package/dist/ui/shared/app-shell.js +111 -8
- package/dist/ui/shared/app-store.js +2 -2
- package/dist/ui/shared/app.css +29 -0
- package/dist/ui/shared/app.js +2 -1
- package/dist/ui/shared/chat-strings.js +8 -8
- package/dist/ui/shared/hub-chat.css +1 -0
- package/dist/ui/shared/hub-owner.css +3 -3
- package/dist/ui/shared/hub-signin.css +24 -0
- package/dist/ui/shared/loading.css +37 -0
- package/dist/ui/shared/preview-pages.js +41 -0
- package/dist/ui/shared/preview-panel-actions.js +168 -0
- package/dist/ui/shared/preview-panel.js +565 -0
- package/dist/ui/shared/preview-versions.js +155 -0
- package/dist/ui/shared/runtime-install.css +4 -0
- package/dist/ui/shared/signin.js +68 -6
- package/dist/ui/shared/ui-states.js +14 -3
- package/dist/ui/shared/view-strings.js +4 -4
- package/dist/ui/shared/workspace-follow.css +19 -0
- package/dist/ui/signin.html +7 -3
- package/dist/ui/structured-signin.js +43 -11
- package/dist/ui/workspace-follow-strings.js +28 -0
- package/dist/ui/workspace-panel.js +225 -36
- package/dist/update-install.d.ts +7 -0
- package/dist/update-install.js +23 -0
- package/dist/update-install.js.map +1 -1
- package/dist/usage/providers.d.ts +6 -0
- package/dist/usage/providers.js +18 -9
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-notices.d.ts +38 -0
- package/dist/usage/quota-notices.js +160 -0
- package/dist/usage/quota-notices.js.map +1 -0
- package/dist/usage/usage-api.d.ts +1 -0
- package/dist/usage/usage-api.js +16 -0
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.d.ts +38 -0
- package/dist/web-api.js +357 -14
- package/dist/web-api.js.map +1 -1
- package/dist/web-login.d.ts +35 -1
- package/dist/web-login.js +51 -5
- package/dist/web-login.js.map +1 -1
- package/dist/web-remote-access.d.ts +6 -0
- package/dist/web-remote-access.js +10 -1
- package/dist/web-remote-access.js.map +1 -1
- package/dist/web-session.d.ts +11 -0
- package/dist/web-session.js +38 -1
- package/dist/web-session.js.map +1 -1
- package/dist/web-shell-routes.d.ts +1 -1
- package/dist/web-shell-routes.js +1 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-signin-link.d.ts +42 -0
- package/dist/web-signin-link.js +110 -0
- package/dist/web-signin-link.js.map +1 -0
- package/dist/windows-cli-api.d.ts +14 -0
- package/dist/windows-cli-api.js +21 -0
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +3 -1
- package/dist/windows-cli-worker.js +18 -3
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/workspace-follow-parse.d.ts +36 -0
- package/dist/workspace-follow-parse.js +208 -0
- package/dist/workspace-follow-parse.js.map +1 -0
- package/dist/workspace-follow-records.d.ts +17 -0
- package/dist/workspace-follow-records.js +88 -0
- package/dist/workspace-follow-records.js.map +1 -0
- package/dist/workspace-follow.d.ts +41 -0
- package/dist/workspace-follow.js +143 -0
- package/dist/workspace-follow.js.map +1 -0
- package/dist/wsl-detect.d.ts +1 -0
- package/dist/wsl-detect.js +20 -0
- package/dist/wsl-detect.js.map +1 -0
- package/launcher/tmux-bundle.cjs +26 -10
- package/package.json +7 -2
- package/templates/runtime-install/install.ps1 +154 -13
|
@@ -15,6 +15,7 @@ import { SessionMenu } from "./app-session.js";
|
|
|
15
15
|
import { onPrefsChanged, savePref } from "./app-prefs.js";
|
|
16
16
|
import { applyPageTheme, pageNow, resolvedMode, themesStore } from "./app-themes.js";
|
|
17
17
|
import { ErrorState, Skeleton } from "./ui-states.js";
|
|
18
|
+
import { Dialog } from "./ui-dialog.js";
|
|
18
19
|
import { InstanceNav, RosterNav, namesStore, setNamesPrimary } from "./instance-nav.js";
|
|
19
20
|
import { usageRailStore } from "./header-tools.js";
|
|
20
21
|
import { useWebAuthorization } from "./web-authorize.js";
|
|
@@ -84,12 +85,18 @@ export function searchOffered(admin) {
|
|
|
84
85
|
return (guestPage() ? guestTrusted() : !!admin) && !offLink;
|
|
85
86
|
}
|
|
86
87
|
let searchModule = null;
|
|
88
|
+
let searchOpen = 0;
|
|
89
|
+
function SearchLoading({ onClose }) {
|
|
90
|
+
return html`<${Dialog} title=${t("app.search")} onClose=${onClose} wide=${true}><${Skeleton} variant="rows" lines=${4} /></${Dialog}>`;
|
|
91
|
+
}
|
|
87
92
|
/** Open search; `preset.instance`: narrowed to that agent (Ctrl+F in its chat). */
|
|
88
93
|
export function openSearch(preset = {}) {
|
|
89
94
|
closeDrawer();
|
|
95
|
+
const mine = ++searchOpen;
|
|
96
|
+
showDialog(SearchLoading, { onClose: () => { searchOpen++; closeDialog(); } });
|
|
90
97
|
(searchModule ??= import("/ui/js/search-dialog.js")).then(
|
|
91
|
-
(m) => showDialog(m.SearchDialog, { preset }),
|
|
92
|
-
() => { searchModule = null; toast(t("app.loadFailed"), false); });
|
|
98
|
+
(m) => { if (mine === searchOpen && shellStore.get().dialog?.Component === SearchLoading) showDialog(m.SearchDialog, { preset }); },
|
|
99
|
+
() => { searchModule = null; if (mine === searchOpen && shellStore.get().dialog?.Component === SearchLoading) { closeDialog(); toast(t("app.loadFailed"), false); } });
|
|
93
100
|
}
|
|
94
101
|
/**
|
|
95
102
|
* Ctrl+K (⌘K) anywhere opens search; Ctrl+F (⌘F) in an agent's chat opens it narrowed to that agent — elsewhere the
|
|
@@ -663,17 +670,108 @@ function whereText(where) {
|
|
|
663
670
|
* "Authorize this browser" (the same DM card as the composer's). The host's command otherwise sits folded under
|
|
664
671
|
* "Advanced".
|
|
665
672
|
*/
|
|
673
|
+
// alpha.6 feedback #2c (the user's decision hmsg-77256f66): a change no General could take says WHY, in plain words, and what
|
|
674
|
+
// would let it through — never "type this command on the host". The host's command stays folded under Advanced, a last resort.
|
|
675
|
+
register("pendingHost", {
|
|
676
|
+
en: {
|
|
677
|
+
no_chat: "This fleet has no chat app connected, so there is no General to send the confirm card to.",
|
|
678
|
+
no_chat_do: "This computer's owner confirms it here with Apply now. To confirm from Discord or Telegram, connect one in Settings → Chat & connections.",
|
|
679
|
+
cross_platform: "This change affects chat apps on more than one platform, so no single General can confirm it.",
|
|
680
|
+
cross_platform_do: "Make the change for one platform at a time.",
|
|
681
|
+
no_general: "No agent is the General in a connected chat app, so there is nowhere to send the confirm card.",
|
|
682
|
+
no_general_do: "Make an agent the General in Settings → Agents, then make the change again.",
|
|
683
|
+
chat_disconnected: "General's chat app is not connected right now, so the confirm card could not be sent.",
|
|
684
|
+
chat_disconnected_do: "Check the connection in Settings → Chat & connections, then make the change again.",
|
|
685
|
+
no_topic: "General has no topic in its chat yet, so the confirm card had nowhere to go.",
|
|
686
|
+
no_topic_do: "Send General a message in its chat once, then make the change again.",
|
|
687
|
+
post_failed: "The confirm card could not be posted in General.",
|
|
688
|
+
post_failed_do: "Check General's chat connection in Settings → Chat & connections, then make the change again.",
|
|
689
|
+
unknown: "No General could take the confirm card for this change.",
|
|
690
|
+
go: "Open",
|
|
691
|
+
codeLead: "Or confirm it here with the code from your authenticator app.",
|
|
692
|
+
codeLabel: "Authenticator code", codeGo: "Confirm",
|
|
693
|
+
codeWrong: "That code is not right. Use the current code in your authenticator app.",
|
|
694
|
+
codePaused: "Too many wrong codes. Try again in {0} minutes.",
|
|
695
|
+
codeNotHere: "This page can no longer confirm it with a code.",
|
|
696
|
+
codeUnavailable: "The code could not be checked. Try again.",
|
|
697
|
+
codeChanged: "This change is no longer the one shown here. Reload the page and check it again.",
|
|
698
|
+
onHost: "This change can't be confirmed over a link. Confirm it in the browser on the computer running AgEnD, or in General.",
|
|
699
|
+
hostBrowser: "This change opens a link to this fleet, so only the browser on the computer running AgEnD can confirm it. Do it there.",
|
|
700
|
+
codeSetUp: "To confirm changes here with a code, set up an authenticator app in Access & security.",
|
|
701
|
+
},
|
|
702
|
+
"zh-TW": {
|
|
703
|
+
no_chat: "這個 Fleet 沒有連接聊天平台,所以沒有 General 可以接收確認卡。",
|
|
704
|
+
no_chat_do: "這台電腦的擁有者可以在這裡按「立即套用」確認。若要從 Discord 或 Telegram 確認,請到「設定 → 聊天與連線」連接其中一個。",
|
|
705
|
+
cross_platform: "這項變更涉及多個聊天平台,沒有單一的 General 可以確認。",
|
|
706
|
+
cross_platform_do: "請一次只變更一個平台。",
|
|
707
|
+
no_general: "已連接的聊天平台中沒有任何 Agent 是 General,所以確認卡無處可送。",
|
|
708
|
+
no_general_do: "請到「設定 → Agent」把一個 Agent 設為 General,再重新做一次這項變更。",
|
|
709
|
+
chat_disconnected: "General 的聊天平台目前沒有連線,確認卡無法送出。",
|
|
710
|
+
chat_disconnected_do: "請到「設定 → 聊天與連線」檢查連線,再重新做一次這項變更。",
|
|
711
|
+
no_topic: "General 在聊天平台上還沒有主題,確認卡無處可送。",
|
|
712
|
+
no_topic_do: "請先在 General 的聊天中傳一則訊息,再重新做一次這項變更。",
|
|
713
|
+
post_failed: "確認卡無法傳到 General。",
|
|
714
|
+
post_failed_do: "請到「設定 → 聊天與連線」檢查 General 的連線,再重新做一次這項變更。",
|
|
715
|
+
unknown: "這項變更沒有 General 可以接收確認卡。",
|
|
716
|
+
go: "前往",
|
|
717
|
+
codeLead: "也可以在這裡輸入驗證器 App 的代碼確認。",
|
|
718
|
+
codeLabel: "驗證器代碼", codeGo: "確認",
|
|
719
|
+
codeWrong: "代碼不正確,請使用驗證器 App 目前顯示的代碼。",
|
|
720
|
+
codePaused: "錯誤次數太多,請 {0} 分鐘後再試。",
|
|
721
|
+
codeNotHere: "這個頁面已無法用代碼確認這項變更。",
|
|
722
|
+
codeUnavailable: "無法檢查代碼,請再試一次。",
|
|
723
|
+
codeChanged: "這項變更已不是這裡顯示的內容,請重新整理頁面再確認一次。",
|
|
724
|
+
onHost: "這項變更無法透過連結確認。請在執行 AgEnD 的那台電腦的瀏覽器中確認,或在 General 確認。",
|
|
725
|
+
hostBrowser: "這項變更會開放一條連到這個 fleet 的連結,只有執行 AgEnD 的那台電腦上的瀏覽器能確認。請到那裡操作。",
|
|
726
|
+
codeSetUp: "若要在這裡用代碼確認變更,請先到「存取與安全」設定驗證器 App。",
|
|
727
|
+
},
|
|
728
|
+
});
|
|
729
|
+
const PENDING_HOST_REASONS = ["no_chat", "cross_platform", "no_general", "chat_disconnected", "no_topic", "post_failed"];
|
|
730
|
+
const PENDING_HOST_GO = { no_chat: "chat", no_general: "agents", chat_disconnected: "chat", post_failed: "chat" };
|
|
731
|
+
/**
|
|
732
|
+
* alpha.6 feedback #2c (the user's decision hmsg-468cc290): on a web-only fleet's own page, a local admin who is not the host
|
|
733
|
+
* operator confirms a pending change with the owner's authenticator code. The server decides who may (p.confirmWithCode, from
|
|
734
|
+
* the view's `totp`) and checks the code; this only asks for it and says the answer.
|
|
735
|
+
*/
|
|
736
|
+
function PendingCode({ p }) {
|
|
737
|
+
const [code, setCode] = useState(""), [busy, setBusy] = useState(false), [msg, setMsg] = useState("");
|
|
738
|
+
const go = async (e) => {
|
|
739
|
+
e.preventDefault();
|
|
740
|
+
if (busy || !/^\d{6}$/.test(code.replace(/\s+/g, ""))) return;
|
|
741
|
+
setBusy(true); setMsg("");
|
|
742
|
+
const r = await p.confirmWithCode(code);
|
|
743
|
+
setBusy(false); setCode("");
|
|
744
|
+
if (r && r.ok) return;
|
|
745
|
+
const why = r && r.error;
|
|
746
|
+
setMsg(why === "wrong" ? t("pendingHost.codeWrong") : why === "paused" ? t("pendingHost.codePaused", Math.max(1, Math.ceil((r.retryAfterMs || 60000) / 60000)))
|
|
747
|
+
: why === "not_here" ? t("pendingHost.codeNotHere") : why === "changed" ? t("pendingHost.codeChanged") : t("pendingHost.codeUnavailable"));
|
|
748
|
+
};
|
|
749
|
+
return html`<form class="pending-self pending-code" onSubmit=${go}>
|
|
750
|
+
<span class="note">${t("pendingHost.codeLead")}</span>
|
|
751
|
+
<label class="field-row"><span class="sr-only">${t("pendingHost.codeLabel")}</span>
|
|
752
|
+
<input class="pending-code-input" inputmode="numeric" autocomplete="one-time-code" maxlength="7" placeholder="000000" aria-label=${t("pendingHost.codeLabel")}
|
|
753
|
+
value=${code} disabled=${busy} onInput=${(e) => setCode(e.target.value)} />
|
|
754
|
+
<button type="submit" class="btn btn-sm btn-primary" disabled=${busy || !/^\d{6}$/.test(code.replace(/\s+/g, ""))}>${t("pendingHost.codeGo")}</button></label>
|
|
755
|
+
</form>${msg ? html`<p class="note" role="alert">${msg}</p>` : null}`;
|
|
756
|
+
}
|
|
666
757
|
function PendingHow({ p }) {
|
|
667
758
|
const a = useWebAuthorization();
|
|
668
759
|
const [refused, setRefused] = useState(false);
|
|
669
760
|
const c = p.confirmation || {}, cmd = `agend settings confirm ${p.id}`;
|
|
670
|
-
const
|
|
761
|
+
const why = c.kind === "host_cli" && PENDING_HOST_REASONS.includes(c.reason) ? c.reason : null;
|
|
762
|
+
const lead = c.kind === "posting" ? t("app.pendingPosting") : c.kind === "host_cli" ? t(`pendingHost.${why || "unknown"}`) : t("app.pendingChatWhere", whereText(c.where));
|
|
763
|
+
const go = why && Object.hasOwn(PENDING_HOST_GO, why) ? PENDING_HOST_GO[why] : null;
|
|
671
764
|
// A browser that isn't verified but could be: authorizing it makes this one (and later ones) "Apply now".
|
|
672
765
|
const route = c.kind !== "host_cli" && !p.applyNow && a.st;
|
|
673
766
|
const canAsk = route && a.st.state === "none" && (a.st.reason === "not_authorized" || a.st.reason === "authorization_expired");
|
|
674
767
|
const asking = route && a.st.state === "pending";
|
|
675
768
|
const apply = async () => { setRefused(false); const r = await p.applyNow(); if (!r || !r.ok) setRefused(true); };
|
|
676
769
|
return html`<p class="note">${lead}</p>
|
|
770
|
+
${why ? html`<p class="note pending-why">${t(`pendingHost.${why}_do`)}${go ? html` <a class="btn btn-sm" href=${settingsPath(go)}>${t("pendingHost.go")}</a>` : null}</p>` : null}
|
|
771
|
+
${p.confirmWithCode && !p.applyNow ? html`<${PendingCode} p=${p} />` : null}
|
|
772
|
+
${p.onHost && !p.applyNow ? html`<p class="note pending-on-host">${t("pendingHost.onHost")}</p>` : null}
|
|
773
|
+
${p.hostBrowser && !p.applyNow ? html`<p class="note pending-host-browser">${t("pendingHost.hostBrowser")}</p>` : null}
|
|
774
|
+
${p.totpNotSetUp && !p.applyNow ? html`<p class="note pending-code-setup">${t("pendingHost.codeSetUp")} <a class="btn btn-sm" href=${settingsPath("access")}>${t("pendingHost.go")}</a></p>` : null}
|
|
677
775
|
${p.applyNow ? html`<div class="pending-self"><span class="note">${t("app.pendingSelf")}</span>
|
|
678
776
|
<button type="button" class="btn btn-sm btn-primary" onClick=${apply}>${t("app.pendingApplyNow")}</button></div>` : null}
|
|
679
777
|
${refused && !p.applyNow ? html`<p class="note" role="status">${t("app.pendingApplyRefused")}</p>` : null}
|
|
@@ -681,7 +779,7 @@ function PendingHow({ p }) {
|
|
|
681
779
|
<button type="button" class="btn btn-sm" onClick=${a.ask}>${t("webauth.authorize")}</button></div>` : null}
|
|
682
780
|
${asking ? html`<p class="note">${t("webauth.waiting", mmss(a.left))}</p>` : null}
|
|
683
781
|
${a.notice && (canAsk || asking) ? html`<p class="note" role="status">${a.notice}</p>` : null}
|
|
684
|
-
|
|
782
|
+
<details class="pending-host"><summary>${t("app.pendingAdvanced")}</summary><code>${cmd}</code></details>`;
|
|
685
783
|
}
|
|
686
784
|
|
|
687
785
|
/** Settings' Apply, followed from another panel: one line, and the way back to it (§5: progress shows in any panel). */
|
|
@@ -721,10 +819,12 @@ export async function refreshRestartPending() {
|
|
|
721
819
|
* Restart now asks first and is never automatic (the leader's default: a Save that restarted on its own once took 33
|
|
722
820
|
* agents down at once). Asked again whenever a Save or a restart settles. Left to the Save in hand while it runs or offers
|
|
723
821
|
* its own restart (Settings' card, or the line above in another panel). Over a temporary public link it says so and
|
|
724
|
-
* offers nothing
|
|
822
|
+
* offers nothing. Restart now is a separate button when a Settings job exists. This muted hint is the no-job case
|
|
823
|
+
* only (a hand edit of fleet.yaml): chat fleets send /restart in General; web-only fleets are told to restart AgEnD,
|
|
824
|
+
* with no command. web-claude will add a button for that case separately.
|
|
725
825
|
*/
|
|
726
826
|
function RestartLine() {
|
|
727
|
-
const { restartPending: pending, settingsOp: op, restartRunner } = useStore(appStore);
|
|
827
|
+
const { restartPending: pending, settingsOp: op, restartRunner, connections } = useStore(appStore);
|
|
728
828
|
const [later, setLater] = useState(null);
|
|
729
829
|
const [busy, setBusy] = useState(false);
|
|
730
830
|
const settled = !op || (!["writing", "posting", "watching"].includes(op.phase) && op.restart !== "busy");
|
|
@@ -734,6 +834,10 @@ function RestartLine() {
|
|
|
734
834
|
const seen = `${pending.jobId}|${pending.keys.join(",")}`;
|
|
735
835
|
if (later === seen) return null;
|
|
736
836
|
const canRestart = !!pending.jobId && typeof restartRunner === "function";
|
|
837
|
+
// connections === 0 is web-only; null is unknown — do not name General.
|
|
838
|
+
const hint = !pending.jobId
|
|
839
|
+
? t(connections > 0 ? "app.restartOnHostChat" : "app.restartOnHost")
|
|
840
|
+
: null;
|
|
737
841
|
const restart = async () => {
|
|
738
842
|
if (!(await confirmDialog({ title: t("app.restartNow"), message: t("app.restartConfirm"), confirmLabel: t("app.restartNow"), danger: true }))) return;
|
|
739
843
|
setBusy(true);
|
|
@@ -749,7 +853,7 @@ function RestartLine() {
|
|
|
749
853
|
return html`<div data-trust="status" class="conn restart-line lbar" role="status">
|
|
750
854
|
<span>${t("app.restartWaiting", Math.max(1, pending.keys.length))}</span>
|
|
751
855
|
${pending.keys.length ? html`<span class="muted restart-keys">${pending.keys.join(", ")}</span>` : null}
|
|
752
|
-
${
|
|
856
|
+
${hint ? html`<span class="muted">${hint}</span>` : null}
|
|
753
857
|
${canRestart ? html`<button type="button" class="btn btn-sm btn-primary" disabled=${busy} onClick=${restart}>${t("app.restartNow")}</button>` : null}
|
|
754
858
|
<button type="button" class="btn btn-sm" onClick=${() => setLater(seen)}>${t("app.restartLater")}</button></div>`;
|
|
755
859
|
}
|
|
@@ -914,4 +1018,3 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
|
|
|
914
1018
|
<${Toasts} />
|
|
915
1019
|
</div>`;
|
|
916
1020
|
}
|
|
917
|
-
|
|
@@ -116,9 +116,9 @@ export function createNoticesSync({ store, fetchList, setTimer = (fn, ms) => set
|
|
|
116
116
|
function read() {
|
|
117
117
|
return (inFlight ??= Promise.resolve().then(fetchList).then((d) => {
|
|
118
118
|
if (!d || !Array.isArray(d.items)) throw new Error("no list");
|
|
119
|
-
store.set({ notices: mergeNoticeList(store.get().notices, d) });
|
|
119
|
+
store.set({ notices: mergeNoticeList(store.get().notices, d), noticesError: false });
|
|
120
120
|
return true;
|
|
121
|
-
}).catch(() => false).then((ok) => {
|
|
121
|
+
}).catch(() => { store.set({ noticesError: true }); return false; }).then((ok) => {
|
|
122
122
|
inFlight = null;
|
|
123
123
|
if (behind()) later(ok ? NOTICES_RETRY_MS.stale : NOTICES_RETRY_MS.failed);
|
|
124
124
|
else retryAt = 0;
|
package/dist/ui/shared/app.css
CHANGED
|
@@ -4075,3 +4075,32 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
|
|
|
4075
4075
|
.agent-runtime-change-dialog .dlg-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
|
|
4076
4076
|
@media(max-width:600px){.agent-runtime-change-dialog.dlg{width:100vw;max-width:none;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.agent-runtime-change-dialog .dlg-box{height:100%;max-height:100dvh}}
|
|
4077
4077
|
@media(max-width:600px){.agent-runtime-settings{align-items:flex-start;flex-direction:column}.agent-runtime-settings>.btn{align-self:flex-end}}
|
|
4078
|
+
.runtime-cli-install { margin: 0 0 16px; }
|
|
4079
|
+
.runtime-cli-install h4 { margin: 0 0 6px; font-size: var(--fs-sm); font-weight: 500; }
|
|
4080
|
+
.runtime-cli-install .note { margin: 4px 0 0; font-size: var(--fs-xs); }
|
|
4081
|
+
.runtime-cli-install-list { list-style: none; margin: 0 0 6px; padding: 0; }
|
|
4082
|
+
.runtime-cli-install-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
|
|
4083
|
+
.runtime-cli-install-list li .btn { margin-inline-start: auto; }
|
|
4084
|
+
.runtime-cli-install pre { margin: 4px 0; overflow-x: auto; }
|
|
4085
|
+
.runtime-cli-install code { font: var(--fs-xs)/1.5 var(--font-mono); overflow-wrap: anywhere; }
|
|
4086
|
+
.runtime-cli-install-others { margin-top: 8px; }
|
|
4087
|
+
.runtime-cli-install-others ul { list-style: none; margin: 4px 0 0; padding: 0; }
|
|
4088
|
+
|
|
4089
|
+
/* Quota preferences obey the panel CSP: no inline styles. */
|
|
4090
|
+
.p-settings .s-quota-fields { border: 0; padding: 0; min-width: 0; }
|
|
4091
|
+
|
|
4092
|
+
/* alpha.6 feedback (#3): one Settings card. Every section's top-level card has the same frame: a 1px border, the --r-md
|
|
4093
|
+
corners the lists, drawers and disclosures beside it already have, and 24px inside (16px on a phone). The editor and the
|
|
4094
|
+
terminal cards stay full-bleed; a card inside a drawer or a disclosure is part of that box. Nothing in a card is wider
|
|
4095
|
+
than the card: a select is as wide as its longest option unless bounded (a paired PC's long name ran the General
|
|
4096
|
+
location card off the right edge). */
|
|
4097
|
+
.p-settings .s-section-layout :is(.card, details.s-ui-disclosure, .runtime-connect-guide, .s-look-advanced):not(:is(details, .drawer-body, .s-disclosure-body, .s-look-disclosure-body) *) { border: 1px solid var(--border); border-radius: var(--r-md); }
|
|
4098
|
+
.p-settings .s-section-layout .card:not(.s-dev, .s-access-terminal):not(:is(details, .drawer-body, .s-disclosure-body, .s-look-disclosure-body) *) { padding: 24px; }
|
|
4099
|
+
@media (max-width: 600px) {
|
|
4100
|
+
.p-settings .s-section-layout .card:not(.s-dev, .s-access-terminal):not(:is(details, .drawer-body, .s-disclosure-body, .s-look-disclosure-body) *) { padding: 16px; }
|
|
4101
|
+
}
|
|
4102
|
+
.p-settings .s-section-layout :is(select, textarea, input:not([type="checkbox"], [type="radio"])) { max-width: 100%; }
|
|
4103
|
+
.general-location-row { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
|
|
4104
|
+
.general-location-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; }
|
|
4105
|
+
.general-location-now > span { color: var(--text-2); }
|
|
4106
|
+
.general-location-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
|
package/dist/ui/shared/app.js
CHANGED
|
@@ -65,7 +65,8 @@ if (hubPage) {
|
|
|
65
65
|
// A chat that loaded late catches up on what is open now; the shell shows that while it is not done, with Retry.
|
|
66
66
|
stream.on("hydration", (hydration) => appStore.set({ hydration }));
|
|
67
67
|
appStore.set({ retryHydration: () => stream.catchUp() });
|
|
68
|
-
|
|
68
|
+
appStore.set({ needsLoaded: false });
|
|
69
|
+
stream.on("needs", (d) => appStore.set({ needsLoaded: true, needs: Array.isArray(d && d.items) ? d.items : [] }));
|
|
69
70
|
// #1218: a panel's way to hear one stream event (the Log's steps_tick), unsubscribed by its lease.
|
|
70
71
|
appStore.set({ streamOn: (name, fn) => stream.on(name, fn) });
|
|
71
72
|
appStore.set({ connection: stream.connection() });
|
|
@@ -30,10 +30,10 @@ register("chat", {
|
|
|
30
30
|
you: "You", sending: "Sending…", uploadingFile: "Uploading {0}", uploadWaiting: "waiting", uploadFailed: "failed",
|
|
31
31
|
uploadNoConnection: "the upload was cut off — check the connection", sendNoConnection: "it did not reach AgEnD — check the connection", notSentBecause: "Not sent: {0}", deleteUnsent: "Delete",
|
|
32
32
|
sendFailure_wake_capacity: "No slot is free to wake this instance. Retry when another instance is idle.",
|
|
33
|
-
sendFailure_wake_credentials: "The instance could not sign in.
|
|
34
|
-
sendFailure_wake_timeout: "The instance did not become ready in time. Retry, or check its status
|
|
35
|
-
sendFailure_instance_stopped: "This instance was stopped or removed. Start it
|
|
36
|
-
sendFailure_delivery_unavailable: "The instance could not receive this message. Check its status
|
|
33
|
+
sendFailure_wake_credentials: "The instance could not sign in. Sign it in from Settings → Agents → AI sign-ins and API keys → Accounts, or send /login in chat, then retry.",
|
|
34
|
+
sendFailure_wake_timeout: "The instance did not become ready in time. Retry, or check its status in Fleet.",
|
|
35
|
+
sendFailure_instance_stopped: "This instance was stopped or removed. Start it from the agent's chat menu → Start instance, then retry.",
|
|
36
|
+
sendFailure_delivery_unavailable: "The instance could not receive this message. Check its status in Fleet, then retry.",
|
|
37
37
|
sendFailure_machine_limit: "This Windows computer already runs its limit of {0} agents: {1}. Stop one of them (or check and unlock one marked “outcome unknown”), then retry.",
|
|
38
38
|
machineLimitUnknown: "{0} (outcome unknown)",
|
|
39
39
|
sendFailure_delivery_changed: "The session or instance changed before this message was sent. Sign in again if needed, then retry.",
|
|
@@ -197,10 +197,10 @@ register("chat", {
|
|
|
197
197
|
you: "你", sending: "傳送中…", uploadingFile: "正在上傳 {0}", uploadWaiting: "等待中", uploadFailed: "失敗",
|
|
198
198
|
uploadNoConnection: "上傳中斷了,請檢查網路連線", sendNoConnection: "沒有送到 AgEnD,請檢查網路連線", notSentBecause: "沒有送出:{0}", deleteUnsent: "刪除",
|
|
199
199
|
sendFailure_wake_capacity: "目前沒有空位可喚醒這個實例。請等其他實例閒置後重試。",
|
|
200
|
-
sendFailure_wake_credentials: "
|
|
201
|
-
sendFailure_wake_timeout: "
|
|
202
|
-
sendFailure_instance_stopped: "
|
|
203
|
-
sendFailure_delivery_unavailable: "
|
|
200
|
+
sendFailure_wake_credentials: "實例無法登入。請到設定 → Agents →「AI 登入與 API 金鑰」→「帳號」登入,或在聊天傳 /login,再重試。",
|
|
201
|
+
sendFailure_wake_timeout: "實例未能及時就緒。請重試,或到 Fleet 查看它的狀態。",
|
|
202
|
+
sendFailure_instance_stopped: "這個實例已停止或移除。請先從該 agent 的聊天選單按「啟動 instance」,再重試。",
|
|
203
|
+
sendFailure_delivery_unavailable: "實例目前無法接收這則訊息。請到 Fleet 查看它的狀態,再重試。",
|
|
204
204
|
sendFailure_machine_limit: "這台 Windows 電腦同時執行的 agent 已達上限 {0} 個:{1}。請先停止其中一個(或檢查並解鎖標示「結果未知」的那個),再重試。",
|
|
205
205
|
machineLimitUnknown: "{0}(結果未知)",
|
|
206
206
|
sendFailure_delivery_changed: "訊息送出前,登入或實例狀態已改變。必要時請重新登入,再重試。",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
.hub-chat { flex: 1; min-height: 0; display: flex; }
|
|
47
47
|
.hub-chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
|
|
48
48
|
.hub-chat-head { display: flex; align-items: center; gap: var(--s-2); min-height: var(--header-h, 52px); padding: 0 var(--s-4); border-bottom: 1px solid var(--border); flex: none; }
|
|
49
|
+
.hub-chat-head .skeleton { padding: 0; margin: 0; }
|
|
49
50
|
.hub-chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
50
51
|
.hub-chat-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
51
52
|
.hub-chat-title .s { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
.hub-row-text .note { overflow-wrap: anywhere; }
|
|
15
15
|
.hub-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
|
|
16
16
|
.hub-card-head h3 { margin: 0; color: var(--text); font-size: var(--fs-lg); text-transform: none; letter-spacing: 0; }
|
|
17
|
-
.hub-grant { display: flex; flex-direction: column; gap: var(--s-3); }
|
|
18
|
-
.hub-grant .field { margin: 0; }
|
|
17
|
+
.hub-grant.form { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-3); }
|
|
18
|
+
.hub-grant.form .field { flex: none; margin: 0; }
|
|
19
19
|
.hub-danger h3 { color: var(--danger); }
|
|
20
20
|
.hub-steps { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); counter-reset: hub-step; }
|
|
21
21
|
.hub-steps > li { display: flex; align-items: flex-start; gap: var(--s-3); counter-increment: hub-step; }
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
.hub-step-form .field { margin: 0; flex: 1; min-width: 12em; }
|
|
30
30
|
.hub-steps .hub-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; margin: 0; padding: 0; }
|
|
31
31
|
.hub-steps > li::before { align-self: flex-start; margin-top: 1px; }
|
|
32
|
-
.hub-steps .hub-offer > * { text-align: start; align-self: flex-start; justify-self: start; }
|
|
32
|
+
.hub-steps .hub-offer > * { text-align: start; align-self: flex-start; justify-self: start; margin-left: 0; } /* hub.css's `.hub-steps small` auto margin would push a short line right */
|
|
33
33
|
@media (max-width: 899px) { .hub-page-body { padding: var(--s-3) var(--s-4) var(--s-6); } }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* alpha.6 feedback: the Hub's signed-out page — AgEnD's sign-in style (signin.html): one centred card on the page's
|
|
2
|
+
background; while it shows, the shell's sidebar and tabs are hidden (focus and screen readers skip them too). Linked
|
|
3
|
+
by panel-hub.js's HubSignIn. Tokens only: both themes follow. */
|
|
4
|
+
body.hub-signed-out #sidebar, body.hub-signed-out nav.tabs { visibility: hidden; }
|
|
5
|
+
.hub-signin-page { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
|
|
6
|
+
overflow: auto; background: var(--bg); color: var(--text); }
|
|
7
|
+
.hub-signin-card { width: 100%; max-width: 380px; margin: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
|
|
8
|
+
padding: 28px 24px; box-sizing: border-box; }
|
|
9
|
+
.hub-signin-brand { display: flex; flex-direction: column; gap: 2px; margin: 0 0 18px; }
|
|
10
|
+
.hub-signin-brand strong { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
|
|
11
|
+
.hub-signin-brand span { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
|
|
12
|
+
.hub-signin-card h1 { margin: 0 0 6px; font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
|
|
13
|
+
.hub-signin-lead { margin: 0 0 18px; color: var(--text-2); }
|
|
14
|
+
.hub-signin-form { display: flex; flex-direction: column; }
|
|
15
|
+
.hub-signin-form label { display: block; margin: 0 0 6px; font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
|
|
16
|
+
.hub-signin-form input { width: 100%; box-sizing: border-box; margin: 0 0 14px; padding: 11px 12px; font: inherit; background: var(--bg); color: var(--text);
|
|
17
|
+
border: 1px solid var(--border-strong); border-radius: var(--r-sm); }
|
|
18
|
+
.hub-signin-form input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-dim); }
|
|
19
|
+
.hub-signin-go { width: 100%; margin-top: 4px; padding: 12px; font: var(--fw-semibold) var(--fs-md) var(--font-ui); color: var(--on-accent);
|
|
20
|
+
background: var(--accent-fill); border: 0; border-radius: var(--r-full); cursor: pointer; }
|
|
21
|
+
.hub-signin-go:hover:not(:disabled) { opacity: .88; }
|
|
22
|
+
.hub-signin-go:disabled { opacity: .6; cursor: default; }
|
|
23
|
+
.hub-signin-go:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
|
24
|
+
.hub-signin-msg { min-height: 1.5em; margin: 14px 0 0; font-size: var(--fs-sm); color: var(--danger); }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* The shared Skeleton's calm content shapes, including before the app's modules arrive. No shimmer or spinner. */
|
|
2
|
+
.skeleton { box-sizing: border-box; width: 100%; min-width: 0; }
|
|
3
|
+
.skeleton > [aria-hidden] { display: flex; flex-direction: column; gap: 14px; width: 100%; }
|
|
4
|
+
.skeleton .sk-line { height: 14px; flex-shrink: 0; background: var(--surface-2, #e8e8eb); border-radius: 5px; }
|
|
5
|
+
.sk-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 0; }
|
|
6
|
+
.sk-row .sk-thumb { width: 36px; height: 36px; border-radius: 9px; }
|
|
7
|
+
.sk-row .sk-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 9px; }
|
|
8
|
+
.sk-row .sk-copy .sk-line { width: 76%; height: 12px; }
|
|
9
|
+
.sk-row .sk-copy .sk-line + .sk-line { width: 51%; height: 10px; }
|
|
10
|
+
.sk-row .sk-pill { width: 52px; height: 22px; border-radius: 99px; }
|
|
11
|
+
.sk-cards .sk-row { min-height: 104px; border-bottom: 1px solid var(--border, #ddd); }
|
|
12
|
+
.sk-inline { max-width: 140px; min-width: 90px; padding: 0; margin: 0; }
|
|
13
|
+
.s-profile { position: relative; }
|
|
14
|
+
.s-profile-fields { display: flex; flex-direction: column; gap: var(--s-3, 12px); }
|
|
15
|
+
.sk-reserve { visibility: hidden; pointer-events: none; }
|
|
16
|
+
.sk-profile-cover { position: absolute; inset: 52px 16px 16px; }
|
|
17
|
+
.s-pref-profile-fields > .sk-profile-cover { inset: 0; }
|
|
18
|
+
.sk-profile-cover .skeleton { padding: 0; margin: 0; max-width: none; }
|
|
19
|
+
.sk-form .sk-line:nth-child(3) { width: 100%; height: 40px; }
|
|
20
|
+
.sk-form .sk-line:nth-child(4) { width: 48%; height: 32px; border-radius: 99px; }
|
|
21
|
+
.sk-boot { display: flex; height: 100dvh; background: var(--bg, #f6f6f8); }
|
|
22
|
+
.sk-boot-side { width: var(--sidebar-w, 248px); padding: 28px 20px; border-right: 1px solid var(--border, #ddd); }
|
|
23
|
+
.sk-boot-main { flex: 1; min-width: 0; }
|
|
24
|
+
.sk-boot-head { height: 64px; border-bottom: 1px solid var(--border, #ddd); }
|
|
25
|
+
.sk-boot-head .sk-line { width: 160px; }
|
|
26
|
+
.sk-boot .skeleton { margin: 0; max-width: 760px; opacity: 1; animation: none; }
|
|
27
|
+
.sk-boot .sk-line { height: 14px; background: var(--surface-2, #e8e8eb); }
|
|
28
|
+
.signin-card { position: relative; }
|
|
29
|
+
/* Reserve the real, translated form's size while the session is checked; hidden fields cannot be focused. */
|
|
30
|
+
.signin-card:has(#checking:not([hidden])) #form[hidden] { display: block !important; visibility: hidden; pointer-events: none; }
|
|
31
|
+
.sk-signin { position: absolute; inset: 72px 24px 28px; width: auto; padding: 0; margin: 0; max-width: none; }
|
|
32
|
+
.sk-signin > [aria-hidden] { gap: 18px; }
|
|
33
|
+
.sk-signin .sk-line:first-child { width: 70%; height: 26px; }
|
|
34
|
+
.sk-signin .sk-line:nth-child(3) { width: 100%; height: 48px; }
|
|
35
|
+
.sk-signin .sk-line:nth-child(4) { width: 100%; height: 42px; border-radius: 99px; }
|
|
36
|
+
@media (max-width: 899px) { .sk-boot-side { display: none; } }
|
|
37
|
+
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; opacity: 1; } }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// #2911 (6): every page in the thread — the list the preview panel shows. A page is what preview-versions.js counts as
|
|
2
|
+
// versions of one thing: the agent's complete ```html blocks with one <title> (the untitled ones together), or its
|
|
3
|
+
// attached .html files of one name. Pure: the panel draws it; nothing here runs a preview.
|
|
4
|
+
import "./chat-render.js";
|
|
5
|
+
import { htmlTitle } from "./preview-versions.js";
|
|
6
|
+
|
|
7
|
+
const R = () => globalThis.AgendChatRender;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The pages in `msgs` (in thread order), newest first: [{ id, label, kind: "html" | "file", versions, latest }], where
|
|
11
|
+
* `latest` is the newest version as the panel opens it ({ key, instance, msgKey, n | att, code, sender, ts }; an
|
|
12
|
+
* attached file's code is read when it is opened). `label` is the title, the file name, or "" for untitled blocks.
|
|
13
|
+
*/
|
|
14
|
+
export function pagesOf(msgs, keyOf, instance) {
|
|
15
|
+
const pages = new Map();
|
|
16
|
+
const add = (id, label, kind, spec) => {
|
|
17
|
+
const p = pages.get(id);
|
|
18
|
+
if (p) { p.versions++; p.latest = spec; pages.delete(id); pages.set(id, p); } // re-inserted: newest last
|
|
19
|
+
else pages.set(id, { id, label, kind, versions: 1, latest: spec });
|
|
20
|
+
};
|
|
21
|
+
for (const x of Array.isArray(msgs) ? msgs : []) {
|
|
22
|
+
if (x.role !== "agent") continue;
|
|
23
|
+
const msgKey = keyOf(x);
|
|
24
|
+
R().htmlFences(x.text).forEach((f, n) => {
|
|
25
|
+
if (!f.terminated) return;
|
|
26
|
+
const title = htmlTitle(f.code);
|
|
27
|
+
add(`t:${title}`, title, "html", { key: `${msgKey}:f${n}`, instance, msgKey, n, code: f.code, sender: x.sender, ts: x.ts });
|
|
28
|
+
});
|
|
29
|
+
for (const a of Array.isArray(x.attachments) ? x.attachments : []) {
|
|
30
|
+
if (!R().isHtmlAttachment(a)) continue;
|
|
31
|
+
add(`a:${a.name.trim().toLowerCase()}`, a.name, "file", { key: `${msgKey}:a${a.id}`, instance, msgKey, att: { id: a.id, name: a.name, size: a.size }, code: null, sender: x.sender, ts: x.ts });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return [...pages.values()].reverse();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The page `open` belongs to: its id in pagesOf's terms. */
|
|
38
|
+
export function pageIdOf(open) {
|
|
39
|
+
if (!open) return null;
|
|
40
|
+
return open.att ? `a:${String(open.att.name || "").trim().toLowerCase()}` : `t:${htmlTitle(open.code)}`;
|
|
41
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// #2911: the preview panel's feedback actions — what a person tells the agent about the page it made (M-2217). The
|
|
2
|
+
// panel (preview-panel.js, M-2216's chrome) renders <PanelActions> in its bar, before Download; everything the actions
|
|
3
|
+
// do lives here, so neither side edits the other's file.
|
|
4
|
+
//
|
|
5
|
+
// Nothing here reads or relays the page. A preview's content is the agent's untrusted HTML, so only what the chat
|
|
6
|
+
// already holds goes into the message: a #2272 reply to the message the page came in, and the page's <title> or file
|
|
7
|
+
// name as one line of plain text in the composer — where the person edits it and sends it themselves. What goes is an
|
|
8
|
+
// ordinary message (Discord first): no new channel, nothing sent by itself.
|
|
9
|
+
|
|
10
|
+
import { html, useEffect, useState } from "/assets/app-html.js";
|
|
11
|
+
import { t } from "/assets/app-i18n.js";
|
|
12
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
13
|
+
import { closePanel, frameKey, htmlTitle } from "./preview-panel.js";
|
|
14
|
+
|
|
15
|
+
const P = () => globalThis.AgendPreview;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The chat registers how to reach its composer (panel-chat.js): { findMsg(instance, msgKey), startReply(instance, msg),
|
|
19
|
+
* clearReply(instance), addToDraft(instance, line), focus() }. null: no chat is mounted, and the actions are not shown.
|
|
20
|
+
*/
|
|
21
|
+
let chat = null;
|
|
22
|
+
export function setPanelFeedback(deps) { chat = deps || null; }
|
|
23
|
+
/** Hub E (#3226): the deps in force, so a room that leaves clears only its own (#3278 review). */
|
|
24
|
+
export const panelFeedback = () => chat;
|
|
25
|
+
/**
|
|
26
|
+
* Hub E (#3226): a page's Share (page-share-dialog.js) is the fleet's only. The fleet registers it (its
|
|
27
|
+
* /ui/js/preview-panel.js); without it the bar has no Share.
|
|
28
|
+
*/
|
|
29
|
+
let ShareButton = null;
|
|
30
|
+
export function setShareButton(component) { ShareButton = component || null; }
|
|
31
|
+
|
|
32
|
+
/** The most of a page's title or file name the line carries. */
|
|
33
|
+
export const NAME_MAX = 80;
|
|
34
|
+
|
|
35
|
+
/** One line of plain text: format characters removed, whitespace and control characters collapsed, cut at NAME_MAX characters. */
|
|
36
|
+
export function plainName(value) {
|
|
37
|
+
// \p{Cf} first (bidi controls, zero-widths): what the person reads is what is sent (#2914 review).
|
|
38
|
+
const s = String(value == null ? "" : value).replace(/\p{Cf}+/gu, "").replace(/[\s\u0000-\u001f\u007f-\u009f\u2028\u2029]+/gu, " ").trim();
|
|
39
|
+
const chars = [...s];
|
|
40
|
+
return chars.length > NAME_MAX ? `${chars.slice(0, NAME_MAX - 1).join("")}…` : s;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The composer's line naming the page: its <title>, else the attached file's name, else "this page". */
|
|
44
|
+
export function aboutLine(open) {
|
|
45
|
+
if (!open) return "";
|
|
46
|
+
const name = plainName(htmlTitle(open.code || "")) || plainName(open.att && open.att.name);
|
|
47
|
+
return name ? t("chat.pvFbAboutNamed", name) : t("chat.pvFbAboutThis");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Reply about the open page: a reply to the message it came in (while the thread still has it), and the line naming
|
|
52
|
+
* the page added to the composer (never twice). Returns false when there is nothing to do it with.
|
|
53
|
+
*/
|
|
54
|
+
export function replyAboutPage(open, deps = chat) {
|
|
55
|
+
if (!open || !deps) return false;
|
|
56
|
+
const msg = open.msgKey ? deps.findMsg(open.instance, open.msgKey) : null;
|
|
57
|
+
// The page's message gone from the thread: no reply — and not one to another message started earlier, which the
|
|
58
|
+
// line naming this page would be sent as (#2913 review).
|
|
59
|
+
if (msg) deps.startReply(open.instance, msg);
|
|
60
|
+
else deps.clearReply(open.instance);
|
|
61
|
+
deps.addToDraft(open.instance, aboutLine(open));
|
|
62
|
+
deps.focus();
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* #2911: the lines the errors chip adds — a header saying the text below is the page's, then each kept error quoted
|
|
68
|
+
* ("> "), already one line of plain text (preview.js), and how many more there were. `log`: P().errors(key).
|
|
69
|
+
*/
|
|
70
|
+
export function errorLines(log) {
|
|
71
|
+
if (!log || !log.count) return [];
|
|
72
|
+
const kind = { error: "", rejection: t("chat.pvFbErrRejection"), console: "console.error: ", blocked: t("chat.pvCdnBlocked") };
|
|
73
|
+
const lines = [t(log.count === 1 ? "chat.pvFbErrHeadOne" : "chat.pvFbErrHead", String(log.count))];
|
|
74
|
+
for (const x of log.items) lines.push(`> ${kind[x.kind] ?? ""}${plainName(x.message)}${x.line ? ` (${t("chat.pvFbErrAt", String(x.line), String(x.col))})` : ""}`);
|
|
75
|
+
const more = log.count - log.items.length;
|
|
76
|
+
if (more > 0) lines.push(t("chat.pvFbErrMore", String(more)));
|
|
77
|
+
return lines;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The errors chip's click: reply about the page, then the error lines (each once) — the person edits and sends. */
|
|
81
|
+
export function sendErrors(open, log, deps = chat) {
|
|
82
|
+
if (!replyAboutPage(open, deps)) return false;
|
|
83
|
+
for (const line of errorLines(log)) deps.addToDraft(open.instance, line);
|
|
84
|
+
deps.focus();
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* #2911: the line a picked element adds — where in the page (the selector the page's frame built, as code) and its
|
|
90
|
+
* words, marked as the page's text. Backticks are taken out of the selector so it stays one code span.
|
|
91
|
+
*/
|
|
92
|
+
export function pickLine(result) {
|
|
93
|
+
if (!result) return "";
|
|
94
|
+
const where = plainName(String(result.selector || "").replace(/`/g, "")) || "?";
|
|
95
|
+
const words = plainName(result.text);
|
|
96
|
+
return words ? t("chat.pvFbPickWords", where, words) : t("chat.pvFbPickAt", where);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** A picked element: reply about the page, then its line — the person writes what to change after it. */
|
|
100
|
+
export function sendPick(open, result, deps = chat) {
|
|
101
|
+
if (!result || !replyAboutPage(open, deps)) return false;
|
|
102
|
+
deps.addToDraft(open.instance, pickLine(result));
|
|
103
|
+
deps.focus();
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Whether the open page's frame is in pick mode, and its answer handed to sendPick. */
|
|
108
|
+
function usePick(open) {
|
|
109
|
+
const key = open ? frameKey(open.key) : null;
|
|
110
|
+
const [on, setOn] = useState(() => !!(key && P() && P().picking && P().picking(key)));
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
setOn(!!(key && P() && P().picking && P().picking(key)));
|
|
113
|
+
if (!key || !P() || typeof P().onPick !== "function") return undefined;
|
|
114
|
+
return P().onPick((k, result, now) => {
|
|
115
|
+
if (k !== key) return;
|
|
116
|
+
setOn(!!now);
|
|
117
|
+
if (result) { if (narrow()) closePanel(); sendPick(open, result); }
|
|
118
|
+
});
|
|
119
|
+
}, [key]);
|
|
120
|
+
return on;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** The errors the open page's frame reported, re-read when they change. */
|
|
124
|
+
function useErrors(open) {
|
|
125
|
+
const key = open ? frameKey(open.key) : null;
|
|
126
|
+
const read = () => (key && P() && typeof P().errors === "function" ? P().errors(key) : null);
|
|
127
|
+
const [log, setLog] = useState(read);
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
setLog(read());
|
|
130
|
+
if (!key || !P() || typeof P().onErrors !== "function") return undefined;
|
|
131
|
+
return P().onErrors((k) => { if (k === key) setLog(read()); });
|
|
132
|
+
}, [key]);
|
|
133
|
+
return log;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* #2911 item 8: what Share page names — the block of the message the open page came in ({ boot, id } and its fence
|
|
138
|
+
* number or attachment id; the server reads the page itself), its title, and whose reply. null while the thread no
|
|
139
|
+
* longer has that message.
|
|
140
|
+
*/
|
|
141
|
+
export function shareBlock(open, deps = chat) {
|
|
142
|
+
if (!open || !deps) return null;
|
|
143
|
+
const msg = open.msgKey ? deps.findMsg(open.instance, open.msgKey) : null;
|
|
144
|
+
if (!msg || typeof msg.boot !== "string" || typeof msg.id !== "number") return null;
|
|
145
|
+
const from = open.att && typeof open.att.id === "string" ? { boot: msg.boot, id: msg.id, att: open.att.id }
|
|
146
|
+
: Number.isInteger(open.n) ? { boot: msg.boot, id: msg.id, fence: open.n } : null;
|
|
147
|
+
if (!from) return null;
|
|
148
|
+
const title = plainName(htmlTitle(open.code || "")) || plainName(open.att && open.att.name);
|
|
149
|
+
return { instance: open.instance, from, title, sender: msg.sender || open.sender || "", ts: msg.ts || open.ts || "" };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const narrow = () => typeof window !== "undefined" && !!window.matchMedia && window.matchMedia("(max-width: 899px)").matches;
|
|
153
|
+
|
|
154
|
+
/** The bar's actions for the open page. props: open, name, run, view (as the panel has them). */
|
|
155
|
+
export function PanelActions({ open, run }) {
|
|
156
|
+
const log = useErrors(open);
|
|
157
|
+
const picking = usePick(open);
|
|
158
|
+
if (!open || !chat) return null;
|
|
159
|
+
// On a phone the panel is a sheet over the composer: it closes, so the composer is there to type in.
|
|
160
|
+
const reply = () => { if (narrow()) closePanel(); replyAboutPage(open); };
|
|
161
|
+
const send = () => { const now = P().errors(frameKey(open.key)); if (narrow()) closePanel(); sendErrors(open, now); };
|
|
162
|
+
const n = log ? log.count : 0;
|
|
163
|
+
const key = open && frameKey(open.key);
|
|
164
|
+
const canPick = run && run.state === "running" && typeof P().pick === "function";
|
|
165
|
+
const point = () => { P().pick(key, !picking); };
|
|
166
|
+
return html`${ShareButton ? html`<${ShareButton} block=${shareBlock(open)} Icon=${Icon} />` : null}${canPick ? html`<button type="button" class=${`btn btn-sm pv-fb-pick${picking ? " on" : ""}`} aria-pressed=${picking ? "true" : "false"}
|
|
167
|
+
title=${t(picking ? "chat.pvFbPickCancelTitle" : "chat.pvFbPickTitle")} onClick=${point}><${Icon} name="edit" size=${14} /><span class="lbl">${t(picking ? "chat.pvFbPickCancel" : "chat.pvFbPick")}</span></button>` : null}${n ? html`<button type="button" class="btn btn-sm pv-fb-errors" title=${t("chat.pvFbErrTitle")} onClick=${send}><${Icon} name="alert" size=${14} /><span class="pv-fb-n">${n >= P().ERRORS.maxCount ? `${n}+` : String(n)}</span><span class="lbl">${t(n === 1 ? "chat.pvFbErrOne" : "chat.pvFbErrMany")}</span></button>` : null}<button type="button" class="btn btn-sm pv-fb-reply" title=${t("chat.pvFbReplyTitle")} onClick=${reply}><${Icon} name="chat" size=${14} /><span class="lbl">${t("chat.pvFbReply")}</span></button>`;
|
|
168
|
+
}
|