zidane 4.1.8 → 5.0.0

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 (66) hide show
  1. package/README.md +11 -2
  2. package/dist/{index-bgh-k8Mv.d.ts → agent-JhicgLOV.d.ts} +2082 -1969
  3. package/dist/agent-JhicgLOV.d.ts.map +1 -0
  4. package/dist/chat.d.ts +340 -9
  5. package/dist/chat.d.ts.map +1 -1
  6. package/dist/chat.js +2 -2
  7. package/dist/contexts.d.ts +1 -1
  8. package/dist/{index-DRoG_udt.d.ts → index-2yLUyTbc.d.ts} +34 -4
  9. package/dist/{index-DRoG_udt.d.ts.map → index-2yLUyTbc.d.ts.map} +1 -1
  10. package/dist/{index-BB4kuRh3.d.ts → index-CXVvqTQj.d.ts} +1 -1
  11. package/dist/{index-BB4kuRh3.d.ts.map → index-CXVvqTQj.d.ts.map} +1 -1
  12. package/dist/{index-Ds5YpvfZ.d.ts → index-t_W9i7Ql.d.ts} +9 -4
  13. package/dist/index-t_W9i7Ql.d.ts.map +1 -0
  14. package/dist/index.d.ts +4 -4
  15. package/dist/index.js +6 -6
  16. package/dist/{interpolate-CukJwP2G.js → interpolate-Ck970-61.js} +11 -2
  17. package/dist/interpolate-Ck970-61.js.map +1 -0
  18. package/dist/{mcp-8wClKY-3.js → mcp-Dw-fRPVk.js} +61 -65
  19. package/dist/mcp-Dw-fRPVk.js.map +1 -0
  20. package/dist/mcp.d.ts +1 -1
  21. package/dist/mcp.js +1 -1
  22. package/dist/presets-BRFH2qsQ.js +90 -0
  23. package/dist/presets-BRFH2qsQ.js.map +1 -0
  24. package/dist/presets.d.ts +3 -2
  25. package/dist/presets.js +2 -2
  26. package/dist/providers.d.ts +1 -1
  27. package/dist/session/sqlite.d.ts +13 -2
  28. package/dist/session/sqlite.d.ts.map +1 -1
  29. package/dist/session/sqlite.js +96 -38
  30. package/dist/session/sqlite.js.map +1 -1
  31. package/dist/{session-Cn68UASv.js → session-791hhrFa.js} +65 -30
  32. package/dist/session-791hhrFa.js.map +1 -0
  33. package/dist/session.d.ts +1 -1
  34. package/dist/session.js +1 -1
  35. package/dist/skills.d.ts +2 -2
  36. package/dist/skills.js +1 -1
  37. package/dist/{stats-BT9l57RS.js → stats-DZIsGqzu.js} +15 -5
  38. package/dist/stats-DZIsGqzu.js.map +1 -0
  39. package/dist/theme-pJv47erq.d.ts +1202 -0
  40. package/dist/theme-pJv47erq.d.ts.map +1 -0
  41. package/dist/{tools-C8kDot0H.js → tools-CLazLRb4.js} +475 -318
  42. package/dist/tools-CLazLRb4.js.map +1 -0
  43. package/dist/tools.d.ts +2 -2
  44. package/dist/tools.js +1 -1
  45. package/dist/tui.d.ts +303 -18
  46. package/dist/tui.d.ts.map +1 -1
  47. package/dist/tui.js +3305 -509
  48. package/dist/tui.js.map +1 -1
  49. package/dist/turn-operations-5aQu4dJg.js +3587 -0
  50. package/dist/turn-operations-5aQu4dJg.js.map +1 -0
  51. package/dist/types.d.ts +3 -3
  52. package/dist/types.js +1 -1
  53. package/package.json +6 -1
  54. package/dist/index-Ds5YpvfZ.d.ts.map +0 -1
  55. package/dist/index-bgh-k8Mv.d.ts.map +0 -1
  56. package/dist/interpolate-CukJwP2G.js.map +0 -1
  57. package/dist/mcp-8wClKY-3.js.map +0 -1
  58. package/dist/presets-BzkJDW1K.js +0 -39
  59. package/dist/presets-BzkJDW1K.js.map +0 -1
  60. package/dist/session-Cn68UASv.js.map +0 -1
  61. package/dist/stats-BT9l57RS.js.map +0 -1
  62. package/dist/theme-BlXO6yHe.d.ts +0 -503
  63. package/dist/theme-BlXO6yHe.d.ts.map +0 -1
  64. package/dist/theme-context-MungM3SY.js +0 -1713
  65. package/dist/theme-context-MungM3SY.js.map +0 -1
  66. package/dist/tools-C8kDot0H.js.map +0 -1
