@moltium/core 0.1.13 → 0.1.14

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
@@ -304,6 +304,8 @@ interface FeedOptions {
304
304
  limit?: number;
305
305
  since?: Date;
306
306
  cursor?: string;
307
+ submolt?: string;
308
+ sort?: 'hot' | 'new' | 'top' | 'rising';
307
309
  }
308
310
  interface TimelineOptions extends FeedOptions {
309
311
  includeReplies?: boolean;
@@ -316,11 +318,122 @@ interface Post {
316
318
  content: string;
317
319
  timestamp: Date;
318
320
  platform: string;
321
+ title?: string;
319
322
  likes?: number;
320
323
  replies?: number;
321
324
  reposts?: number;
322
325
  mentions?: string[];
323
326
  url?: string;
327
+ submolt?: string;
328
+ }
329
+ interface Comment {
330
+ id: string;
331
+ postId: string;
332
+ parentId?: string;
333
+ authorName: string;
334
+ content: string;
335
+ upvotes: number;
336
+ downvotes: number;
337
+ timestamp: Date;
338
+ replies?: Comment[];
339
+ }
340
+ interface SearchResult {
341
+ id: string;
342
+ type: 'post' | 'comment';
343
+ title?: string;
344
+ content: string;
345
+ upvotes: number;
346
+ downvotes: number;
347
+ similarity: number;
348
+ author: {
349
+ name: string;
350
+ };
351
+ submolt?: {
352
+ name: string;
353
+ display_name: string;
354
+ };
355
+ postId: string;
356
+ timestamp: Date;
357
+ }
358
+ interface SearchOptions {
359
+ type?: 'posts' | 'comments' | 'all';
360
+ limit?: number;
361
+ }
362
+ interface Submolt {
363
+ name: string;
364
+ displayName: string;
365
+ description: string;
366
+ subscriberCount: number;
367
+ postCount?: number;
368
+ yourRole?: 'owner' | 'moderator' | null;
369
+ createdAt: Date;
370
+ }
371
+ interface SubmoltSettings {
372
+ description?: string;
373
+ bannerColor?: string;
374
+ themeColor?: string;
375
+ }
376
+ interface DMCheckResult {
377
+ hasActivity: boolean;
378
+ summary: string;
379
+ requests: {
380
+ count: number;
381
+ items: DMRequest[];
382
+ };
383
+ messages: {
384
+ totalUnread: number;
385
+ conversationsWithUnread: number;
386
+ latest: any[];
387
+ };
388
+ }
389
+ interface DMRequest {
390
+ conversationId: string;
391
+ from: {
392
+ name: string;
393
+ owner?: {
394
+ xHandle: string;
395
+ xName: string;
396
+ };
397
+ };
398
+ messagePreview: string;
399
+ createdAt: Date;
400
+ }
401
+ interface Conversation {
402
+ conversationId: string;
403
+ withAgent: {
404
+ name: string;
405
+ description?: string;
406
+ karma?: number;
407
+ owner?: {
408
+ xHandle: string;
409
+ xName: string;
410
+ };
411
+ };
412
+ unreadCount: number;
413
+ lastMessageAt: Date;
414
+ youInitiated: boolean;
415
+ }
416
+ interface DirectMessage {
417
+ id: string;
418
+ sender: string;
419
+ content: string;
420
+ timestamp: Date;
421
+ needsHumanInput?: boolean;
422
+ }
423
+ interface ConversationDetail {
424
+ conversationId: string;
425
+ withAgent: {
426
+ name: string;
427
+ };
428
+ messages: DirectMessage[];
429
+ }
430
+ interface MoltbookRegistration {
431
+ apiKey: string;
432
+ claimUrl: string;
433
+ verificationCode: string;
434
+ }
435
+ interface MoltbookStatus {
436
+ status: 'pending_claim' | 'claimed';
324
437
  }
325
438
 
326
439
  declare abstract class SocialAdapter {
@@ -334,6 +447,12 @@ declare abstract class SocialAdapter {
334
447
  abstract getProfile(userId: string): Promise<Profile>;
335
448
  abstract connect(): Promise<void>;
336
449
  abstract disconnect(): Promise<void>;
450
+ downvote(_id: string): Promise<void>;
451
+ unfollow(_userId: string): Promise<void>;
452
+ getPost(_id: string): Promise<Post>;
453
+ deletePost(_id: string): Promise<void>;
454
+ getComments(_postId: string, _sort?: string): Promise<Comment[]>;
455
+ search(_query: string, _options?: SearchOptions): Promise<SearchResult[]>;
337
456
  }
338
457
 
339
458
  type AgentState = 'idle' | 'initializing' | 'running' | 'stopping' | 'stopped' | 'error';
@@ -526,13 +645,59 @@ declare class MoltbookAdapter extends SocialAdapter {
526
645
  constructor(config: MoltbookConfig);
527
646
  connect(): Promise<void>;
528
647
  disconnect(): Promise<void>;
648
+ register(name: string, description: string): Promise<MoltbookRegistration>;
649
+ getStatus(): Promise<MoltbookStatus>;
650
+ getProfile(agentName: string): Promise<Profile>;
651
+ getMyProfile(): Promise<any>;
652
+ updateProfile(data: {
653
+ description?: string;
654
+ metadata?: Record<string, unknown>;
655
+ }): Promise<void>;
656
+ uploadAvatar(filePath: string): Promise<void>;
657
+ deleteAvatar(): Promise<void>;
529
658
  post(content: string): Promise<PostResult>;
659
+ postLink(submolt: string, title: string, url: string): Promise<PostResult>;
660
+ getPost(postId: string): Promise<Post>;
661
+ deletePost(postId: string): Promise<void>;
530
662
  reply(postId: string, content: string): Promise<ReplyResult>;
663
+ replyToComment(postId: string, content: string, parentId: string): Promise<ReplyResult>;
664
+ getComments(postId: string, sort?: string): Promise<Comment[]>;
665
+ upvoteComment(commentId: string): Promise<void>;
531
666
  like(postId: string): Promise<void>;
667
+ downvote(postId: string): Promise<void>;
532
668
  follow(agentName: string): Promise<void>;
669
+ unfollow(agentName: string): Promise<void>;
533
670
  getMentions(): Promise<Mention[]>;
534
671
  getFeed(options?: FeedOptions): Promise<Post[]>;
535
- getProfile(agentName: string): Promise<Profile>;
672
+ getGlobalFeed(options?: FeedOptions): Promise<Post[]>;
673
+ search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
674
+ createSubmolt(name: string, displayName: string, description: string): Promise<Submolt>;
675
+ listSubmolts(): Promise<Submolt[]>;
676
+ getSubmolt(name: string): Promise<Submolt>;
677
+ subscribe(submoltName: string): Promise<void>;
678
+ unsubscribe(submoltName: string): Promise<void>;
679
+ getSubmoltFeed(submoltName: string, sort?: string, limit?: number): Promise<Post[]>;
680
+ pinPost(postId: string): Promise<void>;
681
+ unpinPost(postId: string): Promise<void>;
682
+ updateSubmoltSettings(submoltName: string, settings: SubmoltSettings): Promise<void>;
683
+ uploadSubmoltAvatar(submoltName: string, filePath: string): Promise<void>;
684
+ uploadSubmoltBanner(submoltName: string, filePath: string): Promise<void>;
685
+ addModerator(submoltName: string, agentName: string, role?: string): Promise<void>;
686
+ removeModerator(submoltName: string, agentName: string): Promise<void>;
687
+ listModerators(submoltName: string): Promise<Array<{
688
+ name: string;
689
+ role: string;
690
+ }>>;
691
+ checkDMs(): Promise<DMCheckResult>;
692
+ sendDMRequest(to: string, message: string, byOwner?: boolean): Promise<{
693
+ conversationId: string;
694
+ }>;
695
+ getDMRequests(): Promise<DMRequest[]>;
696
+ approveDMRequest(conversationId: string): Promise<void>;
697
+ rejectDMRequest(conversationId: string, block?: boolean): Promise<void>;
698
+ listConversations(): Promise<Conversation[]>;
699
+ readConversation(conversationId: string): Promise<ConversationDetail>;
700
+ sendDM(conversationId: string, message: string, needsHumanInput?: boolean): Promise<void>;
536
701
  }
537
702
 
538
703
  declare class TwitterAdapter extends SocialAdapter {
@@ -580,4 +745,4 @@ declare function createRoutes(agent: Agent): Router;
580
745
 
581
746
  declare function createLogger(label: string): winston.Logger;
582
747
 
583
- export { type Action, type ActionContext, ActionHandler, ActionRegistry, type ActionResult, Agent, type AgentConfig, type AgentState, AnthropicProvider, type BehaviorTrigger, ConfigLoader, type ConfigType, type CustomAPIConfig, type CustomCLIConfig, type CustomDeploymentConfig, type CustomDockerConfig, type CustomSSHConfig, type Decision, type DeploymentConfig, type DeploymentResult, type DeploymentStatus, type Experience, type FeedOptions, type GenerateOptions, LLMProvider, type LifecycleEvent, type LifecycleHooks, LongTermMemory, MarkdownParser, Memory, type Mention, type Message, MoltbookAdapter, type MoltbookConfig, OpenAIProvider, type Plugin, type Post, type PostResult, type PostgresConfig, type Profile, type RedisConfig, type ReplyResult, type ScheduledJob, type ScheduledTask, Scheduler, ShortTermMemory, SocialAdapter, type SocialConfig, type SocialPlatformConfig, type StructuredSchema, type TimelineOptions, TwitterAdapter, type TwitterConfig, buildDecisionPrompt, buildSkillPrompt, buildSystemPrompt, builtInActions, createApp, createLogger, createMarkdownAction, createRoutes, startServer, validateConfig };
748
+ export { type Action, type ActionContext, ActionHandler, ActionRegistry, type ActionResult, Agent, type AgentConfig, type AgentState, AnthropicProvider, type BehaviorTrigger, type Comment, ConfigLoader, type ConfigType, type Conversation, type ConversationDetail, type CustomAPIConfig, type CustomCLIConfig, type CustomDeploymentConfig, type CustomDockerConfig, type CustomSSHConfig, type DMCheckResult, type DMRequest, type Decision, type DeploymentConfig, type DeploymentResult, type DeploymentStatus, type DirectMessage, type Experience, type FeedOptions, type GenerateOptions, LLMProvider, type LifecycleEvent, type LifecycleHooks, LongTermMemory, MarkdownParser, Memory, type Mention, type Message, MoltbookAdapter, type MoltbookConfig, type MoltbookRegistration, type MoltbookStatus, OpenAIProvider, type Plugin, type Post, type PostResult, type PostgresConfig, type Profile, type RedisConfig, type ReplyResult, type ScheduledJob, type ScheduledTask, Scheduler, type SearchOptions, type SearchResult, ShortTermMemory, SocialAdapter, type SocialConfig, type SocialPlatformConfig, type StructuredSchema, type Submolt, type SubmoltSettings, type TimelineOptions, TwitterAdapter, type TwitterConfig, buildDecisionPrompt, buildSkillPrompt, buildSystemPrompt, builtInActions, createApp, createLogger, createMarkdownAction, createRoutes, startServer, validateConfig };
package/dist/index.d.ts CHANGED
@@ -304,6 +304,8 @@ interface FeedOptions {
304
304
  limit?: number;
305
305
  since?: Date;
306
306
  cursor?: string;
307
+ submolt?: string;
308
+ sort?: 'hot' | 'new' | 'top' | 'rising';
307
309
  }
308
310
  interface TimelineOptions extends FeedOptions {
309
311
  includeReplies?: boolean;
@@ -316,11 +318,122 @@ interface Post {
316
318
  content: string;
317
319
  timestamp: Date;
318
320
  platform: string;
321
+ title?: string;
319
322
  likes?: number;
320
323
  replies?: number;
321
324
  reposts?: number;
322
325
  mentions?: string[];
323
326
  url?: string;
327
+ submolt?: string;
328
+ }
329
+ interface Comment {
330
+ id: string;
331
+ postId: string;
332
+ parentId?: string;
333
+ authorName: string;
334
+ content: string;
335
+ upvotes: number;
336
+ downvotes: number;
337
+ timestamp: Date;
338
+ replies?: Comment[];
339
+ }
340
+ interface SearchResult {
341
+ id: string;
342
+ type: 'post' | 'comment';
343
+ title?: string;
344
+ content: string;
345
+ upvotes: number;
346
+ downvotes: number;
347
+ similarity: number;
348
+ author: {
349
+ name: string;
350
+ };
351
+ submolt?: {
352
+ name: string;
353
+ display_name: string;
354
+ };
355
+ postId: string;
356
+ timestamp: Date;
357
+ }
358
+ interface SearchOptions {
359
+ type?: 'posts' | 'comments' | 'all';
360
+ limit?: number;
361
+ }
362
+ interface Submolt {
363
+ name: string;
364
+ displayName: string;
365
+ description: string;
366
+ subscriberCount: number;
367
+ postCount?: number;
368
+ yourRole?: 'owner' | 'moderator' | null;
369
+ createdAt: Date;
370
+ }
371
+ interface SubmoltSettings {
372
+ description?: string;
373
+ bannerColor?: string;
374
+ themeColor?: string;
375
+ }
376
+ interface DMCheckResult {
377
+ hasActivity: boolean;
378
+ summary: string;
379
+ requests: {
380
+ count: number;
381
+ items: DMRequest[];
382
+ };
383
+ messages: {
384
+ totalUnread: number;
385
+ conversationsWithUnread: number;
386
+ latest: any[];
387
+ };
388
+ }
389
+ interface DMRequest {
390
+ conversationId: string;
391
+ from: {
392
+ name: string;
393
+ owner?: {
394
+ xHandle: string;
395
+ xName: string;
396
+ };
397
+ };
398
+ messagePreview: string;
399
+ createdAt: Date;
400
+ }
401
+ interface Conversation {
402
+ conversationId: string;
403
+ withAgent: {
404
+ name: string;
405
+ description?: string;
406
+ karma?: number;
407
+ owner?: {
408
+ xHandle: string;
409
+ xName: string;
410
+ };
411
+ };
412
+ unreadCount: number;
413
+ lastMessageAt: Date;
414
+ youInitiated: boolean;
415
+ }
416
+ interface DirectMessage {
417
+ id: string;
418
+ sender: string;
419
+ content: string;
420
+ timestamp: Date;
421
+ needsHumanInput?: boolean;
422
+ }
423
+ interface ConversationDetail {
424
+ conversationId: string;
425
+ withAgent: {
426
+ name: string;
427
+ };
428
+ messages: DirectMessage[];
429
+ }
430
+ interface MoltbookRegistration {
431
+ apiKey: string;
432
+ claimUrl: string;
433
+ verificationCode: string;
434
+ }
435
+ interface MoltbookStatus {
436
+ status: 'pending_claim' | 'claimed';
324
437
  }
325
438
 
326
439
  declare abstract class SocialAdapter {
@@ -334,6 +447,12 @@ declare abstract class SocialAdapter {
334
447
  abstract getProfile(userId: string): Promise<Profile>;
335
448
  abstract connect(): Promise<void>;
336
449
  abstract disconnect(): Promise<void>;
450
+ downvote(_id: string): Promise<void>;
451
+ unfollow(_userId: string): Promise<void>;
452
+ getPost(_id: string): Promise<Post>;
453
+ deletePost(_id: string): Promise<void>;
454
+ getComments(_postId: string, _sort?: string): Promise<Comment[]>;
455
+ search(_query: string, _options?: SearchOptions): Promise<SearchResult[]>;
337
456
  }
338
457
 
339
458
  type AgentState = 'idle' | 'initializing' | 'running' | 'stopping' | 'stopped' | 'error';
@@ -526,13 +645,59 @@ declare class MoltbookAdapter extends SocialAdapter {
526
645
  constructor(config: MoltbookConfig);
527
646
  connect(): Promise<void>;
528
647
  disconnect(): Promise<void>;
648
+ register(name: string, description: string): Promise<MoltbookRegistration>;
649
+ getStatus(): Promise<MoltbookStatus>;
650
+ getProfile(agentName: string): Promise<Profile>;
651
+ getMyProfile(): Promise<any>;
652
+ updateProfile(data: {
653
+ description?: string;
654
+ metadata?: Record<string, unknown>;
655
+ }): Promise<void>;
656
+ uploadAvatar(filePath: string): Promise<void>;
657
+ deleteAvatar(): Promise<void>;
529
658
  post(content: string): Promise<PostResult>;
659
+ postLink(submolt: string, title: string, url: string): Promise<PostResult>;
660
+ getPost(postId: string): Promise<Post>;
661
+ deletePost(postId: string): Promise<void>;
530
662
  reply(postId: string, content: string): Promise<ReplyResult>;
663
+ replyToComment(postId: string, content: string, parentId: string): Promise<ReplyResult>;
664
+ getComments(postId: string, sort?: string): Promise<Comment[]>;
665
+ upvoteComment(commentId: string): Promise<void>;
531
666
  like(postId: string): Promise<void>;
667
+ downvote(postId: string): Promise<void>;
532
668
  follow(agentName: string): Promise<void>;
669
+ unfollow(agentName: string): Promise<void>;
533
670
  getMentions(): Promise<Mention[]>;
534
671
  getFeed(options?: FeedOptions): Promise<Post[]>;
535
- getProfile(agentName: string): Promise<Profile>;
672
+ getGlobalFeed(options?: FeedOptions): Promise<Post[]>;
673
+ search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
674
+ createSubmolt(name: string, displayName: string, description: string): Promise<Submolt>;
675
+ listSubmolts(): Promise<Submolt[]>;
676
+ getSubmolt(name: string): Promise<Submolt>;
677
+ subscribe(submoltName: string): Promise<void>;
678
+ unsubscribe(submoltName: string): Promise<void>;
679
+ getSubmoltFeed(submoltName: string, sort?: string, limit?: number): Promise<Post[]>;
680
+ pinPost(postId: string): Promise<void>;
681
+ unpinPost(postId: string): Promise<void>;
682
+ updateSubmoltSettings(submoltName: string, settings: SubmoltSettings): Promise<void>;
683
+ uploadSubmoltAvatar(submoltName: string, filePath: string): Promise<void>;
684
+ uploadSubmoltBanner(submoltName: string, filePath: string): Promise<void>;
685
+ addModerator(submoltName: string, agentName: string, role?: string): Promise<void>;
686
+ removeModerator(submoltName: string, agentName: string): Promise<void>;
687
+ listModerators(submoltName: string): Promise<Array<{
688
+ name: string;
689
+ role: string;
690
+ }>>;
691
+ checkDMs(): Promise<DMCheckResult>;
692
+ sendDMRequest(to: string, message: string, byOwner?: boolean): Promise<{
693
+ conversationId: string;
694
+ }>;
695
+ getDMRequests(): Promise<DMRequest[]>;
696
+ approveDMRequest(conversationId: string): Promise<void>;
697
+ rejectDMRequest(conversationId: string, block?: boolean): Promise<void>;
698
+ listConversations(): Promise<Conversation[]>;
699
+ readConversation(conversationId: string): Promise<ConversationDetail>;
700
+ sendDM(conversationId: string, message: string, needsHumanInput?: boolean): Promise<void>;
536
701
  }
537
702
 
538
703
  declare class TwitterAdapter extends SocialAdapter {
@@ -580,4 +745,4 @@ declare function createRoutes(agent: Agent): Router;
580
745
 
581
746
  declare function createLogger(label: string): winston.Logger;
582
747
 
583
- export { type Action, type ActionContext, ActionHandler, ActionRegistry, type ActionResult, Agent, type AgentConfig, type AgentState, AnthropicProvider, type BehaviorTrigger, ConfigLoader, type ConfigType, type CustomAPIConfig, type CustomCLIConfig, type CustomDeploymentConfig, type CustomDockerConfig, type CustomSSHConfig, type Decision, type DeploymentConfig, type DeploymentResult, type DeploymentStatus, type Experience, type FeedOptions, type GenerateOptions, LLMProvider, type LifecycleEvent, type LifecycleHooks, LongTermMemory, MarkdownParser, Memory, type Mention, type Message, MoltbookAdapter, type MoltbookConfig, OpenAIProvider, type Plugin, type Post, type PostResult, type PostgresConfig, type Profile, type RedisConfig, type ReplyResult, type ScheduledJob, type ScheduledTask, Scheduler, ShortTermMemory, SocialAdapter, type SocialConfig, type SocialPlatformConfig, type StructuredSchema, type TimelineOptions, TwitterAdapter, type TwitterConfig, buildDecisionPrompt, buildSkillPrompt, buildSystemPrompt, builtInActions, createApp, createLogger, createMarkdownAction, createRoutes, startServer, validateConfig };
748
+ export { type Action, type ActionContext, ActionHandler, ActionRegistry, type ActionResult, Agent, type AgentConfig, type AgentState, AnthropicProvider, type BehaviorTrigger, type Comment, ConfigLoader, type ConfigType, type Conversation, type ConversationDetail, type CustomAPIConfig, type CustomCLIConfig, type CustomDeploymentConfig, type CustomDockerConfig, type CustomSSHConfig, type DMCheckResult, type DMRequest, type Decision, type DeploymentConfig, type DeploymentResult, type DeploymentStatus, type DirectMessage, type Experience, type FeedOptions, type GenerateOptions, LLMProvider, type LifecycleEvent, type LifecycleHooks, LongTermMemory, MarkdownParser, Memory, type Mention, type Message, MoltbookAdapter, type MoltbookConfig, type MoltbookRegistration, type MoltbookStatus, OpenAIProvider, type Plugin, type Post, type PostResult, type PostgresConfig, type Profile, type RedisConfig, type ReplyResult, type ScheduledJob, type ScheduledTask, Scheduler, type SearchOptions, type SearchResult, ShortTermMemory, SocialAdapter, type SocialConfig, type SocialPlatformConfig, type StructuredSchema, type Submolt, type SubmoltSettings, type TimelineOptions, TwitterAdapter, type TwitterConfig, buildDecisionPrompt, buildSkillPrompt, buildSystemPrompt, builtInActions, createApp, createLogger, createMarkdownAction, createRoutes, startServer, validateConfig };