Skip to main content

YAML Configuration Formats

English | 简体中文

This document provides detailed explanations of the YAML configuration formats for each core concept in the Wegent platform. Each definition follows Kubernetes-style declarative API design patterns.

Table of Contents​


👻 Ghost​

Ghost defines the "soul" of an agent, including personality, capabilities, and behavior patterns.

Complete Configuration Example​

apiVersion: agent.wecode.io/v1
kind: Ghost
metadata:
name: developer-ghost
namespace: default
spec:
systemPrompt: |
You are a senior software engineer, proficient in Git, GitHub MCP, branch management, and code submission workflows. You will use the specified programming language to generate executable code and complete the branch submission and MR (Merge Request) process.
baseGhostRef:
name: system-default-ghost
namespace: default
user_id: 0
mcpServers:
github:
env:
GITHUB_PERSONAL_ACCESS_TOKEN: ghp_xxxxx
args:
- run
- -i
- --rm
- -e
- GITHUB_PERSONAL_ACCESS_TOKEN
- -e
- GITHUB_TOOLSETS
- -e
- GITHUB_READ_ONLY
- ghcr.io/github/github-mcp-server
command: docker

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Ghost
metadata.namespacestringYesNamespace, typically default
spec.systemPromptstringYesSystem prompt defining agent personality and capabilities
spec.baseGhostRefobjectNoGhost reference used as a capability baseline; one level only
spec.mcpServersobjectNoMCP server configuration defining agent's tool capabilities
spec.skillsarrayNoList of Skill names to associate with this Ghost, e.g., ["skill-1", "skill-2"]

baseGhostRef contains name, namespace, and user_id. At runtime, only the base Ghost's MCP servers, Skills, preloaded Skills, and plugins are inherited. Same-name entries from the current Ghost take precedence, and the current Ghost's systemPrompt is always preserved. Wegent merges the configuration before making one model request; it does not invoke both Ghosts separately. Nested baseGhostRef values are not supported.

Business MCP Server Identity​

When spec.mcpServers points to a remote MCP server hosted by a business partner, the server can authenticate the calling Wegent user with the task token Wegent injects into outbound requests. Configure the server's static headers with the ${{task_token}} placeholder; Wegent replaces it with a signed task token when building the request:

spec:
mcpServers:
business:
type: streamable-http
url: https://mcp.business.example.com/mcp
headers:
Authorization: "Bearer ${{task_token}}"

The task token is scoped to the current task (24 hours by default). The business side can resolve the current user by calling GET /api/external/mcp-identity/userinfo with the same Authorization: Bearer <token> header; the response contains only the user's basic information (id, user_name, email) and never exposes git credentials.


✨ Skill​

Skill is a Claude Code capability extension package containing executable code and configuration. Skills are uploaded as ZIP packages and deployed to ~/.claude/skills/ when tasks start.

Complete Configuration Example​

apiVersion: agent.wecode.io/v1
kind: Skill
metadata:
name: python-debugger
namespace: default
spec:
description: "Python debugging tool with breakpoint and variable inspection support"
version: "1.0.0"
author: "WeCode Team"
tags: ["python", "debugging", "development"]
status:
state: "Available"
fileSize: 2048576
fileHash: "abc123def456..."

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Skill (used in Ghost spec.skills field)
metadata.namespacestringYesNamespace, typically default
spec.descriptionstringYesSkill功能描述 (extracted from SKILL.md frontmatter)
spec.versionstringNoVersion number (semantic versioning recommended)
spec.authorstringNoAuthor name or organization
spec.tagsarrayNoTags for categorization, e.g., ["python", "debugging"]
status.statestringYesSkill status: Available or Unavailable
status.fileSizeintegerNoZIP package size in bytes
status.fileHashstringNoSHA256 hash of the ZIP package

ZIP Package Requirements​

Skills must be uploaded as ZIP packages containing:

  1. SKILL.md (required): Skill documentation with YAML frontmatter
  2. Other files: Scripts, configurations, assets, etc.

SKILL.md Format:

---
description: "Your skill description here"
version: "1.0.0"
author: "Your Name"
tags: ["tag1", "tag2"]
---

# Skill Documentation

Detailed description of what this skill does...

Using Skills in Ghosts​

Associate skills with a Ghost by adding them to the spec.skills array:

apiVersion: agent.wecode.io/v1
kind: Ghost
metadata:
name: developer-ghost
namespace: default
spec:
systemPrompt: "You are a senior developer..."
mcpServers: { ... }
skills:
- python-debugger
- code-formatter

When a task starts with this Ghost, the Executor automatically downloads and deploys these skills to ~/.claude/skills/.

🧠 Model​

Model defines the AI model configuration, including environment variables and model parameters.

Complete Configuration ClaudeCode Example​

apiVersion: agent.wecode.io/v1
kind: Model
metadata:
name: ClaudeSonnet4
namespace: default
spec:
isVisible: true
allowedUsersEnabled: true
allowedUsers: ["alice", "bob"]
modelGroup: "Primary"
modelSubGroup: "Fast"
capability: "Fast responses for everyday questions and simple tasks"
modelConfig:
env:
ANTHROPIC_MODEL: "openrouter,anthropic/claude-sonnet-4"
ANTHROPIC_BASE_URL: "http://xxxxx"
ANTHROPIC_AUTH_TOKEN: "sk-xxxxxx"
ANTHROPIC_DEFAULT_HAIKU_MODEL: "openrouter,anthropic/claude-haiku-4.5"

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Model
metadata.namespacestringYesNamespace, typically default
spec.isVisiblebooleanNoWhether a public model appears in regular users' model selectors. Defaults to true; false preserves existing references and runtime resolution.
spec.allowedUsersarrayNoUser-name whitelist of a public model; only enforced when allowedUsersEnabled is true. When the switch is off, the list is retained but does not restrict access.
spec.allowedUsersEnabledbooleanNoExplicit switch for whitelist-only mode; when true, access is governed strictly by allowedUsers, and an empty list denies everyone. When false/absent, the model is a normal public model and allowedUsers is ignored.
spec.modelGroupstringNoFirst-level display group used by model selectors
spec.modelSubGroupstringNoSecond-level display group under spec.modelGroup
spec.capabilitystring/objectNoSummary shown below the model name. Published models use the publication object's description field. Omit or leave empty to show only the name; selectors do not display the real model ID.
spec.modelConfigobjectYesModel configuration object
spec.modelConfig.envobjectYesEnvironment variables configuration
spec.modelConfig.uiobjectNoWework model-picker presentation, default-model, and reasoning-effort configuration.
spec.modelConfig.visionSidecarModelobjectNoExplicit reference to the model that processes images; omission disables vision delegation.
spec.protocolstringNoUpstream protocol (openai, openai-responses, claude, ...). Inferred from env.model when omitted.
spec.apiFormatstringNoUpstream API format (responses, chat/completions, ...). Derived from spec.protocol when omitted.
spec.isWeworkAvailablebooleanNoWhether the model is distributed to the wework desktop client.

Wework model-picker configuration​

Decision models set spec.modelType: decision and explicitly declare spec.protocol: systemone or openai, without a chat apiFormat. Provider URL, model ID and credentials remain in spec.modelConfig.env. Enable isWeworkAvailable to select them in the decision workbench. See Decision Models.

Cloud models can provide model-picker metadata through modelConfig.ui. Mark the default model with defaultModel: true, and declare its supported reasoning efforts with reasoningEfforts and defaultReasoningEffort. The default model can also provide multiple named model sets through sliderModelsConfig.presets. Every preset with at least one available slider position is displayed, and defaultPreset selects the initially active model set.

Each preset has a stable unique name, a first-line label, and an ordered models list. An optional description configures the second line. Without a description, the default preset falls back to "Recommended model set" and other presets fall back to "Model set". modelName identifies a Model resource name or model ID. For ambiguous names, provide modelType, namespace, and resourceUserId as the complete resource identity. Presets appear directly under their top-level source, such as "Cloud models", before model-family subgroups. An entry that omits both reasoningEffort and reasoningEfforts selects only the model without setting a reasoning effort; the model need not declare reasoning efforts. Explicitly requested efforts must be supported by the target model; declare them through its own modelConfig.ui.reasoningEfforts. Invisible or unavailable models and unsupported efforts are removed from the preset. The remaining preset is still displayed when at least one valid position remains, and is hidden only when no valid positions remain.

