@unieai/rabi-message-feedback 0.0.0-stage → 0.2.2-rc.5
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 +21 -0
- package/README.md +7 -2
- package/lib/index.js +331 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +391 -0
- package/lib/typert.remote-client.d.ts +31 -0
- package/lib/typert.remote-client.js +232 -0
- package/lib/types/index.d.ts +73 -0
- package/lib/types/index.js +293 -0
- package/lib/types/types.d.ts +138 -0
- package/lib/types/types.js +7 -0
- package/locale/de.json +6 -0
- package/locale/en.json +5 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +59 -4
- package/src/index.ts +313 -0
- package/src/types.ts +177 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/* Generated by @unieai/rabi-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import { createTypertRemoteInfo } from '@unieai/rabi-typert-protocol/remote-info'
|
|
5
|
+
|
|
6
|
+
let _unieai_rabi_message_feedback_messageFeedback_delete_parameter_0$schema$value
|
|
7
|
+
const _unieai_rabi_message_feedback_messageFeedback_delete_parameter_0$schema = () => (_unieai_rabi_message_feedback_messageFeedback_delete_parameter_0$schema$value ??= z.object({
|
|
8
|
+
'sessionId': z.string().readonly().describe('Session that owns the feedback.'),
|
|
9
|
+
'messageId': z.string().readonly().describe('Message whose feedback should be absent after this operation.'),
|
|
10
|
+
'ifVersion': z.string().readonly().describe('Observed item version; ignored when the item is already absent.'),
|
|
11
|
+
}))
|
|
12
|
+
let _unieai_rabi_message_feedback_messageFeedback_delete_result$schema$value
|
|
13
|
+
const _unieai_rabi_message_feedback_messageFeedback_delete_result$schema = () => (_unieai_rabi_message_feedback_messageFeedback_delete_result$schema$value ??= z.union([z.object({
|
|
14
|
+
'ok': z.literal(true).readonly(),
|
|
15
|
+
'value': z.object({
|
|
16
|
+
'absent': z.literal(true).readonly().describe('Stable postcondition shared by the first deletion and every retry.'),
|
|
17
|
+
}).readonly(),
|
|
18
|
+
}), z.object({
|
|
19
|
+
'ok': z.literal(false).readonly(),
|
|
20
|
+
'error': z.union([z.object({
|
|
21
|
+
'code': z.literal("session-not-found").readonly(),
|
|
22
|
+
'sessionId': z.string().readonly(),
|
|
23
|
+
}), z.object({
|
|
24
|
+
'code': z.literal("version-conflict").readonly(),
|
|
25
|
+
'current': z.union([z.literal(null), z.object({
|
|
26
|
+
'messageId': z.string().readonly().describe('Stable identity of the assistant message inside the owning Session.'),
|
|
27
|
+
'rating': z.union([z.literal("positive"), z.literal("negative")]).readonly().describe('Overall positive or negative judgment.'),
|
|
28
|
+
'note': z.string().readonly().optional().describe('Optional explanation, preserved verbatim after validation.'),
|
|
29
|
+
'category': z.union([z.literal("other"), z.literal("task-result"), z.literal("instruction-following"), z.literal("product-interaction"), z.literal("service-stability"), z.literal("resource-cost"), z.literal("security-privacy-permission")]).readonly().optional().describe('Category the human filed the judgment under.'),
|
|
30
|
+
'version': z.string().readonly().describe('Equality-only token replaced by every material create or update.'),
|
|
31
|
+
'createdAt': z.number().readonly().describe('Host-assigned creation time in Unix epoch milliseconds.'),
|
|
32
|
+
'updatedAt': z.number().readonly().describe('Host-assigned time of the most recent material update.'),
|
|
33
|
+
})]).readonly().describe('Authoritative current item, or `null` when it does not exist.'),
|
|
34
|
+
})]).readonly(),
|
|
35
|
+
})]))
|
|
36
|
+
let _unieai_rabi_message_feedback_messageFeedback_list_parameter_0$schema$value
|
|
37
|
+
const _unieai_rabi_message_feedback_messageFeedback_list_parameter_0$schema = () => (_unieai_rabi_message_feedback_messageFeedback_list_parameter_0$schema$value ??= z.object({
|
|
38
|
+
'sessionId': z.string().readonly().describe('Session whose feedback events should be read.'),
|
|
39
|
+
}))
|
|
40
|
+
let _unieai_rabi_message_feedback_messageFeedback_list_result$schema$value
|
|
41
|
+
const _unieai_rabi_message_feedback_messageFeedback_list_result$schema = () => (_unieai_rabi_message_feedback_messageFeedback_list_result$schema$value ??= z.union([z.object({
|
|
42
|
+
'ok': z.literal(true).readonly(),
|
|
43
|
+
'value': z.object({
|
|
44
|
+
'items': z.array(z.object({
|
|
45
|
+
'messageId': z.string().readonly().describe('Stable identity of the assistant message inside the owning Session.'),
|
|
46
|
+
'rating': z.union([z.literal("positive"), z.literal("negative")]).readonly().describe('Overall positive or negative judgment.'),
|
|
47
|
+
'note': z.string().readonly().optional().describe('Optional explanation, preserved verbatim after validation.'),
|
|
48
|
+
'category': z.union([z.literal("other"), z.literal("task-result"), z.literal("instruction-following"), z.literal("product-interaction"), z.literal("service-stability"), z.literal("resource-cost"), z.literal("security-privacy-permission")]).readonly().optional().describe('Category the human filed the judgment under.'),
|
|
49
|
+
'version': z.string().readonly().describe('Equality-only token replaced by every material create or update.'),
|
|
50
|
+
'createdAt': z.number().readonly().describe('Host-assigned creation time in Unix epoch milliseconds.'),
|
|
51
|
+
'updatedAt': z.number().readonly().describe('Host-assigned time of the most recent material update.'),
|
|
52
|
+
})).readonly().describe('Fresh immutable item snapshots.'),
|
|
53
|
+
}).readonly(),
|
|
54
|
+
}), z.object({
|
|
55
|
+
'ok': z.literal(false).readonly(),
|
|
56
|
+
'error': z.object({
|
|
57
|
+
'code': z.literal("session-not-found").readonly(),
|
|
58
|
+
'sessionId': z.string().readonly(),
|
|
59
|
+
}).readonly(),
|
|
60
|
+
})]))
|
|
61
|
+
let _unieai_rabi_message_feedback_messageFeedback_put_parameter_0$schema$value
|
|
62
|
+
const _unieai_rabi_message_feedback_messageFeedback_put_parameter_0$schema = () => (_unieai_rabi_message_feedback_messageFeedback_put_parameter_0$schema$value ??= z.object({
|
|
63
|
+
'sessionId': z.string().readonly().describe('Persisted Session that owns the target message.'),
|
|
64
|
+
'messageId': z.string().readonly().describe('Target assistant-message identity.'),
|
|
65
|
+
'rating': z.union([z.literal("positive"), z.literal("negative")]).readonly().describe('Desired overall judgment.'),
|
|
66
|
+
'note': z.string().readonly().optional().describe('Optional non-blank explanation.'),
|
|
67
|
+
'category': z.union([z.literal("other"), z.literal("task-result"), z.literal("instruction-following"), z.literal("product-interaction"), z.literal("service-stability"), z.literal("resource-cost"), z.literal("security-privacy-permission")]).readonly().optional().describe('Optional category; absent keeps the item uncategorized.'),
|
|
68
|
+
'ifVersion': z.union([z.literal(null), z.string()]).readonly().describe('Observed item version, or `null` to require that no item exists.'),
|
|
69
|
+
}))
|
|
70
|
+
let _unieai_rabi_message_feedback_messageFeedback_put_result$schema$value
|
|
71
|
+
const _unieai_rabi_message_feedback_messageFeedback_put_result$schema = () => (_unieai_rabi_message_feedback_messageFeedback_put_result$schema$value ??= z.union([z.object({
|
|
72
|
+
'ok': z.literal(true).readonly(),
|
|
73
|
+
'value': z.object({
|
|
74
|
+
'messageId': z.string().readonly().describe('Stable identity of the assistant message inside the owning Session.'),
|
|
75
|
+
'rating': z.union([z.literal("positive"), z.literal("negative")]).readonly().describe('Overall positive or negative judgment.'),
|
|
76
|
+
'note': z.string().readonly().optional().describe('Optional explanation, preserved verbatim after validation.'),
|
|
77
|
+
'category': z.union([z.literal("other"), z.literal("task-result"), z.literal("instruction-following"), z.literal("product-interaction"), z.literal("service-stability"), z.literal("resource-cost"), z.literal("security-privacy-permission")]).readonly().optional().describe('Category the human filed the judgment under.'),
|
|
78
|
+
'version': z.string().readonly().describe('Equality-only token replaced by every material create or update.'),
|
|
79
|
+
'createdAt': z.number().readonly().describe('Host-assigned creation time in Unix epoch milliseconds.'),
|
|
80
|
+
'updatedAt': z.number().readonly().describe('Host-assigned time of the most recent material update.'),
|
|
81
|
+
}).readonly(),
|
|
82
|
+
}), z.object({
|
|
83
|
+
'ok': z.literal(false).readonly(),
|
|
84
|
+
'error': z.union([z.object({
|
|
85
|
+
'code': z.literal("session-not-found").readonly(),
|
|
86
|
+
'sessionId': z.string().readonly(),
|
|
87
|
+
}), z.object({
|
|
88
|
+
'code': z.literal("target-not-found").readonly(),
|
|
89
|
+
'sessionId': z.string().readonly(),
|
|
90
|
+
'messageId': z.string().readonly(),
|
|
91
|
+
}), z.object({
|
|
92
|
+
'code': z.literal("version-conflict").readonly(),
|
|
93
|
+
'current': z.union([z.literal(null), z.object({
|
|
94
|
+
'messageId': z.string().readonly().describe('Stable identity of the assistant message inside the owning Session.'),
|
|
95
|
+
'rating': z.union([z.literal("positive"), z.literal("negative")]).readonly().describe('Overall positive or negative judgment.'),
|
|
96
|
+
'note': z.string().readonly().optional().describe('Optional explanation, preserved verbatim after validation.'),
|
|
97
|
+
'category': z.union([z.literal("other"), z.literal("task-result"), z.literal("instruction-following"), z.literal("product-interaction"), z.literal("service-stability"), z.literal("resource-cost"), z.literal("security-privacy-permission")]).readonly().optional().describe('Category the human filed the judgment under.'),
|
|
98
|
+
'version': z.string().readonly().describe('Equality-only token replaced by every material create or update.'),
|
|
99
|
+
'createdAt': z.number().readonly().describe('Host-assigned creation time in Unix epoch milliseconds.'),
|
|
100
|
+
'updatedAt': z.number().readonly().describe('Host-assigned time of the most recent material update.'),
|
|
101
|
+
})]).readonly().describe('Authoritative current item, or `null` when it does not exist.'),
|
|
102
|
+
}), z.object({
|
|
103
|
+
'code': z.literal("note-blank").readonly(),
|
|
104
|
+
}), z.object({
|
|
105
|
+
'code': z.literal("note-too-large").readonly(),
|
|
106
|
+
'maxBytes': z.number().readonly(),
|
|
107
|
+
'actualBytes': z.number().readonly(),
|
|
108
|
+
})]).readonly(),
|
|
109
|
+
})]))
|
|
110
|
+
let _unieai_rabi_message_feedback_messageFeedback_delete_parameter_0_strict$schema$value
|
|
111
|
+
const _unieai_rabi_message_feedback_messageFeedback_delete_parameter_0_strict$schema = () => (_unieai_rabi_message_feedback_messageFeedback_delete_parameter_0_strict$schema$value ??= z.strictObject({
|
|
112
|
+
'sessionId': z.string().readonly().describe('Session that owns the feedback.'),
|
|
113
|
+
'messageId': z.string().readonly().describe('Message whose feedback should be absent after this operation.'),
|
|
114
|
+
'ifVersion': z.string().readonly().describe('Observed item version; ignored when the item is already absent.'),
|
|
115
|
+
}))
|
|
116
|
+
let _unieai_rabi_message_feedback_messageFeedback_list_parameter_0_strict$schema$value
|
|
117
|
+
const _unieai_rabi_message_feedback_messageFeedback_list_parameter_0_strict$schema = () => (_unieai_rabi_message_feedback_messageFeedback_list_parameter_0_strict$schema$value ??= z.strictObject({
|
|
118
|
+
'sessionId': z.string().readonly().describe('Session whose feedback events should be read.'),
|
|
119
|
+
}))
|
|
120
|
+
let _unieai_rabi_message_feedback_messageFeedback_put_parameter_0_strict$schema$value
|
|
121
|
+
const _unieai_rabi_message_feedback_messageFeedback_put_parameter_0_strict$schema = () => (_unieai_rabi_message_feedback_messageFeedback_put_parameter_0_strict$schema$value ??= z.strictObject({
|
|
122
|
+
'sessionId': z.string().readonly().describe('Persisted Session that owns the target message.'),
|
|
123
|
+
'messageId': z.string().readonly().describe('Target assistant-message identity.'),
|
|
124
|
+
'rating': z.union([z.literal("positive"), z.literal("negative")]).readonly().describe('Desired overall judgment.'),
|
|
125
|
+
'note': z.string().readonly().optional().describe('Optional non-blank explanation.'),
|
|
126
|
+
'category': z.union([z.literal("other"), z.literal("task-result"), z.literal("instruction-following"), z.literal("product-interaction"), z.literal("service-stability"), z.literal("resource-cost"), z.literal("security-privacy-permission")]).readonly().optional().describe('Optional category; absent keeps the item uncategorized.'),
|
|
127
|
+
'ifVersion': z.union([z.literal(null), z.string()]).readonly().describe('Observed item version, or `null` to require that no item exists.'),
|
|
128
|
+
}))
|
|
129
|
+
|
|
130
|
+
const $remote = createTypertRemoteInfo({
|
|
131
|
+
package: '@unieai/rabi-message-feedback',
|
|
132
|
+
methods: {
|
|
133
|
+
'messageFeedback/delete': {
|
|
134
|
+
service: 'messageFeedback',
|
|
135
|
+
description: 'Delete one item after checking its version; absence succeeds without an event.',
|
|
136
|
+
invocation: { kind: 'direct' },
|
|
137
|
+
parameters: [
|
|
138
|
+
{
|
|
139
|
+
name: 'request',
|
|
140
|
+
description: 'Session, message, and observed item version.',
|
|
141
|
+
source: 'json',
|
|
142
|
+
codec: {
|
|
143
|
+
mode: 'strict',
|
|
144
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackDeleteRequest',
|
|
145
|
+
create: _unieai_rabi_message_feedback_messageFeedback_delete_parameter_0$schema,
|
|
146
|
+
jsonSchema: {"type":"object","properties":{"sessionId":{"type":"string","description":"Session that owns the feedback."},"messageId":{"type":"string","description":"Message whose feedback should be absent after this operation."},"ifVersion":{"type":"string","description":"Observed item version; ignored when the item is already absent."}},"required":["sessionId","messageId","ifVersion"],"additionalProperties":true},
|
|
147
|
+
},
|
|
148
|
+
strictCodec: {
|
|
149
|
+
mode: 'strict',
|
|
150
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackDeleteRequest',
|
|
151
|
+
create: _unieai_rabi_message_feedback_messageFeedback_delete_parameter_0_strict$schema,
|
|
152
|
+
jsonSchema: {"type":"object","properties":{"sessionId":{"type":"string","description":"Session that owns the feedback."},"messageId":{"type":"string","description":"Message whose feedback should be absent after this operation."},"ifVersion":{"type":"string","description":"Observed item version; ignored when the item is already absent."}},"required":["sessionId","messageId","ifVersion"],"additionalProperties":false},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
result: {
|
|
157
|
+
mode: 'strict',
|
|
158
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackDeleteResult',
|
|
159
|
+
create: _unieai_rabi_message_feedback_messageFeedback_delete_result$schema,
|
|
160
|
+
description: 'the stable absent postcondition or an explicit failure.',
|
|
161
|
+
jsonSchema: {"oneOf":[{"type":"object","properties":{"ok":{"type":"boolean","const":true},"value":{"type":"object","properties":{"absent":{"type":"boolean","const":true,"description":"Stable postcondition shared by the first deletion and every retry."}},"required":["absent"],"additionalProperties":true}},"required":["ok","value"],"additionalProperties":true},{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"oneOf":[{"type":"object","properties":{"code":{"type":"string","const":"session-not-found"},"sessionId":{"type":"string"}},"required":["code","sessionId"],"additionalProperties":true},{"type":"object","properties":{"code":{"type":"string","const":"version-conflict"},"current":{"oneOf":[{"type":"null","const":null},{"type":"object","properties":{"messageId":{"type":"string","description":"Stable identity of the assistant message inside the owning Session."},"rating":{"type":"string","enum":["positive","negative"],"description":"Overall positive or negative judgment."},"note":{"type":"string","description":"Optional explanation, preserved verbatim after validation."},"category":{"type":"string","enum":["other","task-result","instruction-following","product-interaction","service-stability","resource-cost","security-privacy-permission"],"description":"Category the human filed the judgment under."},"version":{"type":"string","description":"Equality-only token replaced by every material create or update."},"createdAt":{"type":"number","description":"Host-assigned creation time in Unix epoch milliseconds."},"updatedAt":{"type":"number","description":"Host-assigned time of the most recent material update."}},"required":["messageId","rating","version","createdAt","updatedAt"],"additionalProperties":true}],"description":"Authoritative current item, or `null` when it does not exist."}},"required":["code","current"],"additionalProperties":true}]}},"required":["ok","error"],"additionalProperties":true}]},
|
|
162
|
+
},
|
|
163
|
+
sourceLocation: {"file":"packages/feedback/message-feedback/src/index.ts","line":207,"column":3},
|
|
164
|
+
},
|
|
165
|
+
'messageFeedback/list': {
|
|
166
|
+
service: 'messageFeedback',
|
|
167
|
+
description: 'Read current feedback from the canonical log.',
|
|
168
|
+
invocation: { kind: 'direct' },
|
|
169
|
+
parameters: [
|
|
170
|
+
{
|
|
171
|
+
name: 'request',
|
|
172
|
+
description: 'Session to inspect.',
|
|
173
|
+
source: 'json',
|
|
174
|
+
codec: {
|
|
175
|
+
mode: 'strict',
|
|
176
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackListRequest',
|
|
177
|
+
create: _unieai_rabi_message_feedback_messageFeedback_list_parameter_0$schema,
|
|
178
|
+
jsonSchema: {"type":"object","properties":{"sessionId":{"type":"string","description":"Session whose feedback events should be read."}},"required":["sessionId"],"additionalProperties":true},
|
|
179
|
+
},
|
|
180
|
+
strictCodec: {
|
|
181
|
+
mode: 'strict',
|
|
182
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackListRequest',
|
|
183
|
+
create: _unieai_rabi_message_feedback_messageFeedback_list_parameter_0_strict$schema,
|
|
184
|
+
jsonSchema: {"type":"object","properties":{"sessionId":{"type":"string","description":"Session whose feedback events should be read."}},"required":["sessionId"],"additionalProperties":false},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
result: {
|
|
189
|
+
mode: 'strict',
|
|
190
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackListResult',
|
|
191
|
+
create: _unieai_rabi_message_feedback_messageFeedback_list_result$schema,
|
|
192
|
+
description: 'immutable items or a definite persistence miss.',
|
|
193
|
+
jsonSchema: {"oneOf":[{"type":"object","properties":{"ok":{"type":"boolean","const":true},"value":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"messageId":{"type":"string","description":"Stable identity of the assistant message inside the owning Session."},"rating":{"type":"string","enum":["positive","negative"],"description":"Overall positive or negative judgment."},"note":{"type":"string","description":"Optional explanation, preserved verbatim after validation."},"category":{"type":"string","enum":["other","task-result","instruction-following","product-interaction","service-stability","resource-cost","security-privacy-permission"],"description":"Category the human filed the judgment under."},"version":{"type":"string","description":"Equality-only token replaced by every material create or update."},"createdAt":{"type":"number","description":"Host-assigned creation time in Unix epoch milliseconds."},"updatedAt":{"type":"number","description":"Host-assigned time of the most recent material update."}},"required":["messageId","rating","version","createdAt","updatedAt"],"additionalProperties":true},"description":"Fresh immutable item snapshots."}},"required":["items"],"additionalProperties":true}},"required":["ok","value"],"additionalProperties":true},{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","const":"session-not-found"},"sessionId":{"type":"string"}},"required":["code","sessionId"],"additionalProperties":true}},"required":["ok","error"],"additionalProperties":true}]},
|
|
194
|
+
},
|
|
195
|
+
sourceLocation: {"file":"packages/feedback/message-feedback/src/index.ts","line":155,"column":3},
|
|
196
|
+
},
|
|
197
|
+
'messageFeedback/put': {
|
|
198
|
+
service: 'messageFeedback',
|
|
199
|
+
description: 'Create or replace feedback after checking its current version. Matching no-ops retain the version and append no event.',
|
|
200
|
+
invocation: { kind: 'direct' },
|
|
201
|
+
parameters: [
|
|
202
|
+
{
|
|
203
|
+
name: 'request',
|
|
204
|
+
description: 'Target, desired value, and observed item version.',
|
|
205
|
+
source: 'json',
|
|
206
|
+
codec: {
|
|
207
|
+
mode: 'strict',
|
|
208
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackPutRequest',
|
|
209
|
+
create: _unieai_rabi_message_feedback_messageFeedback_put_parameter_0$schema,
|
|
210
|
+
jsonSchema: {"type":"object","properties":{"sessionId":{"type":"string","description":"Persisted Session that owns the target message."},"messageId":{"type":"string","description":"Target assistant-message identity."},"rating":{"type":"string","enum":["positive","negative"],"description":"Desired overall judgment."},"note":{"type":"string","description":"Optional non-blank explanation."},"category":{"type":"string","enum":["other","task-result","instruction-following","product-interaction","service-stability","resource-cost","security-privacy-permission"],"description":"Optional category; absent keeps the item uncategorized."},"ifVersion":{"oneOf":[{"type":"null","const":null},{"type":"string"}],"description":"Observed item version, or `null` to require that no item exists."}},"required":["sessionId","messageId","rating","ifVersion"],"additionalProperties":true},
|
|
211
|
+
},
|
|
212
|
+
strictCodec: {
|
|
213
|
+
mode: 'strict',
|
|
214
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackPutRequest',
|
|
215
|
+
create: _unieai_rabi_message_feedback_messageFeedback_put_parameter_0_strict$schema,
|
|
216
|
+
jsonSchema: {"type":"object","properties":{"sessionId":{"type":"string","description":"Persisted Session that owns the target message."},"messageId":{"type":"string","description":"Target assistant-message identity."},"rating":{"type":"string","enum":["positive","negative"],"description":"Desired overall judgment."},"note":{"type":"string","description":"Optional non-blank explanation."},"category":{"type":"string","enum":["other","task-result","instruction-following","product-interaction","service-stability","resource-cost","security-privacy-permission"],"description":"Optional category; absent keeps the item uncategorized."},"ifVersion":{"oneOf":[{"type":"null","const":null},{"type":"string"}],"description":"Observed item version, or `null` to require that no item exists."}},"required":["sessionId","messageId","rating","ifVersion"],"additionalProperties":false},
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
result: {
|
|
221
|
+
mode: 'strict',
|
|
222
|
+
typeSymbol: '@unieai/rabi-message-feedback/types#MessageFeedbackPutResult',
|
|
223
|
+
create: _unieai_rabi_message_feedback_messageFeedback_put_result$schema,
|
|
224
|
+
description: 'the durable item or an explicit business failure.',
|
|
225
|
+
jsonSchema: {"oneOf":[{"type":"object","properties":{"ok":{"type":"boolean","const":true},"value":{"type":"object","properties":{"messageId":{"type":"string","description":"Stable identity of the assistant message inside the owning Session."},"rating":{"type":"string","enum":["positive","negative"],"description":"Overall positive or negative judgment."},"note":{"type":"string","description":"Optional explanation, preserved verbatim after validation."},"category":{"type":"string","enum":["other","task-result","instruction-following","product-interaction","service-stability","resource-cost","security-privacy-permission"],"description":"Category the human filed the judgment under."},"version":{"type":"string","description":"Equality-only token replaced by every material create or update."},"createdAt":{"type":"number","description":"Host-assigned creation time in Unix epoch milliseconds."},"updatedAt":{"type":"number","description":"Host-assigned time of the most recent material update."}},"required":["messageId","rating","version","createdAt","updatedAt"],"additionalProperties":true}},"required":["ok","value"],"additionalProperties":true},{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"oneOf":[{"type":"object","properties":{"code":{"type":"string","const":"session-not-found"},"sessionId":{"type":"string"}},"required":["code","sessionId"],"additionalProperties":true},{"type":"object","properties":{"code":{"type":"string","const":"target-not-found"},"sessionId":{"type":"string"},"messageId":{"type":"string"}},"required":["code","sessionId","messageId"],"additionalProperties":true},{"type":"object","properties":{"code":{"type":"string","const":"version-conflict"},"current":{"oneOf":[{"type":"null","const":null},{"type":"object","properties":{"messageId":{"type":"string","description":"Stable identity of the assistant message inside the owning Session."},"rating":{"type":"string","enum":["positive","negative"],"description":"Overall positive or negative judgment."},"note":{"type":"string","description":"Optional explanation, preserved verbatim after validation."},"category":{"type":"string","enum":["other","task-result","instruction-following","product-interaction","service-stability","resource-cost","security-privacy-permission"],"description":"Category the human filed the judgment under."},"version":{"type":"string","description":"Equality-only token replaced by every material create or update."},"createdAt":{"type":"number","description":"Host-assigned creation time in Unix epoch milliseconds."},"updatedAt":{"type":"number","description":"Host-assigned time of the most recent material update."}},"required":["messageId","rating","version","createdAt","updatedAt"],"additionalProperties":true}],"description":"Authoritative current item, or `null` when it does not exist."}},"required":["code","current"],"additionalProperties":true},{"type":"object","properties":{"code":{"type":"string","const":"note-blank"}},"required":["code"],"additionalProperties":true},{"type":"object","properties":{"code":{"type":"string","const":"note-too-large"},"maxBytes":{"type":"number"},"actualBytes":{"type":"number"}},"required":["code","maxBytes","actualBytes"],"additionalProperties":true}]}},"required":["ok","error"],"additionalProperties":true}]},
|
|
226
|
+
},
|
|
227
|
+
sourceLocation: {"file":"packages/feedback/message-feedback/src/index.ts","line":167,"column":3},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
}, z)
|
|
231
|
+
|
|
232
|
+
export const TYPERT = {
|
|
233
|
+
package: '@unieai/rabi-message-feedback',
|
|
234
|
+
face: 'host',
|
|
235
|
+
schemas: [
|
|
236
|
+
],
|
|
237
|
+
get invocations() { return $remote.descriptors },
|
|
238
|
+
model: {
|
|
239
|
+
"services": [
|
|
240
|
+
{
|
|
241
|
+
"description": "Session-log service; cold operations never construct a Session or Agent.",
|
|
242
|
+
"summary": "Session-log service; cold operations never construct a Session or Agent.",
|
|
243
|
+
"tags": [],
|
|
244
|
+
"jsDoc": "/** Session-log service; cold operations never construct a Session or Agent. */",
|
|
245
|
+
"key": "messageFeedback",
|
|
246
|
+
"exportName": "MessageFeedbackService",
|
|
247
|
+
"members": [
|
|
248
|
+
{
|
|
249
|
+
"kind": "method",
|
|
250
|
+
"name": "list",
|
|
251
|
+
"signature": "@Remote('list') list(request: MessageFeedbackListRequest): Promise<MessageFeedbackListResult>",
|
|
252
|
+
"summary": "Read current feedback from the canonical log.",
|
|
253
|
+
"jsDoc": "/**\n * Read current feedback from the canonical log.\n * @param request - Session to inspect.\n * @returns immutable items or a definite persistence miss.\n */"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"kind": "method",
|
|
257
|
+
"name": "put",
|
|
258
|
+
"signature": "@Remote('put') put(request: MessageFeedbackPutRequest): Promise<MessageFeedbackPutResult>",
|
|
259
|
+
"summary": "Create or replace feedback after checking its current version.",
|
|
260
|
+
"jsDoc": "/**\n * Create or replace feedback after checking its current version.\n * Matching no-ops retain the version and append no event.\n * @param request - Target, desired value, and observed item version.\n * @returns the durable item or an explicit business failure.\n */"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"kind": "method",
|
|
264
|
+
"name": "delete",
|
|
265
|
+
"signature": "@Remote('delete') delete(request: MessageFeedbackDeleteRequest): Promise<MessageFeedbackDeleteResult>",
|
|
266
|
+
"summary": "Delete one item after checking its version; absence succeeds without an event.",
|
|
267
|
+
"jsDoc": "/**\n * Delete one item after checking its version; absence succeeds without an event.\n * @param request - Session, message, and observed item version.\n * @returns the stable absent postcondition or an explicit failure.\n */"
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"types": [
|
|
271
|
+
{
|
|
272
|
+
"name": "Branded",
|
|
273
|
+
"declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "FeedbackCategory",
|
|
277
|
+
"declaration": "export type FeedbackCategory = 'task-result' | 'instruction-following' | 'product-interaction' | 'service-stability' | 'resource-cost' | 'security-privacy-permission' | 'other';"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "MessageFeedbackDeleteRequest",
|
|
281
|
+
"declaration": "export interface MessageFeedbackDeleteRequest {\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n readonly ifVersion: MessageFeedbackVersion;\n}"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "MessageFeedbackDeleteResult",
|
|
285
|
+
"declaration": "export type MessageFeedbackDeleteResult = MessageFeedbackSuccess<MessageFeedbackDeleteValue> | MessageFeedbackRejected<MessageFeedbackSessionNotFound | MessageFeedbackVersionConflict>;"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "MessageFeedbackDeleteValue",
|
|
289
|
+
"declaration": "export interface MessageFeedbackDeleteValue {\n readonly absent: true;\n}"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "MessageFeedbackFailure",
|
|
293
|
+
"declaration": "export type MessageFeedbackFailure = MessageFeedbackSessionNotFound | MessageFeedbackTargetNotFound | MessageFeedbackVersionConflict | MessageFeedbackNoteBlank | MessageFeedbackNoteTooLarge;"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "MessageFeedbackItem",
|
|
297
|
+
"declaration": "export interface MessageFeedbackItem {\n readonly messageId: MessageId;\n readonly rating: MessageFeedbackRating;\n readonly note?: string;\n readonly category?: FeedbackCategory;\n readonly version: MessageFeedbackVersion;\n readonly createdAt: number;\n readonly updatedAt: number;\n}"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "MessageFeedbackListRequest",
|
|
301
|
+
"declaration": "export interface MessageFeedbackListRequest {\n readonly sessionId: SessionId;\n}"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"name": "MessageFeedbackListResult",
|
|
305
|
+
"declaration": "export type MessageFeedbackListResult = MessageFeedbackSuccess<MessageFeedbackListValue> | MessageFeedbackRejected<MessageFeedbackSessionNotFound>;"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "MessageFeedbackListValue",
|
|
309
|
+
"declaration": "export interface MessageFeedbackListValue {\n readonly items: readonly MessageFeedbackItem[];\n}"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"name": "MessageFeedbackNoteBlank",
|
|
313
|
+
"declaration": "export interface MessageFeedbackNoteBlank {\n readonly code: 'note-blank';\n}"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "MessageFeedbackNoteTooLarge",
|
|
317
|
+
"declaration": "export interface MessageFeedbackNoteTooLarge {\n readonly code: 'note-too-large';\n readonly maxBytes: number;\n readonly actualBytes: number;\n}"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "MessageFeedbackPutRequest",
|
|
321
|
+
"declaration": "export interface MessageFeedbackPutRequest {\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n readonly rating: MessageFeedbackRating;\n readonly note?: string;\n readonly category?: FeedbackCategory;\n readonly ifVersion: MessageFeedbackVersion | null;\n}"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "MessageFeedbackPutResult",
|
|
325
|
+
"declaration": "export type MessageFeedbackPutResult = MessageFeedbackSuccess<MessageFeedbackItem> | MessageFeedbackRejected<MessageFeedbackSessionNotFound | MessageFeedbackTargetNotFound | MessageFeedbackVersionConflict | MessageFeedbackNoteBlank | MessageFeedbackNoteTooLarge>;"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "MessageFeedbackRating",
|
|
329
|
+
"declaration": "export type MessageFeedbackRating = 'positive' | 'negative';"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "MessageFeedbackRejected",
|
|
333
|
+
"declaration": "export interface MessageFeedbackRejected<E extends MessageFeedbackFailure> {\n readonly ok: false;\n readonly error: E;\n}"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "MessageFeedbackSessionNotFound",
|
|
337
|
+
"declaration": "export interface MessageFeedbackSessionNotFound {\n readonly code: 'session-not-found';\n readonly sessionId: SessionId;\n}"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "MessageFeedbackSuccess",
|
|
341
|
+
"declaration": "export interface MessageFeedbackSuccess<T> {\n readonly ok: true;\n readonly value: T;\n}"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"name": "MessageFeedbackTargetNotFound",
|
|
345
|
+
"declaration": "export interface MessageFeedbackTargetNotFound {\n readonly code: 'target-not-found';\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n}"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "MessageFeedbackVersion",
|
|
349
|
+
"declaration": "export type MessageFeedbackVersion = Branded<'MessageFeedbackVersion'>;"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"name": "MessageFeedbackVersionConflict",
|
|
353
|
+
"declaration": "export interface MessageFeedbackVersionConflict {\n readonly code: 'version-conflict';\n readonly current: MessageFeedbackItem | null;\n}"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"name": "MessageId",
|
|
357
|
+
"declaration": "export type MessageId = Branded<'MessageId'>;"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"name": "SessionId",
|
|
361
|
+
"declaration": "export type SessionId = Branded<'SessionId'>;"
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
"events": [
|
|
367
|
+
{
|
|
368
|
+
"description": "Observe a durable cold feedback mutation without publishing a live Session. Observers run before write ownership is released and must not await another message-feedback operation for this Session. The payload is borrowed read-only; deep-clone it before transferring ownership (for example, to Session.fromRestore).",
|
|
369
|
+
"summary": "Observe a durable cold feedback mutation without publishing a live Session.",
|
|
370
|
+
"tags": [
|
|
371
|
+
{
|
|
372
|
+
"name": "param",
|
|
373
|
+
"argument": "inspection",
|
|
374
|
+
"comment": "- committed canonical prefix, including the feedback as its last event.",
|
|
375
|
+
"text": "@param inspection - committed canonical prefix, including the feedback as its last event.\n *"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "mode",
|
|
379
|
+
"comment": "parallel",
|
|
380
|
+
"text": "@mode parallel"
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
"jsDoc": "/**\n * Observe a durable cold feedback mutation without publishing a live Session.\n * Observers run before write ownership is released and must not await\n * another message-feedback operation for this Session. The payload is borrowed\n * read-only; deep-clone it before transferring ownership (for example, to Session.fromRestore).\n * @param inspection - committed canonical prefix, including the feedback as its last event.\n * @mode parallel\n */",
|
|
384
|
+
"name": "feedback/committed",
|
|
385
|
+
"mode": "parallel",
|
|
386
|
+
"signature": "'feedback/committed'(inspection: SessionInspection): void"
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
"objects": []
|
|
390
|
+
},
|
|
391
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Generated by @unieai/rabi-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import type {
|
|
3
|
+
RemoteResult,
|
|
4
|
+
TypertRemoteInfo,
|
|
5
|
+
TypertRemoteMethod,
|
|
6
|
+
} from '@unieai/rabi-typert-protocol'
|
|
7
|
+
import type { MessageFeedbackDeleteRequest, MessageFeedbackDeleteResult, MessageFeedbackListRequest, MessageFeedbackListResult, MessageFeedbackPutRequest, MessageFeedbackPutResult } from '@unieai/rabi-message-feedback/types'
|
|
8
|
+
|
|
9
|
+
declare module '@unieai/rabi-typert-protocol' {
|
|
10
|
+
interface TypertRemoteNamespace$6d657373616765466565646261636b {
|
|
11
|
+
delete: (request: MessageFeedbackDeleteRequest) => Promise<RemoteResult<MessageFeedbackDeleteResult>>
|
|
12
|
+
list: (request: MessageFeedbackListRequest) => Promise<RemoteResult<MessageFeedbackListResult>>
|
|
13
|
+
put: (request: MessageFeedbackPutRequest) => Promise<RemoteResult<MessageFeedbackPutResult>>
|
|
14
|
+
}
|
|
15
|
+
interface TypertRemoteMap {
|
|
16
|
+
'messageFeedback/delete': (request: MessageFeedbackDeleteRequest) => Promise<RemoteResult<MessageFeedbackDeleteResult>>
|
|
17
|
+
'messageFeedback/list': (request: MessageFeedbackListRequest) => Promise<RemoteResult<MessageFeedbackListResult>>
|
|
18
|
+
'messageFeedback/put': (request: MessageFeedbackPutRequest) => Promise<RemoteResult<MessageFeedbackPutResult>>
|
|
19
|
+
}
|
|
20
|
+
interface TypertRemoteNamespaceMap {
|
|
21
|
+
'messageFeedback': TypertRemoteNamespace$6d657373616765466565646261636b
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare const TYPERT_REMOTE: TypertRemoteInfo<{
|
|
26
|
+
readonly 'messageFeedback/delete': TypertRemoteMethod<{ readonly 'request': MessageFeedbackDeleteRequest }, MessageFeedbackDeleteResult>
|
|
27
|
+
readonly 'messageFeedback/list': TypertRemoteMethod<{ readonly 'request': MessageFeedbackListRequest }, MessageFeedbackListResult>
|
|
28
|
+
readonly 'messageFeedback/put': TypertRemoteMethod<{ readonly 'request': MessageFeedbackPutRequest }, MessageFeedbackPutResult>
|
|
29
|
+
}>
|
|
30
|
+
export default TYPERT_REMOTE
|
|
31
|
+
//# sourceMappingURL=typert.remote-client.d.ts.map
|