@spine-event-engine/proto 2.0.0-snapshot.21 → 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 (50) hide show
  1. package/dist/generated/proto-module.d.ts +7 -1
  2. package/dist/generated/proto-module.d.ts.map +1 -1
  3. package/dist/generated/proto-module.js +53 -17
  4. package/dist/generated/proto-module.js.map +1 -1
  5. package/dist/generated/spine/server/agent/execution_record_pb.d.ts +1781 -0
  6. package/dist/generated/spine/server/agent/execution_record_pb.d.ts.map +1 -0
  7. package/dist/generated/spine/server/agent/execution_record_pb.js +490 -0
  8. package/dist/generated/spine/server/agent/execution_record_pb.js.map +1 -0
  9. package/dist/generated/spine/server/agent/history_record_pb.d.ts +66 -0
  10. package/dist/generated/spine/server/agent/history_record_pb.d.ts.map +1 -0
  11. package/dist/generated/spine/server/agent/history_record_pb.js +25 -0
  12. package/dist/generated/spine/server/agent/history_record_pb.js.map +1 -0
  13. package/dist/generated/spine/ts/agent/content_pb.d.ts +963 -0
  14. package/dist/generated/spine/ts/agent/content_pb.d.ts.map +1 -0
  15. package/dist/generated/spine/ts/agent/content_pb.js +258 -0
  16. package/dist/generated/spine/ts/agent/content_pb.js.map +1 -0
  17. package/dist/generated/spine/ts/agent/history_pb.d.ts +165 -0
  18. package/dist/generated/spine/ts/agent/history_pb.d.ts.map +1 -0
  19. package/dist/generated/spine/ts/agent/history_pb.js +39 -0
  20. package/dist/generated/spine/ts/agent/history_pb.js.map +1 -0
  21. package/dist/generated/spine/ts/agent/interaction_events_pb.d.ts +541 -0
  22. package/dist/generated/spine/ts/agent/interaction_events_pb.d.ts.map +1 -0
  23. package/dist/generated/spine/ts/agent/interaction_events_pb.js +76 -0
  24. package/dist/generated/spine/ts/agent/interaction_events_pb.js.map +1 -0
  25. package/dist/generated/spine/ts/agent/model_pb.d.ts +870 -0
  26. package/dist/generated/spine/ts/agent/model_pb.d.ts.map +1 -0
  27. package/dist/generated/spine/ts/agent/model_pb.js +404 -0
  28. package/dist/generated/spine/ts/agent/model_pb.js.map +1 -0
  29. package/dist/src/agent/index.d.ts +38 -0
  30. package/dist/src/agent/index.d.ts.map +1 -0
  31. package/dist/src/agent/index.js +47 -0
  32. package/dist/src/agent/index.js.map +1 -0
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/generated/.spine-proto-generation.json +1 -1
  35. package/generated/proto-module.ts +53 -17
  36. package/generated/spine/server/agent/execution_record_pb.ts +2034 -0
  37. package/generated/spine/server/agent/history_record_pb.ts +85 -0
  38. package/generated/spine/ts/agent/content_pb.ts +1103 -0
  39. package/generated/spine/ts/agent/history_pb.ts +194 -0
  40. package/generated/spine/ts/agent/interaction_events_pb.ts +639 -0
  41. package/generated/spine/ts/agent/model_pb.ts +1014 -0
  42. package/package.json +5 -1
  43. package/proto/spine/server/agent/execution_record.proto +849 -0
  44. package/proto/spine/server/agent/history_record.proto +47 -0
  45. package/proto/spine/ts/agent/content.proto +412 -0
  46. package/proto/spine/ts/agent/history.proto +99 -0
  47. package/proto/spine/ts/agent/interaction_events.proto +367 -0
  48. package/proto/spine/ts/agent/model.proto +333 -0
  49. package/proto/spine-sources.json +28 -4
  50. package/spine-proto-manifest.json +14 -2
