@elizaos/core 2.0.0-alpha.86 → 2.0.0-alpha.89

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 (147) hide show
  1. package/README.md +2 -2
  2. package/dist/autonomy/index.d.ts +1 -1
  3. package/dist/browser/index.browser.js +419 -418
  4. package/dist/browser/index.browser.js.map +13 -11
  5. package/dist/edge/index.edge.js +3498 -3332
  6. package/dist/edge/index.edge.js.map +16 -14
  7. package/dist/generated/action-docs.d.ts.map +1 -1
  8. package/dist/node/index.node.js +683 -371
  9. package/dist/node/index.node.js.map +16 -16
  10. package/dist/types/agent.d.ts +2 -0
  11. package/dist/types/agent.d.ts.map +1 -1
  12. package/dist/types/events.d.ts +8 -8
  13. package/dist/types/events.d.ts.map +1 -1
  14. package/dist/types/generated/eliza/v1/agent_pb.d.ts +4 -4
  15. package/dist/types/generated/eliza/v1/agent_pb.d.ts.map +1 -1
  16. package/package.json +3 -3
  17. package/dist/advanced-capabilities/actions/createTask.d.ts +0 -3
  18. package/dist/advanced-capabilities/actions/createTask.d.ts.map +0 -1
  19. package/dist/advanced-memory/actions/resetSession.d.ts +0 -11
  20. package/dist/advanced-memory/actions/resetSession.d.ts.map +0 -1
  21. package/dist/advanced-memory/services/autoCompaction.d.ts +0 -24
  22. package/dist/advanced-memory/services/autoCompaction.d.ts.map +0 -1
  23. package/dist/autonomy/autonomousState.d.ts +0 -5
  24. package/dist/autonomy/autonomousState.d.ts.map +0 -1
  25. package/dist/basic-capabilities/actions/status.d.ts +0 -10
  26. package/dist/basic-capabilities/actions/status.d.ts.map +0 -1
  27. package/dist/basic-capabilities/providers/capabilities.d.ts +0 -14
  28. package/dist/basic-capabilities/providers/capabilities.d.ts.map +0 -1
  29. package/dist/bootstrap/actions/addContact.d.ts +0 -3
  30. package/dist/bootstrap/actions/addContact.d.ts.map +0 -1
  31. package/dist/bootstrap/actions/choice.d.ts +0 -3
  32. package/dist/bootstrap/actions/choice.d.ts.map +0 -1
  33. package/dist/bootstrap/actions/followRoom.d.ts +0 -3
  34. package/dist/bootstrap/actions/followRoom.d.ts.map +0 -1
  35. package/dist/bootstrap/actions/ignore.d.ts +0 -3
  36. package/dist/bootstrap/actions/ignore.d.ts.map +0 -1
  37. package/dist/bootstrap/actions/imageGeneration.d.ts +0 -2
  38. package/dist/bootstrap/actions/imageGeneration.d.ts.map +0 -1
  39. package/dist/bootstrap/actions/index.d.ts +0 -14
  40. package/dist/bootstrap/actions/index.d.ts.map +0 -1
  41. package/dist/bootstrap/actions/muteRoom.d.ts +0 -3
  42. package/dist/bootstrap/actions/muteRoom.d.ts.map +0 -1
  43. package/dist/bootstrap/actions/none.d.ts +0 -3
  44. package/dist/bootstrap/actions/none.d.ts.map +0 -1
  45. package/dist/bootstrap/actions/removeContact.d.ts +0 -3
  46. package/dist/bootstrap/actions/removeContact.d.ts.map +0 -1
  47. package/dist/bootstrap/actions/reply.d.ts +0 -3
  48. package/dist/bootstrap/actions/reply.d.ts.map +0 -1
  49. package/dist/bootstrap/actions/resetSession.d.ts +0 -2
  50. package/dist/bootstrap/actions/resetSession.d.ts.map +0 -1
  51. package/dist/bootstrap/actions/roles.d.ts +0 -13
  52. package/dist/bootstrap/actions/roles.d.ts.map +0 -1
  53. package/dist/bootstrap/actions/scheduleFollowUp.d.ts +0 -3
  54. package/dist/bootstrap/actions/scheduleFollowUp.d.ts.map +0 -1
  55. package/dist/bootstrap/actions/searchContacts.d.ts +0 -3
  56. package/dist/bootstrap/actions/searchContacts.d.ts.map +0 -1
  57. package/dist/bootstrap/actions/sendMessage.d.ts +0 -14
  58. package/dist/bootstrap/actions/sendMessage.d.ts.map +0 -1
  59. package/dist/bootstrap/actions/settings.d.ts +0 -7
  60. package/dist/bootstrap/actions/settings.d.ts.map +0 -1
  61. package/dist/bootstrap/actions/status.d.ts +0 -10
  62. package/dist/bootstrap/actions/status.d.ts.map +0 -1
  63. package/dist/bootstrap/actions/unfollowRoom.d.ts +0 -13
  64. package/dist/bootstrap/actions/unfollowRoom.d.ts.map +0 -1
  65. package/dist/bootstrap/actions/unmuteRoom.d.ts +0 -14
  66. package/dist/bootstrap/actions/unmuteRoom.d.ts.map +0 -1
  67. package/dist/bootstrap/actions/updateContact.d.ts +0 -3
  68. package/dist/bootstrap/actions/updateContact.d.ts.map +0 -1
  69. package/dist/bootstrap/actions/updateEntity.d.ts +0 -42
  70. package/dist/bootstrap/actions/updateEntity.d.ts.map +0 -1
  71. package/dist/bootstrap/evaluators/index.d.ts +0 -2
  72. package/dist/bootstrap/evaluators/index.d.ts.map +0 -1
  73. package/dist/bootstrap/evaluators/reflection.d.ts +0 -3
  74. package/dist/bootstrap/evaluators/reflection.d.ts.map +0 -1
  75. package/dist/bootstrap/evaluators/relationshipExtraction.d.ts +0 -3
  76. package/dist/bootstrap/evaluators/relationshipExtraction.d.ts.map +0 -1
  77. package/dist/bootstrap/index.d.ts +0 -64
  78. package/dist/bootstrap/index.d.ts.map +0 -1
  79. package/dist/bootstrap/providers/actionState.d.ts +0 -7
  80. package/dist/bootstrap/providers/actionState.d.ts.map +0 -1
  81. package/dist/bootstrap/providers/actions.d.ts +0 -4
  82. package/dist/bootstrap/providers/actions.d.ts.map +0 -1
  83. package/dist/bootstrap/providers/attachments.d.ts +0 -20
  84. package/dist/bootstrap/providers/attachments.d.ts.map +0 -1
  85. package/dist/bootstrap/providers/capabilities.d.ts +0 -13
  86. package/dist/bootstrap/providers/capabilities.d.ts.map +0 -1
  87. package/dist/bootstrap/providers/character.d.ts +0 -17
  88. package/dist/bootstrap/providers/character.d.ts.map +0 -1
  89. package/dist/bootstrap/providers/choice.d.ts +0 -10
  90. package/dist/bootstrap/providers/choice.d.ts.map +0 -1
  91. package/dist/bootstrap/providers/contacts.d.ts +0 -3
  92. package/dist/bootstrap/providers/contacts.d.ts.map +0 -1
  93. package/dist/bootstrap/providers/contextBench.d.ts +0 -12
  94. package/dist/bootstrap/providers/contextBench.d.ts.map +0 -1
  95. package/dist/bootstrap/providers/entities.d.ts +0 -7
  96. package/dist/bootstrap/providers/entities.d.ts.map +0 -1
  97. package/dist/bootstrap/providers/evaluators.d.ts +0 -3
  98. package/dist/bootstrap/providers/evaluators.d.ts.map +0 -1
  99. package/dist/bootstrap/providers/facts.d.ts +0 -11
  100. package/dist/bootstrap/providers/facts.d.ts.map +0 -1
  101. package/dist/bootstrap/providers/followUps.d.ts +0 -3
  102. package/dist/bootstrap/providers/followUps.d.ts.map +0 -1
  103. package/dist/bootstrap/providers/index.d.ts +0 -16
  104. package/dist/bootstrap/providers/index.d.ts.map +0 -1
  105. package/dist/bootstrap/providers/knowledge.d.ts +0 -9
  106. package/dist/bootstrap/providers/knowledge.d.ts.map +0 -1
  107. package/dist/bootstrap/providers/providers.d.ts +0 -18
  108. package/dist/bootstrap/providers/providers.d.ts.map +0 -1
  109. package/dist/bootstrap/providers/recentMessages.d.ts +0 -14
  110. package/dist/bootstrap/providers/recentMessages.d.ts.map +0 -1
  111. package/dist/bootstrap/providers/relationships.d.ts +0 -15
  112. package/dist/bootstrap/providers/relationships.d.ts.map +0 -1
  113. package/dist/bootstrap/providers/roles.d.ts +0 -18
  114. package/dist/bootstrap/providers/roles.d.ts.map +0 -1
  115. package/dist/bootstrap/providers/settings.d.ts +0 -7
  116. package/dist/bootstrap/providers/settings.d.ts.map +0 -1
  117. package/dist/bootstrap/providers/time.d.ts +0 -16
  118. package/dist/bootstrap/providers/time.d.ts.map +0 -1
  119. package/dist/bootstrap/providers/world.d.ts +0 -7
  120. package/dist/bootstrap/providers/world.d.ts.map +0 -1
  121. package/dist/bootstrap/services/autoCompaction.d.ts +0 -2
  122. package/dist/bootstrap/services/autoCompaction.d.ts.map +0 -1
  123. package/dist/deterministic.d.ts +0 -31
  124. package/dist/deterministic.d.ts.map +0 -1
  125. package/dist/network/sandbox-fetch-proxy.d.ts +0 -25
  126. package/dist/network/sandbox-fetch-proxy.d.ts.map +0 -1
  127. package/dist/packages/typescript/tsconfig.tsbuildinfo +0 -1
  128. package/dist/providers/sessionKeys.d.ts +0 -24
  129. package/dist/providers/sessionKeys.d.ts.map +0 -1
  130. package/dist/request-context.d.ts +0 -143
  131. package/dist/request-context.d.ts.map +0 -1
  132. package/dist/security/sandbox-token-manager.d.ts +0 -33
  133. package/dist/security/sandbox-token-manager.d.ts.map +0 -1
  134. package/dist/services/action-filter.d.ts +0 -195
  135. package/dist/services/action-filter.d.ts.map +0 -1
  136. package/dist/services/bm25.d.ts +0 -51
  137. package/dist/services/bm25.d.ts.map +0 -1
  138. package/dist/services/cosine-similarity.d.ts +0 -5
  139. package/dist/services/cosine-similarity.d.ts.map +0 -1
  140. package/dist/services/triggerScheduling.d.ts +0 -29
  141. package/dist/services/triggerScheduling.d.ts.map +0 -1
  142. package/dist/services/triggerWorker.d.ts +0 -17
  143. package/dist/services/triggerWorker.d.ts.map +0 -1
  144. package/dist/utils/time-format.d.ts +0 -28
  145. package/dist/utils/time-format.d.ts.map +0 -1
  146. package/dist/validation/keywords.d.ts +0 -26
  147. package/dist/validation/keywords.d.ts.map +0 -1
