@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
46 lines • 1.92 kB
JavaScript
// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
// bash takes `-a` / `-A` too, though its usage line names only `-fn`.
export const EXPORT_FLAGS = new Set('aAfnp');
export const READONLY_FLAGS = new Set('aAfp');
/**
* The attribute letters a no-name `declare` listing filters on: a name
* carrying any of them is listed (`declare -ix` lists both kinds).
*/
export const LISTED_ATTRIBUTES = new Set('ilnrtux');
/**
* The declaration builtins that assign whichever variable is visible, a
* function's local or else the global; `declare` and `local` make a new
* local inside a function instead.
*/
export const VISIBLE_SCOPE_BUILTINS = new Set(['export', 'readonly']);
export const ANSI_C_ESCAPES = {
'\\': '\\\\',
"'": "\\'",
'\x07': '\\a',
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\v': '\\v',
'\f': '\\f',
'\r': '\\r',
'\x1b': '\\E',
};
export const BARE_KEY_RE = /^[A-Za-z0-9_%+,./:=@~-]+$/;
// eslint-disable-next-line no-control-regex
export const CONTROL_RE = /[\x00-\x1f\x7f]/;
// `arr[0]` and friends: a target that parses as an assignment but is
// not a plain name, which the declaration builtins quote on its own.
export const SUBSCRIPT_RE = /^[A-Za-z_][A-Za-z0-9_]*\[.*\]$/;
//# sourceMappingURL=constants.js.map