@fork-api/chat-sdk 0.1.152 → 0.1.154

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.
package/dist/index.d.cts CHANGED
@@ -19,6 +19,32 @@ interface Fork {
19
19
  completedAt?: string;
20
20
  error?: string;
21
21
  }
22
+ type ForkActivityTargetKind = "slot" | "module";
23
+ interface ForkActivity {
24
+ id: string;
25
+ status: Fork["status"];
26
+ targetKind: ForkActivityTargetKind;
27
+ targetId: string;
28
+ summary?: string | null;
29
+ latestMessage?: string | null;
30
+ estimateMinutes?: number | null;
31
+ promptCount?: number;
32
+ messageCount?: number;
33
+ isActive?: boolean;
34
+ createdAt: string;
35
+ updatedAt: string;
36
+ completedAt?: string | null;
37
+ unread?: boolean;
38
+ }
39
+ interface ForkActivitySummary {
40
+ state: "idle" | "running" | "complete" | "error";
41
+ label: string;
42
+ detail?: string;
43
+ count: number;
44
+ runningCount: number;
45
+ unreadCompletedCount: number;
46
+ latest: ForkActivity | null;
47
+ }
22
48
  interface ForkEvent {
23
49
  type: "status" | "agent_message" | "tool_use" | "build_start" | "build_complete" | "build_error" | "complete" | "error";
24
50
  data: unknown;
@@ -99,6 +125,12 @@ type ForkChatInterfaceProps = ForkChatTargetInput & {
99
125
  * shell (e.g. Chrome's native side panel).
100
126
  */
101
127
  embedded?: boolean;
128
+ /**
129
+ * How the completed-fork summary renders. "bubble" (default) is the chat
130
+ * bubble layout; "item" is the shadcn-Item layout (icon tile + title +
131
+ * description + Undo action).
132
+ */
133
+ completeVariant?: "bubble" | "item";
102
134
  };
103
135
  interface ForkSlotProps {
104
136
  slotId: string;
@@ -204,8 +236,10 @@ interface ForkUIProps {
204
236
  }
205
237
  declare function ForkUI({ slotId, title, slotLabel }: ForkUIProps): react_jsx_runtime.JSX.Element;
206
238
 
207
- declare function ForkButton({ onClick }: {
239
+ declare function ForkButton({ onClick, hasNotification, activity, }: {
208
240
  onClick?: () => void;
241
+ hasNotification?: boolean;
242
+ activity?: ForkActivitySummary;
209
243
  }): react_jsx_runtime.JSX.Element;
210
244
 
211
245
  interface ForkPanelProps {
@@ -235,8 +269,13 @@ interface ForkPanelProps {
235
269
  * panel.
236
270
  */
237
271
  embedded?: boolean;
272
+ /**
273
+ * Rendering style for the "applied" summary in the complete state.
274
+ * "bubble" (default) is the chat bubble. "item" is a shadcn-Item layout.
275
+ */
276
+ completeVariant?: "bubble" | "item";
238
277
  }
239
- declare function ForkPanel({ state, fork, events, error, slotId, targetId, targetLabel, historyMode, onSubmit, onUndo, onClose, baseUrl, apiKey, userId, userHash, appId, embedded, }: ForkPanelProps): react_jsx_runtime.JSX.Element;
278
+ declare function ForkPanel({ state, fork, events, error, slotId, targetId, targetLabel, historyMode, onSubmit, onUndo, onClose, baseUrl, apiKey, userId, userHash, appId, embedded, completeVariant, }: ForkPanelProps): react_jsx_runtime.JSX.Element;
240
279
 
241
280
  declare function useFork(): {
242
281
  state: ForkState;
@@ -250,6 +289,7 @@ declare function useFork(): {
250
289
  forceNew?: boolean;
251
290
  }) => Promise<void>;
252
291
  undoFork: (slotId: string) => Promise<any>;
292
+ adoptRunningFork: (forkId: string) => Promise<void>;
253
293
  };
254
294
 
255
295
  declare function useBoundaryFork(boundaryId: string): {
@@ -264,9 +304,11 @@ declare function useBoundaryFork(boundaryId: string): {
264
304
  forceNew?: boolean;
265
305
  }) => Promise<void>;
266
306
  undoFork: () => Promise<any>;
307
+ adoptRunningFork: (forkId: string) => Promise<void>;
267
308
  };
268
309
 
269
310
  declare function useForkChatPanel(options: ForkChatPanelOptions): {
311
+ open: () => void;
270
312
  target: ForkChatTarget;
271
313
  targetId: string;
272
314
  targetLabel: string | undefined;
@@ -277,7 +319,9 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
277
319
  }) => Promise<void>;
278
320
  undo: (submittedTargetId?: string) => Promise<any>;
279
321
  buttonProps: {
280
- onClick: (() => void) | (() => void);
322
+ onClick: () => void;
323
+ hasNotification: boolean;
324
+ activity: ForkActivitySummary;
281
325
  };
282
326
  panelProps: {
283
327
  onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
@@ -323,9 +367,10 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
323
367
  events: ForkEvent[];
324
368
  error: string | null;
325
369
  isOpen: boolean;
326
- open: () => void;
327
370
  close: () => void;
371
+ adoptRunningFork: (forkId: string) => Promise<void>;
328
372
  } | {
373
+ open: () => void;
329
374
  target: ForkChatTarget;
330
375
  targetId: string;
331
376
  targetLabel: string | undefined;
@@ -336,7 +381,9 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
336
381
  }) => Promise<void>;
337
382
  undo: (submittedTargetId?: string) => Promise<any>;
338
383
  buttonProps: {
339
- onClick: (() => void) | (() => void);
384
+ onClick: () => void;
385
+ hasNotification: boolean;
386
+ activity: ForkActivitySummary;
340
387
  };
341
388
  panelProps: {
342
389
  onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
@@ -382,8 +429,8 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
382
429
  events: ForkEvent[];
383
430
  error: string | null;
384
431
  isOpen: boolean;
385
- open: () => void;
386
432
  close: () => void;
433
+ adoptRunningFork: (forkId: string) => Promise<void>;
387
434
  };
388
435
 
389
436
  /**
@@ -481,4 +528,4 @@ declare function clearCachedManifest(tenantId: string, appId: string, userId: st
481
528
  */
482
529
  declare function manifestDiffers(a: Manifest | null, b: Manifest | null): boolean;
483
530
 
484
- export { type Fork, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkEvent, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type PreviewSessionPayload, clearCachedManifest, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, usePreviewSession, writeCachedManifest };
531
+ export { type Fork, type ForkActivity, type ForkActivitySummary, type ForkActivityTargetKind, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkEvent, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type PreviewSessionPayload, clearCachedManifest, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, usePreviewSession, writeCachedManifest };
package/dist/index.d.ts CHANGED
@@ -19,6 +19,32 @@ interface Fork {
19
19
  completedAt?: string;
20
20
  error?: string;
21
21
  }
22
+ type ForkActivityTargetKind = "slot" | "module";
23
+ interface ForkActivity {
24
+ id: string;
25
+ status: Fork["status"];
26
+ targetKind: ForkActivityTargetKind;
27
+ targetId: string;
28
+ summary?: string | null;
29
+ latestMessage?: string | null;
30
+ estimateMinutes?: number | null;
31
+ promptCount?: number;
32
+ messageCount?: number;
33
+ isActive?: boolean;
34
+ createdAt: string;
35
+ updatedAt: string;
36
+ completedAt?: string | null;
37
+ unread?: boolean;
38
+ }
39
+ interface ForkActivitySummary {
40
+ state: "idle" | "running" | "complete" | "error";
41
+ label: string;
42
+ detail?: string;
43
+ count: number;
44
+ runningCount: number;
45
+ unreadCompletedCount: number;
46
+ latest: ForkActivity | null;
47
+ }
22
48
  interface ForkEvent {
23
49
  type: "status" | "agent_message" | "tool_use" | "build_start" | "build_complete" | "build_error" | "complete" | "error";
24
50
  data: unknown;
@@ -99,6 +125,12 @@ type ForkChatInterfaceProps = ForkChatTargetInput & {
99
125
  * shell (e.g. Chrome's native side panel).
100
126
  */
101
127
  embedded?: boolean;
128
+ /**
129
+ * How the completed-fork summary renders. "bubble" (default) is the chat
130
+ * bubble layout; "item" is the shadcn-Item layout (icon tile + title +
131
+ * description + Undo action).
132
+ */
133
+ completeVariant?: "bubble" | "item";
102
134
  };
103
135
  interface ForkSlotProps {
104
136
  slotId: string;
@@ -204,8 +236,10 @@ interface ForkUIProps {
204
236
  }
205
237
  declare function ForkUI({ slotId, title, slotLabel }: ForkUIProps): react_jsx_runtime.JSX.Element;
206
238
 
207
- declare function ForkButton({ onClick }: {
239
+ declare function ForkButton({ onClick, hasNotification, activity, }: {
208
240
  onClick?: () => void;
241
+ hasNotification?: boolean;
242
+ activity?: ForkActivitySummary;
209
243
  }): react_jsx_runtime.JSX.Element;
210
244
 
211
245
  interface ForkPanelProps {
@@ -235,8 +269,13 @@ interface ForkPanelProps {
235
269
  * panel.
236
270
  */
237
271
  embedded?: boolean;
272
+ /**
273
+ * Rendering style for the "applied" summary in the complete state.
274
+ * "bubble" (default) is the chat bubble. "item" is a shadcn-Item layout.
275
+ */
276
+ completeVariant?: "bubble" | "item";
238
277
  }
239
- declare function ForkPanel({ state, fork, events, error, slotId, targetId, targetLabel, historyMode, onSubmit, onUndo, onClose, baseUrl, apiKey, userId, userHash, appId, embedded, }: ForkPanelProps): react_jsx_runtime.JSX.Element;
278
+ declare function ForkPanel({ state, fork, events, error, slotId, targetId, targetLabel, historyMode, onSubmit, onUndo, onClose, baseUrl, apiKey, userId, userHash, appId, embedded, completeVariant, }: ForkPanelProps): react_jsx_runtime.JSX.Element;
240
279
 
241
280
  declare function useFork(): {
242
281
  state: ForkState;
@@ -250,6 +289,7 @@ declare function useFork(): {
250
289
  forceNew?: boolean;
251
290
  }) => Promise<void>;
252
291
  undoFork: (slotId: string) => Promise<any>;
292
+ adoptRunningFork: (forkId: string) => Promise<void>;
253
293
  };
254
294
 
255
295
  declare function useBoundaryFork(boundaryId: string): {
@@ -264,9 +304,11 @@ declare function useBoundaryFork(boundaryId: string): {
264
304
  forceNew?: boolean;
265
305
  }) => Promise<void>;
266
306
  undoFork: () => Promise<any>;
307
+ adoptRunningFork: (forkId: string) => Promise<void>;
267
308
  };
268
309
 
269
310
  declare function useForkChatPanel(options: ForkChatPanelOptions): {
311
+ open: () => void;
270
312
  target: ForkChatTarget;
271
313
  targetId: string;
272
314
  targetLabel: string | undefined;
@@ -277,7 +319,9 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
277
319
  }) => Promise<void>;
278
320
  undo: (submittedTargetId?: string) => Promise<any>;
279
321
  buttonProps: {
280
- onClick: (() => void) | (() => void);
322
+ onClick: () => void;
323
+ hasNotification: boolean;
324
+ activity: ForkActivitySummary;
281
325
  };
282
326
  panelProps: {
283
327
  onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
@@ -323,9 +367,10 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
323
367
  events: ForkEvent[];
324
368
  error: string | null;
325
369
  isOpen: boolean;
326
- open: () => void;
327
370
  close: () => void;
371
+ adoptRunningFork: (forkId: string) => Promise<void>;
328
372
  } | {
373
+ open: () => void;
329
374
  target: ForkChatTarget;
330
375
  targetId: string;
331
376
  targetLabel: string | undefined;
@@ -336,7 +381,9 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
336
381
  }) => Promise<void>;
337
382
  undo: (submittedTargetId?: string) => Promise<any>;
338
383
  buttonProps: {
339
- onClick: (() => void) | (() => void);
384
+ onClick: () => void;
385
+ hasNotification: boolean;
386
+ activity: ForkActivitySummary;
340
387
  };
341
388
  panelProps: {
342
389
  onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
@@ -382,8 +429,8 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
382
429
  events: ForkEvent[];
383
430
  error: string | null;
384
431
  isOpen: boolean;
385
- open: () => void;
386
432
  close: () => void;
433
+ adoptRunningFork: (forkId: string) => Promise<void>;
387
434
  };
388
435
 
389
436
  /**
@@ -481,4 +528,4 @@ declare function clearCachedManifest(tenantId: string, appId: string, userId: st
481
528
  */
482
529
  declare function manifestDiffers(a: Manifest | null, b: Manifest | null): boolean;
483
530
 
484
- export { type Fork, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkEvent, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type PreviewSessionPayload, clearCachedManifest, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, usePreviewSession, writeCachedManifest };
531
+ export { type Fork, type ForkActivity, type ForkActivitySummary, type ForkActivityTargetKind, type ForkBoundaryDefinition, ForkBoundaryUI, ForkButton, ForkChatInterface, type ForkChatInterfaceProps, type ForkChatPanelOptions, type ForkChatTarget, type ForkEvent, ForkPanel, ForkProvider, type ForkProviderProps, type ForkSharedRegistry, ForkSlot, type ForkSlotProps, type ForkState, ForkUI, type LoadManifestInput, type Manifest, type ManifestEntry, type ManifestModuleEntry, type PreviewSessionPayload, clearCachedManifest, forkable, loadManifest, manifestDiffers, readCachedManifest, registerForkShared, useBoundaryFork, useFork, useForkChatPanel, usePreviewSession, writeCachedManifest };