@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.
- package/README.md +213 -16
- package/dist/testing/index.js +22 -0
- package/dist/testing/index.js.map +9 -0
- package/package.json +46 -27
- package/dist/actions.d.ts +0 -22
- package/dist/actions.d.ts.map +0 -1
- package/dist/browser/index.browser.js +0 -771
- package/dist/browser/index.browser.js.map +0 -427
- package/dist/browser/index.d.ts +0 -2
- package/dist/character.d.ts +0 -39
- package/dist/character.d.ts.map +0 -1
- package/dist/constants/index.d.ts +0 -7
- package/dist/constants/secrets.d.ts +0 -67
- package/dist/database.d.ts +0 -494
- package/dist/database.d.ts.map +0 -1
- package/dist/elizaos.d.ts +0 -194
- package/dist/elizaos.d.ts.map +0 -1
- package/dist/entities.d.ts +0 -40
- package/dist/entities.d.ts.map +0 -1
- package/dist/index.browser.d.ts +0 -39
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.d.ts +0 -40
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.node.d.ts +0 -37
- package/dist/index.node.d.ts.map +0 -1
- package/dist/logger.d.ts +0 -72
- package/dist/logger.d.ts.map +0 -1
- package/dist/memory.d.ts +0 -63
- package/dist/memory.d.ts.map +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.node.js +0 -53403
- package/dist/node/index.node.js.map +0 -511
- package/dist/onboarding-state.d.ts +0 -209
- package/dist/plugin.d.ts +0 -55
- package/dist/plugin.d.ts.map +0 -1
- package/dist/prompts.d.ts +0 -7
- package/dist/prompts.d.ts.map +0 -1
- package/dist/request-context.d.ts +0 -142
- package/dist/request-context.d.ts.map +0 -1
- package/dist/request-context.node.d.ts +0 -36
- package/dist/request-context.node.d.ts.map +0 -1
- package/dist/roles.d.ts +0 -23
- package/dist/roles.d.ts.map +0 -1
- package/dist/runtime.d.ts +0 -366
- package/dist/runtime.d.ts.map +0 -1
- package/dist/schemas/character.d.ts +0 -151
- package/dist/schemas/character.d.ts.map +0 -1
- package/dist/search.d.ts +0 -316
- package/dist/search.d.ts.map +0 -1
- package/dist/secrets.d.ts +0 -11
- package/dist/secrets.d.ts.map +0 -1
- package/dist/services/default-message-service.d.ts +0 -69
- package/dist/services/default-message-service.d.ts.map +0 -1
- package/dist/services/message-service.d.ts +0 -171
- package/dist/services/message-service.d.ts.map +0 -1
- package/dist/services.d.ts +0 -56
- package/dist/services.d.ts.map +0 -1
- package/dist/sessions/index.d.ts +0 -10
- package/dist/sessions/paths.d.ts +0 -56
- package/dist/sessions/provider.d.ts +0 -73
- package/dist/sessions/session-key.d.ts +0 -133
- package/dist/sessions/store.d.ts +0 -75
- package/dist/sessions/types.d.ts +0 -195
- package/dist/settings.d.ts +0 -90
- package/dist/settings.d.ts.map +0 -1
- package/dist/streaming-context.browser.d.ts +0 -26
- package/dist/streaming-context.browser.d.ts.map +0 -1
- package/dist/streaming-context.d.ts +0 -95
- package/dist/streaming-context.d.ts.map +0 -1
- package/dist/streaming-context.node.d.ts +0 -15
- package/dist/streaming-context.node.d.ts.map +0 -1
- package/dist/types/agent.d.ts +0 -97
- package/dist/types/agent.d.ts.map +0 -1
- package/dist/types/components.d.ts +0 -155
- package/dist/types/components.d.ts.map +0 -1
- package/dist/types/database.d.ts +0 -414
- package/dist/types/database.d.ts.map +0 -1
- package/dist/types/elizaos.d.ts +0 -159
- package/dist/types/elizaos.d.ts.map +0 -1
- package/dist/types/environment.d.ts +0 -116
- package/dist/types/environment.d.ts.map +0 -1
- package/dist/types/events.d.ts +0 -203
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -20
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/knowledge.d.ts +0 -30
- package/dist/types/knowledge.d.ts.map +0 -1
- package/dist/types/memory.d.ts +0 -102
- package/dist/types/memory.d.ts.map +0 -1
- package/dist/types/messaging.d.ts +0 -137
- package/dist/types/messaging.d.ts.map +0 -1
- package/dist/types/model.d.ts +0 -513
- package/dist/types/model.d.ts.map +0 -1
- package/dist/types/plugin.d.ts +0 -91
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/primitives.d.ts +0 -96
- package/dist/types/primitives.d.ts.map +0 -1
- package/dist/types/runtime.d.ts +0 -140
- package/dist/types/runtime.d.ts.map +0 -1
- package/dist/types/service.d.ts +0 -150
- package/dist/types/service.d.ts.map +0 -1
- package/dist/types/settings.d.ts +0 -29
- package/dist/types/settings.d.ts.map +0 -1
- package/dist/types/state.d.ts +0 -56
- package/dist/types/state.d.ts.map +0 -1
- package/dist/types/streaming.d.ts +0 -71
- package/dist/types/streaming.d.ts.map +0 -1
- package/dist/types/task.d.ts +0 -67
- package/dist/types/task.d.ts.map +0 -1
- package/dist/types/tee.d.ts +0 -96
- package/dist/types/tee.d.ts.map +0 -1
- package/dist/types/testing.d.ts +0 -28
- package/dist/types/testing.d.ts.map +0 -1
- package/dist/utils/buffer.d.ts +0 -104
- package/dist/utils/buffer.d.ts.map +0 -1
- package/dist/utils/crypto-compat.d.ts +0 -183
- package/dist/utils/crypto-compat.d.ts.map +0 -1
- package/dist/utils/environment.d.ts +0 -50
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/node.d.ts +0 -5
- package/dist/utils/node.d.ts.map +0 -1
- package/dist/utils/paths.d.ts +0 -92
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/server-health.d.ts +0 -22
- package/dist/utils/server-health.d.ts.map +0 -1
- package/dist/utils/streaming.d.ts +0 -179
- package/dist/utils/streaming.d.ts.map +0 -1
- package/dist/utils/type-guards.d.ts +0 -23
- package/dist/utils/type-guards.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -182
- package/dist/utils.d.ts.map +0 -1
package/dist/sessions/paths.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session path utilities for ElizaOS.
|
|
3
|
-
*
|
|
4
|
-
* Provides functions for resolving session-related file paths.
|
|
5
|
-
*
|
|
6
|
-
* @module sessions/paths
|
|
7
|
-
*/
|
|
8
|
-
import type { SessionEntry } from './types';
|
|
9
|
-
/**
|
|
10
|
-
* Resolve the Eliza state directory.
|
|
11
|
-
*
|
|
12
|
-
* Uses ELIZA_STATE_DIR env var, falling back to ~/.eliza
|
|
13
|
-
*/
|
|
14
|
-
export declare function resolveStateDir(env?: NodeJS.ProcessEnv, homedir?: () => string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Resolve the sessions directory for an agent.
|
|
17
|
-
*/
|
|
18
|
-
export declare function resolveAgentSessionsDir(agentId?: string, env?: NodeJS.ProcessEnv, homedir?: () => string): string;
|
|
19
|
-
/**
|
|
20
|
-
* Resolve the transcripts directory for the default agent.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveSessionTranscriptsDir(env?: NodeJS.ProcessEnv, homedir?: () => string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Resolve the transcripts directory for a specific agent.
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolveSessionTranscriptsDirForAgent(agentId?: string, env?: NodeJS.ProcessEnv, homedir?: () => string): string;
|
|
27
|
-
/**
|
|
28
|
-
* Resolve the default session store path for an agent.
|
|
29
|
-
*/
|
|
30
|
-
export declare function resolveDefaultSessionStorePath(agentId?: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Resolve a session store path with optional template expansion.
|
|
33
|
-
*
|
|
34
|
-
* Supports `{agentId}` placeholder and `~` expansion.
|
|
35
|
-
*/
|
|
36
|
-
export declare function resolveStorePath(store?: string, opts?: {
|
|
37
|
-
agentId?: string;
|
|
38
|
-
}): string;
|
|
39
|
-
/**
|
|
40
|
-
* Resolve the path to a session transcript file.
|
|
41
|
-
*/
|
|
42
|
-
export declare function resolveSessionTranscriptPath(sessionId: string, agentId?: string, topicId?: string | number): string;
|
|
43
|
-
/**
|
|
44
|
-
* Resolve the path to a session file.
|
|
45
|
-
*/
|
|
46
|
-
export declare function resolveSessionFilePath(sessionId: string, entry?: SessionEntry, opts?: {
|
|
47
|
-
agentId?: string;
|
|
48
|
-
}): string;
|
|
49
|
-
/**
|
|
50
|
-
* Check if a path is within the Eliza state directory.
|
|
51
|
-
*/
|
|
52
|
-
export declare function isWithinStateDir(filePath: string): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Ensure a path is safe to use for session storage.
|
|
55
|
-
*/
|
|
56
|
-
export declare function ensureSafeSessionPath(filePath: string): string;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session provider for ElizaOS runtime.
|
|
3
|
-
*
|
|
4
|
-
* Exposes session context to agents during message processing.
|
|
5
|
-
*
|
|
6
|
-
* @module sessions/provider
|
|
7
|
-
*/
|
|
8
|
-
import type { Memory } from '../types/memory';
|
|
9
|
-
import type { Provider } from '../types/components';
|
|
10
|
-
import { type SessionEntry, type SessionStore } from './types';
|
|
11
|
-
/**
|
|
12
|
-
* Extract session context from a memory object.
|
|
13
|
-
*/
|
|
14
|
-
export declare function extractSessionContext(memory: Memory): {
|
|
15
|
-
sessionId?: string;
|
|
16
|
-
sessionKey?: string;
|
|
17
|
-
entry?: SessionEntry;
|
|
18
|
-
} | null;
|
|
19
|
-
/**
|
|
20
|
-
* Create a session provider that exposes session context.
|
|
21
|
-
*/
|
|
22
|
-
export declare function createSessionProvider(options?: {
|
|
23
|
-
storePath?: string;
|
|
24
|
-
name?: string;
|
|
25
|
-
}): Provider;
|
|
26
|
-
/**
|
|
27
|
-
* Create a provider that exposes session skills.
|
|
28
|
-
*/
|
|
29
|
-
export declare function createSessionSkillsProvider(options?: {
|
|
30
|
-
storePath?: string;
|
|
31
|
-
name?: string;
|
|
32
|
-
}): Provider;
|
|
33
|
-
/**
|
|
34
|
-
* Create a provider that enforces session send policy.
|
|
35
|
-
*/
|
|
36
|
-
export declare function createSendPolicyProvider(options?: {
|
|
37
|
-
storePath?: string;
|
|
38
|
-
name?: string;
|
|
39
|
-
}): Provider;
|
|
40
|
-
/**
|
|
41
|
-
* Get all default session providers.
|
|
42
|
-
*/
|
|
43
|
-
export declare function getSessionProviders(options?: {
|
|
44
|
-
storePath?: string;
|
|
45
|
-
}): Provider[];
|
|
46
|
-
/**
|
|
47
|
-
* Session state manager for runtime integration.
|
|
48
|
-
*/
|
|
49
|
-
export declare class SessionStateManager {
|
|
50
|
-
private readonly storePath;
|
|
51
|
-
private store;
|
|
52
|
-
private lastLoadTime;
|
|
53
|
-
private readonly cacheTtlMs;
|
|
54
|
-
constructor(storePath: string, options?: {
|
|
55
|
-
cacheTtlMs?: number;
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* Get the session store, loading if necessary.
|
|
59
|
-
*/
|
|
60
|
-
getStore(): SessionStore;
|
|
61
|
-
/**
|
|
62
|
-
* Get a session entry by key.
|
|
63
|
-
*/
|
|
64
|
-
getEntry(sessionKey: string): SessionEntry | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Get a session entry by ID.
|
|
67
|
-
*/
|
|
68
|
-
getEntryById(sessionId: string): SessionEntry | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* Invalidate the cached store.
|
|
71
|
-
*/
|
|
72
|
-
invalidate(): void;
|
|
73
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session key utilities for ElizaOS.
|
|
3
|
-
*
|
|
4
|
-
* Provides functions for building, parsing, and normalizing session keys
|
|
5
|
-
* used to identify agent sessions, threads, and peer connections.
|
|
6
|
-
*
|
|
7
|
-
* Session keys follow the format: agent:{agentId}:{rest}
|
|
8
|
-
*
|
|
9
|
-
* @module sessions/session-key
|
|
10
|
-
*/
|
|
11
|
-
export declare const DEFAULT_AGENT_ID = "main";
|
|
12
|
-
export declare const DEFAULT_MAIN_KEY = "main";
|
|
13
|
-
export declare const DEFAULT_ACCOUNT_ID = "default";
|
|
14
|
-
/**
|
|
15
|
-
* Parsed agent session key components.
|
|
16
|
-
*/
|
|
17
|
-
export type ParsedAgentSessionKey = {
|
|
18
|
-
/** The full original session key */
|
|
19
|
-
raw: string;
|
|
20
|
-
/** Agent ID extracted from the key */
|
|
21
|
-
agentId: string;
|
|
22
|
-
/** The remainder of the key after agent:{agentId}: */
|
|
23
|
-
rest: string;
|
|
24
|
-
/** Whether this is an ACP session */
|
|
25
|
-
isAcp: boolean;
|
|
26
|
-
/** Whether this is a subagent session */
|
|
27
|
-
isSubagent: boolean;
|
|
28
|
-
/** Thread ID if present */
|
|
29
|
-
threadId?: string;
|
|
30
|
-
/** Parent session key if this is a thread */
|
|
31
|
-
parentKey?: string;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Parse an agent session key into its components.
|
|
35
|
-
*/
|
|
36
|
-
export declare function parseAgentSessionKey(sessionKey: string | undefined | null): ParsedAgentSessionKey | null;
|
|
37
|
-
/**
|
|
38
|
-
* Check if a session key is an ACP session.
|
|
39
|
-
*/
|
|
40
|
-
export declare function isAcpSessionKey(sessionKey: string | undefined | null): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Check if a session key is a subagent session.
|
|
43
|
-
*/
|
|
44
|
-
export declare function isSubagentSessionKey(sessionKey: string | undefined | null): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Resolve the parent session key for a thread session.
|
|
47
|
-
*/
|
|
48
|
-
export declare function resolveThreadParentSessionKey(sessionKey: string | undefined | null): string | null;
|
|
49
|
-
/**
|
|
50
|
-
* Normalize a main key value.
|
|
51
|
-
*/
|
|
52
|
-
export declare function normalizeMainKey(value: string | undefined | null): string;
|
|
53
|
-
/**
|
|
54
|
-
* Normalize an agent ID. Ensures path-safe and shell-friendly.
|
|
55
|
-
*/
|
|
56
|
-
export declare function normalizeAgentId(value: string | undefined | null): string;
|
|
57
|
-
/**
|
|
58
|
-
* Sanitize an agent ID (alias for normalizeAgentId).
|
|
59
|
-
*/
|
|
60
|
-
export declare function sanitizeAgentId(value: string | undefined | null): string;
|
|
61
|
-
/**
|
|
62
|
-
* Normalize an account ID.
|
|
63
|
-
*/
|
|
64
|
-
export declare function normalizeAccountId(value: string | undefined | null): string;
|
|
65
|
-
/**
|
|
66
|
-
* Build an agent session key from components.
|
|
67
|
-
*/
|
|
68
|
-
export declare function buildAgentSessionKey(agentId: string, rest: string): string;
|
|
69
|
-
/**
|
|
70
|
-
* Build the main session key for an agent.
|
|
71
|
-
*/
|
|
72
|
-
export declare function buildAgentMainSessionKey(params: {
|
|
73
|
-
agentId: string;
|
|
74
|
-
mainKey?: string | undefined;
|
|
75
|
-
}): string;
|
|
76
|
-
/**
|
|
77
|
-
* Build an ACP session key.
|
|
78
|
-
*/
|
|
79
|
-
export declare function buildAcpSessionKey(agentId: string, acpKey: string): string;
|
|
80
|
-
/**
|
|
81
|
-
* Build a subagent session key.
|
|
82
|
-
*/
|
|
83
|
-
export declare function buildSubagentSessionKey(agentId: string, subagentId: string, rest?: string): string;
|
|
84
|
-
/**
|
|
85
|
-
* Build a peer session key for an agent.
|
|
86
|
-
*/
|
|
87
|
-
export declare function buildAgentPeerSessionKey(params: {
|
|
88
|
-
agentId: string;
|
|
89
|
-
mainKey?: string | undefined;
|
|
90
|
-
channel: string;
|
|
91
|
-
accountId?: string | null;
|
|
92
|
-
peerKind?: 'dm' | 'group' | 'channel' | null;
|
|
93
|
-
peerId?: string | null;
|
|
94
|
-
identityLinks?: Record<string, string[]>;
|
|
95
|
-
dmScope?: 'main' | 'per-peer' | 'per-channel-peer' | 'per-account-channel-peer';
|
|
96
|
-
}): string;
|
|
97
|
-
/**
|
|
98
|
-
* Convert a store session key to a request session key.
|
|
99
|
-
*/
|
|
100
|
-
export declare function toAgentRequestSessionKey(storeKey: string | undefined | null): string | undefined;
|
|
101
|
-
/**
|
|
102
|
-
* Convert a request session key to a store session key.
|
|
103
|
-
*/
|
|
104
|
-
export declare function toAgentStoreSessionKey(params: {
|
|
105
|
-
agentId: string;
|
|
106
|
-
requestKey: string | undefined | null;
|
|
107
|
-
mainKey?: string | undefined;
|
|
108
|
-
}): string;
|
|
109
|
-
/**
|
|
110
|
-
* Resolve the agent ID from a session key.
|
|
111
|
-
*/
|
|
112
|
-
export declare function resolveAgentIdFromSessionKey(sessionKey: string | undefined | null): string;
|
|
113
|
-
/**
|
|
114
|
-
* Build a group history key.
|
|
115
|
-
*/
|
|
116
|
-
export declare function buildGroupHistoryKey(params: {
|
|
117
|
-
channel: string;
|
|
118
|
-
accountId?: string | null;
|
|
119
|
-
peerKind: 'group' | 'channel';
|
|
120
|
-
peerId: string;
|
|
121
|
-
}): string;
|
|
122
|
-
/**
|
|
123
|
-
* Resolve thread session keys.
|
|
124
|
-
*/
|
|
125
|
-
export declare function resolveThreadSessionKeys(params: {
|
|
126
|
-
baseSessionKey: string;
|
|
127
|
-
threadId?: string | null;
|
|
128
|
-
parentSessionKey?: string;
|
|
129
|
-
useSuffix?: boolean;
|
|
130
|
-
}): {
|
|
131
|
-
sessionKey: string;
|
|
132
|
-
parentSessionKey?: string;
|
|
133
|
-
};
|
package/dist/sessions/store.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session store for ElizaOS.
|
|
3
|
-
*
|
|
4
|
-
* Provides file-based session storage with caching, locking, and
|
|
5
|
-
* atomic updates.
|
|
6
|
-
*
|
|
7
|
-
* @module sessions/store
|
|
8
|
-
*/
|
|
9
|
-
import { type SessionEntry, type SessionStore } from './types';
|
|
10
|
-
/**
|
|
11
|
-
* Clear all session store caches (for testing).
|
|
12
|
-
*/
|
|
13
|
-
export declare function clearSessionStoreCacheForTest(): void;
|
|
14
|
-
export type LoadSessionStoreOptions = {
|
|
15
|
-
/** Skip cache and read directly from disk */
|
|
16
|
-
skipCache?: boolean;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Load a session store from disk.
|
|
20
|
-
*/
|
|
21
|
-
export declare function loadSessionStore(storePath: string, opts?: LoadSessionStoreOptions): SessionStore;
|
|
22
|
-
/**
|
|
23
|
-
* Save a session store to disk with locking.
|
|
24
|
-
*/
|
|
25
|
-
export declare function saveSessionStore(storePath: string, store: SessionStore): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Update a session store with a mutator function.
|
|
28
|
-
*/
|
|
29
|
-
export declare function updateSessionStore<T>(storePath: string, mutator: (store: SessionStore) => Promise<T> | T): Promise<T>;
|
|
30
|
-
/**
|
|
31
|
-
* Update a single session entry.
|
|
32
|
-
*/
|
|
33
|
-
export declare function updateSessionStoreEntry(params: {
|
|
34
|
-
storePath: string;
|
|
35
|
-
sessionKey: string;
|
|
36
|
-
update: (entry: SessionEntry) => Promise<Partial<SessionEntry> | null>;
|
|
37
|
-
}): Promise<SessionEntry | null>;
|
|
38
|
-
/**
|
|
39
|
-
* Get a session entry from the store.
|
|
40
|
-
*/
|
|
41
|
-
export declare function getSessionEntry(storePath: string, sessionKey: string): SessionEntry | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Get a session entry by session ID.
|
|
44
|
-
*/
|
|
45
|
-
export declare function getSessionEntryById(storePath: string, sessionId: string): SessionEntry | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* Get the updated timestamp for a session.
|
|
48
|
-
*/
|
|
49
|
-
export declare function readSessionUpdatedAt(params: {
|
|
50
|
-
storePath: string;
|
|
51
|
-
sessionKey: string;
|
|
52
|
-
}): number | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Create or update a session entry.
|
|
55
|
-
*/
|
|
56
|
-
export declare function upsertSessionEntry(params: {
|
|
57
|
-
storePath: string;
|
|
58
|
-
sessionKey: string;
|
|
59
|
-
patch: Partial<SessionEntry>;
|
|
60
|
-
}): Promise<SessionEntry>;
|
|
61
|
-
/**
|
|
62
|
-
* Delete a session entry.
|
|
63
|
-
*/
|
|
64
|
-
export declare function deleteSessionEntry(params: {
|
|
65
|
-
storePath: string;
|
|
66
|
-
sessionKey: string;
|
|
67
|
-
}): Promise<boolean>;
|
|
68
|
-
/**
|
|
69
|
-
* List all session keys in a store.
|
|
70
|
-
*/
|
|
71
|
-
export declare function listSessionKeys(storePath: string): string[];
|
|
72
|
-
/**
|
|
73
|
-
* List all sessions with their entries.
|
|
74
|
-
*/
|
|
75
|
-
export declare function listSessions(storePath: string): Array<[string, SessionEntry]>;
|
package/dist/sessions/types.d.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session types for ElizaOS.
|
|
3
|
-
*
|
|
4
|
-
* Defines the core data structures for session management including
|
|
5
|
-
* session entries, scopes, origins, and related metadata.
|
|
6
|
-
*
|
|
7
|
-
* @module sessions/types
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Origin information for a session.
|
|
11
|
-
*/
|
|
12
|
-
export type SessionOrigin = {
|
|
13
|
-
channel?: string;
|
|
14
|
-
platform?: string;
|
|
15
|
-
accountId?: string;
|
|
16
|
-
groupId?: string;
|
|
17
|
-
threadId?: string | number;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Snapshot of active skills for a session.
|
|
21
|
-
*/
|
|
22
|
-
export type SessionSkillsSnapshot = {
|
|
23
|
-
skills?: string[];
|
|
24
|
-
updatedAt?: number;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Normalized chat type for session classification.
|
|
28
|
-
*/
|
|
29
|
-
export type SessionChatType = 'dm' | 'group' | 'channel' | 'thread';
|
|
30
|
-
/**
|
|
31
|
-
* Delivery context for routing responses.
|
|
32
|
-
*/
|
|
33
|
-
export type SessionDeliveryContext = {
|
|
34
|
-
/** Channel to deliver to */
|
|
35
|
-
channel?: string;
|
|
36
|
-
/** Target recipient/destination */
|
|
37
|
-
to?: string;
|
|
38
|
-
/** Account to use for delivery */
|
|
39
|
-
accountId?: string;
|
|
40
|
-
/** Thread to deliver to */
|
|
41
|
-
threadId?: string | number;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Core session entry representing a conversation session.
|
|
45
|
-
*/
|
|
46
|
-
export type SessionEntry = {
|
|
47
|
-
/** Unique session identifier (UUID) */
|
|
48
|
-
sessionId: string;
|
|
49
|
-
/** Last update timestamp (milliseconds since epoch) */
|
|
50
|
-
updatedAt: number;
|
|
51
|
-
/** Path to the session transcript file */
|
|
52
|
-
sessionFile?: string;
|
|
53
|
-
/** Parent session key that spawned this session */
|
|
54
|
-
spawnedBy?: string;
|
|
55
|
-
/** Human-readable label for the session */
|
|
56
|
-
label?: string;
|
|
57
|
-
/** Display name for UI purposes */
|
|
58
|
-
displayName?: string;
|
|
59
|
-
/** Whether system introduction has been sent */
|
|
60
|
-
systemSent?: boolean;
|
|
61
|
-
/** Whether the last run was aborted */
|
|
62
|
-
abortedLastRun?: boolean;
|
|
63
|
-
/** Type of chat */
|
|
64
|
-
chatType?: SessionChatType;
|
|
65
|
-
/** Primary channel for this session */
|
|
66
|
-
channel?: string;
|
|
67
|
-
/** Group identifier */
|
|
68
|
-
groupId?: string;
|
|
69
|
-
/** Group subject/name */
|
|
70
|
-
subject?: string;
|
|
71
|
-
/** Group channel name */
|
|
72
|
-
groupChannel?: string;
|
|
73
|
-
/** Space/server name */
|
|
74
|
-
space?: string;
|
|
75
|
-
/** Origin information */
|
|
76
|
-
origin?: SessionOrigin;
|
|
77
|
-
/** Current delivery context */
|
|
78
|
-
deliveryContext?: SessionDeliveryContext;
|
|
79
|
-
/** Last channel used for delivery */
|
|
80
|
-
lastChannel?: string;
|
|
81
|
-
/** Last recipient */
|
|
82
|
-
lastTo?: string;
|
|
83
|
-
/** Last account used */
|
|
84
|
-
lastAccountId?: string;
|
|
85
|
-
/** Last thread ID */
|
|
86
|
-
lastThreadId?: string | number;
|
|
87
|
-
/** Thinking/reasoning level */
|
|
88
|
-
thinkingLevel?: string;
|
|
89
|
-
/** Verbose output level */
|
|
90
|
-
verboseLevel?: string;
|
|
91
|
-
/** Reasoning level */
|
|
92
|
-
reasoningLevel?: string;
|
|
93
|
-
/** Elevated permissions level */
|
|
94
|
-
elevatedLevel?: string;
|
|
95
|
-
/** Provider override */
|
|
96
|
-
providerOverride?: string;
|
|
97
|
-
/** Model override */
|
|
98
|
-
modelOverride?: string;
|
|
99
|
-
/** Auth profile override */
|
|
100
|
-
authProfileOverride?: string;
|
|
101
|
-
/** Source of auth profile override */
|
|
102
|
-
authProfileOverrideSource?: 'auto' | 'user';
|
|
103
|
-
/** Compaction count when auth profile was set */
|
|
104
|
-
authProfileOverrideCompactionCount?: number;
|
|
105
|
-
/** Input tokens consumed */
|
|
106
|
-
inputTokens?: number;
|
|
107
|
-
/** Output tokens generated */
|
|
108
|
-
outputTokens?: number;
|
|
109
|
-
/** Total tokens */
|
|
110
|
-
totalTokens?: number;
|
|
111
|
-
/** Context window tokens */
|
|
112
|
-
contextTokens?: number;
|
|
113
|
-
/** Number of compaction operations */
|
|
114
|
-
compactionCount?: number;
|
|
115
|
-
/** Model provider used */
|
|
116
|
-
modelProvider?: string;
|
|
117
|
-
/** Model identifier used */
|
|
118
|
-
model?: string;
|
|
119
|
-
/** Group activation mode */
|
|
120
|
-
groupActivation?: 'mention' | 'always';
|
|
121
|
-
/** Whether group needs system introduction */
|
|
122
|
-
groupActivationNeedsSystemIntro?: boolean;
|
|
123
|
-
/** Send policy */
|
|
124
|
-
sendPolicy?: 'allow' | 'deny';
|
|
125
|
-
/** Response usage display mode */
|
|
126
|
-
responseUsage?: 'on' | 'off' | 'tokens' | 'full';
|
|
127
|
-
/** Text-to-speech auto mode */
|
|
128
|
-
ttsAuto?: 'on' | 'off' | 'voice-only';
|
|
129
|
-
/** Execution host */
|
|
130
|
-
execHost?: string;
|
|
131
|
-
/** Execution security mode */
|
|
132
|
-
execSecurity?: string;
|
|
133
|
-
/** Execution ask mode */
|
|
134
|
-
execAsk?: string;
|
|
135
|
-
/** Execution node */
|
|
136
|
-
execNode?: string;
|
|
137
|
-
/** Timestamp when memory was last flushed */
|
|
138
|
-
memoryFlushAt?: number;
|
|
139
|
-
/** Compaction count when memory was flushed */
|
|
140
|
-
memoryFlushCompactionCount?: number;
|
|
141
|
-
/** Snapshot of active skills */
|
|
142
|
-
skillsSnapshot?: SessionSkillsSnapshot;
|
|
143
|
-
/** Last delivered heartbeat payload */
|
|
144
|
-
lastHeartbeatText?: string;
|
|
145
|
-
/** Timestamp when last heartbeat was sent */
|
|
146
|
-
lastHeartbeatSentAt?: number;
|
|
147
|
-
/** Map of CLI session identifiers */
|
|
148
|
-
cliSessionIds?: Record<string, string>;
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* Session store mapping session keys to entries.
|
|
152
|
-
*/
|
|
153
|
-
export type SessionStore = Record<string, SessionEntry>;
|
|
154
|
-
/**
|
|
155
|
-
* Result of resolving a session key.
|
|
156
|
-
*/
|
|
157
|
-
export type SessionResolution = {
|
|
158
|
-
/** The resolved session key */
|
|
159
|
-
sessionKey: string;
|
|
160
|
-
/** Whether this is a new session */
|
|
161
|
-
isNew: boolean;
|
|
162
|
-
/** The session entry */
|
|
163
|
-
entry: SessionEntry;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* Result of resolving a group session key.
|
|
167
|
-
*/
|
|
168
|
-
export type GroupKeyResolution = {
|
|
169
|
-
/** The resolved group key */
|
|
170
|
-
key: string;
|
|
171
|
-
/** Channel identifier */
|
|
172
|
-
channel?: string;
|
|
173
|
-
/** Group/room identifier */
|
|
174
|
-
id?: string;
|
|
175
|
-
/** Chat type */
|
|
176
|
-
chatType?: SessionChatType;
|
|
177
|
-
};
|
|
178
|
-
/** Default trigger for resetting a session */
|
|
179
|
-
export declare const DEFAULT_RESET_TRIGGER = "/new";
|
|
180
|
-
/** All default reset triggers */
|
|
181
|
-
export declare const DEFAULT_RESET_TRIGGERS: string[];
|
|
182
|
-
/** Default idle timeout in minutes */
|
|
183
|
-
export declare const DEFAULT_IDLE_MINUTES = 60;
|
|
184
|
-
/**
|
|
185
|
-
* Merge a session entry with a partial update.
|
|
186
|
-
*/
|
|
187
|
-
export declare function mergeSessionEntry(existing: SessionEntry | undefined, patch: Partial<SessionEntry>): SessionEntry;
|
|
188
|
-
/**
|
|
189
|
-
* Create a new session entry with minimal required fields.
|
|
190
|
-
*/
|
|
191
|
-
export declare function createSessionEntry(overrides?: Partial<SessionEntry>): SessionEntry;
|
|
192
|
-
/**
|
|
193
|
-
* Check if a session entry is valid.
|
|
194
|
-
*/
|
|
195
|
-
export declare function isValidSessionEntry(entry: unknown): entry is SessionEntry;
|
package/dist/settings.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { Character, IAgentRuntime, OnboardingConfig, Setting, World, WorldSettings } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a Setting object from a configSetting object by omitting the 'value' property.
|
|
4
|
-
*
|
|
5
|
-
* @param {Omit<Setting, 'value'>} configSetting - The configSetting object to create the Setting from.
|
|
6
|
-
* @returns {Setting} A new Setting object created from the provided configSetting object.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createSettingFromConfig(configSetting: Omit<Setting, 'value'>): Setting;
|
|
9
|
-
/**
|
|
10
|
-
* Gets the salt for the agent.
|
|
11
|
-
*
|
|
12
|
-
* @returns {string} The salt for the agent.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getSalt(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Clears the salt cache - useful for tests or when environment changes
|
|
17
|
-
*/
|
|
18
|
-
export declare function clearSaltCache(): void;
|
|
19
|
-
/**
|
|
20
|
-
* Common encryption function for string values
|
|
21
|
-
* @param {string} value - The string value to encrypt
|
|
22
|
-
* @param {string} salt - The salt to use for encryption
|
|
23
|
-
* @returns {string} - The encrypted value in 'iv:encrypted' format
|
|
24
|
-
*/
|
|
25
|
-
export declare function encryptStringValue(value: string, salt: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Common decryption function for string values
|
|
28
|
-
* @param value - The encrypted value in 'iv:encrypted' format
|
|
29
|
-
* @param salt - The salt to use for decryption
|
|
30
|
-
* @returns The decrypted string value, or original value if not encrypted
|
|
31
|
-
*/
|
|
32
|
-
export declare function decryptStringValue(value: string, salt: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* Applies salt to the value of a setting
|
|
35
|
-
* Only applies to secret settings with string values
|
|
36
|
-
*/
|
|
37
|
-
export declare function saltSettingValue(setting: Setting, salt: string): Setting;
|
|
38
|
-
/**
|
|
39
|
-
* Removes salt from the value of a setting
|
|
40
|
-
* Only applies to secret settings with string values
|
|
41
|
-
*/
|
|
42
|
-
export declare function unsaltSettingValue(setting: Setting, salt: string): Setting;
|
|
43
|
-
/**
|
|
44
|
-
* Applies salt to all settings in a WorldSettings object
|
|
45
|
-
*/
|
|
46
|
-
export declare function saltWorldSettings(worldSettings: WorldSettings, salt: string): WorldSettings;
|
|
47
|
-
/**
|
|
48
|
-
* Removes salt from all settings in a WorldSettings object
|
|
49
|
-
*/
|
|
50
|
-
export declare function unsaltWorldSettings(worldSettings: WorldSettings, salt: string): WorldSettings;
|
|
51
|
-
/**
|
|
52
|
-
* Updates settings state in world metadata
|
|
53
|
-
*/
|
|
54
|
-
export declare function updateWorldSettings(runtime: IAgentRuntime, serverId: string, worldSettings: WorldSettings): Promise<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Gets settings state from world metadata
|
|
57
|
-
*/
|
|
58
|
-
export declare function getWorldSettings(runtime: IAgentRuntime, serverId: string): Promise<WorldSettings | null>;
|
|
59
|
-
/**
|
|
60
|
-
* Initializes settings configuration for a server
|
|
61
|
-
*/
|
|
62
|
-
export declare function initializeOnboarding(runtime: IAgentRuntime, world: World, config: OnboardingConfig): Promise<WorldSettings | null>;
|
|
63
|
-
/**
|
|
64
|
-
* Encrypts sensitive data in a Character object
|
|
65
|
-
* @param {Character} character - The character object to encrypt secrets for
|
|
66
|
-
* @returns {Character} - A copy of the character with encrypted secrets
|
|
67
|
-
*/
|
|
68
|
-
export declare function encryptedCharacter(character: Character): Character;
|
|
69
|
-
/**
|
|
70
|
-
* Decrypts sensitive data in a Character object
|
|
71
|
-
* @param {Character} character - The character object with encrypted secrets
|
|
72
|
-
* @param {IAgentRuntime} runtime - The runtime information needed for salt generation
|
|
73
|
-
* @returns {Character} - A copy of the character with decrypted secrets
|
|
74
|
-
*/
|
|
75
|
-
export declare function decryptedCharacter(character: Character, _runtime: IAgentRuntime): Character;
|
|
76
|
-
/**
|
|
77
|
-
* Helper function to encrypt all string values in an object
|
|
78
|
-
* @param {Record<string, unknown>} obj - Object with values to encrypt
|
|
79
|
-
* @param {string} salt - The salt to use for encryption
|
|
80
|
-
* @returns {Record<string, unknown>} - Object with encrypted values
|
|
81
|
-
*/
|
|
82
|
-
export declare function encryptObjectValues(obj: Record<string, unknown>, salt: string): Record<string, unknown>;
|
|
83
|
-
/**
|
|
84
|
-
* Helper function to decrypt all string values in an object
|
|
85
|
-
* @param {Record<string, unknown>} obj - Object with encrypted values
|
|
86
|
-
* @param {string} salt - The salt to use for decryption
|
|
87
|
-
* @returns {Record<string, unknown>} - Object with decrypted values
|
|
88
|
-
*/
|
|
89
|
-
export declare function decryptObjectValues(obj: Record<string, unknown>, salt: string): Record<string, unknown>;
|
|
90
|
-
export { decryptStringValue as decryptSecret };
|
package/dist/settings.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,OAAO,CActF;AAYD;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAyBhC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAwCtE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA8BtE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CASxE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAS1E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAQ3F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,CAQ7F;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAc/B;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAsC/B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAgBlE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,SAAS,CAgB3F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB;AAED,OAAO,EAAE,kBAAkB,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-specific streaming context manager using a simple stack.
|
|
3
|
-
*
|
|
4
|
-
* In browser environments, each API call typically creates its own runtime instance,
|
|
5
|
-
* so there's no risk of parallel context collision. A simple stack-based approach
|
|
6
|
-
* is sufficient and performant.
|
|
7
|
-
*
|
|
8
|
-
* Inspired by OpenTelemetry's StackContextManager for browser environments.
|
|
9
|
-
* @see https://opentelemetry.io/docs/languages/js/context/
|
|
10
|
-
*/
|
|
11
|
-
import type { StreamingContext, IStreamingContextManager } from './streaming-context';
|
|
12
|
-
/**
|
|
13
|
-
* Stack-based context manager for browser environments.
|
|
14
|
-
* Safe because browser typically has 1 runtime per request.
|
|
15
|
-
* Supports nested contexts via stack push/pop.
|
|
16
|
-
*/
|
|
17
|
-
export declare class StackContextManager implements IStreamingContextManager {
|
|
18
|
-
private stack;
|
|
19
|
-
run<T>(context: StreamingContext | undefined, fn: () => T): T;
|
|
20
|
-
active(): StreamingContext | undefined;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Create and return a configured Stack context manager.
|
|
24
|
-
* Called by index.browser.ts during initialization.
|
|
25
|
-
*/
|
|
26
|
-
export declare function createBrowserStreamingContextManager(): IStreamingContextManager;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streaming-context.browser.d.ts","sourceRoot":"","sources":["../src/streaming-context.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEtF;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,wBAAwB;IAClE,OAAO,CAAC,KAAK,CAA2C;IAExD,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAS7D,MAAM,IAAI,gBAAgB,GAAG,SAAS;CAGvC;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,IAAI,wBAAwB,CAE/E"}
|