mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 09:20:24 +00:00
Plugins: remove public extension-api surface (#48462)
* Plugins: remove public extension-api surface * Plugins: fix loader setup routing follow-ups * CI: ignore non-extension helper dirs in extension-fast * Docs: note extension-api removal as breaking
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
|
||||
vi.mock("openclaw/extension-api", () => {
|
||||
return {
|
||||
runEmbeddedPiAgent: vi.fn(async () => ({
|
||||
meta: { startedAt: Date.now() },
|
||||
payloads: [{ text: "{}" }],
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
import { runEmbeddedPiAgent } from "openclaw/extension-api";
|
||||
import { createLlmTaskTool } from "./llm-task-tool.js";
|
||||
|
||||
const runEmbeddedPiAgent = vi.fn(async () => ({
|
||||
meta: { startedAt: Date.now() },
|
||||
payloads: [{ text: "{}" }],
|
||||
}));
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
function fakeApi(overrides: any = {}) {
|
||||
return {
|
||||
@@ -22,7 +16,12 @@ function fakeApi(overrides: any = {}) {
|
||||
agents: { defaults: { workspace: "/tmp", model: { primary: "openai-codex/gpt-5.2" } } },
|
||||
},
|
||||
pluginConfig: {},
|
||||
runtime: { version: "test" },
|
||||
runtime: {
|
||||
version: "test",
|
||||
agent: {
|
||||
runEmbeddedPiAgent,
|
||||
},
|
||||
},
|
||||
logger: { debug() {}, info() {}, warn() {}, error() {} },
|
||||
registerTool() {},
|
||||
...overrides,
|
||||
|
||||
@@ -2,7 +2,6 @@ import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import Ajv from "ajv";
|
||||
import { runEmbeddedPiAgent } from "openclaw/extension-api";
|
||||
import {
|
||||
formatThinkingLevels,
|
||||
formatXHighModelHint,
|
||||
@@ -179,7 +178,7 @@ export function createLlmTaskTool(api: OpenClawPluginApi) {
|
||||
const sessionId = `llm-task-${Date.now()}`;
|
||||
const sessionFile = path.join(tmpDir, "session.json");
|
||||
|
||||
const result = await runEmbeddedPiAgent({
|
||||
const result = await api.runtime.agent.runEmbeddedPiAgent({
|
||||
sessionId,
|
||||
sessionFile,
|
||||
workspaceDir: api.config?.agents?.defaults?.workspace ?? process.cwd(),
|
||||
|
||||
Reference in New Issue
Block a user