Giter Club home page Giter Club logo

debot-is-consortium's Introduction

DeBot-IS-consortium

DeBot Interface Specifications (IS) Consortium. IS a place where community defines interfaces every DeBot browser should support.

Application Rules:

Each new interface must create a folder, which has a readme.md desciption of an interface, example of its implementaion in both Solidity and C++ placed in an "examples" sub folder.

Interface submission proccess:

  • You should create a specifications proposal, discuss it.
  • After the discussion is over and proposal is accepted you should submit examples in both Solidity and C++.
  • Only proposals with examples will be published.

Supported browsers:

  • If you implemented a DeBot browser we will be happy to list it. Please let us know.
  • Your browser should clearly state interfaces which it supports (by version number as stated in this repository).

debot-is-consortium's People

Contributors

amphyby avatar bigroma avatar futurizt avatar ilyar avatar keshoid avatar mikhailushakoff avatar oxydixi avatar sauin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

debot-is-consortium's Issues

Have an ability to send a message to a regular Surf chat

MOTIVATION:
I want to to create a debot, it's a simple quiz, that asks few questions to a user and generate a single message with answers. I want to have an ability to store the message somewhere. In theory I can store it in blockchain, but it requires to create a storage contract and deploy it for every user, also to save the message I need to send a transaction. But in Surf we already have a contract, that we create and deploy for a new account, so I can just create a new account for the debot and use it. If I send a regular message to such account I mustn't create a transaction even though it would be encrypted, that is actually perfect.

ADDITIONAL CASES:

  • Debot for Assistant for Surf, that can have quizzes for a user, to get more details about a problem, then generate a message and send to an actual Assistant, where a real technical specialist can take a look at it.
  • Online shop, where user can choose a product and fulfil order details, then a debot can generate an "order" message that will be sent to a regular chat where a real human can interact with a customer further and accept payment.

SOLUTION:
Create a new interface, something like:

sendToChat(address: string, message: string)

That will send a message to any address via chat.

ISSUES:

  • The interface looks to be a very custom and related to Surf, therefore it might be not a good idea to put it as a general interface and rather create for a browser an ability to use custom plugins that a debot must declare when it wants to use it.
  • Looks like the same functionality can be achieved with a transaction sending with a relatively low amount (like 0,0000001), though I'm not sure that it will have a good UI, as a message can be very long.

Error: Debot failed: Contract execution was terminated with error: Unknown error, exit code: 75

pragma ton-solidity >= 0.57.3;
pragma AbiHeader expire;
pragma AbiHeader time;
pragma AbiHeader pubkey;

interface IContract {
    function foo() external responsible pure returns (string);
}

contract Example {
    function foo() external responsible pure returns (string) {
        return "foo42";
    }
    // minimal DeBot
    string s_dabi;
    function setABI(string dabi) public {
        require(tvm.pubkey() == msg.pubkey(), 100);
        tvm.accept();
        s_dabi = dabi;
    }
    function getDebotOptions() public view returns (
        uint8 options, string debotAbi, string targetAbi, address targetAddr
    ) {
        debotAbi = s_dabi;
        targetAbi = "";
        targetAddr = address(0);
        options = 1;
    }

    function onFoo(string data) public pure {
        tvm.log(format("onFoo: {}", data));
    }

    function start() public pure {
        tvm.log("start");
        IContract(address(this)).foo{
            callback: onFoo
        }();
        // FIXME IContract(address(this)).foo().await;
        tvm.log("end");
    }

    function getDebotInfo() public functionID(0xDEB) view returns(
        string name, string version, string publisher, string caption, string author,
        address support, string hello, string language, string dabi, bytes icon
    ) {
        tvm.log("getDebotInfo");
        name = "Example";
        version = "1.0.0-alpha.0";
        publisher = "Everscale";
        caption = "My first DeBot";
        author = "Everscale";
        support = address.makeAddrStd(0, 0x0);
        hello = "Hello first user!";
        language = "en";
        dabi = s_dabi;
        icon = "";
    }
}

Run log:

19:31:10 [DEBUG] (1) ton_client::debot::dengine: running getRequiredInterfaces, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running getDebotInfo, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [INFO] getDebotInfo
19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_debot_external getDebotOptions, args: {}
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running getDebotOptions, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_debot_external fetch, args: {}
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running fetch, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [ERROR] Create run message failed: Invalid name: fetch
19:31:10 [DEBUG] (1) ton_client::debot::dengine: switching to 0
19:31:10 [DEBUG] (1) tonos_cli::debot::callbacks: switched to ctx 0

