UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

19 lines (18 loc) • 1.6 kB
/** * Brace expansion: the words bash makes of ONE word before any other expansion, in bash's order. A leaf (it reads the lexer * only) so that every reader of the words a command runs with reads the same expansion — the plan's words of a simple * command (shell-read-plan.ts, both faces) and the words a `for` list binds its variable to (shell-read-bindings.ts). */ import { type LexedWord } from "../../shell/lex.js"; /** How many readings one segment is read in — every combination of one value for each name its words may hold several * values of — before the reader stops claiming to know those names; and how many words one word's braces may make before * the reader stops reading them (the word then stays the word it is). */ export declare const READINGS_MAX = 64; /** The bash releases whose brace expansion makes different words of one text: 3.2 (macOS's `/bin/bash`) and every release * from 4.0 on, which pads a sequence written with a leading zero and reads a sequence's step (measured on 3.2.57 and 5.3.15). * Which one runs a command is not in the text. */ export type BashRelease = "3.2" | "4+"; /** The words a list of words makes under each bash release the text may meet ({@link braceWordsOf}): one list where every * release makes the same words, one per release where they differ — the command is then read once per list, as a word * whose names hold several values is (`readInSeveral`), and a `for` list binds its variable to every list's words. */ export declare function braceWordListsOf(words: readonly LexedWord[]): readonly (readonly LexedWord[])[];