carrick 0.3.57 → 0.3.59

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.
Files changed (65) hide show
  1. package/README.md +117 -26
  2. package/bin/carrick.mjs +13 -2
  3. package/dist/auth/credentials.d.ts +14 -0
  4. package/dist/auth/credentials.js +86 -0
  5. package/dist/auth/credentials.js.map +1 -0
  6. package/dist/auth/oauth.d.ts +11 -0
  7. package/dist/auth/oauth.js +119 -0
  8. package/dist/auth/oauth.js.map +1 -0
  9. package/dist/auth/read.d.ts +139 -0
  10. package/dist/auth/read.js +44 -0
  11. package/dist/auth/read.js.map +1 -0
  12. package/dist/auth/run.d.ts +12 -0
  13. package/dist/auth/run.js +68 -0
  14. package/dist/auth/run.js.map +1 -0
  15. package/dist/contract.d.ts +10 -0
  16. package/dist/contract.js +3 -0
  17. package/dist/contract.js.map +1 -1
  18. package/dist/definition.d.ts +33 -0
  19. package/dist/definition.js +107 -0
  20. package/dist/definition.js.map +1 -0
  21. package/dist/diagnostics.d.ts +72 -3
  22. package/dist/diagnostics.js +275 -55
  23. package/dist/diagnostics.js.map +1 -1
  24. package/dist/hook/refresh.d.ts +32 -0
  25. package/dist/hook/refresh.js +138 -0
  26. package/dist/hook/refresh.js.map +1 -0
  27. package/dist/hook/session-start.js +13 -0
  28. package/dist/hook/session-start.js.map +1 -1
  29. package/dist/init/connect.d.ts +17 -0
  30. package/dist/init/connect.js +120 -0
  31. package/dist/init/connect.js.map +1 -0
  32. package/dist/init/mcp.d.ts +50 -0
  33. package/dist/init/mcp.js +235 -0
  34. package/dist/init/mcp.js.map +1 -0
  35. package/dist/init/projects.d.ts +46 -0
  36. package/dist/init/projects.js +137 -0
  37. package/dist/init/projects.js.map +1 -0
  38. package/dist/init/repos.d.ts +113 -19
  39. package/dist/init/repos.js +60 -39
  40. package/dist/init/repos.js.map +1 -1
  41. package/dist/init/run.d.ts +16 -0
  42. package/dist/init/run.js +243 -61
  43. package/dist/init/run.js.map +1 -1
  44. package/dist/init/settings.d.ts +1 -1
  45. package/dist/init/settings.js +1 -1
  46. package/dist/init/settings.js.map +1 -1
  47. package/dist/lens.d.ts +41 -0
  48. package/dist/lens.js +116 -0
  49. package/dist/lens.js.map +1 -0
  50. package/dist/server.js +327 -24
  51. package/dist/server.js.map +1 -1
  52. package/dist/surfaces.d.ts +28 -0
  53. package/dist/surfaces.js +70 -0
  54. package/dist/surfaces.js.map +1 -0
  55. package/package.json +6 -6
  56. package/sidecar/dist/src/capture/deno-project.d.ts +41 -0
  57. package/sidecar/dist/src/capture/deno-project.js +513 -0
  58. package/sidecar/dist/src/capture/index.d.ts +1 -0
  59. package/sidecar/dist/src/capture/index.js +60 -19
  60. package/sidecar/dist/src/capture/self-check.d.ts +2 -0
  61. package/sidecar/dist/src/capture/self-check.js +3 -2
  62. package/sidecar/dist/src/project-loader.js +22 -1
  63. package/dist/init/identity.d.ts +0 -20
  64. package/dist/init/identity.js +0 -60
  65. package/dist/init/identity.js.map +0 -1
package/dist/server.js CHANGED
@@ -23,17 +23,24 @@
23
23
  // sites go in both places (see diagnostics.ts).
24
24
  //
25
25
  // stdout is protocol only. Every log line goes to stderr.
26
+ import fs from "node:fs";
26
27
  import path from "node:path";
27
28
  import { fileURLToPath, pathToFileURL } from "node:url";
