@redplanethq/sdk 0.1.16 → 1.2.1

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +1657 -0
  2. package/LICENSE.md +30 -0
  3. package/README.md +159 -183
  4. package/dist/__tests__/__fixtures__/network.stream.d.ts +2329 -0
  5. package/dist/__tests__/__fixtures__/network.stream.d.ts.map +1 -0
  6. package/dist/_types/@ai-sdk_provider/dist/index.d.ts +1725 -0
  7. package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +10332 -0
  8. package/dist/_types/@internal_ai-v6/dist/index.d.ts +13493 -0
  9. package/dist/chat-route.d.ts +117 -0
  10. package/dist/chat-route.d.ts.map +1 -0
  11. package/dist/chunk-3YJ25IUJ.js +79 -0
  12. package/dist/chunk-3YJ25IUJ.js.map +1 -0
  13. package/dist/chunk-DGUM43GV.js +10 -0
  14. package/dist/chunk-DGUM43GV.js.map +1 -0
  15. package/dist/chunk-HDI4ZP7N.js +79 -0
  16. package/dist/chunk-HDI4ZP7N.js.map +1 -0
  17. package/dist/chunk-HMOX24BQ.js +439 -0
  18. package/dist/chunk-HMOX24BQ.js.map +1 -0
  19. package/dist/chunk-IV3RKEE4.js +439 -0
  20. package/dist/chunk-IV3RKEE4.js.map +1 -0
  21. package/dist/chunk-JEQ2X3Z6.cjs +12 -0
  22. package/dist/chunk-JEQ2X3Z6.cjs.map +1 -0
  23. package/dist/chunk-PEZAMDZJ.cjs +84 -0
  24. package/dist/chunk-PEZAMDZJ.cjs.map +1 -0
  25. package/dist/chunk-VJW66KXQ.cjs +441 -0
  26. package/dist/chunk-VJW66KXQ.cjs.map +1 -0
  27. package/dist/chunk-WFARZCDO.cjs +84 -0
  28. package/dist/chunk-WFARZCDO.cjs.map +1 -0
  29. package/dist/chunk-X72VW7EY.cjs +441 -0
  30. package/dist/chunk-X72VW7EY.cjs.map +1 -0
  31. package/dist/convert-messages.d.ts +90 -0
  32. package/dist/convert-messages.d.ts.map +1 -0
  33. package/dist/convert-streams.d.ts +59 -0
  34. package/dist/convert-streams.d.ts.map +1 -0
  35. package/dist/helpers.d.ts +59 -0
  36. package/dist/helpers.d.ts.map +1 -0
  37. package/dist/index.cjs +14385 -0
  38. package/dist/index.cjs.map +1 -0
  39. package/dist/index.d.ts +14 -1243
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +14289 -804
  42. package/dist/index.js.map +1 -1
  43. package/dist/middleware.d.ts +159 -0
  44. package/dist/middleware.d.ts.map +1 -0
  45. package/dist/network-route.d.ts +84 -0
  46. package/dist/network-route.d.ts.map +1 -0
  47. package/dist/public-types.d.ts +9 -0
  48. package/dist/public-types.d.ts.map +1 -0
  49. package/dist/to-ai-sdk-format.d.ts +16 -0
  50. package/dist/to-ai-sdk-format.d.ts.map +1 -0
  51. package/dist/token-APYSY3BW-CBIBV5F2.js +61 -0
  52. package/dist/token-APYSY3BW-CBIBV5F2.js.map +1 -0
  53. package/dist/token-APYSY3BW-INR55PKP.js +61 -0
  54. package/dist/token-APYSY3BW-INR55PKP.js.map +1 -0
  55. package/dist/token-APYSY3BW-M2K6HVOG.cjs +63 -0
  56. package/dist/token-APYSY3BW-M2K6HVOG.cjs.map +1 -0
  57. package/dist/token-APYSY3BW-Y5VD4L7Z.cjs +63 -0
  58. package/dist/token-APYSY3BW-Y5VD4L7Z.cjs.map +1 -0
  59. package/dist/token-util-RMHT2CPJ-3LCBPXJ6.cjs +10 -0
  60. package/dist/token-util-RMHT2CPJ-3LCBPXJ6.cjs.map +1 -0
  61. package/dist/token-util-RMHT2CPJ-4YTBAZ23.cjs +10 -0
  62. package/dist/token-util-RMHT2CPJ-4YTBAZ23.cjs.map +1 -0
  63. package/dist/token-util-RMHT2CPJ-HCMQIDTV.js +8 -0
  64. package/dist/token-util-RMHT2CPJ-HCMQIDTV.js.map +1 -0
  65. package/dist/token-util-RMHT2CPJ-IOKQM5O3.js +8 -0
  66. package/dist/token-util-RMHT2CPJ-IOKQM5O3.js.map +1 -0
  67. package/dist/transformers.d.ts +315 -0
  68. package/dist/transformers.d.ts.map +1 -0
  69. package/dist/ui.cjs +15 -0
  70. package/dist/ui.cjs.map +1 -0
  71. package/dist/ui.d.ts +2 -0
  72. package/dist/ui.d.ts.map +1 -0
  73. package/dist/ui.js +12 -0
  74. package/dist/ui.js.map +1 -0
  75. package/dist/utils.d.ts +11 -0
  76. package/dist/utils.d.ts.map +1 -0
  77. package/dist/workflow-route.d.ts +93 -0
  78. package/dist/workflow-route.d.ts.map +1 -0
  79. package/package.json +65 -31
  80. package/ui.d.ts +1 -0
  81. package/LICENSE +0 -44
  82. package/dist/index.d.mts +0 -1243
  83. package/dist/index.mjs +0 -822
  84. package/dist/index.mjs.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,1243 +1,14 @@
