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

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 (87) 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/grok.d.ts +1 -0
  4. package/dist/backend/grok.js +5 -0
  5. package/dist/backend/grok.js.map +1 -1
  6. package/dist/backend/kiro.d.ts +24 -0
  7. package/dist/backend/kiro.js +51 -5
  8. package/dist/backend/kiro.js.map +1 -1
  9. package/dist/backend/muse.d.ts +17 -0
  10. package/dist/backend/muse.js +86 -16
  11. package/dist/backend/muse.js.map +1 -1
  12. package/dist/backend/types.d.ts +16 -1
  13. package/dist/backend/types.js.map +1 -1
  14. package/dist/channel/mcp-tools.js +1 -1
  15. package/dist/channel/mcp-tools.js.map +1 -1
  16. package/dist/config-validator.js +3 -0
  17. package/dist/config-validator.js.map +1 -1
  18. package/dist/daemon.d.ts +6 -1
  19. package/dist/daemon.js +12 -4
  20. package/dist/daemon.js.map +1 -1
  21. package/dist/fleet-manager.d.ts +13 -0
  22. package/dist/fleet-manager.js +52 -0
  23. package/dist/fleet-manager.js.map +1 -1
  24. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +2 -0
  25. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
  26. package/dist/instance-config-impact.js +1 -0
  27. package/dist/instance-config-impact.js.map +1 -1
  28. package/dist/instance-lifecycle.js +3 -1
  29. package/dist/instance-lifecycle.js.map +1 -1
  30. package/dist/kiro-log-gate.d.ts +42 -0
  31. package/dist/kiro-log-gate.js +39 -0
  32. package/dist/kiro-log-gate.js.map +1 -0
  33. package/dist/log-service.d.ts +99 -0
  34. package/dist/log-service.js +235 -0
  35. package/dist/log-service.js.map +1 -0
  36. package/dist/log-steps.d.ts +169 -0
  37. package/dist/log-steps.js +858 -0
  38. package/dist/log-steps.js.map +1 -0
  39. package/dist/public-web-gateway.js +1 -1
  40. package/dist/public-web-gateway.js.map +1 -1
  41. package/dist/public-web-link.js +15 -3
  42. package/dist/public-web-link.js.map +1 -1
  43. package/dist/settings-api.js +4 -0
  44. package/dist/settings-api.js.map +1 -1
  45. package/dist/settings-change.js +2 -0
  46. package/dist/settings-change.js.map +1 -1
  47. package/dist/settings-effect.js +2 -0
  48. package/dist/settings-effect.js.map +1 -1
  49. package/dist/tool-progress.js +3 -2
  50. package/dist/tool-progress.js.map +1 -1
  51. package/dist/transcript-jsonl.d.ts +80 -3
  52. package/dist/transcript-jsonl.js +147 -10
  53. package/dist/transcript-jsonl.js.map +1 -1
  54. package/dist/transcript-monitor.d.ts +11 -0
  55. package/dist/transcript-monitor.js +61 -13
  56. package/dist/transcript-monitor.js.map +1 -1
  57. package/dist/transcript-sources.d.ts +24 -0
  58. package/dist/transcript-sources.js +205 -55
  59. package/dist/transcript-sources.js.map +1 -1
  60. package/dist/types.d.ts +6 -0
  61. package/dist/ui/panel-log.js +428 -0
  62. package/dist/ui/panel-settings.js +6 -1
  63. package/dist/ui/settings-strings.js +2 -0
  64. package/dist/ui/shared/app-i18n.js +2 -2
  65. package/dist/ui/shared/app-route.js +6 -1
  66. package/dist/ui/shared/app-shell.js +3 -3
  67. package/dist/ui/shared/app-stream.js +2 -1
  68. package/dist/ui/shared/app.css +40 -5
  69. package/dist/ui/shared/app.js +5 -0
  70. package/dist/ui/shared/fonts/README.md +1 -1
  71. package/dist/ui/shared/instance-nav.js +9 -6
  72. package/dist/ui/shared/instance-switch.js +4 -4
  73. package/dist/ui/shared/tokens.css +1 -1
  74. package/dist/unrecognised-prompt.js +2 -2
  75. package/dist/unrecognised-prompt.js.map +1 -1
  76. package/dist/web-api.d.ts +3 -0
  77. package/dist/web-api.js +41 -0
  78. package/dist/web-api.js.map +1 -1
  79. package/dist/web-auth.js +2 -1
  80. package/dist/web-auth.js.map +1 -1
  81. package/dist/web-settings-patch.d.ts +3 -1
  82. package/dist/web-settings-patch.js +4 -1
  83. package/dist/web-settings-patch.js.map +1 -1
  84. package/dist/web-shell-routes.d.ts +4 -0
  85. package/dist/web-shell-routes.js +9 -0
  86. package/dist/web-shell-routes.js.map +1 -1
  87. 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,18 @@ 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: fleet events with the reason its history is not read (kiro-log-gate.ts); other backends have no
