carrick 0.3.53
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/LICENSE.md +99 -0
- package/README.md +79 -0
- package/bin/carrick.mjs +168 -0
- package/dist/channel.d.ts +16 -0
- package/dist/channel.js +37 -0
- package/dist/channel.js.map +1 -0
- package/dist/cli.d.ts +29 -0
- package/dist/cli.js +60 -0
- package/dist/cli.js.map +1 -0
- package/dist/contract.d.ts +154 -0
- package/dist/contract.js +141 -0
- package/dist/contract.js.map +1 -0
- package/dist/diagnostics.d.ts +54 -0
- package/dist/diagnostics.js +199 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/hook/post-edit.d.ts +13 -0
- package/dist/hook/post-edit.js +76 -0
- package/dist/hook/post-edit.js.map +1 -0
- package/dist/hook/session-start.d.ts +2 -0
- package/dist/hook/session-start.js +44 -0
- package/dist/hook/session-start.js.map +1 -0
- package/dist/init/identity.d.ts +20 -0
- package/dist/init/identity.js +60 -0
- package/dist/init/identity.js.map +1 -0
- package/dist/init/repos.d.ts +19 -0
- package/dist/init/repos.js +46 -0
- package/dist/init/repos.js.map +1 -0
- package/dist/init/run.d.ts +11 -0
- package/dist/init/run.js +228 -0
- package/dist/init/run.js.map +1 -0
- package/dist/init/settings.d.ts +50 -0
- package/dist/init/settings.js +138 -0
- package/dist/init/settings.js.map +1 -0
- package/dist/log.d.ts +2 -0
- package/dist/log.js +35 -0
- package/dist/log.js.map +1 -0
- package/dist/native.d.ts +48 -0
- package/dist/native.js +127 -0
- package/dist/native.js.map +1 -0
- package/dist/render.d.ts +65 -0
- package/dist/render.js +334 -0
- package/dist/render.js.map +1 -0
- package/dist/root.d.ts +30 -0
- package/dist/root.js +82 -0
- package/dist/root.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +255 -0
- package/dist/server.js.map +1 -0
- package/dist/templates.d.ts +18 -0
- package/dist/templates.js +66 -0
- package/dist/templates.js.map +1 -0
- package/package.json +72 -0
- package/plugin/.claude-plugin/plugin.json +6 -0
- package/plugin/.lsp.json +14 -0
- package/plugin/hooks/hooks.json +27 -0
- package/sidecar/dist/src/bundler.d.ts +141 -0
- package/sidecar/dist/src/bundler.js +680 -0
- package/sidecar/dist/src/capture/anchors.d.ts +61 -0
- package/sidecar/dist/src/capture/anchors.js +1132 -0
- package/sidecar/dist/src/capture/api.d.ts +378 -0
- package/sidecar/dist/src/capture/api.js +10 -0
- package/sidecar/dist/src/capture/augmentations.d.ts +20 -0
- package/sidecar/dist/src/capture/augmentations.js +60 -0
- package/sidecar/dist/src/capture/check-classify.d.ts +58 -0
- package/sidecar/dist/src/capture/check-classify.js +189 -0
- package/sidecar/dist/src/capture/check-deep.d.ts +32 -0
- package/sidecar/dist/src/capture/check-deep.js +91 -0
- package/sidecar/dist/src/capture/check-poison.d.ts +40 -0
- package/sidecar/dist/src/capture/check-poison.js +155 -0
- package/sidecar/dist/src/capture/check-probe.d.ts +70 -0
- package/sidecar/dist/src/capture/check-probe.js +147 -0
- package/sidecar/dist/src/capture/check-scrub.d.ts +31 -0
- package/sidecar/dist/src/capture/check-scrub.js +71 -0
- package/sidecar/dist/src/capture/check-workspace.d.ts +52 -0
- package/sidecar/dist/src/capture/check-workspace.js +218 -0
- package/sidecar/dist/src/capture/check.d.ts +39 -0
- package/sidecar/dist/src/capture/check.js +450 -0
- package/sidecar/dist/src/capture/deep-walk.d.ts +62 -0
- package/sidecar/dist/src/capture/deep-walk.js +243 -0
- package/sidecar/dist/src/capture/index.d.ts +36 -0
- package/sidecar/dist/src/capture/index.js +477 -0
- package/sidecar/dist/src/capture/lockfile.d.ts +48 -0
- package/sidecar/dist/src/capture/lockfile.js +490 -0
- package/sidecar/dist/src/capture/machinery.d.ts +59 -0
- package/sidecar/dist/src/capture/machinery.js +160 -0
- package/sidecar/dist/src/capture/node-builder.d.ts +37 -0
- package/sidecar/dist/src/capture/node-builder.js +123 -0
- package/sidecar/dist/src/capture/paths-rewrite.d.ts +34 -0
- package/sidecar/dist/src/capture/paths-rewrite.js +100 -0
- package/sidecar/dist/src/capture/self-check.d.ts +38 -0
- package/sidecar/dist/src/capture/self-check.js +317 -0
- package/sidecar/dist/src/capture/specifiers.d.ts +39 -0
- package/sidecar/dist/src/capture/specifiers.js +56 -0
- package/sidecar/dist/src/definition-resolver.d.ts +57 -0
- package/sidecar/dist/src/definition-resolver.js +153 -0
- package/sidecar/dist/src/index.d.ts +14 -0
- package/sidecar/dist/src/index.js +564 -0
- package/sidecar/dist/src/monorepo-builder.d.ts +129 -0
- package/sidecar/dist/src/monorepo-builder.js +584 -0
- package/sidecar/dist/src/project-loader.d.ts +130 -0
- package/sidecar/dist/src/project-loader.js +399 -0
- package/sidecar/dist/src/type-inferrer.d.ts +940 -0
- package/sidecar/dist/src/type-inferrer.js +3540 -0
- package/sidecar/dist/src/type-structural-expander.d.ts +61 -0
- package/sidecar/dist/src/type-structural-expander.js +283 -0
- package/sidecar/dist/src/type-text-canonicalizer.d.ts +40 -0
- package/sidecar/dist/src/type-text-canonicalizer.js +297 -0
- package/sidecar/dist/src/types.d.ts +669 -0
- package/sidecar/dist/src/types.js +5 -0
- package/sidecar/dist/src/validators.d.ts +2214 -0
- package/sidecar/dist/src/validators.js +336 -0
- package/sidecar/package.json +6 -0
- package/templates/carrick.json +7 -0
- package/templates/carrick.yml +45 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anchor resolution for the surface entry: guards for addressable anchors
|
|
3
|
+
* (symbol / handler_return) and the locator + node-builder path for
|
|
4
|
+
* anonymous inferred types. Produces the final alias line for each anchor,
|
|
5
|
+
* or a recorded demotion -- never a silently wrong line.
|
|
6
|
+
*/
|
|
7
|
+
import ts from 'typescript';
|
|
8
|
+
import type { CaptureAnchorRequest, InferAnchorRequest } from './api.js';
|
|
9
|
+
export interface ResolvedAnchor {
|
|
10
|
+
request: CaptureAnchorRequest;
|
|
11
|
+
/** RHS of `export type <alias> = ...;` in the surface entry. */
|
|
12
|
+
aliasText: string;
|
|
13
|
+
serialization: 'emitted' | 'node_builder' | 'structural_fallback';
|
|
14
|
+
/** Present exactly for demotions (the alias line is `unknown`). */
|
|
15
|
+
failureReason?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Provenance for a non-demoting re-aim (#438/#439): recorded into the
|
|
18
|
+
* alias's `self_check_detail` when the alias self-checks clean, so a symbol
|
|
19
|
+
* anchor redirected from a value const to its `typeof` type sibling, or a
|
|
20
|
+
* builder-chain anchor moved off its config descriptor, stays traceable.
|
|
21
|
+
*/
|
|
22
|
+
reaimNote?: string;
|
|
23
|
+
/**
|
|
24
|
+
* carrick#766: why an alias ABSTAINED — the surface line is `unknown`
|
|
25
|
+
* because nothing was resolvable, not because a step failed.
|
|
26
|
+
*
|
|
27
|
+
* Deliberately NOT `failureReason`. The scanner's literal backfill
|
|
28
|
+
* (`backfill_anchors`, engine/type_compat_v2.rs) keys on
|
|
29
|
+
* `capture_failure_reason` and re-anchors any alias carrying one off the v1
|
|
30
|
+
* bundle's text. For an alias whose v1 answer was itself blind that text is
|
|
31
|
+
* a bare element symbol, and re-anchoring it would publish a confident
|
|
32
|
+
* contract whose array-ness was guessed — the #349/#306 false mismatch. An
|
|
33
|
+
* abstain has nothing better to fall back to, so it must not look
|
|
34
|
+
* backfillable; the reason rides `self_check_detail` instead.
|
|
35
|
+
*/
|
|
36
|
+
abstainReason?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Repo-root-relative source file -> extensionless specifier from entryDir. */
|
|
39
|
+
export declare function entryRelativeSpecifier(entryDir: string, repoRoot: string, sourceFile: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve one anchor against the analysis program. `placeholder` is the
|
|
42
|
+
* anchor's own placeholder alias declaration in the entry file -- the
|
|
43
|
+
* destination node the node builder anchors to (banked correction 1).
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveAnchor(program: ts.Program, request: CaptureAnchorRequest, args: {
|
|
46
|
+
repoRoot: string;
|
|
47
|
+
entryDir: string;
|
|
48
|
+
placeholder: ts.TypeAliasDeclaration | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* symbol_name -> entry-relative specifier for every sibling `symbol`
|
|
51
|
+
* anchor. A literal anchor whose text is a bare identifier naming one of
|
|
52
|
+
* these resolves through that module instead of dangling in the entry.
|
|
53
|
+
*/
|
|
54
|
+
siblingSymbolSpecs?: Map<string, string>;
|
|
55
|
+
}): ResolvedAnchor;
|
|
56
|
+
/**
|
|
57
|
+
* Locate the target node: tightest expression covering the byte span when
|
|
58
|
+
* given; else the expression matching expression_text on/after line_number;
|
|
59
|
+
* else the first expression starting on line_number.
|
|
60
|
+
*/
|
|
61
|
+
export declare function locateNode(sourceFile: ts.SourceFile, request: InferAnchorRequest): ts.Node | undefined;
|