openclaw/src/config/types.agents.ts
kumarabhirup e4c94cc012
Merge upstream openclaw/main into ironclaw
Resolve 17 merge conflicts preserving ironclaw branding while
incorporating all upstream bug fixes and feature updates:

- Keep ironclaw name, CLI branding, and custom web app bundling
- Take upstream's new gateway auth token auto-generation
- Take upstream's shouldSkipRespawnForArgv respawn guard
- Take upstream's refactored skills frontmatter (resolveOpenClawManifestBlock)
- Merge upstream's ~/.agents/skills path + ironclaw's bundled skills watcher
- Take upstream's new GatewayToolsConfig alongside ironclaw's GatewayWebAppConfig
- Take upstream's minimalTestGateway guard in server.impl.ts
- Take upstream's refactored fs-mocked tests with ironclaw variants
- Take upstream's system message + subagent polling guidance tests
- Take upstream's dynamic import pattern in onboarding wizard
- Fix extensions/feishu workspace reference (openclaw -> ironclaw)
- Regenerate pnpm-lock.yaml with updated dependencies

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-15 15:17:52 -08:00

98 lines
3.2 KiB
TypeScript

import type { ChatType } from "../channels/chat-type.js";
import type { AgentDefaultsConfig } from "./types.agent-defaults.js";
import type { HumanDelayConfig, IdentityConfig } from "./types.base.js";
import type { GroupChatConfig } from "./types.messages.js";
import type {
SandboxBrowserSettings,
SandboxDockerSettings,
SandboxPruneSettings,
} from "./types.sandbox.js";
import type { AgentToolsConfig, MemorySearchConfig } from "./types.tools.js";
export type AgentModelConfig =
| string
| {
/** Primary model (provider/model). */
primary?: string;
/** Per-agent model fallbacks (provider/model). */
fallbacks?: string[];
};
export type AgentConfig = {
id: string;
default?: boolean;
name?: string;
workspace?: string;
agentDir?: string;
model?: AgentModelConfig;
/** Optional allowlist of skills for this agent (omit = all skills; empty = none). */
skills?: string[];
memorySearch?: MemorySearchConfig;
/** Human-like delay between block replies for this agent. */
humanDelay?: HumanDelayConfig;
/** Optional per-agent heartbeat overrides. */
heartbeat?: AgentDefaultsConfig["heartbeat"];
identity?: IdentityConfig;
groupChat?: GroupChatConfig;
subagents?: {
/** Allow spawning sub-agents under other agent ids. Use "*" to allow any. */
allowAgents?: string[];
/** Per-agent default model for spawned sub-agents (string or {primary,fallbacks}). */
model?: string | { primary?: string; fallbacks?: string[] };
};
sandbox?: {
mode?: "off" | "non-main" | "all";
/** Agent workspace access inside the sandbox. */
workspaceAccess?: "none" | "ro" | "rw";
/**
* Session tools visibility for sandboxed sessions.
* - "spawned": only allow session tools to target sessions spawned from this session (default)
* - "all": allow session tools to target any session
*/
sessionToolsVisibility?: "spawned" | "all";
/** Container/workspace scope for sandbox isolation. */
scope?: "session" | "agent" | "shared";
/** Legacy alias for scope ("session" when true, "shared" when false). */
perSession?: boolean;
workspaceRoot?: string;
/** Docker-specific sandbox overrides for this agent. */
docker?: SandboxDockerSettings;
/** Optional sandboxed browser overrides for this agent. */
browser?: SandboxBrowserSettings;
/** Auto-prune overrides for this agent. */
prune?: SandboxPruneSettings;
};
tools?: AgentToolsConfig;
};
/**
* LLM engine to use for agent runs.
* - "aisdk": Vercel AI SDK (default for new installations)
* - "pi-agent": Original pi-agent implementation
*/
export type LlmEngineType = "aisdk" | "pi-agent";
export type AgentsConfig = {
/**
* LLM engine to use for agent runs.
* - "aisdk": Vercel AI SDK (default for new installations)
* - "pi-agent": Original pi-agent implementation
*/
engine?: LlmEngineType;
defaults?: AgentDefaultsConfig;
list?: AgentConfig[];
};
export type AgentBinding = {
agentId: string;
match: {
channel: string;
accountId?: string;
peer?: { kind: ChatType; id: string };
guildId?: string;
teamId?: string;
/** Discord role IDs used for role-based routing. */
roles?: string[];
};
};