spec:
isWeworkAvailable: true
modelConfig:
env:
model: openai
model_id: cloud-sol-upstream
ui:
family: cloud-openai
modelLabel: Cloud Sol
defaultModel: true
reasoningEfforts: [low, medium, high]
defaultReasoningEffort: medium
sliderModelsConfig:
defaultPreset: recommended
presets:
- name: recommended
label: Recommended
description: Recommended for everyday work
models:
- modelName: cloud-luna
reasoningEffort: high
- modelName: cloud-sol
reasoningEfforts: [low, medium, high]
- name: quality
label: Quality
description: Prioritize quality
models:
- modelName: cloud-terra
reasoningEfforts: [medium, high]

Vision delegation model reference​

A text-only model can explicitly reference another image-capable model in modelConfig.visionSidecarModel. The reference must use the complete resource identity and apiFormat returned by the Backend's authorized model list. The reference is authoritative: Wework only validates its shape, while the Backend's LLM gateway resolves and authorizes the target at call time using the same identity headers. Referencing a model that never declared supportsImage, or one that is not distributed to Wework, therefore still works. Wework never selects a default vision model from sign-in state or model names. A malformed reference leaves the primary model text-only with no image preprocessing; a reference whose target is missing or cannot read images replaces that image with an explicit failure message, so the original image never leaks to the text-only primary model.

The Wegent web vision model dropdown only lists candidates that declare modelCapabilities.supportsImage: true, so image-capable models should carry that field. When an existing reference points at a model outside that candidate list, the dropdown keeps the reference and marks it as currently unselectable, so saving the model does not discard it.

apiFormat must match the upstream protocol the referenced model actually speaks: openai-responses, openai-chat-completions, or anthropic-messages. Most Model CRDs only declare spec.modelConfig.env.model, in which case the protocol is inferred from that field (claude maps to Anthropic Messages, openai maps to OpenAI Chat Completions).

spec:
protocol: openai-responses
apiFormat: responses
modelConfig:
env:
model: openai
model_id: deepseek-v4-pro
base_url: https://example.com/v1
api_key: ${WECODE_USER_API_KEY}
visionSidecarModel:
modelName: openai-gpt-5.6-luna
modelType: public
namespace: default
resourceUserId: 0
apiFormat: openai-responses
FieldTypeRequiredDescription
modelNamestringYesReferenced Model's metadata.name.
modelTypestringYesResource source: public, user, or group.
namespacestringYesReferenced Model's namespace.
resourceUserIdintegerYesResource owner ID of the referenced Model.
apiFormatstringYesopenai-responses, openai-chat-completions, or anthropic-messages.

Model Selector Grouping​

Model selectors display models as modelGroup → modelSubGroup → model. These fields are stored in spec, not metadata.labels, so grouping is part of the Model resource definition. Models without these fields are shown under the default ungrouped/uncategorized buckets. Grouping only affects display and search behavior; it does not change model protocol, credentials, permissions, or runtime selection.

Common Environment Variables for ClaudeCode​

Variable NameDescriptionExample Value
ANTHROPIC_MODELMain model configurationopenrouter,anthropic/claude-sonnet-4
ANTHROPIC_BASE_URLAPI base URLhttp://xxxxx
ANTHROPIC_AUTH_TOKENAuthentication tokensk-xxxxxx
ANTHROPIC_DEFAULT_HAIKU_MODELFast model configurationopenrouter,anthropic/claude-haiku-4.5

🐚 Shell​

Shell defines the agent's runtime environment, specifying the runtime type, base image, and supported models.

Complete Configuration Example​

