carrick 0.3.157 → 0.3.158

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.
Files changed (142) hide show
  1. package/dist/cli.d.ts +7 -0
  2. package/dist/cli.js +4 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/contract.d.ts +8 -1
  5. package/dist/contract.js.map +1 -1
  6. package/dist/engine-ask.d.ts +21 -0
  7. package/dist/engine-ask.js +50 -0
  8. package/dist/engine-ask.js.map +1 -0
  9. package/dist/facts/diff.d.ts +14 -1
  10. package/dist/facts/diff.js +21 -8
  11. package/dist/facts/diff.js.map +1 -1
  12. package/dist/facts/fetch.d.ts +7 -0
  13. package/dist/facts/fetch.js +22 -1
  14. package/dist/facts/fetch.js.map +1 -1
  15. package/dist/facts/lines.d.ts +22 -4
  16. package/dist/facts/lines.js +31 -9
  17. package/dist/facts/lines.js.map +1 -1
  18. package/dist/facts/peers.d.ts +13 -4
  19. package/dist/facts/peers.js +17 -15
  20. package/dist/facts/peers.js.map +1 -1
  21. package/dist/facts/rules/packages.js +3 -1
  22. package/dist/facts/rules/packages.js.map +1 -1
  23. package/dist/facts/rules/same-name.js +1 -1
  24. package/dist/facts/rules/same-name.js.map +1 -1
  25. package/dist/facts/store.d.ts +15 -0
  26. package/dist/facts/store.js +30 -0
  27. package/dist/facts/store.js.map +1 -1
  28. package/dist/held/backoff.d.ts +8 -0
  29. package/dist/held/backoff.js +43 -0
  30. package/dist/held/backoff.js.map +1 -0
  31. package/dist/held/build.d.ts +17 -0
  32. package/dist/held/build.js +62 -0
  33. package/dist/held/build.js.map +1 -0
  34. package/dist/held/client.d.ts +12 -3
  35. package/dist/held/client.js +123 -8
  36. package/dist/held/client.js.map +1 -1
  37. package/dist/held/daemon.d.ts +47 -2
  38. package/dist/held/daemon.js +115 -23
  39. package/dist/held/daemon.js.map +1 -1
  40. package/dist/held/early.d.ts +28 -0
  41. package/dist/held/early.js +115 -0
  42. package/dist/held/early.js.map +1 -0
  43. package/dist/held/paths.d.ts +6 -0
  44. package/dist/held/paths.js +17 -0
  45. package/dist/held/paths.js.map +1 -1
  46. package/dist/held/place.d.ts +76 -30
  47. package/dist/held/place.js +121 -83
  48. package/dist/held/place.js.map +1 -1
  49. package/dist/held/run.js +24 -6
  50. package/dist/held/run.js.map +1 -1
  51. package/dist/held/runtime.d.ts +22 -0
  52. package/dist/held/runtime.js +612 -0
  53. package/dist/held/runtime.js.map +1 -0
  54. package/dist/held/shadow.d.ts +33 -0
  55. package/dist/held/shadow.js +68 -0
  56. package/dist/held/shadow.js.map +1 -0
  57. package/dist/held/steps.d.ts +11 -0
  58. package/dist/held/steps.js +29 -0
  59. package/dist/held/steps.js.map +1 -0
  60. package/dist/hook/confirm.d.ts +79 -0
  61. package/dist/hook/confirm.js +220 -0
  62. package/dist/hook/confirm.js.map +1 -0
  63. package/dist/hook/edit-flow.d.ts +14 -3
  64. package/dist/hook/edit-flow.js +113 -33
  65. package/dist/hook/edit-flow.js.map +1 -1
  66. package/dist/hook/generation.d.ts +19 -0
  67. package/dist/hook/generation.js +75 -0
  68. package/dist/hook/generation.js.map +1 -0
  69. package/dist/hook/late.d.ts +50 -9
  70. package/dist/hook/late.js +104 -24
  71. package/dist/hook/late.js.map +1 -1
  72. package/dist/hook/post-bash.js +3 -3
  73. package/dist/hook/post-bash.js.map +1 -1
  74. package/dist/hook/post-edit.js +2 -2
  75. package/dist/hook/post-edit.js.map +1 -1
  76. package/dist/hook/post-read.js +25 -3
  77. package/dist/hook/post-read.js.map +1 -1
  78. package/dist/hook/post-search.js +1 -1
  79. package/dist/hook/post-search.js.map +1 -1
  80. package/dist/hook/probe.js +1 -0
  81. package/dist/hook/probe.js.map +1 -1
  82. package/dist/hook/read-answer.d.ts +5 -0
  83. package/dist/hook/read-answer.js +8 -4
  84. package/dist/hook/read-answer.js.map +1 -1
  85. package/dist/hook/rechecks.d.ts +58 -2
  86. package/dist/hook/rechecks.js +132 -9
  87. package/dist/hook/rechecks.js.map +1 -1
  88. package/dist/hook/session-start.d.ts +1 -1
  89. package/dist/hook/session-start.js +19 -5
  90. package/dist/hook/session-start.js.map +1 -1
  91. package/dist/hook/similar.d.ts +1 -1
  92. package/dist/hook/similar.js +21 -8
  93. package/dist/hook/similar.js.map +1 -1
  94. package/dist/hook/stop-wait.js +35 -16
  95. package/dist/hook/stop-wait.js.map +1 -1
  96. package/dist/hook/timings.d.ts +29 -1
  97. package/dist/hook/timings.js +7 -1
  98. package/dist/hook/timings.js.map +1 -1
  99. package/dist/hook/user-prompt.js +2 -2
  100. package/dist/hook/user-prompt.js.map +1 -1
  101. package/dist/hosted-snapshot.d.ts +27 -0
  102. package/dist/hosted-snapshot.js +32 -0
  103. package/dist/hosted-snapshot.js.map +1 -1
  104. package/dist/init/hosted.js +2 -9
  105. package/dist/init/hosted.js.map +1 -1
  106. package/dist/render.d.ts +15 -1
  107. package/dist/render.js +50 -4
  108. package/dist/render.js.map +1 -1
  109. package/dist/server.js +1 -1
  110. package/dist/server.js.map +1 -1
  111. package/package.json +6 -6
  112. package/plugin/.claude-plugin/plugin.json +1 -1
  113. package/sidecar/dist/src/capture/anchors.d.ts +8 -0
  114. package/sidecar/dist/src/capture/anchors.js +3 -2
  115. package/sidecar/dist/src/capture/api.d.ts +70 -3
  116. package/sidecar/dist/src/capture/check-classify.d.ts +7 -0
  117. package/sidecar/dist/src/capture/check-classify.js +24 -0
  118. package/sidecar/dist/src/capture/check-probe.d.ts +76 -7
  119. package/sidecar/dist/src/capture/check-probe.js +147 -19
  120. package/sidecar/dist/src/capture/check.js +13 -1
  121. package/sidecar/dist/src/capture/graphql-leaves.d.ts +46 -0
  122. package/sidecar/dist/src/capture/graphql-leaves.js +142 -0
  123. package/sidecar/dist/src/capture/index.d.ts +4 -1
  124. package/sidecar/dist/src/capture/index.js +3 -1
  125. package/sidecar/dist/src/definition-resolver.d.ts +2 -1
  126. package/sidecar/dist/src/definition-resolver.js +15 -9
  127. package/sidecar/dist/src/engine-stamp.json +1 -1
  128. package/sidecar/dist/src/held-shadow.d.ts +12 -2
  129. package/sidecar/dist/src/held-shadow.js +9 -9
  130. package/sidecar/dist/src/index.js +18 -1
  131. package/sidecar/dist/src/library-claims.js +26 -3
  132. package/sidecar/dist/src/retype.d.ts +47 -0
  133. package/sidecar/dist/src/retype.js +274 -18
  134. package/sidecar/dist/src/site-find.d.ts +27 -0
  135. package/sidecar/dist/src/site-find.js +109 -0
  136. package/sidecar/dist/src/type-inferrer.d.ts +5 -0
  137. package/sidecar/dist/src/type-inferrer.js +8 -4
  138. package/sidecar/dist/src/type-structural-expander.d.ts +10 -0
  139. package/sidecar/dist/src/type-structural-expander.js +73 -4
  140. package/sidecar/dist/src/types.d.ts +50 -2
  141. package/sidecar/dist/src/validators.d.ts +328 -8
  142. package/sidecar/dist/src/validators.js +29 -0
