


































@@ -87,11 +87,20 @@ function readConfig() {
87878888function configureRuntime() {
8989const pluginId = process.env.KITCHEN_SINK_ID;
90+const personality = process.env.KITCHEN_SINK_PERSONALITY;
9091const { configPath, config } = readConfig();
9192config.plugins = config.plugins || {};
9293config.plugins.entries = config.plugins.entries || {};
9394config.plugins.entries[pluginId] = {
9495 ...config.plugins.entries[pluginId],
96+ ...(personality
97+ ? {
98+config: {
99+ ...config.plugins.entries[pluginId]?.config,
100+ personality,
101+},
102+}
103+ : {}),
95104hooks: {
96105 ...config.plugins.entries[pluginId]?.hooks,
97106allowConversationAccess: true,
@@ -124,6 +133,39 @@ const expectMissing = (listValue, expected, field) => {
124133}
125134};
126135136+function assertExpectedDiagnostics(surfaceMode, errorMessages) {
137+const expectedErrorMessages = new Set([
138+"only bundled plugins can register agent tool result middleware",
139+'agent harness "kitchen-sink-agent-harness" registration missing required runtime methods',
140+'channel "kitchen-sink-channel-probe" registration missing required config helpers',
141+"cli registration missing explicit commands metadata",
142+"only bundled plugins can register Codex app-server extension factories",
143+'compaction provider "kitchen-sink-compaction-provider" registration missing summarize',
144+"context engine registration missing id",
145+"http route registration missing or invalid auth: /kitchen-sink/http-route",
146+"plugin must own memory slot or declare contracts.memoryEmbeddingProviders for adapter: kitchen-sink-memory-embedding-provider",
147+"memory prompt supplement registration missing builder",
148+]);
149+if (surfaceMode !== "full" && surfaceMode !== "adversarial") {
150+if (errorMessages.size > 0) {
151+throw new Error(
152+`unexpected kitchen-sink diagnostic errors: ${[...errorMessages].join(", ")}`,
153+);
154+}
155+return;
156+}
157+for (const message of errorMessages) {
158+if (!expectedErrorMessages.has(message)) {
159+throw new Error(`unexpected kitchen-sink diagnostic error: ${message}`);
160+}
161+}
162+for (const message of expectedErrorMessages) {
163+if (!errorMessages.has(message)) {
164+throw new Error(`missing expected kitchen-sink diagnostic error: ${message}`);
165+}
166+}
167+}
168+127169function assertRealPathInside(parentPath, childPath, label) {
128170const parentRealPath = fs.realpathSync(parentPath);
129171const childRealPath = fs.realpathSync(childPath);
@@ -181,8 +223,10 @@ function assertInstalled() {
181223);
182224}
183225184-expectIncludes(inspect.plugin?.channelIds, "kitchen-sink-channel", "channels");
185-expectIncludes(inspect.plugin?.providerIds, "kitchen-sink-provider", "providers");
226+if (surfaceMode !== "adversarial") {
227+expectIncludes(inspect.plugin?.channelIds, "kitchen-sink-channel", "channels");
228+expectIncludes(inspect.plugin?.providerIds, "kitchen-sink-provider", "providers");
229+}
186230187231const diagnostics = [
188232 ...(list.diagnostics || []),
@@ -193,7 +237,7 @@ function assertInstalled() {
193237diagnostics.filter((diag) => diag?.level === "error").map((diag) => String(diag.message || "")),
194238);
195239196-if (surfaceMode === "full") {
240+if (surfaceMode === "full" || surfaceMode === "conformance") {
197241const toolNames = Array.isArray(inspect.tools)
198242 ? inspect.tools.flatMap((entry) => (Array.isArray(entry?.names) ? entry.names : []))
199243 : [];
@@ -232,8 +276,13 @@ function assertInstalled() {
232276}
233277expectMissing(inspect.plugin?.agentHarnessIds, "kitchen-sink-agent-harness", "agent harnesses");
234278expectIncludes(inspect.services, "kitchen-sink-service", "services");
235-expectIncludes(inspect.commands, "kitchen-sink-command", "commands");
236-expectIncludes(toolNames, "kitchen-sink-tool", "tools");
279+if (surfaceMode === "full") {
280+expectIncludes(inspect.commands, "kitchen-sink-command", "commands");
281+expectIncludes(toolNames, "kitchen-sink-tool", "tools");
282+} else {
283+expectIncludes(inspect.commands, "kitchen", "commands");
284+expectIncludes(toolNames, "kitchen_sink_text", "tools");
285+}
237286if (
238287(inspect.plugin?.hookCount || 0) < 30 ||
239288!Array.isArray(inspect.typedHooks) ||
@@ -243,32 +292,8 @@ function assertInstalled() {
243292`expected kitchen-sink typed hooks to load, got hookCount=${inspect.plugin?.hookCount} typedHooks=${inspect.typedHooks?.length}`,
244293);
245294}
246-247-const expectedErrorMessages = new Set([
248-"only bundled plugins can register agent tool result middleware",
249-'agent harness "kitchen-sink-agent-harness" registration missing required runtime methods',
250-'channel "kitchen-sink-channel-probe" registration missing required config helpers',
251-"cli registration missing explicit commands metadata",
252-"only bundled plugins can register Codex app-server extension factories",
253-'compaction provider "kitchen-sink-compaction-provider" registration missing summarize',
254-"context engine registration missing id",
255-"http route registration missing or invalid auth: /kitchen-sink/http-route",
256-"plugin must own memory slot or declare contracts.memoryEmbeddingProviders for adapter: kitchen-sink-memory-embedding-provider",
257-"memory prompt supplement registration missing builder",
258-]);
259-for (const message of errorMessages) {
260-if (!expectedErrorMessages.has(message)) {
261-throw new Error(`unexpected kitchen-sink diagnostic error: ${message}`);
262-}
263-}
264-for (const message of expectedErrorMessages) {
265-if (!errorMessages.has(message)) {
266-throw new Error(`missing expected kitchen-sink diagnostic error: ${message}`);
267-}
268-}
269-} else if (errorMessages.size > 0) {
270-throw new Error(`unexpected kitchen-sink diagnostic errors: ${[...errorMessages].join(", ")}`);
271295}
296+assertExpectedDiagnostics(surfaceMode, errorMessages);
272297273298const indexPath = path.join(process.env.HOME, ".openclaw", "plugins", "installs.json");
274299const index = readJson(indexPath);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。