package/dist/tools.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as ToolDef, Q as ToolContext, et as ToolMap } from "./index-bgh-k8Mv.js";
2
- import { A as InteractionToolOptions, C as createSkillsRunScriptTool, D as readFile, E as shell, M as grep, N as glob, O as multiEdit, P as edit, S as SkillsRunScriptToolOptions, T as createSkillsReadTool, _ as SpawnToolOptions, b as SkillsUseToolOptions, d as ValidationResult, f as validateToolArgs, g as ChildAgent, h as createToolSearchTool, j as createInteractionTool, k as listFiles, m as ToolSearchToolOptions, p as LazyToolEntry, u as writeFile, v as SpawnToolState, w as SkillsReadToolOptions, x as createSkillsUseTool, y as createSpawnTool } from "./index-DRoG_udt.js";
1
+ import { _ as ToolContext, v as ToolDef, y as ToolMap } from "./agent-JhicgLOV.js";
2
+ import { A as listFiles, C as SkillsRunScriptToolOptions, D as shell, E as createSkillsReadTool, F as edit, M as createInteractionTool, N as grep, O as readFile, P as glob, S as createSkillsUseTool, T as SkillsReadToolOptions, _ as ChildAgent, b as createSpawnTool, d as writeFile, f as ValidationResult, g as createToolSearchTool, h as ToolSearchToolOptions, j as InteractionToolOptions, k as multiEdit, m as LazyToolEntry, p as validateToolArgs, v as SpawnToolOptions, w as createSkillsRunScriptTool, x as SkillsUseToolOptions, y as SpawnToolState } from "./index-2yLUyTbc.js";
3
3
  export { ChildAgent, InteractionToolOptions, LazyToolEntry, SkillsReadToolOptions, SkillsRunScriptToolOptions, SkillsUseToolOptions, SpawnToolOptions, SpawnToolState, ToolContext, ToolDef, ToolMap, ToolSearchToolOptions, ValidationResult, createInteractionTool, createSkillsReadTool, createSkillsRunScriptTool, createSkillsUseTool, createSpawnTool, createToolSearchTool, edit, glob, grep, listFiles, multiEdit, readFile, shell, validateToolArgs, writeFile };
package/dist/tools.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as multiEdit, c as grep, f as createToolSearchTool, g as validateToolArgs, h as createSkillsReadTool, i as readFile, l as glob, m as createSkillsRunScriptTool, n as createSpawnTool, o as listFiles, p as createSkillsUseTool, r as shell, s as createInteractionTool, t as writeFile, u as edit } from "./tools-C8kDot0H.js";
1
+ import { a as multiEdit, c as grep, f as createToolSearchTool, g as validateToolArgs, h as createSkillsReadTool, i as readFile, l as glob, m as createSkillsRunScriptTool, n as createSpawnTool, o as listFiles, p as createSkillsUseTool, r as shell, s as createInteractionTool, t as writeFile, u as edit } from "./tools-CLazLRb4.js";
2
2
  export { createInteractionTool, createSkillsReadTool, createSkillsRunScriptTool, createSkillsUseTool, createSpawnTool, createToolSearchTool, edit, glob, grep, listFiles, multiEdit, readFile, shell, validateToolArgs, writeFile };
package/dist/tui.d.ts CHANGED
@@ -1,8 +1,42 @@
1
- import { F as Picked, G as ModelInfo, L as SessionMeta, R as Settings, V as ProviderAuth, _ as ChatOptions, a as Theme, d as ApprovalRequest, u as ApprovalDecision, y as ResolvedConfig, z as StreamEvent } from "./theme-BlXO6yHe.js";
1
+ import { b as SkillConfig } from "./agent-JhicgLOV.js";
2
+ import { $ as Settings, C as DiscoveredMcp, Dt as AgentAccent, N as ResolvedConfig, O as EnabledAllowlistKey, Q as SessionMeta, S as splitPromptSegments, _t as ModelInfo, at as CompletionReference, b as PromptSegment, c as ThemeColors, et as StreamEvent, it as CompletionProvider, j as ChatOptions, kt as AgentRegistry, m as ApprovalRequest, ot as CompletionState, p as ApprovalDecision, pt as ProviderAuth, s as Theme, x as PromptSegmentRef } from "./theme-pJv47erq.js";
2
3
  import * as _$react from "react";
