zidane-ui 9.5.0 → 9.5.3

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 (88) hide show
  1. package/dist/chat/SessionList.d.ts +1 -1
  2. package/dist/chat/SessionList.js +1 -1
  3. package/dist/chat/Transcript.js +6 -2
  4. package/dist/chat/composer/ComposerEditor.js +1 -1
  5. package/dist/chat/composer/DraftPickers.d.ts +8 -2
  6. package/dist/chat/composer/DraftPickers.js +5 -3
  7. package/dist/chat/composer/ScopeToggle.d.ts +5 -2
  8. package/dist/chat/composer/ScopeToggle.js +3 -2
  9. package/dist/chat/composer/ServerScopeToggle.d.ts +5 -2
  10. package/dist/chat/composer/ServerScopeToggle.js +2 -1
  11. package/dist/chat/composer/use-draft-target.d.ts +7 -1
  12. package/dist/chat/composer/use-draft-target.js +19 -10
  13. package/dist/chat/headless/fixtures/demo-transcript-all-kinds.d.ts +6 -0
  14. package/dist/chat/headless/fixtures/demo-transcript-all-kinds.js +90 -2
  15. package/dist/chat/headless/index.d.ts +6 -5
  16. package/dist/chat/headless/index.js +4 -3
  17. package/dist/chat/headless/labels.d.ts +9 -0
  18. package/dist/chat/headless/labels.js +12 -3
  19. package/dist/chat/headless/session-list.d.ts +8 -0
  20. package/dist/chat/headless/session-list.js +7 -0
  21. package/dist/chat/headless/sidebar/inbox.d.ts +21 -5
  22. package/dist/chat/headless/sidebar/inbox.js +30 -12
  23. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  24. package/dist/chat/headless/sidebar/index.js +2 -2
  25. package/dist/chat/headless/sidebar/labels.d.ts +7 -1
  26. package/dist/chat/headless/sidebar/labels.js +1 -1
  27. package/dist/chat/headless/sidebar/rows.d.ts +62 -5
  28. package/dist/chat/headless/sidebar/rows.js +93 -17
  29. package/dist/chat/headless/transcript/derive.d.ts +1 -0
  30. package/dist/chat/headless/transcript/derive.js +3 -1
  31. package/dist/chat/headless/transcript/fold.js +1 -0
  32. package/dist/chat/headless/transcript/index.d.ts +3 -2
  33. package/dist/chat/headless/transcript/index.js +2 -1
  34. package/dist/chat/headless/transcript/rail.js +1 -0
  35. package/dist/chat/headless/transcript/rows.d.ts +26 -2
  36. package/dist/chat/headless/transcript/select-stops.js +1 -0
  37. package/dist/chat/headless/transcript/session-groups.d.ts +36 -0
  38. package/dist/chat/headless/transcript/session-groups.js +94 -0
  39. package/dist/chat/index.d.ts +4 -3
  40. package/dist/chat/index.js +7 -6
  41. package/dist/chat/sidebar/InboxList.d.ts +14 -1
  42. package/dist/chat/sidebar/InboxList.js +33 -13
  43. package/dist/chat/sidebar/SessionSidebar.d.ts +13 -5
  44. package/dist/chat/sidebar/SessionSidebar.js +54 -34
  45. package/dist/chat/sidebar/SidebarGroupHeader.d.ts +7 -2
  46. package/dist/chat/sidebar/SidebarGroupHeader.js +22 -6
  47. package/dist/chat/sidebar/useInboxRows.d.ts +4 -1
  48. package/dist/chat/sidebar/useInboxRows.js +6 -3
  49. package/dist/chat/sidebar/useInboxTriage.d.ts +3 -0
  50. package/dist/chat/sidebar/useInboxTriage.js +3 -2
  51. package/dist/chat/testing/index.d.ts +2 -2
  52. package/dist/chat/testing/index.js +2 -2
  53. package/dist/chat/transcript/BadgeMenu.d.ts +9 -2
  54. package/dist/chat/transcript/BadgeMenu.js +20 -2
  55. package/dist/chat/transcript/SubagentBlock.js +24 -7
  56. package/dist/chat/transcript/TranscriptRail.js +3 -3
  57. package/dist/chat/transcript/TranscriptRow.js +8 -0
  58. package/dist/chat/transcript/frame.d.ts +7 -0
  59. package/dist/chat/transcript/frame.js +51 -5
  60. package/dist/chat/transcript/index.d.ts +4 -3
  61. package/dist/chat/transcript/index.js +3 -2
  62. package/dist/chat/transcript/notices.d.ts +9 -9
  63. package/dist/chat/transcript/notices.js +78 -81
  64. package/dist/chat/transcript/receipt-parts.d.ts +29 -2
  65. package/dist/chat/transcript/receipt-parts.js +40 -7
  66. package/dist/chat/transcript/row-estimate.js +4 -1
  67. package/dist/chat/transcript/run-rows.js +2 -5
  68. package/dist/chat/transcript/script-input.d.ts +1 -1
  69. package/dist/chat/transcript/session-groups.d.ts +21 -0
  70. package/dist/chat/transcript/session-groups.js +154 -0
  71. package/dist/chat/transcript/session-line.d.ts +63 -0
  72. package/dist/chat/transcript/session-line.js +114 -0
  73. package/dist/dist/{index-Bsp5Ku7r.d.ts → index-BsoTsm0E.d.ts} +17 -17
  74. package/dist/dist/index.d.ts +1 -1
  75. package/dist/session/ProjectName.js +1 -1
  76. package/dist/session/SessionHeader.js +1 -1
  77. package/dist/session/headless/labels.d.ts +1 -1
  78. package/dist/session/use-home-projects.d.ts +10 -3
  79. package/dist/session/use-home-projects.js +40 -4
  80. package/dist/settings/headless/mcp-requirement.js +4 -3
  81. package/dist/settings/headless/mcp.d.ts +2 -0
  82. package/dist/settings/headless/mcp.js +3 -2
  83. package/dist/settings/headless/search.d.ts +1 -1
  84. package/dist/settings/index.js +3 -3
  85. package/dist/settings/sections/mcp/McpSection.js +3 -5
  86. package/dist/styles.css +43 -0
  87. package/package.json +2 -2
  88. package/src/styles/transcript.css +39 -0
@@ -0,0 +1,154 @@
1
+ import { useStaysMounted } from "../../motion/collapse.js";
2
+ import { dotVariantFor } from "../headless/transcript/fold.js";
3
+ import { latestPerConversation } from "../headless/transcript/session-groups.js";
4
+ import { StatusDot } from "../StatusDot.js";
5
+ import { useChatLabels } from "../useChatLabels.js";
6
+ import { FoldHeader } from "./fold.js";
7
+ import { Dot, RowFrame, SESSION_EVENT_DOT, useRowIcons } from "./frame.js";
8
+ import { useForceMountRows } from "./LazyRow.js";
9
+ import { useTranscriptRenderers } from "./renderers.js";
10
+ import { useRowUiState } from "./row-ui-state.js";
11
+ import { SessionEventScopeContext, SessionLine } from "./session-line.js";
12
+ import { memo, useId, useMemo } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { SESSION_EVENT_STATUS_STYLE, sessionEventExcerpt } from "zidane/chat/pure";
15
+ // src/chat/transcript/session-groups.tsx
16
+ /** The order a group's header counts statuses in: what needs a look first. */
17
+ const STATUS_ORDER = [
18
+ "needs-attention",
19
+ "error",
20
+ "done",
21
+ "cancelled"
22
+ ];
23
+ /** A section's icon, by its level, when the transcript's gutter does not draw it. */
24
+ const SECTION_ICON = {
25
+ project: "i-ph-folder",
26
+ worktree: "i-ph-git-branch"
27
+ };
28
+ const IN_CONVERSATION = { conversation: true };
29
+ const IN_SECTION = { conversation: false };
30
+ /** One status dot per status, with how many of the group's conversations are in it now. */
31
+ function StatusTallies({ events }) {
32
+ const counts = /* @__PURE__ */ new Map();
33
+ for (const event of latestPerConversation(events)) {
34
+ const status = event.sessionEvent.status;
35
+ counts.set(status, (counts.get(status) ?? 0) + 1);
36
+ }
37
+ return /* @__PURE__ */ jsx("span", {
38
+ className: "shrink-0 self-center inline-flex items-center gap-2 zg-meta",
39
+ children: STATUS_ORDER.filter((status) => counts.has(status)).map((status) => /* @__PURE__ */ jsxs("span", {
40
+ className: "inline-flex items-center gap-1",
41
+ children: [/* @__PURE__ */ jsx(StatusDot, {
42
+ state: SESSION_EVENT_DOT[status],
43
+ label: SESSION_EVENT_STATUS_STYLE[status].verb
44
+ }), counts.get(status)]
45
+ }, status))
46
+ });
47
+ }
48
+ /** Sums a number the updates may carry; `undefined` when none does. */
49
+ function total(events, pick) {
50
+ let sum;
51
+ for (const event of events) {
52
+ const value = pick(event.sessionEvent);
53
+ if (value !== void 0) sum = (sum ?? 0) + value;
54
+ }
55
+ return sum;
56
+ }
57
+ /** Renders a group of updates from other sessions at any of its levels: its header line, and its rows when open. */
58
+ const SessionEventGroupRow = memo(({ row, renderRows, onOpenSession, className, style }) => {
59
+ const labels = useChatLabels();
60
+ const icons = useRowIcons();
61
+ const searching = useForceMountRows();
62
+ const { SessionTitle } = useTranscriptRenderers();
63
+ const section = row.level === "project" || row.level === "worktree";
64
+ const [openState, setOpen] = useRowUiState(`session-group:${row.id}`, section);
65
+ const open = openState || searching;
66
+ const mounted = useStaysMounted(open);
67
+ const id = useId();
68
+ const clusters = useMemo(() => row.rows.map((r) => ({
69
+ kind: "single",
70
+ row: r
71
+ })), [row.rows]);
72
+ const toggle = () => setOpen(!open);
73
+ const count = row.events.length;
74
+ const totals = {
75
+ durationMs: total(row.events, (e) => e.durationMs),
76
+ turns: total(row.events, (e) => e.turns)
77
+ };
78
+ let header;
79
+ if (row.level === "conversation") {
80
+ const latest = row.events.at(-1).sessionEvent;
81
+ header = /* @__PURE__ */ jsx(SessionLine, {
82
+ id,
83
+ open,
84
+ onToggle: toggle,
85
+ session: {
86
+ id: latest.sessionId,
87
+ title: latest.title,
88
+ link: latest.link
89
+ },
90
+ lead: icons ? void 0 : /* @__PURE__ */ jsx(StatusDot, { state: SESSION_EVENT_DOT[latest.status] }),
91
+ title: /* @__PURE__ */ jsx(SessionTitle, {
92
+ id: latest.sessionId,
93
+ fallback: latest.title,
94
+ plain: true
95
+ }),
96
+ spoken: SESSION_EVENT_STATUS_STYLE[latest.status].verb,
97
+ answer: latest.status === "needs-attention",
98
+ excerpt: sessionEventExcerpt(latest),
99
+ ...totals,
100
+ count,
101
+ onOpen: onOpenSession ? () => onOpenSession(latest.sessionId) : void 0
102
+ });
103
+ } else if (section) header = /* @__PURE__ */ jsx(SessionLine, {
104
+ id,
105
+ open,
106
+ onToggle: toggle,
107
+ lead: icons ? void 0 : /* @__PURE__ */ jsx("span", {
108
+ "aria-hidden": true,
109
+ className: `${SECTION_ICON[row.level]} text-[var(--zg-text-muted)]`
110
+ }),
111
+ title: row.place ?? labels.sessionUpdatesNoProject,
112
+ titleIsMeta: row.level === "worktree",
113
+ excerpt: /* @__PURE__ */ jsx(StatusTallies, { events: row.events }),
114
+ ...totals,
115
+ count
116
+ });
117
+ else header = /* @__PURE__ */ jsxs(FoldHeader, {
118
+ expandable: true,
119
+ open,
120
+ onToggle: toggle,
121
+ children: [/* @__PURE__ */ jsx("span", {
122
+ className: "min-w-0 truncate",
123
+ children: labels.sessionUpdates(count, latestPerConversation(row.events).length)
124
+ }), /* @__PURE__ */ jsx(StatusTallies, { events: row.events })]
125
+ });
126
+ return /* @__PURE__ */ jsx("div", {
127
+ className: ["relative pb-[var(--zg-row-gap,12px)]", className].filter(Boolean).join(" "),
128
+ style,
129
+ "data-testid": "session-event-group",
130
+ "data-level": row.level,
131
+ "data-open": open,
132
+ children: /* @__PURE__ */ jsxs(RowFrame, { children: [/* @__PURE__ */ jsx(Dot, { variant: dotVariantFor(row) }), /* @__PURE__ */ jsxs("div", {
133
+ className: "zg-fold-messages flex-1 min-w-0 text-zg-body leading-zg-chat",
134
+ children: [header, /* @__PURE__ */ jsx("div", {
135
+ className: "zg-collapsible",
136
+ "data-open": open,
137
+ id: `${id}-body`,
138
+ inert: !open || void 0,
139
+ children: /* @__PURE__ */ jsx("div", {
140
+ className: "zg-collapsible-inner",
141
+ children: /* @__PURE__ */ jsx(SessionEventScopeContext.Provider, {
142
+ value: row.level === "conversation" ? IN_CONVERSATION : IN_SECTION,
143
+ children: /* @__PURE__ */ jsx("div", {
144
+ className: icons ? "zg-fold-body" : "zg-fold-body zg-session-body",
145
+ children: mounted ? renderRows(clusters) : null
146
+ })
147
+ })
148
+ })
149
+ })]
150
+ })] })
151
+ });
152
+ });
153
+ SessionEventGroupRow.displayName = "SessionEventGroupRow";
154
+ export { SessionEventGroupRow };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The one bar every line of an update group reads as: an update alone
3
+ * (`SessionEventRow`), a conversation's header, a project's or a worktree's
4
+ * section (`SessionEventGroupRow`). One order, left to right:
5
+ *
6
+ * status icon · title · excerpt | duration · turns · updates · open · caret
7
+ *
8
+ * Everything after the excerpt is pinned right: the excerpt takes the room
9
+ * that is left whether it shows or not, and the open button keeps its place
10
+ * while hidden, so nothing moves as the bar opens or is hovered.
11
+ *
12
+ * The toggle covers the whole bar (a stretched button under the open and
13
+ * Answer buttons), so a click anywhere opens it and the keyboard reaches it
14
+ * as one control. Right-click opens the chat's badge menu (open it, add it to
15
+ * the prompt, copy its link) when the bar stands for a session.
16
+ */
17
+ import { ReactNode } from "react";
18
+ /** Where an update line sits in a group: what the headers above it already say. */
19
+ export interface SessionEventScope {
20
+ /** A conversation header above names the session: the line reads its time instead. */
21
+ conversation: boolean;
22
+ }
23
+ /** Outside any group: the line says everything. */
24
+ export declare const SessionEventScopeContext: import("react").Context<SessionEventScope>;
25
+ /** The scope of the group around, if any. */
26
+ export declare function useSessionEventScope(): SessionEventScope;
27
+ /** Props for {@link SessionLine}. */
28
+ export interface SessionLineProps {
29
+ /** The id that names the bar (its title and `verb`), and its body's (`<id>-body`). */
30
+ id: string;
31
+ /** The body is open. */
32
+ open: boolean;
33
+ /** Opens or closes the body. */
34
+ onToggle: () => void;
35
+ /** The session the bar stands for: right-click opens its badge menu. Absent (a section): no menu. */
36
+ session?: {
37
+ id: string;
38
+ title: string;
39
+ link?: string | undefined;
40
+ };
41
+ /** The status icon slot: a status dot, a folder, a branch. Absent when the transcript's gutter draws it. */
42
+ lead?: ReactNode;
43
+ /** The bar's name: a session's title, an update's time, a project or a branch. */
44
+ title: ReactNode;
45
+ /** The title is a machine value (a time, a branch): the meta voice, not the title's. */
46
+ titleIsMeta?: boolean;
47
+ /** Said after the title for the ear only: the status verb. */
48
+ spoken?: string;
49
+ /** A blocked session's Answer chip, after the title. */
50
+ answer?: boolean;
51
+ /** The excerpt; hidden while open. */
52
+ excerpt?: ReactNode;
53
+ /** The run's wall-clock (a sum for a group). */
54
+ durationMs?: number | undefined;
55
+ /** The run's turns (a sum for a group). */
56
+ turns?: number | undefined;
57
+ /** How many updates the bar holds; absent for one update. */
58
+ count?: number;
59
+ /** Opens the session; absent: an empty slot, no Open row. */
60
+ onOpen?: (() => void) | undefined;
61
+ }
62
+ /** Renders the bar. */
63
+ export declare function SessionLine({ id, open, onToggle, session, lead, title, titleIsMeta, spoken, answer, excerpt, durationMs, turns, count, onOpen }: SessionLineProps): import("react").JSX.Element;
@@ -0,0 +1,114 @@
1
+ import { IconButton } from "../../components/IconButton.js";
2
+ import { useChatLabels } from "../useChatLabels.js";
3
+ import { useBadgeMenu } from "./BadgeMenu.js";
4
+ import { Caret } from "./frame.js";
5
+ import { MarkdownContext } from "./markdown-context.js";
6
+ import { createContext, useContext } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { chatBadgeTarget, formatRunDuration } from "zidane/chat/pure";
9
+ // src/chat/transcript/session-line.tsx
10
+ /** Outside any group: the line says everything. */
11
+ const SessionEventScopeContext = createContext({ conversation: false });
12
+ /** The scope of the group around, if any. */
13
+ function useSessionEventScope() {
14
+ return useContext(SessionEventScopeContext);
15
+ }
16
+ /** Renders the bar. */
17
+ function SessionLine({ id, open, onToggle, session, lead, title, titleIsMeta = false, spoken, answer = false, excerpt, durationMs, turns, count, onOpen }) {
18
+ const labels = useChatLabels();
19
+ const openMenu = useBadgeMenu();
20
+ const { cwd } = useContext(MarkdownContext);
21
+ return /* @__PURE__ */ jsxs("div", {
22
+ onContextMenu: openMenu && session ? (e) => openMenu(e, chatBadgeTarget({
23
+ id: session.id,
24
+ title: session.title,
25
+ ...session.link ? { link: session.link } : {}
26
+ }), cwd, onOpen ? {
27
+ label: labels.openSession,
28
+ onSelect: onOpen
29
+ } : void 0) : void 0,
30
+ className: "zg-session-bar group zg-disclosure relative flex items-center gap-2 w-full min-w-0 h-[22.4px] text-zg-body leading-zg-chat",
31
+ children: [
32
+ /* @__PURE__ */ jsxs("button", {
33
+ type: "button",
34
+ onClick: onToggle,
35
+ "aria-expanded": open,
36
+ "aria-controls": `${id}-body`,
37
+ "aria-labelledby": spoken ? `${id}-title ${id}-verb` : `${id}-title`,
38
+ className: "zg-focus-ring flex items-center gap-2 shrink min-w-0 max-w-[60%] p-0 border-0 bg-transparent text-inherit text-left cursor-pointer rounded-zg-sm after:content-[''] after:absolute after:inset-0",
39
+ children: [
40
+ lead && /* @__PURE__ */ jsx("span", {
41
+ className: "zg-session-lead",
42
+ children: lead
43
+ }),
44
+ /* @__PURE__ */ jsx("span", {
45
+ id: `${id}-title`,
46
+ className: `min-w-0 truncate ${titleIsMeta ? "zg-meta" : "font-medium text-[var(--zg-text)]"}`,
47
+ children: title
48
+ }),
49
+ spoken && /* @__PURE__ */ jsx("span", {
50
+ id: `${id}-verb`,
51
+ className: "sr-only",
52
+ children: spoken
53
+ })
54
+ ]
55
+ }),
56
+ answer && onOpen && /* @__PURE__ */ jsx("button", {
57
+ type: "button",
58
+ onClick: onOpen,
59
+ className: "zg-meta-chip zg-press-subtle zg-focus-ring relative shrink-0 text-zg-meta text-zg-warn",
60
+ children: labels.clickToAnswer
61
+ }),
62
+ /* @__PURE__ */ jsx("span", {
63
+ "data-slot": "excerpt",
64
+ className: "zg-session-excerpt flex-1 min-w-0 truncate",
65
+ children: open ? null : excerpt
66
+ }),
67
+ durationMs !== void 0 && /* @__PURE__ */ jsx("span", {
68
+ "data-slot": "duration",
69
+ className: "zg-session-slot zg-meta-chip zg-meta",
70
+ children: formatRunDuration(durationMs)
71
+ }),
72
+ turns !== void 0 && /* @__PURE__ */ jsx("span", {
73
+ "data-slot": "turns",
74
+ className: "zg-session-slot zg-session-slot-turns zg-meta-chip zg-meta",
75
+ children: labels.sessionTurns(turns)
76
+ }),
77
+ count !== void 0 && /* @__PURE__ */ jsxs("span", {
78
+ "data-slot": "count",
79
+ className: "zg-session-slot zg-session-slot-count zg-meta-chip zg-meta gap-1",
80
+ children: [
81
+ /* @__PURE__ */ jsx("span", {
82
+ "aria-hidden": true,
83
+ className: "i-ph-stack-simple"
84
+ }),
85
+ /* @__PURE__ */ jsx("span", {
86
+ "aria-hidden": true,
87
+ children: count
88
+ }),
89
+ /* @__PURE__ */ jsx("span", {
90
+ className: "sr-only",
91
+ children: labels.sessionUpdateCount(count)
92
+ })
93
+ ]
94
+ }),
95
+ onOpen && /* @__PURE__ */ jsx("span", {
96
+ "data-slot": "open",
97
+ className: "zg-session-slot",
98
+ children: /* @__PURE__ */ jsx(IconButton, {
99
+ icon: "i-ph-arrow-square-out",
100
+ label: labels.openSession,
101
+ size: "xs",
102
+ className: "zg-reveal relative",
103
+ onClick: onOpen
104
+ })
105
+ }),
106
+ /* @__PURE__ */ jsx("span", {
107
+ "data-slot": "caret",
108
+ className: "zg-session-slot zg-session-slot-caret",
109
+ children: /* @__PURE__ */ jsx(Caret, { open })
110
+ })
111
+ ]
112
+ });
113
+ }
114
+ export { SessionEventScopeContext, SessionLine, useSessionEventScope };
@@ -9,6 +9,22 @@ import "../node_modules/.bun/@earendil-works_pi-ai@1.5.2_46b80fae64c053ae/node_m
9
9
  import "../node_modules/.bun/@anthropic-ai_sdk@1.7.0_fff7ddf946fac095/node_modules/@anthropic-ai/sdk/index.js";
