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/init/run.js CHANGED
@@ -1,27 +1,40 @@
1
- // `carrick init`: the one command, run in the folder that holds the repos.
2
- //
3
- // It does the four things that are otherwise four installs — the repo list,
4
- // the first index, the agent hooks, and the editor line — and prints the two
5
- // it cannot do for you. Everything it writes is a file you can read and edit
6
- // afterwards; nothing here is state only Carrick understands.
7
- //
8
- // Re-running it updates rather than duplicates: the repo list keeps the order
9
- // and the hand-written entries it already had, and the hook entries are merged
10
- // by command rather than replacing the settings file's `hooks` key.
1
+ // Authenticated setup; Rust owns the workspace and service proposal.
11
2
  import fs from "node:fs";
12
3
  import path from "node:path";
13
4
  import readline from "node:readline/promises";
14
5
  import { spawnSync } from "node:child_process";
15
- import { describeIdentity, githubIdentity } from "./identity.js";
16
- import { findRepos, mergeWorkspace } from "./repos.js";
6
+ import { readCredential } from "../auth/credentials.js";
7
+ import { signIn } from "../auth/run.js";
8
+ import { resolveRepos } from "../auth/read.js";
9
+ import { deriveWorkspace, writeConfigs, githubRemote } from "./repos.js";
10
+ import { connectRepos, reposAreInProject } from "./connect.js";
11
+ import { listProjects, createProject, projectLines } from "./projects.js";
12
+ import { connectMcpClients, mcpLines } from "./mcp.js";
17
13
  import { hookCommand, mergeCarrickHooks } from "./settings.js";
18
14
  import { renderTemplate } from "../templates.js";
19
15
  import { resolveNativeBinary, nativeEnv, packageRoot } from "../native.js";
