Skip to content

Commit

Permalink
update docs in core process wit apis
Browse files Browse the repository at this point in the history
  • Loading branch information
nick1udwig committed Dec 16, 2024
1 parent f89c9ae commit f2adf5f
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 9 deletions.
69 changes: 65 additions & 4 deletions kinode/packages/app-store/api/app-store:sys-v1.wit
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,41 @@ interface main {

/// Local requests that can be made to the App Store
variant local-request {
/// Request to add a new package to app-store. Includes zip and an optional onchain-metadata.
/// This is used by kit start
/// Request to add a new package to app-store.
///
/// Used by kit start-package.
///
/// lazy-load-blob: required; the zipped package to be added.
new-package(new-package-request),
/// Request to install a package
/// Request to install a package.
///
/// lazy-load-blob: none.
install(install-package-request),
/// Request to uninstall a package
/// Request to uninstall a package.
///
/// lazy-load-blob: none.
uninstall(package-id),
/// Request to list all available APIs
///
/// lazy-load-blob: none.
apis,
/// Request to get a specific API
///
/// lazy-load-blob: none.
get-api(package-id),
}

/// Local responses from the App Store
variant local-response {
/// lazy-load-blob: none.
new-package-response(new-package-response),
/// lazy-load-blob: none.
install-response(install-response),
/// lazy-load-blob: none.
uninstall-response(uninstall-response),
/// lazy-load-blob: none.
apis-response(apis-response),
/// lazy-load-blob: on success; the WIT API that was requested.
get-api-response(get-api-response),
}

Expand Down Expand Up @@ -99,24 +115,40 @@ interface chain {
/// Requests that can be made to the chain component
variant chain-requests {
/// Get information about a specific app
///
/// lazy-load-blob: none.
get-app(package-id),
/// Get information about all apps
///
/// lazy-load-blob: none.
get-apps,
/// Get information about apps published by the current node
///
/// lazy-load-blob: none.
get-our-apps,
/// Start auto-updating an app
///
/// lazy-load-blob: none.
start-auto-update(package-id),
/// Stop auto-updating an app
///
/// lazy-load-blob: none.
stop-auto-update(package-id),
}

/// Responses from the chain component
variant chain-responses {
/// lazy-load-blob: none.
get-app(option<onchain-app>),
/// lazy-load-blob: none.
get-apps(list<onchain-app>),
/// lazy-load-blob: none.
get-our-apps(list<onchain-app>),
/// lazy-load-blob: none.
auto-update-started,
/// lazy-load-blob: none.
auto-update-stopped,
/// lazy-load-blob: none.
err(chain-error),
}

Expand Down Expand Up @@ -171,37 +203,66 @@ interface downloads {
/// Requests that can be made to the downloads component
variant download-requests {
/// Request a remote download
///
/// lazy-load-blob: none.
remote-download(remote-download-request),
/// Request a chunk of a file
///
/// lazy-load-blob: none.
chunk(chunk-request),
/// Update download progress
///
/// lazy-load-blob: none.
progress(progress-update),
/// Update file size information
///
/// lazy-load-blob: none.
size(size-update),
/// Request a local download
///
/// lazy-load-blob: none.
local-download(local-download-request),
/// Request an auto-update
///
/// lazy-load-blob: none.
auto-update(auto-update-request),
/// Notify that a download is complete
///
/// lazy-load-blob: none.
download-complete(download-complete-request),
/// Auto-update-download complete
///
/// lazy-load-blob: none.
auto-download-complete(auto-download-complete-request),
/// Get files for a package
///
/// lazy-load-blob: none.
get-files(option<package-id>),
/// Remove a file
///
/// lazy-load-blob: none.
remove-file(remove-file-request),
/// Add a download
///
/// lazy-load-blob: none.
add-download(add-download-request),
/// Start mirroring a package
///
/// lazy-load-blob: none.
start-mirroring(package-id),
/// Stop mirroring a package
///
/// lazy-load-blob: none.
stop-mirroring(package-id),
}

/// Responses from the downloads component
variant download-responses {
/// lazy-load-blob: none.
success,
/// lazy-load-blob: none.
err(download-error),
/// lazy-load-blob: none.
get-files(list<entry>),
}

Expand Down
7 changes: 7 additions & 0 deletions kinode/packages/chess/api/chess:sys-v0.wit
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ interface chess {
/// to a byte vector and send them over IPC.

variant request {
/// lazy-load-blob: none.
new-game(new-game-request),
/// lazy-load-blob: none.
move(move-request),
/// lazy-load-blob: none.
resign(string),
}

variant response {
/// lazy-load-blob: none.
new-game-accepted,
/// lazy-load-blob: none.
new-game-rejected,
/// lazy-load-blob: none.
move-accepted,
/// lazy-load-blob: none.
move-rejected,
}

Expand Down
29 changes: 24 additions & 5 deletions kinode/packages/contacts/api/contacts:sys-v0.wit
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,45 @@ interface contacts {
}

variant request {
/// lazy-load-blob: none.
get-names, // requires read-names-only
/// lazy-load-blob: none.
get-all-contacts, // requires read
/// lazy-load-blob: none.
get-contact(string), // requires read
/// lazy-load-blob: none.
add-contact(string), // requires add
// tuple<node, field, value>
/// tuple<node, field, value>
///
/// lazy-load-blob: none.
add-field(tuple<string, string, string>), // requires add
/// lazy-load-blob: none.
remove-contact(string), // requires remove
// tuple<node, field>
/// tuple<node, field>
///
/// lazy-load-blob: none.
remove-field(tuple<string, string>), // requires remove
}

variant response {
/// lazy-load-blob: none.
get-names(list<string>),
get-all-contacts, // JSON all-contacts dict in blob
get-contact, // JSON contact dict in blob
/// lazy-load-blob: required; JSON all-contacts dict in blob.
get-all-contacts,
/// lazy-load-blob: required; JSON contact dict in blob.
get-contact,
/// lazy-load-blob: none.
add-contact,
/// lazy-load-blob: none.
add-field,
/// lazy-load-blob: none.
remove-contact,
/// lazy-load-blob: none.
remove-field,
err(string), // any failed request will receive this response
/// any failed request will receive this response
///
/// lazy-load-blob: none.
err(string),
}
}

Expand Down
8 changes: 8 additions & 0 deletions kinode/packages/homepage/api/homepage:sys-v1.wit
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@ interface homepage {
/// the package and process name will come from request source.
/// the path will automatically have the process_id prepended.
/// the icon is a base64 encoded image.
///
/// lazy-load-blob: none.
add(add-request),
/// remove ourself from homepage (message source will be item removed)
///
/// lazy-load-blob: none.
remove,
/// remove another app from homepage
/// using this requires RemoveOther capability
/// app store uses this to remove apps on uninstall
///
/// lazy-load-blob: none.
remove-other(string),
/// set the stylesheet for the homepage
/// using this requires SetStylesheet capability
/// settings:settings:sys uses this to set the stylesheet
///
/// lazy-load-blob: none.
set-stylesheet(string),
}

Expand Down
2 changes: 2 additions & 0 deletions kinode/packages/tester/api/tester:sys-v0.wit
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
interface tester {
variant request {
/// lazy-load-blob: none.
run(run-request),
}

variant response {
/// lazy-load-blob: none.
run(result<_, fail-response>)
}

Expand Down

0 comments on commit f2adf5f

Please sign in to comment.