@elizaos/agent 2.0.0-alpha.421 → 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.
- package/package.json +4 -4
- package/packages/agent/src/api/accounts-routes.d.ts +11 -3
- package/packages/agent/src/api/accounts-routes.d.ts.map +1 -1
- package/packages/agent/src/api/accounts-routes.js +70 -123
- package/packages/agent/src/api/subscription-routes.js +27 -23
- package/packages/agent/src/runtime/plugin-role-gating.js +4 -3
- package/packages/app-core/src/api/client-agent.d.ts +63 -1
- package/packages/app-core/src/api/client-agent.d.ts.map +1 -1
- package/packages/app-core/src/api/client-agent.js +51 -0
- package/packages/app-core/src/components/accounts/AccountCard.d.ts +30 -0
- package/packages/app-core/src/components/accounts/AccountCard.d.ts.map +1 -0
- package/packages/app-core/src/components/accounts/AccountCard.js +183 -0
- package/packages/app-core/src/components/accounts/AccountList.d.ts +15 -0
- package/packages/app-core/src/components/accounts/AccountList.d.ts.map +1 -0
- package/packages/app-core/src/components/accounts/AccountList.js +80 -0
- package/packages/app-core/src/components/accounts/AddAccountDialog.d.ts +33 -0
- package/packages/app-core/src/components/accounts/AddAccountDialog.d.ts.map +1 -0
- package/packages/app-core/src/components/accounts/AddAccountDialog.js +277 -0
- package/packages/app-core/src/components/accounts/RotationStrategyPicker.d.ts +16 -0
- package/packages/app-core/src/components/accounts/RotationStrategyPicker.d.ts.map +1 -0
- package/packages/app-core/src/components/accounts/RotationStrategyPicker.js +50 -0
- package/packages/app-core/src/components/pages/PluginsView.d.ts.map +1 -1
- package/packages/app-core/src/components/pages/PluginsView.js +3 -34
- package/packages/app-core/src/components/settings/ProviderSwitcher.d.ts.map +1 -1
- package/packages/app-core/src/components/settings/ProviderSwitcher.js +2 -1
- package/packages/app-core/src/hooks/useAccounts.d.ts +41 -0
- package/packages/app-core/src/hooks/useAccounts.d.ts.map +1 -0
- package/packages/app-core/src/hooks/useAccounts.js +250 -0
- package/packages/app-core/src/i18n/locales/en.json +31 -31
- package/packages/app-core/src/i18n/locales/es.json +31 -31
- package/packages/app-core/src/i18n/locales/ko.json +31 -31
- package/packages/app-core/src/i18n/locales/pt.json +31 -31
- package/packages/app-core/src/i18n/locales/tl.json +31 -31
- package/packages/app-core/src/i18n/locales/vi.json +31 -31
- package/packages/app-core/src/i18n/locales/zh-CN.json +31 -31
- package/packages/typescript/src/features/basic-capabilities/index.d.ts +1 -0
- package/packages/typescript/src/features/basic-capabilities/index.d.ts.map +1 -1
- package/packages/typescript/src/features/basic-capabilities/index.js +4 -0
- package/packages/typescript/src/features/index.d.ts.map +1 -1
- package/packages/typescript/src/features/index.js +2 -7
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/core-status.d.ts +14 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/core-status.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/core-status.js +48 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/create.d.ts +32 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/create.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/create.js +502 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/eject.d.ts +16 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/eject.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/eject.js +47 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/install.d.ts +18 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/install.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/install.js +59 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list-ejected.d.ts +14 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list-ejected.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list-ejected.js +31 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list.d.ts +14 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/list.js +51 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/reinject.d.ts +15 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/reinject.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/reinject.js +43 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/search.d.ts +15 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/search.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/search.js +52 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/sync.d.ts +15 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/sync.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin-handlers/sync.js +48 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin.d.ts +25 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/actions/plugin.js +439 -0
- package/packages/typescript/src/features/plugin-manager/index.d.ts +2 -0
- package/packages/typescript/src/features/plugin-manager/index.d.ts.map +1 -1
- package/packages/typescript/src/features/plugin-manager/index.js +7 -10
- package/packages/typescript/src/features/plugin-manager/security.d.ts +33 -0
- package/packages/typescript/src/features/plugin-manager/security.d.ts.map +1 -0
- package/packages/typescript/src/features/plugin-manager/security.js +80 -0
- package/packages/app-core/src/runtime/plugin-manager-guard.d.ts +0 -12
- package/packages/app-core/src/runtime/plugin-manager-guard.d.ts.map +0 -1
- package/packages/app-core/src/runtime/plugin-manager-guard.js +0 -82
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module features/plugin-manager/actions/plugin
|
|
3
|
+
*
|
|
4
|
+
* Unified PLUGIN action with sub-modes (`install`, `eject`, `sync`,
|
|
5
|
+
* `reinject`, `list`, `list_ejected`, `search`, `core_status`, `create`).
|
|
6
|
+
*
|
|
7
|
+
* Validate gates on owner role + a keyword heuristic + a lookup against
|
|
8
|
+
* any pending PLUGIN_CREATE intent task in the same room (so the
|
|
9
|
+
* multi-turn choice reply still resolves).
|
|
10
|
+
*
|
|
11
|
+
* Handler is pure dispatch — sub-handlers live under ./plugin-handlers/.
|
|
12
|
+
*/
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import { logger } from "../../../logger.js";
|
|
15
|
+
import { hasOwnerAccess as defaultOwnerAccessFn } from "../security.js";
|
|
16
|
+
import { runCoreStatus } from "./plugin-handlers/core-status.js";
|
|
17
|
+
import { hasPendingPluginCreateIntent, isPluginCreateChoiceReply, runCreate, } from "./plugin-handlers/create.js";
|
|
18
|
+
import { runEject } from "./plugin-handlers/eject.js";
|
|
19
|
+
import { runInstall } from "./plugin-handlers/install.js";
|
|
20
|
+
import { runList } from "./plugin-handlers/list.js";
|
|
21
|
+
import { runListEjected } from "./plugin-handlers/list-ejected.js";
|
|
22
|
+
import { runReinject } from "./plugin-handlers/reinject.js";
|
|
23
|
+
import { runSearch } from "./plugin-handlers/search.js";
|
|
24
|
+
import { runSync } from "./plugin-handlers/sync.js";
|
|
25
|
+
const MODES = [
|
|
26
|
+
"install",
|
|
27
|
+
"eject",
|
|
28
|
+
"sync",
|
|
29
|
+
"reinject",
|
|
30
|
+
"list",
|
|
31
|
+
"list_ejected",
|
|
32
|
+
"search",
|
|
33
|
+
"core_status",
|
|
34
|
+
"create",
|
|
35
|
+
];
|
|
36
|
+
const INSTALL_VERBS = /\binstall\b/i;
|
|
37
|
+
const EJECT_VERBS = /\beject\b/i;
|
|
38
|
+
const SYNC_VERBS = /\bsync\b/i;
|
|
39
|
+
const REINJECT_VERBS = /\b(reinject|re-inject|unject)\b/i;
|
|
40
|
+
const SEARCH_VERBS = /\b(search|find|look\s+for|discover)\b/i;
|
|
41
|
+
const LIST_VERBS = /\b(list|show)\b/i;
|
|
42
|
+
const CREATE_VERBS = /\b(create|build|make|new|scaffold|generate)\b/i;
|
|
43
|
+
const PLUGIN_NOUN = /\bplugins?\b/i;
|
|
44
|
+
const EJECTED_NOUN = /\bejected\b/i;
|
|
45
|
+
const CORE_NOUN = /\bcore\b/i;
|
|
46
|
+
const STATUS_NOUN = /\bstatus\b/i;
|
|
47
|
+
const MANAGE_VERBS = /\b(manage|build|create|build|fix|update|edit)\b/i;
|
|
48
|
+
const KEYWORD_HEURISTIC = /\b(install|eject|sync|reinject|search|find|create|build|make|scaffold|new|list|show|manage|fix|update|edit)\b.*\bplugins?\b|\bcore\s+status\b|\bplugin\b.*\b(install|eject|sync|reinject|search|find|create|build|make|scaffold|new|list|show)\b/i;
|
|
49
|
+
function defaultRepoRoot() {
|
|
50
|
+
const fromEnv = process.env.MILADY_REPO_ROOT?.trim() ||
|
|
51
|
+
process.env.MILADY_WORKSPACE_DIR?.trim() ||
|
|
52
|
+
process.env.ELIZA_WORKSPACE_DIR?.trim();
|
|
53
|
+
if (fromEnv && path.isAbsolute(fromEnv))
|
|
54
|
+
return fromEnv;
|
|
55
|
+
return process.cwd();
|
|
56
|
+
}
|
|
57
|
+
function readNestedParameters(options) {
|
|
58
|
+
const parameters = options?.parameters;
|
|
59
|
+
if (typeof parameters !== "object" ||
|
|
60
|
+
parameters === null ||
|
|
61
|
+
Array.isArray(parameters)) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
return parameters;
|
|
65
|
+
}
|
|
66
|
+
function readOptionValue(options, key) {
|
|
67
|
+
if (!options)
|
|
68
|
+
return undefined;
|
|
69
|
+
const direct = options[key];
|
|
70
|
+
if (direct !== undefined)
|
|
71
|
+
return direct;
|
|
72
|
+
return readNestedParameters(options)?.[key];
|
|
73
|
+
}
|
|
74
|
+
function readStringOption(options, key) {
|
|
75
|
+
const value = readOptionValue(options, key);
|
|
76
|
+
if (typeof value !== "string")
|
|
77
|
+
return undefined;
|
|
78
|
+
const trimmed = value.trim();
|
|
79
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
80
|
+
}
|
|
81
|
+
function readSourceOption(options) {
|
|
82
|
+
const source = readStringOption(options, "source");
|
|
83
|
+
if (source === "npm" || source === "git")
|
|
84
|
+
return source;
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
function inferMode(text, options) {
|
|
88
|
+
const explicit = readStringOption(options, "mode");
|
|
89
|
+
if (explicit && MODES.includes(explicit)) {
|
|
90
|
+
return explicit;
|
|
91
|
+
}
|
|
92
|
+
const trimmed = text.trim();
|
|
93
|
+
if (!trimmed)
|
|
94
|
+
return null;
|
|
95
|
+
if (CORE_NOUN.test(trimmed) && STATUS_NOUN.test(trimmed))
|
|
96
|
+
return "core_status";
|
|
97
|
+
if (LIST_VERBS.test(trimmed) && EJECTED_NOUN.test(trimmed))
|
|
98
|
+
return "list_ejected";
|
|
99
|
+
if (LIST_VERBS.test(trimmed) && PLUGIN_NOUN.test(trimmed))
|
|
100
|
+
return "list";
|
|
101
|
+
if (REINJECT_VERBS.test(trimmed))
|
|
102
|
+
return "reinject";
|
|
103
|
+
if (EJECT_VERBS.test(trimmed))
|
|
104
|
+
return "eject";
|
|
105
|
+
if (SYNC_VERBS.test(trimmed) && PLUGIN_NOUN.test(trimmed))
|
|
106
|
+
return "sync";
|
|
107
|
+
if (INSTALL_VERBS.test(trimmed) && PLUGIN_NOUN.test(trimmed))
|
|
108
|
+
return "install";
|
|
109
|
+
if (SEARCH_VERBS.test(trimmed) && PLUGIN_NOUN.test(trimmed))
|
|
110
|
+
return "search";
|
|
111
|
+
if (CREATE_VERBS.test(trimmed) && PLUGIN_NOUN.test(trimmed))
|
|
112
|
+
return "create";
|
|
113
|
+
if (MANAGE_VERBS.test(trimmed) && PLUGIN_NOUN.test(trimmed))
|
|
114
|
+
return "create";
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
function extractNameFromText(text) {
|
|
118
|
+
const scoped = text.match(/@[\w-]+\/(plugin-[\w.-]+)/);
|
|
119
|
+
if (scoped)
|
|
120
|
+
return scoped[0];
|
|
121
|
+
const bare = text.match(/\b(plugin-[\w.-]+)\b/);
|
|
122
|
+
if (bare)
|
|
123
|
+
return bare[1];
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
function extractQueryFromText(text) {
|
|
127
|
+
const patterns = [
|
|
128
|
+
/search\s+for\s+plugins?\s+(?:that\s+)?(?:can\s+)?(.+)/i,
|
|
129
|
+
/find\s+plugins?\s+(?:for|that|to)\s+(.+)/i,
|
|
130
|
+
/look\s+for\s+plugins?\s+(?:that\s+)?(.+)/i,
|
|
131
|
+
/discover\s+plugins?\s+(?:for|that)\s+(.+)/i,
|
|
132
|
+
/plugins?\s+(?:for|that\s+can|to)\s+(.+)/i,
|
|
133
|
+
];
|
|
134
|
+
for (const pattern of patterns) {
|
|
135
|
+
const m = text.match(pattern);
|
|
136
|
+
if (m?.[1]) {
|
|
137
|
+
const cleaned = m[1].trim().replace(/[?.!]+$/, "");
|
|
138
|
+
if (cleaned.length > 2)
|
|
139
|
+
return cleaned;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
function hasAccessContext(runtime, message) {
|
|
145
|
+
return (typeof runtime.agentId === "string" &&
|
|
146
|
+
runtime.agentId.length > 0 &&
|
|
147
|
+
typeof message.entityId === "string" &&
|
|
148
|
+
message.entityId.length > 0);
|
|
149
|
+
}
|
|
150
|
+
export function createPluginAction(deps = {}) {
|
|
151
|
+
const ownerCheck = deps.hasOwnerAccess ?? defaultOwnerAccessFn;
|
|
152
|
+
const repoRoot = deps.repoRoot ?? defaultRepoRoot();
|
|
153
|
+
const canManagePlugins = async (runtime, message) => {
|
|
154
|
+
if (!hasAccessContext(runtime, message))
|
|
155
|
+
return false;
|
|
156
|
+
return ownerCheck(runtime, message);
|
|
157
|
+
};
|
|
158
|
+
return {
|
|
159
|
+
name: "PLUGIN",
|
|
160
|
+
similes: [
|
|
161
|
+
"PLUGIN_CONTROL",
|
|
162
|
+
"MANAGE_PLUGINS",
|
|
163
|
+
// Legacy single-purpose action names — preserved as similes so
|
|
164
|
+
// callers that still dispatch by these names resolve to PLUGIN
|
|
165
|
+
// without breaking. Covers both the prior workspace plugin's
|
|
166
|
+
// names and the prior built-in capability's names.
|
|
167
|
+
"INSTALL_PLUGIN",
|
|
168
|
+
"EJECT_PLUGIN",
|
|
169
|
+
"SYNC_PLUGIN",
|
|
170
|
+
"REINJECT_PLUGIN",
|
|
171
|
+
"LIST_EJECTED_PLUGINS",
|
|
172
|
+
"SEARCH_PLUGIN",
|
|
173
|
+
"SEARCH_PLUGINS",
|
|
174
|
+
"CORE_STATUS",
|
|
175
|
+
"GET_PLUGIN_DETAILS",
|
|
176
|
+
],
|
|
177
|
+
description: "Unified plugin control. mode=install installs from registry; mode=eject clones a registry plugin locally; mode=sync pulls upstream into an ejected plugin; mode=reinject removes the local copy; mode=list shows loaded/installed; mode=list_ejected shows ejected; mode=search queries the registry; mode=core_status reports @elizaos/core ejection state; mode=create runs the multi-turn create-or-edit flow that scaffolds from the min-plugin template and dispatches a coding agent with AppVerificationService validator.",
|
|
178
|
+
parameters: [
|
|
179
|
+
{
|
|
180
|
+
name: "mode",
|
|
181
|
+
description: "Sub-mode: install | eject | sync | reinject | list | list_ejected | search | core_status | create.",
|
|
182
|
+
required: true,
|
|
183
|
+
schema: { type: "string", enum: [...MODES] },
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "name",
|
|
187
|
+
description: "Plugin name (e.g. @elizaos/plugin-twitter or plugin-twitter). Required for install / eject / sync / reinject.",
|
|
188
|
+
required: false,
|
|
189
|
+
schema: { type: "string" },
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "version",
|
|
193
|
+
description: "Version spec for install (npm semver). Optional.",
|
|
194
|
+
required: false,
|
|
195
|
+
schema: { type: "string" },
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "source",
|
|
199
|
+
description: "Install source: npm (default) or git.",
|
|
200
|
+
required: false,
|
|
201
|
+
schema: { type: "string", enum: ["npm", "git"] },
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "url",
|
|
205
|
+
description: "Override git URL when source=git.",
|
|
206
|
+
required: false,
|
|
207
|
+
schema: { type: "string" },
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "query",
|
|
211
|
+
description: "Free-form search query (search mode).",
|
|
212
|
+
required: false,
|
|
213
|
+
schema: { type: "string" },
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "intent",
|
|
217
|
+
description: "Free-form description of the plugin to build (create mode). Defaults to user message text.",
|
|
218
|
+
required: false,
|
|
219
|
+
schema: { type: "string" },
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "choice",
|
|
223
|
+
description: "Override choice reply (`new` | `edit-N` | `cancel`) for create-mode follow-up turns.",
|
|
224
|
+
required: false,
|
|
225
|
+
schema: { type: "string", enum: ["new", "edit", "cancel"] },
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "editTarget",
|
|
229
|
+
description: "Skip the picker and edit this installed plugin directly (create mode).",
|
|
230
|
+
required: false,
|
|
231
|
+
schema: { type: "string" },
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
validate: async (runtime, message) => {
|
|
235
|
+
if (!(await canManagePlugins(runtime, message)))
|
|
236
|
+
return false;
|
|
237
|
+
const text = message.content?.text ?? "";
|
|
238
|
+
if (isPluginCreateChoiceReply(text)) {
|
|
239
|
+
const roomId = typeof message.roomId === "string" ? message.roomId : runtime.agentId;
|
|
240
|
+
if (await hasPendingPluginCreateIntent(runtime, roomId))
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
return KEYWORD_HEURISTIC.test(text);
|
|
244
|
+
},
|
|
245
|
+
handler: async (runtime, message, _state, options, callback) => {
|
|
246
|
+
if (!(await canManagePlugins(runtime, message))) {
|
|
247
|
+
const text = "Permission denied: only the owner may manage plugins.";
|
|
248
|
+
await callback?.({ text });
|
|
249
|
+
return { success: false, text };
|
|
250
|
+
}
|
|
251
|
+
const text = message.content?.text ?? "";
|
|
252
|
+
if (isPluginCreateChoiceReply(text)) {
|
|
253
|
+
const roomId = typeof message.roomId === "string" ? message.roomId : runtime.agentId;
|
|
254
|
+
if (await hasPendingPluginCreateIntent(runtime, roomId)) {
|
|
255
|
+
return runCreate({
|
|
256
|
+
runtime,
|
|
257
|
+
message,
|
|
258
|
+
options,
|
|
259
|
+
callback,
|
|
260
|
+
choice: text.trim(),
|
|
261
|
+
repoRoot,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const mode = inferMode(text, options);
|
|
266
|
+
if (!mode) {
|
|
267
|
+
const reply = 'Tell me which plugin operation to run. Try: "install @elizaos/plugin-twitter", "list ejected plugins", "search for plugins for blockchain", "create a new plugin for X".';
|
|
268
|
+
await callback?.({ text: reply });
|
|
269
|
+
return { success: false, text: reply };
|
|
270
|
+
}
|
|
271
|
+
logger.info(`[plugin-manager] PLUGIN mode=${mode}`);
|
|
272
|
+
const name = readStringOption(options, "name") ?? extractNameFromText(text);
|
|
273
|
+
const source = readSourceOption(options);
|
|
274
|
+
const query = readStringOption(options, "query") ?? extractQueryFromText(text) ?? text;
|
|
275
|
+
switch (mode) {
|
|
276
|
+
case "install":
|
|
277
|
+
return runInstall({ runtime, name: name ?? "", source, callback });
|
|
278
|
+
case "eject":
|
|
279
|
+
return runEject({ runtime, name: name ?? "", callback });
|
|
280
|
+
case "sync":
|
|
281
|
+
return runSync({ runtime, name: name ?? "", callback });
|
|
282
|
+
case "reinject":
|
|
283
|
+
return runReinject({ runtime, name: name ?? "", callback });
|
|
284
|
+
case "list":
|
|
285
|
+
return runList({ runtime, callback });
|
|
286
|
+
case "list_ejected":
|
|
287
|
+
return runListEjected({ runtime, callback });
|
|
288
|
+
case "search":
|
|
289
|
+
return runSearch({ runtime, query, callback });
|
|
290
|
+
case "core_status":
|
|
291
|
+
return runCoreStatus({ runtime, callback });
|
|
292
|
+
case "create":
|
|
293
|
+
return runCreate({
|
|
294
|
+
runtime,
|
|
295
|
+
message,
|
|
296
|
+
options,
|
|
297
|
+
callback,
|
|
298
|
+
intent: readStringOption(options, "intent"),
|
|
299
|
+
choice: readStringOption(options, "choice"),
|
|
300
|
+
editTarget: readStringOption(options, "editTarget"),
|
|
301
|
+
repoRoot,
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
examples: [
|
|
306
|
+
[
|
|
307
|
+
{
|
|
308
|
+
name: "{{user1}}",
|
|
309
|
+
content: { text: "install @elizaos/plugin-twitter" },
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: "{{agentName}}",
|
|
313
|
+
content: {
|
|
314
|
+
text: "Installed @elizaos/plugin-twitter@2.0.0 at /…/plugins/installed/@elizaos_plugin-twitter\nRestart required to activate.",
|
|
315
|
+
action: "PLUGIN",
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
[
|
|
320
|
+
{
|
|
321
|
+
name: "{{user1}}",
|
|
322
|
+
content: { text: "eject @elizaos/plugin-shopify" },
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "{{agentName}}",
|
|
326
|
+
content: {
|
|
327
|
+
text: "Ejected @elizaos/plugin-shopify to /…/plugins/ejected/@elizaos_plugin-shopify (commit 1234abcd)\nRestart required to load the local copy.",
|
|
328
|
+
action: "PLUGIN",
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
[
|
|
333
|
+
{
|
|
334
|
+
name: "{{user1}}",
|
|
335
|
+
content: { text: "sync plugin-shopify" },
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "{{agentName}}",
|
|
339
|
+
content: {
|
|
340
|
+
text: "Synced @elizaos/plugin-shopify: 3 new upstream commit(s) at deadbeef\nRestart required.",
|
|
341
|
+
action: "PLUGIN",
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
[
|
|
346
|
+
{
|
|
347
|
+
name: "{{user1}}",
|
|
348
|
+
content: { text: "reinject plugin-shopify" },
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "{{agentName}}",
|
|
352
|
+
content: {
|
|
353
|
+
text: "Reinjected plugin-shopify (removed /…/plugins/ejected/plugin-shopify)\nRestart required.",
|
|
354
|
+
action: "PLUGIN",
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
[
|
|
359
|
+
{
|
|
360
|
+
name: "{{user1}}",
|
|
361
|
+
content: { text: "list plugins" },
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
name: "{{agentName}}",
|
|
365
|
+
content: {
|
|
366
|
+
text: "Loaded plugins (2):\n - plugin-manager [LOADED]\n - @elizaos/plugin-sql [LOADED]",
|
|
367
|
+
action: "PLUGIN",
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
[
|
|
372
|
+
{
|
|
373
|
+
name: "{{user1}}",
|
|
374
|
+
content: { text: "list ejected plugins" },
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: "{{agentName}}",
|
|
378
|
+
content: {
|
|
379
|
+
text: "Ejected plugins (1):\n - @elizaos/plugin-shopify (v2.0.0) at /…/plugins/ejected/@elizaos_plugin-shopify",
|
|
380
|
+
action: "PLUGIN",
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
],
|
|
384
|
+
[
|
|
385
|
+
{
|
|
386
|
+
name: "{{user1}}",
|
|
387
|
+
content: { text: "search for plugins that handle blockchain" },
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: "{{agentName}}",
|
|
391
|
+
content: {
|
|
392
|
+
text: 'Found 3 plugin(s) matching "handle blockchain":\n\n1. @elizaos/plugin-evm (match: 90%)\n …',
|
|
393
|
+
action: "PLUGIN",
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
],
|
|
397
|
+
[
|
|
398
|
+
{
|
|
399
|
+
name: "{{user1}}",
|
|
400
|
+
content: { text: "core status" },
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "{{agentName}}",
|
|
404
|
+
content: {
|
|
405
|
+
text: "Core is using NPM package (v2.0.0-alpha.372). Not ejected.",
|
|
406
|
+
action: "PLUGIN",
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
],
|
|
410
|
+
[
|
|
411
|
+
{
|
|
412
|
+
name: "{{user1}}",
|
|
413
|
+
content: { text: "build me a plugin for sending push notifications" },
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: "{{agentName}}",
|
|
417
|
+
content: {
|
|
418
|
+
text: "[CHOICE:plugin-create id=plugin-create-…]\nnew = Create new plugin\nedit-1 = Edit plugin-notifications\ncancel = Cancel\n[/CHOICE]",
|
|
419
|
+
action: "PLUGIN",
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
],
|
|
423
|
+
[
|
|
424
|
+
{
|
|
425
|
+
name: "{{user1}}",
|
|
426
|
+
content: { text: "new" },
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: "{{agentName}}",
|
|
430
|
+
content: {
|
|
431
|
+
text: "Spawned coding agent. I'll verify when it's done. (Push Notifications Plugin at /…/eliza/plugins/plugin-push-notifications/typescript)",
|
|
432
|
+
action: "PLUGIN",
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
],
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
export const pluginAction = createPluginAction();
|
|
@@ -3,7 +3,9 @@ import * as pluginRegistry from "./services/pluginRegistryService.ts";
|
|
|
3
3
|
import * as types from "./types.ts";
|
|
4
4
|
export { coreStatusAction } from "./actions/coreStatusAction.ts";
|
|
5
5
|
export { listEjectedPluginsAction } from "./actions/listEjectedPluginsAction.ts";
|
|
6
|
+
export { createPluginAction, pluginAction, type PluginMode, } from "./actions/plugin.ts";
|
|
6
7
|
export { getPluginDetailsAction, searchPluginAction, } from "./actions/searchPluginAction.ts";
|
|
8
|
+
export { hasAdminAccess, hasOwnerAccess, type SecurityDeps, } from "./security.ts";
|
|
7
9
|
export type { ExtendedRuntime } from "./coreExtensions.ts";
|
|
8
10
|
export { applyRuntimeExtensions, extendRuntimeWithComponentUnregistration, } from "./coreExtensions.ts";
|
|
9
11
|
export { pluginConfigurationStatusProvider } from "./providers/pluginConfigurationStatus.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../typescript/src/features/plugin-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../typescript/src/features/plugin-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAOpD,OAAO,KAAK,cAAc,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAKpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,UAAU,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,sBAAsB,EACtB,kBAAkB,GAClB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACN,cAAc,EACd,cAAc,EACd,KAAK,YAAY,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACN,sBAAsB,EACtB,wCAAwC,GACxC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iCAAiC,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACX,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,gBAAgB,IAAI,oBAAoB,GACxC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,YAAY,EACX,WAAW,EACX,kBAAkB,EAClB,cAAc,GACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACtB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACX,qBAAqB,EACrB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,WAAW,EACX,cAAc,EACd,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,wBAAwB,EACxB,YAAY,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,eAAe,GACf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;AAGjC,eAAO,MAAM,mBAAmB,EAAE,MAYjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { listEjectedPluginsAction } from "./actions/listEjectedPluginsAction.js";
|
|
3
|
-
import { getPluginDetailsAction, searchPluginAction, } from "./actions/searchPluginAction.js";
|
|
1
|
+
import { pluginAction } from "./actions/plugin.js";
|
|
4
2
|
import { pluginConfigurationStatusProvider } from "./providers/pluginConfigurationStatus.js";
|
|
5
3
|
import { pluginStateProvider } from "./providers/pluginStateProvider.js";
|
|
6
4
|
import { registryPluginsProvider } from "./providers/registryPluginsProvider.js";
|
|
@@ -12,7 +10,11 @@ import * as types from "./types.js";
|
|
|
12
10
|
// Actions
|
|
13
11
|
export { coreStatusAction } from "./actions/coreStatusAction.js";
|
|
14
12
|
export { listEjectedPluginsAction } from "./actions/listEjectedPluginsAction.js";
|
|
13
|
+
export { createPluginAction, pluginAction, } from "./actions/plugin.js";
|
|
15
14
|
export { getPluginDetailsAction, searchPluginAction, } from "./actions/searchPluginAction.js";
|
|
15
|
+
// Security helpers (re-exported from @elizaos/core for consumers like
|
|
16
|
+
// plugin-app-control).
|
|
17
|
+
export { hasAdminAccess, hasOwnerAccess, } from "./security.js";
|
|
16
18
|
// Core extensions
|
|
17
19
|
export { applyRuntimeExtensions, extendRuntimeWithComponentUnregistration, } from "./coreExtensions.js";
|
|
18
20
|
// Providers
|
|
@@ -35,13 +37,8 @@ export { pluginRegistry, types };
|
|
|
35
37
|
// Plugin definition
|
|
36
38
|
export const pluginManagerPlugin = {
|
|
37
39
|
name: "plugin-manager",
|
|
38
|
-
description: "
|
|
39
|
-
actions: [
|
|
40
|
-
coreStatusAction,
|
|
41
|
-
getPluginDetailsAction,
|
|
42
|
-
searchPluginAction,
|
|
43
|
-
listEjectedPluginsAction,
|
|
44
|
-
],
|
|
40
|
+
description: "Plugin discovery, install, eject/sync, registry search, and creation",
|
|
41
|
+
actions: [pluginAction],
|
|
45
42
|
providers: [
|
|
46
43
|
pluginConfigurationStatusProvider,
|
|
47
44
|
pluginStateProvider,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real owner/admin role gating for the PLUGIN action.
|
|
3
|
+
*
|
|
4
|
+
* Lives in core so other plugins (and the built-in pluginManagerCapability)
|
|
5
|
+
* can import it without taking a dep on `@elizaos/agent` (which would
|
|
6
|
+
* create a layer cycle — `@elizaos/agent` already depends on this
|
|
7
|
+
* capability).
|
|
8
|
+
*
|
|
9
|
+
* Behavior:
|
|
10
|
+
* - missing runtime/message context → allow (auth is handled elsewhere)
|
|
11
|
+
* - sender is the agent itself → allow
|
|
12
|
+
* - sender is the canonical owner → allow
|
|
13
|
+
* - otherwise: check the sender role via `checkSenderRole` and require
|
|
14
|
+
* `isOwner` (for owner gate) or `isOwner || isAdmin` (for admin gate)
|
|
15
|
+
*
|
|
16
|
+
* Role-checker functions are injectable so tests can substitute fakes
|
|
17
|
+
* without monkey-patching the module (bun's `mock.module` persists across
|
|
18
|
+
* test files in the same run, which would contaminate unrelated suites).
|
|
19
|
+
*/
|
|
20
|
+
import type { Memory } from "../../types/memory.ts";
|
|
21
|
+
import type { IAgentRuntime } from "../../types/runtime.ts";
|
|
22
|
+
type SenderRole = {
|
|
23
|
+
isOwner?: boolean;
|
|
24
|
+
isAdmin?: boolean;
|
|
25
|
+
} | null | undefined;
|
|
26
|
+
export type SecurityDeps = {
|
|
27
|
+
checkSenderRole?: (runtime: IAgentRuntime, message: Memory) => Promise<SenderRole>;
|
|
28
|
+
resolveCanonicalOwnerIdForMessage?: (runtime: IAgentRuntime, message: Memory) => Promise<string | null | undefined>;
|
|
29
|
+
};
|
|
30
|
+
export declare function hasOwnerAccess(runtime: IAgentRuntime | undefined, message: Memory | undefined, deps?: SecurityDeps): Promise<boolean>;
|
|
31
|
+
export declare function hasAdminAccess(runtime: IAgentRuntime | undefined, message: Memory | undefined, deps?: SecurityDeps): Promise<boolean>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../../../../../typescript/src/features/plugin-manager/security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,KAAK,UAAU,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE9E,MAAM,MAAM,YAAY,GAAG;IAC1B,eAAe,CAAC,EAAE,CACjB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,KACX,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,iCAAiC,CAAC,EAAE,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,MAAM,KACX,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACxC,CAAC;AAuCF,wBAAsB,cAAc,CACnC,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,GAAE,YAAiB,GACrB,OAAO,CAAC,OAAO,CAAC,CAelB;AAED,wBAAsB,cAAc,CACnC,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,GAAE,YAAiB,GACrB,OAAO,CAAC,OAAO,CAAC,CAelB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real owner/admin role gating for the PLUGIN action.
|
|
3
|
+
*
|
|
4
|
+
* Lives in core so other plugins (and the built-in pluginManagerCapability)
|
|
5
|
+
* can import it without taking a dep on `@elizaos/agent` (which would
|
|
6
|
+
* create a layer cycle — `@elizaos/agent` already depends on this
|
|
7
|
+
* capability).
|
|
8
|
+
*
|
|
9
|
+
* Behavior:
|
|
10
|
+
* - missing runtime/message context → allow (auth is handled elsewhere)
|
|
11
|
+
* - sender is the agent itself → allow
|
|
12
|
+
* - sender is the canonical owner → allow
|
|
13
|
+
* - otherwise: check the sender role via `checkSenderRole` and require
|
|
14
|
+
* `isOwner` (for owner gate) or `isOwner || isAdmin` (for admin gate)
|
|
15
|
+
*
|
|
16
|
+
* Role-checker functions are injectable so tests can substitute fakes
|
|
17
|
+
* without monkey-patching the module (bun's `mock.module` persists across
|
|
18
|
+
* test files in the same run, which would contaminate unrelated suites).
|
|
19
|
+
*/
|
|
20
|
+
import { checkSenderRole as defaultCheckSenderRole, resolveCanonicalOwnerIdForMessage as defaultResolveCanonicalOwnerIdForMessage, } from "../../roles.js";
|
|
21
|
+
function getAccessContext(runtime, message) {
|
|
22
|
+
if (!runtime ||
|
|
23
|
+
typeof runtime.agentId !== "string" ||
|
|
24
|
+
!message ||
|
|
25
|
+
typeof message.entityId !== "string" ||
|
|
26
|
+
message.entityId.length === 0) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return { runtime, message };
|
|
30
|
+
}
|
|
31
|
+
function isAgentSelf(context) {
|
|
32
|
+
return context.message.entityId === context.runtime.agentId;
|
|
33
|
+
}
|
|
34
|
+
async function isCanonicalOwner(context, resolveOwnerFn) {
|
|
35
|
+
try {
|
|
36
|
+
const ownerId = await resolveOwnerFn(context.runtime, context.message);
|
|
37
|
+
return typeof ownerId === "string" && ownerId === context.message.entityId;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export async function hasOwnerAccess(runtime, message, deps = {}) {
|
|
44
|
+
const context = getAccessContext(runtime, message);
|
|
45
|
+
if (!context)
|
|
46
|
+
return true;
|
|
47
|
+
if (isAgentSelf(context))
|
|
48
|
+
return true;
|
|
49
|
+
const resolveOwnerFn = deps.resolveCanonicalOwnerIdForMessage ??
|
|
50
|
+
defaultResolveCanonicalOwnerIdForMessage;
|
|
51
|
+
if (await isCanonicalOwner(context, resolveOwnerFn))
|
|
52
|
+
return true;
|
|
53
|
+
const checkRoleFn = deps.checkSenderRole ?? defaultCheckSenderRole;
|
|
54
|
+
try {
|
|
55
|
+
const role = await checkRoleFn(context.runtime, context.message);
|
|
56
|
+
return role?.isOwner === true;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export async function hasAdminAccess(runtime, message, deps = {}) {
|
|
63
|
+
const context = getAccessContext(runtime, message);
|
|
64
|
+
if (!context)
|
|
65
|
+
return true;
|
|
66
|
+
if (isAgentSelf(context))
|
|
67
|
+
return true;
|
|
68
|
+
const resolveOwnerFn = deps.resolveCanonicalOwnerIdForMessage ??
|
|
69
|
+
defaultResolveCanonicalOwnerIdForMessage;
|
|
70
|
+
if (await isCanonicalOwner(context, resolveOwnerFn))
|
|
71
|
+
return true;
|
|
72
|
+
const checkRoleFn = deps.checkSenderRole ?? defaultCheckSenderRole;
|
|
73
|
+
try {
|
|
74
|
+
const role = await checkRoleFn(context.runtime, context.message);
|
|
75
|
+
return role?.isOwner === true || role?.isAdmin === true;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-enable `@elizaos/plugin-plugin-manager` via `plugins.allow` so the
|
|
3
|
-
* dashboard "Install Plugin" flow works. The plugin is bundled but optional
|
|
4
|
-
* (see OPTIONAL_CORE_PLUGINS in the agent runtime).
|
|
5
|
-
*
|
|
6
|
-
* Skipped when `ELIZA_DISABLE_PLUGIN_MANAGER_AUTO_ENABLE=1` is set.
|
|
7
|
-
*/
|
|
8
|
-
export declare const PLUGIN_MANAGER_UNAVAILABLE_ERROR = "Plugin manager service not found";
|
|
9
|
-
export type PluginManagerGuardResult = "enabled" | "already-enabled" | "disabled-by-user" | "disabled-by-env" | "error";
|
|
10
|
-
export declare function getPluginManagerBlockReason(result: PluginManagerGuardResult): string | null;
|
|
11
|
-
export declare function ensurePluginManagerAllowed(): Promise<PluginManagerGuardResult>;
|
|
12
|
-
//# sourceMappingURL=plugin-manager-guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-manager-guard.d.ts","sourceRoot":"","sources":["../../../../../../app-core/src/runtime/plugin-manager-guard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,eAAO,MAAM,gCAAgC,qCACT,CAAC;AAErC,MAAM,MAAM,wBAAwB,GAChC,SAAS,GACT,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,OAAO,CAAC;AAEZ,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,wBAAwB,GAC/B,MAAM,GAAG,IAAI,CAQf;AAED,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,wBAAwB,CAAC,CA4DpF"}
|