Skip to content

Commit b74b2be

Browse files
authored
feat: add coder workspace support to scout (#96)
1 parent 03580dd commit b74b2be

File tree

10 files changed

+2148
-67
lines changed

10 files changed

+2148
-67
lines changed

packages/scout-agent/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
.blink
2+
**/.claude
3+
dist
4+
node_modules
5+
*.tgz

packages/scout-agent/README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ All integrations are optional - include only what you need.
6666

6767
### ScoutOptions
6868

69-
| Option | Type | Required | Description |
70-
| ----------- | ---------------------- | -------- | --------------------------------------- |
71-
| `agent` | `blink.Agent<Message>` | Yes | Blink agent instance |
72-
| `github` | `GitHubConfig` | No | GitHub App configuration |
73-
| `slack` | `SlackConfig` | No | Slack App configuration |
74-
| `webSearch` | `WebSearchConfig` | No | Exa web search configuration |
75-
| `compute` | `ComputeConfig` | No | Docker or Daytona compute configuration |
76-
| `logger` | `Logger` | No | Custom logger instance |
69+
| Option | Type | Required | Description |
70+
| ----------- | ---------------------- | -------- | ----------------------------------------------- |
71+
| `agent` | `blink.Agent<Message>` | Yes | Blink agent instance |
72+
| `github` | `GitHubConfig` | No | GitHub App configuration |
73+
| `slack` | `SlackConfig` | No | Slack App configuration |
74+
| `webSearch` | `WebSearchConfig` | No | Exa web search configuration |
75+
| `compute` | `ComputeConfig` | No | Docker, Daytona, or Coder compute configuration |
76+
| `logger` | `Logger` | No | Custom logger instance |
7777

7878
### GitHub
7979

@@ -151,6 +151,23 @@ Execute code in isolated environments:
151151
}
152152
```
153153

154+
**Coder (self-hosted workspaces):**
155+
156+
```typescript
157+
{
158+
type: "coder",
159+
options: {
160+
coderUrl: string // Coder deployment URL (e.g., https://coder.example.com)
161+
sessionToken: string // Coder session token for authentication
162+
template: string // Template name to create workspaces from
163+
computeServerPort?: number // Port for compute server (default: 22137)
164+
presetName?: string // Optional preset name for workspace creation
165+
richParameters?: Array<{ name: string; value: string }> // Optional template parameters
166+
startTimeoutSeconds?: number // Workspace start timeout (default: 300)
167+
}
168+
}
169+
```
170+
154171
## API Reference
155172

156173
### Scout Class

packages/scout-agent/agent.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ import { type Message, Scout } from "./lib";
55

66
export const agent = new blink.Agent<Message>();
77

8+
const ensure = (value: string | undefined): string => {
9+
if (value === undefined) {
10+
throw new Error("value is undefined");
11+
}
12+
return value;
13+
};
14+
815
const scout = new Scout({
916
agent,
1017
github: {
@@ -20,7 +27,13 @@ const scout = new Scout({
2027
exaApiKey: process.env.EXA_API_KEY,
2128
},
2229
compute: {
23-
type: "docker",
30+
type: "coder",
31+
options: {
32+
url: ensure(process.env.CODER_URL),
33+
sessionToken: ensure(process.env.CODER_SESSION_TOKEN),
34+
template: ensure(process.env.CODER_TEMPLATE),
35+
presetName: ensure(process.env.CODER_PRESET_NAME),
36+
},
2437
},
2538
});
2639

@@ -39,7 +52,7 @@ agent.on("chat", async ({ id, messages }) => {
3952
const params = await scout.buildStreamTextParams({
4053
messages,
4154
chatID: id,
42-
model: "anthropic/claude-sonnet-4.5",
55+
model: "anthropic/claude-opus-4.5",
4356
providerOptions: { anthropic: { cacheControl: { type: "ephemeral" } } },
4457
tools: {
4558
get_favorite_color: tool({

0 commit comments

Comments
 (0)