From f2adf5f61ac5e1742c2df2ed8983edbb2009d93a Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Mon, 16 Dec 2024 11:51:08 -0800 Subject: [PATCH] update docs in core process wit apis --- .../app-store/api/app-store:sys-v1.wit | 69 +++++++++++++++++-- kinode/packages/chess/api/chess:sys-v0.wit | 7 ++ .../packages/contacts/api/contacts:sys-v0.wit | 29 ++++++-- .../packages/homepage/api/homepage:sys-v1.wit | 8 +++ kinode/packages/tester/api/tester:sys-v0.wit | 2 + 5 files changed, 106 insertions(+), 9 deletions(-) diff --git a/kinode/packages/app-store/api/app-store:sys-v1.wit b/kinode/packages/app-store/api/app-store:sys-v1.wit index f34513e1f..1f40bf5b7 100644 --- a/kinode/packages/app-store/api/app-store:sys-v1.wit +++ b/kinode/packages/app-store/api/app-store:sys-v1.wit @@ -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), } @@ -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), + /// lazy-load-blob: none. get-apps(list), + /// lazy-load-blob: none. get-our-apps(list), + /// lazy-load-blob: none. auto-update-started, + /// lazy-load-blob: none. auto-update-stopped, + /// lazy-load-blob: none. err(chain-error), } @@ -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), /// 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), } diff --git a/kinode/packages/chess/api/chess:sys-v0.wit b/kinode/packages/chess/api/chess:sys-v0.wit index 856f5d361..bbf935046 100644 --- a/kinode/packages/chess/api/chess:sys-v0.wit +++ b/kinode/packages/chess/api/chess:sys-v0.wit @@ -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, } diff --git a/kinode/packages/contacts/api/contacts:sys-v0.wit b/kinode/packages/contacts/api/contacts:sys-v0.wit index 6a9a8d450..76e36e30b 100644 --- a/kinode/packages/contacts/api/contacts:sys-v0.wit +++ b/kinode/packages/contacts/api/contacts:sys-v0.wit @@ -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 + /// tuple + /// + /// lazy-load-blob: none. add-field(tuple), // requires add + /// lazy-load-blob: none. remove-contact(string), // requires remove - // tuple + /// tuple + /// + /// lazy-load-blob: none. remove-field(tuple), // requires remove } variant response { + /// lazy-load-blob: none. get-names(list), - 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), } } diff --git a/kinode/packages/homepage/api/homepage:sys-v1.wit b/kinode/packages/homepage/api/homepage:sys-v1.wit index ce8928fd4..2df66e996 100644 --- a/kinode/packages/homepage/api/homepage:sys-v1.wit +++ b/kinode/packages/homepage/api/homepage:sys-v1.wit @@ -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), } diff --git a/kinode/packages/tester/api/tester:sys-v0.wit b/kinode/packages/tester/api/tester:sys-v0.wit index eaf6d22e6..23db05466 100644 --- a/kinode/packages/tester/api/tester:sys-v0.wit +++ b/kinode/packages/tester/api/tester:sys-v0.wit @@ -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>) }