@spine-event-engine/ai 0.0.0-stage → 2.0.0-snapshot.23

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 (53) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +73 -2
  3. package/REFERENCE.md +238 -0
  4. package/dist/index.d.ts +31 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +26 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/internal/contracts.d.ts +648 -0
  9. package/dist/internal/contracts.d.ts.map +1 -0
  10. package/dist/internal/contracts.js +15 -0
  11. package/dist/internal/contracts.js.map +1 -0
  12. package/dist/internal/decision.d.ts +54 -0
  13. package/dist/internal/decision.d.ts.map +1 -0
  14. package/dist/internal/decision.js +197 -0
  15. package/dist/internal/decision.js.map +1 -0
  16. package/dist/internal/execution.d.ts +309 -0
  17. package/dist/internal/execution.d.ts.map +1 -0
  18. package/dist/internal/execution.js +143 -0
  19. package/dist/internal/execution.js.map +1 -0
  20. package/dist/internal/mcp-protocol.d.ts +282 -0
  21. package/dist/internal/mcp-protocol.d.ts.map +1 -0
  22. package/dist/internal/mcp-protocol.js +32 -0
  23. package/dist/internal/mcp-protocol.js.map +1 -0
  24. package/dist/internal/mcp.d.ts +36 -0
  25. package/dist/internal/mcp.d.ts.map +1 -0
  26. package/dist/internal/mcp.js +144 -0
  27. package/dist/internal/mcp.js.map +1 -0
  28. package/dist/internal/model.d.ts +103 -0
  29. package/dist/internal/model.d.ts.map +1 -0
  30. package/dist/internal/model.js +292 -0
  31. package/dist/internal/model.js.map +1 -0
  32. package/dist/internal/registration.d.ts +102 -0
  33. package/dist/internal/registration.d.ts.map +1 -0
  34. package/dist/internal/registration.js +65 -0
  35. package/dist/internal/registration.js.map +1 -0
  36. package/dist/internal/registry.d.ts +102 -0
  37. package/dist/internal/registry.d.ts.map +1 -0
  38. package/dist/internal/registry.js +250 -0
  39. package/dist/internal/registry.js.map +1 -0
  40. package/dist/internal/schema.d.ts +70 -0
  41. package/dist/internal/schema.d.ts.map +1 -0
  42. package/dist/internal/schema.js +329 -0
  43. package/dist/internal/schema.js.map +1 -0
  44. package/dist/spi/adapter.d.ts +11 -0
  45. package/dist/spi/adapter.d.ts.map +1 -0
  46. package/dist/spi/adapter.js +21 -0
  47. package/dist/spi/adapter.js.map +1 -0
  48. package/dist/spi/runtime.d.ts +10 -0
  49. package/dist/spi/runtime.d.ts.map +1 -0
  50. package/dist/spi/runtime.js +20 -0
  51. package/dist/spi/runtime.js.map +1 -0
  52. package/dist/tsconfig.tsbuildinfo +1 -0
  53. package/package.json +37 -3
@@ -0,0 +1,329 @@
1
+ /*
2
+ * Copyright 2026, CodeMatters. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
+ * in compliance with the License. You may obtain a copy of the License at
6
+ *
7
+ * https://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
10
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
+ * or implied. See the License for the specific language governing permissions and limitations under
12
+ * the License.
13
+ */
14
+ import { fromJsonString, getOption, ScalarType } from "@bufbuild/protobuf";
15
+ import { Validate } from "@spine-event-engine/core";
16
+ import { choice, max, min, pattern, range, required } from "@spine-event-engine/proto/agent";
17
+ /**
18
+ * Fails before provider dispatch for constraints that cannot be represented exactly.
19
+ *
20
+ * @param field Descriptor being lowered.
21
+ * @param path Field-specific diagnostic path.
22
+ */
23
+ const checkOptions = (field, path) => {
24
+ if (getOption(field, range).value)
25
+ throw new TypeError(`${path}: range is unsupported`);
26
+ if (getOption(field, min).value || getOption(field, max).value) {
27
+ if (field.fieldKind !== "scalar" || (!isNumber32(field.scalar) && !positive64Bound(field)))
28
+ throw new TypeError(`${path}: numeric bound is unsupported`);
29
+ }
30
+ const declaredPattern = getOption(field, pattern);
31
+ if (declaredPattern.regex) {
32
+ if (field.fieldKind !== "scalar" || field.scalar !== ScalarType.STRING)
33
+ throw new TypeError(`${path}: pattern is unsupported`);
34
+ if (declaredPattern.modifier ||
35
+ !declaredPattern.regex.startsWith("^") ||
36
+ !declaredPattern.regex.endsWith("$"))
37
+ throw new TypeError(`${path}: pattern modifiers or partial matches are unsupported`);
38
+ }
39
+ };
40
+ /**
41
+ * @param field Numeric descriptor. @returns Whether one exact positive bound is representable.
42
+ */
43
+ const positive64Bound = (field) => {
44
+ return (field.fieldKind === "scalar" &&
45
+ isLong64(field.scalar) &&
46
+ getOption(field, min).value === "1" &&
47
+ !getOption(field, min).exclusive &&
48
+ !getOption(field, max).value);
49
+ };
50
+ /**
51
+ * @param scalar Protobuf scalar kind. @returns Whether ProtoJSON requires a decimal string.
52
+ */
53
+ const isLong64 = (scalar) => {
54
+ return [
55
+ ScalarType.INT64,
56
+ ScalarType.UINT64,
57
+ ScalarType.SINT64,
58
+ ScalarType.FIXED64,
59
+ ScalarType.SFIXED64,
60
+ ].includes(scalar);
61
+ };
62
+ /**
63
+ * @param field Descriptor. @returns Whether JSON must supply the field.
64
+ */
65
+ const requiredField = (field) => {
66
+ return (getOption(field, required) ||
67
+ positive64Bound(field) ||
68
+ (field.fieldKind === "scalar" &&
69
+ isNumber32(field.scalar) &&
70
+ getOption(field, min).value === "1" &&
71
+ !getOption(field, min).exclusive));
72
+ };
73
+ /**
74
+ * @param scalar Protobuf scalar kind. @returns Whether JSON represents it as a number.
75
+ */
76
+ const isNumber32 = (scalar) => {
77
+ return scalar === ScalarType.DOUBLE || scalar === ScalarType.FLOAT || isInteger32(scalar);
78
+ };
79
+ /**
80
+ * Checks whether a scalar uses an integral 32-bit ProtoJSON number.
81
+ *
82
+ * @param scalar Protobuf scalar kind.
83
+ * @returns Whether the native schema must require an integer.
84
+ */
85
+ const isInteger32 = (scalar) => {
86
+ return [
87
+ ScalarType.INT32,
88
+ ScalarType.UINT32,
89
+ ScalarType.SINT32,
90
+ ScalarType.FIXED32,
91
+ ScalarType.SFIXED32,
92
+ ].includes(scalar);
93
+ };
94
+ /**
95
+ * @param scalar Protobuf scalar kind. @returns Strict JSON scalar schema.
96
+ */
97
+ const scalarSchema = (scalar) => {
98
+ if (scalar === ScalarType.STRING)
99
+ return { type: "string" };
100
+ if (scalar === ScalarType.BYTES)
101
+ return { type: "string", contentEncoding: "base64" };
102
+ if (scalar === ScalarType.BOOL)
103
+ return { type: "boolean" };
104
+ if (isInteger32(scalar))
105
+ return { type: "integer" };
106
+ if (isNumber32(scalar))
107
+ return { type: "number" };
108
+ if (isLong64(scalar))
109
+ return {
110
+ type: "string",
111
+ pattern: [ScalarType.UINT64, ScalarType.FIXED64].includes(scalar)
112
+ ? "^(0|[1-9][0-9]*)$"
113
+ : "^-?(0|[1-9][0-9]*)$",
114
+ };
115
+ throw new TypeError(`Unsupported scalar kind ${String(scalar)}`);
116
+ };
117
+ /**
118
+ * @param field Descriptor being lowered. @param path Diagnostic path. @returns JSON schema.
119
+ */
120
+ const fieldSchema = (field, path, active) => {
121
+ checkOptions(field, path);
122
+ if (field.fieldKind === "list") {
123
+ if (field.listKind === "message")
124
+ return { type: "array", items: messageSchema(field.message, path, active) };
125
+ if (field.listKind === "enum")
126
+ return { type: "array", items: { enum: field.enum.values.map((value) => value.name) } };
127
+ return { type: "array", items: scalarSchema(field.scalar) };
128
+ }
129
+ if (field.fieldKind === "map")
130
+ throw new TypeError(`${path}: maps are unsupported`);
131
+ if (field.fieldKind === "message")
132
+ return messageSchema(field.message, path, active);
133
+ if (field.fieldKind === "enum")
134
+ return { type: "string", enum: field.enum.values.map((value) => value.name) };
135
+ const schema = scalarSchema(field.scalar);
136
+ const lower = getOption(field, min);
137
+ const upper = getOption(field, max);
138
+ if (lower.value && isNumber32(field.scalar))
139
+ schema[lower.exclusive ? "exclusiveMinimum" : "minimum"] = Number(lower.value);
140
+ if (positive64Bound(field))
141
+ schema.pattern = "^[1-9][0-9]*$";
142
+ if (upper.value)
143
+ schema[upper.exclusive ? "exclusiveMaximum" : "maximum"] = Number(upper.value);
144
+ const regex = getOption(field, pattern).regex;
145
+ if (regex)
146
+ schema.pattern = regex;
147
+ return schema;
148
+ };
149
+ /**
150
+ * @param message Nested message. @param path Diagnostic path. @returns JSON schema.
151
+ */
152
+ const messageSchema = (message, path, active = new Set()) => {
153
+ if (active.has(message.typeName))
154
+ throw new TypeError(`${path}: recursive message unsupported`);
155
+ const nested = new Set(active).add(message.typeName);
156
+ if (message.typeName === "google.protobuf.Any" ||
157
+ message.typeName === "google.protobuf.Timestamp" ||
158
+ message.typeName === "google.protobuf.Duration")
159
+ throw new TypeError(`${path}: ${message.typeName} ProtoJSON is unsupported`);
160
+ if (message.typeName === "google.protobuf.Empty")
161
+ return { type: "object", properties: {}, required: [], additionalProperties: false };
162
+ if (message.typeName.endsWith("Value") && message.typeName.startsWith("google.protobuf.")) {
163
+ const value = message.fields[0];
164
+ if (value?.fieldKind !== "scalar")
165
+ throw new TypeError(`${path}: wrapper unsupported`);
166
+ return scalarSchema(value.scalar);
167
+ }
168
+ const properties = Object.fromEntries(message.fields.map((field) => [
169
+ field.jsonName,
170
+ fieldSchema(field, `${path}.${field.name}`, nested),
171
+ ]));
172
+ const allOf = oneofSchemas(message);
173
+ return {
174
+ type: "object",
175
+ properties,
176
+ required: message.fields.filter(requiredField).map((field) => field.jsonName),
177
+ additionalProperties: false,
178
+ ...(allOf.length ? { allOf } : {}),
179
+ };
180
+ };
181
+ /**
182
+ * Represents declared Protobuf oneofs as exact JSON alternatives.
183
+ *
184
+ * @param message Message descriptor with optional choice constraints.
185
+ * @returns Schema clauses for each oneof.
186
+ */
187
+ const oneofSchemas = (message) => {
188
+ return message.oneofs.map((oneof) => ({
189
+ oneOf: [
190
+ ...(!getOption(oneof, choice).required
191
+ ? [{ not: { anyOf: oneof.fields.map((field) => ({ required: [field.jsonName] })) } }]
192
+ : []),
193
+ ...oneof.fields.map((field) => ({ required: [field.jsonName] })),
194
+ ],
195
+ }));
196
+ };
197
+ /**
198
+ * Creates provider-neutral schema directly from a generated descriptor.
199
+ *
200
+ * @param schema Generated Protobuf output schema.
201
+ * @returns Strict schema or a field-specific unsupported-feature error.
202
+ */
203
+ export const deriveOutputSchema = (schema) => {
204
+ const candidate = schema;
205
+ if (typeof candidate !== "object" ||
206
+ candidate === null ||
207
+ candidate.kind !== "message")
208
+ throw new TypeError("output must be a message descriptor");
209
+ if (schema.typeName.startsWith("google.protobuf.") && schema.typeName.endsWith("Value"))
210
+ throw new TypeError(`${schema.typeName}: scalar root wrapper output is unsupported`);
211
+ return messageSchema(schema, schema.typeName);
212
+ };
213
+ /**
214
+ * @param code Machine-readable issue code. @param path JSON field path. @param message Safe diagnostic. @returns Issue.
215
+ */
216
+ const issue = (code, path, message) => {
217
+ return { code, path, message };
218
+ };
219
+ /**
220
+ * @param field Descriptor. @param value Raw JSON value. @param path Field path. @returns Shape issues.
221
+ */
222
+ const checkField = (field, value, path) => {
223
+ if (field.fieldKind === "message")
224
+ return checkMessageValue(field.message, value, path);
225
+ if (field.fieldKind === "list" && Array.isArray(value))
226
+ return value.flatMap((item, index) => {
227
+ const itemPath = `${path}[${String(index)}]`;
228
+ if (field.listKind === "message")
229
+ return checkMessageValue(field.message, item, itemPath);
230
+ if (field.listKind === "scalar")
231
+ return checkLongValue(field.scalar, item, itemPath);
232
+ return [];
233
+ });
234
+ if (field.fieldKind === "scalar")
235
+ return checkLongValue(field.scalar, value, path);
236
+ return [];
237
+ };
238
+ /**
239
+ * Checks a scalar before Buf can round an unsafe 64-bit JSON number.
240
+ *
241
+ * @param scalar Protobuf scalar kind.
242
+ * @param value Raw JSON value.
243
+ * @param path Candidate field path.
244
+ * @returns Exact-integer issues.
245
+ */
246
+ const checkLongValue = (scalar, value, path) => {
247
+ return isLong64(scalar) && typeof value !== "string"
248
+ ? [issue("INVALID_INTEGER", path, "64-bit integer must be a decimal string")]
249
+ : [];
250
+ };
251
+ /**
252
+ * Checks a nested message or scalar-shaped well-known wrapper.
253
+ *
254
+ * @param message Nested message descriptor.
255
+ * @param value Raw ProtoJSON value.
256
+ * @param path Candidate field path.
257
+ * @returns Shape or exact-integer issues.
258
+ */
259
+ const checkMessageValue = (message, value, path) => {
260
+ if (message.typeName.startsWith("google.protobuf.") && message.typeName.endsWith("Value")) {
261
+ const scalar = message.fields[0];
262
+ return scalar?.fieldKind === "scalar" ? checkLongValue(scalar.scalar, value, path) : [];
263
+ }
264
+ return checkShape(message, value, path);
265
+ };
266
+ /**
267
+ * @param message Descriptor. @param value Raw JSON object. @param path Object path. @returns Shape issues.
268
+ */
269
+ const checkShape = (message, value, path) => {
270
+ if (typeof value !== "object" || value === null || Array.isArray(value))
271
+ return [issue("INVALID_OBJECT", path, "Expected a JSON object")];
272
+ const candidate = value;
273
+ const names = new Set(message.fields.map((field) => field.jsonName));
274
+ const issues = Object.keys(candidate)
275
+ .filter((key) => !names.has(key))
276
+ .map((key) => issue("UNKNOWN_FIELD", `${path}.${key}`, "Unknown field"));
277
+ for (const field of message.fields) {
278
+ const entry = candidate[field.jsonName];
279
+ if (entry === undefined || entry === null) {
280
+ if (requiredField(field))
281
+ issues.push(issue("REQUIRED", `${path}.${field.jsonName}`, "Required field missing"));
282
+ }
283
+ else
284
+ issues.push(...checkField(field, entry, `${path}.${field.jsonName}`));
285
+ }
286
+ for (const oneof of message.oneofs) {
287
+ const count = oneof.fields.filter((field) => candidate[field.jsonName] !== undefined).length;
288
+ if (count > 1 || (count === 0 && getOption(oneof, choice).required))
289
+ issues.push(issue("ONEOF", `${path}.${oneof.name}`, "Exactly one member required"));
290
+ }
291
+ return issues;
292
+ };
293
+ /**
294
+ * Parses exact ProtoJSON, then applies Spine constraints and application validation.
295
+ *
296
+ * @typeParam S - Output message descriptor.
297
+ * @param schema Generated output descriptor.
298
+ * @param text Exact provider candidate text.
299
+ * @param check Optional pure application validator.
300
+ * @returns Admitted value or bounded local issues for a correction.
301
+ */
302
+ export const parseCandidate = (schema, text, check) => {
303
+ let raw;
304
+ try {
305
+ raw = JSON.parse(text);
306
+ }
307
+ catch {
308
+ return { ok: false, issues: [issue("MALFORMED_JSON", "$", "Invalid JSON")] };
309
+ }
310
+ const shapeIssues = checkShape(schema, raw, "$");
311
+ if (shapeIssues.length)
312
+ return { ok: false, issues: shapeIssues };
313
+ let value;
314
+ try {
315
+ value = fromJsonString(schema, text, { ignoreUnknownFields: false });
316
+ }
317
+ catch {
318
+ return { ok: false, issues: [issue("INVALID_PROTOJSON", "$", "Invalid Protobuf JSON value")] };
319
+ }
320
+ const result = Validate.message(schema, value);
321
+ if (!result.valid)
322
+ return {
323
+ ok: false,
324
+ issues: result.violations.map((entry) => issue("PROTO_CONSTRAINT", entry.fieldPath?.fieldName.join(".") ?? "$", entry.message?.withPlaceholders ?? "Invalid field")),
325
+ };
326
+ const appIssues = check?.(value) ?? [];
327
+ return appIssues.length ? { ok: false, issues: appIssues } : { ok: true, value };
328
+ };
329
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/internal/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,QAAQ,EAAsB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AA8D7F;;;;;GAKG;AACH,MAAM,YAAY,GAAG,CAAC,KAAgB,EAAE,IAAY,EAAQ,EAAE;IAC5D,IAAI,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,wBAAwB,CAAC,CAAC;IACxF,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC,KAAK,EAA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E,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAClE,IAAI,KAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAAC,EAAE,CAAC;IACjG,CAAC;IACD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM,CAAC,KAAK;QACf,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACtC,KAAK,CACH,kBAAkB,EAClB,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAC3C,KAAK,CAAC,OAAO,EAAE,gBAAgB,IAAI,eAAe,CACnD,CACF;SACF,CAAC;IACJ,MAAM,SAAS,GAAG,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACvC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACnF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Factory for registrations created by an optional provider adapter.
3
+ */
4
+ export { backendDefinition, createBackendRegistration } from "../internal/registration.js";
5
+ export { deriveOutputSchema } from "../internal/schema.js";
6
+ export type { AiBackendDefinition, AiBackendRegistration } from "../internal/registration.js";
7
+ export type { AiAttemptRequest, AiAttemptResponse, AiAttemptTicket, AiAttemptReplay, AiAttemptCompletion, AiCandidateAdmission, AiToolInvocation, AiExecutionControl, AiBackendExecution, AiBackendOutcome, } from "../internal/execution.js";
8
+ export { assertAiOutcomeContext } from "../internal/execution.js";
9
+ export { AiMcpSetupFailure } from "../internal/mcp-protocol.js";
10
+ export type { AiMcpProtocolFactory, AiMcpProtocolSession, AiMcpProtocolControl, AiMcpMessageRequest, AiMcpMessageTicket, AiMcpResolvedConnection, AiMcpConnectionIdentity, AiMcpToolDefinition, AiMcpAdvertisedTool, AiMcpToolResult, AiMcpResultContent, } from "../internal/mcp-protocol.js";
11
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/spi/adapter.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC9F,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACnB,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright 2026, CodeMatters. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
+ * in compliance with the License. You may obtain a copy of the License at
6
+ *
7
+ * https://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
10
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
+ * or implied. See the License for the specific language governing permissions and limitations under
12
+ * the License.
13
+ */
14
+ /**
15
+ * Factory for registrations created by an optional provider adapter.
16
+ */
17
+ export { backendDefinition, createBackendRegistration } from "../internal/registration.js";
18
+ export { deriveOutputSchema } from "../internal/schema.js";
19
+ export { assertAiOutcomeContext } from "../internal/execution.js";
20
+ export { AiMcpSetupFailure } from "../internal/mcp-protocol.js";
21
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/spi/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAc3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { isAiModel, modelRefKey } from "../internal/model.js";
2
+ export { backendDefinition } from "../internal/registration.js";
3
+ export { freezeRegistry, mcpRegistration, mcpRegistrations, registryOptions, selectDeployment, } from "../internal/registry.js";
4
+ export { mcpDefinition } from "../internal/mcp.js";
5
+ export type { AiSelection } from "../internal/registry.js";
6
+ export { deriveOutputSchema, parseCandidate } from "../internal/schema.js";
7
+ export type { AiOutputSchema, AiCandidateResult } from "../internal/schema.js";
8
+ export { admitDecision } from "../internal/decision.js";
9
+ export type { AiDistributionRounding, AiDecisionAdmission } from "../internal/decision.js";
10
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/spi/runtime.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3E,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Copyright 2026, CodeMatters. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
+ * in compliance with the License. You may obtain a copy of the License at
6
+ *
7
+ * https://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
10
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
+ * or implied. See the License for the specific language governing permissions and limitations under
12
+ * the License.
13
+ */
14
+ export { isAiModel, modelRefKey } from "../internal/model.js";
15
+ export { backendDefinition } from "../internal/registration.js";
16
+ export { freezeRegistry, mcpRegistration, mcpRegistrations, registryOptions, selectDeployment, } from "../internal/registry.js";
17
+ export { mcpDefinition } from "../internal/mcp.js";
18
+ export { deriveOutputSchema, parseCandidate } from "../internal/schema.js";
19
+ export { admitDecision } from "../internal/decision.js";
20
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/spi/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}