@@ -1,24 +0,0 @@
1
- /**
2
- * Bridges Milady session keys with ElizaOS rooms.
3
- *
4
- * Milady keys: agent:{agentId}:main (DMs), agent:{agentId}:{channel}:group:{id} (groups)
5
- * ElizaOS rooms: per-agent UUIDs via createUniqueUuid(runtime, channelId)
6
- */
7
- import { type Provider, type Room } from "../types";
8
- /**
9
- * Resolve an Milady session key from an ElizaOS room.
10
- *
11
- * DMs -> agent:{agentId}:main
12
- * Groups -> agent:{agentId}:{channel}:group:{groupId}
13
- * Channels -> agent:{agentId}:{channel}:channel:{channelId}
14
- * Threads append :thread:{threadId}
15
- */
16
- export declare function resolveSessionKeyFromRoom(agentId: string, room: Room, meta?: {
17
- threadId?: string;
18
- groupId?: string;
19
- channel?: string;
20
- }): string;
21
- export declare function createSessionKeyProvider(options?: {
22
- defaultAgentId?: string;
23
- }): Provider;
24
- //# sourceMappingURL=sessionKeys.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sessionKeys.d.ts","sourceRoot":"","sources":["../../src/providers/sessionKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,IAAI,EAEV,MAAM,UAAU,CAAC;AA6ClB;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,EACV,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/D,MAAM,CAiBR;AAED,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,QAAQ,CAoDX"}
@@ -1,143 +0,0 @@
1
- /**
2
- * Request context management for per-entity settings in multi-tenant deployments.
3
- *
4
- * Follows the OpenTelemetry ContextManager pattern (same as streaming-context.ts):
5
- * - Interface for context management
6
- * - Platform-specific implementations (Node.js AsyncLocalStorage, Browser Stack)
7
- * - Global singleton configured at startup
8
- *
9
- * This enables sharing a single agent runtime across multiple users while ensuring
10
- * each user's API keys, OAuth tokens, and configuration are used for their specific requests.
11
- *
12
- * @example
13
- * ```typescript
14
- * // Before processing a user's message
15
- * const entitySettings = await prefetchEntitySettings(userId, agentId);
16
- *
17
- * await runWithRequestContext({
18
- * entityId: userId,
19
- * agentId: agentId,
20
- * entitySettings: new Map([
21
- * ['OPENAI_API_KEY', 'sk-user-specific-key'],
22
- * ['TWITTER_ACCESS_TOKEN', 'oauth-token-for-user'],
23
- * ]),
24
- * requestStartTime: Date.now(),
25
- * }, async () => {
26
- * // All getSetting() calls here check entitySettings first
27
- * await runtime.handleMessage(message);
28
- * });
29
- * ```
30
- */
31
- import type { UUID } from "./types";
32
- /**
33
- * The value types that can be stored in entity settings.
34
- * Matches the return type of getSetting().
35
- */
36
- export type EntitySettingValue = string | boolean | number | null;
37
- /**
38
- * Request-scoped context containing per-entity settings.
39
- * Used to isolate user settings across concurrent requests sharing the same runtime.
40
- */
41
- export interface RequestContext {
42
- /**
43
- * The entity (user) ID for this request.
44
- * Used to identify which user's settings should be used.
45
- */
46
- entityId: UUID;
47
- /**
48
- * The agent ID for this request.
49
- * Used for agent-specific entity settings lookup.
50
- */
51
- agentId: UUID;
52
- /**
53
- * Pre-fetched entity-specific settings.
54
- * These take highest priority in getSetting() resolution chain.
55
- *
56
- * The Map contains setting keys and their values:
57
- * - string/boolean/number: The actual setting value to use
58
- * - null: Explicitly unset (use agent default)
59
- * - undefined (key not present): Fall through to agent settings
60
- */
61
- entitySettings: Map<string, EntitySettingValue>;
62
- /**
63
- * Request start timestamp for observability and debugging.
64
- * Useful for tracking request duration and timeout handling.
65
- */
66
- requestStartTime: number;
67
- /**
68
- * Optional trace ID for distributed tracing.
69
- * Can be passed from incoming request headers (e.g., X-Trace-Id).
70
- */
71
- traceId?: string;
72
- /**
73
- * Optional organization ID for multi-tenant deployments.
74
- * Used for logging and auditing purposes.
75
- */
76
- organizationId?: string;
77
- }
78
- /**
79
- * Interface for request context managers.
80
- * Different implementations exist for Node.js (AsyncLocalStorage) and Browser (fallback).
81
- */
82
- export interface IRequestContextManager {
83
- /**
84
- * Run a function with a request context.
85
- * The context will be available to all nested async calls via `active()`.
86
- *
87
- * @param context - The request context to make available, or undefined to clear context
88
- * @param fn - The function to run within the context
89
- * @returns The result of the function
90
- */
91
- run<T>(context: RequestContext | undefined, fn: () => T): T;
92
- /**
93
- * Get the currently active request context.
94
- * Returns undefined if no context is active (e.g., during plugin init).
95
- *
96
- * @returns The current request context or undefined
97
- */
98
- active(): RequestContext | undefined;
99
- }
100
- /**
101
- * Set the global request context manager.
102
- * Called during initialization by platform-specific entry points.
103
- *
104
- * @param manager - The context manager to use globally
105
- */
106
- export declare function setRequestContextManager(manager: IRequestContextManager): void;
107
- /**
108
- * Get the global request context manager.
109
- * Useful for testing or advanced use cases.
110
- *
111
- * @returns The current global request context manager
112
- */
113
- export declare function getRequestContextManager(): IRequestContextManager;
114
- /**
115
- * Run a function with a request context.
116
- * All getSetting() calls within this function will check entitySettings first.
117
- *
118
- * @example
119
- * ```typescript
120
- * const result = await runWithRequestContext({
121
- * entityId: userId as UUID,
122
- * agentId: agentId as UUID,
123
- * entitySettings: new Map([['API_KEY', 'user-specific-key']]),
124
- * requestStartTime: Date.now(),
125
- * }, async () => {
126
- * // Inside here, runtime.getSetting('API_KEY') returns 'user-specific-key'
127
- * return await runtime.processMessage(message);
128
- * });
129
- * ```
130
- *
131
- * @param context - The request context with entitySettings
132
- * @param fn - The function to run with request context
133
- * @returns The result of the function
134
- */
135
- export declare function runWithRequestContext<T>(context: RequestContext | undefined, fn: () => T): T;
136
- /**
137
- * Get the currently active request context.
138
- * Called by getSetting() to check for entity-specific settings.
139
- *
140
- * @returns The current request context or undefined if not in a request
141
- */
142
- export declare function getRequestContext(): RequestContext | undefined;
143
- //# sourceMappingURL=request-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../src/request-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,EAAE,IAAI,CAAC;IAEf;;;OAGG;IACH,OAAO,EAAE,IAAI,CAAC;IAEd;;;;;;;;OAQG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAEhD;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,MAAM,IAAI,cAAc,GAAG,SAAS,CAAC;CACtC;AAqBD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CAEN;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,sBAAsB,CAEjE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,EAAE,EAAE,MAAM,CAAC,GACV,CAAC,CAEH;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAE9D"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Sandbox secret token manager.
3
- *
4
- * Maps real secrets to opaque `stok_` prefixed tokens. Plugins see tokens;
5
- * the fetch proxy resolves them to real values at the network boundary.
6
- */
7
- export declare const SANDBOX_TOKEN_PREFIX = "stok_";
8
- export interface SecretTokenMetadata {
9
- settingKey: string;
10
- secretType: "api_key" | "oauth_token" | "password" | "private_key" | "other";
11
- createdAt: number;
12
- owner?: string;
13
- }
14
- export declare class SandboxTokenManager {
15
- private tokenToEntry;
16
- private realValueToToken;
17
- private settingKeyToToken;
18
- /** Register a secret, returning its stable token. Idempotent per key. */
19
- registerSecret(settingKey: string, realValue: string, metadata?: Partial<SecretTokenMetadata>): string;
20
- resolveToken(token: string): string | null;
21
- getTokenForKey(settingKey: string): string | null;
22
- getTokenForValue(realValue: string): string | null;
23
- getMetadata(token: string): SecretTokenMetadata | null;
24
- /** Replace tokens → real values (outbound). */
25
- detokenizeString(input: string): string;
26
- /** Replace real values → tokens (inbound). Longest-first to avoid partial matches. */
27
- tokenizeString(input: string): string;
28
- static isToken(value: string): boolean;
29
- get size(): number;
30
- clear(): void;
31
- listKeys(): string[];
32
- }
33
- //# sourceMappingURL=sandbox-token-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sandbox-token-manager.d.ts","sourceRoot":"","sources":["../../src/security/sandbox-token-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAE5C,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,OAAO,CAAC;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAQD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,YAAY,CAAiC;IACrD,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,iBAAiB,CAA6B;IAEtD,yEAAyE;IACzE,cAAc,CACZ,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACtC,MAAM;IAgCT,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAI1C,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIjD,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIlD,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI;IAItD,+CAA+C;IAC/C,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAWvC,sFAAsF;IACtF,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAcrC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAItC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,KAAK,IAAI,IAAI;IAMb,QAAQ,IAAI,MAAM,EAAE;CAGrB"}
@@ -1,195 +0,0 @@
1
- /**
2
- * ActionFilterService — dynamically filters which actions are shown to the LLM
3
- * based on relevance to the current message.
4
- *
5
- * Two-tier ranking:
6
- * 1. Vector search: embed action descriptions + similes at registration time.
7
- * At message time, embed the query (user message + context). Use cosine
8
- * similarity to get the top candidates.
9
- * 2. BM25 reranking: rerank the vector-search candidates using BM25
10
- * (term-frequency * inverse-document-frequency). BM25 is especially good
11
- * at matching specific keywords that vector search might miss.
12
- *
13
- * Graceful degradation:
14
- * - If the embedding model is unavailable → BM25-only ranking.
15
- * - If BM25 also fails → return all actions (same as before).
16
- */
17
- import type { Action, IAgentRuntime, Memory, Provider } from "../types/index.ts";
18
- import { Service } from "../types/service.ts";
19
- import type { State } from "../types/state.ts";
20
- declare module "../types/service.ts" {
21
- interface ServiceTypeRegistry {
22
- ACTION_FILTER: "action_filter";
23
- }
24
- }
25
- export interface RankedAction {
26
- action: Action;
27
- /** Cosine similarity against the query embedding (0-1 range, 0 if unavailable). */
28
- vectorScore: number;
29
- /** BM25 score against the query text (0+ range, 0 if unavailable). */
30
- bm25Score: number;
31
- /** Weighted combination of vectorScore and bm25Score, plus momentum boost. */
32
- combinedScore: number;
33
- }
34
- export interface FilterConfig {
35
- /** Master switch — if false the service is a no-op. */
36
- enabled: boolean;
37
- /** Minimum registered action count before filtering kicks in. */
38
- threshold: number;
39
- /** How many candidates to pull from the vector search stage. */
40
- vectorTopK: number;
41
- /** Final number of actions returned after reranking. */
42
- finalTopK: number;
43
- /** Weight for the normalized vector score in the combined score (0-1). */
44
- vectorWeight: number;
45
- /** Weight for the normalized BM25 score in the combined score (0-1). */
46
- bm25Weight: number;
47
- /** Action names that always bypass filtering (in addition to per-action alwaysInclude). */
48
- alwaysIncludeActions: string[];
49
- /** Time window (ms) for conversation momentum decay. */
50
- momentumDecayMs: number;
51
- /** Score boost for recently used actions (0-1). */
52
- momentumBoost: number;
53
- }
54
- export interface FilterMetrics {
55
- /** Total number of filter() invocations. */
56
- filterCalls: number;
57
- /** How many times filtering was actually applied (vs. passthrough). */
58
- filteredCalls: number;
59
- /** How many times we fell back to BM25-only (embedding unavailable). */
60
- bm25OnlyFallbacks: number;
61
- /** How many times we fell back to returning all actions (complete failure). */
62
- fullFallbacks: number;
63
- /** Reported misses — actions that were filtered out but then selected by the LLM. */
64
- missCount: number;
65
- /** Names of missed actions for debugging (bounded ring buffer). */
66
- missedActions: string[];
67
- /** Average combined-score of returned actions (last call). */
68
- lastAvgScore: number;
69
- /** Number of actions in the embedding index. */
70
- indexedActionCount: number;
71
- /** Number of actions whose embedding failed during buildIndex or addAction. */
72
- embedFailureCount: number;
73
- }
74
- /**
75
- * Build a rich text blob from an action's metadata, suitable for both
76
- * embedding and BM25 indexing.
77
- */
78
- export declare function getActionEmbeddingText(action: Action): string;
79
- /**
80
- * Build a text blob from a provider's metadata for BM25 indexing.
81
- * Includes name, description, and relevanceKeywords.
82
- */
83
- export declare function getProviderIndexText(provider: Provider): string;
84
- /**
85
- * Build the query text used for vector + BM25 matching against the action
86
- * index. Includes the user message, recent conversation context, and any
87
- * detected intent keywords.
88
- */
89
- export declare function buildQueryText(message: Memory, state: State): string;
90
- /**
91
- * Normalize an array of scores to [0, 1] using min-max normalization.
92
- * Returns an array of the same length. If all values are the same,
93
- * returns an array of 1s (or 0s if all are 0).
94
- *
95
- * NaN and Infinity values are sanitized to 0 before normalization.
96
- */
97
- export declare function minMaxNormalize(scores: number[]): number[];
98
- export declare class ActionFilterService extends Service {
99
- static serviceType: "action_filter";
100
- capabilityDescription: string;
101
- private actionEmbeddings;
102
- private bm25Index;
103
- /** Separate BM25 index for provider descriptions, used by filterProviders(). */
104
- private providerBM25Index;
105
- private filterConfig;
106
- private recentActions;
107
- private readonly maxRecentActions;
108
- private lastFilteredByRoom;
109
- private readonly maxTrackedRooms;
110
- private metrics;
111
- private embeddingAvailable;
112
- constructor(runtime?: IAgentRuntime, config?: Partial<FilterConfig>);
113
- /** Start the service. Reads ACTION_FILTER_* from runtime settings, then builds indices. */
114
- static start(runtime: IAgentRuntime): Promise<Service>;
115
- stop(): Promise<void>;
116
- /**
117
- * Build (or rebuild) the vector + BM25 index for all registered actions.
118
- * Also builds the provider BM25 index for dynamic provider filtering.
119
- */
120
- buildIndex(runtime: IAgentRuntime): Promise<void>;
121
- /**
122
- * Add a single action to the index at runtime (e.g. when a plugin
123
- * registers a new action after startup).
124
- */
125
- addAction(action: Action, runtime: IAgentRuntime): Promise<void>;
126
- /**
127
- * Remove an action from both indices (e.g. when a plugin is unloaded).
128
- */
129
- removeAction(actionName: string): void;
130
- /**
131
- * Filter the registered actions to the most relevant subset for this message.
132
- *
133
- * Flow:
134
- * 1. If action count <= threshold → return all (same as validate-all path).
135
- * 2. Always-include actions bypass filtering and are prepended to results.
136
- * 3. Vector search: embed query → cosine similarity → top vectorTopK.
137
- * 4. BM25 rerank: score vectorTopK candidates → combine scores.
138
- * 5. Apply momentum boost for recently used actions.
139
- * 6. Return top finalTopK actions.
140
- *
141
- * The returned actions have NOT been validated — the caller (actionsProvider)
142
- * is responsible for running `validate()` on the returned set.
143
- */
144
- filter(runtime: IAgentRuntime, message: Memory, state: State): Promise<Action[]>;
145
- /**
146
- * Score providers by relevance to the current message using BM25.
147
- * Returns provider names sorted by relevance score, highest first.
148
- * Only scores providers that have been indexed (i.e. have a description).
149
- *
150
- * This is used by composeState() to auto-include dynamic providers
151
- * that are relevant to the current message, without requiring explicit
152
- * relevanceKeywords on each provider.
153
- *
154
- * @param providers - The candidate providers to score (typically dynamic providers).
155
- * @param message - The current message being processed.
156
- * @param state - The current state (used to build query context).
157
- * @param topK - Maximum number of provider names to return (default: 5).
158
- * @returns Provider names sorted by descending BM25 relevance score.
159
- */
160
- filterProviders(providers: Provider[], message: Memory, state: State, topK?: number): string[];
161
- /**
162
- * Record that an action was used, so future queries in the same room
163
- * receive a momentum boost for that action.
164
- */
165
- recordActionUse(actionName: string, roomId: string): void;
166
- getMetrics(): FilterMetrics;
167
- reportMiss(actionName: string): void;
168
- hasAction(actionName: string): boolean;
169
- getConfig(): Readonly<FilterConfig>;
170
- /**
171
- * Check whether an action was in the most recent filtered set for a room.
172
- * Returns `true` if filtering was active for that room and the action
173
- * WAS in the filtered set, `false` if it was filtered OUT, or `null` if
174
- * filtering wasn't active for that room (so the caller should skip
175
- * false-negative reporting).
176
- */
177
- wasActionInFilteredSet(actionName: string, roomId: string): boolean | null;
178
- /**
179
- * Override the tracked action set for a room with the exact list that was
180
- * presented in the prompt. This keeps miss detection accurate when callers
181
- * use filter() for ranking but still include additional actions.
182
- */
183
- setRoomActionSet(roomId: string, actionNames: Iterable<string>): void;
184
- /**
185
- * Run the full two-tier ranking pipeline on a set of candidate actions.
186
- * Returns RankedAction[] sorted by combinedScore descending.
187
- */
188
- private rankActions;
189
- /**
190
- * Compute per-action momentum boosts based on recently used actions
191
- * in the same room as the current message.
192
- */
193
- private computeMomentumBoosts;
194
- }
195
- //# sourceMappingURL=action-filter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-filter.d.ts","sourceRoot":"","sources":["../../src/services/action-filter.ts"],"names":[],"mappings":"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"}
@@ -1,51 +0,0 @@
1
- /**
2
- * BM25 index with incremental add/remove support.
3
- *
4
- * Uses the shared Tokenizer from search.ts as the primary text processor
5
- * (Unicode normalization, optional Porter2 stemming, configurable stopwords).
6
- * Falls back to a unicode-aware regex tokenizer for scripts the shared
7
- * Tokenizer doesn't cover (Cyrillic, Arabic, etc.).
8
- *
9
- * Scoring formula:
10
- * score(q, d) = Σ IDF(qi) * (f(qi, d) * (k1 + 1)) / (f(qi, d) + k1 * (1 - b + b * |d| / avgdl))
11
- */
12
- import { type TokenizerOptions } from "../search.ts";
13
- export interface BM25Result {
14
- id: string;
15
- score: number;
16
- }
17
- /**
18
- * BM25 index for text documents with incremental add/remove.
19
- *
20
- * Primary tokenization: shared Tokenizer (stemming, Unicode normalization).
21
- * Fallback: unicode-aware regex split for scripts the Tokenizer strips
22
- * (Cyrillic, Arabic, Devanagari, etc.). The fallback tokens are merged
23
- * with the primary tokens so all scripts are searchable.
24
- */
25
- export declare class BM25Index {
26
- private documents;
27
- private documentFrequencies;
28
- private avgDocLength;
29
- private totalTermCount;
30
- private k1;
31
- private b;
32
- private sharedTokenizer;
33
- private stopWords;
34
- constructor(k1?: number, b?: number, tokenizerOptions?: TokenizerOptions);
35
- addDocument(id: string, text: string): void;
36
- removeDocument(id: string): void;
37
- search(query: string, topK?: number): BM25Result[];
38
- searchSubset(query: string, documentIds: string[], topK?: number): BM25Result[];
39
- get size(): number;
40
- has(id: string): boolean;
41
- private scoreDocument;
42
- private recomputeAvgDocLength;
43
- /**
44
- * Tokenize text using the shared Tokenizer (for English, CJK, Hangul)
45
- * merged with a unicode-aware regex fallback (for Cyrillic, Arabic, etc.).
46
- * This ensures all scripts are searchable while still benefiting from
47
- * the Tokenizer's stemming and normalization for supported scripts.
48
- */
49
- private tokenize;
50
- }
51
- //# sourceMappingURL=bm25.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bm25.d.ts","sourceRoot":"","sources":["../../src/services/bm25.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA+EhE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,mBAAmB,CAAkC;IAC7D,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,SAAS,CAAc;gBAEnB,EAAE,SAAM,EAAE,CAAC,SAAO,EAAE,gBAAgB,CAAC,EAAE,gBAAgB;IAYnE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAwB3C,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAkBhC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE;IAalD,YAAY,CACV,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EAAE,EACrB,IAAI,CAAC,EAAE,MAAM,GACZ,UAAU,EAAE;IAef,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,qBAAqB;IAK7B;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CA2BjB"}
@@ -1,5 +0,0 @@
1
- /** Cosine similarity: dot(a,b) / (||a|| * ||b||). Returns [-1, 1], or 0 for degenerate inputs. */
2
- export declare function cosineSimilarity(a: number[], b: number[]): number;
3
- /** L2-normalize a vector to unit magnitude. Returns a copy for zero vectors. */
4
- export declare function normalizeVector(v: number[]): number[];
5
- //# sourceMappingURL=cosine-similarity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cosine-similarity.d.ts","sourceRoot":"","sources":["../../src/services/cosine-similarity.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAmCjE;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAgBrD"}
@@ -1,29 +0,0 @@
1
- import type { TaskMetadata } from "../types/task";
2
- import { type TriggerConfig } from "../types/trigger";
3
- export declare const MIN_TRIGGER_INTERVAL_MS = 60000;
4
- export declare const MAX_TRIGGER_INTERVAL_MS: number;
5
- export declare const DISABLED_TRIGGER_INTERVAL_MS: number;
6
- interface CronSchedule {
7
- minute: Set<number>;
8
- hour: Set<number>;
9
- dayOfMonth: Set<number>;
10
- month: Set<number>;
11
- dayOfWeek: Set<number>;
12
- }
13
- export declare function normalizeTriggerIntervalMs(intervalMs: number): number;
14
- export declare function parseCronExpression(expression: string): CronSchedule | null;
15
- export declare function computeNextCronRunAtMs(expression: string, fromMs: number, timezone?: string): number | null;
16
- export declare function parseScheduledAtIso(scheduledAtIso: string): number | null;
17
- export interface TriggerTiming {
18
- updatedAt: number;
19
- updateIntervalMs: number;
20
- nextRunAtMs: number;
21
- }
22
- export declare function resolveTriggerTiming(trigger: TriggerConfig, nowMs: number): TriggerTiming | null;
23
- export declare function buildTriggerTaskMetadata(params: {
24
- trigger: TriggerConfig;
25
- nowMs: number;
26
- existingMetadata?: TaskMetadata;
27
- }): TaskMetadata | null;
28
- export {};
29
- //# sourceMappingURL=triggerScheduling.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"triggerScheduling.d.ts","sourceRoot":"","sources":["../../src/services/triggerScheduling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,eAAO,MAAM,uBAAuB,QAA2B,CAAC;AAChE,eAAO,MAAM,4BAA4B,QAA4B,CAAC;AAWtE,UAAU,YAAY;IACpB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxB;AAoED,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAIrE;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAuB3E;AA4DD,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,GAAG,IAAI,CAkBf;AAED,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIzE;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAgDD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,MAAM,GACZ,aAAa,GAAG,IAAI,CActB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,YAAY,CAAC;CACjC,GAAG,YAAY,GAAG,IAAI,CAetB"}
@@ -1,17 +0,0 @@
1
- import type { IAgentRuntime, Task } from "../types";
2
- import { Service } from "../types/service";
3
- export declare const TRIGGER_DISPATCH_TASK_NAME: "TRIGGER_DISPATCH";
4
- export declare const TRIGGER_TASK_TAGS: readonly ["queue", "repeat", "trigger"];
5
- export interface TriggerDispatchExecuteOptions {
6
- source: "scheduler" | "manual";
7
- force?: boolean;
8
- }
9
- export declare function executeTriggerDispatch(runtime: IAgentRuntime, task: Task, options: TriggerDispatchExecuteOptions): Promise<void>;
10
- export declare function registerTriggerDispatchWorker(runtime: IAgentRuntime): void;
11
- export declare class TriggerDispatchService extends Service {
12
- static serviceType: "trigger_dispatch";
13
- capabilityDescription: string;
14
- static start(runtime: IAgentRuntime): Promise<Service>;
15
- stop(): Promise<void>;
16
- }
17
- //# sourceMappingURL=triggerWorker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"triggerWorker.d.ts","sourceRoot":"","sources":["../../src/services/triggerWorker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAEb,IAAI,EAKL,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAO3C,eAAO,MAAM,0BAA0B,EAAG,kBAA2B,CAAC;AACtE,eAAO,MAAM,iBAAiB,yCAA0C,CAAC;AAgBzE,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAoHD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CAyFf;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAa1E;AAED,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,EAAG,kBAAkB,CAAU;IACjD,qBAAqB,SAAqD;WAE7D,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAKtD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAC5B"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Time formatting utilities.
3
- *
4
- * Provides functions for human-readable time display.
5
- *
6
- * @module utils/time-format
7
- */
8
- /**
9
- * Format a timestamp as a relative time string.
10
- *
11
- * @param timestamp - Unix timestamp in milliseconds
12
- * @returns Human-readable relative time string
13
- *
14
- * @example
15
- * ```ts
16
- * formatRelativeTime(Date.now() - 30000) // => "just now"
17
- * formatRelativeTime(Date.now() - 300000) // => "5m ago"
18
- * formatRelativeTime(Date.now() - 7200000) // => "2h ago"
19
- * formatRelativeTime(Date.now() - 86400000) // => "Yesterday"
20
- * formatRelativeTime(Date.now() - 604800000) // => "Jan 15" (or similar)
21
- * ```
22
- */
23
- export declare function formatRelativeTime(timestamp: number): string;
24
- /**
25
- * Format a timestamp as a verbose relative string.
26
- */
27
- export declare function formatTimestamp(timestamp: number): string;
28
- //# sourceMappingURL=time-format.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time-format.d.ts","sourceRoot":"","sources":["../../src/utils/time-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgDH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzD"}
@@ -1,26 +0,0 @@
1
- import type { Memory } from "../types";
2
- /**
3
- * Validates if any of the given keywords are present in the recent message history.
4
- *
5
- * This function checks the current message content and the last 5 messages in the provided
6
- * list for the presence of any of the provided keywords. The check is case-insensitive.
7
- *
8
- * @param message The current message memory
9
- * @param recentMessages List of recent memories
10
- * @param keywords List of keywords to check for
11
- * @returns true if any keyword matches, false otherwise
12
- */
13
- export declare function validateActionKeywords(message: Memory, recentMessages: Memory[], keywords: string[]): boolean;
14
- /**
15
- * Validates if any of the recent message history matches the given regex.
16
- *
17
- * This function checks the current message content and the last 5 messages in the provided
18
- * list against the provided regex pattern.
19
- *
20
- * @param message The current message memory
21
- * @param recentMessages List of recent memories
22
- * @param regex The regular expression to check against
23
- * @returns true if the regex matches any message content, false otherwise
24
- */
25
- export declare function validateActionRegex(message: Memory, recentMessages: Memory[], regex: RegExp): boolean;
26
- //# sourceMappingURL=keywords.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keywords.d.ts","sourceRoot":"","sources":["../../src/validation/keywords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EAAE,EACxB,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAsCT;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EAAE,EACxB,KAAK,EAAE,MAAM,GACZ,OAAO,CA8BT"}