@personaai/sdkv0.9.0

agents — @personaai/sdk

Generated field tables for agents — do not edit

Generated from sdk/typescript/dist/typedoc.json — do not edit. Regenerate with node platform/scripts/typedoc-resources.mjs.

agents

Auth: Requires Authorization: Bearer <keyId>.<secret> (server-side). For per-user calls add x-persona-external-user-id. See .

Agents are AI personas with a system prompt, provider, and tool attachments. Create them with a control-plane client (no externalUserId), then chat with them via a per-user client. Agent is the read shape; CreateAgentInput/UpdateAgentInput are the write shapes.

Example

TypeScript

ts
import { PersonaClient } from '@personaai/sdk';const persona = new PersonaClient({ baseUrl, credential: process.env.PERSONA_CREDENTIAL! });const agent = await persona.agents.create({  name: 'Career Launchpad',  systemPrompt: 'You help students find internships.',  providerId: '...',  visibility: 'unlisted',});

cURL

bash
curl https://api.persona.hasanraiyan.me/api/v1/developer/agents \  -H "Authorization: Bearer $PERSONA_CREDENTIAL" \  -H "Content-Type: application/json" \  -d '{"name":"Career Launchpad","systemPrompt":"You help students…","providerId":"...","visibility":"unlisted"}'

Response

json
{  "success": true,  "data": { "_id": "ag_123", "name": "Career Launchpad", "slug": "career-launchpad", "isActive": true }}

Agent

Note: like Skill, this mirrors the real wire shape (_id, raw domain/ownerType fields) — getOne() returns skills/mcps/ knowledgeBases populated as objects, while create()/update()/ list() return them as bare id strings; typed loosely here to reflect that real difference rather than picking one shape and being wrong for the other calls.

Source: types/agent.ts:21

Interface

