@songsid/agend 2.3.5-alpha.12 → 2.3.5-alpha.13

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.
Files changed (113) hide show
  1. package/THIRD_PARTY_NOTICES.md +4 -0
  2. package/dist/agent-workspace.d.ts +1 -2
  3. package/dist/agent-workspace.js +8 -29
  4. package/dist/agent-workspace.js.map +1 -1
  5. package/dist/auth-api.js +3 -1
  6. package/dist/auth-api.js.map +1 -1
  7. package/dist/backend/codex.d.ts +7 -14
  8. package/dist/backend/codex.js +25 -29
  9. package/dist/backend/codex.js.map +1 -1
  10. package/dist/backend/grok-mcp.d.ts +5 -0
  11. package/dist/backend/grok-mcp.js +221 -0
  12. package/dist/backend/grok-mcp.js.map +1 -0
  13. package/dist/backend/grok.d.ts +0 -10
  14. package/dist/backend/grok.js +5 -82
  15. package/dist/backend/grok.js.map +1 -1
  16. package/dist/backend/types.d.ts +6 -1
  17. package/dist/backend/types.js.map +1 -1
  18. package/dist/build-provenance.json +1 -1
  19. package/dist/cli.js +18 -0
  20. package/dist/cli.js.map +1 -1
  21. package/dist/codex-pane-ownership.d.ts +13 -0
  22. package/dist/codex-pane-ownership.js +192 -0
  23. package/dist/codex-pane-ownership.js.map +1 -0
  24. package/dist/daemon.d.ts +2 -0
  25. package/dist/daemon.js +89 -8
  26. package/dist/daemon.js.map +1 -1
  27. package/dist/fleet-manager.d.ts +8 -1
  28. package/dist/fleet-manager.js +52 -16
  29. package/dist/fleet-manager.js.map +1 -1
  30. package/dist/hub/client.d.ts +1 -1
  31. package/dist/hub/client.js +11 -0
  32. package/dist/hub/client.js.map +1 -1
  33. package/dist/hub/compose/member.d.ts +2 -2
  34. package/dist/hub/compose/member.js +11 -3
  35. package/dist/hub/compose/member.js.map +1 -1
  36. package/dist/hub/member/exposure-api.d.ts +2 -0
  37. package/dist/hub/member/exposure-api.js +4 -2
  38. package/dist/hub/member/exposure-api.js.map +1 -1
  39. package/dist/hub/member/pairing-api.d.ts +2 -2
  40. package/dist/hub/member/pairing-api.js +2 -2
  41. package/dist/hub/member/pairing-api.js.map +1 -1
  42. package/dist/hub/server.js +8 -0
  43. package/dist/hub/server.js.map +1 -1
  44. package/dist/hub-pairing-summary.d.ts +3 -1
  45. package/dist/hub-pairing-summary.js +6 -3
  46. package/dist/hub-pairing-summary.js.map +1 -1
  47. package/dist/locale.js +6 -2
  48. package/dist/locale.js.map +1 -1
  49. package/dist/runtime-client-store.js +5 -0
  50. package/dist/runtime-client-store.js.map +1 -1
  51. package/dist/runtime-pane-private.d.ts +2 -0
  52. package/dist/runtime-pane-private.js +25 -0
  53. package/dist/runtime-pane-private.js.map +1 -1
  54. package/dist/runtime-pane-private.ps1 +74 -7
  55. package/dist/selection-card.d.ts +4 -3
  56. package/dist/selection-card.js +2 -1
  57. package/dist/selection-card.js.map +1 -1
  58. package/dist/settings-change.d.ts +2 -0
  59. package/dist/settings-change.js +74 -31
  60. package/dist/settings-change.js.map +1 -1
  61. package/dist/settings-confirmation.d.ts +23 -0
  62. package/dist/settings-confirmation.js +13 -2
  63. package/dist/settings-confirmation.js.map +1 -1
  64. package/dist/settings-effect.d.ts +4 -0
  65. package/dist/settings-effect.js +14 -14
  66. package/dist/settings-effect.js.map +1 -1
  67. package/dist/settings-http-confirmation.d.ts +3 -1
  68. package/dist/settings-http-confirmation.js +12 -7
  69. package/dist/settings-http-confirmation.js.map +1 -1
  70. package/dist/settings-summary.d.ts +24 -0
  71. package/dist/settings-summary.js +42 -0
  72. package/dist/settings-summary.js.map +1 -0
  73. package/dist/transcript-delta-reader.d.ts +9 -1
  74. package/dist/transcript-delta-reader.js +37 -8
  75. package/dist/transcript-delta-reader.js.map +1 -1
  76. package/dist/ui/agent-details-settings.js +253 -0
  77. package/dist/ui/agent-instructions-field.js +69 -0
  78. package/dist/ui/agent-page-strings.js +148 -0
  79. package/dist/ui/chat-quote.js +12 -17
  80. package/dist/ui/hub-client.js +1 -1
  81. package/dist/ui/hub-company-join-strings.js +1 -1
  82. package/dist/ui/hub-company-join.js +7 -0
  83. package/dist/ui/hub-strings.js +4 -0
  84. package/dist/ui/native-instance-settings.js +47 -14
  85. package/dist/ui/panel-details.js +38 -14
  86. package/dist/ui/panel-fleet.js +2 -2
  87. package/dist/ui/panel-settings.js +12 -9
  88. package/dist/ui/settings-access-overview.js +24 -3
  89. package/dist/ui/settings-confirm.js +5 -5
  90. package/dist/ui/settings-dialogs.js +208 -100
  91. package/dist/ui/settings-hub-company-join.js +69 -14
  92. package/dist/ui/settings-hub.js +13 -5
  93. package/dist/ui/settings-layout.js +0 -2
  94. package/dist/ui/settings-model.js +15 -0
  95. package/dist/ui/shared/access-overview.css +48 -0
  96. package/dist/ui/shared/app-i18n.js +2 -2
  97. package/dist/ui/shared/app-shell.js +144 -3
  98. package/dist/ui/shared/app.css +74 -50
  99. package/dist/ui/shared/instance-nav.js +5 -1
  100. package/dist/ui/shared/view-strings.js +2 -0
  101. package/dist/update-dispatch.d.ts +50 -0
  102. package/dist/update-dispatch.js +58 -2
  103. package/dist/update-dispatch.js.map +1 -1
  104. package/dist/web-session.d.ts +4 -2
  105. package/dist/web-session.js +5 -2
  106. package/dist/web-session.js.map +1 -1
  107. package/dist/workspace-file-policy.d.ts +2 -0
  108. package/dist/workspace-file-policy.js +31 -0
  109. package/dist/workspace-file-policy.js.map +1 -0
  110. package/dist/workspace-follow.js +2 -1
  111. package/dist/workspace-follow.js.map +1 -1
  112. package/package.json +2 -2
  113. package/templates/runtime-assets/runtime-pane-private.ps1 +74 -7
@@ -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. */
@@ -605,6 +607,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
605
607
  private hubMemberBinding;
606
608
  /** The member link as the "Connect to a Hub" view shows it (S5's client lifecycle). */
607
609
  private hubMemberLink;
610
+ private hubMemberLinkBinding;
608
611
  /** OutboundContext: the Hub representative's answer hook (null: no member service running, or not a Hub answer). */
609
612
  hubReport(input: {
610
613
  correlationId: string;
@@ -1128,6 +1131,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1128
1131
  * stays another way to confirm; General is told of a change a chat account confirmed here, when one can be.
1129
1132
  */
1130
1133
  private settingsSelfConfirmation;
1134
+ /** Company Start is the signed-in admin’s consent; a personal enforced remote code still applies. */
1135
+ private settingsCompanyJoinAllowed;
1131
1136
  /**
1132
1137
  * AGEND-122 (Prism P2): whether the ordinary New Agent shortcut — created at once, web-confirmed, with no held change — is open to
1133
1138
  * 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 +1185,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1180
1185
  * that opens a link is never confirmed over a link (the public gateway, bound by the gateway itself, never by a header), the
1181
1186
  * code or not. The code is the authority; the session only carries it.
1182
1187
  */
1188
+ /** Only the server-attested company Start carries its own policy, bound to the original live private cookie. */
1189
+ private settingsCodeRole;
1183
1190
  private settingsCodeSession;
1184
1191
  /** 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
1192
  private checkAuthenticatorCode;
@@ -4317,7 +4324,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
4317
4324
  * `text` if nobody answered them here.
4318
4325
  */
4319
4326
  retireRemoteCard(instanceName: string, identity: string | null, text?: string): void;
4320
- /** Who may answer an instance's card: whoever may already talk to it there (a ClassicBot room is open to all). */
4327
+ /** CLI-owned dialogs need the owning adapter's fleet admin; ordinary agent questions follow conversation access. */
4321
4328
  private mayAnswerRemoteCard;
4322
4329
  /** A click on a card's button (platform or dashboard). */
4323
4330
  private handleRemoteCardClick;
@@ -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; there are no platform buttons to edit afterwards, and the
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, summary: [t("general_location.confirm_host"), t("general_location.history")] };
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, summary: [t("general_location.confirm_windows", settingsDisplay(machine.name)), t("general_location.history")] };
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: () => (this.hubMemberLink === "online" ? "online" : "offline"),
2219
- hold: () => (this.hubMemberLink === "revoked" ? "revoked" : null),
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.
@@ -2569,6 +2573,7 @@ export class FleetManager {
2569
2573
  hubMemberBinding = null;
2570
2574
  /** The member link as the "Connect to a Hub" view shows it (S5's client lifecycle). */
2571
2575
  hubMemberLink = "offline";
2576
+ hubMemberLinkBinding = null;
2572
2577
  /** OutboundContext: the Hub representative's answer hook (null: no member service running, or not a Hub answer). */
2573
2578
  hubReport(input) {
2574
2579
  return this.hubReports?.(input) ?? null;
@@ -3540,6 +3545,7 @@ export class FleetManager {
3540
3545
  directAgentCreation: true,
3541
3546
  directHostInstall: true,
3542
3547
  directCompanyJoin: true,
3548
+ companyJoinPolicy: req => this.settingsCompanyJoinAllowed(req),
3543
3549
  job: async (id) => {
3544
3550
  const settlement = this.settingsJobSettlements.get(id);
3545
3551
  if (!settlement)
@@ -3619,6 +3625,11 @@ export class FleetManager {
3619
3625
  },
3620
3626
  };
3621
3627
  }
3628
+ /** Company Start is the signed-in admin’s consent; a personal enforced remote code still applies. */
3629
+ settingsCompanyJoinAllowed(req) {
3630
+ const { role } = this.settingsRole(req, { ignoreSwitch: true });
3631
+ return role.ok && (role.onHost || !this.strictFor(role.actor));
3632
+ }
3622
3633
  /**
3623
3634
  * AGEND-122 (Prism P2): whether the ordinary New Agent shortcut — created at once, web-confirmed, with no held change — is open to
3624
3635
  * 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 +3770,19 @@ export class FleetManager {
3759
3770
  * that opens a link is never confirmed over a link (the public gateway, bound by the gateway itself, never by a header), the
3760
3771
  * code or not. The code is the authority; the session only carries it.
3761
3772
  */
3773
+ /** Only the server-attested company Start carries its own policy, bound to the original live private cookie. */
3774
+ settingsCodeRole(req, proof) {
3775
+ if (proof?.kind !== "company-start")
3776
+ return this.settingsRole(req);
3777
+ const auth = authorizeSession(req, this.webToken, this.webSessions, { touch: false });
3778
+ if (auth.kind !== "ok" || gatewayRequestContext(req) || !proof.current(auth.session.idHash))
3779
+ return { role: { ok: false, reason: "not_session" }, handle: null };
3780
+ return this.settingsRole(req, { ignoreSwitch: true });
3781
+ }
3762
3782
  settingsCodeSession(store, req, id) {
3783
+ const proof = store.codePolicy(id);
3763
3784
  const check = (asking) => {
3764
- const { role, handle } = this.settingsRole(req);
3785
+ const { role, handle } = this.settingsCodeRole(req, proof);
3765
3786
  if (!role.ok || !handle || role.onHost)
3766
3787
  return null;
3767
3788
  if (asking && !this.strictFor(role.actor))
@@ -3810,7 +3831,7 @@ export class FleetManager {
3810
3831
  return webPeerOf(req) !== "loopback";
3811
3832
  }
3812
3833
  settingsTotpState(store, req, id) {
3813
- const { role } = this.settingsRole(req);
3834
+ const { role } = this.settingsCodeRole(req, store.codePolicy(id));
3814
3835
  // The owner turned on "Only this computer can authorize": a page that is not on this computer is told so, in plain words.
3815
3836
  if (!role.ok)
3816
3837
  return role.reason === "loopback_only" ? "host_only" : null;
@@ -20799,22 +20820,31 @@ export class FleetManager {
20799
20820
  * was gone; this is the fallback).
20800
20821
  */
20801
20822
  async postRemoteCard(instanceName, card) {
20802
- // #2910 D4: a CLI's own dialog read as a card (selection-card.ts) is put to people only on a web-only fleet — the
20803
- // dashboard; a chat fleet keeps its parked notice and its General's controls, as before.
20804
- if (card.kind === "question" && card.webOnly && !this.webOnlyPromptPlace())
20805
- return;
20823
+ // #3334: CLI-owned dialogs also reach chat fleets. Their legacy webOnly marker now requires the owning
20824
+ // adapter's fleet admin to answer; ordinary agent questions retain their existing conversation authority.
20806
20825
  this.retireRemoteCard(instanceName, null, t("card.answered_in_pane"));
20807
- const place = this.remoteCardPlace(instanceName);
20826
+ const requiresAdmin = card.kind === "question" && card.webOnly === true;
20827
+ // Classic rooms may include people outside the fleet. Keep their generic parked notice; the full CLI dialog
20828
+ // and its approval live only on the existing admin dashboard, never in that room or an assumed-private General.
20829
+ const privateDashboard = requiresAdmin && this.classicChannels?.getChannelIdByInstance(instanceName) !== undefined;
20830
+ const place = privateDashboard ? { adapter: WEB_ONLY_PROMPT_SINK, adapterId: "web", chatId: "web" } : this.remoteCardPlace(instanceName);
20808
20831
  if (!place) {
20809
20832
  this.logger.warn({ instanceName }, "A card is waiting on screen but the instance has no place to post it — the parked notice stands");
20810
20833
  return;
20811
20834
  }
20812
- const prompt = remoteCardPrompt(instanceName, card);
20835
+ // Redact before labels are clipped. Keep the raw request's identity for the pane check, and retain only the
20836
+ // displayed option titles for the chat outcome too, so selecting an option cannot re-disclose its secret.
20837
+ const shown = card.kind === "question" && requiresAdmin && place.adapter.type !== "web" ? {
20838
+ ...card, title: redactSecrets(card.title), question: redactSecrets(card.question),
20839
+ options: card.options.map(o => ({ ...o, title: redactSecrets(o.title), description: o.description === null ? null : redactSecrets(o.description) })),
20840
+ } : card;
20841
+ const prompt = remoteCardPrompt(instanceName, shown);
20813
20842
  const nonce = await this.postNonceButtonPrompt({
20814
20843
  prefix: REMOTE_CARD_CALLBACK_PREFIX, alertType: "interactive_prompt", instanceName, ...place,
20815
20844
  message: prompt.message, choices: prompt.choices, webInput: prompt.webInput,
20816
20845
  expiredText: t("card.expired", instanceName), timeoutMs: REMOTE_CARD_TIMEOUT_MS,
20817
- extra: { remoteCard: { identity: card.identity, kind: card.kind, options: card.kind === "question" ? card.options.map(o => ({ n: o.n, title: o.title })) : [] } },
20846
+ extra: { remoteCard: { identity: card.identity, kind: card.kind, options: shown.kind === "question" ? shown.options.map(o => ({ n: o.n, title: o.title })) : [],
20847
+ requiresAdmin, ownerAdapterId: this.getInstanceAdapterId(instanceName) } },
20818
20848
  });
20819
20849
  if (nonce)
20820
20850
  this.remoteCardPosts.set(instanceName, nonce);
@@ -20838,8 +20868,10 @@ export class FleetManager {
20838
20868
  clearTimeout(entry.timer);
20839
20869
  void this.retireNonceButtons(entry, entry.messageId ?? "", text);
20840
20870
  }
20841
- /** Who may answer an instance's card: whoever may already talk to it there (a ClassicBot room is open to all). */
20871
+ /** CLI-owned dialogs need the owning adapter's fleet admin; ordinary agent questions follow conversation access. */
20842
20872
  mayAnswerRemoteCard(userId, entry) {
20873
+ if (entry.remoteCard?.requiresAdmin)
20874
+ return this.isFleetAdmin(userId, entry.adapterId);
20843
20875
  if (this.classicChannels?.getChannelIdByInstance(entry.instanceName) === entry.chatId)
20844
20876
  return true;
20845
20877
  const am = this.worlds.get(entry.adapterId)?.accessManager ?? this.accessManager;
@@ -20914,6 +20946,10 @@ export class FleetManager {
20914
20946
  let outcome;
20915
20947
  if (!card || !action)
20916
20948
  outcome = { outcome: "refused", reason: "malformed" };
20949
+ // The worker may have moved since posting. Its owner is distinct from the private dashboard's display sink.
20950
+ // Check here for platform buttons, typed replies and dashboard claims alike, before invoking the CLI answer.
20951
+ else if (card.requiresAdmin && card.ownerAdapterId !== this.getInstanceAdapterId(entry.instanceName))
20952
+ outcome = { outcome: "stale" };
20917
20953
  else if (!daemon?.answerRemoteCard)
20918
20954
  outcome = { outcome: "stale" };
20919
20955
  else {