the-citadel 0.12.7
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/.citadel/instructions/tag-planning.md +14 -0
- package/README.md +132 -0
- package/dist/agents/evaluator.d.ts +8 -0
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/worker.d.ts +10 -0
- package/dist/bridge/components/Dashboard.d.ts +1 -0
- package/dist/bridge/components/MoleculeTree.d.ts +1 -0
- package/dist/bridge/index.d.ts +1 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +97093 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/schema.d.ts +89 -0
- package/dist/core/agent.d.ts +59 -0
- package/dist/core/formula.d.ts +63 -0
- package/dist/core/gitignore.d.ts +1 -0
- package/dist/core/hooks.d.ts +19 -0
- package/dist/core/instruction.d.ts +103 -0
- package/dist/core/llm.d.ts +3 -0
- package/dist/core/logger.d.ts +31 -0
- package/dist/core/mcp-resource-provider.d.ts +14 -0
- package/dist/core/memory.d.ts +8 -0
- package/dist/core/pearls.d.ts +77 -0
- package/dist/core/pool.d.ts +31 -0
- package/dist/core/queue.d.ts +99 -0
- package/dist/core/registry.d.ts +3 -0
- package/dist/core/schema-utils.d.ts +11 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +94741 -0
- package/dist/services/conductor.d.ts +21 -0
- package/dist/services/mcp.d.ts +17 -0
- package/dist/services/piper.d.ts +21 -0
- package/dist/services/project-context.d.ts +37 -0
- package/dist/services/workflow-engine.d.ts +17 -0
- package/dist/tools/evaluator.d.ts +25 -0
- package/dist/tools/inspection.d.ts +18 -0
- package/dist/tools/shell.d.ts +18 -0
- package/dist/tools/worker.d.ts +46 -0
- package/package.json +64 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# PLANNING BEAD INSTRUCTIONS
|
|
2
|
+
|
|
3
|
+
You are working on a PLANNING task.
|
|
4
|
+
|
|
5
|
+
## Acceptance Criteria Requirement
|
|
6
|
+
When submitting your plan (via `submit_work`), you **MUST** include a `verification_plan` or `acceptance_criteria` section in your output.
|
|
7
|
+
- This defines EXACTLY how the Gatekeeper will verify your work (e.g., "Run `npm test`", "Check file X exists").
|
|
8
|
+
- **Failure to include this will result in immediate rejection** by the Gatekeeper.
|
|
9
|
+
|
|
10
|
+
## Plan Structure
|
|
11
|
+
Your plan should generally include:
|
|
12
|
+
1. **Problem Analysis**: What are we solving?
|
|
13
|
+
2. **Proposed Changes**: What files will change?
|
|
14
|
+
3. **Verification Plan**: How do we know it works? (CRITICAL)
|
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# The Citadel
|
|
2
|
+
|
|
3
|
+
**Deterministic Agent Orchestration System** β a lightweight engine that turns chaotic agent swarms into an auditable, deterministic **Knowledge Factory**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> [!IMPORTANT]
|
|
8
|
+
> **π NEW FOR 0.12: Context-Aware Reasoning & Tool Result Offloading**
|
|
9
|
+
> The Citadel now automatically handles industrial-scale tool outputs by offloading large buffers to disk and providing sub-agent reasoning via the `inspect_result` tool. Prevents context bloat and scale your agents beyond the context window.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Use The Citadel for complex, multi-step objectives: **building software features**, **conducting deep research**, **synthesizing market reports**, or **managing content pipelines**. By decoupling the *process* (SOPs) from the *execution* (Agents), it ensures that even creative work follows a reliable, auditable path.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install the-citadel@0.12.0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Foundry (Workflow Engine)** β Compile standard operating procedures (SOPs) into dynamic **Molecules** (task DAGs).
|
|
28
|
+
- **Process Integrity** β The *state machine* guarantees `Open β In Progress β Verify β Done` transitions for every task.
|
|
29
|
+
- **Dynamic Bonding** β Agents can spawn subβtasks in parallel to handle complex objectives (research, coding, analysis).
|
|
30
|
+
- **Resilient Recovery** β Automated `on_failure` handling with conditional skips.
|
|
31
|
+
- **Durable State** β All context is stored in Gitβbacked SQLite **Pearls** (auditβready, restartable).
|
|
32
|
+
- **Parallel Execution** β Configurable `max_workers` and `load_factor` for high-throughput concurrency.
|
|
33
|
+
- **Providerβagnostic** β Works with Ollama, OpenAI, Anthropic, and more.
|
|
34
|
+
- **Context Aware** β Adheres to specific project rules and style guides (`AGENTS.md`) automatically. Supports [YAML Frontmatter](docs/agent/AGENTS.md.frontmatter.md) for strict `ignore`, `read_only`, and `forbidden` file constraints.
|
|
35
|
+
- **Dynamic Data Piping** β Pass rich inputs (`context`) to tasks and pipe outputs between steps (`{{steps.foo.output.bar}}`).
|
|
36
|
+
- **Context-Aware Reasoning** β Scale beyond the context window with **Tool Result Offloading** and sub-agent inspection (`inspect_result`).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# 1οΈβ£ Install globally
|
|
44
|
+
npm install -g the-citadel@0.12.0
|
|
45
|
+
|
|
46
|
+
# 2οΈβ£ Bootstrap a new project
|
|
47
|
+
citadel init # creates .citadel/ + config + sample formula
|
|
48
|
+
|
|
49
|
+
# 3οΈβ£ Run a workload
|
|
50
|
+
# Option A: Simple Task
|
|
51
|
+
citadel create "Hello world"
|
|
52
|
+
|
|
53
|
+
# Option B: Run a Formula
|
|
54
|
+
citadel create "My Release" --formula feature_release --vars name="Dark Mode"
|
|
55
|
+
|
|
56
|
+
citadel start
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
βοΈ The **Conductor** will orchestrate agents automatically. Log output is written to `log.txt` courtesy of the shared `CitadelLogger`.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Documentation
|
|
64
|
+
|
|
65
|
+
For detailed usage instructions, including advanced configuration, formula creation, and troubleshooting, please refer to the **[User Guide](wiki/USER-GUIDE.md)**.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Bridge TUI
|
|
71
|
+
|
|
72
|
+
The **Bridge** is the lightweight terminal dashboard built with **Ink** that shows the orchestration in real time.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Launch the Bridge (Conductor + UI)
|
|
76
|
+
citadel bridge # or
|
|
77
|
+
bun run script:bridge
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The dashboard remains open until you hit **Ctrl+C**.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Project Structure
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
ββ src/ # Source code
|
|
88
|
+
β ββ bridge/ # Terminal UI (Ink)
|
|
89
|
+
β β ββ index.tsx # Entry point
|
|
90
|
+
β β ββ components/ # Dashboard panes
|
|
91
|
+
β ββ core/ # Core engine (queue, logger, pearls)
|
|
92
|
+
β ββ config/ # Config handling
|
|
93
|
+
β ββ services/ # Conductor & agent services
|
|
94
|
+
β ββ types/ # Shared TS types
|
|
95
|
+
ββ docs/ # Documentation (this file included)
|
|
96
|
+
ββ tests/ # Unit tests
|
|
97
|
+
ββ README.md # This file
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Extending & Customising
|
|
103
|
+
|
|
104
|
+
- **New panels** β Add a component under `src/bridge/components` and import it into `Dashboard.tsx`.
|
|
105
|
+
- **Eventβdriven UI** β Replace polling in `AgentMatrix` / `MoleculeTree` with Conductor events.
|
|
106
|
+
- **Custom loggers** β Hook into the global `CitadelLogger` to emit richer data.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Build / Test / Lint
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# TypeScript type-check
|
|
114
|
+
bun run tsc --noEmit
|
|
115
|
+
|
|
116
|
+
# Lint
|
|
117
|
+
bunx biome lint .
|
|
118
|
+
|
|
119
|
+
# Tests
|
|
120
|
+
bun test tests/
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Contribution
|
|
126
|
+
|
|
127
|
+
1. `prl ready` β Find a work item.
|
|
128
|
+
2. `prl update <id> --status in_progress` β Claim it.
|
|
129
|
+
3. execute & verify β Pass all checks.
|
|
130
|
+
4. `prl close <id>` β Ship it.
|
|
131
|
+
|
|
132
|
+
Love to see you play around!
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LanguageModel } from "ai";
|
|
2
|
+
import { type AgentContext, CoreAgent } from "../core/agent";
|
|
3
|
+
import type { PearlsClient } from "../core/pearls";
|
|
4
|
+
export declare class EvaluatorAgent extends CoreAgent {
|
|
5
|
+
constructor(model?: LanguageModel, pearlsClient?: PearlsClient);
|
|
6
|
+
protected getDynamicTools(context?: AgentContext): Promise<Record<string, import("ai").Tool>>;
|
|
7
|
+
protected getSystemPrompt(defaultPrompt: string, context?: AgentContext): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LanguageModel } from "ai";
|
|
2
|
+
import { type AgentContext, CoreAgent } from "../core/agent";
|
|
3
|
+
import { type AgentRole } from "../config/schema";
|
|
4
|
+
import { type PearlsClient } from "../core/pearls";
|
|
5
|
+
export declare class WorkerAgent extends CoreAgent {
|
|
6
|
+
constructor(role?: AgentRole, model?: LanguageModel, pearlsClient?: PearlsClient);
|
|
7
|
+
protected getDynamicTools(context?: AgentContext): Promise<Record<string, import("ai").Tool>>;
|
|
8
|
+
run(prompt: string, context?: Record<string, unknown>): Promise<string>;
|
|
9
|
+
protected getSystemPrompt(defaultPrompt: string): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Dashboard: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MoleculeTree: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function startBridge(): Promise<void>;
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { loadConfig } from "./config";
|
|
4
|
+
import { getPearls } from "./core/pearls";
|
|
5
|
+
import { getQueue } from "./core/queue";
|
|
6
|
+
import { Conductor } from "./services/conductor";
|
|
7
|
+
import { getWorkflowEngine } from "./services/workflow-engine";
|
|
8
|
+
export { loadConfig, getPearls, getQueue, Conductor, getWorkflowEngine };
|
|
9
|
+
export declare const program: Command;
|
|
10
|
+
export declare function runCLI(): void;
|