@redplanethq/sdk 0.1.10 → 0.1.12

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.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Command } from 'commander';
2
+ import { z } from 'zod';
2
3
 
3
4
  declare enum LLMModelEnum {
4
5
  GPT35TURBO = "GPT35TURBO",
@@ -64,6 +65,7 @@ interface DocumentNode {
64
65
  metadata: Record<string, any>;
65
66
  source: string;
66
67
  userId: string;
68
+ workspaceId?: string;
67
69
  createdAt: Date;
68
70
  validAt: Date;
69
71
  totalChunks: number;
@@ -89,6 +91,7 @@ interface EpisodicNode {
89
91
  validAt: Date;
90
92
  labelIds: string[];
91
93
  userId: string;
94
+ workspaceId?: string;
92
95
  sessionId: string;
93
96
  queueId?: string;
94
97
  type?: EpisodeType;
@@ -109,10 +112,16 @@ type EpisodicNodeWithoutEmbeddings = Omit<EpisodicNode, "contentEmbedding">;
109
112
  * Helper to get episodic node properties for Cypher RETURN clause (excludes embeddings)
110
113
  * Usage in Cypher: RETURN ${EPISODIC_NODE_PROPERTIES} as episode
111
114
  */
112
- 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 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}";
113
- declare const STATEMENT_NODE_PROPERTIES = "{\n uuid: s.uuid,\n fact: s.fact,\n createdAt: s.createdAt,\n userId: s.userId,\n validAt: s.validAt,\n invalidAt: s.invalidAt,\n invalidatedBy: s.invalidatedBy,\n attributes: s.attributes,\n recallCount: s.recallCount,\n provenanceCount: s.provenanceCount\n}";
114
- declare const ENTITY_NODE_PROPERTIES = "{\n uuid: ent.uuid,\n name: ent.name,\n createdAt: ent.createdAt,\n userId: ent.userId,\n attributes: ent.attributes\n}";
115
- 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 source: cs.source,\n compressionRatio: cs.compressionRatio,\n metadata: cs.metadata\n}";
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];
116
125
  /**
117
126
  * Interface for entity node in the reified knowledge graph
118
127
  * Entities represent subjects, objects, or predicates in statements
@@ -120,12 +129,32 @@ declare const COMPACTED_SESSION_NODE_PROPERTIES = "{\n uuid: cs.uuid,\n sessio
120
129
  interface EntityNode {
121
130
  uuid: string;
122
131
  name: string;
123
- type?: string;
132
+ type?: EntityType;
124
133
  nameEmbedding?: number[];
125
134
  attributes?: Record<string, any>;
126
135
  createdAt: Date;
127
136
  userId: string;
137
+ workspaceId?: string;
128
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", "Directive", "Decision", "Event", "Problem", "Relationship"];
157
+ type StatementAspect = (typeof StatementAspects)[number];
129
158
  /**
130
159
  * Interface for statement node in the reified knowledge graph
131
160
  * Statements are first-class objects representing facts with temporal properties
@@ -140,7 +169,9 @@ interface StatementNode {
140
169
  invalidatedBy?: string;
141
170
  attributes: Record<string, any>;
142
171
  userId: string;
172
+ workspaceId?: string;
143
173
  labelIds?: string[];
174
+ aspect?: StatementAspect | null;
144
175
  recallCount?: {
145
176
  low: number;
146
177
  high: number;
@@ -176,6 +207,8 @@ type AddEpisodeParams = {
176
207
  metadata?: Record<string, any>;
177
208
  source: string;
178
209
  userId: string;
210
+ workspaceId?: string;
211
+ userName?: string;
179
212
  labelIds?: string[];
180
213
  sessionId: string;
181
214
  queueId: string;
@@ -215,6 +248,7 @@ interface ExtractedTripleData {
215
248
  target: string;
216
249
  targetType?: string;
217
250
  fact: string;
251
+ aspect?: StatementAspect | null;
218
252
  attributes?: Record<string, any>;
219
253
  }
220
254
  interface CompactedSessionNode {
@@ -229,6 +263,7 @@ interface CompactedSessionNode {
229
263
  updatedAt?: Date;
230
264
  confidence: number;
231
265
  userId: string;
266
+ workspaceId?: string;
232
267
  source: string;
233
268
  compressionRatio?: number;
234
269
  metadata?: Record<string, any>;
@@ -242,6 +277,7 @@ interface SpaceNode {
242
277
  name: string;
243
278
  description: string;
244
279
  userId: string;
280
+ workspaceId?: string;
245
281
  createdAt: Date;
246
282
  updatedAt: Date;
247
283
  isActive: boolean;
@@ -306,10 +342,18 @@ declare class OAuth2Params {
306
342
  scopes?: string[];
307
343
  token_request_auth_method?: string;
308
344
  }
309
- type AuthType = "OAuth2" | "APIKey";
345
+ type AuthType = "OAuth2" | "api_key" | "mcp";
346
+ type Param = {
347
+ name: string;
348
+ label: string;
349
+ placeholder: string;
350
+ description: string;
351
+ };
310
352
  declare class APIKeyParams {
311
- "header_name": string;
312
- "format": string;
353
+ fields: Array<Param>;
354
+ }
355
+ declare class McpAuthParams {
356
+ authorization_url: string;
313
357
  }
314
358
 
315
359
  declare enum IntegrationEventType {
@@ -366,15 +410,7 @@ declare class Spec {
366
410
  schedule?: {
367
411
  frequency?: string;
368
412
  };
369
- mcp?: {
370
- type: "http";
371
- url: string;
372
- headers?: Record<string, string>;
373
- needsAuth?: boolean;
374
- } | {
375
- type: "cli";
376
- };
377
- auth?: Record<string, OAuth2Params | APIKeyParams>;
413
+ auth?: Record<AuthType, OAuth2Params | APIKeyParams | McpAuthParams>;
378
414
  }
379
415
  interface Config {
380
416
  access_token: string;
@@ -493,6 +529,7 @@ interface SearchOptions {
493
529
  qualityThreshold?: number;
494
530
  maxEpisodesForLLM?: number;
495
531
  sortBy?: "relevance" | "recency";
532
+ tokenBudget?: number;
496
533
  }
497
534
  /**
498
535
  * Statement with source provenance tracking
@@ -606,4 +643,533 @@ declare abstract class IntegrationCLI {
606
643
  getProgram(): Command;
607
644
  }
608
645
 
609
- export { APIKeyParams, ActionStatus, ActionStatusEnum, type AddEpisodeParams, type AddEpisodeResult, type AdjacentChunks, type AuthType, COMPACTED_SESSION_NODE_PROPERTIES, ClaudeModels, type CompactedSessionNode, type Config, type CreatePatternParams, type DocumentNode, ENTITY_NODE_PROPERTIES, EPISODIC_NODE_PROPERTIES, EXPLICIT_PATTERN_TYPES, type EntityNode, type EpisodeSearchResult, EpisodeType, EpisodeTypeEnum, type EpisodeWithProvenance, type EpisodicNode, type EpisodicNodeWithoutEmbeddings, type ExplicitPatternType, type ExtractedTripleData, GeminiModels, IMPLICIT_PATTERN_TYPES, type Identifier, type ImplicitPatternType, IntegrationCLI, type IntegrationEventPayload, IntegrationEventType, LLMMappings, LLMModelEnum, LLMModelType, type Message, type MessageType, OAuth2Params, OpenAIModels, PATTERN_TYPES, type PatternConfirmationParams, type PatternDetectionResult, type PatternType, QUALITY_THRESHOLDS, type QualityFilterResult, type RerankConfig, STATEMENT_NODE_PROPERTIES, type SearchOptions, type SpaceAssignmentResult, type SpaceDeletionResult, type SpaceNode, type SpacePattern, Spec, type StatementNode, type StatementWithSource, type Triple, type UserConfirmationStatus, UserTypeEnum };
646
+ declare const IngestInputSchema: z.ZodObject<{
647
+ episodeBody: z.ZodString;
648
+ referenceTime: z.ZodString;
649
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
650
+ source: z.ZodString;
651
+ labelIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
652
+ sessionId: z.ZodOptional<z.ZodString>;
653
+ type: z.ZodDefault<z.ZodEnum<["CONVERSATION", "DOCUMENT"]>>;
654
+ title: z.ZodOptional<z.ZodString>;
655
+ }, "strip", z.ZodTypeAny, {
656
+ episodeBody?: string;
657
+ referenceTime?: string;
658
+ type?: "CONVERSATION" | "DOCUMENT";
659
+ metadata?: Record<string, string | number | boolean>;
660
+ source?: string;
661
+ labelIds?: string[];
662
+ sessionId?: string;
663
+ title?: string;
664
+ }, {
665
+ episodeBody?: string;
666
+ referenceTime?: string;
667
+ type?: "CONVERSATION" | "DOCUMENT";
668
+ metadata?: Record<string, string | number | boolean>;
669
+ source?: string;
670
+ labelIds?: string[];
671
+ sessionId?: string;
672
+ title?: string;
673
+ }>;
674
+ type IngestInput = z.infer<typeof IngestInputSchema>;
675
+ declare const IngestResponseSchema: z.ZodObject<{
676
+ success: z.ZodBoolean;
677
+ id: z.ZodString;
678
+ }, "strip", z.ZodTypeAny, {
679
+ success?: boolean;
680
+ id?: string;
681
+ }, {
682
+ success?: boolean;
683
+ id?: string;
684
+ }>;
685
+ type IngestResponse = z.infer<typeof IngestResponseSchema>;
686
+ declare const SearchInputSchema: z.ZodObject<{
687
+ query: z.ZodString;
688
+ startTime: z.ZodOptional<z.ZodString>;
689
+ endTime: z.ZodOptional<z.ZodString>;
690
+ labelIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
691
+ limit: z.ZodOptional<z.ZodNumber>;
692
+ structured: z.ZodOptional<z.ZodBoolean>;
693
+ sortBy: z.ZodOptional<z.ZodEnum<["relevance", "recency"]>>;
694
+ }, "strip", z.ZodTypeAny, {
695
+ labelIds?: string[];
696
+ query?: string;
697
+ startTime?: string;
698
+ endTime?: string;
699
+ limit?: number;
700
+ structured?: boolean;
701
+ sortBy?: "relevance" | "recency";
702
+ }, {
703
+ labelIds?: string[];
704
+ query?: string;
705
+ startTime?: string;
706
+ endTime?: string;
707
+ limit?: number;
708
+ structured?: boolean;
709
+ sortBy?: "relevance" | "recency";
710
+ }>;
711
+ type SearchInput = z.infer<typeof SearchInputSchema>;
712
+ declare const SearchResponseSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
713
+ type SearchResponse = z.infer<typeof SearchResponseSchema>;
714
+ declare const MeResponseSchema: z.ZodObject<{
715
+ id: z.ZodString;
716
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
717
+ persona: z.ZodOptional<z.ZodNullable<z.ZodString>>;
718
+ workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
719
+ phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
720
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
721
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
722
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
723
+ }, "strip", z.ZodTypeAny, {
724
+ metadata?: Record<string, unknown>;
725
+ id?: string;
726
+ name?: string;
727
+ persona?: string;
728
+ workspaceId?: string;
729
+ phoneNumber?: string;
730
+ email?: string;
731
+ timezone?: string;
732
+ }, {
733
+ metadata?: Record<string, unknown>;
734
+ id?: string;
735
+ name?: string;
736
+ persona?: string;
737
+ workspaceId?: string;
738
+ phoneNumber?: string;
739
+ email?: string;
740
+ timezone?: string;
741
+ }>;
742
+ type MeResponse = z.infer<typeof MeResponseSchema>;
743
+ declare const IntegrationAccountSchema: z.ZodObject<{
744
+ id: z.ZodString;
745
+ name: z.ZodOptional<z.ZodString>;
746
+ slug: z.ZodOptional<z.ZodString>;
747
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
748
+ id: z.ZodString;
749
+ name: z.ZodOptional<z.ZodString>;
750
+ slug: z.ZodOptional<z.ZodString>;
751
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
752
+ id: z.ZodString;
753
+ name: z.ZodOptional<z.ZodString>;
754
+ slug: z.ZodOptional<z.ZodString>;
755
+ }, z.ZodTypeAny, "passthrough">>;
756
+ declare const GetIntegrationsConnectedResponseSchema: z.ZodObject<{
757
+ accounts: z.ZodArray<z.ZodObject<{
758
+ id: z.ZodString;
759
+ name: z.ZodOptional<z.ZodString>;
760
+ slug: z.ZodOptional<z.ZodString>;
761
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
762
+ id: z.ZodString;
763
+ name: z.ZodOptional<z.ZodString>;
764
+ slug: z.ZodOptional<z.ZodString>;
765
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
766
+ id: z.ZodString;
767
+ name: z.ZodOptional<z.ZodString>;
768
+ slug: z.ZodOptional<z.ZodString>;
769
+ }, z.ZodTypeAny, "passthrough">>, "many">;
770
+ }, "strip", z.ZodTypeAny, {
771
+ accounts?: z.objectOutputType<{
772
+ id: z.ZodString;
773
+ name: z.ZodOptional<z.ZodString>;
774
+ slug: z.ZodOptional<z.ZodString>;
775
+ }, z.ZodTypeAny, "passthrough">[];
776
+ }, {
777
+ accounts?: z.objectInputType<{
778
+ id: z.ZodString;
779
+ name: z.ZodOptional<z.ZodString>;
780
+ slug: z.ZodOptional<z.ZodString>;
781
+ }, z.ZodTypeAny, "passthrough">[];
782
+ }>;
783
+ type GetIntegrationsConnectedResponse = z.infer<typeof GetIntegrationsConnectedResponseSchema>;
784
+ declare const GetIntegrationActionsInputSchema: z.ZodObject<{
785
+ accountId: z.ZodString;
786
+ query: z.ZodOptional<z.ZodString>;
787
+ }, "strip", z.ZodTypeAny, {
788
+ query?: string;
789
+ accountId?: string;
790
+ }, {
791
+ query?: string;
792
+ accountId?: string;
793
+ }>;
794
+ type GetIntegrationActionsInput = z.infer<typeof GetIntegrationActionsInputSchema>;
795
+ declare const GetIntegrationActionsResponseSchema: z.ZodObject<{
796
+ actions: z.ZodArray<z.ZodUnknown, "many">;
797
+ }, "strip", z.ZodTypeAny, {
798
+ actions?: unknown[];
799
+ }, {
800
+ actions?: unknown[];
801
+ }>;
802
+ type GetIntegrationActionsResponse = z.infer<typeof GetIntegrationActionsResponseSchema>;
803
+ declare const ExecuteIntegrationActionInputSchema: z.ZodObject<{
804
+ accountId: z.ZodString;
805
+ action: z.ZodString;
806
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
807
+ }, "strip", z.ZodTypeAny, {
808
+ accountId?: string;
809
+ action?: string;
810
+ parameters?: Record<string, unknown>;
811
+ }, {
812
+ accountId?: string;
813
+ action?: string;
814
+ parameters?: Record<string, unknown>;
815
+ }>;
816
+ type ExecuteIntegrationActionInput = z.infer<typeof ExecuteIntegrationActionInputSchema>;
817
+ declare const ExecuteIntegrationActionResponseSchema: z.ZodObject<{
818
+ result: z.ZodUnknown;
819
+ }, "strip", z.ZodTypeAny, {
820
+ result?: unknown;
821
+ }, {
822
+ result?: unknown;
823
+ }>;
824
+ type ExecuteIntegrationActionResponse = z.infer<typeof ExecuteIntegrationActionResponseSchema>;
825
+ declare const GetDocumentsInputSchema: z.ZodObject<{
826
+ page: z.ZodOptional<z.ZodNumber>;
827
+ limit: z.ZodOptional<z.ZodNumber>;
828
+ source: z.ZodOptional<z.ZodString>;
829
+ status: z.ZodOptional<z.ZodString>;
830
+ type: z.ZodOptional<z.ZodString>;
831
+ sessionId: z.ZodOptional<z.ZodString>;
832
+ label: z.ZodOptional<z.ZodString>;
833
+ cursor: z.ZodOptional<z.ZodString>;
834
+ }, "strip", z.ZodTypeAny, {
835
+ status?: string;
836
+ type?: string;
837
+ source?: string;
838
+ sessionId?: string;
839
+ limit?: number;
840
+ page?: number;
841
+ label?: string;
842
+ cursor?: string;
843
+ }, {
844
+ status?: string;
845
+ type?: string;
846
+ source?: string;
847
+ sessionId?: string;
848
+ limit?: number;
849
+ page?: number;
850
+ label?: string;
851
+ cursor?: string;
852
+ }>;
853
+ type GetDocumentsInput = z.infer<typeof GetDocumentsInputSchema>;
854
+ declare const DocumentSchema: z.ZodObject<{
855
+ id: z.ZodString;
856
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
857
+ createdAt: z.ZodOptional<z.ZodString>;
858
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
859
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
860
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
861
+ id: z.ZodString;
862
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
863
+ createdAt: z.ZodOptional<z.ZodString>;
864
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
865
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
866
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
867
+ id: z.ZodString;
868
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
869
+ createdAt: z.ZodOptional<z.ZodString>;
870
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
871
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
872
+ }, z.ZodTypeAny, "passthrough">>;
873
+ declare const GetDocumentsResponseSchema: z.ZodObject<{
874
+ documents: z.ZodArray<z.ZodObject<{
875
+ id: z.ZodString;
876
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
877
+ createdAt: z.ZodOptional<z.ZodString>;
878
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
879
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
880
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
881
+ id: z.ZodString;
882
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
883
+ createdAt: z.ZodOptional<z.ZodString>;
884
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
885
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
886
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
887
+ id: z.ZodString;
888
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
889
+ createdAt: z.ZodOptional<z.ZodString>;
890
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
891
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
892
+ }, z.ZodTypeAny, "passthrough">>, "many">;
893
+ page: z.ZodNumber;
894
+ limit: z.ZodNumber;
895
+ hasMore: z.ZodBoolean;
896
+ nextCursor: z.ZodNullable<z.ZodString>;
897
+ availableSources: z.ZodArray<z.ZodObject<{
898
+ name: z.ZodString;
899
+ slug: z.ZodString;
900
+ }, "strip", z.ZodTypeAny, {
901
+ name?: string;
902
+ slug?: string;
903
+ }, {
904
+ name?: string;
905
+ slug?: string;
906
+ }>, "many">;
907
+ totalCount: z.ZodNumber;
908
+ }, "strip", z.ZodTypeAny, {
909
+ limit?: number;
910
+ page?: number;
911
+ documents?: z.objectOutputType<{
912
+ id: z.ZodString;
913
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
914
+ createdAt: z.ZodOptional<z.ZodString>;
915
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
916
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
917
+ }, z.ZodTypeAny, "passthrough">[];
918
+ hasMore?: boolean;
919
+ nextCursor?: string;
920
+ availableSources?: {
921
+ name?: string;
922
+ slug?: string;
923
+ }[];
924
+ totalCount?: number;
925
+ }, {
926
+ limit?: number;
927
+ page?: number;
928
+ documents?: z.objectInputType<{
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">[];
935
+ hasMore?: boolean;
936
+ nextCursor?: string;
937
+ availableSources?: {
938
+ name?: string;
939
+ slug?: string;
940
+ }[];
941
+ totalCount?: number;
942
+ }>;
943
+ type GetDocumentsResponse = z.infer<typeof GetDocumentsResponseSchema>;
944
+ declare const GetDocumentInputSchema: z.ZodObject<{
945
+ documentId: z.ZodString;
946
+ }, "strip", z.ZodTypeAny, {
947
+ documentId?: string;
948
+ }, {
949
+ documentId?: string;
950
+ }>;
951
+ type GetDocumentInput = z.infer<typeof GetDocumentInputSchema>;
952
+ declare const GetDocumentResponseSchema: z.ZodObject<{
953
+ document: z.ZodNullable<z.ZodObject<{
954
+ id: z.ZodString;
955
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
956
+ createdAt: z.ZodOptional<z.ZodString>;
957
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
958
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
959
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
960
+ id: z.ZodString;
961
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
962
+ createdAt: z.ZodOptional<z.ZodString>;
963
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
964
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
965
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
966
+ id: z.ZodString;
967
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
968
+ createdAt: z.ZodOptional<z.ZodString>;
969
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
970
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
971
+ }, z.ZodTypeAny, "passthrough">>>;
972
+ }, "strip", z.ZodTypeAny, {
973
+ document?: {
974
+ source?: string;
975
+ sessionId?: string;
976
+ title?: string;
977
+ id?: string;
978
+ createdAt?: string;
979
+ } & {
980
+ [k: string]: unknown;
981
+ };
982
+ }, {
983
+ document?: {
984
+ source?: string;
985
+ sessionId?: string;
986
+ title?: string;
987
+ id?: string;
988
+ createdAt?: string;
989
+ } & {
990
+ [k: string]: unknown;
991
+ };
992
+ }>;
993
+ type GetDocumentResponse = z.infer<typeof GetDocumentResponseSchema>;
994
+ declare const GatewayAgentInfoSchema: z.ZodObject<{
995
+ id: z.ZodString;
996
+ name: z.ZodString;
997
+ description: z.ZodString;
998
+ tools: z.ZodArray<z.ZodString, "many">;
999
+ platform: z.ZodNullable<z.ZodString>;
1000
+ hostname: z.ZodNullable<z.ZodString>;
1001
+ status: z.ZodEnum<["CONNECTED", "DISCONNECTED"]>;
1002
+ }, "strip", z.ZodTypeAny, {
1003
+ tools?: string[];
1004
+ status?: "CONNECTED" | "DISCONNECTED";
1005
+ id?: string;
1006
+ name?: string;
1007
+ description?: string;
1008
+ platform?: string;
1009
+ hostname?: string;
1010
+ }, {
1011
+ tools?: string[];
1012
+ status?: "CONNECTED" | "DISCONNECTED";
1013
+ id?: string;
1014
+ name?: string;
1015
+ description?: string;
1016
+ platform?: string;
1017
+ hostname?: string;
1018
+ }>;
1019
+ type GatewayAgentInfo = z.infer<typeof GatewayAgentInfoSchema>;
1020
+ declare const GetGatewaysResponseSchema: z.ZodObject<{
1021
+ gateways: z.ZodArray<z.ZodObject<{
1022
+ id: z.ZodString;
1023
+ name: z.ZodString;
1024
+ description: z.ZodString;
1025
+ tools: z.ZodArray<z.ZodString, "many">;
1026
+ platform: z.ZodNullable<z.ZodString>;
1027
+ hostname: z.ZodNullable<z.ZodString>;
1028
+ status: z.ZodEnum<["CONNECTED", "DISCONNECTED"]>;
1029
+ }, "strip", z.ZodTypeAny, {
1030
+ tools?: string[];
1031
+ status?: "CONNECTED" | "DISCONNECTED";
1032
+ id?: string;
1033
+ name?: string;
1034
+ description?: string;
1035
+ platform?: string;
1036
+ hostname?: string;
1037
+ }, {
1038
+ tools?: string[];
1039
+ status?: "CONNECTED" | "DISCONNECTED";
1040
+ id?: string;
1041
+ name?: string;
1042
+ description?: string;
1043
+ platform?: string;
1044
+ hostname?: string;
1045
+ }>, "many">;
1046
+ }, "strip", z.ZodTypeAny, {
1047
+ gateways?: {
1048
+ tools?: string[];
1049
+ status?: "CONNECTED" | "DISCONNECTED";
1050
+ id?: string;
1051
+ name?: string;
1052
+ description?: string;
1053
+ platform?: string;
1054
+ hostname?: string;
1055
+ }[];
1056
+ }, {
1057
+ gateways?: {
1058
+ tools?: string[];
1059
+ status?: "CONNECTED" | "DISCONNECTED";
1060
+ id?: string;
1061
+ name?: string;
1062
+ description?: string;
1063
+ platform?: string;
1064
+ hostname?: string;
1065
+ }[];
1066
+ }>;
1067
+ type GetGatewaysResponse = z.infer<typeof GetGatewaysResponseSchema>;
1068
+ declare const ExecuteGatewayInputSchema: z.ZodObject<{
1069
+ gatewayId: z.ZodString;
1070
+ intent: z.ZodString;
1071
+ }, "strip", z.ZodTypeAny, {
1072
+ gatewayId?: string;
1073
+ intent?: string;
1074
+ }, {
1075
+ gatewayId?: string;
1076
+ intent?: string;
1077
+ }>;
1078
+ type ExecuteGatewayInput = z.infer<typeof ExecuteGatewayInputSchema>;
1079
+ declare const ExecuteGatewayToolInputSchema: z.ZodObject<{
1080
+ gatewayId: z.ZodString;
1081
+ toolName: z.ZodString;
1082
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1083
+ }, "strip", z.ZodTypeAny, {
1084
+ params?: Record<string, unknown>;
1085
+ gatewayId?: string;
1086
+ toolName?: string;
1087
+ }, {
1088
+ params?: Record<string, unknown>;
1089
+ gatewayId?: string;
1090
+ toolName?: string;
1091
+ }>;
1092
+ type ExecuteGatewayToolInput = z.infer<typeof ExecuteGatewayToolInputSchema>;
1093
+ declare const ExecuteGatewayResponseSchema: z.ZodObject<{
1094
+ result: z.ZodUnknown;
1095
+ }, "strip", z.ZodTypeAny, {
1096
+ result?: unknown;
1097
+ }, {
1098
+ result?: unknown;
1099
+ }>;
1100
+ type ExecuteGatewayResponse = z.infer<typeof ExecuteGatewayResponseSchema>;
1101
+ declare const AuthorizationCodeResponseSchema: z.ZodObject<{
1102
+ authorizationCode: z.ZodString;
1103
+ url: z.ZodString;
1104
+ }, "strip", z.ZodTypeAny, {
1105
+ authorizationCode?: string;
1106
+ url?: string;
1107
+ }, {
1108
+ authorizationCode?: string;
1109
+ url?: string;
1110
+ }>;
1111
+ type AuthorizationCodeResponse = z.infer<typeof AuthorizationCodeResponseSchema>;
1112
+ declare const TokenExchangeInputSchema: z.ZodObject<{
1113
+ authorizationCode: z.ZodString;
1114
+ }, "strip", z.ZodTypeAny, {
1115
+ authorizationCode?: string;
1116
+ }, {
1117
+ authorizationCode?: string;
1118
+ }>;
1119
+ type TokenExchangeInput = z.infer<typeof TokenExchangeInputSchema>;
1120
+ declare const TokenExchangeResponseSchema: z.ZodObject<{
1121
+ token: z.ZodNullable<z.ZodObject<{
1122
+ token: z.ZodString;
1123
+ obfuscatedToken: z.ZodString;
1124
+ }, "strip", z.ZodTypeAny, {
1125
+ token?: string;
1126
+ obfuscatedToken?: string;
1127
+ }, {
1128
+ token?: string;
1129
+ obfuscatedToken?: string;
1130
+ }>>;
1131
+ }, "strip", z.ZodTypeAny, {
1132
+ token?: {
1133
+ token?: string;
1134
+ obfuscatedToken?: string;
1135
+ };
1136
+ }, {
1137
+ token?: {
1138
+ token?: string;
1139
+ obfuscatedToken?: string;
1140
+ };
1141
+ }>;
1142
+ type TokenExchangeResponse = z.infer<typeof TokenExchangeResponseSchema>;
1143
+
1144
+ interface CoreClientOptions {
1145
+ baseUrl: string;
1146
+ token: string;
1147
+ }
1148
+ declare class CoreClientError extends Error {
1149
+ statusCode: number;
1150
+ constructor(message: string, statusCode: number);
1151
+ }
1152
+ declare class CoreClient {
1153
+ private baseUrl;
1154
+ private token;
1155
+ constructor(options: CoreClientOptions);
1156
+ private request;
1157
+ private requestPublic;
1158
+ me(): Promise<MeResponse>;
1159
+ ingest(body: IngestInput): Promise<IngestResponse>;
1160
+ search(body: SearchInput): Promise<SearchResponse>;
1161
+ getIntegrationsConnected(): Promise<GetIntegrationsConnectedResponse>;
1162
+ getIntegrationActions(params: GetIntegrationActionsInput): Promise<GetIntegrationActionsResponse>;
1163
+ executeIntegrationAction(params: ExecuteIntegrationActionInput): Promise<ExecuteIntegrationActionResponse>;
1164
+ getSessionId(): Promise<string>;
1165
+ getDocuments(params?: GetDocumentsInput): Promise<GetDocumentsResponse>;
1166
+ getDocument(params: GetDocumentInput): Promise<GetDocumentResponse>;
1167
+ getGateways(): Promise<GetGatewaysResponse>;
1168
+ executeGateway(params: ExecuteGatewayInput): Promise<ExecuteGatewayResponse>;
1169
+ executeGatewayTool(params: ExecuteGatewayToolInput): Promise<ExecuteGatewayResponse>;
1170
+ getAuthorizationCode(): Promise<AuthorizationCodeResponse>;
1171
+ exchangeToken(params: TokenExchangeInput): Promise<TokenExchangeResponse>;
1172
+ checkAuth(): Promise<MeResponse>;
1173
+ }
1174
+
1175
+ 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, 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, 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 UserConfirmationStatus, UserTypeEnum };