@songsid/agend 2.2.0-beta.7 → 2.2.0-beta.8

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 (72) hide show
  1. package/dist/agent-whats-new.js +9 -3
  2. package/dist/agent-whats-new.js.map +1 -1
  3. package/dist/backend/kiro.d.ts +9 -0
  4. package/dist/backend/kiro.js +23 -0
  5. package/dist/backend/kiro.js.map +1 -1
  6. package/dist/channel/mcp-tools.js +1 -1
  7. package/dist/channel/mcp-tools.js.map +1 -1
  8. package/dist/config-validator.js +3 -0
  9. package/dist/config-validator.js.map +1 -1
  10. package/dist/daemon.d.ts +2 -0
  11. package/dist/daemon.js +2 -0
  12. package/dist/daemon.js.map +1 -1
  13. package/dist/fleet-manager.d.ts +12 -0
  14. package/dist/fleet-manager.js +45 -0
  15. package/dist/fleet-manager.js.map +1 -1
  16. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +2 -0
  17. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
  18. package/dist/instance-config-impact.js +1 -0
  19. package/dist/instance-config-impact.js.map +1 -1
  20. package/dist/log-service.d.ts +99 -0
  21. package/dist/log-service.js +235 -0
  22. package/dist/log-service.js.map +1 -0
  23. package/dist/log-steps.d.ts +143 -0
  24. package/dist/log-steps.js +646 -0
  25. package/dist/log-steps.js.map +1 -0
  26. package/dist/public-web-gateway.js +1 -1
  27. package/dist/public-web-gateway.js.map +1 -1
  28. package/dist/public-web-link.js +15 -3
  29. package/dist/public-web-link.js.map +1 -1
  30. package/dist/settings-api.js +4 -0
  31. package/dist/settings-api.js.map +1 -1
  32. package/dist/settings-change.js +2 -0
  33. package/dist/settings-change.js.map +1 -1
  34. package/dist/settings-effect.js +2 -0
  35. package/dist/settings-effect.js.map +1 -1
  36. package/dist/tool-progress.js +3 -2
  37. package/dist/tool-progress.js.map +1 -1
  38. package/dist/transcript-jsonl.d.ts +80 -3
  39. package/dist/transcript-jsonl.js +147 -10
  40. package/dist/transcript-jsonl.js.map +1 -1
  41. package/dist/transcript-monitor.d.ts +11 -0
  42. package/dist/transcript-monitor.js +61 -13
  43. package/dist/transcript-monitor.js.map +1 -1
  44. package/dist/transcript-sources.d.ts +24 -0
  45. package/dist/transcript-sources.js +205 -55
  46. package/dist/transcript-sources.js.map +1 -1
  47. package/dist/types.d.ts +6 -0
  48. package/dist/ui/panel-log.js +388 -0
  49. package/dist/ui/panel-settings.js +6 -1
  50. package/dist/ui/settings-strings.js +2 -0
  51. package/dist/ui/shared/app-i18n.js +2 -2
  52. package/dist/ui/shared/app-route.js +6 -1
  53. package/dist/ui/shared/app-shell.js +3 -3
  54. package/dist/ui/shared/app-stream.js +2 -1
  55. package/dist/ui/shared/app.css +40 -5
  56. package/dist/ui/shared/app.js +5 -0
  57. package/dist/ui/shared/fonts/README.md +1 -1
  58. package/dist/ui/shared/instance-nav.js +9 -6
  59. package/dist/ui/shared/instance-switch.js +4 -4
  60. package/dist/ui/shared/tokens.css +1 -1
  61. package/dist/web-api.d.ts +3 -0
  62. package/dist/web-api.js +41 -0
  63. package/dist/web-api.js.map +1 -1
  64. package/dist/web-auth.js +2 -1
  65. package/dist/web-auth.js.map +1 -1
  66. package/dist/web-settings-patch.d.ts +3 -1
  67. package/dist/web-settings-patch.js +4 -1
  68. package/dist/web-settings-patch.js.map +1 -1
  69. package/dist/web-shell-routes.d.ts +4 -0
  70. package/dist/web-shell-routes.js +9 -0
  71. package/dist/web-shell-routes.js.map +1 -1
  72. package/package.json +1 -1
@@ -53,6 +53,7 @@ export declare function applyTaskListCap<T extends {
53
53
  hint: string;
54
54
  } | T[];
55
55
  import { type PublicPreviewForUi } from "./web-api.js";
56
+ import { type LogAnswer, type LogQuery } from "./log-service.js";
56
57
  import { WebChatHistory } from "./web-chat-history.js";
57
58
  import { SeenUsers, type MentionNames, type MentionQuery } from "./web-mentions.js";
58
59
  import { WebPrefsStore } from "./web-prefs.js";
@@ -814,6 +815,17 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
814
815
  getActiveBackendIds(): ReadonlySet<string>;
815
816
  isClassicInstance(name: string): boolean;
816
817
  /** #1523 N2: a ClassicBot room's own summary for its Details page (classicBot.yaml), or null. */
