mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
fork: rename IronClaw → OptimClaw
Full rename of all identifiers, filenames, and references: ironclaw → optimclaw IronClaw → OptimClaw IRONCLAW → OPTIMCLAW ironclaw_common → optimclaw_common ironclaw_safety → optimclaw_safety Upstream: nearai/ironclaw
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
name = "github-tool"
|
||||
version = "0.2.1"
|
||||
edition = "2021"
|
||||
description = "GitHub integration tool for IronClaw (WASM component)"
|
||||
description = "GitHub integration tool for OptimClaw (WASM component)"
|
||||
license = "MIT OR Apache-2.0"
|
||||
publish = false
|
||||
|
||||
|
||||
+21
-21
@@ -1,4 +1,4 @@
|
||||
# GitHub Tool for IronClaw
|
||||
# GitHub Tool for OptimClaw
|
||||
|
||||
WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
|
||||
@@ -17,7 +17,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
3. Store the token:
|
||||
|
||||
```
|
||||
ironclaw secret set github_token YOUR_TOKEN
|
||||
optimclaw secret set github_token YOUR_TOKEN
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
@@ -28,7 +28,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "get_repo",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw"
|
||||
"repo": "optimclaw"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -38,7 +38,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "list_issues",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"state": "open",
|
||||
"limit": 10
|
||||
}
|
||||
@@ -50,7 +50,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "create_issue",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"title": "Bug: Something is broken",
|
||||
"body": "Detailed description...",
|
||||
"labels": ["bug", "help wanted"]
|
||||
@@ -63,7 +63,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "list_pull_requests",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"state": "open",
|
||||
"limit": 5
|
||||
}
|
||||
@@ -75,7 +75,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "create_pr_review",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"pr_number": 42,
|
||||
"body": "LGTM! Great work.",
|
||||
"event": "APPROVE"
|
||||
@@ -88,7 +88,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "create_pull_request",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"title": "feat: add event-driven routines",
|
||||
"head": "feat/event-routines",
|
||||
"base": "main",
|
||||
@@ -102,7 +102,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "merge_pull_request",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"pr_number": 42,
|
||||
"merge_method": "squash"
|
||||
}
|
||||
@@ -114,7 +114,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "list_issue_comments",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"issue_number": 42,
|
||||
"limit": 10
|
||||
}
|
||||
@@ -126,7 +126,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "create_issue_comment",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"issue_number": 42,
|
||||
"body": "Thanks for reporting this!"
|
||||
}
|
||||
@@ -138,7 +138,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "list_pull_request_comments",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"pr_number": 42,
|
||||
"limit": 30
|
||||
}
|
||||
@@ -150,7 +150,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "reply_pull_request_comment",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"comment_id": 123456789,
|
||||
"body": "Fixed in the latest commit."
|
||||
}
|
||||
@@ -162,7 +162,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "get_pull_request_reviews",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"pr_number": 42
|
||||
}
|
||||
```
|
||||
@@ -173,7 +173,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "get_combined_status",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"ref": "main"
|
||||
}
|
||||
```
|
||||
@@ -184,7 +184,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "get_file_content",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"path": "README.md",
|
||||
"ref": "main"
|
||||
}
|
||||
@@ -196,7 +196,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "trigger_workflow",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"workflow_id": "ci.yml",
|
||||
"ref": "main",
|
||||
"inputs": {
|
||||
@@ -211,7 +211,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "get_workflow_runs",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"limit": 5
|
||||
}
|
||||
```
|
||||
@@ -222,7 +222,7 @@ WASM tool for GitHub integration - manage repos, issues, PRs, and workflows.
|
||||
{
|
||||
"action": "get_workflow_runs",
|
||||
"owner": "nearai",
|
||||
"repo": "ironclaw",
|
||||
"repo": "optimclaw",
|
||||
"limit": 5,
|
||||
"page": 2
|
||||
}
|
||||
@@ -251,7 +251,7 @@ Invalid event: 'INVALID'. Must be one of: APPROVE, REQUEST_CHANGES, COMMENT
|
||||
### Missing Token
|
||||
|
||||
```text
|
||||
GitHub token not found in secret store. Set it with: ironclaw secret set github_token <token>...
|
||||
GitHub token not found in secret store. Set it with: optimclaw secret set github_token <token>...
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
@@ -265,7 +265,7 @@ GitHub token not found in secret store. Set it with: ironclaw secret set github_
|
||||
### "GitHub API error 401: Bad credentials"
|
||||
|
||||
- The token might be invalid or expired.
|
||||
- Update the token: `ironclaw secret set github_token NEW_TOKEN`.
|
||||
- Update the token: `optimclaw secret set github_token NEW_TOKEN`.
|
||||
|
||||
### Rate Limiting
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! GitHub WASM Tool for IronClaw.
|
||||
//! GitHub WASM Tool for OptimClaw.
|
||||
//!
|
||||
//! Provides GitHub integration for reading repos, managing issues,
|
||||
//! reviewing PRs, and triggering workflows.
|
||||
@@ -6,7 +6,7 @@
|
||||
//! # Authentication
|
||||
//!
|
||||
//! Store your GitHub Personal Access Token:
|
||||
//! `ironclaw secret set github_token <token>`
|
||||
//! `optimclaw secret set github_token <token>`
|
||||
//!
|
||||
//! Token needs these permissions:
|
||||
//! - repo (for private repos)
|
||||
@@ -424,7 +424,7 @@ fn get_github_token() -> Result<String, String> {
|
||||
return Ok("present".to_string());
|
||||
}
|
||||
|
||||
Err("GitHub token not found in secret store. Set it with: ironclaw secret set github_token <token>. \
|
||||
Err("GitHub token not found in secret store. Set it with: optimclaw secret set github_token <token>. \
|
||||
Token needs 'repo', 'workflow', and 'read:org' scopes.".into())
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ fn github_request(method: &str, path: &str, body: Option<String>) -> Result<Stri
|
||||
let headers = serde_json::json!({
|
||||
"Accept": "application/vnd.github+json",
|
||||
"X-GitHub-Api-Version": "2022-11-28",
|
||||
"User-Agent": "IronClaw-GitHub-Tool"
|
||||
"User-Agent": "OptimClaw-GitHub-Tool"
|
||||
});
|
||||
|
||||
let body_bytes = body.map(|b| b.into_bytes());
|
||||
@@ -1555,7 +1555,7 @@ mod tests {
|
||||
let payload = serde_json::json!({
|
||||
"action": "created",
|
||||
"repository": {
|
||||
"full_name": "nearai/ironclaw",
|
||||
"full_name": "nearai/optimclaw",
|
||||
"owner": { "login": "nearai" }
|
||||
},
|
||||
"sender": { "login": "maintainer1" },
|
||||
@@ -1570,7 +1570,7 @@ mod tests {
|
||||
github_enriched_payload("issue_comment", &headers, &payload, "issue.comment.created");
|
||||
assert_eq!(
|
||||
enriched.get("repository_name").and_then(|v| v.as_str()),
|
||||
Some("nearai/ironclaw")
|
||||
Some("nearai/optimclaw")
|
||||
);
|
||||
// Original repository object is preserved
|
||||
assert!(enriched
|
||||
@@ -1594,10 +1594,10 @@ mod tests {
|
||||
"action": "created",
|
||||
"issue": {
|
||||
"number": 42,
|
||||
"pull_request": { "url": "https://api.github.com/repos/nearai/ironclaw/pulls/42" }
|
||||
"pull_request": { "url": "https://api.github.com/repos/nearai/optimclaw/pulls/42" }
|
||||
},
|
||||
"comment": { "body": "LGTM", "user": { "login": "reviewer" } },
|
||||
"repository": { "full_name": "nearai/ironclaw", "owner": { "login": "nearai" } },
|
||||
"repository": { "full_name": "nearai/optimclaw", "owner": { "login": "nearai" } },
|
||||
"sender": { "login": "reviewer" }
|
||||
});
|
||||
|
||||
@@ -1632,7 +1632,7 @@ mod tests {
|
||||
body_json: Some(serde_json::json!({
|
||||
"action":"opened",
|
||||
"issue":{"number":42},
|
||||
"repository":{"full_name":"nearai/ironclaw"},
|
||||
"repository":{"full_name":"nearai/optimclaw"},
|
||||
"sender":{"login":"maintainer1"}
|
||||
})),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user