@wyxos/vibe 5.5.1 → 5.5.3
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/lib/core/autofillController.d.ts +1 -1
- package/lib/core/feedFooter.d.ts +1 -0
- package/lib/core/fillController.d.ts +16 -1
- package/lib/core/fillReconciliation.d.ts +16 -0
- package/lib/core/reelForwardController.d.ts +1 -2
- package/lib/core/removalControllers.d.ts +1 -2
- package/lib/core/removalReconciliationController.d.ts +3 -1
- package/lib/core/runtime.d.ts +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +285 -194
- package/lib/types.d.ts +3 -0
- package/package.json +1 -1
package/lib/core/feedFooter.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { VibeFeedFooterActions } from '../types';
|
|
2
2
|
interface FeedFooterActionTarget {
|
|
3
3
|
cancelAutofill: () => Promise<void>;
|
|
4
|
+
getState: () => import('../types').VibeState;
|
|
4
5
|
loadNext: () => Promise<void>;
|
|
5
6
|
reload: () => Promise<void>;
|
|
6
7
|
retryEnd: () => Promise<void>;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
+
import { type FrontendFillProgress } from './fill';
|
|
1
2
|
import type { LoadedPageRecord } from './page';
|
|
3
|
+
import { type RequestDelaySnapshot } from './requestDelay';
|
|
2
4
|
import type { VibeRuntimeState } from './runtime';
|
|
3
5
|
import type { VibeBackendFillUpdate, VibeCursor, VibeFillOptions, VibeFillSessionSnapshot, VibeFillTarget, VibePageLoader } from '../types';
|
|
4
6
|
interface FillControllerOptions {
|
|
5
7
|
fill?: VibeFillOptions;
|
|
6
8
|
loadPage?: VibePageLoader;
|
|
9
|
+
needsFrontendPreparation?: () => boolean;
|
|
7
10
|
onLastCursor: (cursor: VibeCursor) => void;
|
|
8
11
|
onPages: (pages: readonly LoadedPageRecord[]) => void;
|
|
12
|
+
prepareFrontend?: (context: {
|
|
13
|
+
isCurrent: () => boolean;
|
|
14
|
+
onDelayChange: (snapshot: RequestDelaySnapshot) => void;
|
|
15
|
+
signal: AbortSignal;
|
|
16
|
+
}) => Promise<'complete' | 'paused' | 'skipped'>;
|
|
9
17
|
state: VibeRuntimeState;
|
|
10
18
|
}
|
|
19
|
+
interface FillStartOptions {
|
|
20
|
+
cycleId?: string;
|
|
21
|
+
prepareFrontend?: boolean;
|
|
22
|
+
progressOffset?: Pick<FrontendFillProgress, 'completedPages' | 'received'>;
|
|
23
|
+
target?: VibeFillTarget;
|
|
24
|
+
}
|
|
11
25
|
export declare class VibeFillController {
|
|
12
26
|
private readonly options;
|
|
13
27
|
private abortController;
|
|
@@ -19,8 +33,9 @@ export declare class VibeFillController {
|
|
|
19
33
|
isActive(): boolean;
|
|
20
34
|
applyUpdate(update: VibeBackendFillUpdate): boolean;
|
|
21
35
|
restoreSession(snapshot: VibeFillSessionSnapshot): boolean;
|
|
22
|
-
start(targetValue: VibeFillTarget): Promise<void>;
|
|
36
|
+
start(targetValue: VibeFillTarget, startOptions?: FillStartOptions): Promise<void>;
|
|
23
37
|
cancel(): Promise<void>;
|
|
38
|
+
resume(prepareFrontend: boolean): Promise<void>;
|
|
24
39
|
reset(): void;
|
|
25
40
|
destroy(): void;
|
|
26
41
|
private abortLocalRequest;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RemovalReconciliationController } from './removalReconciliationController';
|
|
2
|
+
import type { RequestDelaySnapshot } from './requestDelay';
|
|
3
|
+
import type { VibeRuntimeState } from './runtime';
|
|
4
|
+
import type { VibeCursor, VibePageLoader } from '../types';
|
|
5
|
+
export type FillReconciliationStatus = 'complete' | 'paused' | 'skipped';
|
|
6
|
+
interface FillReconciliationOptions {
|
|
7
|
+
controller: RemovalReconciliationController;
|
|
8
|
+
isCurrent: () => boolean;
|
|
9
|
+
loadPage: VibePageLoader;
|
|
10
|
+
onDelayChange: (snapshot: RequestDelaySnapshot) => void;
|
|
11
|
+
setLastCursor: (cursor: VibeCursor) => void;
|
|
12
|
+
signal: AbortSignal;
|
|
13
|
+
state: VibeRuntimeState;
|
|
14
|
+
}
|
|
15
|
+
export declare function reconcileBeforeFill({ controller, isCurrent, loadPage, onDelayChange, setLastCursor, signal, state, }: FillReconciliationOptions): Promise<FillReconciliationStatus>;
|
|
16
|
+
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { VibeRuntimeState } from './runtime';
|
|
2
2
|
import type { VibeItem, VibeItemId } from '../types';
|
|
3
3
|
interface ReelForwardControllerOptions {
|
|
4
|
-
loadNext: () => Promise<void>;
|
|
5
4
|
onActivate: (postId: VibeItemId) => void;
|
|
6
|
-
|
|
5
|
+
replenishAfterRemoval: () => Promise<void>;
|
|
7
6
|
state: VibeRuntimeState;
|
|
8
7
|
}
|
|
9
8
|
export declare class ReelForwardController {
|
|
@@ -7,11 +7,10 @@ import type { VibeRuntimeState } from './runtime';
|
|
|
7
7
|
import type { VibeItemId } from '../types';
|
|
8
8
|
interface RemovalControllerOptions {
|
|
9
9
|
historyLimit: number | undefined;
|
|
10
|
-
loadNext: () => Promise<void>;
|
|
11
10
|
onActivate: (postId: VibeItemId) => void;
|
|
12
11
|
onItemsRemoved: (postIds: readonly VibeItemId[]) => void;
|
|
13
12
|
onItemsRestored: (postIds: readonly VibeItemId[]) => void;
|
|
14
|
-
|
|
13
|
+
replenishAfterRemoval: () => Promise<void>;
|
|
15
14
|
state: VibeRuntimeState;
|
|
16
15
|
surface: () => VibeSurfaceExpose | null;
|
|
17
16
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CreateVibeOptions, VibeCursor, VibeItem, VibeItemId, VibePageLoader } from '../types';
|
|
2
2
|
import { type LoadedPageRecord } from './page';
|
|
3
|
+
import { type RequestDelaySnapshot } from './requestDelay';
|
|
3
4
|
interface ReconciliationResult {
|
|
4
5
|
items: VibeItem[];
|
|
5
6
|
lastCursor: VibeCursor;
|
|
@@ -12,6 +13,7 @@ interface ReconciliationResult {
|
|
|
12
13
|
interface ReconcileOptions {
|
|
13
14
|
existingItems: readonly VibeItem[];
|
|
14
15
|
loadPage: VibePageLoader;
|
|
16
|
+
onDelayChange?: (snapshot: RequestDelaySnapshot) => void;
|
|
15
17
|
shouldPause?: () => boolean;
|
|
16
18
|
signal: AbortSignal;
|
|
17
19
|
}
|
|
@@ -32,7 +34,7 @@ export declare class RemovalReconciliationController {
|
|
|
32
34
|
remove(postIds: readonly VibeItemId[]): void;
|
|
33
35
|
reset(): void;
|
|
34
36
|
restore(postIds: readonly VibeItemId[]): void;
|
|
35
|
-
reconcile({ existingItems, loadPage, shouldPause, signal, }: ReconcileOptions): Promise<ReconciliationResult>;
|
|
37
|
+
reconcile({ existingItems, loadPage, onDelayChange, shouldPause, signal, }: ReconcileOptions): Promise<ReconciliationResult>;
|
|
36
38
|
private createSession;
|
|
37
39
|
private result;
|
|
38
40
|
private findUnderfilledPage;
|
package/lib/core/runtime.d.ts
CHANGED