@redplanethq/sdk 0.1.9 → 0.1.11

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
@@ -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",
@@ -110,9 +111,15 @@ type EpisodicNodeWithoutEmbeddings = Omit<EpisodicNode, "contentEmbedding">;
110
111
  * Usage in Cypher: RETURN ${EPISODIC_NODE_PROPERTIES} as episode
111
112
  */
112
113
  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}";
114
+ 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 aspect: s.aspect,\n recallCount: s.recallCount,\n provenanceCount: s.provenanceCount\n}";
115
+ 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 attributes: ent.attributes\n}";
115
116
  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}";
117
+ /**
118
+ * Entity types for the knowledge graph (10 types)
119
+ * Only NAMED, SEARCHABLE entities - no generic vocabulary
120
+ */
121
+ declare const EntityTypes: readonly ["Person", "Organization", "Place", "Event", "Project", "Task", "Technology", "Product", "Standard", "Concept", "Predicate"];
122
+ type EntityType = (typeof EntityTypes)[number];
116
123
  /**
117
124
  * Interface for entity node in the reified knowledge graph
118
125
  * Entities represent subjects, objects, or predicates in statements
@@ -120,12 +127,31 @@ declare const COMPACTED_SESSION_NODE_PROPERTIES = "{\n uuid: cs.uuid,\n sessio
120
127
  interface EntityNode {
121
128
  uuid: string;
122
129
  name: string;
123
- type?: string;
130
+ type?: EntityType;
124
131
  nameEmbedding?: number[];
125
132
  attributes?: Record<string, any>;
126
133
  createdAt: Date;
127
134
  userId: string;
128
135
  }
136
+ /**
137
+ * Statement aspects for classification
138
+ * These are the types of knowledge a statement can represent
139
+ *
140
+ * Categories:
141
+ * 1. Identity - Who they are (slow-changing): role, location, affiliation
142
+ * 2. Knowledge - What they know: expertise, skills, understanding
143
+ * 3. Belief - Why they think that way: values, opinions, reasoning
144
+ * 4. Preference - How they want things: likes, dislikes, style choices
145
+ * 5. Action - What they do: observable behaviors, habits, practices
146
+ * 6. Goal - What they want to achieve: future targets, aims
147
+ * 7. Directive - Rules and automation: always do X, notify when Y, remind me to Z
148
+ * 8. Decision - Choices made, conclusions reached
149
+ * 9. Event - Specific occurrences with timestamps
150
+ * 10. Problem - Blockers, issues, challenges
151
+ * 11. Relationship - Connections between people
152
+ */
153
+ declare const StatementAspects: readonly ["Identity", "Knowledge", "Belief", "Preference", "Action", "Goal", "Directive", "Decision", "Event", "Problem", "Relationship"];
154
+ type StatementAspect = (typeof StatementAspects)[number];
129
155
  /**
130
156
  * Interface for statement node in the reified knowledge graph
131
157
  * Statements are first-class objects representing facts with temporal properties
@@ -141,6 +167,7 @@ interface StatementNode {
141
167
  attributes: Record<string, any>;
142
168
  userId: string;
143
169
  labelIds?: string[];
170
+ aspect?: StatementAspect | null;
144
171
  recallCount?: {
145
172
  low: number;
146
173
  high: number;
@@ -171,13 +198,15 @@ declare const EpisodeType: {
171
198
  type EpisodeType = (typeof EpisodeType)[keyof typeof EpisodeType];
172
199
  type AddEpisodeParams = {
173
200
  episodeBody: string;
201
+ originalEpisodeBody: string;
174
202
  referenceTime: Date;
175
203
  metadata?: Record<string, any>;
176
204
  source: string;
177
205
  userId: string;
206
+ userName?: string;
178
207
  labelIds?: string[];
179
208
  sessionId: string;
180
- queueId?: string;
209
+ queueId: string;
181
210
  type?: EpisodeType;
182
211
  chunkIndex?: number;
183
212
  totalChunks?: number;
@@ -185,6 +214,7 @@ type AddEpisodeParams = {
185
214
  contentHash?: string;
186
215
  previousVersionSessionId?: string;
187
216
  chunkHashes?: string[];
217
+ episodeUuid?: string;
188
218
  };
189
219
  type AddEpisodeResult = {
190
220
  episodeUuid: string | null;
@@ -213,6 +243,7 @@ interface ExtractedTripleData {
213
243
  target: string;
214
244
  targetType?: string;
215
245
  fact: string;
246
+ aspect?: StatementAspect | null;
216
247
  attributes?: Record<string, any>;
217
248
  }
218
249
  interface CompactedSessionNode {
@@ -231,6 +262,46 @@ interface CompactedSessionNode {
231
262
  compressionRatio?: number;
232
263
  metadata?: Record<string, any>;
233
264
  }
265
+ /**
266
+ * Interface for space node - a collection of related episodes
267
+ * Spaces help organize memory by topics, projects, or contexts
268
+ */
269
+ interface SpaceNode {
270
+ uuid: string;
271
+ name: string;
272
+ description: string;
273
+ userId: string;
274
+ createdAt: Date;
275
+ updatedAt: Date;
276
+ isActive: boolean;
277
+ contextCount?: number;
278
+ type?: string;
279
+ summaryStructure?: string;
280
+ }
281
+ /**
282
+ * Result type for space deletion operations
283
+ */
284
+ interface SpaceDeletionResult {
285
+ deleted: boolean;
286
+ statementsUpdated: number;
287
+ error?: string;
288
+ }
289
+ /**
290
+ * Result type for space assignment operations
291
+ */
292
+ interface SpaceAssignmentResult {
293
+ success: boolean;
294
+ statementsUpdated: number;
295
+ error?: string;
296
+ }
297
+ /**
298
+ * Adjacent episode chunks result
299
+ */
300
+ interface AdjacentChunks {
301
+ matchedChunk: EpisodicNode;
302
+ previousChunk?: EpisodicNode;
303
+ nextChunk?: EpisodicNode;
304
+ }
234
305
 
235
306
  declare enum ActionStatusEnum {
236
307
  ACCEPT = "ACCEPT",
@@ -462,6 +533,9 @@ interface StatementWithSource {
462
533
  score: number;
463
534
  entityMatches: number;
464
535
  };
536
+ episodeVector?: {
537
+ score: number;
538
+ };
465
539
  bfs?: {
466
540
  score: number;
467
541
  hopDistance: number;
@@ -476,7 +550,7 @@ interface StatementWithSource {
476
550
  rank: number;
477
551
  };
478
552
  };
479
- primarySource: "episodeGraph" | "bfs" | "vector" | "bm25";
553
+ primarySource: "episodeGraph" | "episodeVector" | "bfs" | "vector" | "bm25";
480
554
  }
481
555
  /**
482
556
  * Episode with provenance tracking from multiple sources
@@ -485,11 +559,13 @@ interface EpisodeWithProvenance {
485
559
  episode: EpisodicNode;
486
560
  statements: StatementWithSource[];
487
561
  episodeGraphScore: number;
562
+ episodeVectorScore: number;
488
563
  bfsScore: number;
489
564
  vectorScore: number;
490
565
  bm25Score: number;
491
566
  sourceBreakdown: {
492
567
  fromEpisodeGraph: number;
568
+ fromEpisodeVector: number;
493
569
  fromBFS: number;
494
570
  fromVector: number;
495
571
  fromBM25: number;
@@ -559,4 +635,423 @@ declare abstract class IntegrationCLI {
559
635
  getProgram(): Command;
560
636
  }
561
637
 
562
- export { APIKeyParams, ActionStatus, ActionStatusEnum, type AddEpisodeParams, type AddEpisodeResult, 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 SpacePattern, Spec, type StatementNode, type StatementWithSource, type Triple, type UserConfirmationStatus, UserTypeEnum };
638
+ declare const IngestInputSchema: z.ZodObject<{
639
+ episodeBody: z.ZodString;
640
+ referenceTime: z.ZodString;
641
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
642
+ source: z.ZodString;
643
+ labelIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
644
+ sessionId: z.ZodOptional<z.ZodString>;
645
+ type: z.ZodDefault<z.ZodEnum<["CONVERSATION", "DOCUMENT"]>>;
646
+ title: z.ZodOptional<z.ZodString>;
647
+ }, "strip", z.ZodTypeAny, {
648
+ episodeBody?: string;
649
+ referenceTime?: string;
650
+ type?: "CONVERSATION" | "DOCUMENT";
651
+ metadata?: Record<string, string | number | boolean>;
652
+ source?: string;
653
+ labelIds?: string[];
654
+ sessionId?: string;
655
+ title?: string;
656
+ }, {
657
+ episodeBody?: string;
658
+ referenceTime?: string;
659
+ type?: "CONVERSATION" | "DOCUMENT";
660
+ metadata?: Record<string, string | number | boolean>;
661
+ source?: string;
662
+ labelIds?: string[];
663
+ sessionId?: string;
664
+ title?: string;
665
+ }>;
666
+ type IngestInput = z.infer<typeof IngestInputSchema>;
667
+ declare const IngestResponseSchema: z.ZodObject<{
668
+ success: z.ZodBoolean;
669
+ id: z.ZodString;
670
+ }, "strip", z.ZodTypeAny, {
671
+ success?: boolean;
672
+ id?: string;
673
+ }, {
674
+ success?: boolean;
675
+ id?: string;
676
+ }>;
677
+ type IngestResponse = z.infer<typeof IngestResponseSchema>;
678
+ declare const SearchInputSchema: z.ZodObject<{
679
+ query: z.ZodString;
680
+ startTime: z.ZodOptional<z.ZodString>;
681
+ endTime: z.ZodOptional<z.ZodString>;
682
+ labelIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
683
+ limit: z.ZodOptional<z.ZodNumber>;
684
+ structured: z.ZodOptional<z.ZodBoolean>;
685
+ sortBy: z.ZodOptional<z.ZodEnum<["relevance", "recency"]>>;
686
+ }, "strip", z.ZodTypeAny, {
687
+ labelIds?: string[];
688
+ query?: string;
689
+ startTime?: string;
690
+ endTime?: string;
691
+ limit?: number;
692
+ structured?: boolean;
693
+ sortBy?: "relevance" | "recency";
694
+ }, {
695
+ labelIds?: string[];
696
+ query?: string;
697
+ startTime?: string;
698
+ endTime?: string;
699
+ limit?: number;
700
+ structured?: boolean;
701
+ sortBy?: "relevance" | "recency";
702
+ }>;
703
+ type SearchInput = z.infer<typeof SearchInputSchema>;
704
+ declare const SearchResponseSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
705
+ type SearchResponse = z.infer<typeof SearchResponseSchema>;
706
+ declare const MeResponseSchema: z.ZodObject<{
707
+ id: z.ZodString;
708
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
709
+ persona: z.ZodOptional<z.ZodNullable<z.ZodString>>;
710
+ workspaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
711
+ phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
712
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
713
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
714
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
715
+ }, "strip", z.ZodTypeAny, {
716
+ metadata?: Record<string, unknown>;
717
+ id?: string;
718
+ name?: string;
719
+ persona?: string;
720
+ workspaceId?: string;
721
+ phoneNumber?: string;
722
+ email?: string;
723
+ timezone?: string;
724
+ }, {
725
+ metadata?: Record<string, unknown>;
726
+ id?: string;
727
+ name?: string;
728
+ persona?: string;
729
+ workspaceId?: string;
730
+ phoneNumber?: string;
731
+ email?: string;
732
+ timezone?: string;
733
+ }>;
734
+ type MeResponse = z.infer<typeof MeResponseSchema>;
735
+ declare const IntegrationAccountSchema: z.ZodObject<{
736
+ id: z.ZodString;
737
+ name: z.ZodOptional<z.ZodString>;
738
+ slug: z.ZodOptional<z.ZodString>;
739
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
740
+ id: z.ZodString;
741
+ name: z.ZodOptional<z.ZodString>;
742
+ slug: z.ZodOptional<z.ZodString>;
743
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
744
+ id: z.ZodString;
745
+ name: z.ZodOptional<z.ZodString>;
746
+ slug: z.ZodOptional<z.ZodString>;
747
+ }, z.ZodTypeAny, "passthrough">>;
748
+ declare const GetIntegrationsConnectedResponseSchema: z.ZodObject<{
749
+ accounts: z.ZodArray<z.ZodObject<{
750
+ id: z.ZodString;
751
+ name: z.ZodOptional<z.ZodString>;
752
+ slug: z.ZodOptional<z.ZodString>;
753
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
754
+ id: z.ZodString;
755
+ name: z.ZodOptional<z.ZodString>;
756
+ slug: z.ZodOptional<z.ZodString>;
757
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
758
+ id: z.ZodString;
759
+ name: z.ZodOptional<z.ZodString>;
760
+ slug: z.ZodOptional<z.ZodString>;
761
+ }, z.ZodTypeAny, "passthrough">>, "many">;
762
+ }, "strip", z.ZodTypeAny, {
763
+ accounts?: z.objectOutputType<{
764
+ id: z.ZodString;
765
+ name: z.ZodOptional<z.ZodString>;
766
+ slug: z.ZodOptional<z.ZodString>;
767
+ }, z.ZodTypeAny, "passthrough">[];
768
+ }, {
769
+ accounts?: z.objectInputType<{
770
+ id: z.ZodString;
771
+ name: z.ZodOptional<z.ZodString>;
772
+ slug: z.ZodOptional<z.ZodString>;
773
+ }, z.ZodTypeAny, "passthrough">[];
774
+ }>;
775
+ type GetIntegrationsConnectedResponse = z.infer<typeof GetIntegrationsConnectedResponseSchema>;
776
+ declare const GetIntegrationActionsInputSchema: z.ZodObject<{
777
+ accountId: z.ZodString;
778
+ query: z.ZodOptional<z.ZodString>;
779
+ }, "strip", z.ZodTypeAny, {
780
+ query?: string;
781
+ accountId?: string;
782
+ }, {
783
+ query?: string;
784
+ accountId?: string;
785
+ }>;
786
+ type GetIntegrationActionsInput = z.infer<typeof GetIntegrationActionsInputSchema>;
787
+ declare const GetIntegrationActionsResponseSchema: z.ZodObject<{
788
+ actions: z.ZodArray<z.ZodUnknown, "many">;
789
+ }, "strip", z.ZodTypeAny, {
790
+ actions?: unknown[];
791
+ }, {
792
+ actions?: unknown[];
793
+ }>;
794
+ type GetIntegrationActionsResponse = z.infer<typeof GetIntegrationActionsResponseSchema>;
795
+ declare const ExecuteIntegrationActionInputSchema: z.ZodObject<{
796
+ accountId: z.ZodString;
797
+ action: z.ZodString;
798
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
799
+ }, "strip", z.ZodTypeAny, {
800
+ accountId?: string;
801
+ action?: string;
802
+ parameters?: Record<string, unknown>;
803
+ }, {
804
+ accountId?: string;
805
+ action?: string;
806
+ parameters?: Record<string, unknown>;
807
+ }>;
808
+ type ExecuteIntegrationActionInput = z.infer<typeof ExecuteIntegrationActionInputSchema>;
809
+ declare const ExecuteIntegrationActionResponseSchema: z.ZodObject<{
810
+ result: z.ZodUnknown;
811
+ }, "strip", z.ZodTypeAny, {
812
+ result?: unknown;
813
+ }, {
814
+ result?: unknown;
815
+ }>;
816
+ type ExecuteIntegrationActionResponse = z.infer<typeof ExecuteIntegrationActionResponseSchema>;
817
+ declare const GetDocumentsInputSchema: z.ZodObject<{
818
+ page: z.ZodOptional<z.ZodNumber>;
819
+ limit: z.ZodOptional<z.ZodNumber>;
820
+ source: z.ZodOptional<z.ZodString>;
821
+ status: z.ZodOptional<z.ZodString>;
822
+ type: z.ZodOptional<z.ZodString>;
823
+ sessionId: z.ZodOptional<z.ZodString>;
824
+ label: z.ZodOptional<z.ZodString>;
825
+ cursor: z.ZodOptional<z.ZodString>;
826
+ }, "strip", z.ZodTypeAny, {
827
+ status?: string;
828
+ type?: string;
829
+ source?: string;
830
+ sessionId?: string;
831
+ limit?: number;
832
+ page?: number;
833
+ label?: string;
834
+ cursor?: string;
835
+ }, {
836
+ status?: string;
837
+ type?: string;
838
+ source?: string;
839
+ sessionId?: string;
840
+ limit?: number;
841
+ page?: number;
842
+ label?: string;
843
+ cursor?: string;
844
+ }>;
845
+ type GetDocumentsInput = z.infer<typeof GetDocumentsInputSchema>;
846
+ declare const DocumentSchema: z.ZodObject<{
847
+ id: z.ZodString;
848
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
849
+ createdAt: z.ZodOptional<z.ZodString>;
850
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
851
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
852
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
853
+ id: z.ZodString;
854
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
855
+ createdAt: z.ZodOptional<z.ZodString>;
856
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
857
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
858
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
859
+ id: z.ZodString;
860
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
861
+ createdAt: z.ZodOptional<z.ZodString>;
862
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
863
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
864
+ }, z.ZodTypeAny, "passthrough">>;
865
+ declare const GetDocumentsResponseSchema: z.ZodObject<{
866
+ documents: z.ZodArray<z.ZodObject<{
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
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
873
+ id: z.ZodString;
874
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
875
+ createdAt: z.ZodOptional<z.ZodString>;
876
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
877
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
878
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
879
+ id: z.ZodString;
880
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
881
+ createdAt: z.ZodOptional<z.ZodString>;
882
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
883
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
884
+ }, z.ZodTypeAny, "passthrough">>, "many">;
885
+ page: z.ZodNumber;
886
+ limit: z.ZodNumber;
887
+ hasMore: z.ZodBoolean;
888
+ nextCursor: z.ZodNullable<z.ZodString>;
889
+ availableSources: z.ZodArray<z.ZodObject<{
890
+ name: z.ZodString;
891
+ slug: z.ZodString;
892
+ }, "strip", z.ZodTypeAny, {
893
+ name?: string;
894
+ slug?: string;
895
+ }, {
896
+ name?: string;
897
+ slug?: string;
898
+ }>, "many">;
899
+ totalCount: z.ZodNumber;
900
+ }, "strip", z.ZodTypeAny, {
901
+ limit?: number;
902
+ page?: number;
903
+ documents?: z.objectOutputType<{
904
+ id: z.ZodString;
905
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
906
+ createdAt: z.ZodOptional<z.ZodString>;
907
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
908
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
909
+ }, z.ZodTypeAny, "passthrough">[];
910
+ hasMore?: boolean;
911
+ nextCursor?: string;
912
+ availableSources?: {
913
+ name?: string;
914
+ slug?: string;
915
+ }[];
916
+ totalCount?: number;
917
+ }, {
918
+ limit?: number;
919
+ page?: number;
920
+ documents?: z.objectInputType<{
921
+ id: z.ZodString;
922
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
923
+ createdAt: z.ZodOptional<z.ZodString>;
924
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
925
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
926
+ }, z.ZodTypeAny, "passthrough">[];
927
+ hasMore?: boolean;
928
+ nextCursor?: string;
929
+ availableSources?: {
930
+ name?: string;
931
+ slug?: string;
932
+ }[];
933
+ totalCount?: number;
934
+ }>;
935
+ type GetDocumentsResponse = z.infer<typeof GetDocumentsResponseSchema>;
936
+ declare const GetDocumentInputSchema: z.ZodObject<{
937
+ documentId: z.ZodString;
938
+ }, "strip", z.ZodTypeAny, {
939
+ documentId?: string;
940
+ }, {
941
+ documentId?: string;
942
+ }>;
943
+ type GetDocumentInput = z.infer<typeof GetDocumentInputSchema>;
944
+ declare const GetDocumentResponseSchema: z.ZodObject<{
945
+ document: z.ZodNullable<z.ZodObject<{
946
+ id: z.ZodString;
947
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
948
+ createdAt: z.ZodOptional<z.ZodString>;
949
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
950
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
951
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
952
+ id: z.ZodString;
953
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
954
+ createdAt: z.ZodOptional<z.ZodString>;
955
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
956
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
957
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
958
+ id: z.ZodString;
959
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
960
+ createdAt: z.ZodOptional<z.ZodString>;
961
+ sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
962
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
963
+ }, z.ZodTypeAny, "passthrough">>>;
964
+ }, "strip", z.ZodTypeAny, {
965
+ document?: {
966
+ source?: string;
967
+ sessionId?: string;
968
+ title?: string;
969
+ id?: string;
970
+ createdAt?: string;
971
+ } & {
972
+ [k: string]: unknown;
973
+ };
974
+ }, {
975
+ document?: {
976
+ source?: string;
977
+ sessionId?: string;
978
+ title?: string;
979
+ id?: string;
980
+ createdAt?: string;
981
+ } & {
982
+ [k: string]: unknown;
983
+ };
984
+ }>;
985
+ type GetDocumentResponse = z.infer<typeof GetDocumentResponseSchema>;
986
+ declare const AuthorizationCodeResponseSchema: z.ZodObject<{
987
+ authorizationCode: z.ZodString;
988
+ url: z.ZodString;
989
+ }, "strip", z.ZodTypeAny, {
990
+ authorizationCode?: string;
991
+ url?: string;
992
+ }, {
993
+ authorizationCode?: string;
994
+ url?: string;
995
+ }>;
996
+ type AuthorizationCodeResponse = z.infer<typeof AuthorizationCodeResponseSchema>;
997
+ declare const TokenExchangeInputSchema: z.ZodObject<{
998
+ authorizationCode: z.ZodString;
999
+ }, "strip", z.ZodTypeAny, {
1000
+ authorizationCode?: string;
1001
+ }, {
1002
+ authorizationCode?: string;
1003
+ }>;
1004
+ type TokenExchangeInput = z.infer<typeof TokenExchangeInputSchema>;
1005
+ declare const TokenExchangeResponseSchema: z.ZodObject<{
1006
+ token: z.ZodNullable<z.ZodObject<{
1007
+ token: z.ZodString;
1008
+ obfuscatedToken: z.ZodString;
1009
+ }, "strip", z.ZodTypeAny, {
1010
+ token?: string;
1011
+ obfuscatedToken?: string;
1012
+ }, {
1013
+ token?: string;
1014
+ obfuscatedToken?: string;
1015
+ }>>;
1016
+ }, "strip", z.ZodTypeAny, {
1017
+ token?: {
1018
+ token?: string;
1019
+ obfuscatedToken?: string;
1020
+ };
1021
+ }, {
1022
+ token?: {
1023
+ token?: string;
1024
+ obfuscatedToken?: string;
1025
+ };
1026
+ }>;
1027
+ type TokenExchangeResponse = z.infer<typeof TokenExchangeResponseSchema>;
1028
+
1029
+ interface CoreClientOptions {
1030
+ baseUrl: string;
1031
+ token: string;
1032
+ }
1033
+ declare class CoreClientError extends Error {
1034
+ statusCode: number;
1035
+ constructor(message: string, statusCode: number);
1036
+ }
1037
+ declare class CoreClient {
1038
+ private baseUrl;
1039
+ private token;
1040
+ constructor(options: CoreClientOptions);
1041
+ private request;
1042
+ private requestPublic;
1043
+ me(): Promise<MeResponse>;
1044
+ ingest(body: IngestInput): Promise<IngestResponse>;
1045
+ search(body: SearchInput): Promise<SearchResponse>;
1046
+ getIntegrationsConnected(): Promise<GetIntegrationsConnectedResponse>;
1047
+ getIntegrationActions(params: GetIntegrationActionsInput): Promise<GetIntegrationActionsResponse>;
1048
+ executeIntegrationAction(params: ExecuteIntegrationActionInput): Promise<ExecuteIntegrationActionResponse>;
1049
+ getSessionId(): Promise<string>;
1050
+ getDocuments(params?: GetDocumentsInput): Promise<GetDocumentsResponse>;
1051
+ getDocument(params: GetDocumentInput): Promise<GetDocumentResponse>;
1052
+ getAuthorizationCode(): Promise<AuthorizationCodeResponse>;
1053
+ exchangeToken(params: TokenExchangeInput): Promise<TokenExchangeResponse>;
1054
+ checkAuth(): Promise<MeResponse>;
1055
+ }
1056
+
1057
+ 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 ExecuteIntegrationActionInput, ExecuteIntegrationActionInputSchema, type ExecuteIntegrationActionResponse, ExecuteIntegrationActionResponseSchema, type ExplicitPatternType, type ExtractedTripleData, GeminiModels, type GetDocumentInput, GetDocumentInputSchema, type GetDocumentResponse, GetDocumentResponseSchema, type GetDocumentsInput, GetDocumentsInputSchema, type GetDocumentsResponse, GetDocumentsResponseSchema, 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, type MeResponse, MeResponseSchema, type Message, type MessageType, OAuth2Params, OpenAIModels, PATTERN_TYPES, 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 };