You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(paracosm): cover 0.6.0 universal schema + list as ecosystem app
PARACOSM.md
- Rewrite quick-start result reads to use finalState?.metrics and
forgedTools?.length (old finalState.systems + totalToolsForged removed).
- Add universal result contract section covering RunArtifact, three modes,
11 primitives, scenarioExtensions escape hatch, JSON Schema export.
- Add subjects and interventions section documenting SubjectConfig and
InterventionConfig input primitives.
- Rewrite API surface imports to include paracosm/schema and paracosm/compiler.
- Fix broken TypeDoc links (/paracosm/interfaces -> /paracosm/engine/interfaces,
/paracosm/classes -> /paracosm/engine/classes).
- Add the 17-variant StreamEvent list under HTTP+SSE section.
ECOSYSTEM.md
- Add Paracosm as the lead applications entry with npm badge, feature
bullets, and live demo link.
Or run the hosted demo at [paracosm.agentos.sh/sim](https://paracosm.agentos.sh/sim) with zero setup. The demo caps turns, population, and model tier so public access stays affordable; paste your own OpenAI or Anthropic key into Settings to unlock full scope.
43
43
44
+
## The universal result contract
45
+
46
+
Every `runSimulation()` call returns a Zod-validated `RunArtifact` exported from the `paracosm/schema` subpath. One shape covers three simulation modes, discriminated on `metadata.mode`:
47
+
48
+
-`turn-loop`: civilization sims (paracosm's built-in mode). Populates `trajectory.timepoints[]` and `decisions[]` with per-turn specialist notes.
49
+
-`batch-trajectory`: digital-twin simulations (digital-twin). Labeled timepoints over a horizon, populated by external LangGraph-style executors.
50
+
-`batch-point`: one-shot forecasts. Overview and risk flags only, no trajectory.
The schema exposes 11 content primitives (`RunMetadata`, `WorldSnapshot`, `Score`, `HighlightMetric`, `Timepoint`, `TrajectoryPoint`, `Trajectory`, `Citation`, `SpecialistDetail`, `SpecialistNote`, `RiskFlag`, `Decision`) plus operational types (`Cost`, `ProviderError`). Every primitive carries an optional `scenarioExtensions?: Record<string, unknown>` escape hatch for domain-specific fields that must not pollute the universal shape.
71
+
72
+
Non-TypeScript consumers generate equivalent types from JSON Schema: `npm run export:json-schema` emits `schema/run-artifact.schema.json` and `schema/stream-event.schema.json`. Python projects use `datamodel-codegen`; any ecosystem with a JSON-Schema code generator adopts cleanly. Full adoption walkthrough at [paracosm/docs/adoption/digital-twin.md](https://github.com/framersai/paracosm/blob/master/docs/adoption/digital-twin.md).
73
+
74
+
### Subjects and interventions
75
+
76
+
For simulations built around a single subject (a person, character, organism, vessel) under a counterfactual intervention, `paracosm/schema` exposes `SubjectConfig` and `InterventionConfig` as first-class input primitives. Pass them through `RunOptions` and they carry through to `RunArtifact.subject` and `RunArtifact.intervention` for downstream consumers:
-[`compileScenario`](/paracosm/engine/compiler/functions/compileScenario): turns scenario JSON into a runnable `ScenarioPackage`
133
203
134
204
## HTTP + SSE server
135
205
@@ -148,6 +218,17 @@ The dashboard server exposes a small HTTP API for driving sims from any client:
148
218
149
219
`/events` replays a buffered event history on reconnect (persisted to disk so restarts do not evaporate completed runs), closes with a `replay_done` marker so clients can distinguish historical from live events.
150
220
221
+
The SSE stream emits a 17-variant `StreamEvent` discriminated union (defined in `paracosm/schema`), every event carrying a universal `e.data.summary` one-liner so consumers can render cleanly without narrowing on per-event fields:
Narrow via `e.type` for per-event intellisense on `e.data`. Validate the envelope at runtime with `StreamEventSchema.parse(evt)` when ingesting untrusted streams.
231
+
151
232
## Related
152
233
153
234
-[Emergent Capabilities](/features/emergent-capabilities) — the forge + judge machinery underlying `forge_tool`
**AI Agent Swarm Simulation Engine** — Define worlds as JSON, assign AI leaders with HEXACO personality profiles, and watch their decisions compound into measurably different outcomes from identical starting conditions. Built on `@framers/agentos`.
0 commit comments