@sema-agent/core
Version:
Stateless, task-oriented AI agent core
37 lines (36 loc) • 1.8 kB
JavaScript
export const TOOL_FAMILIES = Object.freeze(["shell", "file-read", "file-write", "search", "web", "delegate", "plan", "scaffold", "memory", "protocol", "other"]);
export const TOOL_MOUNT_TAGS = Object.freeze(["hands", "backgroundTasks", "workflow", "delegation", "hostInternals", "peerLane", "scheduler", "memory", "scenario", "always", "optional"]);
export const TOOL_APPROVAL_CARDS = Object.freeze(["file-edit", "file-write", "notebook-edit", "shell", "fetch", "plan", "question", "generic"]);
export const TOOL_PATH_ACCESSES = Object.freeze(["read", "create", "edit"]);
export const TOOL_PATH_BASES = Object.freeze(["cwd", "root"]);
export const TOOL_PATH_ABSENCES = Object.freeze(["none", "base"]);
export function pathTargetSlotOnly(pt) {
return {
param: pt.param,
access: pt.access,
...(pt.aliases !== undefined ? { aliases: pt.aliases } : {}),
...(pt.skillScopeEligible !== undefined ? { skillScopeEligible: pt.skillScopeEligible } : {}),
};
}
export const TOOL_WIRE_NAME_MAX_CHARS = 128;
export const TOOL_CONTRACT_MAX_CHARS = 64;
export const TOOL_CARD_ID_MAX_CHARS = "mcp:".length + TOOL_WIRE_NAME_MAX_CHARS + "/".length + TOOL_WIRE_NAME_MAX_CHARS;
export const TOOL_KEY_MAX_CHARS = 256;
export const TOOL_KEYS_MAX = 1024;
export const RENDER_HINT_MAX_CHARS = 64;
export const RENDER_HINT_ACTIVITY_MAX_CHARS = 32;
export const RENDER_HINT_MAX_LIST = 16;
export const MOUNT_TAG_IN_HANDS_BAND = {
hands: true,
backgroundTasks: true,
workflow: false,
delegation: true,
hostInternals: true,
peerLane: true,
scheduler: false,
memory: false,
scenario: false,
always: false,
optional: false,
};
export const HANDS_BAND_TAGS = new Set(Object.keys(MOUNT_TAG_IN_HANDS_BAND).filter((t) => MOUNT_TAG_IN_HANDS_BAND[t]));