@suss/ir-core 0.5.9 → 0.5.10

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.
@@ -7,6 +7,17 @@ import { z as z9 } from "zod";
7
7
  // src/semantics/functionCall.ts
8
8
  import { z } from "zod";
9
9
 
10
+ // src/identityKeys.ts
11
+ function gqlIdentityKey(typeName, fieldName) {
12
+ return `gql:${typeName}.${fieldName}`;
13
+ }
14
+ function fnIdentityKey(packageName, exportPath) {
15
+ return `fn:${packageName}::${exportPath.join(".")}`;
16
+ }
17
+ function busIdentityKey(messageBus, subject) {
18
+ return `bus:${messageBus} ${subject}`;
19
+ }
20
+
10
21
  // src/semantics/definition.ts
11
22
  function defineBoundarySemantics(definition) {
12
23
  return definition;
@@ -51,6 +62,12 @@ var functionCallSemantics = defineBoundarySemantics({
51
62
  /** A call returns a value, which is not a status and a body. */
52
63
  exchangesHttpResponses: false,
53
64
  reportsUnpairedItself: false,
65
+ /**
66
+ * In-repo units (components, bare handlers) are keyless by design
67
+ * and pair through call edges rather than the keyed pass, so a
68
+ * missing key is not a boundary nothing can reach.
69
+ */
70
+ canPair: () => true,
54
71
  /**
55
72
  * `"fn:<package>::<exportPath>"` when both are set. Other in-process
56
73
  * function-call units, such as components and bare handlers inside
@@ -58,7 +75,7 @@ var functionCallSemantics = defineBoundarySemantics({
58
75
  */
59
76
  identityKey(semantics) {
60
77
  if (semantics.package !== void 0 && semantics.exportPath !== void 0 && semantics.exportPath.length > 0) {
61
- return `fn:${semantics.package}::${semantics.exportPath.join(".")}`;
78
+ return fnIdentityKey(semantics.package, semantics.exportPath);
62
79
  }
63
80
  return null;
64
81
  }
@@ -84,6 +101,8 @@ var graphqlOperationSemantics = defineBoundarySemantics({
84
101
  exchangesHttpResponses: false,
85
102
  reportsUnpairedItself: false,
86
103
  identityKey: () => null,
104
+ /** Keyless by design; the dedicated pass pairs it by its document. */
105
+ canPair: () => true,
87
106
  /** "query GetUser". The contract checker pairs it, the key does not. */
88
107
  displayLabel(semantics) {
89
108
  return `${semantics.operationType} ${semantics.operationName ?? "<anonymous>"}`;
@@ -120,7 +139,7 @@ var graphqlResolverSemantics = defineBoundarySemantics({
120
139
  if (semantics.typeName === null || semantics.fieldName === "") {
121
140
  return null;
122
141
  }
123
- return `gql:${semantics.typeName}.${semantics.fieldName}`;
142
+ return gqlIdentityKey(semantics.typeName, semantics.fieldName);
124
143
  }
125
144
  }
126
145
  });
@@ -182,6 +201,12 @@ var messageBusSemantics = defineBoundarySemantics({
182
201
  * ones, so the generic unmatched lists leave them alone.
183
202
  */
184
203
  reportsUnpairedItself: true,
204
+ /**
205
+ * A channel unnamed here can still pair: the dedicated pass
206
+ * collapses env chains before comparing, so a consumer whose
207
+ * channel arrives at runtime meets the template that declares it.
208
+ */
209
+ canPair: () => true,
185
210
  /**
186
211
  * `"bus:<messageBus> <subject>"`, or null when the channel is null
187
212
  * or its subject is empty.
@@ -204,7 +229,7 @@ var messageBusSemantics = defineBoundarySemantics({
204
229
  if (subject === "") {
205
230
  return null;
206
231
  }
207
- return `bus:${semantics.messageBus} ${subject}`;
232
+ return busIdentityKey(semantics.messageBus, subject);
208
233
  },
209
234
  sidesAgree(a, b) {
210
235
  if (a.channel === null || b.channel === null) {
@@ -566,8 +591,11 @@ function withDefinitionsInlined(shape, definitions, depth = 0, inProgress = /* @
566
591
  }
567
592
 
568
593
  export {
569
- FunctionCallSemanticsSchema,
570
594
  GraphqlOperationSemanticsSchema,
595
+ gqlIdentityKey,
596
+ fnIdentityKey,
597
+ busIdentityKey,
598
+ FunctionCallSemanticsSchema,
571
599
  GraphqlResolverSemanticsSchema,
572
600
  parseChannel,
573
601
  formatChannel,