@jarkkojs/readseek-api 0.10.0 → 0.10.2

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/README.md CHANGED
@@ -9,12 +9,13 @@ bounded Node/Bun process runners.
9
9
  npm install @jarkkojs/readseek-api
10
10
  ```
11
11
 
12
- Linux platform packages supply `bin/readseek.AppImage`; macOS and Windows supply
13
- native executables. The `readseek` CLI and Node/Bun runners set
12
+ `@jarkkojs/readseek` installs the optional platform binary and provides the
13
+ `readseek` CLI. Linux packages supply `bin/readseek.AppImage`; macOS and Windows
14
+ supply native executables. The CLI and Node/Bun runners set
14
15
  `APPIMAGE_EXTRACT_AND_RUN=1` for Linux child processes, so FUSE is not required.
15
16
  Custom process launchers should pass `readSeekProcessEnvironment()` as their
16
- child environment. Linux payload packages do not expose a separate CLI; use
17
- `@jarkkojs/readseek-api`.
17
+ child environment. Installing the API also installs `@jarkkojs/readseek` and its
18
+ platform binary; plugins declare both packages directly.
18
19
 
19
20
  ## Example
20
21
 
package/dist/index.js CHANGED
@@ -1026,18 +1026,18 @@ function resolveReadSeekBinaryFromPackages(resolver = resolveFromPackage, option
1026
1026
  const platformPackage = READSEEK_PLATFORM_PACKAGES[key];
1027
1027
  if (!platformPackage) {
1028
1028
  const supported = Object.keys(READSEEK_PLATFORM_PACKAGES).join(", ");
1029
- throw new Error(`@jarkkojs/readseek-api ships no binary for ${key}; it supports ${supported}`);
1029
+ throw new Error(`@jarkkojs/readseek ships no binary for ${key}; it supports ${supported}`);
1030
1030
  }
1031
- const metaPackage = options.metaPackage ?? "@jarkkojs/readseek-api";
1032
- const metaPackageJson = resolve(`${metaPackage}/package.json`);
1033
- const metaPackageDir = path.dirname(metaPackageJson);
1031
+ const metaPackage = options.metaPackage ?? "@jarkkojs/readseek";
1034
1032
  let packageJsonPath;
1035
1033
  try {
1036
- packageJsonPath = resolve(`${platformPackage}/package.json`);
1037
- } catch {
1034
+ const metaPackageJson = resolve(`${metaPackage}/package.json`);
1035
+ const metaPackageDir = path.dirname(metaPackageJson);
1038
1036
  packageJsonPath = resolve(`${platformPackage}/package.json`, {
1039
1037
  paths: [metaPackageDir]
1040
1038
  });
1039
+ } catch {
1040
+ packageJsonPath = resolve(`${platformPackage}/package.json`);
1041
1041
  }
1042
1042
  const binaryPath = path.join(path.dirname(packageJsonPath), "bin", readSeekBinaryName(platform));
1043
1043
  accessSync(binaryPath, fsConstants.X_OK);
@@ -1708,15 +1708,21 @@ var SymbolOutput = Type.Object({
1708
1708
  start_anchor: OptStr,
1709
1709
  end_anchor: OptStr
1710
1710
  });
1711
- var MapNode = Type.Recursive((Self) => Type.Object({
1712
- kind: Str,
1713
- name: Str,
1714
- start_line: Int,
1715
- end_line: Int,
1716
- start_anchor: Str,
1717
- end_anchor: Str,
1718
- children: Type.Array(Self)
1719
- }));
1711
+ function mapNodeShape(child) {
1712
+ return Type.Object({
1713
+ kind: Str,
1714
+ name: Str,
1715
+ start_line: Int,
1716
+ end_line: Int,
1717
+ start_anchor: Str,
1718
+ end_anchor: Str,
1719
+ children: Type.Array(child)
1720
+ });
1721
+ }
1722
+ function recursiveMapNode() {
1723
+ return Type.Recursive((self) => mapNodeShape(self));
1724
+ }
1725
+ var MapNode = typeof Type.Recursive === "function" ? recursiveMapNode() : Type.Cyclic({ MapNode: mapNodeShape(Type.Ref("MapNode")) }, "MapNode");
1720
1726
  var MapOutput = Type.Object({
1721
1727
  file: Str,
1722
1728
  language: Str,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarkkojs/readseek-api",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Shared ReadSeek CLI contract, validation, argv builders, and bounded process runners",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -13,9 +13,6 @@
13
13
  "bugs": {
14
14
  "url": "https://gitlab.com/jarkkojs/readseek/-/issues"
15
15
  },
16
- "bin": {
17
- "readseek": "bin/readseek.cjs"
18
- },
19
16
  "exports": {
20
17
  ".": {
21
18
  "types": "./dist/index.d.ts",
@@ -25,7 +22,6 @@
25
22
  "./package.json": "./package.json"
26
23
  },
27
24
  "files": [
28
- "bin/",
29
25
  "dist/",
30
26
  "README.md"
31
27
  ],
@@ -48,12 +44,6 @@
48
44
  "ast-grep",
49
45
  "hashline"
50
46
  ],
51
- "optionalDependencies": {
52
- "@jarkkojs/readseek-darwin-arm64": "0.10.0",
53
- "@jarkkojs/readseek-linux-arm64": "0.10.0",
54
- "@jarkkojs/readseek-linux-x64": "0.10.0",
55
- "@jarkkojs/readseek-win32-x64": "0.10.0"
56
- },
57
47
  "devDependencies": {
58
48
  "@types/node": "^22.0.0",
59
49
  "fast-check": "4.10.0",
@@ -61,6 +51,7 @@
61
51
  "vitest": "^4.1.0"
62
52
  },
63
53
  "dependencies": {
54
+ "@jarkkojs/readseek": "^0.10.2",
64
55
  "@bgotink/kdl": "0.4.0",
65
56
  "@sinclair/typebox": "0.34.52"
66
57
  }
package/bin/readseek.cjs DELETED
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env node
2
- // SPDX-License-Identifier: Apache-2.0
3
- // Copyright (C) Jarkko Sakkinen 2026
4
-
5
- const { execFileSync } = require('node:child_process');
6
- const fs = require('node:fs');
7
- const path = require('node:path');
8
-
9
- function resolveBinary() {
10
- const platform = `${process.platform}-${process.arch}`;
11
- const packages = {
12
- 'darwin-arm64': '@jarkkojs/readseek-darwin-arm64',
13
- 'linux-arm64': '@jarkkojs/readseek-linux-arm64',
14
- 'linux-x64': '@jarkkojs/readseek-linux-x64',
15
- 'win32-x64': '@jarkkojs/readseek-win32-x64',
16
- };
17
- const packageName = packages[platform];
18
- if (!packageName) {
19
- throw new Error(
20
- `unsupported platform: ${platform}; supported platforms: ${Object.keys(packages).join(', ')}`
21
- );
22
- }
23
- const binaryName = process.platform === 'linux' ? 'readseek.AppImage'
24
- : process.platform === 'win32' ? 'readseek.exe' : 'readseek';
25
-
26
- let packageDir;
27
- try {
28
- packageDir = path.dirname(
29
- require.resolve(`${packageName}/package.json`, { paths: [__dirname] })
30
- );
31
- } catch {
32
- throw new Error(
33
- `package ${packageName} is not installed; ` +
34
- 'install the optional platform-specific dependency'
35
- );
36
- }
37
-
38
- const binaryPath = path.join(packageDir, 'bin', binaryName);
39
- if (!fs.existsSync(binaryPath)) {
40
- throw new Error(`binary not found: ${binaryPath}`);
41
- }
42
-
43
- return binaryPath;
44
- }
45
-
46
- try {
47
- const binary = resolveBinary();
48
- const args = process.argv.slice(2);
49
- execFileSync(binary, args, {
50
- stdio: 'inherit',
51
- env: process.platform === 'linux'
52
- ? { ...process.env, APPIMAGE_EXTRACT_AND_RUN: '1' }
53
- : process.env,
54
- });
55
- } catch (err) {
56
- if (typeof err.status === 'number') {
57
- process.exit(err.status);
58
- }
59
- console.error(err.message);
60
- process.exit(1);
61
- }