@@ -0,0 +1,109 @@
1
+ /**
2
+ * `find_site`: the capture's own site finder, asked by a caller that held a
3
+ * value's span in one text and needs its node in another (a held check whose
4
+ * bounds an edit crossed). The value is found by its parent slot, never by its
5
+ * text: the node of the old span sits in a slot of its parent (the n-th child
6
+ * of a call, a `return`'s expression, an arrow's body), and the answer is the
7
+ * node in that slot of the new text nearest the old position carried through
8
+ * the edit, so an edit to the value's own text, or the same text elsewhere
9
+ * (another handler's send, a binding of the same name), cannot move it. A call's
10
+ * slot also needs the callee to read as before unless the edit reaches the call.
11
+ * A node must be one the capture reads a value type at (`isPreferredTarget`).
12
+ * No program is loaded and nothing is read from disk: both texts are the
13
+ * caller's.
14
+ */
15
+ import { ts } from 'ts-morph';
16
+ import { isPreferredTarget } from './capture/index.js';
17
+ /** The text a call's callee reads as, without whitespace. */
18
+ function headOf(parent, sourceFile) {
19
+ if (ts.isCallExpression(parent) || ts.isNewExpression(parent))
20
+ return parent.expression.getText(sourceFile).replace(/\s+/g, '');
21
+ return undefined;
22
+ }
23
+ function slotOf(node, sourceFile) {
24
+ const parent = node.parent;
25
+ if (!parent)
26
+ return undefined;
27
+ let index = -1;
28
+ let at = 0;
29
+ parent.forEachChild((child) => {
30
+ if (child === node)
31
+ index = at;
32
+ at += 1;
33
+ });
34
+ return index < 0 ? undefined : { parentKind: parent.kind, index, head: headOf(parent, sourceFile) };
35
+ }
36
+ /** The outermost value-space node whose span is exactly `[start, end)`. */
37
+ function nodeAtSpan(sourceFile, start, end) {
38
+ let found;
39
+ const visit = (node) => {
40
+ if (found || node.getEnd() < end || node.getStart(sourceFile) > start)
41
+ return;
42
+ if (node.getStart(sourceFile) === start && node.getEnd() === end && ts.isExpression(node)) {
43
+ found = node;
44
+ return;
45
+ }
46
+ node.forEachChild(visit);
47
+ };
48
+ visit(sourceFile);
49
+ return found;
50
+ }
51
+ /** The one region the edit changed, the common prefix and suffix cut off (the caller's `regionOfEdit`). */
52
+ function editRegion(oldText, newText) {
53
+ const limit = Math.min(oldText.length, newText.length);
54
+ let prefix = 0;
55
+ while (prefix < limit && oldText.charCodeAt(prefix) === newText.charCodeAt(prefix))
56
+ prefix += 1;
57
+ let suffix = 0;
58
+ while (suffix < limit - prefix && oldText.charCodeAt(oldText.length - 1 - suffix) === newText.charCodeAt(newText.length - 1 - suffix))
59
+ suffix += 1;
60
+ return { oldStart: prefix, oldEnd: oldText.length - suffix, newStart: prefix, newEnd: newText.length - suffix };
61
+ }
62
+ /** Where `position` of the old text lands in the new: shifted past the edit, kept before it, scaled inside it. */
63
+ function carried(position, region) {
64
+ if (position <= region.oldStart)
65
+ return position;
66
+ if (position >= region.oldEnd)
67
+ return position + (region.newEnd - region.newStart) - (region.oldEnd - region.oldStart);
68
+ return Math.min(region.newEnd, region.newStart + (position - region.oldStart));
69
+ }
70
+ export function findSite(request) {
71
+ const oldFile = ts.createSourceFile(request.file, request.oldText, ts.ScriptTarget.Latest, true);
72
+ const sourceFile = ts.createSourceFile(request.file, request.newText, ts.ScriptTarget.Latest, true);
73
+ const held = nodeAtSpan(oldFile, request.start, request.end);
74
+ const slot = held && slotOf(held, oldFile);
75
+ if (!slot)
76
+ return { reason: 'value_not_a_node' };
77
+ const region = editRegion(request.oldText, request.newText);
78
+ const target = carried(request.start, region);
79
+ let best;
80
+ let bestDistance = Infinity;
81
+ const visit = (node) => {
82
+ const parent = node.parent;
83
+ if (parent && parent.kind === slot.parentKind && isPreferredTarget(node) && ts.isExpression(node)) {
84
+ const at = slotOf(node, sourceFile);
85
+ if (at && at.index === slot.index) {
86
+ const start = node.getStart(sourceFile);
87
+ // The callee is how the slot is told from its namesakes; an edit that reaches the call may have changed it.
88
+ const reached = parent.getEnd() > region.newStart && parent.getStart(sourceFile) < region.newEnd;
89
+ if (at.head === slot.head || reached) {
90
+ const distance = Math.abs(start - target);
91
+ if (distance < bestDistance) {
92
+ best = node;
93
+ bestDistance = distance;
94
+ }
95
+ }
96
+ }
97
+ }
98
+ node.forEachChild(visit);
99
+ };
100
+ visit(sourceFile);
101
+ const node = best;
102
+ if (!node)
103
+ return { reason: 'value_not_a_node' };
104
+ // A call cannot wrap a spread, or the name a shorthand property is also the value of.
105
+ if (ts.isSpreadElement(node) || (ts.isIdentifier(node) && node.parent && ts.isShorthandPropertyAssignment(node.parent))) {
106
+ return { reason: 'not_wrappable' };
107
+ }
108
+ return { start: node.getStart(sourceFile), end: node.getEnd() };
109
+ }
@@ -264,6 +264,11 @@ export declare class TypeInferrer {
264
264
  sourceFile: SourceFile;
265
265
  call: CallExpression;
266
266
  } | undefined;
267
+ /**
268
+ * The source file a locator's `file_path` names (absolute, or relative to
269
+ * the repo root), added to the project when it is not loaded yet.
270
+ */
271
+ sourceFileOf(filePath: string): SourceFile | undefined;
267
272
  /**
268
273
  * Get or add a source file to the project
269
274
  */
@@ -1066,15 +1066,19 @@ export class TypeInferrer {
1066
1066
  * published type came from, not a guess at the line.
1067
1067
  */
1068
1068
  locateCall(request) {
1069
- const filePath = path.isAbsolute(request.file_path)
1070
- ? request.file_path
1071
- : path.join(this.repoRoot, request.file_path);
1072
- const sourceFile = this.getSourceFile(filePath);
1069
+ const sourceFile = this.sourceFileOf(request.file_path);
1073
1070
  if (!sourceFile)
1074
1071
  return undefined;
1075
1072
  const call = this.resolveTargetCallExpression(sourceFile, request);
1076
1073
  return call ? { sourceFile, call } : undefined;
1077
1074
  }
1075
+ /**
1076
+ * The source file a locator's `file_path` names (absolute, or relative to
1077
+ * the repo root), added to the project when it is not loaded yet.
1078
+ */
1079
+ sourceFileOf(filePath) {
1080
+ return this.getSourceFile(path.isAbsolute(filePath) ? filePath : path.join(this.repoRoot, filePath));
1081
+ }
1078
1082
  /**
1079
1083
  * Get or add a source file to the project
1080
1084
  */
@@ -31,6 +31,7 @@
31
31
  import { type Node, type Type, ts } from 'ts-morph';
32
32
  import { type ExternalImports } from './origin.js';
33
33
  import type { WireFormat } from './types.js';
34
+ import type { GraphqlRoot, GraphqlTypes } from './capture/index.js';
34
35
  /**
35
36
  * Bound on the structural-expansion recursion. Deep enough for every realistic
36
37
  * request/response shape; a backstop against pathological/recursive types the
@@ -89,6 +90,15 @@ export interface ExpandOptions {
89
90
  readonly overrides?: MemberOverrides;
90
91
  /** Which representation to print; see `WireFormat`. */
91
92
  readonly wire?: WireFormat;
93
+ /**
94
+ * For `'graphql_scalars'`: the producer service's SDL types and the root
95
+ * field the response answers (carrick#4403). Without a leaf for the root
96
+ * the print is the JSON form.
97
+ */
98
+ readonly graphql?: {
99
+ types: GraphqlTypes;
100
+ root: GraphqlRoot;
101
+ };
92
102
  /**
93
103
  * Where in the recursion the walk starts. Production callers never set it —
94
104
  * depth is walk state — but the `MAX_EXPANSION_DEPTH` backstop is reachable
@@ -32,6 +32,7 @@ import { ts } from 'ts-morph';
32
32
  import { canonicalizeUnionsInText, foldBooleanLiterals, } from './type-text-canonicalizer.js';
33
33
  import { isExternalOrigin } from './origin.js';
34
34
  import { notePrintedType } from './printed-names.js';
35
+ import { graphqlDeclaresType, graphqlFieldLeaf, graphqlRootLeaf, graphqlScalarSent, withoutNonNull, } from './capture/index.js';
35
36
  /**
36
37
  * Bound on the structural-expansion recursion. Deep enough for every realistic
37
38
  * request/response shape; a backstop against pathological/recursive types the
@@ -72,8 +73,67 @@ function childCursor(cursor, segment) {
72
73
  * representation (`WireFormat`).
73
74
  */
74
75
  export function expandTypeStructural(type, origin, options = {}) {
75
- const { overrides, wire = 'declared', depth = 0 } = options;
76
- return expandAt(type, new Set(), depth, overrides ? { overrides, position: '' } : undefined, wire, origin);
76
+ const { overrides, wire = 'declared', depth = 0, graphql } = options;
77
+ return expandAt(type, new Set(), depth, overrides ? { overrides, position: '' } : undefined, wire === 'graphql_scalars'
78
+ ? graphqlWalkFrom(graphql)
79
+ : wire === 'unknown'
80
+ ? 'declared' // an unknown form prints as declared (carrick#4402)
81
+ : wire, origin);
82
+ }
83
+ /** The walk's start for a GraphQL producer response: its root leaf, or JSON. */
84
+ function graphqlWalkFrom(graphql) {
85
+ const leaf = graphql && graphqlRootLeaf(graphql.types, graphql.root);
86
+ return leaf ? { leaf, types: graphql.types } : 'json';
87
+ }
88
+ /**
89
+ * The walk below the member `name` of a value at `wire`: the field's own
90
+ * leaf under a GraphQL object type, JSON for a field the SDL does not name,
91
+ * and `wire` itself everywhere else.
92
+ */
93
+ function memberWalk(wire, name) {
94
+ if (typeof wire !== 'object')
95
+ return wire;
96
+ const leaf = withoutNonNull(wire.leaf);
97
+ if (!('type' in leaf))
98
+ return 'json';
99
+ const field = graphqlFieldLeaf(wire.types, leaf.type, name);
100
+ return field ? { leaf: field, types: wire.types } : 'json';
101
+ }
102
+ /**
103
+ * A value at a GraphQL leaf, printed as the server sends it (carrick#4403),
104
+ * mirroring the probe's `GqlLeafSent`: `null`, `undefined`, `any` and
105
+ * `unknown` stay; a union maps each member; a list maps its elements; a
106
+ * built-in scalar is the type it sends; any other scalar, an enum, a type
107
+ * reference the table does not hold, and a shape the leaf does not describe
108
+ * print in the JSON form. `undefined` means an object type over an object
109
+ * value: the caller walks its members.
110
+ */
111
+ function graphqlLeafText(type, seen, depth, cursor, wire, origin) {
112
+ const leaf = withoutNonNull(wire.leaf);
113
+ const here = { leaf, types: wire.types };
114
+ if (type.isNull() || type.isUndefined() || type.isAny() || type.isUnknown()) {
115
+ return namedText(type);
116
+ }
117
+ if (type.isUnion()) {
118
+ return canonicalMembers(type.getUnionTypes(), seen, depth, cursor, here, origin).join(' | ');
119
+ }
120
+ const json = () => expandAt(type, seen, depth, cursor, 'json', origin);
121
+ if ('list' in leaf) {
122
+ const element = type.isArray() ? type.getArrayElementType() : undefined;
123
+ if (!element)
124
+ return json();
125
+ const inner = expandAt(element, seen, depth + 1, childCursor(cursor, '<0>'), { leaf: leaf.list, types: wire.types }, origin);
126
+ return element.isUnion() || element.isIntersection() ? `(${inner})[]` : `${inner}[]`;
127
+ }
128
+ if ('scalar' in leaf)
129
+ return graphqlScalarSent(leaf.scalar) ?? json();
130
+ if (!('type' in leaf) || !graphqlDeclaresType(wire.types, leaf.type))
131
+ return json();
132
+ if (type.isArray() || isTuple(type))
133
+ return json();
134
+ if (type.getCallSignatures().length > 0)
135
+ return namedText(type);
136
+ return undefined;
77
137
  }
78
138
  /**
79
139
  * The type `JSON.stringify` serialises in place of a value of `type`: the
@@ -120,6 +180,11 @@ function expandAt(type, seen, depth, at, wire, origin) {
120
180
  if (!hasOverrideBelow(cursor))
121
181
  cursor = undefined;
122
182
  }
183
+ if (typeof wire === 'object') {
184
+ const text = graphqlLeafText(type, seen, depth, cursor, wire, origin);
185
+ if (text !== undefined)
186
+ return text;
187
+ }
123
188
  // Primitives & literals: nothing to inline.
124
189
  if (type.isString() ||
125
190
  type.isNumber() ||
@@ -247,7 +312,10 @@ function backstopText(type) {
247
312
  * case the joined output is the same whichever way round they go.
248
313
  */
249
314
  function canonicalMembers(members, seen, depth, cursor, wire, origin) {
250
- return orderMembers(members, (member) => expandAt(member, seen, depth + 1, cursor, wire, origin));
315
+ const texts = orderMembers(members, (member) => expandAt(member, seen, depth + 1, cursor, wire, origin));
316
+ // Under a GraphQL leaf several members can send one type (`bigint |
317
+ // string` under `String`): print it once (carrick#4403).
318
+ return typeof wire === 'object' ? [...new Set(texts)] : texts;
251
319
  }
252
320
  /**
253
321
  * The canonical order itself, over whatever text `render` gives each member.
@@ -268,7 +336,8 @@ function orderMembers(members, render) {
268
336
  return rendered.map((entry) => entry.text);
269
337
  }
270
338
  /** Render a single property as `name[?]: <expanded>`. */
271
- function expandProperty(prop, owner, seen, depth, at, wire, origin) {
339
+ function expandProperty(prop, owner, seen, depth, at, parentWire, origin) {
340
+ const wire = memberWalk(parentWire, prop.getName());
272
341
  const optional = (prop.getFlags() & ts.SymbolFlags.Optional) !== 0;
273
342
  const propDecl = prop.getDeclarations()[0];
274
343
  // Render the key from the declaration's name node so quoted/computed keys
@@ -303,6 +303,20 @@ export interface WriteShadowRequest extends BaseRequest {
303
303
  action: 'write_shadow';
304
304
  out_dir: string;
305
305
  }
306
+ /**
307
+ * Find again, in a file's new text, the node the old text's span `[start, end)`
308
+ * named, with the capture's own exact-text finder (see site-find.ts). `file`
309
+ * only names the file (its extension picks JavaScript or TypeScript syntax);
310
+ * both texts are the caller's, so nothing is read from disk.
311
+ */
312
+ export interface FindSiteRequest extends BaseRequest {
313
+ action: 'find_site';
314
+ file: string;
315
+ oldText: string;
316
+ newText: string;
317
+ start: number;
318
+ end: number;
319
+ }
306
320
  /**
307
321
  * The import graph without statement texts. Every name and path is an index
308
322
  * into `strings`. Per file: its path, whether it is a script, its declared
@@ -447,6 +461,8 @@ export interface ResolveDefinitionsRequest extends BaseRequest {
447
461
  stub_dir: string;
448
462
  /** Surface type aliases to resolve, each with the payload it types. */
449
463
  aliases: DefinitionAlias[];
464
+ /** The service's SDL output types (carrick#4403), when it serves a schema. */
465
+ graphql_types?: import('./capture/api.js').GraphqlTypes;
450
466
  }
451
467
  /**
452
468
  * One surface alias to resolve, and the payload it types: which protocol,
@@ -468,6 +484,13 @@ export interface DefinitionAlias {
468
484
  * (carrick#4275), so it prints as declared until that is a known fact.
469
485
  */
470
486
  procedure: boolean;
487
+ /**
488
+ * The root field a GraphQL producer response answers (carrick#4403), from
489
+ * its manifest entry. With the request's `graphql_types`, the stored text
490
+ * prints each built-in scalar leaf in the type that scalar sends
491
+ * (`wireFormFor`).
492
+ */
493
+ graphql_root?: import('./capture/api.js').GraphqlRoot;
471
494
  }
472
495
  /**
473
496
  * One consumer call to retype with the producer's response type (carrick#1491).
@@ -496,6 +519,12 @@ export interface RetypeItem extends RetypeLocatorItem {
496
519
  producer_unwidened_type?: string;
497
520
  /** Judge the form JSON puts on the wire (an `http` response). */
498
521
  wire: boolean;
522
+ /**
523
+ * The key path of the procedure the call names (`orders.list`): the call's
524
+ * own type is the router's, so the retype judges the consumer's code
525
+ * against it (carrick#937).
526
+ */
527
+ procedure_path?: string;
499
528
  }