818
+ /** #1218: the Log tab's on-demand service — made on first use; with `web.log_tab` off it answers off and does nothing. */
819
+ private logService;
820
+ private get log();
821
+ /** #1218: GET /ui/steps — an instance's steps, read on demand (null: no such instance). */
822
+ logSteps(name: string, q: LogQuery): Promise<LogAnswer | null>;
823
+ /**
824
+ * #1218: where an instance's steps are read from, resolved only when its Log asks: the transcript its daemon follows
825
+ * now; for claude-code, also the path its statusline last named (so a stopped instance's Log still shows its last
826
+ * work). kiro comes with its own reader later in phase 1; other backends have no transcript AgEnD can read.
827
+ */
828
+ private logSource;
817
829
  classicRoomFor(name: string): {
818
830
  name: string;
819
831
  channel_id: string;
@@ -132,6 +132,7 @@ export function applyTaskListCap(tasks, filterAssignee, filterStatus) {
132
132
  return tasks;
133
133
  }
134
134
  import { handleWebRequest, broadcastSseEvent, SSE_HEARTBEAT_MS } from "./web-api.js";
135
+ import { LogService } from "./log-service.js";
135
136
  import { WebChatHistory, WEB_CHAT_TEXT_MAX, isWebMessageId, newWebMessageId } from "./web-chat-history.js";
136
137
  import { WebChatDiskStore } from "./web-chat-store.js";
137
138
  import { SeenUsers, resolveMentions } from "./web-mentions.js";
@@ -2695,6 +2696,49 @@ export class FleetManager {
2695
2696
  return this.classicChannels?.getAll().some(channel => channel.instanceName === name) ?? false;
2696
2697
  }
2697
2698
  /** #1523 N2: a ClassicBot room's own summary for its Details page (classicBot.yaml), or null. */
2699
+ /** #1218: the Log tab's on-demand service — made on first use; with `web.log_tab` off it answers off and does nothing. */
2700
+ logService = null;
2701
+ get log() {
2702
+ return this.logService ??= new LogService({
2703
+ enabled: () => this.fleetConfig?.web?.log_tab === true,
2704
+ known: (name) => Object.prototype.hasOwnProperty.call(this.fleetConfig?.instances ?? {}, name) || this.classicRoomFor(name) !== null,
2705
+ source: (name) => this.logSource(name),
2706
+ events: (name, limit) => (this.eventLog?.query({ instance: name, limit }) ?? []),
2707
+ emit: (event, data) => this.emitSseEvent(event, data),
2708
+ });
2709
+ }
2710
+ /** #1218: GET /ui/steps — an instance's steps, read on demand (null: no such instance). */
2711
+ logSteps(name, q) { return this.log.steps(name, q); }
2712
+ /**
2713
+ * #1218: where an instance's steps are read from, resolved only when its Log asks: the transcript its daemon follows
2714
+ * now; for claude-code, also the path its statusline last named (so a stopped instance's Log still shows its last
2715
+ * work). kiro comes with its own reader later in phase 1; other backends have no transcript AgEnD can read.
2716
+ */
2717
+ logSource(name) {
2718
+ const instances = this.fleetConfig?.instances ?? {};
2719
+ const config = Object.prototype.hasOwnProperty.call(instances, name) ? instances[name] : undefined;
2720
+ const backend = config?.backend ?? (config ? null : this.classicRoomFor(name)?.backend) ?? this.fleetConfig?.defaults?.backend ?? "claude-code";
2721
+ const live = this.lifecycle.daemons.get(name)?.logTranscriptPath() ?? null;
2722
+ if (backend === "claude-code") {
2723
+ let path = live;
2724
+ if (!path) {
2725
+ try {
2726
+ path = JSON.parse(readFileSync(join(this.getInstanceDir(name), "statusline.json"), "utf-8")).transcript_path ?? null;
2727
+ }
2728
+ catch {
2729
+ path = null;
2730
+ }
2731
+ if (typeof path !== "string" || !path)
2732
+ path = null;
2733
+ }
2734
+ return { backend, path, format: "claude", ...(path ? {} : { reason: "no_transcript" }) };
2735
+ }
2736
+ if (backend === "codex")
2737
+ return { backend, path: live, format: "codex", ...(live ? {} : { reason: "not_running" }) };
2738
+ if (backend === "kiro-cli")
2739
+ return { backend, path: null, format: null, reason: "coming" };
2740
+ return { backend, path: null, format: null, reason: "unsupported" };
2741
+ }
2698
2742
  classicRoomFor(name) {
2699
2743
  const ch = this.classicChannels?.getAll().find(channel => channel.instanceName === name);
2700
2744
  if (!ch)
@@ -16659,6 +16703,7 @@ Plus the operational skills (fleet-health, instance-lifecycle, scheduling, sessi
16659
16703
  clearInterval(this.eventLogPruneTimer);
16660
16704
  this.eventLogPruneTimer = null;
16661
16705
  }
16706
+ this.logService?.unwatchAll(); // #1218: a Log's watch timers end with the fleet
16662
16707
  if (this.outboxPruneTimer) {
16663
16708
  clearInterval(this.outboxPruneTimer);
16664
16709
  this.outboxPruneTimer = null;