@elizaos/agent 2.0.0-alpha.422 → 2.0.0-alpha.425

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 (72) hide show
  1. package/package.json +4 -4
  2. package/packages/agent/src/api/accounts-routes.d.ts +11 -3
  3. package/packages/agent/src/api/accounts-routes.d.ts.map +1 -1
  4. package/packages/agent/src/api/accounts-routes.js +70 -123
  5. package/packages/agent/src/api/subscription-routes.js +27 -23
  6. package/packages/agent/src/runtime/plugin-role-gating.js +4 -3
  7. package/packages/app-core/src/api/client-agent.d.ts +63 -1
  8. package/packages/app-core/src/api/client-agent.d.ts.map +1 -1
  9. package/packages/app-core/src/api/client-agent.js +51 -0
  10. package/packages/app-core/src/components/accounts/AccountCard.d.ts +30 -0
  11. package/packages/app-core/src/components/accounts/AccountCard.d.ts.map +1 -0
  12. package/packages/app-core/src/components/accounts/AccountCard.js +183 -0
  13. package/packages/app-core/src/components/accounts/AccountList.d.ts +15 -0
  14. package/packages/app-core/src/components/accounts/AccountList.d.ts.map +1 -0
  15. package/packages/app-core/src/components/accounts/AccountList.js +80 -0
  16. package/packages/app-core/src/components/accounts/AddAccountDialog.d.ts +33 -0
  17. package/packages/app-core/src/components/accounts/AddAccountDialog.d.ts.map +1 -0
  18. package/packages/app-core/src/components/accounts/AddAccountDialog.js +277 -0
  19. package/packages/app-core/src/components/accounts/RotationStrategyPicker.d.ts +16 -0
  20. package/packages/app-core/src/components/accounts/RotationStrategyPicker.d.ts.map +1 -0
  21. package/packages/app-core/src/components/accounts/RotationStrategyPicker.js +50 -0
  22. package/packages/app-core/src/components/pages/PluginsView.d.ts.map +1 -1
  23. package/packages/app-core/src/components/pages/PluginsView.js +3 -34
  24. package/packages/app-core/src/components/settings/ProviderSwitcher.d.ts.map +1 -1
  25. package/packages/app-core/src/components/settings/ProviderSwitcher.js +2 -1
  26. package/packages/app-core/src/hooks/useAccounts.d.ts +41 -0
  27. package/packages/app-core/src/hooks/useAccounts.d.ts.map +1 -0
  28. package/packages/app-core/src/hooks/useAccounts.js +250 -0
  29. package/packages/typescript/src/features/basic-capabilities/index.d.ts +1 -0
  30. package/packages/typescript/src/features/basic-capabilities/index.d.ts.map +1 -1
  31. package/packages/typescript/src/features/basic-capabilities/index.js +4 -0
  32. package/packages/typescript/src/features/index.d.ts.map +1 -1
  33. package/packages/typescript/src/features/index.js +2 -7
  34. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/core-status.d.ts +14 -0
  35. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/core-status.d.ts.map +1 -0
  36. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/core-status.js +48 -0
  37. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/create.d.ts +32 -0
  38. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/create.d.ts.map +1 -0
  39. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/create.js +502 -0
  40. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/eject.d.ts +16 -0
  41. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/eject.d.ts.map +1 -0
  42. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/eject.js +47 -0
  43. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/install.d.ts +18 -0
  44. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/install.d.ts.map +1 -0
  45. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/install.js +59 -0
  46. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list-ejected.d.ts +14 -0
  47. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list-ejected.d.ts.map +1 -0
  48. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list-ejected.js +31 -0
  49. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list.d.ts +14 -0
  50. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list.d.ts.map +1 -0
  51. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list.js +51 -0
  52. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/reinject.d.ts +15 -0
  53. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/reinject.d.ts.map +1 -0
  54. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/reinject.js +43 -0
  55. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/search.d.ts +15 -0
  56. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/search.d.ts.map +1 -0
  57. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/search.js +52 -0
  58. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/sync.d.ts +15 -0
  59. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/sync.d.ts.map +1 -0
  60. package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/sync.js +48 -0
  61. package/packages/typescript/src/features/plugin-manager/actions/plugin.d.ts +25 -0
  62. package/packages/typescript/src/features/plugin-manager/actions/plugin.d.ts.map +1 -0
  63. package/packages/typescript/src/features/plugin-manager/actions/plugin.js +439 -0
  64. package/packages/typescript/src/features/plugin-manager/index.d.ts +2 -0
  65. package/packages/typescript/src/features/plugin-manager/index.d.ts.map +1 -1
  66. package/packages/typescript/src/features/plugin-manager/index.js +7 -10
  67. package/packages/typescript/src/features/plugin-manager/security.d.ts +33 -0
  68. package/packages/typescript/src/features/plugin-manager/security.d.ts.map +1 -0
  69. package/packages/typescript/src/features/plugin-manager/security.js +80 -0
  70. package/packages/app-core/src/runtime/plugin-manager-guard.d.ts +0 -12
  71. package/packages/app-core/src/runtime/plugin-manager-guard.d.ts.map +0 -1
  72. package/packages/app-core/src/runtime/plugin-manager-guard.js +0 -82
