Feature Description
As we solicit feedback from folks, they need to be able to write custom functions in order to:
- Evaluate and understand the capabilities of the Everywhere Computer
- Imagine clear use cases within their business
Use Cases
- Creating bespoke workflows for your own problem domain
- Really running EC through the trials
- Writing a basic "Hello World" rust module and seeing how it runs as a workflow
Signals of Success
More function diversity in each run, and overall.
Current Workarounds (optional)
Technically possible write now, but requires making changes to core code. See Philipp's tear down of how it's done presently: https://www.loom.com/share/19c4651b5ae6419ea091cd6c2fcb049f?sid=8739f44e-e88e-4a29-9446-5eb9a39d59aa
Summary of current process is:
- in your local Homestar repo:
- write a function in
homestar-functions/src/lib.rs
- add type definitions to 'homestar-functions/wit/host.wit`
- compile by running
cargo build -p homestar-functions-test --target wasm32-unkown-unknown --profile release-wasm-fn
- now turn it into a Wasm component:
wasm-tools component new ... -o functions.wasm
- ingest into local IPFS node
- in your local Control Panel repo:
- launch the control panel
npm run dev
- make function available in dropdown. update the
VITE_WORKFLOW_RESOURCE with the newly created module's CID in .env
- add the function signature to the
const FUNCTION_NAMES array in NewFunctionNode.svelte
- in
function-template.ts:
- rewrite
generateFunction as so:
// philipp's snippet goes here
- specify default parameters in the
const DEFAULT_PARAMS object
- in
graph.ts add function definitions to const FUNCTION_PARAMS
Extreme MVP is to document the workaround of manually writing and ingesting wasm modules.
Consider this a map of the work to be done in pursuit of a cleaner DX for authoring -> publishing in your local registry of functions.
Evidence of Value (Optional)
Table stakes! You can't have a computer if there's nothing to compute.
Tasks & Jobs Stories
Additional Context (Optional)
Boris is going to start by dog fooding the process.
Feature Description
As we solicit feedback from folks, they need to be able to write custom functions in order to:
Use Cases
Signals of Success
More function diversity in each run, and overall.
Current Workarounds (optional)
Technically possible write now, but requires making changes to core code. See Philipp's tear down of how it's done presently: https://www.loom.com/share/19c4651b5ae6419ea091cd6c2fcb049f?sid=8739f44e-e88e-4a29-9446-5eb9a39d59aa
Summary of current process is:
homestar-functions/src/lib.rscargo build -p homestar-functions-test --target wasm32-unkown-unknown --profile release-wasm-fnwasm-tools component new ... -o functions.wasmnpm run devVITE_WORKFLOW_RESOURCEwith the newly created module's CID in.envconst FUNCTION_NAMESarray inNewFunctionNode.sveltefunction-template.ts:generateFunctionas so:const DEFAULT_PARAMSobjectgraph.tsadd function definitions toconst FUNCTION_PARAMSExtreme MVP is to document the workaround of manually writing and ingesting wasm modules.
Consider this a map of the work to be done in pursuit of a cleaner DX for authoring -> publishing in your local registry of functions.
Evidence of Value (Optional)
Table stakes! You can't have a computer if there's nothing to compute.
Tasks & Jobs Stories
getting-startedrepo?Additional Context (Optional)
Boris is going to start by dog fooding the process.