@kolbo/app-sdk
Advanced tools
+87
-9
@@ -25,2 +25,9 @@ export interface ClientConfig { | ||
| export interface PaginateResult<T> { | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextOffset: number; | ||
| error: { message: string; status?: number } | null; | ||
| } | ||
| export interface AuthNamespace { | ||
@@ -33,2 +40,6 @@ isSandbox(): boolean; | ||
| verifyOtp(opts: { email: string; code: string; purpose?: string }): Promise<any>; | ||
| // 2.2+ forgot-password flow. Step 1 sends an OTP code; step 2 consumes | ||
| // the code + sets a new password. Both are enumeration-safe. | ||
| requestPasswordReset(opts: { email: string }): Promise<Result<any>>; | ||
| resetPassword(opts: { email: string; code: string; newPassword: string }): Promise<Result<any>>; | ||
| setSession(tokens: { access_token: string; refresh_token: string }): Promise<any>; | ||
@@ -43,7 +54,14 @@ signOut(): Promise<any>; | ||
| export interface DataNamespace { | ||
| list(collection: string, opts?: ListOptions): Promise<Result<any[]>>; | ||
| get(collection: string, id: string): Promise<Result<any>>; | ||
| create(collection: string, doc: any): Promise<Result<any>>; | ||
| update(collection: string, id: string, patch: any): Promise<Result<any>>; | ||
| // Generic <T> on the CRUD surface so callers (e.g. the preset hook | ||
| // library) can declare entity shapes and get them back typed instead | ||
| // of everything being `any`. | ||
| list<T = any>(collection: string, opts?: ListOptions): Promise<Result<T[]>>; | ||
| get<T = any>(collection: string, id: string): Promise<Result<T>>; | ||
| create<T = any>(collection: string, doc: Partial<T>): Promise<Result<T>>; | ||
| update<T = any>(collection: string, id: string, patch: Partial<T>): Promise<Result<T>>; | ||
| delete(collection: string, id: string): Promise<Result<any>>; | ||
| // 2.2+ offset-based pagination with hasMore detection. Internally | ||
| // over-fetches by 1 to probe for a next page, so consumers don't have | ||
| // to maintain their own "did I get less than limit" counter. | ||
| paginate<T = any>(collection: string, opts?: ListOptions): Promise<PaginateResult<T>>; | ||
| } | ||
@@ -53,2 +71,11 @@ | ||
| upload(bucket: string, fileName: string, file: Blob | File): Promise<Result<any>>; | ||
| // 2.2+ variant that surfaces real upload progress via XHR (fetch's | ||
| // upload progress isn't exposed in browsers). onProgress receives a | ||
| // ratio 0..1. | ||
| uploadWithProgress( | ||
| bucket: string, | ||
| fileName: string, | ||
| file: Blob | File, | ||
| onProgress?: (ratio: number) => void, | ||
| ): Promise<Result<any>>; | ||
| getPublicUrl(bucket: string, fileNameOrUrl: string): string; | ||
@@ -60,8 +87,59 @@ delete(bucket: string, fileId: string): Promise<Result<any>>; | ||
| // Common options for every kolbo.ai.* call. `signal` threads through to | ||
| // fetch + polling so hooks (useAIGeneration preset) can cancel an | ||
| // in-flight generation. `model` is picked by the AI Integrator agent | ||
| // server-side at planning time but can be overridden per call. | ||
| export interface AiCallBase { | ||
| model?: string; | ||
| signal?: AbortSignal; | ||
| [key: string]: any; | ||
| } | ||
| export interface AiNamespace { | ||
| chat(opts: { message?: string; messages?: Array<{ role: string; content: string }>; session_id?: string }): Promise<{ content: string; session_id: string }>; | ||
| generateImage(opts: { prompt: string; aspect_ratio?: string }): Promise<{ url: string; images: any[] }>; | ||
| generateVideo(opts: { prompt: string; duration?: number; aspect_ratio?: string }): Promise<{ url: string }>; | ||
| generateMusic(opts: { prompt: string; duration?: number }): Promise<{ url: string }>; | ||
| generateSpeech(opts: { text: string; voice?: string }): Promise<{ url: string }>; | ||
| chat(opts: AiCallBase & { | ||
| message?: string; | ||
| messages?: Array<{ role: string; content: string }>; | ||
| session_id?: string; | ||
| }): Promise<{ content: string; session_id: string }>; | ||
| generateImage(opts: AiCallBase & { | ||
| prompt: string; | ||
| aspect_ratio?: string; | ||
| visual_dna_id?: string; | ||
| reference_image?: string; | ||
| }): Promise<{ url: string; images: any[] }>; | ||
| generateImageEdit(opts: AiCallBase & { | ||
| prompt: string; | ||
| image: string; | ||
| mask?: string; | ||
| }): Promise<{ url: string; images: any[] }>; | ||
| generateVideo(opts: AiCallBase & { | ||
| prompt: string; | ||
| duration?: number; | ||
| aspect_ratio?: string; | ||
| }): Promise<{ url: string }>; | ||
| generateVideoFromImage(opts: AiCallBase & { | ||
| prompt: string; | ||
| image: string; | ||
| duration?: number; | ||
| }): Promise<{ url: string }>; | ||
| generateLipsync(opts: AiCallBase & { | ||
| image?: string; | ||
| video?: string; | ||
| audio: string; | ||
| }): Promise<{ url: string }>; | ||
| generateMusic(opts: AiCallBase & { | ||
| prompt: string; | ||
| duration?: number; | ||
| }): Promise<{ url: string }>; | ||
| generateSpeech(opts: AiCallBase & { | ||
| text: string; | ||
| voice?: string; | ||
| }): Promise<{ url: string }>; | ||
| generateSound(opts: AiCallBase & { | ||
| prompt: string; | ||
| duration?: number; | ||
| }): Promise<{ url: string }>; | ||
| transcribe(opts: AiCallBase & { | ||
| audio: string; | ||
| }): Promise<{ text: string; srt?: string; segments?: any[] }>; | ||
| } | ||
@@ -68,0 +146,0 @@ |
+1
-1
| { | ||
| "name": "@kolbo/app-sdk", | ||
| "version": "2.3.0", | ||
| "version": "2.3.1", | ||
| "description": "Kolbo App Builder SDK — auth, data, storage and AI for generated apps", | ||
@@ -5,0 +5,0 @@ "type": "module", |
82783
3.09%1491
5.37%