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.
Files changed (38) hide show
  1. package/.citadel/instructions/tag-planning.md +14 -0
  2. package/README.md +132 -0
  3. package/dist/agents/evaluator.d.ts +8 -0
  4. package/dist/agents/index.d.ts +2 -0
  5. package/dist/agents/worker.d.ts +10 -0
  6. package/dist/bridge/components/Dashboard.d.ts +1 -0
  7. package/dist/bridge/components/MoleculeTree.d.ts +1 -0
  8. package/dist/bridge/index.d.ts +1 -0
  9. package/dist/cli.d.ts +10 -0
  10. package/dist/cli.js +97093 -0
  11. package/dist/config/index.d.ts +6 -0
  12. package/dist/config/schema.d.ts +89 -0
  13. package/dist/core/agent.d.ts +59 -0
  14. package/dist/core/formula.d.ts +63 -0
  15. package/dist/core/gitignore.d.ts +1 -0
  16. package/dist/core/hooks.d.ts +19 -0
  17. package/dist/core/instruction.d.ts +103 -0
  18. package/dist/core/llm.d.ts +3 -0
  19. package/dist/core/logger.d.ts +31 -0
  20. package/dist/core/mcp-resource-provider.d.ts +14 -0
  21. package/dist/core/memory.d.ts +8 -0
  22. package/dist/core/pearls.d.ts +77 -0
  23. package/dist/core/pool.d.ts +31 -0
  24. package/dist/core/queue.d.ts +99 -0
  25. package/dist/core/registry.d.ts +3 -0
  26. package/dist/core/schema-utils.d.ts +11 -0
  27. package/dist/index.d.ts +9 -0
  28. package/dist/index.js +94741 -0
  29. package/dist/services/conductor.d.ts +21 -0
  30. package/dist/services/mcp.d.ts +17 -0
  31. package/dist/services/piper.d.ts +21 -0
  32. package/dist/services/project-context.d.ts +37 -0
  33. package/dist/services/workflow-engine.d.ts +17 -0
  34. package/dist/tools/evaluator.d.ts +25 -0
  35. package/dist/tools/inspection.d.ts +18 -0
  36. package/dist/tools/shell.d.ts +18 -0
  37. package/dist/tools/worker.d.ts +46 -0
  38. 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,2 @@
1
+ export * from "./evaluator";
2
+ export * from "./worker";
@@ -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;