shfs 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -321,7 +321,8 @@ function compileCat(cmd$1) {
321
321
  const parsed = parseArgs(cmd$1.args.map(expandedWordToString), flags);
322
322
  const fileArgs = [];
323
323
  for (const arg of cmd$1.args) if (!expandedWordToString(arg).startsWith("-")) fileArgs.push(arg);
324
- if (fileArgs.length === 0) throw new Error("cat requires at least one file");
324
+ const hasInputRedirection = cmd$1.redirections.some((redirection) => redirection.kind === "input");
325
+ if (fileArgs.length === 0 && !hasInputRedirection) throw new Error("cat requires at least one file");
325
326
  return {
326
327
  cmd: "cat",
327
328
  args: {
@@ -686,7 +687,10 @@ var ProgramCompiler = class {
686
687
  compileCommandToStep(cmd$1) {
687
688
  const cmdName = this.extractLiteralString(cmd$1.name);
688
689
  if (!cmdName) throw new Error("Command name must be a literal string");
689
- return CommandHandler.get(cmdName)(cmd$1);
690
+ return {
691
+ ...CommandHandler.get(cmdName)(cmd$1),
692
+ redirections: cmd$1.redirections
693
+ };
690
694
  }
691
695
  /**
692
696
  * Extract the literal string value from an ExpandedWord.
@@ -2280,6 +2284,7 @@ async function* files(...paths) {
2280
2284
 
2281
2285
  //#endregion
2282
2286
  //#region src/execute/execute.ts
2287
+ const textEncoder = new TextEncoder();
2283
2288
  /**
2284
2289
  * Execute compiles a PipelineIR into an executable result.
2285
2290
  * Returns either a stream (for producers/transducers) or a promise (for sinks).
@@ -2290,15 +2295,20 @@ function execute(ir, fs) {
2290
2295
  kind: "stream",
2291
2296
  value: (async function* () {})()
2292
2297
  };
2298
+ let result;
2293
2299
  switch (step.cmd) {
2294
- case "cat": return {
2295
- kind: "stream",
2296
- value: pipe(files(...extractPathsFromExpandedWords(step.args.files)), cat(fs))
2297
- };
2300
+ case "cat": {
2301
+ const inputPath = getRedirectPath(step.redirections, "input");
2302
+ result = {
2303
+ kind: "stream",
2304
+ value: pipe(files(...withInputRedirect(extractPathsFromExpandedWords(step.args.files), inputPath)), cat(fs))
2305
+ };
2306
+ break;
2307
+ }
2298
2308
  case "cp": {
2299
2309
  const srcPaths = extractPathsFromExpandedWords(step.args.srcs);
2300
2310
  const destPath = expandedWordToString(step.args.dest);
2301
- return {
2311
+ result = {
2302
2312
  kind: "sink",
2303
2313
  value: Promise.all(map(srcPaths, (src) => cp(fs)({
2304
2314
  src,
@@ -2306,71 +2316,121 @@ function execute(ir, fs) {
2306
2316
  recursive: step.args.recursive
2307
2317
  }))).then()
2308
2318
  };
2319
+ break;
2320
+ }
2321
+ case "head": {
2322
+ const inputPath = getRedirectPath(step.redirections, "input");
2323
+ result = {
2324
+ kind: "stream",
2325
+ value: pipe(files(...withInputRedirect(extractPathsFromExpandedWords(step.args.files), inputPath)), headWithN(fs, step.args.n))
2326
+ };
2327
+ break;
2309
2328
  }
2310
- case "head": return {
2311
- kind: "stream",
2312
- value: pipe(files(...extractPathsFromExpandedWords(step.args.files)), headWithN(fs, step.args.n))
2313
- };
2314
2329
  case "ls": {
2315
2330
  const paths = extractPathsFromExpandedWords(step.args.paths);
2316
- return {
2331
+ result = {
2317
2332
  kind: "stream",
2318
2333
  value: (async function* () {
2319
2334
  const results = await Promise.all(map(paths, (path) => ls(fs, path))).then();
2320
2335
  for (const file of results) yield* file;
2321
2336
  })()
2322
2337
  };
2338
+ break;
2323
2339
  }
2324
2340
  case "mkdir": {
2325
2341
  const paths = extractPathsFromExpandedWords(step.args.paths);
2326
- return {
2342
+ result = {
2327
2343
  kind: "sink",
2328
2344
  value: Promise.all(map(paths, (path) => mkdir(fs)({
2329
2345
  path,
2330
2346
  recursive: step.args.recursive
2331
2347
  }))).then()
2332
2348
  };
2349
+ break;
2333
2350
  }
2334
2351
  case "mv": {
2335
2352
  const srcPaths = extractPathsFromExpandedWords(step.args.srcs);
2336
2353
  const destPath = expandedWordToString(step.args.dest);
2337
- return {
2354
+ result = {
2338
2355
  kind: "sink",
2339
2356
  value: mv(fs)({
2340
2357
  srcs: srcPaths,
2341
2358
  dest: destPath
2342
2359
  })
2343
2360
  };
2361
+ break;
2344
2362
  }
2345
2363
  case "rm": {
2346
2364
  const paths = extractPathsFromExpandedWords(step.args.paths);
2347
- return {
2365
+ result = {
2348
2366
  kind: "sink",
2349
2367
  value: Promise.all(map(paths, (path) => rm(fs)({
2350
2368
  path,
2351
2369
  recursive: step.args.recursive
2352
2370
  }))).then()
2353
2371
  };
2372
+ break;
2354
2373
  }
2355
2374
  case "tail": {
2356
- const filePaths = extractPathsFromExpandedWords(step.args.files);
2357
- return {
2375
+ const inputPath = getRedirectPath(step.redirections, "input");
2376
+ const filePaths = withInputRedirect(extractPathsFromExpandedWords(step.args.files), inputPath);
2377
+ result = {
2358
2378
  kind: "stream",
2359
2379
  value: (async function* () {
2360
2380
  const results = await Promise.all(map(filePaths, (file) => pipe(files(file), cat(fs), tail(step.args.n))));
2361
2381
  for (const lines of results) yield* lines;
2362
2382
  })()
2363
2383
  };
2384
+ break;
2364
2385
  }
2365
2386
  case "touch": {
2366
2387
  const filePaths = extractPathsFromExpandedWords(step.args.files);
2367
- return {
2388
+ result = {
2368
2389
  kind: "sink",
2369
2390
  value: touch(fs)({ files: filePaths })
2370
2391
  };
2392
+ break;
2371
2393
  }
2372
2394
  default: throw new Error(`Unknown command: ${String(step.cmd)}`);
2373
2395
  }
2396
+ return applyOutputRedirect(result, step, fs);
2397
+ }
2398
+ function getRedirectPath(redirections, kind) {
2399
+ if (!redirections) return null;
2400
+ let redirectedPath = null;
2401
+ for (const redirection of redirections) if (redirection.kind === kind) redirectedPath = expandedWordToString(redirection.target);
2402
+ return redirectedPath;
2403
+ }
2404
+ function withInputRedirect(paths, inputPath) {
2405
+ if (paths.length > 0 || !inputPath) return paths;
2406
+ return [inputPath];
2407
+ }
2408
+ function applyOutputRedirect(result, step, fs) {
2409
+ const outputPath = getRedirectPath(step.redirections, "output");
2410
+ if (!outputPath) return result;
2411
+ if (result.kind === "stream") return {
2412
+ kind: "sink",
2413
+ value: writeStreamToFile(result.value, outputPath, fs)
2414
+ };
2415
+ return {
2416
+ kind: "sink",
2417
+ value: result.value.then(async () => {
2418
+ await fs.writeFile(outputPath, textEncoder.encode(""));
2419
+ })
2420
+ };
2421
+ }
2422
+ async function writeStreamToFile(stream, path, fs) {
2423
+ const outputChunks = [];
2424
+ for await (const record of stream) outputChunks.push(formatRecord(record));
2425
+ await fs.writeFile(path, textEncoder.encode(outputChunks.join("\n")));
2426
+ }
2427
+ function formatRecord(record) {
2428
+ switch (record.kind) {
2429
+ case "line": return record.text;
2430
+ case "file": return record.path;
2431
+ case "json": return JSON.stringify(record.value);
2432
+ default: throw new Error("Unknown record kind");
2433
+ }
2374
2434
  }
2375
2435
 
2376
2436
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["map","files","SourcePosition","Token","StringSourceReader","ParseSyntaxError","Parser","files"],"sources":["../../compiler/dist/index.mjs","../src/consumer/consumer.ts","../src/operator/cat/cat.ts","../src/operator/cp/cp.ts","../src/operator/head/head.ts","../src/operator/ls/ls.ts","../src/operator/mkdir/mkdir.ts","../src/operator/mv/mv.ts","../src/operator/rm/rm.ts","../src/operator/tail/tail.ts","../src/operator/touch/touch.ts","../src/execute/producers.ts","../src/execute/execute.ts","../src/util/lazy.ts","../src/shell/shell.ts"],"sourcesContent":["//#region src/ir.ts\n/**\n* Create a literal ExpandedWord.\n*/\nfunction literal(value) {\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue\n\t};\n}\n/**\n* Create a SimpleCommandIR for testing purposes.\n* Convenience helper that creates a command with a name and arguments.\n*/\nfunction cmd(name, args) {\n\treturn {\n\t\tname: literal(name),\n\t\targs,\n\t\tredirections: []\n\t};\n}\n/**\n* Create a glob ExpandedWord.\n*/\nfunction glob(pattern, expanded = []) {\n\treturn {\n\t\tkind: \"glob\",\n\t\tpattern,\n\t\texpanded\n\t};\n}\n/**\n* Create a command substitution ExpandedWord.\n*/\nfunction commandSub(command, output = []) {\n\treturn {\n\t\tkind: \"commandSub\",\n\t\tcommand,\n\t\toutput\n\t};\n}\n/**\n* Extract the string value from an ExpandedWord.\n* For globs, returns the pattern. For command subs, returns the command.\n*/\nfunction expandedWordToString(word) {\n\tswitch (word.kind) {\n\t\tcase \"literal\": return word.value;\n\t\tcase \"glob\": return word.pattern;\n\t\tcase \"commandSub\": return word.command;\n\t\tdefault: {\n\t\t\tconst _exhaustive = word;\n\t\t\tthrow new Error(`Unknown word kind: ${JSON.stringify(_exhaustive)}`);\n\t\t}\n\t}\n}\n/**\n* Extract paths from an array of ExpandedWords.\n* For globs and command subs, expands to their resolved values.\n*/\nfunction extractPathsFromExpandedWords(words) {\n\treturn words.flatMap((word) => {\n\t\tswitch (word.kind) {\n\t\t\tcase \"literal\": return [word.value];\n\t\t\tcase \"glob\": return word.expanded.length > 0 ? word.expanded : [word.pattern];\n\t\t\tcase \"commandSub\": return word.output;\n\t\t\tdefault: {\n\t\t\t\tconst _exhaustive = word;\n\t\t\t\tthrow new Error(`Unknown word kind: ${JSON.stringify(_exhaustive)}`);\n\t\t\t}\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/compile/command/arg/utils.ts\nconst NEGATIVE_NUMBER_REGEX$2 = /^(?:-\\d+(?:\\.\\d+)?|-\\.\\d+)$/;\nfunction isNegativeNumberToken(token) {\n\treturn NEGATIVE_NUMBER_REGEX$2.test(token);\n}\nfunction startsWithLongPrefix(token) {\n\treturn token.length >= 2 && token[0] === \"-\" && token[1] === \"-\";\n}\nfunction startsWithShortPrefix(token) {\n\treturn token.length >= 1 && token[0] === \"-\" && !startsWithLongPrefix(token);\n}\nfunction startsWithNoLongPrefix(token) {\n\treturn token.startsWith(\"--no-\") && token.length > 5;\n}\nfunction splitNameBeforeEquals(token) {\n\tconst eq = token.indexOf(\"=\");\n\treturn eq === -1 ? token : token.slice(0, eq);\n}\n\n//#endregion\n//#region src/compile/command/arg/parse.ts\nconst SHORT_NAME_REGEX = /^[A-Za-z]$/;\nconst LONG_NAME_REGEX = /^[A-Za-z0-9][A-Za-z0-9-]*$/;\nfunction parseArgs(args, flagDefs) {\n\tconst index = buildFlagIndex(flagDefs);\n\tconst flags$1 = Object.create(null);\n\tconst positional = [];\n\tlet endOfFlags = false;\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst token = args[i];\n\t\tif (token === void 0) continue;\n\t\tif (endOfFlags) {\n\t\t\tpositional.push(token);\n\t\t\tcontinue;\n\t\t}\n\t\tif (token === \"--\") {\n\t\t\tendOfFlags = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (token === \"-\") {\n\t\t\tpositional.push(token);\n\t\t\tcontinue;\n\t\t}\n\t\tif (isNegativeNumberToken(token)) {\n\t\t\tpositional.push(token);\n\t\t\tcontinue;\n\t\t}\n\t\tif (startsWithLongPrefix(token)) {\n\t\t\ti = parseLongToken(args, i, token, index, flags$1);\n\t\t\tcontinue;\n\t\t}\n\t\tif (startsWithShortPrefix(token)) {\n\t\t\ti = parseShortToken(args, i, token, index, flags$1);\n\t\t\tcontinue;\n\t\t}\n\t\tpositional.push(token);\n\t}\n\treturn {\n\t\tflags: flags$1,\n\t\tpositional\n\t};\n}\nfunction buildFlagIndex(flagDefs) {\n\tconst short = /* @__PURE__ */ new Map();\n\tconst long = /* @__PURE__ */ new Map();\n\tconst add = (map, token, entry) => {\n\t\tconst prev = map.get(token);\n\t\tif (!prev) {\n\t\t\tmap.set(token, entry);\n\t\t\treturn;\n\t\t}\n\t\tthrow new Error(`Duplicate flag token \"${token}\" for \"${entry.canonical}\" and \"${prev.canonical}\"`);\n\t};\n\tfor (const [canonical, def] of Object.entries(flagDefs)) {\n\t\tif (!SHORT_NAME_REGEX.test(def.short)) throw new Error(`Invalid short flag for \"${canonical}\": \"${def.short}\". Expected a single letter [A-Za-z].`);\n\t\tadd(short, `-${def.short}`, {\n\t\t\tcanonical,\n\t\t\tdef\n\t\t});\n\t\tif (def.long) {\n\t\t\tif (!LONG_NAME_REGEX.test(def.long)) throw new Error(`Invalid long flag for \"${canonical}\": \"${def.long}\". Expected [A-Za-z0-9][A-Za-z0-9-]*.`);\n\t\t\tadd(long, `--${def.long}`, {\n\t\t\t\tcanonical,\n\t\t\t\tdef\n\t\t\t});\n\t\t}\n\t}\n\tconst isFlagToken = (token) => {\n\t\tif (token === \"--\") return true;\n\t\tif (token === \"-\") return false;\n\t\tif (startsWithLongPrefix(token)) {\n\t\t\tconst name = splitNameBeforeEquals(token);\n\t\t\tif (long.has(name)) return true;\n\t\t\tif (startsWithNoLongPrefix(name)) {\n\t\t\t\tconst base = `--${name.slice(5)}`;\n\t\t\t\tconst entry = long.get(base);\n\t\t\t\treturn !!entry && !entry.def.takesValue;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tif (startsWithShortPrefix(token)) {\n\t\t\tconst ch = token[1] ?? \"\";\n\t\t\tif (!SHORT_NAME_REGEX.test(ch)) return false;\n\t\t\treturn short.has(`-${ch}`);\n\t\t}\n\t\treturn false;\n\t};\n\treturn {\n\t\tshort,\n\t\tlong,\n\t\tisFlagToken\n\t};\n}\nfunction parseLongToken(args, index, token, flagsIndex, out) {\n\tif (startsWithNoLongPrefix(token) && !token.includes(\"=\")) {\n\t\tconst base = `--${token.slice(5)}`;\n\t\tconst entry$1 = flagsIndex.long.get(base);\n\t\tif (!entry$1) throw new Error(`Unknown flag: ${token}`);\n\t\tif (entry$1.def.takesValue) throw new Error(`Flag ${base} takes a value; \"${token}\" is invalid.`);\n\t\tsetBoolean(out, entry$1.canonical, false);\n\t\treturn index;\n\t}\n\tif (token.includes(\"=\")) {\n\t\tconst eq = token.indexOf(\"=\");\n\t\tconst name = token.slice(0, eq);\n\t\tconst value$1 = token.slice(eq + 1);\n\t\tconst entry$1 = flagsIndex.long.get(name);\n\t\tif (!entry$1) throw new Error(`Unknown flag: ${name}`);\n\t\tif (!entry$1.def.takesValue) throw new Error(`Flag ${name} does not take a value.`);\n\t\tsetValue(out, entry$1, value$1);\n\t\treturn index;\n\t}\n\tconst entry = flagsIndex.long.get(token);\n\tif (!entry) throw new Error(`Unknown flag: ${token}`);\n\tif (!entry.def.takesValue) {\n\t\tsetBoolean(out, entry.canonical, true);\n\t\treturn index;\n\t}\n\tconst { value, newIndex } = consumeValue(args, index, token, flagsIndex);\n\tsetValue(out, entry, value);\n\treturn newIndex;\n}\nfunction parseShortToken(args, index, token, flagsIndex, out) {\n\tif (token.length >= 3 && token[2] === \"=\") {\n\t\tconst name = token.slice(0, 2);\n\t\tconst value = token.slice(3);\n\t\tconst entry = flagsIndex.short.get(name);\n\t\tif (!entry) throw new Error(`Unknown flag: ${name}`);\n\t\tif (!entry.def.takesValue) throw new Error(`Flag ${name} does not take a value.`);\n\t\tsetValue(out, entry, value);\n\t\treturn index;\n\t}\n\tif (token.length === 2) {\n\t\tconst entry = flagsIndex.short.get(token);\n\t\tif (!entry) throw new Error(`Unknown flag: ${token}`);\n\t\tif (!entry.def.takesValue) {\n\t\t\tsetBoolean(out, entry.canonical, true);\n\t\t\treturn index;\n\t\t}\n\t\tconst { value, newIndex } = consumeValue(args, index, token, flagsIndex);\n\t\tsetValue(out, entry, value);\n\t\treturn newIndex;\n\t}\n\tfor (let j = 1; j < token.length; j++) {\n\t\tconst ch = token[j] ?? \"\";\n\t\tif (!SHORT_NAME_REGEX.test(ch)) throw new Error(`Invalid short flag character \"${ch}\" in \"${token}\". Short flags must be letters.`);\n\t\tconst name = `-${ch}`;\n\t\tconst entry = flagsIndex.short.get(name);\n\t\tif (!entry) throw new Error(`Unknown flag: ${name}`);\n\t\tif (!entry.def.takesValue) {\n\t\t\tsetBoolean(out, entry.canonical, true);\n\t\t\tcontinue;\n\t\t}\n\t\tconst rest = token.slice(j + 1);\n\t\tif (rest.startsWith(\"=\")) {\n\t\t\tsetValue(out, entry, rest.slice(1));\n\t\t\treturn index;\n\t\t}\n\t\tif (rest.length === 0) {\n\t\t\tconst { value, newIndex } = consumeValue(args, index, name, flagsIndex);\n\t\t\tsetValue(out, entry, value);\n\t\t\treturn newIndex;\n\t\t}\n\t\tconst first = rest[0] ?? \"\";\n\t\tif (SHORT_NAME_REGEX.test(first) && flagsIndex.short.has(`-${first}`)) throw new Error(`Ambiguous short flag cluster \"${token}\": ${name} takes a value, but \"${rest}\" begins with \"-${first}\" which is also a flag. Use \"${name}=${rest}\" or pass the value as a separate argument.`);\n\t\tsetValue(out, entry, rest);\n\t\treturn index;\n\t}\n\treturn index;\n}\nfunction consumeValue(args, index, flagToken, flagsIndex) {\n\tconst nextIndex = index + 1;\n\tif (nextIndex >= args.length) throw new Error(`Flag ${flagToken} requires a value.`);\n\tconst next = args[nextIndex];\n\tif (next === void 0) throw new Error(`Flag ${flagToken} requires a value.`);\n\tif (next === \"--\") throw new Error(`Flag ${flagToken} requires a value (got \"--\").`);\n\tif (flagsIndex.isFlagToken(next)) throw new Error(`Flag ${flagToken} requires a value (got \"${next}\").`);\n\treturn {\n\t\tvalue: next,\n\t\tnewIndex: nextIndex\n\t};\n}\nfunction setBoolean(out, canonical, value) {\n\tout[canonical] = value;\n}\nfunction setValue(out, entry, value) {\n\tconst { canonical, def } = entry;\n\tconst existing = out[canonical];\n\tif (existing === void 0) {\n\t\tout[canonical] = value;\n\t\treturn;\n\t}\n\tif (!def.multiple) throw new Error(`Duplicate flag \"${canonical}\". If it is intended to repeat, set { multiple: true } in its definition.`);\n\tif (Array.isArray(existing)) {\n\t\texisting.push(value);\n\t\treturn;\n\t}\n\tif (typeof existing === \"string\") {\n\t\tout[canonical] = [existing, value];\n\t\treturn;\n\t}\n\tthrow new Error(`Invalid state for flag \"${canonical}\".`);\n}\n\n//#endregion\n//#region src/compile/command/cat/cat.ts\n/**\n* cat command handler for the AST-based compiler.\n*/\nconst flags = {\n\tnumber: {\n\t\tshort: \"n\",\n\t\ttakesValue: false\n\t},\n\tnumberNonBlank: {\n\t\tshort: \"b\",\n\t\ttakesValue: false\n\t},\n\tshowAll: {\n\t\tshort: \"A\",\n\t\ttakesValue: false\n\t},\n\tshowEnds: {\n\t\tshort: \"E\",\n\t\ttakesValue: false\n\t},\n\tshowNonprinting: {\n\t\tshort: \"v\",\n\t\ttakesValue: false\n\t},\n\tshowTabs: {\n\t\tshort: \"T\",\n\t\ttakesValue: false\n\t},\n\tsqueezeBlank: {\n\t\tshort: \"s\",\n\t\ttakesValue: false\n\t}\n};\n/**\n* Compile a cat command from SimpleCommandIR to StepIR.\n*/\nfunction compileCat(cmd$1) {\n\tconst parsed = parseArgs(cmd$1.args.map(expandedWordToString), flags);\n\tconst fileArgs = [];\n\tfor (const arg of cmd$1.args) if (!expandedWordToString(arg).startsWith(\"-\")) fileArgs.push(arg);\n\tif (fileArgs.length === 0) throw new Error(\"cat requires at least one file\");\n\treturn {\n\t\tcmd: \"cat\",\n\t\targs: {\n\t\t\tfiles: fileArgs,\n\t\t\tnumberLines: parsed.flags.number === true,\n\t\t\tnumberNonBlank: parsed.flags.numberNonBlank === true,\n\t\t\tshowAll: parsed.flags.showAll === true,\n\t\t\tshowEnds: parsed.flags.showEnds === true,\n\t\t\tshowNonprinting: parsed.flags.showNonprinting === true,\n\t\t\tshowTabs: parsed.flags.showTabs === true,\n\t\t\tsqueezeBlank: parsed.flags.squeezeBlank === true\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/cp/cp.ts\n/**\n* cp command handler for the AST-based compiler.\n*/\n/**\n* Compile a cp command from SimpleCommandIR to StepIR.\n*/\nfunction compileCp(cmd$1) {\n\tlet recursive = false;\n\tconst filteredArgs = [];\n\tfor (const arg of cmd$1.args) {\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-r\") recursive = true;\n\t\telse if (argStr !== \"-f\" && argStr !== \"-i\") filteredArgs.push(arg);\n\t}\n\tif (filteredArgs.length < 2) throw new Error(\"cp requires source and destination\");\n\tconst dest = filteredArgs.pop();\n\tif (!dest) throw new Error(\"cp requires source and destination\");\n\treturn {\n\t\tcmd: \"cp\",\n\t\targs: {\n\t\t\tdest,\n\t\t\trecursive,\n\t\t\tsrcs: filteredArgs\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/head/head.ts\n/**\n* head command handler for the AST-based compiler.\n*/\nconst NEGATIVE_NUMBER_REGEX$1 = /^-\\d+$/;\n/**\n* Compile a head command from SimpleCommandIR to StepIR.\n*/\nfunction compileHead(cmd$1) {\n\tlet n = 10;\n\tconst files = [];\n\tlet skipNext = false;\n\tfor (let i = 0; i < cmd$1.args.length; i++) {\n\t\tif (skipNext) {\n\t\t\tskipNext = false;\n\t\t\tcontinue;\n\t\t}\n\t\tconst arg = cmd$1.args[i];\n\t\tif (!arg) continue;\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-n\") {\n\t\t\tconst numArg = cmd$1.args[i + 1];\n\t\t\tif (!numArg) throw new Error(\"head -n requires a number\");\n\t\t\tn = Number(expandedWordToString(numArg));\n\t\t\tif (!Number.isFinite(n)) throw new Error(\"Invalid head count\");\n\t\t\tskipNext = true;\n\t\t} else if (argStr.startsWith(\"-\") && NEGATIVE_NUMBER_REGEX$1.test(argStr)) n = Number(argStr.slice(1));\n\t\telse if (argStr.startsWith(\"-\")) throw new Error(\"Unknown head option\");\n\t\telse files.push(arg);\n\t}\n\treturn {\n\t\tcmd: \"head\",\n\t\targs: {\n\t\t\tfiles,\n\t\t\tn\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/ls/ls.ts\n/**\n* ls command handler for the AST-based compiler.\n*/\n/**\n* Compile an ls command from SimpleCommandIR to StepIR.\n*/\nfunction compileLs(cmd$1) {\n\treturn {\n\t\tcmd: \"ls\",\n\t\targs: { paths: cmd$1.args.length === 0 ? [literal(\".\")] : cmd$1.args }\n\t};\n}\n\n//#endregion\n//#region src/compile/command/mkdir/mkdir.ts\n/**\n* mkdir command handler for the AST-based compiler.\n*/\n/**\n* Compile a mkdir command from SimpleCommandIR to StepIR.\n*/\nfunction compileMkdir(cmd$1) {\n\tlet recursive = false;\n\tconst paths = [];\n\tfor (const arg of cmd$1.args) if (expandedWordToString(arg) === \"-p\") recursive = true;\n\telse paths.push(arg);\n\tif (paths.length === 0) throw new Error(\"mkdir requires at least one path\");\n\treturn {\n\t\tcmd: \"mkdir\",\n\t\targs: {\n\t\t\tpaths,\n\t\t\trecursive\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/mv/mv.ts\n/**\n* mv command handler for the AST-based compiler.\n*/\n/**\n* Compile a mv command from SimpleCommandIR to StepIR.\n*/\nfunction compileMv(cmd$1) {\n\tconst filteredArgs = [];\n\tfor (const arg of cmd$1.args) {\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr !== \"-f\" && argStr !== \"-i\") filteredArgs.push(arg);\n\t}\n\tif (filteredArgs.length < 2) throw new Error(\"mv requires source and destination\");\n\tconst dest = filteredArgs.pop();\n\tif (!dest) throw new Error(\"mv requires source and destination\");\n\treturn {\n\t\tcmd: \"mv\",\n\t\targs: {\n\t\t\tdest,\n\t\t\tsrcs: filteredArgs\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/rm/rm.ts\n/**\n* rm command handler for the AST-based compiler.\n*/\n/**\n* Compile a rm command from SimpleCommandIR to StepIR.\n*/\nfunction compileRm(cmd$1) {\n\tlet recursive = false;\n\tconst paths = [];\n\tfor (const arg of cmd$1.args) {\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-r\") recursive = true;\n\t\telse if (argStr !== \"-f\" && argStr !== \"-i\") paths.push(arg);\n\t}\n\tif (paths.length === 0) throw new Error(\"rm requires at least one path\");\n\treturn {\n\t\tcmd: \"rm\",\n\t\targs: {\n\t\t\tpaths,\n\t\t\trecursive\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/tail/tail.ts\n/**\n* tail command handler for the AST-based compiler.\n*/\nconst NEGATIVE_NUMBER_REGEX = /^-\\d+$/;\n/**\n* Compile a tail command from SimpleCommandIR to StepIR.\n*/\nfunction compileTail(cmd$1) {\n\tlet n = 10;\n\tconst files = [];\n\tlet skipNext = false;\n\tfor (let i = 0; i < cmd$1.args.length; i++) {\n\t\tif (skipNext) {\n\t\t\tskipNext = false;\n\t\t\tcontinue;\n\t\t}\n\t\tconst arg = cmd$1.args[i];\n\t\tif (!arg) continue;\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-n\") {\n\t\t\tconst numArg = cmd$1.args[i + 1];\n\t\t\tif (!numArg) throw new Error(\"tail -n requires a number\");\n\t\t\tn = Number(expandedWordToString(numArg));\n\t\t\tif (!Number.isFinite(n)) throw new Error(\"Invalid tail count\");\n\t\t\tskipNext = true;\n\t\t} else if (argStr.startsWith(\"-\") && NEGATIVE_NUMBER_REGEX.test(argStr)) n = Number(argStr.slice(1));\n\t\telse if (argStr.startsWith(\"-\")) throw new Error(\"Unknown tail option\");\n\t\telse files.push(arg);\n\t}\n\treturn {\n\t\tcmd: \"tail\",\n\t\targs: {\n\t\t\tfiles,\n\t\t\tn\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/touch/touch.ts\n/**\n* touch command handler for the AST-based compiler.\n*/\n/**\n* Compile a touch command from SimpleCommandIR to StepIR.\n*/\nfunction compileTouch(cmd$1) {\n\tconst files = [];\n\tfor (const arg of cmd$1.args) if (!expandedWordToString(arg).startsWith(\"-\")) files.push(arg);\n\tif (files.length === 0) throw new Error(\"touch requires at least one file\");\n\treturn {\n\t\tcmd: \"touch\",\n\t\targs: { files }\n\t};\n}\n\n//#endregion\n//#region src/compile/command/handler.ts\nlet CommandHandler;\n(function(_CommandHandler) {\n\tconst handlers = {\n\t\tcat: compileCat,\n\t\tcp: compileCp,\n\t\thead: compileHead,\n\t\tls: compileLs,\n\t\tmkdir: compileMkdir,\n\t\tmv: compileMv,\n\t\trm: compileRm,\n\t\ttail: compileTail,\n\t\ttouch: compileTouch\n\t};\n\tfunction get(name) {\n\t\tconst handler = handlers[name];\n\t\tif (!handler) throw new Error(`Unknown command: ${name}`);\n\t\treturn handler;\n\t}\n\t_CommandHandler.get = get;\n\tfunction has(name) {\n\t\treturn name in handlers;\n\t}\n\t_CommandHandler.has = has;\n\tfunction register(name, handler) {\n\t\thandlers[name] = handler;\n\t}\n\t_CommandHandler.register = register;\n})(CommandHandler || (CommandHandler = {}));\n\n//#endregion\n//#region src/compile/compile.ts\n/**\n* AST-based compiler for the Fish subset parser.\n*\n* This compiler traverses the AST and produces a PipelineIR\n* with enhanced word expansion information.\n*\n* Key differences from the old compile.ts:\n* - Accepts Program from the new parser (not ShellAST)\n* - Produces PipelineIR with ExpandedWord types\n* - Preserves word structure for runtime expansion\n*/\n/**\n* Compile a Program AST to a PipelineIR.\n*\n* @param program The parsed Program AST\n* @returns The compiled PipelineIR\n*/\nfunction compile(program) {\n\treturn new ProgramCompiler().compileProgram(program);\n}\n/**\n* Compiler that traverses the AST to produce IR.\n*\n* Note: We don't implement the Visitor interface directly because\n* different AST nodes need to return different types. Instead, we\n* manually traverse the AST with type-specific methods.\n*/\nvar ProgramCompiler = class {\n\t/**\n\t* Compile a Program to a PipelineIR.\n\t*/\n\tcompileProgram(node) {\n\t\treturn this.compilePipeline(node.pipeline);\n\t}\n\t/**\n\t* Compile a Pipeline to a PipelineIR.\n\t*/\n\tcompilePipeline(node) {\n\t\tconst commands = node.commands.map((cmd$1) => this.compileSimpleCommand(cmd$1));\n\t\tif (commands.length === 0) throw new Error(\"Pipeline must contain at least one command\");\n\t\tconst firstCmd = commands[0];\n\t\tif (!firstCmd) throw new Error(\"Pipeline must contain at least one command\");\n\t\treturn {\n\t\t\tsource: this.determineSource(firstCmd),\n\t\t\tsteps: commands.map((cmd$1) => this.compileCommandToStep(cmd$1)),\n\t\t\tfirstCommand: firstCmd\n\t\t};\n\t}\n\t/**\n\t* Compile a SimpleCommand to a SimpleCommandIR.\n\t*/\n\tcompileSimpleCommand(node) {\n\t\treturn {\n\t\t\tname: this.expandWord(node.name),\n\t\t\targs: node.args.map((arg) => this.expandWord(arg)),\n\t\t\tredirections: node.redirections.map((r) => this.compileRedirection(r))\n\t\t};\n\t}\n\t/**\n\t* Compile a Redirection to a RedirectionIR.\n\t*/\n\tcompileRedirection(node) {\n\t\treturn {\n\t\t\tkind: node.redirectKind,\n\t\t\ttarget: this.expandWord(node.target)\n\t\t};\n\t}\n\t/**\n\t* Expand a Word to an ExpandedWord.\n\t* Handles concatenation of literal parts and detection of globs/command subs.\n\t*/\n\texpandWord(word) {\n\t\tconst parts = word.parts;\n\t\tif (parts.length === 0) return literal(\"\");\n\t\tif (parts.length === 1) {\n\t\t\tconst part = parts[0];\n\t\t\tif (!part) return literal(\"\");\n\t\t\treturn this.expandWordPart(part);\n\t\t}\n\t\tif (parts.every((p) => p.kind === \"literal\")) return literal(parts.map((p) => p.value).join(\"\"));\n\t\tif (parts.some((p) => p.kind === \"glob\")) return glob(parts.map((p) => {\n\t\t\tif (p.kind === \"literal\") return p.value;\n\t\t\tif (p.kind === \"glob\") return p.pattern;\n\t\t\treturn \"\";\n\t\t}).join(\"\"));\n\t\tif (parts.some((p) => p.kind === \"commandSub\")) {\n\t\t\tconst cmdSubPart = parts.find((p) => p.kind === \"commandSub\");\n\t\t\treturn commandSub(this.serializeProgram(cmdSubPart.program));\n\t\t}\n\t\treturn literal(parts.filter((p) => p.kind === \"literal\").map((p) => p.value).join(\"\"));\n\t}\n\t/**\n\t* Expand a single WordPart to an ExpandedWord.\n\t*/\n\texpandWordPart(part) {\n\t\tswitch (part.kind) {\n\t\t\tcase \"literal\": return literal(part.value);\n\t\t\tcase \"glob\": return glob(part.pattern);\n\t\t\tcase \"commandSub\": return commandSub(this.serializeProgram(part.program));\n\t\t\tdefault: {\n\t\t\t\tconst _exhaustive = part;\n\t\t\t\tthrow new Error(`Unknown word part kind: ${JSON.stringify(_exhaustive)}`);\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Determine the source for a pipeline based on the first command.\n\t*/\n\tdetermineSource(firstCmd) {\n\t\tconst firstArg = firstCmd.args[0];\n\t\tif (firstArg?.kind === \"literal\") return {\n\t\t\tkind: \"fs\",\n\t\t\tglob: firstArg.value\n\t\t};\n\t\tif (firstArg?.kind === \"glob\") return {\n\t\t\tkind: \"fs\",\n\t\t\tglob: firstArg.pattern\n\t\t};\n\t\treturn {\n\t\t\tkind: \"fs\",\n\t\t\tglob: \"**/*\"\n\t\t};\n\t}\n\t/**\n\t* Compile a SimpleCommandIR to a StepIR.\n\t*/\n\tcompileCommandToStep(cmd$1) {\n\t\tconst cmdName = this.extractLiteralString(cmd$1.name);\n\t\tif (!cmdName) throw new Error(\"Command name must be a literal string\");\n\t\treturn CommandHandler.get(cmdName)(cmd$1);\n\t}\n\t/**\n\t* Extract the literal string value from an ExpandedWord.\n\t* Returns null if the word is not a literal.\n\t*/\n\textractLiteralString(word) {\n\t\tif (word.kind === \"literal\") return word.value;\n\t\treturn null;\n\t}\n\t/**\n\t* Serialize a Program AST back to a string representation.\n\t* Used for storing command substitution content.\n\t*/\n\tserializeProgram(program) {\n\t\treturn program.pipeline.commands.map((cmd$1) => {\n\t\t\tconst name = cmd$1.name.literalValue ?? \"?\";\n\t\t\tconst args = cmd$1.args.map((arg) => arg.literalValue ?? \"?\").join(\" \");\n\t\t\treturn args ? `${name} ${args}` : name;\n\t\t}).join(\" | \");\n\t}\n};\n\n//#endregion\n//#region src/lexer/position.ts\n/**\n* Represents a position in source code.\n*/\nvar SourcePosition = class SourcePosition {\n\tline;\n\tcolumn;\n\toffset;\n\tconstructor(line, column, offset) {\n\t\tthis.line = line;\n\t\tthis.column = column;\n\t\tthis.offset = offset;\n\t}\n\tstatic ZERO = new SourcePosition(1, 1, 0);\n\ttoString() {\n\t\treturn `${this.line}:${this.column}`;\n\t}\n\tspan(end) {\n\t\treturn new SourceSpan(this, end);\n\t}\n};\n/**\n* Represents a span of source code from start to end position.\n*/\nvar SourceSpan = class {\n\tstart;\n\tend;\n\tconstructor(start, end) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\ttoString() {\n\t\treturn `${this.start}-${this.end}`;\n\t}\n};\n\n//#endregion\n//#region src/lexer/context.ts\n/**\n* Lexer states for the fish subset lexer state machine.\n*\n* Simplified for the subset - only tracks quoting and command substitution.\n*/\nconst LexerState = {\n\tNORMAL: 0,\n\tSINGLE_QUOTED: 1,\n\tDOUBLE_QUOTED: 2,\n\tCOMMAND_SUB: 3\n};\n/**\n* Manages the lexer state stack for tracking nested contexts.\n*\n* Fish subset has simple quoting:\n* - Single quotes: literal, no escapes, no substitution\n* - Double quotes: command substitution allowed, minimal escaping (\\\", \\\\)\n*/\nvar StateContext = class {\n\tstack = [LexerState.NORMAL];\n\t/**\n\t* Get the current lexer state.\n\t*/\n\tget current() {\n\t\treturn this.stack.at(-1) ?? LexerState.NORMAL;\n\t}\n\t/**\n\t* Get the stack depth.\n\t*/\n\tget depth() {\n\t\treturn this.stack.length;\n\t}\n\t/**\n\t* Check if we're inside any quote context.\n\t*/\n\tget inQuotes() {\n\t\tconst s = this.current;\n\t\treturn s === LexerState.SINGLE_QUOTED || s === LexerState.DOUBLE_QUOTED;\n\t}\n\t/**\n\t* Check if we're inside single quotes.\n\t*/\n\tget inSingleQuote() {\n\t\treturn this.current === LexerState.SINGLE_QUOTED;\n\t}\n\t/**\n\t* Check if we're inside double quotes.\n\t*/\n\tget inDoubleQuote() {\n\t\treturn this.current === LexerState.DOUBLE_QUOTED;\n\t}\n\t/**\n\t* Check if we're inside a command substitution.\n\t*/\n\tget inCommandSub() {\n\t\treturn this.current === LexerState.COMMAND_SUB;\n\t}\n\t/**\n\t* Push a new state onto the stack.\n\t*/\n\tpush(state) {\n\t\tthis.stack.push(state);\n\t}\n\t/**\n\t* Pop the current state from the stack.\n\t*/\n\tpop() {\n\t\tif (this.stack.length > 1) return this.stack.pop() ?? LexerState.NORMAL;\n\t\treturn LexerState.NORMAL;\n\t}\n\t/**\n\t* Reset the context to initial state.\n\t*/\n\treset() {\n\t\tthis.stack = [LexerState.NORMAL];\n\t}\n\t/**\n\t* Check if any parent context is double-quoted.\n\t* Useful for determining if command substitution should occur.\n\t*/\n\thasDoubleQuoteParent() {\n\t\treturn this.stack.includes(LexerState.DOUBLE_QUOTED);\n\t}\n\t/**\n\t* Check if any parent context is single-quoted.\n\t* If true, no expansions should occur.\n\t*/\n\thasSingleQuoteParent() {\n\t\treturn this.stack.includes(LexerState.SINGLE_QUOTED);\n\t}\n};\n\n//#endregion\n//#region src/lexer/token.ts\n/**\n* Token types for the fish subset lexer.\n*\n* This is a simplified subset of fish shell syntax focused on:\n* - Pipelines\n* - Command substitution (...)\n* - Globbing (* ? [...])\n* - Basic quoting\n* - Comments\n*\n* NOT supported: variables, brace expansion, control flow, functions\n*/\nconst TokenKind = {\n\tEOF: 0,\n\tERROR: 1,\n\tNEWLINE: 2,\n\tCOMMENT: 3,\n\tWORD: 4,\n\tNAME: 5,\n\tNUMBER: 6,\n\tPIPE: 7,\n\tLPAREN: 8,\n\tRPAREN: 9,\n\tLESS: 10,\n\tGREAT: 11,\n\tCOMMAND_SUB: 12,\n\tGLOB: 13\n};\n/**\n* Create an empty flags object.\n*/\nfunction createEmptyFlags() {\n\treturn {\n\t\tquoted: false,\n\t\tsingleQuoted: false,\n\t\tdoubleQuoted: false,\n\t\tcontainsExpansion: false,\n\t\tcontainsGlob: false\n\t};\n}\n/**\n* Check if any quote flag is set.\n*/\nfunction isQuoted(flags$1) {\n\treturn flags$1.quoted || flags$1.singleQuoted || flags$1.doubleQuoted;\n}\n/**\n* Human-readable names for token kinds.\n*/\nconst TOKEN_KIND_NAMES = {\n\t[TokenKind.EOF]: \"EOF\",\n\t[TokenKind.ERROR]: \"ERROR\",\n\t[TokenKind.NEWLINE]: \"NEWLINE\",\n\t[TokenKind.COMMENT]: \"COMMENT\",\n\t[TokenKind.WORD]: \"WORD\",\n\t[TokenKind.NAME]: \"NAME\",\n\t[TokenKind.NUMBER]: \"NUMBER\",\n\t[TokenKind.PIPE]: \"PIPE\",\n\t[TokenKind.LPAREN]: \"LPAREN\",\n\t[TokenKind.RPAREN]: \"RPAREN\",\n\t[TokenKind.LESS]: \"LESS\",\n\t[TokenKind.GREAT]: \"GREAT\",\n\t[TokenKind.COMMAND_SUB]: \"COMMAND_SUB\",\n\t[TokenKind.GLOB]: \"GLOB\"\n};\n/**\n* Canonical spellings for operators and special tokens.\n*/\nconst TOKEN_SPELLINGS = new Map([\n\t[TokenKind.EOF, \"<eof>\"],\n\t[TokenKind.ERROR, \"<error>\"],\n\t[TokenKind.NEWLINE, \"\\\\n\"],\n\t[TokenKind.PIPE, \"|\"],\n\t[TokenKind.LPAREN, \"(\"],\n\t[TokenKind.RPAREN, \")\"],\n\t[TokenKind.LESS, \"<\"],\n\t[TokenKind.GREAT, \">\"]\n]);\n/**\n* Represents a single token from the lexer.\n*/\nvar Token = class Token {\n\tkind;\n\tspelling;\n\tspan;\n\tflags;\n\tconstructor(kind, spelling, span, flags$1 = createEmptyFlags()) {\n\t\tthis.kind = kind;\n\t\tthis.spelling = spelling;\n\t\tthis.span = span;\n\t\tthis.flags = flags$1;\n\t}\n\t/**\n\t* Get the canonical spelling for a token kind.\n\t*/\n\tstatic spell(kind) {\n\t\treturn TOKEN_SPELLINGS.get(kind) ?? \"<unknown>\";\n\t}\n\t/**\n\t* Get the name of a token kind.\n\t*/\n\tstatic kindName(kind) {\n\t\treturn TOKEN_KIND_NAMES[kind] ?? \"UNKNOWN\";\n\t}\n\t/**\n\t* Check if this token is an operator.\n\t*/\n\tget isOperator() {\n\t\treturn this.kind >= TokenKind.PIPE && this.kind <= TokenKind.GREAT;\n\t}\n\t/**\n\t* Check if this token has any quote flags set.\n\t*/\n\tget isQuoted() {\n\t\treturn isQuoted(this.flags);\n\t}\n\t/**\n\t* Check if this token contains expansions (command substitution).\n\t*/\n\tget hasExpansions() {\n\t\treturn this.flags.containsExpansion;\n\t}\n\t/**\n\t* Check if this token contains glob patterns.\n\t*/\n\tget hasGlob() {\n\t\treturn this.flags.containsGlob;\n\t}\n\ttoString() {\n\t\treturn `Token(${Token.kindName(this.kind)}, \"${this.spelling}\", ${this.span})`;\n\t}\n};\n\n//#endregion\n//#region src/lexer/operators.ts\n/**\n* Multi-character operators sorted by length (longest first) for greedy matching.\n*\n* For the fish subset, we only support:\n* - | (pipe)\n* - > (output redirection - Phase 2)\n* - < (input redirection - Phase 2)\n*\n* NOT supported: &&, ||, >>, &>, >?, ;, &\n*/\nconst OPERATORS = [];\n/**\n* Single-character operators for O(1) lookup.\n*/\nconst SINGLE_CHAR_OPS = new Map([\n\t[\"|\", TokenKind.PIPE],\n\t[\"<\", TokenKind.LESS],\n\t[\">\", TokenKind.GREAT]\n]);\n/**\n* Characters that definitively end a word (token boundary).\n*/\nconst WORD_BOUNDARY_CHARS = new Set([\n\t\" \",\n\t\"\t\",\n\t\"\\n\",\n\t\"|\",\n\t\"<\",\n\t\">\",\n\t\"(\",\n\t\")\",\n\t\"\\0\"\n]);\n\n//#endregion\n//#region src/lexer/source-reader.ts\n/**\n* In-memory implementation of SourceReader (fast).\n*/\nvar StringSourceReader = class StringSourceReader {\n\tstatic EOF = \"\\0\";\n\tinput;\n\tpos = 0;\n\tline = 1;\n\tcolumn = 1;\n\tmarkState = null;\n\tconstructor(input) {\n\t\tthis.input = input;\n\t}\n\tget eof() {\n\t\treturn this.pos >= this.input.length;\n\t}\n\tget position() {\n\t\treturn new SourcePosition(this.line, this.column, this.pos);\n\t}\n\tpeek(offset = 0) {\n\t\tconst idx = this.pos + offset;\n\t\tconst char = this.input[idx];\n\t\treturn char !== void 0 ? char : StringSourceReader.EOF;\n\t}\n\tadvance() {\n\t\tif (this.eof) return StringSourceReader.EOF;\n\t\tconst char = this.input[this.pos];\n\t\tif (char === void 0) return StringSourceReader.EOF;\n\t\tthis.pos++;\n\t\tif (char === \"\\n\") {\n\t\t\tthis.line++;\n\t\t\tthis.column = 1;\n\t\t} else this.column++;\n\t\treturn char;\n\t}\n\tmark() {\n\t\tthis.markState = {\n\t\t\tpos: this.pos,\n\t\t\tline: this.line,\n\t\t\tcolumn: this.column\n\t\t};\n\t}\n\treset() {\n\t\tif (this.markState) {\n\t\t\tthis.pos = this.markState.pos;\n\t\t\tthis.line = this.markState.line;\n\t\t\tthis.column = this.markState.column;\n\t\t\tthis.markState = null;\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/lexer/scanner.ts\nconst NUMBER_PATTERN = /^[0-9]+$/;\nconst NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_-]*$/;\n/**\n* Merge two flags objects, combining their values.\n*/\nfunction mergeFlags(a, b) {\n\treturn {\n\t\tquoted: a.quoted || b.quoted,\n\t\tsingleQuoted: a.singleQuoted || b.singleQuoted,\n\t\tdoubleQuoted: a.doubleQuoted || b.doubleQuoted,\n\t\tcontainsExpansion: a.containsExpansion || b.containsExpansion,\n\t\tcontainsGlob: a.containsGlob || b.containsGlob\n\t};\n}\n/**\n* The main Scanner class for tokenizing fish subset source code.\n*\n* This lexer implements a fish-inspired subset with:\n* - Pipelines (|)\n* - Command substitution (...)\n* - Globbing (* ? [...])\n* - Single quotes (literal, no escapes)\n* - Double quotes (command substitution allowed, minimal escaping)\n* - Comments (#)\n* - Redirection (> <) - Phase 2\n*\n* NOT supported:\n* - Variables ($var)\n* - Brace expansion ({a,b})\n* - Control flow (if, for, while, etc.)\n* - Functions\n* - Background (&)\n* - Semicolons (;)\n* - and/or/not keywords\n* - Tilde expansion (~)\n* - Recursive globbing (**)\n*/\nvar Scanner = class {\n\tsource;\n\tstateCtx = new StateContext();\n\tdebug = false;\n\tconstructor(input) {\n\t\tthis.source = typeof input === \"string\" ? new StringSourceReader(input) : input;\n\t}\n\t/**\n\t* Enable debug logging of tokens.\n\t*/\n\tenableDebugging() {\n\t\tthis.debug = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Main entry: get next token.\n\t*/\n\tgetToken() {\n\t\tthis.skipWhitespace();\n\t\tconst start = this.source.position;\n\t\tconst token = this.nextToken(start);\n\t\tif (this.debug) console.log(token.toString());\n\t\treturn token;\n\t}\n\t/**\n\t* Tokenize all input.\n\t*/\n\ttokenize() {\n\t\tconst tokens = [];\n\t\tlet token;\n\t\tdo {\n\t\t\ttoken = this.getToken();\n\t\t\ttokens.push(token);\n\t\t} while (token.kind !== TokenKind.EOF);\n\t\treturn tokens;\n\t}\n\tnextToken(start) {\n\t\tconst c0 = this.source.peek();\n\t\tif (this.source.eof || c0 === \"\\0\") return this.makeToken(TokenKind.EOF, \"\", start);\n\t\tif (c0 === \"#\") return this.readComment(start);\n\t\tif (c0 === \"\\n\") {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(TokenKind.NEWLINE, \"\\n\", start);\n\t\t}\n\t\tconst opToken = this.tryMatchOperator(start);\n\t\tif (opToken) return opToken;\n\t\tconst singleOp = SINGLE_CHAR_OPS.get(c0);\n\t\tif (singleOp !== void 0) {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(singleOp, c0, start);\n\t\t}\n\t\tif (c0 === \"(\") {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(TokenKind.LPAREN, \"(\", start);\n\t\t}\n\t\tif (c0 === \")\") {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(TokenKind.RPAREN, \")\", start);\n\t\t}\n\t\treturn this.readWord(start);\n\t}\n\ttryMatchOperator(start) {\n\t\tconst chars = this.source.peek() + this.source.peek(1);\n\t\tfor (const op of OPERATORS) if (chars.startsWith(op.pattern)) {\n\t\t\tfor (const _ of op.pattern) this.source.advance();\n\t\t\treturn this.makeToken(op.kind, op.pattern, start);\n\t\t}\n\t\treturn null;\n\t}\n\treadWord(start) {\n\t\tconst fastResult = this.tryFastPath(start);\n\t\tif (fastResult) return fastResult;\n\t\treturn this.readComplexWord(start);\n\t}\n\ttryFastPath(start) {\n\t\tthis.source.mark();\n\t\tlet spelling = \"\";\n\t\twhile (!this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (this.isSpecialChar(c)) break;\n\t\t\tspelling += this.source.advance();\n\t\t}\n\t\tif (spelling.length === 0) {\n\t\t\tthis.source.reset();\n\t\t\treturn null;\n\t\t}\n\t\tconst next = this.source.peek();\n\t\tif (this.isWordBoundary(next)) return this.classifyWord(spelling, start, createEmptyFlags());\n\t\tthis.source.reset();\n\t\treturn null;\n\t}\n\treadComplexWord(start) {\n\t\tthis.stateCtx.reset();\n\t\tlet spelling = \"\";\n\t\tlet flags$1 = createEmptyFlags();\n\t\twhile (!this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (!this.stateCtx.inQuotes && this.isWordBoundary(c)) break;\n\t\t\tconst result = this.processChar(c);\n\t\t\tspelling += result.chars;\n\t\t\tflags$1 = mergeFlags(flags$1, result.flags);\n\t\t\tif (result.done) break;\n\t\t}\n\t\treturn this.classifyWord(spelling, start, flags$1);\n\t}\n\tprocessChar(c) {\n\t\tif (c === \"'\" && !this.stateCtx.inDoubleQuote) return this.handleSingleQuote();\n\t\tif (c === \"\\\"\" && !this.stateCtx.inSingleQuote) return this.handleDoubleQuote();\n\t\tif (c === \"\\\\\" && !this.stateCtx.inSingleQuote) return this.handleEscape();\n\t\tif (c === \"(\" && !this.stateCtx.inSingleQuote) return this.readCommandSubstitution();\n\t\tif ((c === \"*\" || c === \"?\") && !this.stateCtx.inQuotes) return this.handleGlobChar(c);\n\t\tif (c === \"[\" && !this.stateCtx.inQuotes) return this.readCharacterClass();\n\t\tthis.source.advance();\n\t\treturn {\n\t\t\tchars: c,\n\t\t\tflags: createEmptyFlags(),\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleGlobChar(c) {\n\t\tthis.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.containsGlob = true;\n\t\treturn {\n\t\t\tchars: c,\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleSingleQuote() {\n\t\tif (this.stateCtx.inSingleQuote) {\n\t\t\tthis.stateCtx.pop();\n\t\t\tthis.source.advance();\n\t\t\treturn {\n\t\t\t\tchars: \"\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tthis.stateCtx.push(LexerState.SINGLE_QUOTED);\n\t\tthis.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.singleQuoted = true;\n\t\tflags$1.quoted = true;\n\t\treturn {\n\t\t\tchars: \"\",\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleDoubleQuote() {\n\t\tif (this.stateCtx.inDoubleQuote) {\n\t\t\tthis.stateCtx.pop();\n\t\t\tthis.source.advance();\n\t\t\treturn {\n\t\t\t\tchars: \"\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tthis.stateCtx.push(LexerState.DOUBLE_QUOTED);\n\t\tthis.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.doubleQuoted = true;\n\t\tflags$1.quoted = true;\n\t\treturn {\n\t\t\tchars: \"\",\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleEscape() {\n\t\tthis.source.advance();\n\t\tconst next = this.source.peek();\n\t\tif (this.source.eof || next === \"\\0\") return {\n\t\t\tchars: \"\\\\\",\n\t\t\tflags: createEmptyFlags(),\n\t\t\tdone: false\n\t\t};\n\t\tif (next === \"\\n\") {\n\t\t\tthis.source.advance();\n\t\t\treturn {\n\t\t\t\tchars: \"\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tif (this.stateCtx.inDoubleQuote) {\n\t\t\tif (\"\\\"\\\\\".includes(next)) {\n\t\t\t\tthis.source.advance();\n\t\t\t\treturn {\n\t\t\t\t\tchars: next,\n\t\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\t\tdone: false\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchars: \"\\\\\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tthis.source.advance();\n\t\treturn {\n\t\t\tchars: next,\n\t\t\tflags: createEmptyFlags(),\n\t\t\tdone: false\n\t\t};\n\t}\n\treadCommandSubstitution() {\n\t\tlet result = \"\";\n\t\tresult += this.source.advance();\n\t\tlet depth = 1;\n\t\twhile (depth > 0 && !this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (c === \"(\") {\n\t\t\t\tdepth++;\n\t\t\t\tresult += this.source.advance();\n\t\t\t} else if (c === \")\") {\n\t\t\t\tdepth--;\n\t\t\t\tresult += this.source.advance();\n\t\t\t} else if (c === \"'\" || c === \"\\\"\") result += this.skipQuotedContent(c);\n\t\t\telse if (c === \"\\\\\" && !this.source.eof) {\n\t\t\t\tresult += this.source.advance();\n\t\t\t\tif (!this.source.eof) result += this.source.advance();\n\t\t\t} else result += this.source.advance();\n\t\t}\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.containsExpansion = true;\n\t\treturn {\n\t\t\tchars: result,\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\treadCharacterClass() {\n\t\tlet result = \"\";\n\t\tresult += this.source.advance();\n\t\tif (this.source.peek() === \"!\" || this.source.peek() === \"^\") result += this.source.advance();\n\t\tif (this.source.peek() === \"]\") result += this.source.advance();\n\t\twhile (!this.source.eof && this.source.peek() !== \"]\") result += this.source.advance();\n\t\tif (this.source.peek() === \"]\") result += this.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.containsGlob = true;\n\t\treturn {\n\t\t\tchars: result,\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\tskipQuotedContent(quoteChar) {\n\t\tlet result = \"\";\n\t\tresult += this.source.advance();\n\t\twhile (!this.source.eof && this.source.peek() !== quoteChar) {\n\t\t\tconst c = this.source.peek();\n\t\t\tresult += this.source.advance();\n\t\t\tif (c === \"\\\\\" && quoteChar === \"\\\"\" && !this.source.eof) result += this.source.advance();\n\t\t}\n\t\tif (this.source.peek() === quoteChar) result += this.source.advance();\n\t\treturn result;\n\t}\n\tclassifyWord(spelling, start, flags$1) {\n\t\tif (NUMBER_PATTERN.test(spelling)) return this.makeToken(TokenKind.NUMBER, spelling, start, flags$1);\n\t\tif (NAME_PATTERN.test(spelling)) return this.makeToken(TokenKind.NAME, spelling, start, flags$1);\n\t\treturn this.makeToken(TokenKind.WORD, spelling, start, flags$1);\n\t}\n\tskipWhitespace() {\n\t\twhile (!this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (c === \" \" || c === \"\t\") this.source.advance();\n\t\t\telse if (c === \"\\\\\" && this.source.peek(1) === \"\\n\") {\n\t\t\t\tthis.source.advance();\n\t\t\t\tthis.source.advance();\n\t\t\t} else break;\n\t\t}\n\t}\n\treadComment(start) {\n\t\tlet spelling = \"\";\n\t\twhile (!this.source.eof && this.source.peek() !== \"\\n\") spelling += this.source.advance();\n\t\treturn this.makeToken(TokenKind.COMMENT, spelling, start);\n\t}\n\tisSpecialChar(c) {\n\t\treturn \" \t\\n|<>()\\\"'\\\\*?[#\".includes(c);\n\t}\n\tisWordBoundary(c) {\n\t\treturn WORD_BOUNDARY_CHARS.has(c) || c === \"\\0\";\n\t}\n\tmakeToken(kind, spelling, start, flags$1 = createEmptyFlags()) {\n\t\treturn new Token(kind, spelling, start.span(this.source.position), flags$1);\n\t}\n};\n\n//#endregion\n//#region src/parser/ast.ts\n/**\n* Base class for all AST nodes.\n* Every node has a source span for error reporting.\n*/\nvar ASTNode = class {\n\tspan;\n\tconstructor(span) {\n\t\tthis.span = span;\n\t}\n};\n/**\n* Root AST node representing a complete program.\n* A program is a single pipeline (Fish subset does not support multiple statements).\n*/\nvar Program = class extends ASTNode {\n\tpipeline;\n\tconstructor(span, pipeline) {\n\t\tsuper(span);\n\t\tthis.pipeline = pipeline;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitProgram(this);\n\t}\n};\n/**\n* A pipeline of one or more commands connected by pipes.\n* Example: `ls | grep foo | sort`\n*/\nvar Pipeline = class extends ASTNode {\n\tcommands;\n\tconstructor(span, commands) {\n\t\tsuper(span);\n\t\tthis.commands = commands;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitPipeline(this);\n\t}\n};\n/**\n* A simple command with a name, arguments, and optional redirections.\n* Example: `grep -n pattern file.txt > output.txt`\n*/\nvar SimpleCommand = class extends ASTNode {\n\t/** The command name (first word) */\n\tname;\n\t/** Command arguments (remaining words) */\n\targs;\n\t/** Redirections (Phase 2) */\n\tredirections;\n\tconstructor(span, name, args, redirections = []) {\n\t\tsuper(span);\n\t\tthis.name = name;\n\t\tthis.args = args;\n\t\tthis.redirections = redirections;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitSimpleCommand(this);\n\t}\n};\n/**\n* A word is a sequence of word parts.\n* Parts can be literals, globs, or command substitutions.\n* Example: `foo*.txt` has a literal part \"foo\", a glob part \"*\", and a literal part \".txt\"\n*/\nvar Word = class extends ASTNode {\n\tparts;\n\t/** True if the word was quoted (single or double) */\n\tquoted;\n\tconstructor(span, parts, quoted = false) {\n\t\tsuper(span);\n\t\tthis.parts = parts;\n\t\tthis.quoted = quoted;\n\t}\n\t/**\n\t* Get the literal value if this word has no expansions.\n\t* Returns null if the word contains globs or command substitutions.\n\t*/\n\tget literalValue() {\n\t\tif (this.parts.every((p) => p.kind === \"literal\")) return this.parts.map((p) => p.value).join(\"\");\n\t\treturn null;\n\t}\n\t/**\n\t* Check if this word contains any glob patterns.\n\t*/\n\tget hasGlob() {\n\t\treturn this.parts.some((p) => p.kind === \"glob\");\n\t}\n\t/**\n\t* Check if this word contains command substitution.\n\t*/\n\tget hasCommandSub() {\n\t\treturn this.parts.some((p) => p.kind === \"commandSub\");\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitWord(this);\n\t}\n};\n/**\n* A literal string part of a word.\n*/\nvar LiteralPart = class {\n\tkind = \"literal\";\n\tspan;\n\tvalue;\n\tconstructor(span, value) {\n\t\tthis.span = span;\n\t\tthis.value = value;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitLiteralPart(this);\n\t}\n};\n/**\n* A glob pattern part of a word.\n* Examples: `*`, `?`, `[abc]`, `[a-z]`, `[!abc]`\n*/\nvar GlobPart = class {\n\tkind = \"glob\";\n\tspan;\n\tpattern;\n\tconstructor(span, pattern) {\n\t\tthis.span = span;\n\t\tthis.pattern = pattern;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitGlobPart(this);\n\t}\n};\n/**\n* A command substitution part of a word.\n* Example: `(ls -la)`\n*\n* The inner program is parsed recursively.\n*/\nvar CommandSubPart = class {\n\tkind = \"commandSub\";\n\tspan;\n\t/** The inner program to execute */\n\tprogram;\n\tconstructor(span, program) {\n\t\tthis.span = span;\n\t\tthis.program = program;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitCommandSubPart(this);\n\t}\n};\n/**\n* A redirection (input or output).\n* Examples: `< input.txt`, `> output.txt`\n*/\nvar Redirection = class extends ASTNode {\n\tredirectKind;\n\ttarget;\n\tconstructor(span, redirectKind, target) {\n\t\tsuper(span);\n\t\tthis.redirectKind = redirectKind;\n\t\tthis.target = target;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitRedirection(this);\n\t}\n};\n\n//#endregion\n//#region src/parser/command.ts\n/**\n* Command parser for the Fish subset parser.\n*\n* Handles parsing of commands:\n* - Simple commands (name + args)\n* - Redirections (< > Phase 2)\n*/\n/**\n* Parser for commands.\n*\n* A command in the Fish subset is:\n* - A simple command: name followed by arguments and optional redirections\n*\n* Fish subset does NOT support:\n* - Compound commands (if, for, while, function, etc.)\n* - Background execution (&)\n* - Semicolons (;)\n*/\nvar CommandParser = class {\n\tparser;\n\twordParser;\n\tconstructor(parser, wordParser) {\n\t\tthis.parser = parser;\n\t\tthis.wordParser = wordParser;\n\t}\n\t/**\n\t* Parse a command.\n\t* Returns null if no command is present.\n\t*/\n\tparseCommand() {\n\t\treturn this.parseSimpleCommand();\n\t}\n\t/**\n\t* Parse a simple command: name + args + redirections.\n\t*\n\t* Grammar:\n\t* simple_command ::= word+ (redirection)*\n\t*/\n\tparseSimpleCommand() {\n\t\tconst startPos = this.parser.currentToken.span.start;\n\t\tconst name = this.wordParser.parseWord();\n\t\tif (!name) return null;\n\t\tconst args = [];\n\t\tconst redirections = [];\n\t\twhile (!this.isCommandTerminator()) {\n\t\t\tconst redir = this.parseRedirection();\n\t\t\tif (redir) {\n\t\t\t\tredirections.push(redir);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst word = this.wordParser.parseWord();\n\t\t\tif (word) args.push(word);\n\t\t\telse break;\n\t\t}\n\t\tconst endPos = this.parser.previousTokenPosition;\n\t\treturn new SimpleCommand(new SourceSpan(startPos, endPos), name, args, redirections);\n\t}\n\t/**\n\t* Parse a redirection if present.\n\t*\n\t* Grammar:\n\t* redirection ::= '<' word | '>' word\n\t*/\n\tparseRedirection() {\n\t\tconst token = this.parser.currentToken;\n\t\tif (token.kind === TokenKind.LESS) {\n\t\t\tconst startPos = token.span.start;\n\t\t\tthis.parser.advance();\n\t\t\tconst target = this.wordParser.parseWord();\n\t\t\tif (!target) {\n\t\t\t\tthis.parser.syntacticError(\"Expected filename after <\", \"word\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst endPos = this.parser.previousTokenPosition;\n\t\t\treturn new Redirection(new SourceSpan(startPos, endPos), \"input\", target);\n\t\t}\n\t\tif (token.kind === TokenKind.GREAT) {\n\t\t\tconst startPos = token.span.start;\n\t\t\tthis.parser.advance();\n\t\t\tconst target = this.wordParser.parseWord();\n\t\t\tif (!target) {\n\t\t\t\tthis.parser.syntacticError(\"Expected filename after >\", \"word\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst endPos = this.parser.previousTokenPosition;\n\t\t\treturn new Redirection(new SourceSpan(startPos, endPos), \"output\", target);\n\t\t}\n\t\treturn null;\n\t}\n\t/**\n\t* Check if current token terminates a command.\n\t*/\n\tisCommandTerminator() {\n\t\tconst kind = this.parser.currentToken.kind;\n\t\treturn kind === TokenKind.PIPE || kind === TokenKind.NEWLINE || kind === TokenKind.EOF;\n\t}\n};\n\n//#endregion\n//#region src/parser/error-reporter.ts\n/**\n* Error reporter for collecting parser diagnostics.\n*\n* Supports both immediate error throwing and error collection modes.\n*/\nvar ErrorReporter = class {\n\tdiagnostics = [];\n\terrorCount = 0;\n\twarningCount = 0;\n\t/**\n\t* Report an error.\n\t*/\n\treportError(message, span, code) {\n\t\tthis.diagnostics.push({\n\t\t\tseverity: \"error\",\n\t\t\tmessage,\n\t\t\tspan,\n\t\t\tcode\n\t\t});\n\t\tthis.errorCount++;\n\t}\n\t/**\n\t* Report a warning.\n\t*/\n\treportWarning(message, span, code) {\n\t\tthis.diagnostics.push({\n\t\t\tseverity: \"warning\",\n\t\t\tmessage,\n\t\t\tspan,\n\t\t\tcode\n\t\t});\n\t\tthis.warningCount++;\n\t}\n\t/**\n\t* Report an informational message.\n\t*/\n\treportInfo(message, span, code) {\n\t\tthis.diagnostics.push({\n\t\t\tseverity: \"info\",\n\t\t\tmessage,\n\t\t\tspan,\n\t\t\tcode\n\t\t});\n\t}\n\t/**\n\t* Check if any errors have been reported.\n\t*/\n\thasErrors() {\n\t\treturn this.errorCount > 0;\n\t}\n\t/**\n\t* Check if any warnings have been reported.\n\t*/\n\thasWarnings() {\n\t\treturn this.warningCount > 0;\n\t}\n\t/**\n\t* Get the number of errors.\n\t*/\n\tgetErrorCount() {\n\t\treturn this.errorCount;\n\t}\n\t/**\n\t* Get the number of warnings.\n\t*/\n\tgetWarningCount() {\n\t\treturn this.warningCount;\n\t}\n\t/**\n\t* Get all diagnostics.\n\t*/\n\tgetDiagnostics() {\n\t\treturn this.diagnostics;\n\t}\n\t/**\n\t* Get only error diagnostics.\n\t*/\n\tgetErrors() {\n\t\treturn this.diagnostics.filter((d) => d.severity === \"error\");\n\t}\n\t/**\n\t* Get only warning diagnostics.\n\t*/\n\tgetWarnings() {\n\t\treturn this.diagnostics.filter((d) => d.severity === \"warning\");\n\t}\n\t/**\n\t* Clear all diagnostics.\n\t*/\n\tclear() {\n\t\tthis.diagnostics.length = 0;\n\t\tthis.errorCount = 0;\n\t\tthis.warningCount = 0;\n\t}\n\t/**\n\t* Format all diagnostics as a string for display.\n\t*/\n\tformat() {\n\t\treturn this.diagnostics.map((d) => {\n\t\t\tconst loc = `${d.span.start.line}:${d.span.start.column}`;\n\t\t\tlet prefix;\n\t\t\tif (d.severity === \"error\") prefix = \"Error\";\n\t\t\telse if (d.severity === \"warning\") prefix = \"Warning\";\n\t\t\telse prefix = \"Info\";\n\t\t\tconst code = d.code ? ` [${d.code}]` : \"\";\n\t\t\treturn `${prefix}${code} at ${loc}: ${d.message}`;\n\t\t}).join(\"\\n\");\n\t}\n};\n\n//#endregion\n//#region src/parser/statement.ts\n/**\n* Statement parser for the Fish subset parser.\n*\n* Handles parsing of:\n* - Pipelines (command | command | ...)\n*\n* Fish subset does NOT support:\n* - Multiple statements (no ; or newline-separated statements)\n* - Control flow (if, for, while, etc.)\n*/\n/**\n* Parser for statements and pipelines.\n*\n* In the Fish subset, a program is a single pipeline.\n*/\nvar StatementParser = class {\n\tparser;\n\tcommandParser;\n\tconstructor(parser, commandParser) {\n\t\tthis.parser = parser;\n\t\tthis.commandParser = commandParser;\n\t}\n\t/**\n\t* Parse a pipeline.\n\t*\n\t* Grammar:\n\t* pipeline ::= command ('|' command)*\n\t*/\n\tparsePipeline() {\n\t\tconst startPos = this.parser.currentToken.span.start;\n\t\tconst firstCommand = this.commandParser.parseCommand();\n\t\tif (!firstCommand) return null;\n\t\tconst commands = [firstCommand];\n\t\twhile (this.parser.currentToken.kind === TokenKind.PIPE) {\n\t\t\tthis.parser.advance();\n\t\t\tthis.skipNewlines();\n\t\t\tconst command = this.commandParser.parseCommand();\n\t\t\tif (!command) {\n\t\t\t\tthis.parser.syntacticError(\"Expected command after |\", \"command\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcommands.push(command);\n\t\t}\n\t\tconst endPos = this.parser.previousTokenPosition;\n\t\treturn new Pipeline(new SourceSpan(startPos, endPos), commands);\n\t}\n\t/**\n\t* Skip newline tokens (for line continuation after pipe).\n\t*/\n\tskipNewlines() {\n\t\twhile (this.parser.currentToken.kind === TokenKind.NEWLINE) this.parser.advance();\n\t}\n};\n\n//#endregion\n//#region src/parser/syntax-error.ts\n/**\n* Exception thrown when a syntax error is encountered during parsing.\n*/\nvar ParseSyntaxError = class ParseSyntaxError extends Error {\n\t/** The source span where the error occurred */\n\tspan;\n\t/** Additional context about the error */\n\tcontext;\n\tconstructor(message, span, context) {\n\t\tsuper(ParseSyntaxError.formatMessage(message, span, context));\n\t\tthis.name = \"ParseSyntaxError\";\n\t\tthis.span = span;\n\t\tthis.context = context;\n\t\tif (Error.captureStackTrace) Error.captureStackTrace(this, ParseSyntaxError);\n\t}\n\t/**\n\t* Format an error message with position information.\n\t*/\n\tstatic formatMessage(message, span, context) {\n\t\tconst base = `Syntax error at ${`${span.start.line}:${span.start.column}`}: ${message}`;\n\t\treturn context ? `${base} (${context})` : base;\n\t}\n\t/**\n\t* Get the line number where the error occurred.\n\t*/\n\tget line() {\n\t\treturn this.span.start.line;\n\t}\n\t/**\n\t* Get the column number where the error occurred.\n\t*/\n\tget column() {\n\t\treturn this.span.start.column;\n\t}\n};\n/**\n* Exception thrown when the parser encounters an unexpected end of input.\n*/\nvar UnexpectedEOFError = class extends ParseSyntaxError {\n\tconstructor(expected, span) {\n\t\tsuper(`Unexpected end of input, expected ${expected}`, span);\n\t\tthis.name = \"UnexpectedEOFError\";\n\t}\n};\n/**\n* Exception thrown when the parser encounters an unexpected token.\n*/\nvar UnexpectedTokenError = class extends ParseSyntaxError {\n\tfound;\n\texpected;\n\tconstructor(found, expected, span) {\n\t\tsuper(`Unexpected token '${found}', expected ${expected}`, span);\n\t\tthis.name = \"UnexpectedTokenError\";\n\t\tthis.found = found;\n\t\tthis.expected = expected;\n\t}\n};\n\n//#endregion\n//#region src/parser/word.ts\n/**\n* Word parser for the Fish subset parser.\n*\n* Handles parsing of words and their components:\n* - Literal text\n* - Glob patterns (* ? [...])\n* - Command substitution (...)\n* - Quoted strings\n*/\n/**\n* Parser for words and word parts.\n*\n* A word can consist of:\n* - Literal parts (plain text)\n* - Glob parts (* ? [...])\n* - Command substitution parts (...)\n*/\nvar WordParser = class {\n\tparser;\n\tconstructor(parser) {\n\t\tthis.parser = parser;\n\t}\n\t/**\n\t* Parse a single word from the current position.\n\t* Returns null if no word is present.\n\t*\n\t* A word consists of a single token from the scanner.\n\t* The token may contain multiple parts (literal, glob, command substitution)\n\t* which are parsed and combined into a single Word AST node.\n\t*/\n\tparseWord() {\n\t\tconst token = this.parser.currentToken;\n\t\tif (!this.isWordToken(token)) return null;\n\t\tconst startPos = token.span.start;\n\t\tconst part = this.parseWordPart(token);\n\t\tconst parts = part ? [part] : [];\n\t\tif (parts.length === 0) return null;\n\t\tthis.parser.advance();\n\t\tconst endPos = token.span.end;\n\t\tconst span = new SourceSpan(startPos, endPos);\n\t\tconst quoted = token.isQuoted;\n\t\treturn new Word(span, parts, quoted);\n\t}\n\t/**\n\t* Parse a single word part from a token.\n\t*/\n\tparseWordPart(token) {\n\t\tif (token.hasExpansions) return this.parseCommandSubstitution(token);\n\t\tif (token.hasGlob) return this.parseGlobPart(token);\n\t\treturn new LiteralPart(token.span, token.spelling);\n\t}\n\t/**\n\t* Parse a command substitution from a token.\n\t* The token spelling contains the full (...) content.\n\t*/\n\tparseCommandSubstitution(token) {\n\t\tlet inner = token.spelling;\n\t\tif (inner.startsWith(\"(\") && inner.endsWith(\")\")) inner = inner.slice(1, -1);\n\t\tconst innerProgram = this.parser.parseSubstitution(inner);\n\t\treturn new CommandSubPart(token.span, innerProgram);\n\t}\n\t/**\n\t* Parse a glob pattern from a token.\n\t*/\n\tparseGlobPart(token) {\n\t\treturn new GlobPart(token.span, token.spelling);\n\t}\n\t/**\n\t* Check if a token can be part of a word.\n\t*/\n\tisWordToken(token) {\n\t\tconst kind = token.kind;\n\t\treturn kind === TokenKind.WORD || kind === TokenKind.NAME || kind === TokenKind.NUMBER || kind === TokenKind.GLOB || kind === TokenKind.COMMAND_SUB;\n\t}\n};\n\n//#endregion\n//#region src/parser/parser.ts\n/**\n* Main parser for the Fish subset language.\n*\n* This is a modular, recursive descent (LL-style) parser inspired by\n* the VC Parser architecture. It uses single-token lookahead (LL(1))\n* and streams tokens from the lexer.\n*\n* The parser delegates to sub-parsers:\n* - StatementParser: pipelines\n* - CommandParser: simple commands\n* - WordParser: words and expansions\n*\n* Fish subset features supported:\n* - Pipelines (|)\n* - Command substitution (...)\n* - Globbing (* ? [...])\n* - Redirections (< >) - Phase 2\n* - Comments (#)\n*\n* NOT supported:\n* - Variables ($var)\n* - Control flow (if, for, while, etc.)\n* - Functions\n* - Brace expansion\n* - Semicolons\n* - Background jobs (&)\n*/\n/**\n* Main parser class for the Fish subset language.\n*\n* Usage:\n* ```typescript\n* const parser = new Parser('ls | grep foo');\n* const ast = parser.parse();\n* ```\n*/\nvar Parser = class Parser {\n\t/** The scanner/lexer for tokenization */\n\tscanner;\n\t/** Error reporter for collecting diagnostics */\n\terrorReporter;\n\t/** Current token being examined */\n\t_currentToken;\n\t/** Position of the previous token (for span tracking) */\n\t_previousTokenPosition;\n\t/** Sub-parsers */\n\twordParser;\n\tcommandParser;\n\tstatementParser;\n\t/** Recursion depth for command substitution */\n\tsubstitutionDepth;\n\t/** Maximum recursion depth */\n\tstatic MAX_SUBSTITUTION_DEPTH = 10;\n\tconstructor(input, errorReporter, depth = 0) {\n\t\tthis.scanner = typeof input === \"string\" ? new Scanner(input) : input;\n\t\tthis.errorReporter = errorReporter ?? new ErrorReporter();\n\t\tthis.substitutionDepth = depth;\n\t\tthis._currentToken = this.scanner.getToken();\n\t\tthis._previousTokenPosition = this._currentToken.span.start;\n\t\tthis.wordParser = new WordParser(this);\n\t\tthis.commandParser = new CommandParser(this, this.wordParser);\n\t\tthis.statementParser = new StatementParser(this, this.commandParser);\n\t}\n\t/**\n\t* Parse the input and return a Program AST.\n\t* @throws SyntaxError if the input is invalid\n\t*/\n\tparse() {\n\t\treturn this.parseProgram();\n\t}\n\t/**\n\t* Get the error reporter for accessing diagnostics.\n\t*/\n\tgetErrorReporter() {\n\t\treturn this.errorReporter;\n\t}\n\t/**\n\t* Get the current token.\n\t*/\n\tget currentToken() {\n\t\treturn this._currentToken;\n\t}\n\t/**\n\t* Get the position of the previous token.\n\t*/\n\tget previousTokenPosition() {\n\t\treturn this._previousTokenPosition;\n\t}\n\t/**\n\t* Advance to the next token.\n\t*/\n\tadvance() {\n\t\tthis._previousTokenPosition = this._currentToken.span.end;\n\t\tthis._currentToken = this.scanner.getToken();\n\t}\n\t/**\n\t* Match the current token against an expected kind.\n\t* Advances if matched, throws error if not.\n\t*\n\t* @param expected The expected token kind\n\t* @throws SyntaxError if the current token doesn't match\n\t*/\n\tmatch(expected) {\n\t\tif (this._currentToken.kind === expected) {\n\t\t\tthis._previousTokenPosition = this._currentToken.span.end;\n\t\t\tthis._currentToken = this.scanner.getToken();\n\t\t} else this.syntacticError(`Expected ${Token.kindName(expected)}`, Token.kindName(expected));\n\t}\n\t/**\n\t* Accept a token if it matches the expected kind.\n\t* Returns true and advances if matched, false otherwise.\n\t*\n\t* @param expected The expected token kind\n\t* @returns true if the token was accepted\n\t*/\n\taccept(expected) {\n\t\tif (this._currentToken.kind === expected) {\n\t\t\tthis._previousTokenPosition = this._currentToken.span.end;\n\t\t\tthis._currentToken = this.scanner.getToken();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Check if the current token matches the expected kind.\n\t* Does not advance.\n\t*\n\t* @param expected The expected token kind\n\t* @returns true if the current token matches\n\t*/\n\tcheck(expected) {\n\t\treturn this._currentToken.kind === expected;\n\t}\n\t/**\n\t* Start tracking a span from the current token position.\n\t*/\n\tstartSpan() {\n\t\treturn this._currentToken.span.start;\n\t}\n\t/**\n\t* Finish a span at the previous token position.\n\t*/\n\tfinishSpan(start) {\n\t\treturn new SourceSpan(start, this._previousTokenPosition);\n\t}\n\t/**\n\t* Report a syntactic error and throw an exception.\n\t*\n\t* @param message Error message\n\t* @param expected What was expected (for error context)\n\t* @throws SyntaxError always\n\t*/\n\tsyntacticError(message, expected) {\n\t\tconst span = this._currentToken.span;\n\t\tthis.errorReporter.reportError(message, span);\n\t\tif (this._currentToken.kind === TokenKind.EOF) throw new UnexpectedEOFError(expected, span);\n\t\tthrow new UnexpectedTokenError(this._currentToken.spelling || Token.kindName(this._currentToken.kind), expected, span);\n\t}\n\t/**\n\t* Parse a complete program.\n\t*\n\t* Grammar:\n\t* program ::= pipeline\n\t*/\n\tparseProgram() {\n\t\tconst startPos = this.startSpan();\n\t\tthis.skipIgnorable();\n\t\tconst pipeline = this.statementParser.parsePipeline();\n\t\tif (!pipeline) this.syntacticError(\"Expected command\", \"command\");\n\t\tthis.skipIgnorable();\n\t\tif (this._currentToken.kind !== TokenKind.EOF) this.syntacticError(\"Unexpected token after pipeline\", \"end of input\");\n\t\treturn new Program(this.finishSpan(startPos), pipeline);\n\t}\n\t/**\n\t* Parse a command substitution (inner program).\n\t* Called recursively when parsing (...) content.\n\t*\n\t* @param input The inner content of the command substitution\n\t* @returns The parsed program\n\t*/\n\tparseSubstitution(input) {\n\t\tif (this.substitutionDepth >= Parser.MAX_SUBSTITUTION_DEPTH) throw new ParseSyntaxError(\"Maximum command substitution depth exceeded\", this._currentToken.span);\n\t\treturn new Parser(input, this.errorReporter, this.substitutionDepth + 1).parse();\n\t}\n\t/**\n\t* Skip comments and newlines.\n\t*/\n\tskipIgnorable() {\n\t\twhile (this._currentToken.kind === TokenKind.COMMENT || this._currentToken.kind === TokenKind.NEWLINE) this.advance();\n\t}\n};\n/**\n* Parse a Fish subset input string and return the AST.\n*\n* @param input The input string to parse\n* @returns The parsed Program AST\n* @throws SyntaxError if the input is invalid\n*/\nfunction parse(input) {\n\treturn new Parser(input).parse();\n}\n\n//#endregion\nexport { Parser, cmd, commandSub, compile, expandedWordToString, extractPathsFromExpandedWords, glob, literal, parse };","import type { Record } from '../record';\nimport type { Stream } from '../stream';\n\n/**\n * A Consumer terminates a stream.\n * It pulls values and produces a final result or side-effect.\n */\nexport type Consumer<T, R = void> = (input: Stream<T>) => Promise<R>;\n\n/**\n * Collects the entire stream into memory.\n * Pure from an API perspective.\n */\nexport function collect<T>(): Consumer<T, T[]> {\n\treturn async (input) => {\n\t\tconst out: T[] = [];\n\t\tfor await (const item of input) {\n\t\t\tout.push(item);\n\t\t}\n\t\treturn out;\n\t};\n}\n\n/**\n * Streams records directly to stdout.\n * Side-effecting, non-buffering.\n */\nexport function stdout(): Consumer<Record> {\n\treturn async (input) => {\n\t\tfor await (const record of input) {\n\t\t\tprocess.stdout.write(`${format(record)}\\n`);\n\t\t}\n\t};\n}\n\nfunction format(record: Record): string {\n\tswitch (record.kind) {\n\t\tcase 'line':\n\t\t\treturn record.text;\n\t\tcase 'json':\n\t\t\treturn JSON.stringify(record.value);\n\t\tcase 'file':\n\t\t\treturn record.path;\n\t\tdefault:\n\t\t\tthrow new Error('Unknown record kind');\n\t}\n}\n","import type { FS } from '../../fs/fs';\nimport type { FileRecord, LineRecord } from '../../record';\nimport type { Transducer } from '../types';\n\nexport function cat(fs: FS): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const file of input) {\n\t\t\tlet lineNum = 1;\n\t\t\tfor await (const text of fs.readLines(file.path)) {\n\t\t\t\tyield {\n\t\t\t\t\tfile: file.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: lineNum++,\n\t\t\t\t\ttext,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\n// export function cp(fs: FS, dest: string): Sink<FileRecord, void> {\n// \treturn async (input) => {\n// \t\tfor await (const record of input) {\n// \t\t\tconst content = await fs.readFile(record.path);\n// \t\t\tawait fs.writeFile(dest, content);\n// \t\t}\n// \t};\n// }\n\n// export function cp(fs: FS): Effect<{ srcs: string[]; dest: string }> {\n// \treturn async ({ srcs, dest }) => {\n// \t\tawait Promise.all(\n// \t\t\tsrcs.map(async (src) => {\n// \t\t\t\tconst content = await fs.readFile(src);\n// \t\t\t\tawait fs.writeFile(dest, content);\n// \t\t\t})\n// \t\t);\n// \t};\n// }\n\n// missing recursive ?\n\nexport function cp(\n\tfs: FS\n): Effect<{ src: string; dest: string; recursive: boolean }> {\n\treturn async ({ src, dest }) => {\n\t\tconst content = await fs.readFile(src);\n\t\tawait fs.writeFile(dest, content);\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { FileRecord, LineRecord } from '../../record';\nimport type { Transducer } from '../types';\n\nexport function head(fs: FS): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const file of input) {\n\t\t\tlet lineNum = 0;\n\t\t\tfor await (const text of fs.readLines(file.path)) {\n\t\t\t\tif (lineNum >= 10) {\n\t\t\t\t\tbreak; // Default to 10 lines\n\t\t\t\t}\n\t\t\t\tyield {\n\t\t\t\t\tfile: file.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: ++lineNum,\n\t\t\t\t\ttext,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport function headWithN(\n\tfs: FS,\n\tn: number\n): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const file of input) {\n\t\t\tlet lineNum = 0;\n\t\t\tfor await (const text of fs.readLines(file.path)) {\n\t\t\t\tif (lineNum >= n) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tyield {\n\t\t\t\t\tfile: file.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: ++lineNum,\n\t\t\t\t\ttext,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { FileRecord } from '../../record';\nimport type { Stream } from '../../stream';\n\nexport async function* ls(fs: FS, path: string): Stream<FileRecord> {\n\tfor await (const p of fs.readdir(path)) {\n\t\tyield { kind: 'file', path: p };\n\t}\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nexport function mkdir(fs: FS): Effect<{\n\tpath: string;\n\trecursive: boolean;\n}> {\n\treturn async ({ path, recursive }) => {\n\t\tawait fs.mkdir(path, recursive);\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nconst MULTIPLE_SLASH_REGEX = /\\/+/g;\n\nfunction extractFileName(path: string): string {\n\tconst lastSlashIndex = path.lastIndexOf('/');\n\tif (lastSlashIndex === -1) {\n\t\treturn path;\n\t}\n\treturn path.slice(lastSlashIndex + 1);\n}\n\nexport function mv(fs: FS): Effect<{ srcs: string[]; dest: string }> {\n\treturn async ({ srcs, dest }) => {\n\t\tif (srcs.length === 1) {\n\t\t\tconst src = srcs[0];\n\t\t\tif (src === undefined) {\n\t\t\t\tthrow new Error('Source path is required');\n\t\t\t}\n\t\t\t// Check if dest is a directory\n\t\t\ttry {\n\t\t\t\tconst destStat = await fs.stat(dest);\n\t\t\t\tif (destStat.isDirectory) {\n\t\t\t\t\t// Move file into directory\n\t\t\t\t\tconst fileName = extractFileName(src);\n\t\t\t\t\tconst newPath = `${dest}/${fileName}`.replace(\n\t\t\t\t\t\tMULTIPLE_SLASH_REGEX,\n\t\t\t\t\t\t'/'\n\t\t\t\t\t);\n\t\t\t\t\tawait moveFile(fs, src, newPath);\n\t\t\t\t} else {\n\t\t\t\t\t// Dest is a file, throw error\n\t\t\t\t\tthrow new Error(`Destination file already exists: ${dest}`);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Check if error is about existing file\n\t\t\t\tif ((error as Error).message.includes('already exists')) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\t// Dest doesn't exist, move src to dest\n\t\t\t\tawait moveFile(fs, src, dest);\n\t\t\t}\n\t\t} else {\n\t\t\t// If multiple sources, dest must be a directory\n\t\t\t// and each source is moved into that directory\n\t\t\tfor (const src of srcs) {\n\t\t\t\tconst fileName = extractFileName(src);\n\t\t\t\tconst fullDest = dest.endsWith('/')\n\t\t\t\t\t? dest + fileName\n\t\t\t\t\t: `${dest}/${fileName}`;\n\t\t\t\tconst newPath = fullDest.replace(MULTIPLE_SLASH_REGEX, '/');\n\t\t\t\tawait moveFile(fs, src, newPath);\n\t\t\t}\n\t\t}\n\t};\n}\n\nasync function moveFile(fs: FS, src: string, dest: string): Promise<void> {\n\tconst content = await fs.readFile(src);\n\tawait fs.writeFile(dest, content);\n\tawait fs.deleteFile(src);\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nexport function rm(fs: FS): Effect<{ path: string; recursive: boolean }> {\n\treturn async ({ path }) => {\n\t\tawait fs.deleteFile(path);\n\t};\n}\n","import type { LineRecord } from '../../record';\nimport type { Transducer } from '../types';\n\nexport function tail(n: number): Transducer<LineRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tconst buf: LineRecord[] = [];\n\t\tfor await (const x of input) {\n\t\t\tbuf.push(x);\n\t\t\tif (buf.length > n) {\n\t\t\t\tbuf.shift();\n\t\t\t}\n\t\t}\n\t\tyield* buf;\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nexport function touch(fs: FS): Effect<{ files: string[] }> {\n\treturn async ({ files }) => {\n\t\tfor (const file of files) {\n\t\t\tif (!(await fs.exists(file))) {\n\t\t\t\tawait fs.writeFile(file, new Uint8Array());\n\t\t\t}\n\t\t}\n\t};\n}\n","import type { FS } from '../fs/fs';\nimport type { Transducer } from '../operator/types';\nimport type { FileRecord, LineRecord } from '../record';\nimport type { Stream } from '../stream';\n\nexport function lines(fs: FS): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const f of input) {\n\t\t\tlet lineNum = 1;\n\t\t\tfor await (const line of fs.readLines(f.path)) {\n\t\t\t\tyield {\n\t\t\t\t\tfile: f.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: lineNum++,\n\t\t\t\t\ttext: line,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport async function* files(...paths: string[]): Stream<FileRecord> {\n\tfor (const path of paths) {\n\t\tyield { kind: 'file', path };\n\t}\n}\n","import {\n\texpandedWordToString,\n\textractPathsFromExpandedWords,\n\ttype PipelineIR,\n} from '@shfs/compiler';\nimport { map, pipe } from 'remeda';\nimport type { FS } from '../fs/fs';\nimport { cat } from '../operator/cat/cat';\nimport { cp } from '../operator/cp/cp';\nimport { headWithN } from '../operator/head/head';\nimport { ls } from '../operator/ls/ls';\nimport { mkdir } from '../operator/mkdir/mkdir';\nimport { mv } from '../operator/mv/mv';\nimport { rm } from '../operator/rm/rm';\nimport { tail } from '../operator/tail/tail';\nimport { touch } from '../operator/touch/touch';\nimport type { Record } from '../record';\nimport type { Stream } from '../stream';\nimport { files } from './producers';\n\nexport type ExecuteResult =\n\t| { kind: 'stream'; value: Stream<Record> }\n\t| { kind: 'sink'; value: Promise<void> };\n\n/**\n * Execute compiles a PipelineIR into an executable result.\n * Returns either a stream (for producers/transducers) or a promise (for sinks).\n */\nexport function execute(ir: PipelineIR, fs: FS): ExecuteResult {\n\tconst step = ir.steps[0];\n\tif (!step) {\n\t\treturn {\n\t\t\tkind: 'stream',\n\t\t\tvalue: (async function* () {\n\t\t\t\t// Empty stream - no steps to execute\n\t\t\t})(),\n\t\t};\n\t}\n\n\tswitch (step.cmd) {\n\t\tcase 'cat': {\n\t\t\tconst filePaths = extractPathsFromExpandedWords(step.args.files);\n\t\t\treturn {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: pipe(files(...filePaths), cat(fs)),\n\t\t\t};\n\t\t}\n\t\tcase 'cp': {\n\t\t\tconst srcPaths = extractPathsFromExpandedWords(step.args.srcs);\n\t\t\tconst destPath = expandedWordToString(step.args.dest);\n\t\t\treturn {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: Promise.all(\n\t\t\t\t\tmap(srcPaths, (src) =>\n\t\t\t\t\t\tcp(fs)({\n\t\t\t\t\t\t\tsrc,\n\t\t\t\t\t\t\tdest: destPath,\n\t\t\t\t\t\t\trecursive: step.args.recursive,\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t).then(),\n\t\t\t};\n\t\t}\n\t\tcase 'head': {\n\t\t\tconst filePaths = extractPathsFromExpandedWords(step.args.files);\n\t\t\treturn {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: pipe(files(...filePaths), headWithN(fs, step.args.n)),\n\t\t\t};\n\t\t}\n\t\tcase 'ls': {\n\t\t\tconst paths = extractPathsFromExpandedWords(step.args.paths);\n\t\t\treturn {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: (async function* () {\n\t\t\t\t\tconst results = await Promise.all(\n\t\t\t\t\t\tmap(paths, (path) => ls(fs, path))\n\t\t\t\t\t).then();\n\n\t\t\t\t\tfor (const file of results) {\n\t\t\t\t\t\tyield* file;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t};\n\t\t}\n\t\tcase 'mkdir': {\n\t\t\tconst paths = extractPathsFromExpandedWords(step.args.paths);\n\t\t\treturn {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: Promise.all(\n\t\t\t\t\tmap(paths, (path) =>\n\t\t\t\t\t\tmkdir(fs)({ path, recursive: step.args.recursive })\n\t\t\t\t\t)\n\t\t\t\t).then(),\n\t\t\t};\n\t\t}\n\t\tcase 'mv': {\n\t\t\tconst srcPaths = extractPathsFromExpandedWords(step.args.srcs);\n\t\t\tconst destPath = expandedWordToString(step.args.dest);\n\t\t\treturn {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: mv(fs)({ srcs: srcPaths, dest: destPath }),\n\t\t\t};\n\t\t}\n\t\tcase 'rm': {\n\t\t\tconst paths = extractPathsFromExpandedWords(step.args.paths);\n\t\t\treturn {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: Promise.all(\n\t\t\t\t\tmap(paths, (path) =>\n\t\t\t\t\t\trm(fs)({ path, recursive: step.args.recursive })\n\t\t\t\t\t)\n\t\t\t\t).then(),\n\t\t\t};\n\t\t}\n\t\tcase 'tail': {\n\t\t\tconst filePaths = extractPathsFromExpandedWords(step.args.files);\n\t\t\treturn {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: (async function* () {\n\t\t\t\t\tconst results = await Promise.all(\n\t\t\t\t\t\tmap(filePaths, (file) =>\n\t\t\t\t\t\t\tpipe(files(file), cat(fs), tail(step.args.n))\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tfor (const lines of results) {\n\t\t\t\t\t\tyield* lines;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t};\n\t\t}\n\t\tcase 'touch': {\n\t\t\tconst filePaths = extractPathsFromExpandedWords(step.args.files);\n\t\t\treturn {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: touch(fs)({ files: filePaths }),\n\t\t\t};\n\t\t}\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t`Unknown command: ${String((step as { cmd: string }).cmd)}`\n\t\t\t);\n\t}\n}\n","export function lazy<T>(fn: () => T) {\n\tlet value: T | undefined;\n\tlet loaded = false;\n\n\treturn (): T => {\n\t\tif (loaded) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tloaded = true;\n\t\tvalue = fn();\n\t\treturn value as T;\n\t};\n}\n","import { compile, type PipelineIR, parse } from '@shfs/compiler';\n\nimport { collect } from '../consumer/consumer';\nimport { type ExecuteResult, execute } from '../execute/execute';\nimport type { FS } from '../fs/fs';\nimport type { Record } from '../record';\nimport { lazy } from '../util/lazy';\n\nasync function collectRecords(result: ExecuteResult): Promise<Record[]> {\n\tif (result.kind === 'sink') {\n\t\tawait result.value;\n\t\treturn [];\n\t}\n\treturn collect<Record>()(result.value);\n}\n\nexport class Shell {\n\tprivate readonly fs: FS;\n\n\tconstructor(fs: FS) {\n\t\tthis.fs = fs;\n\t}\n\n\t$ = (strings: TemplateStringsArray, ...exprs: unknown[]) => {\n\t\treturn this._exec(strings, ...exprs);\n\t};\n\n\texec(strings: TemplateStringsArray, ...exprs: unknown[]) {\n\t\treturn this._exec(strings, ...exprs);\n\t}\n\n\tprivate _exec(strings: TemplateStringsArray, ...exprs: unknown[]) {\n\t\tconst source = String.raw(strings, ...exprs);\n\t\tconst fs = this.fs;\n\n\t\tconst ir = lazy<PipelineIR>(() => {\n\t\t\tconst ast = parse(source);\n\t\t\treturn compile(ast);\n\t\t});\n\n\t\treturn {\n\t\t\tasync json(): Promise<unknown[]> {\n\t\t\t\tconst records = await collectRecords(execute(ir(), fs));\n\t\t\t\treturn records\n\t\t\t\t\t.filter((r) => r.kind === 'json')\n\t\t\t\t\t.map((r) => r.value);\n\t\t\t},\n\n\t\t\tasync lines(): Promise<string[]> {\n\t\t\t\tconst records = await collectRecords(execute(ir(), fs));\n\t\t\t\treturn records\n\t\t\t\t\t.filter((r) => r.kind === 'line')\n\t\t\t\t\t.map((r) => r.text);\n\t\t\t},\n\n\t\t\tasync raw(): Promise<Record[]> {\n\t\t\t\treturn await collectRecords(execute(ir(), fs));\n\t\t\t},\n\n\t\t\tasync stdout(): Promise<void> {\n\t\t\t\tconst result = execute(ir(), fs);\n\t\t\t\tif (result.kind === 'sink') {\n\t\t\t\t\tawait result.value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor await (const r of result.value) {\n\t\t\t\t\tif (r.kind === 'line') {\n\t\t\t\t\t\tprocess.stdout.write(`${r.text}\\n`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tasync text(): Promise<string> {\n\t\t\t\tconst records = await collectRecords(execute(ir(), fs));\n\t\t\t\treturn records\n\t\t\t\t\t.map((r) => {\n\t\t\t\t\t\tif (r.kind === 'line') {\n\t\t\t\t\t\t\treturn r.text;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif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KAAK,MAAM,EAAE,KAAK;;GAGrB,MAAM,MAAyB;AAC9B,WAAO,MAAM,eAAe,QAAQ,IAAI,EAAE,GAAG,CAAC;;GAG/C,MAAM,SAAwB;IAC7B,MAAM,SAAS,QAAQ,IAAI,EAAE,GAAG;AAChC,QAAI,OAAO,SAAS,QAAQ;AAC3B,WAAM,OAAO;AACb;;AAED,eAAW,MAAM,KAAK,OAAO,MAC5B,KAAI,EAAE,SAAS,OACd,SAAQ,OAAO,MAAM,GAAG,EAAE,KAAK,IAAI;;GAKtC,MAAM,OAAwB;AAE7B,YADgB,MAAM,eAAe,QAAQ,IAAI,EAAE,GAAG,CAAC,EAErD,KAAK,MAAM;AACX,SAAI,EAAE,SAAS,OACd,QAAO,EAAE;AAEV,SAAI,EAAE,SAAS,OACd,QAAO,EAAE;AAEV,SAAI,EAAE,SAAS,OACd,QAAO,KAAK,UAAU,EAAE,MAAM;AAE/B,YAAO;MACN,CACD,KAAK,KAAK;;GAEb"}
1
+ {"version":3,"file":"index.mjs","names":["map","files","SourcePosition","Token","StringSourceReader","ParseSyntaxError","Parser","files"],"sources":["../../compiler/dist/index.mjs","../src/consumer/consumer.ts","../src/operator/cat/cat.ts","../src/operator/cp/cp.ts","../src/operator/head/head.ts","../src/operator/ls/ls.ts","../src/operator/mkdir/mkdir.ts","../src/operator/mv/mv.ts","../src/operator/rm/rm.ts","../src/operator/tail/tail.ts","../src/operator/touch/touch.ts","../src/execute/producers.ts","../src/execute/execute.ts","../src/util/lazy.ts","../src/shell/shell.ts"],"sourcesContent":["//#region src/ir.ts\n/**\n* Create a literal ExpandedWord.\n*/\nfunction literal(value) {\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue\n\t};\n}\n/**\n* Create a SimpleCommandIR for testing purposes.\n* Convenience helper that creates a command with a name and arguments.\n*/\nfunction cmd(name, args, redirections = []) {\n\treturn {\n\t\tname: literal(name),\n\t\targs,\n\t\tredirections\n\t};\n}\n/**\n* Create a glob ExpandedWord.\n*/\nfunction glob(pattern, expanded = []) {\n\treturn {\n\t\tkind: \"glob\",\n\t\tpattern,\n\t\texpanded\n\t};\n}\n/**\n* Create a command substitution ExpandedWord.\n*/\nfunction commandSub(command, output = []) {\n\treturn {\n\t\tkind: \"commandSub\",\n\t\tcommand,\n\t\toutput\n\t};\n}\n/**\n* Extract the string value from an ExpandedWord.\n* For globs, returns the pattern. For command subs, returns the command.\n*/\nfunction expandedWordToString(word) {\n\tswitch (word.kind) {\n\t\tcase \"literal\": return word.value;\n\t\tcase \"glob\": return word.pattern;\n\t\tcase \"commandSub\": return word.command;\n\t\tdefault: {\n\t\t\tconst _exhaustive = word;\n\t\t\tthrow new Error(`Unknown word kind: ${JSON.stringify(_exhaustive)}`);\n\t\t}\n\t}\n}\n/**\n* Extract paths from an array of ExpandedWords.\n* For globs and command subs, expands to their resolved values.\n*/\nfunction extractPathsFromExpandedWords(words) {\n\treturn words.flatMap((word) => {\n\t\tswitch (word.kind) {\n\t\t\tcase \"literal\": return [word.value];\n\t\t\tcase \"glob\": return word.expanded.length > 0 ? word.expanded : [word.pattern];\n\t\t\tcase \"commandSub\": return word.output;\n\t\t\tdefault: {\n\t\t\t\tconst _exhaustive = word;\n\t\t\t\tthrow new Error(`Unknown word kind: ${JSON.stringify(_exhaustive)}`);\n\t\t\t}\n\t\t}\n\t});\n}\n\n//#endregion\n//#region src/compile/command/arg/utils.ts\nconst NEGATIVE_NUMBER_REGEX$2 = /^(?:-\\d+(?:\\.\\d+)?|-\\.\\d+)$/;\nfunction isNegativeNumberToken(token) {\n\treturn NEGATIVE_NUMBER_REGEX$2.test(token);\n}\nfunction startsWithLongPrefix(token) {\n\treturn token.length >= 2 && token[0] === \"-\" && token[1] === \"-\";\n}\nfunction startsWithShortPrefix(token) {\n\treturn token.length >= 1 && token[0] === \"-\" && !startsWithLongPrefix(token);\n}\nfunction startsWithNoLongPrefix(token) {\n\treturn token.startsWith(\"--no-\") && token.length > 5;\n}\nfunction splitNameBeforeEquals(token) {\n\tconst eq = token.indexOf(\"=\");\n\treturn eq === -1 ? token : token.slice(0, eq);\n}\n\n//#endregion\n//#region src/compile/command/arg/parse.ts\nconst SHORT_NAME_REGEX = /^[A-Za-z]$/;\nconst LONG_NAME_REGEX = /^[A-Za-z0-9][A-Za-z0-9-]*$/;\nfunction parseArgs(args, flagDefs) {\n\tconst index = buildFlagIndex(flagDefs);\n\tconst flags$1 = Object.create(null);\n\tconst positional = [];\n\tlet endOfFlags = false;\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst token = args[i];\n\t\tif (token === void 0) continue;\n\t\tif (endOfFlags) {\n\t\t\tpositional.push(token);\n\t\t\tcontinue;\n\t\t}\n\t\tif (token === \"--\") {\n\t\t\tendOfFlags = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (token === \"-\") {\n\t\t\tpositional.push(token);\n\t\t\tcontinue;\n\t\t}\n\t\tif (isNegativeNumberToken(token)) {\n\t\t\tpositional.push(token);\n\t\t\tcontinue;\n\t\t}\n\t\tif (startsWithLongPrefix(token)) {\n\t\t\ti = parseLongToken(args, i, token, index, flags$1);\n\t\t\tcontinue;\n\t\t}\n\t\tif (startsWithShortPrefix(token)) {\n\t\t\ti = parseShortToken(args, i, token, index, flags$1);\n\t\t\tcontinue;\n\t\t}\n\t\tpositional.push(token);\n\t}\n\treturn {\n\t\tflags: flags$1,\n\t\tpositional\n\t};\n}\nfunction buildFlagIndex(flagDefs) {\n\tconst short = /* @__PURE__ */ new Map();\n\tconst long = /* @__PURE__ */ new Map();\n\tconst add = (map, token, entry) => {\n\t\tconst prev = map.get(token);\n\t\tif (!prev) {\n\t\t\tmap.set(token, entry);\n\t\t\treturn;\n\t\t}\n\t\tthrow new Error(`Duplicate flag token \"${token}\" for \"${entry.canonical}\" and \"${prev.canonical}\"`);\n\t};\n\tfor (const [canonical, def] of Object.entries(flagDefs)) {\n\t\tif (!SHORT_NAME_REGEX.test(def.short)) throw new Error(`Invalid short flag for \"${canonical}\": \"${def.short}\". Expected a single letter [A-Za-z].`);\n\t\tadd(short, `-${def.short}`, {\n\t\t\tcanonical,\n\t\t\tdef\n\t\t});\n\t\tif (def.long) {\n\t\t\tif (!LONG_NAME_REGEX.test(def.long)) throw new Error(`Invalid long flag for \"${canonical}\": \"${def.long}\". Expected [A-Za-z0-9][A-Za-z0-9-]*.`);\n\t\t\tadd(long, `--${def.long}`, {\n\t\t\t\tcanonical,\n\t\t\t\tdef\n\t\t\t});\n\t\t}\n\t}\n\tconst isFlagToken = (token) => {\n\t\tif (token === \"--\") return true;\n\t\tif (token === \"-\") return false;\n\t\tif (startsWithLongPrefix(token)) {\n\t\t\tconst name = splitNameBeforeEquals(token);\n\t\t\tif (long.has(name)) return true;\n\t\t\tif (startsWithNoLongPrefix(name)) {\n\t\t\t\tconst base = `--${name.slice(5)}`;\n\t\t\t\tconst entry = long.get(base);\n\t\t\t\treturn !!entry && !entry.def.takesValue;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tif (startsWithShortPrefix(token)) {\n\t\t\tconst ch = token[1] ?? \"\";\n\t\t\tif (!SHORT_NAME_REGEX.test(ch)) return false;\n\t\t\treturn short.has(`-${ch}`);\n\t\t}\n\t\treturn false;\n\t};\n\treturn {\n\t\tshort,\n\t\tlong,\n\t\tisFlagToken\n\t};\n}\nfunction parseLongToken(args, index, token, flagsIndex, out) {\n\tif (startsWithNoLongPrefix(token) && !token.includes(\"=\")) {\n\t\tconst base = `--${token.slice(5)}`;\n\t\tconst entry$1 = flagsIndex.long.get(base);\n\t\tif (!entry$1) throw new Error(`Unknown flag: ${token}`);\n\t\tif (entry$1.def.takesValue) throw new Error(`Flag ${base} takes a value; \"${token}\" is invalid.`);\n\t\tsetBoolean(out, entry$1.canonical, false);\n\t\treturn index;\n\t}\n\tif (token.includes(\"=\")) {\n\t\tconst eq = token.indexOf(\"=\");\n\t\tconst name = token.slice(0, eq);\n\t\tconst value$1 = token.slice(eq + 1);\n\t\tconst entry$1 = flagsIndex.long.get(name);\n\t\tif (!entry$1) throw new Error(`Unknown flag: ${name}`);\n\t\tif (!entry$1.def.takesValue) throw new Error(`Flag ${name} does not take a value.`);\n\t\tsetValue(out, entry$1, value$1);\n\t\treturn index;\n\t}\n\tconst entry = flagsIndex.long.get(token);\n\tif (!entry) throw new Error(`Unknown flag: ${token}`);\n\tif (!entry.def.takesValue) {\n\t\tsetBoolean(out, entry.canonical, true);\n\t\treturn index;\n\t}\n\tconst { value, newIndex } = consumeValue(args, index, token, flagsIndex);\n\tsetValue(out, entry, value);\n\treturn newIndex;\n}\nfunction parseShortToken(args, index, token, flagsIndex, out) {\n\tif (token.length >= 3 && token[2] === \"=\") {\n\t\tconst name = token.slice(0, 2);\n\t\tconst value = token.slice(3);\n\t\tconst entry = flagsIndex.short.get(name);\n\t\tif (!entry) throw new Error(`Unknown flag: ${name}`);\n\t\tif (!entry.def.takesValue) throw new Error(`Flag ${name} does not take a value.`);\n\t\tsetValue(out, entry, value);\n\t\treturn index;\n\t}\n\tif (token.length === 2) {\n\t\tconst entry = flagsIndex.short.get(token);\n\t\tif (!entry) throw new Error(`Unknown flag: ${token}`);\n\t\tif (!entry.def.takesValue) {\n\t\t\tsetBoolean(out, entry.canonical, true);\n\t\t\treturn index;\n\t\t}\n\t\tconst { value, newIndex } = consumeValue(args, index, token, flagsIndex);\n\t\tsetValue(out, entry, value);\n\t\treturn newIndex;\n\t}\n\tfor (let j = 1; j < token.length; j++) {\n\t\tconst ch = token[j] ?? \"\";\n\t\tif (!SHORT_NAME_REGEX.test(ch)) throw new Error(`Invalid short flag character \"${ch}\" in \"${token}\". Short flags must be letters.`);\n\t\tconst name = `-${ch}`;\n\t\tconst entry = flagsIndex.short.get(name);\n\t\tif (!entry) throw new Error(`Unknown flag: ${name}`);\n\t\tif (!entry.def.takesValue) {\n\t\t\tsetBoolean(out, entry.canonical, true);\n\t\t\tcontinue;\n\t\t}\n\t\tconst rest = token.slice(j + 1);\n\t\tif (rest.startsWith(\"=\")) {\n\t\t\tsetValue(out, entry, rest.slice(1));\n\t\t\treturn index;\n\t\t}\n\t\tif (rest.length === 0) {\n\t\t\tconst { value, newIndex } = consumeValue(args, index, name, flagsIndex);\n\t\t\tsetValue(out, entry, value);\n\t\t\treturn newIndex;\n\t\t}\n\t\tconst first = rest[0] ?? \"\";\n\t\tif (SHORT_NAME_REGEX.test(first) && flagsIndex.short.has(`-${first}`)) throw new Error(`Ambiguous short flag cluster \"${token}\": ${name} takes a value, but \"${rest}\" begins with \"-${first}\" which is also a flag. Use \"${name}=${rest}\" or pass the value as a separate argument.`);\n\t\tsetValue(out, entry, rest);\n\t\treturn index;\n\t}\n\treturn index;\n}\nfunction consumeValue(args, index, flagToken, flagsIndex) {\n\tconst nextIndex = index + 1;\n\tif (nextIndex >= args.length) throw new Error(`Flag ${flagToken} requires a value.`);\n\tconst next = args[nextIndex];\n\tif (next === void 0) throw new Error(`Flag ${flagToken} requires a value.`);\n\tif (next === \"--\") throw new Error(`Flag ${flagToken} requires a value (got \"--\").`);\n\tif (flagsIndex.isFlagToken(next)) throw new Error(`Flag ${flagToken} requires a value (got \"${next}\").`);\n\treturn {\n\t\tvalue: next,\n\t\tnewIndex: nextIndex\n\t};\n}\nfunction setBoolean(out, canonical, value) {\n\tout[canonical] = value;\n}\nfunction setValue(out, entry, value) {\n\tconst { canonical, def } = entry;\n\tconst existing = out[canonical];\n\tif (existing === void 0) {\n\t\tout[canonical] = value;\n\t\treturn;\n\t}\n\tif (!def.multiple) throw new Error(`Duplicate flag \"${canonical}\". If it is intended to repeat, set { multiple: true } in its definition.`);\n\tif (Array.isArray(existing)) {\n\t\texisting.push(value);\n\t\treturn;\n\t}\n\tif (typeof existing === \"string\") {\n\t\tout[canonical] = [existing, value];\n\t\treturn;\n\t}\n\tthrow new Error(`Invalid state for flag \"${canonical}\".`);\n}\n\n//#endregion\n//#region src/compile/command/cat/cat.ts\n/**\n* cat command handler for the AST-based compiler.\n*/\nconst flags = {\n\tnumber: {\n\t\tshort: \"n\",\n\t\ttakesValue: false\n\t},\n\tnumberNonBlank: {\n\t\tshort: \"b\",\n\t\ttakesValue: false\n\t},\n\tshowAll: {\n\t\tshort: \"A\",\n\t\ttakesValue: false\n\t},\n\tshowEnds: {\n\t\tshort: \"E\",\n\t\ttakesValue: false\n\t},\n\tshowNonprinting: {\n\t\tshort: \"v\",\n\t\ttakesValue: false\n\t},\n\tshowTabs: {\n\t\tshort: \"T\",\n\t\ttakesValue: false\n\t},\n\tsqueezeBlank: {\n\t\tshort: \"s\",\n\t\ttakesValue: false\n\t}\n};\n/**\n* Compile a cat command from SimpleCommandIR to StepIR.\n*/\nfunction compileCat(cmd$1) {\n\tconst parsed = parseArgs(cmd$1.args.map(expandedWordToString), flags);\n\tconst fileArgs = [];\n\tfor (const arg of cmd$1.args) if (!expandedWordToString(arg).startsWith(\"-\")) fileArgs.push(arg);\n\tconst hasInputRedirection = cmd$1.redirections.some((redirection) => redirection.kind === \"input\");\n\tif (fileArgs.length === 0 && !hasInputRedirection) throw new Error(\"cat requires at least one file\");\n\treturn {\n\t\tcmd: \"cat\",\n\t\targs: {\n\t\t\tfiles: fileArgs,\n\t\t\tnumberLines: parsed.flags.number === true,\n\t\t\tnumberNonBlank: parsed.flags.numberNonBlank === true,\n\t\t\tshowAll: parsed.flags.showAll === true,\n\t\t\tshowEnds: parsed.flags.showEnds === true,\n\t\t\tshowNonprinting: parsed.flags.showNonprinting === true,\n\t\t\tshowTabs: parsed.flags.showTabs === true,\n\t\t\tsqueezeBlank: parsed.flags.squeezeBlank === true\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/cp/cp.ts\n/**\n* cp command handler for the AST-based compiler.\n*/\n/**\n* Compile a cp command from SimpleCommandIR to StepIR.\n*/\nfunction compileCp(cmd$1) {\n\tlet recursive = false;\n\tconst filteredArgs = [];\n\tfor (const arg of cmd$1.args) {\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-r\") recursive = true;\n\t\telse if (argStr !== \"-f\" && argStr !== \"-i\") filteredArgs.push(arg);\n\t}\n\tif (filteredArgs.length < 2) throw new Error(\"cp requires source and destination\");\n\tconst dest = filteredArgs.pop();\n\tif (!dest) throw new Error(\"cp requires source and destination\");\n\treturn {\n\t\tcmd: \"cp\",\n\t\targs: {\n\t\t\tdest,\n\t\t\trecursive,\n\t\t\tsrcs: filteredArgs\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/head/head.ts\n/**\n* head command handler for the AST-based compiler.\n*/\nconst NEGATIVE_NUMBER_REGEX$1 = /^-\\d+$/;\n/**\n* Compile a head command from SimpleCommandIR to StepIR.\n*/\nfunction compileHead(cmd$1) {\n\tlet n = 10;\n\tconst files = [];\n\tlet skipNext = false;\n\tfor (let i = 0; i < cmd$1.args.length; i++) {\n\t\tif (skipNext) {\n\t\t\tskipNext = false;\n\t\t\tcontinue;\n\t\t}\n\t\tconst arg = cmd$1.args[i];\n\t\tif (!arg) continue;\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-n\") {\n\t\t\tconst numArg = cmd$1.args[i + 1];\n\t\t\tif (!numArg) throw new Error(\"head -n requires a number\");\n\t\t\tn = Number(expandedWordToString(numArg));\n\t\t\tif (!Number.isFinite(n)) throw new Error(\"Invalid head count\");\n\t\t\tskipNext = true;\n\t\t} else if (argStr.startsWith(\"-\") && NEGATIVE_NUMBER_REGEX$1.test(argStr)) n = Number(argStr.slice(1));\n\t\telse if (argStr.startsWith(\"-\")) throw new Error(\"Unknown head option\");\n\t\telse files.push(arg);\n\t}\n\treturn {\n\t\tcmd: \"head\",\n\t\targs: {\n\t\t\tfiles,\n\t\t\tn\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/ls/ls.ts\n/**\n* ls command handler for the AST-based compiler.\n*/\n/**\n* Compile an ls command from SimpleCommandIR to StepIR.\n*/\nfunction compileLs(cmd$1) {\n\treturn {\n\t\tcmd: \"ls\",\n\t\targs: { paths: cmd$1.args.length === 0 ? [literal(\".\")] : cmd$1.args }\n\t};\n}\n\n//#endregion\n//#region src/compile/command/mkdir/mkdir.ts\n/**\n* mkdir command handler for the AST-based compiler.\n*/\n/**\n* Compile a mkdir command from SimpleCommandIR to StepIR.\n*/\nfunction compileMkdir(cmd$1) {\n\tlet recursive = false;\n\tconst paths = [];\n\tfor (const arg of cmd$1.args) if (expandedWordToString(arg) === \"-p\") recursive = true;\n\telse paths.push(arg);\n\tif (paths.length === 0) throw new Error(\"mkdir requires at least one path\");\n\treturn {\n\t\tcmd: \"mkdir\",\n\t\targs: {\n\t\t\tpaths,\n\t\t\trecursive\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/mv/mv.ts\n/**\n* mv command handler for the AST-based compiler.\n*/\n/**\n* Compile a mv command from SimpleCommandIR to StepIR.\n*/\nfunction compileMv(cmd$1) {\n\tconst filteredArgs = [];\n\tfor (const arg of cmd$1.args) {\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr !== \"-f\" && argStr !== \"-i\") filteredArgs.push(arg);\n\t}\n\tif (filteredArgs.length < 2) throw new Error(\"mv requires source and destination\");\n\tconst dest = filteredArgs.pop();\n\tif (!dest) throw new Error(\"mv requires source and destination\");\n\treturn {\n\t\tcmd: \"mv\",\n\t\targs: {\n\t\t\tdest,\n\t\t\tsrcs: filteredArgs\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/rm/rm.ts\n/**\n* rm command handler for the AST-based compiler.\n*/\n/**\n* Compile a rm command from SimpleCommandIR to StepIR.\n*/\nfunction compileRm(cmd$1) {\n\tlet recursive = false;\n\tconst paths = [];\n\tfor (const arg of cmd$1.args) {\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-r\") recursive = true;\n\t\telse if (argStr !== \"-f\" && argStr !== \"-i\") paths.push(arg);\n\t}\n\tif (paths.length === 0) throw new Error(\"rm requires at least one path\");\n\treturn {\n\t\tcmd: \"rm\",\n\t\targs: {\n\t\t\tpaths,\n\t\t\trecursive\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/tail/tail.ts\n/**\n* tail command handler for the AST-based compiler.\n*/\nconst NEGATIVE_NUMBER_REGEX = /^-\\d+$/;\n/**\n* Compile a tail command from SimpleCommandIR to StepIR.\n*/\nfunction compileTail(cmd$1) {\n\tlet n = 10;\n\tconst files = [];\n\tlet skipNext = false;\n\tfor (let i = 0; i < cmd$1.args.length; i++) {\n\t\tif (skipNext) {\n\t\t\tskipNext = false;\n\t\t\tcontinue;\n\t\t}\n\t\tconst arg = cmd$1.args[i];\n\t\tif (!arg) continue;\n\t\tconst argStr = expandedWordToString(arg);\n\t\tif (argStr === \"-n\") {\n\t\t\tconst numArg = cmd$1.args[i + 1];\n\t\t\tif (!numArg) throw new Error(\"tail -n requires a number\");\n\t\t\tn = Number(expandedWordToString(numArg));\n\t\t\tif (!Number.isFinite(n)) throw new Error(\"Invalid tail count\");\n\t\t\tskipNext = true;\n\t\t} else if (argStr.startsWith(\"-\") && NEGATIVE_NUMBER_REGEX.test(argStr)) n = Number(argStr.slice(1));\n\t\telse if (argStr.startsWith(\"-\")) throw new Error(\"Unknown tail option\");\n\t\telse files.push(arg);\n\t}\n\treturn {\n\t\tcmd: \"tail\",\n\t\targs: {\n\t\t\tfiles,\n\t\t\tn\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/compile/command/touch/touch.ts\n/**\n* touch command handler for the AST-based compiler.\n*/\n/**\n* Compile a touch command from SimpleCommandIR to StepIR.\n*/\nfunction compileTouch(cmd$1) {\n\tconst files = [];\n\tfor (const arg of cmd$1.args) if (!expandedWordToString(arg).startsWith(\"-\")) files.push(arg);\n\tif (files.length === 0) throw new Error(\"touch requires at least one file\");\n\treturn {\n\t\tcmd: \"touch\",\n\t\targs: { files }\n\t};\n}\n\n//#endregion\n//#region src/compile/command/handler.ts\nlet CommandHandler;\n(function(_CommandHandler) {\n\tconst handlers = {\n\t\tcat: compileCat,\n\t\tcp: compileCp,\n\t\thead: compileHead,\n\t\tls: compileLs,\n\t\tmkdir: compileMkdir,\n\t\tmv: compileMv,\n\t\trm: compileRm,\n\t\ttail: compileTail,\n\t\ttouch: compileTouch\n\t};\n\tfunction get(name) {\n\t\tconst handler = handlers[name];\n\t\tif (!handler) throw new Error(`Unknown command: ${name}`);\n\t\treturn handler;\n\t}\n\t_CommandHandler.get = get;\n\tfunction has(name) {\n\t\treturn name in handlers;\n\t}\n\t_CommandHandler.has = has;\n\tfunction register(name, handler) {\n\t\thandlers[name] = handler;\n\t}\n\t_CommandHandler.register = register;\n})(CommandHandler || (CommandHandler = {}));\n\n//#endregion\n//#region src/compile/compile.ts\n/**\n* AST-based compiler for the Fish subset parser.\n*\n* This compiler traverses the AST and produces a PipelineIR\n* with enhanced word expansion information.\n*\n* Key differences from the old compile.ts:\n* - Accepts Program from the new parser (not ShellAST)\n* - Produces PipelineIR with ExpandedWord types\n* - Preserves word structure for runtime expansion\n*/\n/**\n* Compile a Program AST to a PipelineIR.\n*\n* @param program The parsed Program AST\n* @returns The compiled PipelineIR\n*/\nfunction compile(program) {\n\treturn new ProgramCompiler().compileProgram(program);\n}\n/**\n* Compiler that traverses the AST to produce IR.\n*\n* Note: We don't implement the Visitor interface directly because\n* different AST nodes need to return different types. Instead, we\n* manually traverse the AST with type-specific methods.\n*/\nvar ProgramCompiler = class {\n\t/**\n\t* Compile a Program to a PipelineIR.\n\t*/\n\tcompileProgram(node) {\n\t\treturn this.compilePipeline(node.pipeline);\n\t}\n\t/**\n\t* Compile a Pipeline to a PipelineIR.\n\t*/\n\tcompilePipeline(node) {\n\t\tconst commands = node.commands.map((cmd$1) => this.compileSimpleCommand(cmd$1));\n\t\tif (commands.length === 0) throw new Error(\"Pipeline must contain at least one command\");\n\t\tconst firstCmd = commands[0];\n\t\tif (!firstCmd) throw new Error(\"Pipeline must contain at least one command\");\n\t\treturn {\n\t\t\tsource: this.determineSource(firstCmd),\n\t\t\tsteps: commands.map((cmd$1) => this.compileCommandToStep(cmd$1)),\n\t\t\tfirstCommand: firstCmd\n\t\t};\n\t}\n\t/**\n\t* Compile a SimpleCommand to a SimpleCommandIR.\n\t*/\n\tcompileSimpleCommand(node) {\n\t\treturn {\n\t\t\tname: this.expandWord(node.name),\n\t\t\targs: node.args.map((arg) => this.expandWord(arg)),\n\t\t\tredirections: node.redirections.map((r) => this.compileRedirection(r))\n\t\t};\n\t}\n\t/**\n\t* Compile a Redirection to a RedirectionIR.\n\t*/\n\tcompileRedirection(node) {\n\t\treturn {\n\t\t\tkind: node.redirectKind,\n\t\t\ttarget: this.expandWord(node.target)\n\t\t};\n\t}\n\t/**\n\t* Expand a Word to an ExpandedWord.\n\t* Handles concatenation of literal parts and detection of globs/command subs.\n\t*/\n\texpandWord(word) {\n\t\tconst parts = word.parts;\n\t\tif (parts.length === 0) return literal(\"\");\n\t\tif (parts.length === 1) {\n\t\t\tconst part = parts[0];\n\t\t\tif (!part) return literal(\"\");\n\t\t\treturn this.expandWordPart(part);\n\t\t}\n\t\tif (parts.every((p) => p.kind === \"literal\")) return literal(parts.map((p) => p.value).join(\"\"));\n\t\tif (parts.some((p) => p.kind === \"glob\")) return glob(parts.map((p) => {\n\t\t\tif (p.kind === \"literal\") return p.value;\n\t\t\tif (p.kind === \"glob\") return p.pattern;\n\t\t\treturn \"\";\n\t\t}).join(\"\"));\n\t\tif (parts.some((p) => p.kind === \"commandSub\")) {\n\t\t\tconst cmdSubPart = parts.find((p) => p.kind === \"commandSub\");\n\t\t\treturn commandSub(this.serializeProgram(cmdSubPart.program));\n\t\t}\n\t\treturn literal(parts.filter((p) => p.kind === \"literal\").map((p) => p.value).join(\"\"));\n\t}\n\t/**\n\t* Expand a single WordPart to an ExpandedWord.\n\t*/\n\texpandWordPart(part) {\n\t\tswitch (part.kind) {\n\t\t\tcase \"literal\": return literal(part.value);\n\t\t\tcase \"glob\": return glob(part.pattern);\n\t\t\tcase \"commandSub\": return commandSub(this.serializeProgram(part.program));\n\t\t\tdefault: {\n\t\t\t\tconst _exhaustive = part;\n\t\t\t\tthrow new Error(`Unknown word part kind: ${JSON.stringify(_exhaustive)}`);\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t* Determine the source for a pipeline based on the first command.\n\t*/\n\tdetermineSource(firstCmd) {\n\t\tconst firstArg = firstCmd.args[0];\n\t\tif (firstArg?.kind === \"literal\") return {\n\t\t\tkind: \"fs\",\n\t\t\tglob: firstArg.value\n\t\t};\n\t\tif (firstArg?.kind === \"glob\") return {\n\t\t\tkind: \"fs\",\n\t\t\tglob: firstArg.pattern\n\t\t};\n\t\treturn {\n\t\t\tkind: \"fs\",\n\t\t\tglob: \"**/*\"\n\t\t};\n\t}\n\t/**\n\t* Compile a SimpleCommandIR to a StepIR.\n\t*/\n\tcompileCommandToStep(cmd$1) {\n\t\tconst cmdName = this.extractLiteralString(cmd$1.name);\n\t\tif (!cmdName) throw new Error(\"Command name must be a literal string\");\n\t\treturn {\n\t\t\t...CommandHandler.get(cmdName)(cmd$1),\n\t\t\tredirections: cmd$1.redirections\n\t\t};\n\t}\n\t/**\n\t* Extract the literal string value from an ExpandedWord.\n\t* Returns null if the word is not a literal.\n\t*/\n\textractLiteralString(word) {\n\t\tif (word.kind === \"literal\") return word.value;\n\t\treturn null;\n\t}\n\t/**\n\t* Serialize a Program AST back to a string representation.\n\t* Used for storing command substitution content.\n\t*/\n\tserializeProgram(program) {\n\t\treturn program.pipeline.commands.map((cmd$1) => {\n\t\t\tconst name = cmd$1.name.literalValue ?? \"?\";\n\t\t\tconst args = cmd$1.args.map((arg) => arg.literalValue ?? \"?\").join(\" \");\n\t\t\treturn args ? `${name} ${args}` : name;\n\t\t}).join(\" | \");\n\t}\n};\n\n//#endregion\n//#region src/lexer/position.ts\n/**\n* Represents a position in source code.\n*/\nvar SourcePosition = class SourcePosition {\n\tline;\n\tcolumn;\n\toffset;\n\tconstructor(line, column, offset) {\n\t\tthis.line = line;\n\t\tthis.column = column;\n\t\tthis.offset = offset;\n\t}\n\tstatic ZERO = new SourcePosition(1, 1, 0);\n\ttoString() {\n\t\treturn `${this.line}:${this.column}`;\n\t}\n\tspan(end) {\n\t\treturn new SourceSpan(this, end);\n\t}\n};\n/**\n* Represents a span of source code from start to end position.\n*/\nvar SourceSpan = class {\n\tstart;\n\tend;\n\tconstructor(start, end) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\ttoString() {\n\t\treturn `${this.start}-${this.end}`;\n\t}\n};\n\n//#endregion\n//#region src/lexer/context.ts\n/**\n* Lexer states for the fish subset lexer state machine.\n*\n* Simplified for the subset - only tracks quoting and command substitution.\n*/\nconst LexerState = {\n\tNORMAL: 0,\n\tSINGLE_QUOTED: 1,\n\tDOUBLE_QUOTED: 2,\n\tCOMMAND_SUB: 3\n};\n/**\n* Manages the lexer state stack for tracking nested contexts.\n*\n* Fish subset has simple quoting:\n* - Single quotes: literal, no escapes, no substitution\n* - Double quotes: command substitution allowed, minimal escaping (\\\", \\\\)\n*/\nvar StateContext = class {\n\tstack = [LexerState.NORMAL];\n\t/**\n\t* Get the current lexer state.\n\t*/\n\tget current() {\n\t\treturn this.stack.at(-1) ?? LexerState.NORMAL;\n\t}\n\t/**\n\t* Get the stack depth.\n\t*/\n\tget depth() {\n\t\treturn this.stack.length;\n\t}\n\t/**\n\t* Check if we're inside any quote context.\n\t*/\n\tget inQuotes() {\n\t\tconst s = this.current;\n\t\treturn s === LexerState.SINGLE_QUOTED || s === LexerState.DOUBLE_QUOTED;\n\t}\n\t/**\n\t* Check if we're inside single quotes.\n\t*/\n\tget inSingleQuote() {\n\t\treturn this.current === LexerState.SINGLE_QUOTED;\n\t}\n\t/**\n\t* Check if we're inside double quotes.\n\t*/\n\tget inDoubleQuote() {\n\t\treturn this.current === LexerState.DOUBLE_QUOTED;\n\t}\n\t/**\n\t* Check if we're inside a command substitution.\n\t*/\n\tget inCommandSub() {\n\t\treturn this.current === LexerState.COMMAND_SUB;\n\t}\n\t/**\n\t* Push a new state onto the stack.\n\t*/\n\tpush(state) {\n\t\tthis.stack.push(state);\n\t}\n\t/**\n\t* Pop the current state from the stack.\n\t*/\n\tpop() {\n\t\tif (this.stack.length > 1) return this.stack.pop() ?? LexerState.NORMAL;\n\t\treturn LexerState.NORMAL;\n\t}\n\t/**\n\t* Reset the context to initial state.\n\t*/\n\treset() {\n\t\tthis.stack = [LexerState.NORMAL];\n\t}\n\t/**\n\t* Check if any parent context is double-quoted.\n\t* Useful for determining if command substitution should occur.\n\t*/\n\thasDoubleQuoteParent() {\n\t\treturn this.stack.includes(LexerState.DOUBLE_QUOTED);\n\t}\n\t/**\n\t* Check if any parent context is single-quoted.\n\t* If true, no expansions should occur.\n\t*/\n\thasSingleQuoteParent() {\n\t\treturn this.stack.includes(LexerState.SINGLE_QUOTED);\n\t}\n};\n\n//#endregion\n//#region src/lexer/token.ts\n/**\n* Token types for the fish subset lexer.\n*\n* This is a simplified subset of fish shell syntax focused on:\n* - Pipelines\n* - Command substitution (...)\n* - Globbing (* ? [...])\n* - Basic quoting\n* - Comments\n*\n* NOT supported: variables, brace expansion, control flow, functions\n*/\nconst TokenKind = {\n\tEOF: 0,\n\tERROR: 1,\n\tNEWLINE: 2,\n\tCOMMENT: 3,\n\tWORD: 4,\n\tNAME: 5,\n\tNUMBER: 6,\n\tPIPE: 7,\n\tLPAREN: 8,\n\tRPAREN: 9,\n\tLESS: 10,\n\tGREAT: 11,\n\tCOMMAND_SUB: 12,\n\tGLOB: 13\n};\n/**\n* Create an empty flags object.\n*/\nfunction createEmptyFlags() {\n\treturn {\n\t\tquoted: false,\n\t\tsingleQuoted: false,\n\t\tdoubleQuoted: false,\n\t\tcontainsExpansion: false,\n\t\tcontainsGlob: false\n\t};\n}\n/**\n* Check if any quote flag is set.\n*/\nfunction isQuoted(flags$1) {\n\treturn flags$1.quoted || flags$1.singleQuoted || flags$1.doubleQuoted;\n}\n/**\n* Human-readable names for token kinds.\n*/\nconst TOKEN_KIND_NAMES = {\n\t[TokenKind.EOF]: \"EOF\",\n\t[TokenKind.ERROR]: \"ERROR\",\n\t[TokenKind.NEWLINE]: \"NEWLINE\",\n\t[TokenKind.COMMENT]: \"COMMENT\",\n\t[TokenKind.WORD]: \"WORD\",\n\t[TokenKind.NAME]: \"NAME\",\n\t[TokenKind.NUMBER]: \"NUMBER\",\n\t[TokenKind.PIPE]: \"PIPE\",\n\t[TokenKind.LPAREN]: \"LPAREN\",\n\t[TokenKind.RPAREN]: \"RPAREN\",\n\t[TokenKind.LESS]: \"LESS\",\n\t[TokenKind.GREAT]: \"GREAT\",\n\t[TokenKind.COMMAND_SUB]: \"COMMAND_SUB\",\n\t[TokenKind.GLOB]: \"GLOB\"\n};\n/**\n* Canonical spellings for operators and special tokens.\n*/\nconst TOKEN_SPELLINGS = new Map([\n\t[TokenKind.EOF, \"<eof>\"],\n\t[TokenKind.ERROR, \"<error>\"],\n\t[TokenKind.NEWLINE, \"\\\\n\"],\n\t[TokenKind.PIPE, \"|\"],\n\t[TokenKind.LPAREN, \"(\"],\n\t[TokenKind.RPAREN, \")\"],\n\t[TokenKind.LESS, \"<\"],\n\t[TokenKind.GREAT, \">\"]\n]);\n/**\n* Represents a single token from the lexer.\n*/\nvar Token = class Token {\n\tkind;\n\tspelling;\n\tspan;\n\tflags;\n\tconstructor(kind, spelling, span, flags$1 = createEmptyFlags()) {\n\t\tthis.kind = kind;\n\t\tthis.spelling = spelling;\n\t\tthis.span = span;\n\t\tthis.flags = flags$1;\n\t}\n\t/**\n\t* Get the canonical spelling for a token kind.\n\t*/\n\tstatic spell(kind) {\n\t\treturn TOKEN_SPELLINGS.get(kind) ?? \"<unknown>\";\n\t}\n\t/**\n\t* Get the name of a token kind.\n\t*/\n\tstatic kindName(kind) {\n\t\treturn TOKEN_KIND_NAMES[kind] ?? \"UNKNOWN\";\n\t}\n\t/**\n\t* Check if this token is an operator.\n\t*/\n\tget isOperator() {\n\t\treturn this.kind >= TokenKind.PIPE && this.kind <= TokenKind.GREAT;\n\t}\n\t/**\n\t* Check if this token has any quote flags set.\n\t*/\n\tget isQuoted() {\n\t\treturn isQuoted(this.flags);\n\t}\n\t/**\n\t* Check if this token contains expansions (command substitution).\n\t*/\n\tget hasExpansions() {\n\t\treturn this.flags.containsExpansion;\n\t}\n\t/**\n\t* Check if this token contains glob patterns.\n\t*/\n\tget hasGlob() {\n\t\treturn this.flags.containsGlob;\n\t}\n\ttoString() {\n\t\treturn `Token(${Token.kindName(this.kind)}, \"${this.spelling}\", ${this.span})`;\n\t}\n};\n\n//#endregion\n//#region src/lexer/operators.ts\n/**\n* Multi-character operators sorted by length (longest first) for greedy matching.\n*\n* For the fish subset, we only support:\n* - | (pipe)\n* - > (output redirection - Phase 2)\n* - < (input redirection - Phase 2)\n*\n* NOT supported: &&, ||, >>, &>, >?, ;, &\n*/\nconst OPERATORS = [];\n/**\n* Single-character operators for O(1) lookup.\n*/\nconst SINGLE_CHAR_OPS = new Map([\n\t[\"|\", TokenKind.PIPE],\n\t[\"<\", TokenKind.LESS],\n\t[\">\", TokenKind.GREAT]\n]);\n/**\n* Characters that definitively end a word (token boundary).\n*/\nconst WORD_BOUNDARY_CHARS = new Set([\n\t\" \",\n\t\"\t\",\n\t\"\\n\",\n\t\"|\",\n\t\"<\",\n\t\">\",\n\t\"(\",\n\t\")\",\n\t\"\\0\"\n]);\n\n//#endregion\n//#region src/lexer/source-reader.ts\n/**\n* In-memory implementation of SourceReader (fast).\n*/\nvar StringSourceReader = class StringSourceReader {\n\tstatic EOF = \"\\0\";\n\tinput;\n\tpos = 0;\n\tline = 1;\n\tcolumn = 1;\n\tmarkState = null;\n\tconstructor(input) {\n\t\tthis.input = input;\n\t}\n\tget eof() {\n\t\treturn this.pos >= this.input.length;\n\t}\n\tget position() {\n\t\treturn new SourcePosition(this.line, this.column, this.pos);\n\t}\n\tpeek(offset = 0) {\n\t\tconst idx = this.pos + offset;\n\t\tconst char = this.input[idx];\n\t\treturn char !== void 0 ? char : StringSourceReader.EOF;\n\t}\n\tadvance() {\n\t\tif (this.eof) return StringSourceReader.EOF;\n\t\tconst char = this.input[this.pos];\n\t\tif (char === void 0) return StringSourceReader.EOF;\n\t\tthis.pos++;\n\t\tif (char === \"\\n\") {\n\t\t\tthis.line++;\n\t\t\tthis.column = 1;\n\t\t} else this.column++;\n\t\treturn char;\n\t}\n\tmark() {\n\t\tthis.markState = {\n\t\t\tpos: this.pos,\n\t\t\tline: this.line,\n\t\t\tcolumn: this.column\n\t\t};\n\t}\n\treset() {\n\t\tif (this.markState) {\n\t\t\tthis.pos = this.markState.pos;\n\t\t\tthis.line = this.markState.line;\n\t\t\tthis.column = this.markState.column;\n\t\t\tthis.markState = null;\n\t\t}\n\t}\n};\n\n//#endregion\n//#region src/lexer/scanner.ts\nconst NUMBER_PATTERN = /^[0-9]+$/;\nconst NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_-]*$/;\n/**\n* Merge two flags objects, combining their values.\n*/\nfunction mergeFlags(a, b) {\n\treturn {\n\t\tquoted: a.quoted || b.quoted,\n\t\tsingleQuoted: a.singleQuoted || b.singleQuoted,\n\t\tdoubleQuoted: a.doubleQuoted || b.doubleQuoted,\n\t\tcontainsExpansion: a.containsExpansion || b.containsExpansion,\n\t\tcontainsGlob: a.containsGlob || b.containsGlob\n\t};\n}\n/**\n* The main Scanner class for tokenizing fish subset source code.\n*\n* This lexer implements a fish-inspired subset with:\n* - Pipelines (|)\n* - Command substitution (...)\n* - Globbing (* ? [...])\n* - Single quotes (literal, no escapes)\n* - Double quotes (command substitution allowed, minimal escaping)\n* - Comments (#)\n* - Redirection (> <) - Phase 2\n*\n* NOT supported:\n* - Variables ($var)\n* - Brace expansion ({a,b})\n* - Control flow (if, for, while, etc.)\n* - Functions\n* - Background (&)\n* - Semicolons (;)\n* - and/or/not keywords\n* - Tilde expansion (~)\n* - Recursive globbing (**)\n*/\nvar Scanner = class {\n\tsource;\n\tstateCtx = new StateContext();\n\tdebug = false;\n\tconstructor(input) {\n\t\tthis.source = typeof input === \"string\" ? new StringSourceReader(input) : input;\n\t}\n\t/**\n\t* Enable debug logging of tokens.\n\t*/\n\tenableDebugging() {\n\t\tthis.debug = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Main entry: get next token.\n\t*/\n\tgetToken() {\n\t\tthis.skipWhitespace();\n\t\tconst start = this.source.position;\n\t\tconst token = this.nextToken(start);\n\t\tif (this.debug) console.log(token.toString());\n\t\treturn token;\n\t}\n\t/**\n\t* Tokenize all input.\n\t*/\n\ttokenize() {\n\t\tconst tokens = [];\n\t\tlet token;\n\t\tdo {\n\t\t\ttoken = this.getToken();\n\t\t\ttokens.push(token);\n\t\t} while (token.kind !== TokenKind.EOF);\n\t\treturn tokens;\n\t}\n\tnextToken(start) {\n\t\tconst c0 = this.source.peek();\n\t\tif (this.source.eof || c0 === \"\\0\") return this.makeToken(TokenKind.EOF, \"\", start);\n\t\tif (c0 === \"#\") return this.readComment(start);\n\t\tif (c0 === \"\\n\") {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(TokenKind.NEWLINE, \"\\n\", start);\n\t\t}\n\t\tconst opToken = this.tryMatchOperator(start);\n\t\tif (opToken) return opToken;\n\t\tconst singleOp = SINGLE_CHAR_OPS.get(c0);\n\t\tif (singleOp !== void 0) {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(singleOp, c0, start);\n\t\t}\n\t\tif (c0 === \"(\") {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(TokenKind.LPAREN, \"(\", start);\n\t\t}\n\t\tif (c0 === \")\") {\n\t\t\tthis.source.advance();\n\t\t\treturn this.makeToken(TokenKind.RPAREN, \")\", start);\n\t\t}\n\t\treturn this.readWord(start);\n\t}\n\ttryMatchOperator(start) {\n\t\tconst chars = this.source.peek() + this.source.peek(1);\n\t\tfor (const op of OPERATORS) if (chars.startsWith(op.pattern)) {\n\t\t\tfor (const _ of op.pattern) this.source.advance();\n\t\t\treturn this.makeToken(op.kind, op.pattern, start);\n\t\t}\n\t\treturn null;\n\t}\n\treadWord(start) {\n\t\tconst fastResult = this.tryFastPath(start);\n\t\tif (fastResult) return fastResult;\n\t\treturn this.readComplexWord(start);\n\t}\n\ttryFastPath(start) {\n\t\tthis.source.mark();\n\t\tlet spelling = \"\";\n\t\twhile (!this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (this.isSpecialChar(c)) break;\n\t\t\tspelling += this.source.advance();\n\t\t}\n\t\tif (spelling.length === 0) {\n\t\t\tthis.source.reset();\n\t\t\treturn null;\n\t\t}\n\t\tconst next = this.source.peek();\n\t\tif (this.isWordBoundary(next)) return this.classifyWord(spelling, start, createEmptyFlags());\n\t\tthis.source.reset();\n\t\treturn null;\n\t}\n\treadComplexWord(start) {\n\t\tthis.stateCtx.reset();\n\t\tlet spelling = \"\";\n\t\tlet flags$1 = createEmptyFlags();\n\t\twhile (!this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (!this.stateCtx.inQuotes && this.isWordBoundary(c)) break;\n\t\t\tconst result = this.processChar(c);\n\t\t\tspelling += result.chars;\n\t\t\tflags$1 = mergeFlags(flags$1, result.flags);\n\t\t\tif (result.done) break;\n\t\t}\n\t\treturn this.classifyWord(spelling, start, flags$1);\n\t}\n\tprocessChar(c) {\n\t\tif (c === \"'\" && !this.stateCtx.inDoubleQuote) return this.handleSingleQuote();\n\t\tif (c === \"\\\"\" && !this.stateCtx.inSingleQuote) return this.handleDoubleQuote();\n\t\tif (c === \"\\\\\" && !this.stateCtx.inSingleQuote) return this.handleEscape();\n\t\tif (c === \"(\" && !this.stateCtx.inSingleQuote) return this.readCommandSubstitution();\n\t\tif ((c === \"*\" || c === \"?\") && !this.stateCtx.inQuotes) return this.handleGlobChar(c);\n\t\tif (c === \"[\" && !this.stateCtx.inQuotes) return this.readCharacterClass();\n\t\tthis.source.advance();\n\t\treturn {\n\t\t\tchars: c,\n\t\t\tflags: createEmptyFlags(),\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleGlobChar(c) {\n\t\tthis.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.containsGlob = true;\n\t\treturn {\n\t\t\tchars: c,\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleSingleQuote() {\n\t\tif (this.stateCtx.inSingleQuote) {\n\t\t\tthis.stateCtx.pop();\n\t\t\tthis.source.advance();\n\t\t\treturn {\n\t\t\t\tchars: \"\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tthis.stateCtx.push(LexerState.SINGLE_QUOTED);\n\t\tthis.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.singleQuoted = true;\n\t\tflags$1.quoted = true;\n\t\treturn {\n\t\t\tchars: \"\",\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleDoubleQuote() {\n\t\tif (this.stateCtx.inDoubleQuote) {\n\t\t\tthis.stateCtx.pop();\n\t\t\tthis.source.advance();\n\t\t\treturn {\n\t\t\t\tchars: \"\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tthis.stateCtx.push(LexerState.DOUBLE_QUOTED);\n\t\tthis.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.doubleQuoted = true;\n\t\tflags$1.quoted = true;\n\t\treturn {\n\t\t\tchars: \"\",\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\thandleEscape() {\n\t\tthis.source.advance();\n\t\tconst next = this.source.peek();\n\t\tif (this.source.eof || next === \"\\0\") return {\n\t\t\tchars: \"\\\\\",\n\t\t\tflags: createEmptyFlags(),\n\t\t\tdone: false\n\t\t};\n\t\tif (next === \"\\n\") {\n\t\t\tthis.source.advance();\n\t\t\treturn {\n\t\t\t\tchars: \"\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tif (this.stateCtx.inDoubleQuote) {\n\t\t\tif (\"\\\"\\\\\".includes(next)) {\n\t\t\t\tthis.source.advance();\n\t\t\t\treturn {\n\t\t\t\t\tchars: next,\n\t\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\t\tdone: false\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchars: \"\\\\\",\n\t\t\t\tflags: createEmptyFlags(),\n\t\t\t\tdone: false\n\t\t\t};\n\t\t}\n\t\tthis.source.advance();\n\t\treturn {\n\t\t\tchars: next,\n\t\t\tflags: createEmptyFlags(),\n\t\t\tdone: false\n\t\t};\n\t}\n\treadCommandSubstitution() {\n\t\tlet result = \"\";\n\t\tresult += this.source.advance();\n\t\tlet depth = 1;\n\t\twhile (depth > 0 && !this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (c === \"(\") {\n\t\t\t\tdepth++;\n\t\t\t\tresult += this.source.advance();\n\t\t\t} else if (c === \")\") {\n\t\t\t\tdepth--;\n\t\t\t\tresult += this.source.advance();\n\t\t\t} else if (c === \"'\" || c === \"\\\"\") result += this.skipQuotedContent(c);\n\t\t\telse if (c === \"\\\\\" && !this.source.eof) {\n\t\t\t\tresult += this.source.advance();\n\t\t\t\tif (!this.source.eof) result += this.source.advance();\n\t\t\t} else result += this.source.advance();\n\t\t}\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.containsExpansion = true;\n\t\treturn {\n\t\t\tchars: result,\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\treadCharacterClass() {\n\t\tlet result = \"\";\n\t\tresult += this.source.advance();\n\t\tif (this.source.peek() === \"!\" || this.source.peek() === \"^\") result += this.source.advance();\n\t\tif (this.source.peek() === \"]\") result += this.source.advance();\n\t\twhile (!this.source.eof && this.source.peek() !== \"]\") result += this.source.advance();\n\t\tif (this.source.peek() === \"]\") result += this.source.advance();\n\t\tconst flags$1 = createEmptyFlags();\n\t\tflags$1.containsGlob = true;\n\t\treturn {\n\t\t\tchars: result,\n\t\t\tflags: flags$1,\n\t\t\tdone: false\n\t\t};\n\t}\n\tskipQuotedContent(quoteChar) {\n\t\tlet result = \"\";\n\t\tresult += this.source.advance();\n\t\twhile (!this.source.eof && this.source.peek() !== quoteChar) {\n\t\t\tconst c = this.source.peek();\n\t\t\tresult += this.source.advance();\n\t\t\tif (c === \"\\\\\" && quoteChar === \"\\\"\" && !this.source.eof) result += this.source.advance();\n\t\t}\n\t\tif (this.source.peek() === quoteChar) result += this.source.advance();\n\t\treturn result;\n\t}\n\tclassifyWord(spelling, start, flags$1) {\n\t\tif (NUMBER_PATTERN.test(spelling)) return this.makeToken(TokenKind.NUMBER, spelling, start, flags$1);\n\t\tif (NAME_PATTERN.test(spelling)) return this.makeToken(TokenKind.NAME, spelling, start, flags$1);\n\t\treturn this.makeToken(TokenKind.WORD, spelling, start, flags$1);\n\t}\n\tskipWhitespace() {\n\t\twhile (!this.source.eof) {\n\t\t\tconst c = this.source.peek();\n\t\t\tif (c === \" \" || c === \"\t\") this.source.advance();\n\t\t\telse if (c === \"\\\\\" && this.source.peek(1) === \"\\n\") {\n\t\t\t\tthis.source.advance();\n\t\t\t\tthis.source.advance();\n\t\t\t} else break;\n\t\t}\n\t}\n\treadComment(start) {\n\t\tlet spelling = \"\";\n\t\twhile (!this.source.eof && this.source.peek() !== \"\\n\") spelling += this.source.advance();\n\t\treturn this.makeToken(TokenKind.COMMENT, spelling, start);\n\t}\n\tisSpecialChar(c) {\n\t\treturn \" \t\\n|<>()\\\"'\\\\*?[#\".includes(c);\n\t}\n\tisWordBoundary(c) {\n\t\treturn WORD_BOUNDARY_CHARS.has(c) || c === \"\\0\";\n\t}\n\tmakeToken(kind, spelling, start, flags$1 = createEmptyFlags()) {\n\t\treturn new Token(kind, spelling, start.span(this.source.position), flags$1);\n\t}\n};\n\n//#endregion\n//#region src/parser/ast.ts\n/**\n* Base class for all AST nodes.\n* Every node has a source span for error reporting.\n*/\nvar ASTNode = class {\n\tspan;\n\tconstructor(span) {\n\t\tthis.span = span;\n\t}\n};\n/**\n* Root AST node representing a complete program.\n* A program is a single pipeline (Fish subset does not support multiple statements).\n*/\nvar Program = class extends ASTNode {\n\tpipeline;\n\tconstructor(span, pipeline) {\n\t\tsuper(span);\n\t\tthis.pipeline = pipeline;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitProgram(this);\n\t}\n};\n/**\n* A pipeline of one or more commands connected by pipes.\n* Example: `ls | grep foo | sort`\n*/\nvar Pipeline = class extends ASTNode {\n\tcommands;\n\tconstructor(span, commands) {\n\t\tsuper(span);\n\t\tthis.commands = commands;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitPipeline(this);\n\t}\n};\n/**\n* A simple command with a name, arguments, and optional redirections.\n* Example: `grep -n pattern file.txt > output.txt`\n*/\nvar SimpleCommand = class extends ASTNode {\n\t/** The command name (first word) */\n\tname;\n\t/** Command arguments (remaining words) */\n\targs;\n\t/** Redirections (Phase 2) */\n\tredirections;\n\tconstructor(span, name, args, redirections = []) {\n\t\tsuper(span);\n\t\tthis.name = name;\n\t\tthis.args = args;\n\t\tthis.redirections = redirections;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitSimpleCommand(this);\n\t}\n};\n/**\n* A word is a sequence of word parts.\n* Parts can be literals, globs, or command substitutions.\n* Example: `foo*.txt` has a literal part \"foo\", a glob part \"*\", and a literal part \".txt\"\n*/\nvar Word = class extends ASTNode {\n\tparts;\n\t/** True if the word was quoted (single or double) */\n\tquoted;\n\tconstructor(span, parts, quoted = false) {\n\t\tsuper(span);\n\t\tthis.parts = parts;\n\t\tthis.quoted = quoted;\n\t}\n\t/**\n\t* Get the literal value if this word has no expansions.\n\t* Returns null if the word contains globs or command substitutions.\n\t*/\n\tget literalValue() {\n\t\tif (this.parts.every((p) => p.kind === \"literal\")) return this.parts.map((p) => p.value).join(\"\");\n\t\treturn null;\n\t}\n\t/**\n\t* Check if this word contains any glob patterns.\n\t*/\n\tget hasGlob() {\n\t\treturn this.parts.some((p) => p.kind === \"glob\");\n\t}\n\t/**\n\t* Check if this word contains command substitution.\n\t*/\n\tget hasCommandSub() {\n\t\treturn this.parts.some((p) => p.kind === \"commandSub\");\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitWord(this);\n\t}\n};\n/**\n* A literal string part of a word.\n*/\nvar LiteralPart = class {\n\tkind = \"literal\";\n\tspan;\n\tvalue;\n\tconstructor(span, value) {\n\t\tthis.span = span;\n\t\tthis.value = value;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitLiteralPart(this);\n\t}\n};\n/**\n* A glob pattern part of a word.\n* Examples: `*`, `?`, `[abc]`, `[a-z]`, `[!abc]`\n*/\nvar GlobPart = class {\n\tkind = \"glob\";\n\tspan;\n\tpattern;\n\tconstructor(span, pattern) {\n\t\tthis.span = span;\n\t\tthis.pattern = pattern;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitGlobPart(this);\n\t}\n};\n/**\n* A command substitution part of a word.\n* Example: `(ls -la)`\n*\n* The inner program is parsed recursively.\n*/\nvar CommandSubPart = class {\n\tkind = \"commandSub\";\n\tspan;\n\t/** The inner program to execute */\n\tprogram;\n\tconstructor(span, program) {\n\t\tthis.span = span;\n\t\tthis.program = program;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitCommandSubPart(this);\n\t}\n};\n/**\n* A redirection (input or output).\n* Examples: `< input.txt`, `> output.txt`\n*/\nvar Redirection = class extends ASTNode {\n\tredirectKind;\n\ttarget;\n\tconstructor(span, redirectKind, target) {\n\t\tsuper(span);\n\t\tthis.redirectKind = redirectKind;\n\t\tthis.target = target;\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visitRedirection(this);\n\t}\n};\n\n//#endregion\n//#region src/parser/command.ts\n/**\n* Command parser for the Fish subset parser.\n*\n* Handles parsing of commands:\n* - Simple commands (name + args)\n* - Redirections (< > Phase 2)\n*/\n/**\n* Parser for commands.\n*\n* A command in the Fish subset is:\n* - A simple command: name followed by arguments and optional redirections\n*\n* Fish subset does NOT support:\n* - Compound commands (if, for, while, function, etc.)\n* - Background execution (&)\n* - Semicolons (;)\n*/\nvar CommandParser = class {\n\tparser;\n\twordParser;\n\tconstructor(parser, wordParser) {\n\t\tthis.parser = parser;\n\t\tthis.wordParser = wordParser;\n\t}\n\t/**\n\t* Parse a command.\n\t* Returns null if no command is present.\n\t*/\n\tparseCommand() {\n\t\treturn this.parseSimpleCommand();\n\t}\n\t/**\n\t* Parse a simple command: name + args + redirections.\n\t*\n\t* Grammar:\n\t* simple_command ::= word+ (redirection)*\n\t*/\n\tparseSimpleCommand() {\n\t\tconst startPos = this.parser.currentToken.span.start;\n\t\tconst name = this.wordParser.parseWord();\n\t\tif (!name) return null;\n\t\tconst args = [];\n\t\tconst redirections = [];\n\t\twhile (!this.isCommandTerminator()) {\n\t\t\tconst redir = this.parseRedirection();\n\t\t\tif (redir) {\n\t\t\t\tredirections.push(redir);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst word = this.wordParser.parseWord();\n\t\t\tif (word) args.push(word);\n\t\t\telse break;\n\t\t}\n\t\tconst endPos = this.parser.previousTokenPosition;\n\t\treturn new SimpleCommand(new SourceSpan(startPos, endPos), name, args, redirections);\n\t}\n\t/**\n\t* Parse a redirection if present.\n\t*\n\t* Grammar:\n\t* redirection ::= '<' word | '>' word\n\t*/\n\tparseRedirection() {\n\t\tconst token = this.parser.currentToken;\n\t\tif (token.kind === TokenKind.LESS) {\n\t\t\tconst startPos = token.span.start;\n\t\t\tthis.parser.advance();\n\t\t\tconst target = this.wordParser.parseWord();\n\t\t\tif (!target) {\n\t\t\t\tthis.parser.syntacticError(\"Expected filename after <\", \"word\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst endPos = this.parser.previousTokenPosition;\n\t\t\treturn new Redirection(new SourceSpan(startPos, endPos), \"input\", target);\n\t\t}\n\t\tif (token.kind === TokenKind.GREAT) {\n\t\t\tconst startPos = token.span.start;\n\t\t\tthis.parser.advance();\n\t\t\tconst target = this.wordParser.parseWord();\n\t\t\tif (!target) {\n\t\t\t\tthis.parser.syntacticError(\"Expected filename after >\", \"word\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst endPos = this.parser.previousTokenPosition;\n\t\t\treturn new Redirection(new SourceSpan(startPos, endPos), \"output\", target);\n\t\t}\n\t\treturn null;\n\t}\n\t/**\n\t* Check if current token terminates a command.\n\t*/\n\tisCommandTerminator() {\n\t\tconst kind = this.parser.currentToken.kind;\n\t\treturn kind === TokenKind.PIPE || kind === TokenKind.NEWLINE || kind === TokenKind.EOF;\n\t}\n};\n\n//#endregion\n//#region src/parser/error-reporter.ts\n/**\n* Error reporter for collecting parser diagnostics.\n*\n* Supports both immediate error throwing and error collection modes.\n*/\nvar ErrorReporter = class {\n\tdiagnostics = [];\n\terrorCount = 0;\n\twarningCount = 0;\n\t/**\n\t* Report an error.\n\t*/\n\treportError(message, span, code) {\n\t\tthis.diagnostics.push({\n\t\t\tseverity: \"error\",\n\t\t\tmessage,\n\t\t\tspan,\n\t\t\tcode\n\t\t});\n\t\tthis.errorCount++;\n\t}\n\t/**\n\t* Report a warning.\n\t*/\n\treportWarning(message, span, code) {\n\t\tthis.diagnostics.push({\n\t\t\tseverity: \"warning\",\n\t\t\tmessage,\n\t\t\tspan,\n\t\t\tcode\n\t\t});\n\t\tthis.warningCount++;\n\t}\n\t/**\n\t* Report an informational message.\n\t*/\n\treportInfo(message, span, code) {\n\t\tthis.diagnostics.push({\n\t\t\tseverity: \"info\",\n\t\t\tmessage,\n\t\t\tspan,\n\t\t\tcode\n\t\t});\n\t}\n\t/**\n\t* Check if any errors have been reported.\n\t*/\n\thasErrors() {\n\t\treturn this.errorCount > 0;\n\t}\n\t/**\n\t* Check if any warnings have been reported.\n\t*/\n\thasWarnings() {\n\t\treturn this.warningCount > 0;\n\t}\n\t/**\n\t* Get the number of errors.\n\t*/\n\tgetErrorCount() {\n\t\treturn this.errorCount;\n\t}\n\t/**\n\t* Get the number of warnings.\n\t*/\n\tgetWarningCount() {\n\t\treturn this.warningCount;\n\t}\n\t/**\n\t* Get all diagnostics.\n\t*/\n\tgetDiagnostics() {\n\t\treturn this.diagnostics;\n\t}\n\t/**\n\t* Get only error diagnostics.\n\t*/\n\tgetErrors() {\n\t\treturn this.diagnostics.filter((d) => d.severity === \"error\");\n\t}\n\t/**\n\t* Get only warning diagnostics.\n\t*/\n\tgetWarnings() {\n\t\treturn this.diagnostics.filter((d) => d.severity === \"warning\");\n\t}\n\t/**\n\t* Clear all diagnostics.\n\t*/\n\tclear() {\n\t\tthis.diagnostics.length = 0;\n\t\tthis.errorCount = 0;\n\t\tthis.warningCount = 0;\n\t}\n\t/**\n\t* Format all diagnostics as a string for display.\n\t*/\n\tformat() {\n\t\treturn this.diagnostics.map((d) => {\n\t\t\tconst loc = `${d.span.start.line}:${d.span.start.column}`;\n\t\t\tlet prefix;\n\t\t\tif (d.severity === \"error\") prefix = \"Error\";\n\t\t\telse if (d.severity === \"warning\") prefix = \"Warning\";\n\t\t\telse prefix = \"Info\";\n\t\t\tconst code = d.code ? ` [${d.code}]` : \"\";\n\t\t\treturn `${prefix}${code} at ${loc}: ${d.message}`;\n\t\t}).join(\"\\n\");\n\t}\n};\n\n//#endregion\n//#region src/parser/statement.ts\n/**\n* Statement parser for the Fish subset parser.\n*\n* Handles parsing of:\n* - Pipelines (command | command | ...)\n*\n* Fish subset does NOT support:\n* - Multiple statements (no ; or newline-separated statements)\n* - Control flow (if, for, while, etc.)\n*/\n/**\n* Parser for statements and pipelines.\n*\n* In the Fish subset, a program is a single pipeline.\n*/\nvar StatementParser = class {\n\tparser;\n\tcommandParser;\n\tconstructor(parser, commandParser) {\n\t\tthis.parser = parser;\n\t\tthis.commandParser = commandParser;\n\t}\n\t/**\n\t* Parse a pipeline.\n\t*\n\t* Grammar:\n\t* pipeline ::= command ('|' command)*\n\t*/\n\tparsePipeline() {\n\t\tconst startPos = this.parser.currentToken.span.start;\n\t\tconst firstCommand = this.commandParser.parseCommand();\n\t\tif (!firstCommand) return null;\n\t\tconst commands = [firstCommand];\n\t\twhile (this.parser.currentToken.kind === TokenKind.PIPE) {\n\t\t\tthis.parser.advance();\n\t\t\tthis.skipNewlines();\n\t\t\tconst command = this.commandParser.parseCommand();\n\t\t\tif (!command) {\n\t\t\t\tthis.parser.syntacticError(\"Expected command after |\", \"command\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcommands.push(command);\n\t\t}\n\t\tconst endPos = this.parser.previousTokenPosition;\n\t\treturn new Pipeline(new SourceSpan(startPos, endPos), commands);\n\t}\n\t/**\n\t* Skip newline tokens (for line continuation after pipe).\n\t*/\n\tskipNewlines() {\n\t\twhile (this.parser.currentToken.kind === TokenKind.NEWLINE) this.parser.advance();\n\t}\n};\n\n//#endregion\n//#region src/parser/syntax-error.ts\n/**\n* Exception thrown when a syntax error is encountered during parsing.\n*/\nvar ParseSyntaxError = class ParseSyntaxError extends Error {\n\t/** The source span where the error occurred */\n\tspan;\n\t/** Additional context about the error */\n\tcontext;\n\tconstructor(message, span, context) {\n\t\tsuper(ParseSyntaxError.formatMessage(message, span, context));\n\t\tthis.name = \"ParseSyntaxError\";\n\t\tthis.span = span;\n\t\tthis.context = context;\n\t\tif (Error.captureStackTrace) Error.captureStackTrace(this, ParseSyntaxError);\n\t}\n\t/**\n\t* Format an error message with position information.\n\t*/\n\tstatic formatMessage(message, span, context) {\n\t\tconst base = `Syntax error at ${`${span.start.line}:${span.start.column}`}: ${message}`;\n\t\treturn context ? `${base} (${context})` : base;\n\t}\n\t/**\n\t* Get the line number where the error occurred.\n\t*/\n\tget line() {\n\t\treturn this.span.start.line;\n\t}\n\t/**\n\t* Get the column number where the error occurred.\n\t*/\n\tget column() {\n\t\treturn this.span.start.column;\n\t}\n};\n/**\n* Exception thrown when the parser encounters an unexpected end of input.\n*/\nvar UnexpectedEOFError = class extends ParseSyntaxError {\n\tconstructor(expected, span) {\n\t\tsuper(`Unexpected end of input, expected ${expected}`, span);\n\t\tthis.name = \"UnexpectedEOFError\";\n\t}\n};\n/**\n* Exception thrown when the parser encounters an unexpected token.\n*/\nvar UnexpectedTokenError = class extends ParseSyntaxError {\n\tfound;\n\texpected;\n\tconstructor(found, expected, span) {\n\t\tsuper(`Unexpected token '${found}', expected ${expected}`, span);\n\t\tthis.name = \"UnexpectedTokenError\";\n\t\tthis.found = found;\n\t\tthis.expected = expected;\n\t}\n};\n\n//#endregion\n//#region src/parser/word.ts\n/**\n* Word parser for the Fish subset parser.\n*\n* Handles parsing of words and their components:\n* - Literal text\n* - Glob patterns (* ? [...])\n* - Command substitution (...)\n* - Quoted strings\n*/\n/**\n* Parser for words and word parts.\n*\n* A word can consist of:\n* - Literal parts (plain text)\n* - Glob parts (* ? [...])\n* - Command substitution parts (...)\n*/\nvar WordParser = class {\n\tparser;\n\tconstructor(parser) {\n\t\tthis.parser = parser;\n\t}\n\t/**\n\t* Parse a single word from the current position.\n\t* Returns null if no word is present.\n\t*\n\t* A word consists of a single token from the scanner.\n\t* The token may contain multiple parts (literal, glob, command substitution)\n\t* which are parsed and combined into a single Word AST node.\n\t*/\n\tparseWord() {\n\t\tconst token = this.parser.currentToken;\n\t\tif (!this.isWordToken(token)) return null;\n\t\tconst startPos = token.span.start;\n\t\tconst part = this.parseWordPart(token);\n\t\tconst parts = part ? [part] : [];\n\t\tif (parts.length === 0) return null;\n\t\tthis.parser.advance();\n\t\tconst endPos = token.span.end;\n\t\tconst span = new SourceSpan(startPos, endPos);\n\t\tconst quoted = token.isQuoted;\n\t\treturn new Word(span, parts, quoted);\n\t}\n\t/**\n\t* Parse a single word part from a token.\n\t*/\n\tparseWordPart(token) {\n\t\tif (token.hasExpansions) return this.parseCommandSubstitution(token);\n\t\tif (token.hasGlob) return this.parseGlobPart(token);\n\t\treturn new LiteralPart(token.span, token.spelling);\n\t}\n\t/**\n\t* Parse a command substitution from a token.\n\t* The token spelling contains the full (...) content.\n\t*/\n\tparseCommandSubstitution(token) {\n\t\tlet inner = token.spelling;\n\t\tif (inner.startsWith(\"(\") && inner.endsWith(\")\")) inner = inner.slice(1, -1);\n\t\tconst innerProgram = this.parser.parseSubstitution(inner);\n\t\treturn new CommandSubPart(token.span, innerProgram);\n\t}\n\t/**\n\t* Parse a glob pattern from a token.\n\t*/\n\tparseGlobPart(token) {\n\t\treturn new GlobPart(token.span, token.spelling);\n\t}\n\t/**\n\t* Check if a token can be part of a word.\n\t*/\n\tisWordToken(token) {\n\t\tconst kind = token.kind;\n\t\treturn kind === TokenKind.WORD || kind === TokenKind.NAME || kind === TokenKind.NUMBER || kind === TokenKind.GLOB || kind === TokenKind.COMMAND_SUB;\n\t}\n};\n\n//#endregion\n//#region src/parser/parser.ts\n/**\n* Main parser for the Fish subset language.\n*\n* This is a modular, recursive descent (LL-style) parser inspired by\n* the VC Parser architecture. It uses single-token lookahead (LL(1))\n* and streams tokens from the lexer.\n*\n* The parser delegates to sub-parsers:\n* - StatementParser: pipelines\n* - CommandParser: simple commands\n* - WordParser: words and expansions\n*\n* Fish subset features supported:\n* - Pipelines (|)\n* - Command substitution (...)\n* - Globbing (* ? [...])\n* - Redirections (< >) - Phase 2\n* - Comments (#)\n*\n* NOT supported:\n* - Variables ($var)\n* - Control flow (if, for, while, etc.)\n* - Functions\n* - Brace expansion\n* - Semicolons\n* - Background jobs (&)\n*/\n/**\n* Main parser class for the Fish subset language.\n*\n* Usage:\n* ```typescript\n* const parser = new Parser('ls | grep foo');\n* const ast = parser.parse();\n* ```\n*/\nvar Parser = class Parser {\n\t/** The scanner/lexer for tokenization */\n\tscanner;\n\t/** Error reporter for collecting diagnostics */\n\terrorReporter;\n\t/** Current token being examined */\n\t_currentToken;\n\t/** Position of the previous token (for span tracking) */\n\t_previousTokenPosition;\n\t/** Sub-parsers */\n\twordParser;\n\tcommandParser;\n\tstatementParser;\n\t/** Recursion depth for command substitution */\n\tsubstitutionDepth;\n\t/** Maximum recursion depth */\n\tstatic MAX_SUBSTITUTION_DEPTH = 10;\n\tconstructor(input, errorReporter, depth = 0) {\n\t\tthis.scanner = typeof input === \"string\" ? new Scanner(input) : input;\n\t\tthis.errorReporter = errorReporter ?? new ErrorReporter();\n\t\tthis.substitutionDepth = depth;\n\t\tthis._currentToken = this.scanner.getToken();\n\t\tthis._previousTokenPosition = this._currentToken.span.start;\n\t\tthis.wordParser = new WordParser(this);\n\t\tthis.commandParser = new CommandParser(this, this.wordParser);\n\t\tthis.statementParser = new StatementParser(this, this.commandParser);\n\t}\n\t/**\n\t* Parse the input and return a Program AST.\n\t* @throws SyntaxError if the input is invalid\n\t*/\n\tparse() {\n\t\treturn this.parseProgram();\n\t}\n\t/**\n\t* Get the error reporter for accessing diagnostics.\n\t*/\n\tgetErrorReporter() {\n\t\treturn this.errorReporter;\n\t}\n\t/**\n\t* Get the current token.\n\t*/\n\tget currentToken() {\n\t\treturn this._currentToken;\n\t}\n\t/**\n\t* Get the position of the previous token.\n\t*/\n\tget previousTokenPosition() {\n\t\treturn this._previousTokenPosition;\n\t}\n\t/**\n\t* Advance to the next token.\n\t*/\n\tadvance() {\n\t\tthis._previousTokenPosition = this._currentToken.span.end;\n\t\tthis._currentToken = this.scanner.getToken();\n\t}\n\t/**\n\t* Match the current token against an expected kind.\n\t* Advances if matched, throws error if not.\n\t*\n\t* @param expected The expected token kind\n\t* @throws SyntaxError if the current token doesn't match\n\t*/\n\tmatch(expected) {\n\t\tif (this._currentToken.kind === expected) {\n\t\t\tthis._previousTokenPosition = this._currentToken.span.end;\n\t\t\tthis._currentToken = this.scanner.getToken();\n\t\t} else this.syntacticError(`Expected ${Token.kindName(expected)}`, Token.kindName(expected));\n\t}\n\t/**\n\t* Accept a token if it matches the expected kind.\n\t* Returns true and advances if matched, false otherwise.\n\t*\n\t* @param expected The expected token kind\n\t* @returns true if the token was accepted\n\t*/\n\taccept(expected) {\n\t\tif (this._currentToken.kind === expected) {\n\t\t\tthis._previousTokenPosition = this._currentToken.span.end;\n\t\t\tthis._currentToken = this.scanner.getToken();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Check if the current token matches the expected kind.\n\t* Does not advance.\n\t*\n\t* @param expected The expected token kind\n\t* @returns true if the current token matches\n\t*/\n\tcheck(expected) {\n\t\treturn this._currentToken.kind === expected;\n\t}\n\t/**\n\t* Start tracking a span from the current token position.\n\t*/\n\tstartSpan() {\n\t\treturn this._currentToken.span.start;\n\t}\n\t/**\n\t* Finish a span at the previous token position.\n\t*/\n\tfinishSpan(start) {\n\t\treturn new SourceSpan(start, this._previousTokenPosition);\n\t}\n\t/**\n\t* Report a syntactic error and throw an exception.\n\t*\n\t* @param message Error message\n\t* @param expected What was expected (for error context)\n\t* @throws SyntaxError always\n\t*/\n\tsyntacticError(message, expected) {\n\t\tconst span = this._currentToken.span;\n\t\tthis.errorReporter.reportError(message, span);\n\t\tif (this._currentToken.kind === TokenKind.EOF) throw new UnexpectedEOFError(expected, span);\n\t\tthrow new UnexpectedTokenError(this._currentToken.spelling || Token.kindName(this._currentToken.kind), expected, span);\n\t}\n\t/**\n\t* Parse a complete program.\n\t*\n\t* Grammar:\n\t* program ::= pipeline\n\t*/\n\tparseProgram() {\n\t\tconst startPos = this.startSpan();\n\t\tthis.skipIgnorable();\n\t\tconst pipeline = this.statementParser.parsePipeline();\n\t\tif (!pipeline) this.syntacticError(\"Expected command\", \"command\");\n\t\tthis.skipIgnorable();\n\t\tif (this._currentToken.kind !== TokenKind.EOF) this.syntacticError(\"Unexpected token after pipeline\", \"end of input\");\n\t\treturn new Program(this.finishSpan(startPos), pipeline);\n\t}\n\t/**\n\t* Parse a command substitution (inner program).\n\t* Called recursively when parsing (...) content.\n\t*\n\t* @param input The inner content of the command substitution\n\t* @returns The parsed program\n\t*/\n\tparseSubstitution(input) {\n\t\tif (this.substitutionDepth >= Parser.MAX_SUBSTITUTION_DEPTH) throw new ParseSyntaxError(\"Maximum command substitution depth exceeded\", this._currentToken.span);\n\t\treturn new Parser(input, this.errorReporter, this.substitutionDepth + 1).parse();\n\t}\n\t/**\n\t* Skip comments and newlines.\n\t*/\n\tskipIgnorable() {\n\t\twhile (this._currentToken.kind === TokenKind.COMMENT || this._currentToken.kind === TokenKind.NEWLINE) this.advance();\n\t}\n};\n/**\n* Parse a Fish subset input string and return the AST.\n*\n* @param input The input string to parse\n* @returns The parsed Program AST\n* @throws SyntaxError if the input is invalid\n*/\nfunction parse(input) {\n\treturn new Parser(input).parse();\n}\n\n//#endregion\nexport { Parser, cmd, commandSub, compile, expandedWordToString, extractPathsFromExpandedWords, glob, literal, parse };","import type { Record } from '../record';\nimport type { Stream } from '../stream';\n\n/**\n * A Consumer terminates a stream.\n * It pulls values and produces a final result or side-effect.\n */\nexport type Consumer<T, R = void> = (input: Stream<T>) => Promise<R>;\n\n/**\n * Collects the entire stream into memory.\n * Pure from an API perspective.\n */\nexport function collect<T>(): Consumer<T, T[]> {\n\treturn async (input) => {\n\t\tconst out: T[] = [];\n\t\tfor await (const item of input) {\n\t\t\tout.push(item);\n\t\t}\n\t\treturn out;\n\t};\n}\n\n/**\n * Streams records directly to stdout.\n * Side-effecting, non-buffering.\n */\nexport function stdout(): Consumer<Record> {\n\treturn async (input) => {\n\t\tfor await (const record of input) {\n\t\t\tprocess.stdout.write(`${format(record)}\\n`);\n\t\t}\n\t};\n}\n\nfunction format(record: Record): string {\n\tswitch (record.kind) {\n\t\tcase 'line':\n\t\t\treturn record.text;\n\t\tcase 'json':\n\t\t\treturn JSON.stringify(record.value);\n\t\tcase 'file':\n\t\t\treturn record.path;\n\t\tdefault:\n\t\t\tthrow new Error('Unknown record kind');\n\t}\n}\n","import type { FS } from '../../fs/fs';\nimport type { FileRecord, LineRecord } from '../../record';\nimport type { Transducer } from '../types';\n\nexport function cat(fs: FS): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const file of input) {\n\t\t\tlet lineNum = 1;\n\t\t\tfor await (const text of fs.readLines(file.path)) {\n\t\t\t\tyield {\n\t\t\t\t\tfile: file.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: lineNum++,\n\t\t\t\t\ttext,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\n// export function cp(fs: FS, dest: string): Sink<FileRecord, void> {\n// \treturn async (input) => {\n// \t\tfor await (const record of input) {\n// \t\t\tconst content = await fs.readFile(record.path);\n// \t\t\tawait fs.writeFile(dest, content);\n// \t\t}\n// \t};\n// }\n\n// export function cp(fs: FS): Effect<{ srcs: string[]; dest: string }> {\n// \treturn async ({ srcs, dest }) => {\n// \t\tawait Promise.all(\n// \t\t\tsrcs.map(async (src) => {\n// \t\t\t\tconst content = await fs.readFile(src);\n// \t\t\t\tawait fs.writeFile(dest, content);\n// \t\t\t})\n// \t\t);\n// \t};\n// }\n\n// missing recursive ?\n\nexport function cp(\n\tfs: FS\n): Effect<{ src: string; dest: string; recursive: boolean }> {\n\treturn async ({ src, dest }) => {\n\t\tconst content = await fs.readFile(src);\n\t\tawait fs.writeFile(dest, content);\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { FileRecord, LineRecord } from '../../record';\nimport type { Transducer } from '../types';\n\nexport function head(fs: FS): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const file of input) {\n\t\t\tlet lineNum = 0;\n\t\t\tfor await (const text of fs.readLines(file.path)) {\n\t\t\t\tif (lineNum >= 10) {\n\t\t\t\t\tbreak; // Default to 10 lines\n\t\t\t\t}\n\t\t\t\tyield {\n\t\t\t\t\tfile: file.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: ++lineNum,\n\t\t\t\t\ttext,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport function headWithN(\n\tfs: FS,\n\tn: number\n): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const file of input) {\n\t\t\tlet lineNum = 0;\n\t\t\tfor await (const text of fs.readLines(file.path)) {\n\t\t\t\tif (lineNum >= n) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tyield {\n\t\t\t\t\tfile: file.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: ++lineNum,\n\t\t\t\t\ttext,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { FileRecord } from '../../record';\nimport type { Stream } from '../../stream';\n\nexport async function* ls(fs: FS, path: string): Stream<FileRecord> {\n\tfor await (const p of fs.readdir(path)) {\n\t\tyield { kind: 'file', path: p };\n\t}\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nexport function mkdir(fs: FS): Effect<{\n\tpath: string;\n\trecursive: boolean;\n}> {\n\treturn async ({ path, recursive }) => {\n\t\tawait fs.mkdir(path, recursive);\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nconst MULTIPLE_SLASH_REGEX = /\\/+/g;\n\nfunction extractFileName(path: string): string {\n\tconst lastSlashIndex = path.lastIndexOf('/');\n\tif (lastSlashIndex === -1) {\n\t\treturn path;\n\t}\n\treturn path.slice(lastSlashIndex + 1);\n}\n\nexport function mv(fs: FS): Effect<{ srcs: string[]; dest: string }> {\n\treturn async ({ srcs, dest }) => {\n\t\tif (srcs.length === 1) {\n\t\t\tconst src = srcs[0];\n\t\t\tif (src === undefined) {\n\t\t\t\tthrow new Error('Source path is required');\n\t\t\t}\n\t\t\t// Check if dest is a directory\n\t\t\ttry {\n\t\t\t\tconst destStat = await fs.stat(dest);\n\t\t\t\tif (destStat.isDirectory) {\n\t\t\t\t\t// Move file into directory\n\t\t\t\t\tconst fileName = extractFileName(src);\n\t\t\t\t\tconst newPath = `${dest}/${fileName}`.replace(\n\t\t\t\t\t\tMULTIPLE_SLASH_REGEX,\n\t\t\t\t\t\t'/'\n\t\t\t\t\t);\n\t\t\t\t\tawait moveFile(fs, src, newPath);\n\t\t\t\t} else {\n\t\t\t\t\t// Dest is a file, throw error\n\t\t\t\t\tthrow new Error(`Destination file already exists: ${dest}`);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Check if error is about existing file\n\t\t\t\tif ((error as Error).message.includes('already exists')) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\t// Dest doesn't exist, move src to dest\n\t\t\t\tawait moveFile(fs, src, dest);\n\t\t\t}\n\t\t} else {\n\t\t\t// If multiple sources, dest must be a directory\n\t\t\t// and each source is moved into that directory\n\t\t\tfor (const src of srcs) {\n\t\t\t\tconst fileName = extractFileName(src);\n\t\t\t\tconst fullDest = dest.endsWith('/')\n\t\t\t\t\t? dest + fileName\n\t\t\t\t\t: `${dest}/${fileName}`;\n\t\t\t\tconst newPath = fullDest.replace(MULTIPLE_SLASH_REGEX, '/');\n\t\t\t\tawait moveFile(fs, src, newPath);\n\t\t\t}\n\t\t}\n\t};\n}\n\nasync function moveFile(fs: FS, src: string, dest: string): Promise<void> {\n\tconst content = await fs.readFile(src);\n\tawait fs.writeFile(dest, content);\n\tawait fs.deleteFile(src);\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nexport function rm(fs: FS): Effect<{ path: string; recursive: boolean }> {\n\treturn async ({ path }) => {\n\t\tawait fs.deleteFile(path);\n\t};\n}\n","import type { LineRecord } from '../../record';\nimport type { Transducer } from '../types';\n\nexport function tail(n: number): Transducer<LineRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tconst buf: LineRecord[] = [];\n\t\tfor await (const x of input) {\n\t\t\tbuf.push(x);\n\t\t\tif (buf.length > n) {\n\t\t\t\tbuf.shift();\n\t\t\t}\n\t\t}\n\t\tyield* buf;\n\t};\n}\n","import type { FS } from '../../fs/fs';\nimport type { Effect } from '../types';\n\nexport function touch(fs: FS): Effect<{ files: string[] }> {\n\treturn async ({ files }) => {\n\t\tfor (const file of files) {\n\t\t\tif (!(await fs.exists(file))) {\n\t\t\t\tawait fs.writeFile(file, new Uint8Array());\n\t\t\t}\n\t\t}\n\t};\n}\n","import type { FS } from '../fs/fs';\nimport type { Transducer } from '../operator/types';\nimport type { FileRecord, LineRecord } from '../record';\nimport type { Stream } from '../stream';\n\nexport function lines(fs: FS): Transducer<FileRecord, LineRecord> {\n\treturn async function* (input) {\n\t\tfor await (const f of input) {\n\t\t\tlet lineNum = 1;\n\t\t\tfor await (const line of fs.readLines(f.path)) {\n\t\t\t\tyield {\n\t\t\t\t\tfile: f.path,\n\t\t\t\t\tkind: 'line',\n\t\t\t\t\tlineNum: lineNum++,\n\t\t\t\t\ttext: line,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport async function* files(...paths: string[]): Stream<FileRecord> {\n\tfor (const path of paths) {\n\t\tyield { kind: 'file', path };\n\t}\n}\n","import {\n\texpandedWordToString,\n\textractPathsFromExpandedWords,\n\ttype PipelineIR,\n\ttype RedirectionIR,\n\ttype StepIR,\n} from '@shfs/compiler';\nimport { map, pipe } from 'remeda';\nimport type { FS } from '../fs/fs';\nimport { cat } from '../operator/cat/cat';\nimport { cp } from '../operator/cp/cp';\nimport { headWithN } from '../operator/head/head';\nimport { ls } from '../operator/ls/ls';\nimport { mkdir } from '../operator/mkdir/mkdir';\nimport { mv } from '../operator/mv/mv';\nimport { rm } from '../operator/rm/rm';\nimport { tail } from '../operator/tail/tail';\nimport { touch } from '../operator/touch/touch';\nimport type { Record } from '../record';\nimport type { Stream } from '../stream';\nimport { files } from './producers';\n\nexport type ExecuteResult =\n\t| { kind: 'stream'; value: Stream<Record> }\n\t| { kind: 'sink'; value: Promise<void> };\n\nconst textEncoder = new TextEncoder();\n\n/**\n * Execute compiles a PipelineIR into an executable result.\n * Returns either a stream (for producers/transducers) or a promise (for sinks).\n */\nexport function execute(ir: PipelineIR, fs: FS): ExecuteResult {\n\tconst step = ir.steps[0];\n\tif (!step) {\n\t\treturn {\n\t\t\tkind: 'stream',\n\t\t\tvalue: (async function* () {\n\t\t\t\t// Empty stream - no steps to execute\n\t\t\t})(),\n\t\t};\n\t}\n\n\tlet result: ExecuteResult;\n\n\tswitch (step.cmd) {\n\t\tcase 'cat': {\n\t\t\tconst inputPath = getRedirectPath(step.redirections, 'input');\n\t\t\tconst filePaths = withInputRedirect(\n\t\t\t\textractPathsFromExpandedWords(step.args.files),\n\t\t\t\tinputPath\n\t\t\t);\n\t\t\tresult = {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: pipe(files(...filePaths), cat(fs)),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'cp': {\n\t\t\tconst srcPaths = extractPathsFromExpandedWords(step.args.srcs);\n\t\t\tconst destPath = expandedWordToString(step.args.dest);\n\t\t\tresult = {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: Promise.all(\n\t\t\t\t\tmap(srcPaths, (src) =>\n\t\t\t\t\t\tcp(fs)({\n\t\t\t\t\t\t\tsrc,\n\t\t\t\t\t\t\tdest: destPath,\n\t\t\t\t\t\t\trecursive: step.args.recursive,\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t).then(),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'head': {\n\t\t\tconst inputPath = getRedirectPath(step.redirections, 'input');\n\t\t\tconst filePaths = withInputRedirect(\n\t\t\t\textractPathsFromExpandedWords(step.args.files),\n\t\t\t\tinputPath\n\t\t\t);\n\t\t\tresult = {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: pipe(files(...filePaths), headWithN(fs, step.args.n)),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'ls': {\n\t\t\tconst paths = extractPathsFromExpandedWords(step.args.paths);\n\t\t\tresult = {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: (async function* () {\n\t\t\t\t\tconst results = await Promise.all(\n\t\t\t\t\t\tmap(paths, (path) => ls(fs, path))\n\t\t\t\t\t).then();\n\n\t\t\t\t\tfor (const file of results) {\n\t\t\t\t\t\tyield* file;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'mkdir': {\n\t\t\tconst paths = extractPathsFromExpandedWords(step.args.paths);\n\t\t\tresult = {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: Promise.all(\n\t\t\t\t\tmap(paths, (path) =>\n\t\t\t\t\t\tmkdir(fs)({ path, recursive: step.args.recursive })\n\t\t\t\t\t)\n\t\t\t\t).then(),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'mv': {\n\t\t\tconst srcPaths = extractPathsFromExpandedWords(step.args.srcs);\n\t\t\tconst destPath = expandedWordToString(step.args.dest);\n\t\t\tresult = {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: mv(fs)({ srcs: srcPaths, dest: destPath }),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'rm': {\n\t\t\tconst paths = extractPathsFromExpandedWords(step.args.paths);\n\t\t\tresult = {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: Promise.all(\n\t\t\t\t\tmap(paths, (path) =>\n\t\t\t\t\t\trm(fs)({ path, recursive: step.args.recursive })\n\t\t\t\t\t)\n\t\t\t\t).then(),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'tail': {\n\t\t\tconst inputPath = getRedirectPath(step.redirections, 'input');\n\t\t\tconst filePaths = withInputRedirect(\n\t\t\t\textractPathsFromExpandedWords(step.args.files),\n\t\t\t\tinputPath\n\t\t\t);\n\t\t\tresult = {\n\t\t\t\tkind: 'stream',\n\t\t\t\tvalue: (async function* () {\n\t\t\t\t\tconst results = await Promise.all(\n\t\t\t\t\t\tmap(filePaths, (file) =>\n\t\t\t\t\t\t\tpipe(files(file), cat(fs), tail(step.args.n))\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tfor (const lines of results) {\n\t\t\t\t\t\tyield* lines;\n\t\t\t\t\t}\n\t\t\t\t})(),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tcase 'touch': {\n\t\t\tconst filePaths = extractPathsFromExpandedWords(step.args.files);\n\t\t\tresult = {\n\t\t\t\tkind: 'sink',\n\t\t\t\tvalue: touch(fs)({ files: filePaths }),\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t`Unknown command: ${String((step as { cmd: string }).cmd)}`\n\t\t\t);\n\t}\n\n\treturn applyOutputRedirect(result, step, fs);\n}\n\nfunction getRedirectPath(\n\tredirections: RedirectionIR[] | undefined,\n\tkind: RedirectionIR['kind']\n): string | null {\n\tif (!redirections) {\n\t\treturn null;\n\t}\n\n\tlet redirectedPath: string | null = null;\n\tfor (const redirection of redirections) {\n\t\tif (redirection.kind === kind) {\n\t\t\tredirectedPath = expandedWordToString(redirection.target);\n\t\t}\n\t}\n\treturn redirectedPath;\n}\n\nfunction withInputRedirect(\n\tpaths: string[],\n\tinputPath: string | null\n): string[] {\n\tif (paths.length > 0 || !inputPath) {\n\t\treturn paths;\n\t}\n\treturn [inputPath];\n}\n\nfunction applyOutputRedirect(\n\tresult: ExecuteResult,\n\tstep: StepIR,\n\tfs: FS\n): ExecuteResult {\n\tconst outputPath = getRedirectPath(step.redirections, 'output');\n\tif (!outputPath) {\n\t\treturn result;\n\t}\n\n\tif (result.kind === 'stream') {\n\t\treturn {\n\t\t\tkind: 'sink',\n\t\t\tvalue: writeStreamToFile(result.value, outputPath, fs),\n\t\t};\n\t}\n\n\treturn {\n\t\tkind: 'sink',\n\t\tvalue: result.value.then(async () => {\n\t\t\tawait fs.writeFile(outputPath, textEncoder.encode(''));\n\t\t}),\n\t};\n}\n\nasync function writeStreamToFile(\n\tstream: Stream<Record>,\n\tpath: string,\n\tfs: FS\n): Promise<void> {\n\tconst outputChunks: string[] = [];\n\tfor await (const record of stream) {\n\t\toutputChunks.push(formatRecord(record));\n\t}\n\tawait fs.writeFile(path, textEncoder.encode(outputChunks.join('\\n')));\n}\n\nfunction formatRecord(record: Record): string {\n\tswitch (record.kind) {\n\t\tcase 'line':\n\t\t\treturn record.text;\n\t\tcase 'file':\n\t\t\treturn record.path;\n\t\tcase 'json':\n\t\t\treturn JSON.stringify(record.value);\n\t\tdefault:\n\t\t\tthrow new Error('Unknown record kind');\n\t}\n}\n","export function lazy<T>(fn: () => T) {\n\tlet value: T | undefined;\n\tlet loaded = false;\n\n\treturn (): T => {\n\t\tif (loaded) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tloaded = true;\n\t\tvalue = fn();\n\t\treturn value as T;\n\t};\n}\n","import { compile, type PipelineIR, parse } from '@shfs/compiler';\n\nimport { collect } from '../consumer/consumer';\nimport { type ExecuteResult, execute } from '../execute/execute';\nimport type { FS } from '../fs/fs';\nimport type { Record } from '../record';\nimport { lazy } from '../util/lazy';\n\nasync function collectRecords(result: ExecuteResult): Promise<Record[]> {\n\tif (result.kind === 'sink') {\n\t\tawait result.value;\n\t\treturn [];\n\t}\n\treturn collect<Record>()(result.value);\n}\n\nexport class Shell {\n\tprivate readonly fs: FS;\n\n\tconstructor(fs: FS) {\n\t\tthis.fs = fs;\n\t}\n\n\t$ = (strings: TemplateStringsArray, ...exprs: unknown[]) => {\n\t\treturn this._exec(strings, ...exprs);\n\t};\n\n\texec(strings: TemplateStringsArray, ...exprs: unknown[]) {\n\t\treturn this._exec(strings, ...exprs);\n\t}\n\n\tprivate _exec(strings: TemplateStringsArray, ...exprs: unknown[]) {\n\t\tconst source = String.raw(strings, ...exprs);\n\t\tconst fs = this.fs;\n\n\t\tconst ir = lazy<PipelineIR>(() => {\n\t\t\tconst ast = parse(source);\n\t\t\treturn compile(ast);\n\t\t});\n\n\t\treturn {\n\t\t\tasync json(): Promise<unknown[]> {\n\t\t\t\tconst records = await collectRecords(execute(ir(), fs));\n\t\t\t\treturn records\n\t\t\t\t\t.filter((r) => r.kind === 'json')\n\t\t\t\t\t.map((r) => r.value);\n\t\t\t},\n\n\t\t\tasync lines(): Promise<string[]> {\n\t\t\t\tconst records = await collectRecords(execute(ir(), fs));\n\t\t\t\treturn records\n\t\t\t\t\t.filter((r) => r.kind === 'line')\n\t\t\t\t\t.map((r) => r.text);\n\t\t\t},\n\n\t\t\tasync raw(): Promise<Record[]> {\n\t\t\t\treturn await collectRecords(execute(ir(), fs));\n\t\t\t},\n\n\t\t\tasync stdout(): Promise<void> {\n\t\t\t\tconst result = execute(ir(), fs);\n\t\t\t\tif (result.kind === 'sink') {\n\t\t\t\t\tawait result.value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor await (const r of result.value) {\n\t\t\t\t\tif (r.kind === 'line') {\n\t\t\t\t\t\tprocess.stdout.write(`${r.text}\\n`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tasync text(): Promise<string> {\n\t\t\t\tconst records = await collectRecords(execute(ir(), fs));\n\t\t\t\treturn records\n\t\t\t\t\t.map((r) => {\n\t\t\t\t\t\tif (r.kind === 'line') {\n\t\t\t\t\t\t\treturn r.text;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (r.kind === 'file') {\n\t\t\t\t\t\t\treturn r.path;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (r.kind === 'json') {\n\t\t\t\t\t\t\treturn JSON.stringify(r.value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t})\n\t\t\t\t\t.join('\\n');\n\t\t\t},\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;AAIA,SAAS,QAAQ,OAAO;AACvB,QAAO;EACN,MAAM;EACN;EACA;;;;;AAgBF,SAAS,KAAK,SAAS,WAAW,EAAE,EAAE;AACrC,QAAO;EACN,MAAM;EACN;EACA;EACA;;;;;AAKF,SAAS,WAAW,SAAS,SAAS,EAAE,EAAE;AACzC,QAAO;EACN,MAAM;EACN;EACA;EACA;;;;;;AAMF,SAAS,qBAAqB,MAAM;AACnC,SAAQ,KAAK,MAAb;EACC,KAAK,UAAW,QAAO,KAAK;EAC5B,KAAK,OAAQ,QAAO,KAAK;EACzB,KAAK,aAAc,QAAO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