@arke-institute/sdk 0.1.0 → 0.1.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 (53) hide show
  1. package/dist/{index.d.mts → client-dAk3E64p.d.cts} +1 -7
  2. package/dist/client-dAk3E64p.d.ts +183 -0
  3. package/dist/{index.mjs → collections/index.cjs} +34 -5
  4. package/dist/collections/index.cjs.map +1 -0
  5. package/dist/collections/index.d.cts +9 -0
  6. package/dist/collections/index.d.ts +9 -1
  7. package/dist/collections/index.js +5 -32
  8. package/dist/collections/index.js.map +1 -1
  9. package/dist/content/index.cjs +506 -0
  10. package/dist/content/index.cjs.map +1 -0
  11. package/dist/content/index.d.cts +403 -0
  12. package/dist/content/index.d.ts +403 -0
  13. package/dist/content/index.js +473 -0
  14. package/dist/content/index.js.map +1 -0
  15. package/dist/edit/index.cjs +1029 -0
  16. package/dist/edit/index.cjs.map +1 -0
  17. package/dist/edit/index.d.cts +78 -0
  18. package/dist/edit/index.d.ts +78 -0
  19. package/dist/edit/index.js +983 -0
  20. package/dist/edit/index.js.map +1 -0
  21. package/dist/errors-3L7IiHcr.d.cts +480 -0
  22. package/dist/errors-B82BMmRP.d.cts +343 -0
  23. package/dist/errors-B82BMmRP.d.ts +343 -0
  24. package/dist/errors-BTe8GKRQ.d.ts +480 -0
  25. package/dist/graph/index.cjs +433 -0
  26. package/dist/graph/index.cjs.map +1 -0
  27. package/dist/graph/index.d.cts +456 -0
  28. package/dist/graph/index.d.ts +456 -0
  29. package/dist/graph/index.js +402 -0
  30. package/dist/graph/index.js.map +1 -0
  31. package/dist/index.cjs +3761 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.cts +7 -0
  34. package/dist/index.d.ts +7 -189
  35. package/dist/index.js +3502 -30
  36. package/dist/index.js.map +1 -1
  37. package/dist/query/index.cjs +289 -0
  38. package/dist/query/index.cjs.map +1 -0
  39. package/dist/query/index.d.cts +541 -0
  40. package/dist/query/index.d.ts +541 -0
  41. package/dist/query/index.js +261 -0
  42. package/dist/query/index.js.map +1 -0
  43. package/dist/upload/index.cjs +1634 -0
  44. package/dist/upload/index.cjs.map +1 -0
  45. package/dist/upload/index.d.cts +150 -0
  46. package/dist/upload/index.d.ts +150 -0
  47. package/dist/upload/index.js +1597 -0
  48. package/dist/upload/index.js.map +1 -0
  49. package/package.json +43 -8
  50. package/dist/collections/index.d.mts +0 -1
  51. package/dist/collections/index.mjs +0 -204
  52. package/dist/collections/index.mjs.map +0 -1
  53. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,261 @@
