@corsa-bind/napi 1.13.1 → 1.14.0

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
@@ -30,6 +30,7 @@ bun run ./main.ts
30
30
 
31
31
  - native JS bindings for the `corsa` API and LSP surface
32
32
  - an ESM TypeScript wrapper under `dist/`
33
+ - an `@corsa-bind/napi/orchestrator` subpath for workflow-level JS helpers
33
34
  - no bundled Corsa executable
34
35
 
35
36
  ## Runtime requirement
@@ -45,6 +46,10 @@ and `closeAsync` for production Node services and editor integrations. The
45
46
  older synchronous methods remain available for short scripts and latency-bounded
46
47
  tooling, but they run on the JavaScript call path.
47
48
 
49
+ The root entry point intentionally stays close to the upstream binding surface.
50
+ Workflow strategies such as checker query coalescing live under
51
+ `@corsa-bind/napi/orchestrator`.
52
+
48
53
  ## Development
49
54
 
50
55
  ```bash
@@ -0,0 +1,22 @@
1
+ import { CheckerBatchRequest, CheckerBatchResponse } from "./types.mjs";
2
+ //#region checker_batch.d.ts
3
+ interface CheckerBatchCapableClient {
4
+ callJson<T>(method: string, params?: unknown): T;
5
+ }
6
+ interface AsyncCheckerBatchCapableClient {
7
+ callJsonAsync<T>(method: string, params?: unknown): Promise<T>;
8
+ }
9
+ /**
10
+ * Sends multiple raw checker endpoint calls through upstream `batchRequests`.
11
+ *
12
+ * This keeps the original typed primitives available while giving hot paths a
13
+ * single transport round trip for relation-heavy workflows.
14
+ */
15
+ declare function batchCheckerRequests(client: CheckerBatchCapableClient, requests: readonly CheckerBatchRequest[]): CheckerBatchResponse[];
16
+ /**
17
+ * Async counterpart of {@link batchCheckerRequests}.
18
+ */
19
+ declare function batchCheckerRequestsAsync(client: AsyncCheckerBatchCapableClient, requests: readonly CheckerBatchRequest[]): Promise<CheckerBatchResponse[]>;
20
+ //#endregion
21
+ export { AsyncCheckerBatchCapableClient, CheckerBatchCapableClient, batchCheckerRequests, batchCheckerRequestsAsync };
22
+ //# sourceMappingURL=checker_batch.d.mts.map
@@ -0,0 +1,43 @@
1
+ //#region checker_batch.ts
2
+ /**
3
+ * Sends multiple raw checker endpoint calls through upstream `batchRequests`.
4
+ *
5
+ * This keeps the original typed primitives available while giving hot paths a
6
+ * single transport round trip for relation-heavy workflows.
7
+ */
8
+ function batchCheckerRequests(client, requests) {
9
+ if (requests.length === 0) return [];
10
+ return normalizeCheckerBatchResponses(client.callJson("batchRequests", { requests: requests.map(normalizeCheckerBatchRequest) }), requests.length);
11
+ }
12
+ /**
13
+ * Async counterpart of {@link batchCheckerRequests}.
14
+ */
15
+ async function batchCheckerRequestsAsync(client, requests) {
16
+ if (requests.length === 0) return [];
17
+ return normalizeCheckerBatchResponses(await client.callJsonAsync("batchRequests", { requests: requests.map(normalizeCheckerBatchRequest) }), requests.length);
18
+ }
19
+ function normalizeCheckerBatchRequest(request) {
20
+ if (request.params === void 0) return { method: request.method };
21
+ return {
22
+ method: request.method,
23
+ params: request.params
24
+ };
25
+ }
26
+ function normalizeCheckerBatchResponses(response, expectedLength) {
27
+ if (typeof response !== "object" || response === null) throw new Error("batchRequests returned a malformed response");
28
+ const responses = response.responses;
29
+ if (!Array.isArray(responses)) throw new Error("batchRequests returned a malformed response list");
30
+ if (responses.length !== expectedLength) throw new Error(`batchRequests returned ${responses.length} responses for ${expectedLength} requests`);
31
+ return responses.map((item, index) => {
32
+ if (typeof item !== "object" || item === null) throw new Error(`batchRequests response ${index} is not an object`);
33
+ const record = item;
34
+ const normalized = { method: typeof record.method === "string" ? record.method : "" };
35
+ if (typeof record.error === "string" && record.error.length > 0) normalized.error = record.error;
36
+ if ("result" in record) normalized.result = record.result;
37
+ return normalized;
38
+ });
39
+ }
40
+ //#endregion
41
+ export { batchCheckerRequests, batchCheckerRequestsAsync };
42
+
43
+ //# sourceMappingURL=checker_batch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checker_batch.mjs","names":[],"sources":["../ts/checker_batch.ts"],"sourcesContent":["import type { CheckerBatchRequest, CheckerBatchResponse } from \"./types\";\n\nexport interface CheckerBatchCapableClient {\n callJson<T>(method: string, params?: unknown): T;\n}\n\nexport interface AsyncCheckerBatchCapableClient {\n callJsonAsync<T>(method: string, params?: unknown): Promise<T>;\n}\n\n/**\n * Sends multiple raw checker endpoint calls through upstream `batchRequests`.\n *\n * This keeps the original typed primitives available while giving hot paths a\n * single transport round trip for relation-heavy workflows.\n */\nexport function batchCheckerRequests(\n client: CheckerBatchCapableClient,\n requests: readonly CheckerBatchRequest[],\n): CheckerBatchResponse[] {\n if (requests.length === 0) {\n return [];\n }\n const response = client.callJson<{ responses: unknown }>(\"batchRequests\", {\n requests: requests.map(normalizeCheckerBatchRequest),\n });\n return normalizeCheckerBatchResponses(response, requests.length);\n}\n\n/**\n * Async counterpart of {@link batchCheckerRequests}.\n */\nexport async function batchCheckerRequestsAsync(\n client: AsyncCheckerBatchCapableClient,\n requests: readonly CheckerBatchRequest[],\n): Promise<CheckerBatchResponse[]> {\n if (requests.length === 0) {\n return [];\n }\n const response = await client.callJsonAsync<{ responses: unknown }>(\"batchRequests\", {\n requests: requests.map(normalizeCheckerBatchRequest),\n });\n return normalizeCheckerBatchResponses(response, requests.length);\n}\n\nfunction normalizeCheckerBatchRequest(request: CheckerBatchRequest): CheckerBatchRequest {\n if (request.params === undefined) {\n return { method: request.method };\n }\n return { method: request.method, params: request.params };\n}\n\nfunction normalizeCheckerBatchResponses(\n response: { responses?: unknown },\n expectedLength: number,\n): CheckerBatchResponse[] {\n if (typeof response !== \"object\" || response === null) {\n throw new Error(\"batchRequests returned a malformed response\");\n }\n const responses = response.responses;\n if (!Array.isArray(responses)) {\n throw new Error(\"batchRequests returned a malformed response list\");\n }\n if (responses.length !== expectedLength) {\n throw new Error(\n `batchRequests returned ${responses.length} responses for ${expectedLength} requests`,\n );\n }\n return responses.map((item, index) => {\n if (typeof item !== \"object\" || item === null) {\n throw new Error(`batchRequests response ${index} is not an object`);\n }\n const record = item as Record<string, unknown>;\n const method = typeof record.method === \"string\" ? record.method : \"\";\n const normalized: CheckerBatchResponse = { method };\n if (typeof record.error === \"string\" && record.error.length > 0) {\n normalized.error = record.error;\n }\n if (\"result\" in record) {\n normalized.result = record.result;\n }\n return normalized;\n });\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,qBACd,QACA,UACwB;CACxB,IAAI,SAAS,WAAW,GACtB,OAAO,CAAC;CAKV,OAAO,+BAHU,OAAO,SAAiC,iBAAiB,EACxE,UAAU,SAAS,IAAI,4BAA4B,EACrD,CAC6C,GAAG,SAAS,MAAM;AACjE;;;;AAKA,eAAsB,0BACpB,QACA,UACiC;CACjC,IAAI,SAAS,WAAW,GACtB,OAAO,CAAC;CAKV,OAAO,+BAA+B,MAHf,OAAO,cAAsC,iBAAiB,EACnF,UAAU,SAAS,IAAI,4BAA4B,EACrD,CAAC,GAC+C,SAAS,MAAM;AACjE;AAEA,SAAS,6BAA6B,SAAmD;CACvF,IAAI,QAAQ,WAAW,KAAA,GACrB,OAAO,EAAE,QAAQ,QAAQ,OAAO;CAElC,OAAO;EAAE,QAAQ,QAAQ;EAAQ,QAAQ,QAAQ;CAAO;AAC1D;AAEA,SAAS,+BACP,UACA,gBACwB;CACxB,IAAI,OAAO,aAAa,YAAY,aAAa,MAC/C,MAAM,IAAI,MAAM,6CAA6C;CAE/D,MAAM,YAAY,SAAS;CAC3B,IAAI,CAAC,MAAM,QAAQ,SAAS,GAC1B,MAAM,IAAI,MAAM,kDAAkD;CAEpE,IAAI,UAAU,WAAW,gBACvB,MAAM,IAAI,MACR,0BAA0B,UAAU,OAAO,iBAAiB,eAAe,UAC7E;CAEF,OAAO,UAAU,KAAK,MAAM,UAAU;EACpC,IAAI,OAAO,SAAS,YAAY,SAAS,MACvC,MAAM,IAAI,MAAM,0BAA0B,MAAM,kBAAkB;EAEpE,MAAM,SAAS;EAEf,MAAM,aAAmC,EAAE,QAD5B,OAAO,OAAO,WAAW,WAAW,OAAO,SAAS,GACjB;EAClD,IAAI,OAAO,OAAO,UAAU,YAAY,OAAO,MAAM,SAAS,GAC5D,WAAW,QAAQ,OAAO;EAE5B,IAAI,YAAY,QACd,WAAW,SAAS,OAAO;EAE7B,OAAO;CACT,CAAC;AACH"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,6 @@
1
- import { ApiClientOptions, ApiMode, CapabilitiesResponse, ConfigResponse, DiagnosticsCapabilities, DocumentIdentifier, EditorCapabilities, FileChangeSummary, FileChanges, FileDiagnosticsResponse, InitializeResponse, LspCapabilities, NativeLintDiagnostic, NativeLintFix, NativeLintNode, NativeLintRange, NativeLintRuleMeta, NativeLintSuggestion, NativeNodeMetadataDepth, NativeRuleBridgeRequirements, OverlayCapabilities, OverlayChanges, OverlayUpdate, ProjectDiagnosticsResponse, ProjectResponse, RuntimeCapabilities, SnapshotDiagnosticsResponse, SymbolResponse, TypeResponse, TypeTextKind, UnsafeTypeFlowInput, UpdateSnapshotParams, UpdateSnapshotResponse, VirtualChange, VirtualDocumentState } from "./types.mjs";
1
+ import { ApiClientOptions, ApiMode, CapabilitiesResponse, CheckerBatchRequest, CheckerBatchResponse, ConfigResponse, DiagnosticsCapabilities, DocumentIdentifier, EditorCapabilities, FileChangeSummary, FileChanges, FileDiagnosticsResponse, InitializeResponse, LspCapabilities, NativeLintDiagnostic, NativeLintFix, NativeLintNode, NativeLintRange, NativeLintRuleMeta, NativeLintSuggestion, NativeNodeMetadataDepth, NativeRuleBridgeRequirements, OverlayCapabilities, OverlayChanges, OverlayUpdate, ProjectDiagnosticsResponse, ProjectResponse, RuntimeCapabilities, SnapshotDiagnosticsResponse, SymbolResponse, TypeResponse, TypeTextKind, UnsafeTypeFlowInput, UpdateSnapshotParams, UpdateSnapshotResponse, VirtualChange, VirtualDocumentState } from "./types.mjs";
2
+ import { AsyncCheckerBatchCapableClient, CheckerBatchCapableClient, batchCheckerRequests, batchCheckerRequestsAsync } from "./checker_batch.mjs";
3
+ import { CheckerBatchQuery, CheckerBatchResult, CheckerBatchScope, ResolvedCheckerBatchItem } from "./orchestrator_types.mjs";
2
4
  //#region index.d.ts
3
5
  declare const binding: typeof import("../index.js");
4
6
  type CorsaApiClientConstructor = {
@@ -106,6 +108,16 @@ declare const isArrayLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
106
108
  declare const isStringArrayLikeTypeTexts: (typeTexts: readonly string[]) => boolean;
107
109
  declare const isPromiseLikeTypeTexts: (typeTexts: readonly string[], propertyNames?: readonly string[]) => boolean;
108
110
  declare const isErrorLikeTypeTexts: (typeTexts: readonly string[], propertyNames?: readonly string[]) => boolean;
111
+ /**
112
+ * @deprecated Import from `@corsa-bind/napi/orchestrator` instead. The root
113
+ * export remains as a compatibility shim and warns once at runtime.
114
+ */
115
+ declare function resolveCheckerBatch(client: CheckerBatchCapableClient, scope: CheckerBatchScope, queries: readonly CheckerBatchQuery[]): ResolvedCheckerBatchItem[];
116
+ /**
117
+ * @deprecated Import from `@corsa-bind/napi/orchestrator` instead. The root
118
+ * export remains as a compatibility shim and warns once at runtime.
119
+ */
120
+ declare function resolveCheckerBatchAsync(client: AsyncCheckerBatchCapableClient, scope: CheckerBatchScope, queries: readonly CheckerBatchQuery[]): Promise<ResolvedCheckerBatchItem[]>;
109
121
  declare const Utils: Readonly<{
110
122
  classifyTypeText: (text?: string) => TypeTextKind;
111
123
  splitTopLevelTypeText: (text: string, delimiter: string) => string[];
@@ -121,5 +133,5 @@ declare const Utils: Readonly<{
121
133
  isErrorLikeTypeTexts: (typeTexts: readonly string[], propertyNames?: readonly string[]) => boolean;
122
134
  }>;
123
135
  //#endregion
124
- export { type ApiClientOptions, type ApiMode, type CapabilitiesResponse, type ConfigResponse, CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, type DiagnosticsCapabilities, type DocumentIdentifier, type EditorCapabilities, type FileChangeSummary, type FileChanges, type FileDiagnosticsResponse, type InitializeResponse, type LspCapabilities, type NativeLintDiagnostic, type NativeLintFix, type NativeLintNode, type NativeLintRange, type NativeLintRuleMeta, type NativeLintSuggestion, type NativeNodeMetadataDepth, type NativeRuleBridgeRequirements, type OverlayCapabilities, type OverlayChanges, type OverlayUpdate, type ProjectDiagnosticsResponse, type ProjectResponse, type RuntimeCapabilities, type SnapshotDiagnosticsResponse, type SymbolResponse, type TypeResponse, type TypeTextKind, type UnsafeTypeFlowInput, type UpdateSnapshotParams, type UpdateSnapshotResponse, Utils, type VirtualChange, type VirtualDocumentState, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, spawnCorsaApiClientAsync, splitTopLevelTypeText, splitTypeText, version };
136
+ export { type ApiClientOptions, type ApiMode, type AsyncCheckerBatchCapableClient, type CapabilitiesResponse, type CheckerBatchCapableClient, type CheckerBatchQuery, type CheckerBatchRequest, type CheckerBatchResponse, type CheckerBatchResult, type CheckerBatchScope, type ConfigResponse, CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, type DiagnosticsCapabilities, type DocumentIdentifier, type EditorCapabilities, type FileChangeSummary, type FileChanges, type FileDiagnosticsResponse, type InitializeResponse, type LspCapabilities, type NativeLintDiagnostic, type NativeLintFix, type NativeLintNode, type NativeLintRange, type NativeLintRuleMeta, type NativeLintSuggestion, type NativeNodeMetadataDepth, type NativeRuleBridgeRequirements, type OverlayCapabilities, type OverlayChanges, type OverlayUpdate, type ProjectDiagnosticsResponse, type ProjectResponse, type ResolvedCheckerBatchItem, type RuntimeCapabilities, type SnapshotDiagnosticsResponse, type SymbolResponse, type TypeResponse, type TypeTextKind, type UnsafeTypeFlowInput, type UpdateSnapshotParams, type UpdateSnapshotResponse, Utils, type VirtualChange, type VirtualDocumentState, batchCheckerRequests, batchCheckerRequestsAsync, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, resolveCheckerBatch, resolveCheckerBatchAsync, runNativeLintRule, spawnCorsaApiClientAsync, splitTopLevelTypeText, splitTypeText, version };
125
137
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { batchCheckerRequests, batchCheckerRequestsAsync } from "./checker_batch.mjs";
2
+ import { resolveCheckerBatch as resolveCheckerBatch$1, resolveCheckerBatchAsync as resolveCheckerBatchAsync$1 } from "./orchestrator.mjs";
1
3
  import * as nativeModule from "../index.js";
2
4
  //#region index.ts
3
5
  const binding = "default" in nativeModule ? nativeModule.default : nativeModule;
@@ -22,6 +24,23 @@ const isArrayLikeTypeTexts = binding.isArrayLikeTypeTexts;
22
24
  const isStringArrayLikeTypeTexts = binding.isStringArrayLikeTypeTexts;
23
25
  const isPromiseLikeTypeTexts = binding.isPromiseLikeTypeTexts;
24
26
  const isErrorLikeTypeTexts = binding.isErrorLikeTypeTexts;
27
+ let rootCheckerBatchResolverWarningShown = false;
28
+ /**
29
+ * @deprecated Import from `@corsa-bind/napi/orchestrator` instead. The root
30
+ * export remains as a compatibility shim and warns once at runtime.
31
+ */
32
+ function resolveCheckerBatch(client, scope, queries) {
33
+ warnRootCheckerBatchResolver();
34
+ return resolveCheckerBatch$1(client, scope, queries);
35
+ }
36
+ /**
37
+ * @deprecated Import from `@corsa-bind/napi/orchestrator` instead. The root
38
+ * export remains as a compatibility shim and warns once at runtime.
39
+ */
40
+ async function resolveCheckerBatchAsync(client, scope, queries) {
41
+ warnRootCheckerBatchResolver();
42
+ return resolveCheckerBatchAsync$1(client, scope, queries);
43
+ }
25
44
  const Utils = Object.freeze({
26
45
  classifyTypeText,
27
46
  splitTopLevelTypeText,
@@ -36,7 +55,12 @@ const Utils = Object.freeze({
36
55
  isPromiseLikeTypeTexts,
37
56
  isErrorLikeTypeTexts
38
57
  });
58
+ function warnRootCheckerBatchResolver() {
59
+ if (rootCheckerBatchResolverWarningShown) return;
60
+ rootCheckerBatchResolverWarningShown = true;
61
+ console.warn("@corsa-bind/napi: resolveCheckerBatch is a compatibility shim; import from @corsa-bind/napi/orchestrator for new code.");
62
+ }
39
63
  //#endregion
40
- export { CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, Utils, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, runNativeLintRule, spawnCorsaApiClientAsync, splitTopLevelTypeText, splitTypeText, version };
64
+ export { CorsaApiClient, CorsaDistributedOrchestrator, CorsaVirtualDocument, Utils, batchCheckerRequests, batchCheckerRequestsAsync, classifyTypeText, binding as default, isAnyLikeTypeTexts, isArrayLikeTypeTexts, isBigIntLikeTypeTexts, isErrorLikeTypeTexts, isNumberLikeTypeTexts, isPromiseLikeTypeTexts, isStringArrayLikeTypeTexts, isStringLikeTypeTexts, isUnknownLikeTypeTexts, isUnsafeAssignment, isUnsafeReturn, nativeLintRuleMetas, resolveCheckerBatch, resolveCheckerBatchAsync, runNativeLintRule, spawnCorsaApiClientAsync, splitTopLevelTypeText, splitTypeText, version };
41
65
 
42
66
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../ts/index.ts"],"sourcesContent":["import * as nativeModule from \"../index.js\";\n\nimport type {\n ApiClientOptions,\n ConfigResponse,\n InitializeResponse,\n NativeLintDiagnostic,\n NativeLintNode,\n NativeLintRuleMeta,\n SymbolResponse,\n TypeResponse,\n TypeTextKind,\n UnsafeTypeFlowInput,\n UpdateSnapshotParams,\n UpdateSnapshotResponse,\n VirtualChange,\n VirtualDocumentState,\n} from \"./types\";\n\nconst binding = (\n \"default\" in nativeModule ? nativeModule.default : nativeModule\n) as typeof import(\"../index.js\");\n\ntype CorsaApiClientConstructor = {\n spawn(options: ApiClientOptions): CorsaApiClient;\n spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;\n};\n\nexport interface CorsaApiClient {\n initialize(): InitializeResponse;\n initializeAsync(): Promise<InitializeResponse>;\n parseConfigFile(file: string): ConfigResponse;\n parseConfigFileAsync(file: string): Promise<ConfigResponse>;\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;\n updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;\n getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null;\n getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Uint8Array | null>;\n getStringType(snapshot: string, project: string): TypeResponse;\n getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;\n getTypeAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): TypeResponse | null;\n getTypeAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<TypeResponse | null>;\n getTypesAtPositions(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Array<TypeResponse | null>;\n getTypesAtPositionsAsync(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Promise<Array<TypeResponse | null>>;\n getTypeAtSourceRange(\n snapshot: string,\n project: string,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n kind?: string,\n ): TypeResponse | null;\n getTypeAtSourceRangeAsync(\n snapshot: string,\n project: string,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n kind?: string,\n ): Promise<TypeResponse | null>;\n getSymbolAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): SymbolResponse | null;\n getSymbolAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<SymbolResponse | null>;\n getSymbolsAtPositions(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Array<SymbolResponse | null>;\n getSymbolsAtPositionsAsync(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Promise<Array<SymbolResponse | null>>;\n getAliasedSymbol(snapshot: string, project: string, symbol: string): SymbolResponse | null;\n getAliasedSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<SymbolResponse | null>;\n getImmediateAliasedSymbol(\n snapshot: string,\n project: string,\n symbol: string,\n ): SymbolResponse | null;\n getImmediateAliasedSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<SymbolResponse | null>;\n getExportsOfModule(snapshot: string, project: string, symbol: string): SymbolResponse[];\n getExportsOfModuleAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<SymbolResponse[]>;\n getSymbolOfType(snapshot: string, typeHandle: string, project?: string): SymbolResponse | null;\n getSymbolOfTypeAsync(\n snapshot: string,\n typeHandle: string,\n project?: string,\n ): Promise<SymbolResponse | null>;\n getTypeArguments(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): TypeResponse[];\n getTypeArgumentsAtSourceRange(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags: number | undefined | null,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n ): TypeResponse[];\n getTypeArgumentsAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): Promise<TypeResponse[]>;\n getTypeArgumentsAtSourceRangeAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags: number | undefined | null,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n ): Promise<TypeResponse[]>;\n getPropertyOfType(\n snapshot: string,\n project: string,\n typeHandle: string,\n name: string,\n ): SymbolResponse | null;\n getPropertyOfTypeAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n name: string,\n ): Promise<SymbolResponse | null>;\n isTypeAssignableTo(snapshot: string, project: string, source: string, target: string): boolean;\n isTypeAssignableToAsync(\n snapshot: string,\n project: string,\n source: string,\n target: string,\n ): Promise<boolean>;\n getConstraintOfType(snapshot: string, project: string, typeHandle: string): TypeResponse | null;\n getConstraintOfTypeAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n ): Promise<TypeResponse | null>;\n getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;\n getTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | null>;\n getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;\n getDeclaredTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | null>;\n typeToString(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): string;\n typeToStringAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): Promise<string>;\n callJson<T>(method: string, params?: unknown): T;\n callJsonAsync<T>(method: string, params?: unknown): Promise<T>;\n callBinary(method: string, params?: unknown): Uint8Array | null;\n callBinaryAsync(method: string, params?: unknown): Promise<Uint8Array | null>;\n releaseHandle(handle: string): void;\n releaseHandleAsync(handle: string): Promise<void>;\n close(): void;\n closeAsync(): Promise<void>;\n}\n\ntype CorsaDistributedOrchestratorConstructor = {\n new (nodeIds: string[]): CorsaDistributedOrchestrator;\n};\n\nexport interface CorsaDistributedOrchestrator {\n campaign(nodeId: string): number;\n leaderId(): string | null;\n state<T>(): T | null;\n nodeState<T>(nodeId: string): T | null;\n document(nodeId: string, uri: string): VirtualDocumentState | null;\n openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;\n changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;\n closeVirtualDocument(uri: string): void;\n}\n\ntype CorsaVirtualDocumentConstructor = {\n untitled(path: string, languageId: string, text: string): CorsaVirtualDocument;\n inMemory(authority: string, path: string, languageId: string, text: string): CorsaVirtualDocument;\n};\n\nexport interface CorsaVirtualDocument {\n readonly uri: string;\n readonly languageId: string;\n readonly version: number;\n readonly text: string;\n state(): VirtualDocumentState;\n replace(text: string): void;\n applyChanges(changes: VirtualChange[]): unknown[];\n}\n\nexport const CorsaApiClient = binding.CorsaApiClient as unknown as CorsaApiClientConstructor;\nexport const CorsaDistributedOrchestrator =\n binding.CorsaDistributedOrchestrator as unknown as CorsaDistributedOrchestratorConstructor;\nexport const CorsaVirtualDocument =\n binding.CorsaVirtualDocument as unknown as CorsaVirtualDocumentConstructor;\n\nexport const version = binding.version as () => string;\nexport const spawnCorsaApiClientAsync = binding.spawnCorsaApiClientAsync as (\n options: ApiClientOptions,\n) => Promise<CorsaApiClient>;\nexport const isUnsafeAssignment = binding.isUnsafeAssignment as (\n input: UnsafeTypeFlowInput,\n) => boolean;\nexport const isUnsafeReturn = binding.isUnsafeReturn as (input: UnsafeTypeFlowInput) => boolean;\nexport const runNativeLintRule = binding.runNativeLintRule as (\n ruleName: string,\n node: NativeLintNode,\n) => NativeLintDiagnostic[];\nexport const nativeLintRuleMetas = binding.nativeLintRuleMetas as () => NativeLintRuleMeta[];\nexport const classifyTypeText = binding.classifyTypeText as (text?: string) => TypeTextKind;\nexport const splitTopLevelTypeText = binding.splitTopLevelTypeText as (\n text: string,\n delimiter: string,\n) => string[];\nexport const splitTypeText = binding.splitTypeText as (text: string) => string[];\nexport const isStringLikeTypeTexts = binding.isStringLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isNumberLikeTypeTexts = binding.isNumberLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isBigIntLikeTypeTexts = binding.isBigIntLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isAnyLikeTypeTexts = binding.isAnyLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isUnknownLikeTypeTexts = binding.isUnknownLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isArrayLikeTypeTexts = binding.isArrayLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isStringArrayLikeTypeTexts = binding.isStringArrayLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isPromiseLikeTypeTexts = binding.isPromiseLikeTypeTexts as (\n typeTexts: readonly string[],\n propertyNames?: readonly string[],\n) => boolean;\nexport const isErrorLikeTypeTexts = binding.isErrorLikeTypeTexts as (\n typeTexts: readonly string[],\n propertyNames?: readonly string[],\n) => boolean;\n\nexport const Utils = Object.freeze({\n classifyTypeText,\n splitTopLevelTypeText,\n splitTypeText,\n isStringLikeTypeTexts,\n isNumberLikeTypeTexts,\n isBigIntLikeTypeTexts,\n isAnyLikeTypeTexts,\n isUnknownLikeTypeTexts,\n isArrayLikeTypeTexts,\n isStringArrayLikeTypeTexts,\n isPromiseLikeTypeTexts,\n isErrorLikeTypeTexts,\n});\n\nexport default binding;\nexport type * from \"./types\";\n"],"mappings":";;AAmBA,MAAM,UACJ,aAAa,eAAe,aAAa,UAAU;AA4OrD,MAAa,iBAAiB,QAAQ;AACtC,MAAa,+BACX,QAAQ;AACV,MAAa,uBACX,QAAQ;AAEV,MAAa,UAAU,QAAQ;AAC/B,MAAa,2BAA2B,QAAQ;AAGhD,MAAa,qBAAqB,QAAQ;AAG1C,MAAa,iBAAiB,QAAQ;AACtC,MAAa,oBAAoB,QAAQ;AAIzC,MAAa,sBAAsB,QAAQ;AAC3C,MAAa,mBAAmB,QAAQ;AACxC,MAAa,wBAAwB,QAAQ;AAI7C,MAAa,gBAAgB,QAAQ;AACrC,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,qBAAqB,QAAQ;AAG1C,MAAa,yBAAyB,QAAQ;AAG9C,MAAa,uBAAuB,QAAQ;AAG5C,MAAa,6BAA6B,QAAQ;AAGlD,MAAa,yBAAyB,QAAQ;AAI9C,MAAa,uBAAuB,QAAQ;AAK5C,MAAa,QAAQ,OAAO,OAAO;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["resolveCheckerBatchFromOrchestrator","resolveCheckerBatchAsyncFromOrchestrator"],"sources":["../ts/index.ts"],"sourcesContent":["import * as nativeModule from \"../index.js\";\n\nimport {\n resolveCheckerBatch as resolveCheckerBatchFromOrchestrator,\n resolveCheckerBatchAsync as resolveCheckerBatchAsyncFromOrchestrator,\n} from \"./orchestrator\";\nimport type { AsyncCheckerBatchCapableClient, CheckerBatchCapableClient } from \"./checker_batch\";\nimport type {\n CheckerBatchQuery,\n CheckerBatchScope,\n ResolvedCheckerBatchItem,\n} from \"./orchestrator_types\";\nimport type {\n ApiClientOptions,\n ConfigResponse,\n InitializeResponse,\n NativeLintDiagnostic,\n NativeLintNode,\n NativeLintRuleMeta,\n SymbolResponse,\n TypeResponse,\n TypeTextKind,\n UnsafeTypeFlowInput,\n UpdateSnapshotParams,\n UpdateSnapshotResponse,\n VirtualChange,\n VirtualDocumentState,\n} from \"./types\";\n\nconst binding = (\n \"default\" in nativeModule ? nativeModule.default : nativeModule\n) as typeof import(\"../index.js\");\n\ntype CorsaApiClientConstructor = {\n spawn(options: ApiClientOptions): CorsaApiClient;\n spawnAsync(options: ApiClientOptions): Promise<CorsaApiClient>;\n};\n\nexport interface CorsaApiClient {\n initialize(): InitializeResponse;\n initializeAsync(): Promise<InitializeResponse>;\n parseConfigFile(file: string): ConfigResponse;\n parseConfigFileAsync(file: string): Promise<ConfigResponse>;\n updateSnapshot(params?: UpdateSnapshotParams): UpdateSnapshotResponse;\n updateSnapshotAsync(params?: UpdateSnapshotParams): Promise<UpdateSnapshotResponse>;\n getSourceFile(snapshot: string, project: string, file: string): Uint8Array | null;\n getSourceFileAsync(snapshot: string, project: string, file: string): Promise<Uint8Array | null>;\n getStringType(snapshot: string, project: string): TypeResponse;\n getStringTypeAsync(snapshot: string, project: string): Promise<TypeResponse>;\n getTypeAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): TypeResponse | null;\n getTypeAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<TypeResponse | null>;\n getTypesAtPositions(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Array<TypeResponse | null>;\n getTypesAtPositionsAsync(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Promise<Array<TypeResponse | null>>;\n getTypeAtSourceRange(\n snapshot: string,\n project: string,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n kind?: string,\n ): TypeResponse | null;\n getTypeAtSourceRangeAsync(\n snapshot: string,\n project: string,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n kind?: string,\n ): Promise<TypeResponse | null>;\n getSymbolAtPosition(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): SymbolResponse | null;\n getSymbolAtPositionAsync(\n snapshot: string,\n project: string,\n file: string,\n position: number,\n ): Promise<SymbolResponse | null>;\n getSymbolsAtPositions(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Array<SymbolResponse | null>;\n getSymbolsAtPositionsAsync(\n snapshot: string,\n project: string,\n file: string,\n positions: number[],\n ): Promise<Array<SymbolResponse | null>>;\n getAliasedSymbol(snapshot: string, project: string, symbol: string): SymbolResponse | null;\n getAliasedSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<SymbolResponse | null>;\n getImmediateAliasedSymbol(\n snapshot: string,\n project: string,\n symbol: string,\n ): SymbolResponse | null;\n getImmediateAliasedSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<SymbolResponse | null>;\n getExportsOfModule(snapshot: string, project: string, symbol: string): SymbolResponse[];\n getExportsOfModuleAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<SymbolResponse[]>;\n getSymbolOfType(snapshot: string, typeHandle: string, project?: string): SymbolResponse | null;\n getSymbolOfTypeAsync(\n snapshot: string,\n typeHandle: string,\n project?: string,\n ): Promise<SymbolResponse | null>;\n getTypeArguments(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): TypeResponse[];\n getTypeArgumentsAtSourceRange(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags: number | undefined | null,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n ): TypeResponse[];\n getTypeArgumentsAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags?: number,\n ): Promise<TypeResponse[]>;\n getTypeArgumentsAtSourceRangeAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n objectFlags: number | undefined | null,\n file: string,\n start: number,\n end: number,\n sourceText: string,\n ): Promise<TypeResponse[]>;\n getPropertyOfType(\n snapshot: string,\n project: string,\n typeHandle: string,\n name: string,\n ): SymbolResponse | null;\n getPropertyOfTypeAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n name: string,\n ): Promise<SymbolResponse | null>;\n isTypeAssignableTo(snapshot: string, project: string, source: string, target: string): boolean;\n isTypeAssignableToAsync(\n snapshot: string,\n project: string,\n source: string,\n target: string,\n ): Promise<boolean>;\n getConstraintOfType(snapshot: string, project: string, typeHandle: string): TypeResponse | null;\n getConstraintOfTypeAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n ): Promise<TypeResponse | null>;\n getTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;\n getTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | null>;\n getDeclaredTypeOfSymbol(snapshot: string, project: string, symbol: string): TypeResponse | null;\n getDeclaredTypeOfSymbolAsync(\n snapshot: string,\n project: string,\n symbol: string,\n ): Promise<TypeResponse | null>;\n typeToString(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): string;\n typeToStringAsync(\n snapshot: string,\n project: string,\n typeHandle: string,\n location?: string,\n flags?: number,\n ): Promise<string>;\n callJson<T>(method: string, params?: unknown): T;\n callJsonAsync<T>(method: string, params?: unknown): Promise<T>;\n callBinary(method: string, params?: unknown): Uint8Array | null;\n callBinaryAsync(method: string, params?: unknown): Promise<Uint8Array | null>;\n releaseHandle(handle: string): void;\n releaseHandleAsync(handle: string): Promise<void>;\n close(): void;\n closeAsync(): Promise<void>;\n}\n\ntype CorsaDistributedOrchestratorConstructor = {\n new (nodeIds: string[]): CorsaDistributedOrchestrator;\n};\n\nexport interface CorsaDistributedOrchestrator {\n campaign(nodeId: string): number;\n leaderId(): string | null;\n state<T>(): T | null;\n nodeState<T>(nodeId: string): T | null;\n document(nodeId: string, uri: string): VirtualDocumentState | null;\n openVirtualDocument(document: VirtualDocumentState): VirtualDocumentState;\n changeVirtualDocument(uri: string, changes: VirtualChange[]): VirtualDocumentState;\n closeVirtualDocument(uri: string): void;\n}\n\ntype CorsaVirtualDocumentConstructor = {\n untitled(path: string, languageId: string, text: string): CorsaVirtualDocument;\n inMemory(authority: string, path: string, languageId: string, text: string): CorsaVirtualDocument;\n};\n\nexport interface CorsaVirtualDocument {\n readonly uri: string;\n readonly languageId: string;\n readonly version: number;\n readonly text: string;\n state(): VirtualDocumentState;\n replace(text: string): void;\n applyChanges(changes: VirtualChange[]): unknown[];\n}\n\nexport const CorsaApiClient = binding.CorsaApiClient as unknown as CorsaApiClientConstructor;\nexport const CorsaDistributedOrchestrator =\n binding.CorsaDistributedOrchestrator as unknown as CorsaDistributedOrchestratorConstructor;\nexport const CorsaVirtualDocument =\n binding.CorsaVirtualDocument as unknown as CorsaVirtualDocumentConstructor;\n\nexport const version = binding.version as () => string;\nexport const spawnCorsaApiClientAsync = binding.spawnCorsaApiClientAsync as (\n options: ApiClientOptions,\n) => Promise<CorsaApiClient>;\nexport const isUnsafeAssignment = binding.isUnsafeAssignment as (\n input: UnsafeTypeFlowInput,\n) => boolean;\nexport const isUnsafeReturn = binding.isUnsafeReturn as (input: UnsafeTypeFlowInput) => boolean;\nexport const runNativeLintRule = binding.runNativeLintRule as (\n ruleName: string,\n node: NativeLintNode,\n) => NativeLintDiagnostic[];\nexport const nativeLintRuleMetas = binding.nativeLintRuleMetas as () => NativeLintRuleMeta[];\nexport const classifyTypeText = binding.classifyTypeText as (text?: string) => TypeTextKind;\nexport const splitTopLevelTypeText = binding.splitTopLevelTypeText as (\n text: string,\n delimiter: string,\n) => string[];\nexport const splitTypeText = binding.splitTypeText as (text: string) => string[];\nexport const isStringLikeTypeTexts = binding.isStringLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isNumberLikeTypeTexts = binding.isNumberLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isBigIntLikeTypeTexts = binding.isBigIntLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isAnyLikeTypeTexts = binding.isAnyLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isUnknownLikeTypeTexts = binding.isUnknownLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isArrayLikeTypeTexts = binding.isArrayLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isStringArrayLikeTypeTexts = binding.isStringArrayLikeTypeTexts as (\n typeTexts: readonly string[],\n) => boolean;\nexport const isPromiseLikeTypeTexts = binding.isPromiseLikeTypeTexts as (\n typeTexts: readonly string[],\n propertyNames?: readonly string[],\n) => boolean;\nexport const isErrorLikeTypeTexts = binding.isErrorLikeTypeTexts as (\n typeTexts: readonly string[],\n propertyNames?: readonly string[],\n) => boolean;\n\nlet rootCheckerBatchResolverWarningShown = false;\n\n/**\n * @deprecated Import from `@corsa-bind/napi/orchestrator` instead. The root\n * export remains as a compatibility shim and warns once at runtime.\n */\nexport function resolveCheckerBatch(\n client: CheckerBatchCapableClient,\n scope: CheckerBatchScope,\n queries: readonly CheckerBatchQuery[],\n): ResolvedCheckerBatchItem[] {\n warnRootCheckerBatchResolver();\n return resolveCheckerBatchFromOrchestrator(client, scope, queries);\n}\n\n/**\n * @deprecated Import from `@corsa-bind/napi/orchestrator` instead. The root\n * export remains as a compatibility shim and warns once at runtime.\n */\nexport async function resolveCheckerBatchAsync(\n client: AsyncCheckerBatchCapableClient,\n scope: CheckerBatchScope,\n queries: readonly CheckerBatchQuery[],\n): Promise<ResolvedCheckerBatchItem[]> {\n warnRootCheckerBatchResolver();\n return resolveCheckerBatchAsyncFromOrchestrator(client, scope, queries);\n}\n\nexport const Utils = Object.freeze({\n classifyTypeText,\n splitTopLevelTypeText,\n splitTypeText,\n isStringLikeTypeTexts,\n isNumberLikeTypeTexts,\n isBigIntLikeTypeTexts,\n isAnyLikeTypeTexts,\n isUnknownLikeTypeTexts,\n isArrayLikeTypeTexts,\n isStringArrayLikeTypeTexts,\n isPromiseLikeTypeTexts,\n isErrorLikeTypeTexts,\n});\n\nexport default binding;\nexport { batchCheckerRequests, batchCheckerRequestsAsync } from \"./checker_batch\";\nexport type { AsyncCheckerBatchCapableClient, CheckerBatchCapableClient } from \"./checker_batch\";\nexport type {\n CheckerBatchQuery,\n CheckerBatchResult,\n CheckerBatchScope,\n ResolvedCheckerBatchItem,\n} from \"./orchestrator_types\";\nexport type * from \"./types\";\n\nfunction warnRootCheckerBatchResolver(): void {\n if (rootCheckerBatchResolverWarningShown) {\n return;\n }\n rootCheckerBatchResolverWarningShown = true;\n console.warn(\n \"@corsa-bind/napi: resolveCheckerBatch is a compatibility shim; import from @corsa-bind/napi/orchestrator for new code.\",\n );\n}\n"],"mappings":";;;;AA6BA,MAAM,UACJ,aAAa,eAAe,aAAa,UAAU;AA4OrD,MAAa,iBAAiB,QAAQ;AACtC,MAAa,+BACX,QAAQ;AACV,MAAa,uBACX,QAAQ;AAEV,MAAa,UAAU,QAAQ;AAC/B,MAAa,2BAA2B,QAAQ;AAGhD,MAAa,qBAAqB,QAAQ;AAG1C,MAAa,iBAAiB,QAAQ;AACtC,MAAa,oBAAoB,QAAQ;AAIzC,MAAa,sBAAsB,QAAQ;AAC3C,MAAa,mBAAmB,QAAQ;AACxC,MAAa,wBAAwB,QAAQ;AAI7C,MAAa,gBAAgB,QAAQ;AACrC,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,wBAAwB,QAAQ;AAG7C,MAAa,qBAAqB,QAAQ;AAG1C,MAAa,yBAAyB,QAAQ;AAG9C,MAAa,uBAAuB,QAAQ;AAG5C,MAAa,6BAA6B,QAAQ;AAGlD,MAAa,yBAAyB,QAAQ;AAI9C,MAAa,uBAAuB,QAAQ;AAK5C,IAAI,uCAAuC;;;;;AAM3C,SAAgB,oBACd,QACA,OACA,SAC4B;CAC5B,6BAA6B;CAC7B,OAAOA,sBAAoC,QAAQ,OAAO,OAAO;AACnE;;;;;AAMA,eAAsB,yBACpB,QACA,OACA,SACqC;CACrC,6BAA6B;CAC7B,OAAOC,2BAAyC,QAAQ,OAAO,OAAO;AACxE;AAEA,MAAa,QAAQ,OAAO,OAAO;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAaD,SAAS,+BAAqC;CAC5C,IAAI,sCACF;CAEF,uCAAuC;CACvC,QAAQ,KACN,wHACF;AACF"}
@@ -0,0 +1,18 @@
1
+ import { AsyncCheckerBatchCapableClient, CheckerBatchCapableClient } from "./checker_batch.mjs";
2
+ import { CheckerBatchQuery, CheckerBatchResult, CheckerBatchScope, ResolvedCheckerBatchItem } from "./orchestrator_types.mjs";
3
+ //#region orchestrator.d.ts
4
+ /**
5
+ * Resolves common project-scoped checker lookups as one coalesced batch.
6
+ *
7
+ * Position queries are grouped per source file and symbol-type queries use
8
+ * `getTypesOfSymbols`, so callers can express per-node facts without writing
9
+ * their own N+1 loop.
10
+ */
11
+ declare function resolveCheckerBatch(client: CheckerBatchCapableClient, scope: CheckerBatchScope, queries: readonly CheckerBatchQuery[]): ResolvedCheckerBatchItem[];
12
+ /**
13
+ * Async counterpart of {@link resolveCheckerBatch}.
14
+ */
15
+ declare function resolveCheckerBatchAsync(client: AsyncCheckerBatchCapableClient, scope: CheckerBatchScope, queries: readonly CheckerBatchQuery[]): Promise<ResolvedCheckerBatchItem[]>;
16
+ //#endregion
17
+ export { type CheckerBatchQuery, type CheckerBatchResult, type CheckerBatchScope, type ResolvedCheckerBatchItem, resolveCheckerBatch, resolveCheckerBatchAsync };
18
+ //# sourceMappingURL=orchestrator.d.mts.map
@@ -0,0 +1,332 @@
1
+ import { batchCheckerRequests, batchCheckerRequestsAsync } from "./checker_batch.mjs";
2
+ //#region orchestrator.ts
3
+ /**
4
+ * Resolves common project-scoped checker lookups as one coalesced batch.
5
+ *
6
+ * Position queries are grouped per source file and symbol-type queries use
7
+ * `getTypesOfSymbols`, so callers can express per-node facts without writing
8
+ * their own N+1 loop.
9
+ */
10
+ function resolveCheckerBatch(client, scope, queries) {
11
+ const plan = planCheckerBatch(scope, queries);
12
+ if (plan.requests.length === 0) return plan.resolve([]);
13
+ return plan.resolve(batchCheckerRequests(client, plan.requests));
14
+ }
15
+ /**
16
+ * Async counterpart of {@link resolveCheckerBatch}.
17
+ */
18
+ async function resolveCheckerBatchAsync(client, scope, queries) {
19
+ const plan = planCheckerBatch(scope, queries);
20
+ if (plan.requests.length === 0) return plan.resolve([]);
21
+ return plan.resolve(await batchCheckerRequestsAsync(client, plan.requests));
22
+ }
23
+ function planCheckerBatch(scope, queries) {
24
+ const results = [];
25
+ results.length = queries.length;
26
+ const requests = [];
27
+ const requestRoutes = [];
28
+ const directRequestIndexes = /* @__PURE__ */ new Map();
29
+ const typePositionGroups = /* @__PURE__ */ new Map();
30
+ const symbolPositionGroups = /* @__PURE__ */ new Map();
31
+ const symbolTypeGroup = {
32
+ symbols: [],
33
+ symbolSet: /* @__PURE__ */ new Set(),
34
+ routes: []
35
+ };
36
+ const addRequest = (request, route) => {
37
+ requests.push(request);
38
+ requestRoutes.push([route]);
39
+ };
40
+ const addDirectRequest = (query, queryIndex, method, params, transform = directBatchResult) => {
41
+ const compactParams = omitUndefinedProperties(params);
42
+ const requestKey = `${method}\0${JSON.stringify(compactParams)}`;
43
+ const route = (response) => {
44
+ setResponseResult(results, queryIndex, query, response, transform);
45
+ };
46
+ const existingIndex = directRequestIndexes.get(requestKey);
47
+ if (existingIndex !== void 0) {
48
+ requestRoutes[existingIndex]?.push(route);
49
+ return;
50
+ }
51
+ directRequestIndexes.set(requestKey, requests.length);
52
+ addRequest({
53
+ method,
54
+ params: compactParams
55
+ }, route);
56
+ };
57
+ queries.forEach((query, queryIndex) => {
58
+ switch (query.kind) {
59
+ case "typeAtPosition":
60
+ addPositionBatchQuery(typePositionGroups, query, queryIndex, query.file, [query.position], true);
61
+ break;
62
+ case "typesAtPositions":
63
+ if (query.positions.length === 0) results[queryIndex] = {
64
+ key: query.key,
65
+ kind: query.kind,
66
+ result: []
67
+ };
68
+ else addPositionBatchQuery(typePositionGroups, query, queryIndex, query.file, query.positions, false);
69
+ break;
70
+ case "symbolAtPosition":
71
+ addPositionBatchQuery(symbolPositionGroups, query, queryIndex, query.file, [query.position], true);
72
+ break;
73
+ case "symbolsAtPositions":
74
+ if (query.positions.length === 0) results[queryIndex] = {
75
+ key: query.key,
76
+ kind: query.kind,
77
+ result: []
78
+ };
79
+ else addPositionBatchQuery(symbolPositionGroups, query, queryIndex, query.file, query.positions, false);
80
+ break;
81
+ case "typeOfSymbol":
82
+ addSymbolTypeBatchQuery(symbolTypeGroup, query, queryIndex, [query.symbol], true);
83
+ break;
84
+ case "typesOfSymbols":
85
+ if (query.symbols.length === 0) results[queryIndex] = {
86
+ key: query.key,
87
+ kind: query.kind,
88
+ result: []
89
+ };
90
+ else addSymbolTypeBatchQuery(symbolTypeGroup, query, queryIndex, query.symbols, false);
91
+ break;
92
+ case "symbolOfType":
93
+ addDirectRequest(query, queryIndex, "getSymbolOfType", {
94
+ snapshot: scope.snapshot,
95
+ project: scope.project,
96
+ type: query.type
97
+ });
98
+ break;
99
+ case "declaredTypeOfSymbol":
100
+ addDirectRequest(query, queryIndex, "getDeclaredTypeOfSymbol", {
101
+ snapshot: scope.snapshot,
102
+ project: scope.project,
103
+ symbol: query.symbol
104
+ });
105
+ break;
106
+ case "aliasedSymbol":
107
+ addDirectRequest(query, queryIndex, "getAliasedSymbol", {
108
+ snapshot: scope.snapshot,
109
+ project: scope.project,
110
+ symbol: query.symbol
111
+ });
112
+ break;
113
+ case "immediateAliasedSymbol":
114
+ addDirectRequest(query, queryIndex, "getImmediateAliasedSymbol", {
115
+ snapshot: scope.snapshot,
116
+ project: scope.project,
117
+ symbol: query.symbol
118
+ });
119
+ break;
120
+ case "exportsOfModule":
121
+ addDirectRequest(query, queryIndex, "getExportsOfModule", {
122
+ snapshot: scope.snapshot,
123
+ project: scope.project,
124
+ symbol: query.symbol
125
+ }, arrayBatchResult);
126
+ break;
127
+ case "propertyOfType":
128
+ addDirectRequest(query, queryIndex, "getPropertyOfType", {
129
+ snapshot: scope.snapshot,
130
+ project: scope.project,
131
+ type: query.type,
132
+ name: query.name
133
+ });
134
+ break;
135
+ case "typeArguments":
136
+ if (query.objectFlags !== void 0 && (query.objectFlags & 36) === 0) results[queryIndex] = {
137
+ key: query.key,
138
+ kind: query.kind,
139
+ result: []
140
+ };
141
+ else addDirectRequest(query, queryIndex, "getTypeArguments", {
142
+ snapshot: scope.snapshot,
143
+ project: scope.project,
144
+ type: query.type
145
+ }, arrayBatchResult);
146
+ break;
147
+ case "constraintOfType":
148
+ addDirectRequest(query, queryIndex, "getConstraintOfType", {
149
+ snapshot: scope.snapshot,
150
+ project: scope.project,
151
+ type: query.type
152
+ });
153
+ break;
154
+ case "isTypeAssignableTo":
155
+ addDirectRequest(query, queryIndex, "isTypeAssignableTo", {
156
+ snapshot: scope.snapshot,
157
+ project: scope.project,
158
+ source: query.source,
159
+ target: query.target
160
+ });
161
+ break;
162
+ case "typeToString": addDirectRequest(query, queryIndex, "typeToString", {
163
+ snapshot: scope.snapshot,
164
+ project: scope.project,
165
+ type: query.type,
166
+ location: query.location,
167
+ flags: query.flags
168
+ });
169
+ }
170
+ });
171
+ flushPositionBatchGroups(scope, typePositionGroups, "getTypesAtPositions", requests, requestRoutes, results);
172
+ flushPositionBatchGroups(scope, symbolPositionGroups, "getSymbolsAtPositions", requests, requestRoutes, results);
173
+ flushSymbolTypeBatchGroup(scope, symbolTypeGroup, requests, requestRoutes, results);
174
+ return {
175
+ requests,
176
+ resolve(responses) {
177
+ for (const [index, response] of responses.entries()) for (const route of requestRoutes[index] ?? []) route(response);
178
+ return queries.map((query, index) => {
179
+ return results[index] ?? {
180
+ key: query.key,
181
+ kind: query.kind,
182
+ error: "checker batch query did not produce a result"
183
+ };
184
+ });
185
+ }
186
+ };
187
+ }
188
+ function addPositionBatchQuery(groups, query, queryIndex, file, positions, single) {
189
+ let group = groups.get(file);
190
+ if (!group) {
191
+ group = {
192
+ file,
193
+ positions: [],
194
+ positionSet: /* @__PURE__ */ new Set(),
195
+ routes: []
196
+ };
197
+ groups.set(file, group);
198
+ }
199
+ for (const position of positions) if (!group.positionSet.has(position)) {
200
+ group.positionSet.add(position);
201
+ group.positions.push(position);
202
+ }
203
+ group.routes.push({
204
+ query,
205
+ queryIndex,
206
+ positions,
207
+ single
208
+ });
209
+ }
210
+ function addSymbolTypeBatchQuery(group, query, queryIndex, symbols, single) {
211
+ for (const symbol of symbols) if (!group.symbolSet.has(symbol)) {
212
+ group.symbolSet.add(symbol);
213
+ group.symbols.push(symbol);
214
+ }
215
+ group.routes.push({
216
+ query,
217
+ queryIndex,
218
+ symbols,
219
+ single
220
+ });
221
+ }
222
+ function flushPositionBatchGroups(scope, groups, method, requests, requestRoutes, results) {
223
+ for (const group of groups.values()) {
224
+ requests.push({
225
+ method,
226
+ params: {
227
+ snapshot: scope.snapshot,
228
+ project: scope.project,
229
+ file: group.file,
230
+ positions: group.positions
231
+ }
232
+ });
233
+ requestRoutes.push([(response) => {
234
+ if (response.error) {
235
+ for (const route of group.routes) results[route.queryIndex] = {
236
+ key: route.query.key,
237
+ kind: route.query.kind,
238
+ error: response.error
239
+ };
240
+ return;
241
+ }
242
+ if (!Array.isArray(response.result)) {
243
+ const error = `${method} returned a non-array result`;
244
+ for (const route of group.routes) results[route.queryIndex] = {
245
+ key: route.query.key,
246
+ kind: route.query.kind,
247
+ error
248
+ };
249
+ return;
250
+ }
251
+ const byPosition = /* @__PURE__ */ new Map();
252
+ for (const [index, position] of group.positions.entries()) byPosition.set(position, response.result[index] ?? null);
253
+ for (const route of group.routes) {
254
+ const result = route.single ? byPosition.get(route.positions[0] ?? -1) ?? null : route.positions.map((position) => byPosition.get(position) ?? null);
255
+ results[route.queryIndex] = {
256
+ key: route.query.key,
257
+ kind: route.query.kind,
258
+ result
259
+ };
260
+ }
261
+ }]);
262
+ }
263
+ }
264
+ function flushSymbolTypeBatchGroup(scope, group, requests, requestRoutes, results) {
265
+ if (group.symbols.length === 0) return;
266
+ requests.push({
267
+ method: "getTypesOfSymbols",
268
+ params: {
269
+ snapshot: scope.snapshot,
270
+ project: scope.project,
271
+ symbols: group.symbols
272
+ }
273
+ });
274
+ requestRoutes.push([(response) => {
275
+ if (response.error) {
276
+ for (const route of group.routes) results[route.queryIndex] = {
277
+ key: route.query.key,
278
+ kind: route.query.kind,
279
+ error: response.error
280
+ };
281
+ return;
282
+ }
283
+ if (!Array.isArray(response.result)) {
284
+ const error = "getTypesOfSymbols returned a non-array result";
285
+ for (const route of group.routes) results[route.queryIndex] = {
286
+ key: route.query.key,
287
+ kind: route.query.kind,
288
+ error
289
+ };
290
+ return;
291
+ }
292
+ const bySymbol = /* @__PURE__ */ new Map();
293
+ for (const [index, symbol] of group.symbols.entries()) bySymbol.set(symbol, response.result[index] ?? null);
294
+ for (const route of group.routes) {
295
+ const result = route.single ? bySymbol.get(route.symbols[0] ?? "") ?? null : route.symbols.map((symbol) => bySymbol.get(symbol) ?? null);
296
+ results[route.queryIndex] = {
297
+ key: route.query.key,
298
+ kind: route.query.kind,
299
+ result
300
+ };
301
+ }
302
+ }]);
303
+ }
304
+ function setResponseResult(results, queryIndex, query, response, transform) {
305
+ if (response.error) {
306
+ results[queryIndex] = {
307
+ key: query.key,
308
+ kind: query.kind,
309
+ error: response.error
310
+ };
311
+ return;
312
+ }
313
+ results[queryIndex] = {
314
+ key: query.key,
315
+ kind: query.kind,
316
+ result: transform(response.result)
317
+ };
318
+ }
319
+ function directBatchResult(result) {
320
+ return result ?? null;
321
+ }
322
+ function arrayBatchResult(result) {
323
+ if (result === null || result === void 0) return [];
324
+ return result;
325
+ }
326
+ function omitUndefinedProperties(input) {
327
+ return Object.fromEntries(Object.entries(input).filter((entry) => entry[1] !== void 0));
328
+ }
329
+ //#endregion
330
+ export { resolveCheckerBatch, resolveCheckerBatchAsync };
331
+
332
+ //# sourceMappingURL=orchestrator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.mjs","names":[],"sources":["../ts/orchestrator.ts"],"sourcesContent":["import {\n batchCheckerRequests,\n batchCheckerRequestsAsync,\n type AsyncCheckerBatchCapableClient,\n type CheckerBatchCapableClient,\n} from \"./checker_batch\";\n\nimport type { CheckerBatchRequest, CheckerBatchResponse } from \"./types\";\nimport type {\n CheckerBatchQuery,\n CheckerBatchResult,\n CheckerBatchScope,\n ResolvedCheckerBatchItem,\n} from \"./orchestrator_types\";\n\nconst OBJECT_FLAGS_REFERENCE = 1 << 2;\nconst OBJECT_FLAGS_MAPPED = 1 << 5;\n\ntype CheckerBatchRoute = (response: CheckerBatchResponse) => void;\n\ninterface PositionBatchGroup {\n file: string;\n positions: number[];\n positionSet: Set<number>;\n routes: PositionBatchRoute[];\n}\n\ninterface PositionBatchRoute {\n query: CheckerBatchQuery;\n queryIndex: number;\n positions: readonly number[];\n single: boolean;\n}\n\ninterface SymbolTypeBatchGroup {\n symbols: string[];\n symbolSet: Set<string>;\n routes: SymbolTypeBatchRoute[];\n}\n\ninterface SymbolTypeBatchRoute {\n query: CheckerBatchQuery;\n queryIndex: number;\n symbols: readonly string[];\n single: boolean;\n}\n\ninterface CheckerBatchPlan {\n requests: CheckerBatchRequest[];\n resolve(responses: CheckerBatchResponse[]): ResolvedCheckerBatchItem[];\n}\n\n/**\n * Resolves common project-scoped checker lookups as one coalesced batch.\n *\n * Position queries are grouped per source file and symbol-type queries use\n * `getTypesOfSymbols`, so callers can express per-node facts without writing\n * their own N+1 loop.\n */\nexport function resolveCheckerBatch(\n client: CheckerBatchCapableClient,\n scope: CheckerBatchScope,\n queries: readonly CheckerBatchQuery[],\n): ResolvedCheckerBatchItem[] {\n const plan = planCheckerBatch(scope, queries);\n if (plan.requests.length === 0) {\n return plan.resolve([]);\n }\n return plan.resolve(batchCheckerRequests(client, plan.requests));\n}\n\n/**\n * Async counterpart of {@link resolveCheckerBatch}.\n */\nexport async function resolveCheckerBatchAsync(\n client: AsyncCheckerBatchCapableClient,\n scope: CheckerBatchScope,\n queries: readonly CheckerBatchQuery[],\n): Promise<ResolvedCheckerBatchItem[]> {\n const plan = planCheckerBatch(scope, queries);\n if (plan.requests.length === 0) {\n return plan.resolve([]);\n }\n return plan.resolve(await batchCheckerRequestsAsync(client, plan.requests));\n}\n\nexport type * from \"./orchestrator_types\";\n\nfunction planCheckerBatch(\n scope: CheckerBatchScope,\n queries: readonly CheckerBatchQuery[],\n): CheckerBatchPlan {\n const results: Array<ResolvedCheckerBatchItem | undefined> = [];\n results.length = queries.length;\n const requests: CheckerBatchRequest[] = [];\n const requestRoutes: CheckerBatchRoute[][] = [];\n const directRequestIndexes = new Map<string, number>();\n const typePositionGroups = new Map<string, PositionBatchGroup>();\n const symbolPositionGroups = new Map<string, PositionBatchGroup>();\n const symbolTypeGroup: SymbolTypeBatchGroup = {\n symbols: [],\n symbolSet: new Set(),\n routes: [],\n };\n\n const addRequest = (request: CheckerBatchRequest, route: CheckerBatchRoute): void => {\n requests.push(request);\n requestRoutes.push([route]);\n };\n const addDirectRequest = (\n query: CheckerBatchQuery,\n queryIndex: number,\n method: string,\n params: Record<string, unknown>,\n transform: (result: unknown) => CheckerBatchResult = directBatchResult,\n ): void => {\n const compactParams = omitUndefinedProperties(params);\n const requestKey = `${method}\\0${JSON.stringify(compactParams)}`;\n const route = (response: CheckerBatchResponse): void => {\n setResponseResult(results, queryIndex, query, response, transform);\n };\n const existingIndex = directRequestIndexes.get(requestKey);\n if (existingIndex !== undefined) {\n requestRoutes[existingIndex]?.push(route);\n return;\n }\n directRequestIndexes.set(requestKey, requests.length);\n addRequest({ method, params: compactParams }, route);\n };\n\n queries.forEach((query, queryIndex) => {\n switch (query.kind) {\n case \"typeAtPosition\":\n addPositionBatchQuery(\n typePositionGroups,\n query,\n queryIndex,\n query.file,\n [query.position],\n true,\n );\n break;\n case \"typesAtPositions\":\n if (query.positions.length === 0) {\n results[queryIndex] = { key: query.key, kind: query.kind, result: [] };\n } else {\n addPositionBatchQuery(\n typePositionGroups,\n query,\n queryIndex,\n query.file,\n query.positions,\n false,\n );\n }\n break;\n case \"symbolAtPosition\":\n addPositionBatchQuery(\n symbolPositionGroups,\n query,\n queryIndex,\n query.file,\n [query.position],\n true,\n );\n break;\n case \"symbolsAtPositions\":\n if (query.positions.length === 0) {\n results[queryIndex] = { key: query.key, kind: query.kind, result: [] };\n } else {\n addPositionBatchQuery(\n symbolPositionGroups,\n query,\n queryIndex,\n query.file,\n query.positions,\n false,\n );\n }\n break;\n case \"typeOfSymbol\":\n addSymbolTypeBatchQuery(symbolTypeGroup, query, queryIndex, [query.symbol], true);\n break;\n case \"typesOfSymbols\":\n if (query.symbols.length === 0) {\n results[queryIndex] = { key: query.key, kind: query.kind, result: [] };\n } else {\n addSymbolTypeBatchQuery(symbolTypeGroup, query, queryIndex, query.symbols, false);\n }\n break;\n case \"symbolOfType\":\n addDirectRequest(query, queryIndex, \"getSymbolOfType\", {\n snapshot: scope.snapshot,\n project: scope.project,\n type: query.type,\n });\n break;\n case \"declaredTypeOfSymbol\":\n addDirectRequest(query, queryIndex, \"getDeclaredTypeOfSymbol\", {\n snapshot: scope.snapshot,\n project: scope.project,\n symbol: query.symbol,\n });\n break;\n case \"aliasedSymbol\":\n addDirectRequest(query, queryIndex, \"getAliasedSymbol\", {\n snapshot: scope.snapshot,\n project: scope.project,\n symbol: query.symbol,\n });\n break;\n case \"immediateAliasedSymbol\":\n addDirectRequest(query, queryIndex, \"getImmediateAliasedSymbol\", {\n snapshot: scope.snapshot,\n project: scope.project,\n symbol: query.symbol,\n });\n break;\n case \"exportsOfModule\":\n addDirectRequest(\n query,\n queryIndex,\n \"getExportsOfModule\",\n {\n snapshot: scope.snapshot,\n project: scope.project,\n symbol: query.symbol,\n },\n arrayBatchResult,\n );\n break;\n case \"propertyOfType\":\n addDirectRequest(query, queryIndex, \"getPropertyOfType\", {\n snapshot: scope.snapshot,\n project: scope.project,\n type: query.type,\n name: query.name,\n });\n break;\n case \"typeArguments\":\n if (\n query.objectFlags !== undefined &&\n (query.objectFlags & (OBJECT_FLAGS_REFERENCE | OBJECT_FLAGS_MAPPED)) === 0\n ) {\n results[queryIndex] = { key: query.key, kind: query.kind, result: [] };\n } else {\n addDirectRequest(\n query,\n queryIndex,\n \"getTypeArguments\",\n {\n snapshot: scope.snapshot,\n project: scope.project,\n type: query.type,\n },\n arrayBatchResult,\n );\n }\n break;\n case \"constraintOfType\":\n addDirectRequest(query, queryIndex, \"getConstraintOfType\", {\n snapshot: scope.snapshot,\n project: scope.project,\n type: query.type,\n });\n break;\n case \"isTypeAssignableTo\":\n addDirectRequest(query, queryIndex, \"isTypeAssignableTo\", {\n snapshot: scope.snapshot,\n project: scope.project,\n source: query.source,\n target: query.target,\n });\n break;\n case \"typeToString\":\n addDirectRequest(query, queryIndex, \"typeToString\", {\n snapshot: scope.snapshot,\n project: scope.project,\n type: query.type,\n location: query.location,\n flags: query.flags,\n });\n break;\n }\n });\n\n flushPositionBatchGroups(\n scope,\n typePositionGroups,\n \"getTypesAtPositions\",\n requests,\n requestRoutes,\n results,\n );\n flushPositionBatchGroups(\n scope,\n symbolPositionGroups,\n \"getSymbolsAtPositions\",\n requests,\n requestRoutes,\n results,\n );\n flushSymbolTypeBatchGroup(scope, symbolTypeGroup, requests, requestRoutes, results);\n\n return {\n requests,\n resolve(responses) {\n for (const [index, response] of responses.entries()) {\n for (const route of requestRoutes[index] ?? []) {\n route(response);\n }\n }\n return queries.map((query, index) => {\n return (\n results[index] ?? {\n key: query.key,\n kind: query.kind,\n error: \"checker batch query did not produce a result\",\n }\n );\n });\n },\n };\n}\n\nfunction addPositionBatchQuery(\n groups: Map<string, PositionBatchGroup>,\n query: CheckerBatchQuery,\n queryIndex: number,\n file: string,\n positions: readonly number[],\n single: boolean,\n): void {\n let group = groups.get(file);\n if (!group) {\n group = {\n file,\n positions: [],\n positionSet: new Set(),\n routes: [],\n };\n groups.set(file, group);\n }\n for (const position of positions) {\n if (!group.positionSet.has(position)) {\n group.positionSet.add(position);\n group.positions.push(position);\n }\n }\n group.routes.push({ query, queryIndex, positions, single });\n}\n\nfunction addSymbolTypeBatchQuery(\n group: SymbolTypeBatchGroup,\n query: CheckerBatchQuery,\n queryIndex: number,\n symbols: readonly string[],\n single: boolean,\n): void {\n for (const symbol of symbols) {\n if (!group.symbolSet.has(symbol)) {\n group.symbolSet.add(symbol);\n group.symbols.push(symbol);\n }\n }\n group.routes.push({ query, queryIndex, symbols, single });\n}\n\nfunction flushPositionBatchGroups(\n scope: CheckerBatchScope,\n groups: Map<string, PositionBatchGroup>,\n method: \"getTypesAtPositions\" | \"getSymbolsAtPositions\",\n requests: CheckerBatchRequest[],\n requestRoutes: CheckerBatchRoute[][],\n results: Array<ResolvedCheckerBatchItem | undefined>,\n): void {\n for (const group of groups.values()) {\n requests.push({\n method,\n params: {\n snapshot: scope.snapshot,\n project: scope.project,\n file: group.file,\n positions: group.positions,\n },\n });\n requestRoutes.push([\n (response) => {\n if (response.error) {\n for (const route of group.routes) {\n results[route.queryIndex] = {\n key: route.query.key,\n kind: route.query.kind,\n error: response.error,\n };\n }\n return;\n }\n if (!Array.isArray(response.result)) {\n const error = `${method} returned a non-array result`;\n for (const route of group.routes) {\n results[route.queryIndex] = {\n key: route.query.key,\n kind: route.query.kind,\n error,\n };\n }\n return;\n }\n const byPosition = new Map<number, unknown>();\n for (const [index, position] of group.positions.entries()) {\n byPosition.set(position, response.result[index] ?? null);\n }\n for (const route of group.routes) {\n const result = route.single\n ? (byPosition.get(route.positions[0] ?? -1) ?? null)\n : route.positions.map((position) => byPosition.get(position) ?? null);\n results[route.queryIndex] = {\n key: route.query.key,\n kind: route.query.kind,\n result: result as CheckerBatchResult,\n };\n }\n },\n ]);\n }\n}\n\nfunction flushSymbolTypeBatchGroup(\n scope: CheckerBatchScope,\n group: SymbolTypeBatchGroup,\n requests: CheckerBatchRequest[],\n requestRoutes: CheckerBatchRoute[][],\n results: Array<ResolvedCheckerBatchItem | undefined>,\n): void {\n if (group.symbols.length === 0) {\n return;\n }\n requests.push({\n method: \"getTypesOfSymbols\",\n params: {\n snapshot: scope.snapshot,\n project: scope.project,\n symbols: group.symbols,\n },\n });\n requestRoutes.push([\n (response) => {\n if (response.error) {\n for (const route of group.routes) {\n results[route.queryIndex] = {\n key: route.query.key,\n kind: route.query.kind,\n error: response.error,\n };\n }\n return;\n }\n if (!Array.isArray(response.result)) {\n const error = \"getTypesOfSymbols returned a non-array result\";\n for (const route of group.routes) {\n results[route.queryIndex] = {\n key: route.query.key,\n kind: route.query.kind,\n error,\n };\n }\n return;\n }\n const bySymbol = new Map<string, unknown>();\n for (const [index, symbol] of group.symbols.entries()) {\n bySymbol.set(symbol, response.result[index] ?? null);\n }\n for (const route of group.routes) {\n const result = route.single\n ? (bySymbol.get(route.symbols[0] ?? \"\") ?? null)\n : route.symbols.map((symbol) => bySymbol.get(symbol) ?? null);\n results[route.queryIndex] = {\n key: route.query.key,\n kind: route.query.kind,\n result: result as CheckerBatchResult,\n };\n }\n },\n ]);\n}\n\nfunction setResponseResult(\n results: Array<ResolvedCheckerBatchItem | undefined>,\n queryIndex: number,\n query: CheckerBatchQuery,\n response: CheckerBatchResponse,\n transform: (result: unknown) => CheckerBatchResult,\n): void {\n if (response.error) {\n results[queryIndex] = {\n key: query.key,\n kind: query.kind,\n error: response.error,\n };\n return;\n }\n results[queryIndex] = {\n key: query.key,\n kind: query.kind,\n result: transform(response.result),\n };\n}\n\nfunction directBatchResult(result: unknown): CheckerBatchResult {\n return (result ?? null) as CheckerBatchResult;\n}\n\nfunction arrayBatchResult(result: unknown): CheckerBatchResult {\n if (result === null || result === undefined) {\n return [];\n }\n return result as CheckerBatchResult;\n}\n\nfunction omitUndefinedProperties(input: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(input).filter((entry): entry is [string, unknown] => entry[1] !== undefined),\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,95 @@
1
+ import { SymbolResponse, TypeResponse } from "./types.mjs";
2
+ //#region orchestrator_types.d.ts
3
+ interface CheckerBatchScope {
4
+ snapshot: string;
5
+ project: string;
6
+ }
7
+ type CheckerBatchQuery = {
8
+ key: string;
9
+ kind: "typeAtPosition";
10
+ file: string;
11
+ position: number;
12
+ } | {
13
+ key: string;
14
+ kind: "typesAtPositions";
15
+ file: string;
16
+ positions: readonly number[];
17
+ } | {
18
+ key: string;
19
+ kind: "symbolAtPosition";
20
+ file: string;
21
+ position: number;
22
+ } | {
23
+ key: string;
24
+ kind: "symbolsAtPositions";
25
+ file: string;
26
+ positions: readonly number[];
27
+ } | {
28
+ key: string;
29
+ kind: "typeOfSymbol";
30
+ symbol: string;
31
+ } | {
32
+ key: string;
33
+ kind: "typesOfSymbols";
34
+ symbols: readonly string[];
35
+ } | {
36
+ key: string;
37
+ kind: "symbolOfType";
38
+ type: string;
39
+ } | {
40
+ key: string;
41
+ kind: "declaredTypeOfSymbol";
42
+ symbol: string;
43
+ } | {
44
+ key: string;
45
+ kind: "aliasedSymbol";
46
+ symbol: string;
47
+ } | {
48
+ key: string;
49
+ kind: "immediateAliasedSymbol";
50
+ symbol: string;
51
+ } | {
52
+ key: string;
53
+ kind: "exportsOfModule";
54
+ symbol: string;
55
+ } | {
56
+ key: string;
57
+ kind: "propertyOfType";
58
+ type: string;
59
+ name: string;
60
+ } | {
61
+ key: string;
62
+ kind: "typeArguments";
63
+ type: string;
64
+ objectFlags?: number;
65
+ } | {
66
+ key: string;
67
+ kind: "constraintOfType";
68
+ type: string;
69
+ } | {
70
+ key: string;
71
+ kind: "isTypeAssignableTo";
72
+ source: string;
73
+ target: string;
74
+ } | {
75
+ key: string;
76
+ kind: "typeToString";
77
+ type: string;
78
+ location?: string;
79
+ flags?: number;
80
+ };
81
+ type CheckerBatchResult = TypeResponse | Array<TypeResponse | null> | SymbolResponse | Array<SymbolResponse | null> | boolean | string | null;
82
+ type ResolvedCheckerBatchItem = {
83
+ key: string;
84
+ kind: CheckerBatchQuery["kind"];
85
+ result: CheckerBatchResult;
86
+ error?: never;
87
+ } | {
88
+ key: string;
89
+ kind: CheckerBatchQuery["kind"];
90
+ result?: never;
91
+ error: string;
92
+ };
93
+ //#endregion
94
+ export { CheckerBatchQuery, CheckerBatchResult, CheckerBatchScope, ResolvedCheckerBatchItem };
95
+ //# sourceMappingURL=orchestrator_types.d.mts.map
@@ -0,0 +1 @@
1
+ export {};
package/dist/types.d.mts CHANGED
@@ -62,6 +62,15 @@ interface SymbolResponse {
62
62
  declarations: string[];
63
63
  valueDeclaration?: string;
64
64
  }
65
+ interface CheckerBatchRequest<Params = unknown> {
66
+ method: string;
67
+ params?: Params;
68
+ }
69
+ interface CheckerBatchResponse<Result = unknown> {
70
+ method: string;
71
+ result?: Result;
72
+ error?: string;
73
+ }
65
74
  interface OverlayUpdate {
66
75
  document: DocumentIdentifier;
67
76
  text: string;
@@ -197,5 +206,5 @@ interface VirtualDocumentState {
197
206
  text: string;
198
207
  }
199
208
  //#endregion
200
- export { ApiClientOptions, ApiMode, CapabilitiesResponse, ConfigResponse, DiagnosticsCapabilities, DocumentIdentifier, EditorCapabilities, FileChangeSummary, FileChanges, FileDiagnosticsResponse, InitializeResponse, LspCapabilities, NativeLintDiagnostic, NativeLintFix, NativeLintNode, NativeLintRange, NativeLintRuleMeta, NativeLintSuggestion, NativeNodeMetadataDepth, NativeRuleBridgeRequirements, OverlayCapabilities, OverlayChanges, OverlayUpdate, ProjectDiagnosticsResponse, ProjectResponse, RuntimeCapabilities, SnapshotDiagnosticsResponse, SymbolResponse, TypeResponse, TypeTextKind, UnsafeTypeFlowInput, UpdateSnapshotParams, UpdateSnapshotResponse, VirtualChange, VirtualDocumentState };
209
+ export { ApiClientOptions, ApiMode, CapabilitiesResponse, CheckerBatchRequest, CheckerBatchResponse, ConfigResponse, DiagnosticsCapabilities, DocumentIdentifier, EditorCapabilities, FileChangeSummary, FileChanges, FileDiagnosticsResponse, InitializeResponse, LspCapabilities, NativeLintDiagnostic, NativeLintFix, NativeLintNode, NativeLintRange, NativeLintRuleMeta, NativeLintSuggestion, NativeNodeMetadataDepth, NativeRuleBridgeRequirements, OverlayCapabilities, OverlayChanges, OverlayUpdate, ProjectDiagnosticsResponse, ProjectResponse, RuntimeCapabilities, SnapshotDiagnosticsResponse, SymbolResponse, TypeResponse, TypeTextKind, UnsafeTypeFlowInput, UpdateSnapshotParams, UpdateSnapshotResponse, VirtualChange, VirtualDocumentState };
201
210
  //# sourceMappingURL=types.d.mts.map
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@corsa-bind/napi-android-arm64')
79
79
  const bindingPackageVersion = require('@corsa-bind/napi-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@corsa-bind/napi-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@corsa-bind/napi-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@corsa-bind/napi-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@corsa-bind/napi-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@corsa-bind/napi-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@corsa-bind/napi-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@corsa-bind/napi-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@corsa-bind/napi-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@corsa-bind/napi-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@corsa-bind/napi-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@corsa-bind/napi-darwin-universal')
184
184
  const bindingPackageVersion = require('@corsa-bind/napi-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@corsa-bind/napi-darwin-x64')
200
200
  const bindingPackageVersion = require('@corsa-bind/napi-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@corsa-bind/napi-darwin-arm64')
216
216
  const bindingPackageVersion = require('@corsa-bind/napi-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@corsa-bind/napi-freebsd-x64')
236
236
  const bindingPackageVersion = require('@corsa-bind/napi-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@corsa-bind/napi-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@corsa-bind/napi-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@corsa-bind/napi-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@corsa-bind/napi-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@corsa-bind/napi-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@corsa-bind/napi-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@corsa-bind/napi-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@corsa-bind/napi-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@corsa-bind/napi-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@corsa-bind/napi-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@corsa-bind/napi-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@corsa-bind/napi-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@corsa-bind/napi-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@corsa-bind/napi-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@corsa-bind/napi-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@corsa-bind/napi-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@corsa-bind/napi-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@corsa-bind/napi-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@corsa-bind/napi-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@corsa-bind/napi-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@corsa-bind/napi-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@corsa-bind/napi-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@corsa-bind/napi-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@corsa-bind/napi-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@corsa-bind/napi-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@corsa-bind/napi-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@corsa-bind/napi-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@corsa-bind/napi-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@corsa-bind/napi-openharmony-x64')
494
494
  const bindingPackageVersion = require('@corsa-bind/napi-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@corsa-bind/napi-openharmony-arm')
510
510
  const bindingPackageVersion = require('@corsa-bind/napi-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '1.13.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '1.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -648,8 +648,8 @@ if (!nativeBinding || forceWasi) {
648
648
  if (!candidateFailed) {
649
649
  if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
650
650
  const bindingPackageVersion = require('@corsa-bind/napi-wasm32-wasi/package.json').version
651
- if (bindingPackageVersion !== '1.13.1') {
652
- throw new Error(`WASI binding package version mismatch, expected 1.13.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
651
+ if (bindingPackageVersion !== '1.14.0') {
652
+ throw new Error(`WASI binding package version mismatch, expected 1.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
653
653
  }
654
654
  }
655
655
  wasiBinding = require('@corsa-bind/napi-wasm32-wasi')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corsa-bind/napi",
3
- "version": "1.13.1",
3
+ "version": "1.14.0",
4
4
  "description": "Native JS runtime bindings for Corsa stdio workflows",
5
5
  "homepage": "https://github.com/ubugeeei-prod/corsa-bind/tree/main/src/bindings/nodejs/corsa_node",
6
6
  "bugs": {
@@ -28,6 +28,13 @@
28
28
  "bun": "./dist/index.mjs",
29
29
  "import": "./dist/index.mjs",
30
30
  "default": "./dist/index.mjs"
31
+ },
32
+ "./orchestrator": {
33
+ "types": "./dist/orchestrator.d.mts",
34
+ "deno": "./dist/orchestrator.mjs",
35
+ "bun": "./dist/orchestrator.mjs",
36
+ "import": "./dist/orchestrator.mjs",
37
+ "default": "./dist/orchestrator.mjs"
31
38
  }
32
39
  },
33
40
  "publishConfig": {
@@ -51,13 +58,13 @@
51
58
  "node": ">=22"
52
59
  },
53
60
  "optionalDependencies": {
54
- "@corsa-bind/napi-win32-x64-msvc": "1.13.1",
55
- "@corsa-bind/napi-darwin-x64": "1.13.1",
56
- "@corsa-bind/napi-linux-x64-gnu": "1.13.1",
57
- "@corsa-bind/napi-darwin-arm64": "1.13.1",
58
- "@corsa-bind/napi-win32-arm64-msvc": "1.13.1",
59
- "@corsa-bind/napi-linux-x64-musl": "1.13.1",
60
- "@corsa-bind/napi-linux-arm64-gnu": "1.13.1",
61
- "@corsa-bind/napi-linux-arm64-musl": "1.13.1"
61
+ "@corsa-bind/napi-win32-x64-msvc": "1.14.0",
62
+ "@corsa-bind/napi-darwin-x64": "1.14.0",
63
+ "@corsa-bind/napi-linux-x64-gnu": "1.14.0",
64
+ "@corsa-bind/napi-darwin-arm64": "1.14.0",
65
+ "@corsa-bind/napi-win32-arm64-msvc": "1.14.0",
66
+ "@corsa-bind/napi-linux-x64-musl": "1.14.0",
67
+ "@corsa-bind/napi-linux-arm64-gnu": "1.14.0",
68
+ "@corsa-bind/napi-linux-arm64-musl": "1.14.0"
62
69
  }
63
70
  }