pith-ui 0.1.4 → 0.2.0-app.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/AI.md +21 -7
  2. package/API.md +263 -262
  3. package/APP-API.md +2023 -0
  4. package/APP.md +141 -0
  5. package/README.md +35 -4
  6. package/dist/app/files.d.ts +68 -0
  7. package/dist/app/files.d.ts.map +1 -0
  8. package/dist/app/files.js +177 -0
  9. package/dist/app/files.js.map +1 -0
  10. package/dist/app/index.d.ts +57 -0
  11. package/dist/app/index.d.ts.map +1 -0
  12. package/dist/app/index.js +300 -0
  13. package/dist/app/index.js.map +1 -0
  14. package/dist/app/internal.d.ts +31 -0
  15. package/dist/app/internal.d.ts.map +1 -0
  16. package/dist/app/internal.js +2 -0
  17. package/dist/app/internal.js.map +1 -0
  18. package/dist/app/resources.d.ts +89 -0
  19. package/dist/app/resources.d.ts.map +1 -0
  20. package/dist/app/resources.js +190 -0
  21. package/dist/app/resources.js.map +1 -0
  22. package/dist/app/session.d.ts +14 -0
  23. package/dist/app/session.d.ts.map +1 -0
  24. package/dist/app/session.js +12 -0
  25. package/dist/app/session.js.map +1 -0
  26. package/dist/app/settings.d.ts +109 -0
  27. package/dist/app/settings.d.ts.map +1 -0
  28. package/dist/app/settings.js +283 -0
  29. package/dist/app/settings.js.map +1 -0
  30. package/dist/app/workspace.d.ts +232 -0
  31. package/dist/app/workspace.d.ts.map +1 -0
  32. package/dist/app/workspace.js +413 -0
  33. package/dist/app/workspace.js.map +1 -0
  34. package/dist/forms/actions.d.ts +1 -0
  35. package/dist/forms/actions.d.ts.map +1 -1
  36. package/dist/forms/actions.js +3 -2
  37. package/dist/forms/actions.js.map +1 -1
  38. package/dist/styles.css +4 -1
  39. package/dist/tasks/runtime.js +2 -2
  40. package/dist/tasks/runtime.js.map +1 -1
  41. package/package.json +42 -8
