Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: versioned transport protocol #274

Merged
merged 15 commits into from
Apr 11, 2023
Merged

feat!: versioned transport protocol #274

merged 15 commits into from
Apr 11, 2023

Conversation

Gozala
Copy link
Collaborator

@Gozala Gozala commented Apr 7, 2023

Overview

  • Changes introduce AgentMessage block which are DAGs send around between ucanto (client/server) agents.
  • AgentMessage may contain set of delegations (to be invoked) and / or set of receipts.
    • At the moment clients send invocations and servers respond with receipts but in the future we may allow sending both in either direction.
  • AgentMessage is represented as a variant case so we could introduce another version in the future (e.g. when ucan invocations are implemented)
  • Transport encoders / decoders now simply encode / decode AgentMessage-es and no longer know or care what they contain.
  • New transport codecs now set proper CAR content type while legacy codec uses application/car.
    • This end up been useful way to differentiate between legacy requests that put invocation links in roots vs new requests that put message cid into a root.

@Gozala Gozala requested a review from gobengo April 7, 2023 23:59
@Gozala Gozala changed the title feat! versioned transport protocol feat!: versioned transport protocol Apr 8, 2023
Copy link
Contributor

@gobengo gobengo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentMessage is a good abstraction over the various ways ucanto can be configured to send messages (e.g. so apps using ucanto can transition from legacy to ucan invocation spec )

packages/interface/src/lib.ts Show resolved Hide resolved
@@ -417,3 +418,53 @@ test('falsy errors are turned into {}', async () => {
ok: {},
})
})

test('run invocation without encode / decode', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants