Configuration reference
Every option createAgent() accepts, in one place. For what each type is for, see agent types.
Shared options#
Accepted by all three types.
| Option | Type | Default | Notes |
|---|---|---|---|
type | 'one-shot' | 'agent' | 'saga' | required | Selects the overload |
systemPrompt | string | - | The agent's role and quality bar |
model | string | type-dependent | See the defaults below |
effort | string | model default | Reasoning effort, e.g. xhigh |
maxOutputTokens | number | 128000 | Cap on generated tokens |
By type#
| Option | one-shot | agent | saga |
|---|---|---|---|
temperature | ✓ | - | - |
stop | ✓ | - | - |
instructions | - | ✓ | ✓ |
deadlineMs | - | ✓ | ✓ |
contextWindow | - | ✓ | ✓ |
tools | - | ✓ | ✓ |
toolAllowlist | - | ✓ | ✓ |
maxTools | - | ✓ | ✓ |
skills | - | ✓ | ✓ |
mcpServers | - | ✓ | ✓ |
imageModel | - | ✓ | ✓ |
outputs | - | ✓ | ✓ |
maxOutputInlineBytes | - | ✓ | ✓ |
maxTurns | - | ✓ | - |
permissionMode | - | ✓ | - |
groundingModel | - | - | ✓ |
maxSteps | - | - | ✓ |
parallelism | - | - | ✓ |
TypeScript enforces this table. An option in the wrong column is a compile error, not a runtime surprise.
Defaults#
| Option | Default | What it sets |
|---|---|---|
model for one-shot | deepseek/deepseek-v4-flash | Model used by the synchronous response endpoint |
model for agent and saga | deepseek/deepseek-v4-pro | Model used by the managed runtime |
maxOutputTokens | 128000 | Maximum tokens the model may generate in one response |
contextWindow | 250000 | Size of the agent's working context across a run |
deadlineMs | none | Wall-clock execution deadline. Unset means the run is unbounded |
permissionMode | auto | Default permission policy for agent |
groundingModel | deepseek/deepseek-v4-flash | Grounding model for saga |
maxOutputInlineBytes | 262144 | Maximum bytes projected inline when not set explicitly |
toolAllowlist | derived | Tool names visible to the model. Derived from the rest of the config when unset. See Tools |
Connection options#
The second argument configures transport rather than behaviour, and is the same shape new CoreSource() takes.
| Option | Type | Default |
|---|---|---|
apiKey | string | CORESOURCE_API_KEY |
baseUrl | string | URL | CORESOURCE_API_URL, then https://api.coresource.ai/v1/ |
fetch | typeof fetch | global fetch |
ttlSeconds | number | 3600 for an SDK-hosted bridge |
ttlSeconds applies only when local capabilities cause the SDK to provision a bridge. The accepted range is 60 seconds through 30 days.
import { createAgent } from '@coresourceai/sdk';
const agent = createAgent(
{ type: 'agent', systemPrompt: 'Be careful.' },
{
apiKey: process.env.CORESOURCE_API_KEY,
baseUrl: 'https://api.example.com/v1/'
}
);
await agent.close();See Authentication for keys, deployments, and supplying your own fetch.
Lifecycle#
createAgent() is synchronous and lazy. It prepares the agent locally and
does no network work until run() or start().
close() releases what the agent holds and makes further use of the handle an error. A live bridge is created when an agent or saga uses custom tools, runtime tools, local skill bundles, or locally registered MCP.
import { createAgent } from '@coresourceai/sdk';
const agent = createAgent({ type: 'agent' });
try {
const result = await agent.run('Do the work.');
console.log(result.text);
} finally {
await agent.close();
}registerRuntimeTools() and registerMcpServer() must be called before the first run starts; afterwards they throw, because the tool set is fixed when the run begins.