20
- const WORKSPACE_FILE = "carrick-workspace.json";
21
- const SETTINGS_FILE = path.join(".claude", "settings.json");
22
- const MCP_LINE = "claude mcp add --scope user --transport http carrick https://api.carrick.tools/mcp";
16
+ const EXTENSION_ID = "carrick-tools.carrick";
17
+ /**
18
+ * The prompt that makes an agent write this repo's setup files.
19
+ *
20
+ * A copy, and deliberately a verbatim one: the source of truth is
21
+ * `AGENT_SCAFFOLD_PROMPT` in the dashboard (carrick-cloud
22
+ * `app/src/lib/onboarding.ts`), whose own test checks every filename in it
23
+ * against what the `scaffold` MCP tool actually returns. It is printed here so
24
+ * the terminal path ends where the dashboard path ends — with the one prompt
25
+ * that turns a signed-in workspace into a repo that scans itself in CI
26
+ * (carrick#955). Keep the two in step; the tool's instructions, not this text,
27
+ * decide what gets written.
28
+ */
29
+ const AGENT_SCAFFOLD_PROMPT = "Run the carrick scaffold tool, passing this repo's owner/repo from " +
30
+ "`git remote get-url origin` as `repo`, and follow the instructions it " +
31
+ "returns: create each file at its path, populate carrick.json by scanning " +
32
+ "this repo for its service(s) and the env vars / domains they call (use a " +
33
+ "nested services config if it's a monorepo), and add the Carrick section " +
34
+ "to AGENTS.md if this repo already has one. Answer the closing checklist " +
35
+ "before you open the PR.";
23
36
  export function parseArgs(argv, cwd = process.cwd()) {
24
- const options = { workspace: cwd, assumeYes: false, skipIndex: false };
37
+ const options = { workspace: cwd, project: null, assumeYes: false, skipIndex: false };
25
38
  for (let index = 0; index < argv.length; index += 1) {
26
39
  const argument = argv[index];
27
40
  switch (argument) {
@@ -32,6 +45,17 @@ export function parseArgs(argv, cwd = process.cwd()) {
32
45
  case "--skip-index":
33
46
  options.skipIndex = true;
34
47
  break;
48
+ case "--project": {
49
+ const value = argv[index + 1];
50
+ if (!value)
51
+ return "--project needs a slug";
52
+ if (!/^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,31}$/.test(value)) {
53
+ return `invalid project slug "${value}": use 3-32 lowercase letters, digits, and single hyphens`;
54
+ }
55
+ options.project = value;
56
+ index += 1;
57
+ break;
58
+ }
35
59
  case "--workspace":
36
60
  case "-w": {
37
61
  const value = argv[index + 1];
@@ -54,12 +78,17 @@ export function parseArgs(argv, cwd = process.cwd()) {
54
78
  }
55
79
  function help() {
56
80
  return [
57
- "carrick init [DIRECTORY]",
81
+ "carrick init [DIRECTORY] [--project SLUG]",
58
82
  "",
59
- "Set up the folder that holds your repos: the list to index, the first index,",
60
- "and the wiring that puts its answers where you work.",
83
+ "Sign in (here, or beforehand with carrick login), then configure services,",
84
+ "hooks, the MCP connection and the first index in a repository or a folder",
85
+ "of repos.",
86
+ "With --project, a project missing from the workspace is offered for",
87
+ "creation here; the browser assigns the repos and the CLI waits for Carrick",
88
+ "to verify the assignment.",
61
89
  "",
62
90
  " -w, --workspace DIR The folder holding the repos (default: this one)",
91
+ " --project SLUG Require these repos in this Carrick project",
63
92
  " -y, --yes Take the repo list as proposed",
64
93
  " --skip-index Write the files and print the lines, index later",
65
94
  ].join("\n");
@@ -92,6 +121,70 @@ function onPath(command) {
92
121
  });
93
122
  return probe.status === 0;
94
123
  }
124
+ /**
125
+ * The editor lines, one line per editor that is on the machine.
126
+ *
127
+ * `--install-extension <id>` resolves the id against that editor's own gallery,
128
+ * and the three editors below read three different ones: VS Code the VS Code
129
+ * Marketplace, Cursor and Windsurf each their own. The extension is published
130
+ * to all three, so the id is a command every one of them can run
131
+ * (carrick#915). Any other editor gets the server's command and no claim about
132
+ * the editor: the per-editor results table in `plugin/TEST-PLAN.md` section 6
133
+ * is still empty.
134
+ *
135
+ * `onPath` is injected so a test can state each machine.
136
+ */
137
+ export function editorLines(onPath) {
138
+ const lines = [];
139
+ for (const [command, editor] of [
140
+ ["code", "VS Code"],
141
+ ["cursor", "Cursor"],
142
+ ["windsurf", "Windsurf"],
143
+ ]) {
144
+ if (!onPath(command))
145
+ continue;
146
+ lines.push(` ${editor}, for diagnostics in the Problems panel:`);
147
+ lines.push(` ${command} --install-extension ${EXTENSION_ID}`);
148
+ }
149
+ if (lines.length === 0) {
150
+ lines.push(" Any editor with an LSP client starts the server itself as `carrick lsp --stdio`.");
151
+ }
152
+ return lines;
153
+ }
154
+ /**
155
+ * Make sure the named project exists, from the terminal where that is possible.
156
+ *
157
+ * Returns whether this run can state that the project exists. `false` is the
158
+ * honest answer for every case it could not settle — an API without the
159
+ * actions, a declined offer, a refused create — and the caller then prints
160
+ * today's browser instructions, which include creating it.
161
+ */
162
+ async function ensureProject(token, slug, options) {
163
+ const { say } = options;
164
+ const projects = await listProjects(token);
165
+ if (projects === null)
166
+ return false;
167
+ if (projects.some((project) => project.slug === slug && !project.archived)) {
168
+ say(`Project "${slug}" is in this workspace.`);
169
+ return true;
170
+ }
171
+ say(projects.length === 0
172
+ ? "This workspace has no projects yet."
173
+ : "Projects in this workspace:");
174
+ for (const line of projectLines(projects))
175
+ say(line);
176
+ const create = options.assumeYes || (options.interactive && (await confirm(`Create project "${slug}"?`)));
177
+ if (!create)
178
+ return false;
179
+ const outcome = await createProject(token, slug);
180
+ if (outcome.kind === "created") {
181
+ say(`Created project "${slug}".`);
182
+ return true;
183
+ }
184
+ if (outcome.kind === "refused")
185
+ say(`Carrick did not create "${slug}": ${outcome.message}`);
186
+ return false;
187
+ }
95
188
  export async function init(argv) {
96
189
  const parsed = parseArgs(argv);
97
190
  if (typeof parsed === "string") {
@@ -103,48 +196,127 @@ export async function init(argv) {
103
196
  process.stderr.write(`carrick init: ${workspace} is not a directory on this machine\n`);
104
197
  return 1;
105
198
  }
106
- // 1. Who is asking. There is no anonymous tier: the local index draws on the
107
- // identified free tier's allowance, so this is the first question and not
108
- // a thing to discover halfway through a scan.
109
- const lookup = githubIdentity();
110
- if (!lookup.identity) {
111
- process.stderr.write(`${lookup.problem}\n`);
112
- return 1;
199
+ const interactive = process.stdin.isTTY === true;
200
+ // Authentication and all derivation validation precede local writes.
201
+ let plan;
202
+ try {
203
+ // A machine that has never signed in signs in here rather than being told
204
+ // to run another command: `carrick login` is the same browser round trip,
205
+ // and refusing to take it was the first thing a new install did
206
+ // (carrick#955). Without a terminal there is no browser to hand it to.
207
+ let credential = readCredential();
208
+ if (!credential) {
209
+ if (!interactive) {
210
+ throw new Error("carrick init requires a Carrick login. Run carrick login, or set CARRICK_TOKEN.");
211
+ }
212
+ say("This machine is not signed in to Carrick.");
213
+ credential = await signIn(say);
214
+ }
215
+ plan = deriveWorkspace(workspace);
216
+ const repoIdentities = plan.repos.map((repo) => ({ path: repo.path, name: githubRemote(repo.path) }));
217
+ const names = [...new Set(repoIdentities.map((repo) => repo.name).filter((name) => name !== null))];
218
+ if (names.length > 200)
219
+ throw new Error("This workspace has more than 200 GitHub repos. Initialise smaller workspace groups.");
220
+ const missingIdentities = repoIdentities.filter((repo) => repo.name === null);
221
+ if (parsed.project && missingIdentities.length > 0) {
222
+ throw new Error(`--project ${parsed.project} cannot verify ${missingIdentities.map((repo) => repo.path).join(", ")} because ${missingIdentities.length === 1 ? "it has" : "they have"} no GitHub origin. No project assignment was verified.`);
223
+ }
224
+ if (parsed.project && names.length === 0) {
225
+ throw new Error(`--project ${parsed.project} found no GitHub repos to verify.`);
226
+ }
227
+ if (parsed.project) {
228
+ say(`Repos requested for project "${parsed.project}":`);
229
+ for (const name of names)
230
+ say(` ${name}`);
231
+ }
232
+ const initial = await resolveRepos(credential.token, names);
233
+ // The project half of the browser round trip, where this API can do it
234
+ // from here. Assignment still belongs to the browser, so this only ever
235
+ // removes the "create the project" step from the wait.
236
+ const projectExists = parsed.project && !reposAreInProject(initial, names, parsed.project)
237
+ ? await ensureProject(credential.token, parsed.project, {
238
+ say,
239
+ interactive,
240
+ assumeYes: parsed.assumeYes,
241
+ })
242
+ : false;
243
+ const identity = await connectRepos(credential.token, names, initial, {
244
+ interactive,
245
+ project: parsed.project ?? undefined,
246
+ projectExists,
247
+ say,
248
+ });
249
+ if (parsed.project && !reposAreInProject(identity, names, parsed.project)) {
250
+ throw new Error(`Project "${parsed.project}" was not verified for every requested repo. Complete the browser steps and run carrick init --project ${parsed.project} again.`);
251
+ }
252
+ say(`Carrick workspace: ${identity.workspace.slug}`);
253
+ if (identity.allowance_sentence)
254
+ say(identity.allowance_sentence);
255
+ for (const repo of identity.repos) {
256
+ if (!repo.connected)
257
+ say(`${repo.full_name} is not connected to this Carrick workspace.`);
258
+ else if (repo.services.length === 0) {
259
+ say(`${repo.full_name} is connected and has no hosted index yet.`);
260
+ say(" Add the workflow in that repo:");
261
+ say(" mkdir -p .github/workflows");
262
+ say(" carrick templates workflow > .github/workflows/carrick.yml");
263
+ }
264
+ }
113
265
  }
114
- say(describeIdentity(lookup.identity));
115
- say();
116
- // 2. The repos, proposed and confirmed.
117
- const workspaceFile = path.join(workspace, WORKSPACE_FILE);
118
- const existing = fs.existsSync(workspaceFile) ? fs.readFileSync(workspaceFile, "utf8") : null;
119
- const found = findRepos(workspace);
120
- const merged = mergeWorkspace(existing, found);
121
- if (merged.repos.length === 0) {
122
- process.stderr.write(`carrick init: no repos in ${workspace}. Carrick indexes the directories beside each other, so run it in the folder that holds them, or pass one: carrick init ~/code\n`);
266
+ catch (error) {
267
+ process.stderr.write(`carrick init: ${error.message}\n`);
123
268
  return 1;
124
269
  }
125
- say(`Repos to index, in ${workspace}:`);
126
- for (const repo of merged.repos) {
127
- say(` ${repo}${merged.added.includes(repo) ? " (new)" : ""}`);
270
+ say(`Repos to index, in ${plan.workspace} (${plan.repos_detected_by}):`);
271
+ if (plan.parent_proposal) {
272
+ const parent = plan.parent_proposal;
273
+ say(`The parent folder ${parent.directory} holds ${parent.repos.length} repo(s): ${parent.repos.join(", ")}. Run carrick init .. to initialise that workspace.`);
128
274
  }
129
- say();
130
- if (!parsed.assumeYes && merged.added.length > 0) {
131
- const ok = await confirm("Index these?");
132
- if (!ok) {
133
- say(`Nothing written. Edit ${WORKSPACE_FILE} yourself and run carrick index.`);
134
- return 0;
275
+ for (const repo of plan.repos) {
276
+ say(` ${repo.path} (${repo.reason})`);
277
+ for (const service of repo.services) {
278
+ say(` ${service.serviceName ?? "<repository>"}: directory ${service.directory ?? "."}, tsconfig ${service.tsconfig ?? "scanner default"}`);
135
279
  }
280
+ for (const warning of repo.warnings)
281
+ say(` ${warning}`);
282
+ }
283
+ for (const missing of plan.missing)
284
+ say(`Missing workspace override: ${missing}`);
285
+ if (!parsed.assumeYes) {
286
+ if (!process.stdin.isTTY) {
287
+ process.stderr.write("carrick init: use --yes to accept this proposal without a terminal.\n");
288
+ return 1;
289
+ }
290
+ if (!await confirm("Create missing configs and configure hooks?"))
291
+ return 0;
292
+ }
293
+ try {
294
+ for (const result of writeConfigs(plan))
295
+ say(`${result.created ? "wrote" : "unchanged"} ${result.path}`);
296
+ // Revalidate any file that appeared between preview and exclusive create.
297
+ deriveWorkspace(workspace);
136
298
  }
137
- const wrote = writeIfChanged(workspaceFile, merged.body);
138
- say(`${wrote === "written" ? "wrote" : "unchanged"} ${WORKSPACE_FILE}`);
299
+ catch (error) {
300
+ process.stderr.write(`carrick init: ${error.message}\n`);
301
+ return 1;
302
+ }
303
+ say("Review carrick.json service boundaries and shared includes before committing it.");
139
304
  // 3. The agent hooks. Merged by command: this file may already hold a user's
140
305
  // own hooks, or the hook pack the hosted index installs.
141
- const settingsFile = path.join(workspace, SETTINGS_FILE);
142
- const settings = fs.existsSync(settingsFile) ? fs.readFileSync(settingsFile, "utf8") : null;
143
306
  const command = hookCommand({ onPath });
307
+ const settingsName = path.join(".claude", command.bare ? "settings.json" : "settings.local.json");
308
+ const settingsFile = path.join(workspace, settingsName);
144
309
  try {
310
+ const settings = fs.existsSync(settingsFile) ? fs.readFileSync(settingsFile, "utf8") : null;
311
+ const otherFile = path.join(workspace, ".claude", command.bare ? "settings.local.json" : "settings.json");
312
+ const other = fs.existsSync(otherFile) ? fs.readFileSync(otherFile, "utf8") : null;
313
+ const cleaned = other === null ? null : mergeCarrickHooks(other, null);
145
314
  const hooks = mergeCarrickHooks(settings, command.command);
315
+ // Validate both documents before migrating our entries between them.
316
+ if (cleaned?.changed)
317
+ writeIfChanged(otherFile, cleaned.body);
146
318
  const wroteHooks = writeIfChanged(settingsFile, hooks.body);
147
- say(`${wroteHooks === "written" ? "wrote" : "unchanged"} ${SETTINGS_FILE}`);
319
+ say(`${wroteHooks === "written" ? "wrote" : "unchanged"} ${settingsName}`);
148
320
  if (!command.bare) {
149
321
  say(` \`carrick\` is not on PATH here, so those hooks name this install: ${command.command}.`);
150
322
  say(" An npx run leaves nothing on PATH afterwards, and a hook that cannot find carrick");
@@ -153,7 +325,7 @@ export async function init(argv) {
153
325
  }
154
326
  }
155
327
  catch (error) {
156
- say(`skipped ${SETTINGS_FILE}: it is not valid JSON (${error.message}). Fix it and run carrick init again; nothing was overwritten.`);
328
+ say(`Could not configure Carrick hooks: ${error.message}. Fix the settings files and run carrick init again.`);
157
329
  }
158
330
  // 4. The index itself.
159
331
  if (parsed.skipIndex) {
@@ -176,22 +348,32 @@ export async function init(argv) {
176
348
  return scan.status ?? 1;
177
349
  }
178
350
  }
179
- // 5. The lines it cannot run for you.
351
+ // 5. The MCP connection, for work that crosses repos this machine does not
352
+ // hold. Configured here for every client this machine has, rather than
353
+ // printed for one of them (carrick#955).
354
+ say();
355
+ say("Next:");
180
356
  say();
181
- say("Next, and neither of these is done for you:");
357
+ for (const line of mcpLines(connectMcpClients()))
358
+ say(line);
182
359
  say();
183
- say(" The org index, for work that crosses repos you do not have on disk:");
184
- say(` ${MCP_LINE}`);
360
+ say(" The CI check, once per repo (it needs no secret). Paste this to your agent:");
185
361
  say();
186
- say(" The CI check, once per repo (it needs no secret):");
362
+ say(` ${AGENT_SCAFFOLD_PROMPT}`);
363
+ say();
364
+ say(" Or write the workflow yourself:");
365
+ say(" mkdir -p .github/workflows");
187
366
  say(" carrick templates workflow > .github/workflows/carrick.yml");
188
367
  say();
189
- if (onPath("code")) {
190
- say(" VS Code, for diagnostics in the Problems panel:");
191
- say(" code --install-extension carrick-tools.carrick");
192
- say();
193
- }
194
- say(`Start Claude Code in this folder — the hooks above are ${SETTINGS_FILE} here, and`);
368
+ say(" The first scan on the repo's default branch writes the hosted index. A session");
369
+ say(" started in this folder afterwards picks it up on its own; by hand it is:");
370
+ say(" carrick refresh");
371
+ say(" carrick status");
372
+ say();
373
+ for (const line of editorLines(onPath))
374
+ say(line);
375
+ say();
376
+ say(`Start Claude Code in this folder — the hooks above are ${settingsName} here, and`);
195
377
  say("the index covers every repo in it. The hooks need no plugin; the language server does:");
196
378
  const plugin = path.join(packageRoot(), "plugin");
197
379
  say(` claude --plugin-dir ${fs.existsSync(plugin) ? plugin : "<carrick checkout>/plugin"}`);
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/init/run.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,oEAAoE;AAEpE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mB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kF,CAAC,CAAC;IACxF,OAAO,CAAC,CAAC;AACX,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7B,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAClD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACzE,OAAO,CAAC,CAAC;QACX,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;IACnE,CAAC;IACD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,IAAa,EAAE,SAAS,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAuB,KAAe,CAAC,OAAO,IAAI,CAAC,CAAC;QACzE,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
@@ -47,4 +47,4 @@ export type MergeResult = {
47
47
  * Throws when the existing file is not JSON: a settings file a user has hand
48
48
  * edited into invalid JSON is a thing to report, never a thing to overwrite.
49
49
  */
50
- export declare function mergeCarrickHooks(existing: string | null, command?: string): MergeResult;
50
+ export declare function mergeCarrickHooks(existing: string | null, command?: string | null): MergeResult;
@@ -117,7 +117,7 @@ export function mergeCarrickHooks(existing, command = "carrick") {
117
117
  for (const [event, groups] of Object.entries(hooksBefore)) {
118
118
  hooks[event] = withoutOurs(groups);
119
119
  }
120
- for (const [event, groups] of Object.entries(carrickHooks(command))) {
120
+ for (const [event, groups] of Object.entries(command === null ? {} : carrickHooks(command))) {
121
121
  hooks[event] = [...(hooks[event] ?? []), ...groups];
122
122
  }
123
123
  // An event that only ever held our entry, and no longer does, leaves no
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/init/settings.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,0EAA0E;AAC1E,+EAA+E;AAC/E,4EAA4E;AAC5E,yCAAyC;AACzC,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF;AAChF,yCAAyC;AAEzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,WAAW,EAAE;IACxD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;AAC/C,CAAC;AASD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAG3B;IACC,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzE,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,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CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;IACvE,CAAC;IACD,wEAAwE;IACxE,qCAAqC;IACrC,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAChD,CAAC;IACD,IAAI,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC;QAAE,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IAElD,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;AAC9C,CAAC"}
package/dist/lens.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ import { type CheckResult } from "./contract.ts";
2
+ import { rangeAt } from "./diagnostics.ts";
3
+ import { type Surfaces } from "./surfaces.ts";
4
+ /** The command a client invokes when a lens is clicked. */
5
+ export declare const SHOW_COUNTERPARTS = "carrick.showCounterparts";
6
+ export type LensCommand = {
7
+ title: string;
8
+ command: string;
9
+ arguments?: unknown[];
10
+ };
11
+ export type CodeLens = {
12
+ range: ReturnType<typeof rangeAt>;
13
+ command?: LensCommand;
14
+ };
15
+ /** What the command is handed: enough to list the other side and open it. */
16
+ export type CounterpartList = {
17
+ /** The row's own operation, e.g. `GET /api/users/:id`. */
18
+ operation: string;
19
+ /** Absolute paths, already checked to exist, one per site. */
20
+ sites: Array<{
21
+ role: string;
22
+ service: string | null;
23
+ /** Absolute; null when the counterpart is not on this disk. */
24
+ path: string | null;
25
+ line: number | null;
26
+ }>;
27
+ /** The service's boundary lines, so an empty list reads correctly. */
28
+ boundary: string[];
29
+ };
30
+ export type LensOptions = {
31
+ /** Injectable for tests. */
32
+ exists?: (target: string) => boolean;
33
+ surfaces?: Surfaces;
34
+ };
35
+ /**
36
+ * One lens per row that the index knows something actionable about.
37
+ *
38
+ * Never one per line of a handler, never one for a row whose line the payload
39
+ * did not state, and never one that would have to say zero.
40
+ */
41
+ export declare function toCodeLenses(result: CheckResult, options?: LensOptions): CodeLens[];
package/dist/lens.js ADDED
@@ -0,0 +1,116 @@
1
+ // Code lenses: the one place a person sees what Carrick knows without asking.
2
+ //
3
+ // carrick#880, and the design record of 2026-09-09, candidate 1. Humans only:
4
+ // an agent cannot invoke a lens, so nothing here reaches the agent channel and
5
+ // the whole of it is judged as an editor surface.
6
+ //
7
+ // ZERO SUPPRESSION is the rule the rest of this file exists to keep. A laptop
8
+ // index holds facts only, so a route with no indexed consumer is the ordinary
9
+ // state and not a finding: a lens reading "0 consumers" would say "nobody calls
10
+ // this" where it means "not indexed here". So a lens is rendered only where the
11
+ // index holds at least one counterpart or one non-compatible verdict for that
12
+ // row, and the boundary answers the question of why the others are bare. The
13
+ // general form of the rule, from the same record: nothing states a number it
14
+ // cannot attribute.
15
+ //
16
+ // A candidate row produces no lens at all. Candidates are the model's reading
17
+ // and cannot reach a laptop index today; when they can, they are counted in a
18
+ // clause of their own and never inside the mismatch count, because the mismatch
19
+ // count is the number a person acts on.
20
+ //
21
+ // The lens command carries the boundary in its arguments rather than in a
22
+ // tooltip: `vscode-languageclient`'s `asCommand` copies title, command and
23
+ // arguments and drops everything else, so a tooltip set here would never reach
24
+ // a VS Code user. The extension shows those lines when the lens is clicked, and
25
+ // the status bar item from carrick#879 is where the boundary lives for a person
26
+ // the rest of the time.
27
+ import { isCandidate, } from "./contract.js";
28
+ import { boundaryFor } from "./render.js";
29
+ import { rangeAt, resolveCounterpart } from "./diagnostics.js";
30
+ import { DEFAULT_SURFACES } from "./surfaces.js";
31
+ /** The command a client invokes when a lens is clicked. */
32
+ export const SHOW_COUNTERPARTS = "carrick.showCounterparts";
33
+ /** A verdict that states a result other than `compatible`, on this one row. */
34
+ function isMismatch(item) {
35
+ const verdict = item.verdict;
36
+ return Boolean(verdict && verdict.result != null && verdict.result !== "compatible");
37
+ }
38
+ /**
39
+ * How many of the other side there are, in the word for what they are.
40
+ *
41
+ * One role gets its own noun; a mixed row gets the neutral one. Nothing here
42
+ * can render a zero: the caller has already decided there is something to say.
43
+ */
44
+ function counterpartClause(counterparts) {
45
+ const roles = new Set(counterparts.map((counterpart) => counterpart.role));
46
+ const count = counterparts.length;
47
+ const plural = count === 1 ? "" : "s";
48
+ if (roles.size === 1 && roles.has("consumer"))
49
+ return `${count} consumer${plural}`;
50
+ if (roles.size === 1 && roles.has("producer"))
51
+ return `${count} producer${plural}`;
52
+ if (roles.size === 1 && roles.has("peer"))
53
+ return `${count} service${plural} on the same contract`;
54
+ return `${count} counterpart${plural}`;
55
+ }
56
+ function operationOf(item) {
57
+ return [item.method, item.path].filter(Boolean).join(" ") || item.kind;
58
+ }
59
+ /**
60
+ * One lens per row that the index knows something actionable about.
61
+ *
62
+ * Never one per line of a handler, never one for a row whose line the payload
63
+ * did not state, and never one that would have to say zero.
64
+ */
65
+ export function toCodeLenses(result, options = {}) {
66
+ const surfaces = options.surfaces ?? DEFAULT_SURFACES;
67
+ if (!surfaces.codeLens)
68
+ return [];
69
+ if (result.error)
70
+ return [];
71
+ const exists = options.exists;
72
+ // `carrick.boundary` off takes the boundary off this surface too, or the
73
+ // switch would only half work.
74
+ const boundary = surfaces.boundary ? boundaryFor(result) : [];
75
+ const lenses = [];
76
+ for (const item of result.items ?? []) {
77
+ // A row the model alone states informs a pull surface and asserts nothing
78
+ // on a pushed one. A lens is rendered without being asked for, so no.
79
+ if (isCandidate(item))
80
+ continue;
81
+ if (typeof item.line !== "number")
82
+ continue;
83
+ const counterparts = item.counterparts ?? [];
84
+ const mismatch = isMismatch(item);
85
+ if (counterparts.length === 0 && !mismatch)
86
+ continue;
87
+ const clauses = [];
88
+ if (counterparts.length > 0)
89
+ clauses.push(counterpartClause(counterparts));
90
+ // One row carries one verdict, so the count is one or none. It is stated as
91
+ // a count anyway, because it is the number a person acts on and the clause
92
+ // has to stay countable when candidates gain one of their own.
93
+ if (mismatch)
94
+ clauses.push("1 mismatch");
95
+ const payload = {
96
+ operation: operationOf(item),
97
+ sites: counterparts.map((counterpart) => ({
98
+ role: counterpart.role,
99
+ service: counterpart.service ?? null,
100
+ path: resolveCounterpart(counterpart, exists),
101
+ line: counterpart.line ?? null,
102
+ })),
103
+ boundary,
104
+ };
105
+ lenses.push({
106
+ range: rangeAt(item.line, item.col),
107
+ command: {
108
+ title: clauses.join(", "),
109
+ command: SHOW_COUNTERPARTS,
110
+ arguments: [payload],
111
+ },
112
+ });
113
+ }
114
+ return lenses;
115
+ }
116
+ //# sourceMappingURL=lens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lens.js","sourceRoot":"","sources":["../src/lens.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,kDAAkD;AAClD,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,oBAAoB;AACpB,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF;AAChF,wBAAwB;AAExB,OAAO,E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