@songsid/agend 2.4.0-beta.31 → 2.4.0-beta.32

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 (59) hide show
  1. package/dist/build-provenance.json +1 -1
  2. package/dist/channel/mcp-tools.js +1 -1
  3. package/dist/channel/mcp-tools.js.map +1 -1
  4. package/dist/daemon.d.ts +9 -1
  5. package/dist/daemon.js +104 -25
  6. package/dist/daemon.js.map +1 -1
  7. package/dist/fleet-context.d.ts +2 -0
  8. package/dist/fleet-manager.d.ts +7 -0
  9. package/dist/fleet-manager.js +66 -7
  10. package/dist/fleet-manager.js.map +1 -1
  11. package/dist/general-knowledge/skills/concepts/SKILL.md +21 -2
  12. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +9 -4
  13. package/dist/general-knowledge/skills/hub/SKILL.md +6 -0
  14. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +2 -0
  15. package/dist/hub/client.js +8 -2
  16. package/dist/hub/client.js.map +1 -1
  17. package/dist/hub/compose/member.d.ts +11 -0
  18. package/dist/hub/compose/member.js +15 -4
  19. package/dist/hub/compose/member.js.map +1 -1
  20. package/dist/hub/member/room-ask.d.ts +1 -0
  21. package/dist/hub/member/room-ask.js +11 -4
  22. package/dist/hub/member/room-ask.js.map +1 -1
  23. package/dist/hub/member-journal.d.ts +2 -0
  24. package/dist/hub/member-journal.js +5 -0
  25. package/dist/hub/member-journal.js.map +1 -1
  26. package/dist/hub/protocol.d.ts +7 -0
  27. package/dist/hub/protocol.js +8 -1
  28. package/dist/hub/protocol.js.map +1 -1
  29. package/dist/hub/representative.d.ts +4 -0
  30. package/dist/hub/representative.js +17 -4
  31. package/dist/hub/representative.js.map +1 -1
  32. package/dist/hub/server.js +6 -2
  33. package/dist/hub/server.js.map +1 -1
  34. package/dist/hub-reply-route.d.ts +36 -0
  35. package/dist/hub-reply-route.js +67 -0
  36. package/dist/hub-reply-route.js.map +1 -0
  37. package/dist/hub-report-target.d.ts +4 -0
  38. package/dist/locale.js +2 -2
  39. package/dist/locale.js.map +1 -1
  40. package/dist/outbound-handlers.d.ts +2 -0
  41. package/dist/outbound-handlers.js +22 -7
  42. package/dist/outbound-handlers.js.map +1 -1
  43. package/dist/outbound-schemas.d.ts +1 -0
  44. package/dist/outbound-schemas.js +1 -0
  45. package/dist/outbound-schemas.js.map +1 -1
  46. package/dist/topic-commands.js +6 -4
  47. package/dist/topic-commands.js.map +1 -1
  48. package/dist/turn-reply-guard.d.ts +3 -1
  49. package/dist/turn-reply-guard.js +3 -2
  50. package/dist/turn-reply-guard.js.map +1 -1
  51. package/dist/ui/hub-chat-store.js +9 -6
  52. package/dist/ui/hub-chat-strings.js +4 -2
  53. package/dist/ui/hub-room-strings.js +2 -2
  54. package/dist/ui/hub-room-thread.js +9 -3
  55. package/dist/ui/panel-chat.js +18 -5
  56. package/dist/ui/panel-hub.js +2 -2
  57. package/dist/ui/report-columns.js +137 -0
  58. package/dist/ui/shared/app.css +28 -2
  59. package/package.json +1 -1