10
10
  import "../node_modules/.bun/@anthropic-ai_sdk@1.7.0_fff7ddf946fac095/node_modules/@anthropic-ai/sdk/resources.js";
11
11
  import "react";
12
+ /**
13
+ * Thinking / extended-reasoning configuration. Dependency-free, so the
14
+ * browser-safe surfaces (`zidane/chat/pure`) can validate a stored effort.
15
+ *
16
+ * - `'off'` — no thinking.
17
+ * - `'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'` — explicit
18
+ * effort tier. Maps to provider-specific reasoning controls (Anthropic
19
+ * `output_config.effort`; OpenAI-compatible providers clamp to their
20
+ * supported tiers).
21
+ * - `'adaptive'` — let the model decide per-turn whether and how much to think.
22
+ * Anthropic-only (`thinking.type='adaptive'`). Other providers fall back to
23
+ * no reasoning when this value is supplied.
24
+ */
25
+ declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max", "adaptive"];
26
+ /** One of the {@link THINKING_LEVELS} strings: how much the model reasons before it answers. */
27
+ type ThinkingLevel = (typeof THINKING_LEVELS)[number];
12
28
  /** The values of the `durability` setting (`Settings.durability` in `zidane/chat`, `--durability` in the CLIs). */
13
29
  /**
14
30
  * Whether runs survive a crash: `on` keeps a checkpoint of each run and
@@ -200,22 +216,6 @@ interface ScriptProgress {
200
216
  /** The line of the latest call or wait to start: where the script is (in a loop, which round's lines are behind it). */
