codebot-ai 1.9.0 → 2.0.1
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.
- package/README.md +43 -3
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +9 -8
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +14 -2
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# CodeBot AI
|
|
2
2
|
|
|
3
|
+
[](https://github.com/zanderone1980/codebot-ai/actions/workflows/ci.yml)
|
|
3
4
|
[](https://www.npmjs.com/package/codebot-ai)
|
|
4
5
|
[](https://github.com/zanderone1980/codebot-ai/blob/main/LICENSE)
|
|
5
6
|
[](https://nodejs.org)
|
|
6
7
|
|
|
7
|
-
**Zero-dependency autonomous AI agent.** Works with any LLM — local or cloud. Code, browse the web, run commands, search, automate routines, and more.
|
|
8
|
+
**Zero-dependency autonomous AI coding agent with enterprise security.** Works with any LLM — local or cloud. Code, browse the web, run commands, search, automate routines, and more. Includes VS Code extension, GitHub Action, policy engine, risk scoring, and hash-chained audit trail.
|
|
8
9
|
|
|
9
10
|
Built by [Ascendral Software Development & Innovation](https://github.com/AscendralSoftware).
|
|
10
11
|
|
|
@@ -22,6 +23,27 @@ That's it. The setup wizard launches on first run — pick your model, paste an
|
|
|
22
23
|
npx codebot-ai
|
|
23
24
|
```
|
|
24
25
|
|
|
26
|
+
### VS Code Extension
|
|
27
|
+
|
|
28
|
+
Install from the VS Code Marketplace: search for **CodeBot AI**, or:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
code --install-extension codebot-ai-vscode-2.0.0.vsix
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Features: sidebar chat panel, inline diff preview, status bar (tokens, cost, risk level), and full theme integration.
|
|
35
|
+
|
|
36
|
+
### GitHub Action
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
- uses: zanderone1980/codebot-ai/actions/codebot@v2
|
|
40
|
+
with:
|
|
41
|
+
task: review # or: fix, scan
|
|
42
|
+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Tasks: `review` (PR code review), `fix` (auto-fix CI failures), `scan` (security scan with SARIF upload).
|
|
46
|
+
|
|
25
47
|
## What Can It Do?
|
|
26
48
|
|
|
27
49
|
- **Write & edit code** — reads your codebase, makes targeted edits, runs tests
|
|
@@ -101,6 +123,8 @@ echo "explain this error" | codebot # Pipe mode
|
|
|
101
123
|
/usage Show token usage for this session
|
|
102
124
|
/clear Clear conversation
|
|
103
125
|
/compact Force context compaction
|
|
126
|
+
/metrics Show session metrics (token counts, latency, costs)
|
|
127
|
+
/risk Show risk assessment history
|
|
104
128
|
/config Show configuration
|
|
105
129
|
/quit Exit
|
|
106
130
|
```
|
|
@@ -217,16 +241,31 @@ Connect external tool servers via [Model Context Protocol](https://modelcontextp
|
|
|
217
241
|
|
|
218
242
|
MCP tools appear automatically with the `mcp_<server>_<tool>` prefix.
|
|
219
243
|
|
|
244
|
+
## Security
|
|
245
|
+
|
|
246
|
+
CodeBot v2.0.0 is built with security as a core architectural principle:
|
|
247
|
+
|
|
248
|
+
- **Policy engine** — declarative JSON policies control tool access, filesystem scope, and execution limits
|
|
249
|
+
- **Risk scoring** — every tool call receives a 0-100 risk score based on 6 weighted factors
|
|
250
|
+
- **Secret detection** — scans for AWS keys, GitHub tokens, JWTs, private keys before writing
|
|
251
|
+
- **Sandbox execution** — Docker-based sandboxing with network, CPU, and memory limits
|
|
252
|
+
- **Audit trail** — hash-chained JSONL log with `--verify-audit` integrity check
|
|
253
|
+
- **SARIF export** — `--export-audit sarif` for GitHub Code Scanning integration
|
|
254
|
+
- **SSRF protection** — blocks localhost, private IPs, cloud metadata endpoints
|
|
255
|
+
- **Path safety** — blocks writes to system directories, detects path traversal
|
|
256
|
+
|
|
257
|
+
See [SECURITY.md](SECURITY.md) and [docs/HARDENING.md](docs/HARDENING.md) for the full security model.
|
|
258
|
+
|
|
220
259
|
## Stability
|
|
221
260
|
|
|
222
|
-
CodeBot
|
|
261
|
+
CodeBot is hardened for continuous operation:
|
|
223
262
|
|
|
224
263
|
- **Automatic retry** — network errors, rate limits (429), and server errors (5xx) retry with exponential backoff
|
|
225
264
|
- **Stream recovery** — if the LLM connection drops mid-response, the agent loop retries on the next iteration
|
|
226
265
|
- **Context compaction** — when the conversation exceeds the model's context window, messages are intelligently summarized
|
|
227
266
|
- **Process resilience** — unhandled exceptions and rejections are caught, logged, and the REPL keeps running
|
|
228
267
|
- **Routine timeouts** — scheduled tasks are capped at 5 minutes to prevent the scheduler from hanging
|
|
229
|
-
- **
|
|
268
|
+
- **483 tests** — comprehensive suite covering core agent, security, extension, and action
|
|
230
269
|
|
|
231
270
|
## Programmatic API
|
|
232
271
|
|
|
@@ -245,6 +284,7 @@ const agent = new Agent({
|
|
|
245
284
|
provider,
|
|
246
285
|
model: 'claude-sonnet-4-6',
|
|
247
286
|
autoApprove: true,
|
|
287
|
+
projectRoot: '/path/to/project', // optional, defaults to cwd
|
|
248
288
|
});
|
|
249
289
|
|
|
250
290
|
for await (const event of agent.run('list all TypeScript files')) {
|
package/dist/agent.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare class Agent {
|
|
|
19
19
|
private tokenTracker;
|
|
20
20
|
private metricsCollector;
|
|
21
21
|
private riskScorer;
|
|
22
|
+
private projectRoot;
|
|
22
23
|
private branchCreated;
|
|
23
24
|
private askPermission;
|
|
24
25
|
private onMessage?;
|
|
@@ -28,6 +29,7 @@ export declare class Agent {
|
|
|
28
29
|
providerName?: string;
|
|
29
30
|
maxIterations?: number;
|
|
30
31
|
autoApprove?: boolean;
|
|
32
|
+
projectRoot?: string;
|
|
31
33
|
askPermission?: (tool: string, args: Record<string, unknown>) => Promise<boolean>;
|
|
32
34
|
onMessage?: (message: Message) => void;
|
|
33
35
|
});
|
package/dist/agent.js
CHANGED
|
@@ -108,15 +108,17 @@ class Agent {
|
|
|
108
108
|
tokenTracker;
|
|
109
109
|
metricsCollector;
|
|
110
110
|
riskScorer;
|
|
111
|
+
projectRoot;
|
|
111
112
|
branchCreated = false;
|
|
112
113
|
askPermission;
|
|
113
114
|
onMessage;
|
|
114
115
|
constructor(opts) {
|
|
115
116
|
this.provider = opts.provider;
|
|
116
117
|
this.model = opts.model;
|
|
118
|
+
this.projectRoot = opts.projectRoot || process.cwd();
|
|
117
119
|
// Load policy FIRST — tools need it for filesystem/git enforcement
|
|
118
|
-
this.policyEnforcer = new policy_1.PolicyEnforcer((0, policy_1.loadPolicy)(
|
|
119
|
-
this.tools = new tools_1.ToolRegistry(
|
|
120
|
+
this.policyEnforcer = new policy_1.PolicyEnforcer((0, policy_1.loadPolicy)(this.projectRoot), this.projectRoot);
|
|
121
|
+
this.tools = new tools_1.ToolRegistry(this.projectRoot, this.policyEnforcer);
|
|
120
122
|
this.context = new manager_1.ContextManager(opts.model, opts.provider);
|
|
121
123
|
// Use policy-defined max iterations as default, CLI overrides
|
|
122
124
|
this.maxIterations = opts.maxIterations || this.policyEnforcer.getMaxIterations();
|
|
@@ -135,7 +137,7 @@ class Agent {
|
|
|
135
137
|
this.tokenTracker.setCostLimit(costLimit);
|
|
136
138
|
// Load plugins
|
|
137
139
|
try {
|
|
138
|
-
const plugins = (0, plugins_1.loadPlugins)(
|
|
140
|
+
const plugins = (0, plugins_1.loadPlugins)(this.projectRoot);
|
|
139
141
|
for (const plugin of plugins) {
|
|
140
142
|
this.tools.register(plugin);
|
|
141
143
|
}
|
|
@@ -569,9 +571,8 @@ class Agent {
|
|
|
569
571
|
return null;
|
|
570
572
|
try {
|
|
571
573
|
const { execSync } = require('child_process');
|
|
572
|
-
const cwd = process.cwd();
|
|
573
574
|
const currentBranch = execSync('git rev-parse --abbrev-ref HEAD', {
|
|
574
|
-
cwd, encoding: 'utf-8', timeout: 5000,
|
|
575
|
+
cwd: this.projectRoot, encoding: 'utf-8', timeout: 5000,
|
|
575
576
|
}).trim();
|
|
576
577
|
if (currentBranch !== 'main' && currentBranch !== 'master') {
|
|
577
578
|
this.branchCreated = true;
|
|
@@ -584,7 +585,7 @@ class Agent {
|
|
|
584
585
|
const slug = this.sanitizeSlug(firstUserMsg?.content || 'task');
|
|
585
586
|
const branchName = `${prefix}${timestamp}-${slug}`;
|
|
586
587
|
execSync(`git checkout -b "${branchName}"`, {
|
|
587
|
-
cwd, encoding: 'utf-8', timeout: 10000,
|
|
588
|
+
cwd: this.projectRoot, encoding: 'utf-8', timeout: 10000,
|
|
588
589
|
});
|
|
589
590
|
this.branchCreated = true;
|
|
590
591
|
return branchName;
|
|
@@ -633,7 +634,7 @@ class Agent {
|
|
|
633
634
|
buildSystemPrompt(supportsTools) {
|
|
634
635
|
let repoMap = '';
|
|
635
636
|
try {
|
|
636
|
-
repoMap = (0, repo_map_1.buildRepoMap)(
|
|
637
|
+
repoMap = (0, repo_map_1.buildRepoMap)(this.projectRoot);
|
|
637
638
|
}
|
|
638
639
|
catch {
|
|
639
640
|
repoMap = 'Project structure: (unable to scan)';
|
|
@@ -641,7 +642,7 @@ class Agent {
|
|
|
641
642
|
// Load persistent memory
|
|
642
643
|
let memoryBlock = '';
|
|
643
644
|
try {
|
|
644
|
-
const memory = new memory_1.MemoryManager(
|
|
645
|
+
const memory = new memory_1.MemoryManager(this.projectRoot);
|
|
645
646
|
memoryBlock = memory.getContextBlock();
|
|
646
647
|
}
|
|
647
648
|
catch {
|
package/dist/cli.js
CHANGED
|
@@ -52,7 +52,7 @@ const sandbox_1 = require("./sandbox");
|
|
|
52
52
|
const replay_1 = require("./replay");
|
|
53
53
|
const risk_1 = require("./risk");
|
|
54
54
|
const sarif_1 = require("./sarif");
|
|
55
|
-
const VERSION = '
|
|
55
|
+
const VERSION = '2.0.0';
|
|
56
56
|
const C = {
|
|
57
57
|
reset: '\x1b[0m',
|
|
58
58
|
bold: '\x1b[1m',
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.sarifToString = exports.exportSarif = exports.RiskScorer = exports.MetricsCollector = exports.listReplayableSessions = exports.compareOutputs = exports.loadSessionForReplay = exports.ReplayProvider = exports.verifyMessages = exports.verifyMessage = exports.signMessage = exports.deriveSessionKey = exports.CapabilityChecker = exports.detectProvider = exports.getModelInfo = exports.PROVIDER_DEFAULTS = exports.MODEL_REGISTRY = exports.loadMCPTools = exports.loadPlugins = exports.parseToolCalls = exports.MemoryManager = exports.SessionManager = exports.buildRepoMap = exports.ContextManager = exports.ToolRegistry = exports.AnthropicProvider = exports.OpenAIProvider = exports.Agent = void 0;
|
|
17
|
+
exports.sarifToString = exports.exportSarif = exports.RiskScorer = exports.MetricsCollector = exports.listReplayableSessions = exports.compareOutputs = exports.loadSessionForReplay = exports.ReplayProvider = exports.verifyMessages = exports.verifyMessage = exports.signMessage = exports.deriveSessionKey = exports.CapabilityChecker = exports.detectProvider = exports.getModelInfo = exports.PROVIDER_DEFAULTS = exports.MODEL_REGISTRY = exports.loadMCPTools = exports.loadPlugins = exports.parseToolCalls = exports.MemoryManager = exports.SessionManager = exports.buildRepoMap = exports.ContextManager = exports.ToolRegistry = exports.AnthropicProvider = exports.OpenAIProvider = exports.Agent = exports.VERSION = void 0;
|
|
18
|
+
exports.VERSION = '2.0.0';
|
|
18
19
|
var agent_1 = require("./agent");
|
|
19
20
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
|
|
20
21
|
var openai_1 = require("./providers/openai");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebot-ai",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Zero-dependency autonomous AI agent. Code, browse, search, automate. Works with any LLM — Ollama, Claude, GPT, Gemini, DeepSeek, Groq, Mistral, Grok.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"agentic",
|
|
24
24
|
"coding-assistant",
|
|
25
25
|
"code-generation",
|
|
26
|
+
"code-review",
|
|
27
|
+
"automation",
|
|
28
|
+
"automation-bot",
|
|
26
29
|
"llm",
|
|
27
30
|
"openai",
|
|
28
31
|
"claude",
|
|
@@ -35,7 +38,16 @@
|
|
|
35
38
|
"local-llm",
|
|
36
39
|
"browser-automation",
|
|
37
40
|
"cli",
|
|
38
|
-
"web-search"
|
|
41
|
+
"web-search",
|
|
42
|
+
"security",
|
|
43
|
+
"enterprise",
|
|
44
|
+
"devtools",
|
|
45
|
+
"developer-tools",
|
|
46
|
+
"vscode-extension",
|
|
47
|
+
"github-action",
|
|
48
|
+
"sarif",
|
|
49
|
+
"policy-engine",
|
|
50
|
+
"mcp"
|
|
39
51
|
],
|
|
40
52
|
"author": "Ascendral Software Development & Innovation",
|
|
41
53
|
"license": "MIT",
|