apiVersion: agent.wecode.io/v1
kind: Shell
metadata:
name: ClaudeCode
namespace: default
labels:
type: local_engine
spec:
shellType: ClaudeCode
supportModel: []
baseImage: ghcr.io/wecode-ai/wegent-base-python3.12:1.0.1
status:
state: Available

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Shell
metadata.namespacestringYesNamespace, typically default
metadata.labelsobjectNoLabels for categorization, e.g., type: local_engine or type: external_api
spec.shellTypestringYesShell type, such as ClaudeCode, Agno, Dify
spec.supportModelarrayNoList of supported model types
spec.baseImagestringNoDocker base image for local engine shells (required for local_engine type)
status.statestringNoShell status: Available or Unavailable

Shell Types​

TypeLabelDescription
ClaudeCodelocal_engineClaude Code runtime, requires baseImage
Agnolocal_engineAgno runtime, requires baseImage
Difyexternal_apiDify external API runtime, no baseImage needed

Labels​

LabelValuesDescription
typelocal_engine, external_apiIndicates whether the shell runs locally or connects to external API

🖥 Device​

Device defines an execution device. Device records are usually created automatically by the local executor, cloud device service, or remote Docker device entrypoint. Users normally should not create them by hand.

Remote Docker Device Example​

apiVersion: agent.wecode.io/v1
kind: Device
metadata:
name: 7b7c9d64-xxxx-xxxx-xxxx-3f70c6f4a931
namespace: default
displayName: alice-remote-a931
spec:
deviceId: 7b7c9d64-xxxx-xxxx-xxxx-3f70c6f4a931
displayName: alice-remote-a931
deviceType: remote
connectionMode: websocket
bindShell: claudecode
isDefault: false
clientIp: 10.0.0.24
runtimeTransferHost: 10.0.0.24
runtimeTransferPort: 17888
capabilities: null
remoteConfig:
provider: docker
image: ghcr.io/wecode-ai/wegent-device:latest
deviceId: 7b7c9d64-xxxx-xxxx-xxxx-3f70c6f4a931
deviceName: alice-remote-a931
backendUrl: https://backend.example.com
createdAt: "2026-06-17T10:00:00"
status:
state: Available

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesDevice resource name, usually the same as spec.deviceId
metadata.namespacestringYesNamespace, typically default
spec.deviceIdstringYesDevice ID used by executor registration and heartbeat
spec.displayNamestringNoDisplay name in the frontend
spec.deviceTypelocal, cloud, remoteYesDevice type; remote means a user-managed Docker container or remote host
spec.connectionModewebsocketYesHow the device connects to the backend
spec.bindShellclaudecode, openclawNoShell runtime bound to the device
spec.isDefaultbooleanNoWhether this is the default device for its type
spec.clientIpstringNoClient IP observed by Backend from the device connection
spec.runtimeTransferHoststringNoExecutor-reported device address reachable from other machines
spec.runtimeTransferPortintegerNoEffective Executor session gateway listening port
spec.capabilitiesarray or nullNoDevice capability tags
spec.cloudConfigobjectNoCloud device metadata, used only by cloud devices
spec.remoteConfigobjectNoRemote device metadata, used only by remote devices

runtimeTransferHost must be reachable from other machines; loopback, unspecified, link-local, and multicast addresses are not used to build device access URLs. The Executor reports runtimeTransferPort; Backend uses the default port 17888 when a legacy Executor does not report it. Backend builds a remote device's browser-facing address from the device address it observes, falling back to runtimeTransferHost, and appends runtimeTransferPort. remoteConfig stores only non-sensitive metadata. The WEGENT_AUTH_TOKEN returned in the remote Docker startup command is a newly created remote device API key and is not written to the Device CRD. backendUrl is the URL the container uses to reach Backend and is derived from the current Backend environment.


🤖 Bot​

Bot is a complete agent instance that combines Ghost, Shell, and Model.

Complete Configuration Example​

apiVersion: agent.wecode.io/v1
kind: Bot
metadata:
name: developer-bot
namespace: default
spec:
ghostRef:
name: developer-ghost
namespace: default
shellRef:
name: ClaudeCode
namespace: default
modelRef:
name: ClaudeSonnet4
namespace: default

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Bot
metadata.namespacestringYesNamespace, typically default
spec.ghostRefobjectYesGhost reference
spec.shellRefobjectYesShell reference
spec.modelRefobjectYesModel reference

