from chronicle import Chronicle
import json
from pathlib import Path
blueprint = json.loads(Path("blueprint.json").read_text())
with Chronicle() as client:
result = client.worlds.compile(blueprint=blueprint)
print(result.problems, result.warnings)import { Chronicle } from "@chroniclelabs/sdk";
import { readFile } from "node:fs/promises";
const client = new Chronicle();
const blueprint = JSON.parse(await readFile("blueprint.json", "utf8"));
const result = await client.worlds.compile({ blueprint });
console.log(result.problems, result.warnings);import { Chronicle } from "@chroniclelabs/sdk";
import { readFile } from "node:fs/promises";
const client = new Chronicle();
const blueprint = JSON.parse(await readFile("blueprint.json", "utf8"));
const result = await client.worlds.compile({ blueprint });
console.log(result.problems, result.warnings);package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"time"
chronicle "github.com/chronicle-labs/chronicle-go"
)
func main() {
if err := example(); err != nil { log.Fatal(err) }
}
func example() error {
ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
defer cancel()
client := chronicle.NewClient()
data, err := os.ReadFile("blueprint.json")
if err != nil {
return err
}
var params chronicle.WorldCompileParams
if err := json.Unmarshal(data, ¶ms.Blueprint); err != nil {
return err
}
result, err := client.Worlds.Compile(ctx, params)
if err != nil {
return err
}
fmt.Println(result.Problems, result.Warnings)
return nil
}use chronicle_sdk::Chronicle;
use chronicle_sdk::types::WorldCompileParams;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Chronicle::from_env()?;
let blueprint = serde_json::from_slice(&std::fs::read("blueprint.json")?)?;
let result = client.worlds().compile(WorldCompileParams { blueprint }).await?;
println!("{:?} {:?}", result.problems, result.warnings);
Ok(())
}{
"twins": [
{
"entityCount": 123,
"resources": [
{
"count": 123,
"resource": "<string>"
}
],
"seedJsonl": "<string>",
"service": "<string>",
"sha256": "<string>",
"warnings": []
}
],
"problems": [],
"tasks": [],
"warnings": []
}{
"error": "World not found"
}{
"error": "World not found"
}{
"error": "World not found"
}{
"error": "World not found"
}Compile a blueprint
Validate a blueprint and preview the seed each twin would get, without launching anything. An invalid blueprint returns 200 with a non-empty problems list and no twins; fix the problems before launching.
Use the SDK setup with CHRONICLE_API_KEY and CHRONICLE_API_URL. The Go and Rust samples are complete entry points; Rust also needs Tokio (see Rust setup). Save the blueprint itself as blueprint.json using the blueprint export example. Do not wrap the file in a blueprint property.
The schema below is the HTTP representation. SDKs normalize field names and list wrappers; see SDK and HTTP fields.
from chronicle import Chronicle
import json
from pathlib import Path
blueprint = json.loads(Path("blueprint.json").read_text())
with Chronicle() as client:
result = client.worlds.compile(blueprint=blueprint)
print(result.problems, result.warnings)import { Chronicle } from "@chroniclelabs/sdk";
import { readFile } from "node:fs/promises";
const client = new Chronicle();
const blueprint = JSON.parse(await readFile("blueprint.json", "utf8"));
const result = await client.worlds.compile({ blueprint });
console.log(result.problems, result.warnings);import { Chronicle } from "@chroniclelabs/sdk";
import { readFile } from "node:fs/promises";
const client = new Chronicle();
const blueprint = JSON.parse(await readFile("blueprint.json", "utf8"));
const result = await client.worlds.compile({ blueprint });
console.log(result.problems, result.warnings);package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"time"
chronicle "github.com/chronicle-labs/chronicle-go"
)
func main() {
if err := example(); err != nil { log.Fatal(err) }
}
func example() error {
ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
defer cancel()
client := chronicle.NewClient()
data, err := os.ReadFile("blueprint.json")
if err != nil {
return err
}
var params chronicle.WorldCompileParams
if err := json.Unmarshal(data, ¶ms.Blueprint); err != nil {
return err
}
result, err := client.Worlds.Compile(ctx, params)
if err != nil {
return err
}
fmt.Println(result.Problems, result.Warnings)
return nil
}use chronicle_sdk::Chronicle;
use chronicle_sdk::types::WorldCompileParams;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Chronicle::from_env()?;
let blueprint = serde_json::from_slice(&std::fs::read("blueprint.json")?)?;
let result = client.worlds().compile(WorldCompileParams { blueprint }).await?;
println!("{:?} {:?}", result.problems, result.warnings);
Ok(())
}{
"twins": [
{
"entityCount": 123,
"resources": [
{
"count": 123,
"resource": "<string>"
}
],
"seedJsonl": "<string>",
"service": "<string>",
"sha256": "<string>",
"warnings": []
}
],
"problems": [],
"tasks": [],
"warnings": []
}{
"error": "World not found"
}{
"error": "World not found"
}{
"error": "World not found"
}{
"error": "World not found"
}Authorizations
Body
Dry run: compile a blueprint into per-twin seeds without provisioning anything.
Response
Successful response.
The dry run's outcome. A blueprint with hard problems answers 200 with problems filled in and no twins, so the dashboard can list them (and hand them back to the model) instead of parsing an error.