jvcli 2.0.27__tar.gz → 2.0.28__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.0.27/jvcli.egg-info → jvcli-2.0.28}/PKG-INFO +1 -1
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/__init__.py +1 -1
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/server.py +15 -41
- {jvcli-2.0.27 → jvcli-2.0.28/jvcli.egg-info}/PKG-INFO +1 -1
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_cli.py +0 -1
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_server.py +0 -82
- {jvcli-2.0.27 → jvcli-2.0.28}/LICENSE +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/MANIFEST.in +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/README.md +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/api.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/auth.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/cli.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/__init__.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/app.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/lib/__init__.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/lib/page.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/lib/utils.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/lib/widgets.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/pages/__init__.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/pages/action_dashboard_page.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/pages/analytics_page.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/pages/chat_page.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/client/pages/graph_page.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/__init__.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/auth.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/clean.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/client.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/create.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/download.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/info.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/publish.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/startproject.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/studio.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/commands/update.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio/assets/index-DDV79SDu.js +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio/assets/index-DdMMONxd.css +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio/index.html +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio/jac_logo.png +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio/tauri.svg +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio/vite.svg +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio-auth/assets/index-Bh6lyeXA.js +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio-auth/assets/index-DdMMONxd.css +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio-auth/index.html +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio-auth/jac_logo.png +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio-auth/tauri.svg +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/studio-auth/vite.svg +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/action_info.yaml +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/agent_descriptor.yaml +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/agent_info.yaml +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/agent_knowledge.yaml +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/agent_memory.yaml +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/README.md +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/actions/README.md +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/daf/README.md +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/env.example +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/gitignore.example +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/globals.jac +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/main.jac +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/2.0.0/project/tests/README.md +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/CHANGELOG.md +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/templates/README.md +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli/utils.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli.egg-info/SOURCES.txt +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli.egg-info/dependency_links.txt +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli.egg-info/entry_points.txt +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli.egg-info/requires.txt +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/jvcli.egg-info/top_level.txt +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/setup.cfg +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/setup.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_api.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_auth.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_clean.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_create.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_download.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_info.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_publish.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_render_basic.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_startproject.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_studio.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_update.py +0 -0
- {jvcli-2.0.27 → jvcli-2.0.28}/tests/test_utils.py +0 -0
@@ -101,49 +101,23 @@ def createadmin(email: Optional[str] = None, password: Optional[str] = None) ->
|
|
101
101
|
if password is None:
|
102
102
|
password = click.prompt("Password", hide_input=True)
|
103
103
|
|
104
|
-
|
104
|
+
signup_url = (
|
105
|
+
f"{os.environ.get('JIVAS_BASE_URL', 'http://localhost:8000')}/user/register"
|
106
|
+
)
|
105
107
|
|
106
|
-
|
107
|
-
click.echo("Database host is not set. Using signup endpoint...")
|
108
|
-
signup_url = (
|
109
|
-
f"{os.environ.get('JIVAS_BASE_URL', 'http://localhost:8000')}/user/register"
|
110
|
-
)
|
108
|
+
click.echo("Creating system admin...")
|
111
109
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
except Exception as e:
|
124
|
-
click.secho(
|
125
|
-
f"Error connecting to Jivas Server: {str(e)}", fg="red", bold=True
|
126
|
-
)
|
127
|
-
else:
|
128
|
-
click.echo("Creating system admin...")
|
129
|
-
try:
|
130
|
-
result = subprocess.call(
|
131
|
-
[
|
132
|
-
"jac",
|
133
|
-
"create_system_admin",
|
134
|
-
"main.jac",
|
135
|
-
"--email",
|
136
|
-
email,
|
137
|
-
"--password",
|
138
|
-
password,
|
139
|
-
]
|
140
|
-
)
|
141
|
-
if result == 0:
|
142
|
-
click.secho("Admin user created successfully!", fg="green", bold=True)
|
143
|
-
else:
|
144
|
-
click.secho("Failed to create admin user", fg="red", bold=True)
|
145
|
-
except Exception as e:
|
146
|
-
click.secho(f"Error running jac command: {str(e)}", fg="red", bold=True)
|
110
|
+
try:
|
111
|
+
response = requests.post(
|
112
|
+
signup_url, json={"email": email, "password": password}
|
113
|
+
)
|
114
|
+
if response.status_code in (200, 201):
|
115
|
+
click.secho("Admin user created successfully!", fg="green", bold=True)
|
116
|
+
return response.json()
|
117
|
+
else:
|
118
|
+
click.secho(f"Failed to create admin: {response.text}", fg="red", bold=True)
|
119
|
+
except Exception as e:
|
120
|
+
click.secho(f"Error connecting to Jivas Server: {str(e)}", fg="red", bold=True)
|
147
121
|
|
148
122
|
|
149
123
|
@server.command()
|
@@ -40,6 +40,5 @@ class TestCli:
|
|
40
40
|
"""Test that CLI displays usage information when no command is provided."""
|
41
41
|
runner = click.testing.CliRunner()
|
42
42
|
result = runner.invoke(jvcli)
|
43
|
-
assert result.exit_code == 0
|
44
43
|
assert "Usage:" in result.output
|
45
44
|
assert "Commands:" in result.output
|
@@ -595,47 +595,6 @@ class TestCreateAdminCommand:
|
|
595
595
|
},
|
596
596
|
)
|
597
597
|
|
598
|
-
def test_createadmin_using_jac_command(self, mocker: MockerFixture) -> None:
|
599
|
-
"""Test creating admin user using the jac command."""
|
600
|
-
# Mock subprocess.call successful return
|
601
|
-
mock_subprocess = mocker.patch(
|
602
|
-
"jvcli.commands.server.subprocess.call", return_value=0
|
603
|
-
)
|
604
|
-
|
605
|
-
# Environment with DATABASE_HOST
|
606
|
-
mocker.patch.dict(
|
607
|
-
os.environ,
|
608
|
-
{
|
609
|
-
"DATABASE_HOST": "postgres:5432",
|
610
|
-
"JIVAS_BASE_URL": "http://localhost:8000",
|
611
|
-
},
|
612
|
-
)
|
613
|
-
|
614
|
-
# Run command
|
615
|
-
runner = CliRunner()
|
616
|
-
result = runner.invoke(
|
617
|
-
server,
|
618
|
-
["createadmin", "--email", "admin@example.com", "--password", "admin123"],
|
619
|
-
)
|
620
|
-
|
621
|
-
# Verify behavior
|
622
|
-
assert result.exit_code == 0
|
623
|
-
assert "Creating system admin..." in result.output
|
624
|
-
assert "Admin user created successfully!" in result.output
|
625
|
-
|
626
|
-
# Verify jac command was called
|
627
|
-
mock_subprocess.assert_called_once_with(
|
628
|
-
[
|
629
|
-
"jac",
|
630
|
-
"create_system_admin",
|
631
|
-
"main.jac",
|
632
|
-
"--email",
|
633
|
-
"admin@example.com",
|
634
|
-
"--password",
|
635
|
-
"admin123",
|
636
|
-
]
|
637
|
-
)
|
638
|
-
|
639
598
|
def test_failed_signup_endpoint(self, mocker: MockerFixture) -> None:
|
640
599
|
"""Test behavior when signup endpoint returns an error."""
|
641
600
|
# Mock API error response
|
@@ -660,25 +619,6 @@ class TestCreateAdminCommand:
|
|
660
619
|
assert result.exit_code == 0
|
661
620
|
assert "Failed to create admin: Email already exists" in result.output
|
662
621
|
|
663
|
-
def test_failed_jac_command(self, mocker: MockerFixture) -> None:
|
664
|
-
"""Test behavior when jac command fails."""
|
665
|
-
# Mock subprocess.call failure
|
666
|
-
mocker.patch("jvcli.commands.server.subprocess.call", return_value=1)
|
667
|
-
|
668
|
-
# Environment with DATABASE_HOST
|
669
|
-
mocker.patch.dict(os.environ, {"DATABASE_HOST": "postgres:5432"})
|
670
|
-
|
671
|
-
# Run command
|
672
|
-
runner = CliRunner()
|
673
|
-
result = runner.invoke(
|
674
|
-
server,
|
675
|
-
["createadmin", "--email", "admin@example.com", "--password", "admin123"],
|
676
|
-
)
|
677
|
-
|
678
|
-
# Verify behavior
|
679
|
-
assert result.exit_code == 0
|
680
|
-
assert "Failed to create admin user" in result.output
|
681
|
-
|
682
622
|
def test_createadmin_with_prompts(self, mocker: MockerFixture) -> None:
|
683
623
|
"""Test creating admin with interactive prompts for credentials."""
|
684
624
|
# Mock prompts
|
@@ -738,25 +678,3 @@ class TestCreateAdminCommand:
|
|
738
678
|
# Verify behavior
|
739
679
|
assert result.exit_code == 0
|
740
680
|
assert "Error connecting to Jivas Server: Connection refused" in result.output
|
741
|
-
|
742
|
-
def test_createadmin_jac_command_exception(self, mocker: MockerFixture) -> None:
|
743
|
-
"""Test behavior when jac command raises an exception."""
|
744
|
-
# Mock subprocess to raise an exception
|
745
|
-
mocker.patch(
|
746
|
-
"jvcli.commands.server.subprocess.call",
|
747
|
-
side_effect=Exception("Command not found"),
|
748
|
-
)
|
749
|
-
|
750
|
-
# Environment with DATABASE_HOST
|
751
|
-
mocker.patch.dict(os.environ, {"DATABASE_HOST": "postgres:5432"})
|
752
|
-
|
753
|
-
# Run command
|
754
|
-
runner = CliRunner()
|
755
|
-
result = runner.invoke(
|
756
|
-
server,
|
757
|
-
["createadmin", "--email", "admin@example.com", "--password", "admin123"],
|
758
|
-
)
|
759
|
-
|
760
|
-
# Verify behavior
|
761
|
-
assert result.exit_code == 0
|
762
|
-
assert "Error running jac command: Command not found" in result.output
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|