mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:21:23 +00:00
fix: run BOOT.md for each configured agent at startup (#20569)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 9098a4cc64
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
import type { WorkspaceBootstrapFile } from "../agents/workspace.js";
|
||||
import type { CliDeps } from "../cli/deps.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
export type InternalHookEventType = "command" | "session" | "agent" | "gateway" | "message";
|
||||
@@ -25,6 +26,18 @@ export type AgentBootstrapHookEvent = InternalHookEvent & {
|
||||
context: AgentBootstrapHookContext;
|
||||
};
|
||||
|
||||
export type GatewayStartupHookContext = {
|
||||
cfg?: OpenClawConfig;
|
||||
deps?: CliDeps;
|
||||
workspaceDir?: string;
|
||||
};
|
||||
|
||||
export type GatewayStartupHookEvent = InternalHookEvent & {
|
||||
type: "gateway";
|
||||
action: "startup";
|
||||
context: GatewayStartupHookContext;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// Message Hook Events
|
||||
// ============================================================================
|
||||
@@ -234,6 +247,14 @@ export function isAgentBootstrapEvent(event: InternalHookEvent): event is AgentB
|
||||
return Array.isArray(context.bootstrapFiles);
|
||||
}
|
||||
|
||||
export function isGatewayStartupEvent(event: InternalHookEvent): event is GatewayStartupHookEvent {
|
||||
if (event.type !== "gateway" || event.action !== "startup") {
|
||||
return false;
|
||||
}
|
||||
const context = event.context as GatewayStartupHookContext | null;
|
||||
return Boolean(context && typeof context === "object");
|
||||
}
|
||||
|
||||
export function isMessageReceivedEvent(
|
||||
event: InternalHookEvent,
|
||||
): event is MessageReceivedHookEvent {
|
||||
|
||||
Reference in New Issue
Block a user