@sybil-studio-devs/sdk 0.1.0 → 0.2.0

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.ts CHANGED
@@ -1,396 +1,10 @@
1
- interface SybilConfig {
2
- apiKey: string;
3
- baseUrl?: string;
4
- timeout?: number;
5
- }
6
- interface RateLimitInfo {
7
- limit: number;
8
- remaining: number;
9
- resetAt: string;
10
- }
11
- interface ApiResponse<T> {
12
- data: T;
13
- meta?: {
14
- rateLimit?: RateLimitInfo;
15
- };
16
- }
17
- interface ApiError {
18
- error: {
19
- message: string;
20
- code?: string;
21
- };
22
- }
23
- interface PaginationParams {
24
- limit?: number;
25
- offset?: number;
26
- }
27
- interface Pagination {
28
- total: number;
29
- limit: number;
30
- offset: number;
31
- hasMore: boolean;
32
- }
33
- interface Block {
34
- type: string;
35
- content?: Array<{
36
- type: string;
37
- text?: string;
38
- [key: string]: any;
39
- }>;
40
- attrs?: Record<string, any>;
41
- [key: string]: any;
42
- }
43
- interface Page {
44
- id: string;
45
- title: string;
46
- slug: string;
47
- description?: string;
48
- blocks: Block[];
49
- artifact_map?: Record<string, any>;
50
- parent_id?: string | null;
51
- is_published: boolean;
52
- is_template: boolean;
53
- version: number;
54
- created_at: string;
55
- updated_at: string;
56
- metadata?: Record<string, any>;
57
- }
58
- interface CreatePageParams {
59
- title?: string;
60
- slug?: string;
61
- description?: string;
62
- blocks?: Block[];
63
- parent_id?: string;
64
- }
65
- interface UpdatePageParams {
66
- title?: string;
67
- slug?: string;
68
- description?: string | null;
69
- blocks?: Block[];
70
- is_published?: boolean;
71
- parent_id?: string | null;
72
- }
73
- interface ListPagesParams extends PaginationParams {
74
- parent_id?: string | 'root';
75
- is_published?: boolean;
76
- }
77
- interface UploadResult {
78
- url: string;
79
- fileName: string;
80
- fileSize: number;
81
- mimeType: string;
82
- path: string;
83
- }
84
- interface Document {
85
- id: string;
86
- title: string;
87
- fileName: string;
88
- fileType: string;
89
- mimeType?: string;
90
- fileSize: number;
91
- status: DocumentStatus;
92
- sourceUrl?: string;
93
- sourceType?: string;
94
- content?: string;
95
- contentPreview?: string;
96
- insights?: Insight[];
97
- metadata?: DocumentMetadata;
98
- createdAt: string;
99
- updatedAt: string;
100
- processedAt?: string;
101
- }
102
- type DocumentStatus = 'pending' | 'uploading' | 'processing' | 'extracting' | 'indexing' | 'processed' | 'completed' | 'failed';
103
- interface DocumentMetadata {
104
- title?: string;
105
- fileName?: string;
106
- fileType?: string;
107
- fileSize?: number;
108
- documentType?: string;
109
- category?: string;
110
- keywords?: string[];
111
- language?: string;
112
- pageCount?: number;
113
- wordCount?: number;
114
- hasTranscript?: boolean;
115
- semanticAnalysis?: SemanticAnalysis;
116
- }
117
- interface SemanticAnalysis {
118
- topics?: string[];
119
- entities?: Record<string, any[]>;
120
- keyphrases?: string[];
121
- domainTerms?: string[];
122
- }
123
- interface Insight {
124
- id: string;
125
- type: string;
126
- title?: string;
127
- content: string;
128
- confidence?: number;
129
- data?: any;
130
- created_at?: string;
131
- }
132
- interface ProcessDocumentResult {
133
- success: boolean;
134
- documentId: string;
135
- status: DocumentStatus;
136
- message: string;
137
- metadata: DocumentMetadata;
138
- contentPreview?: string;
139
- insights: Insight[];
140
- processingTime: number;
141
- }
142
- interface DocumentStatusResult {
143
- documentId: string;
144
- status: DocumentStatus;
145
- progress: number;
146
- message: string;
147
- startedAt?: string;
148
- completedAt?: string;
149
- error?: any;
150
- hasInsights: boolean;
151
- insightsCount: number;
152
- }
153
- interface ListDocumentsParams extends PaginationParams {
154
- status?: DocumentStatus;
155
- fileType?: string;
156
- search?: string;
157
- }
158
- interface GetDocumentParams {
159
- includeContent?: boolean;
160
- includeInsights?: boolean;
161
- includeMetadata?: boolean;
162
- }
163
- interface YouTubeVideo {
164
- id: string;
165
- videoId: string;
166
- documentId: string;
167
- title: string;
168
- description?: string;
169
- channelTitle: string;
170
- channelId: string;
171
- tags?: string[];
172
- publishedAt: string;
173
- duration: string;
174
- viewCount: number;
175
- likeCount: number;
176
- commentCount: number;
177
- thumbnailUrl: string;
178
- transcriptAvailable: boolean;
179
- transcriptLanguage?: string;
180
- wordCount: number;
181
- readingTime: number;
182
- createdAt: string;
183
- updatedAt: string;
184
- }
185
- interface ProcessYouTubeResult {
186
- status: 'success' | 'exists';
187
- document: {
188
- id: string;
189
- title: string;
190
- workspace_id: string;
191
- source_url: string;
192
- created_at: string;
193
- };
194
- video: {
195
- videoId: string;
196
- title: string;
197
- channelTitle: string;
198
- duration: string;
199
- viewCount: number;
200
- hasTranscript: boolean;
201
- };
202
- transcript: {
203
- available: boolean;
204
- wordCount: number;
205
- chunkCount: number;
206
- };
207
- insights: {
208
- count: number;
209
- types: string[];
210
- };
211
- message: string;
212
- }
213
- interface GetYouTubeVideoParams {
214
- includeTranscript?: boolean;
215
- includeChunks?: boolean;
216
- includeInsights?: boolean;
217
- }
218
- interface TranscriptChunk {
219
- index: number;
220
- startTime: number;
221
- endTime: number;
222
- content: string;
223
- metadata?: Record<string, any>;
224
- }
225
- interface YouTubeVideoDetail extends YouTubeVideo {
226
- transcript?: string;
227
- chunks?: TranscriptChunk[];
228
- insights?: Insight[];
229
- semanticAnalysis?: SemanticAnalysis;
230
- }
231
- interface ChatMessage {
232
- role: 'user' | 'assistant';
233
- content: string;
234
- }
235
- interface ChatParams {
236
- query: string;
237
- documentId: string;
238
- conversationHistory?: ChatMessage[];
239
- searchConfig?: {
240
- semanticWeight?: number;
241
- keywordWeight?: number;
242
- maxResults?: number;
243
- confidenceThreshold?: number;
244
- };
245
- }
246
- interface ChatSource {
247
- content: string;
248
- similarity: number;
249
- metadata?: Record<string, any>;
250
- }
251
- interface ChatResult {
252
- response: string;
253
- sources: ChatSource[];
254
- metadata: {
255
- documentId: string;
256
- documentTitle: string;
257
- sourcesCount: number;
258
- confidence: number;
259
- requestId: string;
260
- };
261
- }
262
- interface ChatHistoryItem {
263
- id: string;
264
- query: string;
265
- response: string;
266
- type: string;
267
- createdAt: string;
268
- metadata?: Record<string, any>;
269
- }
270
- interface AnalyzeParams {
271
- documentId: string;
272
- forceRefresh?: boolean;
273
- }
274
- interface AnalysisResult {
275
- analysis: any;
276
- cached: boolean;
277
- generatedAt: string;
278
- document: {
279
- id: string;
280
- title: string;
281
- };
282
- }
1
+ import { S as SybilSDK } from './client-BPFcAPV8.js';
2
+ export { y as AnalysisResult, x as AnalyzeParams, f as ApiError, A as ApiResponse, B as Block, w as ChatHistoryItem, s as ChatMessage, t as ChatParams, v as ChatResult, u as ChatSource, C as CreatePageParams, D as Document, k as DocumentMetadata, j as DocumentStatus, n as DocumentStatusResult, b as EmbedInstance, E as EmbedOptions, c as EmbedTheme, G as GetDocumentParams, q as GetYouTubeVideoParams, I as Insight, o as ListDocumentsParams, L as ListPagesParams, h as Page, g as Pagination, P as PaginationParams, m as ProcessDocumentResult, p as ProcessYouTubeResult, R as RateLimitInfo, l as SemanticAnalysis, d as SybilConfig, a as SybilError, T as TranscriptChunk, U as UpdatePageParams, i as UploadResult, Y as YouTubeVideo, r as YouTubeVideoDetail, e as embedPage } from './client-BPFcAPV8.js';
3
+ export { AtlasClient, embedAtlas } from './atlas/index.js';
4
+ export { m as AtlasAPIError, l as AtlasAPIResponse, b as AtlasBlock, f as AtlasEmbedConfig, j as AtlasError, g as AtlasFeatures, k as AtlasInstance, i as AtlasLogEntry, h as AtlasLoggingConfig, a as AtlasPage, d as AtlasSidebarData, e as AtlasSidebarPage, c as AtlasTeamspace, A as AtlasTheme, C as CreateAtlasPageParams, U as UpdateAtlasPageParams } from './types-BjxgQxBW.js';
5
+ export { NexusClient, embedNexus } from './nexus/index.js';
6
+ export { q as NexusAPIError, p as NexusAPIResponse, f as NexusActivity, d as NexusBreadcrumb, i as NexusEmbedConfig, m as NexusError, j as NexusFeatures, a as NexusFile, b as NexusFolder, e as NexusFolderTree, n as NexusInstance, c as NexusItem, g as NexusLabel, l as NexusLogEntry, k as NexusLoggingConfig, h as NexusStats, N as NexusTheme, o as NexusUploadOptions } from './types-DVY5_vpY.js';
283
7
 
