carrick 0.3.84 → 0.3.86
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 +15 -0
- package/bin/carrick.mjs +89 -0
- package/dist/auth/credentials.d.ts +9 -0
- package/dist/auth/credentials.js +13 -2
- package/dist/auth/credentials.js.map +1 -1
- package/dist/auth/read.d.ts +4 -4
- package/dist/global-install.d.ts +183 -0
- package/dist/global-install.js +393 -0
- package/dist/global-install.js.map +1 -0
- package/dist/hook/post-edit.js +10 -0
- package/dist/hook/post-edit.js.map +1 -1
- package/dist/hook/session-start.js +34 -0
- package/dist/hook/session-start.js.map +1 -1
- package/dist/hook/stop.js +18 -4
- package/dist/hook/stop.js.map +1 -1
- package/dist/hook/user-prompt.js +16 -4
- package/dist/hook/user-prompt.js.map +1 -1
- package/dist/init/doctor.d.ts +40 -0
- package/dist/init/doctor.js +125 -0
- package/dist/init/doctor.js.map +1 -1
- package/dist/init/outdated.d.ts +47 -0
- package/dist/init/outdated.js +104 -0
- package/dist/init/outdated.js.map +1 -1
- package/dist/init/projects.d.ts +2 -2
- package/dist/init/run.d.ts +9 -0
- package/dist/init/run.js +57 -12
- package/dist/init/run.js.map +1 -1
- package/dist/scan.d.ts +26 -0
- package/dist/scan.js +92 -0
- package/dist/scan.js.map +1 -1
- package/dist/update-check.d.ts +1 -0
- package/dist/update-check.js +25 -0
- package/dist/update-check.js.map +1 -0
- package/dist/update.d.ts +128 -0
- package/dist/update.js +398 -0
- package/dist/update.js.map +1 -0
- package/package.json +7 -7
- package/sidecar/dist/src/capture/anchors.js +69 -8
- package/sidecar/dist/src/capture/api.d.ts +4 -1
- package/sidecar/dist/src/capture/deep-walk.js +4 -1
- package/sidecar/dist/src/capture/node-builder.d.ts +28 -1
- package/sidecar/dist/src/capture/node-builder.js +89 -3
- package/sidecar/dist/src/capture/unresolved.d.ts +7 -0
- package/sidecar/dist/src/capture/unresolved.js +1 -1
- package/sidecar/dist/src/type-inferrer.d.ts +128 -5
- package/sidecar/dist/src/type-inferrer.js +444 -17
- package/templates/skills/carrick-census.md +3 -1
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
// Keeping the `carrick` a PATH lookup answers with level with the one this run
|
|
2
|
+
// is (carrick#1372).
|
|
3
|
+
//
|
|
4
|
+
// `npx carrick@latest` runs the published version out of a cache directory and
|
|
5
|
+
// changes nothing else on the machine. A global install from three releases ago
|
|
6
|
+
// stays exactly where it was, and it is the one that answers when an agent hook
|
|
7
|
+
// runs `carrick hook post-edit`, when a script types `carrick index`, and when a
|
|
8
|
+
// person opens a new shell. That is the "two versions on one machine in one
|
|
9
|
+
// morning" incident: the run a human watched was current and everything that
|
|
10
|
+
// ran afterwards was not.
|
|
11
|
+
//
|
|
12
|
+
// `src/update.ts` is the other half of this and does the opposite thing on
|
|
13
|
+
// purpose: it NOTIFIES, because it cannot know which of several possible
|
|
14
|
+
// installs a notice is about. This file only ever acts on an install that
|
|
15
|
+
// already exists, through the package manager that owns it, and never creates
|
|
16
|
+
// one without being told to. The four properties:
|
|
17
|
+
//
|
|
18
|
+
// 1. **Only an upgrade, only of what is there.** An older global is brought
|
|
19
|
+
// level with the running version. A global that is current, newer, or
|
|
20
|
+
// absent is left alone, and nothing is ever installed on a machine that has
|
|
21
|
+
// no global without a yes or `--install-global`.
|
|
22
|
+
// 2. **The owning manager, with its own configuration.** The command is the
|
|
23
|
+
// one for the shape the install is in (npm, pnpm, bun, volta). No flag of
|
|
24
|
+
// ours overrides a registry, a prefix or a release-age policy: a machine
|
|
25
|
+
// whose policy refuses this version is a machine that gets told, not one
|
|
26
|
+
// that gets overridden. A project `.npmrc` is not read in global mode
|
|
27
|
+
// (proved in `docs/reference/update-check.md`); a user-level one is, and
|
|
28
|
+
// its refusal is what the reader sees.
|
|
29
|
+
// 3. **It verifies.** After the install it resolves `carrick` again. A second
|
|
30
|
+
// install earlier on PATH, a version-manager shim, or an install that
|
|
31
|
+
// reported success and changed nothing all end with a line naming the path
|
|
32
|
+
// that is still stale and the command for it. The run never ends silently
|
|
33
|
+
// on an older binary.
|
|
34
|
+
// 4. **It never fails the command.** Every refusal, timeout and unreadable
|
|
35
|
+
// version prints and carries on. `CARRICK_NO_UPDATE_CHECK=1` turns it off
|
|
36
|
+
// along with the notice.
|
|
37
|
+
import fs from "node:fs";
|
|
38
|
+
import path from "node:path";
|
|
39
|
+
import { spawnSync } from "node:child_process";
|
|
40
|
+
import { packageRoot } from "./native.js";
|
|
41
|
+
import { currentVersion, inCi, installShape, isNewer, suppressed } from "./update.js";
|
|
42
|
+
/** The names a `carrick` on PATH goes by, most specific first. */
|
|
43
|
+
export function carrickNames(platform = process.platform) {
|
|
44
|
+
return platform === "win32" ? ["carrick.cmd", "carrick.exe", "carrick"] : ["carrick"];
|
|
45
|
+
}
|
|
46
|
+
function defaultExists(target) {
|
|
47
|
+
try {
|
|
48
|
+
return fs.existsSync(target);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function defaultReal(target) {
|
|
55
|
+
try {
|
|
56
|
+
return fs.realpathSync(target);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return target;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function slashed(value) {
|
|
63
|
+
return `/${value.split(path.sep).join("/")}/`;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A PATH entry that only exists while something is running, not a global.
|
|
67
|
+
*
|
|
68
|
+
* Two of them, and both are a `node_modules/.bin` directory: npx resolves a
|
|
69
|
+
* package into `_npx/<hash>/node_modules` and puts its `.bin` first, and
|
|
70
|
+
* `npm run` puts the repository's own `node_modules/.bin` there. No global bin
|
|
71
|
+
* directory is one — npm's is `<prefix>/bin`, and pnpm's, bun's and volta's are
|
|
72
|
+
* their own — so the shape of the directory is the whole test, and it holds
|
|
73
|
+
* however the package inside it is arranged.
|
|
74
|
+
*
|
|
75
|
+
* Deliberately NOT "the package this code is running from". A global install
|
|
76
|
+
* running `carrick doctor` IS the `carrick` on PATH, and skipping it would
|
|
77
|
+
* report the healthiest install shape there is as having nothing on PATH.
|
|
78
|
+
*/
|
|
79
|
+
function transientBin(directory, binary, resolved) {
|
|
80
|
+
if (slashed(directory).endsWith("/node_modules/.bin/"))
|
|
81
|
+
return true;
|
|
82
|
+
return slashed(binary).includes("/_npx/") || slashed(resolved).includes("/_npx/");
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The `carrick` a PATH lookup finds, skipping what only exists during a run.
|
|
86
|
+
*
|
|
87
|
+
* `which carrick` cannot answer this question. npm puts the exec tree's own
|
|
88
|
+
* `node_modules/.bin` at the front of PATH for the child it runs, so inside
|
|
89
|
+
* `npx carrick init` a `which` says `carrick` is on PATH on a machine where it
|
|
90
|
+
* is not — and `carrick init` then wrote a bare `carrick hook post-edit` into a
|
|
91
|
+
* settings file, naming a command that stopped existing when npx exited.
|
|
92
|
+
*
|
|
93
|
+
* File reads only: no `which`, no subprocess, so it costs nothing on a command
|
|
94
|
+
* that runs on every edit.
|
|
95
|
+
*/
|
|
96
|
+
export function findCarrick(options = {}) {
|
|
97
|
+
const env = options.env ?? process.env;
|
|
98
|
+
const exists = options.exists ?? defaultExists;
|
|
99
|
+
const real = options.real ?? defaultReal;
|
|
100
|
+
const raw = env["PATH"] ?? env["Path"] ?? "";
|
|
101
|
+
for (const directory of raw.split(path.delimiter)) {
|
|
102
|
+
if (directory === "")
|
|
103
|
+
continue;
|
|
104
|
+
for (const name of carrickNames(options.platform)) {
|
|
105
|
+
const binary = path.join(directory, name);
|
|
106
|
+
if (!exists(binary))
|
|
107
|
+
continue;
|
|
108
|
+
const resolved = real(binary);
|
|
109
|
+
if (transientBin(directory, binary, resolved))
|
|
110
|
+
continue;
|
|
111
|
+
return { binary, real: resolved, version: null };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
/** How far up from a binary a `package.json` of ours can be. */
|
|
117
|
+
const MANIFEST_DEPTH = 5;
|
|
118
|
+
/**
|
|
119
|
+
* The version of the install a binary belongs to.
|
|
120
|
+
*
|
|
121
|
+
* Read off the manifest above it wherever the path says — an npm global bin
|
|
122
|
+
* entry links straight into `lib/node_modules/carrick/bin`, so the answer is a
|
|
123
|
+
* file read. A shim that is a real file (volta, a `.cmd` on Windows) leads
|
|
124
|
+
* nowhere, and only then is the binary asked, with the version check turned off
|
|
125
|
+
* in the child so an older build does not fork a registry fetch from our probe.
|
|
126
|
+
*/
|
|
127
|
+
export function installedVersion(found, options = {}) {
|
|
128
|
+
const read = options.read ?? ((target) => fs.readFileSync(target, "utf8"));
|
|
129
|
+
let directory = path.dirname(found.real);
|
|
130
|
+
for (let step = 0; step < MANIFEST_DEPTH; step += 1) {
|
|
131
|
+
try {
|
|
132
|
+
const manifest = JSON.parse(read(path.join(directory, "package.json")));
|
|
133
|
+
if (manifest?.name === "carrick" && typeof manifest.version === "string")
|
|
134
|
+
return manifest.version;
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
// Not there, not readable, or not ours. Keep walking up.
|
|
138
|
+
}
|
|
139
|
+
const parent = path.dirname(directory);
|
|
140
|
+
if (parent === directory)
|
|
141
|
+
break;
|
|
142
|
+
directory = parent;
|
|
143
|
+
}
|
|
144
|
+
const run = options.run ?? defaultAskVersion(options);
|
|
145
|
+
return run(found.binary);
|
|
146
|
+
}
|
|
147
|
+
function defaultAskVersion(options) {
|
|
148
|
+
const env = options.env ?? process.env;
|
|
149
|
+
const platform = options.platform ?? process.platform;
|
|
150
|
+
return (binary) => {
|
|
151
|
+
const answer = spawnSync(binary, ["--version"], {
|
|
152
|
+
encoding: "utf8",
|
|
153
|
+
timeout: 5000,
|
|
154
|
+
shell: platform === "win32",
|
|
155
|
+
env: { ...env, CARRICK_NO_UPDATE_CHECK: "1" },
|
|
156
|
+
});
|
|
157
|
+
if (answer.status !== 0 || typeof answer.stdout !== "string")
|
|
158
|
+
return null;
|
|
159
|
+
const first = answer.stdout.trim().split("\n")[0]?.trim();
|
|
160
|
+
return first && /^\d+\.\d+\.\d+$/.test(first) ? first : null;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The command that replaces a global install, for the manager that owns it.
|
|
165
|
+
*
|
|
166
|
+
* Null for the two shapes that are not a global: an npx cache directory, which
|
|
167
|
+
* is thrown away and re-resolved, and a project dependency, which belongs to
|
|
168
|
+
* whichever repository pins it and is not this run's to change. Both are
|
|
169
|
+
* reported rather than acted on.
|
|
170
|
+
*
|
|
171
|
+
* The version is pinned rather than `@latest` on purpose. The run knows which
|
|
172
|
+
* version it is, `@latest` is a second question for the registry, and a pinned
|
|
173
|
+
* spec is what makes the verification below a comparison rather than a guess.
|
|
174
|
+
*/
|
|
175
|
+
export function globalCommand(kind, version) {
|
|
176
|
+
switch (kind) {
|
|
177
|
+
case "npm":
|
|
178
|
+
return ["npm", "install", "-g", `carrick@${version}`];
|
|
179
|
+
case "pnpm":
|
|
180
|
+
return ["pnpm", "add", "-g", `carrick@${version}`];
|
|
181
|
+
case "bun":
|
|
182
|
+
return ["bun", "add", "-g", `carrick@${version}`];
|
|
183
|
+
case "volta":
|
|
184
|
+
return ["volta", "install", `carrick@${version}`];
|
|
185
|
+
default:
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The command for a machine that has no global carrick at all.
|
|
191
|
+
*
|
|
192
|
+
* The running copy's own shape names the manager: somebody running through
|
|
193
|
+
* `npx` has npm, and a project dependency says nothing about what its owner
|
|
194
|
+
* would want globally, so both answer npm.
|
|
195
|
+
*/
|
|
196
|
+
export function firstGlobalCommand(kind, version) {
|
|
197
|
+
return globalCommand(kind === "npx" || kind === "project" ? "npm" : kind, version);
|
|
198
|
+
}
|
|
199
|
+
/** How long an install is given before it is a refusal with a reason. */
|
|
200
|
+
export const INSTALL_TIMEOUT_MS = 180_000;
|
|
201
|
+
/** The last thing a failed install said, for a reader who has to act on it. */
|
|
202
|
+
export function failureReason(result) {
|
|
203
|
+
if (result.error)
|
|
204
|
+
return result.error.message;
|
|
205
|
+
const said = `${result.stderr ?? ""}\n${result.stdout ?? ""}`
|
|
206
|
+
.split("\n")
|
|
207
|
+
.map((line) => line.trim())
|
|
208
|
+
.filter((line) => line !== "" && !line.startsWith("npm warn"));
|
|
209
|
+
const last = said[said.length - 1];
|
|
210
|
+
return last ?? `it exited ${result.status ?? "without a status"}`;
|
|
211
|
+
}
|
|
212
|
+
export function realMachine(env = process.env) {
|
|
213
|
+
return {
|
|
214
|
+
find: () => {
|
|
215
|
+
const found = findCarrick({ env });
|
|
216
|
+
if (!found)
|
|
217
|
+
return null;
|
|
218
|
+
return { ...found, version: installedVersion(found, { env }) };
|
|
219
|
+
},
|
|
220
|
+
shape: (found) => installShape(found.real, env),
|
|
221
|
+
install: (argv) => {
|
|
222
|
+
const answer = spawnSync(argv[0], argv.slice(1), {
|
|
223
|
+
encoding: "utf8",
|
|
224
|
+
timeout: INSTALL_TIMEOUT_MS,
|
|
225
|
+
// A manager on Windows is a `.cmd`, which Node will not run without
|
|
226
|
+
// one. Every word of this command is built here from a fixed list and
|
|
227
|
+
// a version this package's own manifest states.
|
|
228
|
+
shell: process.platform === "win32",
|
|
229
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
230
|
+
env,
|
|
231
|
+
});
|
|
232
|
+
if (answer.status === 0)
|
|
233
|
+
return { ok: true, reason: null };
|
|
234
|
+
return {
|
|
235
|
+
ok: false,
|
|
236
|
+
reason: failureReason({
|
|
237
|
+
status: answer.status,
|
|
238
|
+
stderr: answer.stderr ?? null,
|
|
239
|
+
stdout: answer.stdout ?? null,
|
|
240
|
+
error: answer.error ?? undefined,
|
|
241
|
+
}),
|
|
242
|
+
};
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Bring an older global carrick level with this run, and say so.
|
|
248
|
+
*
|
|
249
|
+
* The ruling this implements: somebody who installed carrick globally has
|
|
250
|
+
* already chosen to have it on this machine, so bringing that choice up to date
|
|
251
|
+
* is inside what they agreed to and is not asked about. What is NOT inside it
|
|
252
|
+
* is creating an install they never asked for, forcing one past their machine's
|
|
253
|
+
* policy, or leaving them on an older binary without knowing.
|
|
254
|
+
*/
|
|
255
|
+
export function syncGlobalInstall(options) {
|
|
256
|
+
const env = options.env ?? process.env;
|
|
257
|
+
const machine = options.machine ?? realMachine(env);
|
|
258
|
+
const running = options.running === undefined ? currentVersion() : options.running;
|
|
259
|
+
if (!running || !/^\d+\.\d+\.\d+$/.test(running)) {
|
|
260
|
+
return { kind: "skipped", why: "this build does not state a plain version", warning: null };
|
|
261
|
+
}
|
|
262
|
+
const found = machine.find();
|
|
263
|
+
if (!found)
|
|
264
|
+
return { kind: "skipped", why: "no carrick on PATH", warning: null };
|
|
265
|
+
if (found.version === null) {
|
|
266
|
+
// An install this cannot identify is one it will not install over. `carrick
|
|
267
|
+
// doctor` says so in its own words; a command doing something else is not
|
|
268
|
+
// where somebody should learn it.
|
|
269
|
+
return {
|
|
270
|
+
kind: "skipped",
|
|
271
|
+
why: `${found.binary} does not say which version it is`,
|
|
272
|
+
warning: null,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
if (!isNewer(running, found.version)) {
|
|
276
|
+
return { kind: "current", version: found.version, warning: null };
|
|
277
|
+
}
|
|
278
|
+
const shape = machine.shape(found);
|
|
279
|
+
const argv = globalCommand(shape.kind, running);
|
|
280
|
+
if (!argv) {
|
|
281
|
+
// A project dependency or an npx cache answering `carrick`. Neither is this
|
|
282
|
+
// run's to replace, and both leave the reader on the older one.
|
|
283
|
+
const where = shape.manifest ? ` (pinned in ${shape.manifest})` : "";
|
|
284
|
+
return {
|
|
285
|
+
kind: "stale",
|
|
286
|
+
path: found.binary,
|
|
287
|
+
version: found.version,
|
|
288
|
+
command: shape.command,
|
|
289
|
+
warning: `\`carrick\` here runs ${found.version} from ${found.binary}${where}, not the ${running} this run is. Update it where it is pinned, or put a global install earlier on PATH.`,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
const command = argv.join(" ");
|
|
293
|
+
options.say(`Upgrading the global carrick ${found.version} -> ${running} (${command})`);
|
|
294
|
+
const result = machine.install(argv);
|
|
295
|
+
if (!result.ok) {
|
|
296
|
+
return {
|
|
297
|
+
kind: "refused",
|
|
298
|
+
from: found.version,
|
|
299
|
+
to: running,
|
|
300
|
+
reason: result.reason ?? "",
|
|
301
|
+
command,
|
|
302
|
+
warning: `The global carrick is still ${found.version}: ${result.reason ?? "the install did not finish"}. Run \`${command}\` when that is sorted.`,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
// The install said it worked, which is not the same as `carrick` now being
|
|
306
|
+
// the new one: a second install earlier on PATH, or a version manager's shim,
|
|
307
|
+
// answers first and was never touched by it.
|
|
308
|
+
const after = machine.find();
|
|
309
|
+
if (!after) {
|
|
310
|
+
return {
|
|
311
|
+
kind: "stale",
|
|
312
|
+
path: null,
|
|
313
|
+
version: null,
|
|
314
|
+
command,
|
|
315
|
+
warning: `carrick ${running} is installed and nothing answers to \`carrick\` on PATH. The directory ${argv[0]} installs into is not on it; add that directory, so your agent's hooks can run carrick by name.`,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
if (after.version === running) {
|
|
319
|
+
options.say(`The global carrick is now ${running}.`);
|
|
320
|
+
return { kind: "upgraded", from: found.version, to: running, warning: null };
|
|
321
|
+
}
|
|
322
|
+
const theirs = (globalCommand(machine.shape(after).kind, running) ?? argv).join(" ");
|
|
323
|
+
return {
|
|
324
|
+
kind: "stale",
|
|
325
|
+
path: after.binary,
|
|
326
|
+
version: after.version,
|
|
327
|
+
command: theirs,
|
|
328
|
+
warning: `\`carrick\` still runs ${after.version ?? "an unknown version"} from ${after.binary}. Replace that one with \`${theirs}\`, or take it off PATH.`,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* The commands this never runs on.
|
|
333
|
+
*
|
|
334
|
+
* `hook` and `lsp` speak a protocol and run on every edit; `remove` is somebody
|
|
335
|
+
* undoing this install, and upgrading one on the way out is the opposite of
|
|
336
|
+
* what they asked for. The three argument forms are the ones that answer in
|
|
337
|
+
* milliseconds and are typed to find something out, not to do work.
|
|
338
|
+
*/
|
|
339
|
+
const NO_SYNC = new Set(["hook", "lsp", "remove", "--version", "-V", "--help", "-h"]);
|
|
340
|
+
/**
|
|
341
|
+
* Whether this invocation keeps the global install level.
|
|
342
|
+
*
|
|
343
|
+
* Only a run through npx. Every other shape IS the install a person would be
|
|
344
|
+
* upgrading: a global run of `carrick index` is already the version on PATH,
|
|
345
|
+
* and a project dependency belongs to the repository that pins it. npx is the
|
|
346
|
+
* one that leaves a second, older carrick behind it, and it is also the one the
|
|
347
|
+
* quickstart and the agents use.
|
|
348
|
+
*
|
|
349
|
+
* Never in CI: a build machine is thrown away, nothing on it is on PATH for a
|
|
350
|
+
* next run, and what runs there is the workflow's decision.
|
|
351
|
+
*/
|
|
352
|
+
export function syncsOnThisRun(command, env = process.env, root = packageRoot()) {
|
|
353
|
+
if (command === undefined || NO_SYNC.has(command))
|
|
354
|
+
return false;
|
|
355
|
+
if (suppressed(env) || inCi(env))
|
|
356
|
+
return false;
|
|
357
|
+
return installShape(root, env).kind === "npx";
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Offer a global install to a machine that has none, and never take one.
|
|
361
|
+
*
|
|
362
|
+
* The ruling: `--yes` answers for the workspace, so it prints the command and
|
|
363
|
+
* installs nothing; a terminal is asked; `--install-global` is the consent a
|
|
364
|
+
* script gives. What turns on the answer is the hook commands written
|
|
365
|
+
* immediately after this — with a global, they are the bare `carrick`, which
|
|
366
|
+
* survives the end of this npx run; without one, they name this install, which
|
|
367
|
+
* does not.
|
|
368
|
+
*/
|
|
369
|
+
export async function offerGlobalInstall(options) {
|
|
370
|
+
const env = options.env ?? process.env;
|
|
371
|
+
const machine = options.machine ?? realMachine(env);
|
|
372
|
+
const running = options.running === undefined ? currentVersion() : options.running;
|
|
373
|
+
if (machine.find() !== null)
|
|
374
|
+
return "present";
|
|
375
|
+
if (!running || !/^\d+\.\d+\.\d+$/.test(running))
|
|
376
|
+
return "declined";
|
|
377
|
+
const argv = firstGlobalCommand(installShape(options.root ?? packageRoot(), env).kind, running);
|
|
378
|
+
const command = argv.join(" ");
|
|
379
|
+
const wanted = options.install ||
|
|
380
|
+
(!options.assumeYes &&
|
|
381
|
+
(await options.confirm(`Install carrick ${running} on this machine with \`${command}\`? Your agent's hooks then run it by name.`)));
|
|
382
|
+
if (!wanted) {
|
|
383
|
+
options.say(`\`carrick\` is not on PATH, so the hooks below name this install, which ends with this run. \`${command}\` puts it there for good.`);
|
|
384
|
+
return "declined";
|
|
385
|
+
}
|
|
386
|
+
options.say(`Installing carrick ${running} (${command})`);
|
|
387
|
+
const result = machine.install(argv);
|
|
388
|
+
if (result.ok && machine.find() !== null)
|
|
389
|
+
return "installed";
|
|
390
|
+
options.say(`carrick is still not on PATH: ${result.reason ?? "the install finished but nothing answers to `carrick`"}. Run \`${command}\` yourself for the short hook commands.`);
|
|
391
|
+
return "failed";
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=global-install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-install.js","sourceRoot":"","sources":["../src/global-install.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,qBAAqB;AACrB,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF;AAChF,iFAAiF;AACjF,4EAA4E;AAC5E,6EAA6E;AAC7E,0BAA0B;AAC1B,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,8EAA8E;AAC9E,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,gFAAgF;AAChF,qDAAqD;AACrD,6EAA6E;AAC7E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AC,GAAG,CACT,iCAAiC,MAAM,CAAC,MAAM,IAAI,uDAAuD,WAAW,OAAO,0CAA0C,CACtK,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/hook/post-edit.js
CHANGED
|
@@ -21,6 +21,8 @@ import { createLogger } from "../log.js";
|
|
|
21
21
|
import { renderPostToolUse } from "../render.js";
|
|
22
22
|
import { resolveRoot, rootNote } from "../root.js";
|
|
23
23
|
import { patchedFiles } from "./apply-patch.js";
|
|
24
|
+
import { throttledVersionMismatch } from "../init/outdated.js";
|
|
25
|
+
import { currentVersion } from "../update.js";
|
|
24
26
|
import { record } from "./reuse.js";
|
|
25
27
|
const log = createLogger("carrick-hook");
|
|
26
28
|
/** The files the index has rows for. */
|
|
@@ -143,6 +145,14 @@ async function main() {
|
|
|
143
145
|
log(`the ${channel.channel} channel owns delivery in this install; printing nothing`);
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
148
|
+
// The `carrick` this hook is running is whatever PATH answered with, which
|
|
149
|
+
// an upgrade elsewhere can leave behind (carrick#1372). Claimed at the last
|
|
150
|
+
// possible moment, so the once-a-day stamp is spent only on a line that is
|
|
151
|
+
// actually delivered, and inside `additionalContext` rather than on a bare
|
|
152
|
+
// stdout line, which this host reads as a malformed hook response.
|
|
153
|
+
const mismatch = throttledVersionMismatch(choice.root, currentVersion());
|
|
154
|
+
if (mismatch)
|
|
155
|
+
contexts.push(mismatch);
|
|
146
156
|
if (contexts.length > 0)
|
|
147
157
|
emit(contexts.join("\n\n"));
|
|
148
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-edit.js","sourceRoot":"","sources":["../../src/hook/post-edit.ts"],"names":[],"mappings":";AACA,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,oEAAoE;AACpE,EAAE;AACF,sEAAsE;AACtE,8EAA8E;AAC9E,sEAAsE;AACtE,+EAA+E;AAC/E,4DAA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AAC,OAAO,0DAA0D,CAAC,CAAC;QACtF,OAAO;IACT,CAAC;IACD,2EAA2E;IAC3E,4EAA4E;IAC5E,2EAA2E;IAC3E,2EAA2E;IAC3E,mEAAmE;IACnE,MAAM,QAAQ,GAAG,wBAAwB,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACzE,IAAI,QAAQ;QAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,IAAI,EAAE,CAAC;AACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -16,8 +16,27 @@ import { resolveChannel } from "../channel.js";
|
|
|
16
16
|
import { createLogger } from "../log.js";
|
|
17
17
|
import { renderSessionStart } from "../render.js";
|
|
18
18
|
import { resolveRoot, rootNote } from "../root.js";
|
|
19
|
+
import { currentVersion, readUpdateState, suppressed, updateNotice } from "../update.js";
|
|
19
20
|
import { refreshInBackground } from "./refresh.js";
|
|
21
|
+
import { versionMismatch } from "../init/outdated.js";
|
|
20
22
|
const log = createLogger("carrick-session");
|
|
23
|
+
/**
|
|
24
|
+
* "Start of session, not mid session" — the moment a version notice is worth
|
|
25
|
+
* anything, because it is the moment before the agent does any work.
|
|
26
|
+
*
|
|
27
|
+
* Read from the cache only: a hook has a 300 ms budget and no business dialling
|
|
28
|
+
* a registry. The cache is refreshed by a detached child the shim starts, so
|
|
29
|
+
* what this prints is at most one run behind. On stdout, unlike the shim's
|
|
30
|
+
* stderr line, because stdout is what Claude Code adds to the session — the
|
|
31
|
+
* agent is the one that can act on it, and an agent that forgets to upgrade is
|
|
32
|
+
* the failure this exists for.
|
|
33
|
+
*/
|
|
34
|
+
function versionLine() {
|
|
35
|
+
if (suppressed(process.env))
|
|
36
|
+
return null;
|
|
37
|
+
const state = readUpdateState(process.env);
|
|
38
|
+
return updateNotice(currentVersion(), state?.latest ?? null, { env: process.env });
|
|
39
|
+
}
|
|
21
40
|
async function main() {
|
|
22
41
|
if (resolveChannel({ hooksInstalled: true }).channel === "off") {
|
|
23
42
|
log("CARRICK_CHANNEL=off; printing nothing");
|
|
@@ -31,6 +50,21 @@ async function main() {
|
|
|
31
50
|
const note = rootNote(choice);
|
|
32
51
|
if (note)
|
|
33
52
|
log(note);
|
|
53
|
+
// Printed whatever the index turns out to say, and before the read that may
|
|
54
|
+
// have nothing to report: a machine with no index yet is a machine about to
|
|
55
|
+
// run its first scan, which is the worst moment to be on a stale build.
|
|
56
|
+
const version = versionLine();
|
|
57
|
+
if (version)
|
|
58
|
+
process.stdout.write(`${version}\n`);
|
|
59
|
+
// And the other mismatch: not "a newer one is published" but "the one
|
|
60
|
+
// answering this hook is not the one that wrote these files". Unthrottled,
|
|
61
|
+
// because this runs once per session and the agent about to work here is the
|
|
62
|
+
// reader who can act on it (carrick#1372).
|
|
63
|
+
if (choice.markerFound) {
|
|
64
|
+
const mismatch = versionMismatch(choice.root, currentVersion());
|
|
65
|
+
if (mismatch)
|
|
66
|
+
process.stdout.write(`${mismatch}\n`);
|
|
67
|
+
}
|
|
34
68
|
const outcome = await status({ cwd: choice.root, workspace: choice.markerFound ? choice.root : null });
|
|
35
69
|
if (!outcome.result) {
|
|
36
70
|
log("no answer", outcome.failure ?? "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-start.js","sourceRoot":"","sources":["../../src/hook/session-start.ts"],"names":[],"mappings":";AACA,8EAA8E;AAC9E,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAC5E,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,0EAA0E;AAC1E,gEAAgE;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,cA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EAAE,CAAC,CAAC;IACvG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACxC,OAAO;IACT,CAAC;IACD,wEAAwE;IACxE,4EAA4E;IAC5E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEhE,6EAA6E;IAC7E,sEAAsE;IACtE,4DAA4D;IAC5D,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,IAAI,CAAC;QACH,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,gCAAgC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,OAAO;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,IAAI,EAAE,CAAC;AACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/hook/stop.js
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
import { createLogger } from "../log.js";
|
|
23
23
|
import { resolveChannel } from "../channel.js";
|
|
24
24
|
import { drain } from "./reuse.js";
|
|
25
|
+
import { initialisedRoot, throttledVersionMismatch } from "../init/outdated.js";
|
|
26
|
+
import { currentVersion } from "../update.js";
|
|
25
27
|
const log = createLogger("carrick-stop");
|
|
26
28
|
async function readStdin() {
|
|
27
29
|
const chunks = [];
|
|
@@ -64,12 +66,24 @@ async function main() {
|
|
|
64
66
|
// (carrick#1335); the difference between the two hosts is the event name on
|
|
65
67
|
// the wire and nothing else.
|
|
66
68
|
const spoken = drain(session);
|
|
67
|
-
|
|
69
|
+
const parts = [];
|
|
70
|
+
if (spoken === null)
|
|
68
71
|
log(`nothing new in ${session}: everything recorded has been named`);
|
|
72
|
+
else
|
|
73
|
+
parts.push(spoken.line);
|
|
74
|
+
// The other thing a task's end is a good moment for: the `carrick` these
|
|
75
|
+
// hooks resolve is not the one that set this workspace up (carrick#1372).
|
|
76
|
+
// Once a day, through the same channel, because a mismatch stands until
|
|
77
|
+
// somebody fixes it and a line per turn would be noise.
|
|
78
|
+
const root = initialisedRoot(process.env["CLAUDE_PROJECT_DIR"] ?? process.cwd());
|
|
79
|
+
const mismatch = root === null ? null : throttledVersionMismatch(root, currentVersion());
|
|
80
|
+
if (mismatch)
|
|
81
|
+
parts.push(mismatch);
|
|
82
|
+
if (parts.length === 0)
|
|
69
83
|
return;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
process.stdout.write(emission(parts.join("\n\n")));
|
|
85
|
+
if (spoken)
|
|
86
|
+
log(`named ${spoken.named} new function(s) to the model, of ${spoken.found} recorded`);
|
|
73
87
|
}
|
|
74
88
|
await main();
|
|
75
89
|
process.exit(0);
|
package/dist/hook/stop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../src/hook/stop.ts"],"names":[],"mappings":";AACA,yEAAyE;AACzE,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,wEAAwE;AACxE,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,uEAAuE;AACvE,4EAA4E;AAC5E,yDAAyD;AACzD,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,C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AAI,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnD,IAAI,MAAM;QAAE,GAAG,CAAC,SAAS,MAAM,CAAC,KAAK,qCAAqC,MAAM,CAAC,KAAK,WAAW,CAAC,CAAC;AACrG,CAAC;AAED,MAAM,IAAI,EAAE,CAAC;AACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/hook/user-prompt.js
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
import { createLogger } from "../log.js";
|
|
26
26
|
import { resolveChannel } from "../channel.js";
|
|
27
27
|
import { drain } from "./reuse.js";
|
|
28
|
+
import { initialisedRoot, throttledVersionMismatch } from "../init/outdated.js";
|
|
29
|
+
import { currentVersion } from "../update.js";
|
|
28
30
|
const log = createLogger("carrick-user-prompt");
|
|
29
31
|
async function readStdin() {
|
|
30
32
|
const chunks = [];
|
|
@@ -67,12 +69,22 @@ async function main() {
|
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
const spoken = drain(session);
|
|
70
|
-
|
|
72
|
+
const parts = [];
|
|
73
|
+
if (spoken === null)
|
|
71
74
|
log(`nothing new in ${session}: everything recorded has been named`);
|
|
75
|
+
else
|
|
76
|
+
parts.push(spoken.line);
|
|
77
|
+
// The same backstop the other hooks carry: this `carrick` is not the one
|
|
78
|
+
// that set this workspace up (carrick#1372), once a day per workspace.
|
|
79
|
+
const root = initialisedRoot(process.env["CLAUDE_PROJECT_DIR"] ?? process.cwd());
|
|
80
|
+
const mismatch = root === null ? null : throttledVersionMismatch(root, currentVersion());
|
|
81
|
+
if (mismatch)
|
|
82
|
+
parts.push(mismatch);
|
|
83
|
+
if (parts.length === 0)
|
|
72
84
|
return;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
85
|
+
process.stdout.write(emission(parts.join("\n\n")));
|
|
86
|
+
if (spoken)
|
|
87
|
+
log(`named ${spoken.named} new function(s) to the model, of ${spoken.found} recorded`);
|
|
76
88
|
}
|
|
77
89
|
await main();
|
|
78
90
|
process.exit(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-prompt.js","sourceRoot":"","sources":["../../src/hook/user-prompt.ts"],"names":[],"mappings":";AACA,mEAAmE;AACnE,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,4EAA4E;AAC5E,6EAA6E;AAC7E,gFAAgF;AAChF,6EAA6E;AAC7E,wCAAwC;AACxC,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,gEAAgE;AAChE,EAAE;AACF,+EAA+E;AAC/E,8BAA8B;AAC9B,EAAE;AACF,iEAAiE;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"user-prompt.js","sourceRoot":"","sources":["../../src/hook/user-prompt.ts"],"names":[],"mappings":";AACA,mEAAmE;AACnE,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,4EAA4E;AAC5E,6EAA6E;AAC7E,gFAAgF;AAChF,6EAA6E;AAC7E,wCAAwC;AACxC,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,gEAAgE;AAChE,EAAE;AACF,+EAA+E;AAC/E,8BAA8B;AAC9B,EAAE;AACF,iEAAiE;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO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