201
217
  at?: number;
202
218
  }
203
- /**
204
- * Thinking / extended-reasoning configuration. Dependency-free, so the
205
- * browser-safe surfaces (`zidane/chat/pure`) can validate a stored effort.
206
- *
207
- * - `'off'` — no thinking.
208
- * - `'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'` — explicit
209
- * effort tier. Maps to provider-specific reasoning controls (Anthropic
210
- * `output_config.effort`; OpenAI-compatible providers clamp to their
211
- * supported tiers).
212
- * - `'adaptive'` — let the model decide per-turn whether and how much to think.
213
- * Anthropic-only (`thinking.type='adaptive'`). Other providers fall back to
214
- * no reasoning when this value is supplied.
215
- */
216
- declare const THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max", "adaptive"];
217
- /** One of the {@link THINKING_LEVELS} strings: how much the model reasons before it answers. */
218
- type ThinkingLevel = (typeof THINKING_LEVELS)[number];
219
219
  /**
220
220
  * The types of the session query: a declarative filter, sort, grouping
221
221
  * and paging over session rows. JSON only, so a query travels over the
@@ -1811,4 +1811,4 @@ type SecretTtl = '1h' | '24h' | '7d' | 'never';
1811
1811
  declare const ARTIFACT_CONTEXT_LEVELS: readonly ["none", "index", "pinned"];
1812
1812
  /** One of {@link ARTIFACT_CONTEXT_LEVELS}. */
