@suss/ir-core 0.0.1

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/index.js ADDED
@@ -0,0 +1,435 @@
1
+ import {
2
+ BoundaryBindingSchema,
3
+ ConfidenceInfoSchema,
4
+ ConfidenceLevelSchema,
5
+ ConfidenceSourceSchema,
6
+ FunctionCallSemanticsSchema,
7
+ GraphqlOperationSemanticsSchema,
8
+ GraphqlResolverSemanticsSchema,
9
+ MessageBusSemanticsSchema,
10
+ RestSemanticsSchema,
11
+ RuntimeConfigSemanticsSchema,
12
+ SemanticsSchema,
13
+ SourceLocationSchema,
14
+ StorageRelationalSemanticsSchema,
15
+ TypeShapeSchema
16
+ } from "./chunk-BWK3IPL7.js";
17
+
18
+ // src/boundaryKey.ts
19
+ function normalizePath(path) {
20
+ let normalized = path.replace(/:([a-zA-Z_]\w*)/g, "{$1}");
21
+ if (normalized.length > 1 && normalized.endsWith("/")) {
22
+ normalized = normalized.slice(0, -1);
23
+ }
24
+ normalized = normalized.replace(
25
+ /\{[^}]+\}|[^{]+/g,
26
+ (segment) => segment.startsWith("{") ? segment : segment.toLowerCase()
27
+ );
28
+ return normalized;
29
+ }
30
+ function boundaryKey(binding) {
31
+ const semantics = binding.semantics;
32
+ if (semantics.name === "rest") {
33
+ if (semantics.method === "" || semantics.path === "") {
34
+ return null;
35
+ }
36
+ const method = semantics.method.toUpperCase();
37
+ const path = normalizePath(semantics.path);
38
+ return `${method} ${path}`;
39
+ }
40
+ if (semantics.name === "graphql-resolver") {
41
+ return `gql:${semantics.typeName}.${semantics.fieldName}`;
42
+ }
43
+ if (semantics.name === "function-call") {
44
+ if (semantics.package !== void 0 && semantics.exportPath !== void 0 && semantics.exportPath.length > 0) {
45
+ return `fn:${semantics.package}::${semantics.exportPath.join(".")}`;
46
+ }
47
+ return null;
48
+ }
49
+ return null;
50
+ }
51
+
52
+ // src/suppressions.ts
53
+ import { z } from "zod";
54
+ var SuppressionRuleSchema = z.object({
55
+ /**
56
+ * Finding kind to match — any behavioural or intent finding kind.
57
+ * Open here (this package sits below both IRs); the loader
58
+ * validates against the published kind enums.
59
+ */
60
+ kind: z.string().optional(),
61
+ /**
62
+ * Boundary as a human-readable key, e.g. "GET /pet/{petId}" or
63
+ * "fn:@acme/api::getUser". REST keys are normalized via the same
64
+ * path normalizer the checkers use, so `:id` and `{id}` compare
65
+ * equal.
66
+ */
67
+ boundary: z.string().optional(),
68
+ /**
69
+ * Consumer-side discriminators (narrowest useful match). Only
70
+ * meaningful for behavioural findings — a rule that specifies
71
+ * `consumer` never matches an intent finding, which has no
72
+ * consumer side.
73
+ */
74
+ consumer: z.object({
75
+ summary: z.string().optional(),
76
+ transitionId: z.string().optional()
77
+ }).optional(),
78
+ /**
79
+ * "narrow" (default): requires at least (kind + boundary) OR
80
+ * (kind + consumer.transitionId) — enough to target a specific
81
+ * finding class. "broad" opts in to kind-only or boundary-only
82
+ * matches, which silence future regressions in that category too.
83
+ */
84
+ scope: z.enum(["narrow", "broad"]).default("narrow"),
85
+ /** Required human-written justification. */
86
+ reason: z.string().min(1),
87
+ /** What to do when a finding matches. */
88
+ effect: z.enum(["mark", "downgrade", "hide"]).default("mark")
89
+ }).strict();
90
+ var SuppressionFileSchema = z.object({
91
+ version: z.literal(1),
92
+ rules: z.array(SuppressionRuleSchema)
93
+ }).strict();
94
+ function validateRule(rule) {
95
+ if (rule.scope === "broad") {
96
+ if (rule.kind === void 0 && rule.boundary === void 0 && rule.consumer === void 0) {
97
+ return "broad-scope rule must constrain at least one field (kind, boundary, or consumer)";
98
+ }
99
+ return null;
100
+ }
101
+ const hasKind = rule.kind !== void 0;
102
+ const hasBoundary = rule.boundary !== void 0;
103
+ const hasConsumerTxn = rule.consumer?.transitionId !== void 0;
104
+ if (hasKind && (hasBoundary || hasConsumerTxn)) {
105
+ return null;
106
+ }
107
+ return "narrow-scope rule must specify kind AND (boundary OR consumer.transitionId); set scope: 'broad' to silence wider categories";
108
+ }
109
+ function normalizeRuleBoundary(raw) {
110
+ const trimmed = raw.trim();
111
+ const spaceIdx = trimmed.indexOf(" ");
112
+ if (spaceIdx < 0) {
113
+ return trimmed;
114
+ }
115
+ const method = trimmed.slice(0, spaceIdx).toUpperCase();
116
+ const path = trimmed.slice(spaceIdx + 1);
117
+ return `${method} ${normalizePath(path)}`;
118
+ }
119
+ function ruleBoundaryMatchesKey(ruleBoundary, key) {
120
+ if (key === null) {
121
+ return false;
122
+ }
123
+ return ruleBoundary === key || normalizeRuleBoundary(ruleBoundary) === key;
124
+ }
125
+ var SEVERITY_DOWNGRADE = {
126
+ error: "warning",
127
+ warning: "info",
128
+ info: "info"
129
+ };
130
+ function applyRuleToFinding(rule, finding) {
131
+ const common = {
132
+ reason: rule.reason,
133
+ effect: rule.effect
134
+ };
135
+ if (rule.effect === "downgrade") {
136
+ return {
137
+ ...finding,
138
+ severity: SEVERITY_DOWNGRADE[finding.severity],
139
+ suppressed: { ...common, originalSeverity: finding.severity }
140
+ };
141
+ }
142
+ return { ...finding, suppressed: { ...common } };
143
+ }
144
+ function applySuppressionsToFindings(findings, rules, matches, opts = {}) {
145
+ const out = [];
146
+ for (const f of findings) {
147
+ const rule = rules.find(
148
+ (r) => (r.kind === void 0 || r.kind === f.kind) && matches(r, f)
149
+ );
150
+ if (rule === void 0) {
151
+ out.push(f);
152
+ continue;
153
+ }
154
+ const applied = applyRuleToFinding(rule, f);
155
+ if (applied.suppressed?.effect === "hide" && !opts.keepHidden) {
156
+ continue;
157
+ }
158
+ out.push(applied);
159
+ }
160
+ return out;
161
+ }
162
+ function countsForThreshold(finding) {
163
+ if (finding.suppressed === void 0) {
164
+ return true;
165
+ }
166
+ return finding.suppressed.effect === "downgrade";
167
+ }
168
+
169
+ // src/typeShapeMatch.ts
170
+ function bodyShapesMatch(actual, declared) {
171
+ if (actual.type === "unknown" || declared.type === "unknown") {
172
+ return "unknown";
173
+ }
174
+ if (actual.type === "ref" || declared.type === "ref") {
175
+ if (actual.type === "ref" && declared.type === "ref" && actual.name === declared.name) {
176
+ return "match";
177
+ }
178
+ return "unknown";
179
+ }
180
+ if (actual.type === "union") {
181
+ return combine(actual.variants.map((v) => bodyShapesMatch(v, declared)));
182
+ }
183
+ if (declared.type === "union") {
184
+ return matchAny(actual, declared.variants);
185
+ }
186
+ if (declared.type === "dictionary") {
187
+ if (actual.type === "dictionary") {
188
+ return bodyShapesMatch(actual.values, declared.values);
189
+ }
190
+ if (actual.type === "record") {
191
+ if (actual.spreads && actual.spreads.length > 0) {
192
+ return "unknown";
193
+ }
194
+ const results = Object.values(actual.properties).map(
195
+ (v) => bodyShapesMatch(v, declared.values)
196
+ );
197
+ return combine(results);
198
+ }
199
+ return "nomatch";
200
+ }
201
+ if (actual.type === "dictionary") {
202
+ return declared.type === "record" ? "unknown" : "nomatch";
203
+ }
204
+ if (declared.type === "record") {
205
+ if (actual.type !== "record") {
206
+ return "nomatch";
207
+ }
208
+ if (actual.spreads && actual.spreads.length > 0 || declared.spreads && declared.spreads.length > 0) {
209
+ return "unknown";
210
+ }
211
+ const results = [];
212
+ for (const [key, declaredValue] of Object.entries(declared.properties)) {
213
+ const actualValue = actual.properties[key];
214
+ if (actualValue === void 0) {
215
+ if (allowsUndefined(declaredValue)) {
216
+ continue;
217
+ }
218
+ return "nomatch";
219
+ }
220
+ results.push(bodyShapesMatch(actualValue, declaredValue));
221
+ }
222
+ return combine(results);
223
+ }
224
+ if (declared.type === "array") {
225
+ if (actual.type !== "array") {
226
+ return "nomatch";
227
+ }
228
+ return bodyShapesMatch(actual.items, declared.items);
229
+ }
230
+ if (declared.type === "literal") {
231
+ if (actual.type !== "literal") {
232
+ return "nomatch";
233
+ }
234
+ return actual.value === declared.value ? "match" : "nomatch";
235
+ }
236
+ if (declared.type === "text") {
237
+ if (actual.type === "text") {
238
+ return "match";
239
+ }
240
+ if (actual.type === "literal" && typeof actual.value === "string") {
241
+ return "match";
242
+ }
243
+ return "nomatch";
244
+ }
245
+ if (declared.type === "integer") {
246
+ if (actual.type === "integer") {
247
+ return "match";
248
+ }
249
+ if (actual.type === "literal" && typeof actual.value === "number" && Number.isInteger(actual.value)) {
250
+ return "match";
251
+ }
252
+ return "nomatch";
253
+ }
254
+ if (declared.type === "number") {
255
+ if (actual.type === "number" || actual.type === "integer") {
256
+ return "match";
257
+ }
258
+ if (actual.type === "literal" && typeof actual.value === "number") {
259
+ return "match";
260
+ }
261
+ return "nomatch";
262
+ }
263
+ if (declared.type === "boolean") {
264
+ if (actual.type === "boolean") {
265
+ return "match";
266
+ }
267
+ if (actual.type === "literal" && typeof actual.value === "boolean") {
268
+ return "match";
269
+ }
270
+ return "nomatch";
271
+ }
272
+ if (declared.type === "null") {
273
+ return actual.type === "null" ? "match" : "nomatch";
274
+ }
275
+ if (declared.type === "undefined") {
276
+ return actual.type === "undefined" ? "match" : "nomatch";
277
+ }
278
+ return "nomatch";
279
+ }
280
+ function matchAny(actual, variants) {
281
+ let sawUnknown = false;
282
+ for (const v of variants) {
283
+ const r = bodyShapesMatch(actual, v);
284
+ if (r === "match") {
285
+ return "match";
286
+ }
287
+ if (r === "unknown") {
288
+ sawUnknown = true;
289
+ }
290
+ }
291
+ return sawUnknown ? "unknown" : "nomatch";
292
+ }
293
+ function combine(results) {
294
+ if (results.some((r) => r === "nomatch")) {
295
+ return "nomatch";
296
+ }
297
+ if (results.some((r) => r === "unknown")) {
298
+ return "unknown";
299
+ }
300
+ return "match";
301
+ }
302
+ function allowsUndefined(shape) {
303
+ if (shape.type === "undefined") {
304
+ return true;
305
+ }
306
+ if (shape.type === "union") {
307
+ return shape.variants.some(allowsUndefined);
308
+ }
309
+ return false;
310
+ }
311
+
312
+ // src/index.ts
313
+ function restBinding(opts) {
314
+ return {
315
+ transport: opts.transport,
316
+ semantics: {
317
+ name: "rest",
318
+ method: opts.method.toUpperCase(),
319
+ path: opts.path,
320
+ ...opts.declaredResponses !== void 0 ? { declaredResponses: opts.declaredResponses } : {}
321
+ },
322
+ recognition: opts.recognition
323
+ };
324
+ }
325
+ function functionCallBinding(opts) {
326
+ return {
327
+ transport: opts.transport,
328
+ semantics: {
329
+ name: "function-call",
330
+ ...opts.module !== void 0 ? { module: opts.module } : {},
331
+ ...opts.exportName !== void 0 ? { exportName: opts.exportName } : {},
332
+ ...opts.package !== void 0 ? { package: opts.package } : {},
333
+ ...opts.exportPath !== void 0 ? { exportPath: opts.exportPath } : {}
334
+ },
335
+ recognition: opts.recognition
336
+ };
337
+ }
338
+ function packageExportBinding(opts) {
339
+ return functionCallBinding({
340
+ transport: opts.transport ?? "in-process",
341
+ recognition: opts.recognition,
342
+ package: opts.packageName,
343
+ exportPath: opts.exportPath
344
+ });
345
+ }
346
+ function graphqlResolverBinding(opts) {
347
+ return {
348
+ transport: opts.transport,
349
+ semantics: {
350
+ name: "graphql-resolver",
351
+ typeName: opts.typeName,
352
+ fieldName: opts.fieldName
353
+ },
354
+ recognition: opts.recognition
355
+ };
356
+ }
357
+ function graphqlOperationBinding(opts) {
358
+ return {
359
+ transport: opts.transport,
360
+ semantics: {
361
+ name: "graphql-operation",
362
+ operationType: opts.operationType,
363
+ ...opts.operationName !== void 0 ? { operationName: opts.operationName } : {}
364
+ },
365
+ recognition: opts.recognition
366
+ };
367
+ }
368
+ function runtimeConfigBinding(opts) {
369
+ return {
370
+ transport: "os",
371
+ semantics: {
372
+ name: "runtime-config",
373
+ deploymentTarget: opts.deploymentTarget,
374
+ instanceName: opts.instanceName
375
+ },
376
+ recognition: opts.recognition
377
+ };
378
+ }
379
+ function storageRelationalBinding(opts) {
380
+ return {
381
+ transport: opts.storageSystem,
382
+ semantics: {
383
+ name: "storage-relational",
384
+ storageSystem: opts.storageSystem,
385
+ scope: opts.scope,
386
+ table: opts.table
387
+ },
388
+ recognition: opts.recognition
389
+ };
390
+ }
391
+ function messageBusBinding(opts) {
392
+ return {
393
+ transport: opts.messageBus,
394
+ semantics: {
395
+ name: "message-bus",
396
+ messageBus: opts.messageBus,
397
+ channel: opts.channel
398
+ },
399
+ recognition: opts.recognition
400
+ };
401
+ }
402
+ export {
403
+ BoundaryBindingSchema,
404
+ ConfidenceInfoSchema,
405
+ ConfidenceLevelSchema,
406
+ ConfidenceSourceSchema,
407
+ FunctionCallSemanticsSchema,
408
+ GraphqlOperationSemanticsSchema,
409
+ GraphqlResolverSemanticsSchema,
410
+ MessageBusSemanticsSchema,
411
+ RestSemanticsSchema,
412
+ RuntimeConfigSemanticsSchema,
413
+ SemanticsSchema,
414
+ SourceLocationSchema,
415
+ StorageRelationalSemanticsSchema,
416
+ SuppressionFileSchema,
417
+ SuppressionRuleSchema,
418
+ TypeShapeSchema,
419
+ applySuppressionsToFindings,
420
+ bodyShapesMatch,
421
+ boundaryKey,
422
+ countsForThreshold,
423
+ functionCallBinding,
424
+ graphqlOperationBinding,
425
+ graphqlResolverBinding,
426
+ messageBusBinding,
427
+ normalizePath,
428
+ normalizeRuleBoundary,
429
+ packageExportBinding,
430
+ restBinding,
431
+ ruleBoundaryMatchesKey,
432
+ runtimeConfigBinding,
433
+ storageRelationalBinding,
434
+ validateRule
435
+ };
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/schemas.ts
21
+ var schemas_exports = {};
22
+ __export(schemas_exports, {
23
+ BoundaryBindingSchema: () => BoundaryBindingSchema,
24
+ ConfidenceInfoSchema: () => ConfidenceInfoSchema,
25
+ ConfidenceLevelSchema: () => ConfidenceLevelSchema,
26
+ ConfidenceSourceSchema: () => ConfidenceSourceSchema,
27
+ FunctionCallSemanticsSchema: () => FunctionCallSemanticsSchema,
28
+ GraphqlOperationSemanticsSchema: () => GraphqlOperationSemanticsSchema,
29
+ GraphqlResolverSemanticsSchema: () => GraphqlResolverSemanticsSchema,
30
+ MessageBusSemanticsSchema: () => MessageBusSemanticsSchema,
31
+ RestSemanticsSchema: () => RestSemanticsSchema,
32
+ RuntimeConfigSemanticsSchema: () => RuntimeConfigSemanticsSchema,
33
+ SemanticsSchema: () => SemanticsSchema,
34
+ SourceLocationSchema: () => SourceLocationSchema,
35
+ StorageRelationalSemanticsSchema: () => StorageRelationalSemanticsSchema,
36
+ TypeShapeSchema: () => TypeShapeSchema
37
+ });
38
+ module.exports = __toCommonJS(schemas_exports);
39
+ var import_zod = require("zod");
40
+ var ConfidenceSourceSchema = import_zod.z.enum([
41
+ "inferred_static",
42
+ "inferred_ai",
43
+ "declared",
44
+ "derived"
45
+ ]);
46
+ var ConfidenceLevelSchema = import_zod.z.enum(["high", "medium", "low"]);
47
+ var ConfidenceInfoSchema = import_zod.z.object({
48
+ source: ConfidenceSourceSchema,
49
+ level: ConfidenceLevelSchema
50
+ });
51
+ var SourceLocationSchema = import_zod.z.object({
52
+ file: import_zod.z.string(),
53
+ range: import_zod.z.object({ start: import_zod.z.number(), end: import_zod.z.number() }),
54
+ exportName: import_zod.z.string().nullable()
55
+ });
56
+ var RestSemanticsSchema = import_zod.z.object({
57
+ name: import_zod.z.literal("rest"),
58
+ /** Uppercase HTTP method ("GET", "POST", …). */
59
+ method: import_zod.z.string(),
60
+ /** Normalized route path ("/users/{id}"). */
61
+ path: import_zod.z.string(),
62
+ /**
63
+ * Status codes the producing source explicitly declared (OpenAPI
64
+ * responses, CFN MethodResponses, ts-rest router statuses). Kept here
65
+ * so the pairing layer can still see them without unwrapping metadata.
66
+ * Empty / absent for inferred sources.
67
+ */
68
+ declaredResponses: import_zod.z.array(import_zod.z.number()).optional()
69
+ });
70
+ var FunctionCallSemanticsSchema = import_zod.z.object({
71
+ name: import_zod.z.literal("function-call"),
72
+ /**
73
+ * Optional module identifier for cross-unit references
74
+ * (e.g. `"./components/Button"` for a React component, or the TS
75
+ * module path for a bare function export). Packs that don't do
76
+ * cross-module pairing can leave it unset.
77
+ */
78
+ module: import_zod.z.string().optional(),
79
+ /** Named export within the module, when applicable. */
80
+ exportName: import_zod.z.string().optional(),
81
+ /**
82
+ * Package name (as written in `package.json`) when this identity
83
+ * refers to a public package export — e.g. `"@suss/behavioral-ir"`.
84
+ * Set alongside `exportPath` by packs that resolve a package's
85
+ * public surface (the `packageExports` discovery variant). Distinct
86
+ * from `module`, which is a repo-relative module path for
87
+ * intra-repo pairing.
88
+ */
89
+ package: import_zod.z.string().optional(),
90
+ /**
91
+ * Path to the exported binding within the package, starting with
92
+ * the sub-path key when one is used. Examples:
93
+ * `["parseSummary"]` — root export
94
+ * `["schemas", "BoundaryBindingSchema"]` — sub-path `./schemas`
95
+ *
96
+ * The first segment is the sub-path without the leading `./`
97
+ * (`"."` → omitted). The last segment is the exported name.
98
+ */
99
+ exportPath: import_zod.z.array(import_zod.z.string()).optional()
100
+ });
101
+ var GraphqlResolverSemanticsSchema = import_zod.z.object({
102
+ name: import_zod.z.literal("graphql-resolver"),
103
+ /** GraphQL type the resolver attaches to: "Query", "Mutation", "Subscription", or an object-type name. */
104
+ typeName: import_zod.z.string(),
105
+ /** Field name on that type. */
106
+ fieldName: import_zod.z.string()
107
+ });
108
+ var GraphqlOperationSemanticsSchema = import_zod.z.object({
109
+ name: import_zod.z.literal("graphql-operation"),
110
+ /** Optional operation name — anonymous queries / mutations leave this unset. */
111
+ operationName: import_zod.z.string().optional(),
112
+ operationType: import_zod.z.enum(["query", "mutation", "subscription"])
113
+ });
114
+ var RuntimeConfigSemanticsSchema = import_zod.z.object({
115
+ name: import_zod.z.literal("runtime-config"),
116
+ deploymentTarget: import_zod.z.enum([
117
+ "lambda",
118
+ "ecs-task",
119
+ "container",
120
+ "k8s-deployment"
121
+ ]),
122
+ /**
123
+ * Stable identifier for the runtime instance — CFN logical resource
124
+ * ID for Lambda / ECS, k8s deployment name, container name.
125
+ */
126
+ instanceName: import_zod.z.string()
127
+ });
128
+ var StorageRelationalSemanticsSchema = import_zod.z.object({
129
+ name: import_zod.z.literal("storage-relational"),
130
+ storageSystem: import_zod.z.enum(["postgres", "mysql", "sqlite"]),
131
+ /**
132
+ * ORM / driver scope. Defaults to `"default"` for single-database
133
+ * setups; monorepos with multiple schemas use distinct values.
134
+ */
135
+ scope: import_zod.z.string(),
136
+ /** Table / model name as declared in the schema. */
137
+ table: import_zod.z.string()
138
+ });
139
+ var MessageBusSemanticsSchema = import_zod.z.object({
140
+ name: import_zod.z.literal("message-bus"),
141
+ messageBus: import_zod.z.enum(["sqs", "eventbridge", "bullmq", "kafka", "nats"]),
142
+ /** Stable channel identifier — CFN logical id, queue/topic name, subject pattern, `bus#detailType`. */
143
+ channel: import_zod.z.string()
144
+ });
145
+ var SemanticsSchema = import_zod.z.discriminatedUnion("name", [
146
+ RestSemanticsSchema,
147
+ FunctionCallSemanticsSchema,
148
+ GraphqlResolverSemanticsSchema,
149
+ GraphqlOperationSemanticsSchema,
150
+ RuntimeConfigSemanticsSchema,
151
+ StorageRelationalSemanticsSchema,
152
+ MessageBusSemanticsSchema
153
+ ]);
154
+ var BoundaryBindingSchema = import_zod.z.object({
155
+ transport: import_zod.z.string(),
156
+ semantics: SemanticsSchema,
157
+ recognition: import_zod.z.string()
158
+ });
159
+ var TypeShapeSchema = import_zod.z.lazy(
160
+ () => import_zod.z.discriminatedUnion("type", [
161
+ import_zod.z.object({
162
+ type: import_zod.z.literal("record"),
163
+ properties: import_zod.z.record(import_zod.z.string(), TypeShapeSchema),
164
+ spreads: import_zod.z.array(import_zod.z.object({ sourceText: import_zod.z.string() })).optional()
165
+ }),
166
+ import_zod.z.object({ type: import_zod.z.literal("dictionary"), values: TypeShapeSchema }),
167
+ import_zod.z.object({ type: import_zod.z.literal("array"), items: TypeShapeSchema }),
168
+ import_zod.z.object({
169
+ type: import_zod.z.literal("literal"),
170
+ value: import_zod.z.union([import_zod.z.string(), import_zod.z.number(), import_zod.z.boolean()]),
171
+ raw: import_zod.z.string().optional()
172
+ }),
173
+ import_zod.z.object({ type: import_zod.z.literal("text") }),
174
+ import_zod.z.object({ type: import_zod.z.literal("integer") }),
175
+ import_zod.z.object({ type: import_zod.z.literal("number") }),
176
+ import_zod.z.object({ type: import_zod.z.literal("boolean") }),
177
+ import_zod.z.object({ type: import_zod.z.literal("null") }),
178
+ import_zod.z.object({ type: import_zod.z.literal("undefined") }),
179
+ import_zod.z.object({
180
+ type: import_zod.z.literal("union"),
181
+ variants: import_zod.z.array(TypeShapeSchema)
182
+ }),
183
+ import_zod.z.object({ type: import_zod.z.literal("ref"), name: import_zod.z.string() }),
184
+ import_zod.z.object({ type: import_zod.z.literal("unknown") })
185
+ ])
186
+ );
187
+ // Annotate the CommonJS export names for ESM import in node:
188
+ 0 && (module.exports = {
189
+ BoundaryBindingSchema,
190
+ ConfidenceInfoSchema,
191
+ ConfidenceLevelSchema,
192
+ ConfidenceSourceSchema,
193
+ FunctionCallSemanticsSchema,
194
+ GraphqlOperationSemanticsSchema,
195
+ GraphqlResolverSemanticsSchema,
196
+ MessageBusSemanticsSchema,
197
+ RestSemanticsSchema,
198
+ RuntimeConfigSemanticsSchema,
199
+ SemanticsSchema,
200
+ SourceLocationSchema,
201
+ StorageRelationalSemanticsSchema,
202
+ TypeShapeSchema
203
+ });