zidane-ui 9.5.0 → 9.5.2
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.
- package/dist/chat/SessionList.d.ts +1 -1
- package/dist/chat/SessionList.js +1 -1
- package/dist/chat/Transcript.js +6 -2
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/DraftPickers.d.ts +8 -2
- package/dist/chat/composer/DraftPickers.js +5 -3
- package/dist/chat/composer/ScopeToggle.d.ts +5 -2
- package/dist/chat/composer/ScopeToggle.js +3 -2
- package/dist/chat/composer/ServerScopeToggle.d.ts +5 -2
- package/dist/chat/composer/ServerScopeToggle.js +2 -1
- package/dist/chat/composer/use-draft-target.d.ts +7 -1
- package/dist/chat/composer/use-draft-target.js +19 -10
- package/dist/chat/headless/fixtures/demo-transcript-all-kinds.d.ts +6 -0
- package/dist/chat/headless/fixtures/demo-transcript-all-kinds.js +90 -2
- package/dist/chat/headless/index.d.ts +6 -5
- package/dist/chat/headless/index.js +6 -5
- package/dist/chat/headless/labels.d.ts +9 -0
- package/dist/chat/headless/labels.js +12 -3
- package/dist/chat/headless/session-list.d.ts +8 -0
- package/dist/chat/headless/session-list.js +7 -0
- package/dist/chat/headless/sidebar/inbox.d.ts +21 -5
- package/dist/chat/headless/sidebar/inbox.js +30 -12
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +7 -1
- package/dist/chat/headless/sidebar/labels.js +1 -1
- package/dist/chat/headless/sidebar/rows.d.ts +62 -5
- package/dist/chat/headless/sidebar/rows.js +93 -17
- package/dist/chat/headless/transcript/derive.d.ts +1 -0
- package/dist/chat/headless/transcript/derive.js +3 -1
- package/dist/chat/headless/transcript/fold.js +1 -0
- package/dist/chat/headless/transcript/index.d.ts +3 -2
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/rail.js +1 -0
- package/dist/chat/headless/transcript/rows.d.ts +26 -2
- package/dist/chat/headless/transcript/select-stops.js +1 -0
- package/dist/chat/headless/transcript/session-groups.d.ts +36 -0
- package/dist/chat/headless/transcript/session-groups.js +94 -0
- package/dist/chat/index.d.ts +4 -3
- package/dist/chat/index.js +7 -6
- package/dist/chat/sidebar/InboxList.d.ts +14 -1
- package/dist/chat/sidebar/InboxList.js +33 -13
- package/dist/chat/sidebar/SessionSidebar.d.ts +13 -5
- package/dist/chat/sidebar/SessionSidebar.js +54 -34
- package/dist/chat/sidebar/SidebarGroupHeader.d.ts +7 -2
- package/dist/chat/sidebar/SidebarGroupHeader.js +22 -6
- package/dist/chat/sidebar/useInboxRows.d.ts +4 -1
- package/dist/chat/sidebar/useInboxRows.js +6 -3
- package/dist/chat/sidebar/useInboxTriage.d.ts +3 -0
- package/dist/chat/sidebar/useInboxTriage.js +3 -2
- package/dist/chat/testing/index.d.ts +2 -2
- package/dist/chat/testing/index.js +2 -2
- package/dist/chat/transcript/BadgeMenu.d.ts +9 -2
- package/dist/chat/transcript/BadgeMenu.js +20 -2
- package/dist/chat/transcript/SubagentBlock.js +24 -7
- package/dist/chat/transcript/TranscriptRail.js +3 -3
- package/dist/chat/transcript/TranscriptRow.js +8 -0
- package/dist/chat/transcript/frame.d.ts +7 -0
- package/dist/chat/transcript/frame.js +51 -5
- package/dist/chat/transcript/index.d.ts +4 -3
- package/dist/chat/transcript/index.js +3 -2
- package/dist/chat/transcript/notices.d.ts +9 -9
- package/dist/chat/transcript/notices.js +78 -81
- package/dist/chat/transcript/receipt-parts.d.ts +29 -2
- package/dist/chat/transcript/receipt-parts.js +40 -7
- package/dist/chat/transcript/row-estimate.js +4 -1
- package/dist/chat/transcript/run-rows.js +2 -5
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/session-groups.d.ts +21 -0
- package/dist/chat/transcript/session-groups.js +154 -0
- package/dist/chat/transcript/session-line.d.ts +63 -0
- package/dist/chat/transcript/session-line.js +114 -0
- package/dist/dist/{index-Bsp5Ku7r.d.ts → index-DPbpsCtl.d.ts} +17 -17
- package/dist/dist/index.d.ts +1 -1
- package/dist/session/ProjectName.js +1 -1
- package/dist/session/SessionHeader.js +1 -1
- package/dist/session/headless/labels.d.ts +1 -1
- package/dist/session/use-home-projects.d.ts +10 -3
- package/dist/session/use-home-projects.js +40 -4
- package/dist/settings/headless/mcp-requirement.js +4 -3
- package/dist/settings/headless/mcp.d.ts +2 -0
- package/dist/settings/headless/mcp.js +3 -2
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.js +9 -9
- package/dist/settings/sections/index.js +1 -1
- package/dist/settings/sections/mcp/McpSection.js +3 -5
- package/dist/styles.css +43 -0
- package/package.json +2 -2
- package/src/styles/transcript.css +39 -0
|
@@ -96,6 +96,8 @@ export interface SessionListOptions<S> {
|
|
|
96
96
|
* above Chats) in this order, whatever their activity.
|
|
97
97
|
*/
|
|
98
98
|
pinnedProjects?: readonly string[];
|
|
99
|
+
/** Project grouping: folders listed as groups even with no session (after the others, unless pinned). */
|
|
100
|
+
projectGroups?: readonly string[];
|
|
99
101
|
/** Strings for group headings and date buckets. Missing keys fall back to the default chat labels. */
|
|
100
102
|
labels?: Pick<ChatLabels, 'today' | 'yesterday' | 'months' | 'chats' | 'favorites' | 'stateRunning' | 'stateCompleted' | 'stateError' | 'stateIdle'>;
|
|
101
103
|
/** Clock, for date buckets (tests pin it). */
|
|
@@ -154,6 +156,7 @@ export declare function dateBucket(at: number, now: number, labels?: {
|
|
|
154
156
|
newSessionIn: (label: string) => string;
|
|
155
157
|
newSession: string;
|
|
156
158
|
searchSessions: string;
|
|
159
|
+
searchSessionsName: string;
|
|
157
160
|
noSessions: string;
|
|
158
161
|
noMatches: (query: string) => string;
|
|
159
162
|
sessions: string;
|
|
@@ -210,6 +213,7 @@ export declare function dateBucket(at: number, now: number, labels?: {
|
|
|
210
213
|
receiptCost: string;
|
|
211
214
|
receiptTokens: (sent: string, received: string) => string;
|
|
212
215
|
receiptSpeed: string;
|
|
216
|
+
receiptFast: string;
|
|
213
217
|
stopped: string;
|
|
214
218
|
stoppedByYou: string;
|
|
215
219
|
stoppedByName: (name: string) => string;
|
|
@@ -253,6 +257,10 @@ export declare function dateBucket(at: number, now: number, labels?: {
|
|
|
253
257
|
authSignInFailed: string;
|
|
254
258
|
sessionEventLabel: (title: string, verb: string, needsAttention: boolean) => string;
|
|
255
259
|
clickToAnswer: string;
|
|
260
|
+
sessionUpdates: (updates: number, conversations: number) => string;
|
|
261
|
+
sessionUpdateCount: (count: number) => string;
|
|
262
|
+
sessionUpdatesNoProject: string;
|
|
263
|
+
sessionTurns: (count: number) => string;
|
|
256
264
|
openSession: string;
|
|
257
265
|
commandDetail: string;
|
|
258
266
|
spawnTask: string;
|
|
@@ -207,6 +207,13 @@ function buildSessionRows(sessions, options = {}) {
|
|
|
207
207
|
if (groupBy === "project" && bucket !== CHATS && options.isGitRepo?.(session)) gitRepos.add(bucket);
|
|
208
208
|
groups.get(bucket).push(session);
|
|
209
209
|
}
|
|
210
|
+
if (groupBy === "project") for (const path of options.projectGroups ?? []) {
|
|
211
|
+
const bucket = path.replace(/\/+$/, "") || "/";
|
|
212
|
+
if (!groups.has(bucket)) {
|
|
213
|
+
groups.set(bucket, []);
|
|
214
|
+
order.push(bucket);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
210
217
|
const pinned = /* @__PURE__ */ new Set();
|
|
211
218
|
if (groupBy === "project") {
|
|
212
219
|
if (order.indexOf(CHATS) > 0) {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* session that runs stays pinned. A folded shelf still shows the open session, so the
|
|
19
19
|
* conversation on screen never vanishes from the list.
|
|
20
20
|
*/
|
|
21
|
+
import { SidebarProjectIndex } from "./rows.js";
|
|
21
22
|
import { SidebarInboxGroupBy, SidebarListSession } from "./types.js";
|
|
22
23
|
/** The shelves at the bottom of the inbox. */
|
|
23
24
|
export type InboxShelfId = 'working' | 'snoozed' | 'earlier' | 'settled' | 'archived';
|
|
@@ -50,7 +51,12 @@ export type InboxRow<S extends SidebarListSession = SidebarListSession> = {
|
|
|
50
51
|
session: S;
|
|
51
52
|
section: InboxSection;
|
|
52
53
|
folder?: string;
|
|
53
|
-
} |
|
|
54
|
+
} |
|
|
55
|
+
/**
|
|
56
|
+
* A project folder. `chats`: the sessions with no folder and no project (`path` `''`). `projectId`: a project with
|
|
57
|
+
* no folder, `path` its group key (`projectGroupPath`), listed with no session too.
|
|
58
|
+
*/
|
|
59
|
+
{
|
|
54
60
|
kind: 'folder';
|
|
55
61
|
id: string;
|
|
56
62
|
label: string;
|
|
@@ -60,6 +66,8 @@ export type InboxRow<S extends SidebarListSession = SidebarListSession> = {
|
|
|
60
66
|
count: number;
|
|
61
67
|
collapsed: boolean;
|
|
62
68
|
urgency: InboxUrgency | null;
|
|
69
|
+
chats?: true;
|
|
70
|
+
projectId?: string;
|
|
63
71
|
} | {
|
|
64
72
|
kind: 'shelf';
|
|
65
73
|
id: InboxShelfId;
|
|
@@ -97,6 +105,11 @@ export interface InboxRowsOptions {
|
|
|
97
105
|
* two runs (a queued message going out, a run resuming) does not send a row to Active and straight back.
|
|
98
106
|
*/
|
|
99
107
|
holdRunning?: ReadonlySet<string>;
|
|
108
|
+
/**
|
|
109
|
+
* This computer's projects (`sidebarProjectIndex`), grouped by project: a session filed in one sits in its folder
|
|
110
|
+
* whatever its own, and each project with no folder has a folder, after the others, with no session too.
|
|
111
|
+
*/
|
|
112
|
+
projects?: SidebarProjectIndex;
|
|
100
113
|
}
|
|
101
114
|
/** How long a session whose run ended stays on the Working shelf, in ms: longer than the gap between two runs. */
|
|
102
115
|
export declare const INBOX_RUN_HOLD_MS = 1500;
|
|
@@ -121,18 +134,21 @@ export declare function inboxSectionOf(session: SidebarListSession, now: number,
|
|
|
121
134
|
*/
|
|
122
135
|
export declare function compareInboxSection(section: InboxSection, a: SidebarListSession, b: SidebarListSession, needsYou?: ReadonlySet<string>): number;
|
|
123
136
|
/**
|
|
124
|
-
* The folder a session sits in: its project, else its folder.
|
|
137
|
+
* The folder a session sits in: the project it is filed in, else its project root, else its working folder. `''`:
|
|
138
|
+
* none (Chats), never `/`.
|
|
125
139
|
*
|
|
126
140
|
* @param session - The session.
|
|
127
|
-
* @
|
|
141
|
+
* @param projects - This computer's projects (`sidebarProjectIndex`).
|
|
142
|
+
* @returns Its group's path.
|
|
128
143
|
*/
|
|
129
|
-
export declare function inboxFolderOf(session: SidebarListSession): string;
|
|
144
|
+
export declare function inboxFolderOf(session: SidebarListSession, projects?: SidebarProjectIndex): string;
|
|
130
145
|
/**
|
|
131
146
|
* The id of the project folder a session sits in, when the inbox groups by project.
|
|
132
147
|
*
|
|
133
148
|
* @param session - The session.
|
|
149
|
+
* @param projects - This computer's projects (`sidebarProjectIndex`).
|
|
134
150
|
*/
|
|
135
|
-
export declare function inboxFolderIdOf(session: SidebarListSession): string;
|
|
151
|
+
export declare function inboxFolderIdOf(session: SidebarListSession, projects?: SidebarProjectIndex): string;
|
|
136
152
|
/**
|
|
137
153
|
* The inbox's rows, top to bottom: the list's (pinned, active), then the shelves' from the first
|
|
138
154
|
* `shelf` row on (the sidebar docks them). Empty shelves have no row.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { DEFAULT_CHAT_LABELS } from "../labels.js";
|
|
1
2
|
import { isSnoozed } from "./inbox-state.js";
|
|
2
3
|
import { comparePinnedMains, isPinnedProjectMain } from "./project-main.js";
|
|
4
|
+
import { projectGroupPath, sidebarGroupPathOf } from "./rows.js";
|
|
3
5
|
// src/chat/headless/sidebar/inbox.ts
|
|
4
6
|
/** The shelves in the order they stack. */
|
|
5
7
|
const INBOX_SHELVES = [
|
|
@@ -93,22 +95,28 @@ function compareInboxSection(section, a, b, needsYou = EMPTY) {
|
|
|
93
95
|
if (section === "active") return Number(needsYou.has(b.id)) - Number(needsYou.has(a.id)) || touchedAt(b) - touchedAt(a);
|
|
94
96
|
return SHELF_ORDER[section](a, b);
|
|
95
97
|
}
|
|
98
|
+
/** A folder's id in the inbox: its path, or Chats' for none. */
|
|
99
|
+
const inboxFolderIdAt = (path) => path ? `inbox-folder:${path}` : "inbox-folder:chats";
|
|
96
100
|
/**
|
|
97
|
-
* The folder a session sits in: its project, else its folder.
|
|
101
|
+
* The folder a session sits in: the project it is filed in, else its project root, else its working folder. `''`:
|
|
102
|
+
* none (Chats), never `/`.
|
|
98
103
|
*
|
|
99
104
|
* @param session - The session.
|
|
100
|
-
* @
|
|
105
|
+
* @param projects - This computer's projects (`sidebarProjectIndex`).
|
|
106
|
+
* @returns Its group's path.
|
|
101
107
|
*/
|
|
102
|
-
function inboxFolderOf(session) {
|
|
103
|
-
|
|
108
|
+
function inboxFolderOf(session, projects) {
|
|
109
|
+
const path = sidebarGroupPathOf(session, projects);
|
|
110
|
+
return path ? path.replace(/\/+$/, "") || "/" : "";
|
|
104
111
|
}
|
|
105
112
|
/**
|
|
106
113
|
* The id of the project folder a session sits in, when the inbox groups by project.
|
|
107
114
|
*
|
|
108
115
|
* @param session - The session.
|
|
116
|
+
* @param projects - This computer's projects (`sidebarProjectIndex`).
|
|
109
117
|
*/
|
|
110
|
-
function inboxFolderIdOf(session) {
|
|
111
|
-
return
|
|
118
|
+
function inboxFolderIdOf(session, projects) {
|
|
119
|
+
return inboxFolderIdAt(inboxFolderOf(session, projects));
|
|
112
120
|
}
|
|
113
121
|
/**
|
|
114
122
|
* The inbox's rows, top to bottom: the list's (pinned, active), then the shelves' from the first
|
|
@@ -142,7 +150,7 @@ function buildInboxRows(sessions, options) {
|
|
|
142
150
|
if (groupBy === "project") {
|
|
143
151
|
const folders = /* @__PURE__ */ new Map();
|
|
144
152
|
for (const section of ["pinned", "active"]) for (const s of by[section]) {
|
|
145
|
-
const path = inboxFolderOf(s);
|
|
153
|
+
const path = inboxFolderOf(s, options.projects);
|
|
146
154
|
const folder = folders.get(path) ?? {
|
|
147
155
|
pinned: [],
|
|
148
156
|
active: []
|
|
@@ -150,22 +158,32 @@ function buildInboxRows(sessions, options) {
|
|
|
150
158
|
folder[section].push(s);
|
|
151
159
|
folders.set(path, folder);
|
|
152
160
|
}
|
|
161
|
+
for (const project of options.projects?.folderless ?? []) {
|
|
162
|
+
const path = projectGroupPath(project.id);
|
|
163
|
+
if (!folders.has(path)) folders.set(path, {
|
|
164
|
+
pinned: [],
|
|
165
|
+
active: []
|
|
166
|
+
});
|
|
167
|
+
}
|
|
153
168
|
for (const [path, { pinned, active }] of folders) {
|
|
154
|
-
const id =
|
|
169
|
+
const id = inboxFolderIdAt(path);
|
|
155
170
|
const collapsed = collapsedFolders.has(id);
|
|
156
171
|
const all = [...pinned, ...active];
|
|
157
172
|
const urgency = all.some((s) => s.status === "error") ? "failed" : all.some((s) => s.status === "running") ? "working" : null;
|
|
158
173
|
const first = all[0];
|
|
174
|
+
const project = options.projects?.byGroup.get(path);
|
|
159
175
|
out.push({
|
|
160
176
|
kind: "folder",
|
|
161
177
|
id,
|
|
162
|
-
label: path.split("/").pop() || path,
|
|
178
|
+
label: project ? project.name : path ? path.split("/").pop() || path : DEFAULT_CHAT_LABELS.chats,
|
|
163
179
|
path,
|
|
164
|
-
...first
|
|
165
|
-
isGitRepo: first
|
|
180
|
+
...first?.hostId && !project ? { hostId: first.hostId } : {},
|
|
181
|
+
isGitRepo: !project && first?.isGitRepo === true,
|
|
166
182
|
count: all.length,
|
|
167
183
|
collapsed,
|
|
168
|
-
urgency
|
|
184
|
+
urgency,
|
|
185
|
+
...path ? {} : { chats: true },
|
|
186
|
+
...project ? { projectId: project.id } : {}
|
|
169
187
|
});
|
|
170
188
|
for (const session of pinned) out.push({
|
|
171
189
|
kind: "session",
|
|
@@ -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, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectPathOf, repoGroups } from "./rows.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";
|
|
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, 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, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sessionRowChanges, sidebarContributionsOf, sidebarLayoutOf, 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, 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 };
|
|
@@ -16,7 +16,7 @@ import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, firstGrapheme,
|
|
|
16
16
|
import { comparePinnedMains, isPinnedProjectMain, isSidebarPinned, isUnlistedProjectMain, sidebarProjectMainOf } from "./project-main.js";
|
|
17
17
|
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 "./query.js";
|
|
18
18
|
import { sessionRowChanges } from "./row-changes.js";
|
|
19
|
-
import { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectPathOf, repoGroups } from "./rows.js";
|
|
19
|
+
import { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectGroupPath, projectIdOfGroup, projectPathOf, repoGroups, sidebarGroupPathOf, sidebarProjectIndex } from "./rows.js";
|
|
20
20
|
import { VIEW_CHOICE } from "./types.js";
|
|
21
21
|
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 "./view.js";
|
|
22
|
-
export { AGENT_GROUPING, CHATS_BUCKET, COMMON_EMOJI, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, 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, projectKeyOf, projectPathOf, readSidebarViews, reduceActivity, reduceCompaction, repoGroups, resolveGrouping, resolveSidebarView, resolveSort, runsInRemoteSandbox, sessionRefsOf, sessionRowChanges, sidebarContributionsOf, sidebarLayoutOf, sidebarProjectMainOf, sidebarViewDefaults, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn, withPinnedProject };
|
|
22
|
+
export { AGENT_GROUPING, CHATS_BUCKET, COMMON_EMOJI, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, MAIN_SESSION_ICON_KEY, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_ICONS_KEY, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, 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 {
|
|
3
|
+
import { PV as McpJobView, UN as SecretTtl, XB as TaskOutcomeCounts, YB as TaskOutcome } from "../../../dist/index-DPbpsCtl.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. */
|
|
@@ -221,6 +221,7 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
221
221
|
openGroup: (label: string) => string;
|
|
222
222
|
newSession: string;
|
|
223
223
|
searchSessions: string;
|
|
224
|
+
searchSessionsName: string;
|
|
224
225
|
noSessions: string;
|
|
225
226
|
noMatches: (query: string) => string;
|
|
226
227
|
sessions: string;
|
|
@@ -277,6 +278,7 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
277
278
|
receiptCost: string;
|
|
278
279
|
receiptTokens: (sent: string, received: string) => string;
|
|
279
280
|
receiptSpeed: string;
|
|
281
|
+
receiptFast: string;
|
|
280
282
|
stopped: string;
|
|
281
283
|
stoppedByYou: string;
|
|
282
284
|
stoppedByName: (name: string) => string;
|
|
@@ -320,6 +322,10 @@ export declare const DEFAULT_SIDEBAR_LABELS: {
|
|
|
320
322
|
authSignInFailed: string;
|
|
321
323
|
sessionEventLabel: (title: string, verb: string, needsAttention: boolean) => string;
|
|
322
324
|
clickToAnswer: string;
|
|
325
|
+
sessionUpdates: (updates: number, conversations: number) => string;
|
|
326
|
+
sessionUpdateCount: (count: number) => string;
|
|
327
|
+
sessionUpdatesNoProject: string;
|
|
328
|
+
sessionTurns: (count: number) => string;
|
|
323
329
|
openSession: string;
|
|
324
330
|
commandDetail: string;
|
|
325
331
|
spawnTask: string;
|
|
@@ -49,7 +49,7 @@ const DEFAULT_SIDEBAR_LABELS = {
|
|
|
49
49
|
noChatsYet: "No chats yet",
|
|
50
50
|
sidebarPreview: "Sidebar preview",
|
|
51
51
|
sidebarPreviewLayout: "Preview layout",
|
|
52
|
-
noChatsYetHint: "Start one with New
|
|
52
|
+
noChatsYetHint: "Start one with New.",
|
|
53
53
|
noChatsMatchFilters: "No chats match these filters",
|
|
54
54
|
noChatsMatchFiltersHint: "Change a filter, or reset them all to see every chat again.",
|
|
55
55
|
resetFilters: "Reset filters",
|
|
@@ -16,6 +16,52 @@ import { SessionGroupBy } from "zidane/chat/pure";
|
|
|
16
16
|
* @param session - Its folder and project root.
|
|
17
17
|
*/
|
|
18
18
|
export declare function projectPathOf(session: Pick<SidebarListSession, 'projectRoot' | 'cwd'>): string;
|
|
19
|
+
/**
|
|
20
|
+
* The group key of a project with no folder, as its header's `fullPath`.
|
|
21
|
+
*
|
|
22
|
+
* @param projectId - The project.
|
|
23
|
+
*/
|
|
24
|
+
export declare function projectGroupPath(projectId: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* The project a group key names (`projectGroupPath`), else `null` (a folder).
|
|
27
|
+
*
|
|
28
|
+
* @param path - A header's `fullPath`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function projectIdOfGroup(path: string | undefined): string | null;
|
|
31
|
+
/** A project the sidebar groups this host's sessions by (`Settings.projectHome`). */
|
|
32
|
+
export interface SidebarProjectGroup {
|
|
33
|
+
/** The project's id. */
|
|
34
|
+
id: string;
|
|
35
|
+
/** Its name: the header of a project with no folder. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Its home folder; absent: a project with no folder. */
|
|
38
|
+
home?: string;
|
|
39
|
+
/** The sessions filed in it (`projects.sessions`): they group under it, whatever their folder. */
|
|
40
|
+
sessions?: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
/** The projects of this host, by what the grouping asks of them (`sidebarProjectIndex`). */
|
|
43
|
+
export interface SidebarProjectIndex {
|
|
44
|
+
/** The project each filed session is in, by session id. */
|
|
45
|
+
filed: ReadonlyMap<string, SidebarProjectGroup>;
|
|
46
|
+
/** The projects with no folder, in order: a group each, with or without sessions. */
|
|
47
|
+
folderless: readonly SidebarProjectGroup[];
|
|
48
|
+
/** Each project with no folder by its group key. */
|
|
49
|
+
byGroup: ReadonlyMap<string, SidebarProjectGroup>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The lookups the grouping reads, built once per list of projects.
|
|
53
|
+
*
|
|
54
|
+
* @param projects - The host's projects, with the sessions filed in each.
|
|
55
|
+
*/
|
|
56
|
+
export declare function sidebarProjectIndex(projects: readonly SidebarProjectGroup[]): SidebarProjectIndex;
|
|
57
|
+
/**
|
|
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.
|
|
60
|
+
*
|
|
61
|
+
* @param session - The session.
|
|
62
|
+
* @param projects - This host's projects (`sidebarProjectIndex`). Absent: its folder.
|
|
63
|
+
*/
|
|
64
|
+
export declare function sidebarGroupPathOf(session: Pick<SidebarListSession, 'id' | 'projectRoot' | 'cwd' | 'hostId'>, projects?: SidebarProjectIndex): string;
|
|
19
65
|
/** One row of the sidebar: a session-list row (a header may name its host) or a host's section header. */
|
|
20
66
|
export type SidebarListRow<S extends SidebarListSession = SidebarListSession> = Extract<SessionListRow<S>, {
|
|
21
67
|
kind: 'showMore';
|
|
@@ -40,13 +86,16 @@ export type SidebarListRow<S extends SidebarListSession = SidebarListSession> =
|
|
|
40
86
|
/**
|
|
41
87
|
* A group header; a server's folder names its server (`hostId`), shown as a chip. A project
|
|
42
88
|
* whose repository also has sessions on other machines names it (`repoKey`): those sessions
|
|
43
|
-
* are listed under it.
|
|
89
|
+
* 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.
|
|
44
91
|
*/
|
|
45
92
|
(Extract<SessionListRow<S>, {
|
|
46
93
|
kind: 'header';
|
|
47
94
|
}> & {
|
|
48
95
|
hostId?: string;
|
|
49
96
|
repoKey?: string;
|
|
97
|
+
projectId?: string;
|
|
98
|
+
empty?: boolean;
|
|
50
99
|
}) |
|
|
51
100
|
/**
|
|
52
101
|
* A host's section in the Per host view (This computer, then each saved
|
|
@@ -69,7 +118,14 @@ export declare function groupsByFolder(groupBy: SidebarGroupBy): boolean;
|
|
|
69
118
|
/** The directory-less bucket's label ("pure chat" sessions, no project). */
|
|
70
119
|
export declare const CHATS_BUCKET = "Chats";
|
|
71
120
|
/** The list options {@link buildSidebarRows} passes through. */
|
|
72
|
-
export type BuildSidebarRowsOptions = Pick<SessionListOptions<SidebarListSession>, 'collapsedGroups' | 'showMoreExpanded' | 'idPrefix' | 'pinnedProjects' | 'compare' | 'keepId'
|
|
121
|
+
export type BuildSidebarRowsOptions = Pick<SessionListOptions<SidebarListSession>, 'collapsedGroups' | 'showMoreExpanded' | 'idPrefix' | 'pinnedProjects' | 'compare' | 'keepId'> & {
|
|
122
|
+
/**
|
|
123
|
+
* This computer's projects (`sidebarProjectIndex`), in a view grouped by folder: a session filed in one groups
|
|
124
|
+
* under it before its folder, and each project with no folder has a group, after the folders', even with no
|
|
125
|
+
* session. Absent: folders alone.
|
|
126
|
+
*/
|
|
127
|
+
projects?: SidebarProjectIndex;
|
|
128
|
+
};
|
|
73
129
|
/**
|
|
74
130
|
* Orchestration on: the main session is pulled out (pinned above the list).
|
|
75
131
|
* Off: the main is not a chat; it is hidden, not regrouped.
|
|
@@ -88,8 +144,8 @@ export declare function partitionMainSession<S extends SidebarListSession>(sessi
|
|
|
88
144
|
* @param sessions - The sessions to list.
|
|
89
145
|
* @param groupBy - The session-list grouping.
|
|
90
146
|
* @param sortBy - The order inside a group.
|
|
91
|
-
* @param options - Collapsed groups, expanded "show more", id prefix, pinned projects.
|
|
92
|
-
* @param project - The
|
|
147
|
+
* @param options - Collapsed groups, expanded "show more", id prefix, pinned projects, this computer's projects.
|
|
148
|
+
* @param project - The group a session is listed under (defaults to {@link sidebarGroupPathOf}).
|
|
93
149
|
*/
|
|
94
150
|
export declare function buildSidebarRows<S extends SidebarListSession>(sessions: S[], groupBy: SessionGroupBy$1, sortBy: SidebarSortBy, options?: BuildSidebarRowsOptions, project?: (session: S) => string): SidebarListRow<S>[];
|
|
95
151
|
/**
|
|
@@ -101,8 +157,9 @@ export declare function buildSidebarRows<S extends SidebarListSession>(sessions:
|
|
|
101
157
|
* server folder.
|
|
102
158
|
*
|
|
103
159
|
* @param sessions - The listed sessions.
|
|
160
|
+
* @param projects - This computer's projects: a session filed in one groups under it, not under its repository.
|
|
104
161
|
*/
|
|
105
|
-
export declare function repoGroups(sessions: readonly SidebarListSession[]): Map<string, string>;
|
|
162
|
+
export declare function repoGroups(sessions: readonly SidebarListSession[], projects?: SidebarProjectIndex): Map<string, string>;
|
|
106
163
|
/**
|
|
107
164
|
* Whether `session` is listed under a project header: a local session in its
|
|
108
165
|
* folder, or, for a header that names a `repoKey`, a server session of that
|
|
@@ -9,7 +9,60 @@ import { groupRows } from "zidane/chat/pure";
|
|
|
9
9
|
* @param session - Its folder and project root.
|
|
10
10
|
*/
|
|
11
11
|
function projectPathOf(session) {
|
|
12
|
-
|
|
12
|
+
const path = session.projectRoot?.trim() ? session.projectRoot : session.cwd;
|
|
13
|
+
return path?.trim() ? path : "";
|
|
14
|
+
}
|
|
15
|
+
const PROJECT_GROUP = "project:";
|
|
16
|
+
/**
|
|
17
|
+
* The group key of a project with no folder, as its header's `fullPath`.
|
|
18
|
+
*
|
|
19
|
+
* @param projectId - The project.
|
|
20
|
+
*/
|
|
21
|
+
function projectGroupPath(projectId) {
|
|
22
|
+
return `${PROJECT_GROUP}${projectId}`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The project a group key names (`projectGroupPath`), else `null` (a folder).
|
|
26
|
+
*
|
|
27
|
+
* @param path - A header's `fullPath`.
|
|
28
|
+
*/
|
|
29
|
+
function projectIdOfGroup(path) {
|
|
30
|
+
return path?.startsWith(PROJECT_GROUP) ? path.slice(9) : null;
|
|
31
|
+
}
|
|
32
|
+
const trimSlashes = (path) => path.replace(/\/+$/, "") || "/";
|
|
33
|
+
/**
|
|
34
|
+
* The lookups the grouping reads, built once per list of projects.
|
|
35
|
+
*
|
|
36
|
+
* @param projects - The host's projects, with the sessions filed in each.
|
|
37
|
+
*/
|
|
38
|
+
function sidebarProjectIndex(projects) {
|
|
39
|
+
const filed = /* @__PURE__ */ new Map();
|
|
40
|
+
const folderless = [];
|
|
41
|
+
const byGroup = /* @__PURE__ */ new Map();
|
|
42
|
+
for (const project of projects) {
|
|
43
|
+
for (const id of project.sessions ?? []) filed.set(id, project);
|
|
44
|
+
if (!project.home?.trim()) {
|
|
45
|
+
folderless.push(project);
|
|
46
|
+
byGroup.set(projectGroupPath(project.id), project);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
filed,
|
|
51
|
+
folderless,
|
|
52
|
+
byGroup
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
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.
|
|
58
|
+
*
|
|
59
|
+
* @param session - The session.
|
|
60
|
+
* @param projects - This host's projects (`sidebarProjectIndex`). Absent: its folder.
|
|
61
|
+
*/
|
|
62
|
+
function sidebarGroupPathOf(session, projects) {
|
|
63
|
+
const project = !session.hostId ? projects?.filed.get(session.id) : void 0;
|
|
64
|
+
if (project) return project.home?.trim() ? trimSlashes(project.home.trim()) : projectGroupPath(project.id);
|
|
65
|
+
return projectPathOf(session);
|
|
13
66
|
}
|
|
14
67
|
/**
|
|
15
68
|
* Views whose groups are folders: Per directory, and each host's section in Per host.
|
|
@@ -50,24 +103,44 @@ function partitionMainSession(sessions, orchestrationEnabled) {
|
|
|
50
103
|
* @param sessions - The sessions to list.
|
|
51
104
|
* @param groupBy - The session-list grouping.
|
|
52
105
|
* @param sortBy - The order inside a group.
|
|
53
|
-
* @param options - Collapsed groups, expanded "show more", id prefix, pinned projects.
|
|
54
|
-
* @param project - The
|
|
106
|
+
* @param options - Collapsed groups, expanded "show more", id prefix, pinned projects, this computer's projects.
|
|
107
|
+
* @param project - The group a session is listed under (defaults to {@link sidebarGroupPathOf}).
|
|
55
108
|
*/
|
|
56
|
-
function buildSidebarRows(sessions, groupBy, sortBy, options = {}, project =
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
109
|
+
function buildSidebarRows(sessions, groupBy, sortBy, options = {}, project = (s) => sidebarGroupPathOf(s, options.projects)) {
|
|
110
|
+
const { projects, ...list } = options;
|
|
111
|
+
const compare = list.compare ?? ((a, b) => compareSessions(a, b, sortBy));
|
|
112
|
+
const rows = buildSessionRows(sessions, {
|
|
113
|
+
...list,
|
|
60
114
|
groupBy,
|
|
61
115
|
sortBy,
|
|
62
116
|
project,
|
|
63
117
|
compare: (a, b) => comparePinnedMains(a, b) || compare(a, b),
|
|
64
118
|
isGitRepo: (s) => s.isGitRepo === true,
|
|
65
|
-
isFavorite: isSidebarPinned
|
|
119
|
+
isFavorite: isSidebarPinned,
|
|
120
|
+
...groupBy === "project" && projects ? { projectGroups: projects.folderless.map((p) => projectGroupPath(p.id)) } : {}
|
|
121
|
+
});
|
|
122
|
+
return groupBy === "project" && projects && projects.byGroup.size > 0 ? withProjectGroups(rows, projects) : rows;
|
|
123
|
+
}
|
|
124
|
+
/** The header of a project with no folder names the project, and says so while nothing is filed in it. */
|
|
125
|
+
function withProjectGroups(rows, projects) {
|
|
126
|
+
return rows.map((row, i) => {
|
|
127
|
+
if (row.kind !== "header" || row.fullPath === void 0) return row;
|
|
128
|
+
const project = projects.byGroup.get(row.fullPath);
|
|
129
|
+
if (!project) return row;
|
|
130
|
+
const next = rows[i + 1];
|
|
131
|
+
const empty = !row.collapsed && (next === void 0 || next.kind !== "session" && next.kind !== "showMore");
|
|
132
|
+
return {
|
|
133
|
+
...row,
|
|
134
|
+
label: project.name,
|
|
135
|
+
isGitRepo: false,
|
|
136
|
+
projectId: project.id,
|
|
137
|
+
...empty ? { empty: true } : {}
|
|
138
|
+
};
|
|
66
139
|
});
|
|
67
140
|
}
|
|
68
141
|
const HOST_SEP = "\0";
|
|
69
|
-
function hostFolderKey(session) {
|
|
70
|
-
const path =
|
|
142
|
+
function hostFolderKey(session, projects) {
|
|
143
|
+
const path = sidebarGroupPathOf(session, projects);
|
|
71
144
|
if (!session.hostId || !path) return path;
|
|
72
145
|
return `${path.replace(/\/+$/, "") || "/"}${HOST_SEP}${session.hostId}`;
|
|
73
146
|
}
|
|
@@ -80,19 +153,20 @@ function hostFolderKey(session) {
|
|
|
80
153
|
* server folder.
|
|
81
154
|
*
|
|
82
155
|
* @param sessions - The listed sessions.
|
|
156
|
+
* @param projects - This computer's projects: a session filed in one groups under it, not under its repository.
|
|
83
157
|
*/
|
|
84
|
-
function repoGroups(sessions) {
|
|
158
|
+
function repoGroups(sessions, projects) {
|
|
85
159
|
const local = /* @__PURE__ */ new Map();
|
|
86
160
|
const remote = /* @__PURE__ */ new Map();
|
|
87
161
|
for (const session of sessions) {
|
|
88
|
-
if (!session.repoKey || !projectPathOf(session)) continue;
|
|
162
|
+
if (!session.repoKey || !projectPathOf(session) || !session.hostId && projects?.filed.has(session.id)) continue;
|
|
89
163
|
if (session.hostId) {
|
|
90
164
|
const key = hostFolderKey(session);
|
|
91
165
|
const first = remote.get(session.repoKey);
|
|
92
166
|
if (first === void 0 || key < first) remote.set(session.repoKey, key);
|
|
93
167
|
} else {
|
|
94
168
|
const folders = local.get(session.repoKey) ?? /* @__PURE__ */ new Set();
|
|
95
|
-
folders.add(projectPathOf(session)
|
|
169
|
+
folders.add(trimSlashes(projectPathOf(session)));
|
|
96
170
|
local.set(session.repoKey, folders);
|
|
97
171
|
}
|
|
98
172
|
}
|
|
@@ -160,9 +234,11 @@ function buildHostSidebarRows(sessions, hosts, groupBy, sortBy, options = {}) {
|
|
|
160
234
|
const servers = new Map(hosts.filter((host) => host.kind === "server").map((host) => [host.id, host.name]));
|
|
161
235
|
if (groupBy !== "host") {
|
|
162
236
|
const listed = sessions.filter((s) => !s.hostId || servers.has(s.hostId));
|
|
163
|
-
const
|
|
237
|
+
const projects = groupBy === "project" ? options.projects : void 0;
|
|
238
|
+
const groups = servers.size > 0 ? repoGroups(listed, projects) : /* @__PURE__ */ new Map();
|
|
164
239
|
const repoByGroup = new Map([...groups].map(([repoKey, group]) => [group, repoKey]));
|
|
165
|
-
const
|
|
240
|
+
const filed = (s) => !s.hostId && projects?.filed.has(s.id) === true;
|
|
241
|
+
const rows = buildSidebarRows(listed, groupBy, sortBy, options, (s) => !filed(s) && s.repoKey && groups.has(s.repoKey) ? groups.get(s.repoKey) : hostFolderKey(s, projects));
|
|
166
242
|
return servers.size > 0 ? rows.map((row) => serverFolderHeader(withRepoKey(row, repoByGroup))) : rows;
|
|
167
243
|
}
|
|
168
244
|
const local = sessions.filter((s) => !s.hostId);
|
|
@@ -187,7 +263,7 @@ function buildHostSidebarRows(sessions, hosts, groupBy, sortBy, options = {}) {
|
|
|
187
263
|
session: open
|
|
188
264
|
});
|
|
189
265
|
} else {
|
|
190
|
-
const { pinnedProjects: _pinnedProjects, ...rest } = options;
|
|
266
|
+
const { pinnedProjects: _pinnedProjects, projects: _projects, ...rest } = options;
|
|
191
267
|
const rows = buildSidebarRows(own, "project", sortBy, {
|
|
192
268
|
...host.kind === "local" ? options : rest,
|
|
193
269
|
idPrefix: `${host.id}:`
|
|
@@ -363,4 +439,4 @@ function nestSidebarRows(rows) {
|
|
|
363
439
|
}
|
|
364
440
|
return top;
|
|
365
441
|
}
|
|
366
|
-
export { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectPathOf, repoGroups };
|
|
442
|
+
export { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebarRows, groupsByFolder, isProjectMember, itemRows, nestSidebarRows, partitionMainSession, projectGroupPath, projectIdOfGroup, projectPathOf, repoGroups, sidebarGroupPathOf, sidebarProjectIndex };
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* batch* tool runs, thinking chains, task bursts
|
|
9
9
|
* markRunFailures a run that ended early → one row that can continue or retry
|
|
10
10
|
* dockRunReceipts run receipts onto their reply
|
|
11
|
+
* groupSessionEvents updates from other sessions in a row → one group
|
|
11
12
|
* foldExchanges compact density: each exchange's work behind one row
|
|
12
13
|
* clusterByOwner subagent rows → blocks per spawn
|
|
13
14
|
*
|
|
@@ -3,6 +3,7 @@ import { collapseEvents, collapseSeamRow } from "./collapse.js";
|
|
|
3
3
|
import { dockRunReceipts, findLastStreamingRow, foldExchanges } from "./fold.js";
|
|
4
4
|
import { nestToolCalls, nestedCallVisible } from "./nesting.js";
|
|
5
5
|
import { markRunFailures } from "./run-failures.js";
|
|
6
|
+
import { groupSessionEvents } from "./session-groups.js";
|
|
6
7
|
import { gatherCommandNotes, isCacheNotice, noteTranscriptPass } from "zidane/chat/pure";
|
|
7
8
|
// src/chat/headless/transcript/derive.ts
|
|
8
9
|
/**
|
|
@@ -40,7 +41,8 @@ function deriveRowsPart(events, streaming, options, final, before) {
|
|
|
40
41
|
const batched = batchTaskRuns(batchThinkingRuns(batchToolRuns(nested, options.groupToolCalls)));
|
|
41
42
|
const failed = markRunFailures(batched);
|
|
42
43
|
const { visibleRows, receiptByRowId } = dockRunReceipts(failed, options.showRunReceipt);
|
|
43
|
-
const
|
|
44
|
+
const grouped = groupSessionEvents(visibleRows);
|
|
45
|
+
const rows = options.compact ? foldExchanges(grouped, streaming, final) : grouped;
|
|
44
46
|
return {
|
|
45
47
|
rows,
|
|
46
48
|
receipts: receiptByRowId,
|
|
@@ -337,6 +337,7 @@ function dotVariantFor(row) {
|
|
|
337
337
|
if (row.live) return "tool-running";
|
|
338
338
|
return row.stats.tools > 0 && row.stats.failed === row.stats.tools ? "tool-err" : "tool-ok";
|
|
339
339
|
case "message-group": return row.messages.length === 0 ? "text" : "messages";
|
|
340
|
+
case "session-event-group": return row.level === "updates" ? "session-group" : row.level === "project" ? "session-project" : row.level === "worktree" ? "session-worktree" : `session-${row.events.at(-1).sessionEvent.status}`;
|
|
340
341
|
case "task": return TASK_DOT[taskOutcome(row.task)];
|
|
341
342
|
case "task-batch": {
|
|
342
343
|
const counts = countTaskOutcomes(row.tasks.map((t) => t.task));
|
|
@@ -7,7 +7,8 @@ import { FoldActionItem, FoldActionState, foldActionItems, toolAction } from "./
|
|
|
7
7
|
import { nestToolCalls, nestedCallVisible } from "./nesting.js";
|
|
8
8
|
import { PairingResult, ToolPairing, pairToolEvents } from "./pairing.js";
|
|
9
9
|
import { EMPTY_RAIL, RailExchange, RailModel, TranscriptRailState, TranscriptRailStore, computeRailModel, computeRailModelParts, createTranscriptRailStore, dataRowSelector, plainPreview, railWithOutline, sameRail } from "./rail.js";
|
|
10
|
-
import { BashExitMeta, Cluster, DotVariant, ExchangeFoldStats, GroupCluster, Owned, Row, SpawnMeta, TaskInfo, ToolRowModel, firstRowId, parseBashExitMeta } from "./rows.js";
|
|
10
|
+
import { BashExitMeta, Cluster, DotVariant, ExchangeFoldStats, GroupCluster, Owned, Row, SessionEventGroupLevel, SessionEventRowModel, SpawnMeta, TaskInfo, ToolRowModel, firstRowId, parseBashExitMeta } from "./rows.js";
|
|
11
11
|
import { RunFailure, failureTooltip, markRunFailures } from "./run-failures.js";
|
|
12
12
|
import { SelectStops, computeSelectStops, rowTurnIds, stopForRow } from "./select-stops.js";
|
|
13
|
-
|
|
13
|
+
import { groupSessionEvents, latestPerConversation } from "./session-groups.js";
|
|
14
|
+
export { type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, type Cluster, type DotVariant, EMPTY_RAIL, type ExchangeFoldStats, type ExchangeMedium, type FoldActionItem, type FoldActionState, type GroupCluster, type MediaRef, type Owned, type PairingResult, type RailExchange, type RailModel, type Row, type RunFailure, type SelectStops, type SessionEventGroupLevel, type SessionEventRowModel, type SpawnMeta, type TaskInfo, type ToolPairing, type ToolRowModel, type TranscriptRailState, type TranscriptRailStore, authFailureDetails, batchTaskRuns, batchThinkingRuns, batchToolRuns, clusterByOwner, collapseEvents, computeRailModel, computeRailModelParts, computeSelectStops, createAuthFixes, createTranscriptRailStore, dataRowSelector, dockRunReceipts, dotVariantFor, exchangesMedia, failureTooltip, findLastStreamingRow, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, groupSessionEvents, inheritRowIdentity, isAuthFixed, latestPerConversation, markRunFailures, mediaRefsOf, mediumKey, nestToolCalls, nestedCallVisible, pairToolEvents, parseBashExitMeta, plainPreview, planAuthCard, railWithOutline, refusedSpawn, rowTurnIds, sameRail, stopForRow, toolAction, toolFailed };
|