FieldTypeDescription
_idstring— _ types/agent.ts:22_
domainstring— _ types/agent.ts:23_
ownerType"PersonaUser" | "Project" | "ExternalUser"— _ types/agent.ts:24_
ownerId?string— _ types/agent.ts:25_
externalOwnerId?string— _ types/agent.ts:26_
namestring— _ types/agent.ts:27_
slugstringURL-safe, unique within the Domain; used in some public-facing routes. — _ types/agent.ts:29_
description?string— _ types/agent.ts:30_
avatar?string— _ types/agent.ts:31_
tags?string[]— _ types/agent.ts:32_
tagline?stringShort one-liner shown in list/card views. — _ types/agent.ts:34_
bio?stringLonger free-text bio shown on the Agent's own profile view. — _ types/agent.ts:36_
personalityTraits?string[]— _ types/agent.ts:37_
socialLinks?AgentSocialLinks— _ types/agent.ts:38_
systemPrompt?stringStripped from the response when the calling identity doesn't own this Agent. — _ types/agent.ts:40_
providerId?stringStripped from the response when the calling identity doesn't own this Agent. — _ types/agent.ts:42_
modelName?stringOverrides the referenced Provider's defaultModel when set. — _ types/agent.ts:44_
webSearchEnabledboolean— _ types/agent.ts:45_
sandboxEnabledbooleanReal shell execution in an isolated CodeSandbox VM. Requires a CSB_API_KEY Project Secret to exist first (there is no secrets SDK resource yet — create one via the platform UI or POST /api/v1/developer/secrets). — _ types/agent.ts:47_
visibilityAgentVisibility— _ types/agent.ts:48_
categoryAgentCategory— _ types/agent.ts:49_
skills?unknown[]Bare id strings on create/update/list; populated objects on get(). — _ types/agent.ts:51_
mcps?unknown[]Bare id strings on create/update/list; populated objects on get(). — _ types/agent.ts:53_
knowledgeBases?unknown[]Bare id strings on create/update/list; populated objects on get(). — _ types/agent.ts:55_
storeMounts?unknown[]Bare id strings on create/update/list; populated objects on get(). — _ types/agent.ts:57_
interruptOn?Record<string, boolean>Maps a tool name to whether calling it pauses the run for human approval (a real LangGraph interrupt, resumed via chat.stream()'s resume option). — _ types/agent.ts:59_
isActiveboolean— _ types/agent.ts:60_
isMainAgentbooleanWhether this is the Project's designated default/primary Agent. — _ types/agent.ts:62_
createdAtstring— _ types/agent.ts:63_
updatedAtstring— _ types/agent.ts:64_

AgentSocialLinks

Source: types/agent.ts:1

Interface

FieldTypeDescription
website?string— _ types/agent.ts:2_
twitter?string— _ types/agent.ts:3_
github?string— _ types/agent.ts:4_
linkedin?string— _ types/agent.ts:5_

AgentVisibility

unlisted is reachable by direct link/id but excluded from public discovery listings.

Source: types/agent.ts:9

Kind 2097152

ts
type AgentVisibility = "private" | "unlisted" | "public"

AgentCategory

Source: types/agent.ts:10

Kind 2097152

ts
type AgentCategory = "productivity" | "coding" | "creative" | "research" | "roleplay" | "other"

CreateAgentInput

Source: types/agent.ts:67

Interface

FieldTypeDescription
namestring— _ types/agent.ts:68_
systemPromptstringThe instructions that define this Agent's behavior/persona. — _ types/agent.ts:70_
providerIdstringMust reference a Provider already created via providers.create(). — _ types/agent.ts:72_
description?string— _ types/agent.ts:73_
avatar?string— _ types/agent.ts:74_
tags?string[]— _ types/agent.ts:75_
tagline?string— _ types/agent.ts:76_
bio?string— _ types/agent.ts:77_
personalityTraits?string[]— _ types/agent.ts:78_
socialLinks?AgentSocialLinks— _ types/agent.ts:79_
modelName?stringOverrides the referenced Provider's defaultModel. — _ types/agent.ts:81_
webSearchEnabled?boolean— _ types/agent.ts:83_
sandboxEnabled?boolean— _ types/agent.ts:85_
visibility?AgentVisibility— _ types/agent.ts:87_
category?AgentCategory— _ types/agent.ts:89_
skills?string[]Skill ids to attach at creation time. — _ types/agent.ts:91_
mcps?string[]MCP server ids to attach at creation time. — _ types/agent.ts:93_
knowledgeBases?string[]Knowledge base ids to attach at creation time. — _ types/agent.ts:95_
storeMounts?string[]Store ids to mount at creation time (see stores.create()). — _ types/agent.ts:97_
interruptOn?Record<string, boolean>Maps a tool name to whether calling it should pause the run for human approval, e.g. { propose_issue: true }. Works identically for built-in and MCP-sourced tool names. Omit for no gated tools. — _ types/agent.ts:99_
isActive?boolean— _ types/agent.ts:101_

UpdateAgentInput

All fields optional — only what you pass is changed.

Source: types/agent.ts:105

Interface

FieldTypeDescription
name?string— _ types/agent.ts:106_
description?string— _ types/agent.ts:107_
avatar?string— _ types/agent.ts:108_
tags?string[]— _ types/agent.ts:109_
tagline?string— _ types/agent.ts:110_
bio?string— _ types/agent.ts:111_
personalityTraits?string[]— _ types/agent.ts:112_
socialLinks?AgentSocialLinks— _ types/agent.ts:113_
systemPrompt?string— _ types/agent.ts:114_
providerId?string— _ types/agent.ts:115_
modelName?string— _ types/agent.ts:116_
webSearchEnabled?boolean— _ types/agent.ts:117_
sandboxEnabled?boolean— _ types/agent.ts:118_
skills?string[]Replaces the entire array — this is not a merge/append. — _ types/agent.ts:120_
mcps?string[]Replaces the entire array — this is not a merge/append. — _ types/agent.ts:122_
knowledgeBases?string[]Replaces the entire array — this is not a merge/append. — _ types/agent.ts:124_
storeMounts?string[]Replaces the entire array — this is not a merge/append. — _ types/agent.ts:126_
interruptOn?Record<string, boolean>Replaces the entire map — this is not a merge/append. — _ types/agent.ts:128_
visibility?AgentVisibility— _ types/agent.ts:129_
category?AgentCategory— _ types/agent.ts:130_
isActive?boolean— _ types/agent.ts:131_

DiscoverAgentsParams

Source: types/agent.ts:148

Interface

FieldTypeDescription
page?number— _ types/agent.ts:150_
limit?number— _ types/agent.ts:152_
search?stringFree-text match against name/description/tagline. — _ types/agent.ts:154_
category?AgentCategory— _ types/agent.ts:155_
scope?"mine"Restricts to the asserted external user's own Agents (ProjectRuntimeContext only). — _ types/agent.ts:157_

McpConnection

One authType: 'oauth', authMode: 'user' MCP attached to an Agent, and whether the calling identity (the client's asserted external user) has connected it yet. authorizeUrl is only present when connected is false — send the browser there to start the OAuth consent flow.

Source: types/agent.ts:140

Interface

FieldTypeDescription
mcpIdstring— _ types/agent.ts:141_
namestring— _ types/agent.ts:142_
descriptionstring— _ types/agent.ts:143_
connectedboolean— _ types/agent.ts:144_
authorizeUrlstring | null— _ types/agent.ts:145_