@ekairos/story 1.6.2 → 1.6.3

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.
Files changed (42) hide show
  1. package/dist/agent.d.ts +72 -72
  2. package/dist/agent.js +478 -478
  3. package/dist/document-parser.d.ts +15 -15
  4. package/dist/document-parser.js +156 -156
  5. package/dist/engine.d.ts +21 -21
  6. package/dist/engine.js +35 -35
  7. package/dist/events.d.ts +27 -27
  8. package/dist/events.js +203 -203
  9. package/dist/index.d.ts +11 -13
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +50 -52
  12. package/dist/index.js.map +1 -1
  13. package/dist/schema.d.ts +107 -107
  14. package/dist/schema.js +63 -63
  15. package/dist/service.d.ts +44 -44
  16. package/dist/service.js +202 -202
  17. package/dist/steps/ai.d.ts +42 -42
  18. package/dist/steps/ai.js +135 -135
  19. package/dist/steps/base.d.ts +13 -13
  20. package/dist/steps/base.js +36 -36
  21. package/dist/steps/index.d.ts +3 -4
  22. package/dist/steps/index.d.ts.map +1 -1
  23. package/dist/steps/index.js +19 -20
  24. package/dist/steps/index.js.map +1 -1
  25. package/dist/steps/registry.d.ts +4 -4
  26. package/dist/steps/registry.js +28 -28
  27. package/dist/steps/sampleStep.d.ts.map +1 -1
  28. package/dist/steps/sampleStep.js +1 -1
  29. package/dist/steps/sampleStep.js.map +1 -1
  30. package/dist/steps-context.d.ts +11 -11
  31. package/dist/steps-context.js +19 -19
  32. package/dist/story.d.ts +49 -49
  33. package/dist/story.js +54 -54
  34. package/dist/storyEngine.d.ts +54 -54
  35. package/dist/storyEngine.js +50 -50
  36. package/dist/storyRunner.d.ts +7 -7
  37. package/dist/storyRunner.js +55 -55
  38. package/dist/workflows/sampleWorkflow.d.ts +5 -1
  39. package/dist/workflows/sampleWorkflow.d.ts.map +1 -1
  40. package/dist/workflows/sampleWorkflow.js +6 -2
  41. package/dist/workflows/sampleWorkflow.js.map +1 -1
  42. package/package.json +2 -2
