Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions AGENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Agent Instructions

## Portal Requests

When the incoming request includes either of these fields:

- `fromportal`
- `source: "portal"`

treat the task as a portal-originated workflow.

## Website Change Rules

This website is generated from source inputs.

- Make durable website content changes in `content/site.yaml`.
- Make reusable layout, styling, or section capability changes in `template/`.
- Do not hand-edit `site/` for durable changes; it is generated output and can be overwritten.
- `oldwebsite/` is archived context and should not be treated as the active website.

For non-portal local work, the normal website validation flow is:

```bash
npm run validate
npm run dev
```

`npm run dev` already runs the generation step first, so a separate `npm run generate` is not required before local development. Use `npm run build` only when a production static build is specifically needed.

For portal-originated workflows, do **not** manually run these website commands:

```bash
npm run validate
npm run generate
npm run build
npm run dev
```

When the request comes from the portal, complete the file changes only. The website tester ActionBlock will handle install, validation/build/start, and browser verification manually through the portal workflow.

## Required Workflow

For portal-originated workflows:

1. Complete the requested code or content change.
2. Call `test-web-site` to verify the change.
3. Summarize the completed work and test results.
4. As the final tool/action step, call `create-pr`.

Do not call `create-pr` before implementation and `test-web-site` validation are complete.

### How to call the test ActionBlock

After completing all code changes, first use the `actionBlock_start` tool to run `test-web-site` with the current worktree path passed as `params.cwd`.

Use the absolute path of the worktree where the changes were made. Do not use the base project path from `codebolt.project.getProjectPath()`.

```json
{
"actionBlockName": "test-web-site",
"params": {
"cwd": "/absolute/path/to/current/worktree"
},
"explanation": "Running calculator app verification before PR creation."
}
```

If `test-web-site` fails, fix the issue and rerun it before calling `create-pr`.

### How to call the PR ActionBlock

After `test-web-site` has executed successfully, use the `actionBlock_start` tool with the current worktree path passed as `params.cwd`.

```json
{
"actionBlockName": "create-pr",
"params": {
"cwd": "/absolute/path/to/current/worktree"
},
"explanation": ""
}
```

Do **not** attempt to call `attempt_completion` until both ActionBlocks have been executed in order and returned their results successfully.

## Failure Handling

If the requested work cannot be completed, or checks fail and cannot be fixed in the current run:

- Report the blocker clearly.
- Do not claim the work is complete.
- If the request came from the portal, run `test-web-site` first when possible, then call `create-pr` as the final step, including the blocker or check failure details.
2 changes: 1 addition & 1 deletion content/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pages:

- type: hero
eyebrow: "AGENT-NATIVE SOFTWARE"
heading: "The self-evolving, swarm-scale AI agent engine"
heading: "The self-evolving, swarm-scale AI orchestration engine"
headingAccent:
- "self-evolving"
- "swarm-scale"
Expand Down
151 changes: 151 additions & 0 deletions site/public/images/sdk-code-diagram.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
background: #1a1b2e;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
padding: 40px;
}

.code-block {
background: #1e1f33;
border-radius: 16px;
padding: 40px 48px;
font-family: 'JetBrains Mono', 'Fira Code', monospace;
font-size: 15px;
line-height: 2;
width: 780px;
box-shadow: 0 25px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}

.line {
display: flex;
align-items: center;
padding: 0 12px;
border-radius: 4px;
white-space: pre;
}

.line.highlighted {
background: rgba(56, 189, 248, 0.08);
border-left: 2px solid rgba(56, 189, 248, 0.4);
padding-left: 10px;
}

.line-num {
color: #4a4b6a;
width: 32px;
text-align: right;
margin-right: 24px;
font-size: 13px;
user-select: none;
flex-shrink: 0;
}

