@descryy/adapter-kotlin 0.1.0
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/adapter.d.ts +27 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +272 -0
- package/dist/adapter.js.map +1 -0
- package/dist/client.d.ts +93 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +344 -0
- package/dist/client.js.map +1 -0
- package/dist/extract.d.ts +56 -0
- package/dist/extract.d.ts.map +1 -0
- package/dist/extract.js +722 -0
- package/dist/extract.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/parse.d.ts +157 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +571 -0
- package/dist/parse.js.map +1 -0
- package/dist/retrofit.d.ts +78 -0
- package/dist/retrofit.d.ts.map +1 -0
- package/dist/retrofit.js +195 -0
- package/dist/retrofit.js.map +1 -0
- package/dist/routes.d.ts +54 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +231 -0
- package/dist/routes.js.map +1 -0
- package/dist/spring.d.ts +39 -0
- package/dist/spring.d.ts.map +1 -0
- package/dist/spring.js +231 -0
- package/dist/spring.js.map +1 -0
- package/dist/tree-sitter-kotlin.wasm +0 -0
- package/package.json +35 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Kotlin `LanguageAdapter` — breadth tier, tenth language.
|
|
3
|
+
*
|
|
4
|
+
* The first adapter to **share** an identity anchor rather than define one:
|
|
5
|
+
* `@descryy/adapter-jvm` is Java's, moved there unchanged because Kotlin answers
|
|
6
|
+
* the identity question the same way. Sharing rather than copying is the point —
|
|
7
|
+
* a copied rule is a rule that will hold in one of the two, measured elsewhere
|
|
8
|
+
* in this project at a two-week silent drift.
|
|
9
|
+
*
|
|
10
|
+
* The one place Kotlin diverges from Java is the fallback, and it diverges
|
|
11
|
+
* toward refusal. See `extract.ts`.
|
|
12
|
+
*/
|
|
13
|
+
import { type LanguageAdapter, type ResolutionLevel } from "@descryy/ir";
|
|
14
|
+
export declare const ADAPTER_ID = "adapter-kotlin";
|
|
15
|
+
export declare const ADAPTER_VERSION = "0.1.0";
|
|
16
|
+
export declare const DEFAULT_KOTLIN_GLOBS: readonly ["**/*.kt"];
|
|
17
|
+
export declare const LANGUAGE = "kotlin";
|
|
18
|
+
export interface KotlinAdapterOptions {
|
|
19
|
+
readonly globs?: readonly string[];
|
|
20
|
+
readonly maxResolution?: ResolutionLevel;
|
|
21
|
+
}
|
|
22
|
+
export interface KotlinAdapter extends LanguageAdapter {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly version: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function createKotlinAdapter(options?: KotlinAdapterOptions): KotlinAdapter;
|
|
27
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAML,KAAK,eAAe,EAGpB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AASrB,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,oBAAoB,sBAAuB,CAAC;AACzD,eAAO,MAAM,QAAQ,WAAW,CAAC;AA2CjC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC;CAC1C;AAcD,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CAkOrF"}
|
package/dist/adapter.js
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Kotlin `LanguageAdapter` — breadth tier, tenth language.
|
|
3
|
+
*
|
|
4
|
+
* The first adapter to **share** an identity anchor rather than define one:
|
|
5
|
+
* `@descryy/adapter-jvm` is Java's, moved there unchanged because Kotlin answers
|
|
6
|
+
* the identity question the same way. Sharing rather than copying is the point —
|
|
7
|
+
* a copied rule is a rule that will hold in one of the two, measured elsewhere
|
|
8
|
+
* in this project at a two-week silent drift.
|
|
9
|
+
*
|
|
10
|
+
* The one place Kotlin diverges from Java is the fallback, and it diverges
|
|
11
|
+
* toward refusal. See `extract.ts`.
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
import {} from "@descryy/ir";
|
|
16
|
+
import { discover, isolateFile } from "@descryy/adapter-common";
|
|
17
|
+
import { anchorOf, identityPackage, sourceRootOf } from "@descryy/adapter-jvm";
|
|
18
|
+
import { parserFor, parseText } from "@descryy/adapter-treesitter";
|
|
19
|
+
import { readKotlinFile } from "./parse.js";
|
|
20
|
+
import { extract } from "./extract.js";
|
|
21
|
+
export const ADAPTER_ID = "adapter-kotlin";
|
|
22
|
+
export const ADAPTER_VERSION = "0.1.0";
|
|
23
|
+
export const DEFAULT_KOTLIN_GLOBS = ["**/*.kt"];
|
|
24
|
+
export const LANGUAGE = "kotlin";
|
|
25
|
+
const PRODUCED_BY = `${ADAPTER_ID}@${ADAPTER_VERSION}`;
|
|
26
|
+
/**
|
|
27
|
+
* Where the grammar is, and what to say when it is not there.
|
|
28
|
+
*
|
|
29
|
+
* Kotlin's grammar is not published on npm, so unlike the first eight adapters
|
|
30
|
+
* there is no `require.resolve` fallback. The failure must name the command —
|
|
31
|
+
* an adapter that cannot parse and does not say so reports an empty graph as a
|
|
32
|
+
* clean one (DEC-171). Two locations because this module runs from `dist/` when
|
|
33
|
+
* built and from `src/` under Node's type stripping, which is how the unit
|
|
34
|
+
* tests import it.
|
|
35
|
+
*/
|
|
36
|
+
function grammarPath() {
|
|
37
|
+
const candidates = [
|
|
38
|
+
join(import.meta.dirname, "tree-sitter-kotlin.wasm"),
|
|
39
|
+
join(import.meta.dirname, "..", "dist", "tree-sitter-kotlin.wasm"),
|
|
40
|
+
];
|
|
41
|
+
for (const candidate of candidates) {
|
|
42
|
+
if (existsSync(candidate))
|
|
43
|
+
return candidate;
|
|
44
|
+
}
|
|
45
|
+
throw new Error("the Kotlin tree-sitter grammar is not present. It is not published on npm — it is fetched " +
|
|
46
|
+
"from the grammar author's GitHub release at a pinned sha256 (DEC-171):\n\n" +
|
|
47
|
+
" npm run grammar:fetch\n\n" +
|
|
48
|
+
`Looked in:\n${candidates.map((c) => ` ${c}`).join("\n")}\n` +
|
|
49
|
+
"Refusing to parse rather than report an empty graph.");
|
|
50
|
+
}
|
|
51
|
+
/** Build output and dependency checkouts are somebody else's source. */
|
|
52
|
+
function isGenerated(file) {
|
|
53
|
+
const path = `/${file}`;
|
|
54
|
+
return (path.includes("/build/generated/") ||
|
|
55
|
+
path.includes("/.gradle/") ||
|
|
56
|
+
path.includes("/build/tmp/") ||
|
|
57
|
+
path.includes("/out/production/") ||
|
|
58
|
+
path.includes("/out/test/"));
|
|
59
|
+
}
|
|
60
|
+
export function createKotlinAdapter(options = {}) {
|
|
61
|
+
const globs = options.globs ?? DEFAULT_KOTLIN_GLOBS;
|
|
62
|
+
const ceiling = options.maxResolution ?? 2;
|
|
63
|
+
let session;
|
|
64
|
+
let parser;
|
|
65
|
+
const filesUnder = (root) => discover(root.absolutePath, globs).filter((file) => !isGenerated(file));
|
|
66
|
+
const current = () => {
|
|
67
|
+
const live = session;
|
|
68
|
+
if (live === undefined)
|
|
69
|
+
return { nodes: [], edges: [], unresolved: [] };
|
|
70
|
+
return extract({
|
|
71
|
+
files: live.units,
|
|
72
|
+
producedBy: PRODUCED_BY,
|
|
73
|
+
scope: { repo: live.root.repo, ...(live.root.workspace === undefined ? {} : { workspace: live.root.workspace }) },
|
|
74
|
+
reached: live.reached,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
id: ADAPTER_ID,
|
|
79
|
+
version: ADAPTER_VERSION,
|
|
80
|
+
async detect(root) {
|
|
81
|
+
const files = filesUnder(root);
|
|
82
|
+
const evidence = [];
|
|
83
|
+
if (files.length > 0)
|
|
84
|
+
evidence.push(`${files.length} .kt source files outside build output`);
|
|
85
|
+
// The anchor's reach is the number that decides what this adapter can
|
|
86
|
+
// emit, so it is stated at detection rather than discovered in a gate.
|
|
87
|
+
if (files.length > 0) {
|
|
88
|
+
let anchored = 0;
|
|
89
|
+
for (const file of files) {
|
|
90
|
+
let text;
|
|
91
|
+
try {
|
|
92
|
+
text = readFileSync(join(root.absolutePath, file), "utf8");
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const packageName = /^[ \t]*package[ \t]+([A-Za-z_][\w.`]*)/m.exec(text)?.[1]?.replace(/`/g, "") ?? "";
|
|
98
|
+
if (sourceRootOf(file, packageName) !== undefined)
|
|
99
|
+
anchored += 1;
|
|
100
|
+
}
|
|
101
|
+
evidence.push(`${anchored} of ${files.length} files sit where their package declaration says, so their ` +
|
|
102
|
+
"module and source set are derivable. The rest emit nothing: anchoring on the package " +
|
|
103
|
+
"alone would give two source sets one identity, which Kotlin Multiplatform produces " +
|
|
104
|
+
"deliberately via expect/actual (DEC-173).");
|
|
105
|
+
evidence.push("Ktor is read on both halves of the contract join: the server routing DSL supplies routes, " +
|
|
106
|
+
"and the client's verb functions supply the calls that reach them. Spring MVC/WebFlux " +
|
|
107
|
+
"annotations (@RestController/@GetMapping/@RequestMapping) supply routes the same way Java's " +
|
|
108
|
+
"own reader does. Retrofit's declarative client interfaces (@GET/@POST on an interface method) " +
|
|
109
|
+
"supply the calls that reach them; raw OkHttp (OkHttpClient().newCall(...)) does not — measured " +
|
|
110
|
+
"at zero real call sites needing it, on two real corpora, see language-problems.md §9. No ORM " +
|
|
111
|
+
"extractor is bound, so models and their columns are reported as not tested rather than absent.");
|
|
112
|
+
evidence.push("no cross-language edges into Java-declared types are emitted. The reference corpus for " +
|
|
113
|
+
"that claim (okhttp) contains no Kotlin-to-Java reference at all, so the rule would " +
|
|
114
|
+
"ship unwitnessed.");
|
|
115
|
+
}
|
|
116
|
+
return { detected: files.length > 0, roots: files.length > 0 ? [root.absolutePath] : [], evidence };
|
|
117
|
+
},
|
|
118
|
+
capabilities() {
|
|
119
|
+
return {
|
|
120
|
+
maxResolution: ceiling,
|
|
121
|
+
nodeTypes: ["MODULE", "CLASS", "FUNCTION", "TEST_CASE", "API_ROUTE", "API_ENDPOINT"],
|
|
122
|
+
/**
|
|
123
|
+
* Kotlin **states** which supertype is the superclass: the constructor
|
|
124
|
+
* is invoked (`Base()`) and an interface cannot be. So `INHERITS` and
|
|
125
|
+
* `IMPLEMENTS` are separable from source here in a way Swift's are not
|
|
126
|
+
* — though the decision is still taken against the declaration table,
|
|
127
|
+
* with the syntax as confirmation.
|
|
128
|
+
*/
|
|
129
|
+
edgeTypes: ["IMPORTS", "CALLS", "TESTS", "IMPLEMENTS", "INHERITS", "USES_TYPE", "SERVES_API", "USES_API"],
|
|
130
|
+
hasCallHierarchy: false,
|
|
131
|
+
hasTypeHierarchy: false,
|
|
132
|
+
/**
|
|
133
|
+
* Directories this ecosystem installs dependencies or build output into —
|
|
134
|
+
* DEC-110's end state. The engine used to hold `node_modules`/`vendor`/`target`
|
|
135
|
+
* in a hardcoded list; it holds none of them now and consumes this instead.
|
|
136
|
+
*
|
|
137
|
+
* `isGenerated()` already excludes `/build/generated/` and `/build/tmp/`; the whole
|
|
138
|
+
* of Gradle's `build/` is output territory. `target/` covers a Maven-built module.
|
|
139
|
+
*
|
|
140
|
+
* Names only — the walk matches one path component, so a path or glob matches
|
|
141
|
+
* nothing. Nothing dotted — those are skipped structurally already.
|
|
142
|
+
*/
|
|
143
|
+
noiseDirectories: ["build", "target"],
|
|
144
|
+
// Ktor's routing DSL and Spring MVC/WebFlux annotations both supply
|
|
145
|
+
// routes; Ktor's client and Retrofit's declarative interfaces both
|
|
146
|
+
// supply calls. No ORM extractor is bound, so patterns 06/07 still
|
|
147
|
+
// skip naming the capability they wanted.
|
|
148
|
+
frameworkExtractors: ["ktor", "ktor-client", "spring", "retrofit"],
|
|
149
|
+
frameworkCapabilities: ["route-extractor", "client-call-extractor"],
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
async prepare(ctx) {
|
|
153
|
+
// Sorted, so which file wins a name collision is a property of the
|
|
154
|
+
// repository rather than of filesystem order.
|
|
155
|
+
const files = [...filesUnder(ctx.root)].sort();
|
|
156
|
+
parser ??= await parserFor(grammarPath());
|
|
157
|
+
const units = [];
|
|
158
|
+
const failures = [];
|
|
159
|
+
const unfinished = [];
|
|
160
|
+
const withoutAnchor = [];
|
|
161
|
+
const parsedWithErrors = [];
|
|
162
|
+
const anchors = new Map();
|
|
163
|
+
for (const file of files) {
|
|
164
|
+
if (ctx.signal.aborted)
|
|
165
|
+
break;
|
|
166
|
+
let text;
|
|
167
|
+
try {
|
|
168
|
+
text = readFileSync(join(ctx.root.absolutePath, file), "utf8");
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
failures.push({ kind: "unreadable", file, detail: error instanceof Error ? error.message : String(error) });
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const outcome = parseText(parser, file, text);
|
|
175
|
+
if (outcome.tree === undefined) {
|
|
176
|
+
if (outcome.failure !== undefined)
|
|
177
|
+
failures.push(outcome.failure);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
// Isolated: a throw in the walk used to cost the run rather than the file.
|
|
181
|
+
const read = isolateFile(file, () => readKotlinFile(file, { rootNode: outcome.tree.rootNode }));
|
|
182
|
+
outcome.tree.delete();
|
|
183
|
+
if (read.failure !== undefined) {
|
|
184
|
+
unfinished.push(read.failure);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const parsed = read.value;
|
|
188
|
+
if (parsed.hasError)
|
|
189
|
+
parsedWithErrors.push(file);
|
|
190
|
+
// The one divergence from Java, and it is the whole decision: an
|
|
191
|
+
// underivable source root produces NO identity package, and `extract.ts`
|
|
192
|
+
// mints nothing for such a file. Java falls back to the bare package;
|
|
193
|
+
// Kotlin refuses (DEC-173).
|
|
194
|
+
const sourceRoot = sourceRootOf(file, parsed.packageName);
|
|
195
|
+
if (sourceRoot === undefined) {
|
|
196
|
+
withoutAnchor.push(file);
|
|
197
|
+
units.push(parsed);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
let anchor = anchors.get(sourceRoot);
|
|
201
|
+
if (anchor === undefined) {
|
|
202
|
+
anchor = anchorOf(ctx.root.absolutePath, sourceRoot);
|
|
203
|
+
// `anchorOf` reads the source set as the segment AFTER the last `src`,
|
|
204
|
+
// which is the Maven and Gradle-JVM layout. Kotlin Multiplatform
|
|
205
|
+
// inverts it: ktor writes `ktor-io/darwin/src`, source set BEFORE
|
|
206
|
+
// `src`, so the rule returns "" for every platform and two source sets
|
|
207
|
+
// in one module collapse onto one identity.
|
|
208
|
+
//
|
|
209
|
+
// Measured before this line existed: 33 colliding MODULE ids on ktor,
|
|
210
|
+
// `HttpClient.kt` in `common/src` and `posix/src` among them. The
|
|
211
|
+
// refusal in `extract.ts` does not catch these — their source root IS
|
|
212
|
+
// derivable, so the failure is in the anchor rather than in the
|
|
213
|
+
// subtraction.
|
|
214
|
+
//
|
|
215
|
+
// The repair is the source root itself, which is already **derived by
|
|
216
|
+
// subtracting the package path** rather than matched against a list of
|
|
217
|
+
// source-set names. That distinction is the whole reason option 2 was
|
|
218
|
+
// struck: `src/<sourceSet>/<lang>` is a convention ktor does not
|
|
219
|
+
// follow, and this is not a convention at all — it is what remains
|
|
220
|
+
// after the package declaration is removed from the directory.
|
|
221
|
+
if (anchor.sourceSet === "")
|
|
222
|
+
anchor = { module: anchor.module, sourceSet: sourceRoot };
|
|
223
|
+
anchors.set(sourceRoot, anchor);
|
|
224
|
+
}
|
|
225
|
+
units.push({ ...parsed, identityPackage: identityPackage(anchor, parsed.packageName, "(default)") });
|
|
226
|
+
}
|
|
227
|
+
const reached = units.some((u) => u.identityPackage !== undefined) ? ceiling : 0;
|
|
228
|
+
session = { root: ctx.root, files, units, reached, failures, unfinished, withoutAnchor, parsedWithErrors };
|
|
229
|
+
return reached;
|
|
230
|
+
},
|
|
231
|
+
async parseFiles(files) {
|
|
232
|
+
const byFile = new Map((session?.units ?? []).map((unit) => [unit.file, unit]));
|
|
233
|
+
return files.map((file) => ({ file, tree: byFile.get(file.path) ?? {} }));
|
|
234
|
+
},
|
|
235
|
+
extractNodes() {
|
|
236
|
+
return current().nodes;
|
|
237
|
+
},
|
|
238
|
+
extractEdges() {
|
|
239
|
+
return current().edges;
|
|
240
|
+
},
|
|
241
|
+
async emit(ctx) {
|
|
242
|
+
await this.prepare(ctx);
|
|
243
|
+
const live = session;
|
|
244
|
+
const { nodes, edges, unresolved } = current();
|
|
245
|
+
const failedFiles = new Set([
|
|
246
|
+
...(live?.failures ?? []).map((f) => f.file),
|
|
247
|
+
...(live?.unfinished ?? []).map((f) => f.file),
|
|
248
|
+
]);
|
|
249
|
+
return {
|
|
250
|
+
repo: ctx.root.repo,
|
|
251
|
+
...(ctx.root.workspace === undefined ? {} : { workspace: ctx.root.workspace }),
|
|
252
|
+
commitSha: ctx.root.commitSha,
|
|
253
|
+
producedBy: PRODUCED_BY,
|
|
254
|
+
sourceFiles: (live?.files ?? []).filter((f) => !failedFiles.has(f)),
|
|
255
|
+
skippedFiles: [
|
|
256
|
+
...(live?.failures ?? []).map((f) => ({ file: f.file, reason: f.kind, detail: f.detail })),
|
|
257
|
+
// `other`: it parsed, and what failed is our walk of it. The detail says which.
|
|
258
|
+
...(live?.unfinished ?? []).map((f) => ({ file: f.file, reason: "other", detail: f.detail })),
|
|
259
|
+
],
|
|
260
|
+
reachedResolution: live?.reached ?? 0,
|
|
261
|
+
nodes,
|
|
262
|
+
edges,
|
|
263
|
+
unresolved,
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
async dispose() {
|
|
267
|
+
session = undefined;
|
|
268
|
+
parser = undefined;
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAUN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAwB,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAkC,MAAM,6BAA6B,CAAC;AAEnG,OAAO,EAAE,cAAc,EAAmB,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,CAAU,CAAC;AACzD,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAEjC,MAAM,WAAW,GAAG,GAAG,UAAU,IAAI,eAAe,EAAE,CAAC;AAEvD;;;;;;;;;GASG;AACH,SAAS,WAAW;IAClB,MAAM,UAAU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G,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC9E,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS;gBAC7B,UAAU,EAAE,WAAW;gBACvB,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACnE,YAAY,EAAE;oBACZ,GAAG,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;oBAC1F,gFAAgF;oBAChF,GAAG,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAgB,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;iBACvG;gBACD,iBAAiB,EAAE,IAAI,EAAE,OAAO,IAAI,CAAC;gBACrC,KAAK;gBACL,KAAK;gBACL,UAAU;aACX,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,OAAO;YACX,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP calls made *from* Kotlin — the caller half of the contract join.
|
|
3
|
+
*
|
|
4
|
+
* ```
|
|
5
|
+
* API_ROUTE ──SERVES_API──▶ API_ENDPOINT ◀──USES_API── caller
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* `routes.ts` produces the provider half. This produces the consumer half, and
|
|
9
|
+
* until it existed `adapter-kotlin` declared no `USES_API` at all, so golden
|
|
10
|
+
* pattern 08 was skipped rather than passed — declared incapacity, per DEC-043.
|
|
11
|
+
*
|
|
12
|
+
* ## Provenance, never the name — and here that is not optional
|
|
13
|
+
*
|
|
14
|
+
* `client.get("/orders/1")` is the single most dangerous shape available to a
|
|
15
|
+
* reader of Kotlin. `adapter-python` measured the equivalent: matching on the
|
|
16
|
+
* verb name alone would have minted **2,280 edges** to endpoints nothing
|
|
17
|
+
* serves, because every Django and Flask test suite calls `client.get(...)` on
|
|
18
|
+
* a *test client* that makes no HTTP request. Ktor's own `testApplication { }`
|
|
19
|
+
* hands the test a `client` with exactly that shape.
|
|
20
|
+
*
|
|
21
|
+
* Two independent conditions, both required:
|
|
22
|
+
*
|
|
23
|
+
* | condition | evidence |
|
|
24
|
+
* | --- | --- |
|
|
25
|
+
* | the file imports the verb | `io.ktor.client.request.*` (wildcard) or `io.ktor.client.request.get` (explicit) |
|
|
26
|
+
* | the receiver is a real client | a local or property **constructed** `HttpClient(...)`, or a parameter/property whose **written type** is `HttpClient` |
|
|
27
|
+
*
|
|
28
|
+
* The wildcard case is not a convenience — it is the common case. Counted
|
|
29
|
+
* across the reference set: **385** files write `import io.ktor.client.request.*`
|
|
30
|
+
* against **3** that import a verb explicitly. A reader that required the
|
|
31
|
+
* explicit form would have been built for a shape the corpus does not contain,
|
|
32
|
+
* which is the failure `adapter-python`'s own header records paying for.
|
|
33
|
+
*
|
|
34
|
+
* ## Interpolation means the opposite of what it means on the route side
|
|
35
|
+
*
|
|
36
|
+
* `routes.ts` **refuses** an interpolated path: a route template is written
|
|
37
|
+
* literally (`"/orders/{id}"`), so interpolation there means the route is
|
|
38
|
+
* assembled elsewhere and half of it is an endpoint that does not exist.
|
|
39
|
+
*
|
|
40
|
+
* Here it is inverted. `client.get("/orders/$id")` is how a caller writes a
|
|
41
|
+
* path *parameter*, and the interpolation is precisely the part that must
|
|
42
|
+
* become `{param}` for the call to join the route that serves it. Refusing it
|
|
43
|
+
* would refuse the only shape that ever joins.
|
|
44
|
+
*
|
|
45
|
+
* Both of Kotlin's interpolation spellings are read — `$id`
|
|
46
|
+
* (`interpolated_identifier`) and `${id}` (`interpolated_expression`). Naming
|
|
47
|
+
* only one of them is the defect this adapter's route reader shipped with.
|
|
48
|
+
*
|
|
49
|
+
* ## What is refused
|
|
50
|
+
*
|
|
51
|
+
* A path that is not a string literal at all · a path that is not
|
|
52
|
+
* repository-relative, which is an outbound call to somebody else's service and
|
|
53
|
+
* has no route on this side of the join · an absolute URL, for the same reason
|
|
54
|
+
* plus [DEC-014](../../../descry-core/DECISIONS.md): an endpoint is host-free,
|
|
55
|
+
* so `/v1/charges` on Stripe and `/v1/charges` here would be one node ·
|
|
56
|
+
* a receiver whose name is bound to `HttpClient` in one place and to something
|
|
57
|
+
* else in another, which this reader cannot separate without a type checker.
|
|
58
|
+
*/
|
|
59
|
+
import type { Node } from "@descryy/adapter-treesitter";
|
|
60
|
+
import type { KotlinImport } from "./parse.ts";
|
|
61
|
+
export interface KotlinClientCall {
|
|
62
|
+
readonly method: string;
|
|
63
|
+
/** The path with every interpolation collapsed to `{param}`. */
|
|
64
|
+
readonly path: string;
|
|
65
|
+
/** As written, for the ledger and for an adjudicator. */
|
|
66
|
+
readonly rawPath: string;
|
|
67
|
+
/** `client.get` — what the call site wrote. */
|
|
68
|
+
readonly client: string;
|
|
69
|
+
readonly line: number;
|
|
70
|
+
}
|
|
71
|
+
export interface KotlinClientRefusal {
|
|
72
|
+
readonly rawTarget: string;
|
|
73
|
+
readonly reason: string;
|
|
74
|
+
readonly line: number;
|
|
75
|
+
/** DEC-242's `attrs.blockedBy` — the literal blocking expression, or `null`. */
|
|
76
|
+
readonly blockedBy: string | null;
|
|
77
|
+
/** DEC-242's `attrs.refusalClass` — `undefined` means unclassified, never askable. */
|
|
78
|
+
readonly refusalClass: BaseRefusalClass | "out-of-scope" | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Diagnostic only, not part of DEC-242 — see `adapter-rust/src/client.ts`'s
|
|
81
|
+
* own doc for what this is and why it is not shipped as part of the
|
|
82
|
+
* contract. Present only on the generic fallthrough of `diagnoseArgument`.
|
|
83
|
+
*/
|
|
84
|
+
readonly argumentKind?: "field" | "call" | "concatenation" | "other";
|
|
85
|
+
}
|
|
86
|
+
export type BaseRefusalClass = "value-unknown" | "varies-per-call" | "capability-gap";
|
|
87
|
+
export interface KotlinClientCalls {
|
|
88
|
+
readonly calls: readonly KotlinClientCall[];
|
|
89
|
+
readonly refusals: readonly KotlinClientRefusal[];
|
|
90
|
+
}
|
|
91
|
+
/** Every HTTP call written in one file, and every one refused. */
|
|
92
|
+
export declare function readKtorClientCalls(root: Node, imports: readonly KotlinImport[]): KotlinClientCalls;
|
|
93
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAkB/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAA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