827
+ * transcript AgEnD can read.
828
+ */
829
+ private logSource;
817
830
  classicRoomFor(name: string): {
818
831
  name: string;
819
832
  channel_id: string;
@@ -39,6 +39,7 @@ import { readFleetMemory } from "./process-memory.js";
39
39
  import { MemoryPressure } from "./memory-pressure.js";
40
40
  import { replyDedupText, ReplyDeduper } from "./reply-dedup.js";
41
41
  import { isMap, isScalar, parseDocument } from "yaml";
42
+ import { kiroLogGate } from "./kiro-log-gate.js";
42
43
  const __filename = fileURLToPath(import.meta.url);
43
44
  const __dirname = dirname(__filename);
44
45
  /** Fallback access policy for a channel with no `access:` block — open (no gate). */
@@ -132,6 +133,7 @@ export function applyTaskListCap(tasks, filterAssignee, filterStatus) {
132
133
  return tasks;
133
134
  }
134
135
  import { handleWebRequest, broadcastSseEvent, SSE_HEARTBEAT_MS } from "./web-api.js";
136
+ import { LogService } from "./log-service.js";
135
137
  import { WebChatHistory, WEB_CHAT_TEXT_MAX, isWebMessageId, newWebMessageId } from "./web-chat-history.js";
136
138
  import { WebChatDiskStore } from "./web-chat-store.js";
137
139
  import { SeenUsers, resolveMentions } from "./web-mentions.js";
@@ -2695,6 +2697,55 @@ export class FleetManager {
2695
2697
  return this.classicChannels?.getAll().some(channel => channel.instanceName === name) ?? false;
2696
2698
  }
2697
2699
  /** #1523 N2: a ClassicBot room's own summary for its Details page (classicBot.yaml), or null. */
2700
+ /** #1218: the Log tab's on-demand service — made on first use; with `web.log_tab` off it answers off and does nothing. */
2701
+ logService = null;
2702
+ get log() {
2703
+ return this.logService ??= new LogService({
2704
+ enabled: () => this.fleetConfig?.web?.log_tab === true,
2705
+ known: (name) => Object.prototype.hasOwnProperty.call(this.fleetConfig?.instances ?? {}, name) || this.classicRoomFor(name) !== null,
2706
+ source: (name) => this.logSource(name),
2707
+ events: (name, limit) => (this.eventLog?.query({ instance: name, limit }) ?? []),
2708
+ emit: (event, data) => this.emitSseEvent(event, data),
2709
+ });
2710
+ }
2711
+ /** #1218: GET /ui/steps — an instance's steps, read on demand (null: no such instance). */
2712
+ logSteps(name, q) { return this.log.steps(name, q); }
2713
+ /**
2714
+ * #1218: where an instance's steps are read from, resolved only when its Log asks: the transcript its daemon follows
2715
+ * now; for claude-code, also the path its statusline last named (so a stopped instance's Log still shows its last
2716
+ * work). kiro: fleet events with the reason its history is not read (kiro-log-gate.ts); other backends have no
2717
+ * transcript AgEnD can read.
2718
+ */
2719
+ logSource(name) {
2720
+ const instances = this.fleetConfig?.instances ?? {};
2721
+ const config = Object.prototype.hasOwnProperty.call(instances, name) ? instances[name] : undefined;
2722
+ const backend = config?.backend ?? (config ? null : this.classicRoomFor(name)?.backend) ?? this.fleetConfig?.defaults?.backend ?? "claude-code";
2723
+ const live = this.lifecycle.daemons.get(name)?.logTranscriptPath() ?? null;
2724
+ if (backend === "claude-code") {
2725
+ let path = live;
2726
+ if (!path) {
2727
+ try {
2728
+ path = JSON.parse(readFileSync(join(this.getInstanceDir(name), "statusline.json"), "utf-8")).transcript_path ?? null;
2729
+ }
2730
+ catch {
2731
+ path = null;
2732
+ }
2733
+ if (typeof path !== "string" || !path)
2734
+ path = null;
2735
+ }
2736
+ return { backend, path, format: "claude", ...(path ? {} : { reason: "no_transcript" }) };
2737
+ }
2738
+ if (backend === "codex")
2739
+ return { backend, path: live, format: "codex", ...(live ? {} : { reason: "not_running" }) };
2740
+ if (backend === "kiro-cli") {
2741
+ // #1218 PR4: events only until the launch's root and the current conversation are both proven (kiro-log-gate.ts);
2742
+ // the reason names which proof is missing. With today's proofs the gate never opens, and nothing is read for kiro:
2743
+ // the reader is bound to an admitted launch when the proofs arrive (#849 root, #1789 current conversation).
2744
+ const gate = kiroLogGate(this.lifecycle.daemons.get(name)?.logLaunch() ?? null);
2745
+ return { backend, path: null, format: null, reason: gate.open ? "kiro_session_unobservable" : gate.reason };
2746
+ }
2747
+ return { backend, path: null, format: null, reason: "unsupported" };
2748
+ }
2698
2749
  classicRoomFor(name) {
2699
2750
  const ch = this.classicChannels?.getAll().find(channel => channel.instanceName === name);
2700
2751
  if (!ch)
@@ -16659,6 +16710,7 @@ Plus the operational skills (fleet-health, instance-lifecycle, scheduling, sessi
16659
16710
  clearInterval(this.eventLogPruneTimer);
16660
16711
  this.eventLogPruneTimer = null;
16661
16712
  }
16713
+ this.logService?.unwatchAll(); // #1218: a Log's watch timers end with the fleet
16662
16714
  if (this.outboxPruneTimer) {
16663
16715
  clearInterval(this.outboxPruneTimer);
16664
16716
  this.outboxPruneTimer = null;