Giter Site home page Giter Site logo

jacamo-web's Introduction

Gitpod ready-to-code

Jacamo-web is an interactive programming IDE based on JaCaMo, a Multi-Agent System (MAS) Oriented Programming platform. The interactive development allows making changes on instances of agents, artefacts and organisations, which means that the system can be updated while it is running.

Running locally

Using a local gradle

$ git clone https://github.com/jacamo-lang/jacamo-web.git
$ cd jacamo-web
$ ./gradlew run

See http://yourIP:8080 for a web interface (see the console for the right IP:port). You can also try ./gradlew run --args="src/jcm/marcos.jcm", ./gradlew run --args="src/jcm/bob.jcm", and go to /examples for more sample projects and information about how to run them.

Making front end changes

If you want to make changes to the jacamo-web front end, install Node.js and install the webpack client with yarn install -g webpack client. Then, install the jacamo-web front end dependencies by running yarn install in the project's root repository. Run the webpack watch task with yarn run watch. All changes you make to JavaScript files will be automatically built and deployed to your local jacamo-web instance.

Using a local docker

You can create a local docker image of jacamo-web. First, make sure you are in the jacamo-web root folder, then run the following command (super user privileges may be necessary):

jacamo-web$ docker build -t jacamo-web:0.5 .

It will take some minutes to build the docker image. After finishing, the jacamo-web image should be listed by the command docker image ls. Execute the following command to launch a container based on jacamo-web docker image:

$ docker run -it --name jacamo-web jacamo-web:0.5

