jvcli 2.0.30__tar.gz → 2.1.1__tar.gz
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-2.1.1/MANIFEST.in +1 -0
- jvcli-2.0.30/README.md → jvcli-2.1.1/PKG-INFO +40 -41
- jvcli-2.0.30/PKG-INFO → jvcli-2.1.1/README.md +3 -79
- jvcli-2.1.1/jvcli/__init__.py +10 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/cli.py +2 -6
- jvcli-2.1.1/jvcli/commands/client.py +26 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/create.py +91 -86
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/server.py +0 -6
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/startproject.py +1 -1
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1}/project/README.md +4 -40
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1}/project/actions/README.md +1 -1
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1}/project/daf/README.md +1 -1
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1}/project/env.example +7 -4
- jvcli-2.1.1/jvcli/templates/2.1.1/project/main.jac +2 -0
- jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles/action_app.py +23 -0
- jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles/action_archetype.jac +49 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles}/action_info.yaml +1 -1
- jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles/action_lib.jac +3 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles}/agent_descriptor.yaml +4 -4
- jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles/interact_action_archetype.jac +58 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/utils.py +1 -1
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli.egg-info/PKG-INFO +8 -47
- jvcli-2.1.1/jvcli.egg-info/SOURCES.txt +56 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli.egg-info/requires.txt +4 -5
- {jvcli-2.0.30 → jvcli-2.1.1}/setup.py +11 -12
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_cli.py +1 -1
- jvcli-2.1.1/tests/test_client.py +46 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_create.py +30 -9
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_server.py +10 -6
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_startproject.py +7 -3
- jvcli-2.0.30/MANIFEST.in +0 -3
- jvcli-2.0.30/jvcli/__init__.py +0 -8
- jvcli-2.0.30/jvcli/client/__init__.py +0 -1
- jvcli-2.0.30/jvcli/client/app.py +0 -188
- jvcli-2.0.30/jvcli/client/lib/__init__.py +0 -1
- jvcli-2.0.30/jvcli/client/lib/page.py +0 -68
- jvcli-2.0.30/jvcli/client/lib/utils.py +0 -312
- jvcli-2.0.30/jvcli/client/lib/widgets.py +0 -291
- jvcli-2.0.30/jvcli/client/pages/__init__.py +0 -1
- jvcli-2.0.30/jvcli/client/pages/action_dashboard_page.py +0 -120
- jvcli-2.0.30/jvcli/client/pages/analytics_page.py +0 -245
- jvcli-2.0.30/jvcli/client/pages/chat_page.py +0 -150
- jvcli-2.0.30/jvcli/client/pages/graph_page.py +0 -20
- jvcli-2.0.30/jvcli/commands/clean.py +0 -29
- jvcli-2.0.30/jvcli/commands/client.py +0 -50
- jvcli-2.0.30/jvcli/commands/studio.py +0 -258
- jvcli-2.0.30/jvcli/studio/assets/index-DDV79SDu.js +0 -213
- jvcli-2.0.30/jvcli/studio/assets/index-DdMMONxd.css +0 -1
- jvcli-2.0.30/jvcli/studio/index.html +0 -15
- jvcli-2.0.30/jvcli/studio/jac_logo.png +0 -0
- jvcli-2.0.30/jvcli/studio/tauri.svg +0 -6
- jvcli-2.0.30/jvcli/studio/vite.svg +0 -1
- jvcli-2.0.30/jvcli/studio-auth/assets/index-Bh6lyeXA.js +0 -218
- jvcli-2.0.30/jvcli/studio-auth/assets/index-DdMMONxd.css +0 -1
- jvcli-2.0.30/jvcli/studio-auth/index.html +0 -15
- jvcli-2.0.30/jvcli/studio-auth/jac_logo.png +0 -0
- jvcli-2.0.30/jvcli/studio-auth/tauri.svg +0 -6
- jvcli-2.0.30/jvcli/studio-auth/vite.svg +0 -1
- jvcli-2.0.30/jvcli/templates/2.0.0/project/main.jac +0 -2
- jvcli-2.0.30/jvcli.egg-info/SOURCES.txt +0 -79
- jvcli-2.0.30/tests/test_clean.py +0 -65
- jvcli-2.0.30/tests/test_render_basic.py +0 -23
- jvcli-2.0.30/tests/test_studio.py +0 -475
- {jvcli-2.0.30 → jvcli-2.1.1}/LICENSE +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/api.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/auth.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/__init__.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/auth.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/download.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/info.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/publish.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli/commands/update.py +0 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1}/project/gitignore.example +0 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1}/project/globals.jac +0 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1}/project/tests/README.md +0 -0
- {jvcli-2.0.30/jvcli/templates → jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles}/CHANGELOG.md +0 -0
- {jvcli-2.0.30/jvcli/templates → jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles}/README.md +0 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles}/agent_info.yaml +0 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles}/agent_knowledge.yaml +0 -0
- {jvcli-2.0.30/jvcli/templates/2.0.0 → jvcli-2.1.1/jvcli/templates/2.1.1/sourcefiles}/agent_memory.yaml +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli.egg-info/dependency_links.txt +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli.egg-info/entry_points.txt +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/jvcli.egg-info/top_level.txt +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/setup.cfg +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_api.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_auth.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_download.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_info.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_publish.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_update.py +0 -0
- {jvcli-2.0.30 → jvcli-2.1.1}/tests/test_utils.py +0 -0
jvcli-2.1.1/MANIFEST.in
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
recursive-include jvcli/templates/ *
|
@@ -1,3 +1,40 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: jvcli
|
3
|
+
Version: 2.1.1
|
4
|
+
Summary: CLI tool for Jivas Package Repository
|
5
|
+
Home-page: https://github.com/TrueSelph/jvcli
|
6
|
+
Author: TrueSelph Inc.
|
7
|
+
Author-email: admin@trueselph.com
|
8
|
+
Requires-Python: >=3.12
|
9
|
+
Description-Content-Type: text/markdown
|
10
|
+
License-File: LICENSE
|
11
|
+
Requires-Dist: click>=8.1.8
|
12
|
+
Requires-Dist: requests>=2.32.3
|
13
|
+
Requires-Dist: packaging>=24.2
|
14
|
+
Requires-Dist: pyaml>=25.1.0
|
15
|
+
Requires-Dist: python-dotenv>=1.0.0
|
16
|
+
Requires-Dist: semver>=3.0.4
|
17
|
+
Requires-Dist: node-semver>=0.9.0
|
18
|
+
Requires-Dist: jaclang
|
19
|
+
Requires-Dist: pymongo
|
20
|
+
Requires-Dist: uvicorn
|
21
|
+
Requires-Dist: fastapi
|
22
|
+
Provides-Extra: dev
|
23
|
+
Requires-Dist: pre-commit; extra == "dev"
|
24
|
+
Requires-Dist: pytest; extra == "dev"
|
25
|
+
Requires-Dist: pytest-mock; extra == "dev"
|
26
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
27
|
+
Dynamic: author
|
28
|
+
Dynamic: author-email
|
29
|
+
Dynamic: description
|
30
|
+
Dynamic: description-content-type
|
31
|
+
Dynamic: home-page
|
32
|
+
Dynamic: license-file
|
33
|
+
Dynamic: provides-extra
|
34
|
+
Dynamic: requires-dist
|
35
|
+
Dynamic: requires-python
|
36
|
+
Dynamic: summary
|
37
|
+
|
1
38
|
# JIVAS Command Line Interface (JVCLI)
|
2
39
|
|
3
40
|