Reference Format​

All references follow the same format:

name: "resource-name"
namespace: "default"

👥 Team​

Team defines a collaborative team of multiple Bots, specifying member roles and collaboration patterns.

Complete Configuration Example for ClaudeCode Model​

apiVersion: agent.wecode.io/v1
kind: Team
metadata:
name: dev-team
namespace: default
spec:
members:
- role: "leader"
botRef:
name: developer-bot
namespace: default
prompt: ""
contextPassing: "previous_bot"
collaborationModel: "pipeline"

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Team
metadata.namespacestringYesNamespace, typically default
spec.membersarrayYesList of team members
spec.collaborationModelstringYesCollaboration model

Member Configuration​

FieldTypeRequiredDescription
rolestringNoMember role, such as leader
botRefobjectYesBot reference
promptstringNoMember-specific prompt
contextPassingstringNoMessage passed to the next pipeline stage after this stage completes: none, original_user, previous_bot, original_and_previous

Collaboration Models​

ModelDescription
pipelinePipeline mode, execute in sequence
routeRoute mode, route based on conditions
coordinateCoordinate mode, members coordinate
collaborateConcurrent mode, members execute simultaneously

📚 KnowledgeBase​

KnowledgeBase is used to manage document knowledge bases, retrieval configuration, and summary capabilities.

Retrieval Configuration​

FieldTypeRequiredDescription
spec.retrievalConfigobjectNoRAG retrieval configuration. Missing or null means the knowledge base has no RAG configuration
spec.retrievalConfig.retriever_namestringYes*Retriever name
spec.retrievalConfig.retriever_namespacestringNoNamespace where the retriever is defined, defaults to default
spec.retrievalConfig.embedding_config.model_namestringYes*Embedding model name
spec.retrievalConfig.embedding_config.model_namespacestringNoNamespace where the embedding model is defined, defaults to default
spec.retrievalConfig.retrieval_modestringNoRetrieval mode: vector, keyword, or hybrid
spec.retrievalConfig.top_kintegerNoNumber of results to return
spec.retrievalConfig.score_thresholdnumberNoMinimum relevance threshold
spec.retrievalConfig.hybrid_weightsobjectNoHybrid retrieval weights

retriever_name and embedding_config.model_name are required only when spec.retrievalConfig exists. By default, the backend automatically fills in a missing retriever and embedding model during creation; if the create request explicitly uses no-RAG mode, or if no usable defaults are available, it does not write retrievalConfig. The create request field rag_config_mode expresses creation intent only and is not persisted as a KnowledgeBase YAML field. The persisted stable states are either a complete retrievalConfig or no retrievalConfig.

FieldTypeRequiredDescription
spec.summaryEnabledbooleanNoWhether automatic summary generation is enabled
spec.summaryModelRef.namestringNoSummary model name
spec.summaryModelRef.namespacestringNoNamespace where the summary model is defined
spec.summaryModelRef.typestringNoSummary model type: public, user, or group

Runtime Summary Fields​

spec.summary is maintained by the system at runtime and is not intended to be authored directly in YAML. Common fields include:

FieldDescription
short_summaryAI-generated short summary
long_summaryAI-generated long summary
manual_long_summaryManually edited knowledge base long summary; takes priority for display and context injection
topicsAI-generated topic tags
statusSummary state: pending, generating, completed, failed
manual_updated_atLast manual summary update time
manual_updated_byLast manual summary editor

Notes:

  • Manual summary does not stop AI summary generation from continuing
  • When manual_long_summary exists, the system uses it first for UI display and chat-context injection
  • After using Restore AI Summary, the system falls back to the latest long_summary

Code wiki fields​

A knowledge base with spec.kbType = "code_wiki" is generated by an agent from a source repository. Every field below is written by the system and should not be edited by hand.

