jvcli 2.0.30__py3-none-any.whl → 2.1.1__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 +4 -2
- jvcli/cli.py +2 -6
- jvcli/commands/client.py +14 -38
- jvcli/commands/create.py +91 -86
- jvcli/commands/server.py +0 -6
- jvcli/commands/startproject.py +1 -1
- jvcli/templates/{2.0.0 → 2.1.1}/project/README.md +4 -40
- jvcli/templates/{2.0.0 → 2.1.1}/project/actions/README.md +1 -1
- jvcli/templates/{2.0.0 → 2.1.1}/project/daf/README.md +1 -1
- jvcli/templates/{2.0.0 → 2.1.1}/project/env.example +7 -4
- jvcli/templates/2.1.1/project/main.jac +2 -0
- jvcli/templates/2.1.1/sourcefiles/action_app.py +23 -0
- jvcli/templates/2.1.1/sourcefiles/action_archetype.jac +49 -0
- jvcli/templates/{2.0.0 → 2.1.1/sourcefiles}/action_info.yaml +1 -1
- jvcli/templates/2.1.1/sourcefiles/action_lib.jac +3 -0
- jvcli/templates/{2.0.0 → 2.1.1/sourcefiles}/agent_descriptor.yaml +4 -4
- jvcli/templates/2.1.1/sourcefiles/interact_action_archetype.jac +58 -0
- jvcli/utils.py +1 -1
- {jvcli-2.0.30.dist-info → jvcli-2.1.1.dist-info}/METADATA +8 -47
- jvcli-2.1.1.dist-info/RECORD +40 -0
- jvcli/client/__init__.py +0 -1
- jvcli/client/app.py +0 -188
- jvcli/client/lib/__init__.py +0 -1
- jvcli/client/lib/page.py +0 -68
- jvcli/client/lib/utils.py +0 -312
- jvcli/client/lib/widgets.py +0 -291
- jvcli/client/pages/__init__.py +0 -1
- jvcli/client/pages/action_dashboard_page.py +0 -120
- jvcli/client/pages/analytics_page.py +0 -245
- jvcli/client/pages/chat_page.py +0 -150
- jvcli/client/pages/graph_page.py +0 -20
- jvcli/commands/clean.py +0 -29
- jvcli/commands/studio.py +0 -258
- jvcli/studio/assets/index-DDV79SDu.js +0 -213
- jvcli/studio/assets/index-DdMMONxd.css +0 -1
- jvcli/studio/index.html +0 -15
- jvcli/studio/jac_logo.png +0 -0
- jvcli/studio/tauri.svg +0 -6
- jvcli/studio/vite.svg +0 -1
- jvcli/studio-auth/assets/index-Bh6lyeXA.js +0 -218
- jvcli/studio-auth/assets/index-DdMMONxd.css +0 -1
- jvcli/studio-auth/index.html +0 -15
- jvcli/studio-auth/jac_logo.png +0 -0
- jvcli/studio-auth/tauri.svg +0 -6
- jvcli/studio-auth/vite.svg +0 -1
- jvcli/templates/2.0.0/project/main.jac +0 -2
- jvcli-2.0.30.dist-info/RECORD +0 -61
- /jvcli/templates/{2.0.0 → 2.1.1}/project/gitignore.example +0 -0
- /jvcli/templates/{2.0.0 → 2.1.1}/project/globals.jac +0 -0
- /jvcli/templates/{2.0.0 → 2.1.1}/project/tests/README.md +0 -0
- /jvcli/templates/{CHANGELOG.md → 2.1.1/sourcefiles/CHANGELOG.md} +0 -0
- /jvcli/templates/{README.md → 2.1.1/sourcefiles/README.md} +0 -0
- /jvcli/templates/{2.0.0 → 2.1.1/sourcefiles}/agent_info.yaml +0 -0
- /jvcli/templates/{2.0.0 → 2.1.1/sourcefiles}/agent_knowledge.yaml +0 -0
- /jvcli/templates/{2.0.0 → 2.1.1/sourcefiles}/agent_memory.yaml +0 -0
- {jvcli-2.0.30.dist-info → jvcli-2.1.1.dist-info}/WHEEL +0 -0
- {jvcli-2.0.30.dist-info → jvcli-2.1.1.dist-info}/entry_points.txt +0 -0
- {jvcli-2.0.30.dist-info → jvcli-2.1.1.dist-info}/licenses/LICENSE +0 -0
- {jvcli-2.0.30.dist-info → jvcli-2.1.1.dist-info}/top_level.txt +0 -0
jvcli/__init__.py
CHANGED
@@ -4,5 +4,7 @@ jvcli package initialization.
|
|
4
4
|
This package provides the CLI tool for Jivas Package Repository.
|
5
5
|
"""
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
from importlib.metadata import version
|
8
|
+
|
9
|
+
__version__ = version("jvcli")
|
10
|
+
__supported__jivas__versions__ = [__version__]
|
jvcli/cli.py
CHANGED
@@ -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)
|
jvcli/commands/client.py
CHANGED
@@ -1,50 +1,26 @@
|
|
1
|
-
"""Client command group for
|
1
|
+
"""Client command group for interfacing with the Jivas Client."""
|
2
2
|
|
3
|
-
import os
|
4
3
|
import subprocess
|
5
|
-
from pathlib import Path
|
6
4
|
|
7
5
|
import click
|
8
6
|
|
9
7
|
|
10
8
|
@click.group()
|
11
9
|
def client() -> None:
|
12
|
-
"""Group for
|
10
|
+
"""Group for interfacing with the Jivas Client."""
|
13
11
|
pass # pragma: no cover
|
14
12
|
|
15
13
|
|
16
14
|
@client.command()
|
17
|
-
|
18
|
-
|
19
|
-
"
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
"""Launch the Jivas Client."""
|
30
|
-
click.echo(
|
31
|
-
f"Launching Jivas Client on port {port}, loading action apps from {jivas_url}..."
|
32
|
-
)
|
33
|
-
os.environ["JIVAS_BASE_URL"] = jivas_url
|
34
|
-
os.environ["JIVAS_STUDIO_URL"] = studio_url
|
35
|
-
subprocess.call(
|
36
|
-
[
|
37
|
-
"streamlit",
|
38
|
-
"run",
|
39
|
-
"--server.port={}".format(port),
|
40
|
-
"--client.showSidebarNavigation=False",
|
41
|
-
"--client.showErrorDetails=False",
|
42
|
-
"--global.showWarningOnDirectExecution=False",
|
43
|
-
Path(__file__)
|
44
|
-
.resolve()
|
45
|
-
.parent.parent.joinpath("client")
|
46
|
-
.joinpath("app.py")
|
47
|
-
.resolve()
|
48
|
-
.__str__(),
|
49
|
-
]
|
50
|
-
)
|
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")
|
jvcli/commands/create.py
CHANGED
@@ -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()
|
jvcli/commands/server.py
CHANGED
@@ -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(
|
jvcli/commands/startproject.py
CHANGED
@@ -86,17 +86,6 @@ This command creates a directory structure with:
|
|
86
86
|
- Main JAC file for your JIVAS application
|
87
87
|
- Configuration files and shell scripts for easy management
|
88
88
|
|
89
|
-
#### `jvcli clean`
|
90
|
-
|
91
|
-
Clean the Jac files in the current directory and subdirectories by removing compiled artifacts and temporary files.
|
92
|
-
|
93
|
-
```sh
|
94
|
-
# Clean the current directory
|
95
|
-
jvcli clean
|
96
|
-
```
|
97
|
-
|
98
|
-
This command executes `jac clean` under the hood and ensures your project is in a clean state before rebuilding or deploying.
|
99
|
-
|
100
89
|
### Create Commands
|
101
90
|
|
102
91
|
Create commands help you generate new resources like actions, agents, and namespaces with the proper structure and configuration.
|
@@ -457,8 +446,7 @@ jvcli server initagents
|
|
457
446
|
This command:
|
458
447
|
1. Checks if the server is running
|
459
448
|
2. Logs in to the server
|
460
|
-
3.
|
461
|
-
4. Sends a request to the server to reinitialize all agents
|
449
|
+
3. Sends a request to the server to reinitialize all agents
|
462
450
|
|
463
451
|
#### `jvcli server importagent`
|
464
452
|
|
@@ -482,31 +470,6 @@ This command:
|
|
482
470
|
3. Sends a request to import the specified agent
|
483
471
|
4. Displays the agent ID upon successful import
|
484
472
|
|
485
|
-
### Studio Commands
|
486
|
-
|
487
|
-
Studio commands help you manage the Jivas Studio, a web-based development environment for Jivas.
|
488
|
-
|
489
|
-
#### `jvcli studio launch`
|
490
|
-
|
491
|
-
Launch the Jivas Studio on a specified port. Jivas Studio provides a visual interface for building and managing agents.
|
492
|
-
|
493
|
-
```sh
|
494
|
-
# Launch with default settings
|
495
|
-
jvcli studio launch
|
496
|
-
|
497
|
-
# Launch on a custom port
|
498
|
-
jvcli studio launch --port 9000
|
499
|
-
|
500
|
-
# Launch with authentication required
|
501
|
-
jvcli studio launch --require-auth
|
502
|
-
```
|
503
|
-
|
504
|
-
Options:
|
505
|
-
- `--port`: Port for the studio to launch on (default: 8989)
|
506
|
-
- `--require-auth`: Require authentication for studio API access (default: false)
|
507
|
-
|
508
|
-
When launched, the Studio will be accessible via a web browser at `http://localhost:<port>`.
|
509
|
-
|
510
473
|
### Client Commands
|
511
474
|
|
512
475
|
Client commands help you manage the Jivas Client, which provides a user interface for interacting with agents.
|
@@ -523,8 +486,9 @@ jvcli client launch
|
|
523
486
|
jvcli client launch --port 9001
|
524
487
|
|
525
488
|
# Launch with custom server URLs
|
526
|
-
|
527
|
-
|
489
|
+
# Launch with custom server URLs
|
490
|
+
jvcli client launch
|
491
|
+
--jivas_url http://my-server:8000
|
528
492
|
--studio_url http://my-studio:8989
|
529
493
|
```
|
530
494
|
|
@@ -20,7 +20,7 @@ To create a custom action using `jvcli`, follow these steps:
|
|
20
20
|
|
21
21
|
2. **Options**: You can customize the creation process with various options:
|
22
22
|
- `--version`: Specify the version of the action. Default is `0.0.1`.
|
23
|
-
- `--jivas_version`: Specify the version of Jivas. Default is `2.
|
23
|
+
- `--jivas_version`: Specify the version of Jivas. Default is `2.1.0`.
|
24
24
|
- `--type`: Define the type of action (`action`, `interact_action`, or `vector_store_action`). Default is `action`.
|
25
25
|
- `--singleton`: Indicate if the action is singleton. Default is `True`.
|
26
26
|
- `--path`: Directory to create the action folder in. Default is `./actions`.
|
@@ -20,7 +20,7 @@ To create a new DAF package using `jvcli`, follow these steps:
|
|
20
20
|
|
21
21
|
2. **Options**: You can customize the creation process with various options:
|
22
22
|
- `--version`: Specify the version of the agent. Default is `0.0.1`.
|
23
|
-
- `--jivas_version`: Specify the version of Jivas. Default is `2.
|
23
|
+
- `--jivas_version`: Specify the version of Jivas. Default is `2.1.0`.
|
24
24
|
- `--path`: Directory to create the agent folder in. Default is `./daf`.
|
25
25
|
- `--namespace`: Namespace for the agent. Defaults to the username in the token.
|
26
26
|
|
@@ -4,17 +4,15 @@ JIVAS_ENVIRONMENT=development
|
|
4
4
|
JIVAS_USER=admin@jivas.com
|
5
5
|
JIVAS_PASSWORD=password
|
6
6
|
JIVAS_PORT=8000
|
7
|
-
JIVAS_DESCRIPTOR_ROOT_PATH=".jvdata"
|
8
7
|
JIVAS_ACTIONS_ROOT_PATH="actions"
|
9
8
|
JIVAS_DAF_ROOT_PATH="daf"
|
10
9
|
JIVAS_BASE_URL=http://127.0.0.1:8000
|
11
|
-
JIVAS_STUDIO_URL=http://127.0.0.1:8989
|
12
10
|
JACPATH="./"
|
13
11
|
|
14
12
|
# JIVAS Files Serving Config
|
15
13
|
JIVAS_FILE_INTERFACE="local"
|
16
14
|
JIVAS_FILES_ROOT_PATH=".files"
|
17
|
-
JIVAS_FILES_URL=http://127.0.0.1:
|
15
|
+
JIVAS_FILES_URL=http://127.0.0.1:8000/files
|
18
16
|
|
19
17
|
# S3 Config
|
20
18
|
# JIVAS_S3_ENDPOINT=access_key_id # optional
|
@@ -31,6 +29,11 @@ TOKEN_SECRET=s3cr3t
|
|
31
29
|
# DATABASE_HOST=mongodb://localhost:27017/?replicaSet=my-rs # If running MongoDB exposed on localhost, replace with the actual host and replaceSet name
|
32
30
|
# DATABASE_HOST=mongodb://mongodb:27017/?replicaSet=my-rs # If running MongoDB in a container named mongodb, replace with the actual host and replaceSet name
|
33
31
|
|
32
|
+
# Redis Config
|
33
|
+
# REDIS_PORT=6379
|
34
|
+
# REDIS_USER=default
|
35
|
+
# REDIS_HOST=redis://localhost
|
36
|
+
|
34
37
|
# Typesense Config
|
35
38
|
# TYPESENSE_HOST=localhost
|
36
39
|
# TYPESENSE_PORT=8108
|
@@ -40,4 +43,4 @@ TOKEN_SECRET=s3cr3t
|
|
40
43
|
|
41
44
|
# WPP Config
|
42
45
|
# WPP_API_URL="http://localhost:21465/api"
|
43
|
-
# WPP_SECRET_KEY="THISISMYSECURETOKEN"
|
46
|
+
# WPP_SECRET_KEY="THISISMYSECURETOKEN"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"""This module renders the streamlit app for the {{title}}."""
|
2
|
+
|
3
|
+
from streamlit_router import StreamlitRouter
|
4
|
+
|
5
|
+
from jvcli.client.lib.widgets import app_controls, app_header, app_update_action
|
6
|
+
|
7
|
+
|
8
|
+
def render(router: StreamlitRouter, agent_id: str, action_id: str, info: dict) -> None:
|
9
|
+
"""Render the Streamlit app for the {{title}}.
|
10
|
+
:param router: The StreamlitRouter instance
|
11
|
+
:param agent_id: The agent ID
|
12
|
+
:param action_id: The action ID
|
13
|
+
:param info: The action info dict
|
14
|
+
"""
|
15
|
+
|
16
|
+
# Add app header controls
|
17
|
+
(model_key, action) = app_header(agent_id, action_id, info)
|
18
|
+
|
19
|
+
# Add app main controls
|
20
|
+
app_controls(agent_id, action_id)
|
21
|
+
|
22
|
+
# Add update button to apply changes
|
23
|
+
app_update_action(agent_id, action_id)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import logging;
|
2
|
+
import traceback;
|
3
|
+
import from typing { Union }
|
4
|
+
import from logging { Logger }
|
5
|
+
import from jivas.agent.action.action { Action }
|
6
|
+
|
7
|
+
node {{archetype}}(Action) {
|
8
|
+
|
9
|
+
# Declare your has variables to be persisted here
|
10
|
+
# e.g has var_a : str = "string";
|
11
|
+
|
12
|
+
# set up logger
|
13
|
+
static has logger:Logger = logging.getLogger(__name__);
|
14
|
+
|
15
|
+
def healthcheck() -> Union[bool, dict] {
|
16
|
+
# override to implement healthcheck operation
|
17
|
+
# optionally returns a dict of (status:bool, severity:str [error|warning], message:str) if more information is needed
|
18
|
+
return True;
|
19
|
+
}
|
20
|
+
#*
|
21
|
+
|
22
|
+
(Optional Abilities - Uncomment and implement as needed)
|
23
|
+
|
24
|
+
# override to execute operations upon registration of action
|
25
|
+
def on_register() { }
|
26
|
+
|
27
|
+
# override to execute operations upon the reload of action
|
28
|
+
def on_reload() { }
|
29
|
+
|
30
|
+
# override to execute any setup code when all actions are in place
|
31
|
+
def post_register() { }
|
32
|
+
|
33
|
+
# override to execute operations upon enabling of action
|
34
|
+
def on_enable() { }
|
35
|
+
|
36
|
+
# override to execute operations upon disabling of action
|
37
|
+
def on_disable() { }
|
38
|
+
|
39
|
+
# override to execute operations upon deregistration of action
|
40
|
+
def on_deregister() { }
|
41
|
+
|
42
|
+
# override to implement pulse operation
|
43
|
+
def pulse() { }
|
44
|
+
|
45
|
+
# override to furnish analytics data for the action
|
46
|
+
def analytics() { }
|
47
|
+
|
48
|
+
*#
|
49
|
+
}
|