refactor: Update variable syntax to support agent context markers

Extend variable pattern matching to support both `#` and `@` markers,
with `@` specifically used for agent context variables. Update regex
patterns, text processing logic, and add sub-graph persistence for agent
variable handling.
This commit is contained in:
zhsama
2026-01-13 16:40:34 +08:00
parent 9b961fb41e
commit ddbbddbd14
10 changed files with 155 additions and 89 deletions

View File

@ -340,7 +340,7 @@ Thought: {{agent_scratchpad}}
}
export const VAR_REGEX
= /\{\{(#[\w-]{1,50}(\.\d+)?(\.[a-z_]\w{0,29}){1,10}#)\}\}/gi
= /\{\{([#@])[\w-]{1,50}(\.\d+)?(\.[a-z_]\w{0,29}){1,10}\1\}\}/gi
export const resetReg = () => (VAR_REGEX.lastIndex = 0)