node9 1.0.3__tar.gz → 1.1.1__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.
Files changed (29) hide show
  1. node9-1.1.1/.github/workflows/ai-review.yml +25 -0
  2. node9-1.1.1/CHANGELOG.md +56 -0
  3. {node9-1.0.3 → node9-1.1.1}/PKG-INFO +1 -1
  4. {node9-1.0.3 → node9-1.1.1}/pyproject.toml +1 -1
  5. node9-1.1.1/scripts/ai-review.mjs +79 -0
  6. node9-1.0.3/CHANGELOG.md +0 -31
  7. {node9-1.0.3 → node9-1.1.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  8. {node9-1.0.3 → node9-1.1.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  9. {node9-1.0.3 → node9-1.1.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  10. {node9-1.0.3 → node9-1.1.1}/.github/workflows/auto-pr.yml +0 -0
  11. {node9-1.0.3 → node9-1.1.1}/.github/workflows/ci.yml +0 -0
  12. {node9-1.0.3 → node9-1.1.1}/.github/workflows/release.yml +0 -0
  13. {node9-1.0.3 → node9-1.1.1}/.gitignore +0 -0
  14. {node9-1.0.3 → node9-1.1.1}/LICENSE +0 -0
  15. {node9-1.0.3 → node9-1.1.1}/README.md +0 -0
  16. {node9-1.0.3 → node9-1.1.1}/conftest.py +0 -0
  17. {node9-1.0.3 → node9-1.1.1}/examples/basic.py +0 -0
  18. {node9-1.0.3 → node9-1.1.1}/examples/crewai_agent.py +0 -0
  19. {node9-1.0.3 → node9-1.1.1}/examples/langchain_agent.py +0 -0
  20. {node9-1.0.3 → node9-1.1.1}/node9/__init__.py +0 -0
  21. {node9-1.0.3 → node9-1.1.1}/node9/_client.py +0 -0
  22. {node9-1.0.3 → node9-1.1.1}/node9/_config.py +0 -0
  23. {node9-1.0.3 → node9-1.1.1}/node9/_decorator.py +0 -0
  24. {node9-1.0.3 → node9-1.1.1}/node9/_exceptions.py +0 -0
  25. {node9-1.0.3 → node9-1.1.1}/scripts/e2e.sh +0 -0
  26. {node9-1.0.3 → node9-1.1.1}/tests/test_client.py +0 -0
  27. {node9-1.0.3 → node9-1.1.1}/tests/test_config.py +0 -0
  28. {node9-1.0.3 → node9-1.1.1}/tests/test_decorator.py +0 -0
  29. {node9-1.0.3 → node9-1.1.1}/tests/test_exceptions.py +0 -0
@@ -0,0 +1,25 @@
1
+ name: AI Code Review
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ review:
9
+ name: Claude Code Review
10
+ runs-on: ubuntu-latest
11
+ # Skip if the PR was opened by the bot itself
12
+ if: github.actor != 'github-actions[bot]'
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Install dependencies
18
+ run: npm install @anthropic-ai/sdk @octokit/rest
19
+
20
+ - name: Run AI Review
21
+ env:
22
+ GITHUB_TOKEN: ${{ secrets.AUTO_PR_TOKEN }}
23
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
24
+ PR_NUMBER: ${{ github.event.pull_request.number }}
25
+ run: node scripts/ai-review.mjs
@@ -0,0 +1,56 @@
1
+ # CHANGELOG
2
+
3
+ <!-- version list -->
4
+
5
+ ## v1.1.1 (2026-03-17)
6
+
7
+ ### Bug Fixes
8
+
9
+ - Rename job to Claude, add env validation and diff size limit
10
+ ([`24aca72`](https://github.com/node9-ai/node9-python/commit/24aca7239a4f00b1128749b7a4013c37e3d8e740))
11
+
12
+ - Surface truncation warning in PR comment, align word limit with max_tokens
13
+ ([`12771d8`](https://github.com/node9-ai/node9-python/commit/12771d8b64d30ebc3556e3a7ba296618b7766471))
14
+
15
+ - **ai-review**: Upgrade to claude-sonnet-4-6 with 2048 max_tokens
16
+ ([`52766cf`](https://github.com/node9-ai/node9-python/commit/52766cf88eebea0568223f25f27152c77b9b8a09))
17
+
18
+
19
+ ## v1.1.0 (2026-03-15)
20
+
21
+ ### Features
22
+
23
+ - Add Gemini AI code review on PRs to main
24
+ ([`50b651d`](https://github.com/node9-ai/node9-python/commit/50b651dc2575dc954def69dd16d7492369a8149a))
25
+
26
+ - Switch AI code review from Gemini to Claude Sonnet
27
+ ([`c52fbb4`](https://github.com/node9-ai/node9-python/commit/c52fbb4ee5d1b460ef008b708e3664e0650f93f9))
28
+
29
+
30
+ ## v1.0.3 (2026-03-15)
31
+
32
+ ### Bug Fixes
33
+
34
+ - Install twine before upload step
35
+ ([`4b4e142`](https://github.com/node9-ai/node9-python/commit/4b4e142b02815937551cbbb8569aa72b0ab222bc))
36
+
37
+
38
+ ## v1.0.2 (2026-03-15)
39
+
40
+ ### Bug Fixes
41
+
42
+ - Publish to PyPI explicitly with twine instead of semantic-release publish
43
+ ([`6847fdb`](https://github.com/node9-ai/node9-python/commit/6847fdbbf6c0bbd7a14a743b99745cdf005d73a9))
44
+
45
+
46
+ ## v1.0.1 (2026-03-15)
47
+
48
+ ### Bug Fixes
49
+
50
+ - Add TWINE credentials and twine to build command for PyPI upload
51
+ ([`d71d73d`](https://github.com/node9-ai/node9-python/commit/d71d73d1caa3c05cfd5011edcd3913f5fc976d07))
52
+
53
+
54
+ ## v1.0.0 (2026-03-15)
55
+
56
+ - Initial Release
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: node9
3
- Version: 1.0.3
3
+ Version: 1.1.1
4
4
  Summary: Execution security for Python AI agents — seatbelt for LangChain, CrewAI, and plain Python.
5
5
  Project-URL: Homepage, https://node9.ai
6
6
  Project-URL: Repository, https://github.com/node9-ai/node9-python
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "node9"
7
- version = "1.0.3"
7
+ version = "1.1.1"
8
8
  description = "Execution security for Python AI agents — seatbelt for LangChain, CrewAI, and plain Python."
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
@@ -0,0 +1,79 @@
1
+ import Anthropic from "@anthropic-ai/sdk";
2
+ import { Octokit } from "@octokit/rest";
3
+
4
+ const prNumber = parseInt(process.env.PR_NUMBER);
5
+ const githubToken = process.env.GITHUB_TOKEN;
6
+ const repo = process.env.GITHUB_REPOSITORY || "";
7
+ const [repoOwner, repoName] = repo.split("/");
8
+
9
+ if (!prNumber || !githubToken || !repoOwner || !repoName || !process.env.ANTHROPIC_API_KEY) {
10
+ console.error("Missing required environment variables.");
11
+ process.exit(1);
12
+ }
13
+
14
+ const MAX_DIFF_CHARS = 20000;
15
+ const octokit = new Octokit({ auth: githubToken });
16
+
17
+ async function runReview() {
18
+ try {
19
+ console.log(`Fetching diff for PR #${prNumber}...`);
20
+ const { data: prDiff } = await octokit.pulls.get({
21
+ owner: repoOwner,
22
+ repo: repoName,
23
+ pull_number: prNumber,
24
+ mediaType: { format: "diff" },
25
+ });
26
+
27
+ if (!prDiff || prDiff.trim().length === 0) {
28
+ console.log("Empty diff, skipping review.");
29
+ return;
30
+ }
31
+
32
+ const wasTruncated = prDiff.length > MAX_DIFF_CHARS;
33
+ const truncatedDiff = wasTruncated
34
+ ? prDiff.slice(0, MAX_DIFF_CHARS) + "\n\n... [diff truncated]"
35
+ : prDiff;
36
+
37
+ const prompt = `You are a senior Python engineer reviewing a pull request for the Node9 Python SDK.
38
+ Node9 is an execution security library — a @protect decorator that intercepts AI agent tool calls and asks for human approval before running them.
39
+
40
+ Review the following git diff and provide concise, actionable feedback. Focus on:
41
+ - Correctness and edge cases
42
+ - Security issues (this is a security library — be strict)
43
+ - API design and usability for developers integrating with LangChain, CrewAI, etc.
44
+ - Test coverage gaps
45
+ - Anything that could break the daemon HTTP communication
46
+
47
+ If the changes look good with no issues, say so briefly.
48
+ Do NOT rewrite the code. Just review it.
49
+ Keep your review under 800 words.
50
+
51
+ ## Git Diff:
52
+ ${truncatedDiff}`;
53
+
54
+ console.log("Sending diff to Claude for review...");
55
+ const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
56
+ const message = await client.messages.create({
57
+ model: "claude-sonnet-4-6",
58
+ max_tokens: 2048,
59
+ messages: [{ role: "user", content: prompt }],
60
+ });
61
+
62
+ const review = message.content[0].text;
63
+
64
+ console.log("Posting review comment...");
65
+ await octokit.issues.createComment({
66
+ owner: repoOwner,
67
+ repo: repoName,
68
+ issue_number: prNumber,
69
+ body: `## 🤖 Claude Code Review\n\n${review}${wasTruncated ? "\n\n> ⚠️ **Note:** This diff exceeded 20,000 characters and was truncated. The review above covers only the first portion of the changes." : ""}\n\n---\n*Automated review by Claude Sonnet*`,
70
+ });
71
+
72
+ console.log("Review posted successfully.");
73
+ } catch (error) {
74
+ console.error("Error:", error.message);
75
+ process.exit(1);
76
+ }
77
+ }
78
+
79
+ runReview();
node9-1.0.3/CHANGELOG.md DELETED
@@ -1,31 +0,0 @@
1
- # CHANGELOG
2
-
3
- <!-- version list -->
4
-
5
- ## v1.0.3 (2026-03-15)
6
-
7
- ### Bug Fixes
8
-
9
- - Install twine before upload step
10
- ([`4b4e142`](https://github.com/node9-ai/node9-python/commit/4b4e142b02815937551cbbb8569aa72b0ab222bc))
11
-
12
-
13
- ## v1.0.2 (2026-03-15)
14
-
15
- ### Bug Fixes
16
-
17
- - Publish to PyPI explicitly with twine instead of semantic-release publish
18
- ([`6847fdb`](https://github.com/node9-ai/node9-python/commit/6847fdbbf6c0bbd7a14a743b99745cdf005d73a9))
19
-
20
-
21
- ## v1.0.1 (2026-03-15)
22
-
23
- ### Bug Fixes
24
-
25
- - Add TWINE credentials and twine to build command for PyPI upload
26
- ([`d71d73d`](https://github.com/node9-ai/node9-python/commit/d71d73d1caa3c05cfd5011edcd3913f5fc976d07))
27
-
28
-
29
- ## v1.0.0 (2026-03-15)
30
-
31
- - Initial Release
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