licos-dev-cli 0.2.14__tar.gz → 0.2.16__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.
- {licos_dev_cli-0.2.14 → licos_dev_cli-0.2.16}/.gitignore +5 -1
- {licos_dev_cli-0.2.14 → licos_dev_cli-0.2.16}/PKG-INFO +2 -2
- {licos_dev_cli-0.2.14 → licos_dev_cli-0.2.16}/pyproject.toml +2 -2
- {licos_dev_cli-0.2.14 → licos_dev_cli-0.2.16}/src/licos_dev_cli/main.py +26 -7
- licos_dev_cli-0.2.16/tests/test_credit_check.py +39 -0
- {licos_dev_cli-0.2.14 → licos_dev_cli-0.2.16}/src/licos_dev_cli/__init__.py +0 -0
- {licos_dev_cli-0.2.14 → licos_dev_cli-0.2.16}/tests/test_cli_output_paths.py +0 -0
|
@@ -12,6 +12,7 @@ packages/*/dist/
|
|
|
12
12
|
.vscode/
|
|
13
13
|
*.swp
|
|
14
14
|
*.swo
|
|
15
|
+
*.pyc
|
|
15
16
|
|
|
16
17
|
# OS
|
|
17
18
|
.DS_Store
|
|
@@ -33,13 +34,16 @@ crates/industrial/industrial-stack.env
|
|
|
33
34
|
# Build
|
|
34
35
|
*.log
|
|
35
36
|
*.pid
|
|
36
|
-
crates/industrial/bin/
|
|
37
37
|
.licos
|
|
38
38
|
.tmp
|
|
39
39
|
.playwright-cli
|
|
40
40
|
|
|
41
41
|
/tmp
|
|
42
|
+
crates/industrial/bin/
|
|
43
|
+
|
|
42
44
|
tools/android-sdk-cache/*.zip
|
|
45
|
+
tools/codegraph-cache/*.tgz
|
|
46
|
+
tools/codegraph-cache/*.tgz
|
|
43
47
|
|
|
44
48
|
*.codex-*
|
|
45
49
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: licos-dev-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.16
|
|
4
4
|
Summary: LICOS Dev CLI - generate files and call model capabilities
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: click>=8.1
|
|
7
|
-
Requires-Dist: licos-dev-sdk>=0.2.
|
|
7
|
+
Requires-Dist: licos-dev-sdk>=0.2.17
|
|
@@ -4,11 +4,11 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "licos-dev-cli"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.16"
|
|
8
8
|
description = "LICOS Dev CLI - generate files and call model capabilities"
|
|
9
9
|
requires-python = ">=3.10"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"licos-dev-sdk>=0.2.
|
|
11
|
+
"licos-dev-sdk>=0.2.17",
|
|
12
12
|
"click>=8.1",
|
|
13
13
|
]
|
|
14
14
|
|
|
@@ -89,13 +89,32 @@ def _echo_path(path: object) -> None:
|
|
|
89
89
|
|
|
90
90
|
# ── CLI Group ────────────────────────────────────────────────────────────────
|
|
91
91
|
|
|
92
|
-
@click.group()
|
|
93
|
-
def cli():
|
|
94
|
-
"""LICOS Dev - file generation and model CLI for AI agents."""
|
|
95
|
-
pass
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
@click.group()
|
|
93
|
+
def cli():
|
|
94
|
+
"""LICOS Dev - file generation and model CLI for AI agents."""
|
|
95
|
+
pass
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@cli.command("credit-check")
|
|
99
|
+
@click.option("--estimated-points", default=1, type=click.IntRange(min=1), show_default=True)
|
|
100
|
+
@click.option("--resource-type", default="MODEL_TOOL", show_default=True)
|
|
101
|
+
@click.option("--resource-code", default="MANUAL_CHECK", show_default=True)
|
|
102
|
+
@click.option("--request-id", default=None)
|
|
103
|
+
def credit_check(estimated_points, resource_type, resource_code, request_id):
|
|
104
|
+
"""Check whether the current SDK identity can execute a billed operation."""
|
|
105
|
+
from licos_dev_sdk import check_credit_availability
|
|
106
|
+
|
|
107
|
+
_echo_json(
|
|
108
|
+
check_credit_availability(
|
|
109
|
+
estimated_points=estimated_points,
|
|
110
|
+
resource_type=resource_type,
|
|
111
|
+
resource_code=resource_code,
|
|
112
|
+
request_id=request_id,
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# ── PDF ──────────────────────────────────────────────────────────────────────
|
|
99
118
|
|
|
100
119
|
@cli.command()
|
|
101
120
|
@click.option("-i", "--input", "input_path", help="Input file (Markdown or HTML)")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from unittest import mock
|
|
5
|
+
|
|
6
|
+
from click.testing import CliRunner
|
|
7
|
+
|
|
8
|
+
from licos_dev_cli.main import cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def test_credit_check_forwards_structured_options() -> None:
|
|
12
|
+
availability = {"allowed": True, "availableBalance": 100}
|
|
13
|
+
with mock.patch(
|
|
14
|
+
"licos_dev_sdk.check_credit_availability",
|
|
15
|
+
return_value=availability,
|
|
16
|
+
) as check:
|
|
17
|
+
result = CliRunner().invoke(
|
|
18
|
+
cli,
|
|
19
|
+
[
|
|
20
|
+
"credit-check",
|
|
21
|
+
"--estimated-points",
|
|
22
|
+
"2",
|
|
23
|
+
"--resource-type",
|
|
24
|
+
"MODEL_TOOL",
|
|
25
|
+
"--resource-code",
|
|
26
|
+
"IMAGE_GENERATE",
|
|
27
|
+
"--request-id",
|
|
28
|
+
"request-1",
|
|
29
|
+
],
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
assert result.exit_code == 0
|
|
33
|
+
assert json.loads(result.output) == availability
|
|
34
|
+
check.assert_called_once_with(
|
|
35
|
+
estimated_points=2,
|
|
36
|
+
resource_type="MODEL_TOOL",
|
|
37
|
+
resource_code="IMAGE_GENERATE",
|
|
38
|
+
request_id="request-1",
|
|
39
|
+
)
|
|
File without changes
|
|
File without changes
|