500
529
  /**
501
530
  * Ask, without a producer type, which consumer calls the retype abstains for
@@ -958,7 +987,7 @@ export interface ListLibrarySurfaceRequest extends BaseRequest {
958
987
  /**
959
988
  * Union type for all possible sidecar requests
960
989
  */
961
- export type SidecarRequest = RetypeCheckRequest | RetypePrescreenRequest | VerifyClientSemanticsRequest | VerifyLibraryClaimsRequest | ListLibrarySurfaceRequest | InitRequest | BundleRequest | CaptureV2Request | CheckV2Request | InferRequest | ResolveDefinitionsRequest | HealthRequest | ShutdownRequest | ListProgramFilesRequest | WriteShadowRequest | ReachGraphRequest | ReachRequest | AddProgramFilesRequest | PositionRowsRequest | ImplementationsRequest;
990
+ export type SidecarRequest = RetypeCheckRequest | RetypePrescreenRequest | VerifyClientSemanticsRequest | VerifyLibraryClaimsRequest | ListLibrarySurfaceRequest | InitRequest | BundleRequest | CaptureV2Request | CheckV2Request | InferRequest | ResolveDefinitionsRequest | HealthRequest | ShutdownRequest | ListProgramFilesRequest | WriteShadowRequest | FindSiteRequest | ReachGraphRequest | ReachRequest | AddProgramFilesRequest | PositionRowsRequest | ImplementationsRequest;
962
991
  /**
963
992
  * Request for a specific symbol to be bundled
964
993
  */