package/APP-API.md ADDED
@@ -0,0 +1,2023 @@
1
+ # Application API reference
2
+
3
+ Generated for `pith-ui@0.2.0-app.2` by `node scripts/api-docs.ts` from TypeScript declaration emit. Do not edit this file by hand. The installed `dist/app/index.d.ts` is authoritative. This reference indexes all 101 direct `pith-ui/app` exports and 17 supporting types reachable from their signatures.
4
+
5
+ Read [APP.md](./APP.md) for the approved consumption contract, ownership and lifecycle rules. Pith Desk imports only `pith-ui/app` and `pith-ui/styles.css`; the separate general [API.md](./API.md) does not expand that boundary.
6
+
7
+ Only names in the public export index may be imported from `pith-ui/app`. Supporting declarations explain the complete signature graph; they are not additional exports or extension points. Platform types such as `HTMLElement` (the sole mount), `Blob` and `File` retain their standard meanings.
8
+
9
+ `SettingsCredential` omits the `actions` member of its supporting `SettingsCredentialView`; that supporting member does not permit a Node slot in the application API. Supply typed `providerActions`. All source links below refer to this exact package version tag.
10
+
11
+ Regenerate: `node scripts/api-docs.ts`. Verify both references and the contract version links without writing: `node scripts/api-docs.ts --check`.
12
+
13
+ ## Public export index
14
+
15
+ | Export | Kind |
16
+ |---|---|
17
+ | [`ActionResult`](#actionresult) | Type |
18
+ | [`AppArtifactsState`](#appartifactsstate) | Type |
19
+ | [`AppFileAction`](#appfileaction) | Type |
20
+ | [`AppFileOwner`](#appfileowner) | Type |
21
+ | [`AppFilePreviewState`](#appfilepreviewstate) | Type |
22
+ | [`AppFileTarget`](#appfiletarget) | Type |
23
+ | [`AppResourceEditorState`](#appresourceeditorstate) | Type |
24
+ | [`AppResourceEntry`](#appresourceentry) | Type |
25
+ | [`AppResourceKind`](#appresourcekind) | Type |
26
+ | [`AppResourceTarget`](#appresourcetarget) | Type |
27
+ | [`Appearance`](#appearance) | Type |
28
+ | [`Application`](#application) | Type |
29
+ | [`ApplicationBrand`](#applicationbrand) | Type |
30
+ | [`ApplicationConversation`](#applicationconversation) | Type |
31
+ | [`ApplicationHost`](#applicationhost) | Type |
32
+ | [`ApplicationOptions`](#applicationoptions) | Type |
33
+ | [`ApplicationState`](#applicationstate) | Type |
34
+ | [`ApplicationWorkspace`](#applicationworkspace) | Type |
35
+ | [`ApprovalPanelState`](#approvalpanelstate) | Type |
36
+ | [`ArtifactsCallbacks`](#artifactscallbacks) | Type |
37
+ | [`AttachmentsState`](#attachmentsstate) | Type |
38
+ | [`BranchHistoryState`](#branchhistorystate) | Type |
39
+ | [`CompletionNoticeDisplay`](#completionnoticedisplay) | Type |
40
+ | [`ComposerViewState`](#composerviewstate) | Type |
41
+ | [`ConfirmationState`](#confirmationstate) | Type |
42
+ | [`ConversationAction`](#conversationaction) | Type |
43
+ | [`ConversationActionAvailability`](#conversationactionavailability) | Type |
44
+ | [`ConversationMessage`](#conversationmessage) | Type |
45
+ | [`ConversationNavigationAction`](#conversationnavigationaction) | Type |
46
+ | [`ConversationState`](#conversationstate) | Type |
47
+ | [`CostLedgerState`](#costledgerstate) | Type |
48
+ | [`CustomConnectionCallbacks`](#customconnectioncallbacks) | Type |
49
+ | [`CustomConnectionDraft`](#customconnectiondraft) | Type |
50
+ | [`CustomConnectionSession`](#customconnectionsession) | Type |
51
+ | [`CustomConnectionState`](#customconnectionstate) | Type |
52
+ | [`FileActionResult`](#fileactionresult) | Type |
53
+ | [`FileCapabilities`](#filecapabilities) | Type |
54
+ | [`FilePreviewCallbacks`](#filepreviewcallbacks) | Type |
55
+ | [`FilePreviewInput`](#filepreviewinput) | Type |
56
+ | [`FilePreviewSession`](#filepreviewsession) | Type |
57
+ | [`FilesScene`](#filesscene) | Type |
58
+ | [`FullAccessState`](#fullaccessstate) | Type |
59
+ | [`ImageTarget`](#imagetarget) | Type |
60
+ | [`LoadingSession`](#loadingsession) | Type |
61
+ | [`LoadingState`](#loadingstate) | Type |
62
+ | [`MCPCallbacks`](#mcpcallbacks) | Type |
63
+ | [`MCPConnectionAction`](#mcpconnectionaction) | Type |
64
+ | [`MCPConnectionDraft`](#mcpconnectiondraft) | Type |
65
+ | [`MCPConnectionItem`](#mcpconnectionitem) | Type |
66
+ | [`MCPConnectionTarget`](#mcpconnectiontarget) | Type |
67
+ | [`MCPConnectionsState`](#mcpconnectionsstate) | Type |
68
+ | [`MCPEditorValue`](#mcpeditorvalue) | Type |
69
+ | [`MCPSession`](#mcpsession) | Type |
70
+ | [`MessageEditorSession`](#messageeditorsession) | Type |
71
+ | [`MessageEditorState`](#messageeditorstate) | Type |
72
+ | [`ModelCallbacks`](#modelcallbacks) | Type |
73
+ | [`ModelPickerState`](#modelpickerstate) | Type |
74
+ | [`ModelSelection`](#modelselection) | Type |
75
+ | [`ModelSession`](#modelsession) | Type |
76
+ | [`NavigationState`](#navigationstate) | Type |
77
+ | [`NavigationStatus`](#navigationstatus) | Type |
78
+ | [`PendingMessagesState`](#pendingmessagesstate) | Type |
79
+ | [`PermissionControlState`](#permissioncontrolstate) | Type |
80
+ | [`ProviderAction`](#provideraction) | Type |
81
+ | [`ProviderActionTarget`](#provideractiontarget) | Type |
82
+ | [`ProviderActionsState`](#provideractionsstate) | Type |
83
+ | [`ProviderLoginCallbacks`](#providerlogincallbacks) | Type |
84
+ | [`ProviderLoginSession`](#providerloginsession) | Type |
85
+ | [`ProviderLoginState`](#providerloginstate) | Type |
86
+ | [`RenameConversationDraft`](#renameconversationdraft) | Type |
87
+ | [`RenameConversationState`](#renameconversationstate) | Type |
88
+ | [`ResourceActionResult`](#resourceactionresult) | Type |
89
+ | [`ResourceDraft`](#resourcedraft) | Type |
90
+ | [`ResourceEditorCallbacks`](#resourceeditorcallbacks) | Type |
91
+ | [`ResourceEditorSession`](#resourceeditorsession) | Type |
92
+ | [`ResourcesCallbacks`](#resourcescallbacks) | Type |
93
+ | [`ResourcesScene`](#resourcesscene) | Type |
94
+ | [`ResourcesSession`](#resourcessession) | Type |
95
+ | [`ResourcesState`](#resourcesstate) | Type |
96
+ | [`RuntimePanelState`](#runtimepanelstate) | Type |
97
+ | [`SceneSession`](#scenesession) | Type |
98
+ | [`SettingsCallbacks`](#settingscallbacks) | Type |
99
+ | [`SettingsCredential`](#settingscredential) | Type |
100
+ | [`SettingsDraft`](#settingsdraft) | Type |
101
+ | [`SettingsPanelState`](#settingspanelstate) | Type |
102
+ | [`SettingsProviderOption`](#settingsprovideroption) | Type |
103
+ | [`SettingsScene`](#settingsscene) | Type |
104
+ | [`SettingsSession`](#settingssession) | Type |
105
+ | [`TaskFailureState`](#taskfailurestate) | Type |
106
+ | [`UpdateAction`](#updateaction) | Type |
107
+ | [`UpdatePanelState`](#updatepanelstate) | Type |
108
+ | [`WelcomeState`](#welcomestate) | Type |
109
+ | [`WorkspaceAction`](#workspaceaction) | Type |
110
+ | [`WorkspaceAvailability`](#workspaceavailability) | Type |
111
+ | [`WorkspaceCallbacks`](#workspacecallbacks) | Type |
112
+ | [`WorkspacePickerState`](#workspacepickerstate) | Type |
113
+ | [`WorkspaceScene`](#workspacescene) | Type |
114
+ | [`WorkspaceShellState`](#workspaceshellstate) | Type |
115
+ | [`createApplication`](#createapplication) | Application factory |
116
+ | [`formatCost`](#formatcost) | Pure formatter |
117
+ | [`thinkingLabel`](#thinkinglabel) | Pure formatter |
118
+
119
+ ## Supporting type index
120
+
121
+ - [`ApprovalView`](#approvalview)
122
+ - [`AttachmentItem`](#attachmentitem)
123
+ - [`BranchHistoryNode`](#branchhistorynode)
124
+ - [`CostRequestDisplay`](#costrequestdisplay)
125
+ - [`CostSummaryDisplay`](#costsummarydisplay)
126
+ - [`CustomModelDraft`](#custommodeldraft)
127
+ - [`CustomModelValue`](#custommodelvalue)
128
+ - [`FormFeedback`](#formfeedback)
129
+ - [`HostResult`](#hostresult)
130
+ - [`LocalContentLink`](#localcontentlink)
131
+ - [`ModelEditorState`](#modeleditorstate)
132
+ - [`ModelOption`](#modeloption)
133
+ - [`ModelProviderOption`](#modelprovideroption)
134
+ - [`PendingMessage`](#pendingmessage)
135
+ - [`SettingsCredentialView`](#settingscredentialview)
136
+ - [`SettingsViewSession`](#settingsviewsession)
137
+ - [`Submission`](#submission)
138
+
139
+ ## Public declarations
140
+
141
+ ### AppArtifactsState
142
+
143
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L38)
144
+
145
+ ```ts
146
+ export interface AppArtifactsState {
147
+ readonly ownerId: string;
148
+ readonly files: readonly {
149
+ readonly name: string;
150
+ readonly path: string;
151
+ }[];
152
+ readonly loading: boolean;
153
+ readonly error: string;
154
+ readonly copyMode: 'file' | 'path';
155
+ readonly disabled?: boolean;
156
+ }
157
+ ```
158
+
159
+ ### AppFileAction
160
+
161
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L8)
162
+
163
+ ```ts
164
+ export type AppFileAction = 'open' | 'reveal' | 'copy' | 'copy-path';
165
+ ```
166
+
167
+ ### AppFileOwner
168
+
169
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L10)
170
+
171
+ ```ts
172
+ export interface AppFileOwner {
173
+ readonly kind: 'artifact';
174
+ readonly id: string;
175
+ }
176
+ ```
177
+
178
+ ### AppFilePreviewState
179
+
180
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L13)
181
+
182
+ ```ts
183
+ export interface AppFilePreviewState {
184
+ readonly kind: 'text' | 'markdown' | 'diff' | 'image';
185
+ readonly text?: string;
186
+ readonly imageSrc?: string;
187
+ readonly imageAlt?: string;
188
+ readonly truncated?: boolean;
189
+ readonly error?: string;
190
+ readonly disabled?: boolean;
191
+ }
192
+ ```
193
+
194
+ ### AppFileTarget
195
+
196
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L11)
197
+
198
+ ```ts
199
+ export interface AppFileTarget {
200
+ readonly owner: AppFileOwner;
201
+ readonly name: string;
202
+ readonly path: string;
203
+ }
204
+ ```
205
+
206
+ Referenced types and APIs: [`AppFileOwner`](#appfileowner).
207
+
208
+ ### ArtifactsCallbacks
209
+
210
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L46)
211
+
212
+ ```ts
213
+ export interface ArtifactsCallbacks {
214
+ onPreview?: (target: AppFileTarget) => FileActionResult;
215
+ onFileAction?: (action: AppFileAction, target: AppFileTarget) => FileActionResult;
216
+ }
217
+ ```
218
+
219
+ Referenced types and APIs: [`AppFileAction`](#appfileaction), [`AppFileTarget`](#appfiletarget), [`FileActionResult`](#fileactionresult).
220
+
221
+ ### FileActionResult
222
+
223
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L9)
224
+
225
+ ```ts
226
+ export type FileActionResult = void | ActionResult | Promise<void | ActionResult>;
227
+ ```
228
+
229
+ Referenced types and APIs: [`ActionResult`](#actionresult).
230
+
231
+ ### FileCapabilities
232
+
233
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L12)
234
+
235
+ ```ts
236
+ export interface FileCapabilities {
237
+ readonly open?: boolean;
238
+ readonly reveal?: boolean;
239
+ readonly copyMode?: 'file' | 'path' | 'none';
240
+ }
241
+ ```
242
+
243
+ ### FilePreviewCallbacks
244
+
245
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L26)
246
+
247
+ ```ts
248
+ export interface FilePreviewCallbacks {
249
+ onFileAction?: (action: AppFileAction, target: AppFileTarget) => FileActionResult;
250
+ onCopyCode?: (text: string) => FileActionResult;
251
+ onClose?: () => void;
252
+ }
253
+ ```
254
+
255
+ Referenced types and APIs: [`AppFileAction`](#appfileaction), [`AppFileTarget`](#appfiletarget), [`FileActionResult`](#fileactionresult).
256
+
257
+ ### FilePreviewInput
258
+
259
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L22)
260
+
261
+ ```ts
262
+ export interface FilePreviewInput extends AppFileTarget {
263
+ readonly capabilities: FileCapabilities;
264
+ readonly content?: AppFilePreviewState;
265
+ }
266
+ ```
267
+
268
+ Referenced types and APIs: [`AppFilePreviewState`](#appfilepreviewstate), [`AppFileTarget`](#appfiletarget), [`FileCapabilities`](#filecapabilities).
269
+
270
+ ### FilePreviewSession
271
+
272
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L31)
273
+
274
+ ```ts
275
+ export interface FilePreviewSession {
276
+ update(state: Readonly<AppFilePreviewState>): void;
277
+ fail(message: string): void;
278
+ close(): void;
279
+ isOpen(): boolean;
280
+ destroy(): void;
281
+ }
282
+ ```
283
+
284
+ Referenced types and APIs: [`AppFilePreviewState`](#appfilepreviewstate).
285
+
286
+ ### FilesScene
287
+
288
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/files.ts#L50)
289
+
290
+ ```ts
291
+ export interface FilesScene {
292
+ updateArtifacts(state: Readonly<AppArtifactsState>, callbacks?: ArtifactsCallbacks): void;
293
+ closeArtifacts(): void;
294
+ areArtifactsOpen(): boolean;
295
+ openPreview(input: Readonly<FilePreviewInput>, callbacks?: FilePreviewCallbacks): FilePreviewSession;
296
+ destroy(): void;
297
+ }
298
+ ```
299
+
300
+ Referenced types and APIs: [`AppArtifactsState`](#appartifactsstate), [`ArtifactsCallbacks`](#artifactscallbacks), [`FilePreviewCallbacks`](#filepreviewcallbacks), [`FilePreviewInput`](#filepreviewinput), [`FilePreviewSession`](#filepreviewsession).
301
+
302
+ ### createApplication
303
+
304
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/index.ts#L58)
305
+
306
+ ```ts
307
+ /** The only DOM argument is the application mount. Scenes return semantic ports. */
308
+ export declare function createApplication(mount: HTMLElement, options?: ApplicationOptions): Application;
309
+ ```
310
+
311
+ Referenced types and APIs: [`Application`](#application), [`ApplicationOptions`](#applicationoptions).
312
+
313
+ Related gallery: [application-reference](https://minifish-org.github.io/pith-ui/?item=application-reference).
314
+
315
+ ### Application
316
+
317
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/index.ts#L40)
318
+
319
+ ```ts
320
+ export interface Application {
321
+ readonly workspace: WorkspaceScene;
322
+ readonly settings: SettingsScene;
323
+ readonly resources: ResourcesScene;
324
+ readonly files: FilesScene;
325
+ read(): ApplicationState;
326
+ setAppearance(appearance: Appearance): void;
327
+ downloadFile(file: {
328
+ readonly blob: Blob;
329
+ readonly name: string;
330
+ }): Promise<ActionResult>;
331
+ destroy(): void;
332
+ }
333
+ ```
334
+
335
+ Referenced types and APIs: [`ActionResult`](#actionresult), [`Appearance`](#appearance), [`ApplicationState`](#applicationstate), [`FilesScene`](#filesscene), [`ResourcesScene`](#resourcesscene), [`SettingsScene`](#settingsscene), [`WorkspaceScene`](#workspacescene).
336
+
337
+ ### ApplicationBrand
338
+
339
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/index.ts#L22)
340
+
341
+ ```ts
342
+ export interface ApplicationBrand {
343
+ readonly name: string;
344
+ readonly qualifier?: string;
345
+ readonly mark?: {
346
+ readonly src: string;
347
+ readonly darkSrc?: string;
348
+ readonly alt: string;
349
+ };
350
+ }
351
+ ```
352
+
353
+ ### ApplicationHost
354
+
355
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/index.ts#L27)
356
+
357
+ ```ts
358
+ export interface ApplicationHost {
359
+ copyText?(text: string): HostResult;
360
+ openExternal?(url: string): HostResult;
361
+ }
362
+ ```
363
+
364
+ Referenced types and APIs: [`HostResult`](#hostresult).
365
+
366
+ ### ApplicationOptions
367
+
368
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/index.ts#L32)
369
+
370
+ ```ts
371
+ export interface ApplicationOptions {
372
+ readonly brand?: ApplicationBrand;
373
+ readonly appearance?: Appearance;
374
+ readonly host?: ApplicationHost;
375
+ readonly workspace?: WorkspaceCallbacks;
376
+ readonly onUIStateChange?: (state: ApplicationState) => void;
377
+ readonly onError?: (message: string) => void;
378
+ }
379
+ ```
380
+
381
+ Referenced types and APIs: [`Appearance`](#appearance), [`ApplicationBrand`](#applicationbrand), [`ApplicationHost`](#applicationhost), [`ApplicationState`](#applicationstate), [`WorkspaceCallbacks`](#workspacecallbacks).
382
+
383
+ ### ApplicationState
384
+
385
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/index.ts#L31)
386
+
387
+ ```ts
388
+ export interface ApplicationState {
389
+ readonly hasModal: boolean;
390
+ readonly appearance: Appearance;
391
+ }
392
+ ```
393
+
394
+ Referenced types and APIs: [`Appearance`](#appearance).
395
+
396
+ ### AppResourceEditorState
397
+
398
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L52)
399
+
400
+ ```ts
401
+ export interface AppResourceEditorState {
402
+ readonly workspaceId: string;
403
+ readonly workspacePath: string;
404
+ readonly path?: string;
405
+ readonly kind: AppResourceKind;
406
+ readonly name?: string;
407
+ readonly content: string;
408
+ readonly editable: boolean;
409
+ readonly workspaceBusy: boolean;
410
+ readonly error?: string;
411
+ readonly disabled?: boolean;
412
+ }
413
+ ```
414
+
415
+ Referenced types and APIs: [`AppResourceKind`](#appresourcekind).
416
+
417
+ ### AppResourceEntry
418
+
419
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L13)
420
+
421
+ ```ts
422
+ export interface AppResourceEntry {
423
+ readonly name: string;
424
+ readonly path: string;
425
+ readonly description?: string;
426
+ readonly content?: string;
427
+ }
428
+ ```
429
+
430
+ ### AppResourceKind
431
+
432
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L11)
433
+
434
+ ```ts
435
+ export type AppResourceKind = 'instructions' | 'skill' | 'template';
436
+ ```
437
+
438
+ ### AppResourceTarget
439
+
440
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L19)
441
+
442
+ ```ts
443
+ export interface AppResourceTarget {
444
+ readonly workspaceId: string;
445
+ readonly kind: AppResourceKind;
446
+ readonly name: string;
447
+ readonly path: string;
448
+ }
449
+ ```
450
+
451
+ Referenced types and APIs: [`AppResourceKind`](#appresourcekind).
452
+
453
+ ### ResourceActionResult
454
+
455
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L12)
456
+
457
+ ```ts
458
+ export type ResourceActionResult = void | ActionResult | Promise<void | ActionResult>;
459
+ ```
460
+
461
+ Referenced types and APIs: [`ActionResult`](#actionresult).
462
+
463
+ ### ResourceEditorCallbacks
464
+
465
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L64)
466
+
467
+ ```ts
468
+ export interface ResourceEditorCallbacks {
469
+ onSubmit?: (draft: ResourceDraft) => ActionResult | Promise<ActionResult>;
470
+ onDelete?: (target: AppResourceTarget) => ResourceActionResult;
471
+ onClose?: () => void;
472
+ }
473
+ ```
474
+
475
+ Referenced types and APIs: [`ActionResult`](#actionresult), [`AppResourceTarget`](#appresourcetarget), [`ResourceActionResult`](#resourceactionresult), [`ResourceDraft`](#resourcedraft).
476
+
477
+ ### ResourceEditorSession
478
+
479
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L69)
480
+
481
+ ```ts
482
+ export interface ResourceEditorSession {
483
+ read(): ResourceDraft;
484
+ update(state: Readonly<AppResourceEditorState>): void;
485
+ fail(message: string): void;
486
+ close(): void;
487
+ isOpen(): boolean;
488
+ destroy(): void;
489
+ }
490
+ ```
491
+
492
+ Referenced types and APIs: [`AppResourceEditorState`](#appresourceeditorstate), [`ResourceDraft`](#resourcedraft).
493
+
494
+ ### ResourcesCallbacks
495
+
496
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L36)
497
+
498
+ ```ts
499
+ export interface ResourcesCallbacks {
500
+ onRefresh?: () => ResourceActionResult;
501
+ onCreate?: (kind: AppResourceKind) => ResourceActionResult;
502
+ onUse?: (target: AppResourceTarget) => ResourceActionResult;
503
+ onEdit?: (target: AppResourceTarget) => ResourceActionResult;
504
+ onFileAction?: (action: 'open' | 'reveal', target: AppResourceTarget) => ResourceActionResult;
505
+ onClose?: () => void;
506
+ }
507
+ ```
508
+
509
+ Referenced types and APIs: [`AppResourceKind`](#appresourcekind), [`AppResourceTarget`](#appresourcetarget), [`ResourceActionResult`](#resourceactionresult).
510
+
511
+ ### ResourcesScene
512
+
513
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L77)
514
+
515
+ ```ts
516
+ export interface ResourcesScene {
517
+ openEditorLoading(state: Readonly<LoadingState> & {
518
+ readonly kind: AppResourceKind;
519
+ readonly path?: string;
520
+ }, callbacks?: {
521
+ onClose?: () => void;
522
+ }): LoadingSession;
523
+ open(state: Readonly<ResourcesState>, callbacks?: ResourcesCallbacks): ResourcesSession;
524
+ openEditor(state: Readonly<AppResourceEditorState>, callbacks?: ResourceEditorCallbacks): ResourceEditorSession;
525
+ destroy(): void;
526
+ }
527
+ ```
528
+
529
+ Referenced types and APIs: [`AppResourceEditorState`](#appresourceeditorstate), [`AppResourceKind`](#appresourcekind), [`LoadingSession`](#loadingsession), [`LoadingState`](#loadingstate), [`ResourceEditorCallbacks`](#resourceeditorcallbacks), [`ResourceEditorSession`](#resourceeditorsession), [`ResourcesCallbacks`](#resourcescallbacks), [`ResourcesSession`](#resourcessession), [`ResourcesState`](#resourcesstate).
530
+
531
+ ### ResourcesSession
532
+
533
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L44)
534
+
535
+ ```ts
536
+ export interface ResourcesSession {
537
+ read(): Readonly<ResourcesState>;
538
+ update(state: Readonly<ResourcesState>): void;
539
+ fail(message: string): void;
540
+ close(): void;
541
+ isOpen(): boolean;
542
+ destroy(): void;
543
+ }
544
+ ```
545
+
546
+ Referenced types and APIs: [`ResourcesState`](#resourcesstate).
547
+
548
+ ### ResourcesState
549
+
550
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/resources.ts#L25)
551
+
552
+ ```ts
553
+ export interface ResourcesState {
554
+ readonly workspace: {
555
+ readonly id: string;
556
+ readonly name: string;
557
+ readonly path: string;
558
+ };
559
+ readonly instructions: readonly AppResourceEntry[];
560
+ readonly skills: readonly AppResourceEntry[];
561
+ readonly templates: readonly AppResourceEntry[];
562
+ readonly diagnostics: readonly string[];
563
+ readonly canCreateInstructions?: boolean;
564
+ readonly loading?: boolean;
565
+ readonly error?: string;
566
+ readonly busy?: boolean;
567
+ }
568
+ ```
569
+
570
+ Referenced types and APIs: [`AppResourceEntry`](#appresourceentry).
571
+
572
+ ### LoadingSession
573
+
574
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/session.ts#L5)
575
+
576
+ ```ts
577
+ export interface LoadingSession {
578
+ update(state: Readonly<LoadingState>): void;
579
+ fail(message: string): void;
580
+ isOpen(): boolean;
581
+ close(): void;
582
+ destroy(): void;
583
+ }
584
+ ```
585
+
586
+ Referenced types and APIs: [`LoadingState`](#loadingstate).
587
+
588
+ ### LoadingState
589
+
590
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/session.ts#L4)
591
+
592
+ ```ts
593
+ export interface LoadingState {
594
+ readonly error?: string;
595
+ }
596
+ ```
597
+
598
+ ### CustomConnectionCallbacks
599
+
600
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L68)
601
+
602
+ ```ts
603
+ export interface CustomConnectionCallbacks {
604
+ onSubmit?: Submission<CustomConnectionDraft>;
605
+ onClose?: () => void;
606
+ }
607
+ ```
608
+
609
+ Referenced types and APIs: [`CustomConnectionDraft`](#customconnectiondraft), [`Submission`](#submission).
610
+
611
+ ### CustomConnectionSession
612
+
613
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L69)
614
+
615
+ ```ts
616
+ export interface CustomConnectionSession extends SettingsViewSession<CustomConnectionState> {
617
+ read(): CustomConnectionDraft;
618
+ clearSecrets(): void;
619
+ }
620
+ ```
621
+
622
+ Referenced types and APIs: [`CustomConnectionDraft`](#customconnectiondraft), [`CustomConnectionState`](#customconnectionstate), [`SettingsViewSession`](#settingsviewsession).
623
+
624
+ ### MCPCallbacks
625
+
626
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L52)
627
+
628
+ ```ts
629
+ export interface MCPCallbacks {
630
+ onSubmit?: Submission<MCPConnectionDraft>;
631
+ onConnectionAction?: (action: MCPConnectionAction, target: MCPConnectionTarget) => HostResult;
632
+ onRefresh?: () => HostResult;
633
+ onNew?: () => HostResult;
634
+ onClose?: () => void;
635
+ }
636
+ ```
637
+
638
+ Referenced types and APIs: [`HostResult`](#hostresult), [`MCPConnectionAction`](#mcpconnectionaction), [`MCPConnectionDraft`](#mcpconnectiondraft), [`MCPConnectionTarget`](#mcpconnectiontarget), [`Submission`](#submission).
639
+
640
+ ### MCPSession
641
+
642
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L59)
643
+
644
+ ```ts
645
+ export interface MCPSession extends SettingsViewSession<MCPConnectionsState> {
646
+ read(): MCPConnectionDraft;
647
+ edit(value?: Readonly<MCPEditorValue>): void;
648
+ setConnections(entries: readonly MCPConnectionItem[]): void;
649
+ clearBearerToken(): void;
650
+ clearSecrets(): void;
651
+ }
652
+ ```
653
+
654
+ Referenced types and APIs: [`MCPConnectionDraft`](#mcpconnectiondraft), [`MCPConnectionItem`](#mcpconnectionitem), [`MCPConnectionsState`](#mcpconnectionsstate), [`MCPEditorValue`](#mcpeditorvalue), [`SettingsViewSession`](#settingsviewsession).
655
+
656
+ ### ModelCallbacks
657
+
658
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L66)
659
+
660
+ ```ts
661
+ export interface ModelCallbacks {
662
+ onSubmit?: Submission<ModelSelection>;
663
+ onClose?: () => void;
664
+ }
665
+ ```
666
+
667
+ Referenced types and APIs: [`ModelSelection`](#modelselection), [`Submission`](#submission).
668
+
669
+ ### ModelSession
670
+
671
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L67)
672
+
673
+ ```ts
674
+ export interface ModelSession extends SettingsViewSession<ModelPickerState> {
675
+ read(): ModelSelection;
676
+ reset(selection: Readonly<ModelSelection>): void;
677
+ focus(): void;
678
+ }
679
+ ```
680
+
681
+ Referenced types and APIs: [`ModelPickerState`](#modelpickerstate), [`ModelSelection`](#modelselection), [`SettingsViewSession`](#settingsviewsession).
682
+
683
+ ### ProviderLoginCallbacks
684
+
685
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L70)
686
+
687
+ ```ts
688
+ export interface ProviderLoginCallbacks {
689
+ onAnswer?: (answer: string) => HostResult;
690
+ onCancel?: () => HostResult;
691
+ onClose?: () => void;
692
+ }
693
+ ```
694
+
695
+ Referenced types and APIs: [`HostResult`](#hostresult).
696
+
697
+ ### ProviderLoginSession
698
+
699
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L71)
700
+
701
+ ```ts
702
+ export interface ProviderLoginSession extends SettingsViewSession<ProviderLoginState> {
703
+ }
704
+ ```
705
+
706
+ Referenced types and APIs: [`ProviderLoginState`](#providerloginstate), [`SettingsViewSession`](#settingsviewsession).
707
+
708
+ ### SettingsCallbacks
709
+
710
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L28)
711
+
712
+ ```ts
713
+ export interface SettingsCallbacks {
714
+ onSubmit?: Submission<SettingsDraft>;
715
+ onRemoveKey?: Submission<SettingsDraft>;
716
+ onTest?: (draft: SettingsDraft) => HostResult;
717
+ onCancelTest?: () => HostResult;
718
+ onAppearanceChange?: (appearance: Appearance) => HostResult;
719
+ onProviderChange?: (provider: string) => HostResult;
720
+ onDraftChange?: (draft: SettingsDraft) => void;
721
+ onProviderAction?: (action: ProviderAction, target: ProviderActionTarget) => HostResult;
722
+ onUpdateAction?: (action: UpdateAction) => HostResult;
723
+ onCreateConnection?: () => HostResult;
724
+ onDiagnostics?: () => HostResult;
725
+ onClose?: () => void;
726
+ }
727
+ ```
728
+
729
+ Referenced types and APIs: [`Appearance`](#appearance), [`HostResult`](#hostresult), [`ProviderAction`](#provideraction), [`ProviderActionTarget`](#provideractiontarget), [`SettingsDraft`](#settingsdraft), [`Submission`](#submission), [`UpdateAction`](#updateaction).
730
+
731
+ ### SettingsCredential
732
+
733
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L26)
734
+
735
+ ```ts
736
+ export interface SettingsCredential extends Omit<SettingsCredentialView, 'actions'> {
737
+ providerActions?: Readonly<ProviderActionsState>;
738
+ }
739
+ ```
740
+
741
+ Referenced types and APIs: [`ProviderActionsState`](#provideractionsstate), [`SettingsCredentialView`](#settingscredentialview).
742
+
743
+ ### SettingsScene
744
+
745
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L72)
746
+
747
+ ```ts
748
+ export interface SettingsScene {
749
+ openConnectionLoading(state: Readonly<LoadingState> & {
750
+ readonly editing: boolean;
751
+ }, callbacks?: {
752
+ onClose?: () => void;
753
+ }): LoadingSession;
754
+ openSettings(state: Readonly<SettingsPanelState>, callbacks?: SettingsCallbacks): SettingsSession;
755
+ openConnections(state?: Readonly<MCPConnectionsState>, callbacks?: MCPCallbacks): MCPSession;
756
+ openModels(state: Readonly<ModelPickerState>, callbacks?: ModelCallbacks): ModelSession;
757
+ openCustomConnection(state: Readonly<CustomConnectionState>, callbacks?: CustomConnectionCallbacks): CustomConnectionSession;
758
+ openProviderLogin(state: Readonly<ProviderLoginState>, callbacks?: ProviderLoginCallbacks): ProviderLoginSession;
759
+ destroy(): void;
760
+ }
761
+ ```
762
+
763
+ Referenced types and APIs: [`CustomConnectionCallbacks`](#customconnectioncallbacks), [`CustomConnectionSession`](#customconnectionsession), [`CustomConnectionState`](#customconnectionstate), [`LoadingSession`](#loadingsession), [`LoadingState`](#loadingstate), [`MCPCallbacks`](#mcpcallbacks), [`MCPConnectionsState`](#mcpconnectionsstate), [`MCPSession`](#mcpsession), [`ModelCallbacks`](#modelcallbacks), [`ModelPickerState`](#modelpickerstate), [`ModelSession`](#modelsession), [`ProviderLoginCallbacks`](#providerlogincallbacks), [`ProviderLoginSession`](#providerloginsession), [`ProviderLoginState`](#providerloginstate), [`SettingsCallbacks`](#settingscallbacks), [`SettingsPanelState`](#settingspanelstate), [`SettingsSession`](#settingssession).
764
+
765
+ ### SettingsSession
766
+
767
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L42)
768
+
769
+ ```ts
770
+ export interface SettingsSession extends SettingsViewSession<SettingsPanelState> {
771
+ read(): SettingsDraft;
772
+ setProviders(providers: readonly SettingsProviderOption[], selected?: string): void;
773
+ resetProvider(value: {
774
+ provider: string;
775
+ baseUrl: string;
776
+ clearKey?: boolean;
777
+ collapseAdvanced?: boolean;
778
+ }): void;
779
+ setCredential(view: Readonly<SettingsCredential>): void;
780
+ updateUpdates(state: Readonly<UpdatePanelState>): void;
781
+ setUpdatePending(pending: boolean): void;
782
+ setUpdateError(message: string, options?: {
783
+ allowCheckRetry?: boolean;
784
+ }): void;
785
+ clearSecrets(): void;
786
+ }
787
+ ```
788
+
789
+ Referenced types and APIs: [`SettingsCredential`](#settingscredential), [`SettingsDraft`](#settingsdraft), [`SettingsPanelState`](#settingspanelstate), [`SettingsProviderOption`](#settingsprovideroption), [`SettingsViewSession`](#settingsviewsession), [`UpdatePanelState`](#updatepanelstate).
790
+
791
+ ### UpdateAction
792
+
793
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L27)
794
+
795
+ ```ts
796
+ export type UpdateAction = 'check' | 'install';
797
+ ```
798
+
799
+ ### ApplicationConversation
800
+
801
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L22)
802
+
803
+ ```ts
804
+ export interface ApplicationConversation {
805
+ readonly id: string;
806
+ readonly title?: string;
807
+ readonly active: boolean;
808
+ readonly status?: NavigationStatus;
809
+ readonly actions?: {
810
+ readonly rename?: boolean;
811
+ readonly history?: boolean;
812
+ readonly export?: boolean;
813
+ readonly delete?: boolean;
814
+ };
815
+ }
816
+ ```
817
+
818
+ Referenced types and APIs: [`NavigationStatus`](#navigationstatus).
819
+
820
+ ### ApplicationWorkspace
821
+
822
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L26)
823
+
824
+ ```ts
825
+ export interface ApplicationWorkspace {
826
+ readonly id: string;
827
+ readonly name: string;
828
+ readonly path: string;
829
+ readonly selected: boolean;
830
+ readonly children: readonly ApplicationConversation[];
831
+ readonly canRemove?: boolean;
832
+ }
833
+ ```
834
+
835
+ Referenced types and APIs: [`ApplicationConversation`](#applicationconversation).
836
+
837
+ ### ConfirmationState
838
+
839
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L79)
840
+
841
+ ```ts
842
+ export interface ConfirmationState {
843
+ readonly title: string;
844
+ readonly action: string;
845
+ readonly description: {
846
+ readonly before: string;
847
+ readonly subject?: string;
848
+ readonly after?: string;
849
+ };
850
+ readonly hint?: string;
851
+ readonly error?: string;
852
+ readonly disabled?: boolean;
853
+ }
854
+ ```
855
+
856
+ ### ConversationNavigationAction
857
+
858
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L35)
859
+
860
+ ```ts
861
+ export type ConversationNavigationAction = 'rename' | 'history' | 'export' | 'delete';
862
+ ```
863
+
864
+ ### ConversationState
865
+
866
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L32)
867
+
868
+ ```ts
869
+ export interface ConversationState {
870
+ readonly id: string;
871
+ readonly messages: readonly ConversationMessage[];
872
+ readonly working: boolean;
873
+ }
874
+ ```
875
+
876
+ Referenced types and APIs: [`ConversationMessage`](#conversationmessage).
877
+
878
+ ### ImageTarget
879
+
880
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L33)
881
+
882
+ ```ts
883
+ export interface ImageTarget {
884
+ readonly conversationId: string;
885
+ readonly messageId: string;
886
+ readonly index: number;
887
+ }
888
+ ```
889
+
890
+ ### MessageEditorSession
891
+
892
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L78)
893
+
894
+ ```ts
895
+ export interface MessageEditorSession extends SceneSession<MessageEditorState> {
896
+ read(): string;
897
+ reset(value: string): void;
898
+ focus(): void;
899
+ }
900
+ ```
901
+
902
+ Referenced types and APIs: [`MessageEditorState`](#messageeditorstate), [`SceneSession`](#scenesession).
903
+
904
+ ### MessageEditorState
905
+
906
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L73)
907
+
908
+ ```ts
909
+ export interface MessageEditorState {
910
+ readonly title: string;
911
+ readonly value: string;
912
+ readonly description?: string;
913
+ readonly note?: string;
914
+ readonly submitLabel?: string;
915
+ readonly disabled?: boolean;
916
+ readonly pending?: boolean;
917
+ readonly inputDisabled?: boolean;
918
+ readonly error?: string;
919
+ }
920
+ ```
921
+
922
+ ### NavigationState
923
+
924
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L31)
925
+
926
+ ```ts
927
+ export interface NavigationState {
928
+ readonly groups: readonly ApplicationWorkspace[];
929
+ readonly empty: 'workspaces' | 'search' | null;
930
+ readonly disabled?: boolean;
931
+ }
932
+ ```
933
+
934
+ Referenced types and APIs: [`ApplicationWorkspace`](#applicationworkspace).
935
+
936
+ ### NavigationStatus
937
+
938
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L21)
939
+
940
+ ```ts
941
+ export interface NavigationStatus {
942
+ readonly kind: 'approval' | 'running' | 'unread' | 'idle';
943
+ }
944
+ ```
945
+
946
+ ### SceneSession
947
+
948
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L66)
949
+
950
+ ```ts
951
+ export interface SceneSession<State> {
952
+ update(state: Readonly<State>): void;
953
+ close(): void;
954
+ isOpen(): boolean;
955
+ fail(message: string): void;
956
+ destroy(): void;
957
+ }
958
+ ```
959
+
960
+ ### WorkspaceAction
961
+
962
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L34)
963
+
964
+ ```ts
965
+ export type WorkspaceAction = 'workspace' | 'resources' | 'connections' | 'settings' | 'model' | 'compact' | 'continue' | 'diagnostics';
966
+ ```
967
+
968
+ ### WorkspaceAvailability
969
+
970
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L84)
971
+
972
+ ```ts
973
+ export interface WorkspaceAvailability {
974
+ /** A host mutation blocks actions in every scope. A running task is scoped below. */
975
+ readonly busy?: boolean;
976
+ /** Global actions only; unrelated inactive targets keep their own availability. */
977
+ readonly global?: boolean;
978
+ readonly active?: boolean;
979
+ readonly conversations?: readonly string[];
980
+ readonly workspaces?: readonly string[];
981
+ }
982
+ ```
983
+
984
+ ### WorkspaceCallbacks
985
+
986
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L36)
987
+
988
+ ```ts
989
+ export interface WorkspaceCallbacks {
990
+ onAction?(action: WorkspaceAction): HostResult;
991
+ onSubmit?(text: string): HostResult;
992
+ onStop?(): HostResult;
993
+ onInput?(text: string): void;
994
+ onBlur?(): void;
995
+ onImages?(files: File[]): void;
996
+ onThinkingChange?(value: string): void;
997
+ onBusyAction?(key: string): void;
998
+ onSearch?(query: string): void;
999
+ onSelectConversation?(id: string): void;
1000
+ onSelectWorkspace?(id: string): void;
1001
+ onNewConversation?(workspaceId: string): void;
1002
+ onConversationAction?(action: ConversationNavigationAction, id: string): HostResult;
1003
+ onWorkspaceAction?(action: 'remove', id: string): HostResult;
1004
+ onMessageAction?(action: ConversationAction): HostResult;
1005
+ onCopyCode?(text: string): HostResult;
1006
+ resolveLocalLink?(href: string, conversationId: string): LocalContentLink | null;
1007
+ onLocalFile?(target: LocalContentLink): HostResult;
1008
+ onLoadImage?(target: ImageTarget): Promise<Blob | null>;
1009
+ onQueueAction?(action: 'edit' | 'delete' | 'steer', id: string): void;
1010
+ onRemoveAttachment?(id: string): void;
1011
+ onDropReferences?(input: {
1012
+ readonly paths: readonly string[];
1013
+ readonly uris?: string;
1014
+ readonly hasUnidentifiedFiles: boolean;
1015
+ }): void;
1016
+ onPermissionChange?(value: string): void;
1017
+ onApproval?(id: string, action: 'deny' | 'always' | 'allow'): void;
1018
+ onCompletionOpen?(id: string): void;
1019
+ onCompletionDismiss?(runId: string): void;
1020
+ onCostsChange?(): void;
1021
+ onError?(message: string): void;
1022
+ }
1023
+ ```
1024
+
1025
+ Referenced types and APIs: [`ConversationAction`](#conversationaction), [`ConversationNavigationAction`](#conversationnavigationaction), [`HostResult`](#hostresult), [`ImageTarget`](#imagetarget), [`LocalContentLink`](#localcontentlink), [`WorkspaceAction`](#workspaceaction).
1026
+
1027
+ ### WorkspaceScene
1028
+
1029
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/workspace.ts#L91)
1030
+
1031
+ ```ts
1032
+ export interface WorkspaceScene {
1033
+ updateShell(state: Readonly<WorkspaceShellState>): void;
1034
+ updateComposer(state: Readonly<ComposerViewState>): void;
1035
+ readDraft(): string;
1036
+ resetDraft(text: string): void;
1037
+ focusComposer(): void;
1038
+ pickImages(): void;
1039
+ insertReferences(paths: readonly string[]): void;
1040
+ receiveNativeDrop(input: {
1041
+ readonly paths: readonly string[];
1042
+ readonly x: number;
1043
+ readonly y: number;
1044
+ }): void;
1045
+ setDropPending(pending: boolean): void;
1046
+ updateNavigation(state: Readonly<NavigationState>): void;
1047
+ search(query: string): void;
1048
+ closeNavigationMenu(): void;
1049
+ setSidebarOpen(open: boolean): void;
1050
+ updateConversation(state: Readonly<ConversationState>): void;
1051
+ updateMessageAvailability(state: Readonly<ConversationActionAvailability>): void;
1052
+ pruneConversations(ids: readonly string[]): void;
1053
+ updateWelcome(state: Readonly<WelcomeState>): void;
1054
+ followLatest(): void;
1055
+ openFind(): void;
1056
+ closeFind(): void;
1057
+ updatePending(state: Readonly<PendingMessagesState>): void;
1058
+ updateAttachments(state: Readonly<AttachmentsState>): void;
1059
+ updateImageGuidance(message: string): void;
1060
+ updatePermission(state: Readonly<PermissionControlState>): void;
1061
+ updateApproval(state: Readonly<ApprovalPanelState>): void;
1062
+ updateFailure(state: Readonly<TaskFailureState>): void;
1063
+ updateRuntime(state: Readonly<RuntimePanelState>): void;
1064
+ updateTiming(value: {
1065
+ summary: string;
1066
+ duration: string;
1067
+ speed: string;
1068
+ }): void;
1069
+ updateNotices(state: readonly CompletionNoticeDisplay[]): void;
1070
+ updateAvailability(state: Readonly<WorkspaceAvailability>): void;
1071
+ readCosts(): {
1072
+ readonly open: boolean;
1073
+ readonly runtimeOpen: boolean;
1074
+ };
1075
+ updateCosts(state: {
1076
+ readonly visible: boolean;
1077
+ readonly report?: CostLedgerState;
1078
+ readonly loading?: boolean;
1079
+ readonly error?: string;
1080
+ }): void;
1081
+ resetCosts(): void;
1082
+ openMessageEditor(state: MessageEditorState, callbacks?: {
1083
+ onSubmit?(text: string): ActionResult | Promise<ActionResult>;
1084
+ onInput?(text: string): void;
1085
+ onClose?(): void;
1086
+ }): MessageEditorSession;
1087
+ openQueueEditor(state: MessageEditorState, callbacks?: {
1088
+ onSubmit?(text: string): ActionResult | Promise<ActionResult>;
1089
+ onInput?(text: string): void;
1090
+ onClose?(): void;
1091
+ }): MessageEditorSession;
1092
+ openConfirmation(state: ConfirmationState, callbacks: {
1093
+ onConfirm(): ActionResult | Promise<ActionResult>;
1094
+ onClose?(): void;
1095
+ }): SceneSession<ConfirmationState>;
1096
+ openWorkspacePicker(state: WorkspacePickerState, callbacks?: {
1097
+ onSubmit?(path: string): ActionResult | Promise<ActionResult>;
1098
+ onPick?(): Promise<{
1099
+ path?: string;
1100
+ error?: string;
1101
+ }>;
1102
+ onSelect?(id: string): void;
1103
+ onClose?(): void;
1104
+ }): SceneSession<WorkspacePickerState> & {
1105
+ read(): {
1106
+ path: string;
1107
+ };
1108
+ reset(path?: string): void;
1109
+ focus(): void;
1110
+ };
1111
+ openRename(state: RenameConversationState, callbacks?: {
1112
+ onSubmit?(draft: RenameConversationDraft): ActionResult | Promise<ActionResult>;
1113
+ onClose?(): void;
1114
+ }): SceneSession<RenameConversationState> & {
1115
+ read(): RenameConversationDraft;
1116
+ reset(state: RenameConversationState): void;
1117
+ focus(): void;
1118
+ };
1119
+ openFullAccess(state: FullAccessState, callbacks: {
1120
+ onConfirm(): ActionResult | Promise<ActionResult>;
1121
+ onClose?(): void;
1122
+ }): SceneSession<FullAccessState>;
1123
+ openHistory(state: BranchHistoryState, callbacks?: {
1124
+ onContinue?(nodeId: string): HostResult;
1125
+ onClose?(): void;
1126
+ }): SceneSession<BranchHistoryState>;
1127
+ destroy(): void;
1128
+ }
1129
+ ```
1130
+
1131
+ Referenced types and APIs: [`ActionResult`](#actionresult), [`ApprovalPanelState`](#approvalpanelstate), [`AttachmentsState`](#attachmentsstate), [`BranchHistoryState`](#branchhistorystate), [`CompletionNoticeDisplay`](#completionnoticedisplay), [`ComposerViewState`](#composerviewstate), [`ConfirmationState`](#confirmationstate), [`ConversationActionAvailability`](#conversationactionavailability), [`ConversationState`](#conversationstate), [`CostLedgerState`](#costledgerstate), [`FullAccessState`](#fullaccessstate), [`HostResult`](#hostresult), [`MessageEditorSession`](#messageeditorsession), [`MessageEditorState`](#messageeditorstate), [`NavigationState`](#navigationstate), [`PendingMessagesState`](#pendingmessagesstate), [`PermissionControlState`](#permissioncontrolstate), [`RenameConversationDraft`](#renameconversationdraft), [`RenameConversationState`](#renameconversationstate), [`RuntimePanelState`](#runtimepanelstate), [`SceneSession`](#scenesession), [`TaskFailureState`](#taskfailurestate), [`WelcomeState`](#welcomestate), [`WorkspaceAvailability`](#workspaceavailability), [`WorkspacePickerState`](#workspacepickerstate), [`WorkspaceShellState`](#workspaceshellstate).
1132
+
1133
+ ### AttachmentsState
1134
+
1135
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/composer.ts#L66)
1136
+
1137
+ ```ts
1138
+ export interface AttachmentsState {
1139
+ items: readonly AttachmentItem[];
1140
+ disabled?: boolean;
1141
+ }
1142
+ ```
1143
+
1144
+ Referenced types and APIs: [`AttachmentItem`](#attachmentitem).
1145
+
1146
+ ### PendingMessagesState
1147
+
1148
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/composer.ts#L7)
1149
+
1150
+ ```ts
1151
+ export interface PendingMessagesState {
1152
+ items: readonly PendingMessage[];
1153
+ running: boolean;
1154
+ busy: boolean;
1155
+ }
1156
+ ```
1157
+
1158
+ Referenced types and APIs: [`PendingMessage`](#pendingmessage).
1159
+
1160
+ ### ConversationAction
1161
+
1162
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/content/conversation-view.ts#L26)
1163
+
1164
+ ```ts
1165
+ export interface ConversationAction {
1166
+ action: 'copy' | 'edit' | 'branch';
1167
+ messageId: string;
1168
+ branchKey?: string;
1169
+ }
1170
+ ```
1171
+
1172
+ ### ConversationActionAvailability
1173
+
1174
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/content/conversation-view.ts#L27)
1175
+
1176
+ ```ts
1177
+ export interface ConversationActionAvailability {
1178
+ copy?: boolean;
1179
+ edit?: boolean;
1180
+ branch?: boolean;
1181
+ }
1182
+ ```
1183
+
1184
+ ### ConversationMessage
1185
+
1186
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/content/conversation-view.ts#L8)
1187
+
1188
+ ```ts
1189
+ /** UI data only. Hosts decide copy/edit/branch eligibility and resolve images. */
1190
+ export interface ConversationMessage {
1191
+ id: string;
1192
+ role: string;
1193
+ text: string;
1194
+ timestamp?: number;
1195
+ toolName?: string;
1196
+ toolCallId?: string;
1197
+ status?: string;
1198
+ images?: Array<{
1199
+ index: number;
1200
+ mimeType?: string;
1201
+ }>;
1202
+ command?: {
1203
+ text: string;
1204
+ cwd: string;
1205
+ exitCode?: number;
1206
+ };
1207
+ actions?: {
1208
+ copy?: boolean | string;
1209
+ edit?: boolean;
1210
+ branch?: {
1211
+ key: string;
1212
+ label?: string;
1213
+ };
1214
+ };
1215
+ }
1216
+ ```
1217
+
1218
+ ### WelcomeState
1219
+
1220
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/content/welcome.ts#L5)
1221
+
1222
+ ```ts
1223
+ export interface WelcomeState {
1224
+ workspace?: {
1225
+ name: string;
1226
+ path: string;
1227
+ };
1228
+ hasApiKey: boolean;
1229
+ hasConnections: boolean;
1230
+ modelName: string;
1231
+ }
1232
+ ```
1233
+
1234
+ ### ActionResult
1235
+
1236
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/core.ts#L8)
1237
+
1238
+ ```ts
1239
+ export type ActionResult = {
1240
+ ok: true;
1241
+ } | {
1242
+ ok: false;
1243
+ error: string;
1244
+ };
1245
+ ```
1246
+
1247
+ ### CompletionNoticeDisplay
1248
+
1249
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/files/systems.ts#L112)
1250
+
1251
+ ```ts
1252
+ export interface CompletionNoticeDisplay {
1253
+ id: string;
1254
+ runID: string;
1255
+ title: string;
1256
+ workspace: string;
1257
+ }
1258
+ ```
1259
+
1260
+ ### CostLedgerState
1261
+
1262
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/files/systems.ts#L23)
1263
+
1264
+ ```ts
1265
+ export interface CostLedgerState {
1266
+ unknownRequests: number;
1267
+ requests: readonly CostRequestDisplay[] | null;
1268
+ }
1269
+ ```
1270
+
1271
+ Referenced types and APIs: [`CostRequestDisplay`](#costrequestdisplay).
1272
+
1273
+ ### formatCost
1274
+
1275
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/files/systems.ts#L10)
1276
+
1277
+ ```ts
1278
+ export declare function formatCost(cost: CostSummaryDisplay | undefined, latestTask?: boolean): string;
1279
+ ```
1280
+
1281
+ Referenced types and APIs: [`CostSummaryDisplay`](#costsummarydisplay).
1282
+
1283
+ ### UpdatePanelState
1284
+
1285
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/files/systems.ts#L77)
1286
+
1287
+ ```ts
1288
+ export interface UpdatePanelState {
1289
+ version: string;
1290
+ enabled: boolean;
1291
+ phase: string;
1292
+ availableVersion: string;
1293
+ progress: number;
1294
+ message: string;
1295
+ }
1296
+ ```
1297
+
1298
+ ### ProviderAction
1299
+
1300
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/actions.ts#L8)
1301
+
1302
+ ```ts
1303
+ export type ProviderAction = 'login' | 'logout' | 'custom' | 'remove-connection';
1304
+ ```
1305
+
1306
+ ### ProviderActionsState
1307
+
1308
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/actions.ts#L5)
1309
+
1310
+ ```ts
1311
+ export interface ProviderActionsState {
1312
+ id: string;
1313
+ oauth: boolean;
1314
+ signedIn: boolean;
1315
+ custom: boolean;
1316
+ disabled?: boolean;
1317
+ }
1318
+ ```
1319
+
1320
+ ### ProviderActionTarget
1321
+
1322
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/actions.ts#L10)
1323
+
1324
+ ```ts
1325
+ export interface ProviderActionTarget {
1326
+ readonly id: string;
1327
+ }
1328
+ ```
1329
+
1330
+ ### CustomConnectionDraft
1331
+
1332
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/custom-connection.ts#L8)
1333
+
1334
+ ```ts
1335
+ export interface CustomConnectionDraft {
1336
+ name: string;
1337
+ baseUrl: string;
1338
+ api: string;
1339
+ apiKey: string;
1340
+ models: CustomModelDraft[];
1341
+ }
1342
+ ```
1343
+
1344
+ Referenced types and APIs: [`CustomModelDraft`](#custommodeldraft).
1345
+
1346
+ ### CustomConnectionState
1347
+
1348
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/custom-connection.ts#L6)
1349
+
1350
+ ```ts
1351
+ export interface CustomConnectionState {
1352
+ name: string;
1353
+ baseUrl: string;
1354
+ api: string;
1355
+ editing: boolean;
1356
+ models: readonly CustomModelValue[];
1357
+ error?: string;
1358
+ disabled?: boolean;
1359
+ }
1360
+ ```
1361
+
1362
+ Referenced types and APIs: [`CustomModelValue`](#custommodelvalue).
1363
+
1364
+ ### BranchHistoryState
1365
+
1366
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/history.ts#L6)
1367
+
1368
+ ```ts
1369
+ export interface BranchHistoryState {
1370
+ nodes: readonly BranchHistoryNode[] | null;
1371
+ error?: string;
1372
+ loading?: boolean;
1373
+ }
1374
+ ```
1375
+
1376
+ Referenced types and APIs: [`BranchHistoryNode`](#branchhistorynode).
1377
+
1378
+ ### ModelSelection
1379
+
1380
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/model-editor.ts#L25)
1381
+
1382
+ ```ts
1383
+ export interface ModelSelection {
1384
+ provider: string;
1385
+ model: string;
1386
+ thinkingLevel: string;
1387
+ }
1388
+ ```
1389
+
1390
+ ### thinkingLabel
1391
+
1392
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/model-editor.ts#L35)
1393
+
1394
+ ```ts
1395
+ export declare function thinkingLabel(level: string): string;
1396
+ ```
1397
+
1398
+ ### MCPConnectionAction
1399
+
1400
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L198)
1401
+
1402
+ ```ts
1403
+ export type MCPConnectionAction = 'mcp-login' | 'mcp-logout' | 'mcp-edit' | 'mcp-toggle' | 'mcp-remove';
1404
+ ```
1405
+
1406
+ ### MCPConnectionDraft
1407
+
1408
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L143)
1409
+
1410
+ ```ts
1411
+ export interface MCPConnectionDraft {
1412
+ name: string;
1413
+ type: 'http' | 'stdio';
1414
+ url: string;
1415
+ oauth: boolean;
1416
+ oauthClientId: string;
1417
+ oauthScope: string;
1418
+ command: string;
1419
+ args: string;
1420
+ enabled: boolean;
1421
+ bearerToken: string;
1422
+ clearBearerToken: boolean;
1423
+ env: string;
1424
+ clearEnv: boolean;
1425
+ }
1426
+ ```
1427
+
1428
+ ### MCPConnectionItem
1429
+
1430
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L193)
1431
+
1432
+ ```ts
1433
+ export interface MCPConnectionItem {
1434
+ name: string;
1435
+ type: string;
1436
+ url?: string;
1437
+ command?: string;
1438
+ args?: readonly string[];
1439
+ enabled: boolean;
1440
+ hasBearerToken?: boolean;
1441
+ status?: string;
1442
+ statusLabel: string;
1443
+ envKeys?: readonly string[];
1444
+ error?: string;
1445
+ oauth?: boolean;
1446
+ signedIn?: boolean;
1447
+ }
1448
+ ```
1449
+
1450
+ ### MCPConnectionsState
1451
+
1452
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L144)
1453
+
1454
+ ```ts
1455
+ export interface MCPConnectionsState extends FormFeedback {
1456
+ formError?: string;
1457
+ }
1458
+ ```
1459
+
1460
+ Referenced types and APIs: [`FormFeedback`](#formfeedback).
1461
+
1462
+ ### MCPConnectionTarget
1463
+
1464
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L199)
1465
+
1466
+ ```ts
1467
+ export interface MCPConnectionTarget {
1468
+ readonly name: string;
1469
+ }
1470
+ ```
1471
+
1472
+ ### MCPEditorValue
1473
+
1474
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L142)
1475
+
1476
+ ```ts
1477
+ export interface MCPEditorValue {
1478
+ name: string;
1479
+ type: string;
1480
+ url?: string;
1481
+ oauth?: boolean;
1482
+ oauthClientId?: string;
1483
+ oauthScope?: string;
1484
+ command?: string;
1485
+ args?: readonly string[];
1486
+ enabled?: boolean;
1487
+ hasBearerToken?: boolean;
1488
+ envKeys?: readonly string[];
1489
+ }
1490
+ ```
1491
+
1492
+ ### ModelPickerState
1493
+
1494
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L180)
1495
+
1496
+ ```ts
1497
+ export interface ModelPickerState extends FormFeedback {
1498
+ editor?: ModelEditorState;
1499
+ loading?: boolean;
1500
+ }
1501
+ ```
1502
+
1503
+ Referenced types and APIs: [`FormFeedback`](#formfeedback), [`ModelEditorState`](#modeleditorstate).
1504
+
1505
+ ### SettingsDraft
1506
+
1507
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L42)
1508
+
1509
+ ```ts
1510
+ export interface SettingsDraft {
1511
+ provider: string;
1512
+ baseUrl: string;
1513
+ apiKey: string;
1514
+ }
1515
+ ```
1516
+
1517
+ ### SettingsPanelState
1518
+
1519
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L40)
1520
+
1521
+ ```ts
1522
+ export interface SettingsPanelState extends FormFeedback {
1523
+ baseUrl: string;
1524
+ hasApiKey: boolean;
1525
+ ready?: boolean;
1526
+ testing?: boolean;
1527
+ appearance?: {
1528
+ mode: 'light' | 'dark' | 'system';
1529
+ disabled?: boolean;
1530
+ error?: string;
1531
+ };
1532
+ testResult?: {
1533
+ message: string;
1534
+ ok?: boolean;
1535
+ };
1536
+ }
1537
+ ```
1538
+
1539
+ Referenced types and APIs: [`FormFeedback`](#formfeedback).
1540
+
1541
+ ### SettingsProviderOption
1542
+
1543
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L43)
1544
+
1545
+ ```ts
1546
+ export interface SettingsProviderOption {
1547
+ id: string;
1548
+ name: string;
1549
+ configured?: boolean;
1550
+ signedIn?: boolean;
1551
+ }
1552
+ ```
1553
+
1554
+ ### ProviderLoginState
1555
+
1556
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/provider-login.ts#L7)
1557
+
1558
+ ```ts
1559
+ export interface ProviderLoginState {
1560
+ phase: string;
1561
+ message: string;
1562
+ url?: string;
1563
+ code?: string;
1564
+ prompt?: string;
1565
+ promptType?: string;
1566
+ options?: readonly {
1567
+ id: string;
1568
+ label: string;
1569
+ }[] | null;
1570
+ error?: string;
1571
+ disabled?: boolean;
1572
+ }
1573
+ ```
1574
+
1575
+ ### ResourceDraft
1576
+
1577
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/resource-editor.ts#L6)
1578
+
1579
+ ```ts
1580
+ export interface ResourceDraft {
1581
+ name: string;
1582
+ content: string;
1583
+ }
1584
+ ```
1585
+
1586
+ ### RenameConversationDraft
1587
+
1588
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/navigation/navigation.ts#L83)
1589
+
1590
+ ```ts
1591
+ export interface RenameConversationDraft {
1592
+ id: string;
1593
+ title: string;
1594
+ }
1595
+ ```
1596
+
1597
+ ### RenameConversationState
1598
+
1599
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/navigation/navigation.ts#L82)
1600
+
1601
+ ```ts
1602
+ export interface RenameConversationState {
1603
+ id: string;
1604
+ title: string;
1605
+ error?: string;
1606
+ disabled?: boolean;
1607
+ }
1608
+ ```
1609
+
1610
+ ### WorkspacePickerState
1611
+
1612
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/navigation/navigation.ts#L130)
1613
+
1614
+ ```ts
1615
+ export interface WorkspacePickerState {
1616
+ workspaces: readonly {
1617
+ id: string;
1618
+ name: string;
1619
+ path: string;
1620
+ }[];
1621
+ error?: string;
1622
+ disabled?: boolean;
1623
+ }
1624
+ ```
1625
+
1626
+ ### ApprovalPanelState
1627
+
1628
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/tasks/approval.ts#L7)
1629
+
1630
+ ```ts
1631
+ export interface ApprovalPanelState {
1632
+ approval: ApprovalView | null;
1633
+ disabled?: boolean;
1634
+ }
1635
+ ```
1636
+
1637
+ Referenced types and APIs: [`ApprovalView`](#approvalview).
1638
+
1639
+ ### FullAccessState
1640
+
1641
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/tasks/permission.ts#L7)
1642
+
1643
+ ```ts
1644
+ export interface FullAccessState {
1645
+ title?: string;
1646
+ error?: string;
1647
+ disabled?: boolean;
1648
+ }
1649
+ ```
1650
+
1651
+ ### PermissionControlState
1652
+
1653
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/tasks/permission.ts#L39)
1654
+
1655
+ ```ts
1656
+ export interface PermissionControlState {
1657
+ mode: string;
1658
+ description: string;
1659
+ disabled?: boolean;
1660
+ }
1661
+ ```
1662
+
1663
+ ### TaskFailureState
1664
+
1665
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/tasks/permission.ts#L18)
1666
+
1667
+ ```ts
1668
+ export interface TaskFailureState {
1669
+ visible: boolean;
1670
+ message: string;
1671
+ advice: string;
1672
+ canContinue: boolean;
1673
+ workspaceId?: string;
1674
+ }
1675
+ ```
1676
+
1677
+ ### RuntimePanelState
1678
+
1679
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/tasks/runtime.ts#L5)
1680
+
1681
+ ```ts
1682
+ export interface RuntimePanelState {
1683
+ visible: boolean;
1684
+ summary: string;
1685
+ duration: string;
1686
+ speed: string;
1687
+ provider?: string;
1688
+ thinkingLevel?: string;
1689
+ inputTokens: string;
1690
+ outputTokens: string;
1691
+ cacheRead: string;
1692
+ cacheWrite: string;
1693
+ contextTokens: string;
1694
+ contextWindow: string;
1695
+ compactions: string;
1696
+ toolFailures: string;
1697
+ recordedCost: string;
1698
+ latestCost: string;
1699
+ }
1700
+ ```
1701
+
1702
+ ### Appearance
1703
+
1704
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/theme.ts#L1)
1705
+
1706
+ ```ts
1707
+ export type Appearance = 'light' | 'dark' | 'system';
1708
+ ```
1709
+
1710
+ ### ComposerViewState
1711
+
1712
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/workspace.ts#L9)
1713
+
1714
+ ```ts
1715
+ export interface ComposerViewState {
1716
+ placeholder?: string;
1717
+ disabled?: boolean;
1718
+ readOnly?: boolean;
1719
+ action?: 'send' | 'queue' | 'stop';
1720
+ actionDisabled?: boolean;
1721
+ model?: {
1722
+ label: string;
1723
+ description: string;
1724
+ disabled?: boolean;
1725
+ };
1726
+ thinking?: {
1727
+ options: readonly {
1728
+ value: string;
1729
+ label: string;
1730
+ }[];
1731
+ value: string;
1732
+ disabled?: boolean;
1733
+ };
1734
+ }
1735
+ ```
1736
+
1737
+ ### WorkspaceShellState
1738
+
1739
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/workspace.ts#L120)
1740
+
1741
+ ```ts
1742
+ export interface WorkspaceShellState {
1743
+ workspace?: string;
1744
+ conversation?: string;
1745
+ reconnecting?: boolean;
1746
+ error?: {
1747
+ message: string;
1748
+ hidden?: boolean;
1749
+ };
1750
+ busy?: {
1751
+ key: string;
1752
+ message: string;
1753
+ actionLabel: string;
1754
+ } | null;
1755
+ }
1756
+ ```
1757
+
1758
+ ## Supporting declarations
1759
+
1760
+ ### HostResult
1761
+
1762
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/internal.ts#L12)
1763
+
1764
+ ```ts
1765
+ export type HostResult = void | ActionResult | Promise<void | ActionResult>;
1766
+ ```
1767
+
1768
+ Referenced types and APIs: [`ActionResult`](#actionresult).
1769
+
1770
+ ### SettingsViewSession
1771
+
1772
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L19)
1773
+
1774
+ ```ts
1775
+ /** Session methods address one owned opening, never a later use of its window. */
1776
+ export interface SettingsViewSession<State> {
1777
+ update(state: Readonly<State>): void;
1778
+ fail(message: string): void;
1779
+ close(): void;
1780
+ isOpen(): boolean;
1781
+ destroy(): void;
1782
+ }
1783
+ ```
1784
+
1785
+ ### Submission
1786
+
1787
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/app/settings.ts#L16)
1788
+
1789
+ ```ts
1790
+ type Submission<Value> = (value: Value) => ActionResult | Promise<ActionResult>;
1791
+ ```
1792
+
1793
+ Referenced types and APIs: [`ActionResult`](#actionresult).
1794
+
1795
+ ### AttachmentItem
1796
+
1797
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/composer.ts#L55)
1798
+
1799
+ ```ts
1800
+ export interface AttachmentItem {
1801
+ id: string;
1802
+ url: string;
1803
+ name: string;
1804
+ }
1805
+ ```
1806
+
1807
+ ### PendingMessage
1808
+
1809
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/composer.ts#L6)
1810
+
1811
+ ```ts
1812
+ export interface PendingMessage {
1813
+ id: string;
1814
+ text: string;
1815
+ mode: string;
1816
+ imageCount?: number;
1817
+ }
1818
+ ```
1819
+
1820
+ ### LocalContentLink
1821
+
1822
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/content/markdown.ts#L5)
1823
+
1824
+ ```ts
1825
+ export interface LocalContentLink {
1826
+ path: string;
1827
+ conversationId: string;
1828
+ }
1829
+ ```
1830
+
1831
+ ### CostRequestDisplay
1832
+
1833
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/files/systems.ts#L18)
1834
+
1835
+ ```ts
1836
+ export interface CostRequestDisplay {
1837
+ id: string;
1838
+ purpose: string;
1839
+ status: string;
1840
+ provider: string;
1841
+ providerName?: string;
1842
+ model: string;
1843
+ modelName?: string;
1844
+ time: string;
1845
+ source: string;
1846
+ price: unknown;
1847
+ known: boolean;
1848
+ usage: {
1849
+ input: number;
1850
+ output: number;
1851
+ cacheRead: number;
1852
+ cacheWrite: number;
1853
+ reasoning?: number;
1854
+ cost: {
1855
+ total: number;
1856
+ };
1857
+ };
1858
+ }
1859
+ ```
1860
+
1861
+ ### CostSummaryDisplay
1862
+
1863
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/files/systems.ts#L9)
1864
+
1865
+ ```ts
1866
+ export interface CostSummaryDisplay {
1867
+ unavailable?: boolean;
1868
+ requestCount: number;
1869
+ unknownRequests: number;
1870
+ runRequests: number;
1871
+ runUnknownRequests: number;
1872
+ total: number;
1873
+ runTotal: number;
1874
+ }
1875
+ ```
1876
+
1877
+ ### CustomModelDraft
1878
+
1879
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/custom-connection.ts#L7)
1880
+
1881
+ ```ts
1882
+ export interface CustomModelDraft {
1883
+ sourceIndex: number;
1884
+ id: string;
1885
+ name: string;
1886
+ contextWindow: number;
1887
+ maxTokens: number;
1888
+ reasoning: boolean;
1889
+ images: boolean;
1890
+ prices: {
1891
+ input: string;
1892
+ output: string;
1893
+ cacheRead: string;
1894
+ cacheWrite: string;
1895
+ };
1896
+ }
1897
+ ```
1898
+
1899
+ ### CustomModelValue
1900
+
1901
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/custom-connection.ts#L5)
1902
+
1903
+ ```ts
1904
+ export interface CustomModelValue {
1905
+ id: string;
1906
+ name?: string;
1907
+ contextWindow?: number;
1908
+ maxTokens?: number;
1909
+ reasoning?: boolean;
1910
+ input?: readonly string[];
1911
+ cost?: {
1912
+ input: number;
1913
+ output: number;
1914
+ cacheRead: number;
1915
+ cacheWrite: number;
1916
+ };
1917
+ }
1918
+ ```
1919
+
1920
+ ### BranchHistoryNode
1921
+
1922
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/history.ts#L5)
1923
+
1924
+ ```ts
1925
+ export interface BranchHistoryNode {
1926
+ id: string;
1927
+ role: string;
1928
+ text: string;
1929
+ active: boolean;
1930
+ }
1931
+ ```
1932
+
1933
+ ### ModelEditorState
1934
+
1935
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/model-editor.ts#L19)
1936
+
1937
+ ```ts
1938
+ export interface ModelEditorState {
1939
+ providers: readonly ModelProviderOption[] | null;
1940
+ models: readonly ModelOption[] | null;
1941
+ selection: ModelSelection;
1942
+ disabled?: boolean;
1943
+ }
1944
+ ```
1945
+
1946
+ Referenced types and APIs: [`ModelOption`](#modeloption), [`ModelProviderOption`](#modelprovideroption), [`ModelSelection`](#modelselection).
1947
+
1948
+ ### ModelOption
1949
+
1950
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/model-editor.ts#L10)
1951
+
1952
+ ```ts
1953
+ export interface ModelOption {
1954
+ id: string;
1955
+ name: string;
1956
+ provider: string;
1957
+ thinkingLevels?: readonly string[] | null;
1958
+ supportsImages: boolean;
1959
+ contextWindow: number;
1960
+ maxTokens: number;
1961
+ }
1962
+ ```
1963
+
1964
+ ### ModelProviderOption
1965
+
1966
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/model-editor.ts#L4)
1967
+
1968
+ ```ts
1969
+ export interface ModelProviderOption {
1970
+ id: string;
1971
+ name: string;
1972
+ model?: string;
1973
+ thinkingLevel?: string;
1974
+ }
1975
+ ```
1976
+
1977
+ ### FormFeedback
1978
+
1979
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L10)
1980
+
1981
+ ```ts
1982
+ export interface FormFeedback {
1983
+ error?: string;
1984
+ disabled?: boolean;
1985
+ }
1986
+ ```
1987
+
1988
+ ### SettingsCredentialView
1989
+
1990
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/forms/panels.ts#L44)
1991
+
1992
+ ```ts
1993
+ export interface SettingsCredentialView {
1994
+ status: string;
1995
+ hidden: boolean;
1996
+ required: boolean;
1997
+ placeholder: string;
1998
+ removeVisible: boolean;
1999
+ hint?: string;
2000
+ actions?: Node;
2001
+ }
2002
+ ```
2003
+
2004
+ ### ApprovalView
2005
+
2006
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.2/src/tasks/approval.ts#L6)
2007
+
2008
+ ```ts
2009
+ export interface ApprovalView {
2010
+ id: string;
2011
+ toolName: string;
2012
+ warning?: string;
2013
+ canAlwaysAllow: boolean;
2014
+ argsText: string;
2015
+ preview?: {
2016
+ kind: string;
2017
+ path: string;
2018
+ error?: string;
2019
+ diff?: string;
2020
+ truncated?: boolean;
2021
+ };
2022
+ }
2023
+ ```