284
- declare class SybilSDK {
285
- private apiKey;
286
- private baseUrl;
287
- private timeout;
288
- pages: PagesAPI;
289
- documents: DocumentsAPI;
290
- youtube: YouTubeAPI;
291
- chat: ChatAPI;
292
- analyze: AnalyzeAPI;
293
- constructor(config: string | SybilConfig);
294
- request<T>(endpoint: string, options?: RequestInit): Promise<T>;
295
- }
296
- declare class SybilError extends Error {
297
- status: number;
298
- code?: string;
299
- constructor(message: string, status: number, code?: string);
300
- }
301
- declare class PagesAPI {
302
- private client;
303
- constructor(client: SybilSDK);
304
- list(params?: ListPagesParams): Promise<{
305
- pages: Page[];
306
- pagination: Pagination;
307
- }>;
308
- get(pageId: string): Promise<{
309
- page: Page;
310
- }>;
311
- create(params?: CreatePageParams): Promise<{
312
- page: Page;
313
- }>;
314
- update(pageId: string, params: UpdatePageParams): Promise<{
315
- page: Page;
316
- }>;
317
- delete(pageId: string): Promise<{
318
- success: boolean;
319
- message: string;
320
- }>;
321
- upload(file: File | Blob, fileName?: string): Promise<UploadResult>;
322
- deleteFile(filePath: string): Promise<{
323
- success: boolean;
324
- message: string;
325
- }>;
326
- }
327
- declare class DocumentsAPI {
328
- private client;
329
- constructor(client: SybilSDK);
330
- list(params?: ListDocumentsParams): Promise<{
331
- documents: Document[];
332
- pagination: Pagination;
333
- }>;
334
- get(documentId: string, params?: GetDocumentParams): Promise<{
335
- document: Document;
336
- }>;
337
- process(file: File | Blob, options?: {
338
- fileName?: string;
339
- metadata?: Record<string, any>;
340
- collectionId?: string;
341
- }): Promise<ProcessDocumentResult>;
342
- status(documentId: string): Promise<DocumentStatusResult>;
343
- insights(documentId: string, type?: string): Promise<{
344
- documentId: string;
345
- insights: Insight[];
346
- semanticAnalysis?: any;
347
- }>;
348
- delete(documentId: string): Promise<{
349
- success: boolean;
350
- message: string;
351
- documentId: string;
352
- }>;
353
- waitForProcessing(documentId: string, options?: {
354
- maxAttempts?: number;
355
- interval?: number;
356
- }): Promise<Document>;
357
- }
358
- declare class YouTubeAPI {
359
- private client;
360
- constructor(client: SybilSDK);
361
- list(params?: {
362
- limit?: number;
363
- offset?: number;
364
- }): Promise<{
365
- videos: YouTubeVideo[];
366
- pagination: Pagination;
367
- }>;
368
- process(url: string, collectionId?: string): Promise<ProcessYouTubeResult>;
369
- get(videoId: string, params?: GetYouTubeVideoParams): Promise<{
370
- video: YouTubeVideoDetail;
371
- }>;
372
- delete(videoId: string): Promise<{
373
- success: boolean;
374
- message: string;
375
- videoId: string;
376
- }>;
377
- }
378
- declare class ChatAPI {
379
- private client;
380
- constructor(client: SybilSDK);
381
- send(params: ChatParams): Promise<ChatResult>;
382
- send(documentId: string, query: string): Promise<ChatResult>;
383
- history(documentId: string, limit?: number): Promise<{
384
- history: ChatHistoryItem[];
385
- total: number;
386
- }>;
387
- }
388
- declare class AnalyzeAPI {
389
- private client;
390
- constructor(client: SybilSDK);
391
- run(params: AnalyzeParams): Promise<AnalysisResult>;
392
- run(documentId: string, forceRefresh?: boolean): Promise<AnalysisResult>;
393
- get(documentId: string): Promise<AnalysisResult>;
394
- }
395
8
 
396
- export { type AnalysisResult, type AnalyzeParams, type ApiError, type ApiResponse, type Block, type ChatHistoryItem, type ChatMessage, type ChatParams, type ChatResult, type ChatSource, type CreatePageParams, type Document, type DocumentMetadata, type DocumentStatus, type DocumentStatusResult, type GetDocumentParams, type GetYouTubeVideoParams, type Insight, type ListDocumentsParams, type ListPagesParams, type Page, type Pagination, type PaginationParams, type ProcessDocumentResult, type ProcessYouTubeResult, type RateLimitInfo, type SemanticAnalysis, type SybilConfig, SybilError, SybilSDK, type TranscriptChunk, type UpdatePageParams, type UploadResult, type YouTubeVideo, type YouTubeVideoDetail, SybilSDK as default };
9
+
10
+ export { SybilSDK, SybilSDK as default };