Rebase: reconcile activation and build drift
This commit is contained in:
parent
d6961c5d5c
commit
5e4c974696
@ -20,6 +20,10 @@ type ChromeMcpToolResult = {
|
||||
isError?: boolean;
|
||||
};
|
||||
|
||||
type ChromeMcpToolListEntry = {
|
||||
name?: string;
|
||||
};
|
||||
|
||||
type ChromeMcpSession = {
|
||||
client: Client;
|
||||
transport: StdioClientTransport;
|
||||
@ -186,7 +190,7 @@ async function createRealSession(profileName: string): Promise<ChromeMcpSession>
|
||||
try {
|
||||
await client.connect(transport);
|
||||
const tools = await client.listTools();
|
||||
if (!tools.tools.some((tool) => tool.name === "list_pages")) {
|
||||
if (!tools.tools.some((tool: ChromeMcpToolListEntry) => tool.name === "list_pages")) {
|
||||
throw new Error("Chrome MCP server did not expose the expected navigation tools.");
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@ -56,7 +56,7 @@ export function prepareExtensionHostLoaderExecution(params: {
|
||||
config: params.config,
|
||||
workspaceDir: params.workspaceDir,
|
||||
env: params.env,
|
||||
warningCacheKey: params.cacheKey,
|
||||
cacheKey: params.cacheKey,
|
||||
warningCache: params.warningCache,
|
||||
cache: params.cache,
|
||||
normalizedConfig: params.normalizedConfig,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { PluginRegistry } from "../../plugins/registry.js";
|
||||
import type { PluginLogger } from "../../plugins/types.js";
|
||||
import { resolveExtensionHostFinalizationPolicy } from "../policy/loader-finalization-policy.js";
|
||||
import type { ExtensionHostProvenanceIndex } from "../policy/loader-policy.js";
|
||||
import type { ExtensionHostProvenanceIndex } from "../policy/loader-provenance.js";
|
||||
import { markExtensionHostRegistryPluginsReady } from "./loader-state.js";
|
||||
|
||||
export function finalizeExtensionHostRegistryLoad(params: {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { NormalizedPluginsConfig } from "../../plugins/config-state.js";
|
||||
import type { PluginCandidate } from "../../plugins/discovery.js";
|
||||
import type { PluginManifestRecord } from "../../plugins/manifest-registry.js";
|
||||
import type { PluginRecord, PluginRegistry } from "../../plugins/registry.js";
|
||||
@ -13,6 +14,7 @@ import {
|
||||
import { resolveExtensionHostModuleExport } from "./loader-runtime.js";
|
||||
import {
|
||||
appendExtensionHostPluginRecord,
|
||||
setExtensionHostPluginRecordDisabled,
|
||||
setExtensionHostPluginRecordLifecycleState,
|
||||
setExtensionHostPluginRecordError,
|
||||
} from "./loader-state.js";
|
||||
@ -20,21 +22,7 @@ import {
|
||||
export function processExtensionHostPluginCandidate(params: {
|
||||
candidate: PluginCandidate;
|
||||
manifestRecord: PluginManifestRecord;
|
||||
normalizedConfig: {
|
||||
entries: Record<
|
||||
string,
|
||||
{
|
||||
enabled?: boolean;
|
||||
hooks?: {
|
||||
allowPromptInjection?: boolean;
|
||||
};
|
||||
config?: unknown;
|
||||
}
|
||||
>;
|
||||
slots: {
|
||||
memory?: string | null;
|
||||
};
|
||||
};
|
||||
normalizedConfig: NormalizedPluginsConfig;
|
||||
rootConfig: OpenClawConfig;
|
||||
validateOnly: boolean;
|
||||
logger: PluginLogger;
|
||||
@ -85,7 +73,7 @@ export function processExtensionHostPluginCandidate(params: {
|
||||
level: "error",
|
||||
pluginId: record.id,
|
||||
source: record.source,
|
||||
message: record.error,
|
||||
message: record.error ?? message,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ import type { PluginRecord } from "../../plugins/registry.js";
|
||||
import type {
|
||||
OpenClawPluginApi,
|
||||
OpenClawPluginDefinition,
|
||||
OpenClawPluginHookOptions,
|
||||
PluginDiagnostic,
|
||||
} from "../../plugins/types.js";
|
||||
import {
|
||||
@ -105,10 +104,11 @@ export function planExtensionHostLoadedPlugin(params: {
|
||||
value: params.entryConfig,
|
||||
});
|
||||
if (!validatedConfig.ok) {
|
||||
const errors = validatedConfig.errors ?? ["invalid config"];
|
||||
return {
|
||||
kind: "invalid-config",
|
||||
message: `invalid config: ${validatedConfig.errors.join(", ")}`,
|
||||
errors: validatedConfig.errors,
|
||||
message: `invalid config: ${errors.join(", ")}`,
|
||||
errors,
|
||||
memorySlotMatched,
|
||||
selectedMemoryPluginId: nextSelectedMemoryPluginId,
|
||||
};
|
||||
@ -147,13 +147,13 @@ export function runExtensionHostPluginRegister(params: {
|
||||
options: {
|
||||
config: OpenClawConfig;
|
||||
pluginConfig?: Record<string, unknown>;
|
||||
hookPolicy?: OpenClawPluginHookOptions;
|
||||
hookPolicy?: { allowPromptInjection?: boolean };
|
||||
},
|
||||
) => OpenClawPluginApi;
|
||||
record: PluginRecord;
|
||||
config: OpenClawConfig;
|
||||
pluginConfig?: Record<string, unknown>;
|
||||
hookPolicy?: OpenClawPluginHookOptions;
|
||||
hookPolicy?: { allowPromptInjection?: boolean };
|
||||
diagnostics: PluginDiagnostic[];
|
||||
}):
|
||||
| {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { NormalizedPluginsConfig } from "../../plugins/config-state.js";
|
||||
import type { PluginRecord } from "../../plugins/registry.js";
|
||||
import type { OpenClawPluginApi, OpenClawPluginModule } from "../../plugins/types.js";
|
||||
import type { ExtensionHostLoaderSession } from "./loader-session.js";
|
||||
@ -13,21 +14,7 @@ export function runExtensionHostLoaderSession(params: {
|
||||
rootDir: string;
|
||||
}>;
|
||||
manifestByRoot: Map<string, { rootDir: string }>;
|
||||
normalizedConfig: {
|
||||
entries: Record<
|
||||
string,
|
||||
{
|
||||
enabled?: boolean;
|
||||
hooks?: {
|
||||
allowPromptInjection?: boolean;
|
||||
};
|
||||
config?: unknown;
|
||||
}
|
||||
>;
|
||||
slots: {
|
||||
memory?: string | null;
|
||||
};
|
||||
};
|
||||
normalizedConfig: NormalizedPluginsConfig;
|
||||
rootConfig: OpenClawConfig;
|
||||
validateOnly: boolean;
|
||||
createApi: (
|
||||
|
||||
@ -87,7 +87,7 @@ export function resolveExtensionHostEarlyMemoryDecision(params: {
|
||||
origin: PluginRecord["origin"];
|
||||
manifestKind?: PluginRecord["kind"];
|
||||
recordId: string;
|
||||
memorySlot?: string;
|
||||
memorySlot?: string | null;
|
||||
selectedMemoryPluginId: string | null;
|
||||
}): { enabled: boolean; reason?: string } {
|
||||
if (params.origin !== "bundled" || params.manifestKind !== "memory") {
|
||||
@ -108,7 +108,7 @@ export function resolveExtensionHostEarlyMemoryDecision(params: {
|
||||
export function resolveExtensionHostMemoryDecision(params: {
|
||||
recordId: string;
|
||||
recordKind?: PluginRecord["kind"];
|
||||
memorySlot?: string;
|
||||
memorySlot?: string | null;
|
||||
selectedMemoryPluginId: string | null;
|
||||
}): { enabled: boolean; selected: boolean; reason?: string } {
|
||||
const decision = resolveMemorySlotDecision({
|
||||
@ -119,7 +119,7 @@ export function resolveExtensionHostMemoryDecision(params: {
|
||||
});
|
||||
return {
|
||||
enabled: decision.enabled,
|
||||
selected: decision.selected,
|
||||
selected: decision.selected === true,
|
||||
...(decision.enabled ? {} : { reason: decision.reason }),
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { NormalizedPluginsConfig } from "../../plugins/config-state.js";
|
||||
import type { PluginCandidate } from "../../plugins/discovery.js";
|
||||
import type { PluginManifestRecord } from "../../plugins/manifest-registry.js";
|
||||
import type { PluginRecord, PluginRegistry } from "../../plugins/registry.js";
|
||||
import type { OpenClawPluginApi, OpenClawPluginModule, PluginLogger } from "../../plugins/types.js";
|
||||
import type { ExtensionHostProvenanceIndex } from "../policy/loader-policy.js";
|
||||
import type { ExtensionHostProvenanceIndex } from "../policy/loader-provenance.js";
|
||||
import { finalizeExtensionHostRegistryLoad } from "./loader-finalize.js";
|
||||
import { processExtensionHostPluginCandidate } from "./loader-flow.js";
|
||||
|
||||
@ -53,21 +54,7 @@ export function processExtensionHostLoaderSessionCandidate(params: {
|
||||
session: ExtensionHostLoaderSession;
|
||||
candidate: PluginCandidate;
|
||||
manifestRecord: PluginManifestRecord;
|
||||
normalizedConfig: {
|
||||
entries: Record<
|
||||
string,
|
||||
{
|
||||
enabled?: boolean;
|
||||
hooks?: {
|
||||
allowPromptInjection?: boolean;
|
||||
};
|
||||
config?: unknown;
|
||||
}
|
||||
>;
|
||||
slots: {
|
||||
memory?: string | null;
|
||||
};
|
||||
};
|
||||
normalizedConfig: NormalizedPluginsConfig;
|
||||
rootConfig: OpenClawConfig;
|
||||
validateOnly: boolean;
|
||||
createApi: (
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { NormalizedPluginsConfig } from "../../plugins/config-state.js";
|
||||
import type { PluginCandidate } from "../../plugins/discovery.js";
|
||||
import type { PluginManifestRecord } from "../../plugins/manifest-registry.js";
|
||||
import type { PluginRecord } from "../../plugins/registry.js";
|
||||
@ -45,21 +46,7 @@ export type ExtensionHostActivationPolicyOutcome =
|
||||
export function resolveExtensionHostActivationPolicy(params: {
|
||||
candidate: PluginCandidate;
|
||||
manifestRecord: PluginManifestRecord;
|
||||
normalizedConfig: {
|
||||
entries: Record<
|
||||
string,
|
||||
{
|
||||
enabled?: boolean;
|
||||
hooks?: {
|
||||
allowPromptInjection?: boolean;
|
||||
};
|
||||
config?: unknown;
|
||||
}
|
||||
>;
|
||||
slots: {
|
||||
memory?: string | null;
|
||||
};
|
||||
};
|
||||
normalizedConfig: NormalizedPluginsConfig;
|
||||
rootConfig: OpenClawConfig;
|
||||
seenIds: Map<string, PluginRecord["origin"]>;
|
||||
selectedMemoryPluginId: string | null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user