1813
1813
  type ArtifactContextLevel = typeof ARTIFACT_CONTEXT_LEVELS[number];
1814
- export { TranscriptDensity as AF, SessionFieldName as AI, Space$1 as BF, Settings as CF, QueryBound as DI, FacetPath as EI, InheritMode as EW, ARTIFACT_CONTEXT_LEVELS as Ey, SessionQueryNot as HI, SessionQuery as II, AnsiColor as Iz, DurabilityMode as JW, NewChatPlace as Kz, SessionQueryAll as LI, ProjectContentKind as MW, OutputLine as Mz, SessionGroupBy as NI, OutputStream as Nz, ToolCallDisplay as OF, QueryValue as OI, McpJobView as OV, SessionGroupOrder as PI, SessionQueryAny as RI, EnvironmentSettings as RV, ProjectInherit as RW, AnsiSpan as Rz, TaskOutcome as UB, SpaceIcon as VF, SecretTtl as VN, TaskOutcomeCounts as WB, SessionSort as WI, ProjectHomeLayout as _F, EnvironmentConfigValue as bH, ProjectHomeIcon as gF, ScriptProgress as gz, ScriptOutputLine as hz, EditDiffDisplay as iF, ThinkingLevel as iz, ViewsMcp as jF, SessionFieldPath as jI, SessionCondition as kI, McpJobViewStatus as kV, ArtifactContextLevel as ky, InteractionMode as lF, ScriptCallStatus as lz, OpenInTarget as pF, ApprovalMode as rF, MessageDelivery as uF, ScriptLineProgress as uz, SidebarLayout as wF, AnsiStyle as zz };
1814
+ export { FacetPath as AI, SessionQuery as BI, AnsiSpan as Bz, Settings as DF, ThinkingLevel as EG, ViewsMcp as FF, SessionFieldPath as FI, OutputStream as Fz, SpaceIcon as GF, SecretTtl as GN, SessionQueryAny as HI, ProjectContentKind as HW, McpJobView as IV, InheritMode as IW, SessionSort as JI, ProjectInherit as JW, NewChatPlace as Jz, SessionQueryNot as KI, EnvironmentSettings as KV, SessionGroupBy as LI, McpJobViewStatus as LV, ToolCallDisplay as MF, QueryValue as MI, SessionCondition as NI, SidebarLayout as OF, EnvironmentConfigValue as OH, ARTIFACT_CONTEXT_LEVELS as Oy, TranscriptDensity as PF, SessionFieldName as PI, OutputLine as Pz, TaskOutcomeCounts as QB, SessionGroupOrder as RI, AnsiColor as Rz, SessionQueryAll as VI, AnsiStyle as Vz, Space$1 as WF, TaskOutcome as ZB, OpenInTarget as _F, ScriptOutputLine as _z, ProjectHomeIcon as bF, EditDiffDisplay as cF, ScriptCallStatus as dz, ScriptLineProgress as fz, DurabilityMode as iG, QueryBound as jI, ArtifactContextLevel as jy, MessageDelivery as mF, InteractionMode as pF, ApprovalMode as sF, ScriptProgress as vz, ProjectHomeLayout as xF };
@@ -1,4 +1,4 @@
1
- import { AI as SessionFieldName, DI as QueryBound, EI as FacetPath, HI as SessionQueryNot, II as SessionQuery, LI as SessionQueryAll, NI as SessionGroupBy, OI as QueryValue, PI as SessionGroupOrder, RI as SessionQueryAny, WI as SessionSort, bH as EnvironmentConfigValue, iz as ThinkingLevel, jI as SessionFieldPath, kI as SessionCondition } from "./index-Bsp5Ku7r.js";
1
+ import { AI as FacetPath, BI as SessionQuery, EG as ThinkingLevel, FI as SessionFieldPath, HI as SessionQueryAny, JI as SessionSort, KI as SessionQueryNot, LI as SessionGroupBy, MI as QueryValue, NI as SessionCondition, OH as EnvironmentConfigValue, PI as SessionFieldName, RI as SessionGroupOrder, VI as SessionQueryAll, jI as QueryBound } from "./index-BsoTsm0E.js";
2
2
  import "./execution-failure-_L2r_Qd-.js";
3
3
  import { d as AuthFailureKind, u as AuthFailure } from "./timeout-NoG7ppkm.js";
4
4
  import "./index-BmO8bRgK.js";
@@ -70,7 +70,7 @@ function useFolderIcons(enabled = true) {
70
70
  const list = useProjectList(enabled && homeOn);
71
71
  const { icons } = useProjectIcons(enabled);
72
72
  return useCallback((folder) => {
73
- if (!enabled) return void 0;
73
+ if (!enabled || !folder.trim()) return void 0;
74
74
  const home = trimmed(folder);
75
75
  const record = list?.find((p) => p.home !== void 0 && trimmed(p.home) === home);
76
76
  return record ? projectIconOf(record, icons) : icons[home];
@@ -46,7 +46,7 @@ function SessionHeader({ title, titleDisplay, titleScope, cwd, projectRoot, bran
46
46
  onRenamingChange?.(false);
47
47
  };
48
48
  const onServer = server !== void 0;
49
- const folderless = !cwd;
49
+ const folderless = !cwd?.trim();
50
50
  const folderName = folderless ? labels.headerChat : folderBasename(projectRoot || cwd);
51
51
  const project = useSessionProject(sessionId ?? null, folderless ? null : projectRoot || cwd, !onServer && !isMain);
52
52
  const settingsOf = project?.id && onOpenProjectSettings ? project.id : null;
@@ -4,7 +4,7 @@
4
4
  * of `SessionProvider`. Keys you leave out keep the default English label.
5
5
  */
6
6
  import { ProjectSessionOriginKey } from "./project-sessions.js";
7
- import { EW as InheritMode, MW as ProjectContentKind, RW as ProjectInherit, ky as ArtifactContextLevel } from "../../dist/index-Bsp5Ku7r.js";
7
+ import { HW as ProjectContentKind, IW as InheritMode, JW as ProjectInherit, jy as ArtifactContextLevel } from "../../dist/index-BsoTsm0E.js";
8
8
  import { ReminderWhen } from "./schedules.js";
9
9
  import { SecretTimeLeft } from "../../chat/headless/secrets.js";
10
10
  import { RunningWorkItem } from "./running-work.js";
@@ -3,7 +3,14 @@
3
3
  * docs/PROJECTS.md § Project UI): the projects with a home folder, each one's
4
4
  * name, its folders among the sidebar's, and its icon from the host
5
5
  * (`projectIcon`, the project's own layer); and the projects with no folder,
6
- * each with its icon from the host (it has no window icon).
6
+ * each with its icon from the host (it has no window icon). Each lists the
7
+ * sessions filed in it (`projects.sessions`), so the sidebar groups them by
8
+ * their project before their folder.
9
+ *
10
+ * filed read when the host's list is read, and again when the
11
+ * sessions' set or their folders change (a new session, a
12
+ * chat moved to a folder) or the project list does; a failed
13
+ * read keeps the last answer
7
14
  *
8
15
  * folders its home, and each listed folder the host resolves to it
9
16
  * (`projects.resolve`, real paths compared on the host): a
@@ -36,8 +43,8 @@ export interface HomeProjects {
36
43
  /** `SessionSidebar`'s `onSetProjectIcon`. Absent: the host's projects are read-only, or off. */
37
44
  onSetProjectIcon?: (projectId: string, icon: ProjectIcon | null) => void;
38
45
  }
39
- /** A session as the sidebar groups it by folder. */
40
- export type GroupedSession = Pick<SidebarListSession, 'projectRoot' | 'cwd' | 'hostId'>;
46
+ /** A session as the sidebar groups it: by its project, else its folder. */
47
+ export type GroupedSession = Pick<SidebarListSession, 'projectRoot' | 'cwd' | 'hostId'> & Partial<Pick<SidebarListSession, 'id'>>;
41
48
  /**
42
49
  * The sidebar's projects: those with a home folder, their folders and their icons, and the window's icons sent to the
43
50
  * host once; and those with no folder, with their icons.
@@ -15,6 +15,13 @@ const NONE = [];
15
15
  const NO_RECORDS = [];
16
16
  const NO_SESSIONS = [];
17
17
  const NOTHING_RESOLVED = /* @__PURE__ */ new Map();
18
+ const NOTHING_FILED = {};
19
+ /** One key per set of this host's sessions and their folders: what can file a session elsewhere. */
20
+ function filingKey(sessions) {
21
+ let key = "";
22
+ for (const session of sessions) if (!session.hostId && session.id !== void 0) key += `${session.id}\u0001${projectPathOf(session)}\u0000`;
23
+ return key;
24
+ }
18
25
  /** The paths of the sidebar's groups of this host's folders, sorted, one per folder. */
19
26
  function localFolders(sessions) {
20
27
  const folders = /* @__PURE__ */ new Set();
@@ -67,6 +74,28 @@ function useHomeProjects(enabled, sessions = NO_SESSIONS) {
67
74
  };
68
75
  }, [resolve, asks]);
69
76
  const resolved = resolve && asks ? found : NOTHING_RESOLVED;
77
+ /** The project each of this host's sessions is filed in (`projects.sessions`), once the list is read. */
78
+ const readFiled = enabled ? host?.sessionProjects : void 0;
79
+ const filingAt = useMemo(() => filingKey(sessions), [sessions]);
80
+ const [filed, setFiled] = useState(NOTHING_FILED);
81
+ useEffect(() => {
82
+ if (!readFiled || list === null) return void 0;
83
+ let live = true;
84
+ readFiled().then((map) => live && setFiled(map && typeof map === "object" ? map : NOTHING_FILED), () => void 0);
85
+ return () => {
86
+ live = false;
87
+ };
88
+ }, [
89
+ readFiled,
90
+ filingAt,
91
+ list
92
+ ]);
93
+ const filedBy = useMemo(() => {
94
+ const out = /* @__PURE__ */ new Map();
95
+ if (!readFiled) return out;
96
+ for (const [sessionId, projectId] of Object.entries(filed)) out.set(projectId, [...out.get(projectId) ?? [], sessionId]);
97
+ return out;
98
+ }, [readFiled, filed]);
70
99
  const mayChange = useCallback((projectId) => !sharing || managesProject(places[projectId]), [sharing, places]);
71
100
  const homeProjects = useMemo(() => homes.length === 0 ? NONE : homes.map((p) => ({
72
101
  id: p.id,
@@ -74,18 +103,25 @@ function useHomeProjects(enabled, sessions = NO_SESSIONS) {
74
103
  home: p.home,
75
104
  folders: [p.home, ...[...resolved].flatMap(([folder, id]) => id === p.id ? [folder] : [])],
76
105
  ...p.settings?.projectIcon ? { icon: p.settings.projectIcon } : {},
77
- ...mayChange(p.id) ? {} : { iconLocked: true }
106
+ ...mayChange(p.id) ? {} : { iconLocked: true },
107
+ ...filedBy.has(p.id) ? { sessions: filedBy.get(p.id) } : {}
78
108
  })), [
79
109
  homes,
80
110
  resolved,
81
- mayChange
111
+ mayChange,
112
+ filedBy
82
113
  ]);
83
114
  const recordProjects = useMemo(() => records.length === 0 ? NO_RECORDS : records.map((p) => ({
84
115
  id: p.id,
85
116
  name: p.name,
86
117
  ...p.settings?.projectIcon ? { icon: p.settings.projectIcon } : {},
87
- ...mayChange(p.id) ? {} : { iconLocked: true }
88
- })), [records, mayChange]);
118
+ ...mayChange(p.id) ? {} : { iconLocked: true },
119
+ ...filedBy.has(p.id) ? { sessions: filedBy.get(p.id) } : {}
120
+ })), [
121
+ records,
122
+ mayChange,
123
+ filedBy
124
+ ]);
89
125
  const sending = useRef(/* @__PURE__ */ new Set());
