zidane 4.1.5 → 4.1.7

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 (45) hide show
  1. package/dist/chat.d.ts +305 -0
  2. package/dist/chat.d.ts.map +1 -0
  3. package/dist/chat.js +2 -0
  4. package/dist/contexts.d.ts +1 -1
  5. package/dist/{index-BfSdALzk.d.ts → index-BB4kuRh3.d.ts} +1 -1
  6. package/dist/{index-BfSdALzk.d.ts.map → index-BB4kuRh3.d.ts.map} +1 -1
  7. package/dist/{index-28otmfLX.d.ts → index-DRoG_udt.d.ts} +42 -42
  8. package/dist/index-DRoG_udt.d.ts.map +1 -0
  9. package/dist/{index-DPsd0qwm.d.ts → index-Ds5YpvfZ.d.ts} +3 -3
  10. package/dist/{index-DPsd0qwm.d.ts.map → index-Ds5YpvfZ.d.ts.map} +1 -1
  11. package/dist/{agent-BoV5Twdl.d.ts → index-bgh-k8Mv.d.ts} +1989 -1963
  12. package/dist/index-bgh-k8Mv.d.ts.map +1 -0
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +3 -3
  15. package/dist/mcp.d.ts +1 -1
  16. package/dist/{presets-Cs7_CsMk.js → presets-BzkJDW1K.js} +3 -3
  17. package/dist/presets-BzkJDW1K.js.map +1 -0
  18. package/dist/presets.d.ts +1 -1
  19. package/dist/presets.js +1 -1
  20. package/dist/providers.d.ts +1 -1
  21. package/dist/session/sqlite.d.ts +1 -1
  22. package/dist/session.d.ts +1 -1
  23. package/dist/skills.d.ts +2 -2
  24. package/dist/{stats-DoKUtF5T.js → stats-BT9l57RS.js} +34 -2
  25. package/dist/stats-BT9l57RS.js.map +1 -0
  26. package/dist/theme-BlXO6yHe.d.ts +503 -0
  27. package/dist/theme-BlXO6yHe.d.ts.map +1 -0
  28. package/dist/theme-context-MungM3SY.js +1713 -0
  29. package/dist/theme-context-MungM3SY.js.map +1 -0
  30. package/dist/{tools-DpeWKzP1.js → tools-C8kDot0H.js} +73 -23
  31. package/dist/tools-C8kDot0H.js.map +1 -0
  32. package/dist/tools.d.ts +2 -2
  33. package/dist/tools.js +1 -1
  34. package/dist/tui.d.ts +51 -499
  35. package/dist/tui.d.ts.map +1 -1
  36. package/dist/tui.js +687 -931
  37. package/dist/tui.js.map +1 -1
  38. package/dist/types.d.ts +3 -3
  39. package/dist/types.js +1 -1
  40. package/package.json +6 -3
  41. package/dist/agent-BoV5Twdl.d.ts.map +0 -1
  42. package/dist/index-28otmfLX.d.ts.map +0 -1
  43. package/dist/presets-Cs7_CsMk.js.map +0 -1
  44. package/dist/stats-DoKUtF5T.js.map +0 -1
  45. package/dist/tools-DpeWKzP1.js.map +0 -1
package/dist/tools.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as ToolDef, g as ToolContext, v as ToolMap } from "./agent-BoV5Twdl.js";
2
- import { A as edit, C as readFile, D as createInteractionTool, E as InteractionToolOptions, O as grep, S as shell, T as listFiles, _ as createSkillsUseTool, b as SkillsReadToolOptions, c as validateToolArgs, d as createToolSearchTool, f as ChildAgent, g as SkillsUseToolOptions, h as createSpawnTool, k as glob, l as LazyToolEntry, m as SpawnToolState, o as writeFile, p as SpawnToolOptions, s as ValidationResult, u as ToolSearchToolOptions, v as SkillsRunScriptToolOptions, w as multiEdit, x as createSkillsReadTool, y as createSkillsRunScriptTool } from "./index-28otmfLX.js";
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";
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-DpeWKzP1.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-C8kDot0H.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,320 +1,8 @@
1
- import { Et as SessionTurn, H as Provider, It as TurnUsage, Mt as ToolResultContent, O as SessionStore } from "./agent-BoV5Twdl.js";
2
- import { P as Preset } from "./index-28otmfLX.js";
3
- import { OAuthCredentials, OAuthProviderInterface } from "@mariozechner/pi-ai/oauth";
4
- import { SyntaxStyle } from "@opentui/core";
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";
5
2
  import * as _$react from "react";
6
- import { Dispatch, ReactNode, SetStateAction } from "react";
3
+ import { ReactNode } from "react";
4
+ import { SyntaxStyle } from "@opentui/core";
7
5
 