FieldTypeDescription
spec.kbTypestringnotebook, classic or code_wiki. Cannot move into or out of code_wiki
spec.source.sourceTypestringgithub, gitlab or gitea
spec.source.sourceUrlstringRepository URL, derived at creation with any credentials stripped
spec.source.projectNamestringowner/repo
spec.source.sourceDomainstringRepository host
spec.publishedGenerationIdintegerSole authority for which version is live; 0 when nothing is
spec.lastPublishedAtstringWhen that version was published, written with the pointer
spec.lastPublishedCommitstringCommit the live version documents
spec.pageOrderarrayPage paths in display order; hierarchy comes from the paths, order only from here
spec.pendingIndexCleanuparrayVector store references owed for removed pages, retried at the next publish

Invariants:

  • publishedGenerationId is the only authority. Never infer the live version from the newest completed generation: one can finish and still be refused by the publish gate.
  • Ownership is the creator, in the default namespace. Owning it is what makes the ordinary knowledge base ACL apply; repository access separately decides who may create one and who may regenerate it.
  • One repository has one wiki, enforced by the UNIQUE on wiki_projects.source_url.
  • Generated pages carry origin = generated; the projection only adds and removes those, so user content is never touched.

🤝 Collaboration​

Collaboration defines the interaction patterns and workflows between Bots in a Team.

Complete Configuration Example for ClaudeCode​

apiVersion: agent.wecode.io/v1
kind: Collaboration
metadata:
name: workflow-collaboration
namespace: default
spec:
type: "workflow"
config:
steps:
- name: "planning"
participants:
- "planner-bot"
- name: "development"
participants:
- "developer-bot"
- name: "review"
participants:
- "reviewer-bot"

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Collaboration
metadata.namespacestringYesNamespace, typically default
spec.typestringYesCollaboration type
spec.configobjectYesCollaboration configuration

Workflow Configuration​

FieldTypeDescription
stepsarrayList of workflow steps
steps.namestringStep name
steps.participantsarrayList of participants

💼 Workspace​

Workspace defines the team's working environment, including code repository and branch information.

Complete Configuration Example​

apiVersion: agent.wecode.io/v1
kind: Workspace
metadata:
name: project-workspace
namespace: default
spec:
repository:
gitUrl: "https://github.com/user/repo.git"
gitRepo: "{user}/{repo}"
branchName: "main"
gitDomain: "github.com"

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Workspace
metadata.namespacestringYesNamespace, typically default
spec.repositoryobjectYesRepository configuration

Repository Configuration​

FieldTypeRequiredDescription
gitUrlstringYesGit repository URL
gitRepostringYesRepository path format
branchNamestringYesDefault branch name
gitDomainstringYesGit domain

🎯 Task​

Task defines the task to be executed, associating Team and Workspace.

Complete Configuration Example​

apiVersion: agent.wecode.io/v1
kind: Task
metadata:
name: implement-feature
namespace: default
spec:
title: "Implement new feature"
prompt: "Task description"
teamRef:
name: dev-team
namespace: default
workspaceRef:
name: project-workspace
namespace: default
knowledgeBaseScopes:
- id: 101
namespace: default
name: Product Docs
scopeRestricted: true
folderIds: [12]
explicitDocumentIds: null
includeSubfolders: true
externalKnowledgeRefs:
- provider: ap
mode: explicit
id: kb-1
name: External Product Docs
scope: organization
target_type: document
node_id: document:node-1
document_id: node-1
target_name: api-reference.md

Field Description​

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Task
metadata.namespacestringYesNamespace, typically default
spec.titlestringYesTask title
spec.promptstringYesTask description
spec.teamRefobjectYesTeam reference
spec.workspaceRefobjectYesWorkspace reference
spec.knowledgeBaseScopesarrayNoKnowledge-base access scopes bound by /api/v1/responses, used to inherit folder/document scope in follow-up turns
spec.externalKnowledgeRefsarrayNoTask-level external knowledge source bindings maintained by chat context selection and the task knowledge management entry

Knowledge Base Scopes​

spec.knowledgeBaseScopes is maintained automatically by the OpenAPI Responses knowledge-base tool. When a folder or document scope is enabled, follow-up requests with previous_response_id inherit the scope and re-resolve folder membership for the current turn.