90
126
  useEffect(() => {
91
127
  if (!setSettings) return;
@@ -26,14 +26,15 @@ function enabledServerNames(servers, enabledMcps) {
26
26
  */
27
27
  function mcpRequirementState(requirement, servers, enabledMcps, picked) {
28
28
  if (!servers) return { kind: "loading" };
29
- const on = enabledServerNames(servers, enabledMcps);
29
+ const listed = enabledServerNames(servers, enabledMcps);
30
+ const on = (s) => s.contributedBy !== void 0 || listed.has(s.name);
30
31
  const server = findMcpRequirementServer(requirement, servers.map((s) => ({
31
32
  ...s,
32
- status: on.has(s.name) ? void 0 : "disabled"
33
+ status: on(s) ? void 0 : "disabled"
33
34
  })), picked);
34
35
  if (!server) return { kind: "missing" };
35
36
  const { status: _status, ...found } = server;
36
- if (!on.has(found.name)) return {
37
+ if (!on(found)) return {
37
38
  kind: "off",
38
39
  server: found
39
40
  };
@@ -68,6 +68,8 @@ export interface SettingsMcpServer {
68
68
  source?: 'user' | 'project';
69
69
  /** `remove` may edit that file. */
70
70
  removable?: boolean;
71
+ /** The extension that brings it: always on, its extension's switch governs it. Absent: a config file declares it. */
72
+ contributedBy?: string;
71
73
  /** Its config's `shared` (absent: `true`). The `mcpSharing` setting wins over it. */
72
74
  shared?: boolean;
73
75
  /**
@@ -15,9 +15,10 @@ function settingsMcpServerOf(entry) {
15
15
  ...entry.url ? { url: entry.url } : {},
16
16
  authState: "idle",
17
17
  ...entry.status,
18
- path: entry.path,
19
- source: entry.source,
18
+ ...entry.path !== void 0 ? { path: entry.path } : {},
19
+ ...entry.source ? { source: entry.source } : {},
20
20
  removable: entry.source === "user",
21
+ ...entry.contributedBy ? { contributedBy: entry.contributedBy } : {},
21
22
  ...entry.shared !== void 0 ? { shared: entry.shared } : {},
22
23
  ...entry.scope ? { scope: entry.scope } : {}
23
24
  };
@@ -12,7 +12,7 @@
12
12
  * best first, once each, and `groupSettingsResults` groups them by page
13
13
  * and section.
14
14
  */
15
- import { CF as Settings } from "../../dist/index-Bsp5Ku7r.js";
15
+ import { DF as Settings } from "../../dist/index-BsoTsm0E.js";
16
16
  import { SettingsActionId, SettingsPage } from "./layout.js";
17
17
  import { SettingsSearchEntry, SettingsSection } from "./registry.js";
18
18
  import { SettingSurface } from "zidane/chat/pure";
@@ -8,13 +8,13 @@ import { DEFAULT_CATALOG_SHARED_LABELS } from "./sections/shared/labels.js";
8
8
  import { DEFAULT_EXTENSION_OPTIONS_LABELS } from "./sections/extensions/options-labels.js";
9
9
  import { McpRequirementRow } from "./sections/extensions/McpRequirementRow.js";
10
10
  import { ExtensionActionRow, ExtensionConfigRow, extensionConfigValue, useExtensionOptionsLabels } from "./sections/extensions/ExtensionConfigRows.js";
11
- import { DEFAULT_ACCOUNTS_SECTION_LABELS } from "./sections/providers/labels.js";
12
- import { ProvidersSection, useAccountsSectionLabels } from "./sections/providers/ProvidersSection.js";
13
- import { ServerSignIn } from "./sections/providers/ServerSignIn.js";
14
11
  import { scopeLabel, useScopeLabel } from "./scope.js";
15
12
  import { SettingFocus, SettingsPanel, SettingsPanelActions, SettingsPanelBody, useSettingsSection } from "./section.js";
16
13
  import { useServerAppSettingsSections } from "./server-app.js";
17
14
  import { ScopeBadge, SettingBadges, SettingCard, SettingChoiceCards, SettingNoteLine } from "./SettingCard.js";
15
+ import { DEFAULT_ACCOUNTS_SECTION_LABELS } from "./sections/providers/labels.js";
16
+ import { ProvidersSection, useAccountsSectionLabels } from "./sections/providers/ProvidersSection.js";
17
+ import { ServerSignIn } from "./sections/providers/ServerSignIn.js";
18
18
  import { SettingDemo } from "./SettingDemo.js";
19
19
  import { AppUpdateButton, SettingsSetupRow, SettingsVersionRow } from "./SettingsFooter.js";
20
20
  import { SettingsHeadingText } from "./SettingsHeadingText.js";
@@ -276,7 +276,7 @@ function McpSection({ cwd: folder, intro, actions, className, style }) {
276
276
  className: "zg-tray rounded-zg-lg list-none m-0 p-1 flex flex-col gap-0.5",
277
277
  children: shown.map((server) => /* @__PURE__ */ jsx(McpServerRow, {
278
278
  server,
279
- enabled: enabled.has(server.name),
279
+ enabled: server.contributedBy !== void 0 || enabled.has(server.name),
280
280
  expanded: expanded.has(server.name),
281
281
  probing: probing.has(server.name),
282
282
  enabledTools: enabledMcpTools(server.name, server.tools ?? [], values?.disabledMcpTools),
@@ -286,10 +286,8 @@ function McpSection({ cwd: folder, intro, actions, className, style }) {
286
286
  ...signOut ? { onSignOut: () => handleSignOut(server.name) } : {},
287
287
  ...test ? { onTest: () => void handleProbe(server.name) } : {},
288
288
  onSignedIn: () => test ? void handleProbe(server.name) : void resource?.refresh(),
289
- ...canWriteSettings ? {
290
- onToggle: () => toggle(server.name),
291
- onToggleTool: (tool) => write("disabledMcpTools", toggleMcpTool(server.name, server.tools ?? [], values?.disabledMcpTools, tool))
292
- } : {},
289
+ ...canWriteSettings && server.contributedBy === void 0 ? { onToggle: () => toggle(server.name) } : {},
290
+ ...canWriteSettings ? { onToggleTool: (tool) => write("disabledMcpTools", toggleMcpTool(server.name, server.tools ?? [], values?.disabledMcpTools, tool)) } : {},
293
291
  onToggleExpanded: () => toggleExpanded(server.name),
294
292
  ...mcp?.remove ? { onArmRemove: (armed) => setRemoveArmed(armed ? server.name : null) } : {},
295
293
  onRemove: () => void handleRemove(server.name),