@botharness/core 0.1.0-alpha.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -8009,7 +8009,7 @@ interface MessagingTarget {
8009
8009
  name: string;
8010
8010
  digest: string;
8011
8011
  receiveScope?: {
8012
- kind: 'group';
8012
+ kind: 'group' | 'dm';
8013
8013
  conversationId: string;
8014
8014
  };
8015
8015
  }
@@ -8023,7 +8023,7 @@ interface MessagingAttachment {
8023
8023
  }
8024
8024
  interface MessagingInboundEvent {
8025
8025
  version: 1;
8026
- channel: 'feishu' | 'slack' | 'discord';
8026
+ channel: 'feishu' | 'slack' | 'discord' | 'weixin';
8027
8027
  botId: string;
8028
8028
  fingerprint: string;
8029
8029
  eventId: string;
@@ -8084,6 +8084,7 @@ interface MessagingHistoryPage {
8084
8084
  }
8085
8085
  interface MessagingReceipt {
8086
8086
  version: 1;
8087
+ identityKind?: 'client-acknowledgement';
8087
8088
  messageId: string;
8088
8089
  conversationId: string;
8089
8090
  }
@@ -8312,7 +8313,7 @@ interface MessagingGrant {
8312
8313
  createdAt: string;
8313
8314
  receiveAfter?: string;
8314
8315
  receiveScope?: {
8315
- kind: 'group';
8316
+ kind: 'group' | 'dm';
8316
8317
  conversationId: string;
8317
8318
  };
8318
8319
  receiveTargetChannelId?: string;
@@ -8422,6 +8423,7 @@ export declare function createOutboundMessaging(options: {
8422
8423
  isBotActive(slug: string): boolean;
8423
8424
  sourcePolicy?: BotSourcePolicyStore;
8424
8425
  onDefaultsChanged?: () => void;
8426
+ onReceptionChanged?: () => void;
8425
8427
  onAdmitted?(botSlug: string, sourceEventId: string): void;
8426
8428
  onPlaced?(commit: ChannelMessageCommit): void;
8427
8429
  onShared?(botSlugs: string[]): void;
@@ -8872,6 +8874,12 @@ interface MemoryRepositoryInitialization {
8872
8874
  }
8873
8875
  interface PersonaBotRegistryOptions {
8874
8876
  rootDir: string;
8877
+ database: OperationalDatabaseOwner;
8878
+ onImport?: (event: {
8879
+ phase: 'complete' | 'failed';
8880
+ count?: number;
8881
+ durationMs: number;
8882
+ }) => void;
8875
8883
  now?: () => Date;
8876
8884
  onDisplayNameChanged?: () => void;
8877
8885
  initializeMemory?: (memoryDir: string) => MemoryRepositoryInitialization;
@@ -10370,21 +10378,24 @@ export declare class RosterUnknownSectionError extends Error {
10370
10378
  readonly sectionId: string;
10371
10379
  constructor(sectionId: string);
10372
10380
  }
10381
+ interface RosterStoreOptions {
10382
+ database: OperationalDatabaseOwner;
10383
+ warn?: ((message: string) => void) | undefined;
10384
+ onCommitted?: (() => void) | undefined;
10385
+ }
10373
10386
  export declare class RosterStore {
10374
10387
  private readonly options;
10375
- private domain;
10376
- private table;
10377
- private global;
10388
+ private readonly database;
10389
+ private imported;
10390
+ private draft;
10378
10391
  private opening;
10379
10392
  private closing;
10380
10393
  private warned;
10381
10394
  private tail;
10382
- constructor(options?: {
10383
- warn?: ((message: string) => void) | undefined;
10384
- onCommitted?: (() => void) | undefined;
10385
- });
10395
+ constructor(options: RosterStoreOptions);
10386
10396
  get available(): boolean;
10387
10397
  attach(facility: RosterDomainFacility): Promise<void>;
10398
+ private importLegacy;
10388
10399
  detach(): Promise<void>;
10389
10400
  snapshot(): RosterSnapshot;
10390
10401
  sectionCreate(name: string): Promise<RosterSection>;
@@ -10398,14 +10409,15 @@ export declare class RosterStore {
10398
10409
  hiddenSet(hidden: readonly string[]): Promise<string[]>;
10399
10410
  private orderedSections;
10400
10411
  private enqueue;
10412
+ private notifyCommitted;
10413
+ private warn;
10401
10414
  private reportUnavailable;
10415
+ private readData;
10416
+ private requireDraft;
10402
10417
  private requireTable;
10403
10418
  private requireGlobal;
10404
10419
  }
10405
- export declare function createRosterStore(options?: {
10406
- warn?: ((message: string) => void) | undefined;
10407
- onCommitted?: (() => void) | undefined;
10408
- }): RosterStore;
10420
+ export declare function createRosterStore(options: RosterStoreOptions): RosterStore;
10409
10421
  //#endregion
10410
10422
  //#region packages/core/src/runtime/attention.d.ts
10411
10423
  type BotAttentionState = 'pending' | 'processing' | 'observed' | 'deferred' | 'needs-repair' | 'handled' | 'ignored';
@@ -10676,16 +10688,19 @@ interface BotHarnessConfig {
10676
10688
  enabled: boolean;
10677
10689
  agentPreset?: string;
10678
10690
  activityDetailConsumers?: string[];
10691
+ marketplaceUrl?: string;
10679
10692
  }
10680
10693
  export declare const DEFAULT_CONFIG: BotHarnessConfig;
10681
10694
  declare const Config$1: Schema<Schemastery.ObjectS<NoInfer<{
10682
10695
  enabled: Schema<boolean, boolean, "defined">;
10683
10696
  activityDetailConsumers: Schema<string[], string[], "defined">;
10684
10697
  agentPreset: Schema<string, string, "defined">;
10698
+ marketplaceUrl: Schema<string, string, "defined">;
10685
10699
  }>>, Schemastery.ObjectT<NoInfer<{
10686
10700
  enabled: Schema<boolean, boolean, "defined">;
10687
10701
  activityDetailConsumers: Schema<string[], string[], "defined">;
10688
10702
  agentPreset: Schema<string, string, "defined">;
10703
+ marketplaceUrl: Schema<string, string, "defined">;
10689
10704
  }>>, "plain">;
10690
10705
  interface BotHarnessCore {
10691
10706
  rootDir: string;
@@ -10743,6 +10758,54 @@ declare module '@deepseek-ai/cordis' {
10743
10758
  }
10744
10759
  }
10745
10760
  //#endregion
10761
+ //#region packages/core/src/marketplace/client.d.ts
10762
+ interface MarketplaceEntry {
10763
+ id: string;
10764
+ owner: string;
10765
+ name: string;
10766
+ fullName: string;
10767
+ description: string | null;
10768
+ topics: string[];
10769
+ stars: number;
10770
+ pushedAt: string;
10771
+ htmlUrl: string;
10772
+ cloneUrl: string;
10773
+ defaultBranch: string;
10774
+ headCommit: {
10775
+ sha: string;
10776
+ committedAt: string;
10777
+ } | null;
10778
+ }
10779
+ interface MarketplacePage {
10780
+ bots: MarketplaceEntry[];
10781
+ nextCursor?: string;
10782
+ }
10783
+ type MarketplaceSort = 'updated' | 'stars';
10784
+ interface MarketplaceQuery {
10785
+ cursor?: string;
10786
+ sort?: MarketplaceSort;
10787
+ q?: string;
10788
+ topic?: string;
10789
+ }
10790
+ interface MarketplaceTopic {
10791
+ topic: string;
10792
+ count: number;
10793
+ }
10794
+ type MarketplaceResult<T> = {
10795
+ ok: true;
10796
+ value: T;
10797
+ } | {
10798
+ ok: false;
10799
+ code: string;
10800
+ };
10801
+ interface MarketplaceClient {
10802
+ list(query: MarketplaceQuery): Promise<MarketplaceResult<MarketplacePage>>;
10803
+ topics(): Promise<MarketplaceResult<MarketplaceTopic[]>>;
10804
+ submit(url: string): Promise<MarketplaceResult<{
10805
+ bot: MarketplaceEntry;
10806
+ }>>;
10807
+ }
10808
+ //#endregion
10746
10809
  //#region packages/core/src/channels/profile-activity.d.ts
10747
10810
  interface GroupProfileActivityDay {
10748
10811
  day: string;
@@ -11264,6 +11327,11 @@ interface BridgeMethods {
11264
11327
  botAppearanceSet(payload: unknown): BridgeResult<{
11265
11328
  bot: PersonaBotDetail;
11266
11329
  }>;
11330
+ marketplaceList(payload: unknown): Promise<BridgeResult<MarketplacePage>>;
11331
+ marketplaceSubmit(payload: unknown): Promise<BridgeResult<{
11332
+ bot: MarketplaceEntry;
11333
+ }>>;
11334
+ marketplaceTopics(): Promise<BridgeResult<MarketplaceTopic[]>>;
11267
11335
  }
11268
11336
  interface BridgeMethodsDeps {
11269
11337
  warn?: (message: string) => void;
@@ -11303,6 +11371,7 @@ interface BridgeMethodsDeps {
11303
11371
  changed(slug: string): void;
11304
11372
  };
11305
11373
  createBotId?: () => string;
11374
+ marketplace?: MarketplaceClient;
11306
11375
  }
11307
11376
  export declare function createBridgeMethods(deps: BridgeMethodsDeps): BridgeMethods;
11308
11377
  //#endregion
@@ -11325,6 +11394,7 @@ declare module '@deepseek-ai/dsh-typert-protocol/types' {
11325
11394
  'invalid-git-url': Record<string, never>;
11326
11395
  'git-clone-failed': Record<string, never>;
11327
11396
  'git-clone-timeout': Record<string, never>;
11397
+ 'marketplace-unavailable': Record<string, never>;
11328
11398
  }
11329
11399
  }
11330
11400
  export declare class BotharnessBridgeService extends TypertRemoteService {
@@ -11657,6 +11727,11 @@ export declare class BotharnessBridgeService extends TypertRemoteService {
11657
11727
  developerModeSet(enabled: boolean): {
11658
11728
  accepted: boolean;
11659
11729
  };
11730
+ marketplaceList(query?: MarketplaceQuery): Promise<MarketplacePage>;
11731
+ marketplaceSubmit(url: string): Promise<{
11732
+ bot: MarketplaceEntry;
11733
+ }>;
11734
+ marketplaceTopics(): Promise<MarketplaceTopic[]>;
11660
11735
  }
11661
11736
  export declare function registerBridge(ctx: Context, methods: BridgeMethods): BotharnessBridgeService;
11662
11737
  //#endregion
@@ -11898,6 +11973,6 @@ interface DshImOutboundService {
11898
11973
  receipt?: MessagingReceipt;
11899
11974
  }>;
11900
11975
  }
11901
- export declare function createDshImProvider(value: unknown, platform?: 'feishu' | 'slack' | 'discord'): MessagingProvider | undefined;
11976
+ export declare function createDshImProvider(value: unknown, platform?: 'feishu' | 'slack' | 'discord' | 'weixin'): MessagingProvider | undefined;
11902
11977
  //#endregion
11903
- export { type ActivityEffect, type ActivitySourceCount, type ActivitySourceRole, type AggregatedState, type AssignmentActivity, type AssignmentAgentRun, type AssignmentDetail, type AssignmentReport, type AssignmentReportInput, type AssignmentReportState, type AssignmentSummary, type BotAgentAdapter, type BotDomain, type BotHarnessConfig, type BotHarnessCore, type BotIdentity, type BotResolveResult, type BotRuntime, type BotRuntimeOptions, type BotStateEvent, type BotStateSnapshot, type BotStateTracker, type BridgeError, type BridgeMethods, type BridgeMethodsDeps, type BridgeResult, type ChannelMessage, type ChannelMessageAuthor, type ChannelMessageExternal, type ChannelMessageOrigin, type ChannelMessageQueryOptions, type ChannelMessageQueryPage, type ChannelMessageView, type ChannelReadOptions, type ChannelRecord, type ChannelStore, type ChannelStoreOptions, type ChannelType, Config$1 as Config, type CreateChannelGroupInput, type CreatePersonaBotInput, type CreatePersonaBotResult, type DshActivityProjection, type DshActivityRebuildReport, type DshActivitySession, type DshAgentHost, type DshBotAgentAdapterOptions, type DshImOutboundService, type DshSession, type DshSessionEvent, type DshSessionHeader, type DshSessionStore, type ExternalSource, type HandleDmMessageInput, type ImBotRecord, type ImStoreReaderOptions, type ImStoresSnapshot, type InboundMessaging, type LegacyForwardMigrationPlanEntry, type MemoryAgentRef, type MemoryCommit, type MemoryEntry, type MemoryRepositoryFailureCode, type MemoryRepositoryInspection, type MemoryRepositoryResult, type MemorySearchHit, type MemoryService, type MemoryServiceOptions, type MemoryStore, type MemoryStoreOptions, type MemoryWriteInput, type MemoryWriteResult, type MessagingAccount, type MessagingGrant, type MessagingInboundEvent, type MessagingProvider, type MessagingReplyRoute, type MessagingSnapshot, type MessagingTarget, type OperationalDatabaseDiagnostics, type OperationalDatabaseErrorCode, type OperationalDatabaseErrorDetails, type OperationalDatabaseMetrics, type OperationalDatabaseMode, type OperationalDatabaseOwner, type OperationalDatabaseOwnerOptions, type OrchestratorAgentRun, type OrchestratorChannelAccess, type OutboundMessaging, type OutboxIntent, type PersonaBotActivityEvent, type PersonaBotActivitySnapshot, type PersonaBotDetail, type PersonaBotOutputCommitted, type PersonaBotPatch, type PersonaBotRecord, type PersonaBotRegistry, type PersonaBotRegistryOptions, type PersonaBotSessionActivity, type PersonaBotSummary, type PersonaBotToolActivity, type PostCommitNotification, type ProfileWriterLeaseMetadata, type PublicToolActivityDeclaration, type RemovePersonaBotOptions, type ResolveBotIdentityInput, type RosterDomainFacility, type RosterDomainState, type RosterSection, type RosterSectionRecord, type RosterSnapshot, type SchemaMigration, type SchemaPlan, type SessionOwnership, type SessionOwnershipClaim, type SessionOwnershipProvenance, type SessionOwnershipRecord, type SessionOwnershipRepair, type SessionPersonaSnapshot, type SessionRootRole, type SessionState, type ToolDetail, type ToolDetailRead, type ToolDetailRefusal, type UpdatePersonaBotResult, type WorkspacesDocument };
11978
+ export { type ActivityEffect, type ActivitySourceCount, type ActivitySourceRole, type AggregatedState, type AssignmentActivity, type AssignmentAgentRun, type AssignmentDetail, type AssignmentReport, type AssignmentReportInput, type AssignmentReportState, type AssignmentSummary, type BotAgentAdapter, type BotDomain, type BotHarnessConfig, type BotHarnessCore, type BotIdentity, type BotResolveResult, type BotRuntime, type BotRuntimeOptions, type BotStateEvent, type BotStateSnapshot, type BotStateTracker, type BridgeError, type BridgeMethods, type BridgeMethodsDeps, type BridgeResult, type ChannelMessage, type ChannelMessageAuthor, type ChannelMessageExternal, type ChannelMessageOrigin, type ChannelMessageQueryOptions, type ChannelMessageQueryPage, type ChannelMessageView, type ChannelReadOptions, type ChannelRecord, type ChannelStore, type ChannelStoreOptions, type ChannelType, Config$1 as Config, type CreateChannelGroupInput, type CreatePersonaBotInput, type CreatePersonaBotResult, type DshActivityProjection, type DshActivityRebuildReport, type DshActivitySession, type DshAgentHost, type DshBotAgentAdapterOptions, type DshImOutboundService, type DshSession, type DshSessionEvent, type DshSessionHeader, type DshSessionStore, type ExternalSource, type HandleDmMessageInput, type ImBotRecord, type ImStoreReaderOptions, type ImStoresSnapshot, type InboundMessaging, type LegacyForwardMigrationPlanEntry, type MemoryAgentRef, type MemoryCommit, type MemoryEntry, type MemoryRepositoryFailureCode, type MemoryRepositoryInspection, type MemoryRepositoryResult, type MemorySearchHit, type MemoryService, type MemoryServiceOptions, type MemoryStore, type MemoryStoreOptions, type MemoryWriteInput, type MemoryWriteResult, type MessagingAccount, type MessagingGrant, type MessagingInboundEvent, type MessagingProvider, type MessagingReplyRoute, type MessagingSnapshot, type MessagingTarget, type OperationalDatabaseDiagnostics, type OperationalDatabaseErrorCode, type OperationalDatabaseErrorDetails, type OperationalDatabaseMetrics, type OperationalDatabaseMode, type OperationalDatabaseOwner, type OperationalDatabaseOwnerOptions, type OrchestratorAgentRun, type OrchestratorChannelAccess, type OutboundMessaging, type OutboxIntent, type PersonaBotActivityEvent, type PersonaBotActivitySnapshot, type PersonaBotDetail, type PersonaBotOutputCommitted, type PersonaBotPatch, type PersonaBotRecord, type PersonaBotRegistry, type PersonaBotRegistryOptions, type PersonaBotSessionActivity, type PersonaBotSummary, type PersonaBotToolActivity, type PostCommitNotification, type ProfileWriterLeaseMetadata, type PublicToolActivityDeclaration, type RemovePersonaBotOptions, type ResolveBotIdentityInput, type RosterDomainFacility, type RosterDomainState, type RosterSection, type RosterSectionRecord, type RosterSnapshot, type RosterStoreOptions, type SchemaMigration, type SchemaPlan, type SessionOwnership, type SessionOwnershipClaim, type SessionOwnershipProvenance, type SessionOwnershipRecord, type SessionOwnershipRepair, type SessionPersonaSnapshot, type SessionRootRole, type SessionState, type ToolDetail, type ToolDetailRead, type ToolDetailRefusal, type UpdatePersonaBotResult, type WorkspacesDocument };