8
- //#region src/tui/providers.d.ts
9
- /**
10
- * Structural model metadata — compatible with pi-ai's `Model` interface but
11
- * not coupled to it, so hosts can pass either pi-ai-shaped objects or a
12
- * custom registry of their own.
13
- *
14
- * Deliberately a structural duplicate of pi-ai's `Model` rather than a
15
- * re-export: keeps the public API stable when pi-ai bumps shape, and lets
16
- * hosts implement their own registry without depending on pi-ai's types.
17
- *
18
- * Lives here (rather than `./config`) because `ProviderDescriptor.models`
19
- * needs it — pushing it to `config.tsx` created an import cycle.
20
- */
21
- interface ModelInfo {
22
- id: string;
23
- name?: string;
24
- contextWindow: number;
25
- maxTokens?: number;
26
- reasoning?: boolean;
27
- input?: readonly ('text' | 'image')[];
28
- cost?: {
29
- input: number;
30
- output: number;
31
- cacheRead?: number;
32
- cacheWrite?: number;
33
- };
34
- provider?: string;
35
- }
36
- interface ProviderDescriptor {
37
- /**
38
- * Unique identifier. Used as the registry key, persisted in `state.json`
39
- * as the resumed provider, and (by default) as the credential-file key.
40
- */
41
- key: string;
42
- /** Display name shown in the TUI's provider picker and labels. */
43
- label: string;
44
- /**
45
- * Factory that builds a fresh `Provider` instance. Called on every session
46
- * activation. Some factories (e.g. zidane's built-in `anthropic`) eagerly
47
- * resolve credentials at construction time and throw when none are
48
- * configured — set {@link defaultModel} on the descriptor to avoid the TUI
49
- * calling the factory before the user has picked + authed a provider.
50
- */
51
- factory: () => Provider;
52
- /**
53
- * Default model id to seed the picker with. When omitted, the TUI falls
54
- * back to `descriptor.factory().meta.defaultModel`, which constructs the
55
- * provider — fine for lazy-credential factories, but breaks for factories
56
- * that throw on missing credentials before the wizard runs. Setting this
57
- * eagerly lets the TUI render the auth wizard without ever instantiating
58
- * the provider.
59
- */
60
- defaultModel?: string;
61
- /**
62
- * Env var checked when detecting whether the user has an API key
63
- * configured for this provider. Optional — set to `undefined` when the
64
- * provider only supports OAuth (or only credentials via a custom path).
65
- */
66
- envKey?: string;
67
- /**
68
- * Key under which credentials live in `credentials.json`. Defaults to
69
- * `key`. The only built-in that overrides this is OpenAI Codex
70
- * (`openai` → `openai-codex`) to stay compatible with the harness
71
- * provider's existing lookup.
72
- */
73
- credentialFileKey?: string;
74
- /** Placeholder shown in the wizard's API-key input. */
75
- apiKeyPlaceholder?: string;
76
- /**
77
- * pi-ai (or compat) OAuth provider. When present, the wizard offers an
78
- * OAuth option in addition to API key.
79
- */
80
- oauthProvider?: OAuthProviderInterface;
81
- /**
82
- * Optional copy appended to the wizard's "OAuth" method description.
83
- * Use to communicate why a user might pick OAuth (e.g. subscription tier,
84
- * org-wide SSO). Shown after `browser-based sign-in`. Skip the leading
85
- * space — the wizard adds it. Example: `'Claude Pro/Max subscription'`.
86
- */
87
- oauthHint?: string;
88
- /**
89
- * pi-ai provider id used to look up models in pi-ai's built-in registry.
90
- * Defaults to `key`. Only Codex differs (`openai` → `openai-codex`).
91
- */
92
- piProviderId?: string;
93
- /**
94
- * Override the model list returned for this provider's picker. When set,
95
- * skips pi-ai's registry entirely. Useful for hosts maintaining their
96
- * own model catalogue or for custom providers pi-ai doesn't know about.
97
- */
98
- models?: readonly ModelInfo[];
99
- }
100
- /** Convenience accessor — returns `credentialFileKey ?? key`. */
101
- declare function credKeyOf(desc: ProviderDescriptor): string;
102
- /** Convenience accessor — returns `piProviderId ?? key`. */
103
- declare function piIdOf(desc: ProviderDescriptor): string;
104
- declare const anthropicDescriptor: ProviderDescriptor;
105
- declare const openaiDescriptor: ProviderDescriptor;
106
- declare const openrouterDescriptor: ProviderDescriptor;
107
- declare const cerebrasDescriptor: ProviderDescriptor;
108
- /**
109
- * Default provider registry. Passed verbatim when `runTui` is invoked without
110
- * an explicit `providers` option. Hosts that want to override per-provider
111
- * metadata can spread this and replace specific entries:
112
- *
113
- * ```ts
114
- * runTui({ providers: { ...BUILTIN_PROVIDERS, anthropic: myOwnAnthropicDescriptor } })
115
- * ```
116
- */
117
- declare const BUILTIN_PROVIDERS: Readonly<Record<string, ProviderDescriptor>>;
118
- /**
119
- * Resolve the model list for a given provider. Honors `descriptor.models`
120
- * when set; otherwise queries pi-ai via `descriptor.piProviderId`. Returns
121
- * `[]` for descriptors with no known mapping (custom providers without a
122
- * model list) — callers should hide the model picker in that case.
123
- */
124
- declare function modelsForDescriptor(descriptor: ProviderDescriptor): readonly ModelInfo[];
125
- /**
126
- * Look up the model's max context window via the descriptor's model source.
127
- * Returns `null` when the model isn't known (custom slugs, providers without
128
- * a registry); callers should hide the context indicator in that case.
129
- */
130
- declare function getContextWindow(descriptor: ProviderDescriptor, modelId: string): number | null;
131
- //#endregion
132
- //#region src/tui/auth.d.ts
133
- /**
134
- * Provider identifier as known to the TUI. Built-in keys are `anthropic`,
135
- * `openai`, `openrouter`, `cerebras`, but hosts can register additional
136
- * keys via {@link ProviderDescriptor} — so the type is open.
137
- */
138
- type ProviderKey = string;
139
- interface AuthMethod {
140
- source: 'env' | 'oauth' | 'apikey';
141
- /** Human-readable detail (env var name, expiry timestamp, …). */
142
- detail: string;
143
- }
144
- interface ProviderAuth {
145
- key: ProviderKey;
146
- label: string;
147
- /** True when at least one credential source is present. */
148
- available: boolean;
149
- methods: AuthMethod[];
150
- }
151
- /**
152
- * Detect available auth for every registered provider.
153
- *
154
- * Resolution order per provider (a method appears in `methods` for each
155
- * layer that has a credential — the agent itself resolves them in the same
156
- * order via its provider factories):
157
- *
158
- * 1. `kind: 'apikey'` from `credentials.json` (injected into env at TUI launch)
159
- * 2. explicit env var (descriptor's `envKey`)
160
- * 3. `kind: 'oauth'` from `credentials.json` (or legacy `cwd/.credentials.json`)
161
- *
162
- * Pure read — never refreshes or rewrites the credentials file.
163
- */
164
- declare function detectAuth(dataDir: string, registry: Readonly<Record<string, ProviderDescriptor>>, env?: Record<string, string | undefined>): ProviderAuth[];
165
- //#endregion
166
- //#region src/tui/types.d.ts
167
- type Screen = 'auth' | 'sessions' | 'chat';
168
- /** Identifies the agent that produced a streaming event. */
169
- type Owner = 'parent' | string;
170
- interface StreamEvent {
171
- kind: 'thinking' | 'tool' | 'tool-result' | 'error' | 'info' | 'separator' | 'markdown' | 'spawn-start' | 'spawn-end';
172
- text: string;
173
- /**
174
- * For `markdown` events: true while the block is still receiving deltas.
175
- * The renderer applies `md4x.heal()` and keeps OpenTUI's markdown parser in
176
- * streaming mode while this is true. Flipped to false on `turn:after`.
177
- */
178
- streaming?: boolean;
179
- /** Subagent that produced this event. Absent / 'parent' = top-level agent. */
180
- childId?: string;
181
- /** Nesting depth — 0 = parent, ≥ 1 = subagent (matches zidane's spawn depth). */
182
- depth?: number;
183
- }
184
- interface Picked {
185
- provider: ProviderAuth;
186
- model: string;
187
- }
188
- interface SessionMeta {
189
- id: string;
190
- title: string;
191
- turnCount: number;
192
- updatedAt: number;
193
- }
194
- /** Persisted, user-toggleable transcript filters. */
195
- interface Settings {
196
- showThinking: boolean;
197
- showToolCalls: boolean;
198
- showToolResults: boolean;
199
- }
200
- //#endregion
201
- //#region src/tui/store.d.ts
202
- declare function createTuiStore(dbPath: string): SessionStore;
203
- interface TuiState {
204
- lastProvider?: ProviderKey;
205
- lastSessionId?: string;
206
- /** Per-provider last-used model id. */
207
- lastModelByProvider?: Partial<Record<ProviderKey, string>>;
208
- /** User-toggled transcript filters. Persisted so they outlive a launch. */
209
- settings?: Partial<Settings>;
210
- }
211
- interface StateStoreApi {
212
- load: () => TuiState;
213
- save: (state: TuiState) => void;
214
- }
215
- declare function createStateStore(path: string): StateStoreApi;
216
- declare function loadState(path: string): TuiState;
217
- declare function saveState(path: string, state: TuiState): void;
218
- /**
219
- * Load every session and project it to the compact `SessionMeta` shape used by
220
- * the picker. Sorted by recency via the underlying store's `list()` contract
221
- * (sqlite store returns by `updated_at DESC`).
222
- */
223
- declare function listSessionMeta(store: SessionStore): Promise<SessionMeta[]>;
224
- /** Derive a short title from the first user message — returns null when empty. */
225
- declare function titleFromTurns(turns: SessionTurn[]): string | null;
226
- /**
227
- * Replay persisted turns as a viewable transcript. Mirrors the event shape produced
228
- * live by the agent hooks so loaded and streaming history render identically.
229
- *
230
- * Skips `tool_result` blocks (they're not user-visible by default), and inserts a
231
- * `separator` event between turn groups so the eye can parse turn boundaries.
232
- */
233
- declare function eventsFromTurns(turns: SessionTurn[]): StreamEvent[];
234
- /** Shared formatter for the `↳ name(args)` line shown on tool calls. */
235
- declare function toolCallPreview(name: string, input: Record<string, unknown>): string;
236
- /** Render tool output as plain text, whether it's a string or structured content. */
237
- declare function toolResultText(output: string | ToolResultContent[]): string;
238
- /** Effective context size of the most recent assistant turn — drives the footer indicator. */
239
- declare function lastContextSizeFromTurns(turns: SessionTurn[]): number;
240
- //#endregion
241
- //#region src/tui/config.d.ts
242
- /**
243
- * Provider registry — a map keyed by `descriptor.key`. Passed verbatim to the
244
- * TUI; there is no implicit merge with built-ins. Hosts that want the four
245
- * default providers spread {@link BUILTIN_PROVIDERS}; hosts that only want
246
- * their own pass exactly their own.
247
- */
248
- type ProviderRegistry = Readonly<Record<string, ProviderDescriptor>>;
249
- /**
250
- * Options accepted by `runTui()` and `resolveConfig()`. Every field is optional
251
- * — defaults boot a working chat against the built-in providers with sessions
252
- * stored under `~/.zidane/`.
253
- */
254
- interface TuiOptions {
255
- /**
256
- * Directory name used under `storageDir` for sessions + state.
257
- * Default: `'.zidane'` → `~/.zidane/sessions.db` + `~/.zidane/state.json`.
258
- * Pass e.g. `'.myapp'` for `~/.myapp/...`, or `'myapp'` for a visible dir.
259
- */
260
- prefix?: string;
261
- /**
262
- * Storage root. Defaults to the user's home directory. Combined with
263
- * `prefix` to form the data directory.
264
- */
265
- storageDir?: string;
266
- /**
267
- * Provider registry. Each value is a {@link ProviderDescriptor} carrying
268
- * label + factory + credential metadata. **No automatic merge** — hosts
269
- * pass exactly what they want.
270
- *
271
- * - Omitted → {@link BUILTIN_PROVIDERS} (anthropic + openai + openrouter + cerebras).
272
- * - `providers: BUILTIN_PROVIDERS` → same as omitted, but explicit.
273
- * - `providers: { anthropic: anthropicDescriptor }` → only Anthropic.
274
- * - `providers: { ...BUILTIN_PROVIDERS, mine: customDescriptor }` → built-ins + custom.
275
- * - `providers: { mine: customDescriptor }` → custom-only, **no built-ins**.
276
- */
277
- providers?: ProviderRegistry;
278
- /**
279
- * Agent preset (tools, system prompt, behavior). Default: `basic`.
280
- */
281
- preset?: Preset;
282
- /**
283
- * Bring your own session store. Default: a SQLite store at
284
- * `<storageDir>/<prefix>/sessions.db`.
285
- */
286
- store?: SessionStore;
287
- }
288
- interface ResolvedConfig {
289
- prefix: string;
290
- storageDir: string;
291
- paths: {
292
- dir: string;
293
- db: string;
294
- state: string;
295
- };
296
- providers: ProviderRegistry;
297
- preset: Preset;
298
- store: SessionStore;
299
- stateStore: StateStoreApi;
300
- /** Lookup by `ProviderKey` returning the available models for the picker. */
301
- modelsFor: (key: ProviderKey) => readonly ModelInfo[];
302
- initialState: TuiState;
303
- initialSettings: Partial<Settings>;
304
- resumeProvider: ProviderAuth | null;
305
- initialPicked: Picked | null;
306
- }
307
- /** Resolve user options into a fully-bound runtime config. Pure aside from disk reads. */
308
- declare function resolveConfig(options?: TuiOptions): ResolvedConfig;
309
- declare function ConfigProvider({
310
- config,
311
- children
312
- }: {
313
- config: ResolvedConfig;
314
- children: ReactNode;
315
- }): ReactNode;
316
- declare function useConfig(): ResolvedConfig;
317
- //#endregion
318
6
  //#region src/tui/app.d.ts