1
- import { Command } from 'commander';
2
- import { z } from 'zod';
3
-
4
- declare enum LLMModelEnum {
5
- GPT35TURBO = "GPT35TURBO",
6
- GPT4TURBO = "GPT4TURBO",
7
- GPT4O = "GPT4O",
8
- GPT41 = "GPT41",
9
- GPT41MINI = "GPT41MINI",
10
- GPT41NANO = "GPT41NANO",
11
- LLAMA3 = "LLAMA3",
12
- CLAUDEOPUS = "CLAUDEOPUS",
13
- CLAUDESONNET = "CLAUDESONNET",
14
- CLAUDEHAIKU = "CLAUDEHAIKU",
15
- GEMINI25FLASH = "GEMINI25FLASH",
16
- GEMINI25PRO = "GEMINI25PRO",
17
- GEMINI20FLASH = "GEMINI20FLASH",
18
- GEMINI20FLASHLITE = "GEMINI20FLASHLITE"
19
- }
20
- declare enum LLMMappings {
21
- GPT35TURBO = "gpt-3.5-turbo",
22
- GPT4TURBO = "gpt-4-turbo",
23
- GPT4O = "gpt-4o",
24
- GPT41 = "gpt-4.1-2025-04-14",
25
- GPT41MINI = "gpt-4.1-mini-2025-04-14",
26
- GPT41NANO = "gpt-4.1-nano-2025-04-14",
27
- LLAMA3 = "llama3",
28
- CLAUDEOPUS = "claude-3-opus-20240229",
29
- CLAUDESONNET = "claude-3-7-sonnet-20250219",
30
- CLAUDEHAIKU = "claude-3-5-haiku-20241022",
31
- GEMINI25FLASH = "gemini-2.5-flash-preview-04-17",
32
- GEMINI25PRO = "gemini-2.5-pro-preview-03-25",
33
- GEMINI20FLASH = "gemini-2.0-flash",
34
- GEMINI20FLASHLITE = "gemini-2.0-flash-lite"
35
- }
36
- declare const OpenAIModels: LLMModelEnum[];
37
- declare const ClaudeModels: LLMModelEnum[];
38
- declare const GeminiModels: LLMModelEnum[];
39
- declare const LLMModelType: {
40
- GPT35TURBO: string;
41
- GPT4TURBO: string;
42
- GPT4O: string;
43
- GPT41: string;
44
- GPT41MINI: string;
45
- GPT41NANO: string;
46
- LLAMA3: string;
47
- CLAUDEOPUS: string;
48
- CLAUDESONNET: string;
49
- CLAUDEHAIKU: string;
50
- GEMINI25FLASH: string;
51
- GEMINI25PRO: string;
52
- GEMINI20FLASH: string;
53
- GEMINI20FLASHLITE: string;
54
- };
55
- type LLMModelType = (typeof LLMModelType)[keyof typeof LLMModelType];
56
-
57
- /**
58
- * Interface for document node in the reified knowledge graph
59
- * Documents are parent containers for episodic chunks
60
- */
61
- interface DocumentNode {
62
- uuid: string;
63
- title: string;
64
- originalContent: string;
65
- metadata: Record<string, any>;
66
- source: string;
67
- userId: string;
68
- workspaceId?: string;
69
- createdAt: Date;
70
- validAt: Date;
71
- totalChunks: number;
72
- sessionId?: string;
73
- version: number;
74
- contentHash: string;
75
- previousVersionUuid?: string;
76
- chunkHashes?: string[];
77
- }
78
- /**
79
- * Interface for episodic node in the reified knowledge graph
80
- * Episodes are containers for statements and represent source information
81
- * Unified architecture: Both conversations and documents use Episodes with sessionId grouping
82
- */
83
- interface EpisodicNode {
84
- uuid: string;
85
- content: string;
86
- originalContent: string;
87
- contentEmbedding?: number[];
88
- metadata: Record<string, any>;
89
- source: string;
90
- createdAt: Date;
91
- validAt: Date;
92
- labelIds: string[];
93
- userId: string;
94
- workspaceId?: string;
95
- sessionId: string;
96
- queueId?: string;
97
- type?: EpisodeType;
98
- chunkIndex?: number;
99
- totalChunks?: number;
100
- version?: number;
101
- contentHash?: string;
102
- previousVersionSessionId?: string;
103
- chunkHashes?: string[];
104
- recallCount?: number;
105
- }
106
- /**
107
- * Episodic node without embeddings for query responses
108
- * Use this type when returning episodes from Cypher queries to avoid loading large embedding arrays
109
- */
110
- type EpisodicNodeWithoutEmbeddings = Omit<EpisodicNode, "contentEmbedding">;
111
- /**
112
- * Helper to get episodic node properties for Cypher RETURN clause (excludes embeddings)
113
- * Usage in Cypher: RETURN ${EPISODIC_NODE_PROPERTIES} as episode
114
- */
115
- declare const EPISODIC_NODE_PROPERTIES = "{\n uuid: e.uuid,\n content: e.content,\n originalContent: e.originalContent,\n source: e.source,\n metadata: e.metadata,\n createdAt: e.createdAt,\n userId: e.userId,\n workspaceId: e.workspaceId,\n sessionId: e.sessionId,\n queueId: e.queueId,\n labelIds: e.labelIds,\n validAt: e.validAt,\n recallCount: e.recallCount,\n type: e.type,\n chunkIndex: e.chunkIndex,\n totalChunks: e.totalChunks,\n version: e.version,\n contentHash: e.contentHash,\n previousVersionSessionId: e.previousVersionSessionId,\n chunkHashes: e.chunkHashes\n}";
116
- declare const STATEMENT_NODE_PROPERTIES = "{\n uuid: s.uuid,\n fact: s.fact,\n createdAt: s.createdAt,\n userId: s.userId,\n workspaceId: s.workspaceId,\n validAt: s.validAt,\n invalidAt: s.invalidAt,\n invalidatedBy: s.invalidatedBy,\n attributes: s.attributes,\n aspect: s.aspect,\n recallCount: s.recallCount,\n provenanceCount: s.provenanceCount\n}";
117
- declare const ENTITY_NODE_PROPERTIES = "{\n uuid: ent.uuid,\n name: ent.name,\n type: ent.type,\n createdAt: ent.createdAt,\n userId: ent.userId,\n workspaceId: ent.workspaceId,\n attributes: ent.attributes\n}";
118
- declare const COMPACTED_SESSION_NODE_PROPERTIES = "{\n uuid: cs.uuid,\n sessionId: cs.sessionId,\n summary: cs.summary,\n episodeCount: cs.episodeCount,\n startTime: cs.startTime,\n endTime: cs.endTime,\n createdAt: cs.createdAt,\n updatedAt: cs.updatedAt,\n confidence: cs.confidence,\n userId: cs.userId,\n workspaceId: cs.workspaceId,\n source: cs.source,\n compressionRatio: cs.compressionRatio,\n metadata: cs.metadata\n}";
119
- /**
120
- * Entity types for the knowledge graph (10 types)
121
- * Only NAMED, SEARCHABLE entities - no generic vocabulary
122
- */
123
- declare const EntityTypes: readonly ["Person", "Organization", "Place", "Event", "Project", "Task", "Technology", "Product", "Standard", "Concept", "Predicate"];
124
- type EntityType = (typeof EntityTypes)[number];
125
- /**
126
- * Interface for entity node in the reified knowledge graph
127
- * Entities represent subjects, objects, or predicates in statements
128
- */
129
- interface EntityNode {
130
- uuid: string;
131
- name: string;
132
- type?: EntityType;
133
- nameEmbedding?: number[];
134
- attributes?: Record<string, any>;
135
- createdAt: Date;
136
- userId: string;
137
- workspaceId?: string;
138
- }
139
- /**
140
- * Statement aspects for classification
141
- * These are the types of knowledge a statement can represent
142
- *
143
- * Categories:
144
- * 1. Identity - Who they are (slow-changing): role, location, affiliation
145
- * 2. Knowledge - What they know: expertise, skills, understanding
146
- * 3. Belief - Why they think that way: values, opinions, reasoning
147
- * 4. Preference - How they want things: likes, dislikes, style choices
148
- * 5. Action - What they do: observable behaviors, habits, practices
149
- * 6. Goal - What they want to achieve: future targets, aims
150
- * 7. Directive - Rules and automation: always do X, notify when Y, remind me to Z
151
- * 8. Decision - Choices made, conclusions reached
152
- * 9. Event - Specific occurrences with timestamps
153
- * 10. Problem - Blockers, issues, challenges
154
- * 11. Relationship - Connections between people
155
- */
156
- declare const StatementAspects: readonly ["Identity", "Knowledge", "Belief", "Preference", "Habit", "Goal", "Task", "Directive", "Decision", "Event", "Problem", "Relationship"];
157
- type StatementAspect = (typeof StatementAspects)[number];
158
- /**
159
- * Voice Aspects — User's voice: stored as complete non-decomposed statements in Aspects Store.
160
- * These represent what the user SPEAKS (rules, preferences, beliefs, goals, habits).
161
- */
162
- declare const VOICE_ASPECTS: readonly ["Directive", "Preference", "Habit", "Belief", "Goal", "Task"];
163
- type VoiceAspect = (typeof VOICE_ASPECTS)[number];
164
- /**
165
- * Graph Aspects — User's world: stored as atomic SPO triples in Neo4j.
166
- * These represent what the user OBSERVES (who they are, what happened, who's connected).
167
- */
168
- declare const GRAPH_ASPECTS: readonly ["Identity", "Event", "Relationship", "Decision", "Knowledge", "Problem", "Task"];
169
- type GraphAspect = (typeof GRAPH_ASPECTS)[number];
170
- /**
171
- * Voice Aspect node — stored in Aspects Store (Postgres table + vector namespace).
172
- * Complete non-decomposed statements representing the user's voice.
173
- */
174
- interface VoiceAspectNode {
175
- uuid: string;
176
- fact: string;
177
- aspect: VoiceAspect;
178
- userId: string;
179
- workspaceId?: string;
180
- episodeUuids: string[];
181
- createdAt: Date;
182
- validAt: Date;
183
- invalidAt: Date | null;
184
- invalidatedBy?: string;
185
- }
186
- /**
187
- * Interface for statement node in the reified knowledge graph
188
- * Statements are first-class objects representing facts with temporal properties
189
- */
190
- interface StatementNode {
191
- uuid: string;
192
- fact: string;
193
- factEmbedding: number[];
194
- createdAt: Date;
195
- validAt: Date;
196
- invalidAt: Date | null;
197
- invalidatedBy?: string;
198
- attributes: Record<string, any>;
199
- userId: string;
200
- workspaceId?: string;
201
- labelIds?: string[];
202
- aspect?: StatementAspect | null;
203
- recallCount?: {
204
- low: number;
205
- high: number;
206
- };
207
- provenanceCount?: number;
208
- }
209
- /**
210
- * Interface for a triple in the reified knowledge graph
211
- * A triple connects a subject, predicate, object via a statement node
212
- * and maintains provenance information
213
- */
214
- interface Triple {
215
- statement: StatementNode;
216
- subject: EntityNode;
217
- predicate: EntityNode;
218
- object: EntityNode;
219
- provenance: EpisodicNode;
220
- }
221
- declare enum EpisodeTypeEnum {
222
- CONVERSATION = "CONVERSATION",
223
- DOCUMENT = "DOCUMENT"
224
- }
225
- declare const EpisodeType: {
226
- CONVERSATION: string;
227
- DOCUMENT: string;
228
- IMAGE: string;
229
- };
230
- type EpisodeType = (typeof EpisodeType)[keyof typeof EpisodeType];
231
- type AddEpisodeParams = {
232
- episodeBody: string;
233
- originalEpisodeBody: string;
234
- referenceTime: Date;
235
- metadata?: Record<string, any>;
236
- source: string;
237
- userId: string;
238
- workspaceId?: string;
239
- userName?: string;
240
- labelIds?: string[];
241
- sessionId: string;
242
- queueId: string;
243
- type?: EpisodeType;
244
- chunkIndex?: number;
245
- totalChunks?: number;
246
- version?: number;
247
- contentHash?: string;
248
- previousVersionSessionId?: string;
249
- chunkHashes?: string[];
250
- episodeUuid?: string;
251
- };
252
- type AddEpisodeResult = {
253
- episodeUuid: string | null;
254
- type: EpisodeType;
255
- statementsCreated: number;
256
- voiceAspectsCreated: number;
257
- processingTimeMs: number;
258
- tokenUsage?: {
259
- high: {
260
- input: number;
261
- output: number;
262
- total: number;
263
- };
264
- low: {
265
- input: number;
266
- output: number;
267
- total: number;
268
- };
269
- };
270
- totalChunks?: number;
271
- currentChunk?: number;
272
- };
273
- interface ExtractedTripleData {
274
- source: string;
275
- sourceType?: string;
276
- predicate: string;
277
- target: string;
278
- targetType?: string;
279
- fact: string;
280
- aspect?: StatementAspect | null;
281
- attributes?: Record<string, any>;
282
- }
283
- interface CompactedSessionNode {
284
- uuid: string;
285
- sessionId: string;
286
- summary: string;
287
- summaryEmbedding?: number[];
288
- episodeCount: number;
289
- startTime: Date;
290
- endTime: Date;
291
- createdAt: Date;
292
- updatedAt?: Date;
293
- confidence: number;
294
- userId: string;
295
- workspaceId?: string;
296
- source: string;
297
- compressionRatio?: number;
298
- metadata?: Record<string, any>;
299
- }
300
- /**
301
- * Interface for space node - a collection of related episodes
302
- * Spaces help organize memory by topics, projects, or contexts
303
- */
304
- interface SpaceNode {
305
- uuid: string;
306
- name: string;
307
- description: string;
308
- userId: string;
309
- workspaceId?: string;
310
- createdAt: Date;
311
- updatedAt: Date;
312
- isActive: boolean;
313
- contextCount?: number;
314
- type?: string;
315
- summaryStructure?: string;
316
- }
317
- /**
318
- * Result type for space deletion operations
319
- */
320
- interface SpaceDeletionResult {
321
- deleted: boolean;
322
- statementsUpdated: number;
323
- error?: string;
324
- }
325
- /**
326
- * Result type for space assignment operations
327
- */
328
- interface SpaceAssignmentResult {
329
- success: boolean;
330
- statementsUpdated: number;
331
- error?: string;
332
- }
333
- /**
334
- * Adjacent episode chunks result
335
- */
336
- interface AdjacentChunks {
337
- matchedChunk: EpisodicNode;
338
- previousChunk?: EpisodicNode;
339
- nextChunk?: EpisodicNode;
340
- }
341
-
342
- declare enum ActionStatusEnum {
343
- ACCEPT = "ACCEPT",
344
- DECLINE = "DECLINE",
345
- QUESTION = "QUESTION",
346
- TOOL_REQUEST = "TOOL_REQUEST",
347
- SUCCESS = "SUCCESS",
348
- FAILED = "FAILED"
349
- }
350
- declare const ActionStatus: {
351
- ACCEPT: string;
352
- DECLINE: string;
353
- QUESTION: string;
354
- TOOL_REQUEST: string;
355
- SUCCESS: string;
356
- FAILED: string;
357
- };
358
- type ActionStatus = (typeof ActionStatus)[keyof typeof ActionStatus];
359
-
360
- declare class OAuth2Params {
361
- authorization_url: string;
362
- authorization_params?: Record<string, string>;
363
- default_scopes?: string[];
364
- scope_separator?: string;
365
- scope_identifier?: string;
366
- token_url: string;
367
- token_params?: Record<string, string>;
368
- redirect_uri_metadata?: string[];
369
- token_response_metadata?: string[];
370
- token_expiration_buffer?: number;
371
- scopes?: string[];
372
- token_request_auth_method?: string;
373
- }
374
- type AuthType = "OAuth2" | "api_key" | "mcp";
375
- type Param = {
376
- name: string;
377
- label: string;
378
- placeholder: string;
379
- description: string;
380
- };
381
- declare class APIKeyParams {
382
- fields: Array<Param>;
383
- }
384
- declare class McpAuthParams {
385
- server_url: string;
386
- }
387
-
388
- interface WidgetRenderContext {
389
- placement: 'tui' | 'webapp';
390
- pat: string;
391
- accounts: Array<{
392
- id: string;
393
- slug: string;
394
- name?: string;
395
- }>;
396
- baseUrl: string;
397
- }
398
- /** Metadata only — used in integration Spec (no render function) */
399
- interface WidgetMeta {
400
- name: string;
401
- slug: string;
402
- description: string;
403
- support: Array<'tui' | 'webapp'>;
404
- tuiPlacement?: 'overview' | 'below-input';
405
- }
406
- /**
407
- * A zero-argument React function component (webapp placement).
408
- * Context (pat, accountId, baseUrl) is baked in via closure.
409
- */
410
- type WebWidgetComponent = () => unknown;
411
- /**
412
- * A pi-tui Component instance (tui placement).
413
- * Returned by createPlayer / createList / etc. from @redplanethq/ui/tui.
414
- */
415
- type TuiWidgetComponent = object;
416
- /** Union of the two surface-specific component types */
417
- type WidgetComponent = WebWidgetComponent | TuiWidgetComponent;
418
- /** Full widget — used in widgets/index.ts (includes render) */
419
- interface WidgetSpec extends WidgetMeta {
420
- render(context: WidgetRenderContext): Promise<WidgetComponent>;
421
- }
422
- declare enum IntegrationEventType {
423
- /**
424
- * Processes authentication data and returns tokens/credentials to be saved
425
- */
426
- SETUP = "setup",
427
- /**
428
- * Processing incoming data from the integration
429
- */
430
- PROCESS = "process",
431
- /**
432
- * Identifying which account a webhook belongs to
433
- */
434
- IDENTIFY = "identify",
435
- /**
436
- * Scheduled synchronization of data
437
- */
438
- SYNC = "sync",
439
- /**
440
- * For returning integration metadata/config
441
- */
442
- SPEC = "spec",
443
- /**
444
- * Get available MCP tools for this integration
445
- */
446
- GET_TOOLS = "get-tools",
447
- /**
448
- * Call a specific MCP tool
449
- */
450
- CALL_TOOL = "call-tool"
451
- }
452
- interface IntegrationDefinition {
453
- name: string;
454
- version: string;
455
- description: string;
456
- config: Record<string, string>;
457
- spec: any;
458
- }
459
- interface IntegrationEventPayload {
460
- event: IntegrationEventType;
461
- integrationDefinition?: IntegrationDefinition;
462
- eventBody: any;
463
- config?: Config;
464
- state?: Record<string, string>;
465
- [x: string]: any;
466
- }
467
- declare class Spec {
468
- name: string;
469
- key: string;
470
- description: string;
471
- icon: string;
472
- category?: string;
473
- schedule?: {
474
- frequency?: string;
475
- };
476
- auth?: {
477
- OAuth2?: OAuth2Params;
478
- api_key?: APIKeyParams;
479
- mcp?: McpAuthParams;
480
- };
481
- widgets?: WidgetMeta[];
482
- }
483
- interface Config {
484
- access_token: string;
485
- [key: string]: string;
486
- }
487
- interface Identifier {
488
- id: string;
489
- type?: string;
490
- }
491
- type MessageType = "spec" | "activity" | "state" | "identifier" | "account" | "tools" | "tool_result" | "error";
492
- interface Message {
493
- type: MessageType;
494
- data: any;
495
- }
496
-
497
- declare enum UserTypeEnum {
498
- Agent = "Agent",
499
- User = "User",
500
- System = "System"
501
- }
502
-
503
- type UserConfirmationStatus = "pending" | "accepted" | "rejected" | "edited";
504
- interface SpacePattern {
505
- id: string;
506
- name: string;
507
- source: "explicit" | "implicit";
508
- type: string;
509
- summary: string;
510
- editedSummary?: string;
511
- evidence: string[];
512
- confidence: number;
513
- userConfirmed: UserConfirmationStatus;
514
- spaceId: string;
515
- createdAt: Date;
516
- updatedAt: Date;
517
- }
518
- interface CreatePatternParams {
519
- name: string;
520
- source: "explicit" | "implicit";
521
- type: string;
522
- summary: string;
523
- editedSummary?: string;
524
- evidence: string[];
525
- confidence: number;
526
- userConfirmed?: UserConfirmationStatus;
527
- spaceId: string;
528
- }
529
- interface PatternDetectionResult {
530
- explicitPatterns: Omit<SpacePattern, "id" | "createdAt" | "updatedAt" | "spaceId">[];
531
- implicitPatterns: Omit<SpacePattern, "id" | "createdAt" | "updatedAt" | "spaceId">[];
532
- totalPatternsFound: number;
533
- processingStats: {
534
- statementsAnalyzed: number;
535
- themesProcessed: number;
536
- implicitPatternsExtracted: number;
537
- };
538
- }
539
- interface PatternConfirmationParams {
540
- patternId: string;
541
- confirmed: boolean;
542
- }
543
- declare const EXPLICIT_PATTERN_TYPES: {
544
- readonly THEME: "theme";
545
- readonly TOPIC: "topic";
546
- readonly DOMAIN: "domain";
547
- readonly INTEREST_AREA: "interest_area";
548
- };
549
- declare const IMPLICIT_PATTERN_TYPES: {
550
- readonly PREFERENCE: "preference";
551
- readonly HABIT: "habit";
552
- readonly WORKFLOW: "workflow";
553
- readonly COMMUNICATION_STYLE: "communication_style";
554
- readonly DECISION_PATTERN: "decision_pattern";
555
- readonly TEMPORAL_PATTERN: "temporal_pattern";
556
- readonly BEHAVIORAL_PATTERN: "behavioral_pattern";
557
- readonly LEARNING_STYLE: "learning_style";
558
- readonly COLLABORATION_STYLE: "collaboration_style";
559
- };
560
- declare const PATTERN_TYPES: {
561
- readonly PREFERENCE: "preference";
562
- readonly HABIT: "habit";
563
- readonly WORKFLOW: "workflow";
564
- readonly COMMUNICATION_STYLE: "communication_style";
565
- readonly DECISION_PATTERN: "decision_pattern";
566
- readonly TEMPORAL_PATTERN: "temporal_pattern";
567
- readonly BEHAVIORAL_PATTERN: "behavioral_pattern";
568
- readonly LEARNING_STYLE: "learning_style";
569
- readonly COLLABORATION_STYLE: "collaboration_style";
570
- readonly THEME: "theme";
571
- readonly TOPIC: "topic";
572
- readonly DOMAIN: "domain";
573
- readonly INTEREST_AREA: "interest_area";
574
- };
575
- type ExplicitPatternType = (typeof EXPLICIT_PATTERN_TYPES)[keyof typeof EXPLICIT_PATTERN_TYPES];
576
- type ImplicitPatternType = (typeof IMPLICIT_PATTERN_TYPES)[keyof typeof IMPLICIT_PATTERN_TYPES];
577
- type PatternType = (typeof PATTERN_TYPES)[keyof typeof PATTERN_TYPES];
578
-
579
- /**
580
- * Search options interface
581
- */
582
- interface SearchOptions {
583
- limit?: number;
584
- maxBfsDepth?: number;
585
- validAt?: Date;
586
- startTime?: Date | null;
587
- endTime?: Date;
588
- includeInvalidated?: boolean;
589
- entityTypes?: string[];
590
- predicateTypes?: string[];
591
- scoreThreshold?: number;
592
- minResults?: number;
593
- labelIds?: string[];
594
- adaptiveFiltering?: boolean;
595
- structured?: boolean;
596
- useLLMValidation?: boolean;
597
- qualityThreshold?: number;
598
- maxEpisodesForLLM?: number;
599
- sortBy?: "relevance" | "recency";
600
- tokenBudget?: number;
601
- }
602
- /**
603
- * Statement with source provenance tracking
604
- */
605
- interface StatementWithSource {
606
- statement: StatementNode;
607
- sources: {
608
- episodeGraph?: {
609
- score: number;
610
- entityMatches: number;
611
- };
612
- episodeVector?: {
613
- score: number;
614
- };
615
- bfs?: {
616
- score: number;
617
- hopDistance: number;
618
- relevance: number;
619
- };
620
- vector?: {
621
- score: number;
622
- similarity: number;
623
- };
624
- bm25?: {
625
- score: number;
626
- rank: number;
627
- };
628
- };
629
- primarySource: "episodeGraph" | "episodeVector" | "bfs" | "vector" | "bm25";
630
- }
631
- /**
632
- * Episode with provenance tracking from multiple sources
633
- */
634
- interface EpisodeWithProvenance {
635
- episode: EpisodicNode;
636
- statements: StatementWithSource[];
637
- episodeGraphScore: number;
638
- episodeVectorScore: number;
639
- bfsScore: number;
640
- vectorScore: number;
641
- bm25Score: number;
642
- sourceBreakdown: {
643
- fromEpisodeGraph: number;
644
- fromEpisodeVector: number;
645
- fromBFS: number;
646
- fromVector: number;
647
- fromBM25: number;
648
- };
649
- entityMatchCount?: number;
650
- firstLevelScore?: number;
651
- }
652
- /**
653
- * Quality filtering result
654
- */
655
- interface QualityFilterResult {
656
- episodes: EpisodeWithProvenance[];
657
- confidence: number;
658
- message: string;
659
- }
660
- /**
661
- * Quality thresholds for filtering
662
- */
663
- declare const QUALITY_THRESHOLDS: {
664
- HIGH_QUALITY_EPISODE: number;
665
- MEDIUM_QUALITY_EPISODE: number;
666
- LOW_QUALITY_EPISODE: number;
667
- CONFIDENT_RESULT: number;
668
- UNCERTAIN_RESULT: number;
669
- NO_RESULT: number;
670
- MINIMUM_GAP_RATIO: number;
671
- };
672
- /**
673
- * Episode search result with aggregated scores and sample statements
674
- * Returned by BM25, Vector, and BFS searches
675
- */
676
- interface EpisodeSearchResult {
677
- episode: EpisodicNode;
678
- score: number;
679
- statementCount: number;
680
- topStatements: StatementNode[];
681
- invalidatedStatements: StatementNode[];
682
- }
683
- /**
684
- * Configuration for reranking
685
- */
686
- interface RerankConfig {
687
- provider: "cohere" | "ollama" | "none";
688
- limit?: number;
689
- threshold: number;
690
- cohereApiKey?: string;
691
- cohereModel?: string;
692
- ollamaUrl?: string;
693
- ollamaModel?: string;
694
- }
695
-
696
- declare abstract class IntegrationCLI {
697
- protected program: Command;
698
- protected integrationName: string;
699
- protected version: string;
700
- constructor(integrationName: string, version?: string);
701
- private setupProgram;
702
- private setupAccountCommands;
703
- private setupDataCommands;
704
- private setupSpecCommand;
705
- private setupSyncCommand;
706
- private setupGetToolsCommand;
707
- private setupCallToolCommand;
708
- protected abstract handleEvent(eventPayload: IntegrationEventPayload): Promise<Message[]>;
709
- protected abstract getSpec(): Promise<Spec>;
710
- parse(): void;
711
- getProgram(): Command;
712
- }
713
-
714
- declare const IngestInputSchema: z.ZodObject<{
715
- episodeBody: z.ZodString;
716
- referenceTime: z.ZodString;
717
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
718
- source: z.ZodString;
719
- labelIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
720
- sessionId: z.ZodOptional<z.ZodString>;
721
- type: z.ZodDefault<z.ZodEnum<["CONVERSATION", "DOCUMENT"]>>;
722
- title: z.ZodOptional<z.ZodString>;
723
- }, "strip", z.ZodTypeAny, {
724
- episodeBody?: string;
725
- referenceTime?: string;
726
- type?: "CONVERSATION" | "DOCUMENT";
727
- metadata?: Record<string, string | number | boolean>;
728
- source?: string;
729
- labelIds?: string[];
730
- sessionId?: string;
731
- title?: string;
732
- }, {
733
- episodeBody?: string;
734
- referenceTime?: string;
735
- type?: "CONVERSATION" | "DOCUMENT";
736
- metadata?: Record<string, string | number | boolean>;
737
- source?: string;
738
- labelIds?: string[];
739
- sessionId?: string;
740
- title?: string;
741
- }>;
742
- type IngestInput = z.infer<typeof IngestInputSchema>;
743
- declare const IngestResponseSchema: z.ZodObject<{
744
- success: z.ZodBoolean;
745
- id: z.ZodString;
746
- }, "strip", z.ZodTypeAny, {
747
- success?: boolean;
748
- id?: string;
749
- }, {
750
- success?: boolean;
751
- id?: string;
752
- }>;
753
- type IngestResponse = z.infer<typeof IngestResponseSchema>;
754
- declare const SearchInputSchema: z.ZodObject<{
755
- query: z.ZodString;
756
- startTime: z.ZodOptional<z.ZodString>;
757
- endTime: z.ZodOptional<z.ZodString>;
758
- labelIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
759
- limit: z.ZodOptional<z.ZodNumber>;
760
- structured: z.ZodOptional<z.ZodBoolean>;
761
- sortBy: z.ZodOptional<z.ZodEnum<["relevance", "recency"]>>;
762
- }, "strip", z.ZodTypeAny, {
763
- labelIds?: string[];
764
- query?: string;
765
- startTime?: string;
766
- endTime?: string;
767
- limit?: number;
768
- structured?: boolean;
769
- sortBy?: "relevance" | "recency";
770
- }, {
771
- labelIds?: string[];
772
- query?: string;
773
- startTime?: string;
774
- endTime?: string;
775
- limit?: number;
776
- structured?: boolean;
777
- sortBy?: "relevance" | "recency";
778
- }>;
779
- type SearchInput = z.infer<typeof SearchInputSchema>;
780
- declare const SearchResponseSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
781
- type SearchResponse = z.infer<typeof SearchResponseSchema>;
782
- declare const MeResponseSchema: z.ZodObject<{
783
- id: z.ZodString;
784
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
785
- persona: z.ZodOptional<z.ZodNullable<z.ZodString>>;
786
- workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
787
- phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
788
- email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
789
- timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
790
- metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
791
- }, "strip", z.ZodTypeAny, {
792
- metadata?: Record<string, unknown>;
793
- id?: string;
794
- name?: string;
795
- persona?: string;
796
- workspaceId?: string;
797
- phoneNumber?: string;
798
- email?: string;
799
- timezone?: string;
800
- }, {
801
- metadata?: Record<string, unknown>;
802
- id?: string;
803
- name?: string;
804
- persona?: string;
805
- workspaceId?: string;
806
- phoneNumber?: string;
807
- email?: string;
808
- timezone?: string;
809
- }>;
810
- type MeResponse = z.infer<typeof MeResponseSchema>;
811
- declare const IntegrationAccountSchema: z.ZodObject<{
812
- id: z.ZodString;
813
- name: z.ZodOptional<z.ZodString>;
814
- slug: z.ZodOptional<z.ZodString>;
815
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
816
- id: z.ZodString;
817
- name: z.ZodOptional<z.ZodString>;
818
- slug: z.ZodOptional<z.ZodString>;
819
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
820
- id: z.ZodString;
821
- name: z.ZodOptional<z.ZodString>;
822
- slug: z.ZodOptional<z.ZodString>;
823
- }, z.ZodTypeAny, "passthrough">>;
824
- declare const GetIntegrationsConnectedResponseSchema: z.ZodObject<{
825
- accounts: z.ZodArray<z.ZodObject<{
826
- id: z.ZodString;
827
- name: z.ZodOptional<z.ZodString>;
828
- slug: z.ZodOptional<z.ZodString>;
829
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
830
- id: z.ZodString;
831
- name: z.ZodOptional<z.ZodString>;
832
- slug: z.ZodOptional<z.ZodString>;
833
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
834
- id: z.ZodString;
835
- name: z.ZodOptional<z.ZodString>;
836
- slug: z.ZodOptional<z.ZodString>;
837
- }, z.ZodTypeAny, "passthrough">>, "many">;
838
- }, "strip", z.ZodTypeAny, {
839
- accounts?: z.objectOutputType<{
840
- id: z.ZodString;
841
- name: z.ZodOptional<z.ZodString>;
842
- slug: z.ZodOptional<z.ZodString>;
843
- }, z.ZodTypeAny, "passthrough">[];
844
- }, {
845
- accounts?: z.objectInputType<{
846
- id: z.ZodString;
847
- name: z.ZodOptional<z.ZodString>;
848
- slug: z.ZodOptional<z.ZodString>;
849
- }, z.ZodTypeAny, "passthrough">[];
850
- }>;
851
- type GetIntegrationsConnectedResponse = z.infer<typeof GetIntegrationsConnectedResponseSchema>;
852
- declare const GetIntegrationActionsInputSchema: z.ZodObject<{
853
- accountId: z.ZodString;
854
- query: z.ZodOptional<z.ZodString>;
855
- }, "strip", z.ZodTypeAny, {
856
- query?: string;
857
- accountId?: string;
858
- }, {
859
- query?: string;
860
- accountId?: string;
861
- }>;
862
- type GetIntegrationActionsInput = z.infer<typeof GetIntegrationActionsInputSchema>;
863
- declare const GetIntegrationActionsResponseSchema: z.ZodObject<{
864
- actions: z.ZodArray<z.ZodUnknown, "many">;
865
- }, "strip", z.ZodTypeAny, {
866
- actions?: unknown[];
867
- }, {
868
- actions?: unknown[];
869
- }>;
870
- type GetIntegrationActionsResponse = z.infer<typeof GetIntegrationActionsResponseSchema>;
871
- declare const ExecuteIntegrationActionInputSchema: z.ZodObject<{
872
- accountId: z.ZodString;
873
- action: z.ZodString;
874
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
875
- }, "strip", z.ZodTypeAny, {
876
- accountId?: string;
877
- action?: string;
878
- parameters?: Record<string, unknown>;
879
- }, {
880
- accountId?: string;
881
- action?: string;
882
- parameters?: Record<string, unknown>;
883
- }>;
884
- type ExecuteIntegrationActionInput = z.infer<typeof ExecuteIntegrationActionInputSchema>;
885
- declare const ExecuteIntegrationActionResponseSchema: z.ZodObject<{
886
- result: z.ZodUnknown;
887
- }, "strip", z.ZodTypeAny, {
888
- result?: unknown;
889
- }, {
890
- result?: unknown;
891
- }>;
892
- type ExecuteIntegrationActionResponse = z.infer<typeof ExecuteIntegrationActionResponseSchema>;
893
- declare const GetDocumentsInputSchema: z.ZodObject<{
894
- page: z.ZodOptional<z.ZodNumber>;
895
- limit: z.ZodOptional<z.ZodNumber>;
896
- source: z.ZodOptional<z.ZodString>;
897
- status: z.ZodOptional<z.ZodString>;
898
- type: z.ZodOptional<z.ZodString>;
899
- sessionId: z.ZodOptional<z.ZodString>;
900
- label: z.ZodOptional<z.ZodString>;
901
- cursor: z.ZodOptional<z.ZodString>;
902
- }, "strip", z.ZodTypeAny, {
903
- status?: string;
904
- type?: string;
905
- source?: string;
906
- sessionId?: string;
907
- limit?: number;
908
- page?: number;
909
- label?: string;
910
- cursor?: string;
911
- }, {
912
- status?: string;
913
- type?: string;
914
- source?: string;
915
- sessionId?: string;
916
- limit?: number;
917
- page?: number;
918
- label?: string;
919
- cursor?: string;
920
- }>;
921
- type GetDocumentsInput = z.infer<typeof GetDocumentsInputSchema>;
922
- declare const DocumentSchema: z.ZodObject<{
923
- id: z.ZodString;
924
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
925
- createdAt: z.ZodOptional<z.ZodString>;
926
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
927
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
928
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
929
- id: z.ZodString;
930
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
931
- createdAt: z.ZodOptional<z.ZodString>;
932
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
933
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
934
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
935
- id: z.ZodString;
936
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
937
- createdAt: z.ZodOptional<z.ZodString>;
938
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
939
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
940
- }, z.ZodTypeAny, "passthrough">>;
941
- declare const GetDocumentsResponseSchema: z.ZodObject<{
942
- documents: z.ZodArray<z.ZodObject<{
943
- id: z.ZodString;
944
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
945
- createdAt: z.ZodOptional<z.ZodString>;
946
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
947
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
948
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
949
- id: z.ZodString;
950
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
951
- createdAt: z.ZodOptional<z.ZodString>;
952
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
953
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
954
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
955
- id: z.ZodString;
956
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
957
- createdAt: z.ZodOptional<z.ZodString>;
958
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
959
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
960
- }, z.ZodTypeAny, "passthrough">>, "many">;
961
- page: z.ZodNumber;
962
- limit: z.ZodNumber;
963
- hasMore: z.ZodBoolean;
964
- nextCursor: z.ZodNullable<z.ZodString>;
965
- availableSources: z.ZodArray<z.ZodObject<{
966
- name: z.ZodString;
967
- slug: z.ZodString;
968
- }, "strip", z.ZodTypeAny, {
969
- name?: string;
970
- slug?: string;
971
- }, {
972
- name?: string;
973
- slug?: string;
974
- }>, "many">;
975
- totalCount: z.ZodNumber;
976
- }, "strip", z.ZodTypeAny, {
977
- limit?: number;
978
- page?: number;
979
- documents?: z.objectOutputType<{
980
- id: z.ZodString;
981
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
982
- createdAt: z.ZodOptional<z.ZodString>;
983
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
984
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
985
- }, z.ZodTypeAny, "passthrough">[];
986
- hasMore?: boolean;
987
- nextCursor?: string;
988
- availableSources?: {
989
- name?: string;
990
- slug?: string;
991
- }[];
992
- totalCount?: number;
993
- }, {
994
- limit?: number;
995
- page?: number;
996
- documents?: z.objectInputType<{
997
- id: z.ZodString;
998
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
999
- createdAt: z.ZodOptional<z.ZodString>;
1000
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1001
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1002
- }, z.ZodTypeAny, "passthrough">[];
1003
- hasMore?: boolean;
1004
- nextCursor?: string;
1005
- availableSources?: {
1006
- name?: string;
1007
- slug?: string;
1008
- }[];
1009
- totalCount?: number;
1010
- }>;
1011
- type GetDocumentsResponse = z.infer<typeof GetDocumentsResponseSchema>;
1012
- declare const GetDocumentInputSchema: z.ZodObject<{
1013
- documentId: z.ZodString;
1014
- }, "strip", z.ZodTypeAny, {
1015
- documentId?: string;
1016
- }, {
1017
- documentId?: string;
1018
- }>;
1019
- type GetDocumentInput = z.infer<typeof GetDocumentInputSchema>;
1020
- declare const GetDocumentResponseSchema: z.ZodObject<{
1021
- document: z.ZodNullable<z.ZodObject<{
1022
- id: z.ZodString;
1023
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1024
- createdAt: z.ZodOptional<z.ZodString>;
1025
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1026
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1027
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1028
- id: z.ZodString;
1029
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1030
- createdAt: z.ZodOptional<z.ZodString>;
1031
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1032
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1033
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1034
- id: z.ZodString;
1035
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1036
- createdAt: z.ZodOptional<z.ZodString>;
1037
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1038
- source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1039
- }, z.ZodTypeAny, "passthrough">>>;
1040
- }, "strip", z.ZodTypeAny, {
1041
- document?: {
1042
- source?: string;
1043
- sessionId?: string;
1044
- title?: string;
1045
- id?: string;
1046
- createdAt?: string;
1047
- } & {
1048
- [k: string]: unknown;
1049
- };
1050
- }, {
1051
- document?: {
1052
- source?: string;
1053
- sessionId?: string;
1054
- title?: string;
1055
- id?: string;
1056
- createdAt?: string;
1057
- } & {
1058
- [k: string]: unknown;
1059
- };
1060
- }>;
1061
- type GetDocumentResponse = z.infer<typeof GetDocumentResponseSchema>;
1062
- declare const GatewayAgentInfoSchema: z.ZodObject<{
1063
- id: z.ZodString;
1064
- name: z.ZodString;
1065
- description: z.ZodString;
1066
- tools: z.ZodArray<z.ZodString, "many">;
1067
- platform: z.ZodNullable<z.ZodString>;
1068
- hostname: z.ZodNullable<z.ZodString>;
1069
- status: z.ZodEnum<["CONNECTED", "DISCONNECTED"]>;
1070
- }, "strip", z.ZodTypeAny, {
1071
- tools?: string[];
1072
- status?: "CONNECTED" | "DISCONNECTED";
1073
- id?: string;
1074
- name?: string;
1075
- description?: string;
1076
- platform?: string;
1077
- hostname?: string;
1078
- }, {
1079
- tools?: string[];
1080
- status?: "CONNECTED" | "DISCONNECTED";
1081
- id?: string;
1082
- name?: string;
1083
- description?: string;
1084
- platform?: string;
1085
- hostname?: string;
1086
- }>;
1087
- type GatewayAgentInfo = z.infer<typeof GatewayAgentInfoSchema>;
1088
- declare const GetGatewaysResponseSchema: z.ZodObject<{
1089
- gateways: z.ZodArray<z.ZodObject<{
1090
- id: z.ZodString;
1091
- name: z.ZodString;
1092
- description: z.ZodString;
1093
- tools: z.ZodArray<z.ZodString, "many">;
1094
- platform: z.ZodNullable<z.ZodString>;
1095
- hostname: z.ZodNullable<z.ZodString>;
1096
- status: z.ZodEnum<["CONNECTED", "DISCONNECTED"]>;
1097
- }, "strip", z.ZodTypeAny, {
1098
- tools?: string[];
1099
- status?: "CONNECTED" | "DISCONNECTED";
1100
- id?: string;
1101
- name?: string;
1102
- description?: string;
1103
- platform?: string;
1104
- hostname?: string;
1105
- }, {
1106
- tools?: string[];
1107
- status?: "CONNECTED" | "DISCONNECTED";
1108
- id?: string;
1109
- name?: string;
1110
- description?: string;
1111
- platform?: string;
1112
- hostname?: string;
1113
- }>, "many">;
1114
- }, "strip", z.ZodTypeAny, {
1115
- gateways?: {
1116
- tools?: string[];
1117
- status?: "CONNECTED" | "DISCONNECTED";
1118
- id?: string;
1119
- name?: string;
1120
- description?: string;
1121
- platform?: string;
1122
- hostname?: string;
1123
- }[];
1124
- }, {
1125
- gateways?: {
1126
- tools?: string[];
1127
- status?: "CONNECTED" | "DISCONNECTED";
1128
- id?: string;
1129
- name?: string;
1130
- description?: string;
1131
- platform?: string;
1132
- hostname?: string;
1133
- }[];
1134
- }>;
1135
- type GetGatewaysResponse = z.infer<typeof GetGatewaysResponseSchema>;
1136
- declare const ExecuteGatewayInputSchema: z.ZodObject<{
1137
- gatewayId: z.ZodString;
1138
- intent: z.ZodString;
1139
- }, "strip", z.ZodTypeAny, {
1140
- gatewayId?: string;
1141
- intent?: string;
1142
- }, {
1143
- gatewayId?: string;
1144
- intent?: string;
1145
- }>;
1146
- type ExecuteGatewayInput = z.infer<typeof ExecuteGatewayInputSchema>;
1147
- declare const ExecuteGatewayToolInputSchema: z.ZodObject<{
1148
- gatewayId: z.ZodString;
1149
- toolName: z.ZodString;
1150
- params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1151
- }, "strip", z.ZodTypeAny, {
1152
- params?: Record<string, unknown>;
1153
- gatewayId?: string;
1154
- toolName?: string;
1155
- }, {
1156
- params?: Record<string, unknown>;
1157
- gatewayId?: string;
1158
- toolName?: string;
1159
- }>;
1160
- type ExecuteGatewayToolInput = z.infer<typeof ExecuteGatewayToolInputSchema>;
1161
- declare const ExecuteGatewayResponseSchema: z.ZodObject<{
1162
- result: z.ZodUnknown;
1163
- }, "strip", z.ZodTypeAny, {
1164
- result?: unknown;
1165
- }, {
1166
- result?: unknown;
1167
- }>;
1168
- type ExecuteGatewayResponse = z.infer<typeof ExecuteGatewayResponseSchema>;
1169
- declare const AuthorizationCodeResponseSchema: z.ZodObject<{
1170
- authorizationCode: z.ZodString;
1171
- url: z.ZodString;
1172
- }, "strip", z.ZodTypeAny, {
1173
- authorizationCode?: string;
1174
- url?: string;
1175
- }, {
1176
- authorizationCode?: string;
1177
- url?: string;
1178
- }>;
1179
- type AuthorizationCodeResponse = z.infer<typeof AuthorizationCodeResponseSchema>;
1180
- declare const TokenExchangeInputSchema: z.ZodObject<{
1181
- authorizationCode: z.ZodString;
1182
- }, "strip", z.ZodTypeAny, {
1183
- authorizationCode?: string;
1184
- }, {
1185
- authorizationCode?: string;
1186
- }>;
1187
- type TokenExchangeInput = z.infer<typeof TokenExchangeInputSchema>;
1188
- declare const TokenExchangeResponseSchema: z.ZodObject<{
1189
- token: z.ZodNullable<z.ZodObject<{
1190
- token: z.ZodString;
1191
- obfuscatedToken: z.ZodString;
1192
- }, "strip", z.ZodTypeAny, {
1193
- token?: string;
1194
- obfuscatedToken?: string;
1195
- }, {
1196
- token?: string;
1197
- obfuscatedToken?: string;
1198
- }>>;
1199
- }, "strip", z.ZodTypeAny, {
1200
- token?: {
1201
- token?: string;
1202
- obfuscatedToken?: string;
1203
- };
1204
- }, {
1205
- token?: {
1206
- token?: string;
1207
- obfuscatedToken?: string;
1208
- };
1209
- }>;
1210
- type TokenExchangeResponse = z.infer<typeof TokenExchangeResponseSchema>;
1211
-
1212
- interface CoreClientOptions {
1213
- baseUrl: string;
1214
- token: string;
1215
- }
1216
- declare class CoreClientError extends Error {
1217
- statusCode: number;
1218
- constructor(message: string, statusCode: number);
1219
- }
1220
- declare class CoreClient {
1221
- private baseUrl;
1222
- private token;
1223
- constructor(options: CoreClientOptions);
1224
- private request;
1225
- private requestPublic;
1226
- me(): Promise<MeResponse>;
1227
- ingest(body: IngestInput): Promise<IngestResponse>;
1228
- search(body: SearchInput): Promise<SearchResponse>;
1229
- getIntegrationsConnected(): Promise<GetIntegrationsConnectedResponse>;
1230
- getIntegrationActions(params: GetIntegrationActionsInput): Promise<GetIntegrationActionsResponse>;
1231
- executeIntegrationAction(params: ExecuteIntegrationActionInput): Promise<ExecuteIntegrationActionResponse>;
1232
- getSessionId(): Promise<string>;
1233
- getDocuments(params?: GetDocumentsInput): Promise<GetDocumentsResponse>;
1234
- getDocument(params: GetDocumentInput): Promise<GetDocumentResponse>;
1235
- getGateways(): Promise<GetGatewaysResponse>;
1236
- executeGateway(params: ExecuteGatewayInput): Promise<ExecuteGatewayResponse>;
1237
- executeGatewayTool(params: ExecuteGatewayToolInput): Promise<ExecuteGatewayResponse>;
1238
- getAuthorizationCode(): Promise<AuthorizationCodeResponse>;
1239
- exchangeToken(params: TokenExchangeInput): Promise<TokenExchangeResponse>;
1240
- checkAuth(): Promise<MeResponse>;
1241
- }
1242
-
1243
- export { APIKeyParams, ActionStatus, ActionStatusEnum, type AddEpisodeParams, type AddEpisodeResult, type AdjacentChunks, type AuthType, type AuthorizationCodeResponse, AuthorizationCodeResponseSchema, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, type CompactedSessionNode, type Config, CoreClient, CoreClientError, type CoreClientOptions, type CreatePatternParams, type DocumentNode, DocumentSchema, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, type EntityNode, type EntityType, EntityTypes, type EpisodeSearchResult, EpisodeType, EpisodeTypeEnum, type EpisodeWithProvenance, type EpisodicNode, type EpisodicNodeWithoutEmbeddings, type ExecuteGatewayInput, ExecuteGatewayInputSchema, type ExecuteGatewayResponse, ExecuteGatewayResponseSchema, type ExecuteGatewayToolInput, ExecuteGatewayToolInputSchema, type ExecuteIntegrationActionInput, ExecuteIntegrationActionInputSchema, type ExecuteIntegrationActionResponse, ExecuteIntegrationActionResponseSchema, type ExplicitPatternType, type ExtractedTripleData, GRAPH_ASPECTS, type GatewayAgentInfo, GatewayAgentInfoSchema, GeminiModels, type GetDocumentInput, GetDocumentInputSchema, type GetDocumentResponse, GetDocumentResponseSchema, type GetDocumentsInput, GetDocumentsInputSchema, type GetDocumentsResponse, GetDocumentsResponseSchema, type GetGatewaysResponse, GetGatewaysResponseSchema, type GetIntegrationActionsInput, GetIntegrationActionsInputSchema, type GetIntegrationActionsResponse, GetIntegrationActionsResponseSchema, type GetIntegrationsConnectedResponse, GetIntegrationsConnectedResponseSchema, type GraphAspect, IMPLICIT_PATTERN_TYPES, type Identifier, type ImplicitPatternType, type IngestInput, IngestInputSchema, type IngestResponse, IngestResponseSchema, IntegrationAccountSchema, IntegrationCLI, type IntegrationEventPayload, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, McpAuthParams, type MeResponse, MeResponseSchema, type Message, type MessageType, OAuth2Params, OpenAIModels, PATTERN_TYPES, type Param, type PatternConfirmationParams, type PatternDetectionResult, type PatternType, QUALITY_THRESHOLDS, type QualityFilterResult, type RerankConfig, STATEMENT_NODE_PROPERTIES, type SearchInput, SearchInputSchema, type SearchOptions, type SearchResponse, SearchResponseSchema, type SpaceAssignmentResult, type SpaceDeletionResult, type SpaceNode, type SpacePattern, Spec, type StatementAspect, StatementAspects, type StatementNode, type StatementWithSource, type TokenExchangeInput, TokenExchangeInputSchema, type TokenExchangeResponse, TokenExchangeResponseSchema, type Triple, type TuiWidgetComponent, type UserConfirmationStatus, UserTypeEnum, VOICE_ASPECTS, type VoiceAspect, type VoiceAspectNode, type WebWidgetComponent, type WidgetComponent, type WidgetMeta, type WidgetRenderContext, type WidgetSpec };
1
+ export { chatRoute, handleChatStream } from './chat-route.js';
2
+ export type { chatRouteOptions, ChatStreamHandlerParams, ChatStreamHandlerOptions } from './chat-route.js';
3
+ export { workflowRoute, handleWorkflowStream } from './workflow-route.js';
4
+ export type { WorkflowRouteOptions, WorkflowStreamHandlerParams, WorkflowStreamHandlerOptions } from './workflow-route.js';
5
+ export type { WorkflowDataPart } from './transformers.js';
6
+ export { networkRoute, handleNetworkStream } from './network-route.js';
7
+ export type { NetworkRouteOptions, NetworkStreamHandlerParams, NetworkStreamHandlerOptions } from './network-route.js';
8
+ export type { NetworkDataPart } from './transformers.js';
9
+ export type { AgentDataPart } from './transformers.js';
10
+ export { toAISdkStream, toAISdkV5Stream } from './convert-streams.js';
11
+ export { withMastra } from './middleware.js';
12
+ export type { WithMastraOptions, WithMastraMemoryOptions, WithMastraSemanticRecallOptions } from './middleware.js';
13
+ export { toAISdkFormat } from './to-ai-sdk-format.js';
14
+ //# sourceMappingURL=index.d.ts.map