3
4
  import { ReactNode } from "react";
4
5
  import { SyntaxStyle } from "@opentui/core";
5
6
 
7
+ //#region src/tui/agent-picker.d.ts
8
+ /**
9
+ * Modal that lists the registered {@link AgentProfile}s and lets the user
10
+ * pick one. Rows show: `● selected · label description`.
11
+ *
12
+ * The accent column is intentionally compact (single-char marker) — the
13
+ * profile's `accent` color is read from the active theme so Build and Plan
14
+ * stand apart at a glance without taking horizontal space.
15
+ *
16
+ * Used by `App` (Ctrl+A binding) and exported for hosts that want to drive
17
+ * agent switching from elsewhere in their own composition.
18
+ */
19
+ declare function AgentPickerModal({
20
+ agents,
21
+ currentAgentId,
22
+ onPick
23
+ }: {
24
+ agents: AgentRegistry;
25
+ currentAgentId: string;
26
+ onPick: (id: string) => void;
27
+ }): _$react.ReactNode;
28
+ /**
29
+ * Resolve a profile's `accent` token to a concrete theme color via the
30
+ * caller's color palette. Exposed for the Footer badge so all surfaces
31
+ * stay in sync with the picker's row tinting.
32
+ */
33
+ declare function accentColor(accent: AgentAccent | undefined, COLOR: {
34
+ brand: string;
35
+ accent: string;
36
+ warn: string;
37
+ model: string;
38
+ }): string;
39
+ //#endregion
6
40
  //#region src/tui/app.d.ts
7
41
  /**
8
42
  * Top-level TUI component. Accepts a fully-resolved `ResolvedConfig` and wires
@@ -18,6 +52,41 @@ declare function App({
18
52
  config: ResolvedConfig;
19
53
  }): _$react.ReactNode;
20
54
  //#endregion
55
+ //#region src/tui/completion-popup.d.ts
56
+ /**
57
+ * Popover above the textarea showing the active provider's items. Provider-
58
+ * agnostic — reads `label` + `description` off each `CompletionItem`. The
59
+ * TUI hosts can pass any `CompletionState<TItem>`; the popup never needs
60
+ * to know what `TItem` is.
61
+ *
62
+ * Geometry: 1 row of chrome + min(N, visibleRows) item rows + 1 hint row.
63
+ * `flexShrink: 0` pins the height so a long transcript can't squeeze it.
64
+ *
65
+ * The popup is invisible (`null`-rendered) when `state.active` is null or
66
+ * `state.items` is empty — the prompt block keeps its layout calm.
67
+ *
68
+ * Solid `backgroundColor: SURFACE.modal` is load-bearing: in `PromptBlock`
69
+ * the popup floats over the transcript via `position: absolute`, and a
70
+ * transparent fill would let the transcript text bleed through. Pairs
71
+ * with the modal panel surface so floating UI shares one visual identity.
72
+ *
73
+ * Title overlays are painted on the top border (same trick as
74
+ * `PromptHints`): provider label on the left in the chip-id's accent
75
+ * color, match count on the right in dim text. Both ride absolute
76
+ * positions so they take no flow space; the popup's height comes
77
+ * entirely from the bordered body. The accent reuses
78
+ * `resolveChipColor(...).bg` (foreground only, no background pill) so
79
+ * the picker title still reads as "this is the X provider" without
80
+ * carrying the chip pill's heavy visual weight.
81
+ */
82
+ declare function CompletionPopup({
83
+ state,
84
+ /** Cap on visible rows. 6 keeps the popover compact even with long catalogs. */visibleRows
85
+ }: {
86
+ state: CompletionState<unknown>;
87
+ visibleRows?: number;
88
+ }): ReactNode;
89
+ //#endregion
21
90
  //#region src/tui/components.d.ts
22
91
  /**
23
92
  * `@opentui/react` extends `React.JSX.IntrinsicElements`, so `onSubmit` on `<input>`
@@ -29,32 +98,70 @@ declare function onInputSubmit(handler: (value: string) => void): never;
29
98
  interface Hint {
30
99
  key: string;
31
100
  label: string;
101
+ /** Optional override for the key color. Defaults to `COLOR.warn`. */
102
+ keyColor?: string;
103
+ /** Optional override for the label color. Defaults to `COLOR.dim`. */
104
+ labelColor?: string;
32
105
  }
