-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Pre-Built Non-JS Scripts (Wrap Scripts) #134
Comments
Just talked to @cbrzn about the implementation of this. Here is a draft {
"name": "webScrape.getLinks",
"description": "Get all links from a web page",
"arguments": "{ ... }",
"code": {
"uri": "wrap://wrapscan.io/polywrap/web-scrape",
"method": "getLinks"
}
} The implementation of this could be done in 2 parts. First is supporting pre-defined "wrap scripts" like shown above, that evo simply knows how to execute. The second step would be adding support for searching through wraps and generating the above JSON file from a wrap ABI. The list of "known wraps" can be hard-coded for now, and in the future could be pulled from an external service like wrapscan. |
Just talked with @rihp and he noted that most web-scraping tests are failing in the benchmarks, so adding support for pre-built scripts (aka wraps) is very important for continuing our progress. First one to be added should be the web-scraper. |
Just talked to @nerfZael and we can actually implement this without any new core code being modified like so: https://github.com/polywrap/evo.ninja/blob/dev/scripts/agent.ask.js We support |
I created this test branch to make sure the wrap scripts work as expected: Invocations fail on my local machine. I'm not yet sure why. const result = __wrap_subinvoke(
"wrap://ipfs/QmXKA6qc3TMiBZn5DyydYwdc9o2uSShqFdV7yTgYjF2xdu",
"get_links",
{ uri }
)
if (!result.ok) {
throw result.error;
}
return result.value; |
Nevermind, I confirmed it works. The issue is in the web scraper wrap. |
You can confirm that wrap scripts work using the fibonacci test script in the branch |
Currently the scripts created by the script-writer have the following limitations:
axios
,fs
, etc)In order to overcome these limitations, we can utilize pre-built wraps, as they can:
The text was updated successfully, but these errors were encountered: