@ekairos/story 1.6.3 → 1.8.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/dist/agent.d.ts +72 -72
- package/dist/agent.js +478 -478
- package/dist/document-parser.d.ts +15 -15
- package/dist/document-parser.js +156 -156
- package/dist/engine.d.ts +21 -21
- package/dist/engine.js +35 -35
- package/dist/events.d.ts +27 -27
- package/dist/events.js +203 -203
- package/dist/index.d.ts +11 -11
- package/dist/index.js +50 -50
- package/dist/schema.d.ts +107 -107
- package/dist/schema.js +63 -63
- package/dist/service.d.ts +44 -44
- package/dist/service.js +202 -202
- package/dist/steps/ai.d.ts +42 -42
- package/dist/steps/ai.js +135 -135
- package/dist/steps/base.d.ts +13 -13
- package/dist/steps/base.js +36 -36
- package/dist/steps/index.d.ts +3 -3
- package/dist/steps/index.js +19 -19
- package/dist/steps/registry.d.ts +4 -4
- package/dist/steps/registry.js +28 -28
- package/dist/steps/sampleStep.d.ts.map +1 -1
- package/dist/steps/sampleStep.js.map +1 -1
- package/dist/steps-context.d.ts +11 -11
- package/dist/steps-context.js +19 -19
- package/dist/story.d.ts +49 -49
- package/dist/story.js +54 -54
- package/dist/storyEngine.d.ts +54 -54
- package/dist/storyEngine.js +50 -50
- package/dist/storyRunner.d.ts +7 -7
- package/dist/storyRunner.js +55 -55
- package/dist/workflows/sampleWorkflow.d.ts.map +1 -1
- package/dist/workflows/sampleWorkflow.js.map +1 -1
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
export declare const storyDomain: import("@ekairos/domain").DomainInstance<{
|
|
2
|
-
readonly story_contexts: import("@instantdb/core").EntityDef<{
|
|
3
|
-
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
4
|
-
updatedAt: import("@instantdb/core").DataAttrDef<Date, false, false>;
|
|
5
|
-
type: import("@instantdb/core").DataAttrDef<string, false, false>;
|
|
6
|
-
key: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
7
|
-
status: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
8
|
-
content: import("@instantdb/core").DataAttrDef<any, false, false>;
|
|
9
|
-
}, {}, void>;
|
|
10
|
-
readonly story_events: import("@instantdb/core").EntityDef<{
|
|
11
|
-
channel: import("@instantdb/core").DataAttrDef<string, true, true>;
|
|
12
|
-
createdAt: import("@instantdb/core").DataAttrDef<Date, true, true>;
|
|
13
|
-
type: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
14
|
-
content: import("@instantdb/core").DataAttrDef<any, false, false>;
|
|
15
|
-
status: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
16
|
-
}, {}, void>;
|
|
17
|
-
readonly story_executions: import("@instantdb/core").EntityDef<{
|
|
18
|
-
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
19
|
-
updatedAt: import("@instantdb/core").DataAttrDef<Date, false, false>;
|
|
20
|
-
status: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
21
|
-
}, {}, void>;
|
|
22
|
-
}, {
|
|
23
|
-
readonly storyContextsOrganization: {
|
|
24
|
-
readonly forward: {
|
|
25
|
-
readonly on: "story_contexts";
|
|
26
|
-
readonly has: "one";
|
|
27
|
-
readonly label: "organization";
|
|
28
|
-
};
|
|
29
|
-
readonly reverse: {
|
|
30
|
-
readonly on: "organizations";
|
|
31
|
-
readonly has: "many";
|
|
32
|
-
readonly label: "story_contexts";
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
readonly storyEventsOrganization: {
|
|
36
|
-
readonly forward: {
|
|
37
|
-
readonly on: "story_events";
|
|
38
|
-
readonly has: "one";
|
|
39
|
-
readonly label: "organization";
|
|
40
|
-
};
|
|
41
|
-
readonly reverse: {
|
|
42
|
-
readonly on: "organizations";
|
|
43
|
-
readonly has: "many";
|
|
44
|
-
readonly label: "story_events";
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
readonly storyEventsContext: {
|
|
48
|
-
readonly forward: {
|
|
49
|
-
readonly on: "story_events";
|
|
50
|
-
readonly has: "one";
|
|
51
|
-
readonly label: "context";
|
|
52
|
-
};
|
|
53
|
-
readonly reverse: {
|
|
54
|
-
readonly on: "story_contexts";
|
|
55
|
-
readonly has: "many";
|
|
56
|
-
readonly label: "events";
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
readonly storyExecutionsContext: {
|
|
60
|
-
readonly forward: {
|
|
61
|
-
readonly on: "story_executions";
|
|
62
|
-
readonly has: "one";
|
|
63
|
-
readonly label: "context";
|
|
64
|
-
};
|
|
65
|
-
readonly reverse: {
|
|
66
|
-
readonly on: "story_contexts";
|
|
67
|
-
readonly has: "many";
|
|
68
|
-
readonly label: "executions";
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
readonly storyContextsCurrentExecution: {
|
|
72
|
-
readonly forward: {
|
|
73
|
-
readonly on: "story_contexts";
|
|
74
|
-
readonly has: "one";
|
|
75
|
-
readonly label: "currentExecution";
|
|
76
|
-
};
|
|
77
|
-
readonly reverse: {
|
|
78
|
-
readonly on: "story_executions";
|
|
79
|
-
readonly has: "one";
|
|
80
|
-
readonly label: "currentOf";
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
readonly storyExecutionsTrigger: {
|
|
84
|
-
readonly forward: {
|
|
85
|
-
readonly on: "story_executions";
|
|
86
|
-
readonly has: "one";
|
|
87
|
-
readonly label: "trigger";
|
|
88
|
-
};
|
|
89
|
-
readonly reverse: {
|
|
90
|
-
readonly on: "story_events";
|
|
91
|
-
readonly has: "many";
|
|
92
|
-
readonly label: "executionsAsTrigger";
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
readonly storyExecutionsReaction: {
|
|
96
|
-
readonly forward: {
|
|
97
|
-
readonly on: "story_executions";
|
|
98
|
-
readonly has: "one";
|
|
99
|
-
readonly label: "reaction";
|
|
100
|
-
};
|
|
101
|
-
readonly reverse: {
|
|
102
|
-
readonly on: "story_events";
|
|
103
|
-
readonly has: "many";
|
|
104
|
-
readonly label: "executionsAsReaction";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
}, {}>;
|
|
1
|
+
export declare const storyDomain: import("@ekairos/domain").DomainInstance<{
|
|
2
|
+
readonly story_contexts: import("@instantdb/core").EntityDef<{
|
|
3
|
+
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
4
|
+
updatedAt: import("@instantdb/core").DataAttrDef<Date, false, false>;
|
|
5
|
+
type: import("@instantdb/core").DataAttrDef<string, false, false>;
|
|
6
|
+
key: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
7
|
+
status: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
8
|
+
content: import("@instantdb/core").DataAttrDef<any, false, false>;
|
|
9
|
+
}, {}, void>;
|
|
10
|
+
readonly story_events: import("@instantdb/core").EntityDef<{
|
|
11
|
+
channel: import("@instantdb/core").DataAttrDef<string, true, true>;
|
|
12
|
+
createdAt: import("@instantdb/core").DataAttrDef<Date, true, true>;
|
|
13
|
+
type: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
14
|
+
content: import("@instantdb/core").DataAttrDef<any, false, false>;
|
|
15
|
+
status: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
16
|
+
}, {}, void>;
|
|
17
|
+
readonly story_executions: import("@instantdb/core").EntityDef<{
|
|
18
|
+
createdAt: import("@instantdb/core").DataAttrDef<Date, true, false>;
|
|
19
|
+
updatedAt: import("@instantdb/core").DataAttrDef<Date, false, false>;
|
|
20
|
+
status: import("@instantdb/core").DataAttrDef<string, false, true>;
|
|
21
|
+
}, {}, void>;
|
|
22
|
+
}, {
|
|
23
|
+
readonly storyContextsOrganization: {
|
|
24
|
+
readonly forward: {
|
|
25
|
+
readonly on: "story_contexts";
|
|
26
|
+
readonly has: "one";
|
|
27
|
+
readonly label: "organization";
|
|
28
|
+
};
|
|
29
|
+
readonly reverse: {
|
|
30
|
+
readonly on: "organizations";
|
|
31
|
+
readonly has: "many";
|
|
32
|
+
readonly label: "story_contexts";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly storyEventsOrganization: {
|
|
36
|
+
readonly forward: {
|
|
37
|
+
readonly on: "story_events";
|
|
38
|
+
readonly has: "one";
|
|
39
|
+
readonly label: "organization";
|
|
40
|
+
};
|
|
41
|
+
readonly reverse: {
|
|
42
|
+
readonly on: "organizations";
|
|
43
|
+
readonly has: "many";
|
|
44
|
+
readonly label: "story_events";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readonly storyEventsContext: {
|
|
48
|
+
readonly forward: {
|
|
49
|
+
readonly on: "story_events";
|
|
50
|
+
readonly has: "one";
|
|
51
|
+
readonly label: "context";
|
|
52
|
+
};
|
|
53
|
+
readonly reverse: {
|
|
54
|
+
readonly on: "story_contexts";
|
|
55
|
+
readonly has: "many";
|
|
56
|
+
readonly label: "events";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
readonly storyExecutionsContext: {
|
|
60
|
+
readonly forward: {
|
|
61
|
+
readonly on: "story_executions";
|
|
62
|
+
readonly has: "one";
|
|
63
|
+
readonly label: "context";
|
|
64
|
+
};
|
|
65
|
+
readonly reverse: {
|
|
66
|
+
readonly on: "story_contexts";
|
|
67
|
+
readonly has: "many";
|
|
68
|
+
readonly label: "executions";
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
readonly storyContextsCurrentExecution: {
|
|
72
|
+
readonly forward: {
|
|
73
|
+
readonly on: "story_contexts";
|
|
74
|
+
readonly has: "one";
|
|
75
|
+
readonly label: "currentExecution";
|
|
76
|
+
};
|
|
77
|
+
readonly reverse: {
|
|
78
|
+
readonly on: "story_executions";
|
|
79
|
+
readonly has: "one";
|
|
80
|
+
readonly label: "currentOf";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
readonly storyExecutionsTrigger: {
|
|
84
|
+
readonly forward: {
|
|
85
|
+
readonly on: "story_executions";
|
|
86
|
+
readonly has: "one";
|
|
87
|
+
readonly label: "trigger";
|
|
88
|
+
};
|
|
89
|
+
readonly reverse: {
|
|
90
|
+
readonly on: "story_events";
|
|
91
|
+
readonly has: "many";
|
|
92
|
+
readonly label: "executionsAsTrigger";
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
readonly storyExecutionsReaction: {
|
|
96
|
+
readonly forward: {
|
|
97
|
+
readonly on: "story_executions";
|
|
98
|
+
readonly has: "one";
|
|
99
|
+
readonly label: "reaction";
|
|
100
|
+
};
|
|
101
|
+
readonly reverse: {
|
|
102
|
+
readonly on: "story_events";
|
|
103
|
+
readonly has: "many";
|
|
104
|
+
readonly label: "executionsAsReaction";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}, {}>;
|
|
108
108
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.storyDomain = void 0;
|
|
4
|
-
const core_1 = require("@instantdb/core");
|
|
5
|
-
const domain_1 = require("@ekairos/domain");
|
|
6
|
-
const entities = {
|
|
7
|
-
story_contexts: core_1.i.entity({
|
|
8
|
-
createdAt: core_1.i.date(),
|
|
9
|
-
updatedAt: core_1.i.date().optional(),
|
|
10
|
-
type: core_1.i.string().optional(),
|
|
11
|
-
key: core_1.i.string().optional().indexed().unique(),
|
|
12
|
-
status: core_1.i.string().optional().indexed(), // open | executing
|
|
13
|
-
content: core_1.i.any().optional(),
|
|
14
|
-
}),
|
|
15
|
-
story_events: core_1.i.entity({
|
|
16
|
-
channel: core_1.i.string().indexed(),
|
|
17
|
-
createdAt: core_1.i.date().indexed(),
|
|
18
|
-
type: core_1.i.string().optional().indexed(),
|
|
19
|
-
content: core_1.i.any().optional(),
|
|
20
|
-
status: core_1.i.string().optional().indexed(),
|
|
21
|
-
}),
|
|
22
|
-
story_executions: core_1.i.entity({
|
|
23
|
-
createdAt: core_1.i.date(),
|
|
24
|
-
updatedAt: core_1.i.date().optional(),
|
|
25
|
-
status: core_1.i.string().optional().indexed(), // executing | completed | failed
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
28
|
-
const links = {
|
|
29
|
-
storyContextsOrganization: {
|
|
30
|
-
forward: { on: "story_contexts", has: "one", label: "organization" },
|
|
31
|
-
reverse: { on: "organizations", has: "many", label: "story_contexts" },
|
|
32
|
-
},
|
|
33
|
-
storyEventsOrganization: {
|
|
34
|
-
forward: { on: "story_events", has: "one", label: "organization" },
|
|
35
|
-
reverse: { on: "organizations", has: "many", label: "story_events" },
|
|
36
|
-
},
|
|
37
|
-
storyEventsContext: {
|
|
38
|
-
forward: { on: "story_events", has: "one", label: "context" },
|
|
39
|
-
reverse: { on: "story_contexts", has: "many", label: "events" },
|
|
40
|
-
},
|
|
41
|
-
// Executions belong to a context
|
|
42
|
-
storyExecutionsContext: {
|
|
43
|
-
forward: { on: "story_executions", has: "one", label: "context" },
|
|
44
|
-
reverse: { on: "story_contexts", has: "many", label: "executions" },
|
|
45
|
-
},
|
|
46
|
-
// Current execution pointer on a context
|
|
47
|
-
storyContextsCurrentExecution: {
|
|
48
|
-
forward: { on: "story_contexts", has: "one", label: "currentExecution" },
|
|
49
|
-
reverse: { on: "story_executions", has: "one", label: "currentOf" },
|
|
50
|
-
},
|
|
51
|
-
// Link execution to its trigger event
|
|
52
|
-
storyExecutionsTrigger: {
|
|
53
|
-
forward: { on: "story_executions", has: "one", label: "trigger" },
|
|
54
|
-
reverse: { on: "story_events", has: "many", label: "executionsAsTrigger" },
|
|
55
|
-
},
|
|
56
|
-
// Link execution to its reaction event
|
|
57
|
-
storyExecutionsReaction: {
|
|
58
|
-
forward: { on: "story_executions", has: "one", label: "reaction" },
|
|
59
|
-
reverse: { on: "story_events", has: "many", label: "executionsAsReaction" },
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
const rooms = {};
|
|
63
|
-
exports.storyDomain = (0, domain_1.domain)({ entities, links, rooms });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.storyDomain = void 0;
|
|
4
|
+
const core_1 = require("@instantdb/core");
|
|
5
|
+
const domain_1 = require("@ekairos/domain");
|
|
6
|
+
const entities = {
|
|
7
|
+
story_contexts: core_1.i.entity({
|
|
8
|
+
createdAt: core_1.i.date(),
|
|
9
|
+
updatedAt: core_1.i.date().optional(),
|
|
10
|
+
type: core_1.i.string().optional(),
|
|
11
|
+
key: core_1.i.string().optional().indexed().unique(),
|
|
12
|
+
status: core_1.i.string().optional().indexed(), // open | executing
|
|
13
|
+
content: core_1.i.any().optional(),
|
|
14
|
+
}),
|
|
15
|
+
story_events: core_1.i.entity({
|
|
16
|
+
channel: core_1.i.string().indexed(),
|
|
17
|
+
createdAt: core_1.i.date().indexed(),
|
|
18
|
+
type: core_1.i.string().optional().indexed(),
|
|
19
|
+
content: core_1.i.any().optional(),
|
|
20
|
+
status: core_1.i.string().optional().indexed(),
|
|
21
|
+
}),
|
|
22
|
+
story_executions: core_1.i.entity({
|
|
23
|
+
createdAt: core_1.i.date(),
|
|
24
|
+
updatedAt: core_1.i.date().optional(),
|
|
25
|
+
status: core_1.i.string().optional().indexed(), // executing | completed | failed
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
const links = {
|
|
29
|
+
storyContextsOrganization: {
|
|
30
|
+
forward: { on: "story_contexts", has: "one", label: "organization" },
|
|
31
|
+
reverse: { on: "organizations", has: "many", label: "story_contexts" },
|
|
32
|
+
},
|
|
33
|
+
storyEventsOrganization: {
|
|
34
|
+
forward: { on: "story_events", has: "one", label: "organization" },
|
|
35
|
+
reverse: { on: "organizations", has: "many", label: "story_events" },
|
|
36
|
+
},
|
|
37
|
+
storyEventsContext: {
|
|
38
|
+
forward: { on: "story_events", has: "one", label: "context" },
|
|
39
|
+
reverse: { on: "story_contexts", has: "many", label: "events" },
|
|
40
|
+
},
|
|
41
|
+
// Executions belong to a context
|
|
42
|
+
storyExecutionsContext: {
|
|
43
|
+
forward: { on: "story_executions", has: "one", label: "context" },
|
|
44
|
+
reverse: { on: "story_contexts", has: "many", label: "executions" },
|
|
45
|
+
},
|
|
46
|
+
// Current execution pointer on a context
|
|
47
|
+
storyContextsCurrentExecution: {
|
|
48
|
+
forward: { on: "story_contexts", has: "one", label: "currentExecution" },
|
|
49
|
+
reverse: { on: "story_executions", has: "one", label: "currentOf" },
|
|
50
|
+
},
|
|
51
|
+
// Link execution to its trigger event
|
|
52
|
+
storyExecutionsTrigger: {
|
|
53
|
+
forward: { on: "story_executions", has: "one", label: "trigger" },
|
|
54
|
+
reverse: { on: "story_events", has: "many", label: "executionsAsTrigger" },
|
|
55
|
+
},
|
|
56
|
+
// Link execution to its reaction event
|
|
57
|
+
storyExecutionsReaction: {
|
|
58
|
+
forward: { on: "story_executions", has: "one", label: "reaction" },
|
|
59
|
+
reverse: { on: "story_events", has: "many", label: "executionsAsReaction" },
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
const rooms = {};
|
|
63
|
+
exports.storyDomain = (0, domain_1.domain)({ entities, links, rooms });
|
|
64
64
|
//# sourceMappingURL=schema.js.map
|
package/dist/service.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { InstaQLEntity } from "@instantdb/admin";
|
|
2
|
-
import { storyDomain } from "./schema";
|
|
3
|
-
export type StoredContext<Context> = Omit<InstaQLEntity<typeof storyDomain, 'story_contexts'>, 'content'> & {
|
|
4
|
-
content: Context;
|
|
5
|
-
};
|
|
6
|
-
export type ContextIdentifier = {
|
|
7
|
-
id: string;
|
|
8
|
-
key?: never;
|
|
9
|
-
} | {
|
|
10
|
-
key: string;
|
|
11
|
-
id?: never;
|
|
12
|
-
};
|
|
13
|
-
export type ContextEvent = InstaQLEntity<typeof storyDomain, 'story_events'> & {
|
|
14
|
-
content: any;
|
|
15
|
-
};
|
|
16
|
-
export type StreamChunk = {
|
|
17
|
-
type: string;
|
|
18
|
-
messageId?: string;
|
|
19
|
-
content?: string;
|
|
20
|
-
[key: string]: unknown;
|
|
21
|
-
};
|
|
22
|
-
export declare class AgentService {
|
|
23
|
-
private db;
|
|
24
|
-
constructor();
|
|
25
|
-
getOrCreateContext<C>(contextIdentifier: ContextIdentifier | null): Promise<StoredContext<C>>;
|
|
26
|
-
createContext<C>(contextKey?: {
|
|
27
|
-
key: string;
|
|
28
|
-
} | null, contextId?: string): Promise<StoredContext<C>>;
|
|
29
|
-
getContext<C>(contextIdentifier: ContextIdentifier): Promise<StoredContext<C>>;
|
|
30
|
-
updateContextContent<C>(contextIdentifier: ContextIdentifier, content: C): Promise<StoredContext<C>>;
|
|
31
|
-
saveEvent(contextIdentifier: ContextIdentifier, event: ContextEvent): Promise<ContextEvent>;
|
|
32
|
-
createExecution(contextIdentifier: ContextIdentifier, triggerEventId: string, reactionEventId: string): Promise<{
|
|
33
|
-
id: string;
|
|
34
|
-
}>;
|
|
35
|
-
completeExecution(contextIdentifier: ContextIdentifier, executionId: string, status: "completed" | "failed"): Promise<void>;
|
|
36
|
-
updateEvent(eventId: string, event: ContextEvent): Promise<ContextEvent>;
|
|
37
|
-
getEvent(eventId: string): Promise<ContextEvent>;
|
|
38
|
-
getEvents(contextIdentifier: ContextIdentifier): Promise<ContextEvent[]>;
|
|
39
|
-
readEventStream(stream: ReadableStream): Promise<{
|
|
40
|
-
eventId: string | undefined;
|
|
41
|
-
chunks: StreamChunk[];
|
|
42
|
-
persistedEvent: any;
|
|
43
|
-
}>;
|
|
44
|
-
}
|
|
1
|
+
import { InstaQLEntity } from "@instantdb/admin";
|
|
2
|
+
import { storyDomain } from "./schema";
|
|
3
|
+
export type StoredContext<Context> = Omit<InstaQLEntity<typeof storyDomain, 'story_contexts'>, 'content'> & {
|
|
4
|
+
content: Context;
|
|
5
|
+
};
|
|
6
|
+
export type ContextIdentifier = {
|
|
7
|
+
id: string;
|
|
8
|
+
key?: never;
|
|
9
|
+
} | {
|
|
10
|
+
key: string;
|
|
11
|
+
id?: never;
|
|
12
|
+
};
|
|
13
|
+
export type ContextEvent = InstaQLEntity<typeof storyDomain, 'story_events'> & {
|
|
14
|
+
content: any;
|
|
15
|
+
};
|
|
16
|
+
export type StreamChunk = {
|
|
17
|
+
type: string;
|
|
18
|
+
messageId?: string;
|
|
19
|
+
content?: string;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
export declare class AgentService {
|
|
23
|
+
private db;
|
|
24
|
+
constructor();
|
|
25
|
+
getOrCreateContext<C>(contextIdentifier: ContextIdentifier | null): Promise<StoredContext<C>>;
|
|
26
|
+
createContext<C>(contextKey?: {
|
|
27
|
+
key: string;
|
|
28
|
+
} | null, contextId?: string): Promise<StoredContext<C>>;
|
|
29
|
+
getContext<C>(contextIdentifier: ContextIdentifier): Promise<StoredContext<C>>;
|
|
30
|
+
updateContextContent<C>(contextIdentifier: ContextIdentifier, content: C): Promise<StoredContext<C>>;
|
|
31
|
+
saveEvent(contextIdentifier: ContextIdentifier, event: ContextEvent): Promise<ContextEvent>;
|
|
32
|
+
createExecution(contextIdentifier: ContextIdentifier, triggerEventId: string, reactionEventId: string): Promise<{
|
|
33
|
+
id: string;
|
|
34
|
+
}>;
|
|
35
|
+
completeExecution(contextIdentifier: ContextIdentifier, executionId: string, status: "completed" | "failed"): Promise<void>;
|
|
36
|
+
updateEvent(eventId: string, event: ContextEvent): Promise<ContextEvent>;
|
|
37
|
+
getEvent(eventId: string): Promise<ContextEvent>;
|
|
38
|
+
getEvents(contextIdentifier: ContextIdentifier): Promise<ContextEvent[]>;
|
|
39
|
+
readEventStream(stream: ReadableStream): Promise<{
|
|
40
|
+
eventId: string | undefined;
|
|
41
|
+
chunks: StreamChunk[];
|
|
42
|
+
persistedEvent: any;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
45
|
//# sourceMappingURL=service.d.ts.map
|