.code { color: #c9d1d9; }

/* Syntax colors */
.comment { color: #6a6f8a; font-style: italic; }
.keyword { color: #c678dd; }
.function { color: #61afef; }
.string { color: #98c379; }
.variable { color: #e5c07b; }
.operator { color: #c9d1d9; }
.property { color: #56b6c2; }
.bracket { color: #e5c07b; }
.template { color: #98c379; }
.interpolation { color: #e5c07b; }
.module { color: #61afef; }
</style>
</head>
<body>
<div class="code-block">
<!-- Line 1: Comment -->
<div class="line">
<span class="line-num">1</span>
<span class="code"><span class="comment">// Custom Agent — 10 lines, full power</span></span>
</div>

<!-- Line 2: import -->
<div class="line">
<span class="line-num">2</span>
<span class="code"><span class="keyword">import</span> <span class="bracket">{</span> <span class="module">codebolt</span> <span class="bracket">}</span> <span class="keyword">from</span> <span class="string">'codeboltjs'</span><span class="operator">;</span></span>
</div>

<!-- Line 3: empty -->
<div class="line">
<span class="line-num">3</span>
<span class="code"></span>
</div>

<!-- Line 4: codebolt.onMessage -->
<div class="line">
<span class="line-num">4</span>
<span class="code"><span class="module">codebolt</span><span class="operator">.</span><span class="function">onMessage</span><span class="operator">(</span><span class="keyword">async</span> <span class="operator">(</span><span class="variable">msg</span><span class="operator">)</span> <span class="keyword">=></span> <span class="bracket">{</span></span>
</div>

<!-- Line 5: plan (highlighted) -->
<div class="line highlighted">
<span class="line-num">5</span>
<span class="code"> <span class="keyword">const</span> <span class="variable">plan</span> <span class="operator">=</span> <span class="keyword">await</span> <span class="module">codebolt</span><span class="operator">.</span><span class="property">llm</span><span class="operator">.</span><span class="function">plan</span><span class="operator">(</span><span class="variable">msg</span><span class="operator">);</span></span>
</div>

<!-- Line 6: code (highlighted) -->
<div class="line highlighted">
<span class="line-num">6</span>
<span class="code"> <span class="keyword">const</span> <span class="variable">code</span> <span class="operator">=</span> <span class="keyword">await</span> <span class="module">codebolt</span><span class="operator">.</span><span class="property">fs</span><span class="operator">.</span><span class="function">read</span><span class="operator">(</span><span class="variable">plan</span><span class="operator">.</span><span class="property">file</span><span class="operator">);</span></span>
</div>

<!-- Line 7: next (highlighted) -->
<div class="line highlighted">
<span class="line-num">7</span>
<span class="code"> <span class="keyword">const</span> <span class="variable">next</span> <span class="operator">=</span> <span class="keyword">await</span> <span class="module">codebolt</span><span class="operator">.</span><span class="property">llm</span><span class="operator">.</span><span class="function">edit</span><span class="operator">(</span><span class="variable">code</span><span class="operator">,</span> <span class="variable">plan</span><span class="operator">);</span></span>
</div>

<!-- Line 8: write (highlighted) -->
<div class="line highlighted">
<span class="line-num">8</span>
<span class="code"> <span class="keyword">await</span> <span class="module">codebolt</span><span class="operator">.</span><span class="property">fs</span><span class="operator">.</span><span class="function">write</span><span class="operator">(</span><span class="variable">plan</span><span class="operator">.</span><span class="property">file</span><span class="operator">,</span> <span class="variable">next</span><span class="operator">);</span></span>
</div>

<!-- Line 9: commit (highlighted) -->
<div class="line highlighted">
<span class="line-num">9</span>
<span class="code"> <span class="keyword">await</span> <span class="module">codebolt</span><span class="operator">.</span><span class="property">git</span><span class="operator">.</span><span class="function">commit</span><span class="operator">(</span><span class="template">`agent: <span class="interpolation">${</span><span class="variable">plan</span><span class="operator">.</span><span class="property">summary</span><span class="interpolation">}</span>`</span><span class="operator">);</span></span>
</div>

<!-- Line 10: closing -->
<div class="line">
<span class="line-num">10</span>
<span class="code"><span class="bracket">}</span><span class="operator">);</span></span>
</div>

<!-- Line 11: empty -->
<div class="line">
<span class="line-num">11</span>
<span class="code"></span>
</div>

<!-- Line 12: comment -->
<div class="line">
<span class="line-num">12</span>
<span class="code"><span class="comment">// Custom Plugin — runs inside the engine</span></span>
</div>

<!-- Line 13: comment -->
<div class="line">
<span class="line-num">13</span>
<span class="code"><span class="comment">// 3 channels: WebSocket · Mux · HTTP</span></span>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion site/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import CtaBlock from '../components/CtaBlock.astro';
<BaseLayout title="Codebolt — AI Engine for Agent-Native Software" navbarVariant="transparent" site={site} navigation={navigation}>
<Hero
eyebrow="AGENT-NATIVE SOFTWARE"
heading="The self-evolving, swarm-scale AI agent engine"
heading="The self-evolving, swarm-scale AI orchestration engine"
headingAccent={["self-evolving","swarm-scale"]}
subheading="Build software with Codebolt. Run and coordinate hundreds of autonomous agents across laptops, cloud, and fleets. Ship Codebolt-native applications that run directly on the engine runtime."
buttons={[{"label":"Download","href":"/download","variant":"primary"},{"label":"Read the Docs","href":"/docs","variant":"secondary"}]}
Expand Down
Loading