@suss/ir-core 0.19.0 → 0.20.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/{chunk-HSJYPBJU.js → chunk-52CH76PE.js} +22 -3
- package/dist/index.cjs +36 -5
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +13 -2
- package/dist/{schemas-k-169oiY.d.cts → schemas-Dt93kAZT.d.cts} +4 -0
- package/dist/{schemas-k-169oiY.d.ts → schemas-Dt93kAZT.d.ts} +4 -0
- package/dist/schemas.cjs +22 -3
- package/dist/schemas.d.cts +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/package.json +1 -1
|
@@ -75,14 +75,24 @@ var functionCallSemantics = defineBoundarySemantics({
|
|
|
75
75
|
*/
|
|
76
76
|
canPair: () => true,
|
|
77
77
|
/**
|
|
78
|
-
* `"fn:<package>::<exportPath>"` when both are set
|
|
79
|
-
*
|
|
80
|
-
*
|
|
78
|
+
* `"fn:<package>::<exportPath>"` when both are set, and
|
|
79
|
+
* `"fn:<module>::<exportName>"` for an in-repo unit that states its
|
|
80
|
+
* module, the way a server action does. Components and bare
|
|
81
|
+
* handlers state neither and have no key at all.
|
|
81
82
|
*/
|
|
83
|
+
rewritePaths(semantics, rewrite) {
|
|
84
|
+
if (semantics.module === void 0) {
|
|
85
|
+
return semantics;
|
|
86
|
+
}
|
|
87
|
+
return { ...semantics, module: rewrite(semantics.module) };
|
|
88
|
+
},
|
|
82
89
|
identityKey(semantics) {
|
|
83
90
|
if (semantics.package !== void 0 && semantics.exportPath !== void 0 && semantics.exportPath.length > 0) {
|
|
84
91
|
return fnIdentityKey(semantics.package, semantics.exportPath);
|
|
85
92
|
}
|
|
93
|
+
if (semantics.module !== void 0 && semantics.exportName !== void 0) {
|
|
94
|
+
return fnIdentityKey(semantics.module, [semantics.exportName]);
|
|
95
|
+
}
|
|
86
96
|
return null;
|
|
87
97
|
}
|
|
88
98
|
}
|
|
@@ -659,7 +669,16 @@ var ConfidenceInfoSchema = z11.object({
|
|
|
659
669
|
});
|
|
660
670
|
var SourceLocationSchema = z11.object({
|
|
661
671
|
file: z11.string(),
|
|
672
|
+
/** Line numbers, for a person reading the summary or an editor link. */
|
|
662
673
|
range: z11.object({ start: z11.number(), end: z11.number() }),
|
|
674
|
+
/**
|
|
675
|
+
* Character offsets of the unit in its file. Identity and joins
|
|
676
|
+
* measure with these, since two functions can share a line and never
|
|
677
|
+
* an offset range; the line `range` above is the presentation of the
|
|
678
|
+
* same place. Absent on summaries no source position backs, a
|
|
679
|
+
* contract artifact's say.
|
|
680
|
+
*/
|
|
681
|
+
span: z11.object({ start: z11.number(), end: z11.number() }).optional(),
|
|
663
682
|
exportName: z11.string().nullable(),
|
|
664
683
|
/**
|
|
665
684
|
* The project the extract was pointed at, by the name that project
|
package/dist/index.cjs
CHANGED
|
@@ -97,7 +97,8 @@ __export(index_exports, {
|
|
|
97
97
|
storageBinding: () => storageBinding,
|
|
98
98
|
typeDefinitionKey: () => typeDefinitionKey,
|
|
99
99
|
validateRule: () => validateRule,
|
|
100
|
-
withDefinitionsInlined: () => withDefinitionsInlined
|
|
100
|
+
withDefinitionsInlined: () => withDefinitionsInlined,
|
|
101
|
+
withRewrittenPaths: () => withRewrittenPaths
|
|
101
102
|
});
|
|
102
103
|
module.exports = __toCommonJS(index_exports);
|
|
103
104
|
|
|
@@ -210,14 +211,24 @@ var functionCallSemantics = defineBoundarySemantics({
|
|
|
210
211
|
*/
|
|
211
212
|
canPair: () => true,
|
|
212
213
|
/**
|
|
213
|
-
* `"fn:<package>::<exportPath>"` when both are set
|
|
214
|
-
*
|
|
215
|
-
*
|
|
214
|
+
* `"fn:<package>::<exportPath>"` when both are set, and
|
|
215
|
+
* `"fn:<module>::<exportName>"` for an in-repo unit that states its
|
|
216
|
+
* module, the way a server action does. Components and bare
|
|
217
|
+
* handlers state neither and have no key at all.
|
|
216
218
|
*/
|
|
219
|
+
rewritePaths(semantics, rewrite) {
|
|
220
|
+
if (semantics.module === void 0) {
|
|
221
|
+
return semantics;
|
|
222
|
+
}
|
|
223
|
+
return { ...semantics, module: rewrite(semantics.module) };
|
|
224
|
+
},
|
|
217
225
|
identityKey(semantics) {
|
|
218
226
|
if (semantics.package !== void 0 && semantics.exportPath !== void 0 && semantics.exportPath.length > 0) {
|
|
219
227
|
return fnIdentityKey(semantics.package, semantics.exportPath);
|
|
220
228
|
}
|
|
229
|
+
if (semantics.module !== void 0 && semantics.exportName !== void 0) {
|
|
230
|
+
return fnIdentityKey(semantics.module, [semantics.exportName]);
|
|
231
|
+
}
|
|
221
232
|
return null;
|
|
222
233
|
}
|
|
223
234
|
}
|
|
@@ -762,7 +773,16 @@ var ConfidenceInfoSchema = import_zod11.z.object({
|
|
|
762
773
|
});
|
|
763
774
|
var SourceLocationSchema = import_zod11.z.object({
|
|
764
775
|
file: import_zod11.z.string(),
|
|
776
|
+
/** Line numbers, for a person reading the summary or an editor link. */
|
|
765
777
|
range: import_zod11.z.object({ start: import_zod11.z.number(), end: import_zod11.z.number() }),
|
|
778
|
+
/**
|
|
779
|
+
* Character offsets of the unit in its file. Identity and joins
|
|
780
|
+
* measure with these, since two functions can share a line and never
|
|
781
|
+
* an offset range; the line `range` above is the presentation of the
|
|
782
|
+
* same place. Absent on summaries no source position backs, a
|
|
783
|
+
* contract artifact's say.
|
|
784
|
+
*/
|
|
785
|
+
span: import_zod11.z.object({ start: import_zod11.z.number(), end: import_zod11.z.number() }).optional(),
|
|
766
786
|
exportName: import_zod11.z.string().nullable(),
|
|
767
787
|
/**
|
|
768
788
|
* The project the extract was pointed at, by the name that project
|
|
@@ -880,6 +900,16 @@ function semconvAttributes(binding) {
|
|
|
880
900
|
function boundaryKey(binding) {
|
|
881
901
|
return behaviorOf(binding.semantics).identityKey(binding.semantics);
|
|
882
902
|
}
|
|
903
|
+
function withRewrittenPaths(binding, rewrite) {
|
|
904
|
+
const behavior = behaviorOf(binding.semantics);
|
|
905
|
+
if (behavior.rewritePaths === void 0) {
|
|
906
|
+
return binding;
|
|
907
|
+
}
|
|
908
|
+
return {
|
|
909
|
+
...binding,
|
|
910
|
+
semantics: behavior.rewritePaths(binding.semantics, rewrite)
|
|
911
|
+
};
|
|
912
|
+
}
|
|
883
913
|
function groundedPairingKey(binding, deployedAs) {
|
|
884
914
|
const behavior = behaviorOf(binding.semantics);
|
|
885
915
|
const grounded = behavior.groundName?.(binding.semantics, deployedAs) ?? null;
|
|
@@ -1537,5 +1567,6 @@ function metricBinding(opts) {
|
|
|
1537
1567
|
storageBinding,
|
|
1538
1568
|
typeDefinitionKey,
|
|
1539
1569
|
validateRule,
|
|
1540
|
-
withDefinitionsInlined
|
|
1570
|
+
withDefinitionsInlined,
|
|
1571
|
+
withRewrittenPaths
|
|
1541
1572
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology, D as DeployableUnit } from './schemas-
|
|
3
|
-
export { f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as methodsAgree, u as normalizePath, v as pathShape, w as routePathAdmits, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-
|
|
2
|
+
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology, D as DeployableUnit } from './schemas-Dt93kAZT.cjs';
|
|
3
|
+
export { f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as methodsAgree, u as normalizePath, v as pathShape, w as routePathAdmits, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-Dt93kAZT.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Comparing two TypeShapes structurally.
|
|
@@ -101,6 +101,12 @@ interface BoundaryBehavior<S extends {
|
|
|
101
101
|
sidesAgree?(a: S, b: S): boolean;
|
|
102
102
|
/** The line a reader sees for this boundary. Defaults to `identityKey`. */
|
|
103
103
|
displayLabel?(semantics: S): string | null;
|
|
104
|
+
/**
|
|
105
|
+
* The semantics with any filesystem path it states rewritten, for
|
|
106
|
+
* the pass that makes a summary's paths project-relative. A
|
|
107
|
+
* protocol that states no path declares nothing here.
|
|
108
|
+
*/
|
|
109
|
+
rewritePaths?(semantics: S, rewrite: (path: string) => string): S;
|
|
104
110
|
/**
|
|
105
111
|
* The first protocol whose `claims` returns true normalizes a
|
|
106
112
|
* hand-written suppression boundary, and a string nobody claims is
|
|
@@ -237,6 +243,12 @@ declare function semconvAttributes(binding: BoundaryBinding): Record<string, str
|
|
|
237
243
|
*/
|
|
238
244
|
|
|
239
245
|
declare function boundaryKey(binding: BoundaryBinding): string | null;
|
|
246
|
+
/**
|
|
247
|
+
* The binding with any filesystem path its semantics state rewritten.
|
|
248
|
+
* The CLI uses it to make a summary's paths project-relative, and each
|
|
249
|
+
* protocol says for itself whether it states one.
|
|
250
|
+
*/
|
|
251
|
+
declare function withRewrittenPaths(binding: BoundaryBinding, rewrite: (path: string) => string): BoundaryBinding;
|
|
240
252
|
/**
|
|
241
253
|
* The bucket a boundary pairs in, with any name the deployment fills in
|
|
242
254
|
* put in first.
|
|
@@ -736,4 +748,4 @@ declare function metricBinding(opts: {
|
|
|
736
748
|
metricType: string | null;
|
|
737
749
|
}): BoundaryBinding;
|
|
738
750
|
|
|
739
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, type NamePart, type ParsedChannel, type Reference, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, statesAnOrigin, storageBinding, validateRule };
|
|
751
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, type NamePart, type ParsedChannel, type Reference, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, statesAnOrigin, storageBinding, validateRule, withRewrittenPaths };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology, D as DeployableUnit } from './schemas-
|
|
3
|
-
export { f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as methodsAgree, u as normalizePath, v as pathShape, w as routePathAdmits, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-
|
|
2
|
+
import { T as TypeShape, M as MessageBusSemantics, S as Semantics, B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, d as SourceLocationSchema, e as MessageBusTechnology, D as DeployableUnit } from './schemas-Dt93kAZT.js';
|
|
3
|
+
export { f as DeployableUnitSchema, F as FunctionCallSemantics, g as FunctionCallSemanticsSchema, G as GraphqlOperationSemantics, h as GraphqlOperationSemanticsSchema, i as GraphqlResolverSemantics, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, R as RestSemantics, l as RestSemanticsSchema, m as RuntimeConfigSemantics, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, p as StorageSemantics, q as StorageSemanticsSchema, r as TypeShapeSchema, s as ecsContainerInstanceName, t as methodsAgree, u as normalizePath, v as pathShape, w as routePathAdmits, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-Dt93kAZT.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Comparing two TypeShapes structurally.
|
|
@@ -101,6 +101,12 @@ interface BoundaryBehavior<S extends {
|
|
|
101
101
|
sidesAgree?(a: S, b: S): boolean;
|
|
102
102
|
/** The line a reader sees for this boundary. Defaults to `identityKey`. */
|
|
103
103
|
displayLabel?(semantics: S): string | null;
|
|
104
|
+
/**
|
|
105
|
+
* The semantics with any filesystem path it states rewritten, for
|
|
106
|
+
* the pass that makes a summary's paths project-relative. A
|
|
107
|
+
* protocol that states no path declares nothing here.
|
|
108
|
+
*/
|
|
109
|
+
rewritePaths?(semantics: S, rewrite: (path: string) => string): S;
|
|
104
110
|
/**
|
|
105
111
|
* The first protocol whose `claims` returns true normalizes a
|
|
106
112
|
* hand-written suppression boundary, and a string nobody claims is
|
|
@@ -237,6 +243,12 @@ declare function semconvAttributes(binding: BoundaryBinding): Record<string, str
|
|
|
237
243
|
*/
|
|
238
244
|
|
|
239
245
|
declare function boundaryKey(binding: BoundaryBinding): string | null;
|
|
246
|
+
/**
|
|
247
|
+
* The binding with any filesystem path its semantics state rewritten.
|
|
248
|
+
* The CLI uses it to make a summary's paths project-relative, and each
|
|
249
|
+
* protocol says for itself whether it states one.
|
|
250
|
+
*/
|
|
251
|
+
declare function withRewrittenPaths(binding: BoundaryBinding, rewrite: (path: string) => string): BoundaryBinding;
|
|
240
252
|
/**
|
|
241
253
|
* The bucket a boundary pairs in, with any name the deployment fills in
|
|
242
254
|
* put in first.
|
|
@@ -736,4 +748,4 @@ declare function metricBinding(opts: {
|
|
|
736
748
|
metricType: string | null;
|
|
737
749
|
}): BoundaryBinding;
|
|
738
750
|
|
|
739
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, type NamePart, type ParsedChannel, type Reference, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, statesAnOrigin, storageBinding, validateRule };
|
|
751
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, type NamePart, type ParsedChannel, type Reference, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, statesAnOrigin, storageBinding, validateRule, withRewrittenPaths };
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
statesAnOrigin,
|
|
37
37
|
typeDefinitionKey,
|
|
38
38
|
withDefinitionsInlined
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-52CH76PE.js";
|
|
40
40
|
|
|
41
41
|
// src/semconv.ts
|
|
42
42
|
function semconvAttributes(binding) {
|
|
@@ -61,6 +61,16 @@ function semconvAttributes(binding) {
|
|
|
61
61
|
function boundaryKey(binding) {
|
|
62
62
|
return behaviorOf(binding.semantics).identityKey(binding.semantics);
|
|
63
63
|
}
|
|
64
|
+
function withRewrittenPaths(binding, rewrite) {
|
|
65
|
+
const behavior = behaviorOf(binding.semantics);
|
|
66
|
+
if (behavior.rewritePaths === void 0) {
|
|
67
|
+
return binding;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
...binding,
|
|
71
|
+
semantics: behavior.rewritePaths(binding.semantics, rewrite)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
64
74
|
function groundedPairingKey(binding, deployedAs) {
|
|
65
75
|
const behavior = behaviorOf(binding.semantics);
|
|
66
76
|
const grounded = behavior.groundName?.(binding.semantics, deployedAs) ?? null;
|
|
@@ -717,5 +727,6 @@ export {
|
|
|
717
727
|
storageBinding,
|
|
718
728
|
typeDefinitionKey,
|
|
719
729
|
validateRule,
|
|
720
|
-
withDefinitionsInlined
|
|
730
|
+
withDefinitionsInlined,
|
|
731
|
+
withRewrittenPaths
|
|
721
732
|
};
|
|
@@ -299,6 +299,10 @@ declare const SourceLocationSchema: z.ZodObject<{
|
|
|
299
299
|
start: z.ZodNumber;
|
|
300
300
|
end: z.ZodNumber;
|
|
301
301
|
}, z.core.$strip>;
|
|
302
|
+
span: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
start: z.ZodNumber;
|
|
304
|
+
end: z.ZodNumber;
|
|
305
|
+
}, z.core.$strip>>;
|
|
302
306
|
exportName: z.ZodNullable<z.ZodString>;
|
|
303
307
|
workspace: z.ZodOptional<z.ZodString>;
|
|
304
308
|
}, z.core.$strip>;
|
|
@@ -299,6 +299,10 @@ declare const SourceLocationSchema: z.ZodObject<{
|
|
|
299
299
|
start: z.ZodNumber;
|
|
300
300
|
end: z.ZodNumber;
|
|
301
301
|
}, z.core.$strip>;
|
|
302
|
+
span: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
start: z.ZodNumber;
|
|
304
|
+
end: z.ZodNumber;
|
|
305
|
+
}, z.core.$strip>>;
|
|
302
306
|
exportName: z.ZodNullable<z.ZodString>;
|
|
303
307
|
workspace: z.ZodOptional<z.ZodString>;
|
|
304
308
|
}, z.core.$strip>;
|
package/dist/schemas.cjs
CHANGED
|
@@ -116,14 +116,24 @@ var functionCallSemantics = defineBoundarySemantics({
|
|
|
116
116
|
*/
|
|
117
117
|
canPair: () => true,
|
|
118
118
|
/**
|
|
119
|
-
* `"fn:<package>::<exportPath>"` when both are set
|
|
120
|
-
*
|
|
121
|
-
*
|
|
119
|
+
* `"fn:<package>::<exportPath>"` when both are set, and
|
|
120
|
+
* `"fn:<module>::<exportName>"` for an in-repo unit that states its
|
|
121
|
+
* module, the way a server action does. Components and bare
|
|
122
|
+
* handlers state neither and have no key at all.
|
|
122
123
|
*/
|
|
124
|
+
rewritePaths(semantics, rewrite) {
|
|
125
|
+
if (semantics.module === void 0) {
|
|
126
|
+
return semantics;
|
|
127
|
+
}
|
|
128
|
+
return { ...semantics, module: rewrite(semantics.module) };
|
|
129
|
+
},
|
|
123
130
|
identityKey(semantics) {
|
|
124
131
|
if (semantics.package !== void 0 && semantics.exportPath !== void 0 && semantics.exportPath.length > 0) {
|
|
125
132
|
return fnIdentityKey(semantics.package, semantics.exportPath);
|
|
126
133
|
}
|
|
134
|
+
if (semantics.module !== void 0 && semantics.exportName !== void 0) {
|
|
135
|
+
return fnIdentityKey(semantics.module, [semantics.exportName]);
|
|
136
|
+
}
|
|
127
137
|
return null;
|
|
128
138
|
}
|
|
129
139
|
}
|
|
@@ -672,7 +682,16 @@ var ConfidenceInfoSchema = import_zod11.z.object({
|
|
|
672
682
|
});
|
|
673
683
|
var SourceLocationSchema = import_zod11.z.object({
|
|
674
684
|
file: import_zod11.z.string(),
|
|
685
|
+
/** Line numbers, for a person reading the summary or an editor link. */
|
|
675
686
|
range: import_zod11.z.object({ start: import_zod11.z.number(), end: import_zod11.z.number() }),
|
|
687
|
+
/**
|
|
688
|
+
* Character offsets of the unit in its file. Identity and joins
|
|
689
|
+
* measure with these, since two functions can share a line and never
|
|
690
|
+
* an offset range; the line `range` above is the presentation of the
|
|
691
|
+
* same place. Absent on summaries no source position backs, a
|
|
692
|
+
* contract artifact's say.
|
|
693
|
+
*/
|
|
694
|
+
span: import_zod11.z.object({ start: import_zod11.z.number(), end: import_zod11.z.number() }).optional(),
|
|
676
695
|
exportName: import_zod11.z.string().nullable(),
|
|
677
696
|
/**
|
|
678
697
|
* The project the extract was pointed at, by the name that project
|
package/dist/schemas.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-
|
|
2
|
+
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-Dt93kAZT.cjs';
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-
|
|
2
|
+
export { B as BoundaryBindingSchema, C as ConfidenceInfoSchema, a as ConfidenceLevelSchema, b as ConfidenceSourceSchema, c as CorroborationSchema, f as DeployableUnitSchema, g as FunctionCallSemanticsSchema, h as GraphqlOperationSemanticsSchema, j as GraphqlResolverSemanticsSchema, k as MessageBusSemanticsSchema, l as RestSemanticsSchema, n as RuntimeConfigSemanticsSchema, o as SemanticsSchema, d as SourceLocationSchema, q as StorageSemanticsSchema, T as TypeShape, r as TypeShapeSchema, x as typeDefinitionKey, y as withDefinitionsInlined } from './schemas-Dt93kAZT.js';
|
package/dist/schemas.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/ir-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared IR primitives for suss — type shapes, boundary bindings, source locations, and confidence. Imported by both @suss/behavioral-ir and @suss/intent-ir so neither depends on the other.",
|
|
6
6
|
"keywords": [
|