@songsid/agend 2.2.0-beta.1 → 2.2.0-beta.11
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/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agent-cli-instructions.md +16 -9
- package/dist/agent-cli.js +15 -7
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.js +24 -9
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-whats-new.d.ts +47 -0
- package/dist/agent-whats-new.js +147 -0
- package/dist/agent-whats-new.js.map +1 -0
- package/dist/auth-api.d.ts +5 -3
- package/dist/auth-api.js +19 -3
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.d.ts +8 -0
- package/dist/backend/antigravity.js +32 -9
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-carry.d.ts +22 -0
- package/dist/backend/claude-carry.js +170 -0
- package/dist/backend/claude-carry.js.map +1 -0
- package/dist/backend/claude-code.d.ts +65 -2
- package/dist/backend/claude-code.js +226 -33
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-metadata.d.ts +33 -0
- package/dist/backend/codex-metadata.js +122 -18
- package/dist/backend/codex-metadata.js.map +1 -1
- package/dist/backend/codex.d.ts +3 -0
- package/dist/backend/codex.js +17 -1
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +40 -3
- package/dist/backend/credential-profile.js +113 -5
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/effort-metadata.d.ts +37 -1
- package/dist/backend/effort-metadata.js +86 -15
- package/dist/backend/effort-metadata.js.map +1 -1
- package/dist/backend/grok.d.ts +4 -0
- package/dist/backend/grok.js +14 -0
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro-engine-ledger.d.ts +5 -0
- package/dist/backend/kiro-engine-ledger.js +20 -0
- package/dist/backend/kiro-engine-ledger.js.map +1 -1
- package/dist/backend/kiro-identity.d.ts +6 -0
- package/dist/backend/kiro-identity.js +19 -5
- package/dist/backend/kiro-identity.js.map +1 -1
- package/dist/backend/kiro.d.ts +39 -3
- package/dist/backend/kiro.js +143 -19
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/launch-effort.d.ts +61 -0
- package/dist/backend/launch-effort.js +170 -0
- package/dist/backend/launch-effort.js.map +1 -0
- package/dist/backend/muse.d.ts +84 -0
- package/dist/backend/muse.js +449 -53
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +47 -4
- package/dist/backend/types.js +12 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-command.d.ts +91 -0
- package/dist/backend-command.js +122 -0
- package/dist/backend-command.js.map +1 -0
- package/dist/background-work-ended.d.ts +18 -0
- package/dist/background-work-ended.js +30 -0
- package/dist/background-work-ended.js.map +1 -0
- package/dist/cache-service.d.ts +2 -0
- package/dist/cache-service.js +2 -1
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +36 -1
- package/dist/channel/adapters/discord.js +126 -4
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +42 -2
- package/dist/channel/adapters/telegram.js +142 -23
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-server.js +9 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.d.ts +11 -0
- package/dist/channel/mcp-tools.js +26 -13
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/message-edit-errors.d.ts +5 -0
- package/dist/channel/message-edit-errors.js +24 -0
- package/dist/channel/message-edit-errors.js.map +1 -0
- package/dist/channel/telegram-markdown.d.ts +6 -0
- package/dist/channel/telegram-markdown.js +104 -0
- package/dist/channel/telegram-markdown.js.map +1 -0
- package/dist/channel/tool-router.d.ts +2 -0
- package/dist/channel/tool-router.js +10 -4
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +55 -3
- package/dist/cli.js +167 -39
- package/dist/cli.js.map +1 -1
- package/dist/command-table.d.ts +2 -2
- package/dist/command-table.js +6 -3
- package/dist/command-table.js.map +1 -1
- package/dist/config-validator.js +59 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/cross-instance-envelope.d.ts +15 -2
- package/dist/cross-instance-envelope.js +29 -5
- package/dist/cross-instance-envelope.js.map +1 -1
- package/dist/daemon.d.ts +156 -1
- package/dist/daemon.js +773 -89
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +70 -8
- package/dist/delivery-outbox.js +315 -24
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +18 -1
- package/dist/delivery-reconciliation.js +67 -2
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/fleet-context.d.ts +10 -1
- package/dist/fleet-manager.d.ts +404 -13
- package/dist/fleet-manager.js +2039 -210
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/backend-providers/SKILL.md +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +92 -21
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +27 -3
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +8 -8
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +5 -5
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +4 -4
- package/dist/general-knowledge/skills/fleet-restart/SKILL.md +13 -13
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -2
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +6 -0
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +12 -9
- package/dist/general-knowledge/skills/multi-channel/SKILL.md +8 -2
- package/dist/general-knowledge/skills/scheduling/SKILL.md +5 -3
- package/dist/general-knowledge/skills/session-management/SKILL.md +6 -5
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +2 -2
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +8 -3
- package/dist/general-knowledge/steering/core-rules.md +8 -7
- package/dist/host-memory.d.ts +10 -0
- package/dist/host-memory.js +33 -1
- package/dist/host-memory.js.map +1 -1
- package/dist/human-delivery-receipts.d.ts +83 -0
- package/dist/human-delivery-receipts.js +194 -0
- package/dist/human-delivery-receipts.js.map +1 -0
- package/dist/instance-avatar.d.ts +36 -0
- package/dist/instance-avatar.js +57 -0
- package/dist/instance-avatar.js.map +1 -0
- package/dist/instance-config-impact.js +6 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +29 -6
- package/dist/instance-lifecycle.js +79 -28
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +3 -1
- package/dist/instructions.js +11 -8
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-log-gate.d.ts +42 -0
- package/dist/kiro-log-gate.js +39 -0
- package/dist/kiro-log-gate.js.map +1 -0
- package/dist/locale.js +226 -44
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +99 -0
- package/dist/log-service.js +243 -0
- package/dist/log-service.js.map +1 -0
- package/dist/log-steps.d.ts +169 -0
- package/dist/log-steps.js +858 -0
- package/dist/log-steps.js.map +1 -0
- package/dist/login-controller.d.ts +20 -3
- package/dist/login-controller.js +71 -19
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.d.ts +5 -2
- package/dist/login-flows.js +5 -4
- package/dist/login-flows.js.map +1 -1
- package/dist/memory-pressure.d.ts +13 -1
- package/dist/memory-pressure.js +50 -10
- package/dist/memory-pressure.js.map +1 -1
- package/dist/needs-you-hub.js +2 -0
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you-live.d.ts +6 -0
- package/dist/needs-you-live.js +23 -3
- package/dist/needs-you-live.js.map +1 -1
- package/dist/next-steps.js +1 -1
- package/dist/next-steps.js.map +1 -1
- package/dist/outbound-handlers.d.ts +100 -0
- package/dist/outbound-handlers.js +284 -97
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +38 -15
- package/dist/outbound-schemas.js +36 -8
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-link-progress.d.ts +1 -1
- package/dist/public-link-progress.js +8 -2
- package/dist/public-link-progress.js.map +1 -1
- package/dist/public-preview.d.ts +101 -0
- package/dist/public-preview.js +236 -0
- package/dist/public-preview.js.map +1 -0
- package/dist/public-web-gateway.js +14 -4
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +24 -1
- package/dist/public-web-link.js +63 -9
- package/dist/public-web-link.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +89 -5
- package/dist/reply-buttons-controller.js +273 -8
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-buttons.d.ts +48 -3
- package/dist/reply-buttons.js +105 -10
- package/dist/reply-buttons.js.map +1 -1
- package/dist/reply-polls.d.ts +85 -0
- package/dist/reply-polls.js +154 -0
- package/dist/reply-polls.js.map +1 -0
- package/dist/restart-guard.d.ts +6 -3
- package/dist/restart-guard.js +6 -3
- package/dist/restart-guard.js.map +1 -1
- package/dist/restart-progress.d.ts +33 -0
- package/dist/restart-progress.js +30 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/service-activation.d.ts +15 -7
- package/dist/service-activation.js +46 -29
- package/dist/service-activation.js.map +1 -1
- package/dist/service-installer.d.ts +31 -0
- package/dist/service-installer.js +41 -2
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.js +85 -25
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +72 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +28 -4
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.js +7 -0
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/setup-form.d.ts +1 -1
- package/dist/setup-form.js +1 -1
- package/dist/spawn-gate.js +5 -1
- package/dist/spawn-gate.js.map +1 -1
- package/dist/spawn-hold-reply.d.ts +12 -0
- package/dist/spawn-hold-reply.js +39 -0
- package/dist/spawn-hold-reply.js.map +1 -0
- package/dist/status-emojis.d.ts +10 -3
- package/dist/status-emojis.js +11 -2
- package/dist/status-emojis.js.map +1 -1
- package/dist/systemd-peer-bus.d.ts +95 -0
- package/dist/systemd-peer-bus.js +430 -0
- package/dist/systemd-peer-bus.js.map +1 -0
- package/dist/systemd-runtime.d.ts +27 -1
- package/dist/systemd-runtime.js +69 -7
- package/dist/systemd-runtime.js.map +1 -1
- package/dist/tips.js +4 -4
- package/dist/tips.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-progress.js +3 -2
- package/dist/tool-progress.js.map +1 -1
- package/dist/topic-commands.d.ts +42 -2
- package/dist/topic-commands.js +101 -11
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-delta-reader.d.ts +3 -3
- package/dist/transcript-delta-reader.js +8 -8
- package/dist/transcript-delta-reader.js.map +1 -1
- package/dist/transcript-jsonl.d.ts +80 -3
- package/dist/transcript-jsonl.js +147 -10
- package/dist/transcript-jsonl.js.map +1 -1
- package/dist/transcript-monitor.d.ts +19 -0
- package/dist/transcript-monitor.js +87 -15
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-sources.d.ts +78 -0
- package/dist/transcript-sources.js +375 -64
- package/dist/transcript-sources.js.map +1 -1
- package/dist/transcript-turns.d.ts +15 -2
- package/dist/transcript-turns.js +15 -2
- package/dist/transcript-turns.js.map +1 -1
- package/dist/tunnel/cloudflared.d.ts +7 -15
- package/dist/tunnel/cloudflared.js +36 -1
- package/dist/tunnel/cloudflared.js.map +1 -1
- package/dist/tunnel/purpose-lane.d.ts +5 -1
- package/dist/tunnel/purpose-lane.js +14 -7
- package/dist/tunnel/purpose-lane.js.map +1 -1
- package/dist/tunnel/types.d.ts +5 -1
- package/dist/tunnel/types.js.map +1 -1
- package/dist/turn-resume.d.ts +2 -0
- package/dist/turn-resume.js +1 -1
- package/dist/turn-resume.js.map +1 -1
- package/dist/types.d.ts +25 -0
- package/dist/ui/chat-commands.js +1 -0
- package/dist/ui/chat-emojis.js +33 -0
- package/dist/ui/chat-mentions.js +63 -0
- package/dist/ui/chat-render.js +61 -4
- package/dist/ui/chat-store.js +37 -3
- package/dist/ui/chat-strings.js +40 -20
- package/dist/ui/chat-thread.js +111 -12
- package/dist/ui/chat-time.js +80 -0
- package/dist/ui/panel-chat.js +41 -10
- package/dist/ui/panel-details.js +2 -0
- package/dist/ui/panel-fleet.js +199 -57
- package/dist/ui/panel-log.js +428 -0
- package/dist/ui/panel-needs.js +6 -2
- package/dist/ui/panel-settings.js +184 -32
- package/dist/ui/preview-panel.js +55 -15
- package/dist/ui/preview-status.js +28 -0
- package/dist/ui/preview.js +44 -3
- package/dist/ui/settings-dialogs.js +7 -2
- package/dist/ui/settings-model.js +2 -1
- package/dist/ui/settings-strings.js +56 -4
- package/dist/ui/settings-token.js +1 -1
- package/dist/ui/shared/app-i18n.js +43 -17
- package/dist/ui/shared/app-prefs.js +250 -0
- package/dist/ui/shared/app-route.js +7 -2
- package/dist/ui/shared/app-shell.js +165 -8
- package/dist/ui/shared/app-store.js +5 -1
- package/dist/ui/shared/app-stream.js +26 -5
- package/dist/ui/shared/app.css +163 -22
- package/dist/ui/shared/app.js +11 -1
- package/dist/ui/shared/fonts/README.md +1 -1
- package/dist/ui/shared/header-tools.js +55 -5
- package/dist/ui/shared/instance-nav.js +241 -45
- package/dist/ui/shared/instance-switch.js +4 -4
- package/dist/ui/shared/panel-view.js +6 -0
- package/dist/ui/shared/signin.js +7 -7
- package/dist/ui/shared/theme.js +39 -7
- package/dist/ui/shared/tokens.css +1 -1
- package/dist/ui/shared/ui-icons.js +1 -0
- package/dist/ui/shared/usage-dialog.js +23 -5
- package/dist/ui/shared/view-strings.js +32 -4
- package/dist/ui/signin.html +1 -1
- package/dist/unrecognised-prompt.d.ts +23 -0
- package/dist/unrecognised-prompt.js +74 -0
- package/dist/unrecognised-prompt.js.map +1 -0
- package/dist/update-check.d.ts +31 -0
- package/dist/update-check.js +47 -0
- package/dist/update-check.js.map +1 -1
- package/dist/update-install.d.ts +28 -2
- package/dist/update-install.js +22 -4
- package/dist/update-install.js.map +1 -1
- package/dist/update-launch.d.ts +46 -1
- package/dist/update-launch.js +146 -3
- package/dist/update-launch.js.map +1 -1
- package/dist/update-marker.d.ts +51 -0
- package/dist/update-marker.js +61 -0
- package/dist/update-marker.js.map +1 -1
- package/dist/update-preflight.d.ts +100 -0
- package/dist/update-preflight.js +264 -0
- package/dist/update-preflight.js.map +1 -0
- package/dist/updater-caller.d.ts +31 -0
- package/dist/updater-caller.js +109 -0
- package/dist/updater-caller.js.map +1 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +1 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/providers.d.ts +34 -5
- package/dist/usage/providers.js +160 -27
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/statusline-usage.d.ts +6 -2
- package/dist/usage/statusline-usage.js +10 -4
- package/dist/usage/statusline-usage.js.map +1 -1
- package/dist/view-api.d.ts +1 -1
- package/dist/view-api.js +38 -8
- package/dist/view-api.js.map +1 -1
- package/dist/wake-coordinator.d.ts +11 -0
- package/dist/wake-coordinator.js +38 -4
- package/dist/wake-coordinator.js.map +1 -1
- package/dist/web-api.d.ts +89 -4
- package/dist/web-api.js +551 -45
- package/dist/web-api.js.map +1 -1
- package/dist/web-auth.d.ts +2 -2
- package/dist/web-auth.js +9 -4
- package/dist/web-auth.js.map +1 -1
- package/dist/web-chat-history.d.ts +12 -1
- package/dist/web-chat-history.js +29 -7
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-commands.d.ts +27 -4
- package/dist/web-commands.js +19 -4
- package/dist/web-commands.js.map +1 -1
- package/dist/web-host-guard.d.ts +3 -11
- package/dist/web-host-guard.js +3 -12
- package/dist/web-host-guard.js.map +1 -1
- package/dist/web-images.d.ts +47 -0
- package/dist/web-images.js +169 -0
- package/dist/web-images.js.map +1 -0
- package/dist/web-login.d.ts +14 -0
- package/dist/web-login.js +4 -2
- package/dist/web-login.js.map +1 -1
- package/dist/web-mentions.d.ts +44 -0
- package/dist/web-mentions.js +75 -0
- package/dist/web-mentions.js.map +1 -0
- package/dist/web-prefs.d.ts +81 -0
- package/dist/web-prefs.js +297 -0
- package/dist/web-prefs.js.map +1 -0
- package/dist/web-preview.d.ts +14 -1
- package/dist/web-preview.js +35 -13
- package/dist/web-preview.js.map +1 -1
- package/dist/web-profile.d.ts +32 -0
- package/dist/web-profile.js +132 -0
- package/dist/web-profile.js.map +1 -0
- package/dist/web-reply-files.d.ts +45 -0
- package/dist/web-reply-files.js +223 -0
- package/dist/web-reply-files.js.map +1 -0
- package/dist/web-schedules.d.ts +12 -0
- package/dist/web-schedules.js +34 -0
- package/dist/web-schedules.js.map +1 -0
- package/dist/web-server-drain.d.ts +10 -0
- package/dist/web-server-drain.js +50 -0
- package/dist/web-server-drain.js.map +1 -0
- package/dist/web-session.d.ts +50 -1
- package/dist/web-session.js +63 -6
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +23 -0
- package/dist/web-settings-patch.js +77 -0
- package/dist/web-settings-patch.js.map +1 -0
- package/dist/web-shell-routes.d.ts +5 -1
- package/dist/web-shell-routes.js +10 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-upload.d.ts +17 -4
- package/dist/web-upload.js +64 -13
- package/dist/web-upload.js.map +1 -1
- package/dist/workflow-templates/default.md +1 -1
- package/package.json +1 -1
- package/templates/launchd.plist.ejs +3 -1
- package/templates/systemd.service.ejs +2 -1
package/dist/types.d.ts
CHANGED
|
@@ -247,6 +247,8 @@ export interface FleetDefaults extends Partial<InstanceConfig> {
|
|
|
247
247
|
* 0 turns the notice off. The owner reminder is not affected.
|
|
248
248
|
*/
|
|
249
249
|
reply_overdue_minutes?: number;
|
|
250
|
+
/** #1694: hours since the last ask before an open reply obligation expires (default 24; positive finite duration). */
|
|
251
|
+
reply_obligation_ttl_hours?: number;
|
|
250
252
|
scheduler?: {
|
|
251
253
|
max_schedules?: number;
|
|
252
254
|
default_timezone?: string;
|
|
@@ -343,6 +345,12 @@ export interface WebConfig {
|
|
|
343
345
|
echo_to_channel?: boolean;
|
|
344
346
|
/** Show the AI subscription usage panel on /view and serve /api/ai-usage (default true). */
|
|
345
347
|
usage_panel?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* #1218: the instance Log tab (紀錄) — each agent's steps (prompts, replies, tool calls and results, errors) read on
|
|
350
|
+
* demand from its own transcript, secrets masked. Default false: off, it does no work at all. Turning it on is an
|
|
351
|
+
* admin's change, confirmed like any access change (Settings → Web).
|
|
352
|
+
*/
|
|
353
|
+
log_tab?: boolean;
|
|
346
354
|
/** Expose provider API-key verify/apply endpoints (default false until dark-shipped). */
|
|
347
355
|
provider_secrets?: boolean;
|
|
348
356
|
/**
|
|
@@ -359,6 +367,17 @@ export interface WebConfig {
|
|
|
359
367
|
view_access?: "open" | "session";
|
|
360
368
|
/** Tell the admin channel when someone signs in to the web panel (default true). */
|
|
361
369
|
notify_login?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* #1620: how long a web session lasts. Only the LOCAL surface (the dashboard reached directly — loopback, a LAN, a
|
|
372
|
+
* tailnet) is configurable; a public-link session's limits stay fixed. Hours, 1 ≤ idle_hours ≤ absolute_hours ≤ 720;
|
|
373
|
+
* defaults 12 (absolute, from sign-in) and 2 (idle, since the last use). Shortening applies to existing sessions.
|
|
374
|
+
*/
|
|
375
|
+
session?: {
|
|
376
|
+
local?: {
|
|
377
|
+
absolute_hours?: number;
|
|
378
|
+
idle_hours?: number;
|
|
379
|
+
};
|
|
380
|
+
};
|
|
362
381
|
/**
|
|
363
382
|
* #1306: HTML previews in the web chat (default true). false: no preview listener; cards show Source and
|
|
364
383
|
* Download only. Even when true, a browser runs a preview only after that device opted in.
|
|
@@ -371,6 +390,12 @@ export interface WebConfig {
|
|
|
371
390
|
* previews through a tunnel or proxy need one. It must not be a name the dashboard answers to.
|
|
372
391
|
*/
|
|
373
392
|
preview_origin?: string;
|
|
393
|
+
/**
|
|
394
|
+
* #1723: previews over the temporary public link (default true): the link opens a second quick tunnel of its own
|
|
395
|
+
* for them, in the background, closed with the link. false: none on the public link. A web.preview_origin is used
|
|
396
|
+
* instead of it; web.preview: false turns previews off everywhere.
|
|
397
|
+
*/
|
|
398
|
+
preview_on_public_link?: boolean;
|
|
374
399
|
}
|
|
375
400
|
/** `login:` section — remote /login behaviour. */
|
|
376
401
|
export interface LoginConfig {
|
package/dist/ui/chat-commands.js
CHANGED
|
@@ -9,6 +9,7 @@ export const CHAT_COMMANDS = [
|
|
|
9
9
|
{ name: "compact", arg: "[instructions]" },
|
|
10
10
|
{ name: "clear", arg: "" },
|
|
11
11
|
{ name: "model", arg: "[name]" },
|
|
12
|
+
{ name: "backend", arg: "[backend] [model] [effort]" },
|
|
12
13
|
{ name: "effort", arg: "[level]" },
|
|
13
14
|
{ name: "cancel", arg: "" },
|
|
14
15
|
{ name: "btw", arg: "<question>" },
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// #1630 (design: the comment on #1630): the Discord server emoji the fleet's bots know — GET /ui/emojis, session-gated
|
|
2
|
+
// and served same-origin — so a message's `<:name:id>` / `<a:name:id>` can be drawn as its picture (chat-render.js).
|
|
3
|
+
// Read once per page, and only once a message shows such a tag; until it arrives (or if it fails) every tag stays text.
|
|
4
|
+
// A message drawn before the list arrived is drawn again when it does (the thread replaces what changed).
|
|
5
|
+
|
|
6
|
+
const TAG = /<a?:[A-Za-z0-9_]{2,32}:\d{15,25}>/;
|
|
7
|
+
const ID = /^\d{15,25}$/;
|
|
8
|
+
|
|
9
|
+
export function createEmojiIndex(fetchImpl) {
|
|
10
|
+
let ids = null; // Set of known ids once read (empty after a failure: no retry on this page)
|
|
11
|
+
let loading = false;
|
|
12
|
+
const listeners = new Set();
|
|
13
|
+
const settle = (next) => { ids = next; for (const f of [...listeners]) f(); };
|
|
14
|
+
return {
|
|
15
|
+
known: (id) => !!ids && ids.has(id),
|
|
16
|
+
/** Any of these messages carries a server-emoji tag. */
|
|
17
|
+
wants: (msgs) => (msgs || []).some((x) => x && typeof x.text === "string" && TAG.test(x.text)),
|
|
18
|
+
/** Starts the one read of this page (once). */
|
|
19
|
+
ensure() {
|
|
20
|
+
if (ids || loading) return;
|
|
21
|
+
loading = true;
|
|
22
|
+
Promise.resolve()
|
|
23
|
+
.then(() => fetchImpl("/ui/emojis"))
|
|
24
|
+
.then((r) => (r && r.ok ? r.json() : null))
|
|
25
|
+
.then((body) => {
|
|
26
|
+
const next = new Set();
|
|
27
|
+
if (body && Array.isArray(body.emojis)) for (const e of body.emojis) if (e && typeof e.id === "string" && ID.test(e.id)) next.add(e.id);
|
|
28
|
+
settle(next);
|
|
29
|
+
}, () => settle(new Set()));
|
|
30
|
+
},
|
|
31
|
+
subscribe(f) { listeners.add(f); return () => listeners.delete(f); },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// #1682 (design: the comment on #1682): the names of the Discord mentions a page shows — `<@id>` / `<@!id>` (a user),
|
|
2
|
+
// `<@&id>` (a role), `<#id>` (a channel). Asked from GET /ui/mentions (same-origin; the host answers from memory) only
|
|
3
|
+
// for the ids the page's messages carry, each id once per page, at most MAX_IDS per request. Until a name arrives (or
|
|
4
|
+
// if it never does) the pill reads @user / @role / #channel; when names arrive, the messages are drawn again.
|
|
5
|
+
|
|
6
|
+
const TOKEN = /<(@!?|@&|#)(\d{15,25})>/g;
|
|
7
|
+
const KIND = { "@": "u", "@!": "u", "@&": "r", "#": "c" };
|
|
8
|
+
const MAX_IDS = 100;
|
|
9
|
+
|
|
10
|
+
export function createMentionIndex(fetchImpl) {
|
|
11
|
+
const names = new Map(); // "u:id" → name
|
|
12
|
+
const asked = new Set(); // "u:id" asked already (answered or not: never again on this page)
|
|
13
|
+
const listeners = new Set();
|
|
14
|
+
let inFlight = 0;
|
|
15
|
+
function idsIn(msgs) {
|
|
16
|
+
const want = [];
|
|
17
|
+
for (const x of msgs || []) {
|
|
18
|
+
if (!x || typeof x.text !== "string" || x.text.indexOf("<") === -1) continue;
|
|
19
|
+
for (const m of x.text.matchAll(TOKEN)) {
|
|
20
|
+
const key = `${KIND[m[1]]}:${m[2]}`;
|
|
21
|
+
if (!asked.has(key) && !want.includes(key)) want.push(key);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return want;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
/** The name the page knows for a mention, or null (the pill says @user / @role / #channel). */
|
|
28
|
+
name: (kind, id) => names.get(`${kind}:${id}`) ?? null,
|
|
29
|
+
/** Ask for the names of the mentions in these messages the page has not asked about yet. */
|
|
30
|
+
ensure(msgs) {
|
|
31
|
+
const want = idsIn(msgs);
|
|
32
|
+
for (let i = 0; i < want.length; i += MAX_IDS) {
|
|
33
|
+
const batch = want.slice(i, i + MAX_IDS);
|
|
34
|
+
for (const key of batch) asked.add(key);
|
|
35
|
+
const params = new URLSearchParams();
|
|
36
|
+
for (const kind of ["u", "r", "c"]) {
|
|
37
|
+
const ids = batch.filter((k) => k[0] === kind).map((k) => k.slice(2));
|
|
38
|
+
if (ids.length) params.set(kind, ids.join(","));
|
|
39
|
+
}
|
|
40
|
+
inFlight++;
|
|
41
|
+
Promise.resolve()
|
|
42
|
+
.then(() => fetchImpl(`/ui/mentions?${params}`))
|
|
43
|
+
.then((r) => (r && r.ok ? r.json() : null))
|
|
44
|
+
.then((body) => {
|
|
45
|
+
let added = false;
|
|
46
|
+
for (const kind of ["u", "r", "c"]) {
|
|
47
|
+
const got = body && typeof body[kind] === "object" && body[kind] ? body[kind] : {};
|
|
48
|
+
for (const key of batch) {
|
|
49
|
+
if (key[0] !== kind) continue;
|
|
50
|
+
const id = key.slice(2);
|
|
51
|
+
if (Object.prototype.hasOwnProperty.call(got, id) && typeof got[id] === "string" && got[id]) { names.set(key, got[id]); added = true; }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (added) for (const f of [...listeners]) f();
|
|
55
|
+
}, () => {})
|
|
56
|
+
.finally(() => { inFlight--; });
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
subscribe(f) { listeners.add(f); return () => listeners.delete(f); },
|
|
60
|
+
/** Requests not answered yet (tests). */
|
|
61
|
+
pending: () => inFlight,
|
|
62
|
+
};
|
|
63
|
+
}
|
package/dist/ui/chat-render.js
CHANGED
|
@@ -51,11 +51,44 @@
|
|
|
51
51
|
return s;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// #1630: a Discord server emoji, `<:name:id>` / `<a:name:id>` — escaped by now — drawn as its picture. Only an id the
|
|
55
|
+
// page knows (the fleet's servers: /ui/emojis) and only from the dashboard's own route; the src is built from the
|
|
56
|
+
// matched digits, the name (word characters only) goes into alt/title. An unknown id stays the literal text.
|
|
57
|
+
var EMOJI_RE = /<(a?):([A-Za-z0-9_]{2,32}):(\d{15,25})>/g;
|
|
58
|
+
function emojiImg(id, name) {
|
|
59
|
+
return '<img class="emoji" src="/ui/img/emoji/' + id + '" alt=":' + name + ':" title=":' + name + ':" decoding="async">';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// #1682: Discord mentions — `<@id>` / `<@!id>` (a user), `<@&id>` (a role), `<#id>` (a channel) — escaped by now (the
|
|
63
|
+
// role's & too), drawn as a pill: the name the page knows (store.mentions(kind, id), inserted escaped), else @user /
|
|
64
|
+
// @role / #channel; never the raw token. The id is the token's own digits (title, data-mention: the page fills a
|
|
65
|
+
// name in later). And a Telegram @username (a letter, then 4–31 word characters; not part of a word, an e-mail
|
|
66
|
+
// or a path) gets the same look — no lookup, no link. It runs after the links (see inline()).
|
|
67
|
+
var MENTION_RE = /<(@!?|@&|#)(\d{15,25})>/g;
|
|
68
|
+
// Not a package or a path either: `@scope/pkg`, `@anthropic-ai/sdk` (followed by - or /) stay text.
|
|
69
|
+
var TG_MENTION_RE = /(^|[^\w@\/.&;])@([A-Za-z][A-Za-z0-9_]{4,31})(?![\w@\/-])/g;
|
|
70
|
+
var MENTION_KIND = { "@": "u", "@!": "u", "@&": "r", "#": "c" };
|
|
71
|
+
var MENTION_UNKNOWN = { u: "@user", r: "@role", c: "#channel" };
|
|
72
|
+
function mentionPill(kind, id, name) {
|
|
73
|
+
var label = name ? (kind === "c" ? "#" : "@") + escapeHtml(name) : MENTION_UNKNOWN[kind];
|
|
74
|
+
return '<span class="mention" data-mention="' + kind + ":" + id + '" title="' + id + '">' + label + "</span>";
|
|
75
|
+
}
|
|
76
|
+
|
|
54
77
|
/** Inline Markdown over ALREADY-ESCAPED text. */
|
|
55
78
|
function inline(escaped, store) {
|
|
56
79
|
var s = escaped;
|
|
57
80
|
// `code` first: nothing inside it is Markdown.
|
|
58
|
-
|
|
81
|
+
// #1812: in a table cell a path may wrap after its separators — the cell keeps words whole, so without these a long
|
|
82
|
+
// path held its whole column wide.
|
|
83
|
+
s = s.replace(/`([^`\n]+)`/g, function (_m, code) { return stash(store, "<code>" + (store.inCell ? code.replace(/\//g, "/<wbr>") : code) + "</code>"); });
|
|
84
|
+
var known = store.emojis;
|
|
85
|
+
if (known) s = s.replace(EMOJI_RE, function (m, _a, name, id) { return known(id) ? stash(store, emojiImg(id, name)) : m; });
|
|
86
|
+
var names = store.mentions;
|
|
87
|
+
s = s.replace(MENTION_RE, function (_m, sigil, id) {
|
|
88
|
+
var kind = MENTION_KIND[sigil];
|
|
89
|
+
var name = names ? names(kind, id) : null;
|
|
90
|
+
return stash(store, mentionPill(kind, id, typeof name === "string" && name ? name : null));
|
|
91
|
+
});
|
|
59
92
|
// [label](url)
|
|
60
93
|
s = s.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, function (m, label, url) {
|
|
61
94
|
var href = safeHref(url);
|
|
@@ -66,6 +99,8 @@
|
|
|
66
99
|
var href = safeHref(url);
|
|
67
100
|
return href ? pre + stash(store, link(href, url)) : m;
|
|
68
101
|
});
|
|
102
|
+
// #1682: a Telegram @username — after the links (a link is stashed by now, so an @ inside a URL is never touched).
|
|
103
|
+
s = s.replace(TG_MENTION_RE, function (_m, pre, user) { return pre + stash(store, '<span class="mention tg">@' + user + "</span>"); });
|
|
69
104
|
return emphasis(s);
|
|
70
105
|
}
|
|
71
106
|
|
|
@@ -147,7 +182,8 @@
|
|
|
147
182
|
function renderTable(header, aligns, rows, store) {
|
|
148
183
|
function cell(tag, text, i) {
|
|
149
184
|
var a = aligns[i] ? ' class="al-' + aligns[i] + '"' : "";
|
|
150
|
-
|
|
185
|
+
store.inCell = true;
|
|
186
|
+
try { return "<" + tag + a + ">" + inline(text, store) + "</" + tag + ">"; } finally { store.inCell = false; }
|
|
151
187
|
}
|
|
152
188
|
function row(tag, cells) {
|
|
153
189
|
var out = "";
|
|
@@ -273,6 +309,10 @@
|
|
|
273
309
|
var cards = !!(opts && opts.htmlCards);
|
|
274
310
|
var src = String(text == null ? "" : text).replace(/\r\n?/g, "\n").replace(/\u0000/g, ""); // \u0000 is the placeholder mark
|
|
275
311
|
var store = [];
|
|
312
|
+
// #1630: which server emoji ids the page knows (a function id → boolean); without it every `<:name:id>` stays text.
|
|
313
|
+
store.emojis = opts && typeof opts.emojis === "function" ? opts.emojis : null;
|
|
314
|
+
// #1682: the names the page knows for mentions (a function (kind "u" | "r" | "c", id) → name or null).
|
|
315
|
+
store.mentions = opts && typeof opts.mentions === "function" ? opts.mentions : null;
|
|
276
316
|
var html = "";
|
|
277
317
|
var re = new RegExp(FENCE_RE.source, "g");
|
|
278
318
|
var last = 0;
|
|
@@ -301,6 +341,22 @@
|
|
|
301
341
|
* stream — and must show once.
|
|
302
342
|
*/
|
|
303
343
|
function buttonsRank(b) { return b && b.state !== "open" ? 1 : 0; }
|
|
344
|
+
/**
|
|
345
|
+
* Whether `next` is an older view than `had` of the same buttons: they only go forward (open → ended), and a poll's
|
|
346
|
+
* views (#1823), which change while it is open, by their `rev`.
|
|
347
|
+
*/
|
|
348
|
+
function olderButtons(next, had) {
|
|
349
|
+
var d = buttonsRank(next) - buttonsRank(had);
|
|
350
|
+
if (d) return d < 0;
|
|
351
|
+
return !!(next && had && next.poll && had.poll && next.poll.rev < had.poll.rev);
|
|
352
|
+
}
|
|
353
|
+
/** #1823: a poll's time left, counted down by the page every second: m:ss, or h:mm:ss. */
|
|
354
|
+
function pollRemaining(ms) {
|
|
355
|
+
var s = Math.max(0, Math.ceil(ms / 1000));
|
|
356
|
+
var h = Math.floor(s / 3600), m = Math.floor((s % 3600) / 60), r = s % 60;
|
|
357
|
+
var mm = h ? String(m).padStart(2, "0") : String(m);
|
|
358
|
+
return (h ? h + ":" : "") + mm + ":" + String(r).padStart(2, "0");
|
|
359
|
+
}
|
|
304
360
|
/**
|
|
305
361
|
* #1266: a reply's buttons changed (one was chosen, or they expired): the message carrying them, by its set id.
|
|
306
362
|
* Returns the list unchanged when no message carries that set.
|
|
@@ -309,7 +365,7 @@
|
|
|
309
365
|
if (!Array.isArray(list) || !buttons || typeof buttons.id !== "string") return list;
|
|
310
366
|
var i = -1;
|
|
311
367
|
for (var j = list.length - 1; j >= 0; j--) if (list[j] && list[j].buttons && list[j].buttons.id === buttons.id) { i = j; break; }
|
|
312
|
-
if (i < 0 ||
|
|
368
|
+
if (i < 0 || olderButtons(buttons, list[i].buttons)) return list;
|
|
313
369
|
var out = list.slice();
|
|
314
370
|
out[i] = Object.assign({}, list[i], { buttons: buttons });
|
|
315
371
|
return out;
|
|
@@ -329,7 +385,7 @@
|
|
|
329
385
|
var next = nextDeliveryState(had.delivery, m.delivery);
|
|
330
386
|
if (next !== had.delivery) out[seen[k]] = had = Object.assign({}, had, { delivery: next });
|
|
331
387
|
// #1266: …and the copy whose buttons got further (open → chosen / expired) shows them.
|
|
332
|
-
if (m.buttons && (!had.buttons || buttonsRank(m.buttons) > buttonsRank(had.buttons))) out[seen[k]] = Object.assign({}, had, { buttons: m.buttons });
|
|
388
|
+
if (m.buttons && (!had.buttons || buttonsRank(m.buttons) > buttonsRank(had.buttons) || (buttonsRank(m.buttons) === buttonsRank(had.buttons) && m.buttons.poll && had.buttons.poll && m.buttons.poll.rev > had.buttons.poll.rev))) out[seen[k]] = Object.assign({}, had, { buttons: m.buttons });
|
|
333
389
|
return;
|
|
334
390
|
}
|
|
335
391
|
seen[k] = out.length;
|
|
@@ -528,6 +584,7 @@
|
|
|
528
584
|
|
|
529
585
|
return {
|
|
530
586
|
renderMarkdown: renderMarkdown, escapeHtml: escapeHtml, mergeMessages: mergeMessages, applyReplyButtons: applyReplyButtons, composerKey: composerKey,
|
|
587
|
+
pollRemaining: pollRemaining,
|
|
531
588
|
settleFailedSend: settleFailedSend, putBack: putBack,
|
|
532
589
|
FILE_LIMITS: FILE_LIMITS, formatSize: formatSize, checkFiles: checkFiles, attachmentsHtml: attachmentsHtml, isHtmlAttachment: isHtmlAttachment,
|
|
533
590
|
nextDeliveryState: nextDeliveryState, applyDelivery: applyDelivery, deliveryHtml: deliveryHtml, isBusy: isBusy,
|
package/dist/ui/chat-store.js
CHANGED
|
@@ -11,11 +11,36 @@ import "./chat-render.js";
|
|
|
11
11
|
|
|
12
12
|
const R = () => globalThis.AgendChatRender;
|
|
13
13
|
|
|
14
|
+
// #1823: this device's own votes on polls (set id → options), so a reload still marks them. A convenience only: the
|
|
15
|
+
// server holds the ballot; storage may be missing or throw (private window), and then marks last for the page.
|
|
16
|
+
const POLL_MINE_KEY = "agend_poll_mine";
|
|
17
|
+
const POLL_MINE_MAX = 50;
|
|
18
|
+
function readPollMine() {
|
|
19
|
+
try {
|
|
20
|
+
const v = JSON.parse(globalThis.localStorage?.getItem(POLL_MINE_KEY) || "{}");
|
|
21
|
+
const out = {};
|
|
22
|
+
if (v && typeof v === "object" && !Array.isArray(v)) {
|
|
23
|
+
for (const [id, opts] of Object.entries(v)) if (/^[0-9a-f]{32}$/.test(id) && Array.isArray(opts)) out[id] = opts.filter(Number.isInteger);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
} catch { return {}; }
|
|
27
|
+
}
|
|
28
|
+
function writePollMine(mine) {
|
|
29
|
+
const ids = Object.keys(mine);
|
|
30
|
+
for (const id of ids.slice(0, Math.max(0, ids.length - POLL_MINE_MAX))) delete mine[id]; // the oldest go first
|
|
31
|
+
try { globalThis.localStorage?.setItem(POLL_MINE_KEY, JSON.stringify(mine)); } catch { /* storage unavailable */ }
|
|
32
|
+
}
|
|
33
|
+
|
|
14
34
|
/** Build a store. `deps` (fetch, toast, announce, t, now) are injected so tests can drive every path. */
|
|
15
35
|
export function createChatStore(deps) {
|
|
16
36
|
const s = {
|
|
17
37
|
msgs: {}, drafts: {}, failedSends: {}, pendingFiles: {}, sending: {}, inFlightFiles: {},
|
|
18
38
|
prompts: {}, workingSince: {}, stopping: {}, cancelling: {}, scrollMemo: {}, historyRead: new Set(), rbBusy: new Set(),
|
|
39
|
+
pollMine: readPollMine(),
|
|
40
|
+
// #1823 (#1828 review): the server's clock minus this device's. A poll's deadline is the server's; a page whose clock
|
|
41
|
+
// is a few seconds off would count a 10 s poll wrong. Only the server's explicit `clock` sets it (#1830 review): a
|
|
42
|
+
// view's rev is when it was made, and a polled or replayed view can be minutes old.
|
|
43
|
+
clockSkew: 0,
|
|
19
44
|
exec: {}, awaiting: {}, current: null,
|
|
20
45
|
// #1269: the last chat command per instance — { command, busy, text?, error?, choices? } — shown above the composer.
|
|
21
46
|
commands: {},
|
|
@@ -62,11 +87,15 @@ export function createChatStore(deps) {
|
|
|
62
87
|
}
|
|
63
88
|
|
|
64
89
|
// ── Messages: one way in, from the stream, a poll or the history; one entry per boot+id.
|
|
90
|
+
/** #1823: the server's clock, `clock` from the stream or a poll answer — handed over as soon as it is read. */
|
|
91
|
+
function noteServerClock(c) {
|
|
92
|
+
if (c && typeof c.now === "number" && Number.isFinite(c.now)) s.clockSkew = c.now - Date.now();
|
|
93
|
+
}
|
|
65
94
|
function ingest(m) {
|
|
66
95
|
if (!m || typeof m.instance !== "string") return;
|
|
67
96
|
const before = s.msgs[m.instance];
|
|
68
97
|
s.msgs[m.instance] = R().mergeMessages(before, [m], 500);
|
|
69
|
-
if (m.instance === s.current && s.msgs[m.instance] !== before && !isUser(m, m.instance) && (s.msgs[m.instance] || []).length > (before || []).length) deps.announce(tf("chat.a11yReplied", m.sender));
|
|
98
|
+
if (m.instance === s.current && s.msgs[m.instance] !== before && m.role !== "status" && !isUser(m, m.instance) && (s.msgs[m.instance] || []).length > (before || []).length) deps.announce(tf("chat.a11yReplied", m.sender));
|
|
70
99
|
if (s.msgs[m.instance] !== before) changed(m.instance, "msgs");
|
|
71
100
|
}
|
|
72
101
|
function applyDeliveries(list) {
|
|
@@ -87,13 +116,17 @@ export function createChatStore(deps) {
|
|
|
87
116
|
s.msgs[u.instance] = R().applyReplyButtons(before, u.buttons);
|
|
88
117
|
if (s.msgs[u.instance] !== before) changed(u.instance, "msgs");
|
|
89
118
|
}
|
|
90
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* #1266: click one of a reply's buttons (the first click anywhere answers for everyone). On a poll (#1823) it is this
|
|
121
|
+
* session's vote: the answer is its ballot, which only this page marks.
|
|
122
|
+
*/
|
|
91
123
|
async function clickReplyButton(instance, id, index) {
|
|
92
124
|
if (s.rbBusy.has(id)) return;
|
|
93
125
|
s.rbBusy.add(id); changed(instance, "msgs");
|
|
94
126
|
let r;
|
|
95
127
|
try { r = await api("POST", "/ui/reply-button", { instance, id, index }); }
|
|
96
128
|
catch (err) { r = { error: err && err.message ? err.message : t("chat.disconnected") }; }
|
|
129
|
+
if (r && r.answered && Array.isArray(r.options)) { s.pollMine[id] = r.options.filter(Number.isInteger); writePollMine(s.pollMine); }
|
|
97
130
|
s.rbBusy.delete(id); changed(instance, "msgs");
|
|
98
131
|
if (!r || !r.answered) deps.toast(r && r.error ? r.error : t("chat.disconnected"), false);
|
|
99
132
|
}
|
|
@@ -300,7 +333,7 @@ export function createChatStore(deps) {
|
|
|
300
333
|
};
|
|
301
334
|
let r = await post({});
|
|
302
335
|
if (r && r.confirm) {
|
|
303
|
-
const yes = deps.confirm ? await deps.confirm({ title: `/${command}`, message: r.confirm.message, confirmLabel: t("chat.cmdConfirm"), danger: true }) : false;
|
|
336
|
+
const yes = deps.confirm ? await deps.confirm({ title: `/${command}`, message: r.confirm.message, confirmLabel: t(command === "backend" ? "chat.cmdConfirmBackend" : "chat.cmdConfirm"), danger: true }) : false;
|
|
304
337
|
if (!yes || !alive()) { delete s.commands[target]; changed(target); return; }
|
|
305
338
|
r = await post({ confirm: r.confirm.token });
|
|
306
339
|
}
|
|
@@ -323,6 +356,7 @@ export function createChatStore(deps) {
|
|
|
323
356
|
stream.on("prompts", applyPrompts);
|
|
324
357
|
stream.on("prompt_resolved", resolvePrompt);
|
|
325
358
|
stream.on("reply_buttons", applyReplyButtons);
|
|
359
|
+
stream.on("clock", noteServerClock); // #1823
|
|
326
360
|
}
|
|
327
361
|
|
|
328
362
|
return {
|
package/dist/ui/chat-strings.js
CHANGED
|
@@ -3,11 +3,11 @@ import { register } from "/assets/app-i18n.js";
|
|
|
3
3
|
|
|
4
4
|
register("chat", {
|
|
5
5
|
en: {
|
|
6
|
-
cmdConfirm: "Clear", cmdRunning: "Running /{0}…", cmdNotCommand: "Not a command here — Enter sends it as a message.", cmdDismiss: "Dismiss", cmdCommands: "Commands",
|
|
6
|
+
cmdConfirm: "Clear", cmdConfirmBackend: "Switch and restart", cmdRunning: "Running /{0}…", cmdNotCommand: "Not a command here — Enter sends it as a message.", cmdDismiss: "Dismiss", cmdCommands: "Commands",
|
|
7
7
|
cmdChoose: "Choose", cmdCurrent: "current", chipCompact: "Compact", chipClear: "Clear…", chipContext: "Context {0}% used",
|
|
8
8
|
chipModel: "Model: {0} — choose another", chipEffort: "Effort: {0} — choose another",
|
|
9
9
|
cmd_ctx: "Context use, model and effort", cmd_compact: "Compact the conversation", cmd_clear: "Clear the conversation (asks first)",
|
|
10
|
-
cmd_model: "Show or switch the model", cmd_effort: "Show or set the reasoning effort", cmd_cancel: "Stop the current reply",
|
|
10
|
+
cmd_model: "Show or switch the model", cmd_backend: "Switch the CLI backend, then model and effort (restarts)", cmd_effort: "Show or set the reasoning effort", cmd_cancel: "Stop the current reply",
|
|
11
11
|
cmd_btw: "A side question that does not interrupt", cmd_steer: "Send into the current turn", cmd_pause: "Pause the instance",
|
|
12
12
|
cmd_wake: "Wake a paused instance", cmd_save: "Save the conversation to a file",
|
|
13
13
|
tourTitle: "Welcome to web chat", tourStep: "{0} of {1}", tourBack: "Back", tourNext: "Next", tourDone: "Got it", tourSkip: "Skip",
|
|
@@ -21,24 +21,25 @@ register("chat", {
|
|
|
21
21
|
dropHere: "Drop files to attach them", asText: "As text", pasteAttached: "A long paste ({0} characters) was attached as a text file", pasteKeptAsText: "No room for another attachment: the long paste stays as text",
|
|
22
22
|
send: "Send", composerPlaceholder: "Message {0}…", composerHint: "Enter to send · Shift+Enter for a new line · / for commands · Esc stops the reply", attachTitle: "Attach files (images, PDF, text — or paste / drop them)",
|
|
23
23
|
pvPreview: "Preview", pvStop: "Stop", pvDownload: "Download", pvMenu: "Preview options", pvHtml: "HTML",
|
|
24
|
-
pvAllowButton: "Allow previews", pvAllow: "Allow HTML previews
|
|
25
|
-
pvConfirm: "Allow HTML previews on
|
|
24
|
+
pvAllowButton: "Allow previews", pvAllow: "Allow HTML previews — they may be able to send data out", pvDisallow: "Stop allowing HTML previews",
|
|
25
|
+
pvConfirm: "Allow HTML previews?\n\nThis applies on every device where you are signed in. A preview runs the agent's HTML in an isolated frame. It cannot use your login, but it may be able to send data out, and it can slow or freeze this tab. You still click Preview each time.",
|
|
26
26
|
pvNever: "Never preview HTML on this device", pvNeverUndo: "Let this device preview HTML again", pvStarting: "Starting the preview…",
|
|
27
27
|
pvChanged: "Preview stopped — the message changed. Preview again.", pvTruncated: "Truncated — ask the agent to send it as a .html file.",
|
|
28
28
|
pvLoading: "Reading the file…", pvAttOver: "This file is over 1 MiB; it is not previewed.",
|
|
29
29
|
pvAttGone: "This file is no longer available here (it changed, or the fleet restarted). Ask the agent to send it again.",
|
|
30
30
|
pvAttFailed: "Could not read this file. Try again.",
|
|
31
31
|
pvBannerAck: "I understand", pvBannerAckTitle: "Hide this notice until you sign in again",
|
|
32
|
-
attGone: "This file could not be found again after AgEnD restarted (moved, deleted or changed). Ask the agent to send it again.", attUnavailable: "unavailable",
|
|
32
|
+
attGone: "This file could not be found again after AgEnD restarted (moved, deleted or changed). Ask the agent to send it again.", attUnavailable: "unavailable", yesterdayAt: "Yesterday {0}",
|
|
33
33
|
tcShow: "Show", tcHide: "Hide", tcDownload: "Download", tcShowAll: "Show all {0} lines", tcOver: "This file is over 1 MiB; download it to read it.", tcPlain: "Too large to format here: shown as plain text.",
|
|
34
34
|
rbGroup: "Choices", rbChosen: "Chosen by {0}", rbExpired: "Expired — reply in text",
|
|
35
|
+
pollGroup: "Poll", pollAnswered: "🗳 {0} answered", pollClosed: "🗳 Closed · {0} answered", pollLeft: "Time left", pollVoters: "Who voted",
|
|
35
36
|
pvOpenPanel: "Open in panel", pvInPanel: "Shown in the panel.", pvPanel: "HTML preview", pvSource: "From {0}, {1} — show the message",
|
|
36
37
|
pvPage: "Page", pvCode: "Code", pvReload: "Reload", pvClose: "Close the panel", pvBack: "Back to the chat", pvResize: "Resize the preview panel",
|
|
37
38
|
pvNewer: "A newer version is in the reply from {0}.", pvNewerShow: "Show it", pvPanelIdle: "Click Preview to run it here.",
|
|
38
39
|
lbLabel: "Image: {0}", lbLabelNoName: "Image", lbClose: "Close", lbOpenOriginal: "Open original", lbPrev: "Previous image", lbNext: "Next image", lbCount: "{0} / {1}",
|
|
39
40
|
// #1554: preview.js's words (its English is the fallback there), and the server's reasons by code.
|
|
40
|
-
pvWhyOptin: "HTML previews are off
|
|
41
|
-
pvWhyOptinPanel: "HTML previews are off
|
|
41
|
+
pvWhyOptin: "HTML previews are off. Allow them from this card's ⋯ menu or Settings → Preferences.",
|
|
42
|
+
pvWhyOptinPanel: "HTML previews are off.",
|
|
42
43
|
pvWhyNever: "Previews are switched off on this device for this session.",
|
|
43
44
|
pvWhyOrigin: "Previews are off: this page is at {0}, but the fleet believes it is at {1} (a proxy that rewrites Host). Pass the external Host through, or set web.preview_origin.",
|
|
44
45
|
pvUnknownAddress: "an unknown address", pvWhyServer: "Previews are not available here.",
|
|
@@ -53,10 +54,19 @@ register("chat", {
|
|
|
53
54
|
pvServer_needOrigin: "Previews need web.preview_origin when the dashboard is reached through a tunnel or proxy.",
|
|
54
55
|
pvServer_needHttps: "Previews need an https web.preview_origin when the dashboard is reached over https.",
|
|
55
56
|
pvServer_sameOrigin: "The preview origin cannot be the dashboard's own.",
|
|
56
|
-
pvServer_publicLink: "Previews are
|
|
57
|
+
pvServer_publicLink: "Previews are off on the public link (web.preview_on_public_link: false). Open the dashboard on the machine running AgEnD to preview.",
|
|
58
|
+
pvServer_publicLinkStarting: "Preview is starting… — the public link's preview address is being opened; the preview runs here as soon as it is up.",
|
|
59
|
+
pvServer_publicLinkPreviewFailed: "Previews are unavailable on this public link: {0}. The link itself keeps working.",
|
|
60
|
+
pvFail_exited: "its address closed unexpectedly", "pvFail_spawn-failed": "cloudflared could not start for it",
|
|
61
|
+
"pvFail_no-address": "no address was given for it", pvFail_unreachable: "its address could not be reached",
|
|
62
|
+
"pvFail_lease-held": "an earlier preview tunnel is still being cleaned up", "pvFail_gateway-failed": "its local listener could not start",
|
|
63
|
+
"pvFail_rate-limited": "Cloudflare is limiting new temporary links from this machine — try again in a while",
|
|
64
|
+
"pvFail_provisioning-failed": "Cloudflare refused to create its address right now", "pvFail_process-exited": "cloudflared stopped before it gave an address",
|
|
65
|
+
"pvFail_bad-address": "Cloudflare gave an address that could not be used",
|
|
66
|
+
pvFail_unknown: "an unexpected error",
|
|
57
67
|
pvServer_notOffered: "Previews are not available on this page.",
|
|
58
|
-
previews: "Allow HTML previews
|
|
59
|
-
copy: "Copy", copyMessage: "Copy this reply", copied: "Copied", copyFailed: "Copy failed", wrap: "Wrap", showAll: "Show all {0} lines", showLess: "Show less", jumpLatest: "Latest", newBelow: "{0} new",
|
|
68
|
+
previews: "Allow HTML previews",
|
|
69
|
+
copy: "Copy", copyMessage: "Copy this reply", copied: "Copied", copyFailed: "Copy failed", wrap: "Wrap", showAll: "Show all {0} lines", showMore: "Show more", showLess: "Show less", jumpLatest: "Latest", newBelow: "{0} new",
|
|
60
70
|
disconnected: "disconnected", tick_queued: "Waiting behind another message", tick_processing: "Handed to the agent", tick_delivered: "The agent has it", tick_failed: "Not delivered", tick_cancelled: "Dropped by Stop",
|
|
61
71
|
promptAnswering: "Answering…", promptGone: "This prompt is no longer open", promptFor: "{0}: {1}",
|
|
62
72
|
working: "{0} is working…", stuck: "{0} looks stuck", stopReply: "Stop reply", stopReplyTitle: "Stop the current reply (like Esc) and drop the messages still waiting. The instance keeps running.", stopSent: "Stopped",
|
|
@@ -78,11 +88,11 @@ register("chat", {
|
|
|
78
88
|
configured: "(configured)", fleetDefault: "(fleet default)",
|
|
79
89
|
},
|
|
80
90
|
"zh-TW": {
|
|
81
|
-
cmdConfirm: "清空", cmdRunning: "執行 /{0} 中…", cmdNotCommand: "這裡沒有這個指令——按 Enter 會當成一般訊息送出。", cmdDismiss: "關閉", cmdCommands: "指令",
|
|
91
|
+
cmdConfirm: "清空", cmdConfirmBackend: "切換並重新啟動", cmdRunning: "執行 /{0} 中…", cmdNotCommand: "這裡沒有這個指令——按 Enter 會當成一般訊息送出。", cmdDismiss: "關閉", cmdCommands: "指令",
|
|
82
92
|
cmdChoose: "選擇", cmdCurrent: "目前", chipCompact: "壓縮", chipClear: "清空…", chipContext: "已用 {0}% 的 context",
|
|
83
93
|
chipModel: "模型:{0}——選擇其他", chipEffort: "推理強度:{0}——選擇其他",
|
|
84
94
|
cmd_ctx: "context 用量、模型與推理強度", cmd_compact: "壓縮對話", cmd_clear: "清空對話(會先確認)",
|
|
85
|
-
cmd_model: "查看或切換模型", cmd_effort: "查看或設定推理強度", cmd_cancel: "停止目前的回覆",
|
|
95
|
+
cmd_model: "查看或切換模型", cmd_backend: "切換 CLI backend,再選模型和推理強度(會重新啟動)", cmd_effort: "查看或設定推理強度", cmd_cancel: "停止目前的回覆",
|
|
86
96
|
cmd_btw: "不打斷目前工作的旁問", cmd_steer: "送進目前這一輪", cmd_pause: "暫停 instance",
|
|
87
97
|
cmd_wake: "喚醒已暫停的 instance", cmd_save: "把對話存成檔案",
|
|
88
98
|
tourTitle: "歡迎使用網頁聊天", tourStep: "{0} / {1}", tourBack: "上一步", tourNext: "下一步", tourDone: "知道了", tourSkip: "略過",
|
|
@@ -96,23 +106,24 @@ register("chat", {
|
|
|
96
106
|
dropHere: "放開即可附加檔案", asText: "改為文字", pasteAttached: "貼上的長文字({0} 個字元)已改為文字檔附加", pasteKeptAsText: "附件已滿,貼上的長文字保留為一般文字",
|
|
97
107
|
send: "送出", composerPlaceholder: "傳訊息給 {0}…", composerHint: "Enter 送出 · Shift+Enter 換行 · / 叫出指令 · Esc 中止回覆", attachTitle: "附加檔案(圖片、PDF、文字檔,也可以貼上或拖曳)",
|
|
98
108
|
pvPreview: "預覽", pvStop: "停止", pvDownload: "下載", pvMenu: "預覽選項", pvHtml: "HTML",
|
|
99
|
-
pvAllowButton: "允許預覽", pvAllow: "
|
|
100
|
-
pvConfirm: "
|
|
109
|
+
pvAllowButton: "允許預覽", pvAllow: "允許預覽 HTML(預覽可能把資料傳出去)", pvDisallow: "不再允許預覽 HTML",
|
|
110
|
+
pvConfirm: "要允許預覽 HTML 嗎?\n\n這會套用到你登入的每一台裝置。預覽會在隔離的框架裡執行 agent 的 HTML。它無法使用你的登入,但可能把資料傳出去,也可能讓這個分頁變慢或卡住。每次仍需要你按「預覽」。",
|
|
101
111
|
pvNever: "這台裝置永不預覽 HTML", pvNeverUndo: "讓這台裝置再次可以預覽 HTML", pvStarting: "正在啟動預覽…",
|
|
102
112
|
pvChanged: "預覽已停止——訊息內容變了。請再預覽一次。", pvTruncated: "內容被截斷——請 agent 改用 .html 檔案傳送。",
|
|
103
113
|
pvLoading: "正在讀取檔案…", pvAttOver: "這個檔案超過 1 MiB,不提供預覽。",
|
|
104
114
|
pvAttGone: "這裡已無法取得這個檔案(檔案已變更,或艦隊已重新啟動)。請 agent 再傳一次。",
|
|
105
115
|
pvAttFailed: "無法讀取這個檔案,請再試一次。",
|
|
106
116
|
pvBannerAck: "我知道了", pvBannerAckTitle: "隱藏這則提醒,直到下次登入",
|
|
107
|
-
attGone: "AgEnD 重新啟動後找不到這個檔案(已移動、刪除或變更)。請 agent 再傳一次。", attUnavailable: "無法取得",
|
|
117
|
+
attGone: "AgEnD 重新啟動後找不到這個檔案(已移動、刪除或變更)。請 agent 再傳一次。", attUnavailable: "無法取得", yesterdayAt: "昨天 {0}",
|
|
108
118
|
tcShow: "顯示", tcHide: "收起", tcDownload: "下載", tcShowAll: "顯示全部 {0} 行", tcOver: "這個檔案超過 1 MiB,請下載後閱讀。", tcPlain: "內容太大,無法在這裡排版,改以純文字顯示。",
|
|
109
119
|
rbGroup: "選項", rbChosen: "{0} 已選擇", rbExpired: "已逾時,請直接回覆文字",
|
|
120
|
+
pollGroup: "投票", pollAnswered: "🗳 已有 {0} 人作答", pollClosed: "🗳 已截止 · {0} 人作答", pollLeft: "剩餘時間", pollVoters: "投票名單",
|
|
110
121
|
pvOpenPanel: "在面板中開啟", pvInPanel: "已在面板中顯示。", pvPanel: "HTML 預覽", pvSource: "來自 {0},{1}——顯示該訊息",
|
|
111
122
|
pvPage: "頁面", pvCode: "程式碼", pvReload: "重新載入", pvClose: "關閉面板", pvBack: "回到對話", pvResize: "調整預覽面板寬度",
|
|
112
123
|
pvNewer: "{0} 的回覆裡有較新的版本。", pvNewerShow: "顯示", pvPanelIdle: "按「預覽」在這裡執行。",
|
|
113
124
|
lbLabel: "圖片:{0}", lbLabelNoName: "圖片", lbClose: "關閉", lbOpenOriginal: "開啟原圖", lbPrev: "上一張", lbNext: "下一張", lbCount: "{0} / {1}",
|
|
114
|
-
pvWhyOptin: "
|
|
115
|
-
pvWhyOptinPanel: "
|
|
125
|
+
pvWhyOptin: "還沒允許 HTML 預覽。可從這張卡片的 ⋯ 選單或「設定 → 偏好設定」允許。",
|
|
126
|
+
pvWhyOptinPanel: "還沒允許 HTML 預覽。",
|
|
116
127
|
pvWhyNever: "這台裝置在這個工作階段已關閉預覽。",
|
|
117
128
|
pvWhyOrigin: "預覽已關閉:這個頁面位於 {0},但艦隊認為它位於 {1}(有會改寫 Host 的代理)。請讓外部 Host 原樣傳入,或設定 web.preview_origin。",
|
|
118
129
|
pvUnknownAddress: "未知的網址", pvWhyServer: "這裡無法使用預覽。",
|
|
@@ -127,10 +138,19 @@ register("chat", {
|
|
|
127
138
|
pvServer_needOrigin: "透過通道或代理開啟儀表板時,預覽需要設定 web.preview_origin。",
|
|
128
139
|
pvServer_needHttps: "以 https 開啟儀表板時,預覽需要 https 的 web.preview_origin。",
|
|
129
140
|
pvServer_sameOrigin: "預覽的來源不能和儀表板相同。",
|
|
130
|
-
pvServer_publicLink: "
|
|
141
|
+
pvServer_publicLink: "公開連結的預覽已關閉(web.preview_on_public_link: false)。要預覽,請在執行 AgEnD 的那台機器上開啟儀表板。",
|
|
142
|
+
pvServer_publicLinkStarting: "預覽啟動中…——正在開啟公開連結的預覽網址,好了就會在這裡執行。",
|
|
143
|
+
pvServer_publicLinkPreviewFailed: "這個公開連結無法預覽:{0}。連結本身照常可用。",
|
|
144
|
+
pvFail_exited: "它的網址意外關閉了", "pvFail_spawn-failed": "無法為它啟動 cloudflared",
|
|
145
|
+
"pvFail_no-address": "沒有取得它的網址", pvFail_unreachable: "連不到它的網址",
|
|
146
|
+
"pvFail_lease-held": "上一個預覽通道還在清理中", "pvFail_gateway-failed": "它的本機監聽無法啟動",
|
|
147
|
+
"pvFail_rate-limited": "Cloudflare 正在限制這台機器建立新的臨時連結 — 請過一陣子再試",
|
|
148
|
+
"pvFail_provisioning-failed": "Cloudflare 目前拒絕建立它的網址", "pvFail_process-exited": "cloudflared 在給出網址前就停止了",
|
|
149
|
+
"pvFail_bad-address": "Cloudflare 給出的網址無法使用",
|
|
150
|
+
pvFail_unknown: "發生了未預期的錯誤",
|
|
131
151
|
pvServer_notOffered: "這個頁面不提供預覽。",
|
|
132
|
-
previews: "
|
|
133
|
-
copy: "複製", copyMessage: "複製這則回覆", copied: "已複製", copyFailed: "複製失敗", wrap: "換行", showAll: "展開全部 {0} 行", showLess: "收合", jumpLatest: "最新", newBelow: "{0} 則新訊息",
|
|
152
|
+
previews: "允許預覽 HTML",
|
|
153
|
+
copy: "複製", copyMessage: "複製這則回覆", copied: "已複製", copyFailed: "複製失敗", wrap: "換行", showAll: "展開全部 {0} 行", showMore: "顯示更多", showLess: "收合", jumpLatest: "最新", newBelow: "{0} 則新訊息",
|
|
134
154
|
disconnected: "已斷線", tick_queued: "排在前一則訊息之後", tick_processing: "已交給 agent", tick_delivered: "agent 已收到", tick_failed: "未送達", tick_cancelled: "已被中止取消",
|
|
135
155
|
promptAnswering: "回覆中…", promptGone: "這個提示已經結束", promptFor: "{0}:{1}",
|
|
136
156
|
working: "{0} 處理中…", stuck: "{0} 似乎卡住了", stopReply: "中止回覆", stopReplyTitle: "中止目前的回覆(同 Esc),並取消還在排隊的訊息。instance 會繼續運行。", stopSent: "已中止",
|