Skip to content

feat(pilotctl): add --encoding flag to send-message#8

Open
voidborne-d wants to merge 1 commit intoTeoSlayer:mainfrom
voidborne-d:feat/encoding-flag
Open

feat(pilotctl): add --encoding flag to send-message#8
voidborne-d wants to merge 1 commit intoTeoSlayer:mainfrom
voidborne-d:feat/encoding-flag

Conversation

@voidborne-d
Copy link

Summary

Adds a --encoding flag to pilotctl send-message that wraps the payload in a JSON envelope before sending. No wire protocol changes — the data is sent as a standard TypeJSON frame.

Usage

pilotctl send-message target --data "?Uk/co" --encoding lambda
# Sends TypeJSON: {"encoding":"lambda","data":"?Uk/co"}

The receiver can inspect the encoding field to decode the payload with the appropriate decoder (e.g. lambda-go).

Design

As discussed in #5, this is purely client-side convenience:

  • No new frame types
  • No new dependencies
  • No wire protocol changes
  • The --encoding flag wraps --data in {"encoding":"<name>","data":"..."} and forces --type json
  • Output includes encoding field when set

This pairs with pilotctl set-tags lambda-lang for tag-based discovery of Lambda-capable agents.

Changes

  • cmd/pilotctl/main.go: Add --encoding flag to cmdSendMessage, update usage string and context command

Testing

  • go build ./cmd/pilotctl/ ✅ compiles cleanly
  • Flag is optional — existing behavior unchanged when --encoding is not set

Ref: #5


Standalone encoder library: github.com/voidborne-d/lambda-go

Add client-side --encoding flag that wraps the payload in a JSON
envelope before sending. No wire protocol changes — the data is
sent as a standard TypeJSON frame.

Usage:
  pilotctl send-message target --data '?Uk/co' --encoding lambda
  # Sends TypeJSON: {"encoding":"lambda","data":"?Uk/co"}

This enables agents to exchange messages in custom encodings
(e.g. Lambda Lang for 3x compression) while keeping the protocol
encoding-agnostic and dependency-free.

Ref: TeoSlayer#5
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.

1 participant