@jarkkojs/readseek-api 0.9.5

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/json.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function cleanReadSeekErrorText(stderr: string): string;
2
+ export declare function parseReadSeekJson(stdout: string): unknown;
@@ -0,0 +1,13 @@
1
+ export declare const READSEEK_PLATFORM_PACKAGES: Readonly<Record<string, string>>;
2
+ export type ModuleResolver = {
3
+ resolve: (specifier: string, options?: {
4
+ paths?: string[];
5
+ }) => string;
6
+ };
7
+ export declare function readSeekBinaryName(platform?: string): string;
8
+ export declare function readSeekPlatformKey(platform?: string, arch?: string): string;
9
+ export declare function resolveReadSeekBinaryFromPackages(resolver?: ModuleResolver["resolve"] | ModuleResolver, options?: {
10
+ platform?: string;
11
+ arch?: string;
12
+ metaPackage?: string;
13
+ }): string;
@@ -0,0 +1,4 @@
1
+ import { type ProcessRunOptions, type ProcessRunResult } from "./process.ts";
2
+ export declare function runReadSeekBun(binaryPath: string, args: readonly string[], options?: ProcessRunOptions): Promise<ProcessRunResult>;
3
+ export declare function runReadSeekBunText(binaryPath: string, args: readonly string[], options?: ProcessRunOptions): Promise<string>;
4
+ export declare function runReadSeekBunJson(binaryPath: string, args: readonly string[], options?: ProcessRunOptions): Promise<unknown>;
@@ -0,0 +1,4 @@
1
+ import { type ProcessRunOptions, type ProcessRunResult } from "./process.ts";
2
+ export declare function runReadSeekNode(binaryPath: string, args: readonly string[], options?: ProcessRunOptions): Promise<ProcessRunResult>;
3
+ export declare function runReadSeekNodeText(binaryPath: string, args: readonly string[], options?: ProcessRunOptions): Promise<string>;
4
+ export declare function runReadSeekNodeJson(binaryPath: string, args: readonly string[], options?: ProcessRunOptions): Promise<unknown>;
@@ -0,0 +1,30 @@
1
+ export declare const DEFAULT_READSEEK_TIMEOUT_MS = 120000;
2
+ export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
3
+ export type ProcessRunOptions = {
4
+ timeoutMs?: number;
5
+ signal?: AbortSignal;
6
+ stdin?: string;
7
+ cwd?: string;
8
+ cancelable?: boolean;
9
+ maxOutputBytes?: number;
10
+ };
11
+ export type ProcessRunResult = {
12
+ stdout: string;
13
+ stderr: string;
14
+ exitCode: number | null;
15
+ signal: string | null;
16
+ };
17
+ export declare function resolveProcessLimits(options?: ProcessRunOptions): {
18
+ timeoutMs: number;
19
+ maxOutputBytes: number;
20
+ cancelable: boolean;
21
+ };
22
+ export declare function readSeekCancellationError(signal: AbortSignal | undefined): Error;
23
+ export declare function failureFromProcessResult(result: ProcessRunResult, options?: {
24
+ timedOut?: boolean;
25
+ timeoutMs?: number;
26
+ overflow?: "stdout" | "stderr";
27
+ maxOutputBytes?: number;
28
+ }): Error;
29
+ export declare function ensureSuccessfulStdout(result: ProcessRunResult): string;
30
+ export declare function parseSuccessfulJson(result: ProcessRunResult): unknown;
@@ -0,0 +1,33 @@
1
+ export type ValidationResult = {
2
+ ok: true;
3
+ } | {
4
+ ok: false;
5
+ error: string;
6
+ };
7
+ export type GitSelectionInput = {
8
+ cached?: boolean;
9
+ others?: boolean;
10
+ ignored?: boolean;
11
+ };
12
+ export declare function validateGitSelection(input: GitSelectionInput): ValidationResult;
13
+ export type RefsScopeInput = {
14
+ name?: string;
15
+ scope?: boolean;
16
+ line?: number;
17
+ column?: number;
18
+ };
19
+ export declare function validateRefsNameVsScope(input: RefsScopeInput): ValidationResult;
20
+ export type VisionInput = {
21
+ visionMode?: string;
22
+ visionLevel?: string;
23
+ outline?: boolean;
24
+ };
25
+ export declare function validateVisionLevelVsMode(input: VisionInput): ValidationResult;
26
+ export type EditObject = Record<string, unknown>;
27
+ export declare function validateExactlyOneEditVariant(edits: unknown): {
28
+ ok: true;
29
+ edits: EditObject[];
30
+ } | {
31
+ ok: false;
32
+ error: string;
33
+ };
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@jarkkojs/readseek-api",
3
+ "version": "0.9.5",
4
+ "description": "Shared ReadSeek CLI contract, validation, argv builders, and bounded process runners",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "homepage": "https://github.com/jarkkojs/readseek/tree/main/packages/readseek-api#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/jarkkojs/readseek.git",
11
+ "directory": "packages/readseek-api"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/jarkkojs/readseek/issues"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "default": "./dist/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist/",
25
+ "LICENSE",
26
+ "README.md"
27
+ ],
28
+ "scripts": {
29
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && bun build ./src/index.ts --outfile dist/index.js --target=node --format=esm --packages=external && tsc -p tsconfig.build.json",
30
+ "prepack": "npm run build",
31
+ "typecheck": "tsc --noEmit",
32
+ "test": "vitest run"
33
+ },
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "keywords": [
41
+ "readseek",
42
+ "cli",
43
+ "structural-search",
44
+ "ast-grep",
45
+ "hashline"
46
+ ],
47
+ "dependencies": {
48
+ "@jarkkojs/readseek": "^0.9.5"
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^22.0.0",
52
+ "typescript": "^5.9.3",
53
+ "vitest": "^4.1.0"
54
+ }
55
+ }