@fork-api/chat-sdk 0.1.176 → 0.1.177
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.cjs +7 -7
- package/dist/index.d.cts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -184,6 +184,19 @@ interface ForkSlotProps {
|
|
|
184
184
|
events?: Record<string, (...args: any[]) => void>;
|
|
185
185
|
}
|
|
186
186
|
type ForkState = "idle" | "prompting" | "running" | "complete" | "error";
|
|
187
|
+
/**
|
|
188
|
+
* Live tracking for one fork's agent run, keyed by fork id in the hooks'
|
|
189
|
+
* `runs` map. Each run owns its own SSE stream and event log so concurrent
|
|
190
|
+
* forks stay fully isolated — starting a second fork never touches the
|
|
191
|
+
* first one's state.
|
|
192
|
+
*/
|
|
193
|
+
interface ForkRun {
|
|
194
|
+
forkId: string;
|
|
195
|
+
state: "running" | "complete" | "error";
|
|
196
|
+
fork: Fork;
|
|
197
|
+
events: ForkEvent[];
|
|
198
|
+
error: string | null;
|
|
199
|
+
}
|
|
187
200
|
|
|
188
201
|
interface AdminContainer {
|
|
189
202
|
id: string;
|
|
@@ -248,6 +261,9 @@ interface ForkPanelProps {
|
|
|
248
261
|
fork: Fork | null;
|
|
249
262
|
events: ForkEvent[];
|
|
250
263
|
error: string | null;
|
|
264
|
+
/** Per-fork live runs keyed by fork id. Each focused thread renders its
|
|
265
|
+
* own run's progress/log/error so concurrent forks stay isolated. */
|
|
266
|
+
runs?: Record<string, ForkRun>;
|
|
251
267
|
slotId?: string;
|
|
252
268
|
targetId?: string;
|
|
253
269
|
targetLabel?: string;
|
|
@@ -276,13 +292,14 @@ interface ForkPanelProps {
|
|
|
276
292
|
*/
|
|
277
293
|
completeVariant?: "bubble" | "item";
|
|
278
294
|
}
|
|
279
|
-
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;
|
|
295
|
+
declare function ForkPanel({ state, fork, events, error, runs, slotId, targetId, targetLabel, historyMode, onSubmit, onUndo, onClose, baseUrl, apiKey, userId, userHash, appId, embedded, completeVariant, }: ForkPanelProps): react_jsx_runtime.JSX.Element;
|
|
280
296
|
|
|
281
297
|
declare function useFork(): {
|
|
282
298
|
state: ForkState;
|
|
283
299
|
fork: Fork | null;
|
|
284
300
|
events: ForkEvent[];
|
|
285
301
|
error: string | null;
|
|
302
|
+
runs: Record<string, ForkRun>;
|
|
286
303
|
open: () => void;
|
|
287
304
|
close: () => void;
|
|
288
305
|
startFork: (prompt: string, slotId?: string, containerId?: string | null, opts?: {
|
|
@@ -298,6 +315,7 @@ declare function useBoundaryFork(boundaryId: string): {
|
|
|
298
315
|
fork: Fork | null;
|
|
299
316
|
events: ForkEvent[];
|
|
300
317
|
error: string | null;
|
|
318
|
+
runs: Record<string, ForkRun>;
|
|
301
319
|
open: () => void;
|
|
302
320
|
close: () => void;
|
|
303
321
|
startFork: (prompt: string, containerId?: string | null, opts?: {
|
|
@@ -343,6 +361,7 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
343
361
|
fork: Fork | null;
|
|
344
362
|
events: ForkEvent[];
|
|
345
363
|
error: string | null;
|
|
364
|
+
runs: Record<string, ForkRun>;
|
|
346
365
|
} | {
|
|
347
366
|
onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
|
|
348
367
|
forkId?: string | null;
|
|
@@ -362,11 +381,13 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
362
381
|
fork: Fork | null;
|
|
363
382
|
events: ForkEvent[];
|
|
364
383
|
error: string | null;
|
|
384
|
+
runs: Record<string, ForkRun>;
|
|
365
385
|
};
|
|
366
386
|
state: ForkState;
|
|
367
387
|
fork: Fork | null;
|
|
368
388
|
events: ForkEvent[];
|
|
369
389
|
error: string | null;
|
|
390
|
+
runs: Record<string, ForkRun>;
|
|
370
391
|
isOpen: boolean;
|
|
371
392
|
close: () => void;
|
|
372
393
|
adoptRunningFork: (forkId: string) => Promise<void>;
|
|
@@ -405,6 +426,7 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
405
426
|
fork: Fork | null;
|
|
406
427
|
events: ForkEvent[];
|
|
407
428
|
error: string | null;
|
|
429
|
+
runs: Record<string, ForkRun>;
|
|
408
430
|
} | {
|
|
409
431
|
onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
|
|
410
432
|
forkId?: string | null;
|
|
@@ -424,11 +446,13 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
424
446
|
fork: Fork | null;
|
|
425
447
|
events: ForkEvent[];
|
|
426
448
|
error: string | null;
|
|
449
|
+
runs: Record<string, ForkRun>;
|
|
427
450
|
};
|
|
428
451
|
state: ForkState;
|
|
429
452
|
fork: Fork | null;
|
|
430
453
|
events: ForkEvent[];
|
|
431
454
|
error: string | null;
|
|
455
|
+
runs: Record<string, ForkRun>;
|
|
432
456
|
isOpen: boolean;
|
|
433
457
|
close: () => void;
|
|
434
458
|
adoptRunningFork: (forkId: string) => Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -184,6 +184,19 @@ interface ForkSlotProps {
|
|
|
184
184
|
events?: Record<string, (...args: any[]) => void>;
|
|
185
185
|
}
|
|
186
186
|
type ForkState = "idle" | "prompting" | "running" | "complete" | "error";
|
|
187
|
+
/**
|
|
188
|
+
* Live tracking for one fork's agent run, keyed by fork id in the hooks'
|
|
189
|
+
* `runs` map. Each run owns its own SSE stream and event log so concurrent
|
|
190
|
+
* forks stay fully isolated — starting a second fork never touches the
|
|
191
|
+
* first one's state.
|
|
192
|
+
*/
|
|
193
|
+
interface ForkRun {
|
|
194
|
+
forkId: string;
|
|
195
|
+
state: "running" | "complete" | "error";
|
|
196
|
+
fork: Fork;
|
|
197
|
+
events: ForkEvent[];
|
|
198
|
+
error: string | null;
|
|
199
|
+
}
|
|
187
200
|
|
|
188
201
|
interface AdminContainer {
|
|
189
202
|
id: string;
|
|
@@ -248,6 +261,9 @@ interface ForkPanelProps {
|
|
|
248
261
|
fork: Fork | null;
|
|
249
262
|
events: ForkEvent[];
|
|
250
263
|
error: string | null;
|
|
264
|
+
/** Per-fork live runs keyed by fork id. Each focused thread renders its
|
|
265
|
+
* own run's progress/log/error so concurrent forks stay isolated. */
|
|
266
|
+
runs?: Record<string, ForkRun>;
|
|
251
267
|
slotId?: string;
|
|
252
268
|
targetId?: string;
|
|
253
269
|
targetLabel?: string;
|
|
@@ -276,13 +292,14 @@ interface ForkPanelProps {
|
|
|
276
292
|
*/
|
|
277
293
|
completeVariant?: "bubble" | "item";
|
|
278
294
|
}
|
|
279
|
-
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;
|
|
295
|
+
declare function ForkPanel({ state, fork, events, error, runs, slotId, targetId, targetLabel, historyMode, onSubmit, onUndo, onClose, baseUrl, apiKey, userId, userHash, appId, embedded, completeVariant, }: ForkPanelProps): react_jsx_runtime.JSX.Element;
|
|
280
296
|
|
|
281
297
|
declare function useFork(): {
|
|
282
298
|
state: ForkState;
|
|
283
299
|
fork: Fork | null;
|
|
284
300
|
events: ForkEvent[];
|
|
285
301
|
error: string | null;
|
|
302
|
+
runs: Record<string, ForkRun>;
|
|
286
303
|
open: () => void;
|
|
287
304
|
close: () => void;
|
|
288
305
|
startFork: (prompt: string, slotId?: string, containerId?: string | null, opts?: {
|
|
@@ -298,6 +315,7 @@ declare function useBoundaryFork(boundaryId: string): {
|
|
|
298
315
|
fork: Fork | null;
|
|
299
316
|
events: ForkEvent[];
|
|
300
317
|
error: string | null;
|
|
318
|
+
runs: Record<string, ForkRun>;
|
|
301
319
|
open: () => void;
|
|
302
320
|
close: () => void;
|
|
303
321
|
startFork: (prompt: string, containerId?: string | null, opts?: {
|
|
@@ -343,6 +361,7 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
343
361
|
fork: Fork | null;
|
|
344
362
|
events: ForkEvent[];
|
|
345
363
|
error: string | null;
|
|
364
|
+
runs: Record<string, ForkRun>;
|
|
346
365
|
} | {
|
|
347
366
|
onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
|
|
348
367
|
forkId?: string | null;
|
|
@@ -362,11 +381,13 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
362
381
|
fork: Fork | null;
|
|
363
382
|
events: ForkEvent[];
|
|
364
383
|
error: string | null;
|
|
384
|
+
runs: Record<string, ForkRun>;
|
|
365
385
|
};
|
|
366
386
|
state: ForkState;
|
|
367
387
|
fork: Fork | null;
|
|
368
388
|
events: ForkEvent[];
|
|
369
389
|
error: string | null;
|
|
390
|
+
runs: Record<string, ForkRun>;
|
|
370
391
|
isOpen: boolean;
|
|
371
392
|
close: () => void;
|
|
372
393
|
adoptRunningFork: (forkId: string) => Promise<void>;
|
|
@@ -405,6 +426,7 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
405
426
|
fork: Fork | null;
|
|
406
427
|
events: ForkEvent[];
|
|
407
428
|
error: string | null;
|
|
429
|
+
runs: Record<string, ForkRun>;
|
|
408
430
|
} | {
|
|
409
431
|
onSubmit: (prompt: string, submittedTargetId?: string, containerId?: string | null, opts?: {
|
|
410
432
|
forkId?: string | null;
|
|
@@ -424,11 +446,13 @@ declare function useForkChatPanel(options: ForkChatPanelOptions): {
|
|
|
424
446
|
fork: Fork | null;
|
|
425
447
|
events: ForkEvent[];
|
|
426
448
|
error: string | null;
|
|
449
|
+
runs: Record<string, ForkRun>;
|
|
427
450
|
};
|
|
428
451
|
state: ForkState;
|
|
429
452
|
fork: Fork | null;
|
|
430
453
|
events: ForkEvent[];
|
|
431
454
|
error: string | null;
|
|
455
|
+
runs: Record<string, ForkRun>;
|
|
432
456
|
isOpen: boolean;
|
|
433
457
|
close: () => void;
|
|
434
458
|
adoptRunningFork: (forkId: string) => Promise<void>;
|