import type { BlogOperation } from './blog.js'; import type { EmailAttachmentContent, EmailComposeInput, EmailDraftInput, EmailForwardInput, EmailListInput, EmailMailbox, EmailMessage, EmailMessagePage, EmailMessageSummary, EmailReplyInput } from './email.js'; import type { ActorDirectoryInput, ActorDirectoryPage, ActorProfile, ActorProfileInput } from './actor-directory.js'; import type { NotificationInput as HpNotificationInput, NotificationPage as HpNotificationPage } from './notifications.js'; import type { ReactionSetInput as HpReactionSetInput, ReactionSummary as HpReactionSummary, ReplyCreateInput as HpReplyCreateInput, ReplyDeleteInput as HpReplyDeleteInput, ReplyRecord as HpReplyRecord, ThreadInput as HpThreadInput, ThreadPage as HpThreadPage } from './participation.js'; import type { BookmarkInput, BookmarkPage } from './bookmarks.js'; import type { SearchInput, SearchPage } from './search.js'; import type { OverrideTaskDecisionInput } from './types.js'; import type { ActorRef, AddressableActor } from './policy.js'; import type { SynomemService, SynomemServiceCapabilities, SynomemServiceInfo } from './service.js'; import type { ActorIdentity, ChangesInput, BindRuntimeInput, CreateAgentInput, CreatePostInput, UpdatePostInput, CreateNoteInput, CreateTaskInput, GiveKudosInput, ItemListInput, KudosListInput, ReviseNoteInput, SendMemoInput, UpdateAgentInput, UpdateTaskInput, UpdateTodoInput, CreateTodoInput, CreateTopicInput, UpdateTopicInput, TopicListInput } from './types.js'; export interface SynomemCredentialProvider { getAccessToken(signal?: AbortSignal): Promise; } /** * Where a remote service gets its bearer: an OAuth access token or a `syn_` access key * (identity contract §6.1). It may refresh; it must never be logged. */ export interface RemoteCredentialSource { bearer(): Promise; } export type RemoteCredential = RemoteCredentialSource | SynomemCredentialProvider | (() => Promise); export interface RemoteSynomemOptions { baseUrl: string; /** The workspace in the route. Must equal the selected context's workspace. */ workspaceId: string; /** * The stable target this service acts as. Sent as `Synomem-Context-Id` on every request. * Omit only for a fixed credential, whose single pinned context the API selects itself. */ contextId?: string; credential: RemoteCredential; fetch?: typeof fetch; signal?: AbortSignal; timeoutMs?: number; maximumResponseBytes?: number; } /** Normalizes any accepted credential shape into one bearer lookup. */ export declare function bearerFrom(credential: RemoteCredential): (signal?: AbortSignal) => Promise; export declare function environmentCredentialProvider(env?: NodeJS.ProcessEnv): SynomemCredentialProvider; export declare class RemoteSynomemService implements SynomemService { /** * The actor this service acts as, learned from the server during `init()` — never asserted * by the caller. Before `init()` it is a placeholder that no request uses. */ actor: ActorIdentity; readonly contextId?: string; private readonly baseUrl; private readonly workspaceId; private readonly bearer; private readonly fetchImplementation; private readonly signal?; private readonly timeoutMs; private readonly maximumResponseBytes; private initialized; private cachedCapabilities?; readonly bookmarks: { list: (input?: BookmarkInput) => Promise; has: (rootId: string) => Promise<{ saved: boolean; }>; set: (input: { rootId: string; present: boolean; }) => Promise<{ saved: boolean; }>; }; readonly notifications: { list: (input?: HpNotificationInput) => Promise; read: (id: string) => Promise; dismiss: (id: string) => Promise; readThrough: (through: string) => Promise; }; readonly replies: { changes: (input: HpThreadInput) => Promise; create: (input: HpReplyCreateInput) => Promise; get: (id: string) => Promise; delete: (input: HpReplyDeleteInput) => Promise; }; readonly threads: { read: (input: { rootId: string; through: string; }) => Promise; get: (input: HpThreadInput) => Promise; subscription: (input: { rootId: string; following: boolean; muted: boolean; }) => Promise; }; readonly reactions: { set: (input: HpReactionSetInput) => Promise; get: (targetId: string) => Promise; }; readonly actors: { profile: (input: ActorProfileInput) => Promise; list: (input?: ActorDirectoryInput) => Promise; get: (ref: ActorRef) => Promise; registerHuman: (_input: { id: string; handle: string; displayName: string; }) => Promise; }; readonly agents: { create: (input: CreateAgentInput) => Promise; update: (id: string, changes: UpdateAgentInput) => Promise; get: (idOrAlias: string) => Promise; list: () => Promise; resolve: (query: string) => Promise; archive: (idOrAlias: string) => Promise; restore: (idOrAlias: string) => Promise; addAliases: (idOrAlias: string, aliases: string[]) => Promise; removeAliases: (idOrAlias: string, aliases: string[]) => Promise; directory: () => Promise; bindings: (idOrAlias: string) => Promise; bindRuntime: (input: BindRuntimeInput) => Promise; unbindRuntime: (bindingId: string) => Promise; }; readonly topics: { create: (input: CreateTopicInput) => Promise; update: (idOrAlias: string, changes: UpdateTopicInput) => Promise; get: (idOrAlias: string) => Promise; list: (input?: TopicListInput) => Promise; resolve: (query: string) => Promise; archive: (idOrAlias: string) => Promise; restore: (idOrAlias: string) => Promise; }; readonly posts: { create: (input: CreatePostInput) => Promise<{ record: import("./types.js").PostRecord; created: boolean; deduplicated: boolean; }>; list: (input?: Omit) => Promise>; get: (id: string) => Promise; update: (input: UpdatePostInput) => Promise; archive: (input: { expectedVersion: number; postId: string; reason?: string; idempotencyKey?: string; }) => Promise; acknowledge: (input: { expectedVersion: number; postId: string; note?: string; idempotencyKey?: string; }) => Promise; withdrawAcknowledgment: (input: { expectedVersion: number; postId: string; reason?: string; idempotencyKey?: string; }) => Promise; roster: (postId: string) => Promise; }; readonly kudos: { give: (input: GiveKudosInput) => Promise; list: (input?: KudosListInput) => Promise>; changes: (input?: ChangesInput) => Promise; get: (id: string) => Promise; acknowledge: (input: { expectedVersion: number; kudosId: string; note?: string; idempotencyKey?: string; }) => Promise; revoke: (input: { expectedVersion: number; kudosId: string; reason: string; administrative?: boolean; idempotencyKey?: string; }) => Promise; }; /** * Hosted email for the bound agent's own mailbox. There is no local equivalent: a mailbox * needs the hosted mail edge, so this exists only on the remote service. */ readonly blog: { call: (operation: BlogOperation, input?: Record) => Promise>; }; readonly email: { mailbox: () => Promise; list: (input?: EmailListInput) => Promise; get: (input: { messageId: string; includeHtml?: boolean; markSeen?: boolean; }) => Promise; thread: (threadId: string) => Promise<{ threadId: string; messages: EmailMessage[]; }>; attachment: (input: { messageId: string; index: number; }) => Promise; send: (input: EmailComposeInput) => Promise; reply: (input: EmailReplyInput) => Promise; forward: (input: EmailForwardInput) => Promise; saveDraft: (input: EmailDraftInput) => Promise; sendDraft: (draftId: string) => Promise; move: (input: { messageId: string; folder: "inbox" | "spam" | "archive" | "trash"; }) => Promise; mark: (input: { messageId: string; seen?: boolean; flagged?: boolean; }) => Promise; delete: (messageId: string) => Promise<{ id: string; deleted: boolean; folder?: string; }>; audit: (input?: { limit?: number; cursor?: string; }) => Promise<{ entries: Record[]; nextCursor?: string; }>; }; readonly memos: { send: (input: SendMemoInput) => Promise; list: (input?: Omit) => Promise>; get: (id: string) => Promise; read: (input: { expectedVersion: number; memoId: string; idempotencyKey?: string; }) => Promise; archive: (input: { expectedVersion: number; memoId: string; idempotencyKey?: string; }) => Promise; }; readonly notes: { create: (input: CreateNoteInput) => Promise; list: (input?: Omit) => Promise>; get: (id: string) => Promise; revise: (input: ReviseNoteInput) => Promise; archive: (input: { expectedVersion: number; noteId: string; idempotencyKey?: string; }) => Promise; }; readonly tasks: { overrideDecision: (input: OverrideTaskDecisionInput) => Promise; create: (input: CreateTaskInput) => Promise; list: (input?: Omit) => Promise>; get: (id: string) => Promise; update: (input: UpdateTaskInput) => Promise; accept: (input: { expectedVersion: number; taskId: string; response?: string; idempotencyKey?: string; }) => Promise; reject: (input: { expectedVersion: number; taskId: string; response: string; idempotencyKey?: string; }) => Promise; complete: (input: { expectedVersion: number; taskId: string; note?: string; idempotencyKey?: string; }) => Promise; reopen: (input: { expectedVersion: number; taskId: string; idempotencyKey?: string; }) => Promise; cancel: (input: { expectedVersion: number; taskId: string; reason?: string; idempotencyKey?: string; }) => Promise; }; /** * Private self-reminders. The remote surface mirrors the local one exactly so * a caller does not have to know which backend it is talking to. */ readonly todos: { create: (input: CreateTodoInput) => Promise; list: (input?: Omit) => Promise>; get: (id: string) => Promise; update: (input: UpdateTodoInput) => Promise; complete: (input: { expectedVersion: number; todoId: string; note?: string; idempotencyKey?: string; }) => Promise; reopen: (input: { expectedVersion: number; todoId: string; idempotencyKey?: string; }) => Promise; cancel: (input: { expectedVersion: number; todoId: string; reason?: string; idempotencyKey?: string; }) => Promise; archive: (input: { expectedVersion: number; todoId: string; idempotencyKey?: string; }) => Promise; }; /** * Discovery mirrors the local semantics: the age/deadline is resolved here so * both backends answer the same question, rather than each server deciding * what "older than 24 hours" means. */ readonly discovery: { unanswered: (input?: Omit & { olderThanHours?: number; }) => Promise>; overdue: (input?: Omit & { asOf?: string; }) => Promise>; }; search(input: SearchInput): Promise; readonly items: { list: (input?: ItemListInput) => Promise>; get: (id: string) => Promise; changes: (input?: ChangesInput) => Promise; }; constructor(options: RemoteSynomemOptions); init(): Promise; close(): Promise; stats(input?: KudosListInput): Promise; doctor(): Promise; export(format: 'json' | 'jsonl' | 'markdown'): Promise; rebuild(): Promise; capabilities(): Promise; info(): Promise; getCanonicalEvent(id: string): Promise; private taskTransition; private todoTransition; private mutation; private request; } //# sourceMappingURL=remote.d.ts.map