jules-orchestrator-kit 0.9.3 → 0.20.0

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 CHANGED
@@ -1,308 +1,114 @@
1
1
  # jules-orchestrator-kit
2
2
 
3
- *Disclaimer: This is an independent open-source orchestration tool and is not officially affiliated with or endorsed by Google.*
3
+ *Disclaimer: This is an independent open-source orchestration tool for Google Jules and is not officially affiliated with or endorsed by Google.*
4
4
 
5
5
  [![Jules PR Audit](https://github.com/FullThrottle83/jules-orchestrator-kit/actions/workflows/jules-audit.yml/badge.svg)](https://github.com/FullThrottle83/jules-orchestrator-kit/actions/workflows/jules-audit.yml)
6
6
  [![npm version](https://img.shields.io/npm/v/jules-orchestrator-kit.svg)](https://www.npmjs.com/package/jules-orchestrator-kit)
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
8
 
9
- **Turn Google Jules into an autonomous code builder that writes, tests, and fixes itself.**
10
- The orchestrator automates verification, scopes file boundaries, and prevents Jules from breaking your CI.
9
+ > **v0.20.0 Early Community Release Candidate**
10
+ > High-volume autonomous orchestration engine for Google Jules. Built specifically to handle 300+ daily sessions and parallel agent swarms with zero external runtime dependencies.
11
11
 
12
- > [!WARNING]
13
- > **Alpha Release:** This kit is in active development. Please exercise caution before integrating it into critical production pipelines.
12
+ ---
14
13
 
15
- > [!CAUTION]
16
- > **Task Limit Warning:** Autonomous loops can quickly consume your daily API limits. We strongly recommend starting with `JULES_DRY_RUN=1` to understand the workflow before scaling up.
14
+ ## ⚡ 2-Minute Quickstart
17
15
 
18
- ## Prerequisites
19
- To use this kit, you will need:
20
- - Node.js `18.0.0` or higher
21
- - `git` installed and available in your PATH
22
- - A Google Jules REST API key (set as `JULES_API_KEY`) **OR** the native `jules` binary in your PATH.
16
+ Get up and running in under 2 minutes:
23
17
 
24
- ## Quick Start
25
- Initialize your repository:
26
18
  ```bash
19
+ # 1. Install or initialize in your target codebase
27
20
  npx jules-orchestrator-kit init
28
- ```
29
-
30
- Dispatch a task or run the queue using `agentctl`:
31
- ```bash
32
- agentctl dispatch --title "Refactor Auth" --prompt "Implement JWT verification in auth handler"
33
- agentctl queue
34
- agentctl gate
35
- ```
36
21
 
37
- > 💡 **Unified Engine CLI (`agentctl`)**:
38
- > `agentctl` is the zero-dependency CLI executable that powers dispatching, safety gate auditing, mutex locks, and swarm management across all project types (Node, Rust, Go, Python, etc.).
39
- > Legacy `scripts/jules-*.mjs` shims are preserved for backward compatibility.
22
+ # 2. Dispatch a task (Dry-Run mode for testing)
23
+ JULES_DRY_RUN=1 npx agentctl dispatch \
24
+ --title "Add JWT Validator" \
25
+ --prompt "Implement JWT validation middleware with unit tests"
40
26
 
41
- ---
27
+ # 3. Run security & verification gatekeeper
28
+ npx agentctl gate
42
29
 
43
- ## How It Works
44
-
45
- 1. **You Assign Task:** Define what needs fixing or building (supports text and multimodal image mockups).
46
- 2. **Jules Writes Code:** Proposes changes in an isolated Git worktree sandbox.
47
- 3. **Run Tests & Linters:** The Gatekeeper runs your test suite, linters, and type checks.
48
- 4. **Self-Correction:** If anything fails, Jules automatically retries with fixes (OODA loop).
49
- 5. **Safe Delivery:** Once tests pass, the PR is verified and ready for review.
50
-
51
- ```mermaid
52
- sequenceDiagram
53
- autonumber
54
-
55
- box "Client Edge" #F4F4F4
56
- actor Trigger as Client (CLI / CI / SDK)
57
- end
58
-
59
- box "Control Plane" #E8F4F8
60
- participant Orc as Orchestrator Core
61
- participant Gate as Self-Audit Gatekeeper
62
- end
63
-
64
- box "Execution Sandbox" #F8E8E8
65
- participant API as Google Jules API
66
- participant Git as Git Worktree Sandbox
67
- end
68
-
69
- Trigger->>+Orc: Dispatch Task Payload
70
-
71
- note over Orc,Git: Phase 1: Security Redaction & Provisioning
72
- Orc->>Orc: Redact Secrets (Entropy > 3.6) & Enforce Dynamic Guardrails
73
- Orc->>+Git: Provision Isolation Sandbox (git worktree)
74
- Git-->>-Orc: Sandbox Ready
75
-
76
- loop OODA Repair Cycle (Max 3 Retries)
77
- note over Orc,Git: Phase 2: Agent Execution & Dispatch
78
- Orc->>+API: Dispatch Task + <MCP_DIRECTIVE> & Target Scope
79
- API->>+Git: Apply Proposed Code Changes
80
- Git-->>-API: Changes Written
81
- API-->>-Orc: Execution Complete
82
-
83
- note over Orc,Gate: Phase 3: Tiered Verification & Gatekeeping
84
- Orc->>+Gate: Trigger Self-Audit (trusted origin/main rules)
85
-
86
- Gate->>+Git: Scope Audit (`git diff -z --name-only` vs forbidden_paths)
87
- Git-->>-Gate: Diff Stats & File List
88
-
89
- alt Scope Breach (Forbidden Path OR Diff Payload > 75 KB)
90
- Gate-->>Orc: Security / Scope Violation Detected
91
- Orc->>Orc: Record Telemetry (metrics.jsonl)
92
- Orc-->>Trigger: Abort Execution (Exit 3)
93
- break Fatal Security Error
94
- Orc->>Git: Teardown Worktree Sandbox
95
- end
96
- else Scope Verification Passed
97
- Gate->>+Git: Run Dynamic Verification (`testCmd` & `buildCmd`)
98
- Git-->>-Gate: stdout / stderr verification results
99
- end
100
-
101
- alt 100% Verification Suite Passed
102
- Gate-->>-Orc: Verification Success
103
- Orc->>+Git: Commit & Push to Remote Branch / PR
104
- Git-->>-Orc: PR Ready
105
- Orc->>Orc: Record Telemetry (metrics.jsonl)
106
- Orc-->>Trigger: Dispatch Succeeded (Exit 0)
107
- break Task Completed
108
- Orc->>Git: Teardown Worktree Sandbox
109
- end
110
- else Verification Failed
111
- Gate-->>Orc: Verification Failed (Stderr Trace output)
112
- Orc->>Orc: Record Failure Telemetry
113
-
114
- alt Retries Remaining (< 3)
115
- Orc->>Orc: Construct Repair Prompt with Stderr Trace
116
- else Max Retries Exceeded (3/3)
117
- Orc-->>-Trigger: Abort & Log Diagnostic Feedback (Exit 4)
118
- Orc->>Git: Teardown Worktree Sandbox
119
- end
120
- end
121
- end
30
+ # 4. Start stdio MCP Server (for Cursor, Claude Code, or AGY integration)
31
+ npx agentctl mcp
122
32
  ```
123
33
 
124
- > 💡 **Core Architectural Invariants**:
125
- > - **Zero-Trust Base-Branch Security**: Security rules (`forbidden_paths`) are fetched exclusively from `origin/main` (never untrusted PR branches).
126
- > - **Automatic PII & Secret Redaction**: Outbound task prompts are automatically sanitized to redact API secrets and mask sensitive PII (emails, IPs, phone numbers).
127
- > - **Ledger Hash-Chain Integrity**: Hashing over JSONL event streams detects unauthorized log tampering or record deletions.
128
- > - **Dynamic Command Resolution (`command-resolver.mjs`)**: Auto-detects workspace boundaries (Turborepo, pnpm, Nx, Cargo, pytest, npm).
129
- >
130
- > 🔍 For a deep dive into the execution protocol, see the [Architecture & Pipeline Flow](docs/architecture.md).
131
-
132
34
  ---
133
35
 
134
- ## Configuration
135
-
136
- The orchestrator automatically detects your tech stack, but you can edit `.agent/jules.yml` for fine-grained control:
137
-
138
- ```yaml
139
- # Google Jules Repository Configuration (Version 2)
140
- version: 2
141
- test_cmd: "npm test"
142
- build_cmd: "npm run build"
143
- forbidden_paths:
144
- - ".github/**"
145
- - "**/secrets/**"
146
- - "**/*.pem"
147
- - "**/lock-manager/**"
148
- - "scripts/jules-*"
149
- - ".agent/jules.yml"
150
- allow_paths: []
151
- ```
36
+ ## 🚀 Built for High-Volume Jules Swarms
152
37
 
153
- ---
38
+ `jules-orchestrator-kit` provides the production-hardened control plane needed to execute parallel Google Jules agent swarms safely:
154
39
 
155
- ## Expand with MCP
40
+ - **Parallel Agent Swarms**: Execute multi-agent task batches concurrently with deterministic lock management and automatic collision prevention.
41
+ - **Self-Healing OODA Loop**: Automatic test/build verification and repair loop with sliding-window thrash detection to halt non-convergent agent loops ($A \rightarrow B \rightarrow A \rightarrow B$) and preserve API token budgets.
42
+ - **4-Phase Security Gatekeeper**: Fails closed on untrusted PRs by verifying Scope (`forbidden_paths`), Diff Payload Size, Secret Entropy (> 3.6 bits), and Trusted Build/Test Execution.
156
43
 
157
- All task dispatches dynamically inject `<MCP_DIRECTIVE>` envelopes into task prompts. This forces Jules to adhere to strict read-before-write invariants.
44
+ ---
158
45
 
159
- You can supercharge Jules with external MCP servers by connecting them to your environment, granting Jules direct access to your infrastructure and real-time documentation. Examples:
160
- * **SaaS APIs & Tooling:** Context 7, Linear, and v0.
161
- * **Databases & Cloud:** Render, Neon, Supabase, Stitch.
162
- * **Framework Documentation:** Astro Docs, Cloudflare Docs, Next.js Docs.
46
+ ## ⚙️ Core Technical Architecture
163
47
 
164
- ---
48
+ Built strictly on native Node.js 18+ ESM with **Zero External Runtime Dependencies** (`"node": ">=18.0.0"`):
165
49
 
166
- ## Integration Interfaces
50
+ - **Linearizable VFS Mutex (`src/state.mjs`)**: Kernel-level directory mutex (`withVfsMutex`) guaranteeing serial linearizability for SHA-256 hash-chained session ledgers under high concurrency.
51
+ - **PID Recycling & Stale Lock Protection (`src/state.mjs`)**: Linux `/proc/<pid>/stat` launch-time validation prevents false-positive lock reaps from recycled OS process IDs.
52
+ - **Memory-Bounded Content-Length MCP Streaming (`src/mcp.mjs`)**: Native MCP server over stdio streams using `McpFrameDecoder` with a 4 MB memory safety ceiling and panic boundaries to prevent stdout stack trace leaks.
53
+ - **Process Group Isolation (`src/process-group.mjs`)**: `ProcessGroupManager` creates isolated process groups (`detached: true`) and catches `SIGINT`/`SIGTERM`/`exit` signals to execute `process.kill(-pgid)`, guaranteeing zero zombie processes.
54
+ - **TOCTOU & Symlink Defense (`src/security.mjs`)**: `safeAtomicWrite()` uses `O_CREAT | O_EXCL | O_WRONLY` temp files with `fsyncSync` + `renameSync` and `lstatSync`/`realpathSync` symlink checks.
55
+ - **3-Way Structural AST/JSON Merge (`scripts/jules-merge-swarm.mjs`)**: Pure Node `deepMerge3Way()` algorithm for recursive object and array merges executed in isolated temporary directories (`os.tmpdir()`).
167
56
 
168
- The orchestrator supports three primary integration channels:
57
+ ---
169
58
 
170
- **1. Direct REST API Mode (`jules.googleapis.com`)**
171
- When `JULES_API_KEY` and `JULES_REPO` are present in your environment, payloads are dispatched directly to the official Google Jules REST API endpoint. Handles HTTP 429 rate limits gracefully.
59
+ ## 🛠️ CLI Command Reference (`agentctl`)
172
60
 
173
- **2. Native Jules CLI Fallback**
174
- If no API key is configured, the kit seamlessly falls back to invoking your local `jules` CLI binary via standard streams.
61
+ | Command | Usage | Description |
62
+ | :--- | :--- | :--- |
63
+ | `agentctl dispatch` | `agentctl dispatch --title "..." --prompt "..."` | Dispatches an autonomous task to Jules |
64
+ | `agentctl gate` | `agentctl gate [--fix] [--base main]` | Runs 4-Phase Safety Gatekeeper against workspace |
65
+ | `agentctl queue` | `agentctl queue` | Processes pending task queue from `.agent/jules-queue/` |
66
+ | `agentctl swarm` | `agentctl swarm` | Executes parallel swarm task queue |
67
+ | `agentctl merge-swarm` | `agentctl merge-swarm` | Performs 3-way structural merge on completed swarm PRs |
68
+ | `agentctl mcp` | `agentctl mcp` | Starts stdio Model Context Protocol (MCP) server |
69
+ | `agentctl doctor` | `agentctl doctor` | Verifies stack configuration, environment, and budget |
175
70
 
176
- **3. Programmatic Node.js SDK (`index.mjs`)**
177
- Downstream Node.js tools, MCP servers, and LLM orchestrators can import kit functions directly:
178
- ```js
179
- import { gate, dispatch, validateEnvelope, classifyRiskTier, checkAssetIntegrity, checkRulesBudget, redactSecrets } from "jules-orchestrator-kit";
71
+ ---
180
72
 
181
- // Anonymize sensitive PII (emails, IPs, phone numbers) before sending prompts
182
- const cleanPrompt = anonymizePii("Contact support at john@example.com");
73
+ ## 📋 Exit Code Protocol
183
74
 
184
- // Programmatically dispatch tasks
185
- await dispatch({ title: "Refactor Auth", prompt: cleanPrompt });
75
+ Standardized exit codes enforced across all CLI utilities:
186
76
 
187
- // Run 4-phase safety gate audit
188
- const audit = await gate({ base: "main" });
189
- ```
77
+ | Code | Status | Description |
78
+ | :---: | :--- | :--- |
79
+ | `0` | **Success** | Task completed cleanly; verification passed 100%. |
80
+ | `1` | **Arg / Pre-Dispatch Failure** | Invalid arguments, prompt > 50 KB, or pre-dispatch error. |
81
+ | `2` | **API / Network Failure** | Jules API rate-limit (429), `FAILED_PRECONDITION`, or timeout. |
82
+ | `3` | **Scope Violation** | Attempted modification of protected/forbidden files. |
83
+ | `4` | **OODA Exhausted / Regression** | Verification failed after max repair attempts or thrash loop. |
84
+ | `5` | **Diff Payload Exceeded** | Git diff exceeds payload budget (`limits.diffKb`, default 75 KB). |
85
+ | `6` | **Secret Detected** | High-confidence secret or token detected in patch diff. |
86
+ | `7` | **Budget Exhausted** | Daily task session quota limit reached (`limits.dailyTasks`, default 300). |
190
87
 
191
88
  ---
192
89
 
193
- ## Known Limitations
194
-
195
- **Code Suggestions (Web UI Only)**
196
- Currently, there is no way to automatically extract "Suggestions" (the inline code review comments Jules sometimes proposes instead of direct commits) via the CLI or API. Suggestions can only be read directly inside the **Jules Web UI**.
90
+ ## 🤝 Join the Community & Field-Testing
197
91
 
198
- *Workaround for Local LLM Users:* If you are tinkering with Jules alongside a local LLM and Jules leaves a Suggestion, the easiest workflow is to open the Jules Web UI, copy the suggestion block, and paste it back into your local LLM.
92
+ We are actively field-testing `v0.20.0` across 300+ daily autonomous sessions and opening the kit to the Google Jules developer community for feedback and contributions!
199
93
 
200
- ---
94
+ - **Test & Benchmark**: Clone the repository, test your edge cases, and run parallel swarms against your codebases.
95
+ - **Report Issues**: Found a bug, state race condition, or edge-case failure? Open an issue on GitHub.
96
+ - **Submit PRs**: We welcome contributions! Ensure all additions preserve our Zero Runtime Dependency invariant and pass `npm test` & `npm run lint`.
201
97
 
202
- ## Supported Tech Stacks
203
-
204
- | Stack / Ecosystem | Manifest / Workspace File | Test Command | Build Command |
205
- | --------------------------- | ------------------------------------- | ---------------------------------------- | ---------------------------------------- |
206
- | **Turborepo** | `turbo.json` | `npx turbo run test --filter=...` | `npx turbo run build --filter=...` |
207
- | **pnpm Workspace** | `pnpm-workspace.yaml` | `pnpm --filter=... test` | `pnpm --filter=... build` |
208
- | **Nx Workspace** | `nx.json` | `npx nx run-many -t test -p ...` | `npx nx run-many -t build -p ...` |
209
- | **Bun** | `bunfig.toml` / `bun.lockb` | `bun test` | `bun run build` |
210
- | **Deno** | `deno.json` / `deno.jsonc` | `deno test` | `deno task build` |
211
- | **JavaScript / TypeScript** | `package.json` | `npm test` | `npm run build` |
212
- | **Rust** | `Cargo.toml` | `cargo test --workspace` | `cargo build` |
213
- | **Go** | `go.mod` | `go test ./...` | `go build ./...` |
214
- | **Python** | `pyproject.toml` / `requirements.txt` | `pytest` | *(none)* |
215
- | **Elixir** | `mix.exs` | `mix test` | `mix compile` |
216
- | **Ruby** | `Gemfile` | `bundle exec rake test` | *(none)* |
217
- | **Swift** | `Package.swift` | `swift test` | `swift build` |
218
- | **Java (Maven/Gradle)** | `pom.xml` / `build.gradle` | `mvn test` / `./gradlew test` | `mvn compile` / `./gradlew assemble` |
219
- | **C / C++** | `Makefile` | `make test` | `make build` |
98
+ ### Running Tests Locally
220
99
 
221
- ---
100
+ ```bash
101
+ # Clone the repository
102
+ git clone https://github.com/FullThrottle83/jules-orchestrator-kit.git
103
+ cd jules-orchestrator-kit
222
104
 
223
- ## Reference Material
224
-
225
- ### CLI Commands
226
- All commands are registered in `package.json` and can be run via `npm run <command>`.
227
-
228
- | Command | Description |
229
- | ------- | ----------- |
230
- | `npm run init` | Initializes the orchestrator and `.agent/` directory |
231
- | `npm run test` | Runs the orchestrator kit's own unit tests |
232
- | `npm run jules:dispatch` | Dispatches a single task directly to Jules |
233
- | `npm run jules:queue` | Runs the local queue processor (picks up tasks from `.agent/jules-queue`) |
234
- | `npm run jules:create` | Scaffolds a new boilerplate task markdown file |
235
- | `npm run jules:status` | Shows real-time 3-bucket status (Action Required, In Progress, Completed) |
236
- | `npm run jules:audit` | Runs the self-audit gatekeeper (verifies tests, forbidden paths, and scope) |
237
- | `npm run jules:cleanup` | Audits and closes merged or stale REST sessions |
238
- | `npm run jules:scan` | Scans the codebase for TODO/FIXME comments and generates a suggested tasks file |
239
- | `npm run jules:swarm` | Launches a multi-agent swarm in parallel across isolated worktrees |
240
- | `npm run jules:merge-swarm` | Autonomous PR merge engine with Safety Gate lock verification |
241
- | `npm run jules:nightly` | Nightly maintenance job (usually triggered in CI) |
242
-
243
- ### Specialist Agent Prompts & Templates (`.agent/prompts/`)
244
- The kit includes pre-configured single-responsibility prompt presets in `.agent/prompts/`:
245
- - **`Overseer.md`**: Codebase architecture auditor & technical debt mapper.
246
- - **`Bolt.md`**: Performance micro-optimizer and payload governor (enforces < 75 KB payload diff limits).
247
- - **`Sentinel.md`**: Security audit specialist for input sanitization and secret scanning.
248
- - **`Task_Template.md`**: Machine-readable master task prompt template schema.
249
-
250
- ### Environment Variables
251
-
252
- | Variable | Description |
253
- | -------- | ----------- |
254
- | `JULES_API_KEY` | Your Google Jules REST API key (required for API mode) |
255
- | `GEMINI_API_KEY` | Alias for `JULES_API_KEY` (fallback) |
256
- | `JULES_API_URL` | Override the Jules REST API URL |
257
- | `JULES_REPO` | Target GitHub Repository (Format: `owner/repo`) |
258
- | `JULES_REPOLESS` | Set to `true` or `1` to run in repoless/serverless mode |
259
- | `JULES_DRY_RUN` | Set to `true` or `1` to simulate dispatching without making API calls |
260
- | `JULES_DAILY_BUDGET` | Daily max session budget for autonomous dispatches (Default: `300`) |
261
- | `JULES_MAX_DIFF_KB` | Maximum git diff payload size in KB before aborting with Exit Code 5 (Default: `50`) |
262
- | `JULES_ALLOW_COMMAND_FILE_CHANGES` | Set to `true` to allow PR changes to command/config files like `package.json`, `tsconfig.json`, `vite.config.ts` (Default: `false`) |
263
- | `JULES_ALLOW_AGENT_RULE_CHANGES` | Set to `true` to allow PR changes to agent rule files like `AGENTS.md`, `JULES_RULES_TEMPLATE.md` (Default: `false`) |
264
- | `BASE_BRANCH` | Base branch for PR Audits & Merge-Base calculations (Default: `main`) |
265
- | `GITHUB_HEAD_REF` | PR Head Branch (Used dynamically by CI during OODA repair) |
266
- | `JULES_PROJECT_ROOT` | Root directory of the project (Auto-assigned during swarm executions) |
267
- | `JULES_SWARM_CONCURRENCY` | Maximum parallel dispatches for swarm runs (Default: `3`) |
268
- | `JULES_SWARM_STAGGER_MS` | Dispatch stagger interval in milliseconds (Default: `1500`) |
269
- | `JULES_PACE_MS` | Rate-limit for the `jules:queue` command (Default: `500`) |
270
- | `JULES_USE_WORKTREES` | Use Git Worktrees instead of cloning for swarm isolation (Default: `false`) |
271
- | `JULES_SLOT_INDEX` | Current slot index for partitioning tasks (Swarm mode) |
272
- | `JULES_SLOT_TOTAL` | Total number of slots for partitioning tasks (Swarm mode) |
273
- | `CI` | Set to `true` to change log output and fail-fast behaviors for CI environments |
274
- | `ALLOW_AUTO_REPAIR` | Set to `true` to allow OODA Auto-Repair even when running in CI |
275
- | `GITHUB_STEP_SUMMARY` | GitHub Actions Step Summary File Path |
276
- | `NO_COLOR` | Set to `true` to disable ANSI color output |
277
-
278
- > [!NOTE]
279
- > **Scope Enforcement via `allow_paths`**
280
- > In `.agent/jules.yml`, defining `allow_paths` acts as a strict allowlist (deny-by-default). When non-empty, any file modified outside `allow_paths` will trigger a security violation (Exit Code 3). `forbidden_paths` always take absolute precedence and cannot be overridden.
281
-
282
- ### Exit Codes
283
- The Gatekeeper (`jules-self-audit.mjs` and related scripts) uses standard exit codes to signal status to CI systems.
284
-
285
- | Code | Meaning | Action Taken |
286
- | ---- | ------- | ------------ |
287
- | `0` | **Success** | All tests and security checks passed. |
288
- | `1` | **Pre-Dispatch / Arg Error** | Missing dependencies, prompt > 50 KB, syntax error, or pre-dispatch failure. |
289
- | `2` | **API / Network / Quota Error** | REST API HTTP 429 rate limit, HTTP 400 `FAILED_PRECONDITION` quota (~30 active limit), or connection timeout. |
290
- | `3` | **Security / Scope Violation** | Modified file breached `forbidden_paths` or changed command-defining files (`package.json`, `Cargo.toml`). Fails closed immediately. |
291
- | `4` | **Verification Exhausted** | Tests failed and the OODA Auto-Repair loop either exhausted its max retries (3) or is disabled. |
292
- | `5` | **Diff Payload Limit** | Diff payload size exceeded payload governor budget (`JULES_MAX_DIFF_KB`, default 50 KB). Split task. |
293
- | `6` | **Secret Leak Prevented** | High-confidence secret or private key pattern detected in diff. Aborted immediately. |
294
- | `7` | **Budget Exhausted** | Daily session budget limit reached or budget state locked. |
105
+ # Run ESLint & node unit test suite (100% zero external runtime deps)
106
+ npm run lint
107
+ npm test
108
+ ```
295
109
 
296
110
  ---
297
111
 
298
- ## Contributing
299
- We welcome contributions! Please follow these core principles:
300
- 1. **Zero Runtime Dependencies**: Use ONLY native Node.js built-in modules (`node:fs`, `node:path`, `node:child_process`, `node:crypto`, `node:util`).
301
- 2. **Verification Suite**: Ensure 100% of unit tests pass cleanly (`npm test`).
302
- 3. **Conventional Commits**: Use standardized prefixes (`feat:`, `fix:`, `docs:`, `test:`, `chore:`).
303
- 4. **Cross-Platform Compatibility**: Normalize Windows backslashes (`\`) to POSIX slashes (`/`) for glob patterns and paths.
304
-
305
- Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before participating.
112
+ ## 📄 License
306
113
 
307
- ## License
308
- MIT License - feel free to use, modify, and share!
114
+ Distributed under the [MIT License](LICENSE).
package/bin/agentctl.mjs CHANGED
@@ -13,7 +13,7 @@ const command = args[0];
13
13
 
14
14
  function printHelp() {
15
15
  console.log(`
16
- 🚀 agentctl v0.9.0 — Universal Agent Orchestrator & Safety Gatekeeper
16
+ 🚀 agentctl v0.20.0 — Universal Agent Orchestrator & Safety Gatekeeper
17
17
 
18
18
  Usage: agentctl <command> [options]
19
19
 
@@ -22,6 +22,7 @@ Commands:
22
22
  gate | audit Run CI security and verification gate against current branch
23
23
  queue Run pending task queue
24
24
  swarm Run parallel task swarm
25
+ mcp Start stdio Model Context Protocol (MCP) server
25
26
  clean Clean stale branches, worktrees, locks, and ledgers
26
27
  lock <action> Manage mutex locks (acquire | release | status | cleanup)
27
28
  doctor Run system diagnostics and stack resolution checks
@@ -42,7 +43,7 @@ async function main() {
42
43
  }
43
44
 
44
45
  if (command === "version" || command === "--version" || command === "-v") {
45
- console.log("agentctl v0.9.0");
46
+ console.log("agentctl v0.9.4");
46
47
  process.exit(0);
47
48
  }
48
49
 
@@ -261,6 +262,12 @@ base_branch: main
261
262
  break;
262
263
  }
263
264
 
265
+ case "mcp": {
266
+ const { startMcpServer } = await import("../src/mcp.mjs");
267
+ startMcpServer();
268
+ break;
269
+ }
270
+
264
271
  default:
265
272
  console.error(`Unknown command: ${command}`);
266
273
  printHelp();
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { startMcpServer } from "../src/mcp.mjs";
4
+
5
+ startMcpServer();
package/index.mjs CHANGED
@@ -5,7 +5,7 @@
5
5
  * security auditing, repo gating, and state operations.
6
6
  */
7
7
 
8
- export { loadConfig, detectStack, resolveVerify, resolveRoot, normalizePath } from "./src/config.mjs";
8
+ export { loadConfig, detectStack, resolveVerify, resolveRoot, normalizePath, TIER_PRESETS } from "./src/config.mjs";
9
9
  export {
10
10
  shannonEntropy,
11
11
  redactSecrets,
@@ -19,14 +19,23 @@ export { createProvider, JULES_PRESET, CLAUDE_PRESET, CODEX_PRESET } from "./src
19
19
  export {
20
20
  appendLedger,
21
21
  readLedger,
22
+ verifyLedgerIntegrity,
23
+ reserveBudget,
24
+ commitBudgetReservation,
22
25
  withBudget,
23
26
  checkDailyBudget,
24
27
  acquireLock,
25
28
  releaseLock,
26
29
  lockStatus,
27
30
  } from "./src/state.mjs";
28
- export { gate, dispatch, repair, run } from "./src/engine.mjs";
31
+ export { gate, dispatch, repair, run, fingerprintFailureState } from "./src/engine.mjs";
29
32
  export { validateEnvelope } from "./src/envelope.mjs";
33
+ export {
34
+ createExecutionEnvelope,
35
+ verifyExecutionEnvelope,
36
+ freezeExecutionEnvelope,
37
+ hashExecutionEnvelope,
38
+ } from "./src/execution_envelope.mjs";
30
39
  export { checkAssetIntegrity } from "./src/asset_integrity.mjs";
31
40
  export { classifyRiskTier, RISK_TIERS } from "./src/risk.mjs";
32
41
  export { checkRulesBudget } from "./src/rules_budget.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jules-orchestrator-kit",
3
- "version": "0.9.3",
3
+ "version": "0.20.0",
4
4
  "description": "Orchestration kit for running Google Jules autonomous agents.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,9 @@
14
14
  "bin": {
15
15
  "agentctl": "bin/agentctl.mjs",
16
16
  "jules-init": "bin/init.js",
17
- "jules-orchestrator-kit": "bin/agentctl.mjs"
17
+ "jules-orchestrator-kit": "bin/agentctl.mjs",
18
+ "jules-mcp": "bin/mcp-server.mjs",
19
+ "agentctl-mcp": "bin/mcp-server.mjs"
18
20
  },
19
21
  "main": "index.mjs",
20
22
  "exports": {