@opencode-ai/cli-linux-x64-baseline 0.0.0-beta-202606050000

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.
Files changed (137) hide show
  1. package/bin/chunk-01tb5qes.js.map +131 -0
  2. package/bin/chunk-06d8aa69.js.map +10 -0
  3. package/bin/chunk-07w2xsfy.js.map +50 -0
  4. package/bin/chunk-0azwkk9z.js.map +12 -0
  5. package/bin/chunk-0d9ja06r.js.map +9 -0
  6. package/bin/chunk-14kv2kjk.js.map +13 -0
  7. package/bin/chunk-17j53wgt.js.map +11 -0
  8. package/bin/chunk-191djt7z.js.map +113 -0
  9. package/bin/chunk-1brm44vt.js.map +10 -0
  10. package/bin/chunk-1jb1dn9p.js.map +10 -0
  11. package/bin/chunk-1paeax4j.js.map +56 -0
  12. package/bin/chunk-1wb39pye.js.map +9 -0
  13. package/bin/chunk-2mjmecen.js.map +10 -0
  14. package/bin/chunk-2wqpg9fb.js.map +10 -0
  15. package/bin/chunk-32ewzcjk.js.map +10 -0
  16. package/bin/chunk-334z6v35.js.map +9 -0
  17. package/bin/chunk-3jqjf0hd.js.map +10 -0
  18. package/bin/chunk-3n6vddyq.js.map +73 -0
  19. package/bin/chunk-3zmvhepw.js.map +10 -0
  20. package/bin/chunk-4980h0t7.js.map +37 -0
  21. package/bin/chunk-4q5k6a0e.js.map +10 -0
  22. package/bin/chunk-5ft9zwf9.js.map +10 -0
  23. package/bin/chunk-6ttpn29p.js.map +10 -0
  24. package/bin/chunk-7fvpf4bs.js.map +10 -0
  25. package/bin/chunk-7vb6kdat.js.map +10 -0
  26. package/bin/chunk-84amh6xf.js.map +11 -0
  27. package/bin/chunk-8akfq1ty.js.map +19 -0
  28. package/bin/chunk-8rd9r1gb.js.map +11 -0
  29. package/bin/chunk-8x80qvzn.js.map +10 -0
  30. package/bin/chunk-943th5qs.js.map +10 -0
  31. package/bin/chunk-94yf089p.js.map +10 -0
  32. package/bin/chunk-98cxndhz.js.map +9 -0
  33. package/bin/chunk-9f8tmby0.js.map +9 -0
  34. package/bin/chunk-9fbstsnw.js.map +9 -0
  35. package/bin/chunk-9hq8aywf.js.map +10 -0
  36. package/bin/chunk-9m7hf7ms.js.map +10 -0
  37. package/bin/chunk-9vf55fj3.js.map +10 -0
  38. package/bin/chunk-9w9rk9en.js.map +20 -0
  39. package/bin/chunk-9y4hgfns.js.map +10 -0
  40. package/bin/chunk-aag5p1fp.js.map +10 -0
  41. package/bin/chunk-axy1v6wd.js.map +27 -0
  42. package/bin/chunk-bj9msmj2.js.map +10 -0
  43. package/bin/chunk-bt0r89ee.js.map +9 -0
  44. package/bin/chunk-c2gsyspz.js.map +10 -0
  45. package/bin/chunk-c8hr0q5n.js.map +10 -0
  46. package/bin/chunk-cab6ccj0.js.map +10 -0
  47. package/bin/chunk-ck4nkjtx.js.map +193 -0
  48. package/bin/chunk-cvm4kr56.js.map +23 -0
  49. package/bin/chunk-cyb9bpgm.js.map +10 -0
  50. package/bin/chunk-d1p8awq6.js.map +10 -0
  51. package/bin/chunk-d6nz1m6v.js.map +10 -0
  52. package/bin/chunk-d9g5798m.js.map +81 -0
  53. package/bin/chunk-dcn0azxw.js.map +10 -0
  54. package/bin/chunk-dd9pfwmr.js.map +10 -0
  55. package/bin/chunk-dk4qekzk.js.map +10 -0
  56. package/bin/chunk-dk9tgwkh.js.map +9 -0
  57. package/bin/chunk-dzzhxh1c.js.map +10 -0
  58. package/bin/chunk-efsmps94.js.map +9 -0
  59. package/bin/chunk-fdw7znt6.js.map +11 -0
  60. package/bin/chunk-fs6t8jdg.js.map +10 -0
  61. package/bin/chunk-fzcqzwx5.js.map +10 -0
  62. package/bin/chunk-g4fcmhkj.js.map +11 -0
  63. package/bin/chunk-g4ff66n8.js.map +10 -0
  64. package/bin/chunk-g8mpn6ke.js.map +11 -0
  65. package/bin/chunk-gahs293a.js.map +10 -0
  66. package/bin/chunk-gh9dcqbv.js.map +10 -0
  67. package/bin/chunk-grvxd8zq.js.map +10 -0
  68. package/bin/chunk-gv6nagng.js.map +10 -0
  69. package/bin/chunk-h1vz14ze.js.map +167 -0
  70. package/bin/chunk-hav16yge.js.map +10 -0
  71. package/bin/chunk-hp5nnq6f.js.map +11 -0
  72. package/bin/chunk-hrcbafh3.js.map +9 -0
  73. package/bin/chunk-hxfsfpek.js.map +10 -0
  74. package/bin/chunk-jcqp2wmf.js.map +10 -0
  75. package/bin/chunk-jt9t8203.js.map +9 -0
  76. package/bin/chunk-k0980eb5.js.map +10 -0
  77. package/bin/chunk-kghptcgb.js.map +9 -0
  78. package/bin/chunk-kkvk5eez.js.map +10 -0
  79. package/bin/chunk-kv0b3sh5.js.map +10 -0
  80. package/bin/chunk-kvfs5rat.js.map +10 -0
  81. package/bin/chunk-mf0qqhvb.js.map +10 -0
  82. package/bin/chunk-mkze6twx.js.map +10 -0
  83. package/bin/chunk-mzjs3qj3.js.map +10 -0
  84. package/bin/chunk-n10mj2m3.js.map +17 -0
  85. package/bin/chunk-n2fbt143.js.map +9 -0
  86. package/bin/chunk-n6a0rctn.js.map +9 -0
  87. package/bin/chunk-nd3yv9bg.js.map +388 -0
  88. package/bin/chunk-njn9a3jp.js.map +13 -0
  89. package/bin/chunk-nkhzpsnk.js.map +13 -0
  90. package/bin/chunk-ny5cyeha.js.map +10 -0
  91. package/bin/chunk-p3nkd9t2.js.map +10 -0
  92. package/bin/chunk-p3pr1t3k.js.map +10 -0
  93. package/bin/chunk-p7j7e7hb.js.map +10 -0
  94. package/bin/chunk-p89bk96c.js.map +10 -0
  95. package/bin/chunk-pnkd37ss.js.map +20 -0
  96. package/bin/chunk-prat77ba.js.map +577 -0
  97. package/bin/chunk-q6nf6fka.js.map +10 -0
  98. package/bin/chunk-qbpebjh2.js.map +10 -0
  99. package/bin/chunk-qzx2gre7.js.map +13 -0
  100. package/bin/chunk-r55kafff.js.map +9 -0
  101. package/bin/chunk-rrwp4x01.js.map +10 -0
  102. package/bin/chunk-rt02k446.js.map +11 -0
  103. package/bin/chunk-s39nwv01.js.map +9 -0
  104. package/bin/chunk-s983v0dp.js.map +10 -0
  105. package/bin/chunk-san15sca.js.map +10 -0
  106. package/bin/chunk-sfk73pp2.js.map +10 -0
  107. package/bin/chunk-sjd3wbjd.js.map +10 -0
  108. package/bin/chunk-swbdmja3.js.map +10 -0
  109. package/bin/chunk-tc8tvjey.js.map +33 -0
  110. package/bin/chunk-tcqtz83b.js.map +10 -0
  111. package/bin/chunk-tgxxchfy.js.map +28 -0
  112. package/bin/chunk-tvxakxv2.js.map +10 -0
  113. package/bin/chunk-v81ta3tx.js.map +15 -0
  114. package/bin/chunk-va2h4xya.js.map +37 -0
  115. package/bin/chunk-vezq3hc4.js.map +9 -0
  116. package/bin/chunk-vmbpvmpg.js.map +10 -0
  117. package/bin/chunk-w7p62pb6.js.map +17 -0
  118. package/bin/chunk-wr4x72qd.js.map +13 -0
  119. package/bin/chunk-x3ywttp7.js.map +10 -0
  120. package/bin/chunk-x988wmrk.js.map +10 -0
  121. package/bin/chunk-x9zjg1f7.js.map +20 -0
  122. package/bin/chunk-xaqrhtz6.js.map +10 -0
  123. package/bin/chunk-xd2mrkwy.js.map +10 -0
  124. package/bin/chunk-xfh2377b.js.map +10 -0
  125. package/bin/chunk-xs0ras4j.js.map +51 -0
  126. package/bin/chunk-xt7ap9fb.js.map +10 -0
  127. package/bin/chunk-xya5qk3h.js.map +16 -0
  128. package/bin/chunk-yg7w4jgd.js.map +10 -0
  129. package/bin/chunk-yhpv46tb.js.map +20 -0
  130. package/bin/chunk-ymy66kr8.js.map +15 -0
  131. package/bin/chunk-yx4z6xsb.js.map +11 -0
  132. package/bin/chunk-yymwxqpy.js.map +10 -0
  133. package/bin/chunk-z70c75xe.js.map +11 -0
  134. package/bin/chunk-zkqyr3hc.js.map +10 -0
  135. package/bin/index.js.map +12 -0
  136. package/bin/lildax +0 -0
  137. package/package.json +15 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../core/src/database/migration/20260510033149_session_usage.ts"],
4
+ "sourcesContent": [
5
+ "import { Effect } from \"effect\"\nimport type { DatabaseMigration } from \"../migration\"\n\nexport default {\n id: \"20260510033149_session_usage\",\n up(tx) {\n return Effect.gen(function* () {\n yield* tx.run(`ALTER TABLE \\`session\\` ADD \\`cost\\` real DEFAULT 0 NOT NULL;`)\n yield* tx.run(`ALTER TABLE \\`session\\` ADD \\`tokens_input\\` integer DEFAULT 0 NOT NULL;`)\n yield* tx.run(`ALTER TABLE \\`session\\` ADD \\`tokens_output\\` integer DEFAULT 0 NOT NULL;`)\n yield* tx.run(`ALTER TABLE \\`session\\` ADD \\`tokens_reasoning\\` integer DEFAULT 0 NOT NULL;`)\n yield* tx.run(`ALTER TABLE \\`session\\` ADD \\`tokens_cache_read\\` integer DEFAULT 0 NOT NULL;`)\n yield* tx.run(`ALTER TABLE \\`session\\` ADD \\`tokens_cache_write\\` integer DEFAULT 0 NOT NULL;`)\n yield* tx.run(`\n UPDATE session\n SET\n cost = coalesce((\n SELECT sum(coalesce(json_extract(message.data, '$.cost'), 0))\n FROM message\n WHERE message.session_id = session.id\n AND json_extract(message.data, '$.role') = 'assistant'\n ), 0),\n tokens_input = coalesce((\n SELECT sum(coalesce(json_extract(message.data, '$.tokens.input'), 0))\n FROM message\n WHERE message.session_id = session.id\n AND json_extract(message.data, '$.role') = 'assistant'\n ), 0),\n tokens_output = coalesce((\n SELECT sum(coalesce(json_extract(message.data, '$.tokens.output'), 0))\n FROM message\n WHERE message.session_id = session.id\n AND json_extract(message.data, '$.role') = 'assistant'\n ), 0),\n tokens_reasoning = coalesce((\n SELECT sum(coalesce(json_extract(message.data, '$.tokens.reasoning'), 0))\n FROM message\n WHERE message.session_id = session.id\n AND json_extract(message.data, '$.role') = 'assistant'\n ), 0),\n tokens_cache_read = coalesce((\n SELECT sum(coalesce(json_extract(message.data, '$.tokens.cache.read'), 0))\n FROM message\n WHERE message.session_id = session.id\n AND json_extract(message.data, '$.role') = 'assistant'\n ), 0),\n tokens_cache_write = coalesce((\n SELECT sum(coalesce(json_extract(message.data, '$.tokens.cache.write'), 0))\n FROM message\n WHERE message.session_id = session.id\n AND json_extract(message.data, '$.role') = 'assistant'\n ), 0)\n `)\n })\n },\n} satisfies DatabaseMigration.Migration\n"
6
+ ],
7
+ "mappings": ";wHAGA,SAAe,QACb,GAAI,+BACJ,EAAE,CAAC,EAAI,CACL,OAAO,EAAO,IAAI,SAAU,EAAG,CAC7B,MAAO,EAAG,IAAI,2DAA+D,EAC7E,MAAO,EAAG,IAAI,sEAA0E,EACxF,MAAO,EAAG,IAAI,uEAA2E,EACzF,MAAO,EAAG,IAAI,0EAA8E,EAC5F,MAAO,EAAG,IAAI,2EAA+E,EAC7F,MAAO,EAAG,IAAI,4EAAgF,EAC9F,MAAO,EAAG,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAuCb,EACF,EAEL",
8
+ "debugId": "A76BA1F7A51D6F5C64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../core/src/database/migration/20260507164347_add_workspace_time.ts"],
4
+ "sourcesContent": [
5
+ "import { Effect } from \"effect\"\nimport type { DatabaseMigration } from \"../migration\"\n\nexport default {\n id: \"20260507164347_add_workspace_time\",\n up(tx) {\n return Effect.gen(function* () {\n yield* tx.run(`ALTER TABLE \\`workspace\\` ADD \\`time_used\\` integer NOT NULL DEFAULT 0;`)\n })\n },\n} satisfies DatabaseMigration.Migration\n"
6
+ ],
7
+ "mappings": ";wHAGA,SAAe,QACb,GAAI,oCACJ,EAAE,CAAC,EAAI,CACL,OAAO,EAAO,IAAI,SAAU,EAAG,CAC7B,MAAO,EAAG,IAAI,qEAAyE,EACxF,EAEL",
8
+ "debugId": "65A5EF5B5E807ED964756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../node_modules/.bun/bun-pty@0.4.8/node_modules/bun-pty/src/terminal.ts", "../../node_modules/.bun/bun-pty@0.4.8/node_modules/bun-pty/src/interfaces.ts", "../../node_modules/.bun/bun-pty@0.4.8/node_modules/bun-pty/src/index.ts", "../core/src/pty/pty.bun.ts"],
4
+ "sourcesContent": [
5
+ "// terminal.ts — JS/TS front-end (final fixed version)\n\nimport { dlopen, FFIType, ptr } from \"bun:ffi\";\nimport { Buffer } from \"node:buffer\";\nimport { EventEmitter } from \"./interfaces\";\nimport type { IPty, IPtyForkOptions, IExitEvent } from \"./interfaces\";\nimport { join, dirname, basename } from \"node:path\";\nimport { existsSync } from \"node:fs\";\n\nexport const DEFAULT_COLS = 80;\nexport const DEFAULT_ROWS = 24;\nexport const DEFAULT_FILE = \"sh\";\nexport const DEFAULT_NAME = \"xterm\";\n\n/**\n * Quote a string for shell-words compatible splitting on the Rust side.\n * We are not invoking a shell; quoting is only to preserve token boundaries\n * when Rust parses the command line with shell_words::split.\n * \n * @param s - The string to quote\n * @returns The quoted string\n */\nfunction shQuote(s: string): string {\n\tif (s.length === 0) return \"''\";\n\t// Replace ' with '\\'' (close-quote, escaped ', reopen)\n\treturn `'${s.replace(/'/g, `'\\\\''`)}'`;\n}\n\n// terminal.ts – loader fragment only\n\nfunction resolveLibPath(): string {\n\tconst env = process.env.BUN_PTY_LIB;\n\tif (env && existsSync(env)) return env;\n\n\t// For bun compile: use statically analyzable require with inline ternary.\n\t// Bun evaluates process.platform and process.arch at compile time and only\n\t// bundles the file for the target platform. The ternary MUST be inline\n\t// in the template literal for Bun's static analysis to work.\n\t// See: https://github.com/sursaone/bun-pty/issues/19\n\ttry {\n\t\t// @ts-ignore - require returns path for binary files in Bun\n\t\tconst embeddedPath = require(`../rust-pty/target/release/${process.platform === \"win32\" ? \"rust_pty.dll\" : process.platform === \"darwin\" ? (process.arch === \"arm64\" ? \"librust_pty_arm64.dylib\" : \"librust_pty.dylib\") : process.arch === \"arm64\" ? \"librust_pty_arm64.so\" : \"librust_pty.so\"}`);\n\t\tif (embeddedPath) return embeddedPath;\n\t} catch {\n\t\t// Not running as compiled binary, fall through to dynamic resolution\n\t}\n\n\t// Fallback: dynamic resolution for development scenarios\n\tconst platform = process.platform;\n\tconst arch = process.arch;\n\n\t// Try both architecture-specific and generic filenames\n\tconst filenames =\n\t\tplatform === \"darwin\"\n\t\t\t? arch === \"arm64\"\n\t\t\t\t? [\"librust_pty_arm64.dylib\", \"librust_pty.dylib\"]\n\t\t\t\t: [\"librust_pty.dylib\"]\n\t\t\t: platform === \"win32\"\n\t\t\t? [\"rust_pty.dll\"]\n\t\t\t: arch === \"arm64\"\n\t\t\t? [\"librust_pty_arm64.so\", \"librust_pty.so\"]\n\t\t\t: [\"librust_pty.so\"];\n\n\t// Start from the current module's location\n\tconst base = Bun.fileURLToPath(import.meta.url);\n\tconst fileDir = dirname(base);\n\tconst dirName = basename(fileDir);\n\t\n\t// Handle both development (src/terminal.ts) and production (dist/terminal.js) cases\n\t// If we're in src/ or dist/, go up one level to get the project root\n\tconst here = (dirName === \"src\" || dirName === \"dist\")\n\t\t? dirname(fileDir) // Go up one level from src/ or dist/\n\t\t: fileDir; // Otherwise use the directory as-is\n\n\tconst basePaths = [\n\t\tjoin(here, \"rust-pty\", \"target\", \"release\"), // Direct path from project root\n\t\tjoin(here, \"..\", \"bun-pty\", \"rust-pty\", \"target\", \"release\"), // monorepo setups\n\t\tjoin(process.cwd(), \"node_modules\", \"bun-pty\", \"rust-pty\", \"target\", \"release\"),\n\t];\n\n\tconst fallbackPaths = [];\n\tfor (const basePath of basePaths) {\n\t\tfor (const filename of filenames) {\n\t\t\tfallbackPaths.push(join(basePath, filename));\n\t\t}\n\t}\n\n\tfor (const path of fallbackPaths) {\n\t\tif (existsSync(path)) return path;\n\t}\n\n\tthrow new Error(\n\t\t`librust_pty shared library not found.\\nChecked:\\n - BUN_PTY_LIB=${env ?? \"<unset>\"}\\n - ${fallbackPaths.join(\"\\n - \")}\\n\\nSet BUN_PTY_LIB or ensure one of these paths contains the file.`\n\t);\n}\n\nconst libPath = resolveLibPath();\n\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\nlet lib: any;\n\n// try to load the lib, if it fails log the error\ntry {\n\tlib = dlopen(libPath, {\n\t\tbun_pty_spawn: {\n\t\t\targs: [FFIType.cstring, FFIType.cstring, FFIType.cstring, FFIType.i32, FFIType.i32],\n\t\t\treturns: FFIType.i32,\n\t\t},\n\t\tbun_pty_write: {\n\t\t\targs: [FFIType.i32, FFIType.pointer, FFIType.i32],\n\t\t\treturns: FFIType.i32,\n\t\t},\n\t\tbun_pty_read: {\n\t\t\targs: [FFIType.i32, FFIType.pointer, FFIType.i32],\n\t\t\treturns: FFIType.i32,\n\t\t},\n\t\tbun_pty_resize: {\n\t\t\targs: [FFIType.i32, FFIType.i32, FFIType.i32],\n\t\t\treturns: FFIType.i32,\n\t\t},\n\t\tbun_pty_kill: { args: [FFIType.i32], returns: FFIType.i32 },\n\t\tbun_pty_get_pid: { args: [FFIType.i32], returns: FFIType.i32 },\n\t\tbun_pty_get_exit_code: { args: [FFIType.i32], returns: FFIType.i32 },\n\t\tbun_pty_close: { args: [FFIType.i32], returns: FFIType.void },\n\t});\n} catch (error) {\n\tconsole.error(\"Failed to load lib\", error);\n}\n\nexport class Terminal implements IPty {\n\tprivate handle = -1;\n\tprivate _pid = -1;\n\tprivate _cols = DEFAULT_COLS;\n\tprivate _rows = DEFAULT_ROWS;\n\tprivate readonly _name = DEFAULT_NAME;\n\n\tprivate _readLoop = false;\n\tprivate _closing = false;\n\n\t// TextDecoder with streaming mode to properly handle UTF-8 across chunk boundaries\n\t// Without this, multi-byte characters (like box-drawing ─) that span chunks become �\n\tprivate readonly _decoder = new TextDecoder(\"utf-8\");\n\n\tprivate readonly _onData = new EventEmitter<string>();\n\tprivate readonly _onExit = new EventEmitter<IExitEvent>();\n\n\tconstructor(\n\t\tfile = DEFAULT_FILE,\n\t\targs: string[] = [],\n\t\topts: IPtyForkOptions = { name: DEFAULT_NAME },\n\t) {\n\t\tthis._cols = opts.cols ?? DEFAULT_COLS;\n\t\tthis._rows = opts.rows ?? DEFAULT_ROWS;\n\t\tconst cwd = opts.cwd ?? process.cwd();\n\t\t// Properly quote file and arguments to preserve spaces and special characters\n\t\tconst cmdline = [shQuote(file), ...args.map(shQuote)].join(\" \");\n\n\t\t// Format environment variables as null-terminated string\n\t\tlet envStr = \"\";\n\t\tif (opts.env) {\n\t\t\tconst envPairs = Object.entries(opts.env).map(([k, v]) => `${k}=${v}`);\n\t\t\tenvStr = envPairs.join(\"\\0\") + \"\\0\";\n\t\t}\n\n\t\tthis.handle = lib.symbols.bun_pty_spawn(\n\t\t\tBuffer.from(`${cmdline}\\0`, \"utf8\"),\n\t\t\tBuffer.from(`${cwd}\\0`, \"utf8\"),\n\t\t\tBuffer.from(`${envStr}\\0`, \"utf8\"),\n\t\t\tthis._cols,\n\t\t\tthis._rows,\n\t\t);\n\t\tif (this.handle < 0) throw new Error(\"PTY spawn failed\");\n\n\t\tthis._pid = lib.symbols.bun_pty_get_pid(this.handle);\n\t\tthis._startReadLoop();\n\t}\n\n\t/* ------------- accessors ------------- */\n\n\tget pid() {\n\t\treturn this._pid;\n\t}\n\tget cols() {\n\t\treturn this._cols;\n\t}\n\tget rows() {\n\t\treturn this._rows;\n\t}\n\tget process() {\n\t\treturn \"shell\";\n\t}\n\n\tget onData() {\n\t\treturn this._onData.event;\n\t}\n\tget onExit() {\n\t\treturn this._onExit.event;\n\t}\n\n\t/* ------------- IO methods ------------- */\n\n\twrite(data: string) {\n\t\tif (this._closing) return;\n\t\tconst buf = Buffer.from(data, \"utf8\");\n\t\tlib.symbols.bun_pty_write(this.handle, ptr(buf), buf.length);\n\t}\n\n\tresize(cols: number, rows: number) {\n\t\tif (this._closing) return;\n\t\tthis._cols = cols;\n\t\tthis._rows = rows;\n\t\tlib.symbols.bun_pty_resize(this.handle, cols, rows);\n\t}\n\n\tkill(signal = \"SIGTERM\") {\n\t\tif (this._closing) return;\n\t\tthis._closing = true;\n\t\tlib.symbols.bun_pty_kill(this.handle);\n\t\tlib.symbols.bun_pty_close(this.handle);\n\t\tthis._onExit.fire({ exitCode: 0, signal });\n\t}\n\n\t/* ------------- read-loop ------------- */\n\n\tprivate async _startReadLoop() {\n\t\tif (this._readLoop) return;\n\t\tthis._readLoop = true;\n\n\t\tconst buf = Buffer.allocUnsafe(4096);\n\n\t\twhile (this._readLoop && !this._closing) {\n\t\t\tconst n = lib.symbols.bun_pty_read(this.handle, ptr(buf), buf.length);\n\t\t\tif (n > 0) {\n\t\t\t\t// Use streaming mode to buffer incomplete UTF-8 sequences across chunks\n\t\t\t\t// This prevents corruption when multi-byte chars span chunk boundaries\n\t\t\t\tconst decoded = this._decoder.decode(buf.subarray(0, n), { stream: true });\n\t\t\t\tif (decoded) {\n\t\t\t\t\tthis._onData.fire(decoded);\n\t\t\t\t}\n\t\t\t} else if (n === -2) {\n\t\t\t\t// CHILD_EXITED - flush any remaining bytes in the decoder\n\t\t\t\tconst remaining = this._decoder.decode();\n\t\t\t\tif (remaining) {\n\t\t\t\t\tthis._onData.fire(remaining);\n\t\t\t\t}\n\t\t\t\tconst exitCode = lib.symbols.bun_pty_get_exit_code(this.handle);\n\t\t\t\tthis._onExit.fire({ exitCode });\n\t\t\t\tbreak;\n\t\t\t} else if (n < 0) {\n\t\t\t\t// error - flush decoder before breaking\n\t\t\t\tconst remaining = this._decoder.decode();\n\t\t\t\tif (remaining) {\n\t\t\t\t\tthis._onData.fire(remaining);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// 0 bytes: wait\n\t\t\t\tawait new Promise((r) => setTimeout(r, 8));\n\t\t\t}\n\t\t}\n\t}\n}\n",
6
+ "import { Buffer } from \"node:buffer\";\n\n/**\n * Interface for disposable resources.\n */\nexport interface IDisposable {\n /**\n * Disposes the resource, performing any necessary cleanup.\n */\n dispose(): void;\n}\n\n/**\n * Event implementation for the terminal.\n */\nexport class EventEmitter<T> {\n private listeners: ((data: T) => void)[] = [];\n\n public event = (listener: (e: T) => void): IDisposable => {\n this.listeners.push(listener);\n return {\n dispose: () => {\n const i = this.listeners.indexOf(listener);\n if (i !== -1) {\n this.listeners.splice(i, 1);\n }\n }\n };\n };\n\n public fire(data: T): void {\n for (const listener of this.listeners) {\n listener(data);\n }\n }\n}\n\n/**\n * Options for spawning a new PTY process.\n */\nexport interface IPtyForkOptions {\n /**\n * The name of the terminal to be set in environment variables.\n */\n name: string;\n\n /**\n * The number of columns in the PTY.\n */\n cols?: number;\n\n /**\n * The number of rows in the PTY.\n */\n rows?: number;\n\n /**\n * The current working directory of the process.\n * Defaults to the current working directory of the parent process.\n */\n cwd?: string;\n\n /**\n * Environment variables to set for the process.\n */\n env?: Record<string, string>;\n}\n\n/**\n * Exit data for PTY process.\n */\nexport interface IExitEvent {\n /**\n * The process exit code.\n */\n exitCode: number;\n\n /**\n * The signal that caused the process to exit, if any.\n */\n signal?: number | string;\n}\n\n/**\n * Interface for interacting with a pseudo-terminal (PTY) instance.\n */\nexport interface IPty {\n /**\n * The PID of the process running in the PTY.\n */\n readonly pid: number;\n\n /**\n * The column size in characters.\n */\n readonly cols: number;\n\n /**\n * The row size in characters.\n */\n readonly rows: number;\n\n /**\n * The title of the active process.\n */\n readonly process: string;\n\n /**\n * Set a callback for when data is received from the PTY.\n */\n readonly onData: (listener: (data: string) => void) => IDisposable;\n\n /**\n * Event emitted when the PTY process exits.\n */\n readonly onExit: (listener: (event: IExitEvent) => void) => IDisposable;\n\n /**\n * Write data to the PTY.\n *\n * @param data - The data to write.\n */\n write(data: string): void;\n\n /**\n * Resize the PTY.\n *\n * @param columns - Number of columns (character width).\n * @param rows - Number of rows (character height).\n */\n resize(columns: number, rows: number): void;\n\n /**\n * Kill the process running in the PTY.\n *\n * @param signal - The signal to send to the process.\n * Defaults to \"SIGTERM\".\n */\n kill(signal?: string): void;\n} ",
7
+ "/**\n * The main export module for bun-pty.\n * Provides a cross-platform PTY interface for Bun runtime.\n */\n\nimport { Terminal } from './terminal';\nimport type { IPty, IPtyForkOptions, IExitEvent, IDisposable } from './interfaces';\n\n/**\n * Creates and spawns a new PTY with the given command and arguments.\n * \n * @param file - Path to the executable to run.\n * @param args - Arguments for the executable.\n * @param options - Options for the PTY.\n * @returns A new PTY instance.\n */\nexport function spawn(file: string, args: string[], options: IPtyForkOptions): IPty {\n return new Terminal(file, args, options);\n}\n\n// Export interfaces and implementations\nexport type { IPty, IPtyForkOptions, IExitEvent, IDisposable };\nexport { Terminal } from './terminal'; ",
8
+ "import { spawn as create } from \"bun-pty\"\nimport type { Opts, Proc } from \"./pty\"\n\nexport type { Disp, Exit, Opts, Proc } from \"./pty\"\n\nexport function spawn(file: string, args: string[], opts: Opts): Proc {\n const pty = create(file, args, opts)\n return {\n pid: pty.pid,\n onData(listener) {\n return pty.onData(listener)\n },\n onExit(listener) {\n return pty.onExit(listener)\n },\n write(data) {\n pty.write(data)\n },\n resize(cols, rows) {\n pty.resize(cols, rows)\n },\n kill(signal) {\n pty.kill(signal)\n },\n }\n}\n"
9
+ ],
10
+ "mappings": ";4GAEA,4BAAS,aAAQ,SAAS,gBAC1B,iBAAS,eCYF,MAAM,CAAgB,CACnB,UAAmC,CAAC,EAErC,MAAQ,CAAC,IAA0C,CAExD,OADA,KAAK,UAAU,KAAK,CAAQ,EACrB,CACL,QAAS,IAAM,CACb,IAAM,EAAI,KAAK,UAAU,QAAQ,CAAQ,EACzC,GAAI,IAAM,GACR,KAAK,UAAU,OAAO,EAAG,CAAC,EAGhC,GAGK,IAAI,CAAC,EAAe,CACzB,QAAW,KAAY,KAAK,UAC1B,EAAS,CAAI,EAGnB,CD7BA,eAAS,aAAM,cAAS,aACxB,qB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