@@ -1221,6 +1250,19 @@ export interface ListProgramFilesResponse extends BaseResponse {
1221
1250
  export interface WriteShadowResponse extends BaseResponse, Partial<ShadowResult> {
1222
1251
  errors?: string[];
1223
1252
  }
1253
+ /**
1254
+ * Response for find_site action: the node's new bounds (offsets into
1255
+ * `newText`, `start` excluding leading trivia), or the reason there are none.
1256
+ * `value_not_a_node`: no node of the new text fills the slot the old span sat in. `not_wrappable`:
1257
+ * the node is one a call cannot wrap in place (a spread, a shorthand
1258
+ * property's name).
1259
+ */
1260
+ export interface FindSiteResponse extends BaseResponse {
1261
+ start?: number;
1262
+ end?: number;
1263
+ reason?: 'value_not_a_node' | 'not_wrappable';
1264
+ errors?: string[];
1265
+ }
1224
1266
  /**
1225
1267
  * Response for reach_graph action
1226
1268
  */
@@ -1374,6 +1416,12 @@ export interface SurfaceSignature {
1374
1416
  * signature returns nothing.
1375
1417
  */
1376
1418
  result_candidates?: SurfaceResultCandidates;
1419
+ /**
1420
+ * On a `construct` entry only, and only when true: the class it constructs
1421
+ * is abstract, so `new` on it is a type error. Absent otherwise. Part of
1422
+ * the surface hash, so a package that declares one gets a new key.
1423
+ */
1424
+ abstract?: true;
1377
1425
  }
1378
1426
  /** What a signature's return offers as its result, by rule R (`result-candidates.ts`). */
1379
1427
  export interface SurfaceResultCandidates {
@@ -1577,7 +1625,7 @@ export interface ListLibrarySurfaceResponse extends BaseResponse {
1577
1625
  /**
1578
1626
  * Union type for all possible sidecar responses
1579
1627
  */
1580
- export type SidecarResponse = RetypeCheckResponse | RetypePrescreenResponse | VerifyClientSemanticsResponse | VerifyLibraryClaimsResponse | ListLibrarySurfaceResponse | InitResponse | BundleResponse | CaptureV2Response | CheckV2Response | InferResponse | ResolveDefinitionsResponse | HealthResponse | ShutdownResponse | ListProgramFilesResponse | WriteShadowResponse | ReachGraphResponse | ReachResponse | AddProgramFilesResponse | PositionRowsResponse | ImplementationsResponse | ErrorResponse;
1628
+ export type SidecarResponse = RetypeCheckResponse | RetypePrescreenResponse | VerifyClientSemanticsResponse | VerifyLibraryClaimsResponse | ListLibrarySurfaceResponse | InitResponse | BundleResponse | CaptureV2Response | CheckV2Response | InferResponse | ResolveDefinitionsResponse | HealthResponse | ShutdownResponse | ListProgramFilesResponse | WriteShadowResponse | FindSiteResponse | ReachGraphResponse | ReachResponse | AddProgramFilesResponse | PositionRowsResponse | ImplementationsResponse | ErrorResponse;
1581
1629
  /**
1582
1630
  * An entry in the type manifest
1583
1631
  */