@@ -0,0 +1,250 @@
1
+ /**
2
+ * useAccounts — fetches and mutates the multi-account credential pool
3
+ * surfaced by `/api/accounts/*`.
4
+ *
5
+ * Polls `client.listAccounts()` on a configurable interval (default 30s)
6
+ * to keep usage / health rows fresh. Each mutation routes through the
7
+ * matching client method, applies an optimistic local update where safe,
8
+ * and reconciles after the server response. Failures bubble through
9
+ * `setActionNotice` so the parent settings panel can surface them.
10
+ */
11
+ import { useCallback, useEffect, useRef, useState } from "react";
12
+ import { client } from "../api";
13
+ const DEFAULT_POLL_MS = 30_000;
14
+ function describeError(prefix, err) {
15
+ const message = err instanceof Error && err.message.trim()
16
+ ? `${prefix}: ${err.message}`
17
+ : prefix;
18
+ return message;
19
+ }
20
+ function replaceAccount(list, providerId, next) {
21
+ if (!list)
22
+ return list;
23
+ return {
24
+ providers: list.providers.map((p) => {
25
+ if (p.providerId !== providerId)
26
+ return p;
27
+ const existing = p.accounts.find((a) => a.id === next.id);
28
+ const merged = existing
29
+ ? { ...existing, ...next }
30
+ : { ...next, hasCredential: true };
31
+ return {
32
+ ...p,
33
+ accounts: p.accounts
34
+ .map((a) => (a.id === next.id ? merged : a))
35
+ .sort((a, b) => a.priority - b.priority),
36
+ };
37
+ }),
38
+ };
39
+ }
40
+ export function useAccounts(opts = {}) {
41
+ const { setActionNotice, pollMs = DEFAULT_POLL_MS } = opts;
42
+ const [data, setData] = useState(null);
43
+ const [loading, setLoading] = useState(true);
44
+ const [saving, setSaving] = useState(() => new Set());
45
+ const mountedRef = useRef(true);
46
+ const notify = useCallback((prefix, err) => {
47
+ setActionNotice?.(describeError(prefix, err), "error", 6000);
48
+ }, [setActionNotice]);
49
+ const refresh = useCallback(async () => {
50
+ try {
51
+ const next = await client.listAccounts();
52
+ if (!mountedRef.current)
53
+ return;
54
+ setData(next);
55
+ }
56
+ catch (err) {
57
+ if (!mountedRef.current)
58
+ return;
59
+ notify("Failed to load accounts", err);
60
+ }
61
+ finally {
62
+ if (mountedRef.current)
63
+ setLoading(false);
64
+ }
65
+ }, [notify]);
66
+ const markSaving = useCallback((id, on) => {
67
+ setSaving((prev) => {
68
+ const next = new Set(prev);
69
+ if (on)
70
+ next.add(id);
71
+ else
72
+ next.delete(id);
73
+ return next;
74
+ });
75
+ }, []);
76
+ const createApiKey = useCallback(async (providerId, body) => {
77
+ const key = `create:${providerId}`;
78
+ markSaving(key, true);
79
+ try {
80
+ const created = await client.createApiKeyAccount(providerId, body);
81
+ setData((prev) => {
82
+ if (!prev)
83
+ return prev;
84
+ return {
85
+ providers: prev.providers.map((p) => {
86
+ if (p.providerId !== providerId)
87
+ return p;
88
+ const accounts = [
89
+ ...p.accounts,
90
+ { ...created, hasCredential: true },
91
+ ].sort((a, b) => a.priority - b.priority);
92
+ return { ...p, accounts };
93
+ }),
94
+ };
95
+ });
96
+ await refresh();
97
+ }
98
+ catch (err) {
99
+ notify("Failed to create account", err);
100
+ throw err;
101
+ }
102
+ finally {
103
+ markSaving(key, false);
104
+ }
105
+ }, [markSaving, notify, refresh]);
106
+ const patch = useCallback(async (providerId, accountId, body) => {
107
+ markSaving(accountId, true);
108
+ const previous = data;
109
+ // Optimistic update for safe fields.
110
+ setData((prev) => {
111
+ if (!prev)
112
+ return prev;
113
+ return {
114
+ providers: prev.providers.map((p) => {
115
+ if (p.providerId !== providerId)
116
+ return p;
117
+ return {
118
+ ...p,
119
+ accounts: p.accounts
120
+ .map((a) => (a.id === accountId ? { ...a, ...body } : a))
121
+ .sort((x, y) => x.priority - y.priority),
122
+ };
123
+ }),
124
+ };
125
+ });
126
+ try {
127
+ const updated = await client.patchAccount(providerId, accountId, body);
128
+ setData((prev) => replaceAccount(prev, providerId, updated));
129
+ }
130
+ catch (err) {
131
+ setData(previous);
132
+ notify("Failed to update account", err);
133
+ throw err;
134
+ }
135
+ finally {
136
+ markSaving(accountId, false);
137
+ }
138
+ }, [data, markSaving, notify]);
139
+ const remove = useCallback(async (providerId, accountId) => {
140
+ markSaving(accountId, true);
141
+ try {
142
+ await client.deleteAccount(providerId, accountId);
143
+ setData((prev) => {
144
+ if (!prev)
145
+ return prev;
146
+ return {
147
+ providers: prev.providers.map((p) => p.providerId === providerId
148
+ ? {
149
+ ...p,
150
+ accounts: p.accounts.filter((a) => a.id !== accountId),
151
+ }
152
+ : p),
153
+ };
154
+ });
155
+ }
156
+ catch (err) {
157
+ notify("Failed to delete account", err);
158
+ throw err;
159
+ }
160
+ finally {
161
+ markSaving(accountId, false);
162
+ }
163
+ }, [markSaving, notify]);
164
+ const test = useCallback(async (providerId, accountId) => {
165
+ markSaving(`test:${accountId}`, true);
166
+ try {
167
+ const result = await client.testAccount(providerId, accountId);
168
+ if (result.ok) {
169
+ setActionNotice?.(`Connection OK${typeof result.latencyMs === "number"
170
+ ? ` (${result.latencyMs}ms)`
171
+ : ""}`, "success", 3000);
172
+ }
173
+ else {
174
+ setActionNotice?.(`Connection failed: ${result.error ?? `HTTP ${result.status ?? "?"}`}`, "error", 6000);
175
+ }
176
+ return result;
177
+ }
178
+ catch (err) {
179
+ notify("Failed to test account", err);
180
+ throw err;
181
+ }
182
+ finally {
183
+ markSaving(`test:${accountId}`, false);
184
+ }
185
+ }, [markSaving, notify, setActionNotice]);
186
+ const refreshUsage = useCallback(async (providerId, accountId) => {
187
+ markSaving(`usage:${accountId}`, true);
188
+ try {
189
+ const result = await client.refreshAccountUsage(providerId, accountId);
190
+ setData((prev) => replaceAccount(prev, providerId, result.account));
191
+ }
192
+ catch (err) {
193
+ notify("Failed to refresh usage", err);
194
+ throw err;
195
+ }
196
+ finally {
197
+ markSaving(`usage:${accountId}`, false);
198
+ }
199
+ }, [markSaving, notify]);
200
+ const setStrategy = useCallback(async (providerId, strategy) => {
201
+ const key = `strategy:${providerId}`;
202
+ markSaving(key, true);
203
+ const previous = data;
204
+ setData((prev) => {
205
+ if (!prev)
206
+ return prev;
207
+ return {
208
+ providers: prev.providers.map((p) => p.providerId === providerId ? { ...p, strategy } : p),
209
+ };
210
+ });
211
+ try {
212
+ await client.patchProviderStrategy(providerId, { strategy });
213
+ }
214
+ catch (err) {
215
+ setData(previous);
216
+ notify("Failed to update rotation strategy", err);
217
+ throw err;
218
+ }
219
+ finally {
220
+ markSaving(key, false);
221
+ }
222
+ }, [data, markSaving, notify]);
223
+ useEffect(() => {
224
+ mountedRef.current = true;
225
+ void refresh();
226
+ return () => {
227
+ mountedRef.current = false;
228
+ };
229
+ }, [refresh]);
230
+ useEffect(() => {
231
+ if (pollMs <= 0)
232
+ return;
233
+ const id = setInterval(() => {
234
+ void refresh();
235
+ }, pollMs);
236
+ return () => clearInterval(id);
237
+ }, [pollMs, refresh]);
238
+ return {
239
+ data,
240
+ loading,
241
+ saving,
242
+ refresh,
243
+ createApiKey,
244
+ patch,
245
+ remove,
246
+ test,
247
+ refreshUsage,
248
+ setStrategy,
249
+ };
250
+ }
@@ -20,6 +20,7 @@ export { advancedActions, advancedCapabilities, advancedEvaluators, advancedProv
20
20
  export * from "../advanced-capabilities/providers/index.ts";
21
21
  export * from "../autonomy/index.ts";
22
22
  export { coreCapabilities, pluginManagerCapability, secretsCapability, trustCapability, } from "../index.ts";
23
+ export { createPluginAction, hasAdminAccess, hasOwnerAccess, pluginAction, type PluginMode, type SecurityDeps, } from "../plugin-manager/index.ts";
23
24
  type MediaData = {
24
25
  data: Buffer;
25
26
  mediaType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../typescript/src/features/basic-capabilities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqBH,OAAO,KAAK,EAOX,SAAS,EAET,aAAa,EAGb,KAAK,EACL,MAAM,EACN,cAAc,EAGd,MAAM,EAEN,IAAI,EAIJ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAY1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAEN,oBAAoB,EAIpB,MAAM,mCAAmC,CAAC;AAY3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAE7D,OAAO,EACN,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,mCAAmC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B,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oDAAoD;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sEAAsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yFAAyF;IACzF,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAID,QAAA,MAAM,oBAAoB;;;gBAGP,SAAS,EAAE;cACW,YAAY,EAAE;;CAEtD,CAAC;AAGF,OAAO,EAAE,oBAAoB,IAAI,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;AAE9E;;;GAGG;AACH,wBAAgB,6BAA6B,CAC5C,MAAM,GAAE,gBAAqB,GAC3B,MAAM,CA6DR;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../typescript/src/features/basic-capabilities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqBH,OAAO,KAAK,EAOX,SAAS,EAET,aAAa,EAGb,KAAK,EACL,MAAM,EACN,cAAc,EAGd,MAAM,EAEN,IAAI,EAIJ,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAY1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAEN,oBAAoB,EAIpB,MAAM,mCAAmC,CAAC;AAY3C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAE7D,OAAO,EACN,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,mCAAmC,CAAC;AAC3C,cAAc,6CAA6C,CAAC;AAE5D,cAAc,sBAAsB,CAAC;AAErC,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,GACf,MAAM,aAAa,C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,CAAC,EAAE,OAAO,CAAC;IAChC,oDAAoD;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sEAAsE;IACtE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yFAAyF;IACzF,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAID,QAAA,MAAM,oBAAoB;;;gBAGP,SAAS,EAAE;cACW,YAAY,EAAE;;CAEtD,CAAC;AAGF,OAAO,EAAE,oBAAoB,IAAI,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;AAE9E;;;GAGG;AACH,wBAAgB,6BAA6B,CAC5C,MAAM,GAAE,gBAAqB,GAC3B,MAAM,CA6DR;AAED,eAAe,iBAAiB,CAAC"}
@@ -46,6 +46,10 @@ export * from "../advanced-capabilities/providers/index.js";
46
46
  export * from "../autonomy/index.js";
47
47
  // Re-export core capabilities (trust, secrets, plugin-manager)
48
48
  export { coreCapabilities, pluginManagerCapability, secretsCapability, trustCapability, } from "../index.js";
49
+ // Re-export plugin-manager security helpers (used by other plugins like
50
+ // plugin-app-control to gate owner/admin-only actions without taking a dep
51
+ // on @elizaos/agent, which would create a layer cycle).
52
+ export { createPluginAction, hasAdminAccess, hasOwnerAccess, pluginAction, } from "../plugin-manager/index.js";
49
53
  function escapeRegex(value) {
50
54
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
51
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../typescript/src/features/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA0BzD,QAAA,MA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,EAAE;iBAOV,MAAM,EAAE;oBAKR,SAAS,EAAE;kBA8BX,YAAY,EAAE;sBACC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;;;mBAgC5C,QAAQ,EAAE;iBAMV,MAAM,EAAE;kBAoBR,YAAY,EAAE;;;mBAmBd,QAAQ,EAAE;iBACY,MAAM,EAAE;kBAc9B,YAAY,EAAE;;CA8CnB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -113,19 +113,14 @@ const secretsCapability = {
113
113
  ],
114
114
  };
115
115
  // ─── Plugin Manager ───────────────────────────────────────────────────────────
116
- import { CoreManagerService, coreStatusAction, getPluginDetailsAction, listEjectedPluginsAction, PluginManagerService, pluginConfigurationStatusProvider, pluginStateProvider, registryPluginsProvider, searchPluginAction, } from "./plugin-manager/index.js";
116
+ import { CoreManagerService, pluginAction, PluginManagerService, pluginConfigurationStatusProvider, pluginStateProvider, registryPluginsProvider, } from "./plugin-manager/index.js";
117
117
  const pluginManagerCapability = {
118
118
  providers: [
119
119
  pluginConfigurationStatusProvider,
120
120
  pluginStateProvider,
121
121
  registryPluginsProvider,
122
122
  ],
123
- actions: [
124
- coreStatusAction,
125
- searchPluginAction,
126
- getPluginDetailsAction,
127
- listEjectedPluginsAction,
128
- ],
123
+ actions: [pluginAction],
129
124
  services: [
130
125
  {
131
126
  serviceType: "plugin_manager",
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module features/plugin-manager/actions/plugin-handlers/core-status
3
+ *
4
+ * `core_status` sub-mode of the unified PLUGIN action. Reports whether
5
+ * `@elizaos/core` is currently ejected or running from the npm package.
6
+ */
7
+ import type { ActionResult, HandlerCallback } from "../../../../types/components.ts";
8
+ import type { IAgentRuntime } from "../../../../types/runtime.ts";
9
+ export interface CoreStatusInput {
10
+ runtime: IAgentRuntime;
11
+ callback?: HandlerCallback;
12
+ }
13
+ export declare function runCoreStatus({ runtime, callback, }: CoreStatusInput): Promise<ActionResult>;
14
+ //# sourceMappingURL=core-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-status.d.ts","sourceRoot":"","sources":["../../../../../../../../../typescript/src/features/plugin-manager/actions/plugin-handlers/core-status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,eAAe,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,wBAAsB,aAAa,CAAC,EACnC,OAAO,EACP,QAAQ,GACR,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CA6CzC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @module features/plugin-manager/actions/plugin-handlers/core-status
3
+ *
4
+ * `core_status` sub-mode of the unified PLUGIN action. Reports whether
5
+ * `@elizaos/core` is currently ejected or running from the npm package.
6
+ */
7
+ export async function runCoreStatus({ runtime, callback, }) {
8
+ const service = runtime.getService("core_manager");
9
+ if (!service) {
10
+ const text = "Core manager service not available";
11
+ await callback?.({ text });
12
+ return { success: false, text };
13
+ }
14
+ const status = await service.getCoreStatus();
15
+ const lines = [];
16
+ if (status.ejected) {
17
+ lines.push(`Core is EJECTED at ${status.ejectedPath}`);
18
+ lines.push(`Version: ${status.version}`);
19
+ lines.push(`Commit: ${status.commitHash || "unknown"}`);
20
+ lines.push(`Local changes: ${status.localChanges ? "yes" : "no"}`);
21
+ if (status.upstream) {
22
+ lines.push(`Upstream: ${status.upstream.gitUrl}#${status.upstream.branch}`);
23
+ lines.push(`Last sync: ${status.upstream.lastSyncAt || "never"}`);
24
+ }
25
+ }
26
+ else {
27
+ lines.push(`Core is using NPM package (v${status.npmVersion}). Not ejected.`);
28
+ }
29
+ const text = lines.join("\n");
30
+ await callback?.({ text });
31
+ return {
32
+ success: true,
33
+ text,
34
+ values: { mode: "core_status", ejected: status.ejected },
35
+ data: {
36
+ ejected: status.ejected,
37
+ ejectedPath: status.ejectedPath,
38
+ monorepoPath: status.monorepoPath,
39
+ corePackagePath: status.corePackagePath,
40
+ coreDistPath: status.coreDistPath,
41
+ version: status.version,
42
+ npmVersion: status.npmVersion,
43
+ commitHash: status.commitHash ?? undefined,
44
+ localChanges: status.localChanges,
45
+ upstream: status.upstream ?? undefined,
46
+ },
47
+ };
48
+ }
@@ -0,0 +1,32 @@
1
+ import type { ActionResult, HandlerCallback } from "../../../../types/components.ts";
2
+ import type { Memory } from "../../../../types/memory.ts";
3
+ import type { IAgentRuntime } from "../../../../types/runtime.ts";
4
+ export declare const PLUGIN_CREATE_INTENT_TAG = "plugin-create-intent";
5
+ export interface PluginCreateInput {
6
+ runtime: IAgentRuntime;
7
+ message: Memory;
8
+ options?: Record<string, unknown>;
9
+ callback?: HandlerCallback;
10
+ intent?: string;
11
+ choice?: string;
12
+ editTarget?: string;
13
+ repoRoot: string;
14
+ }
15
+ interface PluginChoice {
16
+ key: string;
17
+ label: string;
18
+ pluginName?: string;
19
+ pluginPath?: string;
20
+ }
21
+ export interface PluginCreateIntentMetadata {
22
+ roomId: string;
23
+ intent: string;
24
+ choices: PluginChoice[];
25
+ intentCreatedAt: string;
26
+ [key: string]: object | string | number | boolean | null | undefined;
27
+ }
28
+ export declare function isPluginCreateChoiceReply(text: string): boolean;
29
+ export declare function runCreate({ runtime, message, options, callback, intent: explicitIntent, choice: explicitChoice, editTarget, repoRoot, }: PluginCreateInput): Promise<ActionResult>;
30
+ export declare function hasPendingPluginCreateIntent(runtime: IAgentRuntime, roomId: string): Promise<boolean>;
31
+ export {};
32
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../../../../../../typescript/src/features/plugin-manager/actions/plugin-handlers/create.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,eAAe,EAEf,MA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