319
7
  /**
320
8
  * Top-level TUI component. Accepts a fully-resolved `ResolvedConfig` and wires
@@ -368,84 +56,38 @@ declare function Transcript({
368
56
  settings: Settings;
369
57
  }): _$react.ReactNode;
370
58
  /**
371
- * Resolve the top margin for an event given the one rendered just before it.
372
- *
373
- * The only context-aware rule today: a tool/tool-result event that follows
374
- * another tool/tool-result event collapses its margin to zero, so a chain of
375
- * tool calls reads as a tight list whether the user has hidden tool outputs
376
- * or not, and whether the agent emits back-to-back calls or call→result pairs.
377
- *
378
- * Exported so the spacing matrix can be unit-tested without rendering.
379
- */
380
- declare function marginTopFor(event: StreamEvent, previous: StreamEvent | undefined): number;
381
- //#endregion
382
- //#region src/tui/credentials.d.ts
383
- interface ApiKeyCredential {
384
- kind: 'apikey';
385
- value: string;
386
- }
387
- interface OAuthCredential {
388
- kind: 'oauth';
389
- access: string;
390
- refresh?: string;
391
- expires?: number;
392
- /** Provider-specific extras (e.g. OpenAI Codex `accountId`). */
393
- [extra: string]: unknown;
394
- }
395
- type ProviderCredential = ApiKeyCredential | OAuthCredential;
396
- /** Top-level shape of `credentials.json` — keys are credential-file keys. */
397
- type CredentialsFile = Record<string, ProviderCredential>;
398
- /**
399
- * Resolve the credentials file path given the resolved TUI data directory
400
- * (typically `~/.zidane`, i.e. `config.paths.dir`).
59
+ * Per-event visibility filters honor user toggles and the
60
+ * `hideSubagentOutput` setting. When subagent output is hidden:
61
+ * - Child-agent events are filtered down to the `spawn-start` /
62
+ * `spawn-end` markers so the user still sees "🌱 working… 🌳 done".
63
+ * - The parent's `tool-result` for `spawn` is hidden too. Its body
64
+ * duplicates `spawn-end`'s stats line *and* the parent's next markdown
65
+ * turn ("Here's what the sub-agent found: …"). Showing it again
66
+ * produced an extra `┃ [sub-agent child-1] Completed …` block that
67
+ * the user just wanted gone.
401
68
  *
402
- * Matches the convention used elsewhere in the TUI (sessions.db, state.json)
403
- * so a single `ZIDANE_STORAGE_DIR` override moves the entire data root.
69
+ * Exported so the visibility matrix can be unit-tested without rendering.
404
70
  */
