pith-ui 0.1.4 → 0.2.0-app.1

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 +2019 -0
  4. package/APP.md +137 -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 +279 -0
  29. package/dist/app/settings.js.map +1 -0
  30. package/dist/app/workspace.d.ts +228 -0
  31. package/dist/app/workspace.d.ts.map +1 -0
  32. package/dist/app/workspace.js +402 -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,2019 @@
1
+ # Application API reference
2
+
3
+ Generated for `pith-ui@0.2.0-app.1` 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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/src/app/workspace.ts#L21)
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.1/src/app/workspace.ts#L25)
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.1/src/app/workspace.ts#L78)
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.1/src/app/workspace.ts#L34)
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.1/src/app/workspace.ts#L31)
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.1/src/app/workspace.ts#L32)
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.1/src/app/workspace.ts#L77)
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.1/src/app/workspace.ts#L72)
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.1/src/app/workspace.ts#L30)
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.1/src/app/workspace.ts#L20)
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.1/src/app/workspace.ts#L65)
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.1/src/app/workspace.ts#L33)
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.1/src/app/workspace.ts#L83)
971
+
972
+ ```ts
973
+ export interface WorkspaceAvailability {
974
+ readonly global?: boolean;
975
+ readonly active?: boolean;
976
+ readonly conversations?: readonly string[];
977
+ readonly workspaces?: readonly string[];
978
+ }
979
+ ```
980
+
981
+ ### WorkspaceCallbacks
982
+
983
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/app/workspace.ts#L35)
984
+
985
+ ```ts
986
+ export interface WorkspaceCallbacks {
987
+ onAction?(action: WorkspaceAction): HostResult;
988
+ onSubmit?(text: string): HostResult;
989
+ onStop?(): HostResult;
990
+ onInput?(text: string): void;
991
+ onBlur?(): void;
992
+ onImages?(files: File[]): void;
993
+ onThinkingChange?(value: string): void;
994
+ onBusyAction?(key: string): void;
995
+ onSearch?(query: string): void;
996
+ onSelectConversation?(id: string): void;
997
+ onSelectWorkspace?(id: string): void;
998
+ onNewConversation?(workspaceId: string): void;
999
+ onConversationAction?(action: ConversationNavigationAction, id: string): HostResult;
1000
+ onWorkspaceAction?(action: 'remove', id: string): HostResult;
1001
+ onMessageAction?(action: ConversationAction): HostResult;
1002
+ onCopyCode?(text: string): HostResult;
1003
+ resolveLocalLink?(href: string, conversationId: string): LocalContentLink | null;
1004
+ onLocalFile?(target: LocalContentLink): HostResult;
1005
+ onLoadImage?(target: ImageTarget): Promise<Blob | null>;
1006
+ onQueueAction?(action: 'edit' | 'delete' | 'steer', id: string): void;
1007
+ onRemoveAttachment?(id: string): void;
1008
+ onDropReferences?(input: {
1009
+ readonly paths: readonly string[];
1010
+ readonly uris?: string;
1011
+ }): void;
1012
+ onPermissionChange?(value: string): void;
1013
+ onApproval?(id: string, action: 'deny' | 'always' | 'allow'): void;
1014
+ onCompletionOpen?(id: string): void;
1015
+ onCompletionDismiss?(runId: string): void;
1016
+ onCostsChange?(): void;
1017
+ onError?(message: string): void;
1018
+ }
1019
+ ```
1020
+
1021
+ Referenced types and APIs: [`ConversationAction`](#conversationaction), [`ConversationNavigationAction`](#conversationnavigationaction), [`HostResult`](#hostresult), [`ImageTarget`](#imagetarget), [`LocalContentLink`](#localcontentlink), [`WorkspaceAction`](#workspaceaction).
1022
+
1023
+ ### WorkspaceScene
1024
+
1025
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/app/workspace.ts#L84)
1026
+
1027
+ ```ts
1028
+ export interface WorkspaceScene {
1029
+ updateShell(state: Readonly<WorkspaceShellState>): void;
1030
+ updateComposer(state: Readonly<ComposerViewState>): void;
1031
+ readDraft(): string;
1032
+ resetDraft(text: string): void;
1033
+ focusComposer(): void;
1034
+ pickImages(): void;
1035
+ insertReferences(paths: readonly string[]): void;
1036
+ receiveNativeDrop(input: {
1037
+ readonly paths: readonly string[];
1038
+ readonly x: number;
1039
+ readonly y: number;
1040
+ }): void;
1041
+ setDropPending(pending: boolean): void;
1042
+ updateNavigation(state: Readonly<NavigationState>): void;
1043
+ search(query: string): void;
1044
+ closeNavigationMenu(): void;
1045
+ setSidebarOpen(open: boolean): void;
1046
+ updateConversation(state: Readonly<ConversationState>): void;
1047
+ updateMessageAvailability(state: Readonly<ConversationActionAvailability>): void;
1048
+ pruneConversations(ids: readonly string[]): void;
1049
+ updateWelcome(state: Readonly<WelcomeState>): void;
1050
+ followLatest(): void;
1051
+ openFind(): void;
1052
+ closeFind(): void;
1053
+ updatePending(state: Readonly<PendingMessagesState>): void;
1054
+ updateAttachments(state: Readonly<AttachmentsState>): void;
1055
+ updateImageGuidance(message: string): void;
1056
+ updatePermission(state: Readonly<PermissionControlState>): void;
1057
+ updateApproval(state: Readonly<ApprovalPanelState>): void;
1058
+ updateFailure(state: Readonly<TaskFailureState>): void;
1059
+ updateRuntime(state: Readonly<RuntimePanelState>): void;
1060
+ updateTiming(value: {
1061
+ summary: string;
1062
+ duration: string;
1063
+ speed: string;
1064
+ }): void;
1065
+ updateNotices(state: readonly CompletionNoticeDisplay[]): void;
1066
+ updateAvailability(state: Readonly<WorkspaceAvailability>): void;
1067
+ readCosts(): {
1068
+ readonly open: boolean;
1069
+ readonly runtimeOpen: boolean;
1070
+ };
1071
+ updateCosts(state: {
1072
+ readonly visible: boolean;
1073
+ readonly report?: CostLedgerState;
1074
+ readonly loading?: boolean;
1075
+ readonly error?: string;
1076
+ }): void;
1077
+ resetCosts(): void;
1078
+ openMessageEditor(state: MessageEditorState, callbacks?: {
1079
+ onSubmit?(text: string): ActionResult | Promise<ActionResult>;
1080
+ onInput?(text: string): void;
1081
+ onClose?(): void;
1082
+ }): MessageEditorSession;
1083
+ openQueueEditor(state: MessageEditorState, callbacks?: {
1084
+ onSubmit?(text: string): ActionResult | Promise<ActionResult>;
1085
+ onInput?(text: string): void;
1086
+ onClose?(): void;
1087
+ }): MessageEditorSession;
1088
+ openConfirmation(state: ConfirmationState, callbacks: {
1089
+ onConfirm(): ActionResult | Promise<ActionResult>;
1090
+ onClose?(): void;
1091
+ }): SceneSession<ConfirmationState>;
1092
+ openWorkspacePicker(state: WorkspacePickerState, callbacks?: {
1093
+ onSubmit?(path: string): ActionResult | Promise<ActionResult>;
1094
+ onPick?(): Promise<{
1095
+ path?: string;
1096
+ error?: string;
1097
+ }>;
1098
+ onSelect?(id: string): void;
1099
+ onClose?(): void;
1100
+ }): SceneSession<WorkspacePickerState> & {
1101
+ read(): {
1102
+ path: string;
1103
+ };
1104
+ reset(path?: string): void;
1105
+ focus(): void;
1106
+ };
1107
+ openRename(state: RenameConversationState, callbacks?: {
1108
+ onSubmit?(draft: RenameConversationDraft): ActionResult | Promise<ActionResult>;
1109
+ onClose?(): void;
1110
+ }): SceneSession<RenameConversationState> & {
1111
+ read(): RenameConversationDraft;
1112
+ reset(state: RenameConversationState): void;
1113
+ focus(): void;
1114
+ };
1115
+ openFullAccess(state: FullAccessState, callbacks: {
1116
+ onConfirm(): ActionResult | Promise<ActionResult>;
1117
+ onClose?(): void;
1118
+ }): SceneSession<FullAccessState>;
1119
+ openHistory(state: BranchHistoryState, callbacks?: {
1120
+ onContinue?(nodeId: string): HostResult;
1121
+ onClose?(): void;
1122
+ }): SceneSession<BranchHistoryState>;
1123
+ destroy(): void;
1124
+ }
1125
+ ```
1126
+
1127
+ 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).
1128
+
1129
+ ### AttachmentsState
1130
+
1131
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/composer.ts#L66)
1132
+
1133
+ ```ts
1134
+ export interface AttachmentsState {
1135
+ items: readonly AttachmentItem[];
1136
+ disabled?: boolean;
1137
+ }
1138
+ ```
1139
+
1140
+ Referenced types and APIs: [`AttachmentItem`](#attachmentitem).
1141
+
1142
+ ### PendingMessagesState
1143
+
1144
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/composer.ts#L7)
1145
+
1146
+ ```ts
1147
+ export interface PendingMessagesState {
1148
+ items: readonly PendingMessage[];
1149
+ running: boolean;
1150
+ busy: boolean;
1151
+ }
1152
+ ```
1153
+
1154
+ Referenced types and APIs: [`PendingMessage`](#pendingmessage).
1155
+
1156
+ ### ConversationAction
1157
+
1158
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/content/conversation-view.ts#L26)
1159
+
1160
+ ```ts
1161
+ export interface ConversationAction {
1162
+ action: 'copy' | 'edit' | 'branch';
1163
+ messageId: string;
1164
+ branchKey?: string;
1165
+ }
1166
+ ```
1167
+
1168
+ ### ConversationActionAvailability
1169
+
1170
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/content/conversation-view.ts#L27)
1171
+
1172
+ ```ts
1173
+ export interface ConversationActionAvailability {
1174
+ copy?: boolean;
1175
+ edit?: boolean;
1176
+ branch?: boolean;
1177
+ }
1178
+ ```
1179
+
1180
+ ### ConversationMessage
1181
+
1182
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/content/conversation-view.ts#L8)
1183
+
1184
+ ```ts
1185
+ /** UI data only. Hosts decide copy/edit/branch eligibility and resolve images. */
1186
+ export interface ConversationMessage {
1187
+ id: string;
1188
+ role: string;
1189
+ text: string;
1190
+ timestamp?: number;
1191
+ toolName?: string;
1192
+ toolCallId?: string;
1193
+ status?: string;
1194
+ images?: Array<{
1195
+ index: number;
1196
+ mimeType?: string;
1197
+ }>;
1198
+ command?: {
1199
+ text: string;
1200
+ cwd: string;
1201
+ exitCode?: number;
1202
+ };
1203
+ actions?: {
1204
+ copy?: boolean | string;
1205
+ edit?: boolean;
1206
+ branch?: {
1207
+ key: string;
1208
+ label?: string;
1209
+ };
1210
+ };
1211
+ }
1212
+ ```
1213
+
1214
+ ### WelcomeState
1215
+
1216
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/content/welcome.ts#L5)
1217
+
1218
+ ```ts
1219
+ export interface WelcomeState {
1220
+ workspace?: {
1221
+ name: string;
1222
+ path: string;
1223
+ };
1224
+ hasApiKey: boolean;
1225
+ hasConnections: boolean;
1226
+ modelName: string;
1227
+ }
1228
+ ```
1229
+
1230
+ ### ActionResult
1231
+
1232
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/core.ts#L8)
1233
+
1234
+ ```ts
1235
+ export type ActionResult = {
1236
+ ok: true;
1237
+ } | {
1238
+ ok: false;
1239
+ error: string;
1240
+ };
1241
+ ```
1242
+
1243
+ ### CompletionNoticeDisplay
1244
+
1245
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/files/systems.ts#L112)
1246
+
1247
+ ```ts
1248
+ export interface CompletionNoticeDisplay {
1249
+ id: string;
1250
+ runID: string;
1251
+ title: string;
1252
+ workspace: string;
1253
+ }
1254
+ ```
1255
+
1256
+ ### CostLedgerState
1257
+
1258
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/files/systems.ts#L23)
1259
+
1260
+ ```ts
1261
+ export interface CostLedgerState {
1262
+ unknownRequests: number;
1263
+ requests: readonly CostRequestDisplay[] | null;
1264
+ }
1265
+ ```
1266
+
1267
+ Referenced types and APIs: [`CostRequestDisplay`](#costrequestdisplay).
1268
+
1269
+ ### formatCost
1270
+
1271
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/files/systems.ts#L10)
1272
+
1273
+ ```ts
1274
+ export declare function formatCost(cost: CostSummaryDisplay | undefined, latestTask?: boolean): string;
1275
+ ```
1276
+
1277
+ Referenced types and APIs: [`CostSummaryDisplay`](#costsummarydisplay).
1278
+
1279
+ ### UpdatePanelState
1280
+
1281
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/files/systems.ts#L77)
1282
+
1283
+ ```ts
1284
+ export interface UpdatePanelState {
1285
+ version: string;
1286
+ enabled: boolean;
1287
+ phase: string;
1288
+ availableVersion: string;
1289
+ progress: number;
1290
+ message: string;
1291
+ }
1292
+ ```
1293
+
1294
+ ### ProviderAction
1295
+
1296
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/actions.ts#L8)
1297
+
1298
+ ```ts
1299
+ export type ProviderAction = 'login' | 'logout' | 'custom' | 'remove-connection';
1300
+ ```
1301
+
1302
+ ### ProviderActionsState
1303
+
1304
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/actions.ts#L5)
1305
+
1306
+ ```ts
1307
+ export interface ProviderActionsState {
1308
+ id: string;
1309
+ oauth: boolean;
1310
+ signedIn: boolean;
1311
+ custom: boolean;
1312
+ disabled?: boolean;
1313
+ }
1314
+ ```
1315
+
1316
+ ### ProviderActionTarget
1317
+
1318
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/actions.ts#L10)
1319
+
1320
+ ```ts
1321
+ export interface ProviderActionTarget {
1322
+ readonly id: string;
1323
+ }
1324
+ ```
1325
+
1326
+ ### CustomConnectionDraft
1327
+
1328
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/custom-connection.ts#L8)
1329
+
1330
+ ```ts
1331
+ export interface CustomConnectionDraft {
1332
+ name: string;
1333
+ baseUrl: string;
1334
+ api: string;
1335
+ apiKey: string;
1336
+ models: CustomModelDraft[];
1337
+ }
1338
+ ```
1339
+
1340
+ Referenced types and APIs: [`CustomModelDraft`](#custommodeldraft).
1341
+
1342
+ ### CustomConnectionState
1343
+
1344
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/custom-connection.ts#L6)
1345
+
1346
+ ```ts
1347
+ export interface CustomConnectionState {
1348
+ name: string;
1349
+ baseUrl: string;
1350
+ api: string;
1351
+ editing: boolean;
1352
+ models: readonly CustomModelValue[];
1353
+ error?: string;
1354
+ disabled?: boolean;
1355
+ }
1356
+ ```
1357
+
1358
+ Referenced types and APIs: [`CustomModelValue`](#custommodelvalue).
1359
+
1360
+ ### BranchHistoryState
1361
+
1362
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/history.ts#L6)
1363
+
1364
+ ```ts
1365
+ export interface BranchHistoryState {
1366
+ nodes: readonly BranchHistoryNode[] | null;
1367
+ error?: string;
1368
+ loading?: boolean;
1369
+ }
1370
+ ```
1371
+
1372
+ Referenced types and APIs: [`BranchHistoryNode`](#branchhistorynode).
1373
+
1374
+ ### ModelSelection
1375
+
1376
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/model-editor.ts#L25)
1377
+
1378
+ ```ts
1379
+ export interface ModelSelection {
1380
+ provider: string;
1381
+ model: string;
1382
+ thinkingLevel: string;
1383
+ }
1384
+ ```
1385
+
1386
+ ### thinkingLabel
1387
+
1388
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/model-editor.ts#L35)
1389
+
1390
+ ```ts
1391
+ export declare function thinkingLabel(level: string): string;
1392
+ ```
1393
+
1394
+ ### MCPConnectionAction
1395
+
1396
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L198)
1397
+
1398
+ ```ts
1399
+ export type MCPConnectionAction = 'mcp-login' | 'mcp-logout' | 'mcp-edit' | 'mcp-toggle' | 'mcp-remove';
1400
+ ```
1401
+
1402
+ ### MCPConnectionDraft
1403
+
1404
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L143)
1405
+
1406
+ ```ts
1407
+ export interface MCPConnectionDraft {
1408
+ name: string;
1409
+ type: 'http' | 'stdio';
1410
+ url: string;
1411
+ oauth: boolean;
1412
+ oauthClientId: string;
1413
+ oauthScope: string;
1414
+ command: string;
1415
+ args: string;
1416
+ enabled: boolean;
1417
+ bearerToken: string;
1418
+ clearBearerToken: boolean;
1419
+ env: string;
1420
+ clearEnv: boolean;
1421
+ }
1422
+ ```
1423
+
1424
+ ### MCPConnectionItem
1425
+
1426
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L193)
1427
+
1428
+ ```ts
1429
+ export interface MCPConnectionItem {
1430
+ name: string;
1431
+ type: string;
1432
+ url?: string;
1433
+ command?: string;
1434
+ args?: readonly string[];
1435
+ enabled: boolean;
1436
+ hasBearerToken?: boolean;
1437
+ status?: string;
1438
+ statusLabel: string;
1439
+ envKeys?: readonly string[];
1440
+ error?: string;
1441
+ oauth?: boolean;
1442
+ signedIn?: boolean;
1443
+ }
1444
+ ```
1445
+
1446
+ ### MCPConnectionsState
1447
+
1448
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L144)
1449
+
1450
+ ```ts
1451
+ export interface MCPConnectionsState extends FormFeedback {
1452
+ formError?: string;
1453
+ }
1454
+ ```
1455
+
1456
+ Referenced types and APIs: [`FormFeedback`](#formfeedback).
1457
+
1458
+ ### MCPConnectionTarget
1459
+
1460
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L199)
1461
+
1462
+ ```ts
1463
+ export interface MCPConnectionTarget {
1464
+ readonly name: string;
1465
+ }
1466
+ ```
1467
+
1468
+ ### MCPEditorValue
1469
+
1470
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L142)
1471
+
1472
+ ```ts
1473
+ export interface MCPEditorValue {
1474
+ name: string;
1475
+ type: string;
1476
+ url?: string;
1477
+ oauth?: boolean;
1478
+ oauthClientId?: string;
1479
+ oauthScope?: string;
1480
+ command?: string;
1481
+ args?: readonly string[];
1482
+ enabled?: boolean;
1483
+ hasBearerToken?: boolean;
1484
+ envKeys?: readonly string[];
1485
+ }
1486
+ ```
1487
+
1488
+ ### ModelPickerState
1489
+
1490
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L180)
1491
+
1492
+ ```ts
1493
+ export interface ModelPickerState extends FormFeedback {
1494
+ editor?: ModelEditorState;
1495
+ loading?: boolean;
1496
+ }
1497
+ ```
1498
+
1499
+ Referenced types and APIs: [`FormFeedback`](#formfeedback), [`ModelEditorState`](#modeleditorstate).
1500
+
1501
+ ### SettingsDraft
1502
+
1503
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L42)
1504
+
1505
+ ```ts
1506
+ export interface SettingsDraft {
1507
+ provider: string;
1508
+ baseUrl: string;
1509
+ apiKey: string;
1510
+ }
1511
+ ```
1512
+
1513
+ ### SettingsPanelState
1514
+
1515
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L40)
1516
+
1517
+ ```ts
1518
+ export interface SettingsPanelState extends FormFeedback {
1519
+ baseUrl: string;
1520
+ hasApiKey: boolean;
1521
+ ready?: boolean;
1522
+ testing?: boolean;
1523
+ appearance?: {
1524
+ mode: 'light' | 'dark' | 'system';
1525
+ disabled?: boolean;
1526
+ error?: string;
1527
+ };
1528
+ testResult?: {
1529
+ message: string;
1530
+ ok?: boolean;
1531
+ };
1532
+ }
1533
+ ```
1534
+
1535
+ Referenced types and APIs: [`FormFeedback`](#formfeedback).
1536
+
1537
+ ### SettingsProviderOption
1538
+
1539
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L43)
1540
+
1541
+ ```ts
1542
+ export interface SettingsProviderOption {
1543
+ id: string;
1544
+ name: string;
1545
+ configured?: boolean;
1546
+ signedIn?: boolean;
1547
+ }
1548
+ ```
1549
+
1550
+ ### ProviderLoginState
1551
+
1552
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/provider-login.ts#L7)
1553
+
1554
+ ```ts
1555
+ export interface ProviderLoginState {
1556
+ phase: string;
1557
+ message: string;
1558
+ url?: string;
1559
+ code?: string;
1560
+ prompt?: string;
1561
+ promptType?: string;
1562
+ options?: readonly {
1563
+ id: string;
1564
+ label: string;
1565
+ }[] | null;
1566
+ error?: string;
1567
+ disabled?: boolean;
1568
+ }
1569
+ ```
1570
+
1571
+ ### ResourceDraft
1572
+
1573
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/resource-editor.ts#L6)
1574
+
1575
+ ```ts
1576
+ export interface ResourceDraft {
1577
+ name: string;
1578
+ content: string;
1579
+ }
1580
+ ```
1581
+
1582
+ ### RenameConversationDraft
1583
+
1584
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/navigation/navigation.ts#L83)
1585
+
1586
+ ```ts
1587
+ export interface RenameConversationDraft {
1588
+ id: string;
1589
+ title: string;
1590
+ }
1591
+ ```
1592
+
1593
+ ### RenameConversationState
1594
+
1595
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/navigation/navigation.ts#L82)
1596
+
1597
+ ```ts
1598
+ export interface RenameConversationState {
1599
+ id: string;
1600
+ title: string;
1601
+ error?: string;
1602
+ disabled?: boolean;
1603
+ }
1604
+ ```
1605
+
1606
+ ### WorkspacePickerState
1607
+
1608
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/navigation/navigation.ts#L130)
1609
+
1610
+ ```ts
1611
+ export interface WorkspacePickerState {
1612
+ workspaces: readonly {
1613
+ id: string;
1614
+ name: string;
1615
+ path: string;
1616
+ }[];
1617
+ error?: string;
1618
+ disabled?: boolean;
1619
+ }
1620
+ ```
1621
+
1622
+ ### ApprovalPanelState
1623
+
1624
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/tasks/approval.ts#L7)
1625
+
1626
+ ```ts
1627
+ export interface ApprovalPanelState {
1628
+ approval: ApprovalView | null;
1629
+ disabled?: boolean;
1630
+ }
1631
+ ```
1632
+
1633
+ Referenced types and APIs: [`ApprovalView`](#approvalview).
1634
+
1635
+ ### FullAccessState
1636
+
1637
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/tasks/permission.ts#L7)
1638
+
1639
+ ```ts
1640
+ export interface FullAccessState {
1641
+ title?: string;
1642
+ error?: string;
1643
+ disabled?: boolean;
1644
+ }
1645
+ ```
1646
+
1647
+ ### PermissionControlState
1648
+
1649
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/tasks/permission.ts#L39)
1650
+
1651
+ ```ts
1652
+ export interface PermissionControlState {
1653
+ mode: string;
1654
+ description: string;
1655
+ disabled?: boolean;
1656
+ }
1657
+ ```
1658
+
1659
+ ### TaskFailureState
1660
+
1661
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/tasks/permission.ts#L18)
1662
+
1663
+ ```ts
1664
+ export interface TaskFailureState {
1665
+ visible: boolean;
1666
+ message: string;
1667
+ advice: string;
1668
+ canContinue: boolean;
1669
+ workspaceId?: string;
1670
+ }
1671
+ ```
1672
+
1673
+ ### RuntimePanelState
1674
+
1675
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/tasks/runtime.ts#L5)
1676
+
1677
+ ```ts
1678
+ export interface RuntimePanelState {
1679
+ visible: boolean;
1680
+ summary: string;
1681
+ duration: string;
1682
+ speed: string;
1683
+ provider?: string;
1684
+ thinkingLevel?: string;
1685
+ inputTokens: string;
1686
+ outputTokens: string;
1687
+ cacheRead: string;
1688
+ cacheWrite: string;
1689
+ contextTokens: string;
1690
+ contextWindow: string;
1691
+ compactions: string;
1692
+ toolFailures: string;
1693
+ recordedCost: string;
1694
+ latestCost: string;
1695
+ }
1696
+ ```
1697
+
1698
+ ### Appearance
1699
+
1700
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/theme.ts#L1)
1701
+
1702
+ ```ts
1703
+ export type Appearance = 'light' | 'dark' | 'system';
1704
+ ```
1705
+
1706
+ ### ComposerViewState
1707
+
1708
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/workspace.ts#L9)
1709
+
1710
+ ```ts
1711
+ export interface ComposerViewState {
1712
+ placeholder?: string;
1713
+ disabled?: boolean;
1714
+ readOnly?: boolean;
1715
+ action?: 'send' | 'queue' | 'stop';
1716
+ actionDisabled?: boolean;
1717
+ model?: {
1718
+ label: string;
1719
+ description: string;
1720
+ disabled?: boolean;
1721
+ };
1722
+ thinking?: {
1723
+ options: readonly {
1724
+ value: string;
1725
+ label: string;
1726
+ }[];
1727
+ value: string;
1728
+ disabled?: boolean;
1729
+ };
1730
+ }
1731
+ ```
1732
+
1733
+ ### WorkspaceShellState
1734
+
1735
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/workspace.ts#L120)
1736
+
1737
+ ```ts
1738
+ export interface WorkspaceShellState {
1739
+ workspace?: string;
1740
+ conversation?: string;
1741
+ reconnecting?: boolean;
1742
+ error?: {
1743
+ message: string;
1744
+ hidden?: boolean;
1745
+ };
1746
+ busy?: {
1747
+ key: string;
1748
+ message: string;
1749
+ actionLabel: string;
1750
+ } | null;
1751
+ }
1752
+ ```
1753
+
1754
+ ## Supporting declarations
1755
+
1756
+ ### HostResult
1757
+
1758
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/app/internal.ts#L12)
1759
+
1760
+ ```ts
1761
+ export type HostResult = void | ActionResult | Promise<void | ActionResult>;
1762
+ ```
1763
+
1764
+ Referenced types and APIs: [`ActionResult`](#actionresult).
1765
+
1766
+ ### SettingsViewSession
1767
+
1768
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/app/settings.ts#L19)
1769
+
1770
+ ```ts
1771
+ /** Session methods address one owned opening, never a later use of its window. */
1772
+ export interface SettingsViewSession<State> {
1773
+ update(state: Readonly<State>): void;
1774
+ fail(message: string): void;
1775
+ close(): void;
1776
+ isOpen(): boolean;
1777
+ destroy(): void;
1778
+ }
1779
+ ```
1780
+
1781
+ ### Submission
1782
+
1783
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/app/settings.ts#L16)
1784
+
1785
+ ```ts
1786
+ type Submission<Value> = (value: Value) => ActionResult | Promise<ActionResult>;
1787
+ ```
1788
+
1789
+ Referenced types and APIs: [`ActionResult`](#actionresult).
1790
+
1791
+ ### AttachmentItem
1792
+
1793
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/composer.ts#L55)
1794
+
1795
+ ```ts
1796
+ export interface AttachmentItem {
1797
+ id: string;
1798
+ url: string;
1799
+ name: string;
1800
+ }
1801
+ ```
1802
+
1803
+ ### PendingMessage
1804
+
1805
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/composer.ts#L6)
1806
+
1807
+ ```ts
1808
+ export interface PendingMessage {
1809
+ id: string;
1810
+ text: string;
1811
+ mode: string;
1812
+ imageCount?: number;
1813
+ }
1814
+ ```
1815
+
1816
+ ### LocalContentLink
1817
+
1818
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/content/markdown.ts#L5)
1819
+
1820
+ ```ts
1821
+ export interface LocalContentLink {
1822
+ path: string;
1823
+ conversationId: string;
1824
+ }
1825
+ ```
1826
+
1827
+ ### CostRequestDisplay
1828
+
1829
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/files/systems.ts#L18)
1830
+
1831
+ ```ts
1832
+ export interface CostRequestDisplay {
1833
+ id: string;
1834
+ purpose: string;
1835
+ status: string;
1836
+ provider: string;
1837
+ providerName?: string;
1838
+ model: string;
1839
+ modelName?: string;
1840
+ time: string;
1841
+ source: string;
1842
+ price: unknown;
1843
+ known: boolean;
1844
+ usage: {
1845
+ input: number;
1846
+ output: number;
1847
+ cacheRead: number;
1848
+ cacheWrite: number;
1849
+ reasoning?: number;
1850
+ cost: {
1851
+ total: number;
1852
+ };
1853
+ };
1854
+ }
1855
+ ```
1856
+
1857
+ ### CostSummaryDisplay
1858
+
1859
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/files/systems.ts#L9)
1860
+
1861
+ ```ts
1862
+ export interface CostSummaryDisplay {
1863
+ unavailable?: boolean;
1864
+ requestCount: number;
1865
+ unknownRequests: number;
1866
+ runRequests: number;
1867
+ runUnknownRequests: number;
1868
+ total: number;
1869
+ runTotal: number;
1870
+ }
1871
+ ```
1872
+
1873
+ ### CustomModelDraft
1874
+
1875
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/custom-connection.ts#L7)
1876
+
1877
+ ```ts
1878
+ export interface CustomModelDraft {
1879
+ sourceIndex: number;
1880
+ id: string;
1881
+ name: string;
1882
+ contextWindow: number;
1883
+ maxTokens: number;
1884
+ reasoning: boolean;
1885
+ images: boolean;
1886
+ prices: {
1887
+ input: string;
1888
+ output: string;
1889
+ cacheRead: string;
1890
+ cacheWrite: string;
1891
+ };
1892
+ }
1893
+ ```
1894
+
1895
+ ### CustomModelValue
1896
+
1897
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/custom-connection.ts#L5)
1898
+
1899
+ ```ts
1900
+ export interface CustomModelValue {
1901
+ id: string;
1902
+ name?: string;
1903
+ contextWindow?: number;
1904
+ maxTokens?: number;
1905
+ reasoning?: boolean;
1906
+ input?: readonly string[];
1907
+ cost?: {
1908
+ input: number;
1909
+ output: number;
1910
+ cacheRead: number;
1911
+ cacheWrite: number;
1912
+ };
1913
+ }
1914
+ ```
1915
+
1916
+ ### BranchHistoryNode
1917
+
1918
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/history.ts#L5)
1919
+
1920
+ ```ts
1921
+ export interface BranchHistoryNode {
1922
+ id: string;
1923
+ role: string;
1924
+ text: string;
1925
+ active: boolean;
1926
+ }
1927
+ ```
1928
+
1929
+ ### ModelEditorState
1930
+
1931
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/model-editor.ts#L19)
1932
+
1933
+ ```ts
1934
+ export interface ModelEditorState {
1935
+ providers: readonly ModelProviderOption[] | null;
1936
+ models: readonly ModelOption[] | null;
1937
+ selection: ModelSelection;
1938
+ disabled?: boolean;
1939
+ }
1940
+ ```
1941
+
1942
+ Referenced types and APIs: [`ModelOption`](#modeloption), [`ModelProviderOption`](#modelprovideroption), [`ModelSelection`](#modelselection).
1943
+
1944
+ ### ModelOption
1945
+
1946
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/model-editor.ts#L10)
1947
+
1948
+ ```ts
1949
+ export interface ModelOption {
1950
+ id: string;
1951
+ name: string;
1952
+ provider: string;
1953
+ thinkingLevels?: readonly string[] | null;
1954
+ supportsImages: boolean;
1955
+ contextWindow: number;
1956
+ maxTokens: number;
1957
+ }
1958
+ ```
1959
+
1960
+ ### ModelProviderOption
1961
+
1962
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/model-editor.ts#L4)
1963
+
1964
+ ```ts
1965
+ export interface ModelProviderOption {
1966
+ id: string;
1967
+ name: string;
1968
+ model?: string;
1969
+ thinkingLevel?: string;
1970
+ }
1971
+ ```
1972
+
1973
+ ### FormFeedback
1974
+
1975
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L10)
1976
+
1977
+ ```ts
1978
+ export interface FormFeedback {
1979
+ error?: string;
1980
+ disabled?: boolean;
1981
+ }
1982
+ ```
1983
+
1984
+ ### SettingsCredentialView
1985
+
1986
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/forms/panels.ts#L44)
1987
+
1988
+ ```ts
1989
+ export interface SettingsCredentialView {
1990
+ status: string;
1991
+ hidden: boolean;
1992
+ required: boolean;
1993
+ placeholder: string;
1994
+ removeVisible: boolean;
1995
+ hint?: string;
1996
+ actions?: Node;
1997
+ }
1998
+ ```
1999
+
2000
+ ### ApprovalView
2001
+
2002
+ [Source](https://github.com/minifish-org/pith-ui/blob/v0.2.0-app.1/src/tasks/approval.ts#L6)
2003
+
2004
+ ```ts
2005
+ export interface ApprovalView {
2006
+ id: string;
2007
+ toolName: string;
2008
+ warning?: string;
2009
+ canAlwaysAllow: boolean;
2010
+ argsText: string;
2011
+ preview?: {
2012
+ kind: string;
2013
+ path: string;
2014
+ error?: string;
2015
+ diff?: string;
2016
+ truncated?: boolean;
2017
+ };
2018
+ }
2019
+ ```