Skip to content

Commit a0a1cc0

Browse files
committed
fix: message tag to 7.0.0
1 parent e7e0f64 commit a0a1cc0

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

packages/core/src/message.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as Receipt from './receipt.js'
55
import * as Schema from './schema.js'
66

77
export const MessageSchema = Schema.variant({
8-
'ucanto/message@0.6.0': Schema.struct({
8+
'ucanto/message@7.0.0': Schema.struct({
99
execute: Schema.link().array().optional(),
1010
delegate: Schema.dictionary({
1111
key: Schema.string(),
@@ -45,7 +45,7 @@ export const view = ({ root, store }, fallback) => {
4545
const data = DAG.CBOR.decode(block.bytes)
4646
const [branch, value] = MessageSchema.match(data, fallback)
4747
switch (branch) {
48-
case 'ucanto/message@0.6.0':
48+
case 'ucanto/message@7.0.0':
4949
return new Message({ root: { ...block, data }, store })
5050
default:
5151
return value
@@ -89,7 +89,7 @@ class MessageBuilder {
8989
const root = await DAG.writeInto(
9090
/** @type {API.AgentMessageModel<{ In: API.InferInvocations<I>, Out: R }>} */
9191
({
92-
'ucanto/message@0.6.0': {
92+
'ucanto/message@7.0.0': {
9393
...executeField,
9494
...receiptsField,
9595
},
@@ -196,7 +196,7 @@ class Message {
196196
* @returns {API.Receipt|E}
197197
*/
198198
get(link, fallback) {
199-
const receipts = this.root.data['ucanto/message@0.6.0'].report || {}
199+
const receipts = this.root.data['ucanto/message@7.0.0'].report || {}
200200
const receipt = receipts[`${link}`]
201201
if (receipt) {
202202
return Receipt.view({ root: receipt, blocks: this.store })
@@ -208,7 +208,7 @@ class Message {
208208
}
209209

210210
get invocationLinks() {
211-
return this.root.data['ucanto/message@0.6.0'].execute || []
211+
return this.root.data['ucanto/message@7.0.0'].execute || []
212212
}
213213

214214
get invocations() {
@@ -226,7 +226,7 @@ class Message {
226226
let receipts = this._receipts
227227
if (!receipts) {
228228
receipts = new Map()
229-
const report = this.root.data['ucanto/message@0.6.0'].report || {}
229+
const report = this.root.data['ucanto/message@7.0.0'].report || {}
230230
for (const [key, link] of Object.entries(report)) {
231231
const receipt = Receipt.view({ root: link, blocks: this.store })
232232
receipts.set(`${receipt.ran.link()}`, receipt)

packages/core/test/message.spec.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test('build message with an invocation', async () => {
3535
})
3636

3737
assert.deepEqual(message.root.data, {
38-
'ucanto/message@0.6.0': {
38+
'ucanto/message@7.0.0': {
3939
execute: [echo.delegation.cid],
4040
},
4141
})
@@ -134,7 +134,7 @@ test('empty receipts are omitted', async () => {
134134
assert.deepEqual(
135135
message.root.data,
136136
{
137-
'ucanto/message@0.6.0': {
137+
'ucanto/message@7.0.0': {
138138
execute: [hi.delegation.cid],
139139
},
140140
},
@@ -153,7 +153,7 @@ test('message with receipts', async () => {
153153
assert.deepEqual(
154154
message.root.data,
155155
{
156-
'ucanto/message@0.6.0': {
156+
'ucanto/message@7.0.0': {
157157
report: {
158158
[`${hi.delegation.cid}`]: hi.receipt.root.cid,
159159
},
@@ -172,7 +172,7 @@ test('handles duplicate receipts', async () => {
172172
assert.deepEqual(
173173
message.root.data,
174174
{
175-
'ucanto/message@0.6.0': {
175+
'ucanto/message@7.0.0': {
176176
report: {
177177
[`${hi.delegation.cid}`]: hi.receipt.root.cid,
178178
},
@@ -195,7 +195,7 @@ test('empty invocations are omitted', async () => {
195195
assert.deepEqual(
196196
message.root.data,
197197
{
198-
'ucanto/message@0.6.0': {
198+
'ucanto/message@7.0.0': {
199199
report: {
200200
[`${hi.delegation.cid}`]: hi.receipt.root.cid,
201201
},
@@ -223,7 +223,7 @@ test('message with invocations & receipts', async () => {
223223
assert.deepEqual(
224224
message.root.data,
225225
{
226-
'ucanto/message@0.6.0': {
226+
'ucanto/message@7.0.0': {
227227
execute: [hi.delegation.cid],
228228
report: {
229229
[`${hi.delegation.cid}`]: hi.receipt.root.cid,

packages/interface/src/lib.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,11 @@ export type InferReceipts<
676676
* Describes messages send across ucanto agents.
677677
*/
678678
export type AgentMessageModel<T> = Variant<{
679-
'ucanto/message@0.6.0': AgentMessageData<T>
679+
'ucanto/message@7.0.0': AgentMessageData<T>
680680
}>
681681

682682
/**
683-
* Describes ucanto@0.6 message format send between (client/server) agents.
683+
* Describes ucanto@7.0 message format send between (client/server) agents.
684684
*
685685
* @template T - Phantom type capturing types of the payload for the inference.
686686
*/

packages/transport/test/car.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test('encode / decode', async () => {
1515
assertDecode(incoming, {
1616
root: message.root,
1717
data: {
18-
'ucanto/message@0.6.0': {
18+
'ucanto/message@7.0.0': {
1919
execute: [delegation.cid],
2020
},
2121
},
@@ -35,7 +35,7 @@ test('accepts Content-Type as well', async () => {
3535
{
3636
root: message.root,
3737
data: {
38-
'ucanto/message@0.6.0': {
38+
'ucanto/message@7.0.0': {
3939
execute: [delegation.cid],
4040
},
4141
},
@@ -109,7 +109,7 @@ test('CAR.request encode / decode', async () => {
109109
assertDecode(incoming, {
110110
root: message.root,
111111
data: {
112-
'ucanto/message@0.6.0': {
112+
'ucanto/message@7.0.0': {
113113
execute: [delegation.cid],
114114
},
115115
},

0 commit comments

Comments
 (0)