aparavi-client 1.0.2

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 (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +523 -0
  3. package/dist/aparavi-client-typescript-1.0.0.tgz +0 -0
  4. package/dist/aparavi-client-typescript-1.0.1.tgz +0 -0
  5. package/dist/cjs/client.js +1002 -0
  6. package/dist/cjs/client.js.map +1 -0
  7. package/dist/cjs/constants.js +37 -0
  8. package/dist/cjs/constants.js.map +1 -0
  9. package/dist/cjs/core/DAPBase.js +313 -0
  10. package/dist/cjs/core/DAPBase.js.map +1 -0
  11. package/dist/cjs/core/DAPClient.js +173 -0
  12. package/dist/cjs/core/DAPClient.js.map +1 -0
  13. package/dist/cjs/core/TransportBase.js +131 -0
  14. package/dist/cjs/core/TransportBase.js.map +1 -0
  15. package/dist/cjs/core/TransportWebSocket.js +492 -0
  16. package/dist/cjs/core/TransportWebSocket.js.map +1 -0
  17. package/dist/cjs/exceptions/index.js +109 -0
  18. package/dist/cjs/exceptions/index.js.map +1 -0
  19. package/dist/cjs/index.js +56 -0
  20. package/dist/cjs/index.js.map +1 -0
  21. package/dist/cjs/package.json +3 -0
  22. package/dist/cjs/schema/Doc.js +79 -0
  23. package/dist/cjs/schema/Doc.js.map +1 -0
  24. package/dist/cjs/schema/DocFilter.js +133 -0
  25. package/dist/cjs/schema/DocFilter.js.map +1 -0
  26. package/dist/cjs/schema/DocGroup.js +235 -0
  27. package/dist/cjs/schema/DocGroup.js.map +1 -0
  28. package/dist/cjs/schema/DocMetadata.js +57 -0
  29. package/dist/cjs/schema/DocMetadata.js.map +1 -0
  30. package/dist/cjs/schema/Question.js +414 -0
  31. package/dist/cjs/schema/Question.js.map +1 -0
  32. package/dist/cjs/schema/index.js +50 -0
  33. package/dist/cjs/schema/index.js.map +1 -0
  34. package/dist/cjs/types/client.js +26 -0
  35. package/dist/cjs/types/client.js.map +1 -0
  36. package/dist/cjs/types/data.js +26 -0
  37. package/dist/cjs/types/data.js.map +1 -0
  38. package/dist/cjs/types/events.js +119 -0
  39. package/dist/cjs/types/events.js.map +1 -0
  40. package/dist/cjs/types/index.js +50 -0
  41. package/dist/cjs/types/index.js.map +1 -0
  42. package/dist/cjs/types/pipeline.js +26 -0
  43. package/dist/cjs/types/pipeline.js.map +1 -0
  44. package/dist/cjs/types/task.js +115 -0
  45. package/dist/cjs/types/task.js.map +1 -0
  46. package/dist/cli/cli/aparavi.js +1401 -0
  47. package/dist/cli/cli/aparavi.js.map +1 -0
  48. package/dist/cli/src/client.js +1002 -0
  49. package/dist/cli/src/client.js.map +1 -0
  50. package/dist/cli/src/constants.js +37 -0
  51. package/dist/cli/src/constants.js.map +1 -0
  52. package/dist/cli/src/core/DAPBase.js +313 -0
  53. package/dist/cli/src/core/DAPBase.js.map +1 -0
  54. package/dist/cli/src/core/DAPClient.js +173 -0
  55. package/dist/cli/src/core/DAPClient.js.map +1 -0
  56. package/dist/cli/src/core/TransportBase.js +131 -0
  57. package/dist/cli/src/core/TransportBase.js.map +1 -0
  58. package/dist/cli/src/core/TransportWebSocket.js +492 -0
  59. package/dist/cli/src/core/TransportWebSocket.js.map +1 -0
  60. package/dist/cli/src/exceptions/index.js +109 -0
  61. package/dist/cli/src/exceptions/index.js.map +1 -0
  62. package/dist/cli/src/index.js +56 -0
  63. package/dist/cli/src/index.js.map +1 -0
  64. package/dist/cli/src/schema/Doc.js +79 -0
  65. package/dist/cli/src/schema/Doc.js.map +1 -0
  66. package/dist/cli/src/schema/DocFilter.js +133 -0
  67. package/dist/cli/src/schema/DocFilter.js.map +1 -0
  68. package/dist/cli/src/schema/DocGroup.js +235 -0
  69. package/dist/cli/src/schema/DocGroup.js.map +1 -0
  70. package/dist/cli/src/schema/DocMetadata.js +57 -0
  71. package/dist/cli/src/schema/DocMetadata.js.map +1 -0
  72. package/dist/cli/src/schema/Question.js +414 -0
  73. package/dist/cli/src/schema/Question.js.map +1 -0
  74. package/dist/cli/src/schema/index.js +50 -0
  75. package/dist/cli/src/schema/index.js.map +1 -0
  76. package/dist/cli/src/types/client.js +26 -0
  77. package/dist/cli/src/types/client.js.map +1 -0
  78. package/dist/cli/src/types/data.js +26 -0
  79. package/dist/cli/src/types/data.js.map +1 -0
  80. package/dist/cli/src/types/events.js +119 -0
  81. package/dist/cli/src/types/events.js.map +1 -0
  82. package/dist/cli/src/types/index.js +50 -0
  83. package/dist/cli/src/types/index.js.map +1 -0
  84. package/dist/cli/src/types/pipeline.js +26 -0
  85. package/dist/cli/src/types/pipeline.js.map +1 -0
  86. package/dist/cli/src/types/task.js +115 -0
  87. package/dist/cli/src/types/task.js.map +1 -0
  88. package/dist/esm/client.js +997 -0
  89. package/dist/esm/client.js.map +1 -0
  90. package/dist/esm/constants.js +34 -0
  91. package/dist/esm/constants.js.map +1 -0
  92. package/dist/esm/core/DAPBase.js +309 -0
  93. package/dist/esm/core/DAPBase.js.map +1 -0
  94. package/dist/esm/core/DAPClient.js +169 -0
  95. package/dist/esm/core/DAPClient.js.map +1 -0
  96. package/dist/esm/core/TransportBase.js +127 -0
  97. package/dist/esm/core/TransportBase.js.map +1 -0
  98. package/dist/esm/core/TransportWebSocket.js +488 -0
  99. package/dist/esm/core/TransportWebSocket.js.map +1 -0
  100. package/dist/esm/exceptions/index.js +100 -0
  101. package/dist/esm/exceptions/index.js.map +1 -0
  102. package/dist/esm/index.js +40 -0
  103. package/dist/esm/index.js.map +1 -0
  104. package/dist/esm/package.json +3 -0
  105. package/dist/esm/schema/Doc.js +75 -0
  106. package/dist/esm/schema/Doc.js.map +1 -0
  107. package/dist/esm/schema/DocFilter.js +129 -0
  108. package/dist/esm/schema/DocFilter.js.map +1 -0
  109. package/dist/esm/schema/DocGroup.js +231 -0
  110. package/dist/esm/schema/DocGroup.js.map +1 -0
  111. package/dist/esm/schema/DocMetadata.js +53 -0
  112. package/dist/esm/schema/DocMetadata.js.map +1 -0
  113. package/dist/esm/schema/Question.js +409 -0
  114. package/dist/esm/schema/Question.js.map +1 -0
  115. package/dist/esm/schema/index.js +34 -0
  116. package/dist/esm/schema/index.js.map +1 -0
  117. package/dist/esm/types/client.js +25 -0
  118. package/dist/esm/types/client.js.map +1 -0
  119. package/dist/esm/types/data.js +25 -0
  120. package/dist/esm/types/data.js.map +1 -0
  121. package/dist/esm/types/events.js +116 -0
  122. package/dist/esm/types/events.js.map +1 -0
  123. package/dist/esm/types/index.js +34 -0
  124. package/dist/esm/types/index.js.map +1 -0
  125. package/dist/esm/types/pipeline.js +25 -0
  126. package/dist/esm/types/pipeline.js.map +1 -0
  127. package/dist/esm/types/task.js +112 -0
  128. package/dist/esm/types/task.js.map +1 -0
  129. package/dist/types/client.d.ts +395 -0
  130. package/dist/types/client.d.ts.map +1 -0
  131. package/dist/types/constants.d.ts +34 -0
  132. package/dist/types/constants.d.ts.map +1 -0
  133. package/dist/types/core/DAPBase.d.ts +140 -0
  134. package/dist/types/core/DAPBase.d.ts.map +1 -0
  135. package/dist/types/core/DAPClient.d.ts +83 -0
  136. package/dist/types/core/DAPClient.d.ts.map +1 -0
  137. package/dist/types/core/TransportBase.d.ts +94 -0
  138. package/dist/types/core/TransportBase.d.ts.map +1 -0
  139. package/dist/types/core/TransportWebSocket.d.ts +78 -0
  140. package/dist/types/core/TransportWebSocket.d.ts.map +1 -0
  141. package/dist/types/exceptions/index.d.ts +81 -0
  142. package/dist/types/exceptions/index.d.ts.map +1 -0
  143. package/dist/types/index.d.ts +36 -0
  144. package/dist/types/index.d.ts.map +1 -0
  145. package/dist/types/schema/Doc.d.ts +69 -0
  146. package/dist/types/schema/Doc.d.ts.map +1 -0
  147. package/dist/types/schema/DocFilter.d.ts +101 -0
  148. package/dist/types/schema/DocFilter.d.ts.map +1 -0
  149. package/dist/types/schema/DocGroup.d.ts +113 -0
  150. package/dist/types/schema/DocGroup.d.ts.map +1 -0
  151. package/dist/types/schema/DocMetadata.d.ts +61 -0
  152. package/dist/types/schema/DocMetadata.d.ts.map +1 -0
  153. package/dist/types/schema/Question.d.ts +163 -0
  154. package/dist/types/schema/Question.d.ts.map +1 -0
  155. package/dist/types/schema/index.d.ts +34 -0
  156. package/dist/types/schema/index.d.ts.map +1 -0
  157. package/dist/types/types/client.d.ts +140 -0
  158. package/dist/types/types/client.d.ts.map +1 -0
  159. package/dist/types/types/data.d.ts +95 -0
  160. package/dist/types/types/data.d.ts.map +1 -0
  161. package/dist/types/types/events.d.ts +246 -0
  162. package/dist/types/types/events.d.ts.map +1 -0
  163. package/dist/types/types/index.d.ts +34 -0
  164. package/dist/types/types/index.d.ts.map +1 -0
  165. package/dist/types/types/pipeline.d.ts +61 -0
  166. package/dist/types/types/pipeline.d.ts.map +1 -0
  167. package/dist/types/types/task.d.ts +265 -0
  168. package/dist/types/types/task.d.ts.map +1 -0
  169. package/package.json +75 -0
@@ -0,0 +1,101 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ /**
25
+ * Controls how Aparavi searches, processes, and returns documents in your queries.
26
+ *
27
+ * Use DocFilter to customize search behavior, pagination, content grouping,
28
+ * and AI processing options. This gives you fine-grained control over what
29
+ * documents are returned and how they're processed.
30
+ */
31
+ export interface DocFilter {
32
+ /** Combine all chunks from the same table into one result. Useful when you need complete table data rather than individual rows. */
33
+ fullTables?: boolean;
34
+ /** Combine all chunks from the same document into one result. Use this when you need complete document content rather than fragments. */
35
+ fullDocuments?: boolean;
36
+ /** Skip this many results for pagination. Use with limit to page through large result sets. */
37
+ offset?: number;
38
+ /** Maximum number of results to return. Higher numbers give more comprehensive results but slower performance. */
39
+ limit?: number;
40
+ /** Only return chunks with ID >= this value. Used for filtering specific document sections. */
41
+ minChunkId?: number;
42
+ /** Only return chunks with ID <= this value. Used for filtering specific document sections. */
43
+ maxChunkId?: number;
44
+ /** Filter results to documents from a specific Aparavi node/server. Useful in multi-node deployments. */
45
+ nodeId?: string;
46
+ /** Filter to documents from a specific parent file or folder path. */
47
+ parent?: string;
48
+ /** Filter to documents with names matching this pattern. */
49
+ name?: string;
50
+ /** Only return documents the user has these permission levels for. Respects access controls. */
51
+ permissions?: number[];
52
+ /** Include (true) or exclude (false) deleted documents. undefined includes both. */
53
+ isDeleted?: boolean;
54
+ /** Only return documents with these specific object IDs. Useful for targeted queries. */
55
+ objectIds?: string[];
56
+ /** Only return these specific document chunks by ID. */
57
+ chunkIds?: number[];
58
+ /** Filter to only table data (true) or exclude tables (false). undefined includes both. */
59
+ isTable?: boolean;
60
+ /** Only return data from these specific table IDs. */
61
+ tableIds?: number[];
62
+ /** Use AI to rerank results for better relevance. Improves quality but adds processing time. */
63
+ useQuickRank?: boolean;
64
+ /** Use AI to rank groups of related documents. Useful for finding the best document among similar ones. */
65
+ useGroupRank?: boolean;
66
+ /** Number of follow-up questions to generate for AI chat. Helps users explore topics further. */
67
+ followUpQuestions?: number;
68
+ /** Include additional context information with search results. Useful for understanding document relationships. */
69
+ context?: boolean;
70
+ }
71
+ export declare class DocFilterHelper {
72
+ /**
73
+ * Create a default DocFilter with sensible defaults.
74
+ */
75
+ static createDefault(): DocFilter;
76
+ /**
77
+ * Create a DocFilter for paginated table results.
78
+ */
79
+ static forTables(limit?: number, offset?: number): DocFilter;
80
+ /**
81
+ * Create a DocFilter for complete documents.
82
+ */
83
+ static forFullDocuments(limit?: number): DocFilter;
84
+ /**
85
+ * Create a DocFilter with AI enhancements enabled.
86
+ */
87
+ static withAIEnhancements(): DocFilter;
88
+ /**
89
+ * Validate that a DocFilter has reasonable values.
90
+ */
91
+ static validate(filter: DocFilter): string[];
92
+ /**
93
+ * Convert DocFilter to dictionary for serialization.
94
+ */
95
+ static toDict(filter: DocFilter): Record<string, any>;
96
+ /**
97
+ * Create DocFilter from dictionary.
98
+ */
99
+ static fromDict(data: Record<string, any>): DocFilter;
100
+ }
101
+ //# sourceMappingURL=DocFilter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocFilter.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/schema/DocFilter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACzB,oIAAoI;IACpI,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,yIAAyI;IACzI,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,+FAA+F;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kHAAkH;IAClH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,yGAAyG;IACzG,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4DAA4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aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { Doc } from './Doc';
25
+ /**
26
+ * Groups related document chunks that come from the same source file.
27
+ *
28
+ * When you search Aparavi and multiple chunks are found from the same document,
29
+ * they can be organized into DocGroups for easier processing. This helps you
30
+ * understand which content comes from which files and work with complete documents
31
+ * rather than scattered fragments.
32
+ */
33
+ export interface DocGroup {
34
+ /** Overall relevance score for this entire document/file. Higher scores indicate the file is more relevant to your query. */
35
+ score: number;
36
+ /** Unique identifier for this document object in the Aparavi system. */
37
+ objectId: string;
38
+ /** File path or name of the source document. This is typically the filename you would recognize. */
39
+ parent: string;
40
+ /** List of all document chunks from this file that matched your query. */
41
+ documents: Doc[];
42
+ }
43
+ export declare class DocGroupHelper {
44
+ /**
45
+ * Create a readable string representation showing the filename and relevance score.
46
+ */
47
+ static toString(group: DocGroup): string;
48
+ /**
49
+ * Create a new DocGroup.
50
+ */
51
+ static create(objectId: string, parent: string, documents?: Doc[], score?: number): DocGroup;
52
+ /**
53
+ * Add a document to the group and update the score.
54
+ */
55
+ static addDocument(group: DocGroup, doc: Doc): DocGroup;
56
+ /**
57
+ * Get the total content from all documents in the group.
58
+ */
59
+ static getFullContent(group: DocGroup): string;
60
+ /**
61
+ * Get the highest scoring document in the group.
62
+ */
63
+ static getBestDocument(group: DocGroup): Doc | undefined;
64
+ /**
65
+ * Sort documents in the group by score (highest first) or chunk ID.
66
+ */
67
+ static sortDocuments(group: DocGroup, sortBy?: 'score' | 'chunkId'): DocGroup;
68
+ /**
69
+ * Filter documents in the group by score threshold.
70
+ */
71
+ static filterByScore(group: DocGroup, minScore: number): DocGroup;
72
+ /**
73
+ * Get document count in the group.
74
+ */
75
+ static getDocumentCount(group: DocGroup): number;
76
+ /**
77
+ * Get total tokens count for all documents in the group.
78
+ */
79
+ static getTotalTokens(group: DocGroup): number;
80
+ /**
81
+ * Get average score of documents in the group.
82
+ */
83
+ static getAverageScore(group: DocGroup): number;
84
+ /**
85
+ * Check if group contains table data.
86
+ */
87
+ static hasTableData(group: DocGroup): boolean;
88
+ /**
89
+ * Get only table documents from the group.
90
+ */
91
+ static getTableDocuments(group: DocGroup): Doc[];
92
+ /**
93
+ * Get only text documents from the group.
94
+ */
95
+ static getTextDocuments(group: DocGroup): Doc[];
96
+ /**
97
+ * Convert DocGroup to dictionary for serialization.
98
+ */
99
+ static toDict(group: DocGroup): Record<string, any>;
100
+ /**
101
+ * Create DocGroup from dictionary.
102
+ */
103
+ static fromDict(data: Record<string, any>): DocGroup;
104
+ /**
105
+ * Merge multiple DocGroups from the same source document.
106
+ */
107
+ static merge(groups: DocGroup[]): DocGroup | undefined;
108
+ /**
109
+ * Split a DocGroup into smaller groups by chunk ranges.
110
+ */
111
+ static splitByChunkRange(group: DocGroup, chunkSize: number): DocGroup[];
112
+ }
113
+ //# sourceMappingURL=DocGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {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,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAI9C;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAS/C;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;IAI7C;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG,EAAE;IAIhD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,GAAG,EAAE;IAI/C;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAenD;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,QAAQ;IAepD;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,GAAG,SAAS;IA+BtD;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE;CAsBxE"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ /**
25
+ * Contains information about where a document chunk came from and its properties.
26
+ *
27
+ * Every document returned from Aparavi operations includes metadata that tells you
28
+ * about the source file, the chunk's position within that file, permissions,
29
+ * and whether it's table data or regular text.
30
+ */
31
+ export interface DocMetadata {
32
+ /** Unique identifier for the source document in the Aparavi system. */
33
+ objectId: string;
34
+ /** Position of this chunk within the document (0, 1, 2, etc.). */
35
+ chunkId: number;
36
+ /** Identifier of the Aparavi node/server where this document is stored. */
37
+ nodeId?: string;
38
+ /** File path or name of the source document. This is what you would see in a file browser. */
39
+ parent?: string;
40
+ /** Permission level identifier that controls who can access this document. */
41
+ permissionId?: number;
42
+ /** True if the source document has been deleted but is still in search results. */
43
+ isDeleted?: boolean;
44
+ /** True if this chunk contains structured table data, False for regular text content. */
45
+ isTable?: boolean;
46
+ /** If isTable is True, this identifies which table within the document this data came from. */
47
+ tableId?: number;
48
+ /** Allow additional fields for extensibility */
49
+ [key: string]: any;
50
+ }
51
+ export declare class DocMetadataHelper {
52
+ /**
53
+ * Convert metadata to a dictionary for serialization or storage.
54
+ */
55
+ static toDict(metadata: DocMetadata): Record<string, any>;
56
+ /**
57
+ * Create default metadata for a document processing instance.
58
+ */
59
+ static defaultMetadata(pInstance: any): DocMetadata;
60
+ }
61
+ //# sourceMappingURL=DocMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocMetadata.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/schema/DocMetadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC3B,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IAEjB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAEhB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,yFAAyF;IACzF,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,gDAAgD;IAChD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB;AAED,qBAAa,iBAAiB;IAC7B;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAYzD;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,WAAW;CAYnD"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { Doc } from './Doc';
25
+ import { DocFilter } from './DocFilter';
26
+ /**
27
+ * Defines different types of questions and queries you can ask.
28
+ */
29
+ export declare enum QuestionType {
30
+ QUESTION = "question",
31
+ SEMANTIC = "semantic",
32
+ KEYWORD = "keyword",
33
+ GET = "get",
34
+ PROMPT = "prompt"
35
+ }
36
+ /**
37
+ * Represents a single message in a chat conversation history.
38
+ */
39
+ export interface QuestionHistory {
40
+ /** Who sent this message ('user', 'system', or 'assistant') */
41
+ role: string;
42
+ /** The actual message content */
43
+ content: string;
44
+ }
45
+ /**
46
+ * Provides specific instructions to guide the AI's response.
47
+ */
48
+ export interface QuestionInstruction {
49
+ /** Brief description of what this instruction is about */
50
+ subtitle: string;
51
+ /** Detailed guidance for the AI */
52
+ instructions: string;
53
+ }
54
+ /**
55
+ * Shows the AI an example of the kind of response you want.
56
+ */
57
+ export interface QuestionExample {
58
+ /** Example question or input */
59
+ given: string;
60
+ /** Example response you want for that input */
61
+ result: string;
62
+ }
63
+ /**
64
+ * Represents a single question with optional AI embeddings.
65
+ */
66
+ export interface QuestionText {
67
+ /** The actual question text */
68
+ text: string;
69
+ /** AI model used for creating embeddings (if any) */
70
+ embedding_model?: string;
71
+ /** Vector representation of the question (if any) */
72
+ embedding?: number[];
73
+ }
74
+ /**
75
+ * Handles AI responses from Aparavi chat operations.
76
+ */
77
+ export declare class Answer {
78
+ private answer?;
79
+ private expectJson;
80
+ constructor(expectJson?: boolean);
81
+ /**
82
+ * Parse AI response text into JSON structure.
83
+ */
84
+ static parseJson(value: string): any;
85
+ /**
86
+ * Extract Python code from AI response.
87
+ */
88
+ static parsePython(value: string): string;
89
+ /**
90
+ * Set the AI response value (used internally by the system).
91
+ */
92
+ setAnswer(value: string | object | any[]): void;
93
+ /**
94
+ * Get the response as plain text.
95
+ */
96
+ getText(): string;
97
+ /**
98
+ * Get the response as structured JSON data.
99
+ */
100
+ getJson(): any;
101
+ /**
102
+ * Check if this answer contains JSON data.
103
+ */
104
+ isJson(): boolean;
105
+ }
106
+ /**
107
+ * Main class for asking questions to Aparavi's AI system.
108
+ */
109
+ export declare class Question {
110
+ type: QuestionType;
111
+ filter: DocFilter;
112
+ expectJson: boolean;
113
+ role: string;
114
+ instructions: QuestionInstruction[];
115
+ history: QuestionHistory[];
116
+ examples: QuestionExample[];
117
+ context: string[];
118
+ documents: Doc[];
119
+ questions: QuestionText[];
120
+ constructor(options?: {
121
+ type?: QuestionType;
122
+ filter?: DocFilter;
123
+ expectJson?: boolean;
124
+ role?: string;
125
+ });
126
+ /**
127
+ * Add a custom instruction to guide the AI's response.
128
+ */
129
+ addInstruction(title: string, instruction: string): void;
130
+ /**
131
+ * Add an example to show the AI the kind of response you want.
132
+ */
133
+ addExample(given: string, result: string | object | any[]): void;
134
+ /**
135
+ * Add context information to help the AI understand your question better.
136
+ */
137
+ addContext(context: string | object | string[] | object[]): void;
138
+ /**
139
+ * Add a conversation history item for multi-turn chat.
140
+ */
141
+ addHistory(item: QuestionHistory): void;
142
+ /**
143
+ * Add a question to ask the AI.
144
+ */
145
+ addQuestion(question: string): void;
146
+ /**
147
+ * Add specific documents for the AI to reference.
148
+ */
149
+ addDocuments(documents: Doc | Doc[]): void;
150
+ /**
151
+ * Generate the complete prompt text for the AI (used internally).
152
+ */
153
+ getPrompt(hasPreviousJsonFailed?: boolean): string;
154
+ /**
155
+ * Convert Question to dictionary for serialization.
156
+ */
157
+ toDict(): Record<string, any>;
158
+ /**
159
+ * Create Question from dictionary.
160
+ */
161
+ static fromDict(data: Record<string, any>): Question;
162
+ }
163
+ //# sourceMappingURL=Question.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/schema/Question.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,oBAAY,YAAY;IACvB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,MAAM,WAAW;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,qBAAa,MAAM;IAClB,OAAO,CAAC,MAAM,CAAC,CAA0B;IACzC,OAAO,CAAC,UAAU,CAAU;gBAEhB,UAAU,UAAQ;IAI9B;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,GAA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,IAAI;IAInC;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI;IAgB1C;;OAEG;IACH,SAAS,CAAC,qBAAqB,UAAQ,GAAG,MAAM;IAyIhD;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAe7B;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,QAAQ;CAiBpD"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ /**
25
+ * Schema definitions for Aparavi data structures.
26
+ *
27
+ * Re-exports all schema classes and interfaces for convenient imports.
28
+ */
29
+ export * from './Doc';
30
+ export * from './DocFilter';
31
+ export * from './DocGroup';
32
+ export * from './DocMetadata';
33
+ export * from './Question';
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;GAIG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ /**
25
+ * Type definitions for Aparavi client configuration and DAP communication.
26
+ *
27
+ * This module defines the core types used for client-server communication
28
+ * including DAP messages, callbacks, configuration options, and transport interfaces.
29
+ */
30
+ /**
31
+ * Stack trace information for errors.
32
+ */
33
+ export interface TraceInfo {
34
+ /** File path where the error occurred */
35
+ file: string;
36
+ /** Line number where the error occurred */
37
+ lineno: number;
38
+ }
39
+ export interface DAPMessage {
40
+ /** Message type: request from client, response from server, or event notification */
41
+ type: 'request' | 'response' | 'event';
42
+ /** Unique sequence number for message correlation and ordering */
43
+ seq: number;
44
+ /** Command name for requests (e.g., 'execute', 'terminate', 'apaext_ping') */
45
+ command?: string;
46
+ /** Command arguments and parameters */
47
+ arguments?: Record<string, any>;
48
+ /** Response body containing results and data */
49
+ body?: Record<string, any>;
50
+ /** Success flag for responses - true if operation succeeded */
51
+ success?: boolean;
52
+ /** Error or status message */
53
+ message?: string;
54
+ /** Sequence number of the request this response corresponds to */
55
+ request_seq?: number;
56
+ /** Event type name for event messages */
57
+ event?: string;
58
+ /** Task or pipeline token for operation context */
59
+ token?: string;
60
+ /** Binary or text data payload */
61
+ data?: Uint8Array | string;
62
+ /** Stack trace information for errors */
63
+ trace?: TraceInfo;
64
+ }
65
+ /**
66
+ * Callback functions for transport layer events and debugging.
67
+ *
68
+ * These callbacks provide hooks for monitoring transport activity,
69
+ * debugging protocol messages, and handling connection lifecycle events.
70
+ */
71
+ export interface TransportCallbacks {
72
+ /** Called when debug messages are generated */
73
+ onDebugMessage?: (message: string) => void;
74
+ /** Called when protocol messages are sent/received for debugging */
75
+ onDebugProtocol?: (message: string) => void;
76
+ /** Called when a message is received from the server */
77
+ onReceive?: (message: DAPMessage) => Promise<void>;
78
+ /** Called when connection is established */
79
+ onConnected?: (connectionInfo?: string) => Promise<void>;
80
+ /** Called when connection is lost or closed */
81
+ onDisconnected?: (reason?: string, hasError?: boolean) => Promise<void>;
82
+ }
83
+ /**
84
+ * Connection configuration for establishing server connections.
85
+ */
86
+ export interface ConnectionInfo {
87
+ /** Server URI (WebSocket endpoint) */
88
+ uri: string;
89
+ /** Authentication token or API key */
90
+ auth?: string;
91
+ }
92
+ /**
93
+ * Callback function for handling real-time events from the server.
94
+ *
95
+ * Events include pipeline status updates, processing progress,
96
+ * error notifications, and system alerts.
97
+ */
98
+ export type EventCallback = (event: DAPMessage) => Promise<void>;
99
+ /**
100
+ * Callback function for connection establishment events.
101
+ */
102
+ export type ConnectCallback = (connectionInfo?: string) => Promise<void>;
103
+ /**
104
+ * Callback function for disconnection events.
105
+ */
106
+ export type DisconnectCallback = (reason?: string, hasError?: boolean) => Promise<void>;
107
+ /**
108
+ * Configuration options for creating an AparaviClient instance.
109
+ *
110
+ * Provides connection settings, authentication, and event handling
111
+ * configuration for establishing and managing server connections.
112
+ */
113
+ export interface AparaviClientConfig {
114
+ /** API authentication key or token */
115
+ auth?: string;
116
+ /** Server URI (will be converted to WebSocket URI automatically) */
117
+ uri?: string;
118
+ /**
119
+ * Environment variables dictionary for configuration and variable substitution.
120
+ * If not provided, will load from .env file (Node.js only), then fall back to process.env
121
+ */
122
+ env?: Record<string, any>;
123
+ /** Callback for handling real-time events from server */
124
+ onEvent?: EventCallback;
125
+ /** Callback for connection establishment */
126
+ onConnected?: ConnectCallback;
127
+ /** Callback for disconnection events */
128
+ onDisconnected?: DisconnectCallback;
129
+ /** Optional function to output a protocol message */
130
+ onProtocolMessage?: (message: string) => void;
131
+ /** Optional function to output a debug message */
132
+ onDebugMessage?: (message: string) => void;
133
+ /** Maintain the connection */
134
+ persist?: boolean;
135
+ /** Delay before attempting to reconnect */
136
+ reconnectDelay?: number;
137
+ /** Client module name for debugging and identification */
138
+ module?: string;
139
+ }
140
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/types/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,2CAA2C;IAC3C,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