@equationalapplications/core-okf 4.15.0 → 4.15.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 (2) hide show
  1. package/README.md +72 -1
  2. package/package.json +9 -9
package/README.md CHANGED
@@ -1,3 +1,74 @@
1
1
  # @equationalapplications/core-okf
2
2
 
3
- Zero-dependency primitives for producing [Open Knowledge Format](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md) (OKF v0.1) bundles: YAML frontmatter serialization, concept document assembly, and `index.md`/`log.md` builders. No knowledge of any specific data model — bring your own mapping from your domain objects to `OkfFrontmatter` + body strings.
3
+ [![npm version](https://img.shields.io/npm/v/%40equationalapplications%2Fcore-okf?label=core-okf)](https://www.npmjs.com/package/@equationalapplications/core-okf) [![npm downloads](https://img.shields.io/npm/dm/%40equationalapplications%2Fcore-okf?label=downloads)](https://www.npmjs.com/package/@equationalapplications/core-okf)
4
+
5
+ ## Overview
6
+
7
+ A zero-dependency library for parsing and producing [Open Knowledge Format (OKF) v0.1](https://github.com/GoogleCloudPlatform/knowledge-catalog/tree/main/okf) bundles. This package provides the raw primitives to work with OKF frontmatter, concept documents, and index/log files, completely decoupled from any specific database or data model.
8
+
9
+ For a ready-made `MemoryDump` ⇄ OKF bundle adapter, see the [OKF Import/Export section in `@equationalapplications/core-llm-wiki`](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md#okf-importexport).
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install @equationalapplications/core-okf
15
+ ```
16
+
17
+ ## API Reference
18
+
19
+ ### `serializeFrontmatter` / `parseFrontmatter`
20
+
21
+ Produces and parses YAML frontmatter for OKF concept documents.
22
+
23
+ ```typescript
24
+ const yaml = serializeFrontmatter({ type: 'fact', id: 'fact_123' });
25
+ const { frontmatter, rest } = parseFrontmatter(fileContent);
26
+ ```
27
+
28
+ ### `buildConceptDocument` / `parseConcept`
29
+
30
+ Combines frontmatter and markdown body into a single string, or splits an existing OKF file into its component parts.
31
+
32
+ ```typescript
33
+ const markdown = buildConceptDocument({ type: 'task', id: 'task_1' }, '# Buy groceries');
34
+ const { frontmatter, body } = parseConcept(markdown);
35
+ ```
36
+
37
+ ### `buildIndexMd` / `buildRootIndexMd`
38
+
39
+ Generates directory index lists or root OKF catalog manifests.
40
+
41
+ ```typescript
42
+ const sections = [{ heading: 'Facts', entries: [{ path: 'facts/fact_123.md', title: 'Fact 123' }] }];
43
+ const dirIndex = buildIndexMd(sections);
44
+ const rootIndex = buildRootIndexMd('0.1', sections);
45
+ ```
46
+
47
+ ### `buildLogMd` / `parseLogMd`
48
+
49
+ Serializes chronological append-only events or parses them back into discrete entries.
50
+
51
+ ```typescript
52
+ const log = buildLogMd([{ date: '2026-06-23', text: 'Observation made' }]);
53
+ const events = parseLogMd(logContent);
54
+ ```
55
+
56
+ ### `extractMarkdownLinks`
57
+
58
+ Parses relative markdown cross-links to map knowledge graph edges.
59
+
60
+ ```typescript
61
+ const links = extractMarkdownLinks('See [preferences](facts/fact_abc.md) for more.');
62
+ // links: [{ text: 'preferences', path: 'facts/fact_abc.md' }]
63
+ ```
64
+
65
+ ## Monorepo Ecosystem
66
+
67
+ | Package | Purpose |
68
+ | --- | --- |
69
+ | [@equationalapplications/core-llm-wiki](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core/README.md) | Persistent episodic memory |
70
+ | [@equationalapplications/expo-llm-wiki](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/expo/README.md) | Persistent episodic memory for Expo/React Native |
71
+ | [@equationalapplications/react-llm-wiki](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/react/README.md) | Persistent episodic memory for Web |
72
+ | [@equationalapplications/prisma-outbox](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/prisma-outbox/README.md) | Sync SQLite outbox events to Prisma |
73
+ | [@equationalapplications/core-llm-tools](https://github.com/equationalapplications/expo-llm-wiki/blob/main/packages/core-llm-tools/README.md) | Gemini tool schemas and capability injector |
74
+ | **@equationalapplications/core-okf** | Zero-dependency Open Knowledge Format (OKF) v0.1 primitives — parse and produce interoperable knowledge bundles. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equationalapplications/core-okf",
3
- "version": "4.15.0",
3
+ "version": "4.15.2",
4
4
  "description": "Zero-dependency Open Knowledge Format (OKF) v0.1 primitives: frontmatter serialization, concept documents, index.md and log.md builders.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -12,13 +12,6 @@
12
12
  "import": "./dist/index.mjs"
13
13
  }
14
14
  },
15
- "scripts": {
16
- "build": "tsup",
17
- "dev": "tsup --watch",
18
- "typecheck": "tsc --noEmit",
19
- "test": "vitest run",
20
- "test:watch": "vitest"
21
- },
22
15
  "files": [
23
16
  "dist",
24
17
  "LICENSE",
@@ -53,5 +46,12 @@
53
46
  "tsup": "^8.0.0",
54
47
  "typescript": "^5.4.0",
55
48
  "vitest": "4.1.5"
49
+ },
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "dev": "tsup --watch",
53
+ "typecheck": "tsc --noEmit",
54
+ "test": "vitest run",
55
+ "test:watch": "vitest"
56
56
  }
57
- }
57
+ }