capiscio 2.0.0__py3-none-any.whl → 2.1.2__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.
capiscio/__init__.py CHANGED
@@ -1,10 +1,3 @@
1
- """
2
- Capiscio - A2A Protocol Validator and CLI Tool
1
+ """CapiscIO CLI package."""
3
2
 
4
- This package provides a Python wrapper around the Capiscio CLI tool,
5
- allowing easy installation and usage via pip.
6
- """
7
-
8
- __version__ = "2.0.0"
9
- __author__ = "Capiscio Team"
10
- __email__ = "hello@capiscio.com"
3
+ __version__ = "0.1.0"
capiscio/cli.py CHANGED
@@ -1,133 +1,50 @@
1
- #!/usr/bin/env python3
2
- """
3
- Capiscio CLI Wrapper
4
-
5
- This module provides a Python wrapper for the Capiscio CLI tool.
6
- It automatically detects the current platform and architecture,
7
- then executes the appropriate pre-built binary.
8
- """
9
-
10
- import os
11
1
  import sys
12
- import platform
13
- import subprocess
14
- from pathlib import Path
15
- from typing import List, Optional
16
-
17
-
18
- def get_platform_binary() -> str:
19
- """
20
- Determine the correct binary name for the current platform and architecture.
21
-
22
- Returns:
23
- str: The binary filename for this platform
24
-
25
- Raises:
26
- RuntimeError: If the platform/architecture combination is not supported
27
- """
28
- system = platform.system().lower()
29
- machine = platform.machine().lower()
30
-
31
- # Normalize architecture names
32
- if machine in ('x86_64', 'amd64'):
33
- arch = 'x64'
34
- elif machine in ('arm64', 'aarch64'):
35
- arch = 'arm64'
36
- else:
37
- # Default to x64 for unknown architectures
38
- arch = 'x64'
39
-
40
- # Map platform names
41
- if system == 'linux':
42
- return f'capiscio-linux-{arch}'
43
- elif system == 'darwin': # macOS
44
- return f'capiscio-darwin-{arch}'
45
- elif system == 'windows':
46
- return f'capiscio-win-{arch}.exe'
47
- else:
48
- raise RuntimeError(f"Unsupported platform: {system} {machine}")
49
-
50
-
51
- def get_binary_path() -> Path:
52
- """
53
- Get the full path to the appropriate binary for this platform.
54
-
55
- Returns:
56
- Path: Path to the binary file
57
-
58
- Raises:
59
- FileNotFoundError: If the binary doesn't exist
60
- RuntimeError: If the platform is not supported
61
- """
62
- binary_name = get_platform_binary()
63
-
64
- # Get the directory where this Python file is located
65
- package_dir = Path(__file__).parent
66
- binary_path = package_dir / 'binaries' / binary_name
67
-
68
- if not binary_path.exists():
69
- available_binaries = list((package_dir / 'binaries').glob('*'))
70
- available_names = [b.name for b in available_binaries if b.is_file()]
2
+ import shutil
3
+ from rich.console import Console
4
+ from capiscio.manager import run_core, get_cache_dir
5
+
6
+ console = Console()
7
+
8
+ def main():
9
+ """
10
+ Main entry point for the CapiscIO CLI wrapper.
11
+
12
+ This wrapper manages the download and execution of the platform-specific
13
+ capiscio-core binary.
14
+ """
15
+ args = sys.argv[1:]
16
+
17
+ # Handle wrapper-specific maintenance commands
18
+ if len(args) > 0:
19
+ if args[0] == "--wrapper-clean":
20
+ try:
21
+ cache_dir = get_cache_dir()
22
+ if cache_dir.exists():
23
+ shutil.rmtree(cache_dir)
24
+ console.print(f"[green]Cleaned cache directory:[/green] {cache_dir}")
25
+ else:
26
+ console.print("[yellow]Cache directory does not exist.[/yellow]")
27
+ sys.exit(0)
28
+ except Exception as e:
29
+ console.print(f"[red]Failed to clean cache:[/red] {e}")
30
+ sys.exit(1)
31
+
32
+ elif args[0] == "--wrapper-version":
33
+ from importlib.metadata import version
34
+ try:
35
+ v = version("capiscio")
36
+ console.print(f"capiscio-python wrapper v{v}")
37
+ except Exception:
38
+ console.print("capiscio-python wrapper (unknown version)")
39
+ sys.exit(0)
71
40
 
