@tutti-os/agent-gui 0.0.105 → 0.0.107

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.
@@ -6,7 +6,7 @@ import {
6
6
  projectAgentConversationVM,
7
7
  reconcileProjectedAgentConversationVM,
8
8
  useProjectedAgentConversation
9
- } from "../chunk-IR2CL2X2.js";
9
+ } from "../chunk-F7Q7QK42.js";
10
10
  import "../chunk-UFIEUC3Y.js";
11
11
  import "../chunk-7BXWPI4F.js";
12
12
  import "../chunk-FGLQZ6I4.js";
package/dist/agent-gui.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  AgentGUI
3
- } from "./chunk-N3HTEYLZ.js";
3
+ } from "./chunk-ZWY32ZKZ.js";
4
4
  import "./chunk-ZSJBCZUH.js";
5
5
  import "./chunk-V5ROOS2O.js";
6
6
  import "./chunk-4YVKAPKW.js";
7
7
  import "./chunk-QY22OBJS.js";
8
8
  import "./chunk-L3GMMGRS.js";
9
9
  import "./chunk-UHBCM6RO.js";
10
- import "./chunk-IR2CL2X2.js";
10
+ import "./chunk-F7Q7QK42.js";
11
11
  import "./chunk-UFIEUC3Y.js";
12
12
  import "./chunk-7BXWPI4F.js";
13
- import "./chunk-6R7GHXRQ.js";
13
+ import "./chunk-P3CVAWGJ.js";
14
14
  import "./chunk-C35SNDVZ.js";
15
15
  import "./chunk-FGLQZ6I4.js";
16
16
  import "./chunk-4YG7YK7S.js";
17
- import "./chunk-JG7HGKZL.js";
17
+ import "./chunk-BXOKBZH4.js";
18
18
  import "./chunk-4YCCATI4.js";
19
19
  import "./chunk-XJ34OIEQ.js";
20
20
  import "./chunk-J2HG7UCP.js";
@@ -7553,10 +7553,14 @@ button.agent-gui-node__conversation-section-toggle:hover
7553
7553
  background: var(--agent-gui-accent-bg);
7554
7554
  }
7555
7555
 
7556
+ /* In dock layout a growing draft overhangs upward past the composer's top
7557
+ edge (the dock only reserves the collapsed input height in flow), so the
7558
+ floating panels anchored at bottom: 100% must be lifted by that overhang
7559
+ (--agent-gui-composer-input-overflow) or the grown input covers them. */
7556
7560
  .agent-gui-node__composer-floating-prompt {
7557
7561
  position: absolute;
7558
7562
  right: 12px;
7559
- bottom: calc(100% + 8px);
7563
+ bottom: calc(100% + 8px + var(--agent-gui-composer-input-overflow, 0px));
7560
7564
  left: 12px;
7561
7565
  z-index: 5;
7562
7566
  }
@@ -7564,7 +7568,7 @@ button.agent-gui-node__conversation-section-toggle:hover
7564
7568
  .agent-gui-node__composer-floating-prompt--queued {
7565
7569
  z-index: 1;
7566
7570
  right: 24px;
7567
- bottom: 100%;
7571
+ bottom: calc(100% + var(--agent-gui-composer-input-overflow, 0px));
7568
7572
  left: 24px;
7569
7573
  }
7570
7574
 
@@ -7691,7 +7695,9 @@ button.agent-gui-node__conversation-section-toggle:hover
7691
7695
  }
7692
7696
 
7693
7697
  .agent-gui-node__composer[data-layout="dock"]
7694
- .agent-gui-node__composer-send-button {
7698
+ .agent-gui-node__composer-send-button,
7699
+ .agent-gui-node__composer[data-layout="dock"]
7700
+ .agent-gui-node__composer-stop-button {
7695
7701
  align-self: end;
7696
7702
  }
7697
7703
 
@@ -8257,9 +8263,39 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8257
8263
  white-space: nowrap;
8258
8264
  }
8259
8265
 
