kifaru 1.0.147 → 1.0.149

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/bin/kifaru CHANGED
@@ -3,17 +3,18 @@
3
3
  const childProcess = require("child_process")
4
4
  const fs = require("fs")
5
5
  const path = require("path")
6
- const { binaryPath, expectedPackage } = require("./runtime-package.cjs")
6
+ const { binaryPath, expectedPackage, restoreTerminalModes } = require("./runtime-package.cjs")
7
7
 
8
8
  function run(target) {
9
9
  const result = childProcess.spawnSync(target, process.argv.slice(2), {
10
10
  stdio: "inherit",
11
11
  })
12
+ restoreTerminalModes()
12
13
  if (result.error) {
13
14
  console.error(result.error.message)
14
15
  process.exit(1)
15
16
  }
16
- const code = typeof result.status === "number" ? result.status : 0
17
+ const code = typeof result.status === "number" ? result.status : 1
17
18
  process.exit(code)
18
19
  }
19
20
 
package/bin/opencode CHANGED
@@ -3,17 +3,18 @@
3
3
  const childProcess = require("child_process")
4
4
  const fs = require("fs")
5
5
  const path = require("path")
6
- const { binaryPath, expectedPackage } = require("./runtime-package.cjs")
6
+ const { binaryPath, expectedPackage, restoreTerminalModes } = require("./runtime-package.cjs")
7
7
 
8
8
  function run(target) {
9
9
  const result = childProcess.spawnSync(target, process.argv.slice(2), {
10
10
  stdio: "inherit",
11
11
  })
12
+ restoreTerminalModes()
12
13
  if (result.error) {
13
14
  console.error(result.error.message)
14
15
  process.exit(1)
15
16
  }
16
- const code = typeof result.status === "number" ? result.status : 0
17
+ const code = typeof result.status === "number" ? result.status : 1
17
18
  process.exit(code)
18
19
  }
19
20
 
@@ -2,6 +2,19 @@ const fs = require("fs")
2
2
  const os = require("os")
3
3
  const path = require("path")
4
4
 
5
+ const TERMINAL_MODE_RESET =
6
+ "\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1004l\x1b[?1006l\x1b[?1015l\x1b[?2004l\x1b[<u\x1b[?25h\x1b[0m"
7
+
8
+ function restoreTerminalModes(output = process.stdout, writeSync = fs.writeSync) {
9
+ if (!output?.isTTY || typeof output.fd !== "number") return false
10
+ try {
11
+ writeSync(output.fd, TERMINAL_MODE_RESET)
12
+ return true
13
+ } catch {
14
+ return false
15
+ }
16
+ }
17
+
5
18
  function libc() {
6
19
  if (os.platform() !== "linux") return
7
20
 
@@ -82,4 +95,6 @@ function expectedPackage() {
82
95
  module.exports = {
83
96
  binaryPath,
84
97
  expectedPackage,
98
+ TERMINAL_MODE_RESET,
99
+ restoreTerminalModes,
85
100
  }
package/package.json CHANGED
@@ -7,17 +7,17 @@
7
7
  "scripts": {
8
8
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
9
9
  },
10
- "version": "1.0.147",
10
+ "version": "1.0.149",
11
11
  "dependencies": {
12
12
  "@openauthjs/openauth": "0.0.0-20250322224806"
13
13
  },
14
14
  "optionalDependencies": {
15
- "kifaru-linux-arm64": "1.0.147",
16
- "kifaru-linux-x64-baseline": "1.0.147",
17
- "kifaru-linux-arm64-musl": "1.0.147",
18
- "kifaru-linux-x64-baseline-musl": "1.0.147",
19
- "kifaru-darwin-arm64": "1.0.147",
20
- "kifaru-darwin-x64": "1.0.147",
21
- "kifaru-windows-x64": "1.0.147"
15
+ "kifaru-linux-arm64": "1.0.149",
16
+ "kifaru-linux-x64-baseline": "1.0.149",
17
+ "kifaru-linux-arm64-musl": "1.0.149",
18
+ "kifaru-linux-x64-baseline-musl": "1.0.149",
19
+ "kifaru-darwin-arm64": "1.0.149",
20
+ "kifaru-darwin-x64": "1.0.149",
21
+ "kifaru-windows-x64": "1.0.149"
22
22
  }
23
23
  }