33
106
  interface ContextUsage {
34
107
  used: number;
35
108
  max: number;
36
109
  }
110
+ /**
111
+ * Footer status bar. Renders as a single row when the terminal is wide
112
+ * enough, otherwise stacks the context indicator beneath the hint row.
113
+ * Width tiering is driven by plain-text length estimates — close enough
114
+ * since the segments are ASCII-heavy.
115
+ */
37
116
  declare function Footer({
38
117
  hints,
39
- picked,
40
118
  context
41
119
  }: {
42
120
  hints: Hint[];
43
- picked: Picked | null;
44
121
  context: ContextUsage | null;
45
- }): _$react.ReactNode;
122
+ }): ReactNode;
123
+ /**
124
+ * Pure renderer for a list of {@link Hint}s as colored spans —
125
+ * `<key1> <label1> · <key2> <label2> · …` with warn/dim/mute colors.
126
+ *
127
+ * Returns spans only (no enclosing `<text>`, no leading / trailing
128
+ * whitespace) so the caller can wrap it in whichever container fits
129
+ * their surface: the bottom-bar footer uses a single-row `<text>`, the
130
+ * prompt-box overlay wraps it with leading + trailing spaces so the
131
+ * outermost cells punch through the border like a native title would.
132
+ *
133
+ * Pattern matches `renderRefSpans` below — pure function over an opaque
134
+ * `ThemeColors`, no internal hook calls so it composes inside any
135
+ * `<text>` regardless of where the parent grabbed its palette.
136
+ */
137
+ declare function renderHintSpans(hints: readonly Hint[], COLOR: ThemeColors): ReactNode;
138
+ /**
139
+ * Plain-text width estimate for a list of {@link Hint}s rendered via
140
+ * `renderHintSpans` — `<key> <label> · <key> <label> · …`. Exported so
141
+ * the prompt-box overlay (in `screens.tsx`) can run the same responsive
142
+ * math as the bottom-bar footer when deciding whether trigger hints
143
+ * fit. Pure / total.
144
+ */
145
+ declare function hintsLength(hints: readonly Hint[]): number;
46
146
  declare function Spinner({
47
147
  label
48
148
  }: {
49
149
  label: string;
50
- }): _$react.ReactNode;
150
+ }): ReactNode;
51
151
  declare function Transcript({
52
152
  events,
53
- settings
153
+ settings,
154
+ selectedTurnId
54
155
  }: {
55
156
  events: StreamEvent[];
56
157
  settings: Settings;
57
- }): _$react.ReactNode;
158
+ /**
159
+ * Turn id whose events should render with the selection accent bar. `null`
160
+ * leaves every event unhighlighted (normal mode). Events without a turnId
161
+ * (synthetic markers) are never highlighted.
162
+ */
163
+ selectedTurnId?: string | null;
164
+ }): ReactNode;
58
165
  /**
59
166
  * Per-event visibility — filters honor user toggles and the
60
167
  * `hideSubagentOutput` setting. When subagent output is hidden:
@@ -89,6 +196,23 @@ declare function isVisible(event: StreamEvent, settings: Settings): boolean;
89
196
  */
90
197
  declare function marginTopFor(event: StreamEvent, previous: StreamEvent | undefined): number;
91
198
  //#endregion
199
+ //#region src/tui/mcps-settings.d.ts
200
+ /**
201
+ * List + toggle modal for MCP servers discovered from `.{prefix}/mcps.json`
202
+ * / `.agents/mcps.json` (project + user). State machine lives in
203
+ * `<ToggleListModal>` (shared with the Skills picker); this file supplies
204
+ * the transport/command detail column and the empty-state copy.
205
+ *
206
+ * Toggling does NOT restart the active agent — the change applies on the
207
+ * next session activation (the app rebuilds the agent there), keeping
208
+ * current runs stable.
209
+ */
210
+ declare function McpsSettingsModal({
211
+ catalog
212
+ }: {
213
+ catalog: readonly DiscoveredMcp[];
214
+ }): _$react.ReactNode;
215
+ //#endregion
92
216
  //#region src/tui/modal.d.ts
