Implement SPICE-0009 External Readers (#660)

This adds a new feature, which allows Pkl to read resources and modules from external processes.

Follows the design laid out in SPICE-0009.

Also, this moves most of the messaging API into pkl-core
This commit is contained in:
Josh B
2024-10-28 18:22:14 -07:00
committed by GitHub
parent 466ae6fd4c
commit 666f8c3939
110 changed files with 4368 additions and 1810 deletions

View File

@@ -91,6 +91,14 @@ rootDir: String?
/// Configuration of outgoing HTTP requests.
http: Http?
/// Configuration for external module reader processes.
@Since { version = "0.27.0" }
externalModuleReaders: Mapping<String, ExternalReader>?
/// Configuration for external resource reader processes.
@Since { version = "0.27.0" }
externalResourceReaders: Mapping<String, ExternalReader>?
/// Settings that control how Pkl talks to HTTP(S) servers.
class Http {
/// Configuration of the HTTP proxy to use.
@@ -144,3 +152,20 @@ class Proxy {
/// ```
noProxy: Listing<String>(isDistinct)
}
@Since { version = "0.27.0" }
class ExternalReader {
/// The external reader executable.
///
/// Will be spawned with the same environment variables and working directory as the Pkl process.
/// Executable is resolved according to the operating system's process spawning rules.
/// On macOS, Linux, and Windows platforms, this may be:
///
/// * An absolute path
/// * A relative path (to the currrent working directory)
/// * The name of the executable, to be resolved against the `PATH` environment variable
executable: String
/// Additional command line arguments passed to the external reader process.
arguments: Listing<String>?
}