Skip to content

Commit 10ea981

Browse files
committed
chore: ensure max 100 cols
1 parent 4dd4f06 commit 10ea981

7 files changed

Lines changed: 193 additions & 77 deletions

File tree

src/components.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
title: 🧩 Components
33
---
44

5-
Components are the building blocks of asterai. A component is a portable, sandboxed program that can be published to the registry and run anywhere.
5+
Components are the building blocks of asterai.
6+
A component is a portable, sandboxed program that can be published to
7+
the registry and run anywhere.
68

79
## What is a Component?
810

9-
A component is compiled code with a typed interface. You write it in a supported language (TypeScript, Python, Rust, Go, etc.), define its interface, and asterai compiles it to a portable format that runs in any asterai environment.
11+
A component is compiled code with a typed interface.
12+
You write it in a supported language (TypeScript, Python, Rust, Go,
13+
etc.), define its interface, and asterai compiles it to a portable
14+
format that runs in any asterai environment.
1015

1116
Components can:
1217
- 📤 Export functions for other components or AI agents to call
@@ -15,7 +20,10 @@ Components can:
1520

1621
## Component Interface
1722

18-
Every component has an interface defined in [WIT (WebAssembly Interface Types)](https://component-model.bytecodealliance.org/design/wit.html). This defines what functions your component exports and what types it uses.
23+
Every component has an interface defined in
24+
[WIT (WebAssembly Interface Types)](https://component-model.bytecodealliance.org/design/wit.html).
25+
This defines what functions your component exports and what types it
26+
uses.
1927

2028
Example interface for a burger ordering tool:
2129

@@ -39,15 +47,20 @@ world component {
3947

4048
The interface declares:
4149
- **Package**: Your namespace, component name, and version
42-
- **Imports**: Capabilities your component needs (here, the asterai host API)
50+
- **Imports**: Capabilities your component needs
51+
(here, the asterai host API)
4352
- **Exports**: Functions your component provides
4453
- **Types**: Data structures used by your functions
4554

4655
### 🔗 Composability: Interfaces vs World Exports
4756

48-
If you want other components to be able to call your component's functions, you **must** put those functions inside a named interface. Functions exported directly at the world level (bare exports) can only be called by the host runtime, not by other components.
57+
If you want other components to be able to call your component's
58+
functions, you **must** put those functions inside a named interface.
59+
Functions exported directly at the world level (bare exports) can only
60+
be called by the host runtime, not by other components.
4961

50-
What this means is that these functions can only be called externally, e.g. from other environments via the asterai API.
62+
What this means is that these functions can only be called externally,
63+
e.g. from other environments via the asterai API.
5164

5265
**Not composable** — only the host can call `order-burger`:
5366

@@ -69,7 +82,8 @@ world component {
6982
}
7083
```
7184

72-
**Composable** — other components can import and call `your-username:burger-shop/api`:
85+
**Composable** — other components can import and call
86+
`your-username:burger-shop/api`:
7387

7488
```wit
7589
package your-username:burger-shop@0.1.0;
@@ -99,11 +113,14 @@ With the second form, another component can import your interface:
99113
import your-username:burger-shop/api@0.1.0;
100114
```
101115

102-
See the [Component Model composition docs](https://component-model.bytecodealliance.org/composing-and-distributing/composing.html#what-is-composition) for more details.
116+
See the
117+
[Component Model composition docs](https://component-model.bytecodealliance.org/composing-and-distributing/composing.html#what-is-composition)
118+
for more details.
103119

104120
## Component Implementation
105121

106-
The implementation is your actual code. Here's the TypeScript implementation for the interface above:
122+
The implementation is your actual code.
123+
Here's the TypeScript implementation for the interface above:
107124

108125
```ts
109126
import * as asterai from "asterai:host/api@0.1.0";
@@ -140,10 +157,16 @@ pub fn order_burger(order: Order) -> OrderResult {
140157

141158
## 🏷️ Versioning
142159

143-
Components use semantic versioning. Each published version is immutable—you can't overwrite an existing version. This ensures reproducible builds and reliable dependencies.
160+
Components use semantic versioning.
161+
Each published version is immutable—you can't overwrite an existing
162+
version.
163+
This ensures reproducible builds and reliable dependencies.
144164

145165
## 👉 Next Steps
146166

147-
- [Hello World guide](/hello_world): Create and deploy your first component
148-
- [CLI reference](/console_and_cli): Learn the asterai CLI commands
149-
- [Registry](/registry): Publish and discover components
167+
- [Hello World guide](/hello_world):
168+
Create and deploy your first component
169+
- [CLI reference](/console_and_cli):
170+
Learn the asterai CLI commands
171+
- [Registry](/registry):
172+
Publish and discover components

src/console_and_cli.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ title: ⌨️ CLI & Console
44

55
## CLI
66

7-
The asterai CLI is the primary tool for building, publishing, and running components and environments.
7+
The asterai CLI is the primary tool for building, publishing, and
8+
running components and environments.
89

910
### Installation
1011

@@ -47,7 +48,8 @@ asterai env set-var <name> --var NAME=VALUE # Set environment variable
4748

4849
## ☁️ Cloud Console
4950

50-
The [cloud console](https://asterai.io/dashboard) provides a web interface for managing your asterai resources:
51+
The [cloud console](https://asterai.io/dashboard) provides a web
52+
interface for managing your asterai resources:
5153

5254
- 📦 **Environments**: Create, configure, and monitor environments
5355
- 🧩 **Components**: View your published components and their versions
@@ -56,5 +58,7 @@ The [cloud console](https://asterai.io/dashboard) provides a web interface for m
5658

5759
## 👉 Next Steps
5860

59-
- [Hello World guide](/hello_world): Build and run your first component
60-
- [Components](/components): Learn how components work
61+
- [Hello World guide](/hello_world):
62+
Build and run your first component
63+
- [Components](/components):
64+
Learn how components work

src/environments.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: 📦 Environments
33
---
44

5-
Environments are deployable bundles that combine components with configuration. They are the unit of deployment in asterai.
5+
Environments are deployable bundles that combine components with
6+
configuration.
7+
They are the unit of deployment in asterai.
68

79
## What is an Environment?
810

@@ -12,7 +14,8 @@ An environment is a runtime context that:
1214
- ☁️ Can run locally or in the cloud
1315
- 🔒 Provides isolation between deployments
1416

15-
Think of components as reusable building blocks, and environments as the assembled application that runs them.
17+
Think of components as reusable building blocks, and environments as
18+
the assembled application that runs them.
1619

1720
## 🛠️ Creating an Environment
1821

@@ -52,7 +55,9 @@ const apiKey = asterai.getEnv("API_KEY");
5255

5356
### Secrets
5457

55-
For sensitive values like API keys, use the cloud console to set secrets. Secrets are encrypted at rest and only decrypted at runtime.
58+
For sensitive values like API keys, use the cloud console to set
59+
secrets.
60+
Secrets are encrypted at rest and only decrypted at runtime.
5661

5762
## ▶️ Running Environments
5863

@@ -64,7 +69,9 @@ Run an environment on your machine for development and testing:
6469
asterai env run my-env
6570
```
6671

67-
This starts a local runtime that loads your components and configuration. You can then call functions:
72+
This starts a local runtime that loads your components and
73+
configuration.
74+
You can then call functions:
6875

6976
```bash
7077
asterai env call my-env your-username:hello-world greeting.get-greeting '"World"'
@@ -78,21 +85,26 @@ Push your environment to run it on asterai's infrastructure:
7885
asterai env push my-env
7986
```
8087

81-
Once pushed, your environment is available via the asterai API. No infrastructure management required.
88+
Once pushed, your environment is available via the asterai API.
89+
No infrastructure management required.
8290

8391
## 🔗 Composing Components
8492

85-
Environments can contain multiple components that work together. Each component can import and call functions from other components in the same environment.
93+
Environments can contain multiple components that work together.
94+
Each component can import and call functions from other components in
95+
the same environment.
8696

87-
Example: An environment with a web scraper component and a data processing component:
97+
Example: An environment with a web scraper component and a data
98+
processing component:
8899

89100
```bash
90101
asterai env init data-pipeline
91102
asterai env add data-pipeline --component your-username:web-scraper@1.0.0
92103
asterai env add data-pipeline --component your-username:data-processor@1.0.0
93104
```
94105

95-
The data processor can import and call functions from the web scraper, creating a pipeline.
106+
The data processor can import and call functions from the web scraper,
107+
creating a pipeline.
96108

97109
## Inspecting Environments
98110

@@ -117,6 +129,9 @@ asterai env remove my-env --component your-username:hello-world@0.1.0 # Remove
117129

118130
## 👉 Next Steps
119131

120-
- [Hello World guide](/hello_world): Create your first component and environment
121-
- [Components](/components): Learn how to build components
122-
- [CLI reference](/console_and_cli): Full CLI command reference
132+
- [Hello World guide](/hello_world):
133+
Create your first component and environment
134+
- [Components](/components):
135+
Learn how to build components
136+
- [CLI reference](/console_and_cli):
137+
Full CLI command reference

src/hello_world.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
title: 🚀 Hello World
33
---
44

5-
This guide walks you through creating your first asterai component and running it in an environment.
5+
This guide walks you through creating your first asterai component and
6+
running it in an environment.
67

78
## 📋 Prerequisites
89

@@ -11,7 +12,8 @@ This guide walks you through creating your first asterai component and running i
1112

1213
## Overview
1314

14-
You'll create a simple component that returns a greeting, then run it locally in an environment.
15+
You'll create a simple component that returns a greeting, then run it
16+
locally in an environment.
1517

1618
## Steps
1719

@@ -23,7 +25,8 @@ npm install -g @asterai/cli
2325

2426
### 2. Authenticate
2527

26-
Generate an API key from [your dashboard](https://asterai.io/dashboard/account):
28+
Generate an API key from
29+
[your dashboard](https://asterai.io/dashboard/account):
2730

2831
```bash
2932
asterai auth login <your_api_key>
@@ -45,7 +48,8 @@ npm install
4548

4649
### 4. Define the interface
4750

48-
Edit `plugin.wit` to define your component's interface. Replace `your-username` with your asterai username:
51+
Edit `plugin.wit` to define your component's interface.
52+
Replace `your-username` with your asterai username:
4953

5054
```wit
5155
package your-username:hello-world@0.1.0;
@@ -59,7 +63,8 @@ world component {
5963
}
6064
```
6165

62-
This declares a component that exports one function: `get-greeting`, which takes a name and returns a greeting string.
66+
This declares a component that exports one function: `get-greeting`,
67+
which takes a name and returns a greeting string.
6368

6469
### 5. Implement the component
6570

@@ -124,15 +129,20 @@ To run your environment in the cloud, push it to the registry:
124129
asterai env push my-env
125130
```
126131

127-
Your environment is now available to run on asterai's cloud infrastructure.
132+
Your environment is now available to run on asterai's cloud
133+
infrastructure.
128134

129135
## 🎯 What's Next?
130136

131-
You've created a component and run it in an environment. From here you can:
137+
You've created a component and run it in an environment.
138+
From here you can:
132139

133140
- ➕ Add more functions to your component
134141
- 📥 Import other components from the registry
135-
- 🔧 Add configuration (environment variables, secrets) to your environment
142+
- 🔧 Add configuration (environment variables, secrets) to your
143+
environment
136144
- 🔗 Compose multiple components in a single environment
137145

138-
See the [Components](/components) page for more on building components, or [Registry](/registry) for publishing and discovering components.
146+
See the [Components](/components) page for more on building
147+
components, or [Registry](/registry) for publishing and discovering
148+
components.

src/introduction.md

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,80 @@
22
title: 👋 Introduction
33
---
44

5-
Asterai is the tool marketplace for AI agents. Discover, share, and deploy tools written in any programming language, with instant cloud execution.
5+
Asterai is the tool marketplace for AI agents.
6+
Discover, share, and deploy tools written in any programming language,
7+
with instant cloud execution.
68

79
## What is asterai?
810

9-
Asterai is a registry and runtime for portable, sandboxed tools. Write a tool once in your preferred language, publish it to the registry, and run it anywhere—locally or in the cloud.
11+
Asterai is a registry and runtime for portable, sandboxed tools.
12+
Write a tool once in your preferred language, publish it to the registry,
13+
and run it anywhere—locally or in the cloud.
1014

11-
Under the hood, asterai uses [WebAssembly](/webassembly) for portability and security. But you don't need to know anything about WebAssembly to use asterai. Just write code in a supported language (TypeScript, Python, Rust, Go, and more), and asterai handles the rest.
15+
Under the hood, asterai uses [WebAssembly](/webassembly) for portability
16+
and security.
17+
But you don't need to know anything about WebAssembly to use asterai.
18+
Just write code in a supported language (TypeScript, Python, Rust, Go,
19+
and more), and asterai handles the rest.
1220

1321
## Key Concepts
1422

15-
1. 🧩 **Component**: A portable tool or library. Components are published to the registry and can be composed together. Write them in any supported language.
23+
1. 🧩 **Component**: A portable tool or library.
24+
Components are published to the registry and can be composed together.
25+
Write them in any supported language.
1626

17-
2. 📦 **Environment**: A deployable bundle of one or more components with configuration (environment variables, secrets). Environments can run locally or in the cloud.
27+
2. 📦 **Environment**: A deployable bundle of one or more components
28+
with configuration (environment variables, secrets).
29+
Environments can run locally or in the cloud.
1830

19-
3. 🔍 **Registry**: Where components are published and discovered. Each user has a namespace for their components.
31+
3. 🔍 **Registry**: Where components are published and discovered.
32+
Each user has a namespace for their components.
2033

21-
4. ⌨️ **CLI**: The open-source command-line tool for building, publishing, and running components locally.
34+
4. ⌨️ **CLI**: The open-source command-line tool for building,
35+
publishing, and running components locally.
2236

23-
5. ☁️ **Cloud**: Run environments on asterai's infrastructure with a simple API call—no DevOps required.
37+
5. ☁️ **Cloud**: Run environments on asterai's infrastructure with a
38+
simple API call—no DevOps required.
2439

2540
## Why asterai?
2641

2742
🌐 **Language interoperability**
28-
Write tools in any language. Components written in different languages work together seamlessly through typed interfaces.
43+
Write tools in any language.
44+
Components written in different languages work together seamlessly
45+
through typed interfaces.
2946

3047
🔒 **Sandboxed execution**
31-
AI agents can run untrusted code safely. Each component runs in an isolated sandbox with explicit permissions.
48+
AI agents can run untrusted code safely.
49+
Each component runs in an isolated sandbox with explicit permissions.
3250

3351
📤 **True portability**
34-
Deploy anywhere. No dependency hell. Same behavior locally and in the cloud.
52+
Deploy anywhere. No dependency hell.
53+
Same behavior locally and in the cloud.
3554

3655
**Instant deployment**
37-
Tools just work. No containers, no infrastructure configuration. Publish and run.
56+
Tools just work. No containers, no infrastructure configuration.
57+
Publish and run.
3858

3959
## Example Use Cases
4060

4161
### 🤖 Tools for AI Agents
42-
Build reliable tools that your AI agents can call: API integrations, data processing, web scraping, file operations. Components provide type-safe interfaces that LLMs can understand and use correctly.
62+
Build reliable tools that your AI agents can call: API integrations,
63+
data processing, web scraping, file operations.
64+
Components provide type-safe interfaces that LLMs can understand and
65+
use correctly.
4366

4467
### 🗣️ Polyglot Libraries
45-
Use the right language for each job. A Rust component for performance-critical math, a Python component for ML inference, a TypeScript component for API calls—all composable in a single environment.
68+
Use the right language for each job.
69+
A Rust component for performance-critical math, a Python component for
70+
ML inference, a TypeScript component for API calls—all composable in a
71+
single environment.
4672

4773
### ⚙️ Serverless Functions
48-
Deploy functions to the cloud without managing infrastructure. Pay only for what you use, with global edge execution for low latency.
74+
Deploy functions to the cloud without managing infrastructure.
75+
Pay only for what you use, with global edge execution for low latency.
4976

5077
## 🚀 Getting Started
5178

52-
The fastest way to get started is the [Hello World guide](/hello_world), which walks you through creating and deploying your first component.
79+
The fastest way to get started is the
80+
[Hello World guide](/hello_world), which walks you through creating and
81+
deploying your first component.

0 commit comments

Comments
 (0)