@nahisaho/musubix-agent-orchestrator 3.0.16 → 3.1.0
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/KnowledgeContextStore.d.ts +85 -0
- package/dist/infrastructure/KnowledgeContextStore.d.ts.map +1 -0
- package/dist/infrastructure/KnowledgeContextStore.js +97 -0
- package/dist/infrastructure/KnowledgeContextStore.js.map +1 -0
- package/dist/infrastructure/index.d.ts +1 -1
- package/dist/infrastructure/index.d.ts.map +1 -1
- package/dist/infrastructure/index.js +1 -1
- package/dist/infrastructure/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/infrastructure/YATAContextStore.d.ts +0 -60
- package/dist/infrastructure/YATAContextStore.d.ts.map +0 -1
- package/dist/infrastructure/YATAContextStore.js +0 -99
- package/dist/infrastructure/YATAContextStore.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ export * from './application/ContextManager.js';
|
|
|
28
28
|
export * from './application/ParallelExecutor.js';
|
|
29
29
|
export * from './application/ResultAggregator.js';
|
|
30
30
|
export * from './infrastructure/SubagentAdapter.js';
|
|
31
|
-
export * from './infrastructure/
|
|
31
|
+
export * from './infrastructure/KnowledgeContextStore.js';
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAGvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAG9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AAGxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAGlD,cAAc,qCAAqC,CAAC;AACpD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAGvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAG9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AAGxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAGlD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -33,5 +33,5 @@ export * from './application/ParallelExecutor.js';
|
|
|
33
33
|
export * from './application/ResultAggregator.js';
|
|
34
34
|
// Infrastructure
|
|
35
35
|
export * from './infrastructure/SubagentAdapter.js';
|
|
36
|
-
export * from './infrastructure/
|
|
36
|
+
export * from './infrastructure/KnowledgeContextStore.js';
|
|
37
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,yBAAyB;AACzB,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,oBAAoB;AACpB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAE9C,oBAAoB;AACpB,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AAExD,uBAAuB;AACvB,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAElD,iBAAiB;AACjB,cAAc,qCAAqC,CAAC;AACpD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,yBAAyB;AACzB,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,oBAAoB;AACpB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAE9C,oBAAoB;AACpB,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AAExD,uBAAuB;AACvB,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAElD,iBAAiB;AACjB,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KnowledgeContextStore Infrastructure
|
|
3
|
+
*
|
|
4
|
+
* Persists execution contexts to @musubix/knowledge store
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-SDD-003 - Context Sharing
|
|
7
|
+
*/
|
|
8
|
+
import type { ExecutionContext } from '../domain/entities/ExecutionContext.js';
|
|
9
|
+
/**
|
|
10
|
+
* Context store interface
|
|
11
|
+
*/
|
|
12
|
+
export interface IContextStore {
|
|
13
|
+
/**
|
|
14
|
+
* Save context
|
|
15
|
+
* @param context - Context to save
|
|
16
|
+
* @returns Context ID
|
|
17
|
+
*/
|
|
18
|
+
save(context: ExecutionContext): Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Load context by task ID
|
|
21
|
+
* @param taskId - Task ID
|
|
22
|
+
* @returns Context or null
|
|
23
|
+
*/
|
|
24
|
+
load(taskId: string): Promise<ExecutionContext | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete context
|
|
27
|
+
* @param taskId - Task ID
|
|
28
|
+
* @returns true if deleted
|
|
29
|
+
*/
|
|
30
|
+
delete(taskId: string): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* List all context IDs
|
|
33
|
+
* @returns Context task IDs
|
|
34
|
+
*/
|
|
35
|
+
list(): Promise<string[]>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Knowledge store adapter interface
|
|
39
|
+
* Compatible with @musubix/knowledge KnowledgeStore
|
|
40
|
+
*/
|
|
41
|
+
export interface IKnowledgeStoreAdapter {
|
|
42
|
+
putEntity(entity: {
|
|
43
|
+
id: string;
|
|
44
|
+
type: string;
|
|
45
|
+
name: string;
|
|
46
|
+
properties: Record<string, unknown>;
|
|
47
|
+
tags: string[];
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
getEntity(id: string): Promise<{
|
|
50
|
+
id: string;
|
|
51
|
+
type: string;
|
|
52
|
+
name: string;
|
|
53
|
+
properties: Record<string, unknown>;
|
|
54
|
+
tags: string[];
|
|
55
|
+
} | null>;
|
|
56
|
+
deleteEntity(id: string): Promise<boolean>;
|
|
57
|
+
query(filter: {
|
|
58
|
+
type?: string;
|
|
59
|
+
tags?: string[];
|
|
60
|
+
}): Promise<Array<{
|
|
61
|
+
id: string;
|
|
62
|
+
type: string;
|
|
63
|
+
name: string;
|
|
64
|
+
properties: Record<string, unknown>;
|
|
65
|
+
tags: string[];
|
|
66
|
+
}>>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* In-memory context store (for testing)
|
|
70
|
+
*/
|
|
71
|
+
export declare function createInMemoryContextStore(): IContextStore;
|
|
72
|
+
/**
|
|
73
|
+
* Knowledge Store-based context store (v3.0.0)
|
|
74
|
+
*
|
|
75
|
+
* Uses @musubix/knowledge for context persistence
|
|
76
|
+
*/
|
|
77
|
+
export declare function createKnowledgeContextStore(knowledgeStore: IKnowledgeStoreAdapter): IContextStore;
|
|
78
|
+
/**
|
|
79
|
+
* Store factory
|
|
80
|
+
*
|
|
81
|
+
* @param knowledgeStore - Optional knowledge store adapter. If provided, uses persistent storage.
|
|
82
|
+
* @returns Context store instance
|
|
83
|
+
*/
|
|
84
|
+
export declare function createContextStoreFactory(knowledgeStore?: IKnowledgeStoreAdapter): IContextStore;
|
|
85
|
+
//# sourceMappingURL=KnowledgeContextStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KnowledgeContextStore.d.ts","sourceRoot":"","sources":["../../src/infrastructure/KnowledgeContextStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAK/E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAEvD;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,C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Kf"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KnowledgeContextStore Infrastructure
|
|
3
|
+
*
|
|
4
|
+
* Persists execution contexts to @musubix/knowledge store
|
|
5
|
+
*
|
|
6
|
+
* @see REQ-SDD-003 - Context Sharing
|
|
7
|
+
*/
|
|
8
|
+
import { createExecutionContext } from '../domain/entities/ExecutionContext.js';
|
|
9
|
+
import { createContextSnapshot } from '../application/ContextManager.js';
|
|
10
|
+
/**
|
|
11
|
+
* In-memory context store (for testing)
|
|
12
|
+
*/
|
|
13
|
+
export function createInMemoryContextStore() {
|
|
14
|
+
const store = new Map();
|
|
15
|
+
return {
|
|
16
|
+
async save(context) {
|
|
17
|
+
const snapshot = createContextSnapshot(context);
|
|
18
|
+
store.set(context.taskId, snapshot);
|
|
19
|
+
return context.taskId;
|
|
20
|
+
},
|
|
21
|
+
async load(taskId) {
|
|
22
|
+
const snapshot = store.get(taskId);
|
|
23
|
+
if (!snapshot)
|
|
24
|
+
return null;
|
|
25
|
+
return createExecutionContext({
|
|
26
|
+
taskId: snapshot.taskId,
|
|
27
|
+
sharedKnowledge: new Map(Object.entries(snapshot.knowledge)),
|
|
28
|
+
metadata: snapshot.metadata,
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
async delete(taskId) {
|
|
32
|
+
return store.delete(taskId);
|
|
33
|
+
},
|
|
34
|
+
async list() {
|
|
35
|
+
return Array.from(store.keys());
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Knowledge Store-based context store (v3.0.0)
|
|
41
|
+
*
|
|
42
|
+
* Uses @musubix/knowledge for context persistence
|
|
43
|
+
*/
|
|
44
|
+
export function createKnowledgeContextStore(knowledgeStore) {
|
|
45
|
+
const ENTITY_TYPE = 'code';
|
|
46
|
+
const CONTEXT_TAG = 'execution-context';
|
|
47
|
+
return {
|
|
48
|
+
async save(context) {
|
|
49
|
+
const snapshot = createContextSnapshot(context);
|
|
50
|
+
const entityId = `context:${context.taskId}`;
|
|
51
|
+
await knowledgeStore.putEntity({
|
|
52
|
+
id: entityId,
|
|
53
|
+
type: ENTITY_TYPE,
|
|
54
|
+
name: `ExecutionContext-${context.taskId}`,
|
|
55
|
+
properties: snapshot,
|
|
56
|
+
tags: [CONTEXT_TAG],
|
|
57
|
+
});
|
|
58
|
+
return context.taskId;
|
|
59
|
+
},
|
|
60
|
+
async load(taskId) {
|
|
61
|
+
const entityId = `context:${taskId}`;
|
|
62
|
+
const entity = await knowledgeStore.getEntity(entityId);
|
|
63
|
+
if (!entity)
|
|
64
|
+
return null;
|
|
65
|
+
const snapshot = entity.properties;
|
|
66
|
+
return createExecutionContext({
|
|
67
|
+
taskId: snapshot.taskId,
|
|
68
|
+
sharedKnowledge: new Map(Object.entries(snapshot.knowledge)),
|
|
69
|
+
metadata: snapshot.metadata,
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
async delete(taskId) {
|
|
73
|
+
const entityId = `context:${taskId}`;
|
|
74
|
+
return knowledgeStore.deleteEntity(entityId);
|
|
75
|
+
},
|
|
76
|
+
async list() {
|
|
77
|
+
const entities = await knowledgeStore.query({
|
|
78
|
+
type: ENTITY_TYPE,
|
|
79
|
+
tags: [CONTEXT_TAG],
|
|
80
|
+
});
|
|
81
|
+
return entities.map(e => e.id.replace('context:', ''));
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Store factory
|
|
87
|
+
*
|
|
88
|
+
* @param knowledgeStore - Optional knowledge store adapter. If provided, uses persistent storage.
|
|
89
|
+
* @returns Context store instance
|
|
90
|
+
*/
|
|
91
|
+
export function createContextStoreFactory(knowledgeStore) {
|
|
92
|
+
if (knowledgeStore) {
|
|
93
|
+
return createKnowledgeContextStore(knowledgeStore);
|
|
94
|
+
}
|
|
95
|
+
return createInMemoryContextStore();
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=Knowledge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c,CAAC,KAAK,CAAC;gBAC1C,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,CAAC,WAAW,CAAC;aACpB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;QACzD,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,cAAuC;IAEvC,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,2BAA2B,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,0BAA0B,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infrastructure/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KnowledgeContextStore Infrastructure
|
|
3
|
-
*
|
|
4
|
-
* Persists execution contexts to @musubix/knowledge store
|
|
5
|
-
*
|
|
6
|
-
* @see REQ-SDD-003 - Context Sharing
|
|
7
|
-
*/
|
|
8
|
-
import type { ExecutionContext } from '../domain/entities/ExecutionContext.js';
|
|
9
|
-
/**
|
|
10
|
-
* Context store interface
|
|
11
|
-
*/
|
|
12
|
-
export interface IContextStore {
|
|
13
|
-
/**
|
|
14
|
-
* Save context
|
|
15
|
-
* @param context - Context to save
|
|
16
|
-
* @returns Context ID
|
|
17
|
-
*/
|
|
18
|
-
save(context: ExecutionContext): Promise<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Load context by task ID
|
|
21
|
-
* @param taskId - Task ID
|
|
22
|
-
* @returns Context or null
|
|
23
|
-
*/
|
|
24
|
-
load(taskId: string): Promise<ExecutionContext | null>;
|
|
25
|
-
/**
|
|
26
|
-
* Delete context
|
|
27
|
-
* @param taskId - Task ID
|
|
28
|
-
* @returns true if deleted
|
|
29
|
-
*/
|
|
30
|
-
delete(taskId: string): Promise<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* List all context IDs
|
|
33
|
-
* @returns Context task IDs
|
|
34
|
-
*/
|
|
35
|
-
list(): Promise<string[]>;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* In-memory context store (for testing)
|
|
39
|
-
*/
|
|
40
|
-
export declare function createInMemoryContextStore(): IContextStore;
|
|
41
|
-
/**
|
|
42
|
-
* Knowledge Store-based context store
|
|
43
|
-
*
|
|
44
|
-
* Note: This is a placeholder. In production, this would integrate
|
|
45
|
-
* with the @musubix/knowledge store.
|
|
46
|
-
*
|
|
47
|
-
* @deprecated Use createKnowledgeContextStore instead
|
|
48
|
-
*/
|
|
49
|
-
export declare function createYATAContextStore(_knowledgeStore?: unknown): IContextStore;
|
|
50
|
-
/**
|
|
51
|
-
* Knowledge Store-based context store (v3.0.0)
|
|
52
|
-
*
|
|
53
|
-
* Uses @musubix/knowledge for context persistence
|
|
54
|
-
*/
|
|
55
|
-
export declare function createKnowledgeContextStore(_knowledgeStore?: unknown): IContextStore;
|
|
56
|
-
/**
|
|
57
|
-
* Store factory
|
|
58
|
-
*/
|
|
59
|
-
export declare function createContextStoreFactory(useKnowledgeStore?: boolean, knowledgeStore?: unknown): IContextStore;
|
|
60
|
-
//# sourceMappingURL=YATAContextStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"YATAContextStore.d.ts","sourceRoot":"","sources":["../../src/infrastructure/YATAContextStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAK/E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAEvD;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,aAAa,CA6B1D;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,aAAa,CA0C/E;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,aAAa,CAEpF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,iBAAiB,GAAE,OAAe,EAClC,cAAc,CAAC,EAAE,OAAO,GACvB,aAAa,CAKf"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KnowledgeContextStore Infrastructure
|
|
3
|
-
*
|
|
4
|
-
* Persists execution contexts to @musubix/knowledge store
|
|
5
|
-
*
|
|
6
|
-
* @see REQ-SDD-003 - Context Sharing
|
|
7
|
-
*/
|
|
8
|
-
import { createExecutionContext } from '../domain/entities/ExecutionContext.js';
|
|
9
|
-
import { createContextSnapshot } from '../application/ContextManager.js';
|
|
10
|
-
/**
|
|
11
|
-
* In-memory context store (for testing)
|
|
12
|
-
*/
|
|
13
|
-
export function createInMemoryContextStore() {
|
|
14
|
-
const store = new Map();
|
|
15
|
-
return {
|
|
16
|
-
async save(context) {
|
|
17
|
-
const snapshot = createContextSnapshot(context);
|
|
18
|
-
store.set(context.taskId, snapshot);
|
|
19
|
-
return context.taskId;
|
|
20
|
-
},
|
|
21
|
-
async load(taskId) {
|
|
22
|
-
const snapshot = store.get(taskId);
|
|
23
|
-
if (!snapshot)
|
|
24
|
-
return null;
|
|
25
|
-
return createExecutionContext({
|
|
26
|
-
taskId: snapshot.taskId,
|
|
27
|
-
sharedKnowledge: new Map(Object.entries(snapshot.knowledge)),
|
|
28
|
-
metadata: snapshot.metadata,
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
async delete(taskId) {
|
|
32
|
-
return store.delete(taskId);
|
|
33
|
-
},
|
|
34
|
-
async list() {
|
|
35
|
-
return Array.from(store.keys());
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Knowledge Store-based context store
|
|
41
|
-
*
|
|
42
|
-
* Note: This is a placeholder. In production, this would integrate
|
|
43
|
-
* with the @musubix/knowledge store.
|
|
44
|
-
*
|
|
45
|
-
* @deprecated Use createKnowledgeContextStore instead
|
|
46
|
-
*/
|
|
47
|
-
export function createYATAContextStore(_knowledgeStore) {
|
|
48
|
-
// Fallback to in-memory store until @musubix/knowledge integration is complete
|
|
49
|
-
const inMemoryStore = createInMemoryContextStore();
|
|
50
|
-
return {
|
|
51
|
-
async save(context) {
|
|
52
|
-
// In production, this would persist to @musubix/knowledge:
|
|
53
|
-
// await knowledgeStore.putEntity({
|
|
54
|
-
// id: `context:${context.taskId}`,
|
|
55
|
-
// type: 'code',
|
|
56
|
-
// name: `ExecutionContext-${context.taskId}`,
|
|
57
|
-
// properties: createContextSnapshot(context),
|
|
58
|
-
// tags: ['execution-context'],
|
|
59
|
-
// });
|
|
60
|
-
return inMemoryStore.save(context);
|
|
61
|
-
},
|
|
62
|
-
async load(taskId) {
|
|
63
|
-
// In production, this would load from @musubix/knowledge:
|
|
64
|
-
// const entity = await knowledgeStore.getEntity(`context:${taskId}`);
|
|
65
|
-
// if (!entity) return null;
|
|
66
|
-
// return restoreContextFromSnapshot(entity.properties);
|
|
67
|
-
return inMemoryStore.load(taskId);
|
|
68
|
-
},
|
|
69
|
-
async delete(taskId) {
|
|
70
|
-
// In production:
|
|
71
|
-
// await knowledgeStore.deleteEntity(`context:${taskId}`);
|
|
72
|
-
return inMemoryStore.delete(taskId);
|
|
73
|
-
},
|
|
74
|
-
async list() {
|
|
75
|
-
// In production:
|
|
76
|
-
// const entities = await knowledgeStore.query({ type: 'code', tags: ['execution-context'] });
|
|
77
|
-
// return entities.map(e => e.id.replace('context:', ''));
|
|
78
|
-
return inMemoryStore.list();
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Knowledge Store-based context store (v3.0.0)
|
|
84
|
-
*
|
|
85
|
-
* Uses @musubix/knowledge for context persistence
|
|
86
|
-
*/
|
|
87
|
-
export function createKnowledgeContextStore(_knowledgeStore) {
|
|
88
|
-
return createYATAContextStore(_knowledgeStore);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Store factory
|
|
92
|
-
*/
|
|
93
|
-
export function createContextStoreFactory(useKnowledgeStore = false, knowledgeStore) {
|
|
94
|
-
if (useKnowledgeStore && knowledgeStore) {
|
|
95
|
-
return createKnowledgeContextStore(knowledgeStore);
|
|
96
|
-
}
|
|
97
|
-
return createInMemoryContextStore();
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=YATAContextStore.js.map
|
|
@@ -1 +0,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