@equationalapplications/expo-llm-wiki 4.16.0 → 4.17.1

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/README.md CHANGED
@@ -14,22 +14,25 @@ Local-first LLM memory for Expo and React Native. Combines the core semantic sea
14
14
 
15
15
  - **Expo-ready** — Pre-configured for React Native + Expo
16
16
  - **Built on `expo-sqlite`** — Stable, well-supported SQLite driver
17
+ - **Hermes-ready** — Secure record ID generation via [`expo-crypto`](https://docs.expo.dev/versions/latest/sdk/crypto/); wired automatically at import (no manual `crypto` polyfill)
17
18
  - **Semantic search** — Vector embeddings via `embed` function, with MiniSearch fallback
18
19
  - **Retrieval tuning** — Per-call overrides for search behavior (pre-filter, hybrid blend, tier weights)
19
20
  - **Multi-entity reads** — Search across multiple `entity_id` namespaces in one pass with `tierWeights`
20
21
  - **Source provenance** — `WikiFact.source_type` distinguishes immutable document facts (`immutable_document`) from mutable derived/user facts. Immutable document content is protected from librarian/heal rewriting and only changed by `forget()` or re-ingest.
21
22
  - **Seeded ontologies** — Enforce strict taxonomies or allow emergent graph relationship extraction (`useOntologyManifest`, `useSetOntologyManifest`; Strict, Emergent, or Off; defaults to Off).
22
- - **React hooks** — `WikiProvider`, `useMemoryRead`, `useOntologyManifest`, `useSetOntologyManifest`, and all other hooks re-exported from `@equationalapplications/expo-llm-wiki`
23
+ - **React hooks** — `WikiProvider`, `useMemoryRead`, `useOntologyManifest`, `useSetOntologyManifest`, `useWikiTraversal`, and all other hooks re-exported from `@equationalapplications/expo-llm-wiki`
23
24
  - **Full-featured memory** — Facts, tasks, events, maintenance jobs (librarian, heal, reembed, prune)
24
25
  - **Interoperability:** Supports [Open Knowledge Format (OKF) v0.1](https://github.com/GoogleCloudPlatform/knowledge-catalog/tree/main/okf) import and export.
25
26
 
26
27
  ## Installation
27
28
 
28
29
  ```bash
29
- npx expo install expo-sqlite
30
+ npx expo install expo-sqlite expo-crypto
30
31
  npm install @equationalapplications/expo-llm-wiki
31
32
  ```
32
33
 
34
+ `expo-crypto` is a peer dependency. The package wires its `getRandomValues` into the core engine at module load — Hermes and React Native lack the Web `crypto` global, and wiki writes need a cryptographically secure random source for record IDs. No extra setup is required after install; importing `@equationalapplications/expo-llm-wiki` (or the `/factory` subpath) activates it before any `createWiki()` call.
35
+
33
36
  ## Semantic Search
34
37
 
35
38
  Enable vector-based retrieval by providing an `embed` function:
@@ -280,6 +283,27 @@ Global defaults and `seedManifests` bootstrap are configured at construction tim
280
283
 
281
284
  `useSetOntologyManifest` does not automatically refresh `useOntologyManifest` — call `refetch()` after a successful `execute()`, same as `useWikiWrite` + `useMemoryRead`.
282
285
 
286
+ ### `useWikiTraversal(entityId, options)`
287
+
288
+ Reactive read — fetches on mount and whenever `entityId` or `options` change. Walks the knowledge graph N hops outward from a fact (`options.sourceId`) using edges written by `runLibrarian()`/`ingestDocument()`'s Seeded Ontology extraction pass:
289
+
290
+ ```typescript
291
+ import { useWikiTraversal, formatGraphContext } from '@equationalapplications/expo-llm-wiki';
292
+
293
+ const { nodes, edges, isPending, error, refetch } = useWikiTraversal('user-123', {
294
+ sourceId: 'fact_42',
295
+ maxDepth: 2,
296
+ direction: 'both',
297
+ });
298
+
299
+ const promptContext = formatGraphContext({ nodes, edges });
300
+ ```
301
+
302
+ - `maxDepth` is clamped to `[1, 3]` regardless of input.
303
+ - `edgeTypes: []` (explicit empty array) matches nothing; omitting it matches all edge types.
304
+ - Defaults (`maxTraversalNodes`, `minTraversalConfidence`, `traversalDirection`, `excludeSourceTypes`) can be set globally via `createWiki(..., { config: { maxTraversalNodes: 20, ... } })` and overridden per-call.
305
+ - `formatGraphContext()` is a pure function — call it with the hook's `{ nodes, edges }` to get a dense text block suitable for prompt injection.
306
+
283
307
  ## Component Lifecycle
284
308
 
285
309
  ```mermaid
@@ -19,7 +19,12 @@ function createExpoAdapter(db) {
19
19
  return adapter;
20
20
  }
21
21
 
22
+ // src/initRandomSource.ts
23
+ import { getRandomValues } from "expo-crypto";
24
+ import { configureRandomSource } from "@equationalapplications/core-llm-wiki";
25
+ configureRandomSource(getRandomValues);
26
+
22
27
  export {
23
28
  createExpoAdapter
24
29
  };
25
- //# sourceMappingURL=chunk-I2HESFG7.mjs.map
30
+ //# sourceMappingURL=chunk-TMAWD3GO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapter.ts","../src/initRandomSource.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport type { SQLiteAdapter } from '@equationalapplications/core-llm-wiki';\n\nexport function createExpoAdapter(db: SQLite.SQLiteDatabase): SQLiteAdapter {\n const adapter: SQLiteAdapter = {\n execAsync: (sql) => db.execAsync(sql),\n runAsync: async (sql, params = []) => {\n const result = await db.runAsync(sql, params as any[]);\n return { changes: result.changes, lastInsertRowId: result.lastInsertRowId };\n },\n getAllAsync: (sql, params = []) => db.getAllAsync(sql, params as any[]),\n getFirstAsync: (sql, params = []) => db.getFirstAsync(sql, params as any[]),\n withTransactionAsync: <T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T> => {\n // expo-sqlite only accepts () => Promise<void>; capture the result to satisfy the generic interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let captured: any;\n return db.withTransactionAsync(() => fn(adapter).then(v => { captured = v; })).then(() => captured as T);\n },\n closeAsync: () => db.closeAsync(),\n };\n return adapter;\n}\n","import { getRandomValues } from 'expo-crypto';\nimport { configureRandomSource } from '@equationalapplications/core-llm-wiki';\n\n// Install expo-crypto as the random source for Hermes / React Native, where\n// the global `crypto` API is absent. Runs once at module load — any import of\n// `@equationalapplications/expo-llm-wiki` or its `/factory` subpath activates it.\nconfigureRandomSource(getRandomValues);\n"],"mappings":";AAGO,SAAS,kBAAkB,IAA0C;AAC1E,QAAM,UAAyB;AAAA,IAC7B,WAAW,CAAC,QAAQ,GAAG,UAAU,GAAG;AAAA,IACpC,UAAU,OAAO,KAAK,SAAS,CAAC,MAAM;AACpC,YAAM,SAAS,MAAM,GAAG,SAAS,KAAK,MAAe;AACrD,aAAO,EAAE,SAAS,OAAO,SAAS,iBAAiB,OAAO,gBAAgB;AAAA,IAC5E;AAAA,IACA,aAAa,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,YAAY,KAAK,MAAe;AAAA,IACtE,eAAe,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,cAAc,KAAK,MAAe;AAAA,IAC1E,sBAAsB,CAAI,OAAsD;AAG9E,UAAI;AACJ,aAAO,GAAG,qBAAqB,MAAM,GAAG,OAAO,EAAE,KAAK,OAAK;AAAE,mBAAW;AAAA,MAAG,CAAC,CAAC,EAAE,KAAK,MAAM,QAAa;AAAA,IACzG;AAAA,IACA,YAAY,MAAM,GAAG,WAAW;AAAA,EAClC;AACA,SAAO;AACT;;;ACrBA,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AAKtC,sBAAsB,eAAe;","names":[]}
package/dist/factory.js CHANGED
@@ -23,7 +23,7 @@ __export(factory_exports, {
23
23
  createWiki: () => createWiki
24
24
  });
25
25
  module.exports = __toCommonJS(factory_exports);
26
- var import_core_llm_wiki = require("@equationalapplications/core-llm-wiki");
26
+ var import_core_llm_wiki2 = require("@equationalapplications/core-llm-wiki");
27
27
 
28
28
  // src/adapter.ts
29
29
  function createExpoAdapter(db) {
@@ -46,9 +46,14 @@ function createExpoAdapter(db) {
46
46
  return adapter;
47
47
  }
48
48
 
49
+ // src/initRandomSource.ts
50
+ var import_expo_crypto = require("expo-crypto");
51
+ var import_core_llm_wiki = require("@equationalapplications/core-llm-wiki");
52
+ (0, import_core_llm_wiki.configureRandomSource)(import_expo_crypto.getRandomValues);
53
+
49
54
  // src/factory.ts
50
55
  function createWiki(db, options) {
51
- return new import_core_llm_wiki.WikiMemory(createExpoAdapter(db), options);
56
+ return new import_core_llm_wiki2.WikiMemory(createExpoAdapter(db), options);
52
57
  }
53
58
  // Annotate the CommonJS export names for ESM import in node:
54
59
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/factory.ts","../src/adapter.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\n\n/**\n * Create a WikiMemory instance from an expo-sqlite SQLiteDatabase.\n * This factory is exported as a separate subpath (`@equationalapplications/expo-llm-wiki/factory`)\n * so that callers can obtain `createWiki` without loading the React hooks\n * that `@equationalapplications/expo-llm-wiki`'s main entry re-exports from `@equationalapplications/react-llm-wiki`.\n */\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n","import type * as SQLite from 'expo-sqlite';\nimport type { SQLiteAdapter } from '@equationalapplications/core-llm-wiki';\n\nexport function createExpoAdapter(db: SQLite.SQLiteDatabase): SQLiteAdapter {\n const adapter: SQLiteAdapter = {\n execAsync: (sql) => db.execAsync(sql),\n runAsync: async (sql, params = []) => {\n const result = await db.runAsync(sql, params as any[]);\n return { changes: result.changes, lastInsertRowId: result.lastInsertRowId };\n },\n getAllAsync: (sql, params = []) => db.getAllAsync(sql, params as any[]),\n getFirstAsync: (sql, params = []) => db.getFirstAsync(sql, params as any[]),\n withTransactionAsync: <T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T> => {\n // expo-sqlite only accepts () => Promise<void>; capture the result to satisfy the generic interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let captured: any;\n return db.withTransactionAsync(() => fn(adapter).then(v => { captured = v; })).then(() => captured as T);\n },\n closeAsync: () => db.closeAsync(),\n };\n return adapter;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAA6C;;;ACEtC,SAAS,kBAAkB,IAA0C;AAC1E,QAAM,UAAyB;AAAA,IAC7B,WAAW,CAAC,QAAQ,GAAG,UAAU,GAAG;AAAA,IACpC,UAAU,OAAO,KAAK,SAAS,CAAC,MAAM;AACpC,YAAM,SAAS,MAAM,GAAG,SAAS,KAAK,MAAe;AACrD,aAAO,EAAE,SAAS,OAAO,SAAS,iBAAiB,OAAO,gBAAgB;AAAA,IAC5E;AAAA,IACA,aAAa,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,YAAY,KAAK,MAAe;AAAA,IACtE,eAAe,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,cAAc,KAAK,MAAe;AAAA,IAC1E,sBAAsB,CAAI,OAAsD;AAG9E,UAAI;AACJ,aAAO,GAAG,qBAAqB,MAAM,GAAG,OAAO,EAAE,KAAK,OAAK;AAAE,mBAAW;AAAA,MAAG,CAAC,CAAC,EAAE,KAAK,MAAM,QAAa;AAAA,IACzG;AAAA,IACA,YAAY,MAAM,GAAG,WAAW;AAAA,EAClC;AACA,SAAO;AACT;;;ADXO,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,gCAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":[]}
1
+ {"version":3,"sources":["../src/factory.ts","../src/adapter.ts","../src/initRandomSource.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\nimport './initRandomSource';\n\n/**\n * Create a WikiMemory instance from an expo-sqlite SQLiteDatabase.\n * This factory is exported as a separate subpath (`@equationalapplications/expo-llm-wiki/factory`)\n * so that callers can obtain `createWiki` without loading the React hooks\n * that `@equationalapplications/expo-llm-wiki`'s main entry re-exports from `@equationalapplications/react-llm-wiki`.\n */\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n","import type * as SQLite from 'expo-sqlite';\nimport type { SQLiteAdapter } from '@equationalapplications/core-llm-wiki';\n\nexport function createExpoAdapter(db: SQLite.SQLiteDatabase): SQLiteAdapter {\n const adapter: SQLiteAdapter = {\n execAsync: (sql) => db.execAsync(sql),\n runAsync: async (sql, params = []) => {\n const result = await db.runAsync(sql, params as any[]);\n return { changes: result.changes, lastInsertRowId: result.lastInsertRowId };\n },\n getAllAsync: (sql, params = []) => db.getAllAsync(sql, params as any[]),\n getFirstAsync: (sql, params = []) => db.getFirstAsync(sql, params as any[]),\n withTransactionAsync: <T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T> => {\n // expo-sqlite only accepts () => Promise<void>; capture the result to satisfy the generic interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let captured: any;\n return db.withTransactionAsync(() => fn(adapter).then(v => { captured = v; })).then(() => captured as T);\n },\n closeAsync: () => db.closeAsync(),\n };\n return adapter;\n}\n","import { getRandomValues } from 'expo-crypto';\nimport { configureRandomSource } from '@equationalapplications/core-llm-wiki';\n\n// Install expo-crypto as the random source for Hermes / React Native, where\n// the global `crypto` API is absent. Runs once at module load — any import of\n// `@equationalapplications/expo-llm-wiki` or its `/factory` subpath activates it.\nconfigureRandomSource(getRandomValues);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,wBAA6C;;;ACEtC,SAAS,kBAAkB,IAA0C;AAC1E,QAAM,UAAyB;AAAA,IAC7B,WAAW,CAAC,QAAQ,GAAG,UAAU,GAAG;AAAA,IACpC,UAAU,OAAO,KAAK,SAAS,CAAC,MAAM;AACpC,YAAM,SAAS,MAAM,GAAG,SAAS,KAAK,MAAe;AACrD,aAAO,EAAE,SAAS,OAAO,SAAS,iBAAiB,OAAO,gBAAgB;AAAA,IAC5E;AAAA,IACA,aAAa,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,YAAY,KAAK,MAAe;AAAA,IACtE,eAAe,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,cAAc,KAAK,MAAe;AAAA,IAC1E,sBAAsB,CAAI,OAAsD;AAG9E,UAAI;AACJ,aAAO,GAAG,qBAAqB,MAAM,GAAG,OAAO,EAAE,KAAK,OAAK;AAAE,mBAAW;AAAA,MAAG,CAAC,CAAC,EAAE,KAAK,MAAM,QAAa;AAAA,IACzG;AAAA,IACA,YAAY,MAAM,GAAG,WAAW;AAAA,EAClC;AACA,SAAO;AACT;;;ACrBA,yBAAgC;AAChC,2BAAsC;AAAA,IAKtC,4CAAsB,kCAAe;;;AFK9B,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,iCAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":["import_core_llm_wiki"]}
package/dist/factory.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createExpoAdapter
3
- } from "./chunk-I2HESFG7.mjs";
3
+ } from "./chunk-TMAWD3GO.mjs";
4
4
 
5
5
  // src/factory.ts
6
6
  import { WikiMemory } from "@equationalapplications/core-llm-wiki";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\n\n/**\n * Create a WikiMemory instance from an expo-sqlite SQLiteDatabase.\n * This factory is exported as a separate subpath (`@equationalapplications/expo-llm-wiki/factory`)\n * so that callers can obtain `createWiki` without loading the React hooks\n * that `@equationalapplications/expo-llm-wiki`'s main entry re-exports from `@equationalapplications/react-llm-wiki`.\n */\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n"],"mappings":";;;;;AACA,SAAS,kBAAoC;AAStC,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,WAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":[]}
1
+ {"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\nimport './initRandomSource';\n\n/**\n * Create a WikiMemory instance from an expo-sqlite SQLiteDatabase.\n * This factory is exported as a separate subpath (`@equationalapplications/expo-llm-wiki/factory`)\n * so that callers can obtain `createWiki` without loading the React hooks\n * that `@equationalapplications/expo-llm-wiki`'s main entry re-exports from `@equationalapplications/react-llm-wiki`.\n */\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n"],"mappings":";;;;;AACA,SAAS,kBAAoC;AAUtC,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,WAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":[]}
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ __export(index_exports, {
24
24
  createWiki: () => createWiki
25
25
  });
26
26
  module.exports = __toCommonJS(index_exports);
27
- var import_core_llm_wiki = require("@equationalapplications/core-llm-wiki");
27
+ var import_core_llm_wiki2 = require("@equationalapplications/core-llm-wiki");
28
28
 
29
29
  // src/adapter.ts
30
30
  function createExpoAdapter(db) {
@@ -47,11 +47,16 @@ function createExpoAdapter(db) {
47
47
  return adapter;
48
48
  }
49
49
 
50
+ // src/initRandomSource.ts
51
+ var import_expo_crypto = require("expo-crypto");
52
+ var import_core_llm_wiki = require("@equationalapplications/core-llm-wiki");
53
+ (0, import_core_llm_wiki.configureRandomSource)(import_expo_crypto.getRandomValues);
54
+
50
55
  // src/index.ts
51
56
  __reExport(index_exports, require("@equationalapplications/core-llm-wiki"), module.exports);
52
57
  __reExport(index_exports, require("@equationalapplications/react-llm-wiki"), module.exports);
53
58
  function createWiki(db, options) {
54
- return new import_core_llm_wiki.WikiMemory(createExpoAdapter(db), options);
59
+ return new import_core_llm_wiki2.WikiMemory(createExpoAdapter(db), options);
55
60
  }
56
61
  // Annotate the CommonJS export names for ESM import in node:
57
62
  0 && (module.exports = {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/adapter.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\n\n// Re-exports all core types and utilities. The `createWiki` exported below\n// intentionally shadows the one from @equationalapplications/core-llm-wiki, binding the expo-sqlite adapter.\nexport * from '@equationalapplications/core-llm-wiki';\nexport * from '@equationalapplications/react-llm-wiki';\n\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n","import type * as SQLite from 'expo-sqlite';\nimport type { SQLiteAdapter } from '@equationalapplications/core-llm-wiki';\n\nexport function createExpoAdapter(db: SQLite.SQLiteDatabase): SQLiteAdapter {\n const adapter: SQLiteAdapter = {\n execAsync: (sql) => db.execAsync(sql),\n runAsync: async (sql, params = []) => {\n const result = await db.runAsync(sql, params as any[]);\n return { changes: result.changes, lastInsertRowId: result.lastInsertRowId };\n },\n getAllAsync: (sql, params = []) => db.getAllAsync(sql, params as any[]),\n getFirstAsync: (sql, params = []) => db.getFirstAsync(sql, params as any[]),\n withTransactionAsync: <T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T> => {\n // expo-sqlite only accepts () => Promise<void>; capture the result to satisfy the generic interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let captured: any;\n return db.withTransactionAsync(() => fn(adapter).then(v => { captured = v; })).then(() => captured as T);\n },\n closeAsync: () => db.closeAsync(),\n };\n return adapter;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAA6C;;;ACEtC,SAAS,kBAAkB,IAA0C;AAC1E,QAAM,UAAyB;AAAA,IAC7B,WAAW,CAAC,QAAQ,GAAG,UAAU,GAAG;AAAA,IACpC,UAAU,OAAO,KAAK,SAAS,CAAC,MAAM;AACpC,YAAM,SAAS,MAAM,GAAG,SAAS,KAAK,MAAe;AACrD,aAAO,EAAE,SAAS,OAAO,SAAS,iBAAiB,OAAO,gBAAgB;AAAA,IAC5E;AAAA,IACA,aAAa,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,YAAY,KAAK,MAAe;AAAA,IACtE,eAAe,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,cAAc,KAAK,MAAe;AAAA,IAC1E,sBAAsB,CAAI,OAAsD;AAG9E,UAAI;AACJ,aAAO,GAAG,qBAAqB,MAAM,GAAG,OAAO,EAAE,KAAK,OAAK;AAAE,mBAAW;AAAA,MAAG,CAAC,CAAC,EAAE,KAAK,MAAM,QAAa;AAAA,IACzG;AAAA,IACA,YAAY,MAAM,GAAG,WAAW;AAAA,EAClC;AACA,SAAO;AACT;;;ADfA,0BAAc,kDANd;AAOA,0BAAc,mDAPd;AASO,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,gCAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/adapter.ts","../src/initRandomSource.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\nimport './initRandomSource';\n\n// Re-exports all core types and utilities. The `createWiki` exported below\n// intentionally shadows the one from @equationalapplications/core-llm-wiki, binding the expo-sqlite adapter.\nexport * from '@equationalapplications/core-llm-wiki';\nexport * from '@equationalapplications/react-llm-wiki';\n\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n","import type * as SQLite from 'expo-sqlite';\nimport type { SQLiteAdapter } from '@equationalapplications/core-llm-wiki';\n\nexport function createExpoAdapter(db: SQLite.SQLiteDatabase): SQLiteAdapter {\n const adapter: SQLiteAdapter = {\n execAsync: (sql) => db.execAsync(sql),\n runAsync: async (sql, params = []) => {\n const result = await db.runAsync(sql, params as any[]);\n return { changes: result.changes, lastInsertRowId: result.lastInsertRowId };\n },\n getAllAsync: (sql, params = []) => db.getAllAsync(sql, params as any[]),\n getFirstAsync: (sql, params = []) => db.getFirstAsync(sql, params as any[]),\n withTransactionAsync: <T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T> => {\n // expo-sqlite only accepts () => Promise<void>; capture the result to satisfy the generic interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let captured: any;\n return db.withTransactionAsync(() => fn(adapter).then(v => { captured = v; })).then(() => captured as T);\n },\n closeAsync: () => db.closeAsync(),\n };\n return adapter;\n}\n","import { getRandomValues } from 'expo-crypto';\nimport { configureRandomSource } from '@equationalapplications/core-llm-wiki';\n\n// Install expo-crypto as the random source for Hermes / React Native, where\n// the global `crypto` API is absent. Runs once at module load — any import of\n// `@equationalapplications/expo-llm-wiki` or its `/factory` subpath activates it.\nconfigureRandomSource(getRandomValues);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,wBAA6C;;;ACEtC,SAAS,kBAAkB,IAA0C;AAC1E,QAAM,UAAyB;AAAA,IAC7B,WAAW,CAAC,QAAQ,GAAG,UAAU,GAAG;AAAA,IACpC,UAAU,OAAO,KAAK,SAAS,CAAC,MAAM;AACpC,YAAM,SAAS,MAAM,GAAG,SAAS,KAAK,MAAe;AACrD,aAAO,EAAE,SAAS,OAAO,SAAS,iBAAiB,OAAO,gBAAgB;AAAA,IAC5E;AAAA,IACA,aAAa,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,YAAY,KAAK,MAAe;AAAA,IACtE,eAAe,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,cAAc,KAAK,MAAe;AAAA,IAC1E,sBAAsB,CAAI,OAAsD;AAG9E,UAAI;AACJ,aAAO,GAAG,qBAAqB,MAAM,GAAG,OAAO,EAAE,KAAK,OAAK;AAAE,mBAAW;AAAA,MAAG,CAAC,CAAC,EAAE,KAAK,MAAM,QAAa;AAAA,IACzG;AAAA,IACA,YAAY,MAAM,GAAG,WAAW;AAAA,EAClC;AACA,SAAO;AACT;;;ACrBA,yBAAgC;AAChC,2BAAsC;AAAA,IAKtC,4CAAsB,kCAAe;;;AFCrC,0BAAc,kDAPd;AAQA,0BAAc,mDARd;AAUO,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,iCAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":["import_core_llm_wiki"]}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createExpoAdapter
3
- } from "./chunk-I2HESFG7.mjs";
3
+ } from "./chunk-TMAWD3GO.mjs";
4
4
 
5
5
  // src/index.ts
6
6
  import { WikiMemory } from "@equationalapplications/core-llm-wiki";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\n\n// Re-exports all core types and utilities. The `createWiki` exported below\n// intentionally shadows the one from @equationalapplications/core-llm-wiki, binding the expo-sqlite adapter.\nexport * from '@equationalapplications/core-llm-wiki';\nexport * from '@equationalapplications/react-llm-wiki';\n\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n"],"mappings":";;;;;AACA,SAAS,kBAAoC;AAK7C,cAAc;AACd,cAAc;AAEP,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,WAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport { WikiMemory, type WikiOptions } from '@equationalapplications/core-llm-wiki';\nimport { createExpoAdapter } from './adapter';\nimport './initRandomSource';\n\n// Re-exports all core types and utilities. The `createWiki` exported below\n// intentionally shadows the one from @equationalapplications/core-llm-wiki, binding the expo-sqlite adapter.\nexport * from '@equationalapplications/core-llm-wiki';\nexport * from '@equationalapplications/react-llm-wiki';\n\nexport function createWiki(db: SQLite.SQLiteDatabase, options: WikiOptions): WikiMemory {\n return new WikiMemory(createExpoAdapter(db), options);\n}\n"],"mappings":";;;;;AACA,SAAS,kBAAoC;AAM7C,cAAc;AACd,cAAc;AAEP,SAAS,WAAW,IAA2B,SAAkC;AACtF,SAAO,IAAI,WAAW,kBAAkB,EAAE,GAAG,OAAO;AACtD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equationalapplications/expo-llm-wiki",
3
- "version": "4.16.0",
3
+ "version": "4.17.1",
4
4
  "description": "Local-first LLM memory for Expo and React Native. Combines the core semantic search and extraction engine with expo-sqlite and ready-to-use React hooks.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -55,14 +55,16 @@
55
55
  "registry": "https://registry.npmjs.org"
56
56
  },
57
57
  "dependencies": {
58
- "@equationalapplications/react-llm-wiki": "4.16.0",
59
- "@equationalapplications/core-llm-wiki": "4.16.0"
58
+ "@equationalapplications/core-llm-wiki": "4.17.1",
59
+ "@equationalapplications/react-llm-wiki": "4.17.1"
60
60
  },
61
61
  "peerDependencies": {
62
+ "expo-crypto": ">=12",
62
63
  "expo-sqlite": "^14.0.0 || ^15.0.0 || ^55.0.0 || ^56.0.0",
63
64
  "react": ">=17"
64
65
  },
65
66
  "devDependencies": {
67
+ "expo-crypto": "^56.0.4",
66
68
  "tsup": "^8.0.0",
67
69
  "typescript": "^5.4.0",
68
70
  "vitest": "4.1.5"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/adapter.ts"],"sourcesContent":["import type * as SQLite from 'expo-sqlite';\nimport type { SQLiteAdapter } from '@equationalapplications/core-llm-wiki';\n\nexport function createExpoAdapter(db: SQLite.SQLiteDatabase): SQLiteAdapter {\n const adapter: SQLiteAdapter = {\n execAsync: (sql) => db.execAsync(sql),\n runAsync: async (sql, params = []) => {\n const result = await db.runAsync(sql, params as any[]);\n return { changes: result.changes, lastInsertRowId: result.lastInsertRowId };\n },\n getAllAsync: (sql, params = []) => db.getAllAsync(sql, params as any[]),\n getFirstAsync: (sql, params = []) => db.getFirstAsync(sql, params as any[]),\n withTransactionAsync: <T>(fn: (tx: SQLiteAdapter) => Promise<T>): Promise<T> => {\n // expo-sqlite only accepts () => Promise<void>; capture the result to satisfy the generic interface\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let captured: any;\n return db.withTransactionAsync(() => fn(adapter).then(v => { captured = v; })).then(() => captured as T);\n },\n closeAsync: () => db.closeAsync(),\n };\n return adapter;\n}\n"],"mappings":";AAGO,SAAS,kBAAkB,IAA0C;AAC1E,QAAM,UAAyB;AAAA,IAC7B,WAAW,CAAC,QAAQ,GAAG,UAAU,GAAG;AAAA,IACpC,UAAU,OAAO,KAAK,SAAS,CAAC,MAAM;AACpC,YAAM,SAAS,MAAM,GAAG,SAAS,KAAK,MAAe;AACrD,aAAO,EAAE,SAAS,OAAO,SAAS,iBAAiB,OAAO,gBAAgB;AAAA,IAC5E;AAAA,IACA,aAAa,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,YAAY,KAAK,MAAe;AAAA,IACtE,eAAe,CAAC,KAAK,SAAS,CAAC,MAAM,GAAG,cAAc,KAAK,MAAe;AAAA,IAC1E,sBAAsB,CAAI,OAAsD;AAG9E,UAAI;AACJ,aAAO,GAAG,qBAAqB,MAAM,GAAG,OAAO,EAAE,KAAK,OAAK;AAAE,mBAAW;AAAA,MAAG,CAAC,CAAC,EAAE,KAAK,MAAM,QAAa;AAAA,IACzG;AAAA,IACA,YAAY,MAAM,GAAG,WAAW;AAAA,EAClC;AACA,SAAO;AACT;","names":[]}