jvcli 2.0.8__py3-none-any.whl → 2.0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jvcli/__init__.py +1 -1
- jvcli/client/app.py +0 -2
- jvcli/templates/2.0.0/project/README.md +3 -3
- jvcli/templates/2.0.0/project/sh/exportenv.sh +12 -0
- jvcli/templates/2.0.0/project/sh/importagent.sh +36 -0
- jvcli/templates/2.0.0/project/sh/initagents.sh +34 -0
- jvcli/templates/2.0.0/project/sh/inituser.sh +50 -0
- jvcli/templates/2.0.0/project/sh/serve.sh +2 -2
- jvcli/templates/2.0.0/project/sh/startclient.sh +7 -0
- {jvcli-2.0.8.dist-info → jvcli-2.0.9.dist-info}/METADATA +1 -1
- {jvcli-2.0.8.dist-info → jvcli-2.0.9.dist-info}/RECORD +15 -12
- jvcli/templates/2.0.0/project/sh/import_agent.sh +0 -66
- jvcli/templates/2.0.0/project/sh/init.sh +0 -70
- {jvcli-2.0.8.dist-info → jvcli-2.0.9.dist-info}/LICENSE +0 -0
- {jvcli-2.0.8.dist-info → jvcli-2.0.9.dist-info}/WHEEL +0 -0
- {jvcli-2.0.8.dist-info → jvcli-2.0.9.dist-info}/entry_points.txt +0 -0
- {jvcli-2.0.8.dist-info → jvcli-2.0.9.dist-info}/top_level.txt +0 -0
jvcli/__init__.py
CHANGED
jvcli/client/app.py
CHANGED
@@ -26,8 +26,6 @@ def login_form() -> None:
|
|
26
26
|
"""Render the login form and handle login logic."""
|
27
27
|
login_url = f"{JIVAS_URL}/user/login"
|
28
28
|
|
29
|
-
st.write(os.environ.get("JIVAS_ENVIRONMENT"))
|
30
|
-
|
31
29
|
if os.environ.get("JIVAS_ENVIRONMENT") == "development":
|
32
30
|
email = os.environ.get("JIVAS_USER", "admin@jivas.com")
|
33
31
|
password = os.environ.get("JIVAS_PASSWORD", "password")
|
@@ -15,7 +15,7 @@ sh sh/serve.sh
|
|
15
15
|
To set up a demo agent, run the following command in another terminal:
|
16
16
|
|
17
17
|
```sh
|
18
|
-
sh sh/
|
18
|
+
sh sh/importagent.sh
|
19
19
|
```
|
20
20
|
|
21
21
|
This will initialize JIVAS, download, and install a demo agent.
|
@@ -25,7 +25,7 @@ This will initialize JIVAS, download, and install a demo agent.
|
|
25
25
|
Once the setup is complete, run the following command in its own terminal to access the JIVAS manager for configuring and chatting with your agent:
|
26
26
|
|
27
27
|
```sh
|
28
|
-
|
28
|
+
sh sh/startclient.sh
|
29
29
|
```
|
30
30
|
|
31
31
|
## Reflecting Changes to Agent Actions
|
@@ -33,7 +33,7 @@ jvcli client launch
|
|
33
33
|
If you make any changes to the agent actions, run the following command to reinitialize all agents running within this JIVAS app:
|
34
34
|
|
35
35
|
```sh
|
36
|
-
sh sh/
|
36
|
+
sh sh/initagents.sh
|
37
37
|
```
|
38
38
|
|
39
39
|
## Logging In
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Script to create jivas user, login, and initialize jivas graph
|
3
|
+
|
4
|
+
# Export env vars
|
5
|
+
source sh/exportenv.sh
|
6
|
+
|
7
|
+
# Init the user token
|
8
|
+
source sh/inituser.sh
|
9
|
+
|
10
|
+
# Check if JIVAS_TOKEN is set
|
11
|
+
if [ -n "$JIVAS_TOKEN" ]; then
|
12
|
+
|
13
|
+
echo -e "\n\nImporting demo agent...\n"
|
14
|
+
# Import the agent
|
15
|
+
AGENT_ID=$(curl --silent --show-error --no-progress-meter \
|
16
|
+
--request POST \
|
17
|
+
--header 'Content-Type: application/json' \
|
18
|
+
--header 'Accept: application/json' \
|
19
|
+
--header "Authorization: Bearer $JIVAS_TOKEN" \
|
20
|
+
--data '{"daf_name": "jivas/eldon_ai"}' \
|
21
|
+
"http://localhost:$JIVAS_PORT/walker/import_agent" | grep -o '"id":"[^"]*' | sed 's/"id":"//')
|
22
|
+
|
23
|
+
if [ -z "$AGENT_ID" ]; then
|
24
|
+
echo "Failed to import agent. Exiting..."
|
25
|
+
exit 1
|
26
|
+
fi
|
27
|
+
|
28
|
+
echo -e "Agent ID: $AGENT_ID\n"
|
29
|
+
else
|
30
|
+
echo "Failed to initialize user token. Exiting..."
|
31
|
+
exit 1
|
32
|
+
fi
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Script to authenticate and initialize jivas agents
|
3
|
+
|
4
|
+
# Export env vars
|
5
|
+
source sh/exportenv.sh
|
6
|
+
|
7
|
+
# Init the user token
|
8
|
+
source sh/inituser.sh
|
9
|
+
|
10
|
+
# Check if JIVAS_TOKEN is set
|
11
|
+
if [ -n "$JIVAS_TOKEN" ]; then
|
12
|
+
|
13
|
+
echo -e "\n\Initializing agents...\n"
|
14
|
+
|
15
|
+
# Initialize agents and capture the response
|
16
|
+
response=$(curl --silent --show-error --no-progress-meter \
|
17
|
+
--request POST \
|
18
|
+
-H 'accept: application/json' \
|
19
|
+
-H 'Content-Type: application/json' \
|
20
|
+
-H "Authorization: Bearer $JIVAS_TOKEN" \
|
21
|
+
--data '{"reporting":"true"}' \
|
22
|
+
"http://localhost:$JIVAS_PORT/walker/init_agents")
|
23
|
+
|
24
|
+
# Parse the response to extract the list of "id"s without using jq
|
25
|
+
ids=$(echo "$response" | grep -o '"id":"[^"]*"' | sed -e 's/"id":"//g' -e 's/"//g')
|
26
|
+
|
27
|
+
# Output the list of "id"s
|
28
|
+
echo "Initialized Agents:"
|
29
|
+
echo "$ids \n"
|
30
|
+
|
31
|
+
else
|
32
|
+
echo "Failed to initialize user token. Exiting..."
|
33
|
+
exit 1
|
34
|
+
fi
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# Script to init jivas user and grab token
|
3
|
+
|
4
|
+
# Check if required environment variables are set
|
5
|
+
if [ -z "$JIVAS_PORT" ] || [ -z "$JIVAS_PASSWORD" ] || [ -z "$JIVAS_USER" ]; then
|
6
|
+
echo "Required environment variables (JIVAS_PORT, JIVAS_PASSWORD, JIVAS_USER) are not set. Exiting..."
|
7
|
+
exit 1
|
8
|
+
fi
|
9
|
+
|
10
|
+
if lsof -i :$JIVAS_PORT >/dev/null; then
|
11
|
+
|
12
|
+
# Try to login first
|
13
|
+
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
14
|
+
--request POST \
|
15
|
+
--header 'Content-Type: application/json' \
|
16
|
+
--header 'Accept: application/json' \
|
17
|
+
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
18
|
+
"http://localhost:$JIVAS_PORT/user/login" | grep -o '"token":"[^"]*' | sed 's/"token":"//')
|
19
|
+
|
20
|
+
# Check if login was successful
|
21
|
+
if [ -z "$JIVAS_TOKEN" ] || [ "$JIVAS_TOKEN" == "null" ]; then
|
22
|
+
echo "Login failed. Registering user..."
|
23
|
+
|
24
|
+
# Register user if login failed
|
25
|
+
curl --silent --show-error --no-progress-meter \
|
26
|
+
--request POST \
|
27
|
+
--header 'Content-Type: application/json' \
|
28
|
+
--header 'Accept: application/json' \
|
29
|
+
--data '{
|
30
|
+
"password": "'"$JIVAS_PASSWORD"'",
|
31
|
+
"email": "'"$JIVAS_USER"'"
|
32
|
+
}' \
|
33
|
+
"http://localhost:$JIVAS_PORT/user/register"
|
34
|
+
|
35
|
+
# Attempt to login again after registration
|
36
|
+
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
37
|
+
--request POST \
|
38
|
+
--header 'Content-Type: application/json' \
|
39
|
+
--header 'Accept: application/json' \
|
40
|
+
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
41
|
+
"http://localhost:$JIVAS_PORT/user/login" | grep -oP '(?<="token":")[^"]*')
|
42
|
+
fi
|
43
|
+
|
44
|
+
# Print token
|
45
|
+
echo "\n JIVAS token: $JIVAS_TOKEN"
|
46
|
+
|
47
|
+
else
|
48
|
+
echo "Server is not running on port $JIVAS_PORT. Exiting..."
|
49
|
+
exit 1
|
50
|
+
fi
|
@@ -1,10 +1,10 @@
|
|
1
|
-
jvcli/__init__.py,sha256=
|
1
|
+
jvcli/__init__.py,sha256=HeFeEm0rZYsskrT6bwn8VkX3J-OUrBUbWtBz1JKUgww,170
|
2
2
|
jvcli/api.py,sha256=yehboQFyoy6hMhBXBnyK4B3nd2bThLUoUQ2G2PrPl6I,11476
|
3
3
|
jvcli/auth.py,sha256=p04T02ufqbENx_93oDPg3xsq7sv-Nabeq3YR1kLXfSg,1215
|
4
4
|
jvcli/cli.py,sha256=VM_QGPiYfSdqOZ4n0YLZbrOwXm0d5lHmzv47MqTyBMc,1060
|
5
5
|
jvcli/utils.py,sha256=NKWjjJ45NFlwT7QVMh1YMY2zfvGaJ_8LppG4D8QXCwA,7726
|
6
6
|
jvcli/client/__init__.py,sha256=WGP05OBzZHReqENYs1qYqMnYvgAaNVW6KvGQvyB3NGs,85
|
7
|
-
jvcli/client/app.py,sha256=
|
7
|
+
jvcli/client/app.py,sha256=2LGSY2R9GXXRNUu34wb_-i9hLOWbP34YbzgTEnBX-g8,6087
|
8
8
|
jvcli/client/lib/__init__.py,sha256=_Wv8CNIxeIle_x0U9T6w9s5mPuOY9-0u69BvTEPXLUw,38
|
9
9
|
jvcli/client/lib/page.py,sha256=QF53ffO4A2P9QTdPFfi0baCpKyEMmfkLyhJNxm7pTb0,2225
|
10
10
|
jvcli/client/lib/utils.py,sha256=QwG5Ev_8Xd5f5j1DsIR2by4EhOMJ9Yi-UIMezGolU5g,9823
|
@@ -37,19 +37,22 @@ jvcli/templates/2.0.0/agent_descriptor.yaml,sha256=h6_pxmaP-oJqLDCHAyZ1ckETfWD6D
|
|
37
37
|
jvcli/templates/2.0.0/agent_info.yaml,sha256=3olXRQDQG-543o7zSWWT23kJsK29QGhdx6-tOLXvCk8,207
|
38
38
|
jvcli/templates/2.0.0/agent_knowledge.yaml,sha256=hI0ifr0ICiZGce-oUFovBOmDWxGU1Z2M10WyZH_wS2g,284
|
39
39
|
jvcli/templates/2.0.0/agent_memory.yaml,sha256=_MBgObZcW1UzwWuYQVJiPZ_7TvYbGrDgd-xMuzJEkVo,9
|
40
|
-
jvcli/templates/2.0.0/project/README.md,sha256=
|
40
|
+
jvcli/templates/2.0.0/project/README.md,sha256=HV0vVTsE9ELdfdqSpy6Xrn222u9z00rMNVsNPVTMSeA,956
|
41
41
|
jvcli/templates/2.0.0/project/env.example,sha256=aB3Wp-0fJV1o9WlFLjxjdA5fKMg2zBV-y8-nBm9Q-bk,396
|
42
42
|
jvcli/templates/2.0.0/project/globals.jac,sha256=CEt7L25wEZfE6TupqpM1ilHbtJMQQWExDQ5GJlkHPts,56
|
43
43
|
jvcli/templates/2.0.0/project/main.jac,sha256=r37jsaGq-85YvDbHP3bQvBXk0u8w0rtRTZTNxZOjTW0,48
|
44
44
|
jvcli/templates/2.0.0/project/actions/README.md,sha256=TU1t-rOBH5WQP_HUWaEBLq5BbPv4jejtjIrwTW4hZwM,1742
|
45
45
|
jvcli/templates/2.0.0/project/daf/README.md,sha256=M2_BLO6vFlsnUbYHPQMIrcoboe91MO9H9RR8yP9-tF8,1683
|
46
|
-
jvcli/templates/2.0.0/project/sh/
|
47
|
-
jvcli/templates/2.0.0/project/sh/
|
48
|
-
jvcli/templates/2.0.0/project/sh/
|
46
|
+
jvcli/templates/2.0.0/project/sh/exportenv.sh,sha256=UXH0DkHJnVz75YvAU8tw9bqfa2atniUITd7f_3FDBfk,160
|
47
|
+
jvcli/templates/2.0.0/project/sh/importagent.sh,sha256=plls5CY2TUcab7OVxZDPOIYO0vF4bn-yUIjPY1YL_GQ,886
|
48
|
+
jvcli/templates/2.0.0/project/sh/initagents.sh,sha256=WmMshuxLw_dXnm23uhTZjr6Eyc9pAbktlo2R_0tXK6M,923
|
49
|
+
jvcli/templates/2.0.0/project/sh/inituser.sh,sha256=TUg-NqWV3F6o-5nX0fn2L4xcVOn-vbDD-NIRFThAS1U,1828
|
50
|
+
jvcli/templates/2.0.0/project/sh/serve.sh,sha256=S64Pmza1Zh5uf6bDA7aXS282AQsN3jJW4RAyfi7NCrU,103
|
51
|
+
jvcli/templates/2.0.0/project/sh/startclient.sh,sha256=w_oW5DZ9NHRD4HR16lVQsvq8HPtiRNUKFuG2nUrKWlQ,117
|
49
52
|
jvcli/templates/2.0.0/project/tests/README.md,sha256=-1ZXkxuUKa6tMw_jlF3rpCvUFq8ijW2L-nSuAkbCANo,917
|
50
|
-
jvcli-2.0.
|
51
|
-
jvcli-2.0.
|
52
|
-
jvcli-2.0.
|
53
|
-
jvcli-2.0.
|
54
|
-
jvcli-2.0.
|
55
|
-
jvcli-2.0.
|
53
|
+
jvcli-2.0.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
54
|
+
jvcli-2.0.9.dist-info/METADATA,sha256=eQCVbFhqZS_xsGdpMz7El9flmwAohpOyPmRUQHvhc3E,4179
|
55
|
+
jvcli-2.0.9.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
56
|
+
jvcli-2.0.9.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
|
57
|
+
jvcli-2.0.9.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
|
58
|
+
jvcli-2.0.9.dist-info/RECORD,,
|
@@ -1,66 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# Script to create jivas user, login, and initialize jivas graph
|
3
|
-
|
4
|
-
function initialize() {
|
5
|
-
|
6
|
-
if lsof -i :$JIVAS_PORT >/dev/null; then
|
7
|
-
# Try to login first
|
8
|
-
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
9
|
-
--request POST \
|
10
|
-
--header 'Content-Type: application/json' \
|
11
|
-
--header 'Accept: application/json' \
|
12
|
-
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
13
|
-
"http://localhost:$JIVAS_PORT/user/login" | grep -o '"token":"[^"]*' | sed 's/"token":"//')
|
14
|
-
|
15
|
-
echo $JIVAS_TOKEN
|
16
|
-
|
17
|
-
# Check if login was successful
|
18
|
-
if [ -z "$JIVAS_TOKEN" ] || [ "$JIVAS_TOKEN" == "null" ]; then
|
19
|
-
echo "Login failed. Registering user..."
|
20
|
-
|
21
|
-
# Register user if login failed
|
22
|
-
curl --silent --show-error --no-progress-meter \
|
23
|
-
--request POST \
|
24
|
-
--header 'Content-Type: application/json' \
|
25
|
-
--header 'Accept: application/json' \
|
26
|
-
--data '{
|
27
|
-
"password": "'"$JIVAS_PASSWORD"'",
|
28
|
-
"email": "'"$JIVAS_USER"'"
|
29
|
-
}' \
|
30
|
-
"http://localhost:$JIVAS_PORT/user/register"
|
31
|
-
|
32
|
-
# Attempt to login again after registration
|
33
|
-
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
34
|
-
--request POST \
|
35
|
-
--header 'Content-Type: application/json' \
|
36
|
-
--header 'Accept: application/json' \
|
37
|
-
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
38
|
-
"http://localhost:$JIVAS_PORT/user/login" | grep -oP '(?<="token":")[^"]*')
|
39
|
-
fi
|
40
|
-
|
41
|
-
# Print token
|
42
|
-
echo "Jivas token: $JIVAS_TOKEN"
|
43
|
-
|
44
|
-
echo -e "\n\nImporting demo agent...\n"
|
45
|
-
# Import the agent
|
46
|
-
AGENT_ID=$(curl --silent --show-error --no-progress-meter \
|
47
|
-
--request POST \
|
48
|
-
--header 'Content-Type: application/json' \
|
49
|
-
--header 'Accept: application/json' \
|
50
|
-
--header "Authorization: Bearer $JIVAS_TOKEN" \
|
51
|
-
--data '{"daf_name": "jivas/eldon_ai"}' \
|
52
|
-
"http://localhost:$JIVAS_PORT/walker/import_agent" | grep -o '"id":"[^"]*' | sed 's/"id":"//')
|
53
|
-
|
54
|
-
echo "$AGENT_ID\n"
|
55
|
-
else
|
56
|
-
echo "Server is not running on port $JIVAS_PORT. Waiting..."
|
57
|
-
fi
|
58
|
-
|
59
|
-
exit
|
60
|
-
}
|
61
|
-
|
62
|
-
# Main loop to check if a process is running on port $JIVAS_PORT
|
63
|
-
while true; do
|
64
|
-
initialize
|
65
|
-
sleep 2 # Wait for 2 seconds before checking again
|
66
|
-
done
|
@@ -1,70 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# Script to create jivas user, login, and initialize jivas graph
|
3
|
-
|
4
|
-
function initialize() {
|
5
|
-
|
6
|
-
if lsof -i :$JIVAS_PORT >/dev/null; then
|
7
|
-
|
8
|
-
# Try to login first
|
9
|
-
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
10
|
-
--request POST \
|
11
|
-
--header 'Content-Type: application/json' \
|
12
|
-
--header 'Accept: application/json' \
|
13
|
-
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
14
|
-
"http://localhost:$JIVAS_PORT/user/login" | grep -o '"token":"[^"]*' | sed 's/"token":"//')
|
15
|
-
|
16
|
-
echo $JIVAS_TOKEN
|
17
|
-
|
18
|
-
# Check if login was successful
|
19
|
-
if [ -z "$JIVAS_TOKEN" ] || [ "$JIVAS_TOKEN" == "null" ]; then
|
20
|
-
echo "Login failed. Registering user..."
|
21
|
-
|
22
|
-
# Register user if login failed
|
23
|
-
curl --silent --show-error --no-progress-meter \
|
24
|
-
--request POST \
|
25
|
-
--header 'Content-Type: application/json' \
|
26
|
-
--header 'Accept: application/json' \
|
27
|
-
--data '{
|
28
|
-
"password": "'"$JIVAS_PASSWORD"'",
|
29
|
-
"email": "'"$JIVAS_USER"'"
|
30
|
-
}' \
|
31
|
-
"http://localhost:$JIVAS_PORT/user/register"
|
32
|
-
|
33
|
-
# Attempt to login again after registration
|
34
|
-
JIVAS_TOKEN=$(curl --silent --show-error --no-progress-meter \
|
35
|
-
--request POST \
|
36
|
-
--header 'Content-Type: application/json' \
|
37
|
-
--header 'Accept: application/json' \
|
38
|
-
--data '{"password": "'"$JIVAS_PASSWORD"'","email": "'"$JIVAS_USER"'"}' \
|
39
|
-
"http://localhost:$JIVAS_PORT/user/login" | grep -o '"token":"[^"]*' | sed 's/"token":"//')
|
40
|
-
fi
|
41
|
-
|
42
|
-
|
43
|
-
# Print token
|
44
|
-
echo "Jivas token: $JIVAS_TOKEN"
|
45
|
-
|
46
|
-
echo "Initializing jivas graph..."
|
47
|
-
|
48
|
-
# Initialize agents
|
49
|
-
curl --silent --show-error --no-progress-meter \
|
50
|
-
--request POST \
|
51
|
-
-H 'accept: application/json' \
|
52
|
-
-H 'Content-Type: application/json' \
|
53
|
-
-H "Authorization: Bearer $JIVAS_TOKEN" \
|
54
|
-
--data '{}' \
|
55
|
-
"http://localhost:$JIVAS_PORT/walker/init_agents"
|
56
|
-
|
57
|
-
exit
|
58
|
-
|
59
|
-
else
|
60
|
-
echo "Server is not running on port $JIVAS_PORT. Waiting..."
|
61
|
-
fi
|
62
|
-
|
63
|
-
exit
|
64
|
-
}
|
65
|
-
|
66
|
-
# Main loop to check if a process is running on port $JIVAS_PORT
|
67
|
-
while true; do
|
68
|
-
initialize
|
69
|
-
sleep 2 # Wait for 2 seconds before checking again
|
70
|
-
done
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|