is-it-ai 0.1.0__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.
Potentially problematic release.
This version of is-it-ai might be problematic. Click here for more details.
- is_it_ai-0.1.0/PKG-INFO +40 -0
- is_it_ai-0.1.0/README.md +31 -0
- is_it_ai-0.1.0/pyproject.toml +16 -0
- is_it_ai-0.1.0/setup.cfg +4 -0
- is_it_ai-0.1.0/src/is_it_ai/__init__.py +6 -0
- is_it_ai-0.1.0/src/is_it_ai/detector.py +51 -0
- is_it_ai-0.1.0/src/is_it_ai.egg-info/PKG-INFO +40 -0
- is_it_ai-0.1.0/src/is_it_ai.egg-info/SOURCES.txt +8 -0
- is_it_ai-0.1.0/src/is_it_ai.egg-info/dependency_links.txt +1 -0
- is_it_ai-0.1.0/src/is_it_ai.egg-info/top_level.txt +1 -0
is_it_ai-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: is-it-ai
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Detect and verify if packages is executed within an AI agent environment
|
|
5
|
+
Author-email: Ben Needful <doing_the_needful@yahoo.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# is-it-ai
|
|
11
|
+
|
|
12
|
+
Detect and verify if package is being executed in an AI agent environment.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install is-it-ai
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Local Detection
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from is_it_ai import detect, is_claude_code
|
|
26
|
+
|
|
27
|
+
if detect():
|
|
28
|
+
print("Running under an AI agent")
|
|
29
|
+
|
|
30
|
+
if is_claude_code():
|
|
31
|
+
print("Running under Claude Code")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## API
|
|
35
|
+
|
|
36
|
+
- detect() - Detect if running under any known AI agent
|
|
37
|
+
- is_claude_code() - Detect Claude Code specifically
|
|
38
|
+
- is_perplexity() - Detect Perplexity specifically
|
|
39
|
+
- is_cursor() - Detect Cursor specifically
|
|
40
|
+
- is_codex() - Detect Codex specifically
|
is_it_ai-0.1.0/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# is-it-ai
|
|
2
|
+
|
|
3
|
+
Detect and verify if package is being executed in an AI agent environment.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install is-it-ai
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Local Detection
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from is_it_ai import detect, is_claude_code
|
|
17
|
+
|
|
18
|
+
if detect():
|
|
19
|
+
print("Running under an AI agent")
|
|
20
|
+
|
|
21
|
+
if is_claude_code():
|
|
22
|
+
print("Running under Claude Code")
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
- detect() - Detect if running under any known AI agent
|
|
28
|
+
- is_claude_code() - Detect Claude Code specifically
|
|
29
|
+
- is_perplexity() - Detect Perplexity specifically
|
|
30
|
+
- is_cursor() - Detect Cursor specifically
|
|
31
|
+
- is_codex() - Detect Codex specifically
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "is-it-ai"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Detect and verify if packages is executed within an AI agent environment"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [{ name="Ben Needful", email="doing_the_needful@yahoo.com" },]
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
dependencies = []
|
|
14
|
+
|
|
15
|
+
[tool.setuptools.packages.find]
|
|
16
|
+
where = ["src"]
|
is_it_ai-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Local AI agent detection."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def is_perplexity() -> bool:
|
|
7
|
+
"""
|
|
8
|
+
Detect if running under Perplexity based on environment variables.
|
|
9
|
+
|
|
10
|
+
Returns True if PI_PERPLEXITY_TOKEN or PERPLEXITY_API_KEY are set.
|
|
11
|
+
"""
|
|
12
|
+
return bool(os.environ.get('PI_PERPLEXITY_TOKEN') and os.environ.get('PERPLEXITY_API_KEY'))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def is_cursor() -> bool:
|
|
16
|
+
"""
|
|
17
|
+
Detect if running under Cursor based on environment variables.
|
|
18
|
+
|
|
19
|
+
Returns True if CURSOR_PROJECT_PATH or CURSOR_SESSION_ID are set.
|
|
20
|
+
"""
|
|
21
|
+
return bool(os.environ.get('CURSOR_PROJECT_PATH') and os.environ.get('CURSOR_SESSION_ID'))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def is_codex() -> bool:
|
|
25
|
+
"""
|
|
26
|
+
Detect if running under Codex based on environment variables.
|
|
27
|
+
|
|
28
|
+
Returns True if CODEX_HOME or CODEX_SQLITE_HOME are set.
|
|
29
|
+
"""
|
|
30
|
+
return bool(os.environ.get('CODEX_HOME') and os.environ.get('CODEX_SQLITE_HOME'))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def is_claude_code() -> bool:
|
|
34
|
+
"""
|
|
35
|
+
Detect if running under Claude Code based on environment variables.
|
|
36
|
+
|
|
37
|
+
Returns True if CLAUDE_PID or CLAUDE_CODE_ENTRYPOINT are set.
|
|
38
|
+
"""
|
|
39
|
+
return bool(os.environ.get('CLAUDE_PID') and os.environ.get('CLAUDE_CODE_ENTRYPOINT'))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def detect() -> bool:
|
|
43
|
+
"""
|
|
44
|
+
Detect if running under an AI agent.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
True if running under a detected AI agent, False otherwise.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
detectors = [is_perplexity, is_cursor, is_codex, is_claude_code]
|
|
51
|
+
return any(func() for func in detectors)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: is-it-ai
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Detect and verify if packages is executed within an AI agent environment
|
|
5
|
+
Author-email: Ben Needful <doing_the_needful@yahoo.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# is-it-ai
|
|
11
|
+
|
|
12
|
+
Detect and verify if package is being executed in an AI agent environment.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install is-it-ai
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Local Detection
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from is_it_ai import detect, is_claude_code
|
|
26
|
+
|
|
27
|
+
if detect():
|
|
28
|
+
print("Running under an AI agent")
|
|
29
|
+
|
|
30
|
+
if is_claude_code():
|
|
31
|
+
print("Running under Claude Code")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## API
|
|
35
|
+
|
|
36
|
+
- detect() - Detect if running under any known AI agent
|
|
37
|
+
- is_claude_code() - Detect Claude Code specifically
|
|
38
|
+
- is_perplexity() - Detect Perplexity specifically
|
|
39
|
+
- is_cursor() - Detect Cursor specifically
|
|
40
|
+
- is_codex() - Detect Codex specifically
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
is_it_ai
|