8260
- .agent-gui-node__composer-queued-prompt-markdown p {
8266
+ /* Queued rows are single-line previews. Flatten every markdown block
8267
+ (lists, code blocks, quotes, headings) to plain inline text — including
8268
+ their box styling from the markdown renderer — so the row's nowrap +
8269
+ overflow: hidden + "…" overlay can truncate instead of the blocks
8270
+ stacking extra lines. Scoped under the text wrapper to outrank the
8271
+ renderer's own [&_ol]/[&_pre]-style utilities. */
8272
+ .agent-gui-node__composer-queued-prompt-text
8273
+ .agent-gui-node__composer-queued-prompt-markdown
8274
+ :is(p, ul, ol, li, blockquote, pre, h1, h2, h3, h4, h5, h6) {
8261
8275
  display: inline;
8262
8276
  margin: 0;
8277
+ padding: 0;
8278
+ border: 0;
8279
+ background: transparent;
8280
+ font-size: inherit;
8281
+ font-weight: inherit;
8282
+ line-height: inherit;
8283
+ white-space: nowrap;
8284
+ }
8285
+
8286
+ .agent-gui-node__composer-queued-prompt-text
8287
+ .agent-gui-node__composer-queued-prompt-markdown
8288
+ pre
8289
+ code {
8290
+ white-space: nowrap;
8291
+ }
8292
+
8293
+ /* Media, tables, rules, and explicit line breaks cannot collapse into one
8294
+ text line — drop them from the preview entirely. */
8295
+ .agent-gui-node__composer-queued-prompt-text
8296
+ .agent-gui-node__composer-queued-prompt-markdown
8297
+ :is(img, video, table, hr, br, input) {
8298
+ display: none;
8263
8299
  }
8264
8300
 
8265
8301
  .agent-gui-node__composer-queued-prompt-markdown
@@ -8810,6 +8846,12 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8810
8846
 
8811
8847
  .agent-gui-node__composer[data-layout="dock"] .agent-gui-node__composer-footer {
8812
8848
  position: relative;
8849
+ /* The base rule's width: 100% keeps the parent's content width, so the
8850
+ negative margins only shift the row left instead of widening it: the
8851
+ right edge falls 24px short of the composer edge and strands the model
8852
+ dropdown far from the send button above. width: auto lets
8853
+ justify-self: stretch + the negative margins span the full row. */
8854
+ width: auto;
8813
8855
  margin: 0 -12px -12px;
8814
8856
  padding: 0 14px 12px;
8815
8857
  background: var(--agent-gui-session-flow-background);
@@ -91,6 +91,9 @@ function agentMentionEmptyGroupLabel(groupId, query) {
91
91
  if (groupId === "collab_sessions") {
92
92
  return translate("agentHost.agentGui.mentionEmptyCollabSessions");
93
93
  }
94
+ if (groupId.startsWith("agent:")) {
95
+ return translate("agentHost.agentGui.mentionEmptyMySessions");
96
+ }
94
97
  return translate("agentHost.agentGui.mentionEmptyIssues");
95
98
  }
96
99
 
@@ -468,7 +471,18 @@ function resolveMentionGroupItems(groupId, rawGroups) {
468
471
  if (groupId === "files") {
469
472
  return [...rawGroups.opened_files, ...rawGroups.agent_generated_files];
470
473
  }
471
- return rawGroups[groupId] ?? [];
474
+ if (groupId === "my_sessions" || groupId === "collab_sessions") {
475
+ return rawGroups.sessions.filter(
476
+ (item) => item.kind === "session" && item.scope === groupId
477
+ );
478
+ }
479
+ if (groupId.startsWith("agent:")) {
480
+ return [];
481
+ }
482
+ if (groupId === "apps" || groupId === "agents" || groupId === "opened_files" || groupId === "agent_generated_files" || groupId === "issues") {
483
+ return rawGroups[groupId];
484
+ }
485
+ return [];
472
486
  }
473
487
  function resolveMentionGroupTotalCount(groupId, totalCounts, itemCount) {
474
488
  if (groupId.startsWith("issue-topic:")) {
@@ -632,6 +646,10 @@ function buildAgentMentionGroups(input) {
632
646
  expandStatus: group.loadMoreStatus
633
647
  }));
634
648
  }
649
+ const provenanceGroups = buildSessionProvenanceGroups(input);
650
+ if (provenanceGroups) {
651
+ return provenanceGroups;
652
+ }
635
653
  const orderedGroupIds = groupIdsForFilter(input.currentFilter);
636
654
  return orderedGroupIds.map((groupId) => {
637
655
  const rawItems = resolveMentionGroupItems(groupId, input.rawGroups);
@@ -693,14 +711,93 @@ function issueTopicPaginationChanges(groupsAtStart, currentGroups) {
693
711
  return [{ ...group, items: appendedItems }];
694
712
  });
695
713
  }
714
+ function buildSessionProvenanceGroups(input) {
715
+ if (input.currentFilter !== "session" || !input.provenanceCatalog?.enabledDimensions.includes("agent")) {
716
+ return null;
717
+ }
718
+ const selectedAgentTargetIds = input.provenanceFilter?.agentTargetIds ?? null;
719
+ const selectedAgentTargetIdSet = selectedAgentTargetIds === null ? null : new Set(selectedAgentTargetIds);
720
+ const sessionItems = input.rawGroups.sessions.filter(
721
+ (item) => item.kind === "session" && (selectedAgentTargetIdSet === null || (item.agentTargetId ? selectedAgentTargetIdSet.has(item.agentTargetId) : false))
722
+ );
723
+ const catalogAgentTargetIds = new Set(
724
+ input.provenanceCatalog.agentOptions.map((option) => option.id)
725
+ );
726
+ const catalogGroups = input.provenanceCatalog.agentOptions.flatMap(
727
+ (option) => {
728
+ const items = sessionItems.filter(
729
+ (item) => item.kind === "session" && item.agentTargetId === option.id
730
+ );
731
+ if (items.length === 0) {
732
+ return [];
733
+ }
734
+ const groupId = agentProvenanceMentionGroupId(option.id);
735
+ const pageSize = mentionGroupPageSize(input.currentFilter, groupId);
736
+ const visibleCount = Math.min(
737
+ items.length,
738
+ input.expandedCounts[groupId] ?? pageSize
739
+ );
740
+ return [
741
+ {
742
+ id: groupId,
743
+ label: option.label,
744
+ items: items.slice(0, visibleCount),
745
+ totalCount: items.length,
746
+ visibleCount,
747
+ hasMore: items.length > visibleCount
748
+ }
749
+ ];
750
+ }
751
+ );
752
+ if (selectedAgentTargetIdSet !== null) {
753
+ return catalogGroups;
754
+ }
755
+ const unmatchedGroups = /* @__PURE__ */ new Map();
756
+ for (const item of sessionItems) {
757
+ if (item.kind !== "session" || item.agentTargetId && catalogAgentTargetIds.has(item.agentTargetId)) {
758
+ continue;
759
+ }
760
+ const identity = item.agentTargetId?.trim() || item.agentName.trim() || item.initiatorName.trim() || item.targetId;
761
+ const key = `uncatalogued:${identity}`;
762
+ const existing = unmatchedGroups.get(key);
763
+ if (existing) {
764
+ existing.items.push(item);
765
+ continue;
766
+ }
767
+ unmatchedGroups.set(key, {
768
+ id: agentProvenanceMentionGroupId(key),
769
+ label: item.agentName.trim() || item.initiatorName.trim() || item.agentTargetId?.trim() || item.title,
770
+ items: [item]
771
+ });
772
+ }
773
+ return [
774
+ ...catalogGroups,
775
+ ...[...unmatchedGroups.values()].map((group) => {
776
+ const pageSize = mentionGroupPageSize(input.currentFilter, group.id);
777
+ const visibleCount = Math.min(
778
+ group.items.length,
779
+ input.expandedCounts[group.id] ?? pageSize
780
+ );
781
+ return {
782
+ ...group,
783
+ items: group.items.slice(0, visibleCount),
784
+ totalCount: group.items.length,
785
+ visibleCount,
786
+ hasMore: group.items.length > visibleCount
787
+ };
788
+ })
789
+ ];
790
+ }
791
+ function agentProvenanceMentionGroupId(agentTargetId) {
792
+ return `agent:${encodeURIComponent(agentTargetId)}`;
793
+ }
696
794
  function emptyAgentMentionRawGroups() {
697
795
  return {
698
796
  apps: [],
699
797
  agents: [],
700
798
  opened_files: [],
701
799
  agent_generated_files: [],
702
- my_sessions: [],
703
- collab_sessions: [],
800
+ sessions: [],
704
801
  issues: []
705
802
  };
706
803
  }
@@ -710,8 +807,7 @@ function cloneAgentMentionRawGroups(rawGroups) {
710
807
  agents: [...rawGroups.agents],
711
808
  opened_files: [...rawGroups.opened_files],
712
809
  agent_generated_files: [...rawGroups.agent_generated_files],
713
- my_sessions: [...rawGroups.my_sessions],
714
- collab_sessions: [...rawGroups.collab_sessions],
810
+ sessions: [...rawGroups.sessions],
715
811
  issues: [...rawGroups.issues]
716
812
  };
717
813
  }