FieldTypeRequiredDescription
idintegerNoKnowledge base ID, preferred when present
namespacestringNoKnowledge base namespace, defaults to default
namestringYesKnowledge base name
scopeRestrictedbooleanNoWhether access is restricted to the listed folders or documents
folderIdsarrayNoAllowed folder IDs. 0 means documents directly under the root folder
explicitDocumentIdsarrayNoExplicitly allowed document IDs
includeSubfoldersbooleanNoWhether folder scope includes subfolders, defaults to true

External Knowledge Source Bindings​

spec.externalKnowledgeRefs is a runtime field describing the external knowledge sources bound to the current Task. It is maintained by chat send handling and the task knowledge management APIs. It is not used for Ghost, Bot, or Team default configuration.

FieldTypeRequiredDescription
providerstringYesExternal knowledge provider id
modestringNoBinding mode, defaults to explicit; explicit requires id
idstringConditionallyStable provider-owned source ID
namestringNoSource display name
scopestringNoProvider-interpretable scope
target_typestringNoknowledge_base, folder, or document; missing values are treated as whole-source bindings
node_idstringNoProvider-neutral node ID
document_idstringNoProvider-neutral document ID
parent_idstringNoProvider-neutral parent node ID
target_namestringNoFolder or document target display name

Task Status​

StatusDescription
PENDINGWaiting for execution
RUNNINGCurrently executing
COMPLETEDExecution completed
FAILEDExecution failed
CANCELLEDExecution cancelled
DELETETask deleted

🔌 ConnectorApp​

ConnectorApp defines an external app connection published by administrators for Wework/Codex. Resources are stored in the kinds table, metadata.name is the app slug, and the current namespace is system. In normal operation, maintain these resources through System Administration → App Connections in Wegent Web instead of hand-writing YAML.

Complete Example​

apiVersion: agent.wecode.io/v1
kind: ConnectorApp
metadata:
name: ticket-api
namespace: system
displayName: Ticket API
spec:
name: Ticket API
description: Search and read internal tickets
iconUrl: https://example.com/ticket-icon.png
enabled: true
visibility: roles
allowedRoles:
- admin
authType: none
transport: http
mcpUrl: https://tickets.example.com/api
providerHeadersEncrypted: "base64-encrypted-json"
toolAllowlist:
- get_ticket
httpTools:
- name: get_ticket
description: Get one ticket
method: GET
path: /tickets/{id}
input_schema:
type: object
properties:
id:
type: string
required:
- id
argument_locations:
id: path
timeout_seconds: 30

Field Reference​

FieldTypeRequiredDescription
metadata.namestringYesUnique Connector App slug, also used as the tool-name prefix
metadata.namespacestringYesCurrently system
spec.namestringYesDisplay name
spec.descriptionstringNoApp description
spec.iconUrlstringNoIcon URL
spec.enabledbooleanYesWhether the app is enabled; disabled apps are hidden from catalogs/runtime
spec.visibilitystringYesall or roles
spec.allowedRolesarrayNoUser roles allowed when visibility: roles
spec.authTypestringYesCurrently only none is supported
spec.transportstringYesstreamable-http, sse, or http
spec.mcpUrlstringYesMCP endpoint or HTTP API base URL
spec.providerHeadersEncryptedstringNoFixed provider headers JSON encrypted with the project sensitive-data tool
spec.toolAllowlistarrayNoUpstream tool names allowed for discovery and invocation
spec.httpToolsarrayConditionallyRequired for transport: http; maps ordinary HTTP APIs to MCP tools

providerHeadersEncrypted must be an encrypted JSON string. The administrator API accepts plaintext provider_headers and encrypts them before storage; do not commit plaintext API keys, service tokens, or headers in hand-written YAML.


Best Practices​

1. Naming Conventions​

  • Use lowercase letters, numbers, and hyphens
  • Avoid special characters and spaces
  • Names should be descriptive

2. Namespaces​

  • Use default namespace by default
  • Use different namespaces in multi-tenant environments

3. Reference Management​

  • Ensure referenced resources exist
  • Use the same namespace
  • Avoid circular references

4. Status Management​

  • Regularly check resource status
  • Handle unavailable resources promptly
  • Monitor task execution progress

5. Configuration Validation​

  • Use YAML syntax validation tools
  • Check required fields
  • Validate reference relationships