19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_action: start
19:31:10 [DEBUG] (1) ton_client::debot::dengine: run_debot_external start, args: {}
19:31:10 [DEBUG] (1) ton_client::debot::dengine: running start, addr 0:3aee4ccbf6411dc31e48c610ff78ce0e480e1f156d20c04ec88c690657dd0a45
19:31:10 [INFO] start
19:31:10 [INFO] end
19:31:10 [DEBUG] (1) ton_client::debot::dengine: Invoke call
19:31:10 [DEBUG] (1) ton_client::debot::dengine: instant_switch = false, state_to = 0
19:31:10 [DEBUG] (1) ton_client::debot::dengine: Invoke call
19:31:10 [INFO] onFoo: foo42

19:31:10 [DEBUG] (1) tonos_cli::debot::callbacks: no more actions, exit loop

If use IContract(address(this)).foo().await; run log:

19:38:12 [DEBUG] (1) ton_client::debot::dengine: running getRequiredInterfaces, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running getDebotInfo, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [INFO] getDebotInfo
19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_debot_external getDebotOptions, args: {}
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running getDebotOptions, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_debot_external fetch, args: {}
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running fetch, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [ERROR] Create run message failed: Invalid name: fetch
19:38:12 [DEBUG] (1) ton_client::debot::dengine: switching to 0
19:38:12 [DEBUG] (1) tonos_cli::debot::callbacks: switched to ctx 0

19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_action: start
19:38:12 [DEBUG] (1) ton_client::debot::dengine: run_debot_external start, args: {}
19:38:12 [DEBUG] (1) ton_client::debot::dengine: running start, addr 0:7aa981052eeb3022d5752567b593ed9bb260e926f5dc105f0daeb2646d73689a
19:38:12 [INFO] start
19:38:12 [DEBUG] (1) ton_client::debot::dengine: Invoke call
19:38:12 [DEBUG] (1) ton_client::debot::dengine: instant_switch = false, state_to = 0
Error: Debot failed: Contract execution was terminated with error: Unknown error, exit code: 75.
Tip: For more information about exit code check the contract source code or ask the contract developer
Error: 1

Progress Indicator Interface

I think a progress indicator would be very useful on debots.
Instead of some mundane "working..." message, you'd be able to show circular progress indicator, or an ascii equivalent on cli.
the intefrace may also contain progress bar:)

What do you think?

interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 not implemented

debot-run.sh

cd UserInfo/examples
bash debot-run.sh

Log:

13:00:40 [DEBUG] (1) ton_client::debot::dengine: running getRequiredInterfaces, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running getDebotInfo, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_debot_external getDebotOptions, args: {}
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running getDebotOptions, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_debot_external fetch, args: {}
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running fetch, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [ERROR] Create run message failed: Invalid name: fetch
13:00:40 [DEBUG] (1) ton_client::debot::dengine: switching to 0
13:00:40 [DEBUG] (1) tonos_cli::debot::callbacks: switched to ctx 0

13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_action: start
13:00:40 [DEBUG] (1) ton_client::debot::dengine: run_debot_external start, args: {}
13:00:40 [DEBUG] (1) ton_client::debot::dengine: running start, addr 0:336c16a88352dbb1b71222e0257d7ff05587b21455af2b2557d3dc69bcc682d0
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dengine: instant_switch = false, state_to = 0
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) tonos_cli::debot::term_browser: response: 1924829813 ({"value":"0:c3da3e141096b5bb518b3479b8fe36163c191e2aaffa5c603b85b62335c91201"})
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) tonos_cli::debot::term_browser: response: 965659587 ({"value":"0xf869eb226d1d3eda3b9863e3121b66b351cbf8c6ce7f4fd4dba45901b97155d7"})
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface a56115147709ed3437efb89460b94a120b7fe94379c795d1ebb0435a847ee580 call
13:00:40 [DEBUG] (1) tonos_cli::debot::term_browser: response: 261024939 ({"handle":2})
13:00:40 [DEBUG] (1) ton_client::debot::dengine: Interface call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 not implemented
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
User account 0:c3da3e141096b5bb518b3479b8fe36163c191e2aaffa5c603b85b62335c91201
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
User public key 112360728228972547836743944487000110014042219676732296757809302185935662831063
13:00:40 [DEBUG] (1) ton_client::debot::dinterface: interface 8796536366ee21852db56dccb60bc564598b618c865fc50c8b1ab740bba128e3 call
Signing box handle 2
13:00:40 [DEBUG] (1) tonos_cli::debot::callbacks: no more actions, exit loop

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.