405
- declare function credentialsPath(dataDir: string): string;
71
+ declare function isVisible(event: StreamEvent, settings: Settings): boolean;
406
72
  /**
407
- * Read credentials from disk.
408
- *
409
- * Returns `{}` when the file is missing or corrupt (last-ditch tolerance —
410
- * a hand-edit gone wrong shouldn't lock the user out of re-authing). On first
411
- * call with no file present, attempts a migration from `cwd/.credentials.json`
412
- * (the legacy location used by `bun run auth`).
413
- */
414
- declare function readCredentials(dataDir: string): CredentialsFile;
415
- /** Read a single provider's credential (translating via the descriptor). */
416
- declare function readProviderCredential(dataDir: string, descriptor: ProviderDescriptor): ProviderCredential | undefined;
417
- /**
418
- * Write credentials atomically (write-then-rename) with mode 0o600.
73
+ * Resolve the top margin for an event given the one rendered just before it.
419
74
  *
420
- * Atomic on the same filesystem — readers either see the previous file or the
421
- * new one, never a half-written intermediate. Creates the parent dir if needed
422
- * (first launch on a fresh machine: `~/.zidane/` may not exist yet).
423
- */
424
- declare function writeCredentials(dataDir: string, creds: CredentialsFile): void;
425
- declare function setProviderCredential(dataDir: string, descriptor: ProviderDescriptor, cred: ProviderCredential): void;
426
- declare function removeProviderCredential(dataDir: string, descriptor: ProviderDescriptor): void;
427
- /**
428
- * Inject API-key credentials into `process.env` so the harness providers pick
429
- * them up via their existing env-var resolution. Called once at TUI launch
430
- * after the credentials file has been resolved. OAuth credentials are NOT
431
- * injected — those reach providers via `ZIDANE_CREDENTIALS_PATH` + the file
432
- * reader in `src/providers/oauth.ts`.
75
+ * Context-aware rules:
433
76
  *
434
- * Does not overwrite env vars that are already set explicit user-provided
435
- * env values win over stored API keys.
77
+ * - A `tool` / `tool-result` event right after another `tool` / `tool-result`
78
+ * collapses to a tight list call→result pairs and back-to-back calls
79
+ * read as one logical block.
80
+ * - A parent-level event (`depth === 0`) right after a subagent event
81
+ * (`depth > 0`) collapses too. The subagent's `🌳` end marker (and, in
82
+ * show mode, the subagent box's bottom border) already provides the
83
+ * separation; adding the event's default `marginTop` on top would
84
+ * produce the visible "line jump" between a subagent's outcome and the
85
+ * parent's follow-up. Either form of marker is enough — we don't want
86
+ * both.
436
87
  *
437
- * Descriptors without an `envKey` (OAuth-only providers, custom providers
438
- * that bypass env-var resolution) are skipped silently.
88
+ * Exported so the spacing matrix can be unit-tested without rendering.
439
89
  */
