@medicine-wheel/data-store 0.2.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.
- package/README.md +169 -0
- package/dist/connection.d.ts +37 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +171 -0
- package/dist/connection.js.map +1 -0
- package/dist/helpers.d.ts +13 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +53 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/session-link.d.ts +17 -0
- package/dist/session-link.d.ts.map +1 -0
- package/dist/session-link.js +52 -0
- package/dist/session-link.js.map +1 -0
- package/dist/store.d.ts +71 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +301 -0
- package/dist/store.js.map +1 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# @medicine-wheel/data-store
|
|
2
|
+
|
|
3
|
+
Shared Redis data-access layer for the Medicine Wheel Developer Suite — connection management, Node/Edge/Ceremony CRUD, session-ceremony linking, and discovery helpers.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This package provides a **unified Redis persistence layer** consumed by `mcp-medicine-wheel` and other Medicine Wheel services. It wraps the `redis` client with domain-aware helpers that honour the relational ontology defined in `@medicine-wheel/ontology-core`.
|
|
8
|
+
|
|
9
|
+
### What it provides
|
|
10
|
+
|
|
11
|
+
| Module | Description |
|
|
12
|
+
|--------|-------------|
|
|
13
|
+
| `connection` | Redis client lifecycle — connect, create, disconnect |
|
|
14
|
+
| `store` | Node, Edge, and Ceremony CRUD with direction/type indexing |
|
|
15
|
+
| `session-link` | Bi-directional session ↔ ceremony linking |
|
|
16
|
+
| `helpers` | Generic Redis primitives — sets, sorted sets, hashes |
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @medicine-wheel/data-store
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or link locally:
|
|
25
|
+
```bash
|
|
26
|
+
npm link ../medicine-wheel/src/data-store
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import {
|
|
33
|
+
// Connection
|
|
34
|
+
getRedis, createRedisClient, disconnectRedis,
|
|
35
|
+
|
|
36
|
+
// Node CRUD
|
|
37
|
+
createNode, getNode, getNodesByType, getNodesByDirection, getAllNodes, searchNodes,
|
|
38
|
+
|
|
39
|
+
// Edge CRUD
|
|
40
|
+
createEdge, getEdge, getRelatedNodes, updateEdgeCeremony,
|
|
41
|
+
|
|
42
|
+
// Ceremony CRUD
|
|
43
|
+
logCeremony, getCeremony, getCeremoniesTimeline,
|
|
44
|
+
getCeremoniesByDirection, getCeremoniesByType, getAllCeremonies,
|
|
45
|
+
|
|
46
|
+
// Accountability
|
|
47
|
+
getRelationalWeb, trackAccountability, getAccountability,
|
|
48
|
+
|
|
49
|
+
// Session-Ceremony Linking
|
|
50
|
+
linkSessionToCeremony, unlinkSessionFromCeremony,
|
|
51
|
+
getSessionsForCeremony, getCeremoniesForSession,
|
|
52
|
+
|
|
53
|
+
// Generic Redis Helpers
|
|
54
|
+
getAllFromSet, getHash, getAllHashes, setHash, addToSet, addToSortedSet,
|
|
55
|
+
} from '@medicine-wheel/data-store';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Quick start
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { getRedis, createNode, getNodesByDirection } from '@medicine-wheel/data-store';
|
|
62
|
+
|
|
63
|
+
// Connect (reuses existing client if already connected)
|
|
64
|
+
const redis = await getRedis();
|
|
65
|
+
|
|
66
|
+
// Create a relational node
|
|
67
|
+
await createNode({
|
|
68
|
+
id: 'node-1',
|
|
69
|
+
name: 'Vision Quest',
|
|
70
|
+
type: 'ceremony',
|
|
71
|
+
direction: 'East',
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Query by direction
|
|
75
|
+
const eastNodes = await getNodesByDirection('East');
|
|
76
|
+
|
|
77
|
+
// Clean up
|
|
78
|
+
await disconnectRedis();
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Sub-path imports
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { getRedis } from '@medicine-wheel/data-store/connection';
|
|
85
|
+
import { createNode, logCeremony } from '@medicine-wheel/data-store/store';
|
|
86
|
+
import { linkSessionToCeremony } from '@medicine-wheel/data-store/session-link';
|
|
87
|
+
import { getAllFromSet, setHash } from '@medicine-wheel/data-store/helpers';
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## API Reference
|
|
91
|
+
|
|
92
|
+
### Connection (`./connection`)
|
|
93
|
+
|
|
94
|
+
| Function | Description |
|
|
95
|
+
|----------|-------------|
|
|
96
|
+
| `getRedis()` | Return the shared Redis client, connecting if needed |
|
|
97
|
+
| `createRedisClient()` | Create a new, independent Redis client |
|
|
98
|
+
| `disconnectRedis()` | Gracefully close the shared client |
|
|
99
|
+
|
|
100
|
+
### Node CRUD (`./store`)
|
|
101
|
+
|
|
102
|
+
| Function | Description |
|
|
103
|
+
|----------|-------------|
|
|
104
|
+
| `createNode(node)` | Persist a relational node and update indexes |
|
|
105
|
+
| `getNode(id)` | Retrieve a node by ID |
|
|
106
|
+
| `getNodesByType(type)` | List nodes matching a given type |
|
|
107
|
+
| `getNodesByDirection(dir)` | List nodes aligned to a direction |
|
|
108
|
+
| `getAllNodes()` | Return every stored node |
|
|
109
|
+
| `searchNodes(query)` | Full-text / pattern search across nodes |
|
|
110
|
+
|
|
111
|
+
### Edge CRUD (`./store`)
|
|
112
|
+
|
|
113
|
+
| Function | Description |
|
|
114
|
+
|----------|-------------|
|
|
115
|
+
| `createEdge(edge)` | Persist a relational edge |
|
|
116
|
+
| `getEdge(id)` | Retrieve an edge by ID |
|
|
117
|
+
| `getRelatedNodes(nodeId)` | Discover nodes connected to a given node |
|
|
118
|
+
| `updateEdgeCeremony(edgeId, ctx)` | Attach or update ceremony context on an edge |
|
|
119
|
+
|
|
120
|
+
### Ceremony CRUD (`./store`)
|
|
121
|
+
|
|
122
|
+
| Function | Description |
|
|
123
|
+
|----------|-------------|
|
|
124
|
+
| `logCeremony(ceremony)` | Record a ceremony event |
|
|
125
|
+
| `getCeremony(id)` | Retrieve a ceremony by ID |
|
|
126
|
+
| `getCeremoniesTimeline()` | Ceremonies ordered chronologically |
|
|
127
|
+
| `getCeremoniesByDirection(dir)` | Ceremonies filtered by direction |
|
|
128
|
+
| `getCeremoniesByType(type)` | Ceremonies filtered by type |
|
|
129
|
+
| `getAllCeremonies()` | Return every stored ceremony |
|
|
130
|
+
|
|
131
|
+
### Accountability (`./store`)
|
|
132
|
+
|
|
133
|
+
| Function | Description |
|
|
134
|
+
|----------|-------------|
|
|
135
|
+
| `getRelationalWeb(nodeId)` | Full relational web around a node |
|
|
136
|
+
| `trackAccountability(record)` | Log an accountability event |
|
|
137
|
+
| `getAccountability(id)` | Retrieve accountability tracking data |
|
|
138
|
+
|
|
139
|
+
### Session-Ceremony Linking (`./session-link`)
|
|
140
|
+
|
|
141
|
+
| Function | Description |
|
|
142
|
+
|----------|-------------|
|
|
143
|
+
| `linkSessionToCeremony(sessionId, ceremonyId)` | Create a bi-directional link |
|
|
144
|
+
| `unlinkSessionFromCeremony(sessionId, ceremonyId)` | Remove a bi-directional link |
|
|
145
|
+
| `getSessionsForCeremony(ceremonyId)` | Sessions attached to a ceremony |
|
|
146
|
+
| `getCeremoniesForSession(sessionId)` | Ceremonies attached to a session |
|
|
147
|
+
|
|
148
|
+
### Generic Redis Helpers (`./helpers`)
|
|
149
|
+
|
|
150
|
+
| Function | Description |
|
|
151
|
+
|----------|-------------|
|
|
152
|
+
| `getAllFromSet(key)` | All members of a Redis set |
|
|
153
|
+
| `getHash(key)` | All fields of a Redis hash |
|
|
154
|
+
| `getAllHashes(pattern)` | Hashes matching a key pattern |
|
|
155
|
+
| `setHash(key, data)` | Write fields to a Redis hash |
|
|
156
|
+
| `addToSet(key, member)` | Add a member to a Redis set |
|
|
157
|
+
| `addToSortedSet(key, score, member)` | Add a member to a sorted set |
|
|
158
|
+
|
|
159
|
+
## Dependencies
|
|
160
|
+
|
|
161
|
+
| Package | Purpose |
|
|
162
|
+
|---------|---------|
|
|
163
|
+
| `@medicine-wheel/ontology-core` | Shared types, schemas, and constants |
|
|
164
|
+
| `redis` | Redis client (v4+) |
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT — IAIP Collaborative, Shawinigan, QC
|
|
169
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Medicine Wheel Data Store — Redis Connection Management
|
|
3
|
+
*
|
|
4
|
+
* Shared connection logic supporting Upstash, Vercel KV, and local Redis.
|
|
5
|
+
* Loads env from MEDECINEWHEEL_ENV_FILE if set.
|
|
6
|
+
*/
|
|
7
|
+
import { createClient, type RedisClientType } from 'redis';
|
|
8
|
+
export interface ConnectionOptions {
|
|
9
|
+
/** Override Redis URL (takes priority over env detection) */
|
|
10
|
+
url?: string;
|
|
11
|
+
/** Override host for local Redis */
|
|
12
|
+
host?: string;
|
|
13
|
+
/** Override port for local Redis (default: 6381) */
|
|
14
|
+
port?: number;
|
|
15
|
+
/** Redis password */
|
|
16
|
+
password?: string;
|
|
17
|
+
/** Redis database index */
|
|
18
|
+
database?: number;
|
|
19
|
+
/** Max reconnect attempts (default: 3) */
|
|
20
|
+
maxReconnectAttempts?: number;
|
|
21
|
+
/** Connection timeout in ms (default: 5000) */
|
|
22
|
+
connectTimeout?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get a shared Redis client (singleton with connection pooling).
|
|
26
|
+
* Detects Upstash, Vercel KV, REDIS_URL, or falls back to localhost:6381.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getRedis(opts?: ConnectionOptions): Promise<RedisClientType>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a fresh (non-singleton) Redis client for advanced use cases.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createRedisClient(opts?: ConnectionOptions): ReturnType<typeof createClient>;
|
|
33
|
+
/**
|
|
34
|
+
* Disconnect the singleton Redis client.
|
|
35
|
+
*/
|
|
36
|
+
export declare function disconnectRedis(): Promise<void>;
|
|
37
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,OAAO,CAAC;AAG3D,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAwED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CA2CjF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAG3F;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAKrD"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Medicine Wheel Data Store — Redis Connection Management
|
|
4
|
+
*
|
|
5
|
+
* Shared connection logic supporting Upstash, Vercel KV, and local Redis.
|
|
6
|
+
* Loads env from MEDECINEWHEEL_ENV_FILE if set.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.getRedis = getRedis;
|
|
43
|
+
exports.createRedisClient = createRedisClient;
|
|
44
|
+
exports.disconnectRedis = disconnectRedis;
|
|
45
|
+
const redis_1 = require("redis");
|
|
46
|
+
const fs = __importStar(require("fs"));
|
|
47
|
+
// Load environment from custom path
|
|
48
|
+
function loadEnvFile() {
|
|
49
|
+
const envPath = process.env.MEDECINEWHEEL_ENV_FILE;
|
|
50
|
+
if (!envPath)
|
|
51
|
+
return;
|
|
52
|
+
if (!fs.existsSync(envPath)) {
|
|
53
|
+
console.error(`⚠️ MEDECINEWHEEL_ENV_FILE not found: ${envPath}`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const content = fs.readFileSync(envPath, 'utf-8');
|
|
58
|
+
for (const line of content.split('\n')) {
|
|
59
|
+
const trimmed = line.trim();
|
|
60
|
+
if (!trimmed || trimmed.startsWith('#'))
|
|
61
|
+
continue;
|
|
62
|
+
const eqIdx = trimmed.indexOf('=');
|
|
63
|
+
if (eqIdx === -1)
|
|
64
|
+
continue;
|
|
65
|
+
const key = trimmed.slice(0, eqIdx).trim();
|
|
66
|
+
const val = trimmed.slice(eqIdx + 1).trim();
|
|
67
|
+
if (!process.env[key]) {
|
|
68
|
+
process.env[key] = val;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
console.error(`⚠️ Failed to load env file ${envPath}:`, err);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
loadEnvFile();
|
|
77
|
+
function detectRedisOptions(opts) {
|
|
78
|
+
// Explicit URL takes priority
|
|
79
|
+
if (opts?.url) {
|
|
80
|
+
return { url: opts.url };
|
|
81
|
+
}
|
|
82
|
+
// Upstash Redis
|
|
83
|
+
if (process.env.UPSTASH_REDIS_URL) {
|
|
84
|
+
return { url: process.env.UPSTASH_REDIS_URL };
|
|
85
|
+
}
|
|
86
|
+
if (process.env.UPSTASH_REST_API_URL && process.env.UPSTASH_REDIS_REST_TOKEN) {
|
|
87
|
+
const host = process.env.UPSTASH_REST_API_URL.replace(/^https?:\/\//, '');
|
|
88
|
+
return { url: `rediss://default:${process.env.UPSTASH_REDIS_REST_TOKEN}@${host}:6380` };
|
|
89
|
+
}
|
|
90
|
+
// Vercel KV
|
|
91
|
+
if (process.env.KV_URL) {
|
|
92
|
+
return { url: process.env.KV_URL };
|
|
93
|
+
}
|
|
94
|
+
// Generic REDIS_URL
|
|
95
|
+
if (process.env.REDIS_URL) {
|
|
96
|
+
return { url: process.env.REDIS_URL };
|
|
97
|
+
}
|
|
98
|
+
// Local Redis
|
|
99
|
+
return {
|
|
100
|
+
socket: {
|
|
101
|
+
host: opts?.host || process.env.REDIS_HOST || 'localhost',
|
|
102
|
+
port: opts?.port || parseInt(process.env.REDIS_PORT || '6381'),
|
|
103
|
+
},
|
|
104
|
+
password: opts?.password || process.env.REDIS_PASSWORD || undefined,
|
|
105
|
+
database: opts?.database || parseInt(process.env.REDIS_DB || '0'),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
// Singleton state
|
|
109
|
+
let singletonClient = null;
|
|
110
|
+
let singletonConnecting = null;
|
|
111
|
+
/**
|
|
112
|
+
* Get a shared Redis client (singleton with connection pooling).
|
|
113
|
+
* Detects Upstash, Vercel KV, REDIS_URL, or falls back to localhost:6381.
|
|
114
|
+
*/
|
|
115
|
+
async function getRedis(opts) {
|
|
116
|
+
if (singletonClient && singletonClient.isOpen)
|
|
117
|
+
return singletonClient;
|
|
118
|
+
if (singletonConnecting)
|
|
119
|
+
return singletonConnecting;
|
|
120
|
+
singletonConnecting = (async () => {
|
|
121
|
+
try {
|
|
122
|
+
const redisOpts = detectRedisOptions(opts);
|
|
123
|
+
const maxAttempts = opts?.maxReconnectAttempts ?? 3;
|
|
124
|
+
const timeout = opts?.connectTimeout ?? 5000;
|
|
125
|
+
const newClient = (0, redis_1.createClient)({
|
|
126
|
+
...redisOpts,
|
|
127
|
+
socket: {
|
|
128
|
+
...('socket' in redisOpts ? redisOpts.socket : {}),
|
|
129
|
+
reconnectStrategy: (retries) => {
|
|
130
|
+
if (retries > maxAttempts)
|
|
131
|
+
return new Error('Max reconnect attempts reached');
|
|
132
|
+
return retries * 100;
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
newClient.on('error', (err) => {
|
|
137
|
+
if (process.env.DEBUG_REDIS) {
|
|
138
|
+
console.error('[@medicine-wheel/data-store] Redis error:', err);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
const connectPromise = newClient.connect();
|
|
142
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error(`Connection timeout after ${timeout}ms`)), timeout));
|
|
143
|
+
await Promise.race([connectPromise, timeoutPromise]);
|
|
144
|
+
singletonClient = newClient;
|
|
145
|
+
singletonConnecting = null;
|
|
146
|
+
return newClient;
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
singletonConnecting = null;
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
})();
|
|
153
|
+
return singletonConnecting;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Create a fresh (non-singleton) Redis client for advanced use cases.
|
|
157
|
+
*/
|
|
158
|
+
function createRedisClient(opts) {
|
|
159
|
+
const redisOpts = detectRedisOptions(opts);
|
|
160
|
+
return (0, redis_1.createClient)(redisOpts);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Disconnect the singleton Redis client.
|
|
164
|
+
*/
|
|
165
|
+
async function disconnectRedis() {
|
|
166
|
+
if (singletonClient && singletonClient.isOpen) {
|
|
167
|
+
await singletonClient.disconnect();
|
|
168
|
+
singletonClient = null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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ine Wheel Data Store — Generic Redis Helpers
|
|
3
|
+
*
|
|
4
|
+
* Low-level helpers for direct Redis hash/set/sorted-set access.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAllFromSet(setKey: string): Promise<string[]>;
|
|
7
|
+
export declare function getHash(key: string): Promise<Record<string, string> | null>;
|
|
8
|
+
export declare function getAllHashes(prefix: string, ids: string[]): Promise<Record<string, string>[]>;
|
|
9
|
+
export declare function getSortedSetRange(key: string, start?: number, stop?: number): Promise<string[]>;
|
|
10
|
+
export declare function setHash(key: string, data: Record<string, string>): Promise<void>;
|
|
11
|
+
export declare function addToSet(setKey: string, ...members: string[]): Promise<void>;
|
|
12
|
+
export declare function addToSortedSet(key: string, score: number, value: string): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGrE;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAKjF;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAQnG;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAI,EAAE,IAAI,SAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAG5F;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAGtF;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlF;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7F"}
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Medicine Wheel Data Store — Generic Redis Helpers
|
|
4
|
+
*
|
|
5
|
+
* Low-level helpers for direct Redis hash/set/sorted-set access.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getAllFromSet = getAllFromSet;
|
|
9
|
+
exports.getHash = getHash;
|
|
10
|
+
exports.getAllHashes = getAllHashes;
|
|
11
|
+
exports.getSortedSetRange = getSortedSetRange;
|
|
12
|
+
exports.setHash = setHash;
|
|
13
|
+
exports.addToSet = addToSet;
|
|
14
|
+
exports.addToSortedSet = addToSortedSet;
|
|
15
|
+
const connection_js_1 = require("./connection.js");
|
|
16
|
+
async function getAllFromSet(setKey) {
|
|
17
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
18
|
+
return redis.sMembers(setKey);
|
|
19
|
+
}
|
|
20
|
+
async function getHash(key) {
|
|
21
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
22
|
+
const data = await redis.hGetAll(key);
|
|
23
|
+
if (!data || Object.keys(data).length === 0)
|
|
24
|
+
return null;
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
async function getAllHashes(prefix, ids) {
|
|
28
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
29
|
+
const results = [];
|
|
30
|
+
for (const id of ids) {
|
|
31
|
+
const data = await redis.hGetAll(`${prefix}${id}`);
|
|
32
|
+
if (data && Object.keys(data).length > 0)
|
|
33
|
+
results.push(data);
|
|
34
|
+
}
|
|
35
|
+
return results;
|
|
36
|
+
}
|
|
37
|
+
async function getSortedSetRange(key, start = 0, stop = -1) {
|
|
38
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
39
|
+
return redis.zRange(key, start, stop, { REV: true });
|
|
40
|
+
}
|
|
41
|
+
async function setHash(key, data) {
|
|
42
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
43
|
+
await redis.hSet(key, data);
|
|
44
|
+
}
|
|
45
|
+
async function addToSet(setKey, ...members) {
|
|
46
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
47
|
+
await redis.sAdd(setKey, members);
|
|
48
|
+
}
|
|
49
|
+
async function addToSortedSet(key, score, value) {
|
|
50
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
51
|
+
await redis.zAdd(key, { score, value });
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAIH,sCAGC;AAED,0BAKC;AAED,oCAQC;AAED,8CAGC;AAED,0BAGC;AAED,4BAGC;AAED,wCAGC;AA1CD,mDAA2C;AAEpC,KAAK,UAAU,aAAa,CAAC,MAAc;IAChD,MAAM,KAAK,GAAG,MAAM,IAAA,wBAAQ,GAAE,CAAC;IAC/B,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAEM,KAAK,UAAU,OAAO,CAAC,GAAW;IACvC,MAAM,KAAK,GAAG,MAAM,IAAA,wBAAQ,GAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;I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,KAAK,GAAG,MAAM,IAAA,wBAAQ,GAAE,CAAC;IAC/B,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Medicine Wheel Data Store
|
|
3
|
+
*
|
|
4
|
+
* Shared Redis data-access layer for the Medicine Wheel Developer Suite.
|
|
5
|
+
* Provides connection management, Node/Edge/Ceremony CRUD, session-ceremony linking,
|
|
6
|
+
* and generic Redis helpers.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { getRedis, createNode, logCeremony, linkSessionToCeremony } from '@medicine-wheel/data-store';
|
|
11
|
+
*
|
|
12
|
+
* // Connection is auto-managed — just call store functions
|
|
13
|
+
* await createNode({ id: 'elder-1', type: 'human', name: 'Elder', ... });
|
|
14
|
+
* await logCeremony({ id: 'c-1', type: 'opening', direction: 'east', ... });
|
|
15
|
+
* await linkSessionToCeremony('c-1', 'session-abc');
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export { getRedis, createRedisClient, disconnectRedis, type ConnectionOptions, } from './connection.js';
|
|
19
|
+
export { createNode, getNode, getNodesByType, getNodesByDirection, getAllNodes, searchNodes, createEdge, getEdge, getRelatedNodes, updateEdgeCeremony, logCeremony, getCeremony, getCeremoniesTimeline, getCeremoniesByDirection, getCeremoniesByType, getAllCeremonies, getRelationalWeb, trackAccountability, getAccountability, type RelationalNode, type RelationalEdge, type CeremonyLog, type AccountabilityData, } from './store.js';
|
|
20
|
+
export { linkSessionToCeremony, unlinkSessionFromCeremony, getSessionsForCeremony, getCeremoniesForSession, getLinkMetadata, type CeremonySessionLink, } from './session-link.js';
|
|
21
|
+
export { getAllFromSet, getHash, getAllHashes, getSortedSetRange, setHash, addToSet, addToSortedSet, } from './helpers.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,UAAU,EACV,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,UAAU,EACV,OAAO,EACP,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,aAAa,EACb,OAAO,EACP,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,QAAQ,EACR,cAAc,GACf,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Medicine Wheel Data Store
|
|
4
|
+
*
|
|
5
|
+
* Shared Redis data-access layer for the Medicine Wheel Developer Suite.
|
|
6
|
+
* Provides connection management, Node/Edge/Ceremony CRUD, session-ceremony linking,
|
|
7
|
+
* and generic Redis helpers.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { getRedis, createNode, logCeremony, linkSessionToCeremony } from '@medicine-wheel/data-store';
|
|
12
|
+
*
|
|
13
|
+
* // Connection is auto-managed — just call store functions
|
|
14
|
+
* await createNode({ id: 'elder-1', type: 'human', name: 'Elder', ... });
|
|
15
|
+
* await logCeremony({ id: 'c-1', type: 'opening', direction: 'east', ... });
|
|
16
|
+
* await linkSessionToCeremony('c-1', 'session-abc');
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.addToSortedSet = exports.addToSet = exports.setHash = exports.getSortedSetRange = exports.getAllHashes = exports.getHash = exports.getAllFromSet = exports.getLinkMetadata = exports.getCeremoniesForSession = exports.getSessionsForCeremony = exports.unlinkSessionFromCeremony = exports.linkSessionToCeremony = exports.getAccountability = exports.trackAccountability = exports.getRelationalWeb = exports.getAllCeremonies = exports.getCeremoniesByType = exports.getCeremoniesByDirection = exports.getCeremoniesTimeline = exports.getCeremony = exports.logCeremony = exports.updateEdgeCeremony = exports.getRelatedNodes = exports.getEdge = exports.createEdge = exports.searchNodes = exports.getAllNodes = exports.getNodesByDirection = exports.getNodesByType = exports.getNode = exports.createNode = exports.disconnectRedis = exports.createRedisClient = exports.getRedis = void 0;
|
|
21
|
+
// Connection
|
|
22
|
+
var connection_js_1 = require("./connection.js");
|
|
23
|
+
Object.defineProperty(exports, "getRedis", { enumerable: true, get: function () { return connection_js_1.getRedis; } });
|
|
24
|
+
Object.defineProperty(exports, "createRedisClient", { enumerable: true, get: function () { return connection_js_1.createRedisClient; } });
|
|
25
|
+
Object.defineProperty(exports, "disconnectRedis", { enumerable: true, get: function () { return connection_js_1.disconnectRedis; } });
|
|
26
|
+
// Store — Nodes, Edges, Ceremonies, Accountability, Discovery
|
|
27
|
+
var store_js_1 = require("./store.js");
|
|
28
|
+
Object.defineProperty(exports, "createNode", { enumerable: true, get: function () { return store_js_1.createNode; } });
|
|
29
|
+
Object.defineProperty(exports, "getNode", { enumerable: true, get: function () { return store_js_1.getNode; } });
|
|
30
|
+
Object.defineProperty(exports, "getNodesByType", { enumerable: true, get: function () { return store_js_1.getNodesByType; } });
|
|
31
|
+
Object.defineProperty(exports, "getNodesByDirection", { enumerable: true, get: function () { return store_js_1.getNodesByDirection; } });
|
|
32
|
+
Object.defineProperty(exports, "getAllNodes", { enumerable: true, get: function () { return store_js_1.getAllNodes; } });
|
|
33
|
+
Object.defineProperty(exports, "searchNodes", { enumerable: true, get: function () { return store_js_1.searchNodes; } });
|
|
34
|
+
Object.defineProperty(exports, "createEdge", { enumerable: true, get: function () { return store_js_1.createEdge; } });
|
|
35
|
+
Object.defineProperty(exports, "getEdge", { enumerable: true, get: function () { return store_js_1.getEdge; } });
|
|
36
|
+
Object.defineProperty(exports, "getRelatedNodes", { enumerable: true, get: function () { return store_js_1.getRelatedNodes; } });
|
|
37
|
+
Object.defineProperty(exports, "updateEdgeCeremony", { enumerable: true, get: function () { return store_js_1.updateEdgeCeremony; } });
|
|
38
|
+
Object.defineProperty(exports, "logCeremony", { enumerable: true, get: function () { return store_js_1.logCeremony; } });
|
|
39
|
+
Object.defineProperty(exports, "getCeremony", { enumerable: true, get: function () { return store_js_1.getCeremony; } });
|
|
40
|
+
Object.defineProperty(exports, "getCeremoniesTimeline", { enumerable: true, get: function () { return store_js_1.getCeremoniesTimeline; } });
|
|
41
|
+
Object.defineProperty(exports, "getCeremoniesByDirection", { enumerable: true, get: function () { return store_js_1.getCeremoniesByDirection; } });
|
|
42
|
+
Object.defineProperty(exports, "getCeremoniesByType", { enumerable: true, get: function () { return store_js_1.getCeremoniesByType; } });
|
|
43
|
+
Object.defineProperty(exports, "getAllCeremonies", { enumerable: true, get: function () { return store_js_1.getAllCeremonies; } });
|
|
44
|
+
Object.defineProperty(exports, "getRelationalWeb", { enumerable: true, get: function () { return store_js_1.getRelationalWeb; } });
|
|
45
|
+
Object.defineProperty(exports, "trackAccountability", { enumerable: true, get: function () { return store_js_1.trackAccountability; } });
|
|
46
|
+
Object.defineProperty(exports, "getAccountability", { enumerable: true, get: function () { return store_js_1.getAccountability; } });
|
|
47
|
+
// Session-Ceremony Linking
|
|
48
|
+
var session_link_js_1 = require("./session-link.js");
|
|
49
|
+
Object.defineProperty(exports, "linkSessionToCeremony", { enumerable: true, get: function () { return session_link_js_1.linkSessionToCeremony; } });
|
|
50
|
+
Object.defineProperty(exports, "unlinkSessionFromCeremony", { enumerable: true, get: function () { return session_link_js_1.unlinkSessionFromCeremony; } });
|
|
51
|
+
Object.defineProperty(exports, "getSessionsForCeremony", { enumerable: true, get: function () { return session_link_js_1.getSessionsForCeremony; } });
|
|
52
|
+
Object.defineProperty(exports, "getCeremoniesForSession", { enumerable: true, get: function () { return session_link_js_1.getCeremoniesForSession; } });
|
|
53
|
+
Object.defineProperty(exports, "getLinkMetadata", { enumerable: true, get: function () { return session_link_js_1.getLinkMetadata; } });
|
|
54
|
+
// Generic Redis Helpers
|
|
55
|
+
var helpers_js_1 = require("./helpers.js");
|
|
56
|
+
Object.defineProperty(exports, "getAllFromSet", { enumerable: true, get: function () { return helpers_js_1.getAllFromSet; } });
|
|
57
|
+
Object.defineProperty(exports, "getHash", { enumerable: true, get: function () { return helpers_js_1.getHash; } });
|
|
58
|
+
Object.defineProperty(exports, "getAllHashes", { enumerable: true, get: function () { return helpers_js_1.getAllHashes; } });
|
|
59
|
+
Object.defineProperty(exports, "getSortedSetRange", { enumerable: true, get: function () { return helpers_js_1.getSortedSetRange; } });
|
|
60
|
+
Object.defineProperty(exports, "setHash", { enumerable: true, get: function () { return helpers_js_1.setHash; } });
|
|
61
|
+
Object.defineProperty(exports, "addToSet", { enumerable: true, get: function () { return helpers_js_1.addToSet; } });
|
|
62
|
+
Object.defineProperty(exports, "addToSortedSet", { enumerable: true, get: function () { return helpers_js_1.addToSortedSet; } });
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,aAAa;AACb,iDAKyB;AAJvB,yGAAA,QAAQ,OAAA;AACR,kHAAA,iBAAiB,OAAA;AACjB,gHAAA,eAAe,OAAA;AAIjB,8DAA8D;AAC9D,uCAwBoB;AAvBlB,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AACP,0GAAA,cAAc,OAAA;AACd,+GAAA,mBAAmB,OAAA;AACnB,uGAAA,WAAW,OAAA;AACX,uGAAA,WAAW,OAAA;AACX,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AACP,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,uGAAA,WAAW,OAAA;AACX,uGAAA,WAAW,OAAA;AACX,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,+GAAA,mBAAmB,OAAA;AACnB,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,+GAAA,mBAAmB,OAAA;AACnB,6GAAA,iBAAiB,OAAA;AAOnB,2BAA2B;AAC3B,qDAO2B;AANzB,wHAAA,qBAAqB,OAAA;AACrB,4HAAA,yBAAyB,OAAA;AACzB,yHAAA,sBAAsB,OAAA;AACtB,0HAAA,uBAAuB,OAAA;AACvB,kHAAA,eAAe,OAAA;AAIjB,wBAAwB;AACxB,2CAQsB;AAPpB,2GAAA,aAAa,OAAA;AACb,qGAAA,OAAO,OAAA;AACP,0GAAA,YAAY,OAAA;AACZ,+GAAA,iBAAiB,OAAA;AACjB,qGAAA,OAAO,OAAA;AACP,sGAAA,QAAQ,OAAA;AACR,4GAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Medicine Wheel Data Store — Session-Ceremony Linking
|
|
3
|
+
*
|
|
4
|
+
* Bidirectional linking between agent sessions and ceremonies.
|
|
5
|
+
*/
|
|
6
|
+
export interface CeremonySessionLink {
|
|
7
|
+
ceremony_id: string;
|
|
8
|
+
session_id: string;
|
|
9
|
+
linked_at: string;
|
|
10
|
+
notes?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function linkSessionToCeremony(ceremonyId: string, sessionId: string, notes?: string): Promise<void>;
|
|
13
|
+
export declare function unlinkSessionFromCeremony(ceremonyId: string, sessionId: string): Promise<void>;
|
|
14
|
+
export declare function getSessionsForCeremony(ceremonyId: string): Promise<string[]>;
|
|
15
|
+
export declare function getCeremoniesForSession(sessionId: string): Promise<string[]>;
|
|
16
|
+
export declare function getLinkMetadata(ceremonyId: string, sessionId: string): Promise<CeremonySessionLink | null>;
|
|
17
|
+
//# sourceMappingURL=session-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-link.d.ts","sourceRoot":"","sources":["../src/session-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGlF;AAED,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGlF;AAED,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAUrC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Medicine Wheel Data Store — Session-Ceremony Linking
|
|
4
|
+
*
|
|
5
|
+
* Bidirectional linking between agent sessions and ceremonies.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.linkSessionToCeremony = linkSessionToCeremony;
|
|
9
|
+
exports.unlinkSessionFromCeremony = unlinkSessionFromCeremony;
|
|
10
|
+
exports.getSessionsForCeremony = getSessionsForCeremony;
|
|
11
|
+
exports.getCeremoniesForSession = getCeremoniesForSession;
|
|
12
|
+
exports.getLinkMetadata = getLinkMetadata;
|
|
13
|
+
const connection_js_1 = require("./connection.js");
|
|
14
|
+
async function linkSessionToCeremony(ceremonyId, sessionId, notes) {
|
|
15
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
16
|
+
const now = new Date().toISOString();
|
|
17
|
+
await redis.sAdd(`ceremony-sessions:${ceremonyId}`, sessionId);
|
|
18
|
+
await redis.sAdd(`session-ceremony:${sessionId}`, ceremonyId);
|
|
19
|
+
await redis.hSet(`ceremony-session-link:${ceremonyId}:${sessionId}`, {
|
|
20
|
+
ceremony_id: ceremonyId,
|
|
21
|
+
session_id: sessionId,
|
|
22
|
+
linked_at: now,
|
|
23
|
+
...(notes && { notes }),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async function unlinkSessionFromCeremony(ceremonyId, sessionId) {
|
|
27
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
28
|
+
await redis.sRem(`ceremony-sessions:${ceremonyId}`, sessionId);
|
|
29
|
+
await redis.sRem(`session-ceremony:${sessionId}`, ceremonyId);
|
|
30
|
+
await redis.del(`ceremony-session-link:${ceremonyId}:${sessionId}`);
|
|
31
|
+
}
|
|
32
|
+
async function getSessionsForCeremony(ceremonyId) {
|
|
33
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
34
|
+
return redis.sMembers(`ceremony-sessions:${ceremonyId}`);
|
|
35
|
+
}
|
|
36
|
+
async function getCeremoniesForSession(sessionId) {
|
|
37
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
38
|
+
return redis.sMembers(`session-ceremony:${sessionId}`);
|
|
39
|
+
}
|
|
40
|
+
async function getLinkMetadata(ceremonyId, sessionId) {
|
|
41
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
42
|
+
const data = await redis.hGetAll(`ceremony-session-link:${ceremonyId}:${sessionId}`);
|
|
43
|
+
if (!data || Object.keys(data).length === 0)
|
|
44
|
+
return null;
|
|
45
|
+
return {
|
|
46
|
+
ceremony_id: data.ceremony_id,
|
|
47
|
+
session_id: data.session_id,
|
|
48
|
+
linked_at: data.linked_at,
|
|
49
|
+
notes: data.notes || undefined,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=session-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-link.js","sourceRoot":"","sources":["../src/session-link.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAWH,sDAeC;AAED,8DAQC;AAED,wDAGC;AAED,0DAGC;AAED,0CAaC;AA3DD,mDAA2C;AASpC,KAAK,UAAU,qBAAqB,CACzC,UAAkB,EAClB,SAAiB,EACjB,KAAc;IAEd,MAAM,KAAK,GAAG,MAAM,IAAA,wBAAQ,GAAE,CAAC;IAC/B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,KAAK,CAAC,IAAI,CAAC,qBAAqB,UAAU,EAAE,EAAE,SAAS,CAAC,CAAC;IAC/D,MAAM,KAAK,CAAC,IAAI,CAAC,oBAAoB,SAAS,EAAE,EAAE,UAAU,CAAC,CAAC;IAC9D,MAAM,KAAK,CAAC,IAAI,CAAC,yBAAyB,UAAU,IAAI,SAAS,EAAE,EAAE;QACnE,WAAW,EAAE,UAAU;QACvB,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,GAAG;QACd,GAAG,CAAC,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C,SAAS;QACzB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Medicine Wheel Data Store — Relational Memory Store
|
|
3
|
+
*
|
|
4
|
+
* Core CRUD operations for Nodes, Edges, Ceremonies, and Accountability.
|
|
5
|
+
* Uses the shared Redis connection from ./connection.
|
|
6
|
+
*/
|
|
7
|
+
import type { DirectionName, NodeType, CeremonyType } from '@medicine-wheel/ontology-core';
|
|
8
|
+
export interface RelationalNode {
|
|
9
|
+
id: string;
|
|
10
|
+
type: NodeType;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
direction?: DirectionName;
|
|
14
|
+
metadata: Record<string, unknown>;
|
|
15
|
+
created_at: string;
|
|
16
|
+
updated_at: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RelationalEdge {
|
|
19
|
+
from_id: string;
|
|
20
|
+
to_id: string;
|
|
21
|
+
relationship_type: string;
|
|
22
|
+
strength: number;
|
|
23
|
+
ceremony_honored: boolean;
|
|
24
|
+
last_ceremony?: string;
|
|
25
|
+
obligations: string[];
|
|
26
|
+
created_at: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CeremonyLog {
|
|
29
|
+
id: string;
|
|
30
|
+
type: CeremonyType;
|
|
31
|
+
direction: DirectionName;
|
|
32
|
+
participants: string[];
|
|
33
|
+
medicines_used: string[];
|
|
34
|
+
intentions: string[];
|
|
35
|
+
timestamp: string;
|
|
36
|
+
research_context?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AccountabilityData {
|
|
39
|
+
wilson_score: number;
|
|
40
|
+
ocap_compliant: boolean;
|
|
41
|
+
elders_consulted: string[];
|
|
42
|
+
community_approval: boolean;
|
|
43
|
+
last_audit: string;
|
|
44
|
+
}
|
|
45
|
+
export declare function createNode(node: RelationalNode): Promise<void>;
|
|
46
|
+
export declare function getNode(id: string): Promise<RelationalNode | null>;
|
|
47
|
+
export declare function getNodesByType(type: NodeType): Promise<RelationalNode[]>;
|
|
48
|
+
export declare function getNodesByDirection(direction: DirectionName): Promise<RelationalNode[]>;
|
|
49
|
+
export declare function getAllNodes(limit?: number): Promise<RelationalNode[]>;
|
|
50
|
+
export declare function searchNodes(query: string, options?: {
|
|
51
|
+
type?: NodeType;
|
|
52
|
+
direction?: DirectionName;
|
|
53
|
+
limit?: number;
|
|
54
|
+
}): Promise<RelationalNode[]>;
|
|
55
|
+
export declare function createEdge(edge: RelationalEdge): Promise<void>;
|
|
56
|
+
export declare function getEdge(fromId: string, toId: string): Promise<RelationalEdge | null>;
|
|
57
|
+
export declare function getRelatedNodes(nodeId: string, direction?: 'from' | 'to' | 'both'): Promise<string[]>;
|
|
58
|
+
export declare function updateEdgeCeremony(fromId: string, toId: string, ceremonyId: string): Promise<void>;
|
|
59
|
+
export declare function logCeremony(ceremony: CeremonyLog): Promise<void>;
|
|
60
|
+
export declare function getCeremony(id: string): Promise<CeremonyLog | null>;
|
|
61
|
+
export declare function getCeremoniesTimeline(limit?: number): Promise<CeremonyLog[]>;
|
|
62
|
+
export declare function getCeremoniesByDirection(direction: DirectionName): Promise<CeremonyLog[]>;
|
|
63
|
+
export declare function getCeremoniesByType(type: CeremonyType): Promise<CeremonyLog[]>;
|
|
64
|
+
export declare function getAllCeremonies(limit?: number): Promise<CeremonyLog[]>;
|
|
65
|
+
export declare function getRelationalWeb(centerNodeId: string, depth?: number): Promise<{
|
|
66
|
+
nodes: RelationalNode[];
|
|
67
|
+
edges: RelationalEdge[];
|
|
68
|
+
}>;
|
|
69
|
+
export declare function trackAccountability(researchId: string, data: AccountabilityData): Promise<void>;
|
|
70
|
+
export declare function getAccountability(researchId: string): Promise<AccountabilityData | null>;
|
|
71
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.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AG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAKzE;AAED,wBAAsB,qBAAqB,CAAC,KAAK,SAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAS9E;AAED,wBAAsB,wBAAwB,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAS/F;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CASpF;AAED,wBAAsB,gBAAgB,CAAC,KAAK,SAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAE1E;AAID,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,OAAO,CAAC;IAC/E,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB,CAAC,CAuBD;AAID,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CASrG;AAED,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAW9F"}
|
package/dist/store.js
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Medicine Wheel Data Store — Relational Memory Store
|
|
4
|
+
*
|
|
5
|
+
* Core CRUD operations for Nodes, Edges, Ceremonies, and Accountability.
|
|
6
|
+
* Uses the shared Redis connection from ./connection.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.createNode = createNode;
|
|
10
|
+
exports.getNode = getNode;
|
|
11
|
+
exports.getNodesByType = getNodesByType;
|
|
12
|
+
exports.getNodesByDirection = getNodesByDirection;
|
|
13
|
+
exports.getAllNodes = getAllNodes;
|
|
14
|
+
exports.searchNodes = searchNodes;
|
|
15
|
+
exports.createEdge = createEdge;
|
|
16
|
+
exports.getEdge = getEdge;
|
|
17
|
+
exports.getRelatedNodes = getRelatedNodes;
|
|
18
|
+
exports.updateEdgeCeremony = updateEdgeCeremony;
|
|
19
|
+
exports.logCeremony = logCeremony;
|
|
20
|
+
exports.getCeremony = getCeremony;
|
|
21
|
+
exports.getCeremoniesTimeline = getCeremoniesTimeline;
|
|
22
|
+
exports.getCeremoniesByDirection = getCeremoniesByDirection;
|
|
23
|
+
exports.getCeremoniesByType = getCeremoniesByType;
|
|
24
|
+
exports.getAllCeremonies = getAllCeremonies;
|
|
25
|
+
exports.getRelationalWeb = getRelationalWeb;
|
|
26
|
+
exports.trackAccountability = trackAccountability;
|
|
27
|
+
exports.getAccountability = getAccountability;
|
|
28
|
+
const connection_js_1 = require("./connection.js");
|
|
29
|
+
// ── Node Operations ──
|
|
30
|
+
async function createNode(node) {
|
|
31
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
32
|
+
await redis.hSet(`node:${node.id}`, {
|
|
33
|
+
id: node.id,
|
|
34
|
+
type: node.type,
|
|
35
|
+
name: node.name,
|
|
36
|
+
description: node.description,
|
|
37
|
+
direction: node.direction || '',
|
|
38
|
+
metadata: JSON.stringify(node.metadata),
|
|
39
|
+
created_at: node.created_at,
|
|
40
|
+
updated_at: node.updated_at,
|
|
41
|
+
});
|
|
42
|
+
await redis.sAdd(`nodes:type:${node.type}`, node.id);
|
|
43
|
+
if (node.direction) {
|
|
44
|
+
await redis.sAdd(`nodes:direction:${node.direction}`, node.id);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function parseNodeHash(data) {
|
|
48
|
+
return {
|
|
49
|
+
id: data.id,
|
|
50
|
+
type: data.type,
|
|
51
|
+
name: data.name,
|
|
52
|
+
description: data.description,
|
|
53
|
+
direction: (data.direction || undefined),
|
|
54
|
+
metadata: JSON.parse(data.metadata || '{}'),
|
|
55
|
+
created_at: data.created_at,
|
|
56
|
+
updated_at: data.updated_at,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async function getNode(id) {
|
|
60
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
61
|
+
const data = await redis.hGetAll(`node:${id}`);
|
|
62
|
+
if (!data || Object.keys(data).length === 0)
|
|
63
|
+
return null;
|
|
64
|
+
return parseNodeHash(data);
|
|
65
|
+
}
|
|
66
|
+
async function getNodesByType(type) {
|
|
67
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
68
|
+
const ids = await redis.sMembers(`nodes:type:${type}`);
|
|
69
|
+
const nodes = [];
|
|
70
|
+
for (const id of ids) {
|
|
71
|
+
const node = await getNode(id);
|
|
72
|
+
if (node)
|
|
73
|
+
nodes.push(node);
|
|
74
|
+
}
|
|
75
|
+
return nodes;
|
|
76
|
+
}
|
|
77
|
+
async function getNodesByDirection(direction) {
|
|
78
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
79
|
+
const ids = await redis.sMembers(`nodes:direction:${direction}`);
|
|
80
|
+
const nodes = [];
|
|
81
|
+
for (const id of ids) {
|
|
82
|
+
const node = await getNode(id);
|
|
83
|
+
if (node)
|
|
84
|
+
nodes.push(node);
|
|
85
|
+
}
|
|
86
|
+
return nodes;
|
|
87
|
+
}
|
|
88
|
+
async function getAllNodes(limit = 100) {
|
|
89
|
+
const nodes = [];
|
|
90
|
+
const types = ['human', 'land', 'spirit', 'ancestor', 'future', 'knowledge'];
|
|
91
|
+
for (const type of types) {
|
|
92
|
+
const typeNodes = await getNodesByType(type);
|
|
93
|
+
nodes.push(...typeNodes);
|
|
94
|
+
if (nodes.length >= limit)
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
return nodes
|
|
98
|
+
.slice(0, limit)
|
|
99
|
+
.sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at));
|
|
100
|
+
}
|
|
101
|
+
async function searchNodes(query, options) {
|
|
102
|
+
const { type, direction, limit = 50 } = options || {};
|
|
103
|
+
let nodes;
|
|
104
|
+
if (type) {
|
|
105
|
+
nodes = await getNodesByType(type);
|
|
106
|
+
}
|
|
107
|
+
else if (direction) {
|
|
108
|
+
nodes = await getNodesByDirection(direction);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
nodes = await getAllNodes(500);
|
|
112
|
+
}
|
|
113
|
+
const q = query.toLowerCase();
|
|
114
|
+
return nodes
|
|
115
|
+
.filter(n => n.name.toLowerCase().includes(q) || n.description.toLowerCase().includes(q))
|
|
116
|
+
.sort((a, b) => {
|
|
117
|
+
const score = (n) => (n.name.toLowerCase() === q ? 3 : 0) +
|
|
118
|
+
(n.name.toLowerCase().includes(q) ? 2 : 0) +
|
|
119
|
+
(n.description.toLowerCase().includes(q) ? 1 : 0);
|
|
120
|
+
return score(b) - score(a);
|
|
121
|
+
})
|
|
122
|
+
.slice(0, limit);
|
|
123
|
+
}
|
|
124
|
+
// ── Edge Operations ──
|
|
125
|
+
async function createEdge(edge) {
|
|
126
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
127
|
+
await redis.hSet(`edge:${edge.from_id}:${edge.to_id}`, {
|
|
128
|
+
from_id: edge.from_id,
|
|
129
|
+
to_id: edge.to_id,
|
|
130
|
+
relationship_type: edge.relationship_type,
|
|
131
|
+
strength: edge.strength.toString(),
|
|
132
|
+
ceremony_honored: edge.ceremony_honored ? '1' : '0',
|
|
133
|
+
last_ceremony: edge.last_ceremony || '',
|
|
134
|
+
obligations: JSON.stringify(edge.obligations),
|
|
135
|
+
created_at: edge.created_at,
|
|
136
|
+
});
|
|
137
|
+
await redis.sAdd(`edges:from:${edge.from_id}`, edge.to_id);
|
|
138
|
+
await redis.sAdd(`edges:to:${edge.to_id}`, edge.from_id);
|
|
139
|
+
}
|
|
140
|
+
function parseEdgeHash(data) {
|
|
141
|
+
return {
|
|
142
|
+
from_id: data.from_id,
|
|
143
|
+
to_id: data.to_id,
|
|
144
|
+
relationship_type: data.relationship_type,
|
|
145
|
+
strength: parseFloat(data.strength),
|
|
146
|
+
ceremony_honored: data.ceremony_honored === '1',
|
|
147
|
+
last_ceremony: data.last_ceremony || undefined,
|
|
148
|
+
obligations: JSON.parse(data.obligations || '[]'),
|
|
149
|
+
created_at: data.created_at,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async function getEdge(fromId, toId) {
|
|
153
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
154
|
+
const data = await redis.hGetAll(`edge:${fromId}:${toId}`);
|
|
155
|
+
if (!data || Object.keys(data).length === 0)
|
|
156
|
+
return null;
|
|
157
|
+
return parseEdgeHash(data);
|
|
158
|
+
}
|
|
159
|
+
async function getRelatedNodes(nodeId, direction = 'both') {
|
|
160
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
161
|
+
const related = new Set();
|
|
162
|
+
if (direction === 'from' || direction === 'both') {
|
|
163
|
+
(await redis.sMembers(`edges:from:${nodeId}`)).forEach(id => related.add(id));
|
|
164
|
+
}
|
|
165
|
+
if (direction === 'to' || direction === 'both') {
|
|
166
|
+
(await redis.sMembers(`edges:to:${nodeId}`)).forEach(id => related.add(id));
|
|
167
|
+
}
|
|
168
|
+
return Array.from(related);
|
|
169
|
+
}
|
|
170
|
+
async function updateEdgeCeremony(fromId, toId, ceremonyId) {
|
|
171
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
172
|
+
await redis.hSet(`edge:${fromId}:${toId}`, {
|
|
173
|
+
ceremony_honored: '1',
|
|
174
|
+
last_ceremony: ceremonyId,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// ── Ceremony Operations ──
|
|
178
|
+
async function logCeremony(ceremony) {
|
|
179
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
180
|
+
await redis.hSet(`ceremony:${ceremony.id}`, {
|
|
181
|
+
id: ceremony.id,
|
|
182
|
+
type: ceremony.type,
|
|
183
|
+
direction: ceremony.direction,
|
|
184
|
+
participants: JSON.stringify(ceremony.participants),
|
|
185
|
+
medicines_used: JSON.stringify(ceremony.medicines_used),
|
|
186
|
+
intentions: JSON.stringify(ceremony.intentions),
|
|
187
|
+
timestamp: ceremony.timestamp,
|
|
188
|
+
research_context: ceremony.research_context || '',
|
|
189
|
+
});
|
|
190
|
+
await redis.sAdd(`ceremonies:direction:${ceremony.direction}`, ceremony.id);
|
|
191
|
+
await redis.sAdd(`ceremonies:type:${ceremony.type}`, ceremony.id);
|
|
192
|
+
await redis.zAdd('ceremonies:timeline', {
|
|
193
|
+
score: Date.parse(ceremony.timestamp),
|
|
194
|
+
value: ceremony.id,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function parseCeremonyHash(data) {
|
|
198
|
+
return {
|
|
199
|
+
id: data.id,
|
|
200
|
+
type: data.type,
|
|
201
|
+
direction: data.direction,
|
|
202
|
+
participants: JSON.parse(data.participants || '[]'),
|
|
203
|
+
medicines_used: JSON.parse(data.medicines_used || '[]'),
|
|
204
|
+
intentions: JSON.parse(data.intentions || '[]'),
|
|
205
|
+
timestamp: data.timestamp,
|
|
206
|
+
research_context: data.research_context || undefined,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
async function getCeremony(id) {
|
|
210
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
211
|
+
const data = await redis.hGetAll(`ceremony:${id}`);
|
|
212
|
+
if (!data || Object.keys(data).length === 0)
|
|
213
|
+
return null;
|
|
214
|
+
return parseCeremonyHash(data);
|
|
215
|
+
}
|
|
216
|
+
async function getCeremoniesTimeline(limit = 20) {
|
|
217
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
218
|
+
const ids = await redis.zRange('ceremonies:timeline', 0, limit - 1, { REV: true });
|
|
219
|
+
const ceremonies = [];
|
|
220
|
+
for (const id of ids) {
|
|
221
|
+
const c = await getCeremony(id);
|
|
222
|
+
if (c)
|
|
223
|
+
ceremonies.push(c);
|
|
224
|
+
}
|
|
225
|
+
return ceremonies;
|
|
226
|
+
}
|
|
227
|
+
async function getCeremoniesByDirection(direction) {
|
|
228
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
229
|
+
const ids = await redis.sMembers(`ceremonies:direction:${direction}`);
|
|
230
|
+
const ceremonies = [];
|
|
231
|
+
for (const id of ids) {
|
|
232
|
+
const c = await getCeremony(id);
|
|
233
|
+
if (c)
|
|
234
|
+
ceremonies.push(c);
|
|
235
|
+
}
|
|
236
|
+
return ceremonies.sort((a, b) => Date.parse(b.timestamp) - Date.parse(a.timestamp));
|
|
237
|
+
}
|
|
238
|
+
async function getCeremoniesByType(type) {
|
|
239
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
240
|
+
const ids = await redis.sMembers(`ceremonies:type:${type}`);
|
|
241
|
+
const ceremonies = [];
|
|
242
|
+
for (const id of ids) {
|
|
243
|
+
const c = await getCeremony(id);
|
|
244
|
+
if (c)
|
|
245
|
+
ceremonies.push(c);
|
|
246
|
+
}
|
|
247
|
+
return ceremonies.sort((a, b) => Date.parse(b.timestamp) - Date.parse(a.timestamp));
|
|
248
|
+
}
|
|
249
|
+
async function getAllCeremonies(limit = 100) {
|
|
250
|
+
return getCeremoniesTimeline(limit);
|
|
251
|
+
}
|
|
252
|
+
// ── Relational Web Traversal ──
|
|
253
|
+
async function getRelationalWeb(centerNodeId, depth = 2) {
|
|
254
|
+
const visited = new Set();
|
|
255
|
+
const nodes = [];
|
|
256
|
+
const edges = [];
|
|
257
|
+
const traverse = async (nodeId, currentDepth) => {
|
|
258
|
+
if (currentDepth > depth || visited.has(nodeId))
|
|
259
|
+
return;
|
|
260
|
+
visited.add(nodeId);
|
|
261
|
+
const node = await getNode(nodeId);
|
|
262
|
+
if (node)
|
|
263
|
+
nodes.push(node);
|
|
264
|
+
if (currentDepth < depth) {
|
|
265
|
+
const related = await getRelatedNodes(nodeId);
|
|
266
|
+
for (const relatedId of related) {
|
|
267
|
+
const edge = await getEdge(nodeId, relatedId);
|
|
268
|
+
if (edge)
|
|
269
|
+
edges.push(edge);
|
|
270
|
+
await traverse(relatedId, currentDepth + 1);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
await traverse(centerNodeId, 0);
|
|
275
|
+
return { nodes, edges };
|
|
276
|
+
}
|
|
277
|
+
// ── Accountability Tracking ──
|
|
278
|
+
async function trackAccountability(researchId, data) {
|
|
279
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
280
|
+
await redis.hSet(`accountability:${researchId}`, {
|
|
281
|
+
wilson_score: data.wilson_score.toString(),
|
|
282
|
+
ocap_compliant: data.ocap_compliant ? '1' : '0',
|
|
283
|
+
elders_consulted: JSON.stringify(data.elders_consulted),
|
|
284
|
+
community_approval: data.community_approval ? '1' : '0',
|
|
285
|
+
last_audit: data.last_audit,
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
async function getAccountability(researchId) {
|
|
289
|
+
const redis = await (0, connection_js_1.getRedis)();
|
|
290
|
+
const data = await redis.hGetAll(`accountability:${researchId}`);
|
|
291
|
+
if (!data || Object.keys(data).length === 0)
|
|
292
|
+
return null;
|
|
293
|
+
return {
|
|
294
|
+
wilson_score: parseFloat(data.wilson_score),
|
|
295
|
+
ocap_compliant: data.ocap_compliant === '1',
|
|
296
|
+
elders_consulted: JSON.parse(data.elders_consulted || '[]'),
|
|
297
|
+
community_approval: data.community_approval === '1',
|
|
298
|
+
last_audit: data.last_audit,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAkDH,gCAgBC;AAeD,0BAKC;AAED,wCASC;AAED,kDASC;AAED,kCAWC;AAED,kCA2BC;AAID,gCAcC;AAeD,0BAKC;AAED,0CAUC;AAED,gDAMC;AAID,kCAkBC;AAeD,kCAKC;AAED,sDASC;AAED,4DASC;AAED,kDASC;AAED,4CAEC;AAID,4CA0BC;AAID,kDASC;AAED,8CAWC;AApVD,mDA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BAAgB,CAAC;QACvD,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;QACvD,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,iBAAiB,CAAC,UAAkB;IACxD,MAAM,KAAK,GAAG,MAAM,IAAA,wBAAQ,GAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,kBAAkB,UAAU,EAAE,CAAC,CAAC;IACjE,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzD,OAAO;QACL,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;QAC3C,cAAc,EAAE,IAAI,CAAC,cAAc,KAAK,GAAG;QAC3C,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC;QAC3D,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,KAAK,GAAG;QACnD,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@medicine-wheel/data-store",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Shared Redis data-access layer for the Medicine Wheel Developer Suite — connection management, Node/Edge/Ceremony CRUD, session-ceremony linking, and discovery helpers",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./connection": {
|
|
15
|
+
"import": "./dist/connection.js",
|
|
16
|
+
"types": "./dist/connection.d.ts",
|
|
17
|
+
"require": "./dist/connection.js",
|
|
18
|
+
"default": "./dist/connection.js"
|
|
19
|
+
},
|
|
20
|
+
"./store": {
|
|
21
|
+
"import": "./dist/store.js",
|
|
22
|
+
"types": "./dist/store.d.ts",
|
|
23
|
+
"require": "./dist/store.js",
|
|
24
|
+
"default": "./dist/store.js"
|
|
25
|
+
},
|
|
26
|
+
"./session-link": {
|
|
27
|
+
"import": "./dist/session-link.js",
|
|
28
|
+
"types": "./dist/session-link.d.ts",
|
|
29
|
+
"require": "./dist/session-link.js",
|
|
30
|
+
"default": "./dist/session-link.js"
|
|
31
|
+
},
|
|
32
|
+
"./helpers": {
|
|
33
|
+
"import": "./dist/helpers.js",
|
|
34
|
+
"types": "./dist/helpers.d.ts",
|
|
35
|
+
"require": "./dist/helpers.js",
|
|
36
|
+
"default": "./dist/helpers.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc",
|
|
46
|
+
"dev": "tsc --watch",
|
|
47
|
+
"lint": "tsc --noEmit",
|
|
48
|
+
"clean": "rm -rf dist",
|
|
49
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"medicine-wheel",
|
|
53
|
+
"redis",
|
|
54
|
+
"data-store",
|
|
55
|
+
"relational-memory",
|
|
56
|
+
"ceremony",
|
|
57
|
+
"indigenous-research"
|
|
58
|
+
],
|
|
59
|
+
"author": "IAIP Collaborative - Shawinigan, QC",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@medicine-wheel/ontology-core": "^0.2.2",
|
|
63
|
+
"redis": "^4.6.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/node": "^20.10.0",
|
|
67
|
+
"typescript": "^5.3.0"
|
|
68
|
+
}
|
|
69
|
+
}
|