memorysync-sdk 1.2.0 → 1.3.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
@@ -26,6 +26,296 @@ declare class ServerError extends MemorySyncError {
26
26
  constructor(message: string, options?: ErrorOptions);
27
27
  }
28
28
 
29
+ /**
30
+ * Connector namespaces — `client.connections`, `client.objects` and friends.
31
+ *
32
+ * Covers the connector API: creating and managing connections to Slack, Google
33
+ * Drive, S3 and Granola, driving syncs, and inspecting the objects a sync
34
+ * produced. Shaped after `client.connections.*` in comparable SDKs so the layout
35
+ * is familiar.
36
+ *
37
+ * ## Why these return raw payloads
38
+ *
39
+ * Connector responses are large, provider-shaped and still moving — a Slack
40
+ * channel listing looks nothing like an S3 prefix listing, and both carry
41
+ * provider fields that change when the provider changes. Freezing them into
42
+ * interfaces would mean an SDK release every time a provider adds a field, and
43
+ * callers unable to see the new field until then. Typed models are reserved for
44
+ * the small, stable, first-party shapes (memories, history, feedback, ontology).
45
+ */
46
+ /** The client's request function, injected so namespaces carry no transport. */
47
+ type RequestFn = <T>(method: string, path: string, options?: {
48
+ body?: unknown;
49
+ query?: Record<string, unknown>;
50
+ }) => Promise<T>;
51
+ type Json = Record<string, unknown>;
52
+ declare class Namespace {
53
+ protected readonly req: RequestFn;
54
+ constructor(request: RequestFn);
55
+ }
56
+ /** Slack connection settings. */
57
+ declare class SlackNamespace extends Namespace {
58
+ /**
59
+ * Channels the app can see and could be added.
60
+ *
61
+ * Private channels appear only where the deployment allows them *and* a human
62
+ * has invited the app, so this never widens what someone already granted.
63
+ */
64
+ availableChannels(connectionId: string, query?: Json): Promise<Json>;
65
+ /** Channels currently selected for syncing. */
66
+ channels(connectionId: string): Promise<Json>;
67
+ /** Select channels for syncing. */
68
+ addChannels(connectionId: string, channelIds: string[]): Promise<Json>;
69
+ /** Stop syncing one channel. */
70
+ removeChannel(connectionId: string, channelId: string): Promise<Json>;
71
+ /**
72
+ * Channels this connection will never sync.
73
+ *
74
+ * The deployment-wide floor cannot be removed here; a tenant may only add to it.
75
+ */
76
+ exclusionPolicy(connectionId: string): Promise<Json>;
77
+ /** Replace this connection's additions to the exclusion policy. */
78
+ setExclusionPolicy(connectionId: string, policy: Json): Promise<Json>;
79
+ /** Slack users seen on this connection and who they map to. */
80
+ identities(connectionId: string): Promise<Json>;
81
+ /** Map a Slack user to a MemorySync end user. */
82
+ linkIdentity(connectionId: string, body: Json): Promise<Json>;
83
+ /** Re-read the Slack member list and refresh the identity table. */
84
+ syncIdentities(connectionId: string): Promise<Json>;
85
+ }
86
+ /** Google Drive connection settings. */
87
+ declare class GoogleDriveNamespace extends Namespace {
88
+ /** Config for rendering Google's own file picker in your UI. */
89
+ pickerConfig(connectionId: string): Promise<Json>;
90
+ /** Files and folders selected for syncing. */
91
+ resources(connectionId: string, query?: Json): Promise<Json>;
92
+ /** Select files or folders for syncing. */
93
+ addResources(connectionId: string, body: Json): Promise<Json>;
94
+ /** Stop syncing one file or folder. */
95
+ removeResource(connectionId: string, resourceId: string): Promise<Json>;
96
+ }
97
+ /** S3 connection settings. */
98
+ declare class S3Namespace extends Namespace {
99
+ /** Prefixes visible in the bucket that could be added. */
100
+ availablePrefixes(connectionId: string, query?: Json): Promise<Json>;
101
+ /** Prefixes currently selected for syncing. */
102
+ prefixes(connectionId: string): Promise<Json>;
103
+ /** Select prefixes for syncing. */
104
+ addPrefixes(connectionId: string, prefixes: string[]): Promise<Json>;
105
+ /**
106
+ * Stop syncing the given prefixes.
107
+ *
108
+ * The prefixes travel in the body rather than the path because they contain
109
+ * slashes, which is why this DELETE carries one.
110
+ */
111
+ removePrefixes(connectionId: string, prefixes: string[]): Promise<Json>;
112
+ /** Keys and patterns this connection will never sync. */
113
+ exclusionPolicy(connectionId: string): Promise<Json>;
114
+ /** Replace this connection's additions to the exclusion policy. */
115
+ setExclusionPolicy(connectionId: string, policy: Json): Promise<Json>;
116
+ /** Effective S3 settings, including the per-object size ceiling. */
117
+ settings(connectionId: string): Promise<Json>;
118
+ }
119
+ /** Granola connection settings. */
120
+ declare class GranolaNamespace extends Namespace {
121
+ /** Folders that could be added. */
122
+ availableFolders(connectionId: string, query?: Json): Promise<Json>;
123
+ /** Folders currently selected for syncing. */
124
+ folders(connectionId: string): Promise<Json>;
125
+ /** Select folders for syncing. */
126
+ addFolders(connectionId: string, body: Json): Promise<Json>;
127
+ /** Stop syncing one folder. */
128
+ removeFolder(connectionId: string, folderId: string): Promise<Json>;
129
+ /** Folders and meetings this connection will never sync. */
130
+ exclusionPolicy(connectionId: string): Promise<Json>;
131
+ /** Replace this connection's additions to the exclusion policy. */
132
+ setExclusionPolicy(connectionId: string, policy: Json): Promise<Json>;
133
+ /** Meeting participants seen on this connection and who they map to. */
134
+ identities(connectionId: string): Promise<Json>;
135
+ /** Map a participant to a MemorySync end user. */
136
+ linkIdentity(connectionId: string, body: Json): Promise<Json>;
137
+ /** Move an existing mapping to a different end user. */
138
+ relinkIdentity(connectionId: string, body: Json): Promise<Json>;
139
+ /** Effective Granola settings for this connection. */
140
+ settings(connectionId: string): Promise<Json>;
141
+ /** Update Granola settings for this connection. */
142
+ setSettings(connectionId: string, settings: Json): Promise<Json>;
143
+ }
144
+ /** Starting an OAuth connection. */
145
+ declare class ConnectionOAuthNamespace extends Namespace {
146
+ /**
147
+ * Begin an OAuth connection and get the URL to send the user to.
148
+ *
149
+ * The user completes consent in a browser and the provider calls the platform
150
+ * back — not your backend. Poll {@link status} to find out how it went.
151
+ */
152
+ initiate(provider: string, body?: Json): Promise<Json>;
153
+ /** Where an in-flight OAuth connection got to. */
154
+ status(query?: Json): Promise<Json>;
155
+ }
156
+ /**
157
+ * Connections to external sources.
158
+ *
159
+ * Provider-specific settings live in sub-namespaces: `connections.slack`,
160
+ * `connections.gdrive`, `connections.s3`, `connections.granola`.
161
+ */
162
+ declare class ConnectionsNamespace extends Namespace {
163
+ readonly slack: SlackNamespace;
164
+ readonly gdrive: GoogleDriveNamespace;
165
+ readonly s3: S3Namespace;
166
+ readonly granola: GranolaNamespace;
167
+ readonly oauth: ConnectionOAuthNamespace;
168
+ constructor(request: RequestFn);
169
+ /** Every connection in this organization. */
170
+ list(query?: Json): Promise<Json>;
171
+ /** One connection, including its status and last sync. */
172
+ get(connectionId: string): Promise<Json>;
173
+ /** Connect a provider that authenticates with an API key or bot token. */
174
+ createWithApiKey(provider: string, apiKey: string, body?: Json): Promise<Json>;
175
+ /** Connect a provider that needs a credential bundle, such as S3 keys. */
176
+ createWithCredentials(provider: string, credentials: Json, body?: Json): Promise<Json>;
177
+ /** Change a connection's name, schedule or settings. */
178
+ update(connectionId: string, body: Json): Promise<Json>;
179
+ /**
180
+ * Remove a connection.
181
+ *
182
+ * Stops future syncing. Memories already extracted are left in place — use
183
+ * {@link purge} for those, so disconnecting never silently deletes knowledge
184
+ * someone still depends on.
185
+ */
186
+ delete(connectionId: string): Promise<Json>;
187
+ /** Re-authorise a connection whose credentials expired or were revoked. */
188
+ reconnect(connectionId: string, body?: Json): Promise<Json>;
189
+ /**
190
+ * Delete the memories this connection produced.
191
+ *
192
+ * Separate from {@link delete} on purpose: removing a connection and removing
193
+ * what it taught you are different decisions.
194
+ */
195
+ purge(connectionId: string, body?: Json): Promise<Json>;
196
+ /** Current and recent sync state for a connection. */
197
+ syncStatus(connectionId: string): Promise<Json>;
198
+ /** Start a sync now instead of waiting for the schedule. */
199
+ triggerSync(connectionId: string, body?: Json): Promise<Json>;
200
+ /** Objects a connection has ingested — files, messages, meetings. */
201
+ objects(connectionId: string, query?: Json): Promise<Json>;
202
+ /** Object listing with richer filtering and paging than {@link objects}. */
203
+ objectsV2(connectionId: string, query?: Json): Promise<Json>;
204
+ /** Apply one action to many objects — pause, resume, re-extract. */
205
+ bulkObjectAction(connectionId: string, body: Json): Promise<Json>;
206
+ /** Connector totals: connections, objects synced, memories produced. */
207
+ stats(query?: Json): Promise<Json>;
208
+ /** Audit trail of connector activity. */
209
+ auditLogs(query?: Json): Promise<Json>;
210
+ }
211
+ /**
212
+ * A single synced object: a Drive file, a Slack message batch, an S3 key, a
213
+ * meeting transcript.
214
+ */
215
+ declare class ObjectsNamespace extends Namespace {
216
+ /** Metadata and sync state for one object. */
217
+ get(objectId: string): Promise<Json>;
218
+ /** What extraction made of this object. */
219
+ analysis(objectId: string): Promise<Json>;
220
+ /** Every action taken on this object. */
221
+ audit(objectId: string, query?: Json): Promise<Json>;
222
+ /** Versions of this object seen across syncs. */
223
+ history(objectId: string, query?: Json): Promise<Json>;
224
+ /** Which memories this object produced, and whether extraction finished. */
225
+ memoryStatus(objectId: string): Promise<Json>;
226
+ /** Row and column statistics for spreadsheet-shaped objects. */
227
+ structuredStats(objectId: string): Promise<Json>;
228
+ /** Score this object for extraction worthiness without extracting. */
229
+ evaluate(objectId: string, body?: Json): Promise<Json>;
230
+ /** Stop re-syncing this object, leaving its memories in place. */
231
+ pause(objectId: string): Promise<Json>;
232
+ /** Resume syncing a paused object. */
233
+ resume(objectId: string): Promise<Json>;
234
+ /**
235
+ * Run extraction again over content already fetched.
236
+ *
237
+ * Counts against the plan's add allowance, exactly like the first extraction,
238
+ * because it creates memories the same way.
239
+ */
240
+ reextract(objectId: string, body?: Json): Promise<Json>;
241
+ /** Fetch this object from the provider again, then extract. */
242
+ resync(objectId: string, body?: Json): Promise<Json>;
243
+ /** Remove the memories this object produced, keeping the object record. */
244
+ deleteMemories(objectId: string, query?: Json): Promise<Json>;
245
+ }
246
+ /** Connectors this deployment supports. */
247
+ declare class ProvidersNamespace extends Namespace {
248
+ /** Every available provider and what it needs to connect. */
249
+ list(query?: Json): Promise<Json>;
250
+ /** One provider's capabilities, scopes and settings schema. */
251
+ get(providerId: string): Promise<Json>;
252
+ }
253
+ /** Individual sync runs. */
254
+ declare class SyncJobsNamespace extends Namespace {
255
+ /** Progress and outcome of one sync run. */
256
+ get(jobId: string): Promise<Json>;
257
+ /** Stop a running sync. Objects already ingested are kept. */
258
+ cancel(jobId: string, body?: Json): Promise<Json>;
259
+ }
260
+ /** Turn websites into memories. */
261
+ declare class WebCrawlerNamespace extends Namespace {
262
+ /** Check a URL is reachable and crawlable before committing to a job. */
263
+ validate(url: string, body?: Json): Promise<Json>;
264
+ /**
265
+ * Start a crawl. Returns a job to poll.
266
+ *
267
+ * Crawling only fetches and stores page content. Nothing becomes a memory until
268
+ * you call {@link importJob}, so a large crawl cannot quietly consume your add
269
+ * allowance.
270
+ */
271
+ crawl(url: string, body?: Json): Promise<Json>;
272
+ /** Crawl jobs for this organization. */
273
+ jobs(query?: Json): Promise<Json>;
274
+ /** One crawl job's status and progress. */
275
+ job(jobId: string): Promise<Json>;
276
+ /** Stop a running crawl. Pages already fetched are kept. */
277
+ cancelJob(jobId: string): Promise<Json>;
278
+ /** Delete a crawl job and its fetched pages. */
279
+ deleteJob(jobId: string): Promise<Json>;
280
+ /** Pages a crawl fetched, before any import. */
281
+ jobContent(jobId: string, query?: Json): Promise<Json>;
282
+ /** Page counts, byte totals and error breakdown for a crawl. */
283
+ jobStatistics(jobId: string): Promise<Json>;
284
+ /**
285
+ * Turn a completed crawl's pages into memories.
286
+ *
287
+ * This is the step that creates memories, so this is the step that is billed —
288
+ * one unit per memory created, like every other ingestion path.
289
+ */
290
+ importJob(jobId: string, body?: Json): Promise<Json>;
291
+ /** Crawls running right now. */
292
+ active(): Promise<Json>;
293
+ /** Crawler limits in force: depth, page ceiling, rate, timeouts. */
294
+ config(): Promise<Json>;
295
+ }
296
+ /**
297
+ * The `/api/v1/integrations` surface.
298
+ *
299
+ * Kept because the catalog and the web crawler live here and have no v2
300
+ * equivalent. For connection lifecycle use `client.connections`, which is the
301
+ * current API — `connected()` and `stats()` here are older, thinner views of the
302
+ * same data.
303
+ */
304
+ declare class IntegrationsNamespace extends Namespace {
305
+ readonly webCrawler: WebCrawlerNamespace;
306
+ constructor(request: RequestFn);
307
+ /** Every integration this deployment offers, for building a picker UI. */
308
+ catalog(query?: Json): Promise<Json>;
309
+ /** Integrations currently connected. Older view of `connections.list()`. */
310
+ connected(query?: Json): Promise<Json>;
311
+ /** Legacy integration counters. Prefer `connections.stats()`. */
312
+ stats(query?: Json): Promise<Json>;
313
+ /** Update a legacy integration record. */
314
+ update(integrationId: string, body: Json): Promise<Json>;
315
+ /** Delete a legacy integration record. */
316
+ delete(integrationId: string): Promise<Json>;
317
+ }
318
+
29
319
  interface ControlPlaneConfig {
30
320
  baseUrl: string;
31
321
  accessToken?: string;
@@ -679,6 +969,7 @@ interface UploadRequest {
679
969
  metadata?: Record<string, unknown>;
680
970
  endUserId?: string;
681
971
  }
972
+
682
973
  declare class MemorySyncClient {
683
974
  private readonly apiKey;
684
975
  private readonly baseUrl;
@@ -686,6 +977,16 @@ declare class MemorySyncClient {
686
977
  private readonly endUserId?;
687
978
  private readonly timeoutMs;
688
979
  private readonly fetchImpl;
980
+ /** Connections to external sources, with provider sub-namespaces. */
981
+ readonly connections: ConnectionsNamespace;
982
+ /** Individual objects a connector ingested. */
983
+ readonly objects: ObjectsNamespace;
984
+ /** Connectors this deployment supports. */
985
+ readonly providers: ProvidersNamespace;
986
+ /** Individual sync runs. */
987
+ readonly syncJobs: SyncJobsNamespace;
988
+ /** The legacy `/api/v1/integrations` surface, including the web crawler. */
989
+ readonly integrations: IntegrationsNamespace;
689
990
  constructor(config: MemorySyncConfig);
690
991
  private headers;
691
992
  private request;
@@ -872,4 +1173,4 @@ declare class MemorySyncClient {
872
1173
  }): Promise<Record<string, unknown>>;
873
1174
  }
874
1175
 
875
- export { type AddRequest, type AddResponse, type AddSkippedResponse, type ApiKeyTestResponse, type ApiKeyTestStatus, type AuditActor, type AuditEvent, type AuditEventListResponse, type AuditEventQuery, type AuditResource, type AuditSortDirection, AuthError, type BatchUpdateItem, type BatchUpdateItemResult, type BatchUpdateResponse, type BulkAddItem, type BulkAddItemResult, type BulkAddResponse, type BulkRevokeApiKeyResult, type BulkRevokeApiKeysRequest, type BulkRevokeApiKeysResponse, type ComposeRequest, type ComposeResponse, ControlPlaneClient, type ControlPlaneConfig, type ControlPlaneRequestOptions, type CreateOrganizationRequest, type CreateWebhookRequest, type CreatedWebhook, type CurrentPlanResponse, type ExportResponse, type FeedbackResponse, type FeedbackSignal, type FeedbackSummary, type FeedbackTrend, type ForgetFilters, type ForgetRequest, type HistoryResponse, type Integration, type IntegrationQuery, type LoginRequest, type LoginResponse, type MemoryRecord, MemorySyncClient, type MemorySyncConfig, MemorySyncError, NotFoundError, type Ontology, type OntologyUpdateRequest, type OrganizationMembership, type OrganizationSettings, type OrganizationSettingsQuery, type Plan, type PlanLimits, type Project, type QueryFilters, type QueryRequest, type QueryResponse, RateLimitError, type RelationCreateRequest, type RelationRecord, type RelationshipType, type ReplayWebhookDeliveriesRequest, type ReplayWebhookDeliveriesResponse, type RevisionEntry, type RevisionEvent, ServerError, type Session, type SessionListResponse, type SummarizeRequest, type TeamMember, type TestWebhookRequest, type TestWebhookResponse, type UpdateRequest, type UpdateWebhookRequest, type UploadRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQuery, type WebhookListResponse, type WebhookRetryConfig, type WebhookSignatureConfig };
1176
+ export { type AddRequest, type AddResponse, type AddSkippedResponse, type ApiKeyTestResponse, type ApiKeyTestStatus, type AuditActor, type AuditEvent, type AuditEventListResponse, type AuditEventQuery, type AuditResource, type AuditSortDirection, AuthError, type BatchUpdateItem, type BatchUpdateItemResult, type BatchUpdateResponse, type BulkAddItem, type BulkAddItemResult, type BulkAddResponse, type BulkRevokeApiKeyResult, type BulkRevokeApiKeysRequest, type BulkRevokeApiKeysResponse, type ComposeRequest, type ComposeResponse, ConnectionOAuthNamespace, ConnectionsNamespace, ControlPlaneClient, type ControlPlaneConfig, type ControlPlaneRequestOptions, type CreateOrganizationRequest, type CreateWebhookRequest, type CreatedWebhook, type CurrentPlanResponse, type ExportResponse, type FeedbackResponse, type FeedbackSignal, type FeedbackSummary, type FeedbackTrend, type ForgetFilters, type ForgetRequest, GoogleDriveNamespace, GranolaNamespace, type HistoryResponse, type Integration, type IntegrationQuery, IntegrationsNamespace, type LoginRequest, type LoginResponse, type MemoryRecord, MemorySyncClient, type MemorySyncConfig, MemorySyncError, NotFoundError, ObjectsNamespace, type Ontology, type OntologyUpdateRequest, type OrganizationMembership, type OrganizationSettings, type OrganizationSettingsQuery, type Plan, type PlanLimits, type Project, ProvidersNamespace, type QueryFilters, type QueryRequest, type QueryResponse, RateLimitError, type RelationCreateRequest, type RelationRecord, type RelationshipType, type ReplayWebhookDeliveriesRequest, type ReplayWebhookDeliveriesResponse, type RevisionEntry, type RevisionEvent, S3Namespace, ServerError, type Session, type SessionListResponse, SlackNamespace, type SummarizeRequest, SyncJobsNamespace, type TeamMember, type TestWebhookRequest, type TestWebhookResponse, type UpdateRequest, type UpdateWebhookRequest, type UploadRequest, ValidationError, WebCrawlerNamespace, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQuery, type WebhookListResponse, type WebhookRetryConfig, type WebhookSignatureConfig };
package/dist/index.d.ts CHANGED
@@ -26,6 +26,296 @@ declare class ServerError extends MemorySyncError {
26
26
  constructor(message: string, options?: ErrorOptions);
27
27
  }
28
28
 
29
+ /**
30
+ * Connector namespaces — `client.connections`, `client.objects` and friends.
31
+ *
32
+ * Covers the connector API: creating and managing connections to Slack, Google
33
+ * Drive, S3 and Granola, driving syncs, and inspecting the objects a sync
34
+ * produced. Shaped after `client.connections.*` in comparable SDKs so the layout
35
+ * is familiar.
36
+ *
37
+ * ## Why these return raw payloads
38
+ *
39
+ * Connector responses are large, provider-shaped and still moving — a Slack
40
+ * channel listing looks nothing like an S3 prefix listing, and both carry
41
+ * provider fields that change when the provider changes. Freezing them into
42
+ * interfaces would mean an SDK release every time a provider adds a field, and
43
+ * callers unable to see the new field until then. Typed models are reserved for
44
+ * the small, stable, first-party shapes (memories, history, feedback, ontology).
45
+ */
46
+ /** The client's request function, injected so namespaces carry no transport. */
47
+ type RequestFn = <T>(method: string, path: string, options?: {
48
+ body?: unknown;
49
+ query?: Record<string, unknown>;
50
+ }) => Promise<T>;
51
+ type Json = Record<string, unknown>;
52
+ declare class Namespace {
53
+ protected readonly req: RequestFn;
54
+ constructor(request: RequestFn);
55
+ }
56
+ /** Slack connection settings. */
57
+ declare class SlackNamespace extends Namespace {
58
+ /**
59
+ * Channels the app can see and could be added.
60
+ *
61
+ * Private channels appear only where the deployment allows them *and* a human
62
+ * has invited the app, so this never widens what someone already granted.
63
+ */
64
+ availableChannels(connectionId: string, query?: Json): Promise<Json>;
65
+ /** Channels currently selected for syncing. */
66
+ channels(connectionId: string): Promise<Json>;
67
+ /** Select channels for syncing. */
68
+ addChannels(connectionId: string, channelIds: string[]): Promise<Json>;
69
+ /** Stop syncing one channel. */
70
+ removeChannel(connectionId: string, channelId: string): Promise<Json>;
71
+ /**
72
+ * Channels this connection will never sync.
73
+ *
74
+ * The deployment-wide floor cannot be removed here; a tenant may only add to it.
75
+ */
76
+ exclusionPolicy(connectionId: string): Promise<Json>;
77
+ /** Replace this connection's additions to the exclusion policy. */
78
+ setExclusionPolicy(connectionId: string, policy: Json): Promise<Json>;
79
+ /** Slack users seen on this connection and who they map to. */
80
+ identities(connectionId: string): Promise<Json>;
81
+ /** Map a Slack user to a MemorySync end user. */
82
+ linkIdentity(connectionId: string, body: Json): Promise<Json>;
83
+ /** Re-read the Slack member list and refresh the identity table. */
84
+ syncIdentities(connectionId: string): Promise<Json>;
85
+ }
86
+ /** Google Drive connection settings. */
87
+ declare class GoogleDriveNamespace extends Namespace {
88
+ /** Config for rendering Google's own file picker in your UI. */
89
+ pickerConfig(connectionId: string): Promise<Json>;
90
+ /** Files and folders selected for syncing. */
91
+ resources(connectionId: string, query?: Json): Promise<Json>;
92
+ /** Select files or folders for syncing. */
93
+ addResources(connectionId: string, body: Json): Promise<Json>;
94
+ /** Stop syncing one file or folder. */
95
+ removeResource(connectionId: string, resourceId: string): Promise<Json>;
96
+ }
97
+ /** S3 connection settings. */
98
+ declare class S3Namespace extends Namespace {
99
+ /** Prefixes visible in the bucket that could be added. */
100
+ availablePrefixes(connectionId: string, query?: Json): Promise<Json>;
101
+ /** Prefixes currently selected for syncing. */
102
+ prefixes(connectionId: string): Promise<Json>;
103
+ /** Select prefixes for syncing. */
104
+ addPrefixes(connectionId: string, prefixes: string[]): Promise<Json>;
105
+ /**
106
+ * Stop syncing the given prefixes.
107
+ *
108
+ * The prefixes travel in the body rather than the path because they contain
109
+ * slashes, which is why this DELETE carries one.
110
+ */
111
+ removePrefixes(connectionId: string, prefixes: string[]): Promise<Json>;
112
+ /** Keys and patterns this connection will never sync. */
113
+ exclusionPolicy(connectionId: string): Promise<Json>;
114
+ /** Replace this connection's additions to the exclusion policy. */
115
+ setExclusionPolicy(connectionId: string, policy: Json): Promise<Json>;
116
+ /** Effective S3 settings, including the per-object size ceiling. */
117
+ settings(connectionId: string): Promise<Json>;
118
+ }
119
+ /** Granola connection settings. */
120
+ declare class GranolaNamespace extends Namespace {
121
+ /** Folders that could be added. */
122
+ availableFolders(connectionId: string, query?: Json): Promise<Json>;
123
+ /** Folders currently selected for syncing. */
124
+ folders(connectionId: string): Promise<Json>;
125
+ /** Select folders for syncing. */
126
+ addFolders(connectionId: string, body: Json): Promise<Json>;
127
+ /** Stop syncing one folder. */
128
+ removeFolder(connectionId: string, folderId: string): Promise<Json>;
129
+ /** Folders and meetings this connection will never sync. */
130
+ exclusionPolicy(connectionId: string): Promise<Json>;
131
+ /** Replace this connection's additions to the exclusion policy. */
132
+ setExclusionPolicy(connectionId: string, policy: Json): Promise<Json>;
133
+ /** Meeting participants seen on this connection and who they map to. */
134
+ identities(connectionId: string): Promise<Json>;
135
+ /** Map a participant to a MemorySync end user. */
136
+ linkIdentity(connectionId: string, body: Json): Promise<Json>;
137
+ /** Move an existing mapping to a different end user. */
138
+ relinkIdentity(connectionId: string, body: Json): Promise<Json>;
139
+ /** Effective Granola settings for this connection. */
140
+ settings(connectionId: string): Promise<Json>;
141
+ /** Update Granola settings for this connection. */
142
+ setSettings(connectionId: string, settings: Json): Promise<Json>;
143
+ }
144
+ /** Starting an OAuth connection. */
145
+ declare class ConnectionOAuthNamespace extends Namespace {
146
+ /**
147
+ * Begin an OAuth connection and get the URL to send the user to.
148
+ *
149
+ * The user completes consent in a browser and the provider calls the platform
150
+ * back — not your backend. Poll {@link status} to find out how it went.
151
+ */
152
+ initiate(provider: string, body?: Json): Promise<Json>;
153
+ /** Where an in-flight OAuth connection got to. */
154
+ status(query?: Json): Promise<Json>;
155
+ }
156
+ /**
157
+ * Connections to external sources.
158
+ *
159
+ * Provider-specific settings live in sub-namespaces: `connections.slack`,
160
+ * `connections.gdrive`, `connections.s3`, `connections.granola`.
161
+ */
162
+ declare class ConnectionsNamespace extends Namespace {
163
+ readonly slack: SlackNamespace;
164
+ readonly gdrive: GoogleDriveNamespace;
165
+ readonly s3: S3Namespace;
166
+ readonly granola: GranolaNamespace;
167
+ readonly oauth: ConnectionOAuthNamespace;
168
+ constructor(request: RequestFn);
169
+ /** Every connection in this organization. */
170
+ list(query?: Json): Promise<Json>;
171
+ /** One connection, including its status and last sync. */
172
+ get(connectionId: string): Promise<Json>;
173
+ /** Connect a provider that authenticates with an API key or bot token. */
174
+ createWithApiKey(provider: string, apiKey: string, body?: Json): Promise<Json>;
175
+ /** Connect a provider that needs a credential bundle, such as S3 keys. */
176
+ createWithCredentials(provider: string, credentials: Json, body?: Json): Promise<Json>;
177
+ /** Change a connection's name, schedule or settings. */
178
+ update(connectionId: string, body: Json): Promise<Json>;
179
+ /**
180
+ * Remove a connection.
181
+ *
182
+ * Stops future syncing. Memories already extracted are left in place — use
183
+ * {@link purge} for those, so disconnecting never silently deletes knowledge
184
+ * someone still depends on.
185
+ */
186
+ delete(connectionId: string): Promise<Json>;
187
+ /** Re-authorise a connection whose credentials expired or were revoked. */
188
+ reconnect(connectionId: string, body?: Json): Promise<Json>;
189
+ /**
190
+ * Delete the memories this connection produced.
191
+ *
192
+ * Separate from {@link delete} on purpose: removing a connection and removing
193
+ * what it taught you are different decisions.
194
+ */
195
+ purge(connectionId: string, body?: Json): Promise<Json>;
196
+ /** Current and recent sync state for a connection. */
197
+ syncStatus(connectionId: string): Promise<Json>;
198
+ /** Start a sync now instead of waiting for the schedule. */
199
+ triggerSync(connectionId: string, body?: Json): Promise<Json>;
200
+ /** Objects a connection has ingested — files, messages, meetings. */
201
+ objects(connectionId: string, query?: Json): Promise<Json>;
202
+ /** Object listing with richer filtering and paging than {@link objects}. */
203
+ objectsV2(connectionId: string, query?: Json): Promise<Json>;
204
+ /** Apply one action to many objects — pause, resume, re-extract. */
205
+ bulkObjectAction(connectionId: string, body: Json): Promise<Json>;
206
+ /** Connector totals: connections, objects synced, memories produced. */
207
+ stats(query?: Json): Promise<Json>;
208
+ /** Audit trail of connector activity. */
209
+ auditLogs(query?: Json): Promise<Json>;
210
+ }
211
+ /**
212
+ * A single synced object: a Drive file, a Slack message batch, an S3 key, a
213
+ * meeting transcript.
214
+ */
215
+ declare class ObjectsNamespace extends Namespace {
216
+ /** Metadata and sync state for one object. */
217
+ get(objectId: string): Promise<Json>;
218
+ /** What extraction made of this object. */
219
+ analysis(objectId: string): Promise<Json>;
220
+ /** Every action taken on this object. */
221
+ audit(objectId: string, query?: Json): Promise<Json>;
222
+ /** Versions of this object seen across syncs. */
223
+ history(objectId: string, query?: Json): Promise<Json>;
224
+ /** Which memories this object produced, and whether extraction finished. */
225
+ memoryStatus(objectId: string): Promise<Json>;
226
+ /** Row and column statistics for spreadsheet-shaped objects. */
227
+ structuredStats(objectId: string): Promise<Json>;
228
+ /** Score this object for extraction worthiness without extracting. */
229
+ evaluate(objectId: string, body?: Json): Promise<Json>;
230
+ /** Stop re-syncing this object, leaving its memories in place. */
231
+ pause(objectId: string): Promise<Json>;
232
+ /** Resume syncing a paused object. */
233
+ resume(objectId: string): Promise<Json>;
234
+ /**
235
+ * Run extraction again over content already fetched.
236
+ *
237
+ * Counts against the plan's add allowance, exactly like the first extraction,
238
+ * because it creates memories the same way.
239
+ */
240
+ reextract(objectId: string, body?: Json): Promise<Json>;
241
+ /** Fetch this object from the provider again, then extract. */
242
+ resync(objectId: string, body?: Json): Promise<Json>;
243
+ /** Remove the memories this object produced, keeping the object record. */
244
+ deleteMemories(objectId: string, query?: Json): Promise<Json>;
245
+ }
246
+ /** Connectors this deployment supports. */
247
+ declare class ProvidersNamespace extends Namespace {
248
+ /** Every available provider and what it needs to connect. */
249
+ list(query?: Json): Promise<Json>;
250
+ /** One provider's capabilities, scopes and settings schema. */
251
+ get(providerId: string): Promise<Json>;
252
+ }
253
+ /** Individual sync runs. */
254
+ declare class SyncJobsNamespace extends Namespace {
255
+ /** Progress and outcome of one sync run. */
256
+ get(jobId: string): Promise<Json>;
257
+ /** Stop a running sync. Objects already ingested are kept. */
258
+ cancel(jobId: string, body?: Json): Promise<Json>;
259
+ }
260
+ /** Turn websites into memories. */
261
+ declare class WebCrawlerNamespace extends Namespace {
262
+ /** Check a URL is reachable and crawlable before committing to a job. */
263
+ validate(url: string, body?: Json): Promise<Json>;
264
+ /**
265
+ * Start a crawl. Returns a job to poll.
266
+ *
267
+ * Crawling only fetches and stores page content. Nothing becomes a memory until
268
+ * you call {@link importJob}, so a large crawl cannot quietly consume your add
269
+ * allowance.
270
+ */
271
+ crawl(url: string, body?: Json): Promise<Json>;
272
+ /** Crawl jobs for this organization. */
273
+ jobs(query?: Json): Promise<Json>;
274
+ /** One crawl job's status and progress. */
275
+ job(jobId: string): Promise<Json>;
276
+ /** Stop a running crawl. Pages already fetched are kept. */
277
+ cancelJob(jobId: string): Promise<Json>;
278
+ /** Delete a crawl job and its fetched pages. */
279
+ deleteJob(jobId: string): Promise<Json>;
280
+ /** Pages a crawl fetched, before any import. */
281
+ jobContent(jobId: string, query?: Json): Promise<Json>;
282
+ /** Page counts, byte totals and error breakdown for a crawl. */
283
+ jobStatistics(jobId: string): Promise<Json>;
284
+ /**
285
+ * Turn a completed crawl's pages into memories.
286
+ *
287
+ * This is the step that creates memories, so this is the step that is billed —
288
+ * one unit per memory created, like every other ingestion path.
289
+ */
290
+ importJob(jobId: string, body?: Json): Promise<Json>;
291
+ /** Crawls running right now. */
292
+ active(): Promise<Json>;
293
+ /** Crawler limits in force: depth, page ceiling, rate, timeouts. */
294
+ config(): Promise<Json>;
295
+ }
296
+ /**
297
+ * The `/api/v1/integrations` surface.
298
+ *
299
+ * Kept because the catalog and the web crawler live here and have no v2
300
+ * equivalent. For connection lifecycle use `client.connections`, which is the
301
+ * current API — `connected()` and `stats()` here are older, thinner views of the
302
+ * same data.
303
+ */
304
+ declare class IntegrationsNamespace extends Namespace {
305
+ readonly webCrawler: WebCrawlerNamespace;
306
+ constructor(request: RequestFn);
307
+ /** Every integration this deployment offers, for building a picker UI. */
308
+ catalog(query?: Json): Promise<Json>;
309
+ /** Integrations currently connected. Older view of `connections.list()`. */
310
+ connected(query?: Json): Promise<Json>;
311
+ /** Legacy integration counters. Prefer `connections.stats()`. */
312
+ stats(query?: Json): Promise<Json>;
313
+ /** Update a legacy integration record. */
314
+ update(integrationId: string, body: Json): Promise<Json>;
315
+ /** Delete a legacy integration record. */
316
+ delete(integrationId: string): Promise<Json>;
317
+ }
318
+
29
319
  interface ControlPlaneConfig {
30
320
  baseUrl: string;
31
321
  accessToken?: string;
@@ -679,6 +969,7 @@ interface UploadRequest {
679
969
  metadata?: Record<string, unknown>;
680
970
  endUserId?: string;
681
971
  }
972
+
682
973
  declare class MemorySyncClient {
683
974
  private readonly apiKey;
684
975
  private readonly baseUrl;
@@ -686,6 +977,16 @@ declare class MemorySyncClient {
686
977
  private readonly endUserId?;
687
978
  private readonly timeoutMs;
688
979
  private readonly fetchImpl;
980
+ /** Connections to external sources, with provider sub-namespaces. */
981
+ readonly connections: ConnectionsNamespace;
982
+ /** Individual objects a connector ingested. */
983
+ readonly objects: ObjectsNamespace;
984
+ /** Connectors this deployment supports. */
985
+ readonly providers: ProvidersNamespace;
986
+ /** Individual sync runs. */
987
+ readonly syncJobs: SyncJobsNamespace;
988
+ /** The legacy `/api/v1/integrations` surface, including the web crawler. */
989
+ readonly integrations: IntegrationsNamespace;
689
990
  constructor(config: MemorySyncConfig);
690
991
  private headers;
691
992
  private request;
@@ -872,4 +1173,4 @@ declare class MemorySyncClient {
872
1173
  }): Promise<Record<string, unknown>>;
873
1174
  }
874
1175
 
875
- export { type AddRequest, type AddResponse, type AddSkippedResponse, type ApiKeyTestResponse, type ApiKeyTestStatus, type AuditActor, type AuditEvent, type AuditEventListResponse, type AuditEventQuery, type AuditResource, type AuditSortDirection, AuthError, type BatchUpdateItem, type BatchUpdateItemResult, type BatchUpdateResponse, type BulkAddItem, type BulkAddItemResult, type BulkAddResponse, type BulkRevokeApiKeyResult, type BulkRevokeApiKeysRequest, type BulkRevokeApiKeysResponse, type ComposeRequest, type ComposeResponse, ControlPlaneClient, type ControlPlaneConfig, type ControlPlaneRequestOptions, type CreateOrganizationRequest, type CreateWebhookRequest, type CreatedWebhook, type CurrentPlanResponse, type ExportResponse, type FeedbackResponse, type FeedbackSignal, type FeedbackSummary, type FeedbackTrend, type ForgetFilters, type ForgetRequest, type HistoryResponse, type Integration, type IntegrationQuery, type LoginRequest, type LoginResponse, type MemoryRecord, MemorySyncClient, type MemorySyncConfig, MemorySyncError, NotFoundError, type Ontology, type OntologyUpdateRequest, type OrganizationMembership, type OrganizationSettings, type OrganizationSettingsQuery, type Plan, type PlanLimits, type Project, type QueryFilters, type QueryRequest, type QueryResponse, RateLimitError, type RelationCreateRequest, type RelationRecord, type RelationshipType, type ReplayWebhookDeliveriesRequest, type ReplayWebhookDeliveriesResponse, type RevisionEntry, type RevisionEvent, ServerError, type Session, type SessionListResponse, type SummarizeRequest, type TeamMember, type TestWebhookRequest, type TestWebhookResponse, type UpdateRequest, type UpdateWebhookRequest, type UploadRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQuery, type WebhookListResponse, type WebhookRetryConfig, type WebhookSignatureConfig };
1176
+ export { type AddRequest, type AddResponse, type AddSkippedResponse, type ApiKeyTestResponse, type ApiKeyTestStatus, type AuditActor, type AuditEvent, type AuditEventListResponse, type AuditEventQuery, type AuditResource, type AuditSortDirection, AuthError, type BatchUpdateItem, type BatchUpdateItemResult, type BatchUpdateResponse, type BulkAddItem, type BulkAddItemResult, type BulkAddResponse, type BulkRevokeApiKeyResult, type BulkRevokeApiKeysRequest, type BulkRevokeApiKeysResponse, type ComposeRequest, type ComposeResponse, ConnectionOAuthNamespace, ConnectionsNamespace, ControlPlaneClient, type ControlPlaneConfig, type ControlPlaneRequestOptions, type CreateOrganizationRequest, type CreateWebhookRequest, type CreatedWebhook, type CurrentPlanResponse, type ExportResponse, type FeedbackResponse, type FeedbackSignal, type FeedbackSummary, type FeedbackTrend, type ForgetFilters, type ForgetRequest, GoogleDriveNamespace, GranolaNamespace, type HistoryResponse, type Integration, type IntegrationQuery, IntegrationsNamespace, type LoginRequest, type LoginResponse, type MemoryRecord, MemorySyncClient, type MemorySyncConfig, MemorySyncError, NotFoundError, ObjectsNamespace, type Ontology, type OntologyUpdateRequest, type OrganizationMembership, type OrganizationSettings, type OrganizationSettingsQuery, type Plan, type PlanLimits, type Project, ProvidersNamespace, type QueryFilters, type QueryRequest, type QueryResponse, RateLimitError, type RelationCreateRequest, type RelationRecord, type RelationshipType, type ReplayWebhookDeliveriesRequest, type ReplayWebhookDeliveriesResponse, type RevisionEntry, type RevisionEvent, S3Namespace, ServerError, type Session, type SessionListResponse, SlackNamespace, type SummarizeRequest, SyncJobsNamespace, type TeamMember, type TestWebhookRequest, type TestWebhookResponse, type UpdateRequest, type UpdateWebhookRequest, type UploadRequest, ValidationError, WebCrawlerNamespace, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQuery, type WebhookListResponse, type WebhookRetryConfig, type WebhookSignatureConfig };