package/dist/agent.d.ts CHANGED
@@ -1,73 +1,73 @@
1
- import { Tool, UIMessageStreamWriter } from "ai";
2
- import { UIMessage } from 'ai';
3
- import { AgentService, ContextEvent, ContextIdentifier, StoredContext } from "./service";
4
- export type AgentMessage = UIMessage<never, // metadata type
5
- {
6
- weather: {
7
- city: string;
8
- weather?: string;
9
- status: 'loading' | 'success';
10
- };
11
- notification: {
12
- message: string;
13
- level: 'info' | 'warning' | 'error';
14
- };
15
- }>;
16
- export interface AgentOptions {
17
- onEventCreated?: (event: any) => void | Promise<void>;
18
- evaluateToolCalls?: (toolCalls: any[]) => Promise<{
19
- success: boolean;
20
- message?: string;
21
- }>;
22
- onToolCallExecuted?: (executionEvent: any) => void | Promise<void>;
23
- onEnd?: (lastEvent: ContextEvent) => void | {
24
- end?: boolean;
25
- } | Promise<void | {
26
- end?: boolean;
27
- }>;
28
- }
29
- export interface ProgressStreamOptions {
30
- reasoningEffort?: "low" | "medium" | "high";
31
- webSearch?: boolean;
32
- }
33
- export type DataStreamWriter = UIMessageStreamWriter<AgentMessage>;
34
- export declare abstract class Story<Context> {
35
- private opts;
36
- protected db: import("@instantdb/admin").InstantAdminDatabase<import("@instantdb/admin").InstantUnknownSchemaDef, import("@instantdb/admin").InstantConfig<import("@instantdb/admin").InstantUnknownSchemaDef, false>>;
37
- protected agentService: AgentService;
38
- constructor(opts?: AgentOptions);
39
- protected abstract buildSystemPrompt(context: StoredContext<Context>, ...args: any[]): Promise<string> | string;
40
- protected abstract buildTools(context: StoredContext<Context>, dataStream: DataStreamWriter): Promise<Record<string, Tool>>;
41
- protected abstract initialize(context: StoredContext<Context>): Promise<Context>;
42
- protected getModel(context: StoredContext<Context>): string;
43
- protected includeBaseTools(): {
44
- createMessage: boolean;
45
- requestDirection: boolean;
46
- end: boolean;
47
- };
48
- protected getFinalizationToolNames(): Promise<string[]>;
49
- private static readonly FINAL_TOOL_NAMES;
50
- protected getBaseTools(dataStream: DataStreamWriter, threadId: string): Record<string, Tool>;
51
- protected executeCreateMessage(eventId: string, args: {
52
- message: string;
53
- type: "info" | "confirmation" | "warning" | "error" | "success";
54
- includeContext?: boolean;
55
- }, threadId: string, dataStream?: DataStreamWriter): Promise<any>;
56
- protected executeRequestDirection(eventId: string, args: {
57
- issue: string;
58
- context: string;
59
- suggestedActions?: string[];
60
- urgency: "low" | "medium" | "high";
61
- }, threadId: string, _dataStream?: DataStreamWriter): Promise<any>;
62
- progressStream(incomingEvent: ContextEvent, contextIdentifier: ContextIdentifier | null, options?: ProgressStreamOptions): Promise<{
63
- contextId: string;
64
- triggerEventId: string;
65
- reactionEventId: string;
66
- stream: import("stream/web").ReadableStream<any>;
67
- executionId: string;
68
- }>;
69
- private saveMessagesToThread;
70
- private callOnEnd;
71
- }
72
- export { Story as Agent };
1
+ import { Tool, UIMessageStreamWriter } from "ai";
2
+ import { UIMessage } from 'ai';
3
+ import { AgentService, ContextEvent, ContextIdentifier, StoredContext } from "./service";
4
+ export type AgentMessage = UIMessage<never, // metadata type
5
+ {
6
+ weather: {
7
+ city: string;
8
+ weather?: string;
9
+ status: 'loading' | 'success';
10
+ };
11
+ notification: {
12
+ message: string;
13
+ level: 'info' | 'warning' | 'error';
14
+ };
15
+ }>;
16
+ export interface AgentOptions {
17
+ onEventCreated?: (event: any) => void | Promise<void>;
18
+ evaluateToolCalls?: (toolCalls: any[]) => Promise<{
19
+ success: boolean;
20
+ message?: string;
21
+ }>;
22
+ onToolCallExecuted?: (executionEvent: any) => void | Promise<void>;
23
+ onEnd?: (lastEvent: ContextEvent) => void | {
24
+ end?: boolean;
25
+ } | Promise<void | {
26
+ end?: boolean;
27
+ }>;
28
+ }
29
+ export interface ProgressStreamOptions {
30
+ reasoningEffort?: "low" | "medium" | "high";
31
+ webSearch?: boolean;
32
+ }
33
+ export type DataStreamWriter = UIMessageStreamWriter<AgentMessage>;
34
+ export declare abstract class Story<Context> {
35
+ private opts;
36
+ protected db: import("@instantdb/admin").InstantAdminDatabase<import("@instantdb/admin").InstantUnknownSchemaDef, import("@instantdb/admin").InstantConfig<import("@instantdb/admin").InstantUnknownSchemaDef, false>>;
37
+ protected agentService: AgentService;
38
+ constructor(opts?: AgentOptions);
39
+ protected abstract buildSystemPrompt(context: StoredContext<Context>, ...args: any[]): Promise<string> | string;
40
+ protected abstract buildTools(context: StoredContext<Context>, dataStream: DataStreamWriter): Promise<Record<string, Tool>>;
41
+ protected abstract initialize(context: StoredContext<Context>): Promise<Context>;
42
+ protected getModel(context: StoredContext<Context>): string;
43
+ protected includeBaseTools(): {
44
+ createMessage: boolean;
45
+ requestDirection: boolean;
46
+ end: boolean;
47
+ };
48
+ protected getFinalizationToolNames(): Promise<string[]>;
49
+ private static readonly FINAL_TOOL_NAMES;
50
+ protected getBaseTools(dataStream: DataStreamWriter, threadId: string): Record<string, Tool>;
51
+ protected executeCreateMessage(eventId: string, args: {
52
+ message: string;
53
+ type: "info" | "confirmation" | "warning" | "error" | "success";
54
+ includeContext?: boolean;
55
+ }, threadId: string, dataStream?: DataStreamWriter): Promise<any>;
56
+ protected executeRequestDirection(eventId: string, args: {
57
+ issue: string;
58
+ context: string;
59
+ suggestedActions?: string[];
60
+ urgency: "low" | "medium" | "high";
61
+ }, threadId: string, _dataStream?: DataStreamWriter): Promise<any>;
62
+ progressStream(incomingEvent: ContextEvent, contextIdentifier: ContextIdentifier | null, options?: ProgressStreamOptions): Promise<{
63
+ contextId: string;
64
+ triggerEventId: string;
65
+ reactionEventId: string;
66
+ stream: import("stream/web").ReadableStream<any>;
67
+ executionId: string;
68
+ }>;
69
+ private saveMessagesToThread;
70
+ private callOnEnd;
71
+ }
72
+ export { Story as Agent };
73
73
  //# sourceMappingURL=agent.d.ts.map