440
- declare function applyApiKeyEnv(dataDir: string, registry: Readonly<Record<string, ProviderDescriptor>>): void;
441
- //#endregion
442
- //#region src/tui/format.d.ts
443
- /** Compact token formatter — 12_415 → "12.4k", 1_234_567 → "1.23M". */
444
- declare function fmtTokens(n: number): string;
445
- /** Compact relative-time formatter — "just now / 5m / 3h / 2d". */
446
- declare function ageString(ts: number, now?: number): string;
447
- /** Six-char short form of a session id for headers and lists. */
448
- declare function shortId(id: string): string;
90
+ declare function marginTopFor(event: StreamEvent, previous: StreamEvent | undefined): number;
449
91
  //#endregion
450
92
  //#region src/tui/modal.d.ts
451
93
  interface ModalApi {
@@ -519,27 +161,6 @@ declare function ModelPickerModal({
519
161
  onPick: (modelId: string) => void;
520
162
  }): _$react.ReactNode;
521
163
  //#endregion
522
- //#region src/tui/oauth.d.ts
523
- declare function supportsOAuth(descriptor: ProviderDescriptor): boolean;
524
- interface OAuthFlowOptions {
525
- /** Called when the provider emits its login URL — typically right after the callback server starts. */
526
- onUrl: (url: string, instructions?: string) => void;
527
- /** Called when the provider needs a code entered manually (rare; only when callback server fails). */
528
- onCodeRequest?: () => Promise<string>;
529
- /** Called with each progress message from the OAuth flow (token exchange, etc.). */
530
- onProgress?: (message: string) => void;
531
- /** Abort the in-flight login (e.g. user pressed esc). */
532
- signal?: AbortSignal;
533
- }
534
- /**
535
- * Run the OAuth login flow for a provider.
536
- *
537
- * Returns the OAuth credentials on success; caller persists them via
538
- * `setProviderCredential(dataDir, descriptor, { kind: 'oauth', ...credentials })`.
539
- * Throws when the descriptor has no `oauthProvider` configured.
540
- */
541
- declare function runOAuthLogin(descriptor: ProviderDescriptor, options: OAuthFlowOptions): Promise<OAuthCredentials>;
542
- //#endregion
543
164
  //#region src/tui/screens.d.ts
544
165
  declare function AuthScreen({
545
166
  onPick
@@ -562,31 +183,20 @@ declare function ChatScreen({
562
183
  busy,
563
184
  settings,
564
185
  onSubmit,
565
- session
186
+ session,
187
+ pending,
188
+ onApproval
566
189
  }: {
567
190
  events: StreamEvent[];
568
191
  busy: boolean;
569
192
  settings: Settings;
570
193
  onSubmit: (prompt: string) => void;
571
- session: SessionMeta | null;
194
+ session: SessionMeta | null; /** Head of the safe-mode approval queue, or `null` when nothing is pending. */
195
+ pending: ApprovalRequest | null; /** Resolve the active prompt with the user's pick. */
196
+ onApproval: (decision: ApprovalDecision) => void;
572
197
  }): ReactNode;
573
198
  //#endregion
574
- //#region src/tui/settings.d.ts
575
- declare const DEFAULT_SETTINGS: Settings;
576
- interface SettingsContextValue {
577
- settings: Settings;
578
- toggle: (key: keyof Settings) => void;
579
- }
580
- declare function SettingsProvider({
581
- initial,
582
- onChange,
583
- children
584
- }: {
585
- initial: Settings;
586
- onChange?: (settings: Settings) => void;
587
- children: ReactNode;
588
- }): ReactNode;
589
- declare function useSettings(): SettingsContextValue;
199
+ //#region src/tui/settings-modal.d.ts
590
200
  interface SettingsActions {
591
201
  /**
592
202
  * Re-open the auth screen so the user can switch providers or run the
@@ -599,83 +209,24 @@ declare function SettingsModal({
599
209
  actions
600
210
  }?: {
601
211
  actions?: SettingsActions;
602
- }): ReactNode;
603
- //#endregion
604
- //#region src/tui/streaming.d.ts
605
- /** Flip any trailing streaming markdown blocks (any owner) to finalized. */
606
- declare function finalizeStreamingMarkdown(events: StreamEvent[]): StreamEvent[];
607
- /** Flip the trailing streaming markdown block for one specific owner. */
608
- declare function finalizeStreamingMarkdownForOwner(events: StreamEvent[], owner: Owner): StreamEvent[];
609
- /**
610
- * Effective context size for a single turn.
611
- *
612
- * `usage.input` is misleading on its own when prompt caching is active: providers
613
- * (Anthropic, OpenRouter→Anthropic, Gemini) report `input` as the *new uncached*
614
- * tokens only — the cached prefix shows up in `cacheRead`, and newly-cached
615
- * tokens in `cacheCreation`. The model still saw all three buckets, so the real
616
- * context-window utilization is their sum.
617
- *
618
- * Non-caching providers leave `cacheRead`/`cacheCreation` undefined, so this
619
- * collapses to plain `input` for them.
620
- */
621
- declare function turnContextSize(usage: TurnUsage | undefined): number;
622
- interface StreamSource {
623
- /** Pass `undefined` / omit for parent-agent events. */
624
- childId?: string;
625
- /** Nesting depth — 0 for parent, ≥ 1 for subagents. */
626
- depth?: number;
627
- }
628
- interface StreamBuffer {
629
- /** Queue a streaming delta for the next flush tick. */
630
- queueStreamDelta: (kind: 'markdown' | 'thinking', delta: string, source?: StreamSource) => void;
631
- /** Drain pending deltas immediately, then append a non-streaming event. */
632
- appendImmediate: (evt: StreamEvent) => void;
633
- /** Drain pending deltas immediately, then transform the event list. */
634
- flushAndUpdate: (update: (events: StreamEvent[]) => StreamEvent[]) => void;
635
- /** Drain pending deltas without further transformation. */
636
- flush: () => void;
637
- /** Cancel any pending flush and drop buffered deltas (on session teardown). */
638
- reset: () => void;
639
- }
640
- declare function useStreamBuffer(setEvents: Dispatch<SetStateAction<StreamEvent[]>>): StreamBuffer;
212
+ }): _$react.ReactNode;
641
213
  //#endregion
642
214
  //#region src/tui/theme.d.ts
643
215
  /**
644
- * Shared color palette. Kept as plain hex strings so it can be consumed by
645
- * OpenTUI props that accept `string | RGBA`. The names describe role, not
646
- * literal hue, so the theme can be swapped without touching call sites.
647
- */
648
- declare const COLOR: {
649
- readonly brand: "#FFCC00";
650
- readonly accent: "#00FF88";
651
- readonly model: "#88CCFF";
652
- readonly warn: "#FFAA66";
653
- readonly error: "#FF6666";
654
- readonly dim: "#888888";
655
- readonly mute: "#555555";
656
- readonly border: "#333333";
657
- readonly borderActive: "#555555";
658
- };
659
- /**
660
- * Shared select styling — keeps the highlight bar from filling with a
661
- * different background than the surrounding box. The `▶` marker and the
662
- * brand-colored selected text carry the focus affordance.
216
+ * Convert the renderer-agnostic `Theme.syntax` map (hex strings + plain
217
+ * booleans) into an OpenTUI `SyntaxStyle`. Used both for the markdown
218
+ * structural captures (`markup.heading`, `markup.bold`, …) and the
219
+ * embedded Tree-sitter language tokens (`keyword`, `string`, `function`,
220
+ * …) — OpenTUI's `<markdown>` re-uses the same `SyntaxStyle` for the
221
+ * fenced-code renderable, so one table drives both surfaces.
663
222
  */
664
- declare const SELECT_THEME: {
665
- readonly backgroundColor: "transparent";
666
- readonly focusedBackgroundColor: "transparent";
667
- readonly selectedBackgroundColor: "transparent";
668
- readonly selectedTextColor: "#FFCC00";
669
- readonly textColor: "#888888";
670
- readonly descriptionColor: "#555555";
671
- readonly selectedDescriptionColor: "#888888";
672
- };
223
+ declare function buildMdStyle(theme: Theme): SyntaxStyle;
673
224
  /**
674
- * Theme for markdown token highlighting. Token names map to Tree-sitter highlight
675
- * captures emitted by OpenTUI's markdown parser; the `default` entry is the
676
- * fallback for unstyled text.
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.
677
228
  */
678
- declare const MD_STYLE: SyntaxStyle;
229
+ declare function useMdStyle(): SyntaxStyle;
679
230
  //#endregion
680
231
  //#region src/tui/index.d.ts
681
232
  /**
@@ -706,7 +257,8 @@ declare const MD_STYLE: SyntaxStyle;
706
257
  * to `runTui({ storageDir, prefix })`.
707
258
  *
708
259
  * ```ts
709
- * import { BUILTIN_PROVIDERS, runTui } from 'zidane/tui'
260
+ * import { BUILTIN_PROVIDERS } from 'zidane/chat'
261
+ * import { runTui } from 'zidane/tui'
710
262
  * import { createRemoteStore } from 'zidane/session' // for the `store` option
711
263
  *
712
264
  * await runTui() // ~/.zidane/sessions.db + state.json
@@ -716,7 +268,7 @@ declare const MD_STYLE: SyntaxStyle;
716
268
  * await runTui({ store: createRemoteStore({ url: '…' }) })
717
269
  * ```
718
270
  */
719
- declare function runTui(options?: TuiOptions): Promise<never>;
271
+ declare function runTui(options?: ChatOptions): Promise<never>;
720
272
  //#endregion
721
- export { type ApiKeyCredential, App, type AuthMethod, AuthScreen, BUILTIN_PROVIDERS, COLOR, ChatScreen, ConfigProvider, type ContextUsage, type CredentialsFile, DEFAULT_SETTINGS, Footer, type Hint, MD_STYLE, Modal, type ModalProps, ModalRoot, type ModelInfo, ModelPickerModal, type OAuthCredential, type OAuthFlowOptions, type Owner, type Picked, type ProviderAuth, type ProviderCredential, type ProviderDescriptor, type ProviderKey, type ProviderRegistry, type ResolvedConfig, SELECT_THEME, type Screen, type SessionMeta, SessionsScreen, type Settings, SettingsModal, SettingsProvider, Spinner, type StateStoreApi, type StreamBuffer, type StreamEvent, type StreamSource, Transcript, type TuiOptions, type TuiState, ageString, anthropicDescriptor, applyApiKeyEnv, cerebrasDescriptor, createStateStore, createTuiStore, credKeyOf, credentialsPath, detectAuth, eventsFromTurns, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, fmtTokens, getContextWindow, lastContextSizeFromTurns, listSessionMeta, loadState, marginTopFor, modelsForDescriptor, onInputSubmit, openaiDescriptor, openrouterDescriptor, piIdOf, readCredentials, readProviderCredential, removeProviderCredential, resolveConfig, runOAuthLogin, runTui, saveState, setProviderCredential, shortId, supportsOAuth, titleFromTurns, toolCallPreview, toolResultText, turnContextSize, useConfig, useModal, useModalAwareFocus, useSettings, useStreamBuffer, writeCredentials };
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 };
722
274
  //# 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/providers.ts","../src/tui/auth.ts","../src/tui/types.ts","../src/tui/store.ts","../src/tui/config.tsx","../src/tui/app.tsx","../src/tui/components.tsx","../src/tui/credentials.ts","../src/tui/format.ts","../src/tui/modal.tsx","../src/tui/model-picker.tsx","../src/tui/oauth.ts","../src/tui/screens.tsx","../src/tui/settings.tsx","../src/tui/streaming.ts","../src/tui/theme.ts","../src/tui/index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;UA4BiB,SAAA;EACf,EAAA;EACA,IAAA;EACA,aAAA;EACA,SAAA;EACA,SAAA;EACA,KAAA;EACA,IAAA;IAAS,KAAA;IAAe,MAAA;IAAgB,SAAA;IAAoB,UAAA;EAAA;EAC5D,QAAA;AAAA;AAAA,UAGe,kBAAA;EA8Bf;;;;EAzBA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;AAAA,IACX,SAAA;AAAA,iBAgBe,WAAA,CAAA,GAAe,oBAAA;AAAA,UA0Cd,eAAA;EbnEf;;;;;EayEA,QAAA;AAAA;AAAA,iBAGc,aAAA,CAAA;EAAgB;AAAA;EAAa,OAAA,GAAU,eAAA;AAAA,IAAsB,SAAA;;;;iBC3B7D,yBAAA,CAA0B,MAAA,EAAQ,WAAA,KAAgB,WAAA;;iBAalD,iCAAA,CAAkC,MAAA,EAAQ,WAAA,IAAe,KAAA,EAAO,KAAA,GAAQ,WAAA;;AdjExF;;;;;;;;;;;iBciGgB,eAAA,CAAgB,KAAA,EAAO,SAAA;AAAA,UAetB,YAAA;EdzGyB;Ec2GxC,OAAA;Ed1GA;Ec4GA,KAAA;AAAA;AAAA,UAGe,YAAA;Ed5GkB;Ec8GjC,gBAAA,GAAmB,IAAA,2BAA+B,KAAA,UAAe,MAAA,GAAS,YAAA;Ed/F3D;EciGf,eAAA,GAAkB,GAAA,EAAK,WAAA;EdlDL;EcoDlB,cAAA,GAAiB,MAAA,GAAS,MAAA,EAAQ,WAAA,OAAkB,WAAA;EdpDzB;EcsD3B,KAAA;Ed7GA;Ec+GA,KAAA;AAAA;AAAA,iBAGc,eAAA,CAAgB,SAAA,EAAW,QAAA,CAAS,cAAA,CAAe,WAAA,OAAkB,YAAA;;;;;;;;cCzJxE,KAAA;EAAA;;;;;;;;;;;;;;;cAiBA,YAAA;EAAA;;;;;;;;;;;;;cAeA,QAAA,EAAQ,WAAA;;;;;;;;;;AfXrB;;;;;;;;;;;;;;;;;;AAWA;;;;;;;;;;;;;iBgBqBsB,MAAA,CAAO,OAAA,GAAS,UAAA,GAAkB,OAAA"}
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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