@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.
- package/LICENSE +201 -0
- package/README.md +73 -2
- package/REFERENCE.md +238 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/contracts.d.ts +648 -0
- package/dist/internal/contracts.d.ts.map +1 -0
- package/dist/internal/contracts.js +15 -0
- package/dist/internal/contracts.js.map +1 -0
- package/dist/internal/decision.d.ts +54 -0
- package/dist/internal/decision.d.ts.map +1 -0
- package/dist/internal/decision.js +197 -0
- package/dist/internal/decision.js.map +1 -0
- package/dist/internal/execution.d.ts +309 -0
- package/dist/internal/execution.d.ts.map +1 -0
- package/dist/internal/execution.js +143 -0
- package/dist/internal/execution.js.map +1 -0
- package/dist/internal/mcp-protocol.d.ts +282 -0
- package/dist/internal/mcp-protocol.d.ts.map +1 -0
- package/dist/internal/mcp-protocol.js +32 -0
- package/dist/internal/mcp-protocol.js.map +1 -0
- package/dist/internal/mcp.d.ts +36 -0
- package/dist/internal/mcp.d.ts.map +1 -0
- package/dist/internal/mcp.js +144 -0
- package/dist/internal/mcp.js.map +1 -0
- package/dist/internal/model.d.ts +103 -0
- package/dist/internal/model.d.ts.map +1 -0
- package/dist/internal/model.js +292 -0
- package/dist/internal/model.js.map +1 -0
- package/dist/internal/registration.d.ts +102 -0
- package/dist/internal/registration.d.ts.map +1 -0
- package/dist/internal/registration.js +65 -0
- package/dist/internal/registration.js.map +1 -0
- package/dist/internal/registry.d.ts +102 -0
- package/dist/internal/registry.d.ts.map +1 -0
- package/dist/internal/registry.js +250 -0
- package/dist/internal/registry.js.map +1 -0
- package/dist/internal/schema.d.ts +70 -0
- package/dist/internal/schema.d.ts.map +1 -0
- package/dist/internal/schema.js +329 -0
- package/dist/internal/schema.js.map +1 -0
- package/dist/spi/adapter.d.ts +11 -0
- package/dist/spi/adapter.d.ts.map +1 -0
- package/dist/spi/adapter.js +21 -0
- package/dist/spi/adapter.js.map +1 -0
- package/dist/spi/runtime.d.ts +10 -0
- package/dist/spi/runtime.d.ts.map +1 -0
- package/dist/spi/runtime.js +20 -0
- package/dist/spi/runtime.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +37 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Describe an AI task for an Agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An Agent can ask a model to help with a domain task, such as drafting a reply to a support ticket. This package describes the task: the input and result messages, instructions, and checks the result must pass. It does not choose a provider or store credentials. The package is currently an experimental snapshot.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Install it with the Protobuf package and your generated application messages:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @spine-event-engine/ai@snapshot @spine-event-engine/proto@snapshot @bufbuild/protobuf
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Define the task
|
|
14
|
+
|
|
15
|
+
The support example accepts a `DraftSupportReply` Command containing the ticket facts and expects a typed `SupportReply`. These descriptors come from the application's domain Protos.
|
|
16
|
+
|
|
17
|
+
<!-- prettier-ignore-start -->
|
|
18
|
+
|
|
19
|
+
<!-- docs-snippet-path: examples/support/src/model.ts -->
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { AiModel } from "@spine-event-engine/ai";
|
|
23
|
+
import { DraftSupportReplySchema } from "../generated/spine/examples/support/commands_pb.js";
|
|
24
|
+
import { SupportReplySchema } from "../generated/spine/examples/support/types_pb.js";
|
|
25
|
+
|
|
26
|
+
const draftSupportReply = AiModel.define({
|
|
27
|
+
name: "draft-support-reply",
|
|
28
|
+
version: "1",
|
|
29
|
+
kind: "generation",
|
|
30
|
+
input: DraftSupportReplySchema,
|
|
31
|
+
output: SupportReplySchema,
|
|
32
|
+
outputMode: "prompt-and-validate",
|
|
33
|
+
instructions: "Draft a reply for a support person to review using the supplied ticket facts.",
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
<!-- prettier-ignore-end -->
|
|
38
|
+
|
|
39
|
+
`prompt-and-validate` asks the provider for a result and checks the parsed message locally. A provider that supports native schema output can use `native-schema` instead; local output validation still applies. The [support application](https://github.com/SpineEventEngine/spine-ts/blob/master/examples/support/README.md) adds a domain rule so a blank reply cannot become a proposal. Defining a task does not make a model request.
|
|
40
|
+
|
|
41
|
+
## Connect a deployment
|
|
42
|
+
|
|
43
|
+
The task above says what input and output mean. A deployment says which permitted provider account and model will do that task. The [adapter guide](https://github.com/SpineEventEngine/spine-ts/blob/master/packages/ai-vercel-ax/README.md) returns a registration with a model reference, credential setup, and authorization check. Build an `AiRegistry` outside the Agent and attach it to the Bounded Context:
|
|
44
|
+
|
|
45
|
+
<!-- prettier-ignore-start -->
|
|
46
|
+
|
|
47
|
+
<!-- docs-snippet-path: examples/support/test/support-blackbox.test.ts -->
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import {
|
|
51
|
+
AiRegistry,
|
|
52
|
+
type AiBackendRegistration,
|
|
53
|
+
} from "@spine-event-engine/ai";
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Selects a registered provider model for generation tasks.
|
|
57
|
+
*
|
|
58
|
+
* @param registration Deployment configured by the trusted application.
|
|
59
|
+
* @returns Registry to install while building the Bounded Context.
|
|
60
|
+
*/
|
|
61
|
+
function generationRegistry(registration: AiBackendRegistration): AiRegistry {
|
|
62
|
+
return AiRegistry.create({
|
|
63
|
+
defaultModels: { generation: registration.ref },
|
|
64
|
+
}).register(registration);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
<!-- prettier-ignore-end -->
|
|
69
|
+
|
|
70
|
+
The [support context factory](https://github.com/SpineEventEngine/spine-ts/blob/master/examples/support/src/index.ts) calls `withAi(registry)` when it builds its Agent repository. The [support walkthrough](https://github.com/SpineEventEngine/spine-ts/blob/master/examples/support/README.md#3-invoke-the-task-from-the-agent) shows the actual handler calling `this.ai.invoke(draftSupportReply, { call, conversation, input })` and turning its result into a domain Event. The [BlackBox step](https://github.com/SpineEventEngine/spine-ts/blob/master/examples/support/README.md#4-configure-and-test-the-full-flow) shows the same path with a controlled test deployment. The handler does not need a provider SDK or credential.
|
|
71
|
+
|
|
72
|
+
An Agent task can also allow named tools. **MCP** is a protocol that lets a model ask the application to run one of those tools and return its result. The application explicitly lists permitted tools and checks access before a tool runs; model text alone grants no permission. [Release Notes Studio](https://github.com/SpineEventEngine/spine-ts/blob/master/examples/release-notes/README.md#6-let-the-model-ask-for-git-details) uses read-only Git tools to supply evidence for a draft.
|
|
73
|
+
|
|
74
|
+
For exact definition fields, deployment selection, optional application limits, tool registration, and result types, see the [coding-agent reference](REFERENCE.md).
|
package/REFERENCE.md
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Agent AI facade reference
|
|
2
|
+
|
|
3
|
+
Audience: coding agents implementing or checking the AI facade and deployment contracts.
|
|
4
|
+
|
|
5
|
+
## Typed operations and deployments
|
|
6
|
+
|
|
7
|
+
`AiModel.define()` describes one application operation. It validates and copies
|
|
8
|
+
its definition synchronously; defining it does not call a provider. Input and
|
|
9
|
+
output are generated Protobuf descriptors. The definition includes a name,
|
|
10
|
+
version, and either generation instructions or decision questions. Applications
|
|
11
|
+
may configure ceilings for an operation; omitted values impose no such ceiling.
|
|
12
|
+
Register the resulting object among the Agent repository's `ai.models`.
|
|
13
|
+
|
|
14
|
+
A `ModelRef` identifies a configured deployment by name and revision.
|
|
15
|
+
`ModelRef.of()` creates that Protobuf value. Deployment registrations provide an
|
|
16
|
+
adapter, authenticated connection callbacks, and a credential-free account,
|
|
17
|
+
endpoint and model identity. They are separate from the application operation:
|
|
18
|
+
the same drafting operation can use a different permitted deployment without
|
|
19
|
+
putting provider SDK calls in its Entity handler.
|
|
20
|
+
|
|
21
|
+
`AiRegistry.create()` validates deployment defaults and any configured invocation,
|
|
22
|
+
concurrency or queue ceilings. Register deployments with `register()` and configured MCP servers with
|
|
23
|
+
`registerTools()`. Defaults, limits and tool policy freeze when the runtime
|
|
24
|
+
binds the registry. `register()` can append a unique deployment afterward;
|
|
25
|
+
existing references and policy cannot be replaced.
|
|
26
|
+
Choose a generation default, a decision default, or both. A capability's kind
|
|
27
|
+
must match its selected deployment. The server package supplies Bounded Context and
|
|
28
|
+
repository integration; this package alone does not start a signal handler.
|
|
29
|
+
|
|
30
|
+
## Calls and results
|
|
31
|
+
|
|
32
|
+
Inside a signal handler, `this.ai.invoke(model, { call, conversation, input })`
|
|
33
|
+
returns a `Promise<AiResult<Output>>`. `call` names the logical operation within
|
|
34
|
+
that accepted signal, and `conversation` is an explicit `ConversationId`.
|
|
35
|
+
`input` must be an instance of the declared input message. On success, inspect
|
|
36
|
+
`value` and emit the application's domain outcome. On operational failure,
|
|
37
|
+
inspect `failure.code`, `retryableByNewSignal`, and `diagnosticId`. Both results
|
|
38
|
+
carry the operation ID. A technical handler defect can still fail the handler;
|
|
39
|
+
`AiResult` is not a catch-all for arbitrary application exceptions.
|
|
40
|
+
|
|
41
|
+
The runtime saves the named operation, prepared requests and received results.
|
|
42
|
+
Recovery reuses recorded results and rejects changed input or configuration for
|
|
43
|
+
an existing call. A fresh accepted signal can make a new model request and may
|
|
44
|
+
receive different words. The framework does not promise repeatable fresh model
|
|
45
|
+
output or know whether every model assertion is true.
|
|
46
|
+
|
|
47
|
+
`this.ai.select(kind, model)` records an instance preference for later signals.
|
|
48
|
+
Pass `undefined` to restore inheritance. The current signal keeps its selected
|
|
49
|
+
deployment. The repository's allowed model list remains an authorization boundary;
|
|
50
|
+
an instance preference cannot bypass it. See the
|
|
51
|
+
[server reference](../server/REFERENCE.md) for configuration precedence and
|
|
52
|
+
execution lifecycle.
|
|
53
|
+
|
|
54
|
+
## Generation validation and corrections
|
|
55
|
+
|
|
56
|
+
Generation explicitly chooses `native-schema` or `prompt-and-validate`.
|
|
57
|
+
Native schema mode requires a supported descriptor and provider profile; it does
|
|
58
|
+
not silently fall back to text prompting. Prompt-and-validate mode supplies the
|
|
59
|
+
model-facing representation and checks the resulting text locally.
|
|
60
|
+
|
|
61
|
+
Both paths parse and validate the model response against the declared output message.
|
|
62
|
+
A versioned `validation.check(value, input)` then applies a pure application rule.
|
|
63
|
+
Return concrete issues with a code, field path, and safe message. A field path can
|
|
64
|
+
be empty for an issue affecting the whole result. The callback receives the same
|
|
65
|
+
input facts as the operation; it must not fetch new data or perform side effects.
|
|
66
|
+
|
|
67
|
+
A response that fails validation may lead to a corrective request, subject to any
|
|
68
|
+
configured request, time and byte ceilings. The correction includes the actual detected issues, and the
|
|
69
|
+
runtime retains that request as another attempt. It cannot describe an alleged
|
|
70
|
+
hallucination that no validation rule detected. Refusal, cancellation, exhausted
|
|
71
|
+
configured limits and unknown external write outcomes have explicit failure paths.
|
|
72
|
+
|
|
73
|
+
Native output schemas support a conservative descriptor subset. Unsupported
|
|
74
|
+
fields or options produce field-specific errors before dispatch. See the
|
|
75
|
+
[adapter reference](../ai-vercel-ax/REFERENCE.md) for supported provider profiles.
|
|
76
|
+
|
|
77
|
+
## Non-generative decisions
|
|
78
|
+
|
|
79
|
+
A decision capability defines boolean, choice, or score questions. The adapter
|
|
80
|
+
validates question IDs, answer kinds and ranges before calling the versioned
|
|
81
|
+
`mapping.toMessage(result, input)`. That pure callback creates the output Proto;
|
|
82
|
+
Proto validation and the application validation rule still apply. Optional
|
|
83
|
+
requirements for full probability distributions and independent question
|
|
84
|
+
execution must be supported by the deployment. See the
|
|
85
|
+
[Jev registration example](../ai-vercel-ax/REFERENCE.md#openrouter-jev-decision-registration).
|
|
86
|
+
|
|
87
|
+
## Limits and tools
|
|
88
|
+
|
|
89
|
+
Applications may set ceilings for physical model requests, tool calls, elapsed
|
|
90
|
+
time, input bytes, output bytes and generation tokens. Each setting is optional.
|
|
91
|
+
Registry invocation settings may additionally limit work shared by all selected
|
|
92
|
+
handlers of one signal, including recorded reads. Omitting a setting does not
|
|
93
|
+
substitute a framework default. Cancellation remains available without a deadline.
|
|
94
|
+
|
|
95
|
+
Recovery retains measured usage and any configured deadline. Completed exchanges
|
|
96
|
+
record their received byte counts. When a configured shared output ceiling applies,
|
|
97
|
+
the runtime reserves the remaining allowance before dispatch; if a response ends
|
|
98
|
+
without a complete byte count, that reservation remains charged. Without an output
|
|
99
|
+
ceiling, the runtime still records dispatch and measured bytes.
|
|
100
|
+
|
|
101
|
+
Set `maxOutputTokens` only when the deployment can enforce it. An adapter that
|
|
102
|
+
cannot enforce an explicit token ceiling rejects the call before inference. Byte
|
|
103
|
+
ceilings apply to materialized and received data, including protocol framing;
|
|
104
|
+
they are different from model token counts.
|
|
105
|
+
|
|
106
|
+
Await each model call before starting the next one in the same handler. Concurrent
|
|
107
|
+
calls, an unfinished call when the handler returns, and reuse of a facade after
|
|
108
|
+
its handler finishes are programming errors.
|
|
109
|
+
|
|
110
|
+
Bounded Contexts that share one `AiRegistry` object also share any configured
|
|
111
|
+
execution capacity within that process. `concurrentOperations` can limit active
|
|
112
|
+
Agent executions; `queuedOperations` can limit additional work waiting in memory
|
|
113
|
+
for a slot. Both settings are optional. If capacity is configured and full, further
|
|
114
|
+
accepted signals remain in durable storage until a slot becomes available. Waiting
|
|
115
|
+
before execution does not consume a configured execution deadline. Recovery keeps
|
|
116
|
+
the deadline of an execution that already started. Separate registries and
|
|
117
|
+
processes do not share these settings.
|
|
118
|
+
|
|
119
|
+
`Mcp.server()` validates an explicitly configured tool server. A generation
|
|
120
|
+
capability lists the server/tool references it may use. Connection and per-call
|
|
121
|
+
authorization receive the accepted actor, tenant and Agent scope. The runtime
|
|
122
|
+
records tool intent before dispatch and retains results before model continuation.
|
|
123
|
+
Per-tool timeouts and argument/result byte ceilings are optional; no values are
|
|
124
|
+
substituted when they are omitted.
|
|
125
|
+
A write whose result is unknown cannot be sent again automatically. Supported
|
|
126
|
+
content and protocol limits are documented by the optional adapter; model text
|
|
127
|
+
cannot add a server, change credentials, or extend a tool's permission.
|
|
128
|
+
|
|
129
|
+
## Configure an MCP lookup
|
|
130
|
+
|
|
131
|
+
This example adds a locally running knowledge service to support drafting. Its
|
|
132
|
+
`lookup` tool is read-only and requires no credentials in this demonstration.
|
|
133
|
+
The server must expose that exact tool name. Only the configured tool is made
|
|
134
|
+
available to this capability. The model may request it; permission does not
|
|
135
|
+
force a call.
|
|
136
|
+
|
|
137
|
+
The generated message imports come from the [Support example](../../examples/support/README.md).
|
|
138
|
+
Supply a generation deployment created with `VercelAx.model()` as shown in the
|
|
139
|
+
[adapter quickstart](../ai-vercel-ax/README.md). Register `knowledgeDraft` among
|
|
140
|
+
the Agent repository's `ai.models`, then invoke that capability from its handler.
|
|
141
|
+
|
|
142
|
+
<!-- prettier-ignore-start -->
|
|
143
|
+
|
|
144
|
+
<!-- docs-snippet-path: examples/support/src/index.ts -->
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
import { AiModel, AiRegistry, Mcp, type AiBackendRegistration } from "@spine-event-engine/ai";
|
|
148
|
+
import { DraftSupportReplySchema } from "../generated/spine/examples/support/commands_pb.js";
|
|
149
|
+
import { SupportReplySchema } from "../generated/spine/examples/support/types_pb.js";
|
|
150
|
+
|
|
151
|
+
/** Drafts a reply using supplied facts and the permitted knowledge lookup. */
|
|
152
|
+
const knowledgeDraft = AiModel.define({
|
|
153
|
+
name: "knowledge-support-reply",
|
|
154
|
+
version: "1",
|
|
155
|
+
kind: "generation",
|
|
156
|
+
input: DraftSupportReplySchema,
|
|
157
|
+
output: SupportReplySchema,
|
|
158
|
+
outputMode: "prompt-and-validate",
|
|
159
|
+
instructions:
|
|
160
|
+
"Use the reported facts and relevant knowledge articles to draft a reply for human review.",
|
|
161
|
+
tools: [{ server: "knowledge", tool: "lookup" }],
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
/** Permits only lookup on the public demonstration knowledge service. */
|
|
165
|
+
const knowledge = Mcp.server({
|
|
166
|
+
id: "knowledge",
|
|
167
|
+
revision: "1",
|
|
168
|
+
transport: { kind: "streamable-http", url: "http://127.0.0.1:3333/mcp" },
|
|
169
|
+
authorizeConnect: () => true,
|
|
170
|
+
tools: {
|
|
171
|
+
lookup: {
|
|
172
|
+
effect: "read",
|
|
173
|
+
authorize: () => true,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Registers a local public knowledge lookup and a configured generation model.
|
|
180
|
+
*
|
|
181
|
+
* @param deployment Authenticated model registration created by the application.
|
|
182
|
+
* @returns Registry for BoundedContextBuilder.withAi().
|
|
183
|
+
*/
|
|
184
|
+
function supportAi(deployment: AiBackendRegistration): AiRegistry {
|
|
185
|
+
return AiRegistry.create({
|
|
186
|
+
defaultModels: { generation: deployment.ref },
|
|
187
|
+
})
|
|
188
|
+
.register(deployment)
|
|
189
|
+
.registerTools(knowledge);
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
<!-- prettier-ignore-end -->
|
|
194
|
+
|
|
195
|
+
The `true` callbacks permit access to this public demonstration service. For a
|
|
196
|
+
restricted service, `authorizeConnect(scope, control)` checks connection access;
|
|
197
|
+
`tools.lookup.authorize(scope, call, control)` checks each proposed call and its
|
|
198
|
+
arguments. `scope` includes the accepted actor and tenant. Supply credentials with
|
|
199
|
+
`transport.headers(scope, control)` for HTTP, or `transport.environment(scope,
|
|
200
|
+
control)` for a configured stdio process. Resolve secrets in these callbacks;
|
|
201
|
+
do not put them in model input or recorded identity.
|
|
202
|
+
|
|
203
|
+
No MCP client or transport is created in Entity code. The selected Vercel adapter
|
|
204
|
+
supplies it when the operation runs. Setup traffic and tool responses contribute
|
|
205
|
+
to the invocation's measured byte counts. If you configure a byte ceiling, include discovery
|
|
206
|
+
as well as model output.
|
|
207
|
+
See the [adapter transport limits](../ai-vercel-ax/REFERENCE.md) for supported
|
|
208
|
+
schemas, result content and HTTP/stdio behavior, and the
|
|
209
|
+
[full Agent/MCP test](../server-blackbox-tests/test/agent-vercel-mcp-blackbox.test.ts)
|
|
210
|
+
for an executable local protocol example.
|
|
211
|
+
|
|
212
|
+
## History and testing
|
|
213
|
+
|
|
214
|
+
Agent history is retained by its repository. `fullHistory()` returns
|
|
215
|
+
`AgentHistoryEntry` messages whose oneof contains a conversation record, System
|
|
216
|
+
Event, or emitted domain Event. The other methods read a single category:
|
|
217
|
+
`conversationHistory()` requires a conversation ID, `systemEventHistory()` reads
|
|
218
|
+
System Events, and `domainEventHistory()` reads emitted domain Events.
|
|
219
|
+
|
|
220
|
+
All four take a positive `pageSize` and an optional opaque `cursor`, return newest
|
|
221
|
+
entries first, and provide `nextCursor` for older records. There is no 100-record
|
|
222
|
+
retention limit. A cursor belongs to its Agent, tenant, repository, category and
|
|
223
|
+
conversation.
|
|
224
|
+
Recording is mandatory and continues through logical Entity deletion or archive.
|
|
225
|
+
|
|
226
|
+
`AiTestBackend` scripts deployment responses while `BlackBox` remains the test
|
|
227
|
+
entrance for Commands, Events, state and audit. See the
|
|
228
|
+
[Support example](../../examples/support/README.md) and
|
|
229
|
+
[testing reference](../testing/REFERENCE.md).
|
|
230
|
+
|
|
231
|
+
## Adapter boundary
|
|
232
|
+
|
|
233
|
+
Entity code uses the public SDK-free facade. Adapter authors use the separate
|
|
234
|
+
`spi/adapter` entry point. Server integration uses the internal runtime SPI;
|
|
235
|
+
application code must not call those controls to bypass signal handling.
|
|
236
|
+
Unknown usage stays absent in `AiUsage`; a reported zero has an explicit
|
|
237
|
+
`AiTokenCount` message. Credentials belong in application connection callbacks
|
|
238
|
+
and are not part of recorded model identity or diagnostic messages.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { MessageSchema } from "@spine-event-engine/core";
|
|
2
|
+
import type { ModelRef as ProtoModelRef } from "@spine-event-engine/proto/agent";
|
|
3
|
+
import { AiModel as AiModelFactory, ModelRef as ModelRefFactory } from "./internal/model.js";
|
|
4
|
+
import type { AiModel as InternalAiModel } from "./internal/model.js";
|
|
5
|
+
/**
|
|
6
|
+
* SDK-free typed capability created only by {@link AiModel.define}.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam I - Input message descriptor.
|
|
9
|
+
* @typeParam O - Output message descriptor.
|
|
10
|
+
*/
|
|
11
|
+
export type AiModel<I extends MessageSchema, O extends MessageSchema> = InternalAiModel<I, O>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates validated typed capabilities.
|
|
14
|
+
*/
|
|
15
|
+
export declare const AiModel: typeof AiModelFactory;
|
|
16
|
+
/**
|
|
17
|
+
* Credential-free Protobuf deployment reference.
|
|
18
|
+
*/
|
|
19
|
+
export type ModelRef = ProtoModelRef;
|
|
20
|
+
/**
|
|
21
|
+
* Constructs canonical deployment references.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ModelRef: typeof ModelRefFactory;
|
|
24
|
+
export { AiRegistry } from "./internal/registry.js";
|
|
25
|
+
export { Mcp } from "./internal/mcp.js";
|
|
26
|
+
export type { AiBackendRegistration } from "./internal/registration.js";
|
|
27
|
+
export type { McpServerRegistration } from "./internal/mcp.js";
|
|
28
|
+
export type { AgentAi, AiAnswer, AiConnectionIdentity, AiControl, AiDecisionResult, AiDefaultModels, AiFailure, AiInvocationLimits, AiJson, AiLimits, AiModelBase, AiModelDefinition, AiQuestion, AiRegistryOptions, AiResult, AiScope, AiToolCall, AiToolRef, AiValidationIssue, ConversationHistoryRead, HistoryPage, HistoryRead, McpServerDefinition, McpToolPolicy, McpTransport, } from "./internal/contracts.js";
|
|
29
|
+
export type { ModelName, ModelRevision, ModelPreference, AiCapabilityName, AiCapabilityRevision, AiValidationRevision, AiMappingRevision, AiDiagnosticId, McpServerId, McpToolName, AiModelRequestLimit, AiToolCallLimit, AiDeadlineMillis, AiInputByteLimit, AiOutputByteLimit, AiOutputTokenLimit, AiTokenCount, AiProviderName, AiAccountIdentity, AiEndpointIdentity, AiProviderModelName, AiOperationLimits, AiUsage, DecisionQuestionId, DecisionAlternativeKey, ConversationRecordId, AgentHistoryCursor, AgentHistoryEntry, AgentOperationRef, AgentAiOperationStarted, AgentModelAttemptStarted, AgentModelAttemptFinished, AgentAiResultAdmitted, AgentAiOperationFailed, AgentToolCallStarted, AgentToolCallFinished, AgentModelSelectionChanged, AgentInvocationTerminated, AiAttemptId, AiContentDigest, AiOperationId, AiToolCallId, ConversationId, ConversationRecord, GenerationRequest, GenerationResponse, ModelToolCall, DecisionRequest, DecisionResponse, ToolRequest, ToolResponse, DecisionQuestion, DecisionAnswer, DecisionDistribution, DecisionRounding, DecisionChoice, DecisionProbability, } from "@spine-event-engine/proto/agent";
|
|
30
|
+
export { ModelNameSchema, ModelRevisionSchema, ModelPreferenceSchema, AiCapabilityNameSchema, AiCapabilityRevisionSchema, AiValidationRevisionSchema, AiMappingRevisionSchema, AiDiagnosticIdSchema, McpServerIdSchema, McpToolNameSchema, AiModelRequestLimitSchema, AiToolCallLimitSchema, AiDeadlineMillisSchema, AiInputByteLimitSchema, AiOutputByteLimitSchema, AiOutputTokenLimitSchema, AiTokenCountSchema, AiProviderNameSchema, AiAccountIdentitySchema, AiEndpointIdentitySchema, AiProviderModelNameSchema, AiOperationLimitsSchema, AiUsageSchema, AiConnectionIdentitySchema, DecisionQuestionIdSchema, DecisionAlternativeKeySchema, ConversationRecordIdSchema, AgentHistoryCursorSchema, AgentHistoryEntrySchema, AgentOperationRefSchema, AgentAiOperationStartedSchema, AgentModelAttemptStartedSchema, AgentModelAttemptFinishedSchema, AgentAiResultAdmittedSchema, AgentAiOperationFailedSchema, AgentToolCallStartedSchema, AgentToolCallFinishedSchema, AgentModelSelectionChangedSchema, AgentInvocationTerminatedSchema, AiAttemptIdSchema, AiContentDigestSchema, AiModelKind, AiOperationIdSchema, AiToolCallIdSchema, ConversationIdSchema, ConversationRecordSchema, ModelRefSchema, GenerationRequestSchema, GenerationResponseSchema, ModelToolCallSchema, DecisionRequestSchema, DecisionResponseSchema, ToolRequestSchema, ToolResponseSchema, DecisionQuestionSchema, DecisionAnswerSchema, DecisionDistributionSchema, DecisionRoundingSchema, DecisionChoiceSchema, DecisionProbabilitySchema, DecisionQuestionKind, ToolEffect, AiOutcome, AiFailureCode, AiExecutionMode, } from "@spine-event-engine/proto/agent";
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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 { AiModel as AiModelFactory, ModelRef as ModelRefFactory } from "./internal/model.js";
|
|
15
|
+
/**
|
|
16
|
+
* Creates validated typed capabilities.
|
|
17
|
+
*/
|
|
18
|
+
export const AiModel = AiModelFactory;
|
|
19
|
+
/**
|
|
20
|
+
* Constructs canonical deployment references.
|
|
21
|
+
*/
|
|
22
|
+
export const ModelRef = ModelRefFactory;
|
|
23
|
+
export { AiRegistry } from "./internal/registry.js";
|
|
24
|
+
export { Mcp } from "./internal/mcp.js";
|
|
25
|
+
export { ModelNameSchema, ModelRevisionSchema, ModelPreferenceSchema, AiCapabilityNameSchema, AiCapabilityRevisionSchema, AiValidationRevisionSchema, AiMappingRevisionSchema, AiDiagnosticIdSchema, McpServerIdSchema, McpToolNameSchema, AiModelRequestLimitSchema, AiToolCallLimitSchema, AiDeadlineMillisSchema, AiInputByteLimitSchema, AiOutputByteLimitSchema, AiOutputTokenLimitSchema, AiTokenCountSchema, AiProviderNameSchema, AiAccountIdentitySchema, AiEndpointIdentitySchema, AiProviderModelNameSchema, AiOperationLimitsSchema, AiUsageSchema, AiConnectionIdentitySchema, DecisionQuestionIdSchema, DecisionAlternativeKeySchema, ConversationRecordIdSchema, AgentHistoryCursorSchema, AgentHistoryEntrySchema, AgentOperationRefSchema, AgentAiOperationStartedSchema, AgentModelAttemptStartedSchema, AgentModelAttemptFinishedSchema, AgentAiResultAdmittedSchema, AgentAiOperationFailedSchema, AgentToolCallStartedSchema, AgentToolCallFinishedSchema, AgentModelSelectionChangedSchema, AgentInvocationTerminatedSchema, AiAttemptIdSchema, AiContentDigestSchema, AiModelKind, AiOperationIdSchema, AiToolCallIdSchema, ConversationIdSchema, ConversationRecordSchema, ModelRefSchema, GenerationRequestSchema, GenerationResponseSchema, ModelToolCallSchema, DecisionRequestSchema, DecisionResponseSchema, ToolRequestSchema, ToolResponseSchema, DecisionQuestionSchema, DecisionAnswerSchema, DecisionDistributionSchema, DecisionRoundingSchema, DecisionChoiceSchema, DecisionProbabilitySchema, DecisionQuestionKind, ToolEffect, AiOutcome, AiFailureCode, AiExecutionMode, } from "@spine-event-engine/proto/agent";
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAW7F;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAA0B,cAAc,CAAC;AAO7D;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA2B,eAAe,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAyFxC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,+BAA+B,EAC/B,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,aAAa,EACb,eAAe,GAChB,MAAM,iCAAiC,CAAC"}
|