notebooklm-sdk 0.3.2 → 0.3.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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AuthTokens, a as ConnectOptions } from './auth-Dxsm8894.cjs';
2
- export { C as CookieMap, d as connect } from './auth-Dxsm8894.cjs';
1
+ import { A as AuthTokens, a as ConnectOptions } from './auth-BlG6x47F.cjs';
2
+ export { C as CookieMap, d as connect } from './auth-BlG6x47F.cjs';
3
3
  export { ArtifactDownloadError, ArtifactError, ArtifactNotFoundError, ArtifactNotReadyError, ArtifactParseError, AuthError, ChatError, ClientError, NetworkError, NotebookError, NotebookLMError, NotebookNotFoundError, RPCError, RPCTimeoutError, RateLimitError, ServerError, SourceAddError, SourceError, SourceNotFoundError, SourceProcessingError, SourceTimeoutError } from './errors.cjs';
4
4
 
5
5
  /** RPC method IDs for NotebookLM batchexecute API. */
@@ -219,8 +219,9 @@ interface RPCCallOptions {
219
219
  declare class RPCCore {
220
220
  private readonly auth;
221
221
  private readonly timeoutMs;
222
- constructor(auth: AuthTokens, timeoutMs?: number);
223
- call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions): Promise<unknown>;
222
+ private readonly refreshAuth?;
223
+ constructor(auth: AuthTokens, timeoutMs?: number, refreshAuth?: () => Promise<void>);
224
+ call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions, retried?: boolean): Promise<unknown>;
224
225
  /** Extract source IDs from a notebook (used by chat/artifact APIs). */
225
226
  getSourceIds(notebookId: string): Promise<string[]>;
226
227
  }
