@heritageai/messaging 1.0.30 → 1.0.31

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.
@@ -2,7 +2,9 @@ import { Subjects } from "../subjects";
2
2
  export interface KnowledgeDocumentDeletedEvent {
3
3
  subject: Subjects.KnowledgeDocumentDeleted;
4
4
  data: {
5
- docId: string;
5
+ documentId: string;
6
+ siteId?: string;
6
7
  deletedAt: string;
8
+ correlationId: string;
7
9
  };
8
10
  }
@@ -2,11 +2,10 @@ import { Subjects } from "../subjects";
2
2
  export interface KnowledgeDocumentIndexedEvent {
3
3
  subject: Subjects.KnowledgeDocumentIndexed;
4
4
  data: {
5
- docId: string;
6
- source: "asset" | "site" | "manual";
7
- status: "ok" | "failed";
8
- chunksIndexed?: number;
9
- error?: string;
5
+ documentId: string;
6
+ siteId?: string;
7
+ chunks: number;
10
8
  indexedAt: string;
9
+ correlationId: string;
11
10
  };
12
11
  }
@@ -2,14 +2,13 @@ import { Subjects } from "../subjects";
2
2
  export interface KnowledgeDocumentUpsertedEvent {
3
3
  subject: Subjects.KnowledgeDocumentUpserted;
4
4
  data: {
5
- docId: string;
6
- source: "admin" | "site" | "asset";
7
- title?: string;
8
- text: string;
9
- language?: string;
5
+ documentId: string;
10
6
  siteId?: string;
11
- assetId?: string;
12
- tags?: string[];
13
- updatedAt: string;
7
+ title: string;
8
+ language?: string;
9
+ text: string;
10
+ createdByUserId: string;
11
+ createdAt: string;
12
+ correlationId: string;
14
13
  };
15
14
  }
@@ -4,15 +4,10 @@ export interface KnowledgeQueryRequestedEvent {
4
4
  data: {
5
5
  threadId: string;
6
6
  userId: string;
7
- correlationId: string;
8
7
  query: string;
9
- topK?: number;
10
- filters?: {
11
- siteId?: string;
12
- docIds?: string[];
13
- tags?: string[];
14
- source?: Array<"admin" | "site" | "asset">;
15
- };
8
+ topK: number;
9
+ siteId?: string;
10
+ correlationId: string;
16
11
  createdAt: string;
17
12
  };
18
13
  }
@@ -4,17 +4,17 @@ export interface KnowledgeQueryRespondedEvent {
4
4
  data: {
5
5
  threadId: string;
6
6
  userId: string;
7
- correlationId: string;
8
7
  query: string;
9
- results: Array<{
10
- docId: string;
8
+ topK: number;
9
+ matches: Array<{
10
+ documentId: string;
11
11
  chunkId: string;
12
12
  score: number;
13
13
  text: string;
14
14
  title?: string;
15
- url?: string;
16
15
  siteId?: string;
17
16
  }>;
17
+ correlationId: string;
18
18
  createdAt: string;
19
19
  };
20
20
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "future_platform",
3
3
  "name": "@heritageai/messaging",
4
4
  "license": "ISC",
5
- "version": "1.0.30",
5
+ "version": "1.0.31",
6
6
  "description": "",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -3,7 +3,9 @@ import { Subjects } from "../subjects";
3
3
  export interface KnowledgeDocumentDeletedEvent {
4
4
  subject: Subjects.KnowledgeDocumentDeleted;
5
5
  data: {
6
- docId: string;
6
+ documentId: string;
7
+ siteId?: string;
7
8
  deletedAt: string;
9
+ correlationId: string;
8
10
  };
9
11
  }
@@ -3,11 +3,10 @@ import { Subjects } from "../subjects";
3
3
  export interface KnowledgeDocumentIndexedEvent {
4
4
  subject: Subjects.KnowledgeDocumentIndexed;
5
5
  data: {
6
- docId: string;
7
- source: "asset" | "site" | "manual";
8
- status: "ok" | "failed";
9
- chunksIndexed?: number;
10
- error?: string; // only if failed
6
+ documentId: string;
7
+ siteId?: string;
8
+ chunks: number;
11
9
  indexedAt: string;
10
+ correlationId: string;
12
11
  };
13
12
  }
@@ -3,14 +3,19 @@ import { Subjects } from "../subjects";
3
3
  export interface KnowledgeDocumentUpsertedEvent {
4
4
  subject: Subjects.KnowledgeDocumentUpserted;
5
5
  data: {
6
- docId: string; // stable id for document
7
- source: "admin" | "site" | "asset";
8
- title?: string;
6
+ documentId: string;
7
+ // optional scoping (helps future filters)
8
+ siteId?: string;
9
+ title: string;
10
+ language?: string; // optional
11
+ // if you store raw text in mongo, no need to ship whole text in event
12
+ // BUT for MVP, you *can* include it to avoid another DB lookup:
9
13
  text: string;
10
- language?: string; // e.g. "ar" | "en"
11
- siteId?: string; // for targeted site retrieval
12
- assetId?: string; // if it came from assets
13
- tags?: string[];
14
- updatedAt: string; // ISO
14
+
15
+ // who created it (admin)
16
+ createdByUserId: string;
17
+
18
+ createdAt: string;
19
+ correlationId: string;
15
20
  };
16
21
  }
@@ -5,15 +5,14 @@ export interface KnowledgeQueryRequestedEvent {
5
5
  data: {
6
6
  threadId: string;
7
7
  userId: string;
8
+
9
+ query: string;
10
+ topK: number;
11
+
12
+ // optional filters
13
+ siteId?: string;
14
+
8
15
  correlationId: string;
9
- query: string; // user prompt (or a refined query)
10
- topK?: number; // default 5-10
11
- filters?: {
12
- siteId?: string;
13
- docIds?: string[];
14
- tags?: string[];
15
- source?: Array<"admin" | "site" | "asset">;
16
- };
17
16
  createdAt: string;
18
17
  };
19
18
  }
@@ -5,17 +5,21 @@ export interface KnowledgeQueryRespondedEvent {
5
5
  data: {
6
6
  threadId: string;
7
7
  userId: string;
8
- correlationId: string;
9
- query: string; // required
10
- results: Array<{
11
- docId: string;
8
+
9
+ query: string;
10
+ topK: number;
11
+
12
+ // what you got back
13
+ matches: Array<{
14
+ documentId: string;
12
15
  chunkId: string;
13
16
  score: number;
14
- text: string; // chunk text
17
+ text: string;
15
18
  title?: string;
16
- url?: string;
17
19
  siteId?: string;
18
20
  }>;
21
+
22
+ correlationId: string;
19
23
  createdAt: string;
20
24
  };
21
25
  }