28
29
  import { check } from "./cli.js";
29
30
  import { resolveChannel } from "./channel.js";
31
+ import { definitionsAt, positionOf } from "./definition.js";
30
32
  import { toDiagnostics } from "./diagnostics.js";
33
+ import { toCodeLenses } from "./lens.js";
31
34
  import { createLogger } from "./log.js";
32
35
  import { resolveRoot, rootNote } from "./root.js";
36
+ import { boundaryFor } from "./render.js";
37
+ import { DEFAULT_SURFACES, readSurfaces } from "./surfaces.js";
33
38
  const NAME = "carrick";
34
39
  const VERSION = "0.0.1";
35
40
  /** Editors fire `didChange` on every keystroke; one check per pause is enough. */
36
41
  const DEBOUNCE_MS = 400;
42
+ /** How many files' check answers are kept. Enough for the ones in front of you. */
43
+ const CACHE_FILES = 64;
37
44
  const log = createLogger("carrick-lsp");
38
45
  function send(message) {
39
46
  const body = Buffer.from(JSON.stringify({ jsonrpc: "2.0", ...message }), "utf8");
@@ -45,9 +52,40 @@ let root = process.cwd();
45
52
  let rootChoice = null;
46
53
  let channel = resolveChannel({ hooksInstalled: false });
47
54
  let clientName = "an unnamed client";
48
- /** What each checked file last published to, so a clear is scoped to it. */
49
- const publishedBy = new Map();
55
+ /** Whether the client will re-request lenses when asked to (LSP 3.16). */
56
+ let clientRefreshesLenses = false;
57
+ /** One off switch per surface (carrick#879), as the client stated them. */
58
+ let surfaces = DEFAULT_SURFACES;
59
+ /**
60
+ * What each check pass contributed, per pass, per file it landed rows in
61
+ * (carrick#923).
62
+ *
63
+ * A check of one file publishes rows on that file AND on its counterparts, so
64
+ * two open files on either side of one contract are two passes with an opinion
65
+ * about the same URI, and neither is the whole answer: the producer's pass
66
+ * knows every route in the producer, the consumer's pass knows only the one
67
+ * route it calls. `publishDiagnostics` replaces per URI, so whichever pass ran
68
+ * last used to erase the other's rows. What is published for a URI is the merge
69
+ * of every pass that has an opinion about it, computed here, and a pass is
70
+ * replaced whole when it re-runs.
71
+ *
72
+ * Uncapped on purpose. Evicting a pass would clear rows on a file that is still
73
+ * open and still wrong, and an entry is a handful of diagnostics.
74
+ */
75
+ const contributions = new Map();
76
+ /** The last diagnostics sent per URI, so an unchanged merge is not re-sent. */
77
+ const published = new Map();
78
+ /** The text of every document the client has open, by absolute path. */
79
+ const openDocuments = new Map();
50
80
  const debounces = new Map();
81
+ /** Ids for the requests this server makes of the client. */
82
+ let nextServerId = 1;
83
+ /**
84
+ * The last check answer per absolute file, so a pull surface answers from what
85
+ * the push path already ran rather than running the CLI again. Dropped on every
86
+ * edit, because the payload's line numbers are about the text that was checked.
87
+ */
88
+ const lastCheck = new Map();
51
89
  /** One check at a time: a burst of edits must not interleave two runs. */
52
90
  let queue = Promise.resolve();
53
91
  function enqueue(work) {
@@ -63,28 +101,182 @@ function publish(uriPath, diagnostics) {
63
101
  params: { uri: pathToFileURL(uriPath).toString(), diagnostics },
64
102
  });
65
103
  }