@@ -345,10 +346,12 @@ declare class NotesAPI {
345
346
  private readonly rpc;
346
347
  constructor(rpc: RPCCore);
347
348
  list(notebookId: string): Promise<Note[]>;
349
+ get(notebookId: string, noteId: string): Promise<Note | null>;
348
350
  listMindMaps(notebookId: string): Promise<Note[]>;
349
351
  create(notebookId: string, content: string, title?: string): Promise<Note>;
350
352
  update(notebookId: string, noteId: string, content: string, title?: string): Promise<Note>;
351
353
  delete(notebookId: string, noteId: string): Promise<boolean>;
354
+ deleteMindMap(notebookId: string, mindMapId: string): Promise<boolean>;
352
355
  private _fetchAll;
353
356
  private _isMindMap;
354
357
  private _extractContent;
@@ -436,6 +439,8 @@ declare class ArtifactsAPI {
436
439
  createMindMap(notebookId: string, sourceIds?: string[]): Promise<Note>;
437
440
  /** Poll until artifact reaches completed/failed status. */
438
441
  waitUntilReady(notebookId: string, artifactId: string, timeout?: number, pollInterval?: number): Promise<Artifact>;
442
+ /** Get the current status of a generated artifact without waiting. */
443
+ pollStatus(notebookId: string, artifactId: string): Promise<GenerationStatus>;
439
444
  /** Download audio content as a Buffer. */
440
445
  downloadAudio(notebookId: string, artifactId: string): Promise<Buffer>;
441
446
  /** Download video content as a Buffer. */
@@ -475,25 +480,29 @@ interface AskOptions {
475
480
  declare class ChatAPI {
476
481
  private readonly rpc;
477
482
  private readonly auth;
483
+ private readonly refreshAuth?;
478
484
  private readonly conversationCache;
479
485
  private reqid;
480
- constructor(rpc: RPCCore, auth: AuthTokens);
486
+ constructor(rpc: RPCCore, auth: AuthTokens, refreshAuth?: (() => Promise<void>) | undefined);
481
487
  ask(notebookId: string, query: string, opts?: AskOptions): Promise<AskResult>;
482
488
  getConversationTurns(notebookId: string, conversationId: string): Promise<ConversationTurn[]>;
483
489
  getLastConversationId(notebookId: string): Promise<string | null>;
490
+ getHistory(notebookId: string, limit?: number, conversationId?: string): Promise<Array<[string, string]>>;
484
491
  /**
485
492
  * Low-level chat configuration. Set goal, response length, and optional
486
493
  * custom instructions directly. Persists on the server per notebook.
487
494
  * Use `setMode()` for preset combinations instead.
488
495
  */
489
- configure(notebookId: string, goal: ChatGoalValue, length: ChatResponseLengthValue, customPrompt?: string): Promise<void>;
496
+ configure(notebookId: string, goal?: ChatGoalValue, length?: ChatResponseLengthValue, customPrompt?: string): Promise<void>;
490
497
  /**
491
498
  * Set the chat mode for a notebook. Persists on the server — affects all
492
499
  * subsequent `ask()` calls until changed.
493
500
  */
494
501
  setMode(notebookId: string, mode: ChatModeValue): Promise<void>;
495
502
  clearCache(conversationId?: string): void;
503
+ getCachedTurns(conversationId: string): ConversationTurn[];
496
504
  private _buildHistory;
505
+ private _postChatRequest;
497
506
  }
498
507
 
499
508
  declare class NotebooksAPI {
@@ -506,7 +515,15 @@ declare class NotebooksAPI {
506
515
  rename(notebookId: string, newTitle: string): Promise<Notebook>;
507
516
  getSummary(notebookId: string): Promise<string>;
508
517
  removeFromRecent(notebookId: string): Promise<void>;
518
+ getRaw(notebookId: string): Promise<unknown>;
509
519
  getDescription(notebookId: string): Promise<NotebookDescription>;
520
+ share(notebookId: string, publicAccess?: boolean, artifactId?: string): Promise<{
521
+ public: boolean;
522
+ url: string | null;
523
+ artifactId: string | null;
524
+ }>;
525
+ getShareUrl(notebookId: string, artifactId?: string): string;
526
+ getMetadata(notebookId: string): Promise<NotebookMetadata>;
510
527
  }
511
528
 
512
529
  interface ResearchTask {
@@ -620,7 +637,9 @@ declare class SourcesAPI {
620
637
  checkFreshness(notebookId: string, sourceId: string): Promise<boolean>;
621
638
  delete(notebookId: string, sourceId: string): Promise<boolean>;
622
639
  refresh(notebookId: string, sourceId: string): Promise<boolean>;
640
+ rename(notebookId: string, sourceId: string, newTitle: string): Promise<Source>;
623
641
  waitUntilReady(notebookId: string, sourceId: string, timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source>;
642
+ waitForSources(notebookId: string, sourceIds: string[], timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source[]>;
624
643
  }
625
644
 
626
645
  interface ClientOptions {
@@ -650,6 +669,7 @@ declare class NotebookLMClient {
650
669
  readonly research: ResearchAPI;
651
670
  readonly settings: SettingsAPI;
652
671
  readonly sharing: SharingAPI;
672
+ private refreshPromise;
653
673
  private constructor();
654
674
  /**
655
675
  * Connect to NotebookLM using cookies.
@@ -662,4 +682,4 @@ declare class NotebookLMClient {
662
682
  refreshTokens(): Promise<void>;
663
683
  }
664
684
 
665
- export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatGoal, type ChatGoalValue, ChatMode, type ChatModeValue, type ChatReference, ChatResponseLength, type ChatResponseLengthValue, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, DriveMimeType, type DriveMimeTypeValue, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
685
+ export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatGoal, type ChatGoalValue, ChatMode, type ChatModeValue, type ChatReference, ChatResponseLength, type ChatResponseLengthValue, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, DriveMimeType, type DriveMimeTypeValue, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportFormat, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AuthTokens, a as ConnectOptions } from './auth-Dxsm8894.js';
2
- export { C as CookieMap, d as connect } from './auth-Dxsm8894.js';
1
+ import { A as AuthTokens, a as ConnectOptions } from './auth-BlG6x47F.js';
2
+ export { C as CookieMap, d as connect } from './auth-BlG6x47F.js';
3
3
  export { ArtifactDownloadError, ArtifactError, ArtifactNotFoundError, ArtifactNotReadyError, ArtifactParseError, AuthError, ChatError, ClientError, NetworkError, NotebookError, NotebookLMError, NotebookNotFoundError, RPCError, RPCTimeoutError, RateLimitError, ServerError, SourceAddError, SourceError, SourceNotFoundError, SourceProcessingError, SourceTimeoutError } from './errors.js';
4
4
 
5
5
  /** RPC method IDs for NotebookLM batchexecute API. */
@@ -219,8 +219,9 @@ interface RPCCallOptions {
219
219
  declare class RPCCore {
220
220
  private readonly auth;
221
221
  private readonly timeoutMs;
222
- constructor(auth: AuthTokens, timeoutMs?: number);
223
- call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions): Promise<unknown>;
222
+ private readonly refreshAuth?;
223
+ constructor(auth: AuthTokens, timeoutMs?: number, refreshAuth?: () => Promise<void>);
224
+ call(methodId: RPCMethodId, params: unknown[], opts?: RPCCallOptions, retried?: boolean): Promise<unknown>;
224
225
  /** Extract source IDs from a notebook (used by chat/artifact APIs). */
225
226
  getSourceIds(notebookId: string): Promise<string[]>;
226
227
  }
@@ -345,10 +346,12 @@ declare class NotesAPI {
345
346
  private readonly rpc;
346
347
  constructor(rpc: RPCCore);
347
348
  list(notebookId: string): Promise<Note[]>;
349
+ get(notebookId: string, noteId: string): Promise<Note | null>;
348
350
  listMindMaps(notebookId: string): Promise<Note[]>;
349
351
  create(notebookId: string, content: string, title?: string): Promise<Note>;
350
352
  update(notebookId: string, noteId: string, content: string, title?: string): Promise<Note>;
351
353
  delete(notebookId: string, noteId: string): Promise<boolean>;
354
+ deleteMindMap(notebookId: string, mindMapId: string): Promise<boolean>;
352
355
  private _fetchAll;
353
356
  private _isMindMap;
354
357
  private _extractContent;
@@ -436,6 +439,8 @@ declare class ArtifactsAPI {
436
439
  createMindMap(notebookId: string, sourceIds?: string[]): Promise<Note>;
437
440
  /** Poll until artifact reaches completed/failed status. */
438
441
  waitUntilReady(notebookId: string, artifactId: string, timeout?: number, pollInterval?: number): Promise<Artifact>;
442
+ /** Get the current status of a generated artifact without waiting. */
443
+ pollStatus(notebookId: string, artifactId: string): Promise<GenerationStatus>;
439
444
  /** Download audio content as a Buffer. */
440
445
  downloadAudio(notebookId: string, artifactId: string): Promise<Buffer>;
441
446
  /** Download video content as a Buffer. */
@@ -475,25 +480,29 @@ interface AskOptions {
475
480
  declare class ChatAPI {
476
481
  private readonly rpc;
477
482
  private readonly auth;
483
+ private readonly refreshAuth?;
478
484
  private readonly conversationCache;
479
485
  private reqid;
480
- constructor(rpc: RPCCore, auth: AuthTokens);
486
+ constructor(rpc: RPCCore, auth: AuthTokens, refreshAuth?: (() => Promise<void>) | undefined);
481
487
  ask(notebookId: string, query: string, opts?: AskOptions): Promise<AskResult>;
482
488
  getConversationTurns(notebookId: string, conversationId: string): Promise<ConversationTurn[]>;
483
489
  getLastConversationId(notebookId: string): Promise<string | null>;
490
+ getHistory(notebookId: string, limit?: number, conversationId?: string): Promise<Array<[string, string]>>;
484
491
  /**
485
492
  * Low-level chat configuration. Set goal, response length, and optional
486
493
  * custom instructions directly. Persists on the server per notebook.
487
494
  * Use `setMode()` for preset combinations instead.
488
495
  */
489
- configure(notebookId: string, goal: ChatGoalValue, length: ChatResponseLengthValue, customPrompt?: string): Promise<void>;
496
+ configure(notebookId: string, goal?: ChatGoalValue, length?: ChatResponseLengthValue, customPrompt?: string): Promise<void>;
490
497
  /**
491
498
  * Set the chat mode for a notebook. Persists on the server — affects all
492
499
  * subsequent `ask()` calls until changed.
493
500
  */
494
501
  setMode(notebookId: string, mode: ChatModeValue): Promise<void>;
495
502
  clearCache(conversationId?: string): void;
503
+ getCachedTurns(conversationId: string): ConversationTurn[];
496
504
  private _buildHistory;
505
+ private _postChatRequest;
497
506
  }
498
507
 
499
508
  declare class NotebooksAPI {
@@ -506,7 +515,15 @@ declare class NotebooksAPI {
506
515
  rename(notebookId: string, newTitle: string): Promise<Notebook>;
507
516
  getSummary(notebookId: string): Promise<string>;
508
517
  removeFromRecent(notebookId: string): Promise<void>;
518
+ getRaw(notebookId: string): Promise<unknown>;
509
519
  getDescription(notebookId: string): Promise<NotebookDescription>;
520
+ share(notebookId: string, publicAccess?: boolean, artifactId?: string): Promise<{
521
+ public: boolean;
522
+ url: string | null;
523
+ artifactId: string | null;
524
+ }>;
525
+ getShareUrl(notebookId: string, artifactId?: string): string;
526
+ getMetadata(notebookId: string): Promise<NotebookMetadata>;
510
527
  }
511
528
 
512
529
  interface ResearchTask {
@@ -620,7 +637,9 @@ declare class SourcesAPI {
620
637
  checkFreshness(notebookId: string, sourceId: string): Promise<boolean>;
621
638
  delete(notebookId: string, sourceId: string): Promise<boolean>;
622
639
  refresh(notebookId: string, sourceId: string): Promise<boolean>;
640
+ rename(notebookId: string, sourceId: string, newTitle: string): Promise<Source>;
623
641
  waitUntilReady(notebookId: string, sourceId: string, timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source>;
642
+ waitForSources(notebookId: string, sourceIds: string[], timeout?: number, initialInterval?: number, maxInterval?: number, backoffFactor?: number): Promise<Source[]>;
624
643
  }
625
644
 
626
645
  interface ClientOptions {
@@ -650,6 +669,7 @@ declare class NotebookLMClient {
650
669
  readonly research: ResearchAPI;
651
670
  readonly settings: SettingsAPI;
652
671
  readonly sharing: SharingAPI;
672
+ private refreshPromise;
653
673
  private constructor();
654
674
  /**
655
675
  * Connect to NotebookLM using cookies.
@@ -662,4 +682,4 @@ declare class NotebookLMClient {
662
682
  refreshTokens(): Promise<void>;
663
683
  }
664
684
 
665
- export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatGoal, type ChatGoalValue, ChatMode, type ChatModeValue, type ChatReference, ChatResponseLength, type ChatResponseLengthValue, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, DriveMimeType, type DriveMimeTypeValue, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };
685
+ export { type AddSourceOptions, type Artifact, type ArtifactStatus, type ArtifactType, ArtifactTypeCode, ArtifactsAPI, type AskOptions, type AskResult, AudioFormat, type AudioFormatValue, AudioLength, type AudioLengthValue, AuthTokens, ChatAPI, ChatGoal, type ChatGoalValue, ChatMode, type ChatModeValue, type ChatReference, ChatResponseLength, type ChatResponseLengthValue, type ClientOptions, ConnectOptions, type ConversationTurn, type CreateAudioOptions, type CreateDataTableOptions, type CreateInfographicOptions, type CreateQuizOptions, type CreateReportOptions, type CreateSlideDeckOptions, type CreateVideoOptions, type DataTableContent, DriveMimeType, type DriveMimeTypeValue, ExportType, type ExportTypeValue, type GenerationStatus, type ImportedSource, InfographicDetail, type InfographicDetailValue, InfographicOrientation, type InfographicOrientationValue, InfographicStyle, type InfographicStyleValue, type Note, type Notebook, type NotebookDescription, NotebookLMClient, type NotebookMetadata, NotebooksAPI, NotesAPI, QuizDifficulty, type QuizDifficultyValue, QuizQuantity, type QuizQuantityValue, RPCMethod, type RPCMethodId, type ReportFormat, type ReportSuggestion, ResearchAPI, type ResearchResult, type ResearchSource, type ResearchTask, SettingsAPI, ShareAccess, type ShareAccessValue, SharePermission, type SharePermissionValue, type ShareStatus, ShareViewLevel, type ShareViewLevelValue, type SharedUser, SharingAPI, SlideDeckFormat, type SlideDeckFormatValue, SlideDeckLength, type SlideDeckLengthValue, type Source, type SourceFulltext, type SourceGuide, type SourceStatus, type SourceSummary, type SourceType, SourcesAPI, type SuggestedTopic, VideoFormat, type VideoFormatValue, VideoStyle, type VideoStyleValue };