Clarify the grant-free schema 2 contract
CI / checks (pull_request) Successful in 4m29s
Agents / bot (pull_request) Successful in 6m33s

This commit is contained in:
Danny Kim
2026-09-30 19:31:46 +09:00
parent db4f5999d1
commit e14a4dd104
2 changed files with 12 additions and 10 deletions
+3 -2
View File
@@ -17,8 +17,9 @@ This package requires a Memona version that supports plugin manifest schema 2.
| Username | Optional account name for HTTP basic authentication | | Username | Optional account name for HTTP basic authentication |
| Password | Optional password, stored as a secret | | Password | Optional password, stored as a secret |
Public, LAN, VPN, link-local and localhost addresses work directly from the With the compatible schema 2 Memona version required above, public, LAN, VPN,
server address; there is no separate network permission setting. link-local and localhost addresses work directly from the server address;
that API has no separate connection network grant.
Listing, reading, writing, creating directories, renaming and deleting are Listing, reading, writing, creating directories, renaming and deleting are
supported. Reads and writes stream in pieces of at most 1 MiB, so a file of any supported. Reads and writes stream in pieces of at most 1 MiB, so a file of any
+9 -8
View File
@@ -36,9 +36,10 @@ interface host {
pull: func(limit: u32) -> result<list<u8>, host-error>; pull: func(limit: u32) -> result<list<u8>, host-error>;
} }
/// Begins a request to any HTTP or HTTPS host, including LAN and loopback /// Begins a request to any HTTP or HTTPS host, including LAN and loopback
/// addresses. Each redirect and DNS result is checked, and DNS is pinned. /// addresses. This API has no per-connection network grant. Each redirect
/// Cross-origin redirects remove request headers; HTTPS cannot downgrade. /// and DNS result is checked, and DNS is pinned. Cross-origin redirects
/// The host bounds total bytes per exchange, not buffer size. /// remove request headers; HTTPS cannot downgrade. The host bounds total
/// bytes per exchange, not buffer size.
http: func(request: request) -> result<exchange, host-error>; http: func(request: request) -> result<exchange, host-error>;
/// One open TCP connection. Dropping the handle closes the socket, and the /// One open TCP connection. Dropping the handle closes the socket, and the
@@ -51,9 +52,9 @@ interface host {
write: func(data: list<u8>) -> result<u32, host-error>; write: func(data: list<u8>) -> result<u32, host-error>;
} }
/// Opens a socket to any host, including LAN and loopback addresses, on a /// Opens a socket to any host, including LAN and loopback addresses, on a
/// package-declared port. The host resolves and pins DNS and starts TLS /// package-declared port. This API has no per-connection network grant.
/// when asked. Ports negotiated at runtime, such as an FTP data channel, /// The host resolves and pins DNS and starts TLS when asked. Ports
/// must be declared. /// negotiated at runtime, such as an FTP data channel, must be declared.
connect: func(host: string, port: u16, tls: bool) -> result<tcp, host-error>; connect: func(host: string, port: u16, tls: bool) -> result<tcp, host-error>;
/// One datagram socket connected to a single peer. /// One datagram socket connected to a single peer.
@@ -64,8 +65,8 @@ interface host {
/// means none arrived inside the host's wait, not that the peer left. /// means none arrived inside the host's wait, not that the peer left.
receive: func(limit: u32) -> result<list<u8>, host-error>; receive: func(limit: u32) -> result<list<u8>, host-error>;
} }
/// Connects a datagram socket under the same port rules as `connect`, for /// Connects a datagram socket under the same address and port rules as
/// the few filesystem protocols that still need one. /// `connect`, for the few filesystem protocols that still need one.
bind: func(host: string, port: u16) -> result<udp, host-error>; bind: func(host: string, port: u16) -> result<udp, host-error>;
/// A configuration value, typed as the package's manifest declared it. /// A configuration value, typed as the package's manifest declared it.