|
@@ -114,17 +151,6 @@ This command creates a directory structure with:
|
|
114
151
|
- Main JAC file for your JIVAS application
|
115
152
|
- Configuration files and shell scripts for easy management
|
116
153
|
|
117
|
-
#### `jvcli clean`
|
118
|
-
|
119
|
-
Clean the Jac files in the current directory and subdirectories by removing compiled artifacts and temporary files.
|
120
|
-
|
121
|
-
```sh
|
122
|
-
# Clean the current directory
|
123
|
-
jvcli clean
|
124
|
-
```
|
125
|
-
|
126
|
-
This command executes `jac clean` under the hood and ensures your project is in a clean state before rebuilding or deploying.
|
127
|
-
|
128
154
|
### Create Commands
|
129
155
|
|
130
156
|
Create commands help you generate new resources like actions, agents, and namespaces with the proper structure and configuration.
|
@@ -485,8 +511,7 @@ jvcli server initagents
|
|
485
511
|
This command:
|
486
512
|
1. Checks if the server is running
|
487
513
|
2. Logs in to the server
|
488
|
-
3.
|
489
|
-
4. Sends a request to the server to reinitialize all agents
|
514
|
+
3. Sends a request to the server to reinitialize all agents
|
490
515
|
|
491
516
|
#### `jvcli server importagent`
|
492
517
|
|
@@ -510,31 +535,6 @@ This command:
|
|
510
535
|
3. Sends a request to import the specified agent
|
511
536
|
4. Displays the agent ID upon successful import
|
512
537
|
|
513
|
-
### Studio Commands
|
514
|
-
|
515
|
-
Studio commands help you manage the Jivas Studio, a web-based development environment for Jivas.
|
516
|
-
|
517
|
-
#### `jvcli studio launch`
|
518
|
-
|
519
|
-
Launch the Jivas Studio on a specified port. Jivas Studio provides a visual interface for building and managing agents.
|
520
|
-
|
521
|
-
```sh
|
522
|
-
# Launch with default settings
|
523
|
-
jvcli studio launch
|
524
|
-
|
525
|
-
# Launch on a custom port
|
526
|
-
jvcli studio launch --port 9000
|
527
|
-
|
528
|
-
# Launch with authentication required
|
529
|
-
jvcli studio launch --require-auth
|
530
|
-
```
|
531
|
-
|
532
|
-
Options:
|
533
|
-
- `--port`: Port for the studio to launch on (default: 8989)
|
534
|
-
- `--require-auth`: Require authentication for studio API access (default: false)
|
535
|
-
|
536
|
-
When launched, the Studio will be accessible via a web browser at `http://localhost:<port>`.
|
537
|
-
|
538
538
|
### Client Commands
|
539
539
|
|
540
540
|
Client commands help you manage the Jivas Client, which provides a user interface for interacting with agents.
|
@@ -552,15 +552,14 @@ jvcli client launch --port 9001
|
|
552
552
|
|
553
553
|
# Launch with custom server URLs
|
554
554
|
jvcli client launch \
|
555
|
-
--jivas_url http://my-server:8000
|
556
|
-
--studio_url http://my-studio:8989
|
557
|
-
```
|
555
|
+
--jivas_url http://my-server:8000
|
558
556
|
|
559
557
|
Options:
|
560
558
|
- `--port`: Port for the client to launch on (default: 8501)
|
561
559
|
- `--jivas_url`: URL for the Jivas API (default: http://localhost:8000 or JIVAS_BASE_URL env var)
|
562
560
|
- `--studio_url`: URL for the Jivas Studio (default: http://localhost:8989 or JIVAS_STUDIO_URL env var)
|
563
561
|
|
562
|
+
|
564
563
|
When launched, the Client will be accessible via a web browser at `http://localhost:<port>`.
|
565
564
|
|
566
565
|
## 🔰 Contributing
|
@@ -1,41 +1,3 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: jvcli
|
3
|
-
Version: 2.0.30
|
4
|
-
Summary: CLI tool for Jivas Package Repository
|
5
|
-
Home-page: https://github.com/TrueSelph/jvcli
|
6
|
-
Author: TrueSelph Inc.
|
7
|
-
Author-email: admin@trueselph.com
|
8
|
-
Requires-Python: >=3.12
|
9
|
-
Description-Content-Type: text/markdown
|
10
|
-
License-File: LICENSE
|
11
|
-
Requires-Dist: click>=8.1.8
|
12
|
-
Requires-Dist: requests>=2.32.3
|
13
|
-
Requires-Dist: packaging>=24.2
|
14
|
-
Requires-Dist: pyaml>=25.1.0
|
15
|
-
Requires-Dist: jac-cloud==0.1.20
|
16
|
-
Requires-Dist: streamlit>=1.42.0
|
17
|
-
Requires-Dist: streamlit-elements>=0.1.0
|
18
|
-
Requires-Dist: streamlit-router>=0.1.8
|
19
|
-
Requires-Dist: streamlit-javascript>=0.1.5
|
20
|
-
Requires-Dist: python-dotenv>=1.0.0
|
21
|
-
Requires-Dist: semver>=3.0.4
|
22
|
-
Requires-Dist: node-semver>=0.9.0
|
23
|
-
Provides-Extra: dev
|
24
|
-
Requires-Dist: pre-commit; extra == "dev"
|
25
|
-
Requires-Dist: pytest; extra == "dev"
|
26
|
-
Requires-Dist: pytest-mock; extra == "dev"
|
27
|
-
Requires-Dist: pytest-cov; extra == "dev"
|
28
|
-
Dynamic: author
|
29
|
-
Dynamic: author-email
|
30
|
-
Dynamic: description
|
31
|
-
Dynamic: description-content-type
|
32
|
-
Dynamic: home-page
|
33
|
-
Dynamic: license-file
|
34
|
-
Dynamic: provides-extra
|
35
|
-
Dynamic: requires-dist
|
36
|
-
Dynamic: requires-python
|
37
|
-
Dynamic: summary
|
38
|
-
|
39
1
|
# JIVAS Command Line Interface (JVCLI)
|
40
2
|
|
41
3
|

|
@@ -152,17 +114,6 @@ This command creates a directory structure with:
|
|
152
114
|
- Main JAC file for your JIVAS application
|
153
115
|
- Configuration files and shell scripts for easy management
|
154
116
|
|
155
|
-
#### `jvcli clean`
|
156
|
-
|
157
|
-
Clean the Jac files in the current directory and subdirectories by removing compiled artifacts and temporary files.
|
158
|
-
|
159
|
-
```sh
|
160
|
-
# Clean the current directory
|
161
|
-
jvcli clean
|
162
|
-
```
|
163
|
-
|
164
|
-
This command executes `jac clean` under the hood and ensures your project is in a clean state before rebuilding or deploying.
|
165
|
-
|
166
117
|
### Create Commands
|
167
118
|
|
168
119
|
Create commands help you generate new resources like actions, agents, and namespaces with the proper structure and configuration.
|
@@ -523,8 +474,7 @@ jvcli server initagents
|
|
523
474
|
This command:
|
524
475
|
1. Checks if the server is running
|
525
476
|
2. Logs in to the server
|
526
|
-
3.
|
527
|
-
4. Sends a request to the server to reinitialize all agents
|
477
|
+
3. Sends a request to the server to reinitialize all agents
|
528
478
|
|
529
479
|
#### `jvcli server importagent`
|
530
480
|
|
@@ -548,31 +498,6 @@ This command:
|
|
548
498
|
3. Sends a request to import the specified agent
|
549
499
|
4. Displays the agent ID upon successful import
|
550
500
|
|
551
|
-
### Studio Commands
|
552
|
-
|
553
|
-
Studio commands help you manage the Jivas Studio, a web-based development environment for Jivas.
|
554
|
-
|
555
|
-
#### `jvcli studio launch`
|
556
|
-
|
557
|
-
Launch the Jivas Studio on a specified port. Jivas Studio provides a visual interface for building and managing agents.
|
558
|
-
|
559
|
-
```sh
|
560
|
-
# Launch with default settings
|
561
|
-
jvcli studio launch
|
562
|
-
|
563
|
-
# Launch on a custom port
|
564
|
-
jvcli studio launch --port 9000
|
565
|
-
|
566
|
-
# Launch with authentication required
|
567
|
-
jvcli studio launch --require-auth
|
568
|
-
```
|
569
|
-
|
570
|
-
Options:
|
571
|
-
- `--port`: Port for the studio to launch on (default: 8989)
|
572
|
-
- `--require-auth`: Require authentication for studio API access (default: false)
|
573
|
-
|
574
|
-
When launched, the Studio will be accessible via a web browser at `http://localhost:<port>`.
|
575
|
-
|
576
501
|
### Client Commands
|
577
502
|
|
578
503
|
Client commands help you manage the Jivas Client, which provides a user interface for interacting with agents.
|
@@ -590,15 +515,14 @@ jvcli client launch --port 9001
|
|
590
515
|
|
591
516
|
# Launch with custom server URLs
|
592
517
|
jvcli client launch \
|
593
|
-
--jivas_url http://my-server:8000
|
594
|
-
--studio_url http://my-studio:8989
|
595
|
-
```
|
518
|
+
--jivas_url http://my-server:8000
|
596
519
|
|
597
520
|
Options:
|
598
521
|
- `--port`: Port for the client to launch on (default: 8501)
|
599
522
|
- `--jivas_url`: URL for the Jivas API (default: http://localhost:8000 or JIVAS_BASE_URL env var)
|
600
523
|
- `--studio_url`: URL for the Jivas Studio (default: http://localhost:8989 or JIVAS_STUDIO_URL env var)
|
601
524
|
|
525
|
+
|
602
526
|
When launched, the Client will be accessible via a web browser at `http://localhost:<port>`.
|
603
527
|
|
604
528
|
## 🔰 Contributing
|
@@ -2,9 +2,8 @@
|
|
2
2
|
|
3
3
|
import click
|
4
4
|
|
5
|
-
from jvcli import __version__
|
5
|
+
from jvcli import __version__ # type: ignore[attr-defined]
|
6
6
|
from jvcli.commands.auth import login, logout, signup
|
7
|
-
from jvcli.commands.clean import clean
|
8
7
|
from jvcli.commands.client import client
|
9
8
|
from jvcli.commands.create import create
|
10
9
|
from jvcli.commands.download import download
|
@@ -12,7 +11,6 @@ from jvcli.commands.info import info
|
|
12
11
|
from jvcli.commands.publish import publish
|
13
12
|
from jvcli.commands.server import server
|
14
13
|
from jvcli.commands.startproject import startproject
|
15
|
-
from jvcli.commands.studio import studio
|
16
14
|
from jvcli.commands.update import update
|
17
15
|
|
18
16
|
|
@@ -29,11 +27,9 @@ jvcli.add_command(update)
|
|
29
27
|
jvcli.add_command(download)
|
30
28
|
jvcli.add_command(publish)
|
31
29
|
jvcli.add_command(info)
|
32
|
-
jvcli.add_command(studio)
|
33
|
-
jvcli.add_command(client)
|
34
30
|
jvcli.add_command(startproject)
|
35
|
-
jvcli.add_command(clean)
|
36
31
|
jvcli.add_command(server)
|
32
|
+
jvcli.add_command(client)
|
37
33
|
|
38
34
|
# Register standalone commands
|
39
35
|
jvcli.add_command(signup)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"""Client command group for interfacing with the Jivas Client."""
|
2
|
+
|
3
|
+
import subprocess
|
4
|
+
|
5
|
+
import click
|
6
|
+
|
7
|
+
|
8
|
+
@click.group()
|
9
|
+
def client() -> None:
|
10
|
+
"""Group for interfacing with the Jivas Client."""
|
11
|
+
pass # pragma: no cover
|
12
|
+
|
13
|
+
|
14
|
+
@client.command()
|
15
|
+
def launch() -> None:
|
16
|
+
"""Launch the Jivas Client by running the jvmanager launch command."""
|
17
|
+
click.echo("Launching Jivas Client...")
|
18
|
+
try:
|
19
|
+
subprocess.call(["jvmanager", "launch"])
|
20
|
+
except FileNotFoundError:
|
21
|
+
click.secho(
|
22
|
+
"Error: 'jvmanager' command not found. Make sure it is installed and in your PATH.",
|
23
|
+
fg="red",
|
24
|
+
)
|
25
|
+
except Exception as e:
|
26
|
+
click.secho(f"An error occurred: {e}", fg="red")
|
@@ -4,7 +4,7 @@ import os
|
|
4
4
|
|
5
5
|
import click
|
6
6
|
|
7
|
-
from jvcli import __supported__jivas__versions__
|
7
|
+
from jvcli import __supported__jivas__versions__ # type: ignore[attr-defined]
|
8
8
|
from jvcli.api import RegistryAPI
|
9
9
|
from jvcli.auth import load_token, save_token
|
10
10
|
from jvcli.utils import TEMPLATES_DIR, validate_name, validate_snake_case
|
@@ -93,7 +93,7 @@ def create_action(
|
|
93
93
|
full_name = f"{namespace}/{name}"
|
94
94
|
|
95
95
|
# Generate class name (CamelCase)
|
96
|
-
|
96
|
+
archetype = "".join(word.capitalize() for word in name.split("_"))
|
97
97
|
|
98
98
|
# Validate the Jivas version
|
99
99
|
if str(jivas_version) not in __supported__jivas__versions__:
|
@@ -104,7 +104,9 @@ def create_action(
|
|
104
104
|
return
|
105
105
|
|
106
106
|
# Prepare the template path
|
107
|
-
template_path = os.path.join(
|
107
|
+
template_path = os.path.join(
|
108
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "action_info.yaml"
|
109
|
+
)
|
108
110
|
if not os.path.exists(template_path):
|
109
111
|
click.secho(
|
110
112
|
f"Template for version {jivas_version} not found in {TEMPLATES_DIR}.",
|
@@ -126,7 +128,7 @@ def create_action(
|
|
126
128
|
data = {
|
127
129
|
"name": full_name, # Include namespace in the package name
|
128
130
|
"author": author,
|
129
|
-
"
|
131
|
+
"archetype": archetype,
|
130
132
|
"version": version,
|
131
133
|
"title": title,
|
132
134
|
"description": description,
|
@@ -147,101 +149,89 @@ def create_action(
|
|
147
149
|
|
148
150
|
# Create lib.jac
|
149
151
|
lib_path = os.path.join(action_dir, "lib.jac")
|
150
|
-
|
151
|
-
|
152
|
+
lib_template_path = os.path.join(
|
153
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "action_lib.jac"
|
154
|
+
)
|
155
|
+
if not os.path.exists(lib_template_path):
|
156
|
+
click.secho(
|
157
|
+
f"Lib template for version {jivas_version} not found in {TEMPLATES_DIR}.",
|
158
|
+
fg="red",
|
159
|
+
)
|
160
|
+
return
|
152
161
|
|
153
|
-
|
154
|
-
|
155
|
-
with open(action_jac_path, "w") as file:
|
156
|
-
node_class = {
|
157
|
-
"action": "Action",
|
158
|
-
"interact_action": "InteractAction",
|
159
|
-
"vector_store_action": "VectorStoreAction",
|
160
|
-
}[type]
|
161
|
-
|
162
|
-
import_statement = f"import:jac from agent.action.{type} {{ {node_class} }}"
|
163
|
-
|
164
|
-
abilities = """
|
165
|
-
#* (Abilities - Uncomment and implement as needed)
|
166
|
-
can on_register {
|
167
|
-
# override to execute operations upon registration of action
|
168
|
-
}
|
162
|
+
with open(lib_template_path, "r") as file:
|
163
|
+
lib_content = file.read()
|
169
164
|
|
170
|
-
|
171
|
-
|
165
|
+
lib_data = {
|
166
|
+
"namespace": namespace,
|
167
|
+
"name": name,
|
168
|
+
"imports": name,
|
172
169
|
}
|
173
170
|
|
174
|
-
|
175
|
-
|
176
|
-
}
|
171
|
+
for key, value in lib_data.items():
|
172
|
+
lib_content = lib_content.replace(f"{{{{{key}}}}}", str(value))
|
177
173
|
|
178
|
-
|
179
|
-
|
180
|
-
}
|
174
|
+
with open(lib_path, "w") as file:
|
175
|
+
file.write(lib_content)
|
181
176
|
|
182
|
-
|
183
|
-
|
184
|
-
|
177
|
+
# Create action-specific .jac file
|
178
|
+
action_jac_path = os.path.join(action_dir, f"{name}.jac")
|
179
|
+
if type == "action":
|
180
|
+
action_template_path = os.path.join(
|
181
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "action_archetype.jac"
|
182
|
+
)
|
183
|
+
elif type == "interact_action":
|
184
|
+
action_template_path = os.path.join(
|
185
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "interact_action_archetype.jac"
|
186
|
+
)
|
187
|
+
else:
|
188
|
+
action_template_path = os.path.join(
|
189
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "action_archetype.jac"
|
190
|
+
)
|
185
191
|
|
186
|
-
|
187
|
-
|
188
|
-
|
192
|
+
if not os.path.exists(action_template_path):
|
193
|
+
click.secho(
|
194
|
+
f"Action template for version {jivas_version} not found in {TEMPLATES_DIR}.",
|
195
|
+
fg="red",
|
196
|
+
)
|
197
|
+
return
|
189
198
|
|
190
|
-
|
191
|
-
|
192
|
-
}
|
199
|
+
with open(action_template_path, "r") as file:
|
200
|
+
node_content = file.read()
|
193
201
|
|
194
|
-
|
195
|
-
|
202
|
+
action_data = {
|
203
|
+
"archetype": archetype,
|
196
204
|
}
|
197
|
-
*#
|
198
|
-
"""
|
199
|
-
node_content = f"""
|
200
|
-
# Define your custom action code here
|
201
|
-
{import_statement}
|
202
205
|
|
203
|
-
|
204
|
-
|
205
|
-
# e.g has var_a : str = "string";
|
206
|
+
for key, value in action_data.items():
|
207
|
+
node_content = node_content.replace(f"{{{{{key}}}}}", str(value))
|
206
208
|
|
207
|
-
|
208
|
-
}}
|
209
|
-
"""
|
209
|
+
with open(action_jac_path, "w") as file:
|
210
210
|
file.write(node_content.strip())
|
211
211
|
|
212
212
|
# Create the 'app' folder and default 'app.py'
|
213
213
|
app_dir = os.path.join(action_dir, "app")
|
214
214
|
os.makedirs(app_dir, exist_ok=True)
|
215
215
|
app_file_path = os.path.join(app_dir, "app.py")
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
from jvcli.client.lib.widgets import app_controls, app_header, app_update_action
|
221
|
-
|
222
|
-
from streamlit_router import StreamlitRouter
|
223
|
-
|
224
|
-
def render(router: StreamlitRouter, agent_id: str, action_id: str, info: dict) -> None:
|
225
|
-
\"\"\"Render the Streamlit app for the {title}.
|
226
|
-
:param router: The StreamlitRouter instance
|
227
|
-
:param agent_id: The agent ID
|
228
|
-
:param action_id: The action ID
|
229
|
-
:param info: The action info dict
|
230
|
-
\"\"\"
|
216
|
+
app_template_path = os.path.join(
|
217
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "action_app.py"
|
218
|
+
)
|
231
219
|
|
232
|
-
|
233
|
-
|
220
|
+
if not os.path.exists(app_template_path):
|
221
|
+
click.secho(
|
222
|
+
f"App template for version {jivas_version} not found in {TEMPLATES_DIR}.",
|
223
|
+
fg="red",
|
224
|
+
)
|
225
|
+
return
|
234
226
|
|
235
|
-
|
236
|
-
|
227
|
+
with open(app_template_path, "r") as file:
|
228
|
+
app_code = file.read()
|
237
229
|
|
238
|
-
|
239
|
-
|
240
|
-
"""
|
241
|
-
app_code = app_code.replace("{title}", title)
|
230
|
+
app_code = app_code.replace("{{title}}", title)
|
231
|
+
with open(app_file_path, "w") as app_file:
|
242
232
|
app_file.write(app_code)
|
243
233
|
|
244
|
-
|
234
|
+
create_docs(action_dir, title, version, "action", jivas_version, description)
|
245
235
|
|
246
236
|
click.secho(
|
247
237
|
f"Action '{name}' created successfully in {action_dir}!", fg="green", bold=True
|
@@ -336,6 +326,8 @@ def create_agent(
|
|
336
326
|
) -> None:
|
337
327
|
"""Create a new agent with its folder and associated files."""
|
338
328
|
|
329
|
+
title = name.replace("_", " ").title()
|
330
|
+
|
339
331
|
# Retrieve token info
|
340
332
|
token = load_token()
|
341
333
|
namespace = namespace or token.get("namespaces", {}).get("default", "anonymous")
|
@@ -356,14 +348,18 @@ def create_agent(
|
|
356
348
|
|
357
349
|
# Load templates
|
358
350
|
template_paths = {
|
359
|
-
"info.yaml": os.path.join(
|
351
|
+
"info.yaml": os.path.join(
|
352
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "agent_info.yaml"
|
353
|
+
),
|
360
354
|
"descriptor.yaml": os.path.join(
|
361
|
-
TEMPLATES_DIR, jivas_version, "agent_descriptor.yaml"
|
355
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "agent_descriptor.yaml"
|
362
356
|
),
|
363
357
|
"knowledge.yaml": os.path.join(
|
364
|
-
TEMPLATES_DIR, jivas_version, "agent_knowledge.yaml"
|
358
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "agent_knowledge.yaml"
|
359
|
+
),
|
360
|
+
"memory.yaml": os.path.join(
|
361
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "agent_memory.yaml"
|
365
362
|
),
|
366
|
-
"memory.yaml": os.path.join(TEMPLATES_DIR, jivas_version, "agent_memory.yaml"),
|
367
363
|
}
|
368
364
|
|
369
365
|
# Check if all templates exist
|
@@ -383,7 +379,7 @@ def create_agent(
|
|
383
379
|
"name": f"{namespace}/{name}",
|
384
380
|
"author": author,
|
385
381
|
"version": version,
|
386
|
-
"title":
|
382
|
+
"title": title,
|
387
383
|
"description": description,
|
388
384
|
"type": "agent",
|
389
385
|
"jivas_version": jivas_version,
|
@@ -397,7 +393,7 @@ def create_agent(
|
|
397
393
|
file.write(template_content)
|
398
394
|
|
399
395
|
# Create documentation
|
400
|
-
create_docs(daf_dir,
|
396
|
+
create_docs(daf_dir, title, version, "agent", jivas_version, description)
|
401
397
|
|
402
398
|
# Success message
|
403
399
|
click.secho(
|
@@ -406,18 +402,25 @@ def create_agent(
|
|
406
402
|
|
407
403
|
|
408
404
|
def create_docs(
|
409
|
-
path: str,
|
405
|
+
path: str,
|
406
|
+
title: str,
|
407
|
+
version: str,
|
408
|
+
package_type: str,
|
409
|
+
jivas_version: str,
|
410
|
+
description: str = "",
|
410
411
|
) -> None:
|
411
412
|
"""Update README.md and CHANGELOG.md templates with name and version."""
|
412
413
|
|
413
414
|
# Create README
|
414
|
-
readme_template = os.path.join(
|
415
|
+
readme_template = os.path.join(
|
416
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "README.md"
|
417
|
+
)
|
415
418
|
if os.path.exists(readme_template):
|
416
419
|
with open(readme_template, "r") as file:
|
417
420
|
readme_content = file.read()
|
418
421
|
|
419
422
|
readme_content = readme_content.replace("{{version}}", version)
|
420
|
-
readme_content = readme_content.replace("{{
|
423
|
+
readme_content = readme_content.replace("{{title}}", title)
|
421
424
|
readme_content = readme_content.replace("{{description}}", description)
|
422
425
|
|
423
426
|
target_readme = os.path.join(path, "README.md")
|
@@ -425,7 +428,9 @@ def create_docs(
|
|
425
428
|
file.write(readme_content)
|
426
429
|
|
427
430
|
# Create CHANGELOG
|
428
|
-
changelog_template = os.path.join(
|
431
|
+
changelog_template = os.path.join(
|
432
|
+
TEMPLATES_DIR, jivas_version, "sourcefiles", "CHANGELOG.md"
|
433
|
+
)
|
429
434
|
if os.path.exists(changelog_template):
|
430
435
|
with open(changelog_template, "r") as file:
|
431
436
|
changelog_content = file.read()
|
@@ -10,7 +10,6 @@ import click
|
|
10
10
|
import requests
|
11
11
|
|
12
12
|
from jvcli.auth import login_jivas
|
13
|
-
from jvcli.commands.clean import clean
|
14
13
|
from jvcli.utils import is_server_running, load_env_if_present
|
15
14
|
|
16
15
|
load_env_if_present()
|
@@ -167,11 +166,6 @@ def initagents() -> None:
|
|
167
166
|
sys.exit(1)
|
168
167
|
click.secho("Logged in to Jivas successfully.", fg="green")
|
169
168
|
|
170
|
-
# Run jvcli clean command
|
171
|
-
click.secho("Cleaning Jac files before initializing agents...", fg="blue")
|
172
|
-
ctx = click.Context(clean, info_name="clean")
|
173
|
-
clean.invoke(ctx)
|
174
|
-
|
175
169
|
# Initialize agents
|
176
170
|
try:
|
177
171
|
response = requests.post(
|