notebooklm-api 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.
Files changed (58) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -0
  3. package/README.md +113 -0
  4. package/dist/api/artifacts.d.ts +155 -0
  5. package/dist/api/artifacts.d.ts.map +1 -0
  6. package/dist/api/chat.d.ts +63 -0
  7. package/dist/api/chat.d.ts.map +1 -0
  8. package/dist/api/notebooks.d.ts +91 -0
  9. package/dist/api/notebooks.d.ts.map +1 -0
  10. package/dist/api/notes.d.ts +56 -0
  11. package/dist/api/notes.d.ts.map +1 -0
  12. package/dist/api/research.d.ts +63 -0
  13. package/dist/api/research.d.ts.map +1 -0
  14. package/dist/api/sources.d.ts +136 -0
  15. package/dist/api/sources.d.ts.map +1 -0
  16. package/dist/auth.d.ts +82 -0
  17. package/dist/auth.d.ts.map +1 -0
  18. package/dist/cli/commands/chat.d.ts +7 -0
  19. package/dist/cli/commands/chat.d.ts.map +1 -0
  20. package/dist/cli/commands/generate.d.ts +6 -0
  21. package/dist/cli/commands/generate.d.ts.map +1 -0
  22. package/dist/cli/commands/login.d.ts +8 -0
  23. package/dist/cli/commands/login.d.ts.map +1 -0
  24. package/dist/cli/commands/notebook.d.ts +8 -0
  25. package/dist/cli/commands/notebook.d.ts.map +1 -0
  26. package/dist/cli/commands/research.d.ts +6 -0
  27. package/dist/cli/commands/research.d.ts.map +1 -0
  28. package/dist/cli/commands/source.d.ts +6 -0
  29. package/dist/cli/commands/source.d.ts.map +1 -0
  30. package/dist/cli/helpers.d.ts +55 -0
  31. package/dist/cli/helpers.d.ts.map +1 -0
  32. package/dist/cli/index.d.ts +8 -0
  33. package/dist/cli/index.d.ts.map +1 -0
  34. package/dist/cli/index.js +18930 -0
  35. package/dist/client.d.ts +134 -0
  36. package/dist/client.d.ts.map +1 -0
  37. package/dist/core.d.ts +65 -0
  38. package/dist/core.d.ts.map +1 -0
  39. package/dist/errors.d.ts +68 -0
  40. package/dist/errors.d.ts.map +1 -0
  41. package/dist/index.d.ts +42 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +15519 -0
  44. package/dist/logger.d.ts +28 -0
  45. package/dist/logger.d.ts.map +1 -0
  46. package/dist/paths.d.ts +36 -0
  47. package/dist/paths.d.ts.map +1 -0
  48. package/dist/rpc/decoder.d.ts +81 -0
  49. package/dist/rpc/decoder.d.ts.map +1 -0
  50. package/dist/rpc/encoder.d.ts +48 -0
  51. package/dist/rpc/encoder.d.ts.map +1 -0
  52. package/dist/rpc/index.d.ts +7 -0
  53. package/dist/rpc/index.d.ts.map +1 -0
  54. package/dist/rpc/types.d.ts +148 -0
  55. package/dist/rpc/types.d.ts.map +1 -0
  56. package/dist/types.d.ts +226 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/package.json +63 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0 (2026-03-20)
