@elizaos/ui 2.0.0-alpha.197 → 2.0.0-alpha.201
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/apps/app-lifeops/src/actions/calendar.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/calendar.js +99 -6
- package/apps/app-lifeops/src/actions/device-bus.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/device-bus.js +49 -8
- package/apps/app-lifeops/src/actions/health.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/health.js +23 -4
- package/apps/app-lifeops/src/actions/life.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/life.js +9 -2
- package/apps/app-lifeops/src/actions/password-manager.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/password-manager.js +44 -2
- package/apps/app-lifeops/src/actions/remote-desktop.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/remote-desktop.js +41 -2
- package/apps/app-lifeops/src/actions/scheduling.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/scheduling.js +13 -5
- package/apps/app-lifeops/src/actions/website-blocker.d.ts.map +1 -1
- package/apps/app-lifeops/src/actions/website-blocker.js +53 -4
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.d.ts.map +1 -1
- package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.js +44 -3
- package/package.json +1 -1
- package/packages/agent/src/types/trajectory.d.ts +2 -2
- package/packages/agent/src/types/trajectory.d.ts.map +1 -1
- package/packages/app-core/src/api/client-local-inference.d.ts +17 -1
- package/packages/app-core/src/api/client-local-inference.d.ts.map +1 -1
- package/packages/app-core/src/api/client-local-inference.js +18 -0
- package/packages/app-core/src/components/chat/widgets/plugins/agent-orchestrator.d.ts.map +1 -1
- package/packages/app-core/src/components/chat/widgets/plugins/agent-orchestrator.js +11 -12
- package/packages/app-core/src/components/local-inference/LocalInferencePanel.d.ts.map +1 -1
- package/packages/app-core/src/components/local-inference/LocalInferencePanel.js +3 -1
- package/packages/app-core/src/components/local-inference/ProvidersList.d.ts +15 -0
- package/packages/app-core/src/components/local-inference/ProvidersList.d.ts.map +1 -0
- package/packages/app-core/src/components/local-inference/ProvidersList.js +62 -0
- package/packages/app-core/src/components/local-inference/RoutingMatrix.d.ts +13 -0
- package/packages/app-core/src/components/local-inference/RoutingMatrix.d.ts.map +1 -0
- package/packages/app-core/src/components/local-inference/RoutingMatrix.js +105 -0
- package/packages/app-core/src/services/local-inference/handler-registry.d.ts +42 -0
- package/packages/app-core/src/services/local-inference/handler-registry.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/handler-registry.js +127 -0
- package/packages/app-core/src/services/local-inference/providers.d.ts +61 -0
- package/packages/app-core/src/services/local-inference/providers.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/providers.js +231 -0
- package/packages/app-core/src/services/local-inference/routing-preferences.d.ts +29 -0
- package/packages/app-core/src/services/local-inference/routing-preferences.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/routing-preferences.js +71 -0
- package/packages/typescript/src/services/message.d.ts +2 -1
- package/packages/typescript/src/services/message.d.ts.map +1 -1
- package/packages/typescript/src/services/message.js +105 -22
|
@@ -147,21 +147,43 @@ export function extractStandaloneActionParams(actionNames, parsedXml) {
|
|
|
147
147
|
}
|
|
148
148
|
return fragments.join("\n");
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const
|
|
150
|
+
function unwrapPlannerIdentifier(value) {
|
|
151
|
+
const trimmed = value.trim().replace(/^["'`]+|["'`]+$/g, "");
|
|
152
|
+
if (!trimmed) {
|
|
153
|
+
return "";
|
|
154
|
+
}
|
|
155
|
+
const nameMatch = trimmed.match(/^<name\b[^>]*>([\s\S]*?)<\/name>$/i);
|
|
156
|
+
if (nameMatch) {
|
|
157
|
+
return nameMatch[1].trim();
|
|
158
|
+
}
|
|
159
|
+
const actionMatch = trimmed.match(/^<action\b[^>]*>([\s\S]*?)<\/action>$/i);
|
|
160
|
+
if (!actionMatch) {
|
|
161
|
+
return trimmed;
|
|
162
|
+
}
|
|
163
|
+
const inner = actionMatch[1].trim();
|
|
164
|
+
if (!inner) {
|
|
165
|
+
return "";
|
|
166
|
+
}
|
|
167
|
+
const nestedNameMatch = inner.match(/<name\b[^>]*>([\s\S]*?)<\/name>/i);
|
|
168
|
+
if (nestedNameMatch) {
|
|
169
|
+
return nestedNameMatch[1].trim();
|
|
170
|
+
}
|
|
171
|
+
return /<[A-Za-z][^>]*>/.test(inner) ? trimmed : inner;
|
|
172
|
+
}
|
|
173
|
+
export function extractPlannerActionNames(parsedXml) {
|
|
174
|
+
return (() => {
|
|
152
175
|
if (typeof parsedXml.actions === "string") {
|
|
153
176
|
const actionsXml = parsedXml.actions;
|
|
154
|
-
if (
|
|
177
|
+
if (/<action\b[^>]*>/i.test(actionsXml)) {
|
|
155
178
|
const actionEntries = [];
|
|
156
|
-
for (const match of actionsXml.matchAll(/<action
|
|
179
|
+
for (const match of actionsXml.matchAll(/<action\b[^>]*>([\s\S]*?)<\/action>/gi)) {
|
|
157
180
|
const inner = match[1];
|
|
158
|
-
const nameMatch = inner.match(/<name
|
|
159
|
-
const paramsMatch = inner.match(/<params
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
actionEntries.push({ name, paramsXml });
|
|
181
|
+
const nameMatch = inner.match(/<name\b[^>]*>([\s\S]*?)<\/name>/i);
|
|
182
|
+
const paramsMatch = inner.match(/<params\b[^>]*>([\s\S]*?)<\/params>/i);
|
|
183
|
+
const name = unwrapPlannerIdentifier(nameMatch ? nameMatch[1] : match[0]);
|
|
184
|
+
const paramsXml = paramsMatch ? paramsMatch[1].trim() : undefined;
|
|
185
|
+
if (name) {
|
|
186
|
+
actionEntries.push({ name, paramsXml });
|
|
165
187
|
}
|
|
166
188
|
}
|
|
167
189
|
if (actionEntries.length > 0) {
|
|
@@ -178,7 +200,7 @@ function normalizePlannerActions(parsedXml, runtime) {
|
|
|
178
200
|
}
|
|
179
201
|
const commaSplitActions = actionsXml
|
|
180
202
|
.split(",")
|
|
181
|
-
.map((action) => String(action)
|
|
203
|
+
.map((action) => unwrapPlannerIdentifier(String(action)))
|
|
182
204
|
.filter((action) => action.length > 0);
|
|
183
205
|
if (!parsedXml.params || parsedXml.params === "") {
|
|
184
206
|
const assembled = extractStandaloneActionParams(commaSplitActions, parsedXml);
|
|
@@ -190,32 +212,47 @@ function normalizePlannerActions(parsedXml, runtime) {
|
|
|
190
212
|
}
|
|
191
213
|
if (Array.isArray(parsedXml.actions)) {
|
|
192
214
|
return parsedXml.actions
|
|
193
|
-
.map((action) => String(action)
|
|
215
|
+
.map((action) => unwrapPlannerIdentifier(String(action)))
|
|
194
216
|
.filter((action) => action.length > 0);
|
|
195
217
|
}
|
|
196
218
|
return [];
|
|
197
219
|
})();
|
|
220
|
+
}
|
|
221
|
+
function normalizePlannerActions(parsedXml, runtime) {
|
|
222
|
+
const normalizedActions = extractPlannerActionNames(parsedXml);
|
|
198
223
|
const finalActions = !runtime.isActionPlanningEnabled() && normalizedActions.length > 1
|
|
199
224
|
? [normalizedActions[0]]
|
|
200
225
|
: normalizedActions;
|
|
201
226
|
const actionLookup = buildRuntimeActionLookup(runtime);
|
|
202
|
-
const validActions = finalActions.
|
|
227
|
+
const validActions = finalActions.flatMap((actionName) => {
|
|
203
228
|
const normalized = normalizeActionIdentifier(actionName);
|
|
204
229
|
if (!normalized) {
|
|
205
|
-
return
|
|
230
|
+
return [];
|
|
206
231
|
}
|
|
207
232
|
if (PLANNER_CONTROL_ACTIONS.has(normalized)) {
|
|
208
|
-
return
|
|
233
|
+
return [actionName];
|
|
209
234
|
}
|
|
210
235
|
const resolvedAction = resolveRuntimeAction(actionLookup, actionName);
|
|
211
236
|
if (resolvedAction) {
|
|
212
|
-
return
|
|
237
|
+
return [resolvedAction.name];
|
|
238
|
+
}
|
|
239
|
+
const aliasedActionName = PLANNER_ACTION_ALIASES.get(normalized);
|
|
240
|
+
if (aliasedActionName) {
|
|
241
|
+
const resolvedAlias = resolveRuntimeAction(actionLookup, aliasedActionName);
|
|
242
|
+
if (resolvedAlias) {
|
|
243
|
+
runtime.logger.info({
|
|
244
|
+
src: "service:message",
|
|
245
|
+
actionName,
|
|
246
|
+
aliasedActionName: resolvedAlias.name,
|
|
247
|
+
}, "Repaired planner action alias");
|
|
248
|
+
return [resolvedAlias.name];
|
|
249
|
+
}
|
|
213
250
|
}
|
|
214
251
|
runtime.logger.warn({
|
|
215
252
|
src: "service:message",
|
|
216
253
|
actionName,
|
|
217
254
|
}, "Dropping unknown planner action");
|
|
218
|
-
return
|
|
255
|
+
return [];
|
|
219
256
|
});
|
|
220
257
|
if (validActions.length > 0) {
|
|
221
258
|
return validActions;
|
|
@@ -284,7 +321,15 @@ function normalizePlannerProviders(parsedXml, runtime) {
|
|
|
284
321
|
}
|
|
285
322
|
const normalizedProviders = providerNames
|
|
286
323
|
.map((providerName) => {
|
|
287
|
-
const
|
|
324
|
+
const normalizedProviderName = normalizeActionIdentifier(providerName);
|
|
325
|
+
const canonicalProvider = providerLookup.get(normalizedProviderName) ??
|
|
326
|
+
(() => {
|
|
327
|
+
const aliasedProvider = PLANNER_PROVIDER_ALIASES.get(normalizedProviderName);
|
|
328
|
+
if (!aliasedProvider) {
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
return providerLookup.get(normalizeActionIdentifier(aliasedProvider));
|
|
332
|
+
})();
|
|
288
333
|
if (canonicalProvider) {
|
|
289
334
|
return canonicalProvider;
|
|
290
335
|
}
|
|
@@ -478,8 +523,39 @@ function isStopResponse(responseContent) {
|
|
|
478
523
|
responseContent.actions[0].toUpperCase() === "STOP");
|
|
479
524
|
}
|
|
480
525
|
function normalizeActionIdentifier(actionName) {
|
|
481
|
-
return actionName
|
|
526
|
+
return unwrapPlannerIdentifier(actionName).toUpperCase().replace(/_/g, "");
|
|
482
527
|
}
|
|
528
|
+
const PLANNER_ACTION_ALIASES = new Map([
|
|
529
|
+
["BULK_RESCHEDULE_MEETINGS", "PROPOSE_MEETING_TIMES"],
|
|
530
|
+
["SCHEDULE_MEETING", "CALENDAR_ACTION"],
|
|
531
|
+
["RESCHEDULE_MEETINGS", "CALENDAR_ACTION"],
|
|
532
|
+
["CREATE_EVENT", "CALENDAR_ACTION"],
|
|
533
|
+
["CREATE_RECURRING_EVENT", "CALENDAR_ACTION"],
|
|
534
|
+
["CALENDAR_CREATE_RECURRING_EVENT", "CALENDAR_ACTION"],
|
|
535
|
+
["SCHEDULE_RECURRING_EVENT", "CALENDAR_ACTION"],
|
|
536
|
+
["SCHEDULE_RECURRING_MEETING", "CALENDAR_ACTION"],
|
|
537
|
+
["SCHEDULE_RECURRING", "CALENDAR_ACTION"],
|
|
538
|
+
["BOOK_TRAVEL", "CALL_EXTERNAL"],
|
|
539
|
+
["CAPTURE_TRAVEL_PREFERENCES", "UPDATE_OWNER_PROFILE"],
|
|
540
|
+
["CAPTURE_BOOKING_PREFERENCES", "UPDATE_OWNER_PROFILE"],
|
|
541
|
+
["SET_PREFERENCES", "UPDATE_OWNER_PROFILE"],
|
|
542
|
+
["SET_TRAVEL_PREFERENCES", "UPDATE_OWNER_PROFILE"],
|
|
543
|
+
["CREATE_FOLLOWUP", "INBOX"],
|
|
544
|
+
["GET_PENDING_ASSETS", "INBOX"],
|
|
545
|
+
["GET_PENDING_ITEMS", "INBOX"],
|
|
546
|
+
["PROPOSE_GROUP_CHAT_HANDOFF", "INBOX"],
|
|
547
|
+
["SET_MULTI_DEVICE_MEETING_REMINDER", "PUBLISH_DEVICE_INTENT"],
|
|
548
|
+
["HANDLE_CANCELLATION_FEE", "PUBLISH_DEVICE_INTENT"],
|
|
549
|
+
["GET_ID_STATUS", "PUBLISH_DEVICE_INTENT"],
|
|
550
|
+
["REQUEST_UPLOAD", "LIFEOPS_COMPUTER_USE"],
|
|
551
|
+
].map(([from, to]) => [
|
|
552
|
+
normalizeActionIdentifier(from),
|
|
553
|
+
to,
|
|
554
|
+
]));
|
|
555
|
+
const PLANNER_PROVIDER_ALIASES = new Map([
|
|
556
|
+
["DOCUMENT_LOOKUP", "ATTACHMENTS"],
|
|
557
|
+
["INBOX_TRIAGE", "inboxTriage"],
|
|
558
|
+
].map(([from, to]) => [normalizeActionIdentifier(from), to]));
|
|
483
559
|
const PROVIDER_FOLLOWUP_PASSIVE_ACTIONS = new Set(["REPLY", "RESPOND", "NONE"].map(normalizeActionIdentifier));
|
|
484
560
|
function shouldRunProviderFollowup(responseContent) {
|
|
485
561
|
if (!responseContent?.providers?.length) {
|
|
@@ -735,7 +811,7 @@ function suppressesPostActionContinuation(runtime, responseContent) {
|
|
|
735
811
|
* text), IGNORE (no user-visible response), or STOP (terminal). Also skipped
|
|
736
812
|
* when `text` is empty.
|
|
737
813
|
*/
|
|
738
|
-
export function shouldEmitPlannerPreamble(responseContent) {
|
|
814
|
+
export function shouldEmitPlannerPreamble(runtime, responseContent) {
|
|
739
815
|
if (!responseContent)
|
|
740
816
|
return false;
|
|
741
817
|
const text = typeof responseContent.text === "string" ? responseContent.text.trim() : "";
|
|
@@ -746,6 +822,11 @@ export function shouldEmitPlannerPreamble(responseContent) {
|
|
|
746
822
|
: "";
|
|
747
823
|
if (firstAction.length === 0)
|
|
748
824
|
return false;
|
|
825
|
+
const resolvedAction = (runtime.actions ?? []).find((action) => normalizeActionIdentifier(action.name) === firstAction &&
|
|
826
|
+
action.suppressPostActionContinuation === true);
|
|
827
|
+
if (resolvedAction) {
|
|
828
|
+
return false;
|
|
829
|
+
}
|
|
749
830
|
return (firstAction !== normalizeActionIdentifier("REPLY") &&
|
|
750
831
|
firstAction !== normalizeActionIdentifier("IGNORE") &&
|
|
751
832
|
firstAction !== normalizeActionIdentifier("STOP"));
|
|
@@ -1883,7 +1964,9 @@ export class DefaultMessageService {
|
|
|
1883
1964
|
// Surface the planner's text before action handlers run, so the
|
|
1884
1965
|
// user sees the agent's plan rather than silence. The full
|
|
1885
1966
|
// responseContent is already persisted as a memory above.
|
|
1886
|
-
if (callback &&
|
|
1967
|
+
if (callback &&
|
|
1968
|
+
!isBenchmarkMode(state) &&
|
|
1969
|
+
shouldEmitPlannerPreamble(runtime, responseContent)) {
|
|
1887
1970
|
await callback({
|
|
1888
1971
|
...responseContent,
|
|
1889
1972
|
actions: [],
|