node9 1.0.2__tar.gz → 1.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.
- node9-1.1.0/.github/workflows/ai-review.yml +25 -0
- {node9-1.0.2 → node9-1.1.0}/.github/workflows/release.yml +3 -1
- node9-1.1.0/CHANGELOG.md +42 -0
- {node9-1.0.2 → node9-1.1.0}/PKG-INFO +1 -1
- {node9-1.0.2 → node9-1.1.0}/pyproject.toml +1 -1
- node9-1.1.0/scripts/ai-review.mjs +67 -0
- node9-1.0.2/CHANGELOG.md +0 -23
- {node9-1.0.2 → node9-1.1.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {node9-1.0.2 → node9-1.1.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {node9-1.0.2 → node9-1.1.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {node9-1.0.2 → node9-1.1.0}/.github/workflows/auto-pr.yml +0 -0
- {node9-1.0.2 → node9-1.1.0}/.github/workflows/ci.yml +0 -0
- {node9-1.0.2 → node9-1.1.0}/.gitignore +0 -0
- {node9-1.0.2 → node9-1.1.0}/LICENSE +0 -0
- {node9-1.0.2 → node9-1.1.0}/README.md +0 -0
- {node9-1.0.2 → node9-1.1.0}/conftest.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/examples/basic.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/examples/crewai_agent.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/examples/langchain_agent.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/node9/__init__.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/node9/_client.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/node9/_config.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/node9/_decorator.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/node9/_exceptions.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/scripts/e2e.sh +0 -0
- {node9-1.0.2 → node9-1.1.0}/tests/test_client.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/tests/test_config.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/tests/test_decorator.py +0 -0
- {node9-1.0.2 → node9-1.1.0}/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: Gemini 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
|
node9-1.1.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
<!-- version list -->
|
|
4
|
+
|
|
5
|
+
## v1.1.0 (2026-03-15)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- Add Gemini AI code review on PRs to main
|
|
10
|
+
([`50b651d`](https://github.com/node9-ai/node9-python/commit/50b651dc2575dc954def69dd16d7492369a8149a))
|
|
11
|
+
|
|
12
|
+
- Switch AI code review from Gemini to Claude Sonnet
|
|
13
|
+
([`c52fbb4`](https://github.com/node9-ai/node9-python/commit/c52fbb4ee5d1b460ef008b708e3664e0650f93f9))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## v1.0.3 (2026-03-15)
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- Install twine before upload step
|
|
21
|
+
([`4b4e142`](https://github.com/node9-ai/node9-python/commit/4b4e142b02815937551cbbb8569aa72b0ab222bc))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## v1.0.2 (2026-03-15)
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
- Publish to PyPI explicitly with twine instead of semantic-release publish
|
|
29
|
+
([`6847fdb`](https://github.com/node9-ai/node9-python/commit/6847fdbbf6c0bbd7a14a743b99745cdf005d73a9))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## v1.0.1 (2026-03-15)
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
- Add TWINE credentials and twine to build command for PyPI upload
|
|
37
|
+
([`d71d73d`](https://github.com/node9-ai/node9-python/commit/d71d73d1caa3c05cfd5011edcd3913f5fc976d07))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## v1.0.0 (2026-03-15)
|
|
41
|
+
|
|
42
|
+
- Initial Release
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: node9
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
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
|
|
7
|
+
version = "1.1.0"
|
|
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,67 @@
|
|
|
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 [repoOwner, repoName] = (process.env.GITHUB_REPOSITORY || "").split("/");
|
|
7
|
+
|
|
8
|
+
const octokit = new Octokit({ auth: githubToken });
|
|
9
|
+
|
|
10
|
+
async function runReview() {
|
|
11
|
+
try {
|
|
12
|
+
console.log(`Fetching diff for PR #${prNumber}...`);
|
|
13
|
+
const { data: prDiff } = await octokit.pulls.get({
|
|
14
|
+
owner: repoOwner,
|
|
15
|
+
repo: repoName,
|
|
16
|
+
pull_number: prNumber,
|
|
17
|
+
mediaType: { format: "diff" },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (!prDiff || prDiff.trim().length === 0) {
|
|
21
|
+
console.log("Empty diff, skipping review.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const prompt = `You are a senior Python engineer reviewing a pull request for the Node9 Python SDK.
|
|
26
|
+
Node9 is an execution security library — a @protect decorator that intercepts AI agent tool calls and asks for human approval before running them.
|
|
27
|
+
|
|
28
|
+
Review the following git diff and provide concise, actionable feedback. Focus on:
|
|
29
|
+
- Correctness and edge cases
|
|
30
|
+
- Security issues (this is a security library — be strict)
|
|
31
|
+
- API design and usability for developers integrating with LangChain, CrewAI, etc.
|
|
32
|
+
- Test coverage gaps
|
|
33
|
+
- Anything that could break the daemon HTTP communication
|
|
34
|
+
|
|
35
|
+
If the changes look good with no issues, say so briefly.
|
|
36
|
+
Do NOT rewrite the code. Just review it.
|
|
37
|
+
Keep your review under 400 words.
|
|
38
|
+
|
|
39
|
+
## Git Diff:
|
|
40
|
+
${prDiff}`;
|
|
41
|
+
|
|
42
|
+
console.log("Sending diff to Claude for review...");
|
|
43
|
+
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
|
|
44
|
+
const message = await client.messages.create({
|
|
45
|
+
model: "claude-sonnet-4-5",
|
|
46
|
+
max_tokens: 1024,
|
|
47
|
+
messages: [{ role: "user", content: prompt }],
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const review = message.content[0].text;
|
|
51
|
+
|
|
52
|
+
console.log("Posting review comment...");
|
|
53
|
+
await octokit.issues.createComment({
|
|
54
|
+
owner: repoOwner,
|
|
55
|
+
repo: repoName,
|
|
56
|
+
issue_number: prNumber,
|
|
57
|
+
body: `## 🤖 Claude Code Review\n\n${review}\n\n---\n*Automated review by Claude Sonnet*`,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
console.log("Review posted successfully.");
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error("Error:", error.message);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
runReview();
|
node9-1.0.2/CHANGELOG.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# CHANGELOG
|
|
2
|
-
|
|
3
|
-
<!-- version list -->
|
|
4
|
-
|
|
5
|
-
## v1.0.2 (2026-03-15)
|
|
6
|
-
|
|
7
|
-
### Bug Fixes
|
|
8
|
-
|
|
9
|
-
- Publish to PyPI explicitly with twine instead of semantic-release publish
|
|
10
|
-
([`6847fdb`](https://github.com/node9-ai/node9-python/commit/6847fdbbf6c0bbd7a14a743b99745cdf005d73a9))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## v1.0.1 (2026-03-15)
|
|
14
|
-
|
|
15
|
-
### Bug Fixes
|
|
16
|
-
|
|
17
|
-
- Add TWINE credentials and twine to build command for PyPI upload
|
|
18
|
-
([`d71d73d`](https://github.com/node9-ai/node9-python/commit/d71d73d1caa3c05cfd5011edcd3913f5fc976d07))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## v1.0.0 (2026-03-15)
|
|
22
|
-
|
|
23
|
-
- 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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|