@yolk-sdk/knowledge 0.1.0-canary.13 → 0.1.0-canary.130
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 +160 -80
- package/dist/agent.d.mts +118 -19
- package/dist/agent.d.mts.map +1 -1
- package/dist/agent.mjs +256 -34
- package/dist/agent.mjs.map +1 -1
- package/dist/chunking.d.mts +13 -16
- package/dist/chunking.d.mts.map +1 -1
- package/dist/chunking.mjs +4 -4
- package/dist/chunking.mjs.map +1 -1
- package/dist/context.d.mts +4 -13
- package/dist/context.d.mts.map +1 -1
- package/dist/context.mjs +17 -13
- package/dist/context.mjs.map +1 -1
- package/dist/documents.d.mts +128 -78
- package/dist/documents.d.mts.map +1 -1
- package/dist/documents.mjs +89 -61
- package/dist/documents.mjs.map +1 -1
- package/dist/embeddings.d.mts +4 -7
- package/dist/embeddings.d.mts.map +1 -1
- package/dist/embeddings.mjs +1 -2
- package/dist/embeddings.mjs.map +1 -1
- package/dist/errors.d.mts +19 -22
- package/dist/errors.d.mts.map +1 -1
- package/dist/errors.mjs +12 -13
- package/dist/errors.mjs.map +1 -1
- package/dist/extraction.d.mts +4 -7
- package/dist/extraction.d.mts.map +1 -1
- package/dist/extraction.mjs +1 -2
- package/dist/extraction.mjs.map +1 -1
- package/dist/files.d.mts +19 -0
- package/dist/files.d.mts.map +1 -0
- package/dist/files.mjs +6 -0
- package/dist/files.mjs.map +1 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/ingestion.d.mts +21 -23
- package/dist/ingestion.d.mts.map +1 -1
- package/dist/ingestion.mjs +12 -17
- package/dist/ingestion.mjs.map +1 -1
- package/dist/search.d.mts +13 -17
- package/dist/search.d.mts.map +1 -1
- package/dist/search.mjs +9 -12
- package/dist/search.mjs.map +1 -1
- package/dist/store.d.mts +92 -29
- package/dist/store.d.mts.map +1 -1
- package/dist/store.mjs +3 -3
- package/dist/store.mjs.map +1 -1
- package/dist/summarization.d.mts +6 -9
- package/dist/summarization.d.mts.map +1 -1
- package/dist/summarization.mjs +1 -2
- package/dist/summarization.mjs.map +1 -1
- package/package.json +11 -41
- package/src/agent.ts +393 -65
- package/src/chunking.ts +27 -8
- package/src/context.ts +21 -16
- package/src/documents.ts +140 -71
- package/src/errors.ts +4 -4
- package/src/extraction.ts +4 -3
- package/src/files.ts +24 -0
- package/src/index.ts +6 -3
- package/src/ingestion.ts +46 -27
- package/src/search.ts +90 -62
- package/src/store.ts +139 -25
- package/src/summarization.ts +4 -3
- package/dist/artifacts.d.mts +0 -37
- package/dist/artifacts.d.mts.map +0 -1
- package/dist/artifacts.mjs +0 -28
- package/dist/artifacts.mjs.map +0 -1
- package/dist/links.d.mts +0 -17
- package/dist/links.d.mts.map +0 -1
- package/dist/links.mjs +0 -24
- package/dist/links.mjs.map +0 -1
- package/dist/provenance.d.mts +0 -20
- package/dist/provenance.d.mts.map +0 -1
- package/dist/provenance.mjs +0 -26
- package/dist/provenance.mjs.map +0 -1
- package/dist/records.d.mts +0 -59
- package/dist/records.d.mts.map +0 -1
- package/dist/records.mjs +0 -64
- package/dist/records.mjs.map +0 -1
- package/dist/representations.d.mts +0 -36
- package/dist/representations.d.mts.map +0 -1
- package/dist/representations.mjs +0 -44
- package/dist/representations.mjs.map +0 -1
- package/dist/search-store.d.mts +0 -77
- package/dist/search-store.d.mts.map +0 -1
- package/dist/search-store.mjs +0 -7
- package/dist/search-store.mjs.map +0 -1
- package/dist/vector-store.d.mts +0 -3
- package/dist/vector-store.mjs +0 -2
- package/src/artifacts.ts +0 -48
- package/src/links.ts +0 -23
- package/src/provenance.ts +0 -25
- package/src/records.ts +0 -76
- package/src/representations.ts +0 -51
- package/src/search-store.ts +0 -98
- package/src/vector-store.ts +0 -6
package/dist/store.d.mts
CHANGED
|
@@ -1,44 +1,107 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { KnowledgeRepresentation } from "./representations.mjs";
|
|
5
|
-
import { KnowledgeLink } from "./links.mjs";
|
|
6
|
-
import { KnowledgeProvenance } from "./provenance.mjs";
|
|
1
|
+
import { CreateKnowledgeDocumentInput, IndexedKnowledgeDocument, KnowledgeChunk, KnowledgeDocument, KnowledgeDocumentId, KnowledgeFile, KnowledgeScope, KnowledgeScopeId, KnowledgeSearchScope, UpdateKnowledgeDocumentInput } from "./documents.mjs";
|
|
2
|
+
import { KnowledgeEmbedding } from "./embeddings.mjs";
|
|
3
|
+
import { KnowledgeStoreError, SearchIndexStoreError } from "./errors.mjs";
|
|
7
4
|
import { Context, Effect } from "effect";
|
|
8
|
-
|
|
9
|
-
//#region src/store.d.ts
|
|
10
|
-
type GetKnowledgeRecordInput = {
|
|
5
|
+
export type GetKnowledgeDocumentInput = {
|
|
11
6
|
readonly scope: KnowledgeScope;
|
|
12
|
-
readonly id:
|
|
7
|
+
readonly id: KnowledgeDocumentId;
|
|
13
8
|
};
|
|
14
|
-
type
|
|
9
|
+
export type GetKnowledgeDocumentBySlugInput = {
|
|
10
|
+
readonly scope: KnowledgeScope;
|
|
11
|
+
readonly slug: string;
|
|
12
|
+
};
|
|
13
|
+
export type ListKnowledgeDocumentsInput = {
|
|
15
14
|
readonly scope: KnowledgeScope;
|
|
16
15
|
readonly limit: number;
|
|
16
|
+
readonly availability?: KnowledgeDocument['availability'];
|
|
17
17
|
};
|
|
18
|
-
type
|
|
19
|
-
readonly
|
|
18
|
+
export type ListKnowledgeDocumentsResult = {
|
|
19
|
+
readonly documents: ReadonlyArray<KnowledgeDocument>;
|
|
20
20
|
};
|
|
21
|
-
type ListPinnedKnowledgeInput = {
|
|
21
|
+
export type ListPinnedKnowledgeInput = {
|
|
22
22
|
readonly scope: KnowledgeScope;
|
|
23
23
|
readonly limit: number;
|
|
24
24
|
};
|
|
25
|
-
type ListPinnedKnowledgeResult = {
|
|
26
|
-
readonly
|
|
27
|
-
readonly representations: ReadonlyArray<KnowledgeRepresentation>;
|
|
25
|
+
export type ListPinnedKnowledgeResult = {
|
|
26
|
+
readonly documents: ReadonlyArray<KnowledgeDocument>;
|
|
28
27
|
};
|
|
29
|
-
type KnowledgeStoreApi = {
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
28
|
+
export type KnowledgeStoreApi = {
|
|
29
|
+
readonly createDocument: (input: CreateKnowledgeDocumentInput) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>;
|
|
30
|
+
readonly updateDocument: (input: UpdateKnowledgeDocumentInput) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>;
|
|
31
|
+
readonly getDocument: (input: GetKnowledgeDocumentInput) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>;
|
|
32
|
+
readonly getDocumentBySlug: (input: GetKnowledgeDocumentBySlugInput) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>;
|
|
33
|
+
readonly listDocuments: (input: ListKnowledgeDocumentsInput) => Effect.Effect<ListKnowledgeDocumentsResult, KnowledgeStoreError>;
|
|
34
34
|
readonly listPinned: (input: ListPinnedKnowledgeInput) => Effect.Effect<ListPinnedKnowledgeResult, KnowledgeStoreError>;
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly listProvenance: (input: GetKnowledgeRecordInput) => Effect.Effect<ReadonlyArray<KnowledgeProvenance>, KnowledgeStoreError>;
|
|
38
|
-
readonly listLinks: (input: GetKnowledgeRecordInput) => Effect.Effect<ReadonlyArray<KnowledgeLink>, KnowledgeStoreError>;
|
|
35
|
+
readonly deleteDocument: (input: GetKnowledgeDocumentInput) => Effect.Effect<void, KnowledgeStoreError>;
|
|
36
|
+
readonly listFiles: (input: GetKnowledgeDocumentInput) => Effect.Effect<ReadonlyArray<KnowledgeFile>, KnowledgeStoreError>;
|
|
39
37
|
};
|
|
40
38
|
declare const KnowledgeStore_base: Context.ServiceClass<KnowledgeStore, "@yolk-sdk/knowledge/KnowledgeStore", KnowledgeStoreApi>;
|
|
41
|
-
declare class KnowledgeStore extends KnowledgeStore_base {}
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
export declare class KnowledgeStore extends KnowledgeStore_base {}
|
|
40
|
+
export type UpsertIndexedKnowledgeDocumentInput = {
|
|
41
|
+
readonly document: IndexedKnowledgeDocument;
|
|
42
|
+
};
|
|
43
|
+
export type ReplaceKnowledgeDocumentChunksInput = {
|
|
44
|
+
readonly scopeId: KnowledgeScopeId;
|
|
45
|
+
readonly documentId: KnowledgeDocumentId;
|
|
46
|
+
readonly chunks: ReadonlyArray<{
|
|
47
|
+
readonly chunk: KnowledgeChunk;
|
|
48
|
+
readonly embedding: KnowledgeEmbedding;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
export type MarkKnowledgeDocumentReadyInput = {
|
|
52
|
+
readonly scopeId: KnowledgeScopeId;
|
|
53
|
+
readonly documentId: KnowledgeDocumentId;
|
|
54
|
+
readonly title?: string;
|
|
55
|
+
readonly summary?: string;
|
|
56
|
+
readonly contentHash?: string;
|
|
57
|
+
readonly tokenCount: number;
|
|
58
|
+
readonly chunkCount: number;
|
|
59
|
+
};
|
|
60
|
+
export type MarkKnowledgeDocumentErrorInput = {
|
|
61
|
+
readonly scopeId: KnowledgeScopeId;
|
|
62
|
+
readonly documentId: KnowledgeDocumentId;
|
|
63
|
+
readonly message: string;
|
|
64
|
+
};
|
|
65
|
+
export type KnowledgeChunkSearchInput = {
|
|
66
|
+
readonly scope: KnowledgeSearchScope;
|
|
67
|
+
readonly embedding: KnowledgeEmbedding;
|
|
68
|
+
readonly limit: number;
|
|
69
|
+
readonly minScore?: number;
|
|
70
|
+
};
|
|
71
|
+
export type KnowledgeChunkTextSearchInput = {
|
|
72
|
+
readonly scope: KnowledgeSearchScope;
|
|
73
|
+
readonly query: string;
|
|
74
|
+
readonly limit: number;
|
|
75
|
+
};
|
|
76
|
+
export type KnowledgeChunkSearchResult = {
|
|
77
|
+
readonly chunk: KnowledgeChunk;
|
|
78
|
+
readonly score: number;
|
|
79
|
+
readonly document: IndexedKnowledgeDocument;
|
|
80
|
+
};
|
|
81
|
+
export type KnowledgeSearchContextChunksInput = {
|
|
82
|
+
readonly scopeId: KnowledgeScopeId;
|
|
83
|
+
readonly documentId: KnowledgeDocumentId;
|
|
84
|
+
readonly position: number;
|
|
85
|
+
readonly contextChunks: number;
|
|
86
|
+
};
|
|
87
|
+
export type SearchIndexStoreApi = {
|
|
88
|
+
readonly upsertDocument: (input: UpsertIndexedKnowledgeDocumentInput) => Effect.Effect<IndexedKnowledgeDocument, SearchIndexStoreError>;
|
|
89
|
+
readonly markDocumentProcessing: (input: {
|
|
90
|
+
readonly scopeId: KnowledgeScopeId;
|
|
91
|
+
readonly documentId: KnowledgeDocumentId;
|
|
92
|
+
}) => Effect.Effect<IndexedKnowledgeDocument, SearchIndexStoreError>;
|
|
93
|
+
readonly replaceDocumentChunks: (input: ReplaceKnowledgeDocumentChunksInput) => Effect.Effect<void, SearchIndexStoreError>;
|
|
94
|
+
readonly markDocumentReady: (input: MarkKnowledgeDocumentReadyInput) => Effect.Effect<IndexedKnowledgeDocument, SearchIndexStoreError>;
|
|
95
|
+
readonly markDocumentError: (input: MarkKnowledgeDocumentErrorInput) => Effect.Effect<void, SearchIndexStoreError>;
|
|
96
|
+
readonly deleteDocument: (input: {
|
|
97
|
+
readonly scopeId: KnowledgeScopeId;
|
|
98
|
+
readonly documentId: KnowledgeDocumentId;
|
|
99
|
+
}) => Effect.Effect<void, SearchIndexStoreError>;
|
|
100
|
+
readonly searchChunks: (input: KnowledgeChunkSearchInput) => Effect.Effect<ReadonlyArray<KnowledgeChunkSearchResult>, SearchIndexStoreError>;
|
|
101
|
+
readonly searchChunksByText: (input: KnowledgeChunkTextSearchInput) => Effect.Effect<ReadonlyArray<KnowledgeChunkSearchResult>, SearchIndexStoreError>;
|
|
102
|
+
readonly getContextChunks: (input: KnowledgeSearchContextChunksInput) => Effect.Effect<ReadonlyArray<KnowledgeChunk>, SearchIndexStoreError>;
|
|
103
|
+
};
|
|
104
|
+
declare const SearchIndexStore_base: Context.ServiceClass<SearchIndexStore, "@yolk-sdk/knowledge/SearchIndexStore", SearchIndexStoreApi>;
|
|
105
|
+
export declare class SearchIndexStore extends SearchIndexStore_base {}
|
|
106
|
+
export {};
|
|
44
107
|
//# sourceMappingURL=store.d.mts.map
|
package/dist/store.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.mts","names":[],"sources":["../src/store.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.mts","names":[],"sources":["../src/store.ts"],"mappings":";;;;YAiBY;WACD,OAAO;WACP,IAAI;;YAGH;WACD,OAAO;WACP;;YAGC;WACD,OAAO;WACP;WACA,eAAe;;YAGd;WACD,WAAW,cAAc;;YAGxB;WACD,OAAO;WACP;;YAGC;WACD,WAAW,cAAc;;YAGxB;WACD,iBACP,OAAO,iCACJ,OAAO,OAAO,mBAAmB;WAC7B,iBACP,OAAO,iCACJ,OAAO,OAAO,mBAAmB;WAC7B,cACP,OAAO,8BACJ,OAAO,OAAO,mBAAmB;WAC7B,oBACP,OAAO,oCACJ,OAAO,OAAO,mBAAmB;WAC7B,gBACP,OAAO,gCACJ,OAAO,OAAO,8BAA8B;WACxC,aACP,OAAO,6BACJ,OAAO,OAAO,2BAA2B;WACrC,iBACP,OAAO,8BACJ,OAAO,aAAa;WAChB,YACP,OAAO,8BACJ,OAAO,OAAO,cAAc,gBAAgB;;;qBAGtC,uBAAuB;YAIxB;WACD,UAAU;;YAGT;WACD,SAAS;WACT,YAAY;WACZ,QAAQ;aACN,OAAO;aACP,WAAW;;;YAIZ;WACD,SAAS;WACT,YAAY;WACZ;WACA;WACA;WACA;WACA;;YAGC;WACD,SAAS;WACT,YAAY;WACZ;;YAGC;WACD,OAAO;WACP,WAAW;WACX;WACA;;YAGC;WACD,OAAO;WACP;WACA;;YAGC;WACD,OAAO;WACP;WACA,UAAU;;YAGT;WACD,SAAS;WACT,YAAY;WACZ;WACA;;YAGC;WACD,iBACP,OAAO,wCACJ,OAAO,OAAO,0BAA0B;WACpC,yBAAyB;aACvB,SAAS;aACT,YAAY;QACjB,OAAO,OAAO,0BAA0B;WACrC,wBACP,OAAO,wCACJ,OAAO,aAAa;WAChB,oBACP,OAAO,oCACJ,OAAO,OAAO,0BAA0B;WACpC,oBACP,OAAO,oCACJ,OAAO,aAAa;WAChB,iBAAiB;aACf,SAAS;aACT,YAAY;QACjB,OAAO,aAAa;WACjB,eACP,OAAO,8BACJ,OAAO,OAAO,cAAc,6BAA6B;WACrD,qBACP,OAAO,kCACJ,OAAO,OAAO,cAAc,6BAA6B;WACrD,mBACP,OAAO,sCACJ,OAAO,OAAO,cAAc,iBAAiB;;;qBAGvC,yBAAyB"}
|
package/dist/store.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/store.ts
|
|
3
3
|
var KnowledgeStore = class extends Context.Service()("@yolk-sdk/knowledge/KnowledgeStore") {};
|
|
4
|
-
|
|
5
|
-
export { KnowledgeStore };
|
|
4
|
+
var SearchIndexStore = class extends Context.Service()("@yolk-sdk/knowledge/SearchIndexStore") {};
|
|
5
|
+
export { KnowledgeStore, SearchIndexStore };
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=store.mjs.map
|
package/dist/store.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.mjs","names":[],"sources":["../src/store.ts"],"sourcesContent":["import { Context } from 'effect'\nimport type { Effect } from 'effect'\nimport type {
|
|
1
|
+
{"version":3,"file":"store.mjs","names":[],"sources":["../src/store.ts"],"sourcesContent":["import { Context } from 'effect'\nimport type { Effect } from 'effect'\nimport type {\n CreateKnowledgeDocumentInput,\n IndexedKnowledgeDocument,\n KnowledgeChunk,\n KnowledgeDocument,\n KnowledgeDocumentId,\n KnowledgeFile,\n KnowledgeScope,\n KnowledgeScopeId,\n KnowledgeSearchScope,\n UpdateKnowledgeDocumentInput\n} from './documents.ts'\nimport type { KnowledgeEmbedding } from './embeddings.ts'\nimport type { KnowledgeStoreError, SearchIndexStoreError } from './errors.ts'\n\nexport type GetKnowledgeDocumentInput = {\n readonly scope: KnowledgeScope\n readonly id: KnowledgeDocumentId\n}\n\nexport type GetKnowledgeDocumentBySlugInput = {\n readonly scope: KnowledgeScope\n readonly slug: string\n}\n\nexport type ListKnowledgeDocumentsInput = {\n readonly scope: KnowledgeScope\n readonly limit: number\n readonly availability?: KnowledgeDocument['availability']\n}\n\nexport type ListKnowledgeDocumentsResult = {\n readonly documents: ReadonlyArray<KnowledgeDocument>\n}\n\nexport type ListPinnedKnowledgeInput = {\n readonly scope: KnowledgeScope\n readonly limit: number\n}\n\nexport type ListPinnedKnowledgeResult = {\n readonly documents: ReadonlyArray<KnowledgeDocument>\n}\n\nexport type KnowledgeStoreApi = {\n readonly createDocument: (\n input: CreateKnowledgeDocumentInput\n ) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>\n readonly updateDocument: (\n input: UpdateKnowledgeDocumentInput\n ) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>\n readonly getDocument: (\n input: GetKnowledgeDocumentInput\n ) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>\n readonly getDocumentBySlug: (\n input: GetKnowledgeDocumentBySlugInput\n ) => Effect.Effect<KnowledgeDocument, KnowledgeStoreError>\n readonly listDocuments: (\n input: ListKnowledgeDocumentsInput\n ) => Effect.Effect<ListKnowledgeDocumentsResult, KnowledgeStoreError>\n readonly listPinned: (\n input: ListPinnedKnowledgeInput\n ) => Effect.Effect<ListPinnedKnowledgeResult, KnowledgeStoreError>\n readonly deleteDocument: (\n input: GetKnowledgeDocumentInput\n ) => Effect.Effect<void, KnowledgeStoreError>\n readonly listFiles: (\n input: GetKnowledgeDocumentInput\n ) => Effect.Effect<ReadonlyArray<KnowledgeFile>, KnowledgeStoreError>\n}\n\nexport class KnowledgeStore extends Context.Service<KnowledgeStore, KnowledgeStoreApi>()(\n '@yolk-sdk/knowledge/KnowledgeStore'\n) {}\n\nexport type UpsertIndexedKnowledgeDocumentInput = {\n readonly document: IndexedKnowledgeDocument\n}\n\nexport type ReplaceKnowledgeDocumentChunksInput = {\n readonly scopeId: KnowledgeScopeId\n readonly documentId: KnowledgeDocumentId\n readonly chunks: ReadonlyArray<{\n readonly chunk: KnowledgeChunk\n readonly embedding: KnowledgeEmbedding\n }>\n}\n\nexport type MarkKnowledgeDocumentReadyInput = {\n readonly scopeId: KnowledgeScopeId\n readonly documentId: KnowledgeDocumentId\n readonly title?: string\n readonly summary?: string\n readonly contentHash?: string\n readonly tokenCount: number\n readonly chunkCount: number\n}\n\nexport type MarkKnowledgeDocumentErrorInput = {\n readonly scopeId: KnowledgeScopeId\n readonly documentId: KnowledgeDocumentId\n readonly message: string\n}\n\nexport type KnowledgeChunkSearchInput = {\n readonly scope: KnowledgeSearchScope\n readonly embedding: KnowledgeEmbedding\n readonly limit: number\n readonly minScore?: number\n}\n\nexport type KnowledgeChunkTextSearchInput = {\n readonly scope: KnowledgeSearchScope\n readonly query: string\n readonly limit: number\n}\n\nexport type KnowledgeChunkSearchResult = {\n readonly chunk: KnowledgeChunk\n readonly score: number\n readonly document: IndexedKnowledgeDocument\n}\n\nexport type KnowledgeSearchContextChunksInput = {\n readonly scopeId: KnowledgeScopeId\n readonly documentId: KnowledgeDocumentId\n readonly position: number\n readonly contextChunks: number\n}\n\nexport type SearchIndexStoreApi = {\n readonly upsertDocument: (\n input: UpsertIndexedKnowledgeDocumentInput\n ) => Effect.Effect<IndexedKnowledgeDocument, SearchIndexStoreError>\n readonly markDocumentProcessing: (input: {\n readonly scopeId: KnowledgeScopeId\n readonly documentId: KnowledgeDocumentId\n }) => Effect.Effect<IndexedKnowledgeDocument, SearchIndexStoreError>\n readonly replaceDocumentChunks: (\n input: ReplaceKnowledgeDocumentChunksInput\n ) => Effect.Effect<void, SearchIndexStoreError>\n readonly markDocumentReady: (\n input: MarkKnowledgeDocumentReadyInput\n ) => Effect.Effect<IndexedKnowledgeDocument, SearchIndexStoreError>\n readonly markDocumentError: (\n input: MarkKnowledgeDocumentErrorInput\n ) => Effect.Effect<void, SearchIndexStoreError>\n readonly deleteDocument: (input: {\n readonly scopeId: KnowledgeScopeId\n readonly documentId: KnowledgeDocumentId\n }) => Effect.Effect<void, SearchIndexStoreError>\n readonly searchChunks: (\n input: KnowledgeChunkSearchInput\n ) => Effect.Effect<ReadonlyArray<KnowledgeChunkSearchResult>, SearchIndexStoreError>\n readonly searchChunksByText: (\n input: KnowledgeChunkTextSearchInput\n ) => Effect.Effect<ReadonlyArray<KnowledgeChunkSearchResult>, SearchIndexStoreError>\n readonly getContextChunks: (\n input: KnowledgeSearchContextChunksInput\n ) => Effect.Effect<ReadonlyArray<KnowledgeChunk>, SearchIndexStoreError>\n}\n\nexport class SearchIndexStore extends Context.Service<SearchIndexStore, SearchIndexStoreApi>()(\n '@yolk-sdk/knowledge/SearchIndexStore'\n) {}\n"],"mappings":";;AAyEA,IAAa,iBAAb,cAAoC,QAAQ,QAA2C,CAAC,CACtF,oCACF,CAAC,CAAC,CAAC;AAyFH,IAAa,mBAAb,cAAsC,QAAQ,QAA+C,CAAC,CAC5F,sCACF,CAAC,CAAC,CAAC"}
|
package/dist/summarization.d.mts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { KnowledgeMetadata } from "./documents.mjs";
|
|
2
2
|
import { KnowledgeSummarizationError } from "./errors.mjs";
|
|
3
3
|
import { Context, Effect, Layer } from "effect";
|
|
4
|
-
|
|
5
|
-
//#region src/summarization.d.ts
|
|
6
|
-
type KnowledgeDocumentSummary = {
|
|
4
|
+
export type KnowledgeDocumentSummary = {
|
|
7
5
|
readonly title?: string;
|
|
8
6
|
readonly summary?: string;
|
|
9
7
|
};
|
|
10
|
-
type SummarizeKnowledgeDocumentInput = {
|
|
8
|
+
export type SummarizeKnowledgeDocumentInput = {
|
|
11
9
|
readonly content: string;
|
|
12
10
|
readonly sourceTitle?: string;
|
|
13
11
|
readonly metadata?: KnowledgeMetadata;
|
|
14
12
|
};
|
|
15
|
-
type KnowledgeSummarizerApi = {
|
|
13
|
+
export type KnowledgeSummarizerApi = {
|
|
16
14
|
readonly summarize: (input: SummarizeKnowledgeDocumentInput) => Effect.Effect<KnowledgeDocumentSummary, KnowledgeSummarizationError>;
|
|
17
15
|
};
|
|
18
16
|
declare const KnowledgeSummarizer_base: Context.ServiceClass<KnowledgeSummarizer, "@yolk-sdk/knowledge/KnowledgeSummarizer", KnowledgeSummarizerApi>;
|
|
19
|
-
declare class KnowledgeSummarizer extends KnowledgeSummarizer_base {}
|
|
20
|
-
declare const NoopKnowledgeSummarizerLive: Layer.Layer<KnowledgeSummarizer, never, never>;
|
|
21
|
-
|
|
22
|
-
export { KnowledgeDocumentSummary, KnowledgeSummarizer, KnowledgeSummarizerApi, NoopKnowledgeSummarizerLive, SummarizeKnowledgeDocumentInput };
|
|
17
|
+
export declare class KnowledgeSummarizer extends KnowledgeSummarizer_base {}
|
|
18
|
+
export declare const NoopKnowledgeSummarizerLive: Layer.Layer<KnowledgeSummarizer, never, never>;
|
|
19
|
+
export {};
|
|
23
20
|
//# sourceMappingURL=summarization.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarization.d.mts","names":[],"sources":["../src/summarization.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"summarization.d.mts","names":[],"sources":["../src/summarization.ts"],"mappings":";;;YAIY;WACD;WACA;;YAGC;WACD;WACA;WACA,WAAW;;YAGV;WACD,YACP,OAAO,oCACJ,OAAO,OAAO,0BAA0B;;;qBAGlC,4BAA4B;qBAK5B,6BAA2B,MAAA,MAAA"}
|
package/dist/summarization.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/summarization.ts
|
|
3
3
|
var KnowledgeSummarizer = class extends Context.Service()("@yolk-sdk/knowledge/KnowledgeSummarizer") {};
|
|
4
4
|
const NoopKnowledgeSummarizerLive = Layer.succeed(KnowledgeSummarizer, { summarize: (input) => Effect.succeed({ title: input.sourceTitle }) });
|
|
5
|
-
//#endregion
|
|
6
5
|
export { KnowledgeSummarizer, NoopKnowledgeSummarizerLive };
|
|
7
6
|
|
|
8
7
|
//# sourceMappingURL=summarization.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarization.mjs","names":[],"sources":["../src/summarization.ts"],"sourcesContent":["import { Context, Effect, Layer } from 'effect'\nimport type { KnowledgeMetadata } from './documents.ts'\nimport type { KnowledgeSummarizationError } from './errors.ts'\n\nexport type KnowledgeDocumentSummary = {\n readonly title?: string\n readonly summary?: string\n}\n\nexport type SummarizeKnowledgeDocumentInput = {\n readonly content: string\n readonly sourceTitle?: string\n readonly metadata?: KnowledgeMetadata\n}\n\nexport type KnowledgeSummarizerApi = {\n readonly summarize: (\n input: SummarizeKnowledgeDocumentInput\n ) => Effect.Effect<KnowledgeDocumentSummary, KnowledgeSummarizationError>\n}\n\nexport class KnowledgeSummarizer extends Context.Service
|
|
1
|
+
{"version":3,"file":"summarization.mjs","names":[],"sources":["../src/summarization.ts"],"sourcesContent":["import { Context, Effect, Layer } from 'effect'\nimport type { KnowledgeMetadata } from './documents.ts'\nimport type { KnowledgeSummarizationError } from './errors.ts'\n\nexport type KnowledgeDocumentSummary = {\n readonly title?: string\n readonly summary?: string\n}\n\nexport type SummarizeKnowledgeDocumentInput = {\n readonly content: string\n readonly sourceTitle?: string\n readonly metadata?: KnowledgeMetadata\n}\n\nexport type KnowledgeSummarizerApi = {\n readonly summarize: (\n input: SummarizeKnowledgeDocumentInput\n ) => Effect.Effect<KnowledgeDocumentSummary, KnowledgeSummarizationError>\n}\n\nexport class KnowledgeSummarizer extends Context.Service<\n KnowledgeSummarizer,\n KnowledgeSummarizerApi\n>()('@yolk-sdk/knowledge/KnowledgeSummarizer') {}\n\nexport const NoopKnowledgeSummarizerLive = Layer.succeed(KnowledgeSummarizer, {\n summarize: input => Effect.succeed({ title: input.sourceTitle })\n})\n"],"mappings":";;AAqBA,IAAa,sBAAb,cAAyC,QAAQ,QAG/C,CAAC,CAAC,yCAAyC,CAAC,CAAC,CAAC;AAEhD,MAAa,8BAA8B,MAAM,QAAQ,qBAAqB,EAC5E,YAAW,UAAS,OAAO,QAAQ,EAAE,OAAO,MAAM,YAAY,CAAC,EACjE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yolk-sdk/knowledge",
|
|
3
|
-
"version": "0.1.0-canary.
|
|
4
|
-
"description": "Domain-free knowledge
|
|
3
|
+
"version": "0.1.0-canary.130",
|
|
4
|
+
"description": "Domain-free knowledge document/source/file/context, ingestion, hybrid search, and lookup/manage tool helpers for agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"knowledge",
|
|
19
19
|
"agents",
|
|
20
20
|
"context",
|
|
21
|
-
"
|
|
21
|
+
"search",
|
|
22
22
|
"effect"
|
|
23
23
|
],
|
|
24
24
|
"engines": {
|
|
@@ -36,11 +36,6 @@
|
|
|
36
36
|
"import": "./dist/agent.mjs",
|
|
37
37
|
"default": "./dist/agent.mjs"
|
|
38
38
|
},
|
|
39
|
-
"./artifacts": {
|
|
40
|
-
"types": "./dist/artifacts.d.mts",
|
|
41
|
-
"import": "./dist/artifacts.mjs",
|
|
42
|
-
"default": "./dist/artifacts.mjs"
|
|
43
|
-
},
|
|
44
39
|
"./context": {
|
|
45
40
|
"types": "./dist/context.d.mts",
|
|
46
41
|
"import": "./dist/context.mjs",
|
|
@@ -66,6 +61,11 @@
|
|
|
66
61
|
"import": "./dist/extraction.mjs",
|
|
67
62
|
"default": "./dist/extraction.mjs"
|
|
68
63
|
},
|
|
64
|
+
"./files": {
|
|
65
|
+
"types": "./dist/files.d.mts",
|
|
66
|
+
"import": "./dist/files.mjs",
|
|
67
|
+
"default": "./dist/files.mjs"
|
|
68
|
+
},
|
|
69
69
|
"./ingestion": {
|
|
70
70
|
"types": "./dist/ingestion.d.mts",
|
|
71
71
|
"import": "./dist/ingestion.mjs",
|
|
@@ -76,31 +76,6 @@
|
|
|
76
76
|
"import": "./dist/documents.mjs",
|
|
77
77
|
"default": "./dist/documents.mjs"
|
|
78
78
|
},
|
|
79
|
-
"./search-store": {
|
|
80
|
-
"types": "./dist/search-store.d.mts",
|
|
81
|
-
"import": "./dist/search-store.mjs",
|
|
82
|
-
"default": "./dist/search-store.mjs"
|
|
83
|
-
},
|
|
84
|
-
"./links": {
|
|
85
|
-
"types": "./dist/links.d.mts",
|
|
86
|
-
"import": "./dist/links.mjs",
|
|
87
|
-
"default": "./dist/links.mjs"
|
|
88
|
-
},
|
|
89
|
-
"./records": {
|
|
90
|
-
"types": "./dist/records.d.mts",
|
|
91
|
-
"import": "./dist/records.mjs",
|
|
92
|
-
"default": "./dist/records.mjs"
|
|
93
|
-
},
|
|
94
|
-
"./provenance": {
|
|
95
|
-
"types": "./dist/provenance.d.mts",
|
|
96
|
-
"import": "./dist/provenance.mjs",
|
|
97
|
-
"default": "./dist/provenance.mjs"
|
|
98
|
-
},
|
|
99
|
-
"./representations": {
|
|
100
|
-
"types": "./dist/representations.d.mts",
|
|
101
|
-
"import": "./dist/representations.mjs",
|
|
102
|
-
"default": "./dist/representations.mjs"
|
|
103
|
-
},
|
|
104
79
|
"./search": {
|
|
105
80
|
"types": "./dist/search.d.mts",
|
|
106
81
|
"import": "./dist/search.mjs",
|
|
@@ -115,11 +90,6 @@
|
|
|
115
90
|
"types": "./dist/summarization.d.mts",
|
|
116
91
|
"import": "./dist/summarization.mjs",
|
|
117
92
|
"default": "./dist/summarization.mjs"
|
|
118
|
-
},
|
|
119
|
-
"./vector-store": {
|
|
120
|
-
"types": "./dist/vector-store.d.mts",
|
|
121
|
-
"import": "./dist/vector-store.mjs",
|
|
122
|
-
"default": "./dist/vector-store.mjs"
|
|
123
93
|
}
|
|
124
94
|
},
|
|
125
95
|
"files": [
|
|
@@ -134,13 +104,13 @@
|
|
|
134
104
|
"provenance": true
|
|
135
105
|
},
|
|
136
106
|
"dependencies": {
|
|
137
|
-
"effect": "4.
|
|
107
|
+
"effect": "4.1.2",
|
|
138
108
|
"gpt-tokenizer": "^3.4.0",
|
|
139
|
-
"@yolk-sdk/agent": "^0.1.0-canary.
|
|
109
|
+
"@yolk-sdk/agent": "^0.1.0-canary.130"
|
|
140
110
|
},
|
|
141
111
|
"scripts": {
|
|
142
112
|
"build": "tsdown",
|
|
143
|
-
"check": "
|
|
113
|
+
"check": "effect-tsgo tsrs -p tsconfig.json --noEmit",
|
|
144
114
|
"test": "vitest run --passWithNoTests",
|
|
145
115
|
"test:run": "vitest run --passWithNoTests"
|
|
146
116
|
}
|