@@ -215,6 +215,8 @@ export interface FleetContext {
215
215
  cancelLoginSession?(): Promise<string>;
216
216
  /** Human-readable effective model for an instance (resolves inherited defaults). */
217
217
  modelDisplayForInstance?(name: string): string;
218
+ /** M-3943: the account an agent signs in with — a profile name, "default", "invalid", or null when its backend has none. */
219
+ credentialProfileLabel?(name: string, backend?: string): string | null;
218
220
  /** How this instance's backend takes a reasoning-effort setting, if at all. */
219
221
  effortStrategyFor?(name: string): "runtime" | "restart" | "unsupported";
220
222
  /** Configured effort for an instance: per-instance, else fleet default, else none. */
@@ -1038,6 +1038,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1038
1038
  private hubSettledOutsideTurn;
1039
1039
  /** M-3660: the member side's "this question is no longer being answered" reader (null: no member service attached). */
1040
1040
  private notifyHubQuestionEnded;
1041
+ private hubQuestionDelivered;
1041
1042
  private hubQuestionEnded;
1042
1043
  private hubQuestionSettled;
1043
1044
  hubContactRestricted(agent: string): boolean;
@@ -4933,6 +4934,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
4933
4934
  /** #3715: update_instance_config's ClassicBot room account switch — the room's Settings save (#3691), from a tool. */
4934
4935
  switchClassicRoomProfile(name: string, backendOptions: unknown): Promise<ClassicProfileSwitch>;
4935
4936
  credentialProfileOf(name: string, backend: string): string | null;
4937
+ /**
4938
+ * M-3943: the account an agent signs in with, as /status, the web status table and list_instances show it — a profile
4939
+ * name, "default" for the backend's shared login, "invalid" for a ClassicBot room whose setting cannot launch, or
4940
+ * null when the backend has no profiles. A Windows agent's profile is the one kept on its paired Runtime computer.
4941
+ */
4942
+ credentialProfileLabel(name: string, backend?: string): string | null;
4936
4943
  /**
4937
4944
  * #1699: the claude config dir an instance's CLI uses — its credential profile's, else exactly as before
4938
4945
  * (CLAUDE_CONFIG_DIR or ~/.claude).
@@ -288,7 +288,7 @@ import { windowsCliEnabled, closeWindowsBridge, retireWindowsBridgeForRequestCon
288
288
  import { nativeCliVersionState } from "./runtime-pane-native.js";
289
289
  import { localWindowsCliEnabled, remoteRuntimeEnabled, setConfiguredRuntimeSwitches, maxAgentsPerMachine } from "./runtime-switches.js";
290
290
  import { RuntimeInstallService } from "./runtime-install.js";
291
- import { RUNTIME_CREDENTIAL_CAPABILITY, validCredentialProfileName } from "./runtime-credential-profiles.js";
291
+ import { RUNTIME_CREDENTIAL_CAPABILITY, isCredentialProfileCli, validCredentialProfileName } from "./runtime-credential-profiles.js";
292
292
  import { RuntimeCoordinator } from "./runtime-coordinator.js";
293
293
  import { runtimeUpdateAttention } from "./runtime-update-attention.js";
294
294
  import { RuntimeWindowsBridge } from "./runtime-windows-bridge.js";
@@ -4200,6 +4200,7 @@ export class FleetManager {
4200
4200
  attachReports: (handler, failed) => { this.hubReports = handler; this.hubDeliveryFailed = failed; },
4201
4201
  attachPrivateQuestions: read => { this.hubPrivateQuestions = read; },
4202
4202
  attachQuestionEnded: ended => { this.hubQuestionEnded = ended; },
4203
+ attachQuestionDelivered: delivered => { this.hubQuestionDelivered = delivered; },
4203
4204
  attachQuestionSettled: read => { this.hubQuestionSettled = read; },
4204
4205
  attachReacts: handler => { this.hubReacts = handler; },
4205
4206
  },
@@ -4776,6 +4777,8 @@ export class FleetManager {
4776
4777
  if (msg.unknown !== true && (cid || msg.correlationId === null))
4777
4778
  this.hubQuestionTurnState(agent, cid, msg.contactLimit !== false);
4778
4779
  }
4780
+ else if (cid && msg.type === "hub_question_delivered")
4781
+ this.hubQuestionDelivered?.(agent, cid);
4779
4782
  else if (cid && msg.type === "hub_question_input")
4780
4783
  this.hubQuestionInput(agent, cid, msg.contactLimit !== false);
4781
4784
  else if (cid && msg.type === "hub_question_turn_ended")
@@ -4799,6 +4802,7 @@ export class FleetManager {
4799
4802
  this.logger?.warn({ err }, "Hub unanswered completion receipt held");
4800
4803
  }
4801
4804
  }
4805
+ hubQuestionDelivered = null;
4802
4806
  hubQuestionEnded = null;
4803
4807
  hubQuestionSettled = null;
4804
4808
  hubContactRestricted(agent) { return this.contactWindows().restricted(agent, this.hubSettledOutsideTurn()); }
@@ -4875,7 +4879,10 @@ export class FleetManager {
4875
4879
  // M-3660: the share's opt-out travels with the question; its daemon's hub_question_input then opens no window.
4876
4880
  if (input.contactLimit === false)
4877
4881
  ipcMeta.hub_contact_limit = "off";
4878
- const result = await this.deliverToInstance(input.agent, { type: "fleet_inbound", targetSession: input.agent, content: this.screenHubText(input.text), meta: ipcMeta, ...(scoped ? { request_context_input_id: scoped.inputId } : {}) }, { isCrossInstance: true, stillCurrent: input.stillCurrent, beforeInput: async () => {
4882
+ const replyInputId = input.acceptedHubRequest ? randomUUID() : undefined;
4883
+ let registeredDaemon;
4884
+ const screenedText = this.screenHubText(input.text);
4885
+ const result = await this.deliverToInstance(input.agent, { ...(replyInputId ? { hub_reply_input_id: replyInputId } : {}), type: "fleet_inbound", targetSession: input.agent, content: screenedText, meta: ipcMeta, ...(scoped ? { request_context_input_id: scoped.inputId } : {}) }, { isCrossInstance: true, stillCurrent: input.stillCurrent, beforeInput: async () => {
4879
4886
  const classic = this.isClassicInstance(input.agent);
4880
4887
  // A busy Classic room must finish its public turn first; never force a private question into that turn's queue.
4881
4888
  const idle = () => this.waitForInstanceIdle(input.agent, 0, this.lastDeliveryAt.get(input.agent) ?? 0, () => !input.stillCurrent());
@@ -4898,8 +4905,20 @@ export class FleetManager {
4898
4905
  // M-3660: the window covers only the turn that answers the question. The agent's daemon (Classic rooms' too)
4899
4906
  // writes it only into an idle pane, as a turn of its own, and says so just before the write (hub_question_input),
4900
4907
  // so a question waiting behind another turn — or never written — opens nothing.
4908
+ if (!input.stillCurrent())
4909
+ return false;
4910
+ if (replyInputId && input.acceptedHubRequest) {
4911
+ const daemon = this.daemons.get(input.agent);
4912
+ if (typeof daemon?.registerHubReplyInput !== "function")
4913
+ return false;
4914
+ registeredDaemon = daemon;
4915
+ daemon.registerHubReplyInput(replyInputId, input.acceptedHubRequest, input.correlationId, screenedText, this.screenHubText(input.replyQuestionBeginning ?? ""));
4916
+ }
4901
4917
  return input.stillCurrent();
4902
- } });
4918
+ } }).catch(error => { if (replyInputId)
4919
+ registeredDaemon?.releaseHubReplyInput(replyInputId); throw error; });
4920
+ if (result === false && replyInputId)
4921
+ registeredDaemon?.releaseHubReplyInput(replyInputId);
4903
4922
  return result !== false;
4904
4923
  }
4905
4924
  async deliverHubRoomNotification(input) {
@@ -5024,7 +5043,12 @@ export class FleetManager {
5024
5043
  const result = this.hubReports?.(input) ?? null;
5025
5044
  if (!result)
5026
5045
  return null;
5046
+ const daemon = this.daemons.get(input.caller);
5047
+ const callerCurrent = () => typeof input.callerCurrent === "function" && input.callerCurrent();
5048
+ const settle = callerCurrent() ? daemon?.captureHubReplyCompletion?.(input.correlationId) : null;
5027
5049
  return result.then(outcome => {
5050
+ if (this.daemons.get(input.caller) === daemon && callerCurrent())
5051
+ settle?.(outcome);
5028
5052
  // M-3660: an accepted answer inside its own running answer turn does not lift it: the turn's end does.
5029
5053
  if (outcome.ok && this.hubAnswerTurnKnownNone(input.caller, input.correlationId)) {
5030
5054
  try {
@@ -5035,11 +5059,18 @@ export class FleetManager {
5035
5059
  }
5036
5060
  }
5037
5061
  return outcome;
5038
- });
5062
+ }, error => { if (this.daemons.get(input.caller) === daemon)
5063
+ settle?.({ ok: false, message: "Hub outcome unconfirmed" }); throw error; });
5039
5064
  }
5040
5065
  /** M-3127 OutboundContext: an agent's `react` on a Hub room question (its correlation id as message_id); null: not one. */
5041
5066
  hubReact(input) {
5042
- return this.hubReacts?.(input) ?? null;
5067
+ const result = this.hubReacts?.(input) ?? null;
5068
+ if (!result)
5069
+ return null;
5070
+ const daemon = this.daemons.get(input.caller), callerCurrent = () => typeof input.callerCurrent === "function" && input.callerCurrent(), settle = callerCurrent() ? daemon?.captureHubReplyCompletion?.(input.correlationId, false) : null;
5071
+ return result.then(outcome => { if (this.daemons.get(input.caller) === daemon && callerCurrent())
5072
+ settle?.(outcome); return outcome; }, error => { if (this.daemons.get(input.caller) === daemon)
5073
+ settle?.({ ok: false, message: "Hub acknowledgement unconfirmed" }); throw error; });
5043
5074
  }
5044
5075
  hubReacts = null;
5045
5076
  /** The member side's pane-failure hook for a Hub-issued correlation id (else null). */
@@ -12783,7 +12814,7 @@ export class FleetManager {
12783
12814
  const after = identity();
12784
12815
  if (!owned() || after.incarnation !== before.incarnation || after.workGeneration === before.workGeneration)
12785
12816
  throw Error("Fresh request work identity did not rotate");
12786
- }, snapshot => requestHumanReplyTarget(box, snapshot, () => owned() && daemon.requestContextTurnCurrent(snapshot), root => this.requestContextNativeAdmissionCurrent(root)), (id, recovery) => {
12817
+ }, snapshot => requestHumanReplyTarget(box, snapshot, () => owned() && daemon.requestContextTurnCurrent(snapshot), root => this.requestContextNativeAdmissionCurrent(root)) ?? (owned() && daemon.requestContextTurnCurrent(snapshot) ? daemon.hubReplyTarget?.(snapshot) ?? null : null), (id, recovery) => {
12787
12818
  const publication = this.requestContextBoot?.publication;
12788
12819
  if (!publication)
12789
12820
  return;
@@ -18562,7 +18593,7 @@ export class FleetManager {
18562
18593
  if (this.instanceIpcClients.get(name) === ipc && typeof msg.generation === "string" && typeof msg.turn === "string")
18563
18594
  void this.hubRoomOwed?.turnEnded(name, msg.generation, msg.turn).catch(err => this.logger.warn({ err }, "Hub room completion notice held"));
18564
18595
  }
18565
- else if (msg.type === "hub_question_input" || msg.type === "hub_question_turn_ended" || msg.type === "hub_question_turn_state") {
18596
+ else if (msg.type === "hub_question_input" || msg.type === "hub_question_turn_ended" || msg.type === "hub_question_turn_state" || msg.type === "hub_question_delivered") {
18566
18597
  // M-3660: only the instance's current daemon speaks for its pane's turns.
18567
18598
  if (this.instanceIpcClients.get(name) === ipc)
18568
18599
  this.hubTurnSignal(name, msg);
@@ -24856,6 +24887,34 @@ export class FleetManager {
24856
24887
  return null;
24857
24888
  return profileName(this.classicChannels.getCredentialProfileByInstance(name, this.fleetConfig?.defaults));
24858
24889
  }
24890
+ /**
24891
+ * M-3943: the account an agent signs in with, as /status, the web status table and list_instances show it — a profile
24892
+ * name, "default" for the backend's shared login, "invalid" for a ClassicBot room whose setting cannot launch, or
24893
+ * null when the backend has no profiles. A Windows agent's profile is the one kept on its paired Runtime computer.
24894
+ */
24895
+ credentialProfileLabel(name, backend = this.backendNameOf(name)) {
24896
+ const cfg = this.fleetConfig?.instances?.[name];
24897
+ if (isWindowsInstance(cfg)) {
24898
+ if (!isCredentialProfileCli(cfg?.backend ?? backend))
24899
+ return null;
24900
+ try {
24901
+ return nativeCredentialProfile(cfg) ?? "default";
24902
+ }
24903
+ catch {
24904
+ return "invalid";
24905
+ }
24906
+ }
24907
+ if (!credentialHomeSpec(backend))
24908
+ return null;
24909
+ const profile = this.credentialProfileOf(name, backend);
24910
+ if (profile)
24911
+ return profile;
24912
+ if (!cfg && !this.daemons.get(name)?.getConfigSnapshot?.()
24913
+ && this.classicChannels?.getBackendByInstance(name, this.fleetConfig?.defaults?.backend) === backend
24914
+ && this.classicChannels.getCredentialProfileByInstance(name, this.fleetConfig?.defaults).state === "invalid")
24915
+ return "invalid";
24916
+ return "default";
24917
+ }
24859
24918
  /**
24860
24919
  * #1699: the claude config dir an instance's CLI uses — its credential profile's, else exactly as before
24861
24920
  * (CLAUDE_CONFIG_DIR or ~/.claude).