zidane-ui 9.5.2 → 9.6.1

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 (201) hide show
  1. package/dist/adapters/index.d.ts +2 -1
  2. package/dist/adapters/index.js +2 -1
  3. package/dist/adapters/server-git-host.js +67 -0
  4. package/dist/adapters/server-host.js +9 -0
  5. package/dist/adapters/server-oauth-flow.d.ts +2 -2
  6. package/dist/adapters/server-oauth-flow.js +1 -1
  7. package/dist/adapters/server-projects.d.ts +53 -2
  8. package/dist/adapters/server-projects.js +4 -3
  9. package/dist/adapters/server-session-host.js +112 -4
  10. package/dist/channels/BindingEditorDialog.js +1 -1
  11. package/dist/channels/ChannelDefaultsSection.js +1 -1
  12. package/dist/channels/ChannelsSettingsSection.js +1 -1
  13. package/dist/channels/ConnectionSetupDialog.js +1 -1
  14. package/dist/channels/HeldRepliesList.js +1 -1
  15. package/dist/channels/ProjectChannelsSection.js +1 -1
  16. package/dist/chat/HostTranscript.js +1 -0
  17. package/dist/chat/SessionGroupHeader.js +2 -2
  18. package/dist/chat/composer/ComposerBadges.d.ts +27 -1
  19. package/dist/chat/composer/ComposerBadges.js +41 -5
  20. package/dist/chat/composer/ConversationBadges.d.ts +6 -0
  21. package/dist/chat/composer/ConversationBadges.js +70 -3
  22. package/dist/chat/composer/DraftPickers.js +4 -0
  23. package/dist/chat/composer/ServerScopeToggle.d.ts +16 -1
  24. package/dist/chat/composer/ServerScopeToggle.js +90 -47
  25. package/dist/chat/composer/index.d.ts +2 -2
  26. package/dist/chat/composer/use-draft-target.d.ts +18 -2
  27. package/dist/chat/composer/use-draft-target.js +74 -7
  28. package/dist/chat/composer/use-new-session-defaults.d.ts +3 -1
  29. package/dist/chat/composer/use-new-session-defaults.js +19 -14
  30. package/dist/chat/composer/use-send-prompt.js +2 -2
  31. package/dist/chat/headless/composer/index.d.ts +2 -2
  32. package/dist/chat/headless/composer/index.js +2 -2
  33. package/dist/chat/headless/composer/labels-chrome.d.ts +7 -0
  34. package/dist/chat/headless/composer/labels-chrome.js +7 -0
  35. package/dist/chat/headless/composer/labels-editor.d.ts +4 -0
  36. package/dist/chat/headless/composer/labels-editor.js +4 -0
  37. package/dist/chat/headless/composer/models.d.ts +2 -0
  38. package/dist/chat/headless/composer/new-session-defaults.d.ts +12 -1
  39. package/dist/chat/headless/composer/new-session-defaults.js +30 -1
  40. package/dist/chat/headless/draft-target.d.ts +27 -6
  41. package/dist/chat/headless/draft-target.js +36 -3
  42. package/dist/chat/headless/host.d.ts +7 -0
  43. package/dist/chat/headless/index.d.ts +4 -4
  44. package/dist/chat/headless/index.js +29 -29
  45. package/dist/chat/headless/labels.d.ts +4 -0
  46. package/dist/chat/headless/send-flow.d.ts +2 -0
  47. package/dist/chat/headless/send-flow.js +2 -1
  48. package/dist/chat/headless/session-list.d.ts +4 -0
  49. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  50. package/dist/chat/headless/sidebar/labels.d.ts +9 -1
  51. package/dist/chat/headless/sidebar/labels.js +4 -0
  52. package/dist/chat/headless/sidebar/rows.d.ts +48 -7
  53. package/dist/chat/headless/sidebar/rows.js +121 -22
  54. package/dist/chat/headless/sidebar/types.d.ts +5 -0
  55. package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
  56. package/dist/chat/headless/transcript/fold-actions.js +29 -1
  57. package/dist/chat/index.d.ts +2 -2
  58. package/dist/chat/index.js +2 -2
  59. package/dist/chat/rich-composer/RichComposer.js +58 -11
  60. package/dist/chat/rich-composer/composer-controls.d.ts +5 -1
  61. package/dist/chat/rich-composer/composer-controls.js +4 -4
  62. package/dist/chat/rich-composer/composer-keys.js +2 -2
  63. package/dist/chat/rich-composer/draft-collab.d.ts +91 -0
  64. package/dist/chat/rich-composer/draft-collab.js +310 -0
  65. package/dist/chat/rich-composer/use-composer-editor.d.ts +2 -0
  66. package/dist/chat/rich-composer/use-draft-collab.d.ts +53 -0
  67. package/dist/chat/rich-composer/use-draft-collab.js +92 -0
  68. package/dist/chat/rich-composer/use-draft-mirror.d.ts +11 -0
  69. package/dist/chat/rich-composer/use-draft-mirror.js +38 -9
  70. package/dist/chat/sidebar/InboxList.js +1 -1
  71. package/dist/chat/sidebar/ProjectIcon.d.ts +6 -2
  72. package/dist/chat/sidebar/ProjectIcon.js +7 -3
  73. package/dist/chat/sidebar/SessionSidebar.d.ts +30 -1
  74. package/dist/chat/sidebar/SessionSidebar.js +79 -7
  75. package/dist/chat/sidebar/SidebarGroupHeader.d.ts +12 -4
  76. package/dist/chat/sidebar/SidebarGroupHeader.js +70 -28
  77. package/dist/chat/sidebar/index.d.ts +2 -2
  78. package/dist/chat/transcript/actions.d.ts +6 -0
  79. package/dist/chat/transcript/fold.d.ts +2 -1
  80. package/dist/chat/transcript/fold.js +26 -1
  81. package/dist/chat/transcript/index.js +3 -3
  82. package/dist/chat/transcript/notices.d.ts +5 -2
  83. package/dist/chat/transcript/notices.js +23 -3
  84. package/dist/chat/transcript/script-input.d.ts +1 -1
  85. package/dist/components/Avatar.d.ts +36 -0
  86. package/dist/components/Avatar.js +56 -0
  87. package/dist/components/AvatarStack.d.ts +58 -0
  88. package/dist/components/AvatarStack.js +187 -0
  89. package/dist/components/Tabs.d.ts +6 -1
  90. package/dist/components/Tabs.js +43 -39
  91. package/dist/core.css +19 -1
  92. package/dist/dist/{index-DPbpsCtl.d.ts → index-ChabiHpR.d.ts} +1 -1
  93. package/dist/dist/index.d.ts +1 -1
  94. package/dist/git/headless/environment.d.ts +15 -0
  95. package/dist/git/headless/environment.js +18 -1
  96. package/dist/git/headless/github.d.ts +11 -0
  97. package/dist/git/headless/github.js +15 -0
  98. package/dist/git/headless/host.d.ts +109 -0
  99. package/dist/git/headless/index.d.ts +5 -4
  100. package/dist/git/headless/index.js +4 -3
  101. package/dist/git/headless/labels.d.ts +16 -1
  102. package/dist/git/headless/labels.js +25 -1
  103. package/dist/git/testing/contract.d.ts +22 -4
  104. package/dist/git/testing/contract.js +173 -3
  105. package/dist/git/testing/index.d.ts +22 -1
  106. package/dist/git/testing/index.js +135 -1
  107. package/dist/index.d.ts +3 -1
  108. package/dist/index.js +3 -1
  109. package/dist/labels.d.ts +4 -0
  110. package/dist/labels.js +4 -0
  111. package/dist/onboarding/headless/labels.d.ts +4 -0
  112. package/dist/session/DraftPeopleStack.d.ts +24 -0
  113. package/dist/session/DraftPeopleStack.js +48 -0
  114. package/dist/session/NewProjectDialog.d.ts +28 -8
  115. package/dist/session/NewProjectDialog.js +225 -40
  116. package/dist/session/PersonCard.d.ts +29 -0
  117. package/dist/session/PersonCard.js +199 -0
  118. package/dist/session/ProjectArtifactsSection.d.ts +4 -1
  119. package/dist/session/ProjectArtifactsSection.js +149 -34
  120. package/dist/session/ProjectHome.d.ts +1 -1
  121. package/dist/session/ProjectHome.js +23 -4
  122. package/dist/session/ProjectName.d.ts +11 -6
  123. package/dist/session/ProjectName.js +27 -13
  124. package/dist/session/ProjectPeopleStack.d.ts +26 -0
  125. package/dist/session/ProjectPeopleStack.js +56 -0
  126. package/dist/session/ProjectPublishDialog.js +9 -3
  127. package/dist/session/ProjectSettingsDialog.d.ts +1 -1
  128. package/dist/session/ProjectSettingsDialog.js +171 -66
  129. package/dist/session/ProjectShareDialog.d.ts +1 -1
  130. package/dist/session/ProjectShareDialog.js +16 -6
  131. package/dist/session/ProjectToolsSection.js +88 -96
  132. package/dist/session/ProjectUsage.d.ts +4 -1
  133. package/dist/session/ProjectUsage.js +13 -4
  134. package/dist/session/SessionDetailsDialog.d.ts +5 -1
  135. package/dist/session/SessionDetailsDialog.js +67 -10
  136. package/dist/session/SessionPeopleStack.js +19 -37
  137. package/dist/session/SessionProjectPicker.d.ts +54 -0
  138. package/dist/session/SessionProjectPicker.js +175 -0
  139. package/dist/session/SessionProvider.d.ts +15 -1
  140. package/dist/session/SessionProvider.js +28 -6
  141. package/dist/session/UsageSection.d.ts +2 -4
  142. package/dist/session/UsageSection.js +57 -55
  143. package/dist/session/headless/draft-collab.d.ts +55 -0
  144. package/dist/session/headless/draft-collab.js +127 -0
  145. package/dist/session/headless/draft-room.d.ts +124 -0
  146. package/dist/session/headless/draft-room.js +340 -0
  147. package/dist/session/headless/drafts.d.ts +93 -0
  148. package/dist/session/headless/drafts.js +79 -0
  149. package/dist/session/headless/fixture-drafts.d.ts +54 -0
  150. package/dist/session/headless/fixture-drafts.js +286 -0
  151. package/dist/session/headless/fixture-host.d.ts +18 -2
  152. package/dist/session/headless/fixture-host.js +41 -7
  153. package/dist/session/headless/fixture-projects.d.ts +6 -4
  154. package/dist/session/headless/fixture-projects.js +25 -4
  155. package/dist/session/headless/host.d.ts +34 -6
  156. package/dist/session/headless/index.d.ts +6 -3
  157. package/dist/session/headless/index.js +6 -3
  158. package/dist/session/headless/labels.d.ts +47 -2
  159. package/dist/session/headless/labels.js +17 -1
  160. package/dist/session/headless/people.d.ts +27 -3
  161. package/dist/session/headless/people.js +38 -20
  162. package/dist/session/headless/project-artifact-labels.d.ts +7 -0
  163. package/dist/session/headless/project-artifact-labels.js +7 -0
  164. package/dist/session/headless/project-artifacts.d.ts +8 -0
  165. package/dist/session/headless/project-artifacts.js +15 -1
  166. package/dist/session/headless/project-labels.d.ts +25 -0
  167. package/dist/session/headless/project-labels.js +25 -0
  168. package/dist/session/headless/shared-with.d.ts +28 -0
  169. package/dist/session/headless/shared-with.js +51 -0
  170. package/dist/session/host-context.d.ts +11 -0
  171. package/dist/session/host-context.js +14 -0
  172. package/dist/session/index.d.ts +7 -3
  173. package/dist/session/index.js +6 -2
  174. package/dist/session/new-project-parts.d.ts +67 -0
  175. package/dist/session/new-project-parts.js +470 -0
  176. package/dist/session/project-artifact-parts.d.ts +2 -1
  177. package/dist/session/project-artifact-parts.js +5 -2
  178. package/dist/session/project-people.d.ts +14 -0
  179. package/dist/session/project-people.js +86 -0
  180. package/dist/session/share-people.d.ts +12 -0
  181. package/dist/session/share-people.js +1 -1
  182. package/dist/session/testing/contract.d.ts +6 -3
  183. package/dist/session/testing/contract.js +24 -3
  184. package/dist/session/testing/drafts.contract.d.ts +30 -0
  185. package/dist/session/testing/drafts.contract.js +126 -0
  186. package/dist/session/testing/index.d.ts +2 -1
  187. package/dist/session/testing/index.js +2 -1
  188. package/dist/session/use-home-projects.d.ts +11 -2
  189. package/dist/session/use-home-projects.js +142 -5
  190. package/dist/session/useDraftCollab.d.ts +24 -0
  191. package/dist/session/useDraftCollab.js +78 -0
  192. package/dist/settings/headless/search.d.ts +1 -1
  193. package/dist/settings/index.js +9 -9
  194. package/dist/settings/sections/index.js +1 -1
  195. package/dist/settings/sections/providers/CredentialSources.d.ts +5 -5
  196. package/dist/settings/sections/providers/CredentialSources.js +5 -22
  197. package/dist/settings/sections/providers/labels.d.ts +1 -9
  198. package/dist/settings/sections/providers/labels.js +1 -9
  199. package/dist/styles.css +20 -9
  200. package/package.json +4 -3
  201. package/src/styles/sidebar.css +2 -3
@@ -1,23 +1,38 @@
1
1
  import { answeredFirstOf } from "./answered-first.js";
2
- import { DEFAULT_COMPOSER_CHROME_LABELS } from "./composer/labels-chrome.js";
3
- import { DEFAULT_COMPOSER_LABELS } from "./composer/labels.js";
4
2
  import { commandRef, shortUrl, urlRefs } from "./badge-refs.js";
3
+ import { pairToolEvents } from "./transcript/pairing.js";
4
+ import { firstRowId, parseBashExitMeta } from "./transcript/rows.js";
5
+ import { collapseEvents, inheritRowIdentity, refusedSpawn, toolFailed } from "./transcript/collapse.js";
6
+ import { mergeLiveTail } from "./streams/merge.js";
7
+ import { mergePromptPreviews, missingPreviewData } from "./streams/prompt-previews.js";
8
+ import { defaultFrameScheduler } from "./streams/scheduler.js";
9
+ import { SessionStreamStore } from "./streams/store.js";
5
10
  import { LIVE_BLOCK_RUN_LINES, createChatBlockRuns } from "./block-runs.js";
11
+ import { DEFAULT_MODEL_PICKER_PREFS, MODEL_PICKER_STORAGE_KEY, createModelPickerPrefs, parseModelPickerPrefs } from "./composer/model-picker-prefs.js";
12
+ import { EMPTY_RUN_METER, createRunMeter } from "./composer/run-meter.js";
6
13
  import { beginChipWork, chipWorkBusy, resetChipWorkForTests, whenChipsSettle } from "./chip-settle.js";
7
14
  import { commandName, commandView, commitView, sessionForToken, sessionView, skillGroupView, skillName, skillView } from "./chip-views.js";
15
+ import { applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./sidebar/inbox-state.js";
16
+ import { comparePinnedMains, isPinnedProjectMain, isSidebarPinned, isUnlistedProjectMain, sidebarProjectMainOf } from "./sidebar/project-main.js";
8
17
  import { caretEffectivelyAtStart, composeSubmitText, decodeHistoryEntry, encodeHistoryDraft, exitsModeOnKey, modeForTypedChar, unsentDraft } from "./composer-modes.js";
18
+ import { createSessionStreams } from "./streams/session-streams.js";
9
19
  import { createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
10
- import { findCommand } from "./composer/commands.js";
11
- import { draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders, unavailablePlaceIssue } from "./draft-target.js";
20
+ import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, firstGrapheme, isProjectIcon, parseProjectIcons } from "./sidebar/project-icons.js";
21
+ import { draftFolderPath, draftLocalFolder, rankHostProjects, recentHostFolders, recentLocalFolders, unavailablePlaceIssue } from "./draft-target.js";
12
22
  import { chipForPath, classifyInlineCode, positionSuffix, resolveChipPath } from "./file-chip.js";
23
+ import { DEFAULT_COMPOSER_CHROME_LABELS } from "./composer/labels-chrome.js";
24
+ import { DEFAULT_COMPOSER_LABELS } from "./composer/labels.js";
13
25
  import { folderRoots, groupFolders } from "./folder-groups.js";
14
26
  import { hostReachable, hostStatusLabel } from "./hosts.js";
27
+ import { DEFAULT_CHAT_LABELS, secretExpiryWords } from "./labels.js";
28
+ import { CHUNK_THRESHOLD, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
29
+ import { findCommand } from "./composer/commands.js";
30
+ import { approvalNotificationDetail, notificationContent, questionNotificationDetail, shouldNotify } from "./notifications.js";
31
+ import { TOOL_OUTPUT_PAGE_SIZE, createToolOutputPager, sliceToolOutput, toolOutputPagerDone } from "./output-pager.js";
32
+ import { createPathResolver } from "./path-resolver.js";
33
+ import { promptOriginWire } from "./prompt-origin.js";
15
34
  import { authFailureDetails, createAuthFixes, isAuthFixed, planAuthCard } from "./transcript/auth-failure.js";
16
35
  import { batchTaskRuns, batchThinkingRuns, batchToolRuns, clusterByOwner } from "./transcript/batch.js";
17
- import { DEFAULT_CHAT_LABELS, secretExpiryWords } from "./labels.js";
18
- import { pairToolEvents } from "./transcript/pairing.js";
19
- import { firstRowId, parseBashExitMeta } from "./transcript/rows.js";
20
- import { collapseEvents, inheritRowIdentity, refusedSpawn, toolFailed } from "./transcript/collapse.js";
21
36
  import { exchangesMedia, mediaRefsOf, mediumKey } from "./transcript/exchange-media.js";
22
37
  import { foldActionItems, toolAction } from "./transcript/fold-actions.js";
23
38
  import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, foldWorkerRows } from "./transcript/fold.js";
@@ -26,21 +41,6 @@ import { computeSelectStops, rowTurnIds, stopForRow } from "./transcript/select-
26
41
  import { EMPTY_RAIL, computeRailModel, computeRailModelParts, createTranscriptRailStore, dataRowSelector, plainPreview, railWithOutline, sameRail } from "./transcript/rail.js";
27
42
  import { failureTooltip, markRunFailures } from "./transcript/run-failures.js";
28
43
  import { groupSessionEvents, latestPerConversation } from "./transcript/session-groups.js";
29
- import { CHUNK_THRESHOLD, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
30
- import { mergeLiveTail } from "./streams/merge.js";
31
- import { mergePromptPreviews, missingPreviewData } from "./streams/prompt-previews.js";
32
- import { defaultFrameScheduler } from "./streams/scheduler.js";
33
- import { SessionStreamStore } from "./streams/store.js";
34
- import { approvalNotificationDetail, notificationContent, questionNotificationDetail, shouldNotify } from "./notifications.js";
35
- import { DEFAULT_MODEL_PICKER_PREFS, MODEL_PICKER_STORAGE_KEY, createModelPickerPrefs, parseModelPickerPrefs } from "./composer/model-picker-prefs.js";
36
- import { EMPTY_RUN_METER, createRunMeter } from "./composer/run-meter.js";
37
- import { TOOL_OUTPUT_PAGE_SIZE, createToolOutputPager, sliceToolOutput, toolOutputPagerDone } from "./output-pager.js";
38
- import { applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./sidebar/inbox-state.js";
39
- import { comparePinnedMains, isPinnedProjectMain, isSidebarPinned, isUnlistedProjectMain, sidebarProjectMainOf } from "./sidebar/project-main.js";
40
- import { createPathResolver } from "./path-resolver.js";
41
- import { createSessionStreams } from "./streams/session-streams.js";
42
- import { promptOriginWire } from "./prompt-origin.js";
43
- import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, firstGrapheme, isProjectIcon, parseProjectIcons } from "./sidebar/project-icons.js";
44
44
  import { REFERENCES_STORAGE_KEY, createReferenceStore } from "./reference-store.js";
45
45
  import { createRunEstimates, pickRunEstimate } from "./sidebar/estimates.js";
46
46
  import { createSessionStreamActions } from "./streams/actions.js";
@@ -53,29 +53,29 @@ import { MAX_EXTENSION_COMPOSER_BADGES, conversationBadges, resolveBadgePanel }
53
53
  import { DEFAULT_SIDEBAR_LABELS } from "./sidebar/labels.js";
54
54
  import { secretTimeLeft, secretTimeLeftIso } from "./secrets.js";
55
55
  import { NO_PROVIDER_ERROR, newSessionRequest, promptAttachments, promptRefs, sendPrompt, shellCommandOf, wireOriginal } from "./send-flow.js";
56
- import { defaultModelPatch, effortPickerTarget, rememberedDefaultModel } from "./composer/new-session-defaults.js";
56
+ import { defaultModelPatch, effortPickerTarget, rememberedDefaultModel, runnableDefaultModel } from "./composer/new-session-defaults.js";
57
57
  import { PROJECT_GROUP_CAP, RELATIVE_TIME_DATE_AFTER_DAYS, buildSessionRows, compareSessions, dateBucket, filterSessions, formatElapsedShort, relativeTime } from "./session-list.js";
58
58
  import { wireAttachmentsToChat } from "./composer/draft-sync.js";
59
59
  import { createSiteIcons, siteOrigin } from "./site-icons.js";
60
- import { deleteSessionPrompt, environmentKindLabel, environmentLabel, environmentSummaryText, runsInRemoteSandbox } from "./sidebar/environment.js";
61
- import { pinSession, pinnedSessions } from "./sidebar/pinned-sessions.js";
62
- import { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectGroupPath, projectIdOfGroup, projectPathOf, repoGroups, sidebarGroupPathOf, sidebarProjectIndex } from "./sidebar/rows.js";
63
60
  import { activityLabel, createSessionActivity, reduceActivity } from "./sidebar/activity.js";
64
61
  import { createSessionBadges } from "./sidebar/badges.js";
65
62
  import { createCompactionProgress, reduceCompaction } from "./sidebar/compaction.js";
66
63
  import { createNotificationStore } from "./sidebar/notifications.js";
67
64
  import { VIEW_CHOICE } from "./sidebar/types.js";
68
65
  import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, claimChildSessions, clearedViewFilters, createDecorator, extensionSpaceOf, filterQueryOf, filtersForSpace, itemsForSpace, mergeSidebarSpaces, nextSavedViewName, resolveGrouping, resolveSort, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn } from "./sidebar/query.js";
66
+ import { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectGroupPath, projectIdOfGroup, projectPathOf, repoGroups, sidebarGroupPathOf, sidebarProjectIndex } from "./sidebar/rows.js";
69
67
  import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, createSidebarViews, defaultSidebarLayout, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, readSidebarViews, resolveSidebarView, sidebarLayoutOf, sidebarViewDefaults } from "./sidebar/view.js";
70
68
  import { availableProjectsOf, createSessionDirectory, filterDirectorySessions, projectKeyOf, sessionRefsOf } from "./sidebar/directory.js";
71
69
  import { deriveDotState } from "./sidebar/dot-state.js";
70
+ import { deleteSessionPrompt, environmentKindLabel, environmentLabel, environmentSummaryText, runsInRemoteSandbox } from "./sidebar/environment.js";
72
71
  import { SESSION_HISTORY_LIMIT, createSessionHistory, parseSessionHistory } from "./sidebar/history.js";
73
72
  import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderIdOf, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./sidebar/inbox.js";
74
73
  import { PINNED_PROJECTS_KEY, parsePinnedProjects, withPinnedProject } from "./sidebar/pinned-projects.js";
74
+ import { pinSession, pinnedSessions } from "./sidebar/pinned-sessions.js";
75
75
  import { sessionRowChanges } from "./sidebar/row-changes.js";
76
76
  import { SMOOTH_TICK_MS, drainBucket, safeSurrogateSlice, tickBucket } from "./smooth-stream.js";
77
+ import { constant, useReadable, writable } from "./store.js";
77
78
  import { createComposerLists } from "./composer/composer-sources.js";
78
79
  import { UNDECIDED_NEW_CHAT_DRAFT_KEY, createDraftBook, createWebStorageDraftStorage, draftBookOf, newChatDraftKey } from "./composer/draft-book.js";
79
- import { constant, useReadable, writable } from "./store.js";
80
80
  import { promptDraftOf } from "./turn-prompt.js";
81
- export { AGENT_GROUPING, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, EMPTY_RAIL, EMPTY_RUN_METER, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, LIVE_BLOCK_RUN_LINES, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SessionStreamStore, TOOL_OUTPUT_PAGE_SIZE, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, activityLabel, answeredFirstOf, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, comparePinnedMains, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeRailModelParts, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createToolOutputPager, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, folderRoots, formatElapsedShort, formatSessionCostLabel, groupFolders, groupSessionEvents, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderIdOf, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isPinnedProjectMain, isProjectIcon, isProjectMember, isSettled, isSidebarPinned, isSnoozed, isUnlistedProjectMain, itemRows, itemsForSpace, lastModelChainOf, latestPerConversation, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectGroupPath, projectIdOfGroup, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, railWithOutline, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionRowChanges, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarGroupPathOf, sidebarLayoutOf, sidebarProjectIndex, sidebarProjectMainOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, sliceToolOutput, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, toolOutputPagerDone, unavailablePlaceIssue, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
81
+ export { AGENT_GROUPING, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, EMPTY_RAIL, EMPTY_RUN_METER, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, LIVE_BLOCK_RUN_LINES, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SessionStreamStore, TOOL_OUTPUT_PAGE_SIZE, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, activityLabel, answeredFirstOf, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, comparePinnedMains, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeRailModelParts, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createToolOutputPager, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, folderRoots, formatElapsedShort, formatSessionCostLabel, groupFolders, groupSessionEvents, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderIdOf, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isPinnedProjectMain, isProjectIcon, isProjectMember, isSettled, isSidebarPinned, isSnoozed, isUnlistedProjectMain, itemRows, itemsForSpace, lastModelChainOf, latestPerConversation, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectGroupPath, projectIdOfGroup, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, railWithOutline, rankHostProjects, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runnableDefaultModel, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionRowChanges, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarGroupPathOf, sidebarLayoutOf, sidebarProjectIndex, sidebarProjectMainOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, sliceToolOutput, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, toolOutputPagerDone, unavailablePlaceIssue, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
@@ -653,6 +653,10 @@ export declare const DEFAULT_CHAT_LABELS: {
653
653
  noticeShowLess: string;
654
654
  showMoreCount: (count: number) => string;
655
655
  showFewer: string;
656
+ avatarMore: (count: number) => string;
657
+ avatarMoreLabel: (count: number) => string;
658
+ avatarOnline: (name: string) => string;
659
+ avatarUnnamed: string;
656
660
  help: string;
657
661
  helpAbout: (what: string) => string;
658
662
  toastRegion: string;
@@ -82,6 +82,8 @@ export interface SendDraft {
82
82
  };
83
83
  /** The server's folder (`null`: its first root). */
84
84
  remoteFolder: string | null;
85
+ /** The server's project the draft is filed in (`null`: its folder's). Absent: none. */
86
+ remoteProject?: string | null;
85
87
  /** The environment kinds the draft can pick. */
86
88
  environmentChoices: readonly EnvironmentDescriptor[];
87
89
  /** The draft's environment pick (`null`: the default). */
@@ -139,7 +139,8 @@ function newSessionRequest(draft, text, defaults, machineCwd = null) {
139
139
  effort: knobs.effort,
140
140
  modelOptions: knobs.options
141
141
  } : {},
142
- ...environment ? { environment } : {}
142
+ ...environment ? { environment } : {},
143
+ ...server && machineCwd === null && draft.remoteProject ? { projectId: draft.remoteProject } : {}
143
144
  };
144
145
  }
145
146
  const errorText = (err) => err?.message ?? String(err);
@@ -705,6 +705,10 @@ export declare function dateBucket(at: number, now: number, labels?: {
705
705
  noticeShowLess: string;
706
706
  showMoreCount: (count: number) => string;
707
707
  showFewer: string;
708
+ avatarMore: (count: number) => string;
709
+ avatarMoreLabel: (count: number) => string;
710
+ avatarOnline: (name: string) => string;
711
+ avatarUnnamed: string;
708
712
  help: string;
709
713
  helpAbout: (what: string) => string;
710
714
  toastRegion: string;
@@ -17,7 +17,7 @@ import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, ProjectIcon, Pr
17
17
  import { comparePinnedMains, isPinnedProjectMain, isSidebarPinned, isUnlistedProjectMain, sidebarProjectMainOf } from "./project-main.js";
18
18
  import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, SidebarContributionStores, SidebarContributions, SidebarGrouping, SidebarItemEntry, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSpace, claimChildSessions, clearedViewFilters, createDecorator, extensionSpaceOf, filterQueryOf, filtersForSpace, itemsForSpace, mergeSidebarSpaces, nextSavedViewName, resolveGrouping, resolveSort, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn } from "./query.js";
19
19
  import { SessionRowSignal, sessionRowChanges } from "./row-changes.js";
20
- import { BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, SidebarListRow, SidebarNode, SidebarProjectGroup, SidebarProjectIndex, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectGroupPath, projectIdOfGroup, projectPathOf, repoGroups, sidebarGroupPathOf, sidebarProjectIndex } from "./rows.js";
20
+ import { BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, SidebarListRow, SidebarNode, SidebarProjectGroup, SidebarProjectIndex, SidebarServerProjectGroups, SidebarServerProjectIndex, SidebarServerProjectRef, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectGroupPath, projectIdOfGroup, projectPathOf, repoGroups, sidebarGroupPathOf, sidebarProjectIndex } from "./rows.js";
21
21
  import { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarInboxGroupBy, SidebarLayout, SidebarListSession, SidebarOrigin, SidebarProjectMain, SidebarSortBy, SidebarView, VIEW_CHOICE } from "./types.js";
22
22
  import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SidebarLastSessions, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, createSidebarViews, defaultSidebarLayout, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, readSidebarViews, resolveSidebarView, sidebarLayoutOf, sidebarViewDefaults } from "./view.js";
23
- export { AGENT_GROUPING, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, COMMON_EMOJI, CompactionProgress, CompactionProgressStore, CompactionSignal, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DirectoryServer, DirectorySettings, DotStateInput, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionNotification, SessionNotificationStore, SessionRef, SessionRemoval, SessionRowChange, type SessionRowSignal, SessionWindowMode, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarProjectGroup, SidebarProjectIndex, SidebarProjectMain, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, VIEW_CHOICE, activityLabel, applyInboxPatch, availableProjectsOf, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, compareInboxSection, comparePinnedMains, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, inboxDockStart, inboxEarlierAfterMs, inboxFolderIdOf, inboxFolderOf, inboxSectionOf, inboxSessionOrder, isPinnedProjectMain, isProjectIcon, isProjectMember, isSettled, isSidebarPinned, isSnoozed, isUnlistedProjectMain, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextInboxChangeAt, nextSavedViewName, nextWakeAt, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectGroupPath, projectIdOfGroup, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sessionRowChanges, sidebarContributionsOf, sidebarGroupPathOf, sidebarLayoutOf, sidebarProjectIndex, sidebarProjectMainOf, sidebarViewDefaults, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
23
+ export { AGENT_GROUPING, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, COMMON_EMOJI, CompactionProgress, CompactionProgressStore, CompactionSignal, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DirectoryServer, DirectorySettings, DotStateInput, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionNotification, SessionNotificationStore, SessionRef, SessionRemoval, SessionRowChange, type SessionRowSignal, SessionWindowMode, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarProjectGroup, SidebarProjectIndex, SidebarProjectMain, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarServerProjectGroups, SidebarServerProjectIndex, SidebarServerProjectRef, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, VIEW_CHOICE, activityLabel, applyInboxPatch, availableProjectsOf, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSidebarRows, claimChildSessions, clearedViewFilters, compareInboxSection, comparePinnedMains, createCompactionProgress, createDecorator, createNotificationStore, createRunEstimates, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSidebarViews, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, environmentKindLabel, environmentLabel, environmentSummaryText, extensionSpaceOf, filterDirectorySessions, filterQueryOf, filtersForSpace, firstGrapheme, groupsByFolder, inboxDockStart, inboxEarlierAfterMs, inboxFolderIdOf, inboxFolderOf, inboxSectionOf, inboxSessionOrder, isPinnedProjectMain, isProjectIcon, isProjectMember, isSettled, isSidebarPinned, isSnoozed, isUnlistedProjectMain, itemRows, itemsForSpace, mergeSidebarSpaces, nestSidebarRows, nextInboxChangeAt, nextSavedViewName, nextWakeAt, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, projectGroupPath, projectIdOfGroup, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sessionRowChanges, sidebarContributionsOf, sidebarGroupPathOf, sidebarLayoutOf, sidebarProjectIndex, sidebarProjectMainOf, sidebarViewDefaults, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
@@ -1,6 +1,6 @@
1
1
  import { u as AuthFailure } from "../../../dist/timeout-NoG7ppkm.js";
2
2
  import "../../../dist/index.js";
3
- import { PV as McpJobView, UN as SecretTtl, XB as TaskOutcomeCounts, YB as TaskOutcome } from "../../../dist/index-DPbpsCtl.js";
3
+ import { GN as SecretTtl, LV as McpJobView, QB as TaskOutcomeCounts, ZB as TaskOutcome } from "../../../dist/index-ChabiHpR.js";
4
4
  import { SecretTimeLeft } from "../secrets.js";
5
5
  import "../index.js";
6
6
  /** The default English strings of the session sidebar, merged over the chat layer's. */
@@ -21,6 +21,8 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
21
21
  customEmoji: string;
22
22
  chooseImage: string;
23
23
  resetToFolder: string;
24
+ /** The reset row of a server's project, whose default icon is a cloud. */
25
+ resetToCloud: string;
24
26
  searchSessionsLabel: string;
25
27
  clearSearch: string;
26
28
  spaces: string;
@@ -103,6 +105,8 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
103
105
  deleteSessionQuestion: (title: string) => string;
104
106
  deleteSessionSandbox: (kind: string) => string;
105
107
  deleteConfirmLabel: string;
108
+ /** Under the question of a delete that has no Undo (the session details). */
109
+ deleteSessionCannotUndo: string;
106
110
  /** A deleted conversation's notice, with Undo for a few seconds. */
107
111
  sessionDeletedNotice: (title: string) => string;
108
112
  /** Takes back a delete. */
@@ -770,6 +774,10 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
770
774
  noticeShowLess: string;
771
775
  showMoreCount: (count: number) => string;
772
776
  showFewer: string;
777
+ avatarMore: (count: number) => string;
778
+ avatarMoreLabel: (count: number) => string;
779
+ avatarOnline: (name: string) => string;
780
+ avatarUnnamed: string;
773
781
  help: string;
774
782
  helpAbout: (what: string) => string;
775
783
  toastRegion: string;
@@ -24,6 +24,8 @@ const DEFAULT_SIDEBAR_LABELS = {
24
24
  customEmoji: "Custom emoji",
25
25
  chooseImage: "Choose image…",
26
26
  resetToFolder: "Reset to folder",
27
+ /** The reset row of a server's project, whose default icon is a cloud. */
28
+ resetToCloud: "Reset to cloud",
27
29
  searchSessionsLabel: "Search sessions by title and content",
28
30
  clearSearch: "Clear search",
29
31
  spaces: "Spaces",
@@ -112,6 +114,8 @@ const DEFAULT_SIDEBAR_LABELS = {
112
114
  deleteSessionQuestion: (title) => `Delete "${title}"?`,
113
115
  deleteSessionSandbox: (kind) => `Its ${kind} sandbox is deleted too. Push anything you want to keep first.`,
114
116
  deleteConfirmLabel: "Delete",
117
+ /** Under the question of a delete that has no Undo (the session details). */
118
+ deleteSessionCannotUndo: "You cannot undo this.",
115
119
  /** A deleted conversation's notice, with Undo for a few seconds. */
116
120
  sessionDeletedNotice: (title) => title ? `Deleted “${title}”` : "Deleted the conversation",
117
121
  /** Takes back a delete. */
@@ -39,6 +39,31 @@ export interface SidebarProjectGroup {
39
39
  /** The sessions filed in it (`projects.sessions`): they group under it, whatever their folder. */
40
40
  sessions?: readonly string[];
41
41
  }
42
+ /** A server's projects, once read (`sidebarProjectIndex`). */
43
+ export interface SidebarServerProjectGroups {
44
+ /** The server. */
45
+ hostId: string;
46
+ /** Its projects, with the sessions filed in each (the ids the list knows them by). */
47
+ projects: readonly SidebarProjectGroup[];
48
+ }
49
+ /** One server's projects, by what the grouping asks of them. */
50
+ export interface SidebarServerProjectIndex {
51
+ /** The project each filed session is in, by session id. */
52
+ filed: ReadonlyMap<string, SidebarProjectGroup>;
53
+ /** Each project with a home, by that folder on the server. */
54
+ homes: ReadonlyMap<string, SidebarProjectGroup>;
55
+ /** Each project by its id. */
56
+ byId: ReadonlyMap<string, SidebarProjectGroup>;
57
+ }
58
+ /** A project on a server, as its group's header names it. */
59
+ export interface SidebarServerProjectRef {
60
+ /** The server. */
61
+ hostId: string;
62
+ /** The project's id on that server. */
63
+ projectId: string;
64
+ /** Its home folder on the server. Absent: a project with no folder. */
65
+ home?: string;
66
+ }
42
67
  /** The projects of this host, by what the grouping asks of them (`sidebarProjectIndex`). */
43
68
  export interface SidebarProjectIndex {
44
69
  /** The project each filed session is in, by session id. */
@@ -47,21 +72,30 @@ export interface SidebarProjectIndex {
47
72
  folderless: readonly SidebarProjectGroup[];
48
73
  /** Each project with no folder by its group key. */
49
74
  byGroup: ReadonlyMap<string, SidebarProjectGroup>;
75
+ /** Each project by its id: a session whose row names its project (`projectId`) groups under it. */
76
+ byId?: ReadonlyMap<string, SidebarProjectGroup>;
77
+ /**
78
+ * The servers whose projects are read, by id: a session of one is listed under its project (filed in it, or in its
79
+ * home), else in Chats, never under a folder of its own. A server not here lists its sessions by folder.
80
+ */
81
+ servers?: ReadonlyMap<string, SidebarServerProjectIndex>;
50
82
  }
51
83
  /**
52
84
  * The lookups the grouping reads, built once per list of projects.
53
85
  *
54
86
  * @param projects - The host's projects, with the sessions filed in each.
87
+ * @param servers - Each server whose projects are read, with the sessions filed in each.
55
88
  */
56
- export declare function sidebarProjectIndex(projects: readonly SidebarProjectGroup[]): SidebarProjectIndex;
89
+ export declare function sidebarProjectIndex(projects: readonly SidebarProjectGroup[], servers?: readonly SidebarServerProjectGroups[]): SidebarProjectIndex;
57
90
  /**
58
- * The group a session of this host is listed under: the project it is filed in first (its home, or the project's
59
- * own group when it has no folder), else its folder (`projectPathOf`, `''`: Chats). A server's session keeps its folder.
91
+ * The group a session of this host is listed under: the project its row names (`projectId`; `null`: Chats, even in a
92
+ * project's home) or it is filed in first (its home, or the project's own group when it has no folder), else its folder
93
+ * (`projectPathOf`, `''`: Chats). A server's session keeps its folder.
60
94
  *
61
95
  * @param session - The session.
62
96
  * @param projects - This host's projects (`sidebarProjectIndex`). Absent: its folder.
63
97
  */
64
- export declare function sidebarGroupPathOf(session: Pick<SidebarListSession, 'id' | 'projectRoot' | 'cwd' | 'hostId'>, projects?: SidebarProjectIndex): string;
98
+ export declare function sidebarGroupPathOf(session: Pick<SidebarListSession, 'id' | 'projectRoot' | 'cwd' | 'hostId' | 'projectId'>, projects?: SidebarProjectIndex): string;
65
99
  /** One row of the sidebar: a session-list row (a header may name its host) or a host's section header. */
66
100
  export type SidebarListRow<S extends SidebarListSession = SidebarListSession> = Extract<SessionListRow<S>, {
67
101
  kind: 'showMore';
@@ -84,18 +118,22 @@ export type SidebarListRow<S extends SidebarListSession = SidebarListSession> =
84
118
  childCount: number;
85
119
  } |
86
120
  /**
87
- * A group header; a server's folder names its server (`hostId`), shown as a chip. A project
121
+ * A group header; a server's folder names its server (`hostId`), shown as a chip, and the
122
+ * folder of one of that server's machines names the machine too (`machine`). A project
88
123
  * whose repository also has sessions on other machines names it (`repoKey`): those sessions
89
124
  * are listed under it. A project with no folder names it (`projectId`), its `fullPath` its
90
- * group key (`projectGroupPath`); `empty` while no session is filed in it.
125
+ * group key (`projectGroupPath`); `empty` while no session is filed in it. A server's project names it
126
+ * (`serverProject`), its server as `hostId` outside Per host.
91
127
  */
92
128
  (Extract<SessionListRow<S>, {
93
129
  kind: 'header';
94
130
  }> & {
95
131
  hostId?: string;
132
+ machine?: string;
96
133
  repoKey?: string;
97
134
  projectId?: string;
98
135
  empty?: boolean;
136
+ serverProject?: SidebarServerProjectRef;
99
137
  }) |
100
138
  /**
101
139
  * A host's section in the Per host view (This computer, then each saved
@@ -154,7 +192,10 @@ export declare function buildSidebarRows<S extends SidebarListSession>(sessions:
154
192
  * servers join it. A repository only on servers groups under its first
155
193
  * server folder, in key order. A repository with several local folders (two
156
194
  * clones) is left out: each folder keeps its own group, and so does each
157
- * server folder.
195
+ * server folder. A session of a server whose projects are read never makes a
196
+ * server folder's group or a local folder's: in a project it stays there,
197
+ * else it goes to Chats. Nor does a local session its row or its filing puts
198
+ * in a project or in Chats.
158
199
  *
159
200
  * @param sessions - The listed sessions.
160
201
  * @param projects - This computer's projects: a session filed in one groups under it, not under its repository.
@@ -1,7 +1,7 @@
1
1
  import { DEFAULT_CHAT_LABELS } from "../labels.js";
2
2
  import { buildSessionRows, compareSessions } from "../session-list.js";
3
3
  import { comparePinnedMains, isSidebarPinned } from "./project-main.js";
4
- import { groupRows } from "zidane/chat/pure";
4
+ import { groupRows, parseMachineKind } from "zidane/chat/pure";
5
5
  // src/chat/headless/sidebar/rows.ts
6
6
  /**
7
7
  * The project a session is listed under: its repository's root, else its folder (`''`: none).
@@ -29,13 +29,17 @@ function projectGroupPath(projectId) {
29
29
  function projectIdOfGroup(path) {
30
30
  return path?.startsWith(PROJECT_GROUP) ? path.slice(9) : null;
31
31
  }
32
+ const SERVER_PROJECT_GROUP = "server-project:";
33
+ const SERVER_PROJECT_SEP = "";
34
+ const serverProjectGroupPath = (hostId, projectId) => `${SERVER_PROJECT_GROUP}${hostId}${SERVER_PROJECT_SEP}${projectId}`;
32
35
  const trimSlashes = (path) => path.replace(/\/+$/, "") || "/";
33
36
  /**
34
37
  * The lookups the grouping reads, built once per list of projects.
35
38
  *
36
39
  * @param projects - The host's projects, with the sessions filed in each.
40
+ * @param servers - Each server whose projects are read, with the sessions filed in each.
37
41
  */
38
- function sidebarProjectIndex(projects) {
42
+ function sidebarProjectIndex(projects, servers = []) {
39
43
  const filed = /* @__PURE__ */ new Map();
40
44
  const folderless = [];
41
45
  const byGroup = /* @__PURE__ */ new Map();
@@ -46,21 +50,67 @@ function sidebarProjectIndex(projects) {
46
50
  byGroup.set(projectGroupPath(project.id), project);
47
51
  }
48
52
  }
53
+ const byId = new Map(projects.map((project) => [project.id, project]));
54
+ if (servers.length === 0) return {
55
+ filed,
56
+ folderless,
57
+ byGroup,
58
+ byId
59
+ };
49
60
  return {
50
61
  filed,
51
62
  folderless,
52
- byGroup
63
+ byGroup,
64
+ byId,
65
+ servers: new Map(servers.map((server) => [server.hostId, serverProjectIndex(server.projects)]))
53
66
  };
54
67
  }
68
+ function serverProjectIndex(projects) {
69
+ const filed = /* @__PURE__ */ new Map();
70
+ const homes = /* @__PURE__ */ new Map();
71
+ for (const project of projects) {
72
+ for (const id of project.sessions ?? []) filed.set(id, project);
73
+ if (project.home?.trim()) homes.set(trimSlashes(project.home.trim()), project);
74
+ }
75
+ return {
76
+ filed,
77
+ homes,
78
+ byId: new Map(projects.map((project) => [project.id, project]))
79
+ };
80
+ }
81
+ /**
82
+ * The group of a server's session once that server's projects are read: the project its row names (`projectId`; `null`:
83
+ * Chats), else the one it is filed in, else the one whose home holds its folder, else Chats (`''`). `undefined`: a
84
+ * session of this host, or of a server whose projects are not read (it lists by folder).
85
+ */
86
+ function serverGroupPathOf(session, projects) {
87
+ const server = session.hostId ? projects?.servers?.get(session.hostId) : void 0;
88
+ if (!server) return void 0;
89
+ if (session.projectId === null) return "";
90
+ const folder = projectPathOf(session);
91
+ const project = (session.projectId ? server.byId.get(session.projectId) : void 0) ?? server.filed.get(session.id) ?? (folder ? server.homes.get(trimSlashes(folder)) : void 0);
92
+ return project ? serverProjectGroupPath(session.hostId, project.id) : "";
93
+ }
94
+ /**
95
+ * The project a session of this host is in by its row (`projectId`) or its filing: `null` when its row files it in
96
+ * Chats, `undefined` when neither says (its folder decides).
97
+ */
98
+ function localProjectOf(session, projects) {
99
+ if (session.hostId || !projects) return void 0;
100
+ if (session.projectId === null) return null;
101
+ return (session.projectId ? projects.byId?.get(session.projectId) : void 0) ?? projects.filed.get(session.id);
102
+ }
55
103
  /**
56
- * The group a session of this host is listed under: the project it is filed in first (its home, or the project's
57
- * own group when it has no folder), else its folder (`projectPathOf`, `''`: Chats). A server's session keeps its folder.
104
+ * The group a session of this host is listed under: the project its row names (`projectId`; `null`: Chats, even in a
105
+ * project's home) or it is filed in first (its home, or the project's own group when it has no folder), else its folder
106
+ * (`projectPathOf`, `''`: Chats). A server's session keeps its folder.
58
107
  *
59
108
  * @param session - The session.
60
109
  * @param projects - This host's projects (`sidebarProjectIndex`). Absent: its folder.
61
110
  */
62
111
  function sidebarGroupPathOf(session, projects) {
63
- const project = !session.hostId ? projects?.filed.get(session.id) : void 0;
112
+ const project = localProjectOf(session, projects);
113
+ if (project === null) return "";
64
114
  if (project) return project.home?.trim() ? trimSlashes(project.home.trim()) : projectGroupPath(project.id);
65
115
  return projectPathOf(session);
66
116
  }
@@ -139,10 +189,18 @@ function withProjectGroups(rows, projects) {
139
189
  });
140
190
  }
141
191
  const HOST_SEP = "\0";
192
+ /** The machine a session runs on (its environment's `local@gpu`, `worktree@gpu`), when its row carries one. */
193
+ function machineOf(session) {
194
+ const kind = session.environment?.kind;
195
+ return typeof kind === "string" ? parseMachineKind(kind)?.name : void 0;
196
+ }
142
197
  function hostFolderKey(session, projects) {
198
+ const server = serverGroupPathOf(session, projects);
199
+ if (server !== void 0) return server;
143
200
  const path = sidebarGroupPathOf(session, projects);
144
201
  if (!session.hostId || !path) return path;
145
- return `${path.replace(/\/+$/, "") || "/"}${HOST_SEP}${session.hostId}`;
202
+ const machine = machineOf(session);
203
+ return `${path.replace(/\/+$/, "") || "/"}${HOST_SEP}${session.hostId}${machine ? `${HOST_SEP}${machine}` : ""}`;
146
204
  }
147
205
  /**
148
206
  * The group each repository's sessions share across machines, by `repoKey`. A
@@ -150,7 +208,10 @@ function hostFolderKey(session, projects) {
150
208
  * servers join it. A repository only on servers groups under its first
151
209
  * server folder, in key order. A repository with several local folders (two
152
210
  * clones) is left out: each folder keeps its own group, and so does each
153
- * server folder.
211
+ * server folder. A session of a server whose projects are read never makes a
212
+ * server folder's group or a local folder's: in a project it stays there,
213
+ * else it goes to Chats. Nor does a local session its row or its filing puts
214
+ * in a project or in Chats.
154
215
  *
155
216
  * @param sessions - The listed sessions.
156
217
  * @param projects - This computer's projects: a session filed in one groups under it, not under its repository.
@@ -158,9 +219,12 @@ function hostFolderKey(session, projects) {
158
219
  function repoGroups(sessions, projects) {
159
220
  const local = /* @__PURE__ */ new Map();
160
221
  const remote = /* @__PURE__ */ new Map();
222
+ const onServers = /* @__PURE__ */ new Set();
161
223
  for (const session of sessions) {
162
- if (!session.repoKey || !projectPathOf(session) || !session.hostId && projects?.filed.has(session.id)) continue;
224
+ if (!session.repoKey || !projectPathOf(session) || localProjectOf(session, projects) !== void 0) continue;
163
225
  if (session.hostId) {
226
+ if (serverGroupPathOf(session, projects) !== void 0) continue;
227
+ onServers.add(session.repoKey);
164
228
  const key = hostFolderKey(session);
165
229
  const first = remote.get(session.repoKey);
166
230
  if (first === void 0 || key < first) remote.set(session.repoKey, key);
@@ -171,10 +235,11 @@ function repoGroups(sessions, projects) {
171
235
  }
172
236
  }
173
237
  const groups = /* @__PURE__ */ new Map();
174
- for (const [repoKey, first] of remote) {
238
+ for (const repoKey of onServers) {
175
239
  const folders = local.get(repoKey);
176
- if (!folders) groups.set(repoKey, first);
177
- else if (folders.size === 1) groups.set(repoKey, [...folders][0]);
240
+ const first = remote.get(repoKey);
241
+ if (!folders && first !== void 0) groups.set(repoKey, first);
242
+ else if (folders?.size === 1) groups.set(repoKey, [...folders][0]);
178
243
  }
179
244
  return groups;
180
245
  }
@@ -190,16 +255,42 @@ function isProjectMember(session, project) {
190
255
  if (project.repoKey && session.hostId && session.repoKey === project.repoKey) return true;
191
256
  return (session.hostId ?? void 0) === project.hostId && projectPathOf(session) === project.path;
192
257
  }
193
- /** A server folder's header: the folder, its server as `hostId` (a chip), without the local folder affordances. */
258
+ /**
259
+ * A server folder's header: the folder, its server as `hostId` (a chip) and its machine, without the local
260
+ * folder affordances.
261
+ */
194
262
  function serverFolderHeader(row) {
195
263
  if (row.kind !== "header" || !row.fullPath?.includes(HOST_SEP)) return row;
196
264
  const { fullPath, isGitRepo: _isGitRepo, ...rest } = row;
197
- const hostId = fullPath.slice(fullPath.indexOf(HOST_SEP) + 1);
198
- const folder = row.label.replace(`${HOST_SEP}${hostId}`, "") || "/";
265
+ const suffix = fullPath.slice(fullPath.indexOf(HOST_SEP));
266
+ const [hostId = "", machine] = suffix.slice(1).split(HOST_SEP);
267
+ const folder = row.label.replace(suffix, "") || "/";
199
268
  return {
200
269
  ...rest,
201
270
  label: folder,
202
- hostId
271
+ hostId,
272
+ ...machine ? { machine } : {}
273
+ };
274
+ }
275
+ /** A server project's header: its name, its server as `hostId` (a chip) and the project, without a folder's path. */
276
+ function serverProjectHeader(row, projects) {
277
+ if (row.kind !== "header" || !row.fullPath?.startsWith(SERVER_PROJECT_GROUP)) return row;
278
+ const { fullPath, isGitRepo: _isGitRepo, ...rest } = row;
279
+ const key = fullPath.slice(16);
280
+ const at = key.indexOf(SERVER_PROJECT_SEP);
281
+ const hostId = key.slice(0, at);
282
+ const projectId = key.slice(at + 1);
283
+ const project = projects?.servers?.get(hostId)?.byId.get(projectId);
284
+ const home = project?.home?.trim();
285
+ return {
286
+ ...rest,
287
+ label: project?.name ?? projectId,
288
+ hostId,
289
+ serverProject: {
290
+ hostId,
291
+ projectId,
292
+ ...home ? { home } : {}
293
+ }
203
294
  };
204
295
  }
205
296
  /** A header whose group holds a repository's sessions from several machines names the repository. */
@@ -211,6 +302,11 @@ function withRepoKey(row, repoByGroup) {
211
302
  repoKey
212
303
  } : row;
213
304
  }
305
+ function withoutHost(row) {
306
+ if (row.kind !== "header" || row.hostId === void 0) return row;
307
+ const { hostId: _hostId, ...rest } = row;
308
+ return rest;
309
+ }
214
310
  function withoutLocalPath(row) {
215
311
  if (row.kind !== "header" || row.fullPath === void 0) return row;
216
312
  const { fullPath: _fullPath, isGitRepo: _isGitRepo, ...rest } = row;
@@ -237,9 +333,9 @@ function buildHostSidebarRows(sessions, hosts, groupBy, sortBy, options = {}) {
237
333
  const projects = groupBy === "project" ? options.projects : void 0;
238
334
  const groups = servers.size > 0 ? repoGroups(listed, projects) : /* @__PURE__ */ new Map();
239
335
  const repoByGroup = new Map([...groups].map(([repoKey, group]) => [group, repoKey]));
240
- const filed = (s) => !s.hostId && projects?.filed.has(s.id) === true;
336
+ const filed = (s) => localProjectOf(s, projects) !== void 0 || serverGroupPathOf(s, projects) !== void 0;
241
337
  const rows = buildSidebarRows(listed, groupBy, sortBy, options, (s) => !filed(s) && s.repoKey && groups.has(s.repoKey) ? groups.get(s.repoKey) : hostFolderKey(s, projects));
242
- return servers.size > 0 ? rows.map((row) => serverFolderHeader(withRepoKey(row, repoByGroup))) : rows;
338
+ return servers.size > 0 ? rows.map((row) => serverProjectHeader(serverFolderHeader(withRepoKey(row, repoByGroup)), projects)) : rows;
243
339
  }
244
340
  const local = sessions.filter((s) => !s.hostId);
245
341
  const collapsedGroups = options.collapsedGroups ?? EMPTY_SET;
@@ -264,11 +360,14 @@ function buildHostSidebarRows(sessions, hosts, groupBy, sortBy, options = {}) {
264
360
  });
265
361
  } else {
266
362
  const { pinnedProjects: _pinnedProjects, projects: _projects, ...rest } = options;
267
- const rows = buildSidebarRows(own, "project", sortBy, {
268
- ...host.kind === "local" ? options : rest,
363
+ const rows = host.kind === "local" ? buildSidebarRows(own, "project", sortBy, {
364
+ ...options,
269
365
  idPrefix: `${host.id}:`
270
- });
271
- out.push(...host.kind === "server" ? rows.map(withoutLocalPath) : rows);
366
+ }) : buildSidebarRows(own, "project", sortBy, {
367
+ ...rest,
368
+ idPrefix: `${host.id}:`
369
+ }, (s) => serverGroupPathOf(s, options.projects) ?? (machineOf(s) ? hostFolderKey(s) : sidebarGroupPathOf(s)));
370
+ out.push(...host.kind === "server" ? rows.map((row) => withoutHost(withoutLocalPath(serverFolderHeader(serverProjectHeader(row, options.projects))))) : rows);
272
371
  }
273
372
  }
274
373
  return out;
@@ -25,6 +25,11 @@ export interface SidebarListSession {
25
25
  cwd: string;
26
26
  /** The repository or project folder it belongs to, when known. */
27
27
  projectRoot?: string;
28
+ /**
29
+ * The project the host files it in (`SessionRow.projectId`): a project's id, `null` for Chats on purpose (even in a
30
+ * project's home). Absent: the host does not say, and the sidebar finds its project by filing and folder.
31
+ */
32
+ projectId?: string | null;
28
33
  /** The remote host it lives on; undefined on this machine. */
29
34
  hostId?: string;
30
35
  /** The space it belongs to; undefined in the default space. */