-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from kinode-dao/develop
Develop
- Loading branch information
Showing
5 changed files
with
157 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# `kit view-api` | ||
|
||
`kit view-api` fetches the list of APIs or a specific API for the given package. | ||
`view-api` relies on a node to do so, e.g. | ||
|
||
``` | ||
kit view-api --port 8080 | ||
``` | ||
|
||
lists all the APIs of packages downloaded by the Kinode running at port 8080. | ||
|
||
## Example Usage | ||
|
||
``` | ||
# Fetch and display the API for the given package | ||
kit view-api app_store:sys-v0 | ||
``` | ||
|
||
## Discussion | ||
|
||
Currently broken! | ||
TODO: fix & document | ||
|
||
## Arguments | ||
|
||
``` | ||
$ kit view-api --help | ||
Fetch the list of APIs or a specific API | ||
Usage: kit view-api [OPTIONS] [PACKAGE_ID] | ||
Arguments: | ||
[PACKAGE_ID] Get API of this package (default: list all APIs) | ||
Options: | ||
-p, --port <NODE_PORT> Node port: for use on localhost (overridden by URL) [default: 8080] | ||
-u, --url <URL> Node URL (overrides NODE_PORT) | ||
-h, --help Print help | ||
``` | ||
|
||
### Positional arg: `PACKAGE_ID` | ||
|
||
Get the API of this package. | ||
By default, list the names of all APIs. | ||
|
||
### `--port` | ||
|
||
short: `-p` | ||
|
||
For nodes running on localhost, the port of the node; defaults to `8080`. | ||
`--port` is overridden by `--url` if both are supplied. | ||
|
||
### `--url` | ||
|
||
short: `-u` | ||
|
||
The URL the node is hosted at. | ||
Can be either localhost or remote. | ||
`--url` overrides `--port` if both are supplied. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# WIT APIs | ||
|
||
Kinode OS runs processes that are WebAssembly components, as discussed [elsewhere](./processes.md#wasm-and-kinode). | ||
Two key advantages of WebAssembly components are | ||
|
||
1. The declaration of types and functions using the cross-language Wasm Interface Type (WIT) language | ||
2. The composibility of components. | ||
See discussion [here](https://component-model.bytecodealliance.org/design/why-component-model.html). | ||
|
||
Kinode processes make use of these two advantages. | ||
Processes within a package — a group of processes, also referred to as an app — may define an API in WIT format. | ||
Each process defines a [WIT interface](https://component-model.bytecodealliance.org/design/wit.html#interfaces); the package defines a [WIT world](https://component-model.bytecodealliance.org/design/wit.html#interfaces). | ||
The API is published alongside the package. | ||
Other packages may then import and depend upon that API, and thus communicate with the processes in that package. | ||
The publication of the API also allows for easy inspection by developers or by machines, e.g., LLM agents. | ||
|
||
More than types can be published. | ||
Because components are composable, packages may publish, along with the types in their API, library functions that may be of use in interacting with that package. | ||
When set as as a dependency, these functions will be composed into new packages. | ||
Libraries unassociated with packages can also be published and composed. |