refactor(codemode): rename Sandbox terminology to CodeMode (#36768)

This commit is contained in:
Aiden Cline 2026-07-13 16:38:11 -05:00 committed by GitHub
commit ecb5754f4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 257 additions and 257 deletions

View file

@ -19,7 +19,7 @@ export const escapeRegexHint =
'To match special characters like ( ) [ ] { } + * ? . literally, escape them with a backslash (e.g. "\\\\(") or test for them with String.includes instead.'
export const toHostRegex = (arg: unknown, method: string, node: AstNode, extraFlags = ""): RegExp => {
if (arg instanceof SandboxRegExp) return arg.regex
if (arg instanceof CodeModeRegExp) return arg.regex
if (typeof arg === "string") {
try {
return new RegExp(arg, extraFlags)
@ -50,7 +50,7 @@ export const matchToValue = (match: RegExpMatchArray): Array<unknown> => {
}
export const invokeRegExpMethod = (
value: SandboxRegExp,
value: CodeModeRegExp,
name: string,
args: Array<unknown>,
node: AstNode,
@ -70,5 +70,5 @@ export const invokeRegExpMethod = (
}
import { type AstNode, InterpreterRuntimeError } from "../interpreter/model.js"
import { isBlockedMember, type SafeObject } from "../tool-runtime.js"
import { SandboxRegExp } from "../values.js"
import { CodeModeRegExp } from "../values.js"
import { coerceToString } from "./value.js"