jvcli 2.0.2__py3-none-any.whl → 2.0.4__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.
@@ -0,0 +1,20 @@
1
+ """Render the Jivas Studio page in an iframe."""
2
+
3
+ import os
4
+
5
+ import streamlit as st
6
+ from streamlit_router import StreamlitRouter
7
+
8
+ JIVAS_STUDIO_URL = os.environ.get("JIVAS_STUDIO_URL", "http://localhost:8989")
9
+
10
+
11
+ def render(router: StreamlitRouter) -> None:
12
+ """
13
+ Render the Jivas Studio page in an iframe.
14
+
15
+ args:
16
+ router: StreamlitRouter
17
+ The StreamlitRouter instance
18
+ """
19
+
20
+ st.components.v1.iframe(JIVAS_STUDIO_URL, width=None, height=800, scrolling=False)
@@ -0,0 +1,50 @@
1
+ """Client command group for deploying and interfacing with the Jivas Client."""
2
+
3
+ import os
4
+ import subprocess
5
+ from pathlib import Path
6
+
7
+ import click
8
+
9
+
10
+ @click.group()
11
+ def client() -> None:
12
+ """Group for managing Jivas Client resources."""
13
+ pass # pragma: no cover
14
+
15
+
16
+ @client.command()
17
+ @click.option("--port", default=8501, help="Port for the client to launch on.")
18
+ @click.option(
19
+ "--jivas_url",
20
+ default=os.environ.get("JIVAS_URL", "http://localhost:8000"),
21
+ help="URL for the Jivas API.",
22
+ )
23
+ @click.option(
24
+ "--studio_url",
25
+ default=os.environ.get("JIVAS_STUDIO_URL", "http://localhost:8989"),
26
+ help="URL for the Jivas Studio.",
27
+ )
28
+ def launch(port: int, jivas_url: str, studio_url: str) -> None:
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_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
+ )
jvcli/commands/publish.py CHANGED
@@ -163,7 +163,18 @@ def _publish_common(
163
163
  click.secho(f"Error validating dependencies: {e}", fg="red")
164
164
  return
165
165
 
166
- namespace, name = package_name.split("/", 1)
166
+ package_namespace, name = package_name.split("/", 1)
167
+
168
+ # verify that publish namespace matches package namespace
169
+ if (namespace and package_namespace) and (namespace != package_namespace):
170
+ click.secho(
171
+ f"Error validating namespace: You provided '{namespace}', but '{package_namespace}' was found in the package info file.",
172
+ fg="red",
173
+ )
174
+ return
175
+
176
+ # we need to ensure that the namespace is not None i.e namespace not used in cli
177
+ namespace = namespace or package_namespace
167
178
 
168
179
  if package_only and not output:
169
180
  output = "."
@@ -0,0 +1,67 @@
1
+ """Start project command."""
2
+
3
+ import os
4
+
5
+ import click
6
+
7
+ from jvcli import __supported__jivas__versions__
8
+ from jvcli.utils import TEMPLATES_DIR
9
+
10
+
11
+ @click.command()
12
+ @click.argument("project_name")
13
+ @click.option(
14
+ "--version",
15
+ default=max(__supported__jivas__versions__),
16
+ show_default=True,
17
+ help="Jivas project version to use for scaffolding.",
18
+ )
19
+ def startproject(project_name: str, version: str) -> None:
20
+ """
21
+ Initialize a new Jivas project with the necessary structure.
22
+
23
+ Usage:
24
+ jvcli startproject <project_name> [--version <jivas_version>]
25
+ """
26
+ template_path = os.path.join(TEMPLATES_DIR, version, "project")
27
+
28
+ if not os.path.exists(template_path):
29
+ click.secho(f"Template for Jivas version {version} not found.", fg="red")
30
+ return
31
+
32
+ project_structure: dict = {
33
+ "tests": [],
34
+ "actions": [],
35
+ "daf": [],
36
+ "scripts": [],
37
+ }
38
+
39
+ try:
40
+ print(f"Creating project: {project_name} (Version: {version})")
41
+ os.makedirs(project_name, exist_ok=True)
42
+
43
+ # Create directories
44
+ for folder in project_structure.keys():
45
+ os.makedirs(os.path.join(project_name, folder), exist_ok=True)
46
+
47
+ # Copy template files from the selected version
48
+ for filename in ["main.jac", "globals.jac", "env.example"]:
49
+ template_file_path = os.path.join(template_path, filename)
50
+ if os.path.exists(template_file_path):
51
+ with open(template_file_path, "r") as template_file:
52
+ contents = template_file.read()
53
+
54
+ # Write `.env` instead of `env.example`
55
+ target_filename = ".env" if filename == "env.example" else filename
56
+ with open(
57
+ os.path.join(project_name, target_filename), "w"
58
+ ) as project_file:
59
+ project_file.write(contents)
60
+
61
+ click.secho(
62
+ f"Successfully created Jivas project: {project_name} (Version: {version})",
63
+ fg="green",
64
+ )
65
+
66
+ except Exception as e:
67
+ click.secho(f"Error creating project: {e}", fg="red")
jvcli/commands/studio.py CHANGED
@@ -90,7 +90,7 @@ def launch(port: int) -> None:
90
90
  app.add_api_route("/graph", endpoint=get_graph, methods=["GET"])
91
91
  app.add_api_route("/users", endpoint=get_users, methods=["GET"])
92
92
 
93
- client_dir = Path(__file__).resolve().parent.parent.joinpath("client")
93
+ client_dir = Path(__file__).resolve().parent.parent.joinpath("studio")
94
94
  app.mount("/", StaticFiles(directory=client_dir, html=True), name="studio")
95
95
 
96
96
  run(app, host="0.0.0.0", port=port)
@@ -0,0 +1,13 @@
1
+ JIVAS_USER=admin@jivas.com
2
+ JIVAS_PASSWORD=password
3
+ JIVAS_PORT=8000
4
+ JIVAS_BASE_URL=http://localhost:8000
5
+ JIVAS_STUDIO_URL=http://localhost:8989
6
+ JIVAS_FILES_URL=http://localhost:8000/files
7
+ JIVAS_DESCRIPTOR_ROOT_PATH=".jvdata"
8
+ JIVAS_ACTIONS_ROOT_PATH="actions"
9
+ JIVAS_DAF_ROOT_PATH="daf"
10
+ JIVAS_FILES_ROOT_PATH=".files"
11
+ JIVAS_WEBHOOK_SECRET_KEY="ABCDEFGHIJK"
12
+ JIVAS_ENVIRONMENT=development
13
+ JACPATH="./"
@@ -0,0 +1,2 @@
1
+ # Add any global variables here, e.g.
2
+ # glob var = None;
@@ -0,0 +1,2 @@
1
+ import:jac globals;
2
+ include:jac jivas.agent.lib;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jvcli
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: CLI tool for Jivas Package Repository
5
5
  Home-page: https://github.com/TrueSelph/jvcli
6
6
  Author: TrueSelph Inc.
@@ -13,6 +13,10 @@ Requires-Dist: requests>=2.32.3
13
13
  Requires-Dist: packaging>=24.2
14
14
  Requires-Dist: pyaml>=25.1.0
15
15
  Requires-Dist: jac-cloud>=0.1.19
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
16
20
  Provides-Extra: dev
17
21
  Requires-Dist: pre-commit; extra == "dev"
18
22
  Requires-Dist: pytest; extra == "dev"
@@ -66,6 +70,12 @@ To publish an action:
66
70
  jvcli publish action --path ./my_action --visibility public
67
71
  ```
68
72
 
73
+ To start a new project:
74
+
75
+ ```sh
76
+ jvcli startproject my_project
77
+ ```
78
+
69
79
  For more detailed usage, refer to the help command:
70
80
 
71
81
  ```sh
@@ -0,0 +1,48 @@
1
+ jvcli/__init__.py,sha256=4iRZZOXOKPV3k4ry0QlBmWUej0E51Y1cprVqw35zy5Y,170
2
+ jvcli/api.py,sha256=gs0ZWf5T6nMJc6m1aGz6qZpqDHhYhhtVsvN6UYwtpAs,11113
3
+ jvcli/auth.py,sha256=p04T02ufqbENx_93oDPg3xsq7sv-Nabeq3YR1kLXfSg,1215
4
+ jvcli/cli.py,sha256=VM_QGPiYfSdqOZ4n0YLZbrOwXm0d5lHmzv47MqTyBMc,1060
5
+ jvcli/utils.py,sha256=NKWjjJ45NFlwT7QVMh1YMY2zfvGaJ_8LppG4D8QXCwA,7726
6
+ jvcli/client/__init__.py,sha256=WGP05OBzZHReqENYs1qYqMnYvgAaNVW6KvGQvyB3NGs,85
7
+ jvcli/client/app.py,sha256=v494Q_uvw4gO9s4s_KlP_Zxd8g_IEG1BkefoEdppjxU,5464
8
+ jvcli/client/lib/__init__.py,sha256=_Wv8CNIxeIle_x0U9T6w9s5mPuOY9-0u69BvTEPXLUw,38
9
+ jvcli/client/lib/page.py,sha256=QF53ffO4A2P9QTdPFfi0baCpKyEMmfkLyhJNxm7pTb0,2225
10
+ jvcli/client/lib/utils.py,sha256=8YyGoU0Zch9XKz2eBKnXau6bI-dkEV--CSmPbFr8SBA,9833
11
+ jvcli/client/lib/widgets.py,sha256=-YijWUNEgR93LoWiOEDUMi2_sgD_p-dbmkuR92NA-GU,9424
12
+ jvcli/client/pages/__init__.py,sha256=sXsBV8cGItWhXtYg8PkfCd1Vi5ibd-rv5LABnPC_St4,51
13
+ jvcli/client/pages/analytics_page.py,sha256=bNlIaMgWGHz_XO4Z2a0jzEUL1ryGR_4s8TDsyTjZP10,5660
14
+ jvcli/client/pages/chat_page.py,sha256=Eye4KFt_wsiJuX5S7BqNErb2bApYDbNKc-1rJ5HZwnI,4749
15
+ jvcli/client/pages/dashboard_page.py,sha256=bzITRQI-cA5XUrIxwgiFGgrTZp3vvYeiU_e6K4tGx1Q,5006
16
+ jvcli/client/pages/graph_page.py,sha256=2ZN-C9eskqICgnZhfP1zc6YOPPsGib_WZw3xHXcA63k,491
17
+ jvcli/commands/__init__.py,sha256=bjZvM55MC2NugvRlxkEU9CDDP9NnsygcsGZewj1gQcg,57
18
+ jvcli/commands/auth.py,sha256=LjVPgSt50k95H3rlCRappYEt_PsES7FlZryh4ipjSc4,1602
19
+ jvcli/commands/client.py,sha256=SfcE7sDF8gw3pMFs28YV-Rz3cb9rm2O1Kcu-INmAy-g,1422
20
+ jvcli/commands/create.py,sha256=-9Lcng3Ef6AMZwBcuXDgvJCuvWxB_dB_fQF5-OBCkqA,13394
21
+ jvcli/commands/download.py,sha256=AT6SFiJ9ysqNMDCdKsZ6CMUx96qpyzgraOk6EuNL2Qs,3417
22
+ jvcli/commands/info.py,sha256=NyIDpR_AGMMSFPE0tFZv4dIuv_gwqrfd589zQAA_Q3s,2685
23
+ jvcli/commands/publish.py,sha256=q1ihoL42GmEsU5ggHN3bcg8QD26kjRUZGfQpRzI2GMo,6630
24
+ jvcli/commands/startproject.py,sha256=lMKKUcYqwvACKV1Pm0Y6rEqNuazZnu2mcq_Ax1b-9gk,2119
25
+ jvcli/commands/studio.py,sha256=4acrd5Wpv5h2TBFPrzOQGyAtMpy8bQaqPh96Js9nod8,2761
26
+ jvcli/commands/update.py,sha256=LwCLg-W1b8WSdFkiiJ8WwTit2HJXTLpM5OQ4WBTe9C4,1997
27
+ jvcli/studio/index.html,sha256=a4UaOrpXsTrHTF1iN3VIWzF7wgVWvFCEzoFRw-tDPXc,474
28
+ jvcli/studio/jac_logo.png,sha256=upImjxkFU42yMutB-w8S_ZrrWpXxNRtKWUUkmID-8mk,14015
29
+ jvcli/studio/tauri.svg,sha256=5dJzi7qlVDxGhAAaVY3FMWXam2NhRIJ7KNsdz6z4Gqg,2599
30
+ jvcli/studio/vite.svg,sha256=SnSK_UQ5GLsWWRyDTEAdrjPoeGGrXbrQgRw6O0qSFPs,1497
31
+ jvcli/studio/assets/index-BtFItD2q.js,sha256=XR7x4zSXb_BQPw3rXtqdgTYedJhL841Yb0HSLD6155I,934734
32
+ jvcli/studio/assets/index-CIEsu-TC.css,sha256=kGREUw4sJoCChaHm6s7o5mQCESn1ciVPkmdXXadW1l0,191921
33
+ jvcli/templates/CHANGELOG.md,sha256=aci-j1gPbzyywQyPY9M2PJkZLVTKgdDuJYcFpdPpKHQ,66
34
+ jvcli/templates/README.md,sha256=VcLV54kkjp_m-cVVuH_OTdIJ39T41sM2TwKH9ISyqbk,51
35
+ jvcli/templates/2.0.0/action_info.yaml,sha256=ACSLbkr8P3XY8DzPHiGXH9OfjJ2Y-lZd3WefnvPIVbQ,303
36
+ jvcli/templates/2.0.0/agent_descriptor.yaml,sha256=h6_pxmaP-oJqLDCHAyZ1ckETfWD6D60wsmGUH-FVLpI,742
37
+ jvcli/templates/2.0.0/agent_info.yaml,sha256=3olXRQDQG-543o7zSWWT23kJsK29QGhdx6-tOLXvCk8,207
38
+ jvcli/templates/2.0.0/agent_knowledge.yaml,sha256=hI0ifr0ICiZGce-oUFovBOmDWxGU1Z2M10WyZH_wS2g,284
39
+ jvcli/templates/2.0.0/agent_memory.yaml,sha256=_MBgObZcW1UzwWuYQVJiPZ_7TvYbGrDgd-xMuzJEkVo,9
40
+ jvcli/templates/2.0.0/project/env.example,sha256=cQv5YeuEhxUmnDYE1sofCCPuPLAlHP88qnDl2DLd6R4,396
41
+ jvcli/templates/2.0.0/project/globals.jac,sha256=CEt7L25wEZfE6TupqpM1ilHbtJMQQWExDQ5GJlkHPts,56
42
+ jvcli/templates/2.0.0/project/main.jac,sha256=r37jsaGq-85YvDbHP3bQvBXk0u8w0rtRTZTNxZOjTW0,48
43
+ jvcli-2.0.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
44
+ jvcli-2.0.4.dist-info/METADATA,sha256=HI_z8r6p_bdghn_IwufEe1SiWyECJj01S9Q1dvmLsMI,4179
45
+ jvcli-2.0.4.dist-info/WHEEL,sha256=nn6H5-ilmfVryoAQl3ZQ2l8SH5imPWFpm1A5FgEuFV4,91
46
+ jvcli-2.0.4.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
47
+ jvcli-2.0.4.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
48
+ jvcli-2.0.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,32 +0,0 @@
1
- jvcli/__init__.py,sha256=gAch_Skq8FATOW7vl470qDVoFB3jFHq8bQF6CWWTl9c,170
2
- jvcli/api.py,sha256=gs0ZWf5T6nMJc6m1aGz6qZpqDHhYhhtVsvN6UYwtpAs,11113
3
- jvcli/auth.py,sha256=p04T02ufqbENx_93oDPg3xsq7sv-Nabeq3YR1kLXfSg,1215
4
- jvcli/cli.py,sha256=qgfKC-oH13EUhDJxoZCSu2f2xlARGp9i0HnRw6D92ZI,908
5
- jvcli/utils.py,sha256=NKWjjJ45NFlwT7QVMh1YMY2zfvGaJ_8LppG4D8QXCwA,7726
6
- jvcli/client/index.html,sha256=a4UaOrpXsTrHTF1iN3VIWzF7wgVWvFCEzoFRw-tDPXc,474
7
- jvcli/client/jac_logo.png,sha256=upImjxkFU42yMutB-w8S_ZrrWpXxNRtKWUUkmID-8mk,14015
8
- jvcli/client/tauri.svg,sha256=5dJzi7qlVDxGhAAaVY3FMWXam2NhRIJ7KNsdz6z4Gqg,2599
9
- jvcli/client/vite.svg,sha256=SnSK_UQ5GLsWWRyDTEAdrjPoeGGrXbrQgRw6O0qSFPs,1497
10
- jvcli/client/assets/index-BtFItD2q.js,sha256=XR7x4zSXb_BQPw3rXtqdgTYedJhL841Yb0HSLD6155I,934734
11
- jvcli/client/assets/index-CIEsu-TC.css,sha256=kGREUw4sJoCChaHm6s7o5mQCESn1ciVPkmdXXadW1l0,191921
12
- jvcli/commands/__init__.py,sha256=bjZvM55MC2NugvRlxkEU9CDDP9NnsygcsGZewj1gQcg,57
13
- jvcli/commands/auth.py,sha256=LjVPgSt50k95H3rlCRappYEt_PsES7FlZryh4ipjSc4,1602
14
- jvcli/commands/create.py,sha256=-9Lcng3Ef6AMZwBcuXDgvJCuvWxB_dB_fQF5-OBCkqA,13394
15
- jvcli/commands/download.py,sha256=AT6SFiJ9ysqNMDCdKsZ6CMUx96qpyzgraOk6EuNL2Qs,3417
16
- jvcli/commands/info.py,sha256=NyIDpR_AGMMSFPE0tFZv4dIuv_gwqrfd589zQAA_Q3s,2685
17
- jvcli/commands/publish.py,sha256=wpplib0R6zjy9c3nHGiSLs3zIYEaVzvOTSKXXgwQB6E,6109
18
- jvcli/commands/studio.py,sha256=9Efyk-TwVpoBEg4MNgcEDpcLbQJCSboapiGwFmATSZc,2761
19
- jvcli/commands/update.py,sha256=LwCLg-W1b8WSdFkiiJ8WwTit2HJXTLpM5OQ4WBTe9C4,1997
20
- jvcli/templates/CHANGELOG.md,sha256=aci-j1gPbzyywQyPY9M2PJkZLVTKgdDuJYcFpdPpKHQ,66
21
- jvcli/templates/README.md,sha256=VcLV54kkjp_m-cVVuH_OTdIJ39T41sM2TwKH9ISyqbk,51
22
- jvcli/templates/2.0.0/action_info.yaml,sha256=ACSLbkr8P3XY8DzPHiGXH9OfjJ2Y-lZd3WefnvPIVbQ,303
23
- jvcli/templates/2.0.0/agent_descriptor.yaml,sha256=h6_pxmaP-oJqLDCHAyZ1ckETfWD6D60wsmGUH-FVLpI,742
24
- jvcli/templates/2.0.0/agent_info.yaml,sha256=3olXRQDQG-543o7zSWWT23kJsK29QGhdx6-tOLXvCk8,207
25
- jvcli/templates/2.0.0/agent_knowledge.yaml,sha256=hI0ifr0ICiZGce-oUFovBOmDWxGU1Z2M10WyZH_wS2g,284
26
- jvcli/templates/2.0.0/agent_memory.yaml,sha256=_MBgObZcW1UzwWuYQVJiPZ_7TvYbGrDgd-xMuzJEkVo,9
27
- jvcli-2.0.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
28
- jvcli-2.0.2.dist-info/METADATA,sha256=4zo4paTO9em_iaczbXwqZkisZxdmMK2q7bJATdoKxiQ,3957
29
- jvcli-2.0.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
30
- jvcli-2.0.2.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
31
- jvcli-2.0.2.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
32
- jvcli-2.0.2.dist-info/RECORD,,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes