notebooklm-kit 0.0.1 → 2.1.1
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/LICENSE +22 -0
- package/README.md +4102 -0
- package/dist/src/auth/auth.d.ts +46 -0
- package/dist/src/auth/auth.d.ts.map +1 -0
- package/dist/src/auth/auth.js +323 -0
- package/dist/src/auth/auth.js.map +1 -0
- package/dist/src/auth/refresh.d.ts +150 -0
- package/dist/src/auth/refresh.d.ts.map +1 -0
- package/dist/src/auth/refresh.js +433 -0
- package/dist/src/auth/refresh.js.map +1 -0
- package/dist/src/client/notebooklm-client.d.ts +372 -0
- package/dist/src/client/notebooklm-client.d.ts.map +1 -0
- package/dist/src/client/notebooklm-client.js +550 -0
- package/dist/src/client/notebooklm-client.js.map +1 -0
- package/dist/src/index.d.ts +50 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +45 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/rpc/rpc-client.d.ts +48 -0
- package/dist/src/rpc/rpc-client.d.ts.map +1 -0
- package/dist/src/rpc/rpc-client.js +94 -0
- package/dist/src/rpc/rpc-client.js.map +1 -0
- package/dist/src/rpc/rpc-methods.d.ts +127 -0
- package/dist/src/rpc/rpc-methods.d.ts.map +1 -0
- package/dist/src/rpc/rpc-methods.js +169 -0
- package/dist/src/rpc/rpc-methods.js.map +1 -0
- package/dist/src/services/artifacts.d.ts +1017 -0
- package/dist/src/services/artifacts.d.ts.map +1 -0
- package/dist/src/services/artifacts.js +5413 -0
- package/dist/src/services/artifacts.js.map +1 -0
- package/dist/src/services/generation.d.ts +147 -0
- package/dist/src/services/generation.d.ts.map +1 -0
- package/dist/src/services/generation.js +479 -0
- package/dist/src/services/generation.js.map +1 -0
- package/dist/src/services/notebook-language.d.ts +109 -0
- package/dist/src/services/notebook-language.d.ts.map +1 -0
- package/dist/src/services/notebook-language.js +204 -0
- package/dist/src/services/notebook-language.js.map +1 -0
- package/dist/src/services/notebooks.d.ts +26 -0
- package/dist/src/services/notebooks.d.ts.map +1 -0
- package/dist/src/services/notebooks.js +539 -0
- package/dist/src/services/notebooks.js.map +1 -0
- package/dist/src/services/notes.d.ts +72 -0
- package/dist/src/services/notes.d.ts.map +1 -0
- package/dist/src/services/notes.js +340 -0
- package/dist/src/services/notes.js.map +1 -0
- package/dist/src/services/sources.d.ts +1085 -0
- package/dist/src/services/sources.d.ts.map +1 -0
- package/dist/src/services/sources.js +2675 -0
- package/dist/src/services/sources.js.map +1 -0
- package/dist/src/types/artifact.d.ts +258 -0
- package/dist/src/types/artifact.d.ts.map +1 -0
- package/dist/src/types/artifact.js +42 -0
- package/dist/src/types/artifact.js.map +1 -0
- package/dist/src/types/common.d.ts +226 -0
- package/dist/src/types/common.d.ts.map +1 -0
- package/dist/src/types/common.js +80 -0
- package/dist/src/types/common.js.map +1 -0
- package/dist/src/types/languages.d.ts +179 -0
- package/dist/src/types/languages.d.ts.map +1 -0
- package/dist/src/types/languages.js +254 -0
- package/dist/src/types/languages.js.map +1 -0
- package/dist/src/types/note.d.ts +41 -0
- package/dist/src/types/note.d.ts.map +1 -0
- package/dist/src/types/note.js +12 -0
- package/dist/src/types/note.js.map +1 -0
- package/dist/src/types/notebook.d.ts +81 -0
- package/dist/src/types/notebook.d.ts.map +1 -0
- package/dist/src/types/notebook.js +5 -0
- package/dist/src/types/notebook.js.map +1 -0
- package/dist/src/types/source.d.ts +241 -0
- package/dist/src/types/source.d.ts.map +1 -0
- package/dist/src/types/source.js +60 -0
- package/dist/src/types/source.js.map +1 -0
- package/dist/src/utils/batch-execute.d.ts +58 -0
- package/dist/src/utils/batch-execute.d.ts.map +1 -0
- package/dist/src/utils/batch-execute.js +398 -0
- package/dist/src/utils/batch-execute.js.map +1 -0
- package/dist/src/utils/chunked-decoder.d.ts +11 -0
- package/dist/src/utils/chunked-decoder.d.ts.map +1 -0
- package/dist/src/utils/chunked-decoder.js +326 -0
- package/dist/src/utils/chunked-decoder.js.map +1 -0
- package/dist/src/utils/chunked-parser.d.ts +61 -0
- package/dist/src/utils/chunked-parser.d.ts.map +1 -0
- package/dist/src/utils/chunked-parser.js +609 -0
- package/dist/src/utils/chunked-parser.js.map +1 -0
- package/dist/src/utils/errors.d.ts +58 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/errors.js +357 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/quota.d.ts +213 -0
- package/dist/src/utils/quota.d.ts.map +1 -0
- package/dist/src/utils/quota.js +518 -0
- package/dist/src/utils/quota.js.map +1 -0
- package/dist/src/utils/streaming-client.d.ts +129 -0
- package/dist/src/utils/streaming-client.d.ts.map +1 -0
- package/dist/src/utils/streaming-client.js +559 -0
- package/dist/src/utils/streaming-client.js.map +1 -0
- package/package.json +85 -7
- package/index.js +0 -2
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notebook/Project types
|
|
3
|
+
*/
|
|
4
|
+
import type { Source } from './source.js';
|
|
5
|
+
/**
|
|
6
|
+
* NotebookLM Project (Notebook)
|
|
7
|
+
*/
|
|
8
|
+
export interface Notebook {
|
|
9
|
+
projectId: string; /** Unique project ID */
|
|
10
|
+
title: string; /** Project title */
|
|
11
|
+
emoji?: string; /** Project emoji */
|
|
12
|
+
sources?: Source[]; /** Project sources */
|
|
13
|
+
metadata?: Record<string, any>; /** Project metadata */
|
|
14
|
+
createdAt?: string; /** Creation timestamp */
|
|
15
|
+
updatedAt?: string; /** Last modified timestamp */
|
|
16
|
+
description?: string; /** Project description */
|
|
17
|
+
owner?: string; /** Project owner */
|
|
18
|
+
sharing?: SharingSettings; /** Sharing settings */
|
|
19
|
+
sourceCount?: number; /** Number of sources in the notebook */
|
|
20
|
+
lastAccessed?: string; /** Last accessed timestamp */
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sharing settings for a project
|
|
24
|
+
*/
|
|
25
|
+
export interface SharingSettings {
|
|
26
|
+
isShared?: boolean; /** Is project shared */
|
|
27
|
+
shareUrl?: string; /** Share URL */
|
|
28
|
+
shareId?: string; /** Share ID */
|
|
29
|
+
publicAccess?: boolean; /** Public access */
|
|
30
|
+
allowedUsers?: string[]; /** Allowed users */
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Options for creating a notebook
|
|
34
|
+
*/
|
|
35
|
+
export interface CreateNotebookOptions {
|
|
36
|
+
title?: string; /** Notebook title (optional, auto-generated if empty) */
|
|
37
|
+
description?: string; /** Initial description (optional) */
|
|
38
|
+
emoji?: string; /** Notebook emoji (optional) */
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Options for updating a notebook
|
|
42
|
+
*/
|
|
43
|
+
export interface UpdateNotebookOptions {
|
|
44
|
+
title?: string; /** New title */
|
|
45
|
+
description?: string; /** New description */
|
|
46
|
+
emoji?: string; /** New emoji */
|
|
47
|
+
metadata?: Record<string, any>; /** Other metadata updates */
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Options for sharing a notebook
|
|
51
|
+
*/
|
|
52
|
+
export interface ShareNotebookOptions {
|
|
53
|
+
users?: Array<{
|
|
54
|
+
email: string; /** User email */
|
|
55
|
+
role: 2 | 3 | 4; /** User role: 2=editor, 3=viewer, 4=remove */
|
|
56
|
+
}>;
|
|
57
|
+
notify?: boolean; /** Notify users when adding/removing/updating permissions (default: true, only used when users are provided) */
|
|
58
|
+
accessType?: 1 | 2; /** Access type: 1=anyone with link, 2=restricted (default: 2) */
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Result of sharing a notebook
|
|
62
|
+
*/
|
|
63
|
+
export interface ShareNotebookResult {
|
|
64
|
+
shareUrl: string; /** Share URL (always present) */
|
|
65
|
+
success: boolean; /** Whether the share operation succeeded */
|
|
66
|
+
notebookId: string; /** The notebook ID that was shared */
|
|
67
|
+
accessType: 1 | 2; /** Access type: 1=anyone with link, 2=restricted */
|
|
68
|
+
isShared: boolean; /** Whether the notebook is shared (true if shared with users or link enabled) */
|
|
69
|
+
users?: Array<{
|
|
70
|
+
email: string; /** User email */
|
|
71
|
+
role: 2 | 3; /** User role: 2=editor, 3=viewer */
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Result of deleting notebook(s)
|
|
76
|
+
*/
|
|
77
|
+
export interface DeleteNotebookResult {
|
|
78
|
+
deleted: string[]; /** Array of deleted notebook IDs */
|
|
79
|
+
count: number; /** Number of notebooks deleted */
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=notebook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../../src/types/notebook.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC,CAAC,wBAAwB;IAC3C,KAAK,EAAE,MAAM,CAAC,CAAC,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,oBAAoB;IACpC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,sBAAsB;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,uBAAuB;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC,yBAAyB;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC,8BAA8B;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC,0BAA0B;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,oBAAoB;IACpC,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,uBAAuB;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC,wCAAwC;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,8BAA8B;CACtD;AAED;;GAEG;AACH,M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AAM,CAAC,CAAC,sCAAsC;IAC1D,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,oDAAoD;IACvE,QAAQ,EAAE,OAAO,CAAC,CAAC,iFAAiF;IACpG,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC,CAAC,iBAAiB;QAChC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,oCAAoC;KAClD,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,oCAAoC;IACvD,KAAK,EAAE,MAAM,CAAC,CAAC,kCAAkC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook.js","sourceRoot":"","sources":["../../../src/types/notebook.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Source type enum
|
|
6
|
+
* Maps to NotebookLM API type codes:
|
|
7
|
+
* - API code 1 → GOOGLE_DRIVE
|
|
8
|
+
* - API code 2 → TEXT
|
|
9
|
+
* - API code 3 → PDF
|
|
10
|
+
* - API code 4 → TEXT_NOTE
|
|
11
|
+
* - API code 5 → URL
|
|
12
|
+
* - API code 8 → MIND_MAP_NOTE
|
|
13
|
+
* - API code 9 → YOUTUBE_VIDEO
|
|
14
|
+
* - API code 10 → VIDEO_FILE
|
|
15
|
+
* - API code 13 → IMAGE
|
|
16
|
+
* - API code 14 → PDF_FROM_DRIVE
|
|
17
|
+
*/
|
|
18
|
+
export declare enum SourceType {
|
|
19
|
+
UNKNOWN = 0,
|
|
20
|
+
URL = 1,
|
|
21
|
+
TEXT = 2,
|
|
22
|
+
FILE = 3,// Generic file (deprecated - use specific types like PDF, VIDEO_FILE, IMAGE)
|
|
23
|
+
YOUTUBE_VIDEO = 4,
|
|
24
|
+
GOOGLE_DRIVE = 5,
|
|
25
|
+
GOOGLE_SLIDES = 6,
|
|
26
|
+
PDF = 7,// PDF file (API code 3)
|
|
27
|
+
TEXT_NOTE = 8,// Text note (API code 4)
|
|
28
|
+
VIDEO_FILE = 10,// Video file upload (API code 10)
|
|
29
|
+
IMAGE = 13,// Image file (API code 13)
|
|
30
|
+
PDF_FROM_DRIVE = 14,// PDF from Google Drive (API code 14)
|
|
31
|
+
MIND_MAP_NOTE = 15
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Source in a notebook
|
|
35
|
+
*/
|
|
36
|
+
export interface Source {
|
|
37
|
+
sourceId: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
type?: SourceType;
|
|
40
|
+
content?: string;
|
|
41
|
+
url?: string;
|
|
42
|
+
metadata?: Record<string, any>;
|
|
43
|
+
createdAt?: string;
|
|
44
|
+
updatedAt?: string;
|
|
45
|
+
status?: SourceStatus;
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Source processing status
|
|
50
|
+
*/
|
|
51
|
+
export declare enum SourceStatus {
|
|
52
|
+
UNKNOWN = 0,
|
|
53
|
+
PROCESSING = 1,
|
|
54
|
+
READY = 2,
|
|
55
|
+
FAILED = 3
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Input for adding a source
|
|
59
|
+
*/
|
|
60
|
+
export interface SourceInput {
|
|
61
|
+
type: SourceType;
|
|
62
|
+
title?: string;
|
|
63
|
+
content?: string;
|
|
64
|
+
url?: string;
|
|
65
|
+
fileContent?: string;
|
|
66
|
+
fileName?: string;
|
|
67
|
+
mimeType?: string;
|
|
68
|
+
videoId?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Options for adding a source from URL
|
|
72
|
+
*/
|
|
73
|
+
export interface AddSourceFromURLOptions {
|
|
74
|
+
url: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Options for adding a source from text
|
|
79
|
+
*/
|
|
80
|
+
export interface AddSourceFromTextOptions {
|
|
81
|
+
content: string;
|
|
82
|
+
title: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Options for adding a source from file
|
|
86
|
+
*/
|
|
87
|
+
export interface AddSourceFromFileOptions {
|
|
88
|
+
content: Buffer | string;
|
|
89
|
+
fileName: string;
|
|
90
|
+
mimeType?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Source processing status result
|
|
94
|
+
*/
|
|
95
|
+
export interface SourceProcessingStatus {
|
|
96
|
+
allReady: boolean;
|
|
97
|
+
processing: string[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Source content result
|
|
101
|
+
*/
|
|
102
|
+
export interface SourceContent {
|
|
103
|
+
text: string;
|
|
104
|
+
metadata?: Record<string, any>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Source freshness check result
|
|
108
|
+
*/
|
|
109
|
+
export interface SourceFreshness {
|
|
110
|
+
isFresh: boolean;
|
|
111
|
+
lastChecked?: Date;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Research mode for source discovery
|
|
115
|
+
*/
|
|
116
|
+
export declare enum ResearchMode {
|
|
117
|
+
FAST = 1,// Fast research (quick results)
|
|
118
|
+
DEEP = 2
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Source type for search
|
|
122
|
+
*/
|
|
123
|
+
export declare enum SearchSourceType {
|
|
124
|
+
WEB = 1,// Web sources
|
|
125
|
+
GOOGLE_DRIVE = 5
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Discovered web source
|
|
129
|
+
*/
|
|
130
|
+
export interface DiscoveredWebSource {
|
|
131
|
+
url: string;
|
|
132
|
+
title: string;
|
|
133
|
+
id?: string;
|
|
134
|
+
type?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Discovered Drive source
|
|
138
|
+
*/
|
|
139
|
+
export interface DiscoveredDriveSource {
|
|
140
|
+
fileId: string;
|
|
141
|
+
mimeType: string;
|
|
142
|
+
title: string;
|
|
143
|
+
id?: string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Discovered source (DEPRECATED - use DiscoveredWebSource or DiscoveredDriveSource instead)
|
|
147
|
+
* @deprecated This type was used with the removed `discover()` method.
|
|
148
|
+
* Use `DiscoveredWebSource[]` or `DiscoveredDriveSource[]` from `getSearchResults()` or `searchWebAndWait()` instead.
|
|
149
|
+
*/
|
|
150
|
+
export interface DiscoveredSource {
|
|
151
|
+
id: string;
|
|
152
|
+
title: string;
|
|
153
|
+
type?: SourceType;
|
|
154
|
+
url?: string;
|
|
155
|
+
relevance?: number;
|
|
156
|
+
metadata?: Record<string, any>;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Options for searching web sources
|
|
160
|
+
*/
|
|
161
|
+
export interface SearchWebSourcesOptions {
|
|
162
|
+
query: string;
|
|
163
|
+
sourceType?: SearchSourceType;
|
|
164
|
+
mode?: ResearchMode;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Options for adding discovered sources
|
|
168
|
+
*/
|
|
169
|
+
export interface AddDiscoveredSourcesOptions {
|
|
170
|
+
sessionId: string;
|
|
171
|
+
webSources?: DiscoveredWebSource[];
|
|
172
|
+
driveSources?: DiscoveredDriveSource[];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Options for adding Google Drive source directly
|
|
176
|
+
*/
|
|
177
|
+
export interface AddGoogleDriveSourceOptions {
|
|
178
|
+
fileId: string;
|
|
179
|
+
title?: string;
|
|
180
|
+
mimeType?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Options for adding YouTube source
|
|
184
|
+
*/
|
|
185
|
+
export interface AddYouTubeSourceOptions {
|
|
186
|
+
urlOrId: string;
|
|
187
|
+
title?: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Options for batch source addition
|
|
191
|
+
*/
|
|
192
|
+
export interface BatchAddSourcesOptions {
|
|
193
|
+
sources: Array<// Array of source inputs (mixed types supported)
|
|
194
|
+
{
|
|
195
|
+
type: 'url';
|
|
196
|
+
url: string;
|
|
197
|
+
title?: string;
|
|
198
|
+
} | {
|
|
199
|
+
type: 'text';
|
|
200
|
+
title: string;
|
|
201
|
+
content: string;
|
|
202
|
+
} | {
|
|
203
|
+
type: 'file';
|
|
204
|
+
content: Buffer | string;
|
|
205
|
+
fileName: string;
|
|
206
|
+
mimeType?: string;
|
|
207
|
+
} | {
|
|
208
|
+
type: 'youtube';
|
|
209
|
+
urlOrId: string;
|
|
210
|
+
title?: string;
|
|
211
|
+
} | {
|
|
212
|
+
type: 'gdrive';
|
|
213
|
+
fileId: string;
|
|
214
|
+
title?: string;
|
|
215
|
+
mimeType?: string;
|
|
216
|
+
}>;
|
|
217
|
+
waitForProcessing?: boolean;
|
|
218
|
+
timeout?: number;
|
|
219
|
+
pollInterval?: number;
|
|
220
|
+
onProgress?: (ready: number, total: number) => void;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Options for web search with waiting
|
|
224
|
+
*/
|
|
225
|
+
export interface SearchWebAndWaitOptions extends SearchWebSourcesOptions {
|
|
226
|
+
timeout?: number;
|
|
227
|
+
pollInterval?: number;
|
|
228
|
+
onProgress?: (status: {
|
|
229
|
+
hasResults: boolean;
|
|
230
|
+
resultCount?: number;
|
|
231
|
+
}) => void;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Result from web search with waiting
|
|
235
|
+
*/
|
|
236
|
+
export interface WebSearchResult {
|
|
237
|
+
sessionId: string;
|
|
238
|
+
web: DiscoveredWebSource[];
|
|
239
|
+
drive: DiscoveredDriveSource[];
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.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* - API code 3 → PDF
|
|
10
|
+
* - API code 4 → TEXT_NOTE
|
|
11
|
+
* - API code 5 → URL
|
|
12
|
+
* - API code 8 → MIND_MAP_NOTE
|
|
13
|
+
* - API code 9 → YOUTUBE_VIDEO
|
|
14
|
+
* - API code 10 → VIDEO_FILE
|
|
15
|
+
* - API code 13 → IMAGE
|
|
16
|
+
* - API code 14 → PDF_FROM_DRIVE
|
|
17
|
+
*/
|
|
18
|
+
export var SourceType;
|
|
19
|
+
(function (SourceType) {
|
|
20
|
+
SourceType[SourceType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
21
|
+
SourceType[SourceType["URL"] = 1] = "URL";
|
|
22
|
+
SourceType[SourceType["TEXT"] = 2] = "TEXT";
|
|
23
|
+
SourceType[SourceType["FILE"] = 3] = "FILE";
|
|
24
|
+
SourceType[SourceType["YOUTUBE_VIDEO"] = 4] = "YOUTUBE_VIDEO";
|
|
25
|
+
SourceType[SourceType["GOOGLE_DRIVE"] = 5] = "GOOGLE_DRIVE";
|
|
26
|
+
SourceType[SourceType["GOOGLE_SLIDES"] = 6] = "GOOGLE_SLIDES";
|
|
27
|
+
SourceType[SourceType["PDF"] = 7] = "PDF";
|
|
28
|
+
SourceType[SourceType["TEXT_NOTE"] = 8] = "TEXT_NOTE";
|
|
29
|
+
SourceType[SourceType["VIDEO_FILE"] = 10] = "VIDEO_FILE";
|
|
30
|
+
SourceType[SourceType["IMAGE"] = 13] = "IMAGE";
|
|
31
|
+
SourceType[SourceType["PDF_FROM_DRIVE"] = 14] = "PDF_FROM_DRIVE";
|
|
32
|
+
SourceType[SourceType["MIND_MAP_NOTE"] = 15] = "MIND_MAP_NOTE";
|
|
33
|
+
})(SourceType || (SourceType = {}));
|
|
34
|
+
/**
|
|
35
|
+
* Source processing status
|
|
36
|
+
*/
|
|
37
|
+
export var SourceStatus;
|
|
38
|
+
(function (SourceStatus) {
|
|
39
|
+
SourceStatus[SourceStatus["UNKNOWN"] = 0] = "UNKNOWN";
|
|
40
|
+
SourceStatus[SourceStatus["PROCESSING"] = 1] = "PROCESSING";
|
|
41
|
+
SourceStatus[SourceStatus["READY"] = 2] = "READY";
|
|
42
|
+
SourceStatus[SourceStatus["FAILED"] = 3] = "FAILED";
|
|
43
|
+
})(SourceStatus || (SourceStatus = {}));
|
|
44
|
+
/**
|
|
45
|
+
* Research mode for source discovery
|
|
46
|
+
*/
|
|
47
|
+
export var ResearchMode;
|
|
48
|
+
(function (ResearchMode) {
|
|
49
|
+
ResearchMode[ResearchMode["FAST"] = 1] = "FAST";
|
|
50
|
+
ResearchMode[ResearchMode["DEEP"] = 2] = "DEEP";
|
|
51
|
+
})(ResearchMode || (ResearchMode = {}));
|
|
52
|
+
/**
|
|
53
|
+
* Source type for search
|
|
54
|
+
*/
|
|
55
|
+
export var SearchSourceType;
|
|
56
|
+
(function (SearchSourceType) {
|
|
57
|
+
SearchSourceType[SearchSourceType["WEB"] = 1] = "WEB";
|
|
58
|
+
SearchSourceType[SearchSourceType["GOOGLE_DRIVE"] = 5] = "GOOGLE_DRIVE";
|
|
59
|
+
})(SearchSourceType || (SearchSourceType = {}));
|
|
60
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/types/source.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAN,IAAY,UAcX;AAdD,WAAY,UAAU;IACpB,iDAAW,CAAA;IACX,yCAAO,CAAA;IACP,2CAAQ,CAAA;IACR,2CAAQ,CAAA;IACR,6DAAiB,CAAA;IACjB,2DAAgB,CAAA;IAChB,6DAAiB,CAAA;IACjB,yCAAO,CAAA;IACP,qDAAa,CAAA;IACb,wDAAe,CAAA;IACf,8CAAU,CAAA;IACV,gEAAmB,CAAA;IACnB,8DAAkB,CAAA;AACpB,CAAC,EAdW,UAAU,KAAV,UAAU,QAcrB;AAkBD;;GAEG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,qDAAW,CAAA;IACX,2DAAc,CAAA;IACd,iDAAS,CAAA;IACT,mDAAU,CAAA;AACZ,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAiED;;GAEG;AACH,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+CAAQ,CAAA;IACR,+CAAQ,CAAA;AACV,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,qDAAO,CAAA;IACP,uEAAgB,CAAA;AAClB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batch execute client for NotebookLM RPC calls
|
|
3
|
+
* Full-fledged implementation matching nlm Go version
|
|
4
|
+
*/
|
|
5
|
+
import type { BatchExecuteConfig, RPCCall, RPCResponse } from '../types/common.js';
|
|
6
|
+
/**
|
|
7
|
+
* Batch execute client
|
|
8
|
+
*/
|
|
9
|
+
export declare class BatchExecuteClient {
|
|
10
|
+
private config;
|
|
11
|
+
/**
|
|
12
|
+
* Update cookies (called when credentials are refreshed)
|
|
13
|
+
*/
|
|
14
|
+
updateCookies(cookies: string): void;
|
|
15
|
+
private reqidGenerator;
|
|
16
|
+
constructor(config: BatchExecuteConfig);
|
|
17
|
+
/**
|
|
18
|
+
* Execute a single RPC call
|
|
19
|
+
*/
|
|
20
|
+
do(rpc: RPCCall): Promise<RPCResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Execute one or more RPC calls
|
|
23
|
+
*/
|
|
24
|
+
execute(rpcs: RPCCall[]): Promise<RPCResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Build RPC data array
|
|
27
|
+
*/
|
|
28
|
+
private buildRPCData;
|
|
29
|
+
/**
|
|
30
|
+
* Decode batchexecute response
|
|
31
|
+
*/
|
|
32
|
+
private decodeResponse;
|
|
33
|
+
/**
|
|
34
|
+
* Check if error is retryable
|
|
35
|
+
*/
|
|
36
|
+
private isRetryableError;
|
|
37
|
+
/**
|
|
38
|
+
* Check if HTTP status is retryable
|
|
39
|
+
*/
|
|
40
|
+
private isRetryableStatus;
|
|
41
|
+
/**
|
|
42
|
+
* Mask sensitive value for logging
|
|
43
|
+
*/
|
|
44
|
+
private maskSensitiveValue;
|
|
45
|
+
/**
|
|
46
|
+
* Mask cookie values for logging
|
|
47
|
+
*/
|
|
48
|
+
private maskCookieValues;
|
|
49
|
+
/**
|
|
50
|
+
* Sleep helper
|
|
51
|
+
*/
|
|
52
|
+
private sleep;
|
|
53
|
+
/**
|
|
54
|
+
* Get current config
|
|
55
|
+
*/
|
|
56
|
+
getConfig(): BatchExecuteConfig;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=batch-execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-execute.d.ts","sourceRoot":"","sources":["../../../src/utils/batch-execute.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,OAAO,EACP,WAAW,EACZ,MAAM,oBAAoB,CAAC;AA4B5B;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAqB;IAEnC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAGpC,OAAO,CAAC,cAAc,CAAiB;gBAE3B,MAAM,EAAE,kBAAkB;IAiCtC;;OAEG;IACG,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC;IAI5C;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IA4KpD;;OAEG;IACH,OAAO,CAAC,YAAY;IAWpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAsGtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAU1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;OAEG;IACH,SAAS,IAAI,kBAAkB;CAGhC"}
|