@grackle-ai/knowledge 0.62.2 → 0.64.0
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 +4 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -16
- package/dist/index.js.map +1 -1
- package/dist/reference-sync.d.ts +1 -2
- package/dist/reference-sync.d.ts.map +1 -1
- package/dist/reference-sync.js +1 -5
- package/dist/reference-sync.js.map +1 -1
- package/package.json +2 -5
- package/dist/chunker.d.ts +0 -20
- package/dist/chunker.d.ts.map +0 -1
- package/dist/chunker.js +0 -7
- package/dist/chunker.js.map +0 -1
- package/dist/client.d.ts +0 -68
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -150
- package/dist/client.js.map +0 -1
- package/dist/constants.d.ts +0 -33
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -33
- package/dist/constants.js.map +0 -1
- package/dist/edge-store.d.ts +0 -32
- package/dist/edge-store.d.ts.map +0 -1
- package/dist/edge-store.js +0 -145
- package/dist/edge-store.js.map +0 -1
- package/dist/embedder.d.ts +0 -35
- package/dist/embedder.d.ts.map +0 -1
- package/dist/embedder.js +0 -7
- package/dist/embedder.js.map +0 -1
- package/dist/expand.d.ts +0 -42
- package/dist/expand.d.ts.map +0 -1
- package/dist/expand.js +0 -150
- package/dist/expand.js.map +0 -1
- package/dist/ingest.d.ts +0 -23
- package/dist/ingest.d.ts.map +0 -1
- package/dist/ingest.js +0 -27
- package/dist/ingest.js.map +0 -1
- package/dist/local-embedder.d.ts +0 -25
- package/dist/local-embedder.d.ts.map +0 -1
- package/dist/local-embedder.js +0 -88
- package/dist/local-embedder.js.map +0 -1
- package/dist/logger.d.ts +0 -9
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -15
- package/dist/logger.js.map +0 -1
- package/dist/node-store.d.ts +0 -116
- package/dist/node-store.d.ts.map +0 -1
- package/dist/node-store.js +0 -268
- package/dist/node-store.js.map +0 -1
- package/dist/pass-through-chunker.d.ts +0 -16
- package/dist/pass-through-chunker.d.ts.map +0 -1
- package/dist/pass-through-chunker.js +0 -21
- package/dist/pass-through-chunker.js.map +0 -1
- package/dist/schema.d.ts +0 -23
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -73
- package/dist/schema.js.map +0 -1
- package/dist/search.d.ts +0 -43
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js +0 -123
- package/dist/search.js.map +0 -1
- package/dist/transcript-chunker.d.ts +0 -29
- package/dist/transcript-chunker.d.ts.map +0 -1
- package/dist/transcript-chunker.js +0 -142
- package/dist/transcript-chunker.js.map +0 -1
- package/dist/types.d.ts +0 -102
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -61
- package/dist/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Grackle knowledge graph subsystem.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* so that agents can share and reuse contextual information across sessions.
|
|
4
|
+
* Re-exports the generic {@link @grackle-ai/knowledge-core} SDK and adds
|
|
5
|
+
* Grackle-specific reference node sync helpers for tasks and findings.
|
|
7
6
|
*
|
|
8
7
|
* @packageDocumentation
|
|
9
8
|
*/
|
|
10
|
-
export
|
|
11
|
-
export type { Neo4jClientConfig } from "./client.js";
|
|
12
|
-
export { initSchema, SCHEMA_STATEMENTS } from "./schema.js";
|
|
13
|
-
export * from "./types.js";
|
|
14
|
-
export { DEFAULT_NEO4J_URL, DEFAULT_NEO4J_USER, DEFAULT_NEO4J_DATABASE, NEO4J_MAX_POOL_SIZE, NEO4J_CONNECTION_ACQUISITION_TIMEOUT, NODE_LABEL, VECTOR_INDEX_NAME, EMBEDDING_DIMENSIONS, VECTOR_SIMILARITY_FUNCTION, } from "./constants.js";
|
|
15
|
-
export type { Embedder, EmbedderOptions, EmbeddingResult } from "./embedder.js";
|
|
16
|
-
export { createLocalEmbedder } from "./local-embedder.js";
|
|
17
|
-
export type { Chunk, Chunker } from "./chunker.js";
|
|
18
|
-
export { createPassThroughChunker } from "./pass-through-chunker.js";
|
|
19
|
-
export type { EmbeddedChunk } from "./ingest.js";
|
|
20
|
-
export { ingest } from "./ingest.js";
|
|
21
|
-
export type { TranscriptChunkerOptions } from "./transcript-chunker.js";
|
|
22
|
-
export { createTranscriptChunker } from "./transcript-chunker.js";
|
|
23
|
-
export { createReferenceNode, createNativeNode, getNode, deleteNode, updateNode, recordToNode, } from "./node-store.js";
|
|
24
|
-
export type { CreateReferenceNodeInput, CreateNativeNodeInput, UpdateReferenceNodeInput, UpdateNativeNodeInput, UpdateNodeInput, NodeWithEdges, } from "./node-store.js";
|
|
25
|
-
export { createEdge, removeEdge } from "./edge-store.js";
|
|
26
|
-
export type { SearchOptions, SearchResult } from "./search.js";
|
|
27
|
-
export { knowledgeSearch } from "./search.js";
|
|
28
|
-
export type { ExpandOptions, ExpansionResult } from "./expand.js";
|
|
29
|
-
export { expandNode, expandResults } from "./expand.js";
|
|
9
|
+
export * from "@grackle-ai/knowledge-core";
|
|
30
10
|
export { findReferenceNodeBySource, deleteReferenceNodeBySource, syncReferenceNode, deriveTaskText, deriveFindingText, } from "./reference-sync.js";
|
|
31
11
|
export type { SyncReferenceNodeInput } from "./reference-sync.js";
|
|
32
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,4BAA4B,CAAC;AAG3C,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,cAAc,EACd,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Grackle knowledge graph subsystem.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* so that agents can share and reuse contextual information across sessions.
|
|
4
|
+
* Re-exports the generic {@link @grackle-ai/knowledge-core} SDK and adds
|
|
5
|
+
* Grackle-specific reference node sync helpers for tasks and findings.
|
|
7
6
|
*
|
|
8
7
|
* @packageDocumentation
|
|
9
8
|
*/
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export { DEFAULT_NEO4J_URL, DEFAULT_NEO4J_USER, DEFAULT_NEO4J_DATABASE, NEO4J_MAX_POOL_SIZE, NEO4J_CONNECTION_ACQUISITION_TIMEOUT, NODE_LABEL, VECTOR_INDEX_NAME, EMBEDDING_DIMENSIONS, VECTOR_SIMILARITY_FUNCTION, } from "./constants.js";
|
|
14
|
-
export { createLocalEmbedder } from "./local-embedder.js";
|
|
15
|
-
export { createPassThroughChunker } from "./pass-through-chunker.js";
|
|
16
|
-
export { ingest } from "./ingest.js";
|
|
17
|
-
export { createTranscriptChunker } from "./transcript-chunker.js";
|
|
18
|
-
export { createReferenceNode, createNativeNode, getNode, deleteNode, updateNode, recordToNode, } from "./node-store.js";
|
|
19
|
-
export { createEdge, removeEdge } from "./edge-store.js";
|
|
20
|
-
export { knowledgeSearch } from "./search.js";
|
|
21
|
-
export { expandNode, expandResults } from "./expand.js";
|
|
9
|
+
// Re-export everything from the generic core
|
|
10
|
+
export * from "@grackle-ai/knowledge-core";
|
|
11
|
+
// Grackle-specific additions
|
|
22
12
|
export { findReferenceNodeBySource, deleteReferenceNodeBySource, syncReferenceNode, deriveTaskText, deriveFindingText, } from "./reference-sync.js";
|
|
23
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,6CAA6C;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,6BAA6B;AAC7B,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,cAAc,EACd,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
|
package/dist/reference-sync.d.ts
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
|
-
import { type ReferenceSource, type ReferenceNode } from "
|
|
13
|
-
import type { Embedder } from "./embedder.js";
|
|
12
|
+
import { type ReferenceSource, type ReferenceNode, type Embedder } from "@grackle-ai/knowledge-core";
|
|
14
13
|
/** Input for syncing a reference node with a Grackle entity. */
|
|
15
14
|
export interface SyncReferenceNodeInput {
|
|
16
15
|
/** Which entity type this refers to. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-sync.d.ts","sourceRoot":"","sources":["../src/reference-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"reference-sync.d.ts","sourceRoot":"","sources":["../src/reference-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,KAAK,QAAQ,EAId,MAAM,4BAA4B,CAAC;AAMpC,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,UAAU,EAAE,eAAe,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;CACrB;AAmBD;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAoCpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAuBlB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,MAAM,CAAC,CA6BjB;AAMD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAMzE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,GACb,MAAM,CASR"}
|
package/dist/reference-sync.js
CHANGED
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
|
-
import { getSession } from "
|
|
13
|
-
import { logger } from "./logger.js";
|
|
14
|
-
import { NODE_LABEL } from "./constants.js";
|
|
15
|
-
import { isReferenceNode, } from "./types.js";
|
|
16
|
-
import { createReferenceNode, updateNode, recordToNode } from "./node-store.js";
|
|
12
|
+
import { getSession, logger, NODE_LABEL, isReferenceNode, createReferenceNode, updateNode, recordToNode, } from "@grackle-ai/knowledge-core";
|
|
17
13
|
// ---------------------------------------------------------------------------
|
|
18
14
|
// Cypher queries
|
|
19
15
|
// ---------------------------------------------------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-sync.js","sourceRoot":"","sources":["../src/reference-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"reference-sync.js","sourceRoot":"","sources":["../src/reference-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,UAAU,EACV,MAAM,EACN,UAAU,EAGV,eAAe,EAEf,mBAAmB,EACnB,UAAU,EACV,YAAY,GACb,MAAM,4BAA4B,CAAC;AAoBpC,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,MAAM,qBAAqB,GAAW;aACzB,UAAU;WACZ,CAAC;AAEZ,MAAM,uBAAuB,GAAW;aAC3B,UAAU;;6BAEM,CAAC;AAE9B,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,UAA2B,EAC3B,QAAgB;IAEhB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE;YACtD,UAAU;YACV,QAAQ;SACT,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAE1C,CAAC;QACF,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CACT,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EACzC,wDAAwD,CACzD,CAAC;YACF,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,IAA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,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,OAAe,EACf,IAAc;IAEd,MAAM,KAAK,GAAa,CAAC,aAAa,KAAK,EAAE,CAAC,CAAC;IAC/C,IAAI,OAAO,EAAE,CAAC;QACZ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grackle-ai/knowledge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "Knowledge graph subsystem for Grackle (Neo4j + vector search)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,10 +24,7 @@
|
|
|
24
24
|
"dist/"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"neo4j-driver": "^6.0.1",
|
|
29
|
-
"pino": "^10.3.1",
|
|
30
|
-
"@grackle-ai/common": "0.62.2"
|
|
27
|
+
"@grackle-ai/knowledge-core": "0.64.0"
|
|
31
28
|
},
|
|
32
29
|
"devDependencies": {
|
|
33
30
|
"@rushstack/heft": "1.2.4",
|
package/dist/chunker.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pluggable chunker interface for splitting content into embeddable pieces.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
/** A chunk of content produced by a {@link Chunker}. */
|
|
7
|
-
export interface Chunk {
|
|
8
|
-
/** The text content of this chunk. */
|
|
9
|
-
text: string;
|
|
10
|
-
/** Zero-based index of this chunk within the source content. */
|
|
11
|
-
index: number;
|
|
12
|
-
/** Optional metadata carried through from the source or added by the chunker. */
|
|
13
|
-
metadata?: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
/** Splits content into chunks suitable for embedding. */
|
|
16
|
-
export interface Chunker {
|
|
17
|
-
/** Split content into one or more chunks. */
|
|
18
|
-
chunk(content: string, metadata?: Record<string, unknown>): Chunk[];
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=chunker.d.ts.map
|
package/dist/chunker.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunker.d.ts","sourceRoot":"","sources":["../src/chunker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wDAAwD;AACxD,MAAM,WAAW,KAAK;IACpB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,yDAAyD;AACzD,MAAM,WAAW,OAAO;IACtB,6CAA6C;IAC7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,EAAE,CAAC;CACrE"}
|
package/dist/chunker.js
DELETED
package/dist/chunker.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunker.js","sourceRoot":"","sources":["../src/chunker.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/dist/client.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Neo4j driver singleton — connection management, health checks, and shutdown.
|
|
3
|
-
*
|
|
4
|
-
* Follows the same singleton pattern as `packages/server/src/db.ts`.
|
|
5
|
-
* Call {@link openNeo4j} once at startup, then use {@link getDriver} or
|
|
6
|
-
* {@link getSession} for queries, and {@link closeNeo4j} on shutdown.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import { type Driver, type Session } from "neo4j-driver";
|
|
11
|
-
/** Configuration for the Neo4j connection. */
|
|
12
|
-
export interface Neo4jClientConfig {
|
|
13
|
-
/** Bolt URL (default: bolt://127.0.0.1:7687). */
|
|
14
|
-
url?: string;
|
|
15
|
-
/** Username (default: neo4j). */
|
|
16
|
-
username?: string;
|
|
17
|
-
/** Password (default: grackle-dev). */
|
|
18
|
-
password?: string;
|
|
19
|
-
/** Neo4j database name (default: neo4j). */
|
|
20
|
-
database?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Open a connection to Neo4j.
|
|
24
|
-
*
|
|
25
|
-
* Reads configuration from environment variables first, then from the
|
|
26
|
-
* provided {@link Neo4jClientConfig}, then from built-in defaults.
|
|
27
|
-
*
|
|
28
|
-
* Idempotent — returns silently if a connection is already open.
|
|
29
|
-
*
|
|
30
|
-
* | Env Variable | Fallback |
|
|
31
|
-
* |--------------------------|---------------------|
|
|
32
|
-
* | `GRACKLE_NEO4J_URL` | `config.url` |
|
|
33
|
-
* | `GRACKLE_NEO4J_USER` | `config.username` |
|
|
34
|
-
* | `GRACKLE_NEO4J_PASSWORD` | `config.password` |
|
|
35
|
-
* | `GRACKLE_NEO4J_DATABASE` | `config.database` |
|
|
36
|
-
*/
|
|
37
|
-
export declare function openNeo4j(config?: Neo4jClientConfig): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Get a Neo4j session for running queries.
|
|
40
|
-
*
|
|
41
|
-
* Sessions are lightweight and should be short-lived — open one per
|
|
42
|
-
* logical unit of work and close it when done.
|
|
43
|
-
*
|
|
44
|
-
* @throws If {@link openNeo4j} has not been called.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getSession(): Session;
|
|
47
|
-
/**
|
|
48
|
-
* Get the raw Neo4j driver instance.
|
|
49
|
-
*
|
|
50
|
-
* Prefer {@link getSession} for most use cases. Use the driver directly
|
|
51
|
-
* only when you need `driver.executeQuery()` for simple one-shot queries.
|
|
52
|
-
*
|
|
53
|
-
* @throws If {@link openNeo4j} has not been called.
|
|
54
|
-
*/
|
|
55
|
-
export declare function getDriver(): Driver;
|
|
56
|
-
/**
|
|
57
|
-
* Check Neo4j connectivity.
|
|
58
|
-
*
|
|
59
|
-
* @returns `true` if the connection is healthy, `false` otherwise.
|
|
60
|
-
*/
|
|
61
|
-
export declare function healthCheck(): Promise<boolean>;
|
|
62
|
-
/**
|
|
63
|
-
* Gracefully close the Neo4j connection and release resources.
|
|
64
|
-
*
|
|
65
|
-
* Safe to call multiple times or when no connection is open.
|
|
66
|
-
*/
|
|
67
|
-
export declare function closeNeo4j(): Promise<void>;
|
|
68
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAc,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAehE,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBnE;AAgDD;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAKpC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAKlC;AAED;;;;GAIG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAUpD;AAED;;;;GAIG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAYhD"}
|
package/dist/client.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Neo4j driver singleton — connection management, health checks, and shutdown.
|
|
3
|
-
*
|
|
4
|
-
* Follows the same singleton pattern as `packages/server/src/db.ts`.
|
|
5
|
-
* Call {@link openNeo4j} once at startup, then use {@link getDriver} or
|
|
6
|
-
* {@link getSession} for queries, and {@link closeNeo4j} on shutdown.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import neo4j from "neo4j-driver";
|
|
11
|
-
import { logger } from "./logger.js";
|
|
12
|
-
import { DEFAULT_NEO4J_URL, DEFAULT_NEO4J_USER, DEFAULT_NEO4J_PASSWORD, DEFAULT_NEO4J_DATABASE, NEO4J_MAX_POOL_SIZE, NEO4J_CONNECTION_ACQUISITION_TIMEOUT, } from "./constants.js";
|
|
13
|
-
// ---------------------------------------------------------------------------
|
|
14
|
-
// Singleton state
|
|
15
|
-
// ---------------------------------------------------------------------------
|
|
16
|
-
/** Module-level singleton driver instance. */
|
|
17
|
-
let driver;
|
|
18
|
-
/** Promise that resolves when initialization is complete (guards concurrent calls). */
|
|
19
|
-
let initPromise;
|
|
20
|
-
/** The database name used when creating sessions. */
|
|
21
|
-
let databaseName = DEFAULT_NEO4J_DATABASE;
|
|
22
|
-
// ---------------------------------------------------------------------------
|
|
23
|
-
// Public API
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
/**
|
|
26
|
-
* Open a connection to Neo4j.
|
|
27
|
-
*
|
|
28
|
-
* Reads configuration from environment variables first, then from the
|
|
29
|
-
* provided {@link Neo4jClientConfig}, then from built-in defaults.
|
|
30
|
-
*
|
|
31
|
-
* Idempotent — returns silently if a connection is already open.
|
|
32
|
-
*
|
|
33
|
-
* | Env Variable | Fallback |
|
|
34
|
-
* |--------------------------|---------------------|
|
|
35
|
-
* | `GRACKLE_NEO4J_URL` | `config.url` |
|
|
36
|
-
* | `GRACKLE_NEO4J_USER` | `config.username` |
|
|
37
|
-
* | `GRACKLE_NEO4J_PASSWORD` | `config.password` |
|
|
38
|
-
* | `GRACKLE_NEO4J_DATABASE` | `config.database` |
|
|
39
|
-
*/
|
|
40
|
-
export function openNeo4j(config) {
|
|
41
|
-
if (driver) {
|
|
42
|
-
return Promise.resolve();
|
|
43
|
-
}
|
|
44
|
-
// Guard against concurrent calls: if an init is already in flight, await it.
|
|
45
|
-
if (initPromise) {
|
|
46
|
-
return initPromise;
|
|
47
|
-
}
|
|
48
|
-
// Wrap the async work so initPromise is cleared synchronously after settlement.
|
|
49
|
-
initPromise = doOpen(config).finally(() => {
|
|
50
|
-
initPromise = undefined;
|
|
51
|
-
});
|
|
52
|
-
return initPromise;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Internal init logic — separated so {@link openNeo4j} can guard concurrency
|
|
56
|
-
* with a shared promise.
|
|
57
|
-
*/
|
|
58
|
-
async function doOpen(config) {
|
|
59
|
-
const url = process.env.GRACKLE_NEO4J_URL || config?.url || DEFAULT_NEO4J_URL;
|
|
60
|
-
const username = process.env.GRACKLE_NEO4J_USER || config?.username || DEFAULT_NEO4J_USER;
|
|
61
|
-
const explicitPassword = process.env.GRACKLE_NEO4J_PASSWORD || config?.password;
|
|
62
|
-
if (!explicitPassword && process.env.NODE_ENV === "production") {
|
|
63
|
-
throw new Error("GRACKLE_NEO4J_PASSWORD must be set in production. " +
|
|
64
|
-
"Refusing to use the default development password.");
|
|
65
|
-
}
|
|
66
|
-
const password = explicitPassword || DEFAULT_NEO4J_PASSWORD;
|
|
67
|
-
databaseName =
|
|
68
|
-
process.env.GRACKLE_NEO4J_DATABASE ||
|
|
69
|
-
config?.database ||
|
|
70
|
-
DEFAULT_NEO4J_DATABASE;
|
|
71
|
-
logger.info({ url, database: databaseName }, "Connecting to Neo4j");
|
|
72
|
-
const newDriver = neo4j.driver(url, neo4j.auth.basic(username, password), {
|
|
73
|
-
disableLosslessIntegers: true,
|
|
74
|
-
maxConnectionPoolSize: NEO4J_MAX_POOL_SIZE,
|
|
75
|
-
connectionAcquisitionTimeout: NEO4J_CONNECTION_ACQUISITION_TIMEOUT,
|
|
76
|
-
});
|
|
77
|
-
try {
|
|
78
|
-
await newDriver.verifyConnectivity({ database: databaseName });
|
|
79
|
-
logger.info("Neo4j connectivity verified");
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
await newDriver.close().catch(() => { });
|
|
83
|
-
throw new Error(`Failed to connect to Neo4j at ${url}: ${error instanceof Error ? error.message : String(error)}. ` +
|
|
84
|
-
"Ensure Neo4j is running and the credentials are correct.", { cause: error });
|
|
85
|
-
}
|
|
86
|
-
driver = newDriver;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Get a Neo4j session for running queries.
|
|
90
|
-
*
|
|
91
|
-
* Sessions are lightweight and should be short-lived — open one per
|
|
92
|
-
* logical unit of work and close it when done.
|
|
93
|
-
*
|
|
94
|
-
* @throws If {@link openNeo4j} has not been called.
|
|
95
|
-
*/
|
|
96
|
-
export function getSession() {
|
|
97
|
-
if (!driver) {
|
|
98
|
-
throw new Error("Neo4j not initialized. Call openNeo4j() first.");
|
|
99
|
-
}
|
|
100
|
-
return driver.session({ database: databaseName });
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Get the raw Neo4j driver instance.
|
|
104
|
-
*
|
|
105
|
-
* Prefer {@link getSession} for most use cases. Use the driver directly
|
|
106
|
-
* only when you need `driver.executeQuery()` for simple one-shot queries.
|
|
107
|
-
*
|
|
108
|
-
* @throws If {@link openNeo4j} has not been called.
|
|
109
|
-
*/
|
|
110
|
-
export function getDriver() {
|
|
111
|
-
if (!driver) {
|
|
112
|
-
throw new Error("Neo4j not initialized. Call openNeo4j() first.");
|
|
113
|
-
}
|
|
114
|
-
return driver;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Check Neo4j connectivity.
|
|
118
|
-
*
|
|
119
|
-
* @returns `true` if the connection is healthy, `false` otherwise.
|
|
120
|
-
*/
|
|
121
|
-
export async function healthCheck() {
|
|
122
|
-
if (!driver) {
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
try {
|
|
126
|
-
await driver.verifyConnectivity({ database: databaseName });
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
catch {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Gracefully close the Neo4j connection and release resources.
|
|
135
|
-
*
|
|
136
|
-
* Safe to call multiple times or when no connection is open.
|
|
137
|
-
*/
|
|
138
|
-
export async function closeNeo4j() {
|
|
139
|
-
// Wait for any in-flight initialization to settle before closing.
|
|
140
|
-
if (initPromise) {
|
|
141
|
-
await initPromise.catch(() => { });
|
|
142
|
-
}
|
|
143
|
-
const current = driver;
|
|
144
|
-
if (current) {
|
|
145
|
-
driver = undefined;
|
|
146
|
-
logger.info("Closing Neo4j connection");
|
|
147
|
-
await current.close();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAoC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,gBAAgB,CAAC;AAkBxB,8EA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E,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,kEAAkE;IAClE,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC;IACvB,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,GAAG,SAAS,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACxC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
package/dist/constants.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants for the Neo4j knowledge graph subsystem.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
/** Default Neo4j Bolt connection URL. */
|
|
7
|
-
export declare const DEFAULT_NEO4J_URL: string;
|
|
8
|
-
/** Default Neo4j username. */
|
|
9
|
-
export declare const DEFAULT_NEO4J_USER: string;
|
|
10
|
-
/**
|
|
11
|
-
* Default Neo4j password (development only; production should always override).
|
|
12
|
-
*
|
|
13
|
-
* Not re-exported from the package barrel to avoid leaking a credential
|
|
14
|
-
* constant in the public API.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare const DEFAULT_NEO4J_PASSWORD: string;
|
|
19
|
-
/** Default Neo4j database name. */
|
|
20
|
-
export declare const DEFAULT_NEO4J_DATABASE: string;
|
|
21
|
-
/** Maximum number of connections in the Neo4j driver pool. */
|
|
22
|
-
export declare const NEO4J_MAX_POOL_SIZE: number;
|
|
23
|
-
/** Timeout (ms) for acquiring a connection from the Neo4j pool. */
|
|
24
|
-
export declare const NEO4J_CONNECTION_ACQUISITION_TIMEOUT: number;
|
|
25
|
-
/** Neo4j node label applied to all knowledge graph nodes. */
|
|
26
|
-
export declare const NODE_LABEL: string;
|
|
27
|
-
/** Name of the vector index on knowledge node embeddings. */
|
|
28
|
-
export declare const VECTOR_INDEX_NAME: string;
|
|
29
|
-
/** Dimensionality of the embedding vectors (OpenAI text-embedding-3-small). */
|
|
30
|
-
export declare const EMBEDDING_DIMENSIONS: number;
|
|
31
|
-
/** Similarity function used by the vector index. */
|
|
32
|
-
export declare const VECTOR_SIMILARITY_FUNCTION: string;
|
|
33
|
-
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,EAAE,MAAgC,CAAC;AAEjE,8BAA8B;AAC9B,eAAO,MAAM,kBAAkB,EAAE,MAAgB,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAsB,CAAC;AAE5D,mCAAmC;AACnC,eAAO,MAAM,sBAAsB,EAAE,MAAgB,CAAC;AAEtD,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,EAAE,MAAW,CAAC;AAE9C,mEAAmE;AACnE,eAAO,MAAM,oCAAoC,EAAE,MAAe,CAAC;AAEnE,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,MAAwB,CAAC;AAElD,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,EAAE,MAAoC,CAAC;AAErE,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,EAAE,MAAa,CAAC;AAEjD,oDAAoD;AACpD,eAAO,MAAM,0BAA0B,EAAE,MAAiB,CAAC"}
|
package/dist/constants.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants for the Neo4j knowledge graph subsystem.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
/** Default Neo4j Bolt connection URL. */
|
|
7
|
-
export const DEFAULT_NEO4J_URL = "bolt://127.0.0.1:7687";
|
|
8
|
-
/** Default Neo4j username. */
|
|
9
|
-
export const DEFAULT_NEO4J_USER = "neo4j";
|
|
10
|
-
/**
|
|
11
|
-
* Default Neo4j password (development only; production should always override).
|
|
12
|
-
*
|
|
13
|
-
* Not re-exported from the package barrel to avoid leaking a credential
|
|
14
|
-
* constant in the public API.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export const DEFAULT_NEO4J_PASSWORD = "grackle-dev";
|
|
19
|
-
/** Default Neo4j database name. */
|
|
20
|
-
export const DEFAULT_NEO4J_DATABASE = "neo4j";
|
|
21
|
-
/** Maximum number of connections in the Neo4j driver pool. */
|
|
22
|
-
export const NEO4J_MAX_POOL_SIZE = 50;
|
|
23
|
-
/** Timeout (ms) for acquiring a connection from the Neo4j pool. */
|
|
24
|
-
export const NEO4J_CONNECTION_ACQUISITION_TIMEOUT = 30_000;
|
|
25
|
-
/** Neo4j node label applied to all knowledge graph nodes. */
|
|
26
|
-
export const NODE_LABEL = "KnowledgeNode";
|
|
27
|
-
/** Name of the vector index on knowledge node embeddings. */
|
|
28
|
-
export const VECTOR_INDEX_NAME = "knowledge_embedding_index";
|
|
29
|
-
/** Dimensionality of the embedding vectors (OpenAI text-embedding-3-small). */
|
|
30
|
-
export const EMBEDDING_DIMENSIONS = 1536;
|
|
31
|
-
/** Similarity function used by the vector index. */
|
|
32
|
-
export const VECTOR_SIMILARITY_FUNCTION = "cosine";
|
|
33
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yCAAyC;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAW,uBAAuB,CAAC;AAEjE,8BAA8B;AAC9B,MAAM,CAAC,MAAM,kBAAkB,GAAW,OAAO,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAW,aAAa,CAAC;AAE5D,mCAAmC;AACnC,MAAM,CAAC,MAAM,sBAAsB,GAAW,OAAO,CAAC;AAEtD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAW,EAAE,CAAC;AAE9C,mEAAmE;AACnE,MAAM,CAAC,MAAM,oCAAoC,GAAW,MAAM,CAAC;AAEnE,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAW,eAAe,CAAC;AAElD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAW,2BAA2B,CAAC;AAErE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,oBAAoB,GAAW,IAAI,CAAC;AAEjD,oDAAoD;AACpD,MAAM,CAAC,MAAM,0BAA0B,GAAW,QAAQ,CAAC"}
|
package/dist/edge-store.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edge CRUD operations for the knowledge graph.
|
|
3
|
-
*
|
|
4
|
-
* Provides create and remove operations for typed relationships between
|
|
5
|
-
* {@link KnowledgeNode} instances, backed by Neo4j.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import { type EdgeType, type KnowledgeEdge } from "./types.js";
|
|
10
|
-
/**
|
|
11
|
-
* Create a typed edge between two nodes.
|
|
12
|
-
*
|
|
13
|
-
* @param fromId - Source node ID.
|
|
14
|
-
* @param toId - Target node ID.
|
|
15
|
-
* @param type - Relationship type (must be a valid {@link EdgeType}).
|
|
16
|
-
* @param metadata - Optional metadata to attach to the edge.
|
|
17
|
-
* @returns The created edge.
|
|
18
|
-
* @throws If either node does not exist.
|
|
19
|
-
* @throws If the edge type is invalid.
|
|
20
|
-
*/
|
|
21
|
-
export declare function createEdge(fromId: string, toId: string, type: EdgeType, metadata?: Record<string, unknown>): Promise<KnowledgeEdge>;
|
|
22
|
-
/**
|
|
23
|
-
* Remove an edge between two nodes.
|
|
24
|
-
*
|
|
25
|
-
* @param fromId - Source node ID.
|
|
26
|
-
* @param toId - Target node ID.
|
|
27
|
-
* @param type - Relationship type to remove.
|
|
28
|
-
* @returns `true` if an edge was removed, `false` if no matching edge existed.
|
|
29
|
-
* @throws If the edge type is invalid.
|
|
30
|
-
*/
|
|
31
|
-
export declare function removeEdge(fromId: string, toId: string, type: EdgeType): Promise<boolean>;
|
|
32
|
-
//# sourceMappingURL=edge-store.d.ts.map
|
package/dist/edge-store.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-store.d.ts","sourceRoot":"","sources":["../src/edge-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAa,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAwD1E;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,OAAO,CAAC,aAAa,CAAC,CAiDxB;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,OAAO,CAAC,CAsBlB"}
|