@remnic/coding-graph 9.6.37 → 9.6.39

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MAX_TRAVERSE_PATHS_HOPS
3
- } from "./chunk-ABDBWCXU.js";
3
+ } from "./chunk-I56SG643.js";
4
4
 
5
5
  // src/cypher/query-parser.ts
6
6
  var CYPHER_LABEL_TO_DB_LABEL = {
@@ -1039,4 +1039,4 @@ export {
1039
1039
  executeAst,
1040
1040
  executeCypher
1041
1041
  };
1042
- //# sourceMappingURL=chunk-I4R6GAAA.js.map
1042
+ //# sourceMappingURL=chunk-WOPWVODJ.js.map
@@ -4,8 +4,8 @@ import {
4
4
  executeAst,
5
5
  executeCypher,
6
6
  parseCypher
7
- } from "../chunk-I4R6GAAA.js";
8
- import "../chunk-ABDBWCXU.js";
7
+ } from "../chunk-WOPWVODJ.js";
8
+ import "../chunk-I56SG643.js";
9
9
  import "../chunk-ZVCMIM4T.js";
10
10
  export {
11
11
  CYPHER_LABEL_TO_DB_LABEL,
@@ -866,6 +866,36 @@ declare class GraphStore {
866
866
  * `exports` and `routes` arrays feed.
867
867
  */
868
868
  deadCode(): DeadCodeResult;
869
+ /**
870
+ * Find the innermost node whose span contains a byte offset in a file
871
+ * (issue #1917). Used by the LSP resolution pass's NodeLocator to map
872
+ * definition locations back to indexed nodes. Returns the node's
873
+ * qualified name, or null when no node contains the offset.
874
+ */
875
+ findNodeBySpan(filePath: string, byteOffset: number): string | null;
876
+ /**
877
+ * Callee NAMES already linked from a caller symbol via CALLS edges of a
878
+ * given provenance (issue #1917 wiring). The LSP pass uses this to skip
879
+ * call sites Phase A (provenance "heuristic") already resolved WITHOUT
880
+ * also skipping sites whose only edge is a prior "lsp" edge — those must
881
+ * be re-asserted each run or reconciliation would retire them.
882
+ */
883
+ resolvedCalleeNames(srcQualifiedName: string, provenance: string, filePath?: string): string[];
884
+ /**
885
+ * Current CALLS edges of a given provenance owned by a caller symbol in
886
+ * a file (#1923 review threads). The LSP pass uses this two ways:
887
+ * provenance "lsp" lists a filtered caller's existing lsp edges, and
888
+ * provenance "heuristic" lists its current Phase-A resolutions — an lsp
889
+ * edge is preserved at reconcile time only when it duplicates a current
890
+ * heuristic resolution (same dst), so removed member calls' edges retire
891
+ * while a filtered bare call's covering edge survives.
892
+ */
893
+ callEdgesForCaller(srcQualifiedName: string, filePath: string, provenance: string): Array<{
894
+ srcQualifiedName: string;
895
+ dstQualifiedName: string;
896
+ dstName: string;
897
+ type: string;
898
+ }>;
869
899
  /**
870
900
  * Read a symbol's source span from disk. The store NEVER persists
871
901
  * file contents (privacy + DB size — issue #1552 design); this
@@ -4,7 +4,7 @@ import {
4
4
  GraphStore,
5
5
  MAX_TRAVERSE_PATHS_HOPS,
6
6
  nodeIdFor
7
- } from "./chunk-ABDBWCXU.js";
7
+ } from "./chunk-I56SG643.js";
8
8
  import "./chunk-ZVCMIM4T.js";
9
9
  export {
10
10
  DEAD_CODE_EXCLUSION,
package/dist/index.d.ts CHANGED
@@ -1183,6 +1183,15 @@ declare function planLspUpgrades(callSites: readonly UnresolvedCallSite[], budge
1183
1183
  interface ResolveOptions {
1184
1184
  readonly client: LspClient;
1185
1185
  readonly nodeLocator: NodeLocator;
1186
+ /**
1187
+ * Warm-up retry delay in ms (issue #1933). Language servers (tsserver
1188
+ * in particular) load projects ASYNCHRONOUSLY after `didOpen`; a
1189
+ * definition request that arrives too early returns an EMPTY location
1190
+ * array — indistinguishable from "definitely no definition". Until the
1191
+ * server has proven warm (any non-empty response), an empty result is
1192
+ * retried ONCE after this delay. Default 2500. Set 0 to disable.
1193
+ */
1194
+ readonly warmupRetryDelayMs?: number;
1186
1195
  /**
1187
1196
  * Apply a batch of edge upgrades atomically. Called once per file batch.
1188
1197
  * MUST be transactional — if it throws, zero upgrades from this batch
package/dist/index.js CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  executeAst,
4
4
  executeCypher,
5
5
  parseCypher
6
- } from "./chunk-I4R6GAAA.js";
6
+ } from "./chunk-WOPWVODJ.js";
7
7
  import {
8
8
  DEAD_CODE_EXCLUSION,
9
9
  DEFAULT_TRAVERSE_PATHS_MAX,
10
10
  GraphStore,
11
11
  MAX_TRAVERSE_PATHS_HOPS,
12
12
  nodeIdFor
13
- } from "./chunk-ABDBWCXU.js";
13
+ } from "./chunk-I56SG643.js";
14
14
  import {
15
15
  CODING_GRAPH_SCHEMA_VERSION,
16
16
  EDGE_PROVENANCE_VALUES,
@@ -2944,6 +2944,8 @@ async function executeLspResolution(requests, options) {
2944
2944
  let upgraded = 0;
2945
2945
  let unresolved = 0;
2946
2946
  let degradation;
2947
+ let serverWarm = false;
2948
+ const warmupRetryDelayMs = options.warmupRetryDelayMs ?? 2500;
2947
2949
  for (const [filePath, batchReqs] of byFile) {
2948
2950
  const upgrades = [];
2949
2951
  let batchFailed = false;
@@ -2961,10 +2963,22 @@ async function executeLspResolution(requests, options) {
2961
2963
  unresolved += batchReqs.length - i;
2962
2964
  break;
2963
2965
  }
2964
- const defResult = await client.definition({
2966
+ let defResult = await client.definition({
2965
2967
  textDocument: { uri: filePathToUri(req.filePath, options.workspaceRoot) },
2966
2968
  position: req.position
2967
2969
  });
2970
+ if (defResult.ok && defResult.locations.length === 0 && !serverWarm && warmupRetryDelayMs > 0) {
2971
+ await new Promise((resolve) => setTimeout(resolve, warmupRetryDelayMs));
2972
+ serverWarm = true;
2973
+ const retryResult = await client.definition({
2974
+ textDocument: { uri: filePathToUri(req.filePath, options.workspaceRoot) },
2975
+ position: req.position
2976
+ });
2977
+ defResult = retryResult;
2978
+ }
2979
+ if (defResult.ok && defResult.locations.length > 0) {
2980
+ serverWarm = true;
2981
+ }
2968
2982
  if (!defResult.ok) {
2969
2983
  if (defResult.degradation.code === "server_crashed" || defResult.degradation.code === "protocol_error") {
2970
2984
  degradation = defResult.degradation;