carrick 0.3.155 → 0.3.157
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/dist/contract.d.ts +22 -23
- package/dist/contract.js.map +1 -1
- package/dist/facts/enabled.d.ts +28 -0
- package/dist/facts/enabled.js +36 -0
- package/dist/facts/enabled.js.map +1 -1
- package/dist/facts/fetch.js +20 -8
- package/dist/facts/fetch.js.map +1 -1
- package/dist/facts/lines.d.ts +75 -2
- package/dist/facts/lines.js +302 -46
- package/dist/facts/lines.js.map +1 -1
- package/dist/facts/match.d.ts +2 -0
- package/dist/facts/match.js +189 -28
- package/dist/facts/match.js.map +1 -1
- package/dist/facts/peers.d.ts +2 -0
- package/dist/facts/peers.js +7 -2
- package/dist/facts/peers.js.map +1 -1
- package/dist/facts/store.d.ts +98 -2
- package/dist/facts/store.js +110 -12
- package/dist/facts/store.js.map +1 -1
- package/dist/held/client.d.ts +34 -0
- package/dist/held/client.js +85 -0
- package/dist/held/client.js.map +1 -0
- package/dist/held/daemon.d.ts +106 -0
- package/dist/held/daemon.js +307 -0
- package/dist/held/daemon.js.map +1 -0
- package/dist/held/engine.d.ts +50 -0
- package/dist/held/engine.js +166 -0
- package/dist/held/engine.js.map +1 -0
- package/dist/held/paths.d.ts +9 -0
- package/dist/held/paths.js +27 -0
- package/dist/held/paths.js.map +1 -0
- package/dist/held/place.d.ts +84 -0
- package/dist/held/place.js +198 -0
- package/dist/held/place.js.map +1 -0
- package/dist/held/registry.d.ts +22 -0
- package/dist/held/registry.js +72 -0
- package/dist/held/registry.js.map +1 -0
- package/dist/held/run.d.ts +2 -0
- package/dist/held/run.js +60 -0
- package/dist/held/run.js.map +1 -0
- package/dist/hook/bash-targets.d.ts +7 -2
- package/dist/hook/bash-targets.js +82 -27
- package/dist/hook/bash-targets.js.map +1 -1
- package/dist/hook/edit-flow.js +11 -7
- package/dist/hook/edit-flow.js.map +1 -1
- package/dist/hook/late.d.ts +1 -1
- package/dist/hook/late.js +3 -3
- package/dist/hook/late.js.map +1 -1
- package/dist/hook/lock.d.ts +26 -0
- package/dist/hook/lock.js +122 -0
- package/dist/hook/lock.js.map +1 -0
- package/dist/hook/post-bash.js +22 -7
- package/dist/hook/post-bash.js.map +1 -1
- package/dist/hook/post-read.js +9 -4
- package/dist/hook/post-read.js.map +1 -1
- package/dist/hook/probe.js +4 -2
- package/dist/hook/probe.js.map +1 -1
- package/dist/hook/read-answer.d.ts +23 -4
- package/dist/hook/read-answer.js +74 -19
- package/dist/hook/read-answer.js.map +1 -1
- package/dist/hook/rechecks.d.ts +2 -5
- package/dist/hook/rechecks.js +23 -130
- package/dist/hook/rechecks.js.map +1 -1
- package/dist/hook/similar.d.ts +13 -0
- package/dist/hook/similar.js +60 -0
- package/dist/hook/similar.js.map +1 -0
- package/dist/hook/stop-wait.d.ts +1 -0
- package/dist/hook/stop-wait.js +19 -24
- package/dist/hook/stop-wait.js.map +1 -1
- package/dist/hook/timings.d.ts +17 -3
- package/dist/hook/timings.js +10 -2
- package/dist/hook/timings.js.map +1 -1
- package/dist/lsp-frame.d.ts +20 -0
- package/dist/lsp-frame.js +47 -0
- package/dist/lsp-frame.js.map +1 -0
- package/dist/render.js +9 -3
- package/dist/render.js.map +1 -1
- package/dist/scan.d.ts +9 -0
- package/dist/scan.js +39 -8
- package/dist/scan.js.map +1 -1
- package/dist/server.js +4 -28
- package/dist/server.js.map +1 -1
- package/package.json +6 -6
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/sidecar/dist/src/bundler.d.ts +5 -0
- package/sidecar/dist/src/bundler.js +20 -0
- package/sidecar/dist/src/capture/anchors.js +19 -4
- package/sidecar/dist/src/capture/api.d.ts +52 -4
- package/sidecar/dist/src/capture/check-probe.d.ts +17 -1
- package/sidecar/dist/src/capture/check-probe.js +39 -2
- package/sidecar/dist/src/capture/index.d.ts +12 -4
- package/sidecar/dist/src/capture/index.js +19 -3
- package/sidecar/dist/src/capture/result-label.js +3 -1
- package/sidecar/dist/src/capture/self-check.js +12 -31
- package/sidecar/dist/src/capture/serialised-arms.d.ts +27 -0
- package/sidecar/dist/src/capture/serialised-arms.js +76 -0
- package/sidecar/dist/src/capture/site-node.d.ts +17 -0
- package/sidecar/dist/src/capture/site-node.js +36 -0
- package/sidecar/dist/src/capture/stub-resolution.d.ts +63 -0
- package/sidecar/dist/src/capture/stub-resolution.js +102 -0
- package/sidecar/dist/src/capture/type-reasons.json +78 -0
- package/sidecar/dist/src/capture/unresolved.js +8 -1
- package/sidecar/dist/src/definition-resolver.d.ts +18 -9
- package/sidecar/dist/src/definition-resolver.js +66 -42
- package/sidecar/dist/src/engine-stamp.json +1 -0
- package/sidecar/dist/src/held-shadow.d.ts +60 -0
- package/sidecar/dist/src/held-shadow.js +222 -0
- package/sidecar/dist/src/index.js +47 -1
- package/sidecar/dist/src/library-claims.d.ts +3 -1
- package/sidecar/dist/src/library-claims.js +79 -3
- package/sidecar/dist/src/retype.js +1 -61
- package/sidecar/dist/src/type-home.d.ts +42 -0
- package/sidecar/dist/src/type-home.js +94 -0
- package/sidecar/dist/src/type-inferrer.d.ts +245 -28
- package/sidecar/dist/src/type-inferrer.js +938 -192
- package/sidecar/dist/src/type-parameters.d.ts +41 -0
- package/sidecar/dist/src/type-parameters.js +126 -0
- package/sidecar/dist/src/type-structural-expander.d.ts +1 -11
- package/sidecar/dist/src/type-structural-expander.js +9 -1
- package/sidecar/dist/src/types.d.ts +132 -20
- package/sidecar/dist/src/validators.d.ts +450 -244
- package/sidecar/dist/src/validators.js +27 -1
- package/dist/hook/lead.d.ts +0 -13
- package/dist/hook/lead.js +0 -39
- package/dist/hook/lead.js.map +0 -1
|
@@ -108,6 +108,15 @@ export const InferRequestItemSchema = z.object({
|
|
|
108
108
|
result: ResultLabelSchema.optional(),
|
|
109
109
|
// The route row's own path, sent where its line serves several (carrick#1029).
|
|
110
110
|
route_path: z.string().min(1).optional(),
|
|
111
|
+
// The call that reaches the function the expression is in (carrick#4128).
|
|
112
|
+
through_call: z
|
|
113
|
+
.object({
|
|
114
|
+
file_path: z.string().min(1),
|
|
115
|
+
span_start: z.number().int().nonnegative(),
|
|
116
|
+
span_end: z.number().int().nonnegative(),
|
|
117
|
+
})
|
|
118
|
+
.strict()
|
|
119
|
+
.optional(),
|
|
111
120
|
});
|
|
112
121
|
/**
|
|
113
122
|
* Per-item locator validation for infer requests.
|
|
@@ -204,6 +213,7 @@ const CaptureAnchorRequestSchema = z.discriminatedUnion('kind', [
|
|
|
204
213
|
param_name: z.string().optional(),
|
|
205
214
|
unwrap: z.enum(['awaited', 'none']).optional(),
|
|
206
215
|
result: ResultLabelSchema.optional(),
|
|
216
|
+
infer_kind: InferKindSchema.optional(),
|
|
207
217
|
}),
|
|
208
218
|
z.object({
|
|
209
219
|
kind: z.literal('literal'),
|
|
@@ -293,6 +303,10 @@ export const ShutdownRequestSchema = BaseRequestSchema.extend({
|
|
|
293
303
|
export const ListProgramFilesRequestSchema = BaseRequestSchema.extend({
|
|
294
304
|
action: z.literal('list_program_files'),
|
|
295
305
|
});
|
|
306
|
+
export const WriteShadowRequestSchema = BaseRequestSchema.extend({
|
|
307
|
+
action: z.literal('write_shadow'),
|
|
308
|
+
out_dir: z.string().min(1),
|
|
309
|
+
});
|
|
296
310
|
export const ReachGraphRequestSchema = BaseRequestSchema.extend({
|
|
297
311
|
action: z.literal('reach_graph'),
|
|
298
312
|
});
|
|
@@ -345,7 +359,15 @@ export const ImplementationsRequestSchema = BaseRequestSchema.extend({
|
|
|
345
359
|
export const ResolveDefinitionsRequestSchema = BaseRequestSchema.extend({
|
|
346
360
|
action: z.literal('resolve_definitions'),
|
|
347
361
|
stub_dir: z.string().min(1, 'Stub dir cannot be empty'),
|
|
348
|
-
aliases: z
|
|
362
|
+
aliases: z
|
|
363
|
+
.array(z.object({
|
|
364
|
+
alias: z.string().min(1),
|
|
365
|
+
protocol: z.enum(['http', 'graphql', 'socket', 'pubsub']),
|
|
366
|
+
type_kind: z.enum(['request', 'response']),
|
|
367
|
+
side: z.enum(['producer', 'consumer']),
|
|
368
|
+
procedure: z.boolean(),
|
|
369
|
+
}))
|
|
370
|
+
.min(1, 'At least one alias is required'),
|
|
349
371
|
});
|
|
350
372
|
const RetypeLocatorItemSchema = z.object({
|
|
351
373
|
item_id: z.string().min(1),
|
|
@@ -532,6 +554,8 @@ const LibraryClaimSchema = z.discriminatedUnion('kind', [
|
|
|
532
554
|
kind: z.literal('make'),
|
|
533
555
|
form: z.enum(['call', 'new']),
|
|
534
556
|
member: z.string().min(1).nullable(),
|
|
557
|
+
// Amendment 12: the verifier judges it (`claim_invalid`), not this schema.
|
|
558
|
+
of: z.string().min(1).optional(),
|
|
535
559
|
base: ClaimSlotSchema.optional(),
|
|
536
560
|
prefix: ClaimSlotSchema.optional(),
|
|
537
561
|
protocol: z.enum(['http', 'graphql', 'rpc', 'socket', 'message']).optional(),
|
|
@@ -682,6 +706,7 @@ export const VerifyLibraryClaimsRequestSchema = BaseRequestSchema.extend({
|
|
|
682
706
|
checks: z.array(LibraryCheckSchema),
|
|
683
707
|
// The contract's sample sends `null` for "no budget of the request's own".
|
|
684
708
|
budget_ms: z.number().int().nonnegative().nullable().optional(),
|
|
709
|
+
tsconfig_path: z.string().min(1).optional(),
|
|
685
710
|
});
|
|
686
711
|
export const ListLibrarySurfaceRequestSchema = BaseRequestSchema.extend({
|
|
687
712
|
action: z.literal('list_library_surface'),
|
|
@@ -716,6 +741,7 @@ export const SidecarRequestSchema = z.discriminatedUnion('action', [
|
|
|
716
741
|
HealthRequestSchema,
|
|
717
742
|
ShutdownRequestSchema,
|
|
718
743
|
ListProgramFilesRequestSchema,
|
|
744
|
+
WriteShadowRequestSchema,
|
|
719
745
|
ReachGraphRequestSchema,
|
|
720
746
|
ReachRequestSchema,
|
|
721
747
|
AddProgramFilesRequestSchema,
|
package/dist/hook/lead.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CheckResult } from "../contract.ts";
|
|
2
|
-
/** What one answer's leads need to print: the lines, and the keys to claim on delivery. */
|
|
3
|
-
export type LeadLines = {
|
|
4
|
-
lines: string[];
|
|
5
|
-
keys: string[];
|
|
6
|
-
};
|
|
7
|
-
/** The session key of a lead: the edited file and the new function's name. */
|
|
8
|
-
export declare function leadKey(result: CheckResult, relative: string, name: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* One line for each new function of `result` that carries a lead and has not
|
|
11
|
-
* been shown (`isNew`). The score and basis go to the log, never into the text.
|
|
12
|
-
*/
|
|
13
|
-
export declare function leadLines(result: CheckResult, relative: string, isNew: (key: string) => boolean, log?: (...parts: string[]) => void): LeadLines;
|
package/dist/hook/lead.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// The line an edit gets when a function it added looks like one the index
|
|
2
|
-
// already holds (carrick#3249). The binary decides (`recheck.new_functions[].lead`,
|
|
3
|
-
// `docs/local-mode-output.md`); this renders it, once per function per session.
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
/** The session key of a lead: the edited file and the new function's name. */
|
|
6
|
-
export function leadKey(result, relative, name) {
|
|
7
|
-
return `lead::${result.repo ?? ""}::${result.file ?? relative}::${name}`;
|
|
8
|
-
}
|
|
9
|
-
function where(lead, ownRepo) {
|
|
10
|
-
// `lead.repo` is a checkout folder name or an indexed repo name, never a path.
|
|
11
|
-
const spot = `${lead.file}:${lead.line}`;
|
|
12
|
-
return ownRepo !== null && lead.repo !== ownRepo ? `${lead.repo}/${spot}` : spot;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* One line for each new function of `result` that carries a lead and has not
|
|
16
|
-
* been shown (`isNew`). The score and basis go to the log, never into the text.
|
|
17
|
-
*/
|
|
18
|
-
export function leadLines(result, relative, isNew, log = () => { }) {
|
|
19
|
-
const out = { lines: [], keys: [] };
|
|
20
|
-
if (result.error)
|
|
21
|
-
return out;
|
|
22
|
-
const ownRepo = result.repo ? path.basename(result.repo) : null;
|
|
23
|
-
for (const made of result.recheck?.new_functions ?? []) {
|
|
24
|
-
const lead = made.lead;
|
|
25
|
-
if (!lead)
|
|
26
|
-
continue;
|
|
27
|
-
const key = leadKey(result, relative, made.name);
|
|
28
|
-
if (out.keys.includes(key) || !isNew(key))
|
|
29
|
-
continue;
|
|
30
|
-
const callers = lead.callers.map((caller) => `${caller.file}:${caller.line}`);
|
|
31
|
-
const more = lead.callers_total - callers.length;
|
|
32
|
-
const calledFrom = callers.length === 0 ? "" : ` (called from ${callers.join(", ")}${more > 0 ? `, +${more} more` : ""})`;
|
|
33
|
-
out.lines.push(`Carrick: \`${made.name}\` looks like \`${lead.name}\` at ${where(lead, ownRepo)}${calledFrom}: reuse or extend it if it does the same job.`);
|
|
34
|
-
out.keys.push(key);
|
|
35
|
-
log(`lead ${relative}::${made.name} -> ${lead.file}:${lead.line} basis=${lead.basis} score=${lead.score}`);
|
|
36
|
-
}
|
|
37
|
-
return out;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=lead.js.map
|
package/dist/hook/lead.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lead.js","sourceRoot":"","sources":["../../src/hook/lead.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,oFAAoF;AACpF,gFAAgF;AAEhF,OAAO,IAAI,MAAM,WAAW,CAAC;AAM7B,8EAA8E;AAC9E,MAAM,UAAU,OAAO,CAAC,MAAmB,EAAE,QAAgB,EAAE,IAAY;IACzE,OAAO,SAAS,MAAM,CAAC,IAAI,IAAI,EAAE,KAAK,MAAM,CAAC,IAAI,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;AAC3E,CAAC;AAED,SAAS,KAAK,CAAC,IAAU,EAAE,OAAsB;IAC/C,+EAA+E;IAC/E,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;IACzC,OAAO,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC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