1
+ // src/query/errors.ts
2
+ var QueryError = class extends Error {
3
+ constructor(message, code = "UNKNOWN_ERROR", details) {
4
+ super(message);
5
+ this.code = code;
6
+ this.details = details;
7
+ this.name = "QueryError";
8
+ }
9
+ };
10
+
11
+ // src/query/client.ts
12
+ var QueryClient = class {
13
+ constructor(config) {
14
+ this.baseUrl = config.gatewayUrl.replace(/\/$/, "");
15
+ this.fetchImpl = config.fetchImpl ?? fetch;
16
+ }
17
+ // ---------------------------------------------------------------------------
18
+ // Request helpers
19
+ // ---------------------------------------------------------------------------
20
+ buildUrl(path, query) {
21
+ const url = new URL(`${this.baseUrl}${path}`);
22
+ if (query) {
23
+ Object.entries(query).forEach(([key, value]) => {
24
+ if (value !== void 0 && value !== null) {
25
+ url.searchParams.set(key, String(value));
26
+ }
27
+ });
28
+ }
29
+ return url.toString();
30
+ }
31
+ async request(path, options = {}) {
32
+ const url = this.buildUrl(path, options.query);
33
+ const headers = new Headers({ "Content-Type": "application/json" });
34
+ if (options.headers) {
35
+ Object.entries(options.headers).forEach(([k, v]) => {
36
+ if (v !== void 0) headers.set(k, v);
37
+ });
38
+ }
39
+ const response = await this.fetchImpl(url, { ...options, headers });
40
+ if (response.ok) {
41
+ const contentType = response.headers.get("content-type") || "";
42
+ if (contentType.includes("application/json")) {
43
+ return await response.json();
44
+ }
45
+ return await response.text();
46
+ }
47
+ let body;
48
+ const text = await response.text();
49
+ try {
50
+ body = JSON.parse(text);
51
+ } catch {
52
+ body = text;
53
+ }
54
+ const message = body?.error && typeof body.error === "string" ? body.error : body?.message && typeof body.message === "string" ? body.message : `Request failed with status ${response.status}`;
55
+ throw new QueryError(message, "HTTP_ERROR", {
56
+ status: response.status,
57
+ body
58
+ });
59
+ }
60
+ // ---------------------------------------------------------------------------
61
+ // Query methods
62
+ // ---------------------------------------------------------------------------
63
+ /**
64
+ * Execute a path query against the knowledge graph.
65
+ *
66
+ * @param pathQuery - The path query string (e.g., '"alice austen" -[*]{,4}-> type:person')
67
+ * @param options - Query options (k, k_explore, lineage, enrich, etc.)
68
+ * @returns Query results with entities, paths, and metadata
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * // Simple semantic search
73
+ * const results = await query.path('"Washington" type:person');
74
+ *
75
+ * // Multi-hop traversal
76
+ * const results = await query.path('"alice austen" -[*]{,4}-> type:person ~ "photographer"');
77
+ *
78
+ * // With lineage filtering (collection scope)
79
+ * const results = await query.path('"letters" type:document', {
80
+ * lineage: { sourcePi: 'arke:my_collection', direction: 'descendants' },
81
+ * k: 10,
82
+ * });
83
+ * ```
84
+ */
85
+ async path(pathQuery, options = {}) {
86
+ return this.request("/query/path", {
87
+ method: "POST",
88
+ body: JSON.stringify({
89
+ path: pathQuery,
90
+ ...options
91
+ })
92
+ });
93
+ }
94
+ /**
95
+ * Execute a natural language query.
96
+ *
97
+ * The query is translated to a path query using an LLM, then executed.
98
+ *
99
+ * @param question - Natural language question
100
+ * @param options - Query options including custom_instructions for the LLM
101
+ * @returns Query results with translation info
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * const results = await query.natural('Find photographers connected to Alice Austen');
106
+ * console.log('Generated query:', results.translation.path);
107
+ * console.log('Explanation:', results.translation.explanation);
108
+ * ```
109
+ */
110
+ async natural(question, options = {}) {
111
+ const { custom_instructions, ...queryOptions } = options;
112
+ return this.request("/query/natural", {
113
+ method: "POST",
114
+ body: JSON.stringify({
115
+ query: question,
116
+ custom_instructions,
117
+ ...queryOptions
118
+ })
119
+ });
120
+ }
121
+ /**
122
+ * Translate a natural language question to a path query without executing it.
123
+ *
124
+ * Useful for understanding how questions are translated or for manual execution later.
125
+ *
126
+ * @param question - Natural language question
127
+ * @param customInstructions - Optional additional instructions for the LLM
128
+ * @returns Translation result with path query and explanation
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * const result = await query.translate('Who wrote letters from Philadelphia?');
133
+ * console.log('Path query:', result.path);
134
+ * // '"letters" <-[authored, wrote]- type:person -[located]-> "Philadelphia"'
135
+ * ```
136
+ */
137
+ async translate(question, customInstructions) {
138
+ return this.request("/query/translate", {
139
+ method: "POST",
140
+ body: JSON.stringify({
141
+ query: question,
142
+ custom_instructions: customInstructions
143
+ })
144
+ });
145
+ }
146
+ /**
147
+ * Parse and validate a path query without executing it.
148
+ *
149
+ * Returns the AST (Abstract Syntax Tree) if valid, or throws an error.
150
+ *
151
+ * @param pathQuery - The path query to parse
152
+ * @returns Parsed AST
153
+ * @throws QueryError if the query has syntax errors
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * try {
158
+ * const result = await query.parse('"test" -[*]-> type:person');
159
+ * console.log('Valid query, AST:', result.ast);
160
+ * } catch (err) {
161
+ * console.error('Invalid query:', err.message);
162
+ * }
163
+ * ```
164
+ */
165
+ async parse(pathQuery) {
166
+ const url = this.buildUrl("/query/parse", { path: pathQuery });
167
+ const response = await this.fetchImpl(url, {
168
+ method: "GET",
169
+ headers: { "Content-Type": "application/json" }
170
+ });
171
+ const body = await response.json();
172
+ if ("error" in body && body.error === "Parse error") {
173
+ throw new QueryError(
174
+ body.message,
175
+ "PARSE_ERROR",
176
+ { position: body.position }
177
+ );
178
+ }
179
+ if (!response.ok) {
180
+ throw new QueryError(
181
+ body.error || `Request failed with status ${response.status}`,
182
+ "HTTP_ERROR",
183
+ { status: response.status, body }
184
+ );
185
+ }
186
+ return body;
187
+ }
188
+ /**
189
+ * Get the path query syntax documentation.
190
+ *
191
+ * Returns comprehensive documentation including entry points, edge traversal,
192
+ * filters, examples, and constraints.
193
+ *
194
+ * @returns Syntax documentation
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * const syntax = await query.syntax();
199
+ *
200
+ * // List all entry point types
201
+ * syntax.entryPoints.types.forEach(ep => {
202
+ * console.log(`${ep.syntax} - ${ep.description}`);
203
+ * });
204
+ *
205
+ * // Show examples
206
+ * syntax.examples.forEach(ex => {
207
+ * console.log(`${ex.description}: ${ex.query}`);
208
+ * });
209
+ * ```
210
+ */
211
+ async syntax() {
212
+ return this.request("/query/syntax", {
213
+ method: "GET"
214
+ });
215
+ }
216
+ /**
217
+ * Check the health of the query service.
218
+ *
219
+ * @returns Health status
220
+ */
221
+ async health() {
222
+ return this.request("/query/health", { method: "GET" });
223
+ }
224
+ /**
225
+ * Search for collections by semantic similarity.
226
+ *
227
+ * Searches the dedicated collections index for fast semantic matching.
228
+ *
229
+ * @param query - Search query text
230
+ * @param options - Search options (limit, visibility filter)
231
+ * @returns Matching collections with similarity scores
232
+ *
233
+ * @example
234
+ * ```typescript
235
+ * // Search for photography-related collections
236
+ * const results = await query.searchCollections('photography');
237
+ * console.log(results.collections[0].title);
238
+ *
239
+ * // Search only public collections
240
+ * const publicResults = await query.searchCollections('history', {
241
+ * visibility: 'public',
242
+ * limit: 20,
243
+ * });
244
+ * ```
245
+ */
246
+ async searchCollections(query, options = {}) {
247
+ return this.request("/query/search/collections", {
248
+ method: "GET",
249
+ query: {
250
+ q: query,
251
+ limit: options.limit?.toString(),
252
+ visibility: options.visibility
253
+ }
254
+ });
255
+ }
256
+ };
257
+ export {
258
+ QueryClient,
259
+ QueryError
260
+ };
261
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/query/errors.ts","../../src/query/client.ts"],"sourcesContent":["/**\n * Error class for query operations\n */\nexport class QueryError extends Error {\n constructor(\n message: string,\n public code: string = 'UNKNOWN_ERROR',\n public details?: unknown\n ) {\n super(message);\n this.name = 'QueryError';\n }\n}\n","import { QueryError } from './errors';\nimport type {\n PathQueryOptions,\n NaturalQueryOptions,\n QueryResult,\n NaturalQueryResult,\n TranslateResult,\n ParseResult,\n ParseError,\n SyntaxDocumentation,\n CollectionSearchOptions,\n CollectionSearchResponse,\n} from './types';\n\n/**\n * Configuration for QueryClient\n */\nexport interface QueryClientConfig {\n /**\n * Gateway base URL (e.g., https://gateway.arke.institute).\n * The client will call /query/* endpoints.\n */\n gatewayUrl: string;\n /**\n * Optional custom fetch implementation (useful for testing).\n */\n fetchImpl?: typeof fetch;\n}\n\ntype JsonBody = Record<string, unknown>;\n\n/**\n * Client for querying the Arke knowledge graph.\n *\n * All query endpoints are public and do not require authentication.\n *\n * @example\n * ```typescript\n * const query = new QueryClient({\n * gatewayUrl: 'https://gateway.arke.institute',\n * });\n *\n * // Direct path query\n * const results = await query.path('\"alice austen\" -[*]{,4}-> type:person');\n *\n * // Natural language query\n * const nlResults = await query.natural('Find photographers connected to Alice Austen');\n *\n * // Get syntax documentation\n * const syntax = await query.syntax();\n * ```\n */\nexport class QueryClient {\n private baseUrl: string;\n private fetchImpl: typeof fetch;\n\n constructor(config: QueryClientConfig) {\n this.baseUrl = config.gatewayUrl.replace(/\\/$/, '');\n this.fetchImpl = config.fetchImpl ?? fetch;\n }\n\n // ---------------------------------------------------------------------------\n // Request helpers\n // ---------------------------------------------------------------------------\n\n private buildUrl(path: string, query?: Record<string, string | undefined>) {\n const url = new URL(`${this.baseUrl}${path}`);\n if (query) {\n Object.entries(query).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n url.searchParams.set(key, String(value));\n }\n });\n }\n return url.toString();\n }\n\n private async request<T>(\n path: string,\n options: RequestInit & {\n query?: Record<string, string | undefined>;\n } = {}\n ): Promise<T> {\n const url = this.buildUrl(path, options.query);\n const headers = new Headers({ 'Content-Type': 'application/json' });\n if (options.headers) {\n Object.entries(options.headers).forEach(([k, v]) => {\n if (v !== undefined) headers.set(k, v as string);\n });\n }\n\n const response = await this.fetchImpl(url, { ...options, headers });\n\n if (response.ok) {\n const contentType = response.headers.get('content-type') || '';\n if (contentType.includes('application/json')) {\n return (await response.json()) as T;\n }\n return (await response.text()) as unknown as T;\n }\n\n let body: unknown;\n const text = await response.text();\n try {\n body = JSON.parse(text);\n } catch {\n body = text;\n }\n\n const message =\n (body as JsonBody)?.error && typeof (body as JsonBody).error === 'string'\n ? ((body as JsonBody).error as string)\n : (body as JsonBody)?.message && typeof (body as JsonBody).message === 'string'\n ? ((body as JsonBody).message as string)\n : `Request failed with status ${response.status}`;\n\n throw new QueryError(message, 'HTTP_ERROR', {\n status: response.status,\n body,\n });\n }\n\n // ---------------------------------------------------------------------------\n // Query methods\n // ---------------------------------------------------------------------------\n\n /**\n * Execute a path query against the knowledge graph.\n *\n * @param pathQuery - The path query string (e.g., '\"alice austen\" -[*]{,4}-> type:person')\n * @param options - Query options (k, k_explore, lineage, enrich, etc.)\n * @returns Query results with entities, paths, and metadata\n *\n * @example\n * ```typescript\n * // Simple semantic search\n * const results = await query.path('\"Washington\" type:person');\n *\n * // Multi-hop traversal\n * const results = await query.path('\"alice austen\" -[*]{,4}-> type:person ~ \"photographer\"');\n *\n * // With lineage filtering (collection scope)\n * const results = await query.path('\"letters\" type:document', {\n * lineage: { sourcePi: 'arke:my_collection', direction: 'descendants' },\n * k: 10,\n * });\n * ```\n */\n async path(pathQuery: string, options: PathQueryOptions = {}): Promise<QueryResult> {\n return this.request<QueryResult>('/query/path', {\n method: 'POST',\n body: JSON.stringify({\n path: pathQuery,\n ...options,\n }),\n });\n }\n\n /**\n * Execute a natural language query.\n *\n * The query is translated to a path query using an LLM, then executed.\n *\n * @param question - Natural language question\n * @param options - Query options including custom_instructions for the LLM\n * @returns Query results with translation info\n *\n * @example\n * ```typescript\n * const results = await query.natural('Find photographers connected to Alice Austen');\n * console.log('Generated query:', results.translation.path);\n * console.log('Explanation:', results.translation.explanation);\n * ```\n */\n async natural(question: string, options: NaturalQueryOptions = {}): Promise<NaturalQueryResult> {\n const { custom_instructions, ...queryOptions } = options;\n return this.request<NaturalQueryResult>('/query/natural', {\n method: 'POST',\n body: JSON.stringify({\n query: question,\n custom_instructions,\n ...queryOptions,\n }),\n });\n }\n\n /**\n * Translate a natural language question to a path query without executing it.\n *\n * Useful for understanding how questions are translated or for manual execution later.\n *\n * @param question - Natural language question\n * @param customInstructions - Optional additional instructions for the LLM\n * @returns Translation result with path query and explanation\n *\n * @example\n * ```typescript\n * const result = await query.translate('Who wrote letters from Philadelphia?');\n * console.log('Path query:', result.path);\n * // '\"letters\" <-[authored, wrote]- type:person -[located]-> \"Philadelphia\"'\n * ```\n */\n async translate(question: string, customInstructions?: string): Promise<TranslateResult> {\n return this.request<TranslateResult>('/query/translate', {\n method: 'POST',\n body: JSON.stringify({\n query: question,\n custom_instructions: customInstructions,\n }),\n });\n }\n\n /**\n * Parse and validate a path query without executing it.\n *\n * Returns the AST (Abstract Syntax Tree) if valid, or throws an error.\n *\n * @param pathQuery - The path query to parse\n * @returns Parsed AST\n * @throws QueryError if the query has syntax errors\n *\n * @example\n * ```typescript\n * try {\n * const result = await query.parse('\"test\" -[*]-> type:person');\n * console.log('Valid query, AST:', result.ast);\n * } catch (err) {\n * console.error('Invalid query:', err.message);\n * }\n * ```\n */\n async parse(pathQuery: string): Promise<ParseResult> {\n const url = this.buildUrl('/query/parse', { path: pathQuery });\n const response = await this.fetchImpl(url, {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n });\n\n const body = await response.json() as ParseResult | ParseError;\n\n // Check if it's an error response (parse errors return 400)\n if ('error' in body && body.error === 'Parse error') {\n throw new QueryError(\n (body as ParseError).message,\n 'PARSE_ERROR',\n { position: (body as ParseError).position }\n );\n }\n\n if (!response.ok) {\n throw new QueryError(\n (body as any).error || `Request failed with status ${response.status}`,\n 'HTTP_ERROR',\n { status: response.status, body }\n );\n }\n\n return body as ParseResult;\n }\n\n /**\n * Get the path query syntax documentation.\n *\n * Returns comprehensive documentation including entry points, edge traversal,\n * filters, examples, and constraints.\n *\n * @returns Syntax documentation\n *\n * @example\n * ```typescript\n * const syntax = await query.syntax();\n *\n * // List all entry point types\n * syntax.entryPoints.types.forEach(ep => {\n * console.log(`${ep.syntax} - ${ep.description}`);\n * });\n *\n * // Show examples\n * syntax.examples.forEach(ex => {\n * console.log(`${ex.description}: ${ex.query}`);\n * });\n * ```\n */\n async syntax(): Promise<SyntaxDocumentation> {\n return this.request<SyntaxDocumentation>('/query/syntax', {\n method: 'GET',\n });\n }\n\n /**\n * Check the health of the query service.\n *\n * @returns Health status\n */\n async health(): Promise<{ status: string; service: string; version: string }> {\n return this.request('/query/health', { method: 'GET' });\n }\n\n /**\n * Search for collections by semantic similarity.\n *\n * Searches the dedicated collections index for fast semantic matching.\n *\n * @param query - Search query text\n * @param options - Search options (limit, visibility filter)\n * @returns Matching collections with similarity scores\n *\n * @example\n * ```typescript\n * // Search for photography-related collections\n * const results = await query.searchCollections('photography');\n * console.log(results.collections[0].title);\n *\n * // Search only public collections\n * const publicResults = await query.searchCollections('history', {\n * visibility: 'public',\n * limit: 20,\n * });\n * ```\n */\n async searchCollections(\n query: string,\n options: CollectionSearchOptions = {}\n ): Promise<CollectionSearchResponse> {\n return this.request<CollectionSearchResponse>('/query/search/collections', {\n method: 'GET',\n query: {\n q: query,\n limit: options.limit?.toString(),\n visibility: options.visibility,\n },\n });\n }\n}\n"],"mappings":";AAGO,IAAM,aAAN,cAAyB,MAAM;AAAA,EACpC,YACE,SACO,OAAe,iBACf,SACP;AACA,UAAM,OAAO;AAHN;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;;;ACwCO,IAAM,cAAN,MAAkB;AAAA,EAIvB,YAAY,QAA2B;AACrC,SAAK,UAAU,OAAO,WAAW,QAAQ,OAAO,EAAE;AAClD,SAAK,YAAY,OAAO,aAAa;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA,EAMQ,SAAS,MAAc,OAA4C;AACzE,UAAM,MAAM,IAAI,I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