> ## Documentation Index
> Fetch the complete documentation index at: https://docs.astrakairo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Astra First-Party Packages for Kairo: Full Reference

> Explore all Astra first-party packages for Kairo: JSON, HTTP, file system, database, cryptography, and more — declared on demand.

Astra first-party packages are optional libraries published and maintained by Astra Kairo. They extend your application beyond Kairo Core with capabilities like JSON serialization, HTTP communication, file system access, database connectivity, and more. Unlike the Core prelude or Pulse Runtime Services, Astra packages are not bundled with the toolchain — you explicitly declare the ones you need, keeping your dependency surface small and your build intentional.

***

## Adding an Astra package

To use an Astra package, declare it in the `[dependencies]` section of your `kairo.toml` manifest. After editing the manifest, run `forge restore` to fetch and register the package in your project.

```toml theme={null}
[package]
name = "MyApp"
version = "1.0.0"

[dependencies]
Astra.Json = "*"
Astra.Http = "*"
```

```bash theme={null}
forge restore
```

Once restored, import the package in any source file where you need it:

```kairo theme={null}
import Astra.Json
import Astra.Http
```

<Tip>
  Only declare the Astra packages your application actually uses. Each declared dependency is fetched, compiled, and linked — keeping your manifest lean improves build times and reduces your attack surface.
</Tip>

***

## Available packages

<CardGroup cols={2}>
  <Card title="Astra.Money" icon="coins">
    Monetary values and arithmetic. Provides the `Money` type with currency-aware addition, subtraction, rounding, and formatting. `Money` is **not** a Kairo Core primitive — this package is the canonical source for any currency-denominated value in your domain.
  </Card>

  <Card title="Astra.Json" icon="braces">
    JSON serialization and deserialization. Convert Kairo values and objects to JSON text and parse JSON text back into typed Kairo values.
  </Card>

  <Card title="Astra.Xml" icon="code">
    XML processing. Parse XML documents into structured representations, navigate elements and attributes, and generate well-formed XML output.
  </Card>

  <Card title="Astra.Configuration" icon="sliders">
    Application configuration. Load and access structured configuration from files, environment variables, or layered sources with type-safe retrieval.
  </Card>

  <Card title="Astra.Http" icon="globe">
    HTTP client and server. Make typed outbound HTTP requests and define inbound HTTP handlers for building APIs and web services.
  </Card>

  <Card title="Astra.Cryptography" icon="lock">
    Cryptographic primitives. Hashing, HMAC, digital signing, symmetric and asymmetric encryption, and secure random number generation.
  </Card>

  <Card title="Astra.FileSystem" icon="folder">
    File system access. Read and write files, enumerate directories, manage paths, and perform common file operations in a platform-aware way.
  </Card>

  <Card title="Astra.Database" icon="database">
    Database access. Connect to relational and other database systems, execute queries, and map results to typed Kairo values.
  </Card>
</CardGroup>

***

## Package details

### Astra.Money

`Money` is not part of Kairo Core. If your domain involves prices, balances, invoices, or any currency-denominated quantity, use `Astra.Money` — it is the canonical source for monetary values in Kairo.

```toml theme={null}
[dependencies]
Astra.Money = "*"
```

```kairo theme={null}
module Billing.Invoice

import Astra.Money

public value LineItem {
    description: Text
    unitPrice: Money
    quantity: Int32
}
```

<Warning>
  Do not represent monetary values as `Decimal` or `Float64`. Floating-point arithmetic introduces rounding errors that are unacceptable in financial calculations. Always use `Astra.Money` for currency-denominated values.
</Warning>

### Astra.Json

Serialize Kairo value types to JSON text and deserialize JSON text back into typed values with `Astra.Json`.

```toml theme={null}
[dependencies]
Astra.Json = "*"
```

```kairo theme={null}
module Demo.JsonExample

import Astra.Json
import Pulse.Console

public value CustomerDto {
    id: Text
    name: Text
}

public func main(): Int32 {
    let customer: CustomerDto = CustomerDto {
        id: "CUST-001"
        name: "Acme Corp"
    }
    let json: Text = Astra.Json.serialize(customer)
    Pulse.Console.out.writeLine(json)
    return 0
}
```

### Astra.Http

Use `Astra.Http` to make outbound HTTP requests or define handlers for inbound HTTP traffic.

```toml theme={null}
[dependencies]
Astra.Http = "*"
```

<Note>
  Full API details for `Astra.Http` will be published as the package stabilizes. Refer to the individual package reference page for current method signatures, request and response types, and configuration options.
</Note>

### Astra.FileSystem

`Astra.FileSystem` provides platform-aware file and directory operations for reading, writing, and navigating the local file system.

```toml theme={null}
[dependencies]
Astra.FileSystem = "*"
```

<Note>
  Full API details for `Astra.FileSystem` will be published as the package stabilizes. Refer to the individual package reference page for current method signatures and supported operations.
</Note>

### Astra.Configuration

Load and access structured application configuration with `Astra.Configuration`. It supports layered sources and type-safe retrieval so your application code never has to parse raw strings from environment variables by hand.

```toml theme={null}
[dependencies]
Astra.Configuration = "*"
```

### Astra.Cryptography

`Astra.Cryptography` provides cryptographic primitives including hashing algorithms, HMAC, digital signatures, symmetric and asymmetric encryption, and secure random generation.

```toml theme={null}
[dependencies]
Astra.Cryptography = "*"
```

### Astra.Xml

Parse and generate XML documents with `Astra.Xml`. Navigate elements, read attributes, and produce well-formed output for interoperability with XML-based systems and formats.

```toml theme={null}
[dependencies]
Astra.Xml = "*"
```

### Astra.Database

`Astra.Database` enables connection to relational and other database systems, parameterized query execution, and result mapping to typed Kairo values.

```toml theme={null}
[dependencies]
Astra.Database = "*"
```

***

<Note>
  Astra package documentation expands as each package stabilizes and reaches its first stable release. Refer to the individual package reference pages for the most current API details, supported options, and usage patterns.
</Note>
