UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

25 lines (24 loc) • 2.2 kB
import { ZH_HANS_CONSTITUTION } from "./zh-Hans/constitution.js"; import { ZH_HANS_CORE_BEHAVIOR } from "./zh-Hans/core-behavior.js"; import { ZH_HANS_ENGINE } from "./zh-Hans/engine.js"; import { ZH_HANS_ENVIRONMENT } from "./zh-Hans/environment.js"; import { ZH_HANS_EVENTS } from "./zh-Hans/events.js"; import { ZH_HANS_MECHANISM } from "./zh-Hans/mechanism.js"; import { ZH_HANS_MODES } from "./zh-Hans/modes.js"; import { ZH_HANS_ROLE } from "./zh-Hans/role.js"; export const LOCALE_PACKS = { "zh-Hans": { ...ZH_HANS_ROLE, ...ZH_HANS_CONSTITUTION, ...ZH_HANS_CORE_BEHAVIOR, ...ZH_HANS_MODES, ...ZH_HANS_ENVIRONMENT, ...ZH_HANS_ENGINE, ...ZH_HANS_EVENTS, ...ZH_HANS_MECHANISM }, }; export const KEPT_TOKENS = Object.freeze([ { pattern: /`[^`\n]+`/g, why: "a code span: a command, path, identifier or literal the model types or reads back as written" }, { pattern: /<\/?[A-Za-z_][\w-]*(?:\s[^<>\n]*)?>/g, why: "an angle-bracket tag: a protocol mark the engine mints or a template's own structure" }, { pattern: /\{\{\w+\}\}/g, why: "a placeholder a renderer fills" }, { pattern: /\b(?:AskUserQuestion|SendMessage|WebFetch|WebSearch|TodoWrite|TaskCreate|TaskUpdate|TaskStop|ToolSearch)\b/g, why: "a tool name: the model calls the tool by this name" }, { pattern: /\b(?:CLAUDE|SKILL)\.md\b/g, why: "a file name the model reads or writes by this name" }, { pattern: /# (?:Harness|Environment)\b/g, why: "a heading other text names: `# Harness` is a root-exported anchor and `# Environment` the environment block's own heading, which a rendering refers to by that name" }, { pattern: /"(?:Operation not permitted|Permission denied)"/g, why: "a program's own error text: the model has to recognize it in real output" }, { pattern: /\bthey\/them\b/g, why: "the sentence is about the English pronoun; a rendering states its own neutral form beside it" }, ]); export const SECURITY_BEARING_EXEMPT = Object.freeze({ "core/environment.egress-allowlist": "'approved' names the sandbox's endpoint allowlist, a network fact the model cannot change; it asks for no approval and grants none, and a misread wording costs a failed download, not a crossed boundary", });