@songsid/agend 2.3.5-alpha.12 → 2.3.5-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/agent-export.d.ts +74 -0
- package/dist/agent-export.js +362 -0
- package/dist/agent-export.js.map +1 -0
- package/dist/agent-workspace.d.ts +1 -2
- package/dist/agent-workspace.js +8 -29
- package/dist/agent-workspace.js.map +1 -1
- package/dist/auth-api.js +3 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/codex.d.ts +7 -14
- package/dist/backend/codex.js +25 -29
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok-mcp.d.ts +5 -0
- package/dist/backend/grok-mcp.js +221 -0
- package/dist/backend/grok-mcp.js.map +1 -0
- package/dist/backend/grok.d.ts +0 -10
- package/dist/backend/grok.js +5 -82
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +6 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/cli.js +45 -12
- package/dist/cli.js.map +1 -1
- package/dist/codex-pane-ownership.d.ts +13 -0
- package/dist/codex-pane-ownership.js +192 -0
- package/dist/codex-pane-ownership.js.map +1 -0
- package/dist/daemon.d.ts +2 -0
- package/dist/daemon.js +89 -8
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-manager.d.ts +15 -1
- package/dist/fleet-manager.js +72 -17
- package/dist/fleet-manager.js.map +1 -1
- package/dist/hub/client.d.ts +1 -1
- package/dist/hub/client.js +11 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +2 -2
- package/dist/hub/compose/member.js +11 -3
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/join/local.d.ts +1 -0
- package/dist/hub/join/local.js +8 -3
- package/dist/hub/join/local.js.map +1 -1
- package/dist/hub/member/exposure-api.d.ts +2 -0
- package/dist/hub/member/exposure-api.js +4 -2
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/pairing-api.d.ts +2 -2
- package/dist/hub/member/pairing-api.js +2 -2
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/server.js +8 -0
- package/dist/hub/server.js.map +1 -1
- package/dist/hub-pairing-summary.d.ts +3 -1
- package/dist/hub-pairing-summary.js +6 -3
- package/dist/hub-pairing-summary.js.map +1 -1
- package/dist/install-user-systemd.d.ts +20 -0
- package/dist/install-user-systemd.js +55 -0
- package/dist/install-user-systemd.js.map +1 -0
- package/dist/linux-launchers.d.ts +88 -0
- package/dist/linux-launchers.js +296 -0
- package/dist/linux-launchers.js.map +1 -0
- package/dist/locale.js +91 -4
- package/dist/locale.js.map +1 -1
- package/dist/runtime-client-store.js +5 -0
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-pane-private.d.ts +2 -0
- package/dist/runtime-pane-private.js +25 -0
- package/dist/runtime-pane-private.js.map +1 -1
- package/dist/runtime-pane-private.ps1 +74 -7
- package/dist/selection-card.d.ts +4 -3
- package/dist/selection-card.js +2 -1
- package/dist/selection-card.js.map +1 -1
- package/dist/service-installer.js +11 -2
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-change.d.ts +2 -0
- package/dist/settings-change.js +74 -31
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +23 -0
- package/dist/settings-confirmation.js +13 -2
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +4 -0
- package/dist/settings-effect.js +14 -14
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -1
- package/dist/settings-http-confirmation.js +12 -7
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-summary.d.ts +24 -0
- package/dist/settings-summary.js +42 -0
- package/dist/settings-summary.js.map +1 -0
- package/dist/transcript-delta-reader.d.ts +9 -1
- package/dist/transcript-delta-reader.js +37 -8
- package/dist/transcript-delta-reader.js.map +1 -1
- package/dist/ui/agent-details-settings.js +253 -0
- package/dist/ui/agent-export-dialog.js +169 -0
- package/dist/ui/agent-export-strings.js +81 -0
- package/dist/ui/agent-instructions-field.js +69 -0
- package/dist/ui/agent-page-strings.js +148 -0
- package/dist/ui/chat-quote.js +12 -17
- package/dist/ui/hub-client.js +1 -1
- package/dist/ui/hub-company-join-strings.js +1 -1
- package/dist/ui/hub-company-join.js +7 -0
- package/dist/ui/hub-strings.js +4 -0
- package/dist/ui/native-instance-settings.js +47 -14
- package/dist/ui/panel-details.js +38 -14
- package/dist/ui/panel-fleet.js +2 -2
- package/dist/ui/panel-settings.js +12 -9
- package/dist/ui/settings-access-overview.js +24 -3
- package/dist/ui/settings-confirm.js +5 -5
- package/dist/ui/settings-dialogs.js +210 -100
- package/dist/ui/settings-hub-company-join.js +69 -14
- package/dist/ui/settings-hub.js +13 -5
- package/dist/ui/settings-layout.js +0 -2
- package/dist/ui/settings-model.js +15 -0
- package/dist/ui/shared/access-overview.css +48 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +144 -3
- package/dist/ui/shared/app.css +74 -50
- package/dist/ui/shared/instance-nav.js +5 -1
- package/dist/ui/shared/view-strings.js +2 -0
- package/dist/update-dispatch.d.ts +62 -0
- package/dist/update-dispatch.js +69 -2
- package/dist/update-dispatch.js.map +1 -1
- package/dist/web-api.d.ts +2 -0
- package/dist/web-api.js +49 -0
- package/dist/web-api.js.map +1 -1
- package/dist/web-session.d.ts +4 -2
- package/dist/web-session.js +5 -2
- package/dist/web-session.js.map +1 -1
- package/dist/windows-shortcuts.d.ts +29 -5
- package/dist/windows-shortcuts.js +52 -9
- package/dist/windows-shortcuts.js.map +1 -1
- package/dist/workspace-file-policy.d.ts +2 -0
- package/dist/workspace-file-policy.js +31 -0
- package/dist/workspace-file-policy.js.map +1 -0
- package/dist/workspace-follow.js +2 -1
- package/dist/workspace-follow.js.map +1 -1
- package/launcher/agend-install.cjs +7 -1
- package/package.json +2 -2
- package/templates/icons/agend-restart.ico +0 -0
- package/templates/icons/agend.ico +0 -0
- package/templates/runtime-assets/runtime-pane-private.ps1 +74 -7
- package/templates/windows-shortcuts.ps1 +45 -12
package/dist/fleet-manager.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SettingsSummaryPresentation } from "./settings-summary.js";
|
|
1
2
|
import { AgentRuntimeChanges } from "./agent-runtime-change.js";
|
|
2
3
|
import { type HumanOrigin } from "./human-delivery-receipts.js";
|
|
3
4
|
import { SettingsConfirmationStore, type SettingsPendingView } from "./settings-confirmation.js";
|
|
@@ -464,6 +465,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
464
465
|
previewGeneralLocation(raw: unknown): {
|
|
465
466
|
input: GeneralSwitchInput;
|
|
466
467
|
summary: string[];
|
|
468
|
+
summary_i18n?: SettingsSummaryPresentation;
|
|
467
469
|
connections: string[];
|
|
468
470
|
};
|
|
469
471
|
/** All entry points, including automatic native recovery, must respect an interrupted binding switch. */
|
|
@@ -596,6 +598,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
596
598
|
/** Native CLIs are headless: the manager owns the durable delivery generation instead of a tmux daemon. */
|
|
597
599
|
private deliveryBootId;
|
|
598
600
|
private rawFleetConfig;
|
|
601
|
+
/**
|
|
602
|
+
* AGEND-163: one agent's own saved settings, as fleet.yaml has them — not `fleetConfig.instances[name]`, which has the fleet's
|
|
603
|
+
* defaults merged in. Undefined when fleet.yaml has no such agent.
|
|
604
|
+
*/
|
|
605
|
+
rawInstanceConfig(name: string): Record<string, unknown> | undefined;
|
|
599
606
|
/**
|
|
600
607
|
* S-51 (#3095, experimental, off by default): the Hub runtime. src/hub/runtime.js is imported only once a Hub switch
|
|
601
608
|
* (hub.enabled / hub_member.enabled) is on; while both are off nothing Hub-related loads, opens or listens.
|
|
@@ -605,6 +612,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
605
612
|
private hubMemberBinding;
|
|
606
613
|
/** The member link as the "Connect to a Hub" view shows it (S5's client lifecycle). */
|
|
607
614
|
private hubMemberLink;
|
|
615
|
+
private hubMemberLinkBinding;
|
|
608
616
|
/** OutboundContext: the Hub representative's answer hook (null: no member service running, or not a Hub answer). */
|
|
609
617
|
hubReport(input: {
|
|
610
618
|
correlationId: string;
|
|
@@ -1128,6 +1136,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
1128
1136
|
* stays another way to confirm; General is told of a change a chat account confirmed here, when one can be.
|
|
1129
1137
|
*/
|
|
1130
1138
|
private settingsSelfConfirmation;
|
|
1139
|
+
/** Company Start is the signed-in admin’s consent; a personal enforced remote code still applies. */
|
|
1140
|
+
private settingsCompanyJoinAllowed;
|
|
1131
1141
|
/**
|
|
1132
1142
|
* AGEND-122 (Prism P2): whether the ordinary New Agent shortcut — created at once, web-confirmed, with no held change — is open to
|
|
1133
1143
|
* this request. It is the same policy as Apply now: refused where "Only this computer can authorize" is on and this is not the
|
|
@@ -1180,6 +1190,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
1180
1190
|
* that opens a link is never confirmed over a link (the public gateway, bound by the gateway itself, never by a header), the
|
|
1181
1191
|
* code or not. The code is the authority; the session only carries it.
|
|
1182
1192
|
*/
|
|
1193
|
+
/** Only the server-attested company Start carries its own policy, bound to the original live private cookie. */
|
|
1194
|
+
private settingsCodeRole;
|
|
1183
1195
|
private settingsCodeSession;
|
|
1184
1196
|
/** One look at a code, for every place that asks for one: the fleet-wide wrong-code limit and a clock that looks off, logged and noticed the same way. */
|
|
1185
1197
|
private checkAuthenticatorCode;
|
|
@@ -4317,7 +4329,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
4317
4329
|
* `text` if nobody answered them here.
|
|
4318
4330
|
*/
|
|
4319
4331
|
retireRemoteCard(instanceName: string, identity: string | null, text?: string): void;
|
|
4320
|
-
/**
|
|
4332
|
+
/** CLI-owned dialogs need the owning adapter's fleet admin; ordinary agent questions follow conversation access. */
|
|
4321
4333
|
private mayAnswerRemoteCard;
|
|
4322
4334
|
/** A click on a card's button (platform or dashboard). */
|
|
4323
4335
|
private handleRemoteCardClick;
|
|
@@ -5629,6 +5641,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
5629
5641
|
* What the install's own channel offers: the target version and whether it came from that channel's dist-tag. Throws
|
|
5630
5642
|
* when npm cannot be asked (the callers decide what a failed look means).
|
|
5631
5643
|
*/
|
|
5644
|
+
/** Tests only: where lookUpUpdateTarget looks for npm (M-2858); unset in production (the running install, process.env). */
|
|
5645
|
+
private updateNpmProbe?;
|
|
5632
5646
|
private lookUpUpdateTarget;
|
|
5633
5647
|
/** M-2738: record a look's answer for the web — the same offer the notice below would make. */
|
|
5634
5648
|
private recordUpdateCheck;
|
package/dist/fleet-manager.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { settingsSummary, translatedSummary } from "./settings-summary.js";
|
|
1
2
|
import { readInstalledBuild } from "./build-provenance.js";
|
|
2
3
|
import { buildNativeFleetInstructions } from "./instructions.js";
|
|
3
4
|
import { GENERAL_ROLE_INSTRUCTIONS } from "./general-role.js";
|
|
@@ -307,6 +308,7 @@ import { isRemovedBackend, removedBackendMessage } from "./backend/removed.js";
|
|
|
307
308
|
import { presentationState, interactionSummary, sameInteractionOwner } from "./interaction-observation.js";
|
|
308
309
|
import { describeSelfOom } from "./session-oom.js";
|
|
309
310
|
import { assertNoSessionOomStop, readSessionOomStop, captureSessionOomRetry, clearSessionOomStopForRetry, SessionOomStoppedError, sessionOomStopHint } from "./session-oom-stop.js";
|
|
311
|
+
import { redactSecrets } from "./tool-progress.js";
|
|
310
312
|
import { idleGateTimeoutLog } from "./idle-gate-log.js";
|
|
311
313
|
import { DEFAULT_STUCK_TIMEOUT_MS, readLastInboundAt } from "./daemon.js";
|
|
312
314
|
import { clearPausedMarker, readPausedAt, readPauseReason, writePausedMarker } from "./pause-marker.js";
|
|
@@ -634,7 +636,8 @@ const WEB_ONLY_REPLY_SINK = {
|
|
|
634
636
|
/**
|
|
635
637
|
* Where an instance-health prompt (hang, clean exit, interactive prompt) is posted on a fleet with no chat platform:
|
|
636
638
|
* nowhere but the dashboard (#1307 item 6). Posting "succeeds" with an id of its own, so the prompt is armed and
|
|
637
|
-
* offered on the web exactly as a platform prompt is;
|
|
639
|
+
* offered on the web exactly as a platform prompt is; also used for CLI dialogs belonging to public Classic rooms
|
|
640
|
+
* (#3334). There are no platform buttons to edit afterwards, and the
|
|
638
641
|
* outcome reaches the page through prompt_resolved as for any web-answered prompt.
|
|
639
642
|
*/
|
|
640
643
|
const WEB_ONLY_PROMPT_SINK = {
|
|
@@ -1675,7 +1678,7 @@ export class FleetManager {
|
|
|
1675
1678
|
if (input.target.location === "host") {
|
|
1676
1679
|
if (!record)
|
|
1677
1680
|
throw Error("General's saved host location is unavailable");
|
|
1678
|
-
return { input, connections,
|
|
1681
|
+
return { input, connections, ...settingsSummary([translatedSummary("general_location.confirm_host"), translatedSummary("general_location.history")]) };
|
|
1679
1682
|
}
|
|
1680
1683
|
const active = record?.windows.find(row => row.id === record.active);
|
|
1681
1684
|
if (!record?.pending && record?.hold !== "start" && active?.machineId === input.target.machineId && active.cli === input.target.cli)
|
|
@@ -1686,7 +1689,7 @@ export class FleetManager {
|
|
|
1686
1689
|
const provider = input.target.cli;
|
|
1687
1690
|
if (!machine.inventory?.clis.some(cli => cli.id === provider && cli.runnable))
|
|
1688
1691
|
throw Error("The chosen Windows CLI is unavailable");
|
|
1689
|
-
return { input, connections,
|
|
1692
|
+
return { input, connections, ...settingsSummary([translatedSummary("general_location.confirm_windows", settingsDisplay(machine.name)), translatedSummary("general_location.history")]) };
|
|
1690
1693
|
}
|
|
1691
1694
|
/** All entry points, including automatic native recovery, must respect an interrupted binding switch. */
|
|
1692
1695
|
assertGeneralBindingStart(name, config) {
|
|
@@ -2184,7 +2187,7 @@ export class FleetManager {
|
|
|
2184
2187
|
attachAttention: read => this.attachHubExecutionAttention(read),
|
|
2185
2188
|
attachPairingNotices: read => { this.hubPairingNotices = read; },
|
|
2186
2189
|
pokeAttention: () => this.needsYou?.poke(),
|
|
2187
|
-
linkState: state => { this.hubMemberLink = state; },
|
|
2190
|
+
linkState: (state, digest) => { this.hubMemberLink = state; this.hubMemberLinkBinding = digest ?? null; },
|
|
2188
2191
|
},
|
|
2189
2192
|
});
|
|
2190
2193
|
// Stop began during the import: it holds this promise and closes the runtime; do not hand it out again.
|
|
@@ -2215,8 +2218,9 @@ export class FleetManager {
|
|
|
2215
2218
|
home: this.dataDir,
|
|
2216
2219
|
notices: () => this.hubPairingNotices?.() ?? [],
|
|
2217
2220
|
enabled: () => this.rawFleetConfig?.hub_member?.enabled === true,
|
|
2218
|
-
link:
|
|
2219
|
-
hold:
|
|
2221
|
+
link: digest => (digest === this.hubMemberLinkBinding && this.hubMemberLink === "online" ? "online" : "offline"),
|
|
2222
|
+
hold: digest => digest === this.hubMemberLinkBinding
|
|
2223
|
+
? this.hubMemberLink === "revoked" ? "revoked" : this.hubMemberLink === "rejected" ? "rejected" : null : null,
|
|
2220
2224
|
// Disconnect: stop the member client now (the runtime re-composes from the saved binding, fencing first).
|
|
2221
2225
|
fence: () => { void this.hubRuntime?.refresh(); },
|
|
2222
2226
|
// A claim saved, a disconnect tombstone or a cancel: re-compose the member side for the new binding.
|
|
@@ -2560,6 +2564,17 @@ export class FleetManager {
|
|
|
2560
2564
|
return this.daemons.get(name)?.bootId ?? null;
|
|
2561
2565
|
}
|
|
2562
2566
|
rawFleetConfig = {};
|
|
2567
|
+
/**
|
|
2568
|
+
* AGEND-163: one agent's own saved settings, as fleet.yaml has them — not `fleetConfig.instances[name]`, which has the fleet's
|
|
2569
|
+
* defaults merged in. Undefined when fleet.yaml has no such agent.
|
|
2570
|
+
*/
|
|
2571
|
+
rawInstanceConfig(name) {
|
|
2572
|
+
const instances = this.rawFleetConfig.instances;
|
|
2573
|
+
if (!instances || typeof instances !== "object" || !Object.hasOwn(instances, name))
|
|
2574
|
+
return undefined;
|
|
2575
|
+
const own = instances[name];
|
|
2576
|
+
return own && typeof own === "object" && !Array.isArray(own) ? own : undefined;
|
|
2577
|
+
}
|
|
2563
2578
|
/**
|
|
2564
2579
|
* S-51 (#3095, experimental, off by default): the Hub runtime. src/hub/runtime.js is imported only once a Hub switch
|
|
2565
2580
|
* (hub.enabled / hub_member.enabled) is on; while both are off nothing Hub-related loads, opens or listens.
|
|
@@ -2569,6 +2584,7 @@ export class FleetManager {
|
|
|
2569
2584
|
hubMemberBinding = null;
|
|
2570
2585
|
/** The member link as the "Connect to a Hub" view shows it (S5's client lifecycle). */
|
|
2571
2586
|
hubMemberLink = "offline";
|
|
2587
|
+
hubMemberLinkBinding = null;
|
|
2572
2588
|
/** OutboundContext: the Hub representative's answer hook (null: no member service running, or not a Hub answer). */
|
|
2573
2589
|
hubReport(input) {
|
|
2574
2590
|
return this.hubReports?.(input) ?? null;
|
|
@@ -3540,6 +3556,7 @@ export class FleetManager {
|
|
|
3540
3556
|
directAgentCreation: true,
|
|
3541
3557
|
directHostInstall: true,
|
|
3542
3558
|
directCompanyJoin: true,
|
|
3559
|
+
companyJoinPolicy: req => this.settingsCompanyJoinAllowed(req),
|
|
3543
3560
|
job: async (id) => {
|
|
3544
3561
|
const settlement = this.settingsJobSettlements.get(id);
|
|
3545
3562
|
if (!settlement)
|
|
@@ -3619,6 +3636,11 @@ export class FleetManager {
|
|
|
3619
3636
|
},
|
|
3620
3637
|
};
|
|
3621
3638
|
}
|
|
3639
|
+
/** Company Start is the signed-in admin’s consent; a personal enforced remote code still applies. */
|
|
3640
|
+
settingsCompanyJoinAllowed(req) {
|
|
3641
|
+
const { role } = this.settingsRole(req, { ignoreSwitch: true });
|
|
3642
|
+
return role.ok && (role.onHost || !this.strictFor(role.actor));
|
|
3643
|
+
}
|
|
3622
3644
|
/**
|
|
3623
3645
|
* AGEND-122 (Prism P2): whether the ordinary New Agent shortcut — created at once, web-confirmed, with no held change — is open to
|
|
3624
3646
|
* this request. It is the same policy as Apply now: refused where "Only this computer can authorize" is on and this is not the
|
|
@@ -3759,9 +3781,19 @@ export class FleetManager {
|
|
|
3759
3781
|
* that opens a link is never confirmed over a link (the public gateway, bound by the gateway itself, never by a header), the
|
|
3760
3782
|
* code or not. The code is the authority; the session only carries it.
|
|
3761
3783
|
*/
|
|
3784
|
+
/** Only the server-attested company Start carries its own policy, bound to the original live private cookie. */
|
|
3785
|
+
settingsCodeRole(req, proof) {
|
|
3786
|
+
if (proof?.kind !== "company-start")
|
|
3787
|
+
return this.settingsRole(req);
|
|
3788
|
+
const auth = authorizeSession(req, this.webToken, this.webSessions, { touch: false });
|
|
3789
|
+
if (auth.kind !== "ok" || gatewayRequestContext(req) || !proof.current(auth.session.idHash))
|
|
3790
|
+
return { role: { ok: false, reason: "not_session" }, handle: null };
|
|
3791
|
+
return this.settingsRole(req, { ignoreSwitch: true });
|
|
3792
|
+
}
|
|
3762
3793
|
settingsCodeSession(store, req, id) {
|
|
3794
|
+
const proof = store.codePolicy(id);
|
|
3763
3795
|
const check = (asking) => {
|
|
3764
|
-
const { role, handle } = this.
|
|
3796
|
+
const { role, handle } = this.settingsCodeRole(req, proof);
|
|
3765
3797
|
if (!role.ok || !handle || role.onHost)
|
|
3766
3798
|
return null;
|
|
3767
3799
|
if (asking && !this.strictFor(role.actor))
|
|
@@ -3810,7 +3842,7 @@ export class FleetManager {
|
|
|
3810
3842
|
return webPeerOf(req) !== "loopback";
|
|
3811
3843
|
}
|
|
3812
3844
|
settingsTotpState(store, req, id) {
|
|
3813
|
-
const { role } = this.
|
|
3845
|
+
const { role } = this.settingsCodeRole(req, store.codePolicy(id));
|
|
3814
3846
|
// The owner turned on "Only this computer can authorize": a page that is not on this computer is told so, in plain words.
|
|
3815
3847
|
if (!role.ok)
|
|
3816
3848
|
return role.reason === "loopback_only" ? "host_only" : null;
|
|
@@ -20799,22 +20831,31 @@ export class FleetManager {
|
|
|
20799
20831
|
* was gone; this is the fallback).
|
|
20800
20832
|
*/
|
|
20801
20833
|
async postRemoteCard(instanceName, card) {
|
|
20802
|
-
// #
|
|
20803
|
-
//
|
|
20804
|
-
if (card.kind === "question" && card.webOnly && !this.webOnlyPromptPlace())
|
|
20805
|
-
return;
|
|
20834
|
+
// #3334: CLI-owned dialogs also reach chat fleets. Their legacy webOnly marker now requires the owning
|
|
20835
|
+
// adapter's fleet admin to answer; ordinary agent questions retain their existing conversation authority.
|
|
20806
20836
|
this.retireRemoteCard(instanceName, null, t("card.answered_in_pane"));
|
|
20807
|
-
const
|
|
20837
|
+
const requiresAdmin = card.kind === "question" && card.webOnly === true;
|
|
20838
|
+
// Classic rooms may include people outside the fleet. Keep their generic parked notice; the full CLI dialog
|
|
20839
|
+
// and its approval live only on the existing admin dashboard, never in that room or an assumed-private General.
|
|
20840
|
+
const privateDashboard = requiresAdmin && this.classicChannels?.getChannelIdByInstance(instanceName) !== undefined;
|
|
20841
|
+
const place = privateDashboard ? { adapter: WEB_ONLY_PROMPT_SINK, adapterId: "web", chatId: "web" } : this.remoteCardPlace(instanceName);
|
|
20808
20842
|
if (!place) {
|
|
20809
20843
|
this.logger.warn({ instanceName }, "A card is waiting on screen but the instance has no place to post it — the parked notice stands");
|
|
20810
20844
|
return;
|
|
20811
20845
|
}
|
|
20812
|
-
|
|
20846
|
+
// Redact before labels are clipped. Keep the raw request's identity for the pane check, and retain only the
|
|
20847
|
+
// displayed option titles for the chat outcome too, so selecting an option cannot re-disclose its secret.
|
|
20848
|
+
const shown = card.kind === "question" && requiresAdmin && place.adapter.type !== "web" ? {
|
|
20849
|
+
...card, title: redactSecrets(card.title), question: redactSecrets(card.question),
|
|
20850
|
+
options: card.options.map(o => ({ ...o, title: redactSecrets(o.title), description: o.description === null ? null : redactSecrets(o.description) })),
|
|
20851
|
+
} : card;
|
|
20852
|
+
const prompt = remoteCardPrompt(instanceName, shown);
|
|
20813
20853
|
const nonce = await this.postNonceButtonPrompt({
|
|
20814
20854
|
prefix: REMOTE_CARD_CALLBACK_PREFIX, alertType: "interactive_prompt", instanceName, ...place,
|
|
20815
20855
|
message: prompt.message, choices: prompt.choices, webInput: prompt.webInput,
|
|
20816
20856
|
expiredText: t("card.expired", instanceName), timeoutMs: REMOTE_CARD_TIMEOUT_MS,
|
|
20817
|
-
extra: { remoteCard: { identity: card.identity, kind: card.kind, options:
|
|
20857
|
+
extra: { remoteCard: { identity: card.identity, kind: card.kind, options: shown.kind === "question" ? shown.options.map(o => ({ n: o.n, title: o.title })) : [],
|
|
20858
|
+
requiresAdmin, ownerAdapterId: this.getInstanceAdapterId(instanceName) } },
|
|
20818
20859
|
});
|
|
20819
20860
|
if (nonce)
|
|
20820
20861
|
this.remoteCardPosts.set(instanceName, nonce);
|
|
@@ -20838,8 +20879,10 @@ export class FleetManager {
|
|
|
20838
20879
|
clearTimeout(entry.timer);
|
|
20839
20880
|
void this.retireNonceButtons(entry, entry.messageId ?? "", text);
|
|
20840
20881
|
}
|
|
20841
|
-
/**
|
|
20882
|
+
/** CLI-owned dialogs need the owning adapter's fleet admin; ordinary agent questions follow conversation access. */
|
|
20842
20883
|
mayAnswerRemoteCard(userId, entry) {
|
|
20884
|
+
if (entry.remoteCard?.requiresAdmin)
|
|
20885
|
+
return this.isFleetAdmin(userId, entry.adapterId);
|
|
20843
20886
|
if (this.classicChannels?.getChannelIdByInstance(entry.instanceName) === entry.chatId)
|
|
20844
20887
|
return true;
|
|
20845
20888
|
const am = this.worlds.get(entry.adapterId)?.accessManager ?? this.accessManager;
|
|
@@ -20914,6 +20957,10 @@ export class FleetManager {
|
|
|
20914
20957
|
let outcome;
|
|
20915
20958
|
if (!card || !action)
|
|
20916
20959
|
outcome = { outcome: "refused", reason: "malformed" };
|
|
20960
|
+
// The worker may have moved since posting. Its owner is distinct from the private dashboard's display sink.
|
|
20961
|
+
// Check here for platform buttons, typed replies and dashboard claims alike, before invoking the CLI answer.
|
|
20962
|
+
else if (card.requiresAdmin && card.ownerAdapterId !== this.getInstanceAdapterId(entry.instanceName))
|
|
20963
|
+
outcome = { outcome: "stale" };
|
|
20917
20964
|
else if (!daemon?.answerRemoteCard)
|
|
20918
20965
|
outcome = { outcome: "stale" };
|
|
20919
20966
|
else {
|
|
@@ -29249,6 +29296,8 @@ export class FleetManager {
|
|
|
29249
29296
|
* What the install's own channel offers: the target version and whether it came from that channel's dist-tag. Throws
|
|
29250
29297
|
* when npm cannot be asked (the callers decide what a failed look means).
|
|
29251
29298
|
*/
|
|
29299
|
+
/** Tests only: where lookUpUpdateTarget looks for npm (M-2858); unset in production (the running install, process.env). */
|
|
29300
|
+
updateNpmProbe;
|
|
29252
29301
|
async lookUpUpdateTarget(currentVersion) {
|
|
29253
29302
|
// Both npm lookups are async: as execSync they froze the fleet event loop for
|
|
29254
29303
|
// up to 15s each, and on a beta build BOTH ran — 30s with no WATCHDOG ping,
|
|
@@ -29257,8 +29306,14 @@ export class FleetManager {
|
|
|
29257
29306
|
const { execFile } = await import("./child-process.js");
|
|
29258
29307
|
const { promisify } = await import("node:util");
|
|
29259
29308
|
const execFileP = promisify(execFile);
|
|
29309
|
+
// M-2858: the npm that manages this install, also when the service's PATH has none (the alpha.13 rehearsal: with
|
|
29310
|
+
// only ~/.volta/bin/npm, nothing was ever offered and web Update answered 409 nothing_to_install).
|
|
29311
|
+
const { npmEnvForUpdate } = await import("./update-dispatch.js");
|
|
29312
|
+
const npmEnv = await npmEnvForUpdate(this.updateNpmProbe?.deps, this.updateNpmProbe?.env);
|
|
29313
|
+
if (!npmEnv.ok)
|
|
29314
|
+
throw new Error(npmEnv.reason);
|
|
29260
29315
|
const npmVersion = async (spec) => {
|
|
29261
|
-
const { stdout } = await execFileP("npm", ["view", spec, "version"], { timeout: 15_000 });
|
|
29316
|
+
const { stdout } = await execFileP("npm", ["view", spec, "version"], { timeout: 15_000, env: npmEnv.env });
|
|
29262
29317
|
return stdout.toString().trim();
|
|
29263
29318
|
};
|
|
29264
29319
|
const latest = await npmVersion("@songsid/agend");
|