@@ -721,8 +817,12 @@ function totalCountsFromRawGroups(rawGroups) {
721
817
  agents: rawGroups.agents.length,
722
818
  opened_files: rawGroups.opened_files.length,
723
819
  agent_generated_files: rawGroups.agent_generated_files.length,
724
- my_sessions: rawGroups.my_sessions.length,
725
- collab_sessions: rawGroups.collab_sessions.length,
820
+ my_sessions: rawGroups.sessions.filter(
821
+ (item) => item.kind === "session" && item.scope === "my_sessions"
822
+ ).length,
823
+ collab_sessions: rawGroups.sessions.filter(
824
+ (item) => item.kind === "session" && item.scope === "collab_sessions"
825
+ ).length,
726
826
  issues: rawGroups.issues.length
727
827
  };
728
828
  }
@@ -775,12 +875,8 @@ function logAgentMentionLifecycleDiagnostic(payload) {
775
875
  );
776
876
  }
777
877
  }
778
- function normalizeSessionMentionItemsForMySessions(input) {
779
- return input.items.filter((item) => item.kind === "session").filter(
780
- (item) => input.currentUserId ? item.scope === "my_sessions" : true
781
- ).map(
782
- (item) => item.scope === "my_sessions" ? item : { ...item, scope: "my_sessions" }
783
- );
878
+ function normalizeSessionMentionItems(input) {
879
+ return input.items.filter((item) => item.kind === "session");
784
880
  }
785
881
  function providerItemToAgentMentionItem(input) {
786
882
  const label = compactText4(input.label);
@@ -908,6 +1004,7 @@ function providerItemToAgentMentionItem(input) {
908
1004
  initiatorName: "",
909
1005
  agentName,
910
1006
  agentIconUrl: presentation.agentIconUrl?.trim() || presentation.iconUrl?.trim() || void 0,
1007
+ ...scope.agentTargetId ? { agentTargetId: scope.agentTargetId } : {},
911
1008
  status: presentation.status?.trim() || void 0,
912
1009
  inputPreview: description || void 0,
913
1010
  summaryPreview
@@ -1376,14 +1473,16 @@ async function fetchAgentMentionFilterResult(input) {
1376
1473
  workspaceId: input.workspaceId,
1377
1474
  currentUserId: input.currentUserId,
1378
1475
  query: input.query,
1379
- limit: DEFAULT_SESSION_LIMIT,
1476
+ // A provenance-aware host owns a room-scoped directory snapshot and
1477
+ // grouping must see that complete snapshot. Legacy providers retain
1478
+ // the bounded query contract.
1479
+ limit: input.provenanceCatalog?.enabledDimensions.includes("agent") ? void 0 : DEFAULT_SESSION_LIMIT,
1380
1480
  sessionCwd: input.sessionCwd,
1381
1481
  diagnostics: providerDiagnostics,
1382
1482
  provenanceFilter: input.provenanceFilter
1383
1483
  });
1384
1484
  const rawGroups = emptyAgentMentionRawGroups();
1385
- rawGroups.my_sessions = normalizeSessionMentionItemsForMySessions({
1386
- currentUserId: input.currentUserId,
1485
+ rawGroups.sessions = normalizeSessionMentionItems({
1387
1486
  items: sessionItems
1388
1487
  });
1389
1488
  return {
@@ -1657,6 +1756,7 @@ var AgentMentionSearchControllerBase = class {
1657
1756
  currentQuery = "";
1658
1757
  currentSessionCwd = "";
1659
1758
  currentProvenanceFilter = null;
1759
+ currentProvenanceCatalog = null;
1660
1760
  currentFileSearchLimit;
1661
1761
  currentIssueSearchLimit;
1662
1762
  agentGeneratedBrowsePath = null;
@@ -2039,6 +2139,9 @@ var AgentMentionSearchControllerBase = class {
2039
2139
  }
2040
2140
  }
2041
2141
  resetExpandedCounts() {
2142
+ for (const groupId of Object.keys(this.expandedCounts)) {
2143
+ delete this.expandedCounts[groupId];
2144
+ }
2042
2145
  for (const groupId of [
2043
2146
  "files",
2044
2147
  "opened_files",
@@ -2096,7 +2199,9 @@ var AgentMentionSearchControllerBase = class {
2096
2199
  expandedCounts: this.expandedCounts,
2097
2200
  rawGroups: this.rawGroups,
2098
2201
  totalCounts: this.totalCounts,
2099
- issueTopicGroups: this.issueTopicGroups
2202
+ issueTopicGroups: this.issueTopicGroups,
2203
+ provenanceCatalog: this.currentProvenanceCatalog,
2204
+ provenanceFilter: this.currentProvenanceFilter
2100
2205
  });
2101
2206
  }
2102
2207
  browseCacheKey(input, provenanceFilter = this.currentProvenanceFilter) {
@@ -2133,6 +2238,7 @@ var AgentMentionSearchControllerBase = class {
2133
2238
  fileLimit: this.fileLimit,
2134
2239
  currentFileSearchLimit: this.currentFileSearchLimit,
2135
2240
  currentIssueSearchLimit: this.currentIssueSearchLimit,
2241
+ provenanceCatalog: this.currentProvenanceCatalog,
2136
2242
  provenanceFilter,
2137
2243
  queryProviderMentionGroupsById: (queryInput) => this.queryProviderMentionGroupsById({ ...queryInput, abortSignal }),
2138
2244
  queryProviderMentionItemsById: (queryInput) => this.queryProviderMentionItemsById({ ...queryInput, abortSignal })
@@ -2154,6 +2260,17 @@ var AgentMentionSearchControllerBase = class {
2154
2260
  import { referenceProvenanceFilterCacheKey as referenceProvenanceFilterCacheKey2 } from "@tutti-os/workspace-file-reference/core";
2155
2261
  var AgentMentionSearchController = class extends AgentMentionSearchControllerBase {
2156
2262
  issueLoadMoreRequests = /* @__PURE__ */ new Map();
2263
+ setProvenanceCatalog(catalog) {
2264
+ if (this.currentProvenanceCatalog === catalog) return;
2265
+ this.currentProvenanceCatalog = catalog;
2266
+ if (this.currentFilter !== "session" || this.state.status !== "ready" && this.state.status !== "loading") {
2267
+ return;
2268
+ }
2269
+ this.setState({
2270
+ ...this.state,
2271
+ groups: this.groupsFromRawGroups()
2272
+ });
2273
+ }
2157
2274
  setProvenanceFilter(filter) {
2158
2275
  const previousKey = this.currentProvenanceFilter ? referenceProvenanceFilterCacheKey2(this.currentProvenanceFilter) : "disabled";
2159
2276
  const nextKey = filter ? referenceProvenanceFilterCacheKey2(filter) : "disabled";
@@ -2689,4 +2806,4 @@ export {
2689
2806
  AgentMentionSearchController,
2690
2807
  preloadAgentMentionBrowse
2691
2808
  };
2692
- //# sourceMappingURL=chunk-JG7HGKZL.js.map
2809
+ //# sourceMappingURL=chunk-BXOKBZH4.js.map