@elizaos/core 2.0.0-alpha.7 → 2.0.0-alpha.71

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 (132) hide show
  1. package/README.md +213 -16
  2. package/dist/testing/index.js +22 -0
  3. package/dist/testing/index.js.map +9 -0
  4. package/package.json +46 -27
  5. package/dist/actions.d.ts +0 -22
  6. package/dist/actions.d.ts.map +0 -1
  7. package/dist/browser/index.browser.js +0 -771
  8. package/dist/browser/index.browser.js.map +0 -427
  9. package/dist/browser/index.d.ts +0 -2
  10. package/dist/character.d.ts +0 -39
  11. package/dist/character.d.ts.map +0 -1
  12. package/dist/constants/index.d.ts +0 -7
  13. package/dist/constants/secrets.d.ts +0 -67
  14. package/dist/database.d.ts +0 -494
  15. package/dist/database.d.ts.map +0 -1
  16. package/dist/elizaos.d.ts +0 -194
  17. package/dist/elizaos.d.ts.map +0 -1
  18. package/dist/entities.d.ts +0 -40
  19. package/dist/entities.d.ts.map +0 -1
  20. package/dist/index.browser.d.ts +0 -39
  21. package/dist/index.browser.d.ts.map +0 -1
  22. package/dist/index.d.ts +0 -40
  23. package/dist/index.d.ts.map +0 -1
  24. package/dist/index.js +0 -2
  25. package/dist/index.node.d.ts +0 -37
  26. package/dist/index.node.d.ts.map +0 -1
  27. package/dist/logger.d.ts +0 -72
  28. package/dist/logger.d.ts.map +0 -1
  29. package/dist/memory.d.ts +0 -63
  30. package/dist/memory.d.ts.map +0 -1
  31. package/dist/node/index.d.ts +0 -2
  32. package/dist/node/index.node.js +0 -53403
  33. package/dist/node/index.node.js.map +0 -511
  34. package/dist/onboarding-state.d.ts +0 -209
  35. package/dist/plugin.d.ts +0 -55
  36. package/dist/plugin.d.ts.map +0 -1
  37. package/dist/prompts.d.ts +0 -7
  38. package/dist/prompts.d.ts.map +0 -1
  39. package/dist/request-context.d.ts +0 -142
  40. package/dist/request-context.d.ts.map +0 -1
  41. package/dist/request-context.node.d.ts +0 -36
  42. package/dist/request-context.node.d.ts.map +0 -1
  43. package/dist/roles.d.ts +0 -23
  44. package/dist/roles.d.ts.map +0 -1
  45. package/dist/runtime.d.ts +0 -366
  46. package/dist/runtime.d.ts.map +0 -1
  47. package/dist/schemas/character.d.ts +0 -151
  48. package/dist/schemas/character.d.ts.map +0 -1
  49. package/dist/search.d.ts +0 -316
  50. package/dist/search.d.ts.map +0 -1
  51. package/dist/secrets.d.ts +0 -11
  52. package/dist/secrets.d.ts.map +0 -1
  53. package/dist/services/default-message-service.d.ts +0 -69
  54. package/dist/services/default-message-service.d.ts.map +0 -1
  55. package/dist/services/message-service.d.ts +0 -171
  56. package/dist/services/message-service.d.ts.map +0 -1
  57. package/dist/services.d.ts +0 -56
  58. package/dist/services.d.ts.map +0 -1
  59. package/dist/sessions/index.d.ts +0 -10
  60. package/dist/sessions/paths.d.ts +0 -56
  61. package/dist/sessions/provider.d.ts +0 -73
  62. package/dist/sessions/session-key.d.ts +0 -133
  63. package/dist/sessions/store.d.ts +0 -75
  64. package/dist/sessions/types.d.ts +0 -195
  65. package/dist/settings.d.ts +0 -90
  66. package/dist/settings.d.ts.map +0 -1
  67. package/dist/streaming-context.browser.d.ts +0 -26
  68. package/dist/streaming-context.browser.d.ts.map +0 -1
  69. package/dist/streaming-context.d.ts +0 -95
  70. package/dist/streaming-context.d.ts.map +0 -1
  71. package/dist/streaming-context.node.d.ts +0 -15
  72. package/dist/streaming-context.node.d.ts.map +0 -1
  73. package/dist/types/agent.d.ts +0 -97
  74. package/dist/types/agent.d.ts.map +0 -1
  75. package/dist/types/components.d.ts +0 -155
  76. package/dist/types/components.d.ts.map +0 -1
  77. package/dist/types/database.d.ts +0 -414
  78. package/dist/types/database.d.ts.map +0 -1
  79. package/dist/types/elizaos.d.ts +0 -159
  80. package/dist/types/elizaos.d.ts.map +0 -1
  81. package/dist/types/environment.d.ts +0 -116
  82. package/dist/types/environment.d.ts.map +0 -1
  83. package/dist/types/events.d.ts +0 -203
  84. package/dist/types/events.d.ts.map +0 -1
  85. package/dist/types/index.d.ts +0 -20
  86. package/dist/types/index.d.ts.map +0 -1
  87. package/dist/types/knowledge.d.ts +0 -30
  88. package/dist/types/knowledge.d.ts.map +0 -1
  89. package/dist/types/memory.d.ts +0 -102
  90. package/dist/types/memory.d.ts.map +0 -1
  91. package/dist/types/messaging.d.ts +0 -137
  92. package/dist/types/messaging.d.ts.map +0 -1
  93. package/dist/types/model.d.ts +0 -513
  94. package/dist/types/model.d.ts.map +0 -1
  95. package/dist/types/plugin.d.ts +0 -91
  96. package/dist/types/plugin.d.ts.map +0 -1
  97. package/dist/types/primitives.d.ts +0 -96
  98. package/dist/types/primitives.d.ts.map +0 -1
  99. package/dist/types/runtime.d.ts +0 -140
  100. package/dist/types/runtime.d.ts.map +0 -1
  101. package/dist/types/service.d.ts +0 -150
  102. package/dist/types/service.d.ts.map +0 -1
  103. package/dist/types/settings.d.ts +0 -29
  104. package/dist/types/settings.d.ts.map +0 -1
  105. package/dist/types/state.d.ts +0 -56
  106. package/dist/types/state.d.ts.map +0 -1
  107. package/dist/types/streaming.d.ts +0 -71
  108. package/dist/types/streaming.d.ts.map +0 -1
  109. package/dist/types/task.d.ts +0 -67
  110. package/dist/types/task.d.ts.map +0 -1
  111. package/dist/types/tee.d.ts +0 -96
  112. package/dist/types/tee.d.ts.map +0 -1
  113. package/dist/types/testing.d.ts +0 -28
  114. package/dist/types/testing.d.ts.map +0 -1
  115. package/dist/utils/buffer.d.ts +0 -104
  116. package/dist/utils/buffer.d.ts.map +0 -1
  117. package/dist/utils/crypto-compat.d.ts +0 -183
  118. package/dist/utils/crypto-compat.d.ts.map +0 -1
  119. package/dist/utils/environment.d.ts +0 -50
  120. package/dist/utils/environment.d.ts.map +0 -1
  121. package/dist/utils/node.d.ts +0 -5
  122. package/dist/utils/node.d.ts.map +0 -1
  123. package/dist/utils/paths.d.ts +0 -92
  124. package/dist/utils/paths.d.ts.map +0 -1
  125. package/dist/utils/server-health.d.ts +0 -22
  126. package/dist/utils/server-health.d.ts.map +0 -1
  127. package/dist/utils/streaming.d.ts +0 -179
  128. package/dist/utils/streaming.d.ts.map +0 -1
  129. package/dist/utils/type-guards.d.ts +0 -23
  130. package/dist/utils/type-guards.d.ts.map +0 -1
  131. package/dist/utils.d.ts +0 -182
  132. package/dist/utils.d.ts.map +0 -1
@@ -1,95 +0,0 @@
1
- /**
2
- * Streaming context management for automatic streaming in useModel calls.
3
- *
4
- * Follows the OpenTelemetry ContextManager pattern:
5
- * - Interface for context management
6
- * - Platform-specific implementations (Node.js AsyncLocalStorage, Browser Stack)
7
- * - Global singleton configured at startup
8
- *
9
- */
10
- import type { UUID } from './types';
11
- /**
12
- * Streaming context containing callbacks for streaming lifecycle.
13
- */
14
- export interface StreamingContext {
15
- /** Called for each chunk of streamed content */
16
- onStreamChunk: (chunk: string, messageId?: UUID) => Promise<void>;
17
- /** Called when a useModel streaming call completes (allows reset between calls) */
18
- onStreamEnd?: () => void;
19
- messageId?: UUID;
20
- /** Optional abort signal to cancel streaming */
21
- abortSignal?: AbortSignal;
22
- /**
23
- * Reset streaming state for retry attempts.
24
- * Clears extractor buffer and any accumulated state.
25
- * Call before retrying a failed streaming operation.
26
- */
27
- reset?: () => void;
28
- /**
29
- * Get text that has been streamed to the user so far.
30
- * Useful for retry continuation prompts.
31
- */
32
- getStreamedText?: () => string;
33
- /**
34
- * Check if text extraction is complete (closing tag found).
35
- * Used for intelligent retry decisions:
36
- * - true: Use streamedText as final response, skip retry
37
- * - false: Text was cut mid-stream, retry with continuation prompt
38
- */
39
- isComplete?: () => boolean;
40
- }
41
- /**
42
- * Interface for streaming context managers.
43
- * Different implementations exist for Node.js (AsyncLocalStorage) and Browser (Stack).
44
- */
45
- export interface IStreamingContextManager {
46
- /**
47
- * Run a function with a streaming context.
48
- * The context will be available to all nested async calls via `active()`.
49
- */
50
- run<T>(context: StreamingContext | undefined, fn: () => T): T;
51
- /**
52
- * Get the currently active streaming context.
53
- * Returns undefined if no context is active.
54
- */
55
- active(): StreamingContext | undefined;
56
- }
57
- /**
58
- * Set the global streaming context manager.
59
- * Called during initialization by platform-specific entry points.
60
- *
61
- * @param manager - The context manager to use globally
62
- */
63
- export declare function setStreamingContextManager(manager: IStreamingContextManager): void;
64
- /**
65
- * Get the global streaming context manager.
66
- * Useful for testing or advanced use cases.
67
- */
68
- export declare function getStreamingContextManager(): IStreamingContextManager;
69
- /**
70
- * Run a function with a streaming context.
71
- * All useModel calls within this function will automatically use streaming.
72
- *
73
- * @example
74
- * ```typescript
75
- * await runWithStreamingContext(
76
- * { onStreamChunk: async (chunk) => sendSSE(chunk), messageId },
77
- * async () => {
78
- * // All useModel calls here will stream automatically
79
- * await runtime.processMessage(message);
80
- * }
81
- * );
82
- * ```
83
- *
84
- * @param context - The streaming context with onStreamChunk callback
85
- * @param fn - The function to run with streaming context
86
- * @returns The result of the function
87
- */
88
- export declare function runWithStreamingContext<T>(context: StreamingContext | undefined, fn: () => T): T;
89
- /**
90
- * Get the currently active streaming context.
91
- * Called by useModel to check if automatic streaming should be enabled.
92
- *
93
- * @returns The current streaming context or undefined
94
- */
95
- export declare function getStreamingContext(): StreamingContext | undefined;
@@ -1 +0,0 @@
1
- {"version":3,"file":"streaming-context.d.ts","sourceRoot":"","sources":["../src/streaming-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,gDAAgD;IAChD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAE9D;;;OAGG;IACH,MAAM,IAAI,gBAAgB,GAAG,SAAS,CAAC;CACxC;AAmBD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAElF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,wBAAwB,CAErE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAEhG;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,SAAS,CAElE"}
@@ -1,15 +0,0 @@
1
- import type { StreamingContext, IStreamingContextManager } from './streaming-context';
2
- /**
3
- * AsyncLocalStorage-based context manager for Node.js.
4
- * Provides proper async context isolation across parallel async operations.
5
- */
6
- export declare class AsyncLocalStorageContextManager implements IStreamingContextManager {
7
- private storage;
8
- run<T>(context: StreamingContext | undefined, fn: () => T): T;
9
- active(): StreamingContext | undefined;
10
- }
11
- /**
12
- * Create and return a configured AsyncLocalStorage context manager.
13
- * Called by index.node.ts during initialization.
14
- */
15
- export declare function createNodeStreamingContextManager(): IStreamingContextManager;
@@ -1 +0,0 @@
1
- {"version":3,"file":"streaming-context.node.d.ts","sourceRoot":"","sources":["../src/streaming-context.node.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEtF;;;GAGG;AACH,qBAAa,+BAAgC,YAAW,wBAAwB;IAC9E,OAAO,CAAC,OAAO,CAAyD;IAExE,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAI7D,MAAM,IAAI,gBAAgB,GAAG,SAAS;CAGvC;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,IAAI,wBAAwB,CAE5E"}
@@ -1,97 +0,0 @@
1
- import type { DirectoryItem } from './knowledge';
2
- import type { Content, UUID } from './primitives';
3
- import type { State } from './state';
4
- /**
5
- * Example message for demonstration
6
- */
7
- export interface MessageExample {
8
- /** Associated user */
9
- name: string;
10
- /** Message content */
11
- content: Content;
12
- }
13
- export type TemplateType = string | ((options: {
14
- state: State | {
15
- [key: string]: string;
16
- };
17
- }) => string);
18
- /**
19
- * Configuration for an agent's character, defining its personality, knowledge, and capabilities.
20
- * This is a central piece of an agent's definition, used by the `AgentRuntime` to initialize and operate the agent.
21
- * It includes:
22
- * - `id`: Optional unique identifier for the character.
23
- * - `name`, `username`: Identifying names for the character.
24
- * - `system`: A system prompt that guides the agent's overall behavior.
25
- * - `templates`: A map of prompt templates for various situations (e.g., message generation, summarization).
26
- * - `bio`: A textual biography or description of the character.
27
- * - `messageExamples`, `postExamples`: Examples of how the character communicates.
28
- * - `topics`, `adjectives`: Keywords describing the character's knowledge areas and traits.
29
- * - `knowledge`: Paths to knowledge files or directories to be loaded into the agent's memory.
30
- * - `plugins`: A list of plugin names to be loaded for this character.
31
- * - `settings`, `secrets`: Configuration key-value pairs, with secrets being handled more securely.
32
- * - `style`: Guidelines for the character's writing style in different contexts (chat, post).
33
- */
34
- export interface Character {
35
- /** Optional unique identifier */
36
- id?: UUID;
37
- /** Character name */
38
- name: string;
39
- /** Optional username */
40
- username?: string;
41
- /** Optional system prompt */
42
- system?: string;
43
- /** Optional prompt templates */
44
- templates?: {
45
- [key: string]: TemplateType;
46
- };
47
- /** Character biography */
48
- bio: string | string[];
49
- /** Example messages */
50
- messageExamples?: MessageExample[][];
51
- /** Example posts */
52
- postExamples?: string[];
53
- /** Known topics */
54
- topics?: string[];
55
- /** Character traits */
56
- adjectives?: string[];
57
- /** Optional knowledge base */
58
- knowledge?: (string | {
59
- path: string;
60
- shared?: boolean;
61
- } | DirectoryItem)[];
62
- /** Available plugins */
63
- plugins?: string[];
64
- /** Optional configuration */
65
- settings?: {
66
- [key: string]: string | boolean | number | Record<string, unknown>;
67
- };
68
- /** Optional secrets */
69
- secrets?: {
70
- [key: string]: string | boolean | number;
71
- };
72
- /** Writing style guides */
73
- style?: {
74
- all?: string[];
75
- chat?: string[];
76
- post?: string[];
77
- };
78
- }
79
- export declare enum AgentStatus {
80
- ACTIVE = "active",
81
- INACTIVE = "inactive"
82
- }
83
- /**
84
- * Represents an operational agent, extending the `Character` definition with runtime status and timestamps.
85
- * While `Character` defines the blueprint, `Agent` represents an instantiated and potentially running version.
86
- * It includes:
87
- * - `enabled`: A boolean indicating if the agent is currently active or disabled.
88
- * - `status`: The current operational status, typically `AgentStatus.ACTIVE` or `AgentStatus.INACTIVE`.
89
- * - `createdAt`, `updatedAt`: Timestamps for when the agent record was created and last updated in the database.
90
- * This interface is primarily used by the `IDatabaseAdapter` for agent management.
91
- */
92
- export interface Agent extends Character {
93
- enabled?: boolean;
94
- status?: AgentStatus;
95
- createdAt: number;
96
- updatedAt: number;
97
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,sBAAsB;IACtB,IAAI,EAA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M,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpE,CAAC;IAEF,uBAAuB;IACvB,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;KAC1C,CAAC;IAEF,2BAA2B;IAC3B,KAAK,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAM,SAAQ,SAAS;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -1,155 +0,0 @@
1
- import type { Memory } from './memory';
2
- import type { Content } from './primitives';
3
- import type { IAgentRuntime } from './runtime';
4
- import type { State } from './state';
5
- /**
6
- * Example content with associated user for demonstration purposes
7
- */
8
- export interface ActionExample {
9
- /** User associated with the example */
10
- name: string;
11
- /** Content of the example */
12
- content: Content;
13
- }
14
- /**
15
- * Callback function type for handlers
16
- */
17
- export type HandlerCallback = (response: Content) => Promise<Memory[]>;
18
- /**
19
- * Handler function type for processing messages
20
- */
21
- export type Handler = (runtime: IAgentRuntime, message: Memory, state?: State, options?: HandlerOptions, callback?: HandlerCallback, responses?: Memory[]) => Promise<ActionResult | void | undefined>;
22
- /**
23
- * Validator function type for actions/evaluators
24
- */
25
- export type Validator = (runtime: IAgentRuntime, message: Memory, state?: State) => Promise<boolean>;
26
- /**
27
- * Represents an action the agent can perform
28
- */
29
- export interface Action {
30
- /** Similar action descriptions */
31
- similes?: string[];
32
- /** Detailed description */
33
- description: string;
34
- /** Example usages */
35
- examples?: ActionExample[][];
36
- /** Handler function */
37
- handler: Handler;
38
- /** Action name */
39
- name: string;
40
- /** Validation function */
41
- validate: Validator;
42
- /** Allow extensions and custom options */
43
- [key: string]: unknown;
44
- }
45
- /**
46
- * Example for evaluating agent behavior
47
- */
48
- export interface EvaluationExample {
49
- /** Evaluation context */
50
- prompt: string;
51
- /** Example messages */
52
- messages: Array<ActionExample>;
53
- /** Expected outcome */
54
- outcome: string;
55
- }
56
- /**
57
- * Evaluator for assessing agent responses
58
- */
59
- export interface Evaluator {
60
- /** Whether to always run */
61
- alwaysRun?: boolean;
62
- /** Detailed description */
63
- description: string;
64
- /** Similar evaluator descriptions */
65
- similes?: string[];
66
- /** Example evaluations */
67
- examples: EvaluationExample[];
68
- /** Handler function */
69
- handler: Handler;
70
- /** Evaluator name */
71
- name: string;
72
- /** Validation function */
73
- validate: Validator;
74
- }
75
- export interface ProviderResult {
76
- /** Human-readable text for LLM prompt inclusion */
77
- text?: string;
78
- /** Key-value pairs for template variable substitution */
79
- values?: Record<string, unknown>;
80
- /** Structured data for programmatic access by other components */
81
- data?: Record<string, unknown>;
82
- }
83
- /**
84
- * Provider for external data/services
85
- */
86
- export interface Provider {
87
- /** Provider name */
88
- name: string;
89
- /** Description of the provider */
90
- description?: string;
91
- /** Whether the provider is dynamic */
92
- dynamic?: boolean;
93
- /** Position of the provider in the provider list, positive or negative */
94
- position?: number;
95
- /**
96
- * Whether the provider is private
97
- *
98
- * Private providers are not displayed in the regular provider list, they have to be called explicitly
99
- */
100
- private?: boolean;
101
- /** Data retrieval function */
102
- get: (runtime: IAgentRuntime, message: Memory, state: State) => Promise<ProviderResult>;
103
- }
104
- /**
105
- * Result returned by an action after execution
106
- * Used for action chaining and state management
107
- */
108
- export interface ActionResult {
109
- /** Optional text description of the result */
110
- text?: string;
111
- /** Values to merge into the state */
112
- values?: Record<string, unknown>;
113
- /** Data payload containing action-specific results */
114
- data?: Record<string, unknown>;
115
- /** Whether the action succeeded - defaults to true */
116
- success: boolean;
117
- /** Error information if the action failed */
118
- error?: string | Error;
119
- }
120
- /**
121
- * Context provided to actions during execution
122
- * Allows actions to access previous results and execution state
123
- */
124
- export interface ActionContext {
125
- /** Results from previously executed actions in this run */
126
- previousResults: ActionResult[];
127
- /** Get a specific previous result by action name */
128
- getPreviousResult?: (actionName: string) => ActionResult | undefined;
129
- }
130
- /**
131
- * Options passed to action handlers during execution
132
- * Provides context about the current execution and multi-step plans
133
- */
134
- export interface HandlerOptions {
135
- /** Context with previous action results and utilities */
136
- actionContext?: ActionContext;
137
- /** Multi-step action plan information */
138
- actionPlan?: {
139
- /** Total number of steps in the plan */
140
- totalSteps: number;
141
- /** Current step being executed (1-based) */
142
- currentStep: number;
143
- /** Array of action steps with status tracking */
144
- steps: Array<{
145
- action: string;
146
- status: 'pending' | 'completed' | 'failed';
147
- result?: ActionResult;
148
- error?: string;
149
- }>;
150
- /** AI's reasoning for this execution plan */
151
- thought: string;
152
- };
153
- /** Allow plugin extensions and custom options */
154
- [key: string]: unknown;
155
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/types/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IAEb,6BAA6B;IAC7B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,O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