104
+ /**
105
+ * One row's identity within a file: what it says and the line it says it on.
106
+ *
107
+ * Used only to drop a row a second pass would repeat. A finding that is a
108
+ * file's own is also mirrored onto that file by the counterpart's pass, at the
109
+ * same line and under the same code, and the two sentences differ only in the
110
+ * "producer in X of Y." the mirrored one leads with. The code and the line are
111
+ * what a reader would call the same row.
112
+ */
113
+ function rowKey(diagnostic) {
114
+ return `${diagnostic.code ?? ""}|${diagnostic.range.start.line}`;
115
+ }
116
+ /**
117
+ * Every pass's rows for one file, the file's own pass first.
118
+ *
119
+ * Own-pass rows go in unconditionally: two findings on one line are two rows
120
+ * and only the passes DISAGREE about a file, never a pass with itself. Another
121
+ * pass's mirrored row is added only when nothing already said the same thing
122
+ * there, which is what stops the same finding rendering twice.
123
+ */
124
+ function mergedFor(uriPath) {
125
+ const rows = [];
126
+ const seen = new Set();
127
+ const own = contributions.get(uriPath)?.get(uriPath);
128
+ if (own) {
129
+ rows.push(...own);
130
+ for (const row of own)
131
+ seen.add(rowKey(row));
132
+ }
133
+ for (const [checked, byFile] of contributions) {
134
+ if (checked === uriPath)
135
+ continue;
136
+ for (const row of byFile.get(uriPath) ?? []) {
137
+ const key = rowKey(row);
138
+ if (seen.has(key))
139
+ continue;
140
+ seen.add(key);
141
+ rows.push(row);
142
+ }
143
+ }
144
+ return rows;
145
+ }
146
+ /**
147
+ * Replace one pass's rows and re-publish every file the change can reach.
148
+ *
149
+ * That is the files this pass touched now plus the ones it touched before: a
150
+ * file it has dropped needs the merge without it, which is often empty and
151
+ * clears the file. A URI whose merged set is what the client already has is not
152
+ * sent again, so opening the second file of a pair is silent where its rows
153
+ * agree with the first pass's.
154
+ */
155
+ function republish(checkedAbs, byFile) {
156
+ const touched = new Set([
157
+ ...(contributions.get(checkedAbs)?.keys() ?? []),
158
+ ...byFile.keys(),
159
+ ]);
160
+ contributions.set(checkedAbs, byFile);
161
+ for (const file of touched) {
162
+ const rows = mergedFor(file);
163
+ const body = JSON.stringify(rows);
164
+ if (published.get(file) === body)
165
+ continue;
166
+ published.set(file, body);
167
+ publish(file, rows);
168
+ }
169
+ }
170
+ /**
171
+ * The text of one 1-based line, for the span a diagnostic underlines (#922).
172
+ *
173
+ * The open document first, because that is the text in front of the user and
174
+ * an editor with unsaved changes has no other source for it, and the file on
175
+ * disk second, because a finding is mirrored onto counterpart files nobody has
176
+ * opened. A client that sends an empty `text` on `didOpen` has told us nothing,
177
+ * so that reads as "not open" rather than as an empty file.
178
+ *
179
+ * Fresh per check: within one check the same file is read once, and between two
180
+ * checks the text may have moved.
181
+ */
182
+ function lineTextReader() {
183
+ const cache = new Map();
184
+ return (file, line) => {
185
+ const key = path.resolve(file);
186
+ if (!cache.has(key)) {
187
+ let text = openDocuments.get(key);
188
+ if (!text) {
189
+ try {
190
+ text = fs.readFileSync(key, "utf8");
191
+ }
192
+ catch {
193
+ text = undefined;
194
+ }
195
+ }
196
+ cache.set(key, text === undefined ? null : text.split(/\r?\n/));
197
+ }
198
+ const lines = cache.get(key);
199
+ if (!lines)
200
+ return null;
201
+ return lines[line - 1] ?? null;
202
+ };
203
+ }
204
+ /**
205
+ * The check answer for a file: the cached one, or one run now and cached.
206
+ *
207
+ * Every surface reads the file's answer through here, so a hover, a jump and a
208
+ * diagnostic on the same unchanged file cost one CLI call between them. A
209
+ * `check` reads `.carrick/` and never scans, but it does spawn a process, and
210
+ * an on-demand request is expected back in a fraction of a second.
211
+ */
212
+ async function resultFor(absFile) {
213
+ const key = path.resolve(absFile);
214
+ const cached = lastCheck.get(key);
215
+ if (cached)
216
+ return cached;
217
+ const outcome = await check(relative(absFile), { cwd: root });
218
+ if (!outcome.result) {
219
+ log("no answer for", relative(absFile), outcome.failure ?? "");
220
+ return null;
221
+ }
222
+ // A "no" is never cached. `not_indexed` is the answer that changes under the
223
+ // user's feet: they run `carrick index` in a terminal and the next request
224
+ // has to ask again rather than repeat what was true before they did.
225
+ if (outcome.result.error)
226
+ return outcome.result;
227
+ // An editor session opens files all day and this server runs as long as it
228
+ // does, so the oldest entry goes when the cache is full. A Map iterates in
229
+ // insertion order, which makes the first key the oldest.
230
+ if (lastCheck.size >= CACHE_FILES) {
231
+ const oldest = lastCheck.keys().next();
232
+ if (!oldest.done)
233
+ lastCheck.delete(oldest.value);
234
+ }
235
+ lastCheck.set(key, outcome.result);
236
+ return outcome.result;
237
+ }
66
238
  async function checkAndPublish(absFile) {
67
239
  const relFile = relative(absFile);
68
- const outcome = await check(relFile, { cwd: root });
69
- if (!outcome.result) {
70
- log("no answer for", relFile, outcome.failure ?? "");
240
+ const started = Date.now();
241
+ const result = await resultFor(absFile);
242
+ if (!result)
71
243
  return;
72
- }
73
- if (outcome.result.error) {
74
- log("check", relFile, "->", outcome.result.error);
244
+ if (result.error) {
245
+ log("check", relFile, "->", result.error);
75
246
  return;
76
247
  }
77
- const byFile = toDiagnostics(outcome.result, root, relFile);
78
- log(`check ${relFile} -> ${[...byFile.values()].reduce((n, list) => n + list.length, 0)} diagnostic(s) across ${byFile.size} file(s) in ${outcome.ms}ms`);
79
- // Clear only what THIS file's previous check flagged and no longer does: a
80
- // check of another file legitimately returns nothing while its findings stand.
81
- const previous = publishedBy.get(relFile) ?? new Set();
82
- for (const stale of previous)
83
- if (!byFile.has(stale))
84
- byFile.set(stale, []);
85
- publishedBy.set(relFile, new Set([...byFile.keys()].filter((file) => (byFile.get(file) ?? []).length > 0)));
86
- for (const [file, diagnostics] of byFile)
87
- publish(file, diagnostics);
248
+ const byFile = toDiagnostics(result, root, relFile, { surfaces, lineText: lineTextReader() });
249
+ log(`check ${relFile} -> ${[...byFile.values()].reduce((n, list) => n + list.length, 0)} diagnostic(s) across ${byFile.size} file(s) in ${Date.now() - started}ms`);
250
+ // This pass's whole opinion, replacing the one it had before. What a file
251
+ // ends up with is the merge of every pass that has an opinion about it, so a
252
+ // check that returns nothing for a file clears only its own rows there.
253
+ republish(path.resolve(absFile), byFile);
254
+ publishBoundary(result);
255
+ }
256
+ /**
257
+ * The boundary, for a client that has somewhere workspace-shaped to put it.
258
+ *
259
+ * carrick#879 moved it off the per-file Problems list for those clients, and
260
+ * this is where it moved TO: one notification per check carrying the same lines
261
+ * the diagnostic used to, which the VS Code extension renders as a status bar
262
+ * item and its tooltip. A client that declared no such surface gets the
263
+ * Information diagnostic instead and this notification as well, which costs it
264
+ * nothing: an unknown notification is ignored by definition.
265
+ */
266
+ function publishBoundary(result) {
267
+ if (!surfaces.boundary)
268
+ return;
269
+ const lines = boundaryFor(result);
270
+ if (!lines.length)
271
+ return;
272
+ send({
273
+ method: "carrick/boundary",
274
+ params: {
275
+ service: result.service ?? null,
276
+ indexCommit: result.index_commit ?? null,
277
+ lines,
278
+ },
279
+ });
88
280
  }
89
281
  function scheduleCheck(absFile, debounceMs) {
90
282
  const existing = debounces.get(absFile);
@@ -110,6 +302,29 @@ function pathOf(params) {
110
302
  return null;
111
303
  }
112
304
  }
305
+ /**
306
+ * The document's text as this notification states it, or null when it does not.
307
+ *
308
+ * `didOpen` carries the whole document. `didChange` carries whole documents too
309
+ * here, because the sync kind this server declares is Full, and an incremental
310
+ * change (one carrying a `range`) is ignored rather than applied to the wrong
311
+ * text. `didSave` carries none: `includeText` is false, and what is on disk is
312
+ * then the same text anyway.
313
+ */
314
+ function textOf(params) {
315
+ const document = params?.["textDocument"];
316
+ if (typeof document?.text === "string")
317
+ return document.text;
318
+ const changes = params?.["contentChanges"];
319
+ if (!Array.isArray(changes))
320
+ return null;
321
+ for (const change of [...changes].reverse()) {
322
+ const entry = change;
323
+ if (entry.range === undefined && typeof entry.text === "string")
324
+ return entry.text;
325
+ }
326
+ return null;
327
+ }
113
328
  // ------------------------------------------------------------------ protocol
114
329
  function onInitialize(id, params) {
115
330
  const folders = params["workspaceFolders"];
@@ -129,6 +344,9 @@ function onInitialize(id, params) {
129
344
  const info = params["clientInfo"];
130
345
  if (info?.name)
131
346
  clientName = info.name;
347
+ const capabilities = params["capabilities"];
348
+ clientRefreshesLenses = capabilities?.workspace?.codeLens?.refreshSupport === true;
349
+ surfaces = readSurfaces(params["initializationOptions"]);
132
350
  rootChoice = resolveRoot({
133
351
  clientRoot,
134
352
  projectDir: process.env["CLAUDE_PROJECT_DIR"] ?? null,
@@ -158,6 +376,14 @@ function onInitialize(id, params) {
158
376
  interFileDependencies: true,
159
377
  workspaceDiagnostics: false,
160
378
  },
379
+ // Declared whatever `carrick.codeLens` says, so a client that cached
380
+ // the capability still gets an answer when the switch is flipped: the
381
+ // answer is an empty list.
382
+ codeLensProvider: { resolveProvider: true },
383
+ // Declared whatever `carrick.definition` says, for the same reason:
384
+ // off means an empty answer, which is the fall-through every position
385
+ // outside a row already gets, and never a method the server refuses.
386
+ definitionProvider: true,
161
387
  },
162
388
  serverInfo: { name: NAME, version: VERSION },
163
389
  },
@@ -182,14 +408,85 @@ function handle(message) {
182
408
  case "textDocument/didOpen":
183
409
  case "textDocument/didSave":
184
410
  case "textDocument/didChange": {
185
- if (channel.channel !== "lsp")
186
- return;
187
411
  const file = pathOf(params);
188
412
  if (!file)
189
413
  return;
414
+ // The text the client has, kept for the span every row underlines: the
415
+ // buffer is what the user is looking at, and an unsaved one is on no disk.
416
+ const text = textOf(params);
417
+ if (text !== null)
418
+ openDocuments.set(path.resolve(file), text);
419
+ // The text moved, so the lines in the cached answer are about text that
420
+ // is gone. Dropped on every channel: in the hook channel nothing
421
+ // re-checks the file, and a jump off a stale line is the worst answer
422
+ // this surface can give.
423
+ lastCheck.delete(path.resolve(file));
424
+ if (channel.channel !== "lsp")
425
+ return;
190
426
  scheduleCheck(file, method === "textDocument/didChange" ? DEBOUNCE_MS : 0);
191
427
  return;
192
428
  }
429
+ case "textDocument/didClose": {
430
+ // The buffer is gone, so the file on disk is the text from here on. The
431
+ // rows stay: an editor keeps a closed file's diagnostics in the Problems
432
+ // list, and this server has not stopped believing them.
433
+ const file = pathOf(params);
434
+ if (file)
435
+ openDocuments.delete(path.resolve(file));
436
+ return;
437
+ }
438
+ case "workspace/didChangeConfiguration": {
439
+ // A switch turned off takes its rows away on the next publish, not at the
440
+ // next restart, so every file this server has flagged is re-checked here.
441
+ surfaces = readSurfaces(params, surfaces);
442
+ log(`surfaces: ${JSON.stringify(surfaces)}`);
443
+ for (const checked of contributions.keys())
444
+ scheduleCheck(checked, 0);
445
+ // A lens is pulled, not pushed, so `carrick.codeLens` off only clears the
446
+ // screen once the client asks again. It is asked to.
447
+ if (clientRefreshesLenses)
448
+ send({ id: `carrick-refresh-${nextServerId++}`, method: "workspace/codeLens/refresh", params: {} });
449
+ return;
450
+ }
451
+ case "textDocument/codeLens": {
452
+ // A REQUEST, not a push: it is answered in an install where the hook owns
453
+ // delivery, because the channel decides who speaks unasked and a lens is
454
+ // only ever rendered because a client asked for it.
455
+ const file = pathOf(params);
456
+ if (!file) {
457
+ send({ id, result: [] });
458
+ return;
459
+ }
460
+ void enqueue(async () => {
461
+ // The same cached answer every other surface reads (carrick#910): a
462
+ // lens and a jump on one unchanged file cost one CLI call between them.
463
+ const result = await resultFor(file);
464
+ send({ id, result: result ? toCodeLenses(result, { surfaces }) : [] });
465
+ });
466
+ return;
467
+ }
468
+ case "codeLens/resolve":
469
+ // Everything a lens carries comes from the one check the list was built
470
+ // from, so there is nothing left to fill in.
471
+ send({ id, result: params ?? null });
472
+ return;
473
+ case "textDocument/definition": {
474
+ // Not gated on which channel owns delivery: an install where the hook
475
+ // owns it publishes nothing, and a person in that editor still asks for
476
+ // a jump. `off` is the exception, because it is the blunt instrument
477
+ // that means Carrick says nothing at all.
478
+ const file = pathOf(params);
479
+ const position = positionOf(params);
480
+ if (!file || !position || !surfaces.definition || channel.channel === "off") {
481
+ send({ id, result: [] });
482
+ return;
483
+ }
484
+ void enqueue(async () => {
485
+ const result = await resultFor(file);
486
+ send({ id, result: result ? definitionsAt(result, position) : [] });
487
+ });
488
+ return;
489
+ }
193
490
  case "textDocument/diagnostic": {
194
491
  // A pull-only client still gets an answer, and the same one.
195
492
  const file = pathOf(params);
@@ -198,9 +495,15 @@ function handle(message) {
198
495
  return;
199
496
  }
200
497
  void enqueue(async () => {
201
- const outcome = await check(relative(file), { cwd: root });
202
- const items = outcome.result
203
- ? (toDiagnostics(outcome.result, root, relative(file)).get(path.resolve(file)) ?? [])
498
+ const result = await resultFor(file);
499
+ // This file's own pass and no other: a request answers what a check of
500
+ // this file says, and a pull must not rewrite what the push path has
501
+ // published to other files.
502
+ const items = result
503
+ ? (toDiagnostics(result, root, relative(file), {
504
+ surfaces,
505
+ lineText: lineTextReader(),
506
+ }).get(path.resolve(file)) ?? [])
204
507
  : [];
205
508
  send({ id, result: { kind: "full", items } });
206
509
  });
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,kEAAkE;AAClE,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,qEAAqE;AACrE,2DAA2D;AAC3D,EAAE;AACF,+EAA+E;AAC/E,qEAAqE;AACrE,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,mDAAmD;AACnD,gFAAgF;AAChF,gFAAgF;AAChF,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,+EAA+E;AAC/E,iDAAiD;AACjD,2EAA2E;AAC3E,kDAAkD;AAClD,EAAE;AACF,0DAA0D;AAE1D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,cAAc,EAAsB,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,aAAa,EAAmB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAC;AAEnE,MAAM,IAAI,GAAG,SAAS,CAAC;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AAC"}
@@ -0,0 +1,28 @@
1
+ export type Surfaces = {
2
+ /** Publish verdict diagnostics at all. */
3
+ diagnostics: boolean;
4
+ /**
5
+ * Answer `textDocument/definition` (carrick#881). Off means an empty answer
6
+ * rather than a withdrawn capability, so a client that cached the capability
7
+ * at initialize still behaves.
8
+ */
9
+ definition: boolean;
10
+ /** State the boundary. Where it lands depends on `boundarySurface`. */
11
+ boundary: boolean;
12
+ /** Render code lenses on the rows the index knows something about. */
13
+ codeLens: boolean;
14
+ /**
15
+ * The client shows the boundary somewhere that is not the Problems list, so
16
+ * the per-file Information diagnostic is not published to it. False for a
17
+ * client that says nothing, which keeps the fallback.
18
+ */
19
+ boundarySurface: boolean;
20
+ };
21
+ export declare const DEFAULT_SURFACES: Surfaces;
22
+ /**
23
+ * Read the switches a client states, over the ones already in force.
24
+ *
25
+ * A key the client omits keeps its current value: a notification that carries
26
+ * one setting must not silently reset the rest to their defaults.
27
+ */
28
+ export declare function readSurfaces(params: unknown, current?: Surfaces): Surfaces;
@@ -0,0 +1,70 @@
1
+ // One off switch per surface, in one place.
2
+ //
3
+ // Every surface this server offers can be turned off on its own, defaulting on,
4
+ // and turning one off leaves the others exactly as they were (design record
5
+ // 2026-09-09, "Off switches, one per thing"). `CARRICK_CHANNEL=off` stays the
6
+ // blunt instrument that silences delivery entirely.
7
+ //
8
+ // A client states them twice over: once in `initializationOptions` at startup,
9
+ // and again in `workspace/didChangeConfiguration` when a person changes a
10
+ // setting mid-session, which is why one parser reads both shapes. VS Code sends
11
+ // `{ settings: { carrick: { ... } } }` for the notification; a generic client
12
+ // that only has `initializationOptions` sends the flat object. Either is
13
+ // accepted, and anything that is not a boolean leaves the default alone rather
14
+ // than reading as false.
15
+ //
16
+ // `boundarySurface` is not an off switch and not a preference: it is the client
17
+ // saying it has somewhere else to put the boundary, which the VS Code extension
18
+ // does because it owns a status bar item. It decides placement, never whether
19
+ // the boundary is stated at all. See diagnostics.ts for what it changes.
20
+ export const DEFAULT_SURFACES = {
21
+ diagnostics: true,
22
+ definition: true,
23
+ boundary: true,
24
+ codeLens: true,
25
+ boundarySurface: false,
26
+ };
27
+ function isRecord(value) {
28
+ return typeof value === "object" && value !== null && !Array.isArray(value);
29
+ }
30
+ /**
31
+ * The `carrick` block of whatever a client sent, flat or nested.
32
+ *
33
+ * `initializationOptions` is already the block. A
34
+ * `workspace/didChangeConfiguration` payload wraps it in `settings.carrick`,
35
+ * and some clients send `settings` alone with the section stripped.
36
+ */
37
+ function block(params) {
38
+ if (!isRecord(params))
39
+ return {};
40
+ const settings = params["settings"];
41
+ if (isRecord(settings)) {
42
+ const scoped = settings["carrick"];
43
+ return isRecord(scoped) ? scoped : settings;
44
+ }
45
+ const scoped = params["carrick"];
46
+ if (isRecord(scoped))
47
+ return scoped;
48
+ return params;
49
+ }
50
+ /**
51
+ * Read the switches a client states, over the ones already in force.
52
+ *
53
+ * A key the client omits keeps its current value: a notification that carries
54
+ * one setting must not silently reset the rest to their defaults.
55
+ */
56
+ export function readSurfaces(params, current = DEFAULT_SURFACES) {
57
+ const stated = block(params);
58
+ const read = (key) => {
59
+ const value = stated[key];
60
+ return typeof value === "boolean" ? value : current[key];
61
+ };
62
+ return {
63
+ diagnostics: read("diagnostics"),
64
+ definition: read("definition"),
65
+ boundary: read("boundary"),
66
+ codeLens: read("codeLens"),
67
+ boundarySurface: read("boundarySurface"),
68
+ };
69
+ }
70
+ //# sourceMappingURL=surfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaces.js","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,8EAA8E;AAC9E,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,0EAA0E;AAC1E,gFAAgF;AAChF,8EAA8E;AAC9E,yEAAyE;AACzE,+EAA+E;AAC/E,yBAAyB;AACzB,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8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,CAAC,CAAC;IACF,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;QAChC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;QAC9B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;QAC1B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;QAC1B,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAAC;KACzC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carrick",
3
- "version": "0.3.57",
3
+ "version": "0.3.59",
4
4
  "description": "The API contract index for a TypeScript workspace: what the other services do with the routes and calls in the file you are editing, in your editor and in your agent's context",
5
5
  "keywords": [
6
6
  "typescript",
@@ -55,11 +55,11 @@
55
55
  "zod": "^3.23.0"
56
56
  },
57
57
  "optionalDependencies": {
58
- "@carrick-tools/cli-darwin-arm64": "0.3.57",
59
- "@carrick-tools/cli-darwin-x64": "0.3.57",
60
- "@carrick-tools/cli-linux-arm64": "0.3.57",
61
- "@carrick-tools/cli-linux-x64": "0.3.57",
62
- "@carrick-tools/cli-win32-x64": "0.3.57"
58
+ "@carrick-tools/cli-darwin-arm64": "0.3.59",
59
+ "@carrick-tools/cli-darwin-x64": "0.3.59",
60
+ "@carrick-tools/cli-linux-arm64": "0.3.59",
61
+ "@carrick-tools/cli-linux-x64": "0.3.59",
62
+ "@carrick-tools/cli-win32-x64": "0.3.59"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@types/node": "^24.13.3",
@@ -0,0 +1,41 @@
1
+ /** Deno owns module resolution; both compiler frontends consume its graph. */
2
+ import ts from 'typescript';
3
+ export interface DenoConfig {
4
+ configPath: string;
5
+ workspaceRoot: string;
6
+ compilerOptions: Record<string, unknown>;
7
+ exclude: string[];
8
+ }
9
+ /** Explicit TS configs keep their existing behaviour, including mixed repos. */
10
+ export declare function findDenoConfig(repoRoot: string, explicit?: string): DenoConfig | undefined;
11
+ /** One request's immutable graph, shared by analysis, emit and relocation. */
12
+ export declare class DenoProject {
13
+ readonly config: DenoConfig;
14
+ readonly repoRoot: string;
15
+ readonly cacheDir: string;
16
+ readonly parsed: ts.ParsedCommandLine;
17
+ readonly globals: string[];
18
+ readonly diagnostics: string[];
19
+ readonly pinned: Record<string, string>;
20
+ private readonly modules;
21
+ private readonly localPaths;
22
+ private readonly edges;
23
+ private readonly redirects;
24
+ private readonly npmPackages;
25
+ private readonly externalNames;
26
+ constructor(config: DenoConfig, repoRoot: string);
27
+ private targetPath;
28
+ resolve(spec: string, from: string, options: ts.CompilerOptions, host?: ts.ModuleResolutionHost): ts.ResolvedModule | undefined;
29
+ private npmOwner;
30
+ private isNpmFile;
31
+ /** Let TypeScript interpret real package exports/types using Deno's exact
32
+ * dependency graph. Only the resolution host sees virtual node_modules;
33
+ * every returned source path points at the existing Deno cache. */
34
+ private resolveNpm;
35
+ host(options: ts.CompilerOptions): ts.CompilerHost;
36
+ resolveTypeReference(spec: string, from: string, options: ts.CompilerOptions, host?: ts.ModuleResolutionHost): ts.ResolvedTypeReferenceDirective | undefined;
37
+ /** Turn a Deno npm alias into its real package export, with the exact pin. */
38
+ private externalName;
39
+ /** Relocate Deno's per-file resolutions into the portable declaration tree. */
40
+ rewrite(typesDir: string, files: string[], sourceByEmitted: Map<string, string>): number;
41
+ }