@songsid/agend 2.2.0-beta.9 → 2.3.0-beta.1
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 +40 -24
- package/README.zh-TW.md +40 -24
- package/dist/agent-cli.js +248 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.d.ts +2 -0
- package/dist/agent-endpoint.js +28 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-file-read.d.ts +30 -0
- package/dist/agent-file-read.js +129 -0
- package/dist/agent-file-read.js.map +1 -0
- package/dist/agent-whats-new.js +20 -1
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/atomic-write.js +9 -1
- package/dist/atomic-write.js.map +1 -1
- package/dist/auth-api.d.ts +3 -1
- package/dist/auth-api.js +32 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.d.ts +33 -0
- package/dist/backend/antigravity.js +129 -21
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +3 -0
- package/dist/backend/claude-code.js +9 -0
- 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/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 +3 -0
- package/dist/backend/grok.js +9 -0
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.d.ts +3 -1
- package/dist/backend/kiro.js +7 -3
- 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.js +10 -2
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +24 -0
- 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/channel/adapters/discord.d.ts +14 -0
- package/dist/channel/adapters/discord.js +66 -4
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +26 -1
- package/dist/channel/adapters/telegram.js +98 -7
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-tools.js +36 -0
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.d.ts +2 -0
- package/dist/channel/tool-router.js +1 -1
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +31 -0
- package/dist/cli.js +124 -24
- package/dist/cli.js.map +1 -1
- package/dist/command-table.d.ts +2 -2
- package/dist/command-table.js +5 -2
- package/dist/command-table.js.map +1 -1
- package/dist/compact-watch.d.ts +86 -0
- package/dist/compact-watch.js +288 -0
- package/dist/compact-watch.js.map +1 -0
- package/dist/config-validator.js +55 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +9 -0
- package/dist/daemon.js +394 -29
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +8 -1
- package/dist/delivery-outbox.js +6 -2
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/doctor.js +7 -0
- package/dist/doctor.js.map +1 -1
- package/dist/fleet-context.d.ts +12 -0
- package/dist/fleet-manager.d.ts +247 -9
- package/dist/fleet-manager.js +1227 -142
- package/dist/fleet-manager.js.map +1 -1
- package/dist/forged-envelope-scan.d.ts +4 -3
- package/dist/forged-envelope-scan.js +4 -3
- package/dist/forged-envelope-scan.js.map +1 -1
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +4 -1
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +258 -0
- package/dist/install-lock.d.ts +18 -1
- package/dist/install-lock.js +30 -3
- package/dist/install-lock.js.map +1 -1
- package/dist/instance-avatar.d.ts +5 -4
- package/dist/instance-avatar.js +15 -8
- package/dist/instance-avatar.js.map +1 -1
- package/dist/instance-config-impact.js +3 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.js +9 -4
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.js +2 -2
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-compact-pane.d.ts +38 -0
- package/dist/kiro-compact-pane.js +57 -0
- package/dist/kiro-compact-pane.js.map +1 -0
- package/dist/launchd-handoff.d.ts +43 -0
- package/dist/launchd-handoff.js +56 -0
- package/dist/launchd-handoff.js.map +1 -0
- package/dist/locale.js +202 -30
- package/dist/locale.js.map +1 -1
- package/dist/log-service.js +10 -2
- package/dist/log-service.js.map +1 -1
- package/dist/login-shell.d.ts +21 -0
- package/dist/login-shell.js +98 -0
- package/dist/login-shell.js.map +1 -0
- package/dist/needs-you-hub.d.ts +4 -0
- package/dist/needs-you-hub.js +31 -6
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +1 -13
- package/dist/needs-you.js +3 -37
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +32 -0
- package/dist/outbound-handlers.js +150 -45
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +76 -0
- package/dist/outbound-schemas.js +65 -4
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/provider-probe.d.ts +29 -0
- package/dist/provider-probe.js +198 -2
- package/dist/provider-probe.js.map +1 -1
- package/dist/public-web-gateway.d.ts +2 -0
- package/dist/public-web-gateway.js +25 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/quickstart-api.d.ts +1 -1
- package/dist/quickstart-api.js +8 -6
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.d.ts +12 -0
- package/dist/quickstart.js +36 -6
- package/dist/quickstart.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +86 -5
- package/dist/reply-buttons-controller.js +271 -7
- 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/repo-worktree-guard.d.ts +36 -0
- package/dist/repo-worktree-guard.js +143 -0
- package/dist/repo-worktree-guard.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 +0 -2
- package/dist/restart-progress.js +0 -2
- package/dist/restart-progress.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +58 -1
- package/dist/scheduler/scheduler.js +176 -10
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/sd-notify.d.ts +22 -1
- package/dist/sd-notify.js +63 -10
- package/dist/sd-notify.js.map +1 -1
- package/dist/service-activation.d.ts +15 -7
- package/dist/service-activation.js +42 -26
- package/dist/service-activation.js.map +1 -1
- package/dist/service-installer.d.ts +24 -0
- package/dist/service-installer.js +49 -1
- package/dist/service-installer.js.map +1 -1
- package/dist/service-plan.d.ts +11 -0
- package/dist/service-plan.js +23 -0
- package/dist/service-plan.js.map +1 -1
- package/dist/settings-api.js +74 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +8 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +16 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.js +5 -0
- package/dist/settings-http-confirmation.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/tool-permissions.js +53 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.d.ts +72 -2
- package/dist/topic-commands.js +156 -38
- package/dist/topic-commands.js.map +1 -1
- package/dist/topic-link.d.ts +128 -0
- package/dist/topic-link.js +269 -0
- package/dist/topic-link.js.map +1 -0
- package/dist/transcript-jsonl.d.ts +7 -2
- package/dist/transcript-jsonl.js +13 -7
- package/dist/transcript-jsonl.js.map +1 -1
- package/dist/transcript-sources.js +6 -1
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +21 -0
- package/dist/ui/app-effects.js +187 -0
- package/dist/ui/chat-commands.js +1 -0
- package/dist/ui/chat-effect-posters.js +42 -0
- package/dist/ui/chat-effects.js +72 -0
- package/dist/ui/chat-live-replies.js +58 -0
- package/dist/ui/chat-render.js +59 -14
- package/dist/ui/chat-store.js +78 -8
- package/dist/ui/chat-strings.js +43 -16
- package/dist/ui/chat-thread.js +175 -31
- package/dist/ui/chat-tour.js +18 -15
- package/dist/ui/effect-trial-controller.js +119 -0
- package/dist/ui/effect-trial-offer.js +31 -0
- package/dist/ui/effect-trial-panel.js +37 -0
- package/dist/ui/image-lightbox.js +1 -1
- package/dist/ui/panel-chat.js +101 -27
- package/dist/ui/panel-details.js +18 -5
- package/dist/ui/panel-fleet.js +18 -5
- package/dist/ui/panel-log.js +10 -10
- package/dist/ui/panel-needs.js +13 -10
- package/dist/ui/panel-settings.js +66 -12
- package/dist/ui/preview-panel.js +25 -9
- package/dist/ui/settings-appearance.js +325 -0
- package/dist/ui/settings-dialogs.js +11 -6
- package/dist/ui/settings-effects.js +201 -0
- package/dist/ui/settings-model.js +3 -1
- package/dist/ui/settings-mods.js +257 -0
- package/dist/ui/settings-owner-effects.js +80 -0
- package/dist/ui/settings-strings.js +269 -10
- package/dist/ui/settings-token.js +7 -0
- package/dist/ui/settings-wizard.js +5 -3
- package/dist/ui/shared/agend-auth.js +27 -3
- package/dist/ui/shared/agent-widget.js +248 -0
- package/dist/ui/shared/app-i18n.js +3 -1
- package/dist/ui/shared/app-prefs.js +30 -10
- package/dist/ui/shared/app-route.js +23 -1
- package/dist/ui/shared/app-session.js +1 -1
- package/dist/ui/shared/app-shell.js +29 -16
- package/dist/ui/shared/app-store.js +2 -0
- package/dist/ui/shared/app-stream.js +15 -7
- package/dist/ui/shared/app-themes.js +188 -0
- package/dist/ui/shared/app.css +266 -11
- package/dist/ui/shared/app.js +6 -0
- package/dist/ui/shared/card-strings.js +28 -0
- package/dist/ui/shared/effect-app-runtime.js +248 -0
- package/dist/ui/shared/effect-baseline.js +64 -0
- package/dist/ui/shared/effect-chat-runtime.js +154 -0
- package/dist/ui/shared/effect-cursor.js +125 -0
- package/dist/ui/shared/effect-frame.js +127 -0
- package/dist/ui/shared/effect-geometry.js +122 -0
- package/dist/ui/shared/effect-host-style.js +10 -0
- package/dist/ui/shared/effect-owner-regions.js +74 -0
- package/dist/ui/shared/effect-owner-source.js +115 -0
- package/dist/ui/shared/effect-policy.js +137 -0
- package/dist/ui/shared/effect-poster-reader.js +98 -0
- package/dist/ui/shared/effect-posters.js +117 -0
- package/dist/ui/shared/effect-profiler.js +162 -0
- package/dist/ui/shared/effect-profiles.js +65 -0
- package/dist/ui/shared/effect-registry.js +496 -0
- package/dist/ui/shared/effect-runtime-loader.js +234 -0
- package/dist/ui/shared/effect-safety.js +153 -0
- package/dist/ui/shared/effect-stock-snapshot.js +34 -0
- package/dist/ui/shared/effect-stock-trust.js +165 -0
- package/dist/ui/shared/effect-trial-source.js +103 -0
- package/dist/ui/shared/effect-trial-stage.js +147 -0
- package/dist/ui/shared/header-tools.js +35 -15
- package/dist/ui/shared/identity-card.js +202 -0
- package/dist/ui/shared/identity-color.js +261 -0
- package/dist/ui/shared/instance-nav.js +22 -14
- package/dist/ui/shared/instance-switch.js +5 -2
- package/dist/ui/shared/owner-css.js +221 -0
- package/dist/ui/shared/owner-effect-prefs.js +117 -0
- package/dist/ui/shared/panel-view.js +96 -12
- package/dist/ui/shared/signin.js +17 -9
- package/dist/ui/shared/ui-dialog.js +1 -1
- package/dist/ui/shared/ui-icons.js +3 -0
- package/dist/ui/shared/ui-menu.js +1 -1
- package/dist/ui/shared/ui-toast.js +1 -1
- package/dist/ui/shared/view-strings.js +40 -2
- package/dist/ui/signin.html +9 -3
- 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-launch.d.ts +48 -1
- package/dist/update-launch.js +159 -5
- package/dist/update-launch.js.map +1 -1
- package/dist/usage/providers.d.ts +28 -8
- package/dist/usage/providers.js +96 -41
- package/dist/usage/providers.js.map +1 -1
- package/dist/view-api.d.ts +29 -0
- package/dist/view-api.js +214 -17
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.d.ts +86 -2
- package/dist/web-api.js +1160 -92
- package/dist/web-api.js.map +1 -1
- package/dist/web-appearance-limits.d.ts +82 -0
- package/dist/web-appearance-limits.js +83 -0
- package/dist/web-appearance-limits.js.map +1 -0
- package/dist/web-appearance-policy.d.ts +66 -0
- package/dist/web-appearance-policy.js +94 -0
- package/dist/web-appearance-policy.js.map +1 -0
- package/dist/web-appearance-tools.d.ts +50 -0
- package/dist/web-appearance-tools.js +105 -0
- package/dist/web-appearance-tools.js.map +1 -0
- package/dist/web-appearance-view.d.ts +99 -0
- package/dist/web-appearance-view.js +163 -0
- package/dist/web-appearance-view.js.map +1 -0
- package/dist/web-appearance.d.ts +79 -0
- package/dist/web-appearance.js +298 -0
- package/dist/web-appearance.js.map +1 -0
- package/dist/web-asset-parts.d.ts +98 -0
- package/dist/web-asset-parts.js +133 -0
- package/dist/web-asset-parts.js.map +1 -0
- package/dist/web-auth.js +17 -1
- package/dist/web-auth.js.map +1 -1
- package/dist/web-card.d.ts +96 -0
- package/dist/web-card.js +232 -0
- package/dist/web-card.js.map +1 -0
- package/dist/web-chat-history.d.ts +39 -1
- package/dist/web-chat-history.js +69 -9
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-commands.d.ts +39 -3
- package/dist/web-commands.js +22 -5
- package/dist/web-commands.js.map +1 -1
- package/dist/web-effect-bundle.d.ts +28 -0
- package/dist/web-effect-bundle.js +126 -0
- package/dist/web-effect-bundle.js.map +1 -0
- package/dist/web-effect-canonical.d.ts +8 -0
- package/dist/web-effect-canonical.js +27 -0
- package/dist/web-effect-canonical.js.map +1 -0
- package/dist/web-effect-library.d.ts +114 -0
- package/dist/web-effect-library.js +530 -0
- package/dist/web-effect-library.js.map +1 -0
- package/dist/web-effect-poster.d.ts +8 -0
- package/dist/web-effect-poster.js +52 -0
- package/dist/web-effect-poster.js.map +1 -0
- package/dist/web-effect-profiles.d.ts +118 -0
- package/dist/web-effect-profiles.js +180 -0
- package/dist/web-effect-profiles.js.map +1 -0
- package/dist/web-effect-service.d.ts +86 -0
- package/dist/web-effect-service.js +312 -0
- package/dist/web-effect-service.js.map +1 -0
- package/dist/web-effect-tools.d.ts +47 -0
- package/dist/web-effect-tools.js +126 -0
- package/dist/web-effect-tools.js.map +1 -0
- package/dist/web-effect-trials.d.ts +86 -0
- package/dist/web-effect-trials.js +204 -0
- package/dist/web-effect-trials.js.map +1 -0
- package/dist/web-effect-upload.d.ts +29 -0
- package/dist/web-effect-upload.js +190 -0
- package/dist/web-effect-upload.js.map +1 -0
- package/dist/web-effect-worker.d.ts +8 -0
- package/dist/web-effect-worker.js +170 -0
- package/dist/web-effect-worker.js.map +1 -0
- package/dist/web-effect.d.ts +89 -0
- package/dist/web-effect.js +132 -0
- package/dist/web-effect.js.map +1 -0
- package/dist/web-identity-color.d.ts +87 -0
- package/dist/web-identity-color.js +209 -0
- package/dist/web-identity-color.js.map +1 -0
- package/dist/web-identity-palette.d.ts +113 -0
- package/dist/web-identity-palette.js +84 -0
- package/dist/web-identity-palette.js.map +1 -0
- package/dist/web-image-meta.d.ts +25 -0
- package/dist/web-image-meta.js +200 -0
- package/dist/web-image-meta.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-mod-agent.d.ts +50 -0
- package/dist/web-mod-agent.js +203 -0
- package/dist/web-mod-agent.js.map +1 -0
- package/dist/web-mod-bundle.d.ts +144 -0
- package/dist/web-mod-bundle.js +464 -0
- package/dist/web-mod-bundle.js.map +1 -0
- package/dist/web-mod-export.d.ts +59 -0
- package/dist/web-mod-export.js +79 -0
- package/dist/web-mod-export.js.map +1 -0
- package/dist/web-mod-store.d.ts +283 -0
- package/dist/web-mod-store.js +624 -0
- package/dist/web-mod-store.js.map +1 -0
- package/dist/web-org.d.ts +3 -3
- package/dist/web-org.js +11 -17
- package/dist/web-org.js.map +1 -1
- package/dist/web-owner-css-store.d.ts +180 -0
- package/dist/web-owner-css-store.js +384 -0
- package/dist/web-owner-css-store.js.map +1 -0
- package/dist/web-owner-css.d.ts +58 -0
- package/dist/web-owner-css.js +552 -0
- package/dist/web-owner-css.js.map +1 -0
- package/dist/web-prefs.d.ts +66 -0
- package/dist/web-prefs.js +243 -35
- package/dist/web-prefs.js.map +1 -1
- package/dist/web-preview.d.ts +9 -1
- package/dist/web-preview.js +24 -7
- 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-session.d.ts +14 -0
- package/dist/web-session.js +10 -0
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +18 -0
- package/dist/web-settings-patch.js +51 -0
- package/dist/web-settings-patch.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-theme-store.d.ts +218 -0
- package/dist/web-theme-store.js +516 -0
- package/dist/web-theme-store.js.map +1 -0
- package/dist/web-theme.d.ts +121 -0
- package/dist/web-theme.js +407 -0
- package/dist/web-theme.js.map +1 -0
- package/dist/web-upload.d.ts +119 -4
- package/dist/web-upload.js +252 -39
- package/dist/web-upload.js.map +1 -1
- package/dist/web-widget.d.ts +72 -0
- package/dist/web-widget.js +245 -0
- package/dist/web-widget.js.map +1 -0
- package/launcher/install-admission.cjs +61 -6
- package/package.json +3 -3
package/dist/topic-commands.js
CHANGED
|
@@ -3,7 +3,7 @@ import { LOGIN_BACKEND_ALIASES } from "./login-flows.js";
|
|
|
3
3
|
import { measureSyncWork } from "./sync-work-attribution.js";
|
|
4
4
|
import { LOOPBACK_HOST_NAMES } from "./web-host-guard.js";
|
|
5
5
|
import { WEB_REMOTE_DOCS_URL } from "./upgrade-notices.js";
|
|
6
|
-
import { readFileSync, existsSync } from "node:fs";
|
|
6
|
+
import { closeSync, readFileSync, existsSync } from "node:fs";
|
|
7
7
|
import { exec, execFileSync } from "node:child_process";
|
|
8
8
|
import { promisify } from "node:util";
|
|
9
9
|
import { join, basename } from "node:path";
|
|
@@ -21,11 +21,13 @@ import { runVisibilityCommand } from "./cross-instance-notice.js";
|
|
|
21
21
|
import { clampContextPercent, parseContextPercent, parseTokenContextRatio, } from "./context-percent.js";
|
|
22
22
|
import { isGeneralInstance } from "./general-instance.js";
|
|
23
23
|
import { instanceSupportsSteer } from "./steer-capability.js";
|
|
24
|
+
import { compareSemver } from "./update-check.js";
|
|
24
25
|
import { SYSINFO_BACKEND_IDS } from "./backend/types.js";
|
|
25
26
|
import { recordInternalRequest, withOrigin } from "./fleet-control-audit.js";
|
|
26
27
|
import { resolveInstalledAgend } from "./update-dispatch.js";
|
|
27
|
-
import { resolveUpdateLaunch, watchUpdateLaunch } from "./update-launch.js";
|
|
28
|
+
import { resolveUpdateLaunch, openUpdateLog, updateLogPath, watchUpdateLaunch } from "./update-launch.js";
|
|
28
29
|
import { selfCommand } from "./cli-entry.js";
|
|
30
|
+
import { GENERAL_POINTING_REFUSALS, placeSuffix } from "./topic-link.js";
|
|
29
31
|
export { parseContextPercent, parseTokenContextRatio } from "./context-percent.js";
|
|
30
32
|
/** Longest one setMyCommands call may take. */
|
|
31
33
|
const TELEGRAM_COMMANDS_TIMEOUT_MS = 10_000;
|
|
@@ -160,6 +162,54 @@ function disambiguateLabel(name, explicit, base, used) {
|
|
|
160
162
|
}
|
|
161
163
|
/** Allowed filename for /save and /load (no path separators, no shell/inject chars). */
|
|
162
164
|
export const SAVE_FILENAME_RE = /^[\w.-]+$/;
|
|
165
|
+
/**
|
|
166
|
+
* #1809: resolve a display label (as shown by `agend ls`) back to a real instance name.
|
|
167
|
+
* Returns the real name on a unique match, `null` when the query does not match any label,
|
|
168
|
+
* or `{ ambiguous: true, realNames }` when two labels are identical under case-folding
|
|
169
|
+
* (e.g. display_names "Prism" and "prism" both fold to "prism").
|
|
170
|
+
* Always case-insensitive. Real names are NOT resolved here — callers must try real names first.
|
|
171
|
+
*/
|
|
172
|
+
export function resolveByLabel(query, entries) {
|
|
173
|
+
const labelMap = assignDisplayLabels(entries);
|
|
174
|
+
const q = query.toLowerCase();
|
|
175
|
+
const matches = [];
|
|
176
|
+
for (const [realName, label] of labelMap) {
|
|
177
|
+
if (label.toLowerCase() === q)
|
|
178
|
+
matches.push(realName);
|
|
179
|
+
}
|
|
180
|
+
if (matches.length === 0)
|
|
181
|
+
return null;
|
|
182
|
+
if (matches.length === 1)
|
|
183
|
+
return matches[0];
|
|
184
|
+
return { ambiguous: true, realNames: matches };
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* #1809: full label/name resolution pipeline without process.exit or readline — suitable for
|
|
188
|
+
* unit testing and for callers that want to decide what to do on each outcome.
|
|
189
|
+
*
|
|
190
|
+
* Resolution order:
|
|
191
|
+
* 1. Exact match on real name (case-insensitive) — always wins.
|
|
192
|
+
* 2. Exact match on the display label `agend ls` shows (via `resolveByLabel`).
|
|
193
|
+
* 3. No match → `{ kind: "none" }`.
|
|
194
|
+
*
|
|
195
|
+
* Returns `{ kind: "name", realName }` on success,
|
|
196
|
+
* `{ kind: "ambiguous", realNames }` when two labels are case-identical,
|
|
197
|
+
* or `{ kind: "none" }` when nothing matched.
|
|
198
|
+
*/
|
|
199
|
+
export function resolveName(query, entries) {
|
|
200
|
+
// Step 1: exact real-name match wins.
|
|
201
|
+
const q = query.toLowerCase();
|
|
202
|
+
const exactReal = entries.find(e => e.name.toLowerCase() === q);
|
|
203
|
+
if (exactReal)
|
|
204
|
+
return { kind: "name", realName: exactReal.name };
|
|
205
|
+
// Step 2: label match.
|
|
206
|
+
const labelResult = resolveByLabel(query, entries);
|
|
207
|
+
if (labelResult === null)
|
|
208
|
+
return { kind: "none" };
|
|
209
|
+
if (typeof labelResult === "string")
|
|
210
|
+
return { kind: "name", realName: labelResult };
|
|
211
|
+
return { kind: "ambiguous", realNames: labelResult.realNames };
|
|
212
|
+
}
|
|
163
213
|
/** Backends with a native side-question command that does not steer the active turn. */
|
|
164
214
|
export const BTW_SUPPORTED_BACKENDS = new Set(["claude-code"]);
|
|
165
215
|
/**
|
|
@@ -187,14 +237,6 @@ export function parsePauseWakeCommand(text) {
|
|
|
187
237
|
return null;
|
|
188
238
|
return { action: match[1], instance: match[2] };
|
|
189
239
|
}
|
|
190
|
-
/**
|
|
191
|
-
* The in-session compact/context-reset command for a backend NAME (the fleet
|
|
192
|
-
* process routes /compact via IPC and only has the backend string, not a
|
|
193
|
-
* CliBackend instance). Keep in sync with each backend's getCompactCommand().
|
|
194
|
-
* Most CLIs (claude-code, kiro-cli, codex, opencode) use "/compact".
|
|
195
|
-
* Antigravity (agy) has NO summarizing compact — its only manual context-reset
|
|
196
|
-
* is "/clear" (a full reset; it also auto-summarizes at a token threshold).
|
|
197
|
-
*/
|
|
198
240
|
/** os.release(), guarded — purely informational, must never break /sysinfo. */
|
|
199
241
|
function osRelease() {
|
|
200
242
|
try {
|
|
@@ -241,10 +283,20 @@ function backendCliLines(versions) {
|
|
|
241
283
|
}),
|
|
242
284
|
];
|
|
243
285
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
286
|
+
/**
|
|
287
|
+
* Board 0340ec89: agy's own `/compact` summarizes the conversation (verified live on 1.3.6: "Conversation compacted ·
|
|
288
|
+
* 5 steps summarized", tests/fixtures/agy-1.3.6-compact.pane.txt). agy's release notes add it in 1.3.5, and the 1.3.5
|
|
289
|
+
* binary registers it ("Compact the conversation now (summarize history to free up the context window)"), so 1.3.5 is
|
|
290
|
+
* the floor. AgEnD used to send `/clear` for an agy compact, which wiped the conversation instead. An agy known to be
|
|
291
|
+
* older than that is refused (null), never cleared; an agy whose version is not known yet gets `/compact` (a version
|
|
292
|
+
* without it ignores the line).
|
|
293
|
+
*/
|
|
294
|
+
export const AGY_COMPACT_MIN_VERSION = "1.3.5";
|
|
295
|
+
export function compactCommandForBackend(backend, version) {
|
|
296
|
+
if (backend !== "antigravity")
|
|
297
|
+
return "/compact";
|
|
298
|
+
const v = typeof version === "string" ? version.match(/\d+\.\d+\.\d+/)?.[0] : undefined;
|
|
299
|
+
return v && (compareSemver(v, AGY_COMPACT_MIN_VERSION) ?? 0) < 0 ? null : "/compact";
|
|
248
300
|
}
|
|
249
301
|
/**
|
|
250
302
|
* Backends whose `/compact` verifiably takes custom summarization instructions
|
|
@@ -256,7 +308,7 @@ export function compactCommandForBackend(backend) {
|
|
|
256
308
|
* compact into a prompt, so it must never be appended.
|
|
257
309
|
* - grok 1.0.46: the binary answers "/compact takes no arguments."
|
|
258
310
|
* - opencode 1.18: `/compact` calls session.summarize with no text.
|
|
259
|
-
* - kiro-cli: takes none (audit); antigravity
|
|
311
|
+
* - kiro-cli: takes none (audit); antigravity's own /compact (1.3.5+, board 0340ec89) takes none either.
|
|
260
312
|
* - muse 1.4.2: accepts the line (empty session: "nothing to summarize") but
|
|
261
313
|
* no use of the text is verifiable — unsupported until shown otherwise.
|
|
262
314
|
*/
|
|
@@ -447,6 +499,7 @@ const INSTANCE_FORMS = [
|
|
|
447
499
|
["collab", bare("collab")],
|
|
448
500
|
["effort", withArgs("effort")],
|
|
449
501
|
["model", withArgs("model")],
|
|
502
|
+
["backend", withArgs("backend")],
|
|
450
503
|
["compact", text => parseCompactCommand(text) !== null],
|
|
451
504
|
["steer", withArgs("steer")],
|
|
452
505
|
["btw", withArgs("btw")],
|
|
@@ -489,12 +542,27 @@ export class TopicCommands {
|
|
|
489
542
|
}, "telegram");
|
|
490
543
|
if (decision.allow || "passthrough" in decision)
|
|
491
544
|
return null;
|
|
545
|
+
// A command off for want of fleet admins names where they go (`{0}` in its disabled reply).
|
|
546
|
+
if (decision.reply === spec.disabled)
|
|
547
|
+
return [...decision.reply, this.adminListKey(msg.adapterId)];
|
|
492
548
|
return decision.reply;
|
|
493
549
|
}
|
|
550
|
+
/** Where the adapter's fleet-admin list is in fleet.yaml (the fleet's answer; a bare key without it). */
|
|
551
|
+
adminListKey(adapterId) {
|
|
552
|
+
return this.ctx.adminListKey?.(adapterId) ?? "access.allowed_users";
|
|
553
|
+
}
|
|
494
554
|
async sendRefusal(msg, [key, ...args]) {
|
|
495
555
|
const adapter = this.getReplyAdapter(msg);
|
|
496
|
-
if (adapter)
|
|
497
|
-
|
|
556
|
+
if (!adapter)
|
|
557
|
+
return;
|
|
558
|
+
// #1990: a refusal that sends the person to General links to it.
|
|
559
|
+
const text = t(key, ...args) + (GENERAL_POINTING_REFUSALS.has(key) ? placeSuffix({ kind: "general" }, "General") : "");
|
|
560
|
+
const out = this.placed(msg, text);
|
|
561
|
+
await adapter.sendText(msg.chatId, out.text, out.opts).catch(() => { });
|
|
562
|
+
}
|
|
563
|
+
/** #1990: a reply in the message's own chat, its place tokens rendered for the world it came from. */
|
|
564
|
+
placed(msg, text) {
|
|
565
|
+
return this.ctx.renderPlaces?.(msg.adapterId, text, { threadId: msg.threadId }) ?? { text, opts: { threadId: msg.threadId } };
|
|
498
566
|
}
|
|
499
567
|
getReplyAdapter(msg) {
|
|
500
568
|
if (msg.adapterId && this.ctx.adapters) {
|
|
@@ -596,6 +664,13 @@ export class TopicCommands {
|
|
|
596
664
|
}
|
|
597
665
|
return false;
|
|
598
666
|
}
|
|
667
|
+
/**
|
|
668
|
+
* General's action-first menu. The click owns private issuance; no URL or code exists in this copy.
|
|
669
|
+
*/
|
|
670
|
+
getDashboardMenuText() {
|
|
671
|
+
const access = this.ctx.getDashboardAccess?.();
|
|
672
|
+
return access?.ready && access.token ? t("dashboard.menu_instruction") : t("dashboard.starting");
|
|
673
|
+
}
|
|
599
674
|
/**
|
|
600
675
|
* Pure, secret-free dashboard/menu copy. Issuance belongs to the private
|
|
601
676
|
* delivery action; rendering or previewing this text cannot retire a code.
|
|
@@ -633,7 +708,7 @@ export class TopicCommands {
|
|
|
633
708
|
const threadId = msg.threadId;
|
|
634
709
|
// The caller's own adapter decides, and an empty list means the command is off for everyone.
|
|
635
710
|
if (!this.ctx.hasFleetAdmins(msg.adapterId)) {
|
|
636
|
-
await adapter.sendText(chatId, t("dashboard.disabled"), { threadId });
|
|
711
|
+
await adapter.sendText(chatId, t("dashboard.disabled", this.adminListKey(msg.adapterId)), { threadId });
|
|
637
712
|
return;
|
|
638
713
|
}
|
|
639
714
|
if (!this.ctx.isFleetAdmin(msg.userId, msg.adapterId)) {
|
|
@@ -770,6 +845,23 @@ export class TopicCommands {
|
|
|
770
845
|
}
|
|
771
846
|
return true;
|
|
772
847
|
}
|
|
848
|
+
if (command === "backend") {
|
|
849
|
+
const adapter = this.getReplyAdapter(msg);
|
|
850
|
+
if (!adapter)
|
|
851
|
+
return false;
|
|
852
|
+
// #1806: the same gate as /model.
|
|
853
|
+
if (!this.ctx.isFleetAdmin(msg.userId, msg.adapterId)) {
|
|
854
|
+
await adapter.sendText(msg.chatId, t("permission.denied"), { threadId: msg.threadId });
|
|
855
|
+
return true;
|
|
856
|
+
}
|
|
857
|
+
if (this.ctx.runBackendCommand) {
|
|
858
|
+
await this.ctx.runBackendCommand(instanceName, text, msg.userId, msg.threadId ?? msg.chatId, adapter, msg.chatId, msg.threadId, msg.adapterId);
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
await adapter.sendText(msg.chatId, t("backend.usage"), { threadId: msg.threadId });
|
|
862
|
+
}
|
|
863
|
+
return true;
|
|
864
|
+
}
|
|
773
865
|
if (command === "compact") {
|
|
774
866
|
const compact = parseCompactCommand(text);
|
|
775
867
|
const adapter = this.getReplyAdapter(msg);
|
|
@@ -990,6 +1082,14 @@ export class TopicCommands {
|
|
|
990
1082
|
}
|
|
991
1083
|
/** Send the backend-appropriate compact command to an instance's tmux pane */
|
|
992
1084
|
async sendCompact(instanceName, instructions) {
|
|
1085
|
+
return this.compactInstance(instanceName, instructions).text;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* sendCompact, saying whether the command was handed to the daemon (the web chat follows a sent one to its end,
|
|
1089
|
+
* board 003648ac). `notify` runs only when it is about to be handed over; its id rides along so the daemon says when
|
|
1090
|
+
* the command reached the pane (`raw_paste_written`). A write the IPC refuses is not sent.
|
|
1091
|
+
*/
|
|
1092
|
+
compactInstance(instanceName, instructions, notify) {
|
|
993
1093
|
const ipc = this.ctx.instanceIpcClients.get(instanceName);
|
|
994
1094
|
if (ipc?.connected) {
|
|
995
1095
|
const classicBackend = this.ctx.classicChannels?.getChannelIdByInstance(instanceName)
|
|
@@ -998,26 +1098,34 @@ export class TopicCommands {
|
|
|
998
1098
|
const backend = this.ctx.fleetConfig?.instances[instanceName]?.backend
|
|
999
1099
|
?? classicBackend
|
|
1000
1100
|
?? this.ctx.fleetConfig?.defaults?.backend ?? "claude-code";
|
|
1001
|
-
const
|
|
1101
|
+
const agyVersion = backend === "antigravity" ? this.ctx.getBackendCliVersionSnapshot?.()?.antigravity?.version ?? null : null;
|
|
1102
|
+
const base = compactCommandForBackend(backend, agyVersion);
|
|
1103
|
+
if (base === null)
|
|
1104
|
+
return { sent: false, text: t("compact.unsupported_version", backend, agyVersion ?? "?", AGY_COMPACT_MIN_VERSION) };
|
|
1002
1105
|
const custom = normalizeCompactInstructions(instructions);
|
|
1003
1106
|
if (custom.length > COMPACT_INSTRUCTIONS_MAX) {
|
|
1004
1107
|
// Refuse rather than cut: a truncated instruction is a different instruction.
|
|
1005
|
-
return t("compact.instructions_too_long", String(COMPACT_INSTRUCTIONS_MAX));
|
|
1108
|
+
return { sent: false, text: t("compact.instructions_too_long", String(COMPACT_INSTRUCTIONS_MAX)) };
|
|
1006
1109
|
}
|
|
1110
|
+
const id = notify?.() ?? null;
|
|
1111
|
+
const paste = (content) => ipc.send({ type: "raw_paste", content, ...(id ? { notify_written: id } : {}) }) !== false;
|
|
1007
1112
|
if (!custom) {
|
|
1008
|
-
|
|
1009
|
-
|
|
1113
|
+
if (!paste(base))
|
|
1114
|
+
return { sent: false, text: t("compact.not_connected") };
|
|
1115
|
+
return { sent: true, text: t("compact.sent", base) };
|
|
1010
1116
|
}
|
|
1011
1117
|
if (backendSupportsCompactInstructions(backend)) {
|
|
1012
|
-
|
|
1013
|
-
|
|
1118
|
+
if (!paste(`${base} ${custom}`))
|
|
1119
|
+
return { sent: false, text: t("compact.not_connected") };
|
|
1120
|
+
return { sent: true, text: t("compact.sent_with_instructions", base) };
|
|
1014
1121
|
}
|
|
1015
1122
|
// Compact as asked, without the text, and say so — never send it (codex
|
|
1016
1123
|
// would take it for a chat message) and never drop it unannounced.
|
|
1017
|
-
|
|
1018
|
-
|
|
1124
|
+
if (!paste(base))
|
|
1125
|
+
return { sent: false, text: t("compact.not_connected") };
|
|
1126
|
+
return { sent: true, text: `${t("compact.sent", base)}\n${t("compact.instructions_ignored", backend)}` };
|
|
1019
1127
|
}
|
|
1020
|
-
return t("compact.not_connected");
|
|
1128
|
+
return { sent: false, text: t("compact.not_connected") };
|
|
1021
1129
|
}
|
|
1022
1130
|
/** Whether the instance backend exposes a verified full-reset command. */
|
|
1023
1131
|
supportsClear(instanceName) {
|
|
@@ -1099,20 +1207,24 @@ export class TopicCommands {
|
|
|
1099
1207
|
}
|
|
1100
1208
|
/** Send the backend-appropriate full conversation reset through raw_paste. */
|
|
1101
1209
|
async sendClear(instanceName) {
|
|
1210
|
+
return this.clearInstance(instanceName).text;
|
|
1211
|
+
}
|
|
1212
|
+
/** sendClear, saying whether the command was handed to the daemon (board 003648ac: the web chat's card then leaves). */
|
|
1213
|
+
clearInstance(instanceName) {
|
|
1102
1214
|
const backend = this.effectiveBackend(instanceName);
|
|
1103
1215
|
const cmd = clearCommandForBackend(backend);
|
|
1104
1216
|
if (!cmd)
|
|
1105
|
-
return t("clear.unsupported");
|
|
1217
|
+
return { sent: false, text: t("clear.unsupported") };
|
|
1106
1218
|
const ipc = this.ctx.instanceIpcClients.get(instanceName);
|
|
1107
1219
|
if (ipc?.connected) {
|
|
1108
|
-
ipc.send({
|
|
1220
|
+
const sent = ipc.send({
|
|
1109
1221
|
type: "raw_paste",
|
|
1110
1222
|
content: cmd,
|
|
1111
1223
|
...(backend === "kiro-cli" ? { confirm_clear: true } : {}),
|
|
1112
|
-
});
|
|
1113
|
-
return t("clear.sent", cmd);
|
|
1224
|
+
}) !== false;
|
|
1225
|
+
return sent ? { sent: true, text: t("clear.sent", cmd) } : { sent: false, text: t("clear.not_connected") };
|
|
1114
1226
|
}
|
|
1115
|
-
return t("clear.not_connected");
|
|
1227
|
+
return { sent: false, text: t("clear.not_connected") };
|
|
1116
1228
|
}
|
|
1117
1229
|
/** Send a backend-appropriate session-save command to a fleet-topic instance. */
|
|
1118
1230
|
async sendSave(instanceName, filename) {
|
|
@@ -1498,7 +1610,7 @@ export class TopicCommands {
|
|
|
1498
1610
|
const threadId = msg.threadId;
|
|
1499
1611
|
// Access control — only fleet admins of THIS adapter can trigger an update; empty = disabled
|
|
1500
1612
|
if (!this.ctx.hasFleetAdmins(msg.adapterId)) {
|
|
1501
|
-
await adapter.sendText(chatId, t("update.disabled"), { threadId });
|
|
1613
|
+
await adapter.sendText(chatId, t("update.disabled", this.adminListKey(msg.adapterId)), { threadId });
|
|
1502
1614
|
return;
|
|
1503
1615
|
}
|
|
1504
1616
|
if (!this.ctx.isFleetAdmin(msg.userId, msg.adapterId)) {
|
|
@@ -1511,7 +1623,7 @@ export class TopicCommands {
|
|
|
1511
1623
|
// agend, verified by identity, by absolute path — or a refusal, never whatever `agend` is first on PATH.
|
|
1512
1624
|
const installed = await resolveInstalledAgend();
|
|
1513
1625
|
if (!installed.ok) {
|
|
1514
|
-
this.ctx.failUpdateProgress?.(
|
|
1626
|
+
this.ctx.failUpdateProgress?.(`${t("update.failure.shell")} ${t("update.failure.installed", installed.reason)}`);
|
|
1515
1627
|
return;
|
|
1516
1628
|
}
|
|
1517
1629
|
const { spawn } = await import("node:child_process");
|
|
@@ -1519,17 +1631,22 @@ export class TopicCommands {
|
|
|
1519
1631
|
recordInternalRequest(this.ctx.dataDir, "update", origin);
|
|
1520
1632
|
const launch = await resolveUpdateLaunch(installed.agend);
|
|
1521
1633
|
if (!launch.ok) {
|
|
1522
|
-
this.ctx.failUpdateProgress?.(
|
|
1634
|
+
this.ctx.failUpdateProgress?.(`${t("update.failure.shell")} ${t("update.failure.independent", launch.reason)}`);
|
|
1523
1635
|
return;
|
|
1524
1636
|
}
|
|
1525
1637
|
if (!this.ctx.hasFleetAdmins(msg.adapterId) || !this.ctx.isFleetAdmin(msg.userId, msg.adapterId) || this.ctx.isFleetStopping()) {
|
|
1526
1638
|
this.ctx.failUpdateProgress?.(t("not_authorized"));
|
|
1527
1639
|
return;
|
|
1528
1640
|
}
|
|
1641
|
+
const logPath = updateLogPath(this.ctx.dataDir);
|
|
1642
|
+
const ts = new Date().toISOString();
|
|
1643
|
+
const logFd = openUpdateLog(logPath, `--- /update ${ts} ---`);
|
|
1529
1644
|
const child = spawn(launch.command, launch.args, {
|
|
1530
|
-
detached: true, stdio: "ignore", env: withOrigin(origin),
|
|
1645
|
+
detached: true, stdio: ["ignore", logFd ? logFd.fd : "ignore", logFd ? logFd.fd : "ignore"], env: withOrigin(origin),
|
|
1531
1646
|
});
|
|
1532
|
-
|
|
1647
|
+
if (logFd)
|
|
1648
|
+
closeSync(logFd.fd);
|
|
1649
|
+
watchUpdateLaunch(child, message => this.ctx.failUpdateProgress?.(message), logFd ? logPath : undefined, logFd?.offset, installed.agend);
|
|
1533
1650
|
child.unref();
|
|
1534
1651
|
}
|
|
1535
1652
|
/** #1302: `/visibility [full|summary|hidden]` in the General topic. */
|
|
@@ -1585,7 +1702,8 @@ export class TopicCommands {
|
|
|
1585
1702
|
const adapter = this.getReplyAdapter(msg);
|
|
1586
1703
|
if (!adapter)
|
|
1587
1704
|
return;
|
|
1588
|
-
|
|
1705
|
+
const out = this.placed(msg, t("topic.unbound") + placeSuffix({ kind: "general" }, "General"));
|
|
1706
|
+
await adapter.sendText(msg.chatId, out.text, out.opts);
|
|
1589
1707
|
}
|
|
1590
1708
|
/**
|
|
1591
1709
|
* Handle provider-confirmed topic deletion without deleting instance data.
|