@dirgha/code 1.43.3 → 2.0.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/CHANGELOG.md +22 -0
- package/LICENSE +202 -101
- package/NOTICE +9 -0
- package/README.md +184 -97
- package/THIRD_PARTY_NOTICES.md +28 -0
- package/bin/build-native.mjs +43 -0
- package/bin/dirgha.mjs +241 -0
- package/dist/cli/flows/full-cycle.d.ts +0 -3
- package/dist/cli/flows/full-cycle.js +1 -9
- package/dist/cli/flows/full-cycle.js.map +1 -1
- package/dist/cli/main.js +1 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/slash/index.js +0 -2
- package/dist/cli/slash/index.js.map +1 -1
- package/dist/cli/subcommands/index.js +0 -2
- package/dist/cli/subcommands/index.js.map +1 -1
- package/dist/integrations/entitlements.d.ts +1 -2
- package/dist/integrations/entitlements.js.map +1 -1
- package/dist/integrations/index.d.ts +0 -1
- package/dist/integrations/index.js +0 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/mcp/mcp-config.js +27 -3
- package/dist/mcp/mcp-config.js.map +1 -1
- package/dist/safety/policy.d.ts +18 -0
- package/dist/safety/policy.js +95 -1
- package/dist/safety/policy.js.map +1 -1
- package/dist/tools/index.d.ts +1 -2
- package/dist/tools/index.js +1 -8
- package/dist/tools/index.js.map +1 -1
- package/extensions/firefox-mv3/background.js +144 -0
- package/extensions/firefox-mv3/content-agent-dom.js +161 -0
- package/extensions/firefox-mv3/lokahi_gate.wasm +0 -0
- package/extensions/firefox-mv3/manifest.json +33 -0
- package/include/dirgha_kernel.h +41 -0
- package/package.json +65 -56
- package/plugins/dsh-plugin-dirgha/cordis.patch.yml +11 -0
- package/plugins/dsh-plugin-dirgha/index.ts +135 -0
- package/plugins/dsh-plugin-dirgha/package.json +18 -0
- package/plugins/robotics-physical-ai/README.md +11 -0
- package/plugins/robotics-physical-ai/mujoco_eval_sidecar.py +848 -0
- package/plugins/robotics-physical-ai/plugin.toml +23 -0
- package/plugins/robotics-skills-pack/README.md +15 -0
- package/plugins/robotics-skills-pack/plugin.toml +36 -0
- package/vendor/rtk/README.md +7 -0
- package/dist/cli/slash/goal.d.ts +0 -14
- package/dist/cli/slash/goal.js +0 -74
- package/dist/cli/slash/goal.js.map +0 -1
- package/dist/cli/slash/gpu.d.ts +0 -11
- package/dist/cli/slash/gpu.js +0 -58
- package/dist/cli/slash/gpu.js.map +0 -1
- package/dist/cli/subcommands/gpu.d.ts +0 -15
- package/dist/cli/subcommands/gpu.js +0 -187
- package/dist/cli/subcommands/gpu.js.map +0 -1
- package/dist/context/goal.d.ts +0 -27
- package/dist/context/goal.js +0 -77
- package/dist/context/goal.js.map +0 -1
- package/dist/gpu/market.d.ts +0 -30
- package/dist/gpu/market.js +0 -120
- package/dist/gpu/market.js.map +0 -1
- package/dist/integrations/bucky-client.d.ts +0 -105
- package/dist/integrations/bucky-client.js +0 -76
- package/dist/integrations/bucky-client.js.map +0 -1
- package/dist/providers/presets.d.ts +0 -30
- package/dist/providers/presets.js +0 -80
- package/dist/providers/presets.js.map +0 -1
- package/dist/tools/goal.d.ts +0 -11
- package/dist/tools/goal.js +0 -69
- package/dist/tools/goal.js.map +0 -1
- package/dist/tools/gpu-compute.d.ts +0 -19
- package/dist/tools/gpu-compute.js +0 -380
- package/dist/tools/gpu-compute.js.map +0 -1
- package/dist/tui/ink/components/GoalIndicator.d.ts +0 -7
- package/dist/tui/ink/components/GoalIndicator.js +0 -34
- package/dist/tui/ink/components/GoalIndicator.js.map +0 -1
- package/vendor/rtk/linux-x64/rtk +0 -0
package/README.md
CHANGED
|
@@ -1,147 +1,234 @@
|
|
|
1
|
-
<
|
|
1
|
+
<h1 align="center">Dirgha</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center"><strong>Open infrastructure for AI that acts: run agents on your own machine, and check every action before it happens.</strong></p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="License: Apache-2.0"></a>
|
|
7
|
+
<a href="https://github.com/Dirgha-AI/dirgha/actions/workflows/ci.yml"><img src="https://github.com/Dirgha-AI/dirgha/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@dirgha/code"><img src="https://img.shields.io/npm/dt/@dirgha/code.svg?label=npm%20downloads" alt="npm downloads"></a>
|
|
9
|
+
<a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/protocol-MCP-purple.svg" alt="Protocol: MCP"></a>
|
|
10
|
+
</p>
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
AI agents now open files, run commands, send messages and, increasingly, move machines. Dirgha is a harness for those agents. It runs a coding agent in your terminal and robot simulations in MuJoCo with the same engine, works with local models or any provider you choose, and puts a safety gate between the agent and everything it touches. Your keys, memory and logs stay on your machine.
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
Dirgha is built by [Dirgha AI](#about-dirgha-ai) and released under Apache-2.0.
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[Why a sovereign coding CLI matters](https://github.com/Dirgha-AI/Rama-I-Dirgha-AI-OS/blob/main/WHY_BHARAT_NEEDS_DIRGHA_CLI.md) — latency data, cost structure for independent developers, the layered view of AI sovereignty, and what the CLI does not solve.
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/Dirgha-AI/dirgha.git && cd dirgha
|
|
18
|
+
npm ci && npm run build
|
|
19
|
+
node bin/dirgha.mjs # start the agent
|
|
20
|
+
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
---
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
## Contents
|
|
25
|
+
|
|
26
|
+
- [Who it's for](#who-its-for)
|
|
27
|
+
- [What you get](#what-you-get)
|
|
28
|
+
- [How it works](#how-it-works)
|
|
29
|
+
- [Quick start](#quick-start)
|
|
30
|
+
- [Everyday use](#everyday-use)
|
|
31
|
+
- [Models and providers](#models-and-providers)
|
|
32
|
+
- [Safety model](#safety-model)
|
|
33
|
+
- [Robotics and physical AI](#robotics-and-physical-ai)
|
|
34
|
+
- [Documentation](#documentation)
|
|
35
|
+
- [For AI agents](#for-ai-agents)
|
|
36
|
+
- [The Dirgha AI stack](#the-dirgha-ai-stack)
|
|
37
|
+
- [Project status](#project-status)
|
|
38
|
+
- [Roadmap](#roadmap)
|
|
39
|
+
- [For organisations](#for-organisations)
|
|
40
|
+
- [About Dirgha AI](#about-dirgha-ai)
|
|
41
|
+
- [Contributing, security and licence](#contributing-security-and-licence)
|
|
42
|
+
|
|
43
|
+
## Who it's for
|
|
44
|
+
|
|
45
|
+
- **Developers** who want a capable coding agent that runs locally, uses the model they pick, and keeps a record of what it did.
|
|
46
|
+
- **Teams** that need agents to follow written rules: which files they may touch, which commands need a person's yes, where data may go.
|
|
47
|
+
- **Robotics and physical-AI builders** who want to test agent behaviour in simulation, with the same gate in front of physical actions.
|
|
48
|
+
- **Researchers and educators** who need an inspectable, offline-capable agent they can change.
|
|
49
|
+
|
|
50
|
+
## What you get
|
|
51
|
+
|
|
52
|
+
| | |
|
|
53
|
+
|---|---|
|
|
54
|
+
| **A coding agent** | Interactive terminal UI, one-shot mode (`dirgha "fix the failing test"`), headless mode for scripts, and NDJSON event output for other tools |
|
|
55
|
+
| **Real tools** | Files, shell, grep and glob search, git and GitHub, a browser, language-server lookups (definitions, references, symbols), checkpoints, scheduled tasks, a local knowledge base and code graph |
|
|
56
|
+
| **Parallel agents** | `dirgha fleet` runs sub-agents in separate git worktrees and merges their work |
|
|
57
|
+
| **Your choice of model** | 14 hosted provider families plus any OpenAI-compatible endpoint, or fully local models through Ollama and llama.cpp |
|
|
58
|
+
| **Local memory** | Long-term memory and search in SQLite under `~/.dirgha/` |
|
|
59
|
+
| **MCP both ways** | Connects to MCP servers (stdio and HTTP/SSE), and the Rust kernel serves 24 MCP tools of its own |
|
|
60
|
+
| **A safety gate** | A WebAssembly gate screens every tool call; it refuses when it can't check |
|
|
61
|
+
| **An audit trail** | Append-only local logs, and a signed, hash-chained ledger for gate decisions |
|
|
62
|
+
| **Extensibility** | Skills in the [agentskills.io](https://agentskills.io) format, hooks, and an ESM plugin API |
|
|
63
|
+
| **Robot evaluation** | A MuJoCo sidecar for seeded rollouts, failure triage and HTML replays |
|
|
64
|
+
|
|
65
|
+
## How it works
|
|
25
66
|
|
|
26
|
-
|
|
67
|
+
```
|
|
68
|
+
you / your scripts / other agents
|
|
69
|
+
│
|
|
70
|
+
┌────────────▼────────────┐
|
|
71
|
+
│ dirgha (bin/dirgha.mjs) │ one entry point
|
|
72
|
+
└──────┬──────────┬───────┘
|
|
73
|
+
│ │
|
|
74
|
+
┌───────────────▼──┐ ┌───▼─────────────────────────┐
|
|
75
|
+
│ TypeScript agent │ │ Rust kernel │
|
|
76
|
+
│ (src/) │ │ dirgha-native-host (~1 MB) │
|
|
77
|
+
│ loop, tools, │ │ 24 MCP tools, cockpit, │
|
|
78
|
+
│ providers, TUI │ │ browser native messaging │
|
|
79
|
+
└───────┬──────────┘ └───┬─────────────────────────┘
|
|
80
|
+
│ │
|
|
81
|
+
└──────┬───────────┘
|
|
82
|
+
▼
|
|
83
|
+
Safety gate (WebAssembly, crates/lokahi-gate)
|
|
84
|
+
checks each action → allow / refuse / needs approval
|
|
85
|
+
│
|
|
86
|
+
▼
|
|
87
|
+
files · shell · git · browser · MCP servers · robots (simulated)
|
|
88
|
+
```
|
|
27
89
|
|
|
28
|
-
|
|
90
|
+
The TypeScript agent handles conversation, tools and providers. The Rust kernel handles the gate, the ledger, the MCP server, the local cockpit and the robotics tools. Both sit behind one command.
|
|
29
91
|
|
|
30
|
-
|
|
92
|
+
## Quick start
|
|
31
93
|
|
|
32
|
-
|
|
94
|
+
**Requirements:** Node.js 22 or later. Rust stable if you want to build the kernel.
|
|
33
95
|
|
|
34
|
-
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/Dirgha-AI/dirgha.git
|
|
98
|
+
cd dirgha
|
|
99
|
+
npm ci
|
|
100
|
+
npm run build # TypeScript agent
|
|
101
|
+
npm run build:native # Rust kernel (optional)
|
|
102
|
+
node bin/dirgha.mjs doctor # check your setup
|
|
103
|
+
```
|
|
35
104
|
|
|
36
|
-
|
|
105
|
+
Add a key, or use a local model:
|
|
37
106
|
|
|
38
|
-
|
|
107
|
+
```bash
|
|
108
|
+
node bin/dirgha.mjs keys set OPENROUTER_API_KEY sk-or-... # stored in ~/.dirgha/keys.json
|
|
109
|
+
# or run fully offline with Ollama:
|
|
110
|
+
ollama pull qwen2.5-coder:7b
|
|
111
|
+
node bin/dirgha.mjs -m ollama/qwen2.5-coder:7b
|
|
112
|
+
```
|
|
39
113
|
|
|
40
|
-
|
|
114
|
+
Start working:
|
|
41
115
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
116
|
+
```bash
|
|
117
|
+
node bin/dirgha.mjs # interactive
|
|
118
|
+
node bin/dirgha.mjs "explain src/kernel/agent-loop.ts"
|
|
119
|
+
echo "summarise the last 5 commits" | node bin/dirgha.mjs --print
|
|
120
|
+
```
|
|
46
121
|
|
|
47
|
-
|
|
122
|
+
> `npm install -g @dirgha/code` installs the 1.x release today. 2.0 will be published to npm shortly; until then, run from source.
|
|
48
123
|
|
|
49
|
-
|
|
124
|
+
## Everyday use
|
|
50
125
|
|
|
51
|
-
|
|
126
|
+
| Command | What it does |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `dirgha` | Interactive agent |
|
|
129
|
+
| `dirgha "<prompt>"` / `dirgha ask "<prompt>"` | One task, with tools, then exit |
|
|
130
|
+
| `dirgha chat "<prompt>"` | Plain model call, no tools |
|
|
131
|
+
| `dirgha init` | Write a `DIRGHA.md` with notes about your project for the agent |
|
|
132
|
+
| `dirgha fleet launch ...` | Parallel agents in git worktrees |
|
|
133
|
+
| `dirgha verify "<goal>" --accept "<cmd>"` | Run a goal, succeed only if your command exits 0 |
|
|
134
|
+
| `dirgha memory add|list|show|remove` | Long-term memory |
|
|
135
|
+
| `dirgha models list` / `dirgha keys list` | Models and keys |
|
|
136
|
+
| `dirgha audit tail` | Recent actions from the local audit log |
|
|
137
|
+
| `dirgha export-session <id>` / `import-session <path>` | Move sessions between machines |
|
|
138
|
+
| `dirgha doctor` | Environment and kernel checks |
|
|
139
|
+
| `dirgha cockpit` | Local web cockpit (needs the kernel) |
|
|
140
|
+
| `dirgha --self-test` | Kernel self-test |
|
|
52
141
|
|
|
53
|
-
|
|
142
|
+
Run `dirgha --help` for the full list.
|
|
54
143
|
|
|
55
|
-
|
|
144
|
+
## Models and providers
|
|
56
145
|
|
|
57
|
-
|
|
146
|
+
Bring your own keys for Anthropic, OpenAI, Google Gemini, OpenRouter, DeepSeek, NVIDIA NIM, Fireworks, Groq, Mistral, Cohere, Together, Cerebras, Perplexity and xAI, or point Dirgha at any OpenAI-compatible endpoint. For local and offline work, use Ollama or llama.cpp; a quantized 7B model runs on an ordinary laptop with no GPU.
|
|
58
147
|
|
|
59
|
-
|
|
148
|
+
Keys live in `~/.dirgha/keys.json` or environment variables (`OPENROUTER_API_KEY`, `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `NVIDIA_API_KEY`). Dirgha sends them only to the provider they belong to.
|
|
60
149
|
|
|
61
|
-
##
|
|
150
|
+
## Safety model
|
|
62
151
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
152
|
+
- **Every tool call is checked first.** The WebAssembly gate screens shell commands, file paths, secrets and network targets. If the gate is missing or errors, the call is refused (`DIRGHA_ALLOW_UNGATED=1` turns this off for local development and prints a warning).
|
|
153
|
+
- **Physical actions need a person.** Actions marked S2 (irreversible or physical) are refused unless they carry an Ed25519 signature from an approver you configured. The agent cannot approve itself.
|
|
154
|
+
- **Silence means no.** An approval that doesn't arrive in time is a refusal.
|
|
155
|
+
- **Decisions are recorded.** Gate decisions go into a hash-chained, signed ledger you can verify with your own public key.
|
|
156
|
+
- **The cockpit is locked.** Its API needs a bearer token and accepts no cross-origin requests.
|
|
157
|
+
- **No telemetry by default.** Usage statistics are off unless you run `dirgha telemetry enable`.
|
|
68
158
|
|
|
69
|
-
|
|
70
|
-
For 100% local: install [Ollama](https://ollama.com) or [llama.cpp](https://github.com/ggerganov/llama.cpp), then run `dirgha setup` and pick **Local**.
|
|
159
|
+
The built-in gate is a fast first-pass filter. For rules your team writes and signs, approvals from separate people, and evidence an auditor can check, use [LOKAHI](https://github.com/Dirgha-AI/lokahi) (`pip install lokahi`). Dirgha is moving to LOKAHI's reference rules; see the [roadmap](#roadmap).
|
|
71
160
|
|
|
72
|
-
|
|
161
|
+
## Robotics and physical AI
|
|
73
162
|
|
|
74
|
-
|
|
163
|
+
Dirgha uses the same harness for robots. Today that means simulation:
|
|
75
164
|
|
|
76
|
-
|
|
165
|
+
- `dirgha eval-robot` runs seeded MuJoCo rollouts on bundled arm models and reports success with confidence intervals, failure classes and an HTML replay.
|
|
166
|
+
- `dirgha_sim_reset`, `dirgha_sim_step` and `dirgha_sim_observe` let an agent drive a simulation step by step over MCP.
|
|
167
|
+
- `dirgha_gate_check` puts the safety gate in front of a proposed robot action.
|
|
77
168
|
|
|
78
|
-
|
|
79
|
-
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
80
|
-
| **17 providers** | anthropic, openai, gemini, openrouter, nvidia, fireworks, deepseek, groq, cerebras, together, deepinfra, mistral, xai, perplexity, cohere, kimi, zai |
|
|
81
|
-
| **34 model aliases** | `kimi`, `opus`, `sonnet`, `haiku`, `gemini`, `flash`, `deepseek`, `llama`, `ling`, `hy3`, … resolved before routing |
|
|
82
|
-
| **18 built-in tools** | `fs_read`, `fs_write`, `fs_edit`, `fs_ls`, `shell`, `git`, `github`, `search_grep`, `search_glob`, `browser`, `checkpoint`, `cron`, `task`, `go_to_definition`, `find_references`, `hover_documentation`, `document_symbols`, `qmd_search` |
|
|
83
|
-
| **20 slash commands** | `/account`, `/clear`, `/compact`, `/cost`, `/fleet`, `/keys`, `/login`, `/memory`, `/mode`, `/models`, `/resume`, `/session`, `/status`, `/theme`, `/upgrade`, … |
|
|
84
|
-
| **18 subcommands** | `audit`, `audit-codebase`, `cost`, `kb`, `keys`, `ledger`, `login`, `models`, `resume`, `skills`, `undo`, `update`, `verify`, … |
|
|
85
|
-
| **4 modes** | `act` · `plan` (read-only thinking) · `verify` (read-only audit) · `ask` (read-only Q&A) |
|
|
86
|
-
| **MCP** | stdio + HTTP/SSE + `bearerProvider` async OAuth rotation |
|
|
87
|
-
| **Source** | ~14.5 K LOC across 23 modules in `src/`. Hard rule: every src file ≤ 200 lines. |
|
|
169
|
+
Several robotics and hardware tools are **demos**: they show the interface but do not call real models, vendors or services, and every response includes `"simulated": true`. They are `dirgha_policy_infer`, `physical_ai_vla_infer`, `hf_lerobot_dataset_sync`, `hardware_cad_pcb_generate`, `hardware_vendor_quote_order` and `robotics_skill_invoke`.
|
|
88
170
|
|
|
89
|
-
##
|
|
171
|
+
## Documentation
|
|
90
172
|
|
|
91
|
-
|
|
|
92
|
-
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
173
|
+
| Guide | |
|
|
174
|
+
|---|---|
|
|
175
|
+
| [Getting started](docs/getting-started.md) | Install, pick a model, first tasks |
|
|
176
|
+
| [Safety model](docs/safety.md) | The gate, S2 approvals, the ledger, the cockpit |
|
|
177
|
+
| [MCP tools](docs/mcp-tools.md) | All 24 kernel tools, generated from the binary |
|
|
178
|
+
| [Robotics](docs/robotics.md) | MuJoCo evaluation and simulation tools |
|
|
179
|
+
| [Local models](docs/local-models.md) | Ollama and llama.cpp |
|
|
180
|
+
| [Fleet](docs/tutorials/fleet.md) and [sub-agents](docs/tutorials/subagents.md) | Parallel and delegated work |
|
|
181
|
+
| [Extensions](docs/extensions.md) | Plugin API |
|
|
98
182
|
|
|
99
|
-
##
|
|
183
|
+
## For AI agents
|
|
100
184
|
|
|
101
|
-
|
|
185
|
+
If you are an AI agent working with or on this repository:
|
|
102
186
|
|
|
103
|
-
|
|
187
|
+
- **[AGENTS.md](AGENTS.md)** tells you how to build, test and change this codebase safely.
|
|
188
|
+
- **[llms.txt](llms.txt)** is a short index of the docs, for loading into context.
|
|
189
|
+
- **[docs/agents/](docs/agents/)** has task guides: long-running commands, file search, skill security.
|
|
190
|
+
- To use Dirgha's tools from another agent, run `dirgha-native-host --mcp` (stdio). Call `tools/list` for the 24 tools and their schemas. Respect `"simulated": true` in responses.
|
|
104
191
|
|
|
105
|
-
##
|
|
192
|
+
## The Dirgha AI stack
|
|
106
193
|
|
|
107
|
-
|
|
108
|
-
| ----------------------- | ------------------------------------------------------------------------------------ |
|
|
109
|
-
| Architecture | [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) |
|
|
110
|
-
| Roadmap | [`docs/ROADMAP.md`](./docs/ROADMAP.md) |
|
|
111
|
-
| Knowledge management | [`docs/memory/km-architecture.md`](./docs/memory/km-architecture.md) |
|
|
112
|
-
| Architecture efficiency | [`docs/memory/architecture-efficiency.md`](./docs/memory/architecture-efficiency.md) |
|
|
113
|
-
| Skill security | [`docs/agents/skill-security.md`](./docs/agents/skill-security.md) |
|
|
114
|
-
| Files & search contract | [`docs/agents/files-and-search.md`](./docs/agents/files-and-search.md) |
|
|
115
|
-
| GPU marketplace | [`docs/GPU_MARKETPLACE.md`](./docs/GPU_MARKETPLACE.md) |
|
|
116
|
-
| Per-release notes | [`changelog/`](./changelog) |
|
|
194
|
+
Dirgha is one part of a small set of open tools, each usable on its own:
|
|
117
195
|
|
|
118
|
-
|
|
196
|
+
| Step | Project | What it does | Licence |
|
|
197
|
+
|---|---|---|---|
|
|
198
|
+
| Scan | [Arniko](https://github.com/Dirgha-AI/arniko) | Runs existing security scanners over an agent's code and dependencies and merges the findings | Apache-2.0 |
|
|
199
|
+
| Assess | [Ahimsa AI](https://github.com/Dirgha-AI/ahimsa-ai) | Scores a project's risk of harm and public benefit, and compiles approved projects into rules | MIT |
|
|
200
|
+
| Enforce | [LOKAHI](https://github.com/Dirgha-AI/lokahi) | An open rules format and gate: signed rules files, approvals from separate people, evidence packs, a conformance suite | Apache-2.0 |
|
|
201
|
+
| Run | **Dirgha** | The harness that runs agents and robots behind a gate | Apache-2.0 |
|
|
119
202
|
|
|
120
|
-
|
|
203
|
+
## Project status
|
|
121
204
|
|
|
122
|
-
|
|
205
|
+
Dirgha 2.0 is an early release for developers and pilots.
|
|
123
206
|
|
|
124
|
-
|
|
207
|
+
- The coding agent is the most mature part; it grew out of the 1.x releases on npm.
|
|
208
|
+
- The Rust kernel, gate and MuJoCo sidecar work and are tested in CI on Linux and Windows.
|
|
209
|
+
- The robotics model and hardware integrations listed above are demos.
|
|
210
|
+
- Nothing here has been independently security-reviewed. Don't rely on it to protect production systems yet.
|
|
125
211
|
|
|
126
|
-
|
|
127
|
-
- **File issues.** Anything that doesn't match the README, anything that crashes, anything that wastes your tokens. We read everything.
|
|
128
|
-
- **Suggest providers.** If your favourite provider isn't in the 17 we support, open an issue and tell us which one + the env var. Most are a single config-blob diff.
|
|
129
|
-
- **Write a skill.** SKILL.md packs work across compatible agent CLIs. Publish a git repo, share the URL, anyone can `dirgha skills install <url>`.
|
|
130
|
-
- **Write a plugin.** TypeScript extensions API takes ~20 lines for a real tool. We're keen to feature good ones — drop a link.
|
|
131
|
-
- **Send a PR.** Every PR adds a `.changeset/<random-name>.md` describing what changed and at what semver tier. Tests must stay green: `npm run test:cli:offline`.
|
|
212
|
+
## Roadmap
|
|
132
213
|
|
|
133
|
-
|
|
214
|
+
1. Run LOKAHI's reference rules inside Dirgha, passing the same conformance suite as the Python implementation.
|
|
215
|
+
2. Prebuilt kernel binaries for Windows, macOS and Linux; 2.0 on npm.
|
|
216
|
+
3. Arniko as an optional built-in scan before an agent runs.
|
|
217
|
+
4. Real robot policy adapters in place of the demos, behind the same gate.
|
|
218
|
+
5. A remote cockpit to approve actions and read logs from your phone.
|
|
134
219
|
|
|
135
|
-
##
|
|
220
|
+
## For organisations
|
|
136
221
|
|
|
137
|
-
|
|
222
|
+
Dirgha and LOKAHI are free and open source. If your organisation wants to run agents under written rules, Dirgha AI can help with setup, custom rule packs, pilots and support. Open an [issue](https://github.com/Dirgha-AI/dirgha/issues/new) titled "Pilot" and we will reply.
|
|
138
223
|
|
|
139
|
-
|
|
224
|
+
## About Dirgha AI
|
|
140
225
|
|
|
141
|
-
|
|
226
|
+
Dirgha AI builds open infrastructure so AI agents and robots act only within rules people set, and can prove it. We think the people who live with an AI system's actions should decide what it may do, and that the tools to check those decisions should belong to everyone. That is why the core is open source, runs on hardware people already own, and works offline.
|
|
142
227
|
|
|
143
|
-
|
|
228
|
+
Dirgha AI is led by [Salik Shah](https://salikshah.com), working with an open community of contributors.
|
|
144
229
|
|
|
145
|
-
|
|
230
|
+
## Contributing, security and licence
|
|
146
231
|
|
|
147
|
-
|
|
232
|
+
- **Contributing:** issues and pull requests are welcome. Sign off your commits (`git commit -s`) under the [Developer Certificate of Origin](https://developercertificate.org/). See [CONTRIBUTORS.md](CONTRIBUTORS.md).
|
|
233
|
+
- **Security:** report vulnerabilities privately to security@dirgha.ai. See [SECURITY.md](SECURITY.md).
|
|
234
|
+
- **Licence:** Apache-2.0 ([LICENSE](LICENSE), [NOTICE](NOTICE)). Copyright 2026 Salik Shah. Releases 1.x of `@dirgha/code` keep their FSL-1.1-MIT licence, and each becomes MIT two years after release. Third-party components are listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Third-Party Notices & Upstream Open-Source Attributions
|
|
2
|
+
|
|
3
|
+
Dirgha v2 builds upon and interoperates with the following open-source software and research specifications. We gratefully acknowledge their authors:
|
|
4
|
+
|
|
5
|
+
1. **`deepseek-ai/deepseek-recipe` (`0.2.0`) & `deepseek-ai/deepseek-harness` (`dsh`)**
|
|
6
|
+
- **Author:** DeepSeek-AI
|
|
7
|
+
- **License:** MIT License (`https://github.com/deepseek-ai/deepseek-recipe`, `https://github.com/deepseek-ai/deepseek-harness`)
|
|
8
|
+
- **Usage in Dirgha v2:** `crates/llm-router` directly links `deepseek-recipe-core@0.2.0` for conversation, prompt, and tool-call structures; `crates/agent-loop` and `plugins/dsh-plugin-dirgha` adopt `dsh`'s Cordis waterfall hook semantics (`agent/pre-step`, `tools/pre-execute`, `tools/post-execute`) and `session.vN.jsonl` log invariants.
|
|
9
|
+
|
|
10
|
+
2. **`SouravBeraAkaSpeed/xiryn`**
|
|
11
|
+
- **Author:** Sourav Bera
|
|
12
|
+
- **License:** MIT License (`https://github.com/SouravBeraAkaSpeed/xiryn`)
|
|
13
|
+
- **Usage in Dirgha v2:** Architectural patterns for `<untrusted source="...">` prompt-injection defusal (`crates/dirgha-core`), `prepareStep` sliding-window context compaction (retaining the 2 most recent screenshots and 6 most recent tool outputs), OS-keychain `AES-256-GCM` (Windows DPAPI, macOS Keychain, Linux `secret-tool`) origin-verified `vault_fill`, and disposable Docker `workstation/` + Telegram takeover tunnel (`dirgha computer`).
|
|
14
|
+
|
|
15
|
+
3. **`traycerai/traycer`**
|
|
16
|
+
- **Author:** Traycer AI, Inc.
|
|
17
|
+
- **License:** MIT License (Clients, CLI & Protocol: `https://github.com/traycerai/traycer`)
|
|
18
|
+
- **Usage in Dirgha v2:** Architectural inspiration for monotonic `generation`-stamped accessibility tree snapshots (`STALE_DOM_GENERATION` fail-closed ref verification in `crates/dirgha-core` and `extensions/firefox-mv3/`) and MCP/BYOA integration.
|
|
19
|
+
|
|
20
|
+
4. **`HKUDS` (Data Intelligence Lab @ The University of Hong Kong)**
|
|
21
|
+
- **Repositories:** `HKUDS/AgentPilot`, `HKUDS/AutoSwarm`, `HKUDS/CLI-Anything`, `HKUDS/PhoneCLI`, `HKUDS/LightRAG`, `HKUDS/HELIX` (arXiv:2608.13951), `HKUDS/MGP`, `HKUDS/PrivacyFlow`
|
|
22
|
+
- **License:** MIT License / Apache-2.0 (`https://github.com/HKUDS`)
|
|
23
|
+
- **Usage in Dirgha v2:** `PrivacyFlow` local `<SECRET_HANDLE_01>` masking in `crates/llm-router`; `AgentPilot` KL-UCB (`D1/D2/D3`) search state + `HELIX` 96-port harness atom recomposition in `crates/flywheel-engine`; `RSI Arena` benchmark protocol; and `AutoSwarm` / `CLI-Anything` L3/L4 bridges.
|
|
24
|
+
|
|
25
|
+
5. **`thinksabin/DTrackAuditor`**
|
|
26
|
+
- **Author:** Sabin Ranjit (external contributor)
|
|
27
|
+
- **License:** Apache-2.0 / MIT (`https://github.com/thinksabin/DTrackAuditor`)
|
|
28
|
+
- **Usage in Dirgha v2:** Core OWASP Dependency-Track SBOM policy and vulnerability auditing logic integrated into `crates/arniko-audit`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `bin/build-native.mjs` — Zero-OOM Pre-Flight Builder for `@dirgha/cli@2.0.0`.
|
|
4
|
+
*
|
|
5
|
+
* Verifies that `extensions/firefox-mv3/lokahi_gate.wasm` is present and valid,
|
|
6
|
+
* and if Cargo is installed locally, ensures `target/release/dirgha-native-host[.exe]` is up to date.
|
|
7
|
+
* Uses 0 bundler dependencies (<30 MB RAM), permanently eliminating the legacy 5.6 GB VPS esbuild OOM.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as fs from "node:fs";
|
|
11
|
+
import * as path from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
|
|
14
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const rootDir = path.resolve(__dirname, "..");
|
|
16
|
+
|
|
17
|
+
const wasmPath = path.join(rootDir, "extensions", "firefox-mv3", "lokahi_gate.wasm");
|
|
18
|
+
if (!fs.existsSync(wasmPath)) {
|
|
19
|
+
console.error(`[dirgha build] ERROR: Missing compiled WASM module at ${wasmPath}`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const wasmSizeKb = (fs.statSync(wasmPath).size / 1024).toFixed(1);
|
|
24
|
+
const exeName = process.platform === "win32" ? "dirgha-native-host.exe" : "dirgha-native-host";
|
|
25
|
+
const releaseBin = path.join(rootDir, "target", "release", exeName);
|
|
26
|
+
const hasReleaseBin = fs.existsSync(releaseBin);
|
|
27
|
+
|
|
28
|
+
console.log(
|
|
29
|
+
JSON.stringify(
|
|
30
|
+
{
|
|
31
|
+
package: "@dirgha/cli@2.0.0",
|
|
32
|
+
version: "2.0.0",
|
|
33
|
+
wasm_gate_path: "extensions/firefox-mv3/lokahi_gate.wasm",
|
|
34
|
+
wasm_gate_size_kb: Number(wasmSizeKb),
|
|
35
|
+
native_binary_present: hasReleaseBin,
|
|
36
|
+
native_binary_path: hasReleaseBin ? `target/release/${exeName}` : null,
|
|
37
|
+
bundler_memory_overhead_mb: 0,
|
|
38
|
+
status: "BUILD_READY",
|
|
39
|
+
},
|
|
40
|
+
null,
|
|
41
|
+
2
|
|
42
|
+
)
|
|
43
|
+
);
|