In the log you should see a message similar to "jacamo-web Rest API is running on http://yourIP:8080/" (e.g. http://172.17.0.2:8080/), so you can open your browser on the referred URL.

To rerun jacamo-web after stopping the container execute:

$ docker container start -i jacamo-web

Alternativelly, you can remove the pre-generated jacamo-web container executing docker container rm jacamo-web.

More about jacamo-web

It uses jacamo-rest on the back-end and provides a web front-end developed in plain javascript, the API jacamo-rest 0.3 bind these parts.

In short, jacao-web provides an interface to develop Multi-Agent Systems interactively allow to send beliefs and plans to agents, inspect, create and destroy them. It is also supported dynamic compiling of CArtAgO artefacts and Moise organisations. The following diagram shows the main functionalities of the interface:

Alt text

Interactive programming concept with jacamo-web programmingconcept digraph G { graph [ rankdir="RL" ] subgraph cluster_1 { label="Environment: CArtAgO"; Artifact [shape = record, label="Artifact"]; ArtInsp [shape = plain, label="Artifact Inspection"]; ArtEdit [shape = plain, label="Edit artifact code"]; ArtCreate [shape = plain, label="Make new artifact"]; ArtDispo [shape = plain, label="Dispose artifact"]; } subgraph cluster_0 { label="Agents: Jason"; Agent [label="Agent"]; AgInsp [shape = plain, label="Agent Inspection"]; AgCmd [shape = plain, label="Send commands"]; AgEdit [shape = plain, label="Edit Agent"]; AgCreate [shape = plain, label="Create agent"]; AgKill [shape = plain, label="Kill agents"]; AgDF [shape = plain, label="Directory Facilitator"]; } subgraph cluster_2 { label="Organisation: Moise"; Org [shape = tab, label="Organisation"]; OrgInsp [shape = plain, label="Organisation Inspection"]; OrgEdit [shape = plain, label="Edit organisation"]; OrgAgR [shape = plain, label="Adopting role"]; OrgAgM [shape = plain, label="Commiting mission"]; } AgInsp -> Agent [color = gray20, fontcolor = gray20, style = dotted]; AgCmd -> Agent [color = gray20, fontcolor = gray20, style = dotted]; AgEdit -> Agent [color = gray20, fontcolor = gray20, style = dotted]; AgCreate -> Agent [color = gray20, fontcolor = gray20, style = dotted]; AgKill -> Agent [color = gray20, fontcolor = gray20, style = dotted]; AgDF -> Agent [color = gray20, fontcolor = gray20, style = dotted]; ArtInsp -> Artifact [color = gray20, fontcolor = gray20, style = dotted]; ArtEdit -> Artifact [color = gray20, fontcolor = gray20, style = dotted]; ArtCreate -> Artifact [color = gray20, fontcolor = gray20, style = dotted]; ArtDispo -> Artifact [color = gray20, fontcolor = gray20, style = dotted]; OrgInsp -> Org [color = gray20, fontcolor = gray20, style = dotted]; OrgEdit -> Org [color = gray20, fontcolor = gray20, style = dotted]; OrgAgR -> Org [color = gray20, fontcolor = gray20, style = dotted]; OrgAgM -> Org [color = gray20, fontcolor = gray20, style = dotted]; } programmingconcept

jacamo-web's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jacamo-web's Issues

Docker doesn't build

Hey guys, I'm trying to build the Dockerfile in this project, but it doesn't works. Could you check that? I'm not very good with Java applications hahaha

Building jacamo-web
[+] Building 109.4s (7/8)
 => [internal] load build definition from Dockerfile                                                                     0.0s 
 => => transferring dockerfile: 703B                                                                                     0.0s 
 => [internal] load .dockerignore                                                                                        0.0s 
 => => transferring context: 2B                                                                                          0.0s 
 => [internal] load metadata for docker.io/library/alpine:latest                                                        13.3s 
 => [auth] library/alpine:pull token for registry-1.docker.io                                                            0.0s 
 => [1/4] FROM docker.io/library/alpine@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae          0.0s 
 => CACHED [2/4] RUN apk add --update --no-cache git gradle openjdk8-jre bash fontconfig ttf-dejavu graphviz             0.0s 
 => ERROR [3/4] RUN git clone https://github.com/jacamo-lang/jacamo-web.git &&     cd jacamo-web &&     gradle build    96.0s 
------
 > [3/4] RUN git clone https://github.com/jacamo-lang/jacamo-web.git &&     cd jacamo-web &&     gradle build:
#7 0.452 Cloning into 'jacamo-web'...
#7 6.459
#7 6.459 Welcome to Gradle 6.8.3!
#7 6.459
#7 6.459 Here are the highlights of this release:
#7 6.460  - Faster Kotlin DSL script compilation
#7 6.460  - Vendor selection for Java toolchains
#7 6.460  - Convenient execution of tasks in composite builds
#7 6.460  - Consistent dependency resolution
#7 6.461
#7 6.461 For more details see https://docs.gradle.org/6.8.3/release-notes.html
#7 6.461
#7 6.659 Starting a Gradle Daemon (subsequent builds will be faster)
#7 95.36 > Task :compileJava FAILED
#7 95.36
#7 95.36 FAILURE: Build failed with an exception.
#7 95.36 
#7 95.36 * What went wrong:
#7 95.36 Execution failed for task ':compileJava'.
#7 95.36 > Could not find tools.jar. Please check that /usr/lib/jvm/java-1.8-openjdk contains a valid JDK installation.       
#7 95.36
#7 95.36 * Try:
#7 95.36 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
#7 95.36
#7 95.36 * Get more help at https://help.gradle.org
#7 95.36
#7 95.36 Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
#7 95.36 Use '--warning-mode all' to show the individual deprecation warnings.
#7 95.36 See https://docs.gradle.org/6.8.3/userguide/command_line_interface.html#sec:command_line_warnings
#7 95.36
#7 95.36 BUILD FAILED in 1m 29s
#7 95.36 1 actionable task: 1 executed
------
executor failed running [/bin/sh -c git clone https://github.com/jacamo-lang/jacamo-web.git &&     cd jacamo-web &&     gradle build]: exit code: 1
ERROR: Service 'jacamo-web' failed to build : Build failed

Migrate to jacamo-rest 0.5

It shouldn't be a big deal since I don't remember any deep change but it could take a while to be done since Jacamo-rest 0.5 has changed several endpoint paths.

Create a popup textarea to allow to add plans interactively

This popup is for add plans on-the-fly. It does not need to save in file yet, we need to first think how we will do it.

About edit aslfile, which is a related function, it is for big changes and it needs to kill and resurrect the agent.

Fetch dependencies from npm

Instead of pointing to CDNs for the JavaScript dependencies, install them via NPM. For now, don't set up a "full" build (webpack or similar) to avoid the overhead that comes with it.

Create an ACE editor mode for Jason

We are currently using erlang mode but there are several tokens that are not suitable, for instance, the #comment one. It is also necessary to create many others like for adding and removing beliefs, for plans, namespaces and so on.

Some material about how to create/extend a mode:
https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode
For testing highlighting script
https://ace.c9.io/tool/mode_creator.html
For testing regex:
https://regex101.com/

Create lock and unlock endpoints

Lock and unlock will be used to notify other developers that some file is being edited by someone. The first basic version could be just for "models", i.e., not aware of specific agent of artefact instances. Indeed, jacamo-web still has limitation about editing agents in which the .asl has a name different from name_of_agent.asl.

The endpoints must have the filename of the referred file, like these:
/lock/{filename}
/unlock/{filename}

format:
const lock = {
file1: ['user1', 'user2'],
file1: ['user3', 'user4']
}

Create a set of Rest methods for listing JCM files, launch, create/update project files

Create methods for listing projects (JCMs), create (using POST?), updating (also using POST or do PUT?) and delete. Create a specific RestImp class to put these methods?

There is a fork which is showing that it is possible to launch a system while jacamo is running, but it is necessary to remove all artifacts (see getProjectsJSON and getProjectJSON - actually, this last one should be named just getProject)
https://github.com/cleberjamaral/jacamo-web/blob/master/src/java/jacamo/web/RestImpl.java

Create a 'learning JaCaMo' mode where we can easily launch JaCaMo examples

jacamo-web could be launched by default in a 'learning mode' which provides an easy way to launch examples of programming regarding MultiAgents Oriented Programming and logic paradigm used by Jason.

It will also be a good way to find issues about the interface in the way it shows easily how to program JaCaMo, how to get feedbacks, debugging and so on.

Save and Reload agent is not taking new rules

When edited an asl file and then saved and reloaded, the new rules are not being added at runtime. This behaviour is expected for initial beliefs and initial plans, but for rules it sounds incorrect.

Create "clone agent" function

In case of an agent which is sharing the aslfile with others, it is necessary a function to allow to edit a unique agent, in this case, "cloning" the source file and pointing the agent that is being edited to this new file.

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.