@elizaos/agent 2.0.0-alpha.410 → 2.0.0-alpha.413
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-companion/src/components/companion/CompanionAppView.d.ts.map +1 -1
- package/apps/app-companion/src/components/companion/CompanionAppView.js +5 -5
- package/apps/app-companion/src/components/companion/CompanionView.d.ts.map +1 -1
- package/apps/app-companion/src/components/companion/CompanionView.js +5 -5
- package/package.json +4 -4
- package/packages/agent/src/api/provider-switch-config.d.ts +3 -3
- package/packages/agent/src/api/provider-switch-config.d.ts.map +1 -1
- package/packages/agent/src/auth/account-storage.d.ts +48 -0
- package/packages/agent/src/auth/account-storage.d.ts.map +1 -0
- package/packages/agent/src/auth/account-storage.js +238 -0
- package/packages/agent/src/auth/credentials.d.ts +44 -25
- package/packages/agent/src/auth/credentials.d.ts.map +1 -1
- package/packages/agent/src/auth/credentials.js +175 -137
- package/packages/agent/src/auth/refresh-mutex.d.ts +19 -0
- package/packages/agent/src/auth/refresh-mutex.d.ts.map +1 -0
- package/packages/agent/src/auth/refresh-mutex.js +33 -0
- package/packages/agent/src/config/types.eliza.d.ts +8 -3
- package/packages/agent/src/config/types.eliza.d.ts.map +1 -1
- package/packages/app-core/src/components/apps/launch-history.d.ts.map +1 -1
- package/packages/app-core/src/components/auth/LoginView.d.ts +1 -1
- package/packages/app-core/src/components/auth/LoginView.d.ts.map +1 -1
- package/packages/app-core/src/components/auth/LoginView.js +1 -1
- package/packages/app-core/src/components/pages/AppDetailsView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/AppDetailsView.js +10 -10
- package/packages/app-core/src/components/pages/AppsView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/AppsView.js +1 -0
- package/packages/app-core/src/components/pages/AutomationsView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/AutomationsView.js +0 -1
- package/packages/app-core/src/components/settings/ProviderSwitcher.d.ts.map +1 -1
- package/packages/app-core/src/components/settings/SubscriptionStatus.d.ts +2 -0
- package/packages/app-core/src/components/settings/SubscriptionStatus.d.ts.map +1 -1
- package/packages/app-core/src/onboarding-config.d.ts +2 -2
- package/packages/app-core/src/onboarding-config.d.ts.map +1 -1
- package/packages/app-core/src/services/auth-store.d.ts.map +1 -1
- package/packages/app-core/src/shell/AppWindowRenderer.d.ts.map +1 -1
- package/packages/app-core/src/shell/AppWindowRenderer.js +11 -17
- package/packages/app-core/src/shell/DetachedShellRoot.d.ts.map +1 -1
- package/packages/app-core/src/state/startup-phase-poll.js +1 -1
- package/packages/shared/src/config/types.eliza.d.ts +8 -3
- package/packages/shared/src/config/types.eliza.d.ts.map +1 -1
- package/packages/shared/src/contracts/onboarding.d.ts +10 -2
- package/packages/shared/src/contracts/onboarding.d.ts.map +1 -1
- package/packages/shared/src/contracts/onboarding.js +2 -2
- package/packages/shared/src/contracts/service-routing.d.ts +87 -3
- package/packages/shared/src/contracts/service-routing.d.ts.map +1 -1
- package/packages/shared/src/contracts/service-routing.js +171 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-routing.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/contracts/service-routing.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,OAAO,GACP,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"service-routing.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/contracts/service-routing.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,OAAO,GACP,aAAa,GACb,cAAc,CAAC;AAEnB;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,M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BAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC3B,GACL,oBAAoB,CAwBtB;AAkDD,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,OAAO,GACb,uBAAuB,GAAG,IAAI,CAqBhC;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,GACb,wBAAwB,GAAG,IAAI,CAmBjC;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yCAAmC,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,6BAA6B,0CAAoC,CAAC;AAsF/E,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GACb,mBAAmB,GAAG,IAAI,CA4D5B;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,OAAO,GACb,oBAAoB,GAAG,IAAI,CAe7B;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,kBAAkB,GAAG,IAAI,CAmF3B;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,GACb,oBAAoB,GAAG,IAAI,CAiB7B;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,GACb,sBAAsB,GAAG,IAAI,CA+B/B"}
|
|
@@ -87,7 +87,15 @@ function normalizeServiceTransport(value) {
|
|
|
87
87
|
? value
|
|
88
88
|
: undefined;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
function normalizeServiceRouteAccountStrategy(value) {
|
|
91
|
+
return value === "priority" ||
|
|
92
|
+
value === "round-robin" ||
|
|
93
|
+
value === "least-used" ||
|
|
94
|
+
value === "quota-aware"
|
|
95
|
+
? value
|
|
96
|
+
: undefined;
|
|
97
|
+
}
|
|
98
|
+
export function normalizeLinkedAccountFlagConfig(value) {
|
|
91
99
|
const account = asRecord(value);
|
|
92
100
|
if (!account) {
|
|
93
101
|
return null;
|
|
@@ -106,7 +114,7 @@ export function normalizeLinkedAccountConfig(value) {
|
|
|
106
114
|
...(organizationId ? { organizationId } : {}),
|
|
107
115
|
};
|
|
108
116
|
}
|
|
109
|
-
export function
|
|
117
|
+
export function normalizeLinkedAccountFlagsConfig(value) {
|
|
110
118
|
const accounts = asRecord(value);
|
|
111
119
|
if (!accounts) {
|
|
112
120
|
return null;
|
|
@@ -114,7 +122,7 @@ export function normalizeLinkedAccountsConfig(value) {
|
|
|
114
122
|
const normalizedEntries = [];
|
|
115
123
|
for (const [accountId, accountValue] of Object.entries(accounts)) {
|
|
116
124
|
const trimmedAccountId = accountId.trim();
|
|
117
|
-
const normalizedAccount =
|
|
125
|
+
const normalizedAccount = normalizeLinkedAccountFlagConfig(accountValue);
|
|
118
126
|
if (!trimmedAccountId || !normalizedAccount) {
|
|
119
127
|
continue;
|
|
120
128
|
}
|
|
@@ -123,6 +131,152 @@ export function normalizeLinkedAccountsConfig(value) {
|
|
|
123
131
|
const normalized = Object.fromEntries(normalizedEntries);
|
|
124
132
|
return Object.keys(normalized).length > 0 ? normalized : null;
|
|
125
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* @deprecated Use {@link normalizeLinkedAccountFlagConfig}. Retained
|
|
136
|
+
* as a re-export so older imports keep compiling during the WS1→WS3
|
|
137
|
+
* migration; will be removed once all callers move to the flag-typed
|
|
138
|
+
* helpers (still WS3).
|
|
139
|
+
*/
|
|
140
|
+
export const normalizeLinkedAccountConfig = normalizeLinkedAccountFlagConfig;
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Use {@link normalizeLinkedAccountFlagsConfig}.
|
|
143
|
+
*/
|
|
144
|
+
export const normalizeLinkedAccountsConfig = normalizeLinkedAccountFlagsConfig;
|
|
145
|
+
function isLinkedAccountProviderId(value) {
|
|
146
|
+
return (value === "anthropic-subscription" ||
|
|
147
|
+
value === "openai-codex" ||
|
|
148
|
+
value === "anthropic-api" ||
|
|
149
|
+
value === "openai-api");
|
|
150
|
+
}
|
|
151
|
+
function normalizeLinkedAccountAccountSource(value) {
|
|
152
|
+
return value === "oauth" || value === "api-key" ? value : undefined;
|
|
153
|
+
}
|
|
154
|
+
function normalizeLinkedAccountHealth(value) {
|
|
155
|
+
return value === "ok" ||
|
|
156
|
+
value === "rate-limited" ||
|
|
157
|
+
value === "needs-reauth" ||
|
|
158
|
+
value === "invalid" ||
|
|
159
|
+
value === "unknown"
|
|
160
|
+
? value
|
|
161
|
+
: undefined;
|
|
162
|
+
}
|
|
163
|
+
function normalizeLinkedAccountHealthDetail(value) {
|
|
164
|
+
const detail = asRecord(value);
|
|
165
|
+
if (!detail)
|
|
166
|
+
return undefined;
|
|
167
|
+
const until = typeof detail.until === "number" && Number.isFinite(detail.until)
|
|
168
|
+
? detail.until
|
|
169
|
+
: undefined;
|
|
170
|
+
const lastError = readTrimmedString(detail, "lastError");
|
|
171
|
+
const lastChecked = typeof detail.lastChecked === "number" &&
|
|
172
|
+
Number.isFinite(detail.lastChecked)
|
|
173
|
+
? detail.lastChecked
|
|
174
|
+
: undefined;
|
|
175
|
+
if (until === undefined && !lastError && lastChecked === undefined) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
...(until !== undefined ? { until } : {}),
|
|
180
|
+
...(lastError ? { lastError } : {}),
|
|
181
|
+
...(lastChecked !== undefined ? { lastChecked } : {}),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function normalizeLinkedAccountUsage(value) {
|
|
185
|
+
const usage = asRecord(value);
|
|
186
|
+
if (!usage)
|
|
187
|
+
return undefined;
|
|
188
|
+
const refreshedAt = typeof usage.refreshedAt === "number" && Number.isFinite(usage.refreshedAt)
|
|
189
|
+
? usage.refreshedAt
|
|
190
|
+
: undefined;
|
|
191
|
+
if (refreshedAt === undefined)
|
|
192
|
+
return undefined;
|
|
193
|
+
const sessionPct = typeof usage.sessionPct === "number" && Number.isFinite(usage.sessionPct)
|
|
194
|
+
? usage.sessionPct
|
|
195
|
+
: undefined;
|
|
196
|
+
const weeklyPct = typeof usage.weeklyPct === "number" && Number.isFinite(usage.weeklyPct)
|
|
197
|
+
? usage.weeklyPct
|
|
198
|
+
: undefined;
|
|
199
|
+
const resetsAt = typeof usage.resetsAt === "number" && Number.isFinite(usage.resetsAt)
|
|
200
|
+
? usage.resetsAt
|
|
201
|
+
: undefined;
|
|
202
|
+
return {
|
|
203
|
+
refreshedAt,
|
|
204
|
+
...(sessionPct !== undefined ? { sessionPct } : {}),
|
|
205
|
+
...(weeklyPct !== undefined ? { weeklyPct } : {}),
|
|
206
|
+
...(resetsAt !== undefined ? { resetsAt } : {}),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export function normalizeLinkedAccountRecord(value) {
|
|
210
|
+
const record = asRecord(value);
|
|
211
|
+
if (!record)
|
|
212
|
+
return null;
|
|
213
|
+
const id = readTrimmedString(record, "id");
|
|
214
|
+
const providerId = isLinkedAccountProviderId(record.providerId)
|
|
215
|
+
? record.providerId
|
|
216
|
+
: null;
|
|
217
|
+
const label = readTrimmedString(record, "label");
|
|
218
|
+
const source = normalizeLinkedAccountAccountSource(record.source);
|
|
219
|
+
const createdAt = typeof record.createdAt === "number" && Number.isFinite(record.createdAt)
|
|
220
|
+
? record.createdAt
|
|
221
|
+
: null;
|
|
222
|
+
const enabled = typeof record.enabled === "boolean" ? record.enabled : null;
|
|
223
|
+
const priority = typeof record.priority === "number" && Number.isFinite(record.priority)
|
|
224
|
+
? record.priority
|
|
225
|
+
: null;
|
|
226
|
+
const health = normalizeLinkedAccountHealth(record.health);
|
|
227
|
+
if (!id ||
|
|
228
|
+
!providerId ||
|
|
229
|
+
!label ||
|
|
230
|
+
!source ||
|
|
231
|
+
createdAt === null ||
|
|
232
|
+
enabled === null ||
|
|
233
|
+
priority === null ||
|
|
234
|
+
!health) {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
const lastUsedAt = typeof record.lastUsedAt === "number" && Number.isFinite(record.lastUsedAt)
|
|
238
|
+
? record.lastUsedAt
|
|
239
|
+
: undefined;
|
|
240
|
+
const healthDetail = normalizeLinkedAccountHealthDetail(record.healthDetail);
|
|
241
|
+
const usage = normalizeLinkedAccountUsage(record.usage);
|
|
242
|
+
const organizationId = readTrimmedString(record, "organizationId");
|
|
243
|
+
const userId = readTrimmedString(record, "userId");
|
|
244
|
+
const email = readTrimmedString(record, "email");
|
|
245
|
+
return {
|
|
246
|
+
id,
|
|
247
|
+
providerId,
|
|
248
|
+
label,
|
|
249
|
+
source,
|
|
250
|
+
enabled,
|
|
251
|
+
priority,
|
|
252
|
+
createdAt,
|
|
253
|
+
health,
|
|
254
|
+
...(lastUsedAt !== undefined ? { lastUsedAt } : {}),
|
|
255
|
+
...(healthDetail ? { healthDetail } : {}),
|
|
256
|
+
...(usage ? { usage } : {}),
|
|
257
|
+
...(organizationId ? { organizationId } : {}),
|
|
258
|
+
...(userId ? { userId } : {}),
|
|
259
|
+
...(email ? { email } : {}),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
export function normalizeLinkedAccountsRecords(value) {
|
|
263
|
+
const records = asRecord(value);
|
|
264
|
+
if (!records)
|
|
265
|
+
return null;
|
|
266
|
+
const out = {};
|
|
267
|
+
for (const [id, raw] of Object.entries(records)) {
|
|
268
|
+
const trimmedId = id.trim();
|
|
269
|
+
if (!trimmedId)
|
|
270
|
+
continue;
|
|
271
|
+
const normalized = normalizeLinkedAccountRecord(raw);
|
|
272
|
+
if (!normalized)
|
|
273
|
+
continue;
|
|
274
|
+
if (normalized.id !== trimmedId)
|
|
275
|
+
continue;
|
|
276
|
+
out[trimmedId] = normalized;
|
|
277
|
+
}
|
|
278
|
+
return Object.keys(out).length > 0 ? out : null;
|
|
279
|
+
}
|
|
126
280
|
export function normalizeServiceRouteConfig(value) {
|
|
127
281
|
const route = asRecord(value);
|
|
128
282
|
if (!route) {
|
|
@@ -131,6 +285,16 @@ export function normalizeServiceRouteConfig(value) {
|
|
|
131
285
|
const backend = readTrimmedString(route, "backend");
|
|
132
286
|
const transport = normalizeServiceTransport(route.transport);
|
|
133
287
|
const accountId = readTrimmedString(route, "accountId");
|
|
288
|
+
const accountIdsRaw = Array.isArray(route.accountIds)
|
|
289
|
+
? route.accountIds
|
|
290
|
+
: null;
|
|
291
|
+
const accountIds = accountIdsRaw
|
|
292
|
+
? Array.from(new Set(accountIdsRaw
|
|
293
|
+
.filter((entry) => typeof entry === "string")
|
|
294
|
+
.map((entry) => entry.trim())
|
|
295
|
+
.filter((entry) => entry.length > 0)))
|
|
296
|
+
: undefined;
|
|
297
|
+
const strategy = normalizeServiceRouteAccountStrategy(route.strategy);
|
|
134
298
|
const primaryModel = readTrimmedString(route, "primaryModel");
|
|
135
299
|
const nanoModel = readTrimmedString(route, "nanoModel");
|
|
136
300
|
const smallModel = readTrimmedString(route, "smallModel");
|
|
@@ -147,6 +311,8 @@ export function normalizeServiceRouteConfig(value) {
|
|
|
147
311
|
if (!backend &&
|
|
148
312
|
!transport &&
|
|
149
313
|
!accountId &&
|
|
314
|
+
(!accountIds || accountIds.length === 0) &&
|
|
315
|
+
!strategy &&
|
|
150
316
|
!primaryModel &&
|
|
151
317
|
!nanoModel &&
|
|
152
318
|
!smallModel &&
|
|
@@ -166,6 +332,8 @@ export function normalizeServiceRouteConfig(value) {
|
|
|
166
332
|
...(backend ? { backend } : {}),
|
|
167
333
|
...(transport ? { transport } : {}),
|
|
168
334
|
...(accountId ? { accountId } : {}),
|
|
335
|
+
...(accountIds && accountIds.length > 0 ? { accountIds } : {}),
|
|
336
|
+
...(strategy ? { strategy } : {}),
|
|
169
337
|
...(primaryModel ? { primaryModel } : {}),
|
|
170
338
|
...(nanoModel ? { nanoModel } : {}),
|
|
171
339
|
...(smallModel ? { smallModel } : {}),
|