93
217
  interface ModalApi {
94
218
  open: (node: ReactNode) => void;
@@ -113,33 +237,70 @@ declare function useModal(): ModalApi;
113
237
  declare function useModalAwareFocus(preferred?: boolean): boolean;
114
238
  interface ModalProps {
115
239
  title?: string;
240
+ /**
241
+ * Secondary label rendered on the bottom border, right-aligned. Use it
242
+ * for status / counter info that complements the top title (e.g.
243
+ * "3 before · 6 after" on the turn-details modal). Kept short — long
244
+ * strings collide with the bottom-right corner glyph.
245
+ */
246
+ bottomTitle?: string;
116
247
  /** Called when the user presses esc. Defaults to `useModal().close()` if available. */
117
248
  onClose?: () => void;
249
+ /**
250
+ * When true, Modal's built-in Esc-to-close handler is suppressed for
251
+ * this render. The child stays free to register its own `useKeyboard`
252
+ * and handle Esc however it wants (cancel a pending confirmation,
253
+ * block dismissal mid-async, …). `@opentui/react`'s `useKeyboard`
254
+ * registers independent listeners with no propagation, so a child's
255
+ * `return` inside its own handler can't stop this Modal's default
256
+ * handler from firing on the same keystroke — `disableEscape` is the
257
+ * declarative escape hatch that closes that race.
258
+ */
259
+ disableEscape?: boolean;
118
260
  children: ReactNode;
119
261
  /** Preferred width in columns. Modal grows to this when the terminal allows. */
120
262
  maxWidth?: number;
121
263
  /** Floor on the width, so content stays minimally legible. */
122
264
  minWidth?: number;
265
+ /**
266
+ * Hard cap on the modal's height in rows. When set, the modal grows
267
+ * to this size when the terminal allows and shrinks down to fit on
268
+ * smaller screens. Without it, the modal grows to fit its children
269
+ * (uncapped) — fine for picker-style modals, problematic for
270
+ * unbounded content (long turn previews, etc.) where the modal could
271
+ * exceed the viewport and bury its esc-hint footer.
272
+ */
273
+ maxHeight?: number;
123
274
  /** Columns of breathing room kept on each side of the modal. */
124
275
  horizontalMargin?: number;
276
+ /** Rows of breathing room kept above + below the modal when `maxHeight` is set. */
277
+ verticalMargin?: number;
125
278
  }
126
279
  /**
127
- * Responsive modal — picks a width based on the live terminal size.
280
+ * Responsive modal — picks a width (and optionally a height) based on the
281
+ * live terminal size.
128
282
  *
129
283
  * - On a wide terminal, the modal grows to `maxWidth` so descriptions sit on
130
284
  * one line and don't wrap.
131
285
  * - On a narrow terminal, the modal shrinks down to `minWidth`, keeping a
132
286
  * small horizontal margin from the screen edges. Text inside wraps naturally.
287
+ * - When `maxHeight` is set, the same tier logic applies on the vertical
288
+ * axis — anything beyond is the consumer's job (typically a `scrollbox`
289
+ * child for long content).
133
290
  *
134
291
  * Uses `useTerminalDimensions()` so it reflows on `SIGWINCH` without remount.
135
292
  */
136
293
  declare function Modal({
137
294
  title,
295
+ bottomTitle,
138
296
  onClose,
297
+ disableEscape,
139
298
  children,
140
299
  maxWidth,
141
300
  minWidth,
142
- horizontalMargin
301
+ maxHeight,
302
+ horizontalMargin,
303
+ verticalMargin
143
304
  }: ModalProps): ReactNode;
144
305
  //#endregion
145
306
  //#region src/tui/model-picker.d.ts
@@ -170,13 +331,42 @@ declare function AuthScreen({
170
331
  declare function SessionsScreen({
171
332
  sessions,
172
333
  currentId,
334
+ focusedSessionId,
173
335
  onPick,
174
- onCreate
336
+ onCreate,
337
+ onFocusChange,
338
+ showAllProjects,
339
+ currentProjectRoot
175
340
  }: {
176
341
  sessions: SessionMeta[];
342
+ /**
343
+ * Identity of the row the parent considers focused. Drives the row
344
+ * cursor so the highlight follows the SESSION (not its slot) when the
345
+ * list reorders. `null` lands the cursor on the first session row, or
346
+ * on "+ new" if there are no sessions yet.
347
+ */
348
+ focusedSessionId: string | null;
177
349
  currentId: string | null;
178
350
  onPick: (id: string) => void;
179
351
  onCreate: () => void;
352
+ /**
353
+ * Notified as the user navigates between rows. Receives the session id
354
+ * of the focused row, or `null` when "+ new" is focused (no session to
355
+ * act on). Parents use this to wire `ctrl+x` against the live focus.
356
+ */
357
+ onFocusChange?: (id: string | null) => void;
358
+ /**
359
+ * When `true`, render each session's project label under the title.
360
+ * Off by default — when the list is already filtered to one project
361
+ * the label would just repeat that project on every row.
362
+ */
363
+ showAllProjects?: boolean;
364
+ /**
365
+ * Current project root, used to label "this project" on rows that
366
+ * belong to it when `showAllProjects` is on. Untagged (legacy)
367
+ * sessions render as "untagged".
368
+ */
369
+ currentProjectRoot?: string;
180
370
  }): ReactNode;
181
371
  declare function ChatScreen({
182
372
  events,
@@ -185,15 +375,52 @@ declare function ChatScreen({
185
375
  onSubmit,
186
376
  session,
187
377
  pending,
188
- onApproval
378
+ onApproval,
379
+ completionProviders,
380
+ onPopupOpenChange,
381
+ selectedTurnId,
382
+ promptTriggerHints
189
383
  }: {
190
384
  events: StreamEvent[];
191
385
  busy: boolean;
192
386
  settings: Settings;
193
- onSubmit: (prompt: string) => void;
387
+ /**
388
+ * Submit handler — receives the raw prompt text and the parsed references
389
+ * (skills, files, …) so the App can act on them (e.g. activate the
390
+ * referenced skill before `agent.run()`).
391
+ */
392
+ onSubmit: (prompt: string, references: readonly CompletionReference<unknown>[]) => void;
194
393
  session: SessionMeta | null; /** Head of the safe-mode approval queue, or `null` when nothing is pending. */
195
394
  pending: ApprovalRequest | null; /** Resolve the active prompt with the user's pick. */
196
395
  onApproval: (decision: ApprovalDecision) => void;
396
+ /**
397
+ * Optional autocomplete providers. When passed, `PromptBlock` shows a
398
+ * popup above the textarea and intercepts navigation keys while it's
399
+ * visible. Providers are typed by their item payload (e.g.
400
+ * `CompletionProvider<SkillConfig>`).
401
+ */
402
+ completionProviders?: readonly CompletionProvider<unknown>[];
403
+ /**
404
+ * Notified whenever the popup opens / closes. The App uses this to gate
405
+ * the esc-abort handler so esc dismisses the popup instead of aborting
406
+ * the run when both could fire.
407
+ */
408
+ onPopupOpenChange?: (open: boolean) => void;
409
+ /**
410
+ * Active turn id when the user is in select-turn mode. `null` = normal
411
+ * mode. Drives the transcript highlight and unfocuses the textarea so
412
+ * up/down/return reach the parent's keyboard handler instead of being
413
+ * consumed by the input.
414
+ */
415
+ selectedTurnId?: string | null;
416
+ /**
417
+ * Optional trigger affordances (e.g. `@ files`, `/ skills`) appended
418
+ * to the prompt-box overlay's hint row when there's room. Caller
419
+ * filters by provider availability (don't include `/ skills` if the
420
+ * skills catalog is empty, etc.) — the prompt overlay drops the
421
+ * triggers entirely on narrow terminals.
422
+ */
423
+ promptTriggerHints?: readonly Hint[];
197
424
  }): ReactNode;
198
425
  //#endregion
199
426
  //#region src/tui/settings-modal.d.ts
@@ -204,6 +431,15 @@ interface SettingsActions {
204
431
  * "Re-configure providers" row to the modal.
205
432
  */
206
433
  onReauth?: () => void;
434
+ /**
435
+ * Open the Skills list + toggle modal. Adds a "Skills" row when wired.
436
+ */
437
+ onOpenSkills?: () => void;
438
+ /**
439
+ * Open the MCP servers list + toggle modal. Adds an "MCP servers" row
440
+ * when wired.
441
+ */
442
+ onOpenMcps?: () => void;
207
443
  }
208
444
  declare function SettingsModal({
209
445
  actions
@@ -211,6 +447,18 @@ declare function SettingsModal({
211
447
  actions?: SettingsActions;
212
448
  }): _$react.ReactNode;
213
449
  //#endregion
450
+ //#region src/tui/skills-settings.d.ts
451
+ /**
452
+ * List + toggle modal for discovered skills. State machine + keyboard +
453
+ * row geometry live in `<ToggleListModal>`; this file just supplies the
454
+ * skill-specific column (description) and the empty-state hint.
455
+ */
456
+ declare function SkillsSettingsModal({
457
+ catalog
458
+ }: {
459
+ catalog: readonly SkillConfig[];
460
+ }): _$react.ReactNode;
461
+ //#endregion
214
462
  //#region src/tui/theme.d.ts
215
463
  /**
216
464
  * Convert the renderer-agnostic `Theme.syntax` map (hex strings + plain
@@ -222,12 +470,48 @@ declare function SettingsModal({
222
470
  */
223
471
  declare function buildMdStyle(theme: Theme): SyntaxStyle;
224
472
  /**
225
- * Active markdown / syntax-highlighting style, memoized per theme. Reading
226
- * this in a component subscribes it to theme changes a `Settings.theme`
227
- * flip immediately re-renders the affected `<markdown>` instances.
473
+ * Active markdown / syntax-highlighting style. Returns a single shared
474
+ * `SyntaxStyle` instance for the active theme built once at provider
475
+ * mount, re-built on theme switch. A `Settings.theme` flip re-paints every
476
+ * `<markdown>` that reads this hook.
477
+ *
478
+ * Throws if used outside `<MdStyleProvider>` so a missing wiring shows up
479
+ * loudly in development rather than silently rendering plain text.
228
480
  */
229
481
  declare function useMdStyle(): SyntaxStyle;
230
482
  //#endregion
483
+ //#region src/tui/toggle-list-modal.d.ts
484
+ /**
485
+ * Generic list-with-checkboxes modal. Powers both the Skills and MCP
486
+ * server pickers — same state machine, same keyboard map, same row
487
+ * geometry. Per-feature variance flows in through props:
488
+ *
489
+ * - `keyOf` — extract the persisted identity (skill name, server name).
490
+ * - `settingKey` — `'enabledSkills'` | `'enabledMcps'`.
491
+ * - `renderDetail` — appended to each row in mute color (descriptions,
492
+ * transports, …). Optional.
493
+ * - `emptyState` — replacement content when `catalog` is empty.
494
+ *
495
+ * Renderer-agnostic state machine lives in `useEnabledToggleSet`
496
+ * (chat layer) — a GUI shell can build its own toggle list against the
497
+ * same hook without pulling OpenTUI.
498
+ */
499
+ declare function ToggleListModal<T>({
500
+ catalog,
501
+ keyOf,
502
+ settingKey,
503
+ title,
504
+ renderDetail,
505
+ emptyState
506
+ }: {
507
+ catalog: readonly T[];
508
+ keyOf: (entry: T) => string;
509
+ settingKey: EnabledAllowlistKey; /** Modal title stem — rendered as `${title} · N / M enabled` in non-empty mode. */
510
+ title: string; /** Mute-colored trailing copy for each row (description, transport, …). */
511
+ renderDetail?: (entry: T) => ReactNode; /** What to render when `catalog` is empty (hint about where to drop config). */
512
+ emptyState: ReactNode;
513
+ }): ReactNode;
514
+ //#endregion
231
515
  //#region src/tui/index.d.ts
232
516
  /**
233
517
  * Boot a full chat TUI with sensible defaults. **Does not return** under
@@ -257,7 +541,7 @@ declare function useMdStyle(): SyntaxStyle;
257
541
  * to `runTui({ storageDir, prefix })`.
258
542
  *
259
543
  * ```ts
260
- * import { BUILTIN_PROVIDERS } from 'zidane/chat'
544
+ * import { BUILTIN_AGENTS, BUILTIN_PROVIDERS } from 'zidane/chat'
261
545
  * import { runTui } from 'zidane/tui'
262
546
  * import { createRemoteStore } from 'zidane/session' // for the `store` option
263
547
  *
@@ -266,9 +550,10 @@ declare function useMdStyle(): SyntaxStyle;
266
550
  * await runTui({ storageDir: '/data', prefix: 'myapp' })
267
551
  * await runTui({ providers: { ...BUILTIN_PROVIDERS, mine: myDescriptor } })
268
552
  * await runTui({ store: createRemoteStore({ url: '…' }) })
553
+ * await runTui({ agents: { ...BUILTIN_AGENTS, debug: myDebugProfile } })
269
554
  * ```
270
555
  */
271
- declare function runTui(options?: ChatOptions): Promise<never>;
556
+ declare function runTui(options?: Partial<ChatOptions>): Promise<never>;
272
557
  //#endregion
273
- export { App, AuthScreen, ChatScreen, type ContextUsage, Footer, type Hint, Modal, type ModalProps, ModalRoot, ModelPickerModal, SessionsScreen, type SettingsActions, SettingsModal, Spinner, Transcript, buildMdStyle, isVisible, marginTopFor, onInputSubmit, runTui, useMdStyle, useModal, useModalAwareFocus };
558
+ export { AgentPickerModal, App, AuthScreen, ChatScreen, CompletionPopup, type ContextUsage, Footer, type Hint, McpsSettingsModal, Modal, type ModalProps, ModalRoot, ModelPickerModal, type PromptSegment, type PromptSegmentRef, SessionsScreen, type SettingsActions, SettingsModal, SkillsSettingsModal, Spinner, ToggleListModal, Transcript, accentColor, buildMdStyle, hintsLength, isVisible, marginTopFor, onInputSubmit, renderHintSpans, runTui, splitPromptSegments, useMdStyle, useModal, useModalAwareFocus };
274
559
  //# sourceMappingURL=tui.d.ts.map
package/dist/tui.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tui.d.ts","names":[],"sources":["../src/tui/app.tsx","../src/tui/components.tsx","../src/tui/modal.tsx","../src/tui/model-picker.tsx","../src/tui/screens.tsx","../src/tui/settings-modal.tsx","../src/tui/theme.ts","../src/tui/index.tsx"],"mappings":";;;;;;;;;;;AAyDA;;;iBAAgB,GAAA,CAAA;EAAM;AAAA;EAAY,MAAA,EAAQ,cAAA;AAAA,IAAc,OAAA,CAAE,SAAA;;;;;;;;AAA1D;iBCRgB,aAAA,CAAc,OAAA,GAAU,KAAA;AAAA,UASvB,IAAA;EACf,GAAA;EACA,KAAA;AAAA;AAAA,UAGe,YAAA;EACf,IAAA;EACA,GAAA;AAAA;AAAA,iBAGc,MAAA,CAAA;EACd,KAAA;EACA,MAA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AA,GAAS,CAAA,EAAG,YAAA;AAAA,IAAuB,SAAA;AAAA,iBA4e5D,cAAA,CAAA;EACd,QAAA;EACA,SAAA;EACA,MAAA;EACA;AAAA;EAEA,QAAA,EAAU,WAAA;EACV,SAAA;EACA,MAAA,GAAS,EAAA;EACT,QAAA;AAAA,IACD,SAAA;AAAA,iBA2De,UAAA,CAAA;EACd,MAAA;EACA,IAAA;EACA,QAAA;EACA,QAAA;EACA,OAAA;EACA,OAAA;EACA;AAAA;EAEA,MAAA,EAAQ,WAAA;EACR,IAAA;EACA,QAAA,EAAU,QAAA;EACV,QAAA,GAAW,MAAA;EACX,OAAA,EAAS,WAAA,SJ5jB6C;EI8jBtD,OAAA,EAAS,eAAA;EAET,UAAA,GAAa,QAAA,EAAU,gBAAA;AAAA,IACxB,SAAA;;;UC3kBgB,eAAA;;;;;;EAMf,QAAA;AAAA;AAAA,iBAGc,aAAA,CAAA;EAAgB;AAAA;EAAa,OAAA,GAAU,eAAA;AAAA,IAAe,OAAA,CAAO,SAAA;;;;;;;ALC7E;;;;iBM5CgB,YAAA,CAAa,KAAA,EAAO,KAAA,GAAQ,WAAA;;;;;;iBAkC5B,UAAA,CAAA,GAAc,WAAA;;;;;;;;ANU9B;;;;;;;;;;;;;;;;;;ACRA;;;;;AASA;;;;;AAKA;;;;;AAKA;iBMFsB,MAAA,CAAO,OAAA,GAAS,WAAA,GAAmB,OAAA"}
1
+ {"version":3,"file":"tui.d.ts","names":[],"sources":["../src/tui/agent-picker.tsx","../src/tui/app.tsx","../src/tui/completion-popup.tsx","../src/tui/components.tsx","../src/tui/mcps-settings.tsx","../src/tui/modal.tsx","../src/tui/model-picker.tsx","../src/tui/screens.tsx","../src/tui/settings-modal.tsx","../src/tui/skills-settings.tsx","../src/tui/theme.ts","../src/tui/toggle-list-modal.tsx","../src/tui/index.tsx"],"mappings":";;;;;;;;;;;;;AAoBA;;;;;iBAAgB,gBAAA,CAAA;EACd,MAAA;EACA,cAAA;EACA;AAAA;EAE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