4
+
5
+ Fork of `notebooklm@0.1.1` by kaelen with extensive bug fixes and new features.
6
+
7
+ ### Bug Fixes
8
+
9
+ - **Source status parsing**: Sources always showed "processing" even when ready. The GET_NOTEBOOK response wraps status in `[null, statusCode]` array — added array traversal to extract the actual code.
10
+ - **Source list RPC method**: Changed from `hizoJc` (GET_SOURCE_FULLTEXT) to `rLM1Ne` (GET_NOTEBOOK) which actually returns sources.
11
+ - **Source ID parsing**: GET_NOTEBOOK wraps source IDs as `["uuid"]` arrays — added unwrapping logic in `parseSourceItem`.
12
+ - **Source list traversal**: `parseSourceList` now correctly finds sources at the right nesting level in the GET_NOTEBOOK response.
13
+ - **addText RPC params**: Fixed parameter format from flat `[notebookId, title, content]` to correct nested array structure per Google's batchexecute protocol.
14
+ - **addUrl RPC params**: Fixed parameter format for both regular URLs and YouTube URLs.
15
+ - **Source delete params**: Fixed to use triple-nested sourceId `[[[sourceId]]]`.
16
+ - **Generation status codes**: Fixed mapping — was `0=Pending, 1=InProgress, 2=Completed, 3=Error`, should be `1=Processing, 2=Pending, 3=Completed`.
17
+ - **Artifact status parsing**: Status is at `item[4]` in the LIST_ARTIFACTS response, not `item[3]`.
18
+ - **Artifact listing**: Added required `source-path=/notebook/{id}` URL parameter to `rpcCall` — without it, LIST_ARTIFACTS returns null.
19
+ - **getStatus method**: Replaced fake `GET_GENERATION_STATUS` RPC (doesn't exist) with LIST_ARTIFACTS + find by ID.
20
+ - **CREATE_ARTIFACT method ID**: Changed from `xpWGLf` to `R7cb6c`.
21
+ - **generateReport**: Complete rewrite — fetches source IDs from notebook and builds correct nested params with source ID references.
22
+ - **downloadReport**: Now reads `artifact.content` from LIST_ARTIFACTS response instead of returning empty string.
23
+
24
+ ### New Features
25
+
26
+ - **Slide deck generation**: Added `generateSlideDeck()` API method and `notebooklm generate slide-deck` CLI command with `--prompt`, `--format` (detailed/presenter), and `--length` (default/short) options.
27
+ - **Artifact download**: Added `notebooklm generate download <notebookId> <artifactId> <outputPath>` CLI command for downloading artifact content to files.
28
+ - **rpcCall source-path**: Added optional `sourcePath` parameter to `rpcCall` for methods that require notebook context.
29
+
30
+ ### RPC Method Reference
31
+
32
+ Correct method IDs (verified against [teng-lin/notebooklm-py](https://github.com/teng-lin/notebooklm-py)):
33
+
34
+ | Method | ID | Notes |
35
+ |--------|-----|-------|
36
+ | GET_NOTEBOOK | `rLM1Ne` | Returns notebook + sources |
37
+ | ADD_SOURCE | `izAoDd` | URL, text, YouTube |
38
+ | DELETE_SOURCE | `tGMBJ` | Triple-nested source ID |
39
+ | LIST_ARTIFACTS | `gArtLc` | Requires source-path |
40
+ | CREATE_ARTIFACT | `R7cb6c` | All artifact types |
41
+ | DELETE_ARTIFACT | `V5N4be` | |
42
+ | EXPORT_ARTIFACT | `Krh3pd` | To Docs/Sheets |
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eric
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # notebooklm-client
2
+
3
+ Unofficial TypeScript/JavaScript client and CLI for the Google NotebookLM API.
4
+
5
+ Fork of [`notebooklm`](https://www.npmjs.com/package/notebooklm) with extensive bug fixes (15+ RPC fixes) and new features (slide deck generation, artifact downloads). See [CHANGELOG.md](./CHANGELOG.md) for details.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g notebooklm-client
11
+ ```
12
+
13
+ ## Authentication
14
+
15
+ ```bash
16
+ notebooklm login
17
+ ```
18
+
19
+ Opens a browser to authenticate with your Google account. Credentials are stored locally in `~/.notebooklm/`.
20
+
21
+ ## CLI Usage
22
+
23
+ ### Notebooks
24
+
25
+ ```bash
26
+ notebooklm create "My Research" # Create notebook
27
+ notebooklm list # List all notebooks
28
+ ```
29
+
30
+ ### Sources
31
+
32
+ ```bash
33
+ notebooklm source add-text <notebookId> -t "Title" -c "Content"
34
+ notebooklm source add-url <notebookId> <url>
35
+ notebooklm source list <notebookId>
36
+ notebooklm source delete <notebookId> <sourceId>
37
+ ```
38
+
39
+ ### Generate Content
40
+
41
+ ```bash
42
+ # Reports
43
+ notebooklm generate report <notebookId> -p "Custom prompt" -w
44
+
45
+ # Slide decks
46
+ notebooklm generate slide-deck <notebookId> -p "Instructions" -f presenter -w
47
+
48
+ # Audio/video overviews
49
+ notebooklm generate audio <notebookId> -w
50
+ notebooklm generate video <notebookId> -w
51
+
52
+ # Check status
53
+ notebooklm generate status <notebookId> <artifactId>
54
+
55
+ # Download content
56
+ notebooklm generate download <notebookId> <artifactId> output.md
57
+ ```
58
+
59
+ ### Research
60
+
61
+ ```bash
62
+ notebooklm research fast <notebookId> "research query"
63
+ notebooklm research deep <notebookId> "research query"
64
+ ```
65
+
66
+ ## Programmatic Usage
67
+
68
+ ```typescript
69
+ import { NotebookLMClient } from 'notebooklm-client';
70
+
71
+ const client = await NotebookLMClient.fromStorage();
72
+
73
+ // Create notebook and add sources
74
+ const notebook = await client.notebooks.create('Research');
75
+ await client.sources.addText(notebook.id, 'Title', 'Content...');
76
+
77
+ // Generate report
78
+ const status = await client.artifacts.generateReport(notebook.id, {
79
+ customPrompt: 'Analyze the key findings...'
80
+ });
81
+
82
+ // Wait and download
83
+ await client.artifacts.waitForGeneration(notebook.id, status.artifactId);
84
+ const content = await client.artifacts.downloadReport(notebook.id, status.artifactId);
85
+
86
+ // Generate slide deck
87
+ const slides = await client.artifacts.generateSlideDeck(notebook.id, {
88
+ instructions: 'Create executive briefing...',
89
+ format: 'presenter',
90
+ length: 'default'
91
+ });
92
+ ```
93
+
94
+ ## What's Fixed (vs `notebooklm@0.1.1`)
95
+
96
+ - Source status always showing "processing" even when ready
97
+ - Sources listing using wrong RPC method
98
+ - `addText` / `addUrl` using wrong parameter formats
99
+ - Artifact status codes mapped incorrectly
100
+ - Artifact polling using nonexistent RPC method
101
+ - Report generation using wrong method ID and params
102
+ - Report download returning empty string
103
+ - Missing `source-path` URL parameter on artifact calls
104
+
105
+ ## What's New
106
+
107
+ - `generate slide-deck` command (ArtifactType 8)
108
+ - `generate download` command for saving artifacts to files
109
+ - Artifact content extraction from LIST_ARTIFACTS response
110
+
111
+ ## License
112
+
113
+ MIT
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Artifacts API Module
3
+ *
4
+ * Handles AI-generated content like audio, video, reports, quizzes, etc.
5
+ */
6
+ import { ClientCore } from '../core.ts';
7
+ import { StudioContentType } from '../rpc/types.ts';
8
+ import type { Artifact, GenerationStatus, AudioOptions, VideoOptions, ReportOptions, QuizOptions, FlashcardOptions, MindMapOptions } from '../types.ts';
9
+ /**
10
+ * API client for artifact operations.
11
+ */
12
+ export declare class ArtifactsAPI {
13
+ private core;
14
+ constructor(core: ClientCore);
15
+ /**
16
+ * Lists all artifacts in a notebook.
17
+ *
18
+ * @param notebookId - The notebook ID
19
+ * @param type - Optional filter by content type
20
+ * @returns List of artifacts
21
+ */
22
+ list(notebookId: string, type?: StudioContentType): Promise<Artifact[]>;
23
+ /**
24
+ * Gets a specific artifact by ID.
25
+ *
26
+ * @param notebookId - The notebook ID
27
+ * @param artifactId - The artifact ID
28
+ * @returns Artifact details
29
+ */
30
+ get(notebookId: string, artifactId: string): Promise<Artifact | null>;
31
+ /**
32
+ * Deletes an artifact.
33
+ *
34
+ * @param notebookId - The notebook ID
35
+ * @param artifactId - The artifact ID
36
+ */
37
+ delete(notebookId: string, artifactId: string): Promise<void>;
38
+ /**
39
+ * Renames an artifact.
40
+ *
41
+ * @param notebookId - The notebook ID
42
+ * @param artifactId - The artifact ID
43
+ * @param newTitle - The new title
44
+ */
45
+ rename(notebookId: string, artifactId: string, newTitle: string): Promise<void>;
46
+ /**
47
+ * Generates an audio overview (podcast).
48
+ *
49
+ * @param notebookId - The notebook ID
50
+ * @param options - Generation options
51
+ * @returns Generation status
52
+ */
53
+ generateAudio(notebookId: string, options?: AudioOptions): Promise<GenerationStatus>;
54
+ /**
55
+ * Generates a video overview.
56
+ *
57
+ * @param notebookId - The notebook ID
58
+ * @param options - Generation options
59
+ * @returns Generation status
60
+ */
61
+ generateVideo(notebookId: string, options?: VideoOptions): Promise<GenerationStatus>;
62
+ /**
63
+ * Generates a report.
64
+ *
65
+ * @param notebookId - The notebook ID
66
+ * @param options - Generation options
67
+ * @returns Generation status
68
+ */
69
+ generateReport(notebookId: string, options?: ReportOptions): Promise<GenerationStatus>;
70
+ /**
71
+ * Generates a quiz.
72
+ *
73
+ * @param notebookId - The notebook ID
74
+ * @param options - Generation options
75
+ * @returns Generation status
76
+ */
77
+ generateQuiz(notebookId: string, options?: QuizOptions): Promise<GenerationStatus>;
78
+ /**
79
+ * Generates flashcards.
80
+ *
81
+ * @param notebookId - The notebook ID
82
+ * @param options - Generation options
83
+ * @returns Generation status
84
+ */
85
+ generateFlashcards(notebookId: string, options?: FlashcardOptions): Promise<GenerationStatus>;
86
+ /**
87
+ * Generates a mind map.
88
+ *
89
+ * @param notebookId - The notebook ID
90
+ * @param options - Generation options
91
+ * @returns Generation status
92
+ */
93
+ generateMindMap(notebookId: string, options?: MindMapOptions): Promise<GenerationStatus>;
94
+ /**
95
+ * Gets the current generation status for an artifact.
96
+ *
97
+ * @param notebookId - The notebook ID
98
+ * @param artifactId - The artifact ID
99
+ * @returns Current status
100
+ */
101
+ getStatus(notebookId: string, artifactId: string): Promise<GenerationStatus>;
102
+ /**
103
+ * Waits for generation to complete.
104
+ *
105
+ * @param notebookId - The notebook ID
106
+ * @param artifactId - The artifact ID
107
+ * @param options - Polling options
108
+ * @returns Final generation status
109
+ */
110
+ waitForGeneration(notebookId: string, artifactId: string, options?: {
111
+ timeoutMs?: number;
112
+ pollIntervalMs?: number;
113
+ }): Promise<GenerationStatus>;
114
+ /**
115
+ * Downloads an audio artifact.
116
+ *
117
+ * @param notebookId - The notebook ID
118
+ * @param artifactId - The artifact ID
119
+ * @returns Audio content as Uint8Array
120
+ */
121
+ downloadAudio(notebookId: string, artifactId: string): Promise<Uint8Array>;
122
+ /**
123
+ * Downloads a video artifact.
124
+ *
125
+ * @param notebookId - The notebook ID
126
+ * @param artifactId - The artifact ID
127
+ * @returns Video content as Uint8Array
128
+ */
129
+ downloadVideo(notebookId: string, artifactId: string): Promise<Uint8Array>;
130
+ /**
131
+ * Downloads a report as markdown.
132
+ *
133
+ * @param notebookId - The notebook ID
134
+ * @param artifactId - The artifact ID
135
+ * @returns Report content as string
136
+ */
137
+ downloadReport(notebookId: string, artifactId: string): Promise<string>;
138
+ /**
139
+ * Exports a report to Google Docs.
140
+ *
141
+ * @param notebookId - The notebook ID
142
+ * @param artifactId - The artifact ID
143
+ * @returns Google Docs URL
144
+ */
145
+ exportToDocs(notebookId: string, artifactId: string): Promise<string>;
146
+ /**
147
+ * Exports a data table to Google Sheets.
148
+ *
149
+ * @param notebookId - The notebook ID
150
+ * @param artifactId - The artifact ID
151
+ * @returns Google Sheets URL
152
+ */
153
+ exportToSheets(notebookId: string, artifactId: string): Promise<string>;
154
+ }
155
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/api/artifacts.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Chat API Module
3
+ *
4
+ * Handles conversational interactions with notebooks.
5
+ */
6
+ import { ClientCore } from '../core.ts';
7
+ import { ChatMode } from '../rpc/types.ts';
8
+ import type { AskResult, ConversationTurn, ChatConfig } from '../types.ts';
9
+ /**
10
+ * API client for chat operations.
11
+ */
12
+ export declare class ChatAPI {
13
+ private core;
14
+ constructor(core: ClientCore);
15
+ /**
16
+ * Asks a question to a notebook.
17
+ *
18
+ * @param notebookId - The notebook ID
19
+ * @param question - The question to ask
20
+ * @param options - Optional parameters
21
+ * @returns The answer with references
22
+ */
23
+ ask(notebookId: string, question: string, options?: {
24
+ conversationId?: string;
25
+ sourceIds?: string[];
26
+ }): Promise<AskResult>;
27
+ /**
28
+ * Gets conversation history from the API.
29
+ *
30
+ * @param notebookId - The notebook ID
31
+ * @param conversationId - The conversation ID
32
+ * @returns List of conversation turns
33
+ */
34
+ getHistory(notebookId: string, conversationId: string): Promise<ConversationTurn[]>;
35
+ /**
36
+ * Gets locally cached conversation turns.
37
+ *
38
+ * @param conversationId - The conversation ID
39
+ * @returns Cached turns
40
+ */
41
+ getCachedTurns(conversationId: string): ConversationTurn[];
42
+ /**
43
+ * Clears the conversation cache.
44
+ *
45
+ * @param conversationId - Optional specific conversation to clear
46
+ */
47
+ clearCache(conversationId?: string): void;
48
+ /**
49
+ * Configures chat persona and response settings.
50
+ *
51
+ * @param notebookId - The notebook ID
52
+ * @param config - Configuration options
53
+ */
54
+ configure(notebookId: string, config: ChatConfig): Promise<void>;
55
+ /**
56
+ * Applies a predefined chat mode.
57
+ *
58
+ * @param notebookId - The notebook ID
59
+ * @param mode - The chat mode to apply
60
+ */
61
+ setMode(notebookId: string, mode: ChatMode): Promise<void>;
62
+ }
63
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/api/chat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAa,QAAQ,EAAkC,MAAM,iBAAiB,CAAC;AAEtF,OAAO,KAAK,EACV,SAAS,EAET,gBAAgB,EAChB,UAAU,EACX,MAAM,aAAa,CAAC;AAKrB;;GAEG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;;;OAOG;IACG,GAAG,CACP,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;QACP,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,GACL,OAAO,CAAC,SAAS,CAAC;IA8CrB;;;;;;OAMG;IACG,UAAU,CACd,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAW9B;;;;;OAKG;IACH,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAI1D;;;;OAIG;IACH,UAAU,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAIzC;;;;;OAKG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAWtE;;;;;OAKG;IACG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAQjE"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Notebooks API Module
3
+ *
4
+ * Handles notebook management operations.
5
+ */
6
+ import { ClientCore } from '../core.ts';
7
+ import type { Notebook, NotebookDescription } from '../types.ts';
8
+ /**
9
+ * API client for notebook operations.
10
+ */
11
+ export declare class NotebooksAPI {
12
+ private core;
13
+ constructor(core: ClientCore);
14
+ /**
15
+ * Lists all notebooks for the authenticated user.
16
+ */
17
+ list(): Promise<Notebook[]>;
18
+ /**
19
+ * Creates a new notebook.
20
+ *
21
+ * @param title - The title for the new notebook
22
+ * @returns The created notebook
23
+ */
24
+ create(title: string): Promise<Notebook>;
25
+ /**
26
+ * Gets detailed information about a notebook.
27
+ *
28
+ * @param notebookId - The notebook ID
29
+ * @returns Notebook details
30
+ */
31
+ get(notebookId: string): Promise<Notebook>;
32
+ /**
33
+ * Deletes a notebook.
34
+ *
35
+ * @param notebookId - The notebook ID to delete
36
+ */
37
+ delete(notebookId: string): Promise<void>;
38
+ /**
39
+ * Renames a notebook.
40
+ *
41
+ * @param notebookId - The notebook ID
42
+ * @param newTitle - The new title
43
+ */
44
+ rename(notebookId: string, newTitle: string): Promise<void>;
45
+ /**
46
+ * Gets the raw summary text for a notebook.
47
+ *
48
+ * @param notebookId - The notebook ID
49
+ * @returns Raw summary string
50
+ */
51
+ getSummary(notebookId: string): Promise<string>;
52
+ /**
53
+ * Gets the AI-generated description and suggested topics for a notebook.
54
+ *
55
+ * @param notebookId - The notebook ID
56
+ * @returns NotebookDescription with summary and topics
57
+ */
58
+ getDescription(notebookId: string): Promise<NotebookDescription>;
59
+ /**
60
+ * Gets the raw API response for a notebook.
61
+ * Useful for debugging or accessing data not in the typed interface.
62
+ *
63
+ * @param notebookId - The notebook ID
64
+ * @returns Raw response data
65
+ */
66
+ getRaw(notebookId: string): Promise<unknown>;
67
+ /**
68
+ * Shares or unshares a notebook.
69
+ *
70
+ * @param notebookId - The notebook ID
71
+ * @param isPublic - Whether to make public
72
+ * @param artifactId - Optional specific artifact to share
73
+ */
74
+ share(notebookId: string, isPublic: boolean, artifactId?: string): Promise<void>;
75
+ /**
76
+ * Gets the share URL for a notebook.
77
+ * This is a non-destructive operation that doesn't change sharing settings.
78
+ *
79
+ * @param notebookId - The notebook ID
80
+ * @param artifactId - Optional specific artifact
81
+ * @returns The share URL
82
+ */
83
+ getShareUrl(notebookId: string, artifactId?: string): Promise<string>;
84
+ /**
85
+ * Removes a notebook from the recent list.
86
+ *
87
+ * @param notebookId - The notebook ID
88
+ */
89
+ removeFromRecent(notebookId: string): Promise<void>;
90
+ }
91
+ //# sourceMappingURL=notebooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notebooks.d.ts","sourceRoot":"","sources":["../../src/api/notebooks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAkB,MAAM,aAAa,CAAC;AAKjF;;GAEG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IASjC;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAS9C;;;;;OAKG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQhD;;;;OAIG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/C;;;;;OAKG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjE;;;;;OAKG;IACG,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYrD;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAUtE;;;;;;OAMG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlD;;;;;;OAMG;IACG,KAAK,CACT,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;;;;OAOG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAY3E;;;;OAIG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAK1D"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Notes API Module
3
+ *
4
+ * Handles user-created notes within notebooks.
5
+ */
6
+ import { ClientCore } from '../core.ts';
7
+ import type { Note } from '../types.ts';
8
+ /**
9
+ * API client for note operations.
10
+ */
11
+ export declare class NotesAPI {
12
+ private core;
13
+ constructor(core: ClientCore);
14
+ /**
15
+ * Lists all notes in a notebook.
16
+ *
17
+ * @param notebookId - The notebook ID
18
+ * @returns List of notes
19
+ */
20
+ list(notebookId: string): Promise<Note[]>;
21
+ /**
22
+ * Creates a new note.
23
+ *
24
+ * @param notebookId - The notebook ID
25
+ * @param title - Note title
26
+ * @param content - Note content
27
+ * @returns The created note
28
+ */
29
+ create(notebookId: string, title: string, content: string): Promise<Note>;
30
+ /**
31
+ * Updates an existing note.
32
+ *
33
+ * @param notebookId - The notebook ID
34
+ * @param noteId - The note ID
35
+ * @param title - New title
36
+ * @param content - New content
37
+ * @returns The updated note
38
+ */
39
+ update(notebookId: string, noteId: string, title: string, content: string): Promise<Note>;
40
+ /**
41
+ * Deletes a note.
42
+ *
43
+ * @param notebookId - The notebook ID
44
+ * @param noteId - The note ID
45
+ */
46
+ delete(notebookId: string, noteId: string): Promise<void>;
47
+ /**
48
+ * Gets a specific note by ID.
49
+ *
50
+ * @param notebookId - The notebook ID
51
+ * @param noteId - The note ID
52
+ * @returns The note or null if not found
53
+ */
54
+ get(notebookId: string, noteId: string): Promise<Note | null>;
55
+ }
56
+ //# sourceMappingURL=notes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/api/notes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKxC;;GAEG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;OAKG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAS/C;;;;;;;OAOG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;;;;OAQG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAahB;;;;;OAKG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/D;;;;;;OAMG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;CAIpE"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Research API Module
3
+ *
4
+ * Handles web and Drive research functionality.
5
+ */
6
+ import { ClientCore } from '../core.ts';
7
+ import type { ResearchTask, ResearchResult, ResearchSource } from '../types.ts';
8
+ /**
9
+ * API client for research operations.
10
+ */
11
+ export declare class ResearchAPI {
12
+ private core;
13
+ constructor(core: ClientCore);
14
+ /**
15
+ * Starts a research session.
16
+ *
17
+ * @param notebookId - The notebook ID
18
+ * @param query - The research query
19
+ * @param options - Research options
20
+ * @returns Research task info
21
+ */
22
+ start(notebookId: string, query: string, options?: {
23
+ source?: 'web' | 'drive';
24
+ mode?: 'fast' | 'deep';
25
+ }): Promise<ResearchTask>;
26
+ /**
27
+ * Polls for research progress and results.
28
+ *
29
+ * @param notebookId - The notebook ID
30
+ * @param taskId - The task ID from start()
31
+ * @returns Current research status and results
32
+ */
33
+ poll(notebookId: string, taskId: string): Promise<ResearchResult>;
34
+ /**
35
+ * Imports discovered sources into the notebook.
36
+ *
37
+ * @param notebookId - The notebook ID
38
+ * @param sources - Sources to import (from poll results)
39
+ * @returns Imported source IDs
40
+ */
41
+ importSources(notebookId: string, sources: ResearchSource[]): Promise<string[]>;
42
+ /**
43
+ * Runs a complete research workflow.
44
+ *
45
+ * Starts research, polls until complete, and optionally imports sources.
46
+ *
47
+ * @param notebookId - The notebook ID
48
+ * @param query - The research query
49
+ * @param options - Research options
50
+ * @returns Final research results
51
+ */
52
+ research(notebookId: string, query: string, options?: {
53
+ source?: 'web' | 'drive';
54
+ mode?: 'fast' | 'deep';
55
+ autoImport?: boolean;
56
+ timeoutMs?: number;
57
+ pollIntervalMs?: number;
58
+ }): Promise<{
59
+ result: ResearchResult;
60
+ importedSourceIds?: string[];
61
+ }>;
62
+ }
63
+ //# sourceMappingURL=research.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../src/api/research.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKhF;;GAEG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;;;;OAOG;IACG,KAAK,CACT,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QACP,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;QACzB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACnB,GACL,OAAO,CAAC,YAAY,CAAC;IA6BxB;;;;;;OAMG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAWvE;;;;;;OAMG;IACG,aAAa,CACjB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,EAAE,GACxB,OAAO,CAAC,MAAM,EAAE,CAAC;IAoBpB;;;;;;;;;OASG;IACG,QAAQ,CACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QACP,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;QACzB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACpB,GACL,OAAO,CAAC;QACT,MAAM,EAAE,cAAc,CAAC;QACvB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;CAqCH"}