@suss/ir-core 0.19.0 → 0.21.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-QHFMZPEG.js} +148 -52
- package/dist/index.cjs +279 -67
- package/dist/index.d.cts +159 -3
- package/dist/index.d.ts +159 -3
- package/dist/index.js +125 -15
- package/dist/{schemas-k-169oiY.d.cts → schemas-Dn1AzzWd.d.cts} +41 -1
- package/dist/{schemas-k-169oiY.d.ts → schemas-Dn1AzzWd.d.ts} +41 -1
- package/dist/schemas.cjs +142 -52
- 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
package/dist/schemas.cjs
CHANGED
|
@@ -40,10 +40,10 @@ __export(schemas_exports, {
|
|
|
40
40
|
withDefinitionsInlined: () => withDefinitionsInlined
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(schemas_exports);
|
|
43
|
-
var
|
|
43
|
+
var import_zod12 = require("zod");
|
|
44
44
|
|
|
45
45
|
// src/semantics/registry.ts
|
|
46
|
-
var
|
|
46
|
+
var import_zod11 = require("zod");
|
|
47
47
|
|
|
48
48
|
// src/semantics/functionCall.ts
|
|
49
49
|
var import_zod = require("zod");
|
|
@@ -58,6 +58,9 @@ function fnIdentityKey(packageName, exportPath) {
|
|
|
58
58
|
function busIdentityKey(messageBus, subject) {
|
|
59
59
|
return `bus:${messageBus} ${subject}`;
|
|
60
60
|
}
|
|
61
|
+
function unitIdentityKey(deploymentTarget, instanceName) {
|
|
62
|
+
return `unit:${deploymentTarget} ${instanceName}`;
|
|
63
|
+
}
|
|
61
64
|
function metricIdentityKey(metricSystem, metricType) {
|
|
62
65
|
return `metric:${metricSystem} ${metricType}`;
|
|
63
66
|
}
|
|
@@ -116,14 +119,24 @@ var functionCallSemantics = defineBoundarySemantics({
|
|
|
116
119
|
*/
|
|
117
120
|
canPair: () => true,
|
|
118
121
|
/**
|
|
119
|
-
* `"fn:<package>::<exportPath>"` when both are set
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
+
* `"fn:<package>::<exportPath>"` when both are set, and
|
|
123
|
+
* `"fn:<module>::<exportName>"` for an in-repo unit that states its
|
|
124
|
+
* module, the way a server action does. Components and bare
|
|
125
|
+
* handlers state neither and have no key at all.
|
|
122
126
|
*/
|
|
127
|
+
rewritePaths(semantics, rewrite) {
|
|
128
|
+
if (semantics.module === void 0) {
|
|
129
|
+
return semantics;
|
|
130
|
+
}
|
|
131
|
+
return { ...semantics, module: rewrite(semantics.module) };
|
|
132
|
+
},
|
|
123
133
|
identityKey(semantics) {
|
|
124
134
|
if (semantics.package !== void 0 && semantics.exportPath !== void 0 && semantics.exportPath.length > 0) {
|
|
125
135
|
return fnIdentityKey(semantics.package, semantics.exportPath);
|
|
126
136
|
}
|
|
137
|
+
if (semantics.module !== void 0 && semantics.exportName !== void 0) {
|
|
138
|
+
return fnIdentityKey(semantics.module, [semantics.exportName]);
|
|
139
|
+
}
|
|
127
140
|
return null;
|
|
128
141
|
}
|
|
129
142
|
}
|
|
@@ -487,6 +500,14 @@ var restSemantics = defineBoundarySemantics({
|
|
|
487
500
|
}
|
|
488
501
|
return routePathAdmits(semantics.path, path) ? "match" : "nomatch";
|
|
489
502
|
},
|
|
503
|
+
/**
|
|
504
|
+
* A route the registration pattern admits is inside it. A route
|
|
505
|
+
* whose path this source never gave is left outside, because
|
|
506
|
+
* nothing here can show it is one the pattern covers.
|
|
507
|
+
*/
|
|
508
|
+
withinScope(semantics, scope) {
|
|
509
|
+
return semantics.path !== null && routePathAdmits(scope, semantics.path);
|
|
510
|
+
},
|
|
490
511
|
/**
|
|
491
512
|
* A call whose base URL the deployment fills in, resolved to the
|
|
492
513
|
* path it reaches.
|
|
@@ -619,12 +640,70 @@ var storageSemantics = defineBoundarySemantics({
|
|
|
619
640
|
/** A query returns rows or items, not a status and a body. */
|
|
620
641
|
exchangesHttpResponses: false,
|
|
621
642
|
reportsUnpairedItself: false,
|
|
622
|
-
identityKey: () => null
|
|
643
|
+
identityKey: () => null,
|
|
644
|
+
displayLabel: storageLabel
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
function storageLabel(semantics) {
|
|
648
|
+
return `${semantics.storageSystem}:${storageContainerLabel(semantics)}`;
|
|
649
|
+
}
|
|
650
|
+
function storageContainerLabel(semantics) {
|
|
651
|
+
const container = semantics.container ?? "<unnamed container>";
|
|
652
|
+
const addressed = semantics.accessPath === null ? container : `${container}#${semantics.accessPath}`;
|
|
653
|
+
return semantics.scope === "default" ? addressed : `${semantics.scope}/${addressed}`;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// src/semantics/unitInvocation.ts
|
|
657
|
+
var import_zod10 = require("zod");
|
|
658
|
+
var UnitInvocationSemanticsSchema = DeployableUnitSchema.extend({
|
|
659
|
+
name: import_zod10.z.literal("unit-invocation"),
|
|
660
|
+
instanceName: DeployableUnitSchema.shape.instanceName.nullable()
|
|
661
|
+
});
|
|
662
|
+
var unitInvocationSemantics = defineBoundarySemantics({
|
|
663
|
+
name: "unit-invocation",
|
|
664
|
+
schema: UnitInvocationSemanticsSchema,
|
|
665
|
+
// faas.name is the deployed function's own name and instanceName is
|
|
666
|
+
// the deployment template's logical id, which is a different string.
|
|
667
|
+
// Runtime config leaves the pair off for the same reason.
|
|
668
|
+
semconv: {},
|
|
669
|
+
behavior: {
|
|
670
|
+
/**
|
|
671
|
+
* A synchronous invoke gives back whatever the handler returned,
|
|
672
|
+
* which is a value rather than a status and a body. A handler's
|
|
673
|
+
* return only becomes an HTTP response under a proxy integration,
|
|
674
|
+
* and that route gets a REST binding instead of this one.
|
|
675
|
+
*/
|
|
676
|
+
exchangesHttpResponses: false,
|
|
677
|
+
/**
|
|
678
|
+
* A unit nothing in the run invokes is the ordinary case, since
|
|
679
|
+
* most services are reached from a stack suss never read. So an
|
|
680
|
+
* uninvoked unit stays in the generic unmatched list rather than
|
|
681
|
+
* being reported as a problem here.
|
|
682
|
+
*/
|
|
683
|
+
reportsUnpairedItself: false,
|
|
684
|
+
identityKey(semantics) {
|
|
685
|
+
if (semantics.instanceName === null) {
|
|
686
|
+
return null;
|
|
687
|
+
}
|
|
688
|
+
return unitIdentityKey(
|
|
689
|
+
semantics.deploymentTarget,
|
|
690
|
+
semantics.instanceName
|
|
691
|
+
);
|
|
692
|
+
},
|
|
693
|
+
displayLabel(semantics) {
|
|
694
|
+
if (semantics.instanceName === null) {
|
|
695
|
+
return `unit:${semantics.deploymentTarget} (named at runtime)`;
|
|
696
|
+
}
|
|
697
|
+
return unitIdentityKey(
|
|
698
|
+
semantics.deploymentTarget,
|
|
699
|
+
semantics.instanceName
|
|
700
|
+
);
|
|
701
|
+
}
|
|
623
702
|
}
|
|
624
703
|
});
|
|
625
704
|
|
|
626
705
|
// src/semantics/registry.ts
|
|
627
|
-
var SemanticsSchema =
|
|
706
|
+
var SemanticsSchema = import_zod11.z.discriminatedUnion("name", [
|
|
628
707
|
restSemantics.schema,
|
|
629
708
|
functionCallSemantics.schema,
|
|
630
709
|
graphqlResolverSemantics.schema,
|
|
@@ -632,7 +711,8 @@ var SemanticsSchema = import_zod10.z.discriminatedUnion("name", [
|
|
|
632
711
|
runtimeConfigSemantics.schema,
|
|
633
712
|
storageSemantics.schema,
|
|
634
713
|
messageBusSemantics.schema,
|
|
635
|
-
metricSemantics.schema
|
|
714
|
+
metricSemantics.schema,
|
|
715
|
+
unitInvocationSemantics.schema
|
|
636
716
|
]);
|
|
637
717
|
var DEFINITIONS = [
|
|
638
718
|
restSemantics,
|
|
@@ -642,38 +722,48 @@ var DEFINITIONS = [
|
|
|
642
722
|
runtimeConfigSemantics,
|
|
643
723
|
storageSemantics,
|
|
644
724
|
messageBusSemantics,
|
|
645
|
-
metricSemantics
|
|
725
|
+
metricSemantics,
|
|
726
|
+
unitInvocationSemantics
|
|
646
727
|
];
|
|
647
728
|
var BY_NAME = new Map(
|
|
648
729
|
DEFINITIONS.map((d) => [d.name, d])
|
|
649
730
|
);
|
|
650
731
|
|
|
651
732
|
// src/schemas.ts
|
|
652
|
-
var ConfidenceSourceSchema =
|
|
733
|
+
var ConfidenceSourceSchema = import_zod12.z.enum([
|
|
653
734
|
"inferred_static",
|
|
654
735
|
"inferred_ai",
|
|
655
736
|
"declared",
|
|
656
737
|
"derived"
|
|
657
738
|
]);
|
|
658
|
-
var ConfidenceLevelSchema =
|
|
659
|
-
var CorroborationSchema =
|
|
660
|
-
outcome:
|
|
739
|
+
var ConfidenceLevelSchema = import_zod12.z.enum(["high", "medium", "low"]);
|
|
740
|
+
var CorroborationSchema = import_zod12.z.object({
|
|
741
|
+
outcome: import_zod12.z.enum(["observed", "refuted", "untested"]),
|
|
661
742
|
/** Executions that produced a verdict for this claim. */
|
|
662
|
-
runs:
|
|
743
|
+
runs: import_zod12.z.number(),
|
|
663
744
|
/** Present when refuted: the input and observation that disagreed. */
|
|
664
|
-
counterexample:
|
|
745
|
+
counterexample: import_zod12.z.unknown().optional(),
|
|
665
746
|
/** Present when untested: why no verdict was reachable. */
|
|
666
|
-
reason:
|
|
747
|
+
reason: import_zod12.z.string().optional()
|
|
667
748
|
});
|
|
668
|
-
var ConfidenceInfoSchema =
|
|
749
|
+
var ConfidenceInfoSchema = import_zod12.z.object({
|
|
669
750
|
source: ConfidenceSourceSchema,
|
|
670
751
|
level: ConfidenceLevelSchema,
|
|
671
752
|
corroboration: CorroborationSchema.optional()
|
|
672
753
|
});
|
|
673
|
-
var SourceLocationSchema =
|
|
674
|
-
file:
|
|
675
|
-
|
|
676
|
-
|
|
754
|
+
var SourceLocationSchema = import_zod12.z.object({
|
|
755
|
+
file: import_zod12.z.string(),
|
|
756
|
+
/** Line numbers, for a person reading the summary or an editor link. */
|
|
757
|
+
range: import_zod12.z.object({ start: import_zod12.z.number(), end: import_zod12.z.number() }),
|
|
758
|
+
/**
|
|
759
|
+
* Character offsets of the unit in its file. Identity and joins
|
|
760
|
+
* measure with these, since two functions can share a line and never
|
|
761
|
+
* an offset range; the line `range` above is the presentation of the
|
|
762
|
+
* same place. Absent on summaries no source position backs, a
|
|
763
|
+
* contract artifact's say.
|
|
764
|
+
*/
|
|
765
|
+
span: import_zod12.z.object({ start: import_zod12.z.number(), end: import_zod12.z.number() }).optional(),
|
|
766
|
+
exportName: import_zod12.z.string().nullable(),
|
|
677
767
|
/**
|
|
678
768
|
* The project the extract was pointed at, by the name that project
|
|
679
769
|
* calls itself.
|
|
@@ -683,47 +773,47 @@ var SourceLocationSchema = import_zod11.z.object({
|
|
|
683
773
|
* summaries puts them on top of each other. This field is what tells
|
|
684
774
|
* them apart, and what a reader groups by.
|
|
685
775
|
*/
|
|
686
|
-
workspace:
|
|
776
|
+
workspace: import_zod12.z.string().optional()
|
|
687
777
|
});
|
|
688
|
-
var BoundaryBindingSchema =
|
|
689
|
-
transport:
|
|
778
|
+
var BoundaryBindingSchema = import_zod12.z.object({
|
|
779
|
+
transport: import_zod12.z.string(),
|
|
690
780
|
semantics: SemanticsSchema,
|
|
691
|
-
recognition:
|
|
781
|
+
recognition: import_zod12.z.string()
|
|
692
782
|
});
|
|
693
783
|
function typeDefinitionKey(ref) {
|
|
694
784
|
return ref.def ?? null;
|
|
695
785
|
}
|
|
696
|
-
var TypeShapeSchema =
|
|
697
|
-
() =>
|
|
698
|
-
|
|
699
|
-
type:
|
|
700
|
-
properties:
|
|
701
|
-
spreads:
|
|
786
|
+
var TypeShapeSchema = import_zod12.z.lazy(
|
|
787
|
+
() => import_zod12.z.discriminatedUnion("type", [
|
|
788
|
+
import_zod12.z.object({
|
|
789
|
+
type: import_zod12.z.literal("record"),
|
|
790
|
+
properties: import_zod12.z.record(import_zod12.z.string(), TypeShapeSchema),
|
|
791
|
+
spreads: import_zod12.z.array(import_zod12.z.object({ sourceText: import_zod12.z.string() })).optional()
|
|
702
792
|
}),
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
type:
|
|
707
|
-
value:
|
|
708
|
-
raw:
|
|
793
|
+
import_zod12.z.object({ type: import_zod12.z.literal("dictionary"), values: TypeShapeSchema }),
|
|
794
|
+
import_zod12.z.object({ type: import_zod12.z.literal("array"), items: TypeShapeSchema }),
|
|
795
|
+
import_zod12.z.object({
|
|
796
|
+
type: import_zod12.z.literal("literal"),
|
|
797
|
+
value: import_zod12.z.union([import_zod12.z.string(), import_zod12.z.number(), import_zod12.z.boolean()]),
|
|
798
|
+
raw: import_zod12.z.string().optional()
|
|
709
799
|
}),
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
type:
|
|
718
|
-
variants:
|
|
800
|
+
import_zod12.z.object({ type: import_zod12.z.literal("text") }),
|
|
801
|
+
import_zod12.z.object({ type: import_zod12.z.literal("integer") }),
|
|
802
|
+
import_zod12.z.object({ type: import_zod12.z.literal("number") }),
|
|
803
|
+
import_zod12.z.object({ type: import_zod12.z.literal("boolean") }),
|
|
804
|
+
import_zod12.z.object({ type: import_zod12.z.literal("null") }),
|
|
805
|
+
import_zod12.z.object({ type: import_zod12.z.literal("undefined") }),
|
|
806
|
+
import_zod12.z.object({
|
|
807
|
+
type: import_zod12.z.literal("union"),
|
|
808
|
+
variants: import_zod12.z.array(TypeShapeSchema)
|
|
719
809
|
}),
|
|
720
|
-
|
|
721
|
-
type:
|
|
722
|
-
name:
|
|
723
|
-
from:
|
|
724
|
-
def:
|
|
810
|
+
import_zod12.z.object({
|
|
811
|
+
type: import_zod12.z.literal("ref"),
|
|
812
|
+
name: import_zod12.z.string(),
|
|
813
|
+
from: import_zod12.z.string().optional(),
|
|
814
|
+
def: import_zod12.z.string().optional()
|
|
725
815
|
}),
|
|
726
|
-
|
|
816
|
+
import_zod12.z.object({ type: import_zod12.z.literal("unknown") })
|
|
727
817
|
])
|
|
728
818
|
);
|
|
729
819
|
var MAX_DEFINITION_DEPTH = 6;
|
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,
|
|
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, z as typeDefinitionKey, A as withDefinitionsInlined } from './schemas-Dn1AzzWd.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,
|
|
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, z as typeDefinitionKey, A as withDefinitionsInlined } from './schemas-Dn1AzzWd.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.21.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": [
|