carrick 0.3.145 → 0.3.147
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/bin/carrick.mjs +4 -4
- package/dist/cli.d.ts +8 -1
- package/dist/cli.js +14 -2
- package/dist/cli.js.map +1 -1
- package/dist/contract.d.ts +31 -0
- package/dist/contract.js +29 -3
- package/dist/contract.js.map +1 -1
- package/dist/diagnostics.js +1 -9
- package/dist/diagnostics.js.map +1 -1
- package/dist/fs-util.d.ts +6 -0
- package/dist/fs-util.js +29 -0
- package/dist/fs-util.js.map +1 -0
- package/dist/global-install.js +1 -8
- package/dist/global-install.js.map +1 -1
- package/dist/hook/apply-patch.js +3 -4
- package/dist/hook/apply-patch.js.map +1 -1
- package/dist/hook/checked.d.ts +3 -1
- package/dist/hook/checked.js +9 -2
- package/dist/hook/checked.js.map +1 -1
- package/dist/hook/late.js +9 -2
- package/dist/hook/late.js.map +1 -1
- package/dist/hook/post-edit.js +33 -24
- package/dist/hook/post-edit.js.map +1 -1
- package/dist/hook/post-read.js +1 -6
- package/dist/hook/post-read.js.map +1 -1
- package/dist/hook/rechecks.d.ts +45 -1
- package/dist/hook/rechecks.js +116 -10
- package/dist/hook/rechecks.js.map +1 -1
- package/dist/hook/reuse.d.ts +31 -58
- package/dist/hook/reuse.js +48 -112
- package/dist/hook/reuse.js.map +1 -1
- package/dist/hook/session-start.d.ts +9 -0
- package/dist/hook/session-start.js +43 -16
- package/dist/hook/session-start.js.map +1 -1
- package/dist/hook/stdin.d.ts +2 -0
- package/dist/hook/stdin.js +8 -0
- package/dist/hook/stdin.js.map +1 -0
- package/dist/hook/stop-wait.d.ts +24 -1
- package/dist/hook/stop-wait.js +163 -28
- package/dist/hook/stop-wait.js.map +1 -1
- package/dist/hook/stop.js +17 -36
- package/dist/hook/stop.js.map +1 -1
- package/dist/hook/user-prompt.js +13 -30
- package/dist/hook/user-prompt.js.map +1 -1
- package/dist/hosted-snapshot.d.ts +37 -0
- package/dist/hosted-snapshot.js +49 -0
- package/dist/hosted-snapshot.js.map +1 -0
- package/dist/init/agents-section.d.ts +16 -2
- package/dist/init/agents-section.js +43 -7
- package/dist/init/agents-section.js.map +1 -1
- package/dist/init/codex.js +8 -7
- package/dist/init/codex.js.map +1 -1
- package/dist/init/mcp.js +1 -3
- package/dist/init/mcp.js.map +1 -1
- package/dist/init/remove.d.ts +2 -0
- package/dist/init/remove.js +18 -4
- package/dist/init/remove.js.map +1 -1
- package/dist/init/repo-copies.js +2 -10
- package/dist/init/repo-copies.js.map +1 -1
- package/dist/init/repos.d.ts +0 -2
- package/dist/init/repos.js +1 -9
- package/dist/init/repos.js.map +1 -1
- package/dist/init/run.js +14 -4
- package/dist/init/run.js.map +1 -1
- package/dist/init/self-update.d.ts +2 -2
- package/dist/init/self-update.js +89 -3
- package/dist/init/self-update.js.map +1 -1
- package/dist/init/settings.js +5 -7
- package/dist/init/settings.js.map +1 -1
- package/dist/native.js +1 -9
- package/dist/native.js.map +1 -1
- package/dist/render.d.ts +54 -11
- package/dist/render.js +188 -34
- package/dist/render.js.map +1 -1
- package/dist/root.d.ts +1 -2
- package/dist/root.js +1 -9
- package/dist/root.js.map +1 -1
- package/dist/surfaces.js +1 -3
- package/dist/surfaces.js.map +1 -1
- package/package.json +6 -6
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/sidecar/dist/src/bundler.js +30 -28
- package/sidecar/dist/src/capture/service-config.d.ts +6 -0
- package/sidecar/dist/src/capture/service-config.js +11 -1
- package/sidecar/dist/src/library-claims.js +14 -0
- package/sidecar/dist/src/platform-body-read.d.ts +46 -0
- package/sidecar/dist/src/platform-body-read.js +82 -0
- package/sidecar/dist/src/response-modes.d.ts +5 -4
- package/sidecar/dist/src/response-modes.js +21 -25
- package/sidecar/dist/src/retype.js +11 -16
- package/sidecar/dist/src/stated-params.d.ts +6 -0
- package/sidecar/dist/src/stated-params.js +13 -0
- package/sidecar/dist/src/type-inferrer.d.ts +47 -14
- package/sidecar/dist/src/type-inferrer.js +119 -62
- package/sidecar/dist/src/types.d.ts +20 -3
- package/templates/skills/carrick-census.md +24 -3
- package/templates/skills/carrick-drift.md +11 -3
- package/templates/skills/carrick-impact.md +8 -3
- package/dist/hook/edited.d.ts +0 -22
- package/dist/hook/edited.js +0 -84
- package/dist/hook/edited.js.map +0 -1
package/dist/hook/edited.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// What one edited file is, shared by the post-edit hook and the background
|
|
2
|
-
// re-check runner: whether the scan reads it, which checkout it sits in, and
|
|
3
|
-
// which functions a re-check says it newly declares.
|
|
4
|
-
//
|
|
5
|
-
// Split out of `post-edit.ts` because that file runs `main` on import, so
|
|
6
|
-
// nothing else could import from it.
|
|
7
|
-
import fs from "node:fs";
|
|
8
|
-
import path from "node:path";
|
|
9
|
-
/**
|
|
10
|
-
* The files `carrick check --changed` judges: the scanner's own source
|
|
11
|
-
* extensions (`SOURCE_EXTENSIONS` in `src/file_finder.rs`, carrick#904). An API
|
|
12
|
-
* spec file is not counted: the hook cannot tell a spec the scan reads from any
|
|
13
|
-
* other `.json` or `.yaml` without reading the repo, and a config file that
|
|
14
|
-
* moves no contract is what the line used to be wrong about.
|
|
15
|
-
*/
|
|
16
|
-
const CHECKED_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
17
|
-
/** `TEST_FILE_INFIXES` in `src/file_finder.rs`: a test or story file name ends its stem in one. */
|
|
18
|
-
const TEST_FILE_INFIXES = [".test", ".spec", ".stories"];
|
|
19
|
-
/** `TEST_DIR_NAMES` in `src/file_finder.rs` (plus `.storybook`): trees the scan does not read. */
|
|
20
|
-
const TEST_DIR_NAMES = new Set([
|
|
21
|
-
"__tests__",
|
|
22
|
-
"__mocks__",
|
|
23
|
-
"__fixtures__",
|
|
24
|
-
"tests",
|
|
25
|
-
"test",
|
|
26
|
-
"fixtures",
|
|
27
|
-
"e2e",
|
|
28
|
-
".storybook",
|
|
29
|
-
]);
|
|
30
|
-
/** Whether `carrick check --changed` would judge this edited file: source, and not a test or story. */
|
|
31
|
-
export function isCheckedSource(file) {
|
|
32
|
-
const extension = path.extname(file).toLowerCase();
|
|
33
|
-
if (!CHECKED_EXTENSIONS.has(extension))
|
|
34
|
-
return false;
|
|
35
|
-
const stem = path.basename(file, extension).toLowerCase();
|
|
36
|
-
if (TEST_FILE_INFIXES.some((infix) => stem.endsWith(infix)))
|
|
37
|
-
return false;
|
|
38
|
-
// Directory names above the file. The scanner reads them relative to the
|
|
39
|
-
// scan root; the hook does not know it, so a checkout under a directory
|
|
40
|
-
// named `test` hides its source here: the line is then missing, not wrong.
|
|
41
|
-
const directories = path.dirname(file).split(/[\\/]/);
|
|
42
|
-
return !directories.some((name) => TEST_DIR_NAMES.has(name.toLowerCase()));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* What the re-check said this file declares and the index does not
|
|
46
|
-
* (carrick#1330).
|
|
47
|
-
*
|
|
48
|
-
* Nothing is printed about it here. This hook fires on every edit and most
|
|
49
|
-
* edits add no function; the one line about the ones that did belongs at the
|
|
50
|
-
* end of the task, where it costs one model turn instead of one per edit. All
|
|
51
|
-
* this does is put the names somewhere the Stop hook can find them.
|
|
52
|
-
*/
|
|
53
|
-
export function newFunctions(result, file) {
|
|
54
|
-
// Test, spec and story files never warrant a reuse check (carrick#2936).
|
|
55
|
-
if (!isCheckedSource(file))
|
|
56
|
-
return [];
|
|
57
|
-
return (result.recheck?.new_functions ?? []).map((entry) => ({
|
|
58
|
-
name: entry.name,
|
|
59
|
-
// The path this hook computed, not the one the binary echoes: it is the
|
|
60
|
-
// checkout-relative path the index holds, whatever root the edit ran from.
|
|
61
|
-
file,
|
|
62
|
-
indexCommit: result.index_commit ?? "",
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* `file` relative to the nearest checkout top at or below `root`: the nearest
|
|
67
|
-
* directory holding `.git` (a folder, or the file a linked worktree has). An
|
|
68
|
-
* edit inside a nested worktree is then keyed as the index keys it, not with
|
|
69
|
-
* the worktree's own prefix (carrick#2936). With no nested checkout it is
|
|
70
|
-
* relative to `root`, as before.
|
|
71
|
-
*/
|
|
72
|
-
export function checkoutRelative(root, file) {
|
|
73
|
-
let dir = path.dirname(file);
|
|
74
|
-
while (dir !== root && path.relative(root, dir) && !path.relative(root, dir).startsWith("..")) {
|
|
75
|
-
if (fs.existsSync(path.join(dir, ".git")))
|
|
76
|
-
return path.relative(dir, file);
|
|
77
|
-
const parent = path.dirname(dir);
|
|
78
|
-
if (parent === dir)
|
|
79
|
-
break;
|
|
80
|
-
dir = parent;
|
|
81
|
-
}
|
|
82
|
-
return path.relative(root, file);
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=edited.js.map
|
package/dist/hook/edited.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edited.js","sourceRoot":"","sources":["../../src/hook/edited.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,qDAAqD;AACrD,EAAE;AACF,0EAA0E;AAC1E,qCAAqC;AAErC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEnG,mGAAmG;AACnG,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAEzD,kGAAkG;AAClG,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,WAAW;IACX,WAAW;IACX,cAAc;IACd,OAAO;IACP,MAAM;IACN,UAAU;IACV,KAAK;IACL,YAAY;CACb,CAAC,CAAC;AAEH,uGAAuG;AACvG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