urbit/sur/lens.hoon
benjamin-tlon d06693dc7e
Add support to lens-command for pill output and optimized base64 encoding. (#1068)
Added support to `lens-command` for outputting a pill. We want this so that we can create (solid and brass) pills from `urb.py`.

This also adds an optimized base64 encoding routine. The previous version of base64 stack overflowed on large inputs, and a tail-recursive version took hours to encode 5mb of data. This one uses the `ripn` jet and only takes a second or two.
2019-02-27 16:12:59 -08:00

31 lines
752 B
Plaintext

^?
|%
++ command
$: source/source
sink/sink
==
++ source
$% {$data data/@}
{$dojo command/@t}
{$clay pax/@t}
{$url url/purl:eyre}
{$api api/term command/@t}
{$get-api api/term endpoint/(list @t)}
{$as mar/mark next/source} :: can't be at the
{$hoon code/@t next/source} :: end since they
{$tuple next/(list source)} :: don't bunt well
{$listen-api api/term event/term}
==
++ sink
$% {$stdout ~}
{$output-file pax/@t}
{$output-pill pax/@t}
{$output-clay pax/path}
{$url url/purl:eyre}
{$to-api api/term command/@t}
{$send-api api/term endpoint/(list @t)}
{$command command/@t}
{$app app/term}
==
--