72
- raise FileNotFoundError(
73
- f"Binary '{binary_name}' not found. "
74
- f"Available binaries: {', '.join(available_names) or 'none'}"
75
- )
76
-
77
- return binary_path
78
-
79
-
80
- def run_capiscio(args: Optional[List[str]] = None) -> int:
81
- """
82
- Execute the Capiscio CLI tool with the given arguments.
83
-
84
- Args:
85
- args: Command line arguments to pass to capiscio (default: sys.argv[1:])
86
-
87
- Returns:
88
- int: Exit code from the capiscio process
89
-
90
- Raises:
91
- FileNotFoundError: If the binary doesn't exist
92
- RuntimeError: If the platform is not supported
93
- """
94
- if args is None:
95
- args = sys.argv[1:]
96
-
97
- binary_path = get_binary_path()
98
-
99
- # Make sure the binary is executable on Unix-like systems
100
- if os.name != 'nt': # Not Windows
101
- os.chmod(binary_path, 0o755)
102
-
103
- try:
104
- # Execute the binary with the provided arguments
105
- result = subprocess.run([str(binary_path)] + args)
106
- return result.returncode
107
- except KeyboardInterrupt:
108
- # Handle Ctrl+C gracefully
109
- return 130
110
- except Exception as e:
111
- print(f"Error executing capiscio: {e}", file=sys.stderr)
112
- return 1
113
-
114
-
115
- def main() -> int:
116
- """
117
- Main entry point for the capiscio command.
118
-
119
- This function is called when running `capiscio` from the command line
120
- after installing the package via pip.
121
-
122
- Returns:
123
- int: Exit code
124
- """
125
- try:
126
- return run_capiscio()
127
- except Exception as e:
128
- print(f"capiscio: {e}", file=sys.stderr)
129
- return 1
41
+ # If we handled a wrapper command, we shouldn't reach here if we used sys.exit
42
+ # But if we didn't use sys.exit (e.g. in a test mock), we need to return
43
+ if args[0].startswith("--wrapper-"):
44
+ return
130
45
 
46
+ # Delegate to the core binary
47
+ sys.exit(run_core(args))
131
48
 
132
- if __name__ == '__main__':
133
- sys.exit(main())
49
+ if __name__ == "__main__":
50
+ main()
capiscio/manager.py ADDED
@@ -0,0 +1,143 @@
1
+ import os
2
+ import sys
3
+ import platform
4
+ import stat
5
+ import shutil
6
+ import logging
7
+ import subprocess
8
+ from pathlib import Path
9
+ from typing import Optional, Tuple
10
+
11
+ import requests
12
+ from platformdirs import user_cache_dir
13
+ from rich.console import Console
14
+ from rich.progress import Progress, SpinnerColumn, TextColumn
15
+
16
+ console = Console()
17
+ logger = logging.getLogger(__name__)
18
+
19
+ # Configuration
20
+ CORE_VERSION = "2.1.2" # Matches the python package version
21
+ GITHUB_REPO = "capiscio/capiscio-core"
22
+ BINARY_NAME = "capiscio"
23
+
24
+ def get_platform_info() -> Tuple[str, str]:
25
+ """
26
+ Determine the OS and Architecture.
27
+ Returns: (os_name, arch_name)
28
+ """
29
+ system = platform.system().lower()
30
+ machine = platform.machine().lower()
31
+
32
+ # Normalize OS
33
+ if system == "darwin":
34
+ os_name = "darwin"
35
+ elif system == "linux":
36
+ os_name = "linux"
37
+ elif system == "windows":
38
+ os_name = "windows"
39
+ else:
40
+ raise RuntimeError(f"Unsupported operating system: {system}")
41
+
42
+ # Normalize Architecture
43
+ if machine in ("x86_64", "amd64"):
44
+ arch_name = "amd64"
45
+ elif machine in ("arm64", "aarch64"):
46
+ arch_name = "arm64"
47
+ else:
48
+ raise RuntimeError(f"Unsupported architecture: {machine}")
49
+
50
+ return os_name, arch_name
51
+
52
+ def get_binary_filename(os_name: str, arch_name: str) -> str:
53
+ """Get the expected binary name for the platform."""
54
+ ext = ".exe" if os_name == "windows" else ""
55
+ return f"capiscio-{os_name}-{arch_name}{ext}"
56
+
57
+ def get_cache_dir() -> Path:
58
+ """Get the directory where binaries are stored."""
59
+ cache_dir = Path(user_cache_dir("capiscio", "capiscio")) / "bin"
60
+ cache_dir.mkdir(parents=True, exist_ok=True)
61
+ return cache_dir
62
+
63
+ def get_binary_path(version: str) -> Path:
64
+ """Get the full path to the binary for a specific version."""
65
+ os_name, arch_name = get_platform_info()
66
+ filename = get_binary_filename(os_name, arch_name)
67
+ # We might want to version the binary filename or put it in a versioned folder
68
+ # For now, let's put it in a versioned folder
69
+ return get_cache_dir() / version / filename
70
+
71
+ def download_binary(version: str) -> Path:
72
+ """
73
+ Download the binary for the current platform and version.
74
+ Returns the path to the executable.
75
+ """
76
+ os_name, arch_name = get_platform_info()
77
+ filename = get_binary_filename(os_name, arch_name)
78
+ target_path = get_binary_path(version)
79
+
80
+ if target_path.exists():
81
+ return target_path
82
+
83
+ # Construct URL
84
+ # Assuming standard GitHub release naming convention
85
+ url = f"https://github.com/{GITHUB_REPO}/releases/download/v{version}/{filename}"
86
+
87
+ console.print(f"[cyan]Downloading CapiscIO Core v{version} for {os_name}/{arch_name}...[/cyan]")
88
+
89
+ try:
90
+ with requests.get(url, stream=True) as r:
91
+ r.raise_for_status()
92
+ total_size = int(r.headers.get('content-length', 0))
93
+
94
+ # Ensure directory exists
95
+ target_path.parent.mkdir(parents=True, exist_ok=True)
96
+
97
+ with Progress(
98
+ SpinnerColumn(),
99
+ TextColumn("[progress.description]{task.description}"),
100
+ transient=True,
101
+ ) as progress:
102
+ task = progress.add_task(f"Downloading...", total=total_size)
103
+
104
+ with open(target_path, 'wb') as f:
105
+ for chunk in r.iter_content(chunk_size=8192):
106
+ f.write(chunk)
107
+ progress.update(task, advance=len(chunk))
108
+
109
+ # Make executable
110
+ st = os.stat(target_path)
111
+ os.chmod(target_path, st.st_mode | stat.S_IEXEC)
112
+
113
+ console.print(f"[green]Successfully installed CapiscIO Core v{version}[/green]")
114
+ return target_path
115
+
116
+ except requests.exceptions.RequestException as e:
117
+ if target_path.exists():
118
+ target_path.unlink()
119
+ raise RuntimeError(f"Failed to download binary from {url}: {e}")
120
+ except Exception as e:
121
+ if target_path.exists():
122
+ target_path.unlink()
123
+ raise RuntimeError(f"Failed to install binary: {e}")
124
+
125
+ def run_core(args: list[str]) -> int:
126
+ """
127
+ Ensure binary exists and run it with provided args.
128
+ Returns exit code.
129
+ """
130
+ try:
131
+ binary_path = download_binary(CORE_VERSION)
132
+
133
+ # Replace the current process with the binary
134
+ # This is cleaner than subprocess for a wrapper
135
+ if platform.system() == "Windows":
136
+ return subprocess.call([str(binary_path)] + args)
137
+ else:
138
+ os.execv(str(binary_path), [str(binary_path)] + args)
139
+ return 0 # Should not be reached
140
+
141
+ except Exception as e:
142
+ console.print(f"[bold red]Error:[/bold red] {e}")
143
+ return 1
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.4
2
+ Name: capiscio
3
+ Version: 2.1.2
4
+ Summary: The official CapiscIO CLI tool for validating A2A agents.
5
+ Project-URL: Homepage, https://capisc.io
6
+ Project-URL: Documentation, https://docs.capisc.io/cli
7
+ Project-URL: Repository, https://github.com/capiscio/capiscio-python
8
+ Project-URL: Issues, https://github.com/capiscio/capiscio-python/issues
9
+ Author-email: Capiscio Team <team@capisc.io>
10
+ License: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: a2a,agent,capiscio,cli,tool,validation
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.10
23
+ Requires-Dist: platformdirs>=4.0.0
24
+ Requires-Dist: requests>=2.31.0
25
+ Requires-Dist: rich>=13.0.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: build; extra == 'dev'
28
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
29
+ Requires-Dist: twine; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # CapiscIO CLI (Python)
33
+
34
+ **The official command-line interface for CapiscIO, the Agent-to-Agent (A2A) validation platform.**
35
+
36
+ [![PyPI version](https://badge.fury.io/py/capiscio.svg)](https://badge.fury.io/py/capiscio)
37
+ [![Python Versions](https://img.shields.io/pypi/pyversions/capiscio.svg)](https://pypi.org/project/capiscio/)
38
+ [![License](https://img.shields.io/github/license/capiscio/capiscio-python)](https://github.com/capiscio/capiscio-python/blob/main/LICENSE)
39
+ [![Downloads](https://pepy.tech/badge/capiscio)](https://pepy.tech/project/capiscio)
40
+
41
+ ## Overview
42
+
43
+ This package provides a convenient Python distribution for the **CapiscIO CLI**. It acts as a smart wrapper that automatically manages the underlying `capiscio-core` binary (written in Go), ensuring you always have the correct executable for your operating system and architecture.
44
+
45
+ > **Note:** This is a wrapper. The core logic resides in [capiscio-core](https://github.com/capiscio/capiscio-core).
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ pip install capiscio
51
+ ```
52
+
53
+ ## Usage
54
+
55
+ Once installed, the `capiscio` command is available in your terminal. It passes all arguments directly to the core binary.
56
+
57
+ ```bash
58
+ # Validate an agent
59
+ capiscio validate https://my-agent.example.com
60
+
61
+ # Check compliance score
62
+ capiscio score https://my-agent.example.com
63
+
64
+ # Check version
65
+ capiscio --version
66
+ ```
67
+
68
+ ### Wrapper Utilities
69
+
70
+ The Python wrapper includes specific commands to manage the binary:
71
+
72
+ | Command | Description |
73
+ |---------|-------------|
74
+ | `capiscio --wrapper-version` | Display the version of this Python wrapper package. |
75
+ | `capiscio --wrapper-clean` | Remove the cached `capiscio-core` binary (forces re-download on next run). |
76
+
77
+ ## How It Works
78
+
79
+ 1. **Detection**: When you run `capiscio`, the script detects your OS (Linux, macOS, Windows) and Architecture (AMD64, ARM64).
80
+ 2. **Provisioning**: It checks if the correct `capiscio-core` binary is present in your user cache.
81
+ * *Linux*: `~/.cache/capiscio/bin`
82
+ * *macOS*: `~/Library/Caches/capiscio/bin`
83
+ * *Windows*: `%LOCALAPPDATA%\capiscio\bin`
84
+ 3. **Download**: If missing, it securely downloads the release from GitHub.
85
+ 4. **Execution**: It seamlessly replaces the Python process with the Go binary, ensuring zero overhead during execution.
86
+
87
+ ## Supported Platforms
88
+
89
+ - **macOS**: AMD64 (Intel), ARM64 (Apple Silicon)
90
+ - **Linux**: AMD64, ARM64
91
+ - **Windows**: AMD64
92
+
93
+ ## Troubleshooting
94
+
95
+ **"Permission denied" errors:**
96
+ Ensure your user has write access to the cache directory. You can reset the cache by running:
97
+ ```bash
98
+ capiscio --wrapper-clean
99
+ ```
100
+
101
+ **"Binary not found" or download errors:**
102
+ If you are behind a corporate firewall, ensure you can access `github.com`.
103
+
104
+ ## License
105
+
106
+ Apache-2.0
@@ -0,0 +1,8 @@
1
+ capiscio/__init__.py,sha256=TXit6o-1pP1R4IW4nSPhkrovW8V4USVHnnXUlTzjt58,51
2
+ capiscio/cli.py,sha256=9Cn5qLIP4-b8A4R1rHD2qN10RPnAqV7smy-lDsPAv18,1676
3
+ capiscio/manager.py,sha256=29kf-lF6myvfqYQ8Szph2qtb7I8OEPbQB6bxL6dVT9Q,4799
4
+ capiscio-2.1.2.dist-info/METADATA,sha256=G-vVndLzzndprLQlY9uDIiWOUxk0tQdvgZGbkVkvgU0,3950
5
+ capiscio-2.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ capiscio-2.1.2.dist-info/entry_points.txt,sha256=VopPHB5eo2LBjOFiraE3JiEOzVmJJVwtUPVfXlYS_ns,47
7
+ capiscio-2.1.2.dist-info/licenses/LICENSE,sha256=de-gfE0q-xTYImzwC3dj3S7BxVhanf6RmIGjo_7y3aw,11357
8
+ capiscio-2.1.2.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
Binary file
Binary file
Binary file
Binary file
@@ -1,289 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: capiscio
3
- Version: 2.0.0
4
- Summary: The definitive A2A protocol validator with live endpoint testing, JWS signature verification, and transport protocol compliance checking
5
- Author-email: Capiscio Team <hello@capiscio.com>
6
- Maintainer-email: Capiscio Team <hello@capiscio.com>
7
- License: MIT
8
- Project-URL: Homepage, https://capisc.io
9
- Project-URL: Documentation, https://capisc.io/cli
10
- Project-URL: Repository, https://github.com/capiscio/capiscio-cli
11
- Project-URL: Bug Reports, https://github.com/capiscio/capiscio-cli/issues
12
- Project-URL: Changelog, https://github.com/capiscio/capiscio-cli/releases
13
- Project-URL: Download, https://capisc.io/downloads
14
- Project-URL: Web Validator, https://capisc.io/validator
15
- Project-URL: Source, https://github.com/capiscio/capiscio-cli
16
- Keywords: a2a,protocol,validation,cli,agent,ai,jsonrpc,grpc,rest,jws,signature,verification,transport,testing,compliance,agent-card,llm,agent-to-agent,cryptography,security,endpoint
17
- Classifier: Development Status :: 4 - Beta
18
- Classifier: Intended Audience :: Developers
19
- Classifier: Intended Audience :: System Administrators
20
- Classifier: Intended Audience :: Information Technology
21
- Classifier: License :: OSI Approved :: MIT License
22
- Classifier: Programming Language :: Python :: 3
23
- Classifier: Programming Language :: Python :: 3.7
24
- Classifier: Programming Language :: Python :: 3.8
25
- Classifier: Programming Language :: Python :: 3.9
26
- Classifier: Programming Language :: Python :: 3.10
27
- Classifier: Programming Language :: Python :: 3.11
28
- Classifier: Programming Language :: Python :: 3.12
29
- Classifier: Programming Language :: Python :: 3.13
30
- Classifier: Operating System :: OS Independent
31
- Classifier: Environment :: Console
32
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
- Classifier: Topic :: Software Development :: Quality Assurance
34
- Classifier: Topic :: Software Development :: Testing
35
- Classifier: Topic :: Internet :: WWW/HTTP
36
- Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
37
- Classifier: Topic :: Security :: Cryptography
38
- Classifier: Topic :: System :: Networking
39
- Classifier: Topic :: System :: Distributed Computing
40
- Requires-Python: >=3.7
41
- Description-Content-Type: text/markdown
42
-
43
- # Capiscio CLI - A2A Protocol Validator
44
-
45
- > **Validator & A2A Protocol Compliance CLI** | The only CLI that actually tests AI agent transport protocols. Validate agent-card.json files, A2A compliance across JSONRPC, GRPC, and REST with live endpoint testing.
46
-
47
- 🌐 **[Learn more about Capiscio](https://capisc.io)** | **[Download Page](https://capisc.io/downloads)** | **[Web Validator](https://capisc.io/validator)**
48
-
49
- [![PyPI version](https://badge.fury.io/py/capiscio.svg)](https://badge.fury.io/py/capiscio)
50
- [![Downloads](https://img.shields.io/pypi/dm/capiscio)](https://pypi.org/project/capiscio/)
51
- [![Python](https://img.shields.io/badge/python-3.7+-blue.svg)](https://python.org/)
52
- [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/capiscio/capiscio-cli/blob/main/LICENSE)
53
- [![Security](https://img.shields.io/badge/security-JWS%20verified-green.svg)](https://capisc.io)
54
- [![A2A Protocol](https://img.shields.io/badge/A2A-v0.3.0-purple.svg)](https://capisc.io)
55
-
56
- ## Installation
57
-
58
- ```bash
59
- pip install capiscio
60
- ```
61
-
62
- **Zero dependencies required** - This package contains pre-built native binaries that work without Python runtime dependencies.
63
-
64
- ## Quick Start
65
-
66
- **💡 Prefer a web interface?** Try our [online validator at capisc.io](https://capisc.io/validator) - no installation required!
67
-
68
- ```bash
69
- # Validate your agent (with signature verification)
70
- capiscio validate ./agent-card.json
71
-
72
- # Test live endpoints with cryptographic verification
73
- capiscio validate https://your-agent.com
74
-
75
- # Strict validation for production deployment
76
- capiscio validate ./agent-card.json --strict --json
77
-
78
- # Skip signature verification when not needed
79
- capiscio validate ./agent-card.json --skip-signature
80
- ```
81
-
82
- ## Security & Trust 🔐
83
-
84
- **Industry-grade cryptographic validation:**
85
- - ✅ **RFC 7515 compliant** JWS signature verification
86
- - ✅ **HTTPS-only** JWKS endpoint fetching
87
- - ✅ **Secure by default** - signatures checked automatically
88
- - ✅ **Zero trust** - verify before you trust any agent card
89
- - ✅ **Production ready** - meets enterprise security standards
90
-
91
- **Why signature verification matters:**
92
- - **Prevent tampering** - Detect modified or malicious agent cards
93
- - **Establish authenticity** - Cryptographically verify publisher identity
94
- - **Enable trust networks** - Build secure agent ecosystems
95
- - **Regulatory compliance** - Meet security audit requirements
96
-
97
- ## Key Features
98
-
99
- - **🚀 Transport Protocol Testing** - Actually tests JSONRPC, GRPC, and REST endpoints
100
- - **🔐 JWS Signature Verification** - Cryptographic validation of agent cards (RFC 7515 compliant)
101
- - **💻 Native Binaries** - No Node.js or runtime dependencies required
102
- - **🔍 Smart Discovery** - Finds agent cards automatically with multiple fallbacks
103
- - **⚡ Three Validation Modes** - Progressive, strict, and conservative
104
- - **🔧 CI/CD Ready** - JSON output with proper exit codes
105
- - **🌐 Live Endpoint Testing** - Validates real connectivity, not just schemas
106
- - **🛡️ Secure by Default** - Signature verification enabled automatically
107
-
108
- ## Usage Examples
109
-
110
- ### Basic Commands
111
-
112
- ```bash
113
- capiscio validate [input] [options]
114
-
115
- # Examples
116
- capiscio validate # Auto-detect in current directory
117
- capiscio validate ./agent-card.json # Validate local file (with signatures)
118
- capiscio validate https://agent.com # Test live agent (with signatures)
119
- capiscio validate ./agent-card.json --skip-signature # Skip signature verification
120
- capiscio validate ./agent-card.json --verbose # Detailed output
121
- capiscio validate ./agent-card.json --registry-ready # Check registry readiness
122
- capiscio validate https://agent.com --errors-only # Show only problems
123
- ```
124
-
125
- ### Key Options
126
-
127
- | Option | Description |
128
- |--------|-------------|
129
- | --strict | Strict A2A protocol compliance |
130
- | --json | JSON output for CI/CD |
131
- | --verbose | Detailed validation steps |
132
- | --timeout <ms> | Request timeout (default: 10000) |
133
- | --schema-only | Skip live endpoint testing |
134
- | --skip-signature | Skip JWS signature verification |
135
- | --test-live | Test agent endpoint with real messages |
136
-
137
- ### Three-Dimensional Scoring
138
-
139
- Capiscio CLI automatically provides detailed quality scoring across three independent dimensions:
140
-
141
- ```bash
142
- # Scoring is shown by default
143
- capiscio validate agent.json
144
- ```
145
-
146
- **Three Quality Dimensions:**
147
- - **Spec Compliance (0-100)** - How well does the agent conform to A2A v0.3.0?
148
- - **Trust (0-100)** - How trustworthy and secure is this agent? (includes confidence multiplier)
149
- - **Availability (0-100)** - Is the endpoint operational? (requires `--test-live`)
150
-
151
- Each score includes a detailed breakdown showing exactly what contributed to the result. **Learn more:** [Scoring System Documentation](https://github.com/capiscio/capiscio-cli/blob/main/docs/scoring-system.md)
152
-
153
- ### Live Agent Testing
154
-
155
- The `--test-live` flag tests your agent endpoint with real A2A protocol messages:
156
-
157
- ```bash
158
- # Test agent endpoint
159
- capiscio validate https://agent.com --test-live
160
-
161
- # Test with custom timeout
162
- capiscio validate ./agent-card.json --test-live --timeout 5000
163
-
164
- # Full validation for production
165
- capiscio validate https://agent.com --test-live --strict --json
166
- ```
167
-
168
- **What it validates:**
169
- - ✅ Endpoint connectivity
170
- - ✅ JSONRPC and HTTP+JSON transport protocols
171
- - ✅ A2A message structure (Message, Task, StatusUpdate, ArtifactUpdate)
172
- - ✅ Response timing metrics
173
-
174
- **Exit codes for automation:**
175
- - `0` = Success
176
- - `1` = Schema validation failed
177
- - `2` = Network error (timeout, connection refused, DNS)
178
- - `3` = Protocol violation (invalid A2A response)
179
-
180
- **Use cases:**
181
- - CI/CD post-deployment verification
182
- - Cron-based health monitoring
183
- - Pre-production testing
184
- - Third-party agent evaluation
185
- - Multi-environment validation
186
-
187
- ## Signature Verification (New in v1.2.0)
188
-
189
- **Secure by default** JWS signature verification for agent cards:
190
-
191
- ### 🔐 Cryptographic Validation
192
- - **RFC 7515 compliant** JWS (JSON Web Signature) verification
193
- - **JWKS (JSON Web Key Set)** fetching from trusted sources
194
- - **Detached signature** support for agent card authentication
195
- - **HTTPS-only** JWKS endpoints for security
196
-
197
- ### 🛡️ Security Benefits
198
- - **Authenticity** - Verify agent cards haven't been tampered with
199
- - **Trust** - Cryptographically confirm the publisher's identity
200
- - **Security** - Prevent malicious agent card injection
201
- - **Compliance** - Meet security requirements for production deployments
202
-
203
- ## Why Use Capiscio CLI?
204
-
205
- **Catch Integration Issues Before Production:**
206
- - ❌ Schema validators miss broken JSONRPC endpoints
207
- - ❌ Manual testing doesn't cover all transport protocols
208
- - ❌ Integration failures happen at runtime
209
- - ❌ Unsigned agent cards can't be trusted
210
- - ✅ **Capiscio tests actual connectivity and protocol compliance**
211
- - ✅ **Capiscio verifies cryptographic signatures for authenticity**
212
-
213
- **Real Problems This Solves:**
214
- - JSONRPC methods return wrong error codes
215
- - GRPC services are unreachable or misconfigured
216
- - REST endpoints don't match declared capabilities
217
- - Agent cards validate but agents don't work
218
- - Unsigned or tampered agent cards pose security risks
219
-
220
- ## Transport Protocol Testing
221
-
222
- Unlike basic schema validators, Capiscio CLI actually tests your agent endpoints:
223
-
224
- - **JSONRPC** - Validates JSON-RPC 2.0 compliance and connectivity
225
- - **GRPC** - Tests gRPC endpoint accessibility
226
- - **REST** - Verifies HTTP+JSON endpoint patterns
227
- - **Consistency** - Ensures equivalent functionality across protocols
228
-
229
- Perfect for testing your own agents and evaluating third-party agents before integration.
230
-
231
- ## CI/CD Integration
232
-
233
- ### GitHub Actions Example:
234
- ```yaml
235
- - name: Install and Validate Agent
236
- run: |
237
- pip install capiscio
238
- capiscio validate ./agent-card.json --json --strict
239
- ```
240
-
241
- ### Docker Example:
242
- ```dockerfile
243
- RUN pip install capiscio
244
- COPY agent-card.json .
245
- RUN capiscio validate ./agent-card.json --strict
246
- ```
247
-
248
- Exit codes: 0 = success, 1 = validation failed
249
-
250
- ## Platform Support
251
-
252
- This package contains pre-built binaries for multiple platforms:
253
-
254
- - **Linux**: x86_64, ARM64
255
- - **macOS**: Intel (x64), Apple Silicon (ARM64)
256
- - **Windows**: x64 (ARM64 available via [direct download](https://capisc.io/downloads))
257
- - **Python**: 3.7+ (no runtime dependencies required)
258
-
259
- The Python wrapper automatically detects your platform and runs the appropriate native binary.
260
-
261
- ## FAQ
262
-
263
- **Q: What is the A2A Protocol?**
264
- A: The Agent-to-Agent (A2A) protocol v0.3.0 is a standardized specification for AI agent discovery, communication, and interoperability. [Learn more at capisc.io](https://capisc.io).
265
-
266
- **Q: How is this different from schema validators?**
267
- A: We actually test live JSONRPC, GRPC, and REST endpoints with transport protocol validation, not just JSON schema structure. We also verify JWS signatures for cryptographic authenticity.
268
-
269
- **Q: Do I need Node.js installed?**
270
- A: No! This Python package contains pre-built native binaries that work without any Node.js dependency.
271
-
272
- **Q: Can I validate LLM agent cards?**
273
- A: Yes! Perfect for AI/LLM developers validating agent configurations and testing third-party agents before integration.
274
-
275
- ## Development
276
-
277
- This package contains pre-built native binaries compiled for maximum performance and zero dependencies. The CLI provides the same functionality across all platforms without requiring any additional runtime installations.
278
-
279
- **Source code:** https://github.com/capiscio/capiscio-cli
280
-
281
- ## License
282
-
283
- MIT License - see the [main repository](https://github.com/capiscio/capiscio-cli/blob/main/LICENSE) for details.
284
-
285
- ---
286
-
287
- **Need help?** [Visit capisc.io](https://capisc.io) | [Open an issue](https://github.com/capiscio/capiscio-cli/issues) | [Documentation](https://capisc.io/cli) | [Web Validator](https://capisc.io/validator)
288
-
289
- **Keywords**: A2A protocol, AI agent validation, agent-card.json validator, Python CLI, agent-to-agent protocol, LLM agent cards, AI agent discovery, transport protocol testing, JSONRPC validation, GRPC testing, JWS signature verification
@@ -1,11 +0,0 @@
1
- capiscio/__init__.py,sha256=26rK67aWRdEmd17v53GiY2UwrTEcSW7ZQVFCqAH_N20,255
2
- capiscio/cli.py,sha256=bQ_BJVsthM1Bd7Y658Gjcj9xadl2zSWGIQjesARm0Tg,3650
3
- capiscio/binaries/capiscio-darwin-arm64,sha256=d3rePOhXDLJwarp2mQ_3-2P4Uc2px8cIfv_42Dbo3dw,50664768
4
- capiscio/binaries/capiscio-darwin-x64,sha256=HvtBoMedoCj-UyVE1S3hXm6DwjrH-LXA8Gx25bthQGM,56886032
5
- capiscio/binaries/capiscio-linux-x64,sha256=ANoz3u4BQPDZ-MV9KsZZgDJqRVdNpHrkoNDeadb27VE,52196445
6
- capiscio/binaries/capiscio-win-x64.exe,sha256=eTvfit_F1jvFUKvwSDV3TiuAGd8b1WzKH5ah6HqqQeU,43408670
7
- capiscio-2.0.0.dist-info/METADATA,sha256=MyByQPdQ5PIwy568gFq-gP_yQZX2dSzx3pSkHqaHl1Q,12180
8
- capiscio-2.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
- capiscio-2.0.0.dist-info/entry_points.txt,sha256=VopPHB5eo2LBjOFiraE3JiEOzVmJJVwtUPVfXlYS_ns,47
10
- capiscio-2.0.0.dist-info/top_level.txt,sha256=Kuk2V-rnWre1x0tW87SRnlteIV1NhngUaXo6V1klMHk,9
11
- capiscio-2.0.0.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- capiscio