@@ -0,0 +1,47 @@
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
+ syntax = "proto3";
16
+
17
+ package spine.server.agent;
18
+
19
+ import "spine/options.proto";
20
+ import "spine/ts/agent/history.proto";
21
+
22
+ option (SPI_all) = true;
23
+ option (type_url_prefix) = "type.spine.io";
24
+
25
+ // Canonical repository scope retained with one Agent history entry.
26
+ message AgentHistoryStorageKey {
27
+ // Generated Agent state type name within the tenant boundary.
28
+ string state_type = 1 [(required) = true];
29
+
30
+ // Canonical storage key of the typed Agent identifier.
31
+ string agent_key = 2 [(required) = true];
32
+ }
33
+
34
+ // Internal stored record containing the original complete history entry.
35
+ message AgentHistoryRecord {
36
+ // Repository scope used for indexed reads and immutable identity.
37
+ AgentHistoryStorageKey scope = 1 [
38
+ (required) = true,
39
+ (validate) = true
40
+ ];
41
+
42
+ // Original conversation record or Event envelope and occurrence time.
43
+ spine.ts.agent.AgentHistoryEntry entry = 2 [
44
+ (required) = true,
45
+ (validate) = true
46
+ ];
47
+ }
@@ -0,0 +1,412 @@
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
+ syntax = "proto3";
16
+
17
+ package spine.ts.agent;
18
+
19
+ import "google/protobuf/any.proto";
20
+ import "google/protobuf/wrappers.proto";
21
+ import "spine/options.proto";
22
+ import "spine/ts/agent/model.proto";
23
+
24
+ option (type_url_prefix) = "type.spine.io";
25
+
26
+ // The actual prepared generation request, including a corrective request.
27
+ message GenerationRequest {
28
+ // Typed application facts supplied to this request.
29
+ google.protobuf.Any input = 1 [
30
+ (required) = true,
31
+ (validate) = true
32
+ ];
33
+
34
+ // Rendered developer instructions sent to the model.
35
+ string instructions = 2 [(required) = true];
36
+
37
+ // Canonical JSON schema supplied to the provider.
38
+ string output_schema_json = 3 [(required) = true];
39
+
40
+ // Actual prepared conversation and advertised tool definitions as canonical JSON.
41
+ // Includes model-visible names mapped to configured server/tool names, without credentials.
42
+ string prompt_json = 4 [(required) = true];
43
+
44
+ // Correction target; absent on the first attempt.
45
+ AiAttemptId corrects = 5 [(validate) = true];
46
+
47
+ // Digest of the actual prepared request.
48
+ AiContentDigest digest = 6 [
49
+ (required) = true,
50
+ (validate) = true
51
+ ];
52
+ }
53
+
54
+ // One model-proposed external call before tool policy and argument validation.
55
+ // Received content is not evidence of authorization or dispatch.
56
+ message ModelToolCall {
57
+ // Exact provider correlation ID; blank or duplicate IDs remain recorded but cannot be dispatched.
58
+ string provider_call_id = 1;
59
+
60
+ // Exact model-facing name, including unsupported or blank names.
61
+ string tool_name = 2;
62
+
63
+ // Exact received argument text, including malformed JSON or empty text.
64
+ string arguments_json = 3;
65
+ }
66
+
67
+ // Exact assistant content returned by the Anthropic Messages profile.
68
+ message AnthropicAssistantContent {
69
+ // Blocks in provider order, including incomplete blocks on a failed receipt.
70
+ repeated AnthropicContentBlock blocks = 1 [(validate) = true];
71
+ }
72
+
73
+ // One typed Anthropic assistant block before any tool result is sent.
74
+ message AnthropicContentBlock {
75
+ oneof content {
76
+ option (choice).required = true;
77
+
78
+ string text = 1;
79
+ ModelToolCall tool_call = 2 [(validate) = true];
80
+ AnthropicThinking thinking = 3 [(validate) = true];
81
+ AnthropicRedactedThinking redacted_thinking = 4 [(validate) = true];
82
+ }
83
+ }
84
+
85
+ // Provider reasoning text and its opaque signature.
86
+ message AnthropicThinking {
87
+ string text = 1;
88
+ string signature = 2;
89
+ }
90
+
91
+ // Provider-encrypted reasoning retained without transformation.
92
+ message AnthropicRedactedThinking {
93
+ string data = 1;
94
+ }
95
+
96
+ // Ordered assistant items received through ChatGPT plan Responses.
97
+ message OpenAiAssistantContent {
98
+ // Provider items in output index order, including items on an interrupted receipt.
99
+ repeated OpenAiOutputItem items = 1 [(validate) = true];
100
+
101
+ // True only after response.completed and coherent closure of every item.
102
+ bool complete = 2;
103
+ }
104
+
105
+ // One Responses assistant output item with its exact provider item ID.
106
+ message OpenAiOutputItem {
107
+ string item_id = 1 [(required) = true];
108
+
109
+ oneof content {
110
+ option (choice).required = true;
111
+
112
+ OpenAiMessageItem message = 2 [(validate) = true];
113
+ OpenAiReasoningItem reasoning = 3 [(validate) = true];
114
+ OpenAiFunctionCallItem function_call = 4 [(validate) = true];
115
+ }
116
+ }
117
+
118
+ // Output text and refusals in provider order.
119
+ message OpenAiMessageItem {
120
+ enum Phase {
121
+ PHASE_UNSPECIFIED = 0;
122
+ COMMENTARY = 1;
123
+ FINAL_ANSWER = 2;
124
+ }
125
+
126
+ Phase phase = 1;
127
+ repeated OpenAiMessagePart parts = 2 [(validate) = true];
128
+ }
129
+
130
+ // One visible or refused message part.
131
+ message OpenAiMessagePart {
132
+ oneof content {
133
+ option (choice).required = true;
134
+
135
+ string output_text = 1;
136
+ string refusal = 2;
137
+ }
138
+ }
139
+
140
+ // Reasoning summaries and encrypted continuation state.
141
+ message OpenAiReasoningItem {
142
+ repeated string summary = 1;
143
+ string encrypted_content = 2 [(required) = true];
144
+ }
145
+
146
+ // Namespaced local function proposal.
147
+ message OpenAiFunctionCallItem {
148
+ ModelToolCall call = 1 [
149
+ (required) = true,
150
+ (validate) = true
151
+ ];
152
+ string namespace = 2 [(required) = true];
153
+ }
154
+
155
+ // Provider generation content, admitted or rejected after local validation.
156
+ message GenerationResponse {
157
+ // Exact received assistant text, including text accompanying tool proposals.
158
+ string raw_output = 1;
159
+
160
+ // Outcome after provider and local validation; TOOL_REQUESTED is nonterminal.
161
+ AiOutcome outcome = 2 [(required) = true];
162
+
163
+ // Typed admitted result; absent when any tool proposal remains outstanding.
164
+ google.protobuf.Any admitted_output = 3 [(validate) = true];
165
+
166
+ // Provider token counts when known.
167
+ AiUsage usage = 4 [(validate) = true];
168
+
169
+ // Digest of the received content when available.
170
+ AiContentDigest digest = 5 [(validate) = true];
171
+
172
+ // Safe diagnostic reference, never a raw provider exception.
173
+ AiDiagnosticId diagnostic_id = 6 [(validate) = true];
174
+
175
+ // Concrete provider model identity when the provider reports it.
176
+ AiProviderModelName actual_model = 7 [(validate) = true];
177
+
178
+ // Received model proposals in order, including malformed or denied proposals.
179
+ // Presence does not imply authorization or execution.
180
+ repeated ModelToolCall tool_calls = 8 [(validate) = true];
181
+
182
+ // Ordered Anthropic assistant content, present for Anthropic Messages receipts.
183
+ AnthropicAssistantContent anthropic_content = 9 [(validate) = true];
184
+
185
+ // Ordered ChatGPT plan response items, present only for that profile.
186
+ OpenAiAssistantContent openai_content = 10 [(validate) = true];
187
+ }
188
+
189
+ // Application-assigned identity of one non-generative question.
190
+ message DecisionQuestionId {
191
+ string value = 1 [(required) = true];
192
+ }
193
+
194
+ // Choice key or zero-based rubric-level index in a decision distribution.
195
+ message DecisionAlternativeKey {
196
+ string value = 1 [(required) = true];
197
+ }
198
+
199
+ // Kind of one non-generative decision question.
200
+ enum DecisionQuestionKind {
201
+ // Unknown questions are invalid.
202
+ DECISION_QUESTION_KIND_UNSPECIFIED = 0;
203
+
204
+ // Probability that a proposition is true.
205
+ BOOLEAN = 1;
206
+
207
+ // One selection from named alternatives.
208
+ CHOICE = 2;
209
+
210
+ // Fractional score against an ordered rubric.
211
+ SCORE = 3;
212
+ }
213
+
214
+ // One named alternative in a choice question.
215
+ message DecisionChoice {
216
+ // Application-defined choice key.
217
+ DecisionAlternativeKey key = 1 [
218
+ (required) = true,
219
+ (validate) = true
220
+ ];
221
+
222
+ // Meaning of the alternative.
223
+ string description = 2 [(required) = true];
224
+ }
225
+
226
+ // One typed question sent to a decision backend.
227
+ message DecisionQuestion {
228
+ // Application-defined question identity.
229
+ DecisionQuestionId id = 1 [
230
+ (required) = true,
231
+ (validate) = true
232
+ ];
233
+
234
+ // Decision contract for the answer.
235
+ DecisionQuestionKind kind = 2 [(required) = true];
236
+
237
+ // Proposition or assessment instructions.
238
+ string instructions = 3 [(required) = true];
239
+
240
+ // Permitted choices for a choice question.
241
+ repeated DecisionChoice choices = 4 [(validate) = true];
242
+
243
+ // Ordered rubric levels for a score question.
244
+ repeated string rubric = 5;
245
+ }
246
+
247
+ // Actual non-generative decision request.
248
+ message DecisionRequest {
249
+ // Typed facts supplied by the application.
250
+ google.protobuf.Any input = 1 [
251
+ (required) = true,
252
+ (validate) = true
253
+ ];
254
+
255
+ // Exact questions sent to the backend.
256
+ repeated DecisionQuestion questions = 2 [
257
+ (required) = true,
258
+ (validate) = true
259
+ ];
260
+
261
+ // Digest of the materialized request.
262
+ AiContentDigest digest = 3 [
263
+ (required) = true,
264
+ (validate) = true
265
+ ];
266
+ }
267
+
268
+ // One reported probability in a choice or score distribution.
269
+ message DecisionProbability {
270
+ // Choice key or decimal rubric-level index.
271
+ DecisionAlternativeKey key = 1 [
272
+ (required) = true,
273
+ (validate) = true
274
+ ];
275
+
276
+ // Finite inclusive zero-to-one probability, checked by the facade.
277
+ double probability = 2;
278
+ }
279
+
280
+ // Provider answer to one declared decision question.
281
+ message DecisionAnswer {
282
+ // Application-defined question identity.
283
+ DecisionQuestionId id = 1 [
284
+ (required) = true,
285
+ (validate) = true
286
+ ];
287
+
288
+ // Declared question and answer kind.
289
+ DecisionQuestionKind kind = 2 [(required) = true];
290
+
291
+ // Exactly one value consistent with the declared question kind.
292
+ oneof value {
293
+ option (choice).required = true;
294
+
295
+ // Probability of true for a boolean answer, including zero.
296
+ double boolean_probability = 3;
297
+
298
+ // Selected key for a choice answer.
299
+ DecisionAlternativeKey choice = 4 [(validate) = true];
300
+
301
+ // Fractional score for a score answer, including zero.
302
+ double score = 5;
303
+ }
304
+
305
+ // Full reported distribution when available; absent means unknown.
306
+ DecisionDistribution distribution = 6 [(validate) = true];
307
+
308
+ // Provider confidence when separately reported; absent means unknown.
309
+ google.protobuf.DoubleValue confidence = 7;
310
+ }
311
+
312
+ // Present distribution over declared choice keys or rubric levels.
313
+ message DecisionDistribution {
314
+ // One entry for each declared alternative.
315
+ repeated DecisionProbability probabilities = 1 [
316
+ (required) = true,
317
+ (validate) = true
318
+ ];
319
+ }
320
+
321
+ // Provider-declared decimal precision used to assess decision answers.
322
+ message DecisionRounding {
323
+ // Decimal places for reported probabilities; absent means unspecified.
324
+ google.protobuf.UInt32Value probability_decimals = 1;
325
+
326
+ // Decimal places for reported scores; absent means unspecified.
327
+ google.protobuf.UInt32Value score_decimals = 2;
328
+ }
329
+
330
+ // Provider decision content and validation outcome.
331
+ message DecisionResponse {
332
+ // Answers received from the backend, including invalid answers.
333
+ repeated DecisionAnswer answers = 1 [(validate) = true];
334
+
335
+ // Outcome after local answer and mapped Proto validation; TOOL_REQUESTED is invalid here.
336
+ AiOutcome outcome = 2 [(required) = true];
337
+
338
+ // Typed admitted mapped result when validation succeeds.
339
+ google.protobuf.Any admitted_output = 3 [(validate) = true];
340
+
341
+ // Provider token usage if supplied by the decision backend.
342
+ AiUsage usage = 4 [(validate) = true];
343
+
344
+ // Safe diagnostic reference for a failed outcome.
345
+ AiDiagnosticId diagnostic_id = 5 [(validate) = true];
346
+
347
+ // Provider-declared precision applied during answer admission.
348
+ DecisionRounding rounding = 6 [(validate) = true];
349
+ }
350
+
351
+ // Actual authorized external tool request.
352
+ message ToolRequest {
353
+ // Logical call identity preserved across recovery.
354
+ AiToolCallId call = 1 [
355
+ (required) = true,
356
+ (validate) = true
357
+ ];
358
+
359
+ // Configured MCP server identifier.
360
+ McpServerId server = 2 [
361
+ (required) = true,
362
+ (validate) = true
363
+ ];
364
+
365
+ // Exact configured tool name.
366
+ McpToolName tool = 3 [
367
+ (required) = true,
368
+ (validate) = true
369
+ ];
370
+
371
+ // Validated canonical JSON arguments, without credentials.
372
+ string arguments_json = 4 [(required) = true];
373
+
374
+ // Application-established read or write effect.
375
+ ToolEffect effect = 5 [(required) = true];
376
+ }
377
+
378
+ // Effect category established by application policy, not remote annotations.
379
+ enum ToolEffect {
380
+ // Unknown effects cannot be dispatched.
381
+ TOOL_EFFECT_UNSPECIFIED = 0;
382
+
383
+ // Tool call does not mutate remote business state.
384
+ READ = 1;
385
+
386
+ // Tool call may mutate remote business state.
387
+ WRITE = 2;
388
+ }
389
+
390
+ // External tool response or unresolved write outcome.
391
+ message ToolResponse {
392
+ // Logical call associated with this response.
393
+ AiToolCallId call = 1 [
394
+ (required) = true,
395
+ (validate) = true
396
+ ];
397
+
398
+ // Tool or transport outcome; TOOL_REQUESTED is invalid here.
399
+ AiOutcome outcome = 2 [(required) = true];
400
+
401
+ // Supported text returned by the tool, when available.
402
+ repeated string text = 3;
403
+
404
+ // Canonical structured JSON returned by the tool, when available.
405
+ string structured_json = 4;
406
+
407
+ // Whether MCP reported a tool execution error.
408
+ bool tool_error = 5;
409
+
410
+ // Safe diagnostic reference; never an HTTP body with credentials.
411
+ AiDiagnosticId diagnostic_id = 6 [(validate) = true];
412
+ }
@@ -0,0 +1,99 @@
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
+ syntax = "proto3";
16
+
17
+ package spine.ts.agent;
18
+
19
+ import "google/protobuf/any.proto";
20
+ import "google/protobuf/timestamp.proto";
21
+ import "spine/core/event.proto";
22
+ import "spine/options.proto";
23
+ import "spine/ts/agent/model.proto";
24
+
25
+ option (type_url_prefix) = "type.spine.io";
26
+
27
+ // Identifies one recorded model or tool request or response.
28
+ message ConversationRecordId {
29
+ // Identifier assigned when the exchange is recorded.
30
+ string value = 1 [(required) = true];
31
+ }
32
+
33
+ // Continuation returned by one Agent history read method.
34
+ message AgentHistoryCursor {
35
+ // Opaque scope and complete ordering-key continuation.
36
+ string value = 1 [(required) = true];
37
+ }
38
+
39
+ // One request or response exchanged with a model or tool.
40
+ message ConversationRecord {
41
+ // Identity of this immutable record.
42
+ ConversationRecordId id = 1 [
43
+ (required) = true,
44
+ (validate) = true
45
+ ];
46
+
47
+ // Conversation continued by this exchange.
48
+ ConversationId conversation = 2 [
49
+ (required) = true,
50
+ (validate) = true
51
+ ];
52
+
53
+ // Model operation during which the exchange occurred.
54
+ AiOperationId operation = 3 [
55
+ (required) = true,
56
+ (validate) = true
57
+ ];
58
+
59
+ // Occurrence timestamp supplied by Spine Time.
60
+ google.protobuf.Timestamp occurred_at = 4 [
61
+ (required) = true,
62
+ (validate) = true
63
+ ];
64
+
65
+ // Exactly one documented generation, decision or tool content message.
66
+ google.protobuf.Any content = 5 [
67
+ (required) = true,
68
+ (validate) = true
69
+ ];
70
+
71
+ // Physical model request when this record concerns a provider request.
72
+ AiAttemptId attempt = 6 [(validate) = true];
73
+
74
+ // Logical tool call when this record concerns external tool execution.
75
+ AiToolCallId tool_call = 7 [(validate) = true];
76
+ }
77
+
78
+ // One entry in the Agent's combined repository history.
79
+ message AgentHistoryEntry {
80
+ // Original occurrence timestamp of the enclosed record or Event.
81
+ google.protobuf.Timestamp occurred_at = 1 [
82
+ (required) = true,
83
+ (validate) = true
84
+ ];
85
+
86
+ // Exactly one recorded item in the combined history.
87
+ oneof item {
88
+ option (choice).required = true;
89
+
90
+ // Model or tool request or response.
91
+ ConversationRecord conversation_record = 2 [(validate) = true];
92
+
93
+ // Original System Event concerning this Agent.
94
+ spine.core.Event system_event = 3 [(validate) = true];
95
+
96
+ // Original domain Event emitted by this Agent.
97
+ spine.core.Event domain_event = 4 [(validate) = true];
98
+ }
99
+ }