Skip to content

mzf11125/DAEMON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

109 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAEMON

Industry-agnostic operational intelligence platform — modular, Grafana-like dashboard ecosystem built on the Ontology framework.

<<<<<<< HEAD DAEMON ingests data, models it in an ontology, evaluates rules, executes actions, and operates cases through a pluggable dashboard platform. It serves as the universal source of truth for enterprise operations, with an SDK + marketplace for extensions, and bidirectional Grafana interoperability.

Remote: github.com/daemon-blockint-tech/DAEMON

Quality bar

upstream/main

ROADMAP.md — Phased plan for dashboard engine, SDK suite, marketplace, and Grafana integration. AGENTS.md — Instructions for AI coding agents working on this repo.

Vision

Pillar Description
Dashboard platform Pluggable panels, typed data sources, dashboard-as-code. Every visualization is a registered plugin.
SDK suite @daemon/sdk — one import for panel, data source, action, and plugin development.
Marketplace Discover, install, and manage plugins. Tenant-scoped activation with version management.
Grafana integration Bidirectional — export ontology dashboards to Grafana JSON via @grafana/grafana-foundation-sdk, or import Grafana dashboards into Daemon.

What works today (v1)

  • Ontology v2 manifest, objects, and role-gated actions (OpenCase, RecordDecision, …)
  • Operational loop: signal → rules → open case (with signalIds) → record decision → audit trail → case read model
  • Console case detail, decision form, audit strip (apps/console-web)
  • Read-only functions (summarizeCaseContext)
  • HTTP APIs with shared envelope, pagination, OpenAPI spec, and TypeScript client (packages/sdk-ts)

Traceability: docs/traceability/operational-platform-parity-v1.md. UX flow: docs/ux/operational-cockpit-flow-v1.md.

Stack

Layer Technology
Console Next.js 15 (apps/console-web)
Control plane Fastify (apps/control-plane)
Services Go 1.22+ (services/*)
Metadata Postgres via Supabase local (Auth + RLS)
Analytics ClickHouse (datasets)
Graph Neo4j 5 (optional links)
Batch Go CLIs (pipelines/*)
Agent tools MCP ontology server (aip/mcp-ontology)
SDK TypeScript monorepo — pnpm workspaces + Turborepo

Prerequisites

  • Docker (ClickHouse, Neo4j)
  • Supabase CLI for local Postgres + Auth
  • Go 1.22+, Node.js 20+, pnpm 9.15.0

Quick start

Run all commands from the repository root (not apps/console-web).

<<<<<<< HEAD
cp .env.example .env
make demo                    # up + supabase + migrate + seed + pipelines
./scripts/supabase-seed-auth.sh   # demo users (analyst@demo.local / analyst)
=======
cp .env.example .env   # optional; defaults work for local dev
pnpm install
pnpm run dev:up        # docker compose + build deps
pnpm run dev:gateway   # NestJS API on :3000 (skips upstream Go ingest/policy in dev)

Other useful commands:

pnpm run build
pnpm run test
pnpm run test:repo     # full repo tests (set DAEMON_INTEGRATION_REQUIRED=1 when stack is up)
make dev-gateway
>>>>>>> upstream/main

Start services (separate terminals):

make run-platform-api      # :8080
make run-ontology-service  # :8081
make run-ingestion-service # :8082
make run-rules-engine      # :8083
make run-case-service      # :8084
pnpm --filter @daemon/console-web dev

Console: http://localhost:3000 — sign in with seeded analyst credentials; tenant tenant-demo.

Smoke and proof scripts

chmod +x scripts/e2e-smoke.sh scripts/prove-operational-loop.sh
./scripts/e2e-smoke.sh              # health, manifest, seed, rules, CH counts
./scripts/prove-operational-loop.sh # OpenCase → decision → audit (needs services + auth)

Strict loop assertions (CI-style):

E2E_FULL=1 ./scripts/e2e-smoke.sh

Integration tests (Docker + stack; from repo root):

make test-integration

TypeScript tests

# All TypeScript unit tests (15 packages)
pnpm -r test --if-present

# Coverage reports
pnpm -r test:coverage --if-present

# Full CI gate
make ci-full

Control-plane (port 4000)

Requires local PostgreSQL on port 5433:

# One-time setup
initdb -D .local/pgdata --username=daemon --auth=trust
echo "port = 5433" >> .local/pgdata/postgresql.conf
echo "listen_addresses = 'localhost'" >> .local/pgdata/postgresql.conf
pg_ctl -D .local/pgdata -l .local/pgdata/logfile start
createdb -h localhost -p 5433 -U daemon daemon_control
createdb -h localhost -p 5433 -U daemon control_plane
psql -h localhost -p 5433 -U daemon -d daemon_control -f apps/control-plane/src/db/migrations/0001_initial.sql
psql -h localhost -p 5433 -U daemon -d control_plane -f apps/control-plane/src/db/migrations/0001_initial.sql

# Run tests
pnpm --filter @daemon/control-plane test

# Start server
pnpm --filter @daemon/control-plane dev

AIP (agents, MCP, golden eval)

Requires ontology-service on :8081 (and :8080 / :8084 for audit/case MCP tools).

make aip-build
export OIDC_REQUIRED=false
export EVAL_DETERMINISTIC=true   # CI parity without API keys
make aip-eval
./scripts/prove-aip-eval.sh

Optional: LLM gateway on :8092 (LLM_GATEWAY_ENABLED=true), LangSmith (LANGCHAIN_TRACING_V2=true in staging). See docs/traceability/aip-phase-2.md.

Full stack in Docker (data stores + Go service images):

make up-apps

API

Service Port Role
platform-api 8080 /v1/me, audit events
ontology-service 8081 manifest, objects, actions, functions
ingestion-service 8082 connector jobs
rules-engine 8083 rule evaluation
case-service 8084 case list/detail

Authenticated calls need Authorization: Bearer <jwt> and X-Tenant-Id (default tenant-demo).

Repository layout

apps/
├── console-web/          # Next.js 15 operator dashboard (port 3000)
├── control-plane/        # Fastify control-plane server (port 4000)
└── daemon-cli/           # Commander.js CLI

packages/
├── ontology-language/    # Core types (Zod) + YAML parser
├── ontology-engine/      # Runtime: objects, actions, audit, schema registry
├── ontology-sdk/         # OntologyClient, ObjectQueryBuilder, ActionProposer
├── ontology-contracts/   # Manifest schema, canonical object/action lists
├── ontology-functions/   # Pure functions (aggregate, summarize, match)
├── plugin-sdk/           # PluginRegistry, SkillRegistry, DynamicAgentBuilder
├── aip-agent/            # Agent orchestrator + MCP client
├── sdk-ts/               # Browser/Node HTTP API client
├── shared-types/         # Shared TS types
├── ui-kit/               # React component library
├── dashboard-engine/     # (NEW) PanelRegistry, DataSourceRegistry, DashboardBuilder
├── sdk/                  # (NEW) Unified developer SDK barrel
├── sdk-react/            # (NEW) React hooks + components
├── sdk-node/             # (NEW) Node.js middleware + utilities
└── grafana-codegen/      # (NEW) Ontology → Grafana dashboard generator

aip/
├── agent-service/        # Fastify HTTP bridge (port 3001)
├── mcp-ontology/         # MCP server exposing ontology as LLM tools
├── llm/                  # LLM gateway stub
├── agents/               # Agent definitions
├── prompts/              # System prompts
└── evals/                # Evaluation cases + fixtures

services/                 # Go microservices (8080-8084)
ontology/                 # Ontology schema files (v2 compiled, v3 source YAML)
infra/                    # Docker, migrations, k8s, terraform, helm
pipelines/                # Data pipeline CLIs
connectors/               # External data connectors

Dev API smoke (gateway)

Use header x-api-key: daemon-dev-key (see .env.example).

  1. Register an entity via ingest (flat body):
curl -sS -X POST http://localhost:3000/v1/ingest/records \
  -H 'content-type: application/json' \
  -H 'x-api-key: daemon-dev-key' \
  -d '{"ontologyId":"default","entityId":"my-entity","payload":{"name":"demo"}}'
  1. Run an automation against that entity:
curl -sS -X POST http://localhost:3000/v1/automations/run \
  -H 'content-type: application/json' \
  -H 'x-api-key: daemon-dev-key' \
  -d '{"steps":[{"id":"s1","action":"notify"}],"loop":{"ontologyId":"default","entityId":"my-entity","patch":{"status":"done"}}}'

Ingest must run before automations; otherwise the read path returns 404 with { "code": "NOT_FOUND" }.

Documentation

<<<<<<< HEAD Full index: docs/README.md

Platform master PRD: docs/product/PRD-daemon-platform.md

License

BSD 3-Clause — see LICENSE.

Published site (Mintlify): run nvm use (Node 22 per .nvmrc), then cd mintlify && npx mint devhttp://localhost:3000. Deploy path in the Mintlify dashboard: /mintlify. See mintlify/README.md.

Engineering Markdown (docs/):

License

Apache-2.0 — see LICENSE.

upstream/main

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors