Skip to content

feat(net): capability contract for network/fetch in the host op seta #226

Description

@wielorzeczownik

What's missing

Guest code can't do any network I/O right now. HostOps gives us ui.*, input and
assets, and that's it. So every app builds its own way out: pocket-youtube runs a
companion process on a Mac and passes messages through an in/out.jsonl file over
usbhostfs_pc. It works, but it's private to that app, untyped, and guest code
can't tell whether it's there.

I'd like a net.* capability contract in the host op set, negotiated per target
like the other contracts, so guest code can ask "do I have network?" instead of
guessing.

What it would look like

A small subset of fetch:

net.request({ url, method, headers, body }) -> stream of bytes

No CORS, no cache, no Request/Response objects, no redirect handling. Just enough
to pull bytes from a URL, streamed, because with an 8 MB budget you can't buffer a
whole response.

Where it would run

  • PSP: psp-net (0.6.6) has TCP/UDP and DNS on rust-psp. Its socket implements
    embedded-io Read/Write, so it plugs into embedded-tls for TLS 1.3. Both are
    no_std, same as the core.
  • Vita and ESP32: native stack.
  • Desktop and web: the host's own fetch.
  • Companion transport: the pocket-youtube mailbox still earns its place where the
    device can't do the heavy lifting itself (H.264). It could just sit behind the
    same contract instead of being app private.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions