Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.profy.cn/llms.txt

Use this file to discover all available pages before exploring further.

Task Orchestration

The task system manages the full lifecycle of user-submitted work requests — from creation through agent dispatch to paid result delivery. Tasks bridge the gap between user intent and AI agent execution.

Overview

Task Lifecycle

Every task progresses through a defined state machine:

Task States

StateDescription
PENDINGTask created, not yet submitted for processing
RUNNINGSubmitted to agent engine, awaiting result
COMPLETEDAgent returned a result, available for viewing
FAILEDAgent processing encountered an error
CANCELLEDTask deleted by user before completion

Payment States

StateDescription
UNPAIDResult available but not yet purchased
PAIDUser paid coins to unlock full result
REFUNDEDPayment reversed

API Endpoints

MethodEndpointDescription
POST/api/task/createCreate a new task
POST/api/task/submitSubmit task to agent for processing
POST/api/task/listList user’s tasks with pagination
POST/api/task/resultGet task result (preview or full)
POST/api/task/payPay coins to unlock full result
POST/api/task/renameRename a task
POST/api/task/pinPin/unpin a task
POST/api/task/deleteDelete (cancel) a task
All endpoints require JWT authentication.

Agent Dispatch

When a task is submitted, the Core API dispatches it to the configured agent engine.

Configuration

Environment VariableDescription
AGENT_INVOKE_URLURL of the agent engine’s task intake endpoint
When AGENT_INVOKE_URL is not configured, the system enters test mode — tasks complete immediately with mock data, useful for development and testing.

Agent Callback

The agent engine reports results asynchronously via:
POST /internal/task/callback
This is an internal-only route, accessible only from the private network. The callback payload includes the task identifier, result data, and success/failure status.

Pay-to-View Model

Task results use a two-tier visibility model:
Access LevelContentAuth Required
PreviewresultPreview — summary or truncated resultJWT (task owner)
FullresultFull — complete result dataJWT + PAID status

Task Management

Beyond the core lifecycle, users can organize their tasks:
ActionEndpointDescription
RenamePOST /api/task/renameChange task display name
PinPOST /api/task/pinPin/unpin for quick access
DeletePOST /api/task/deleteCancel and remove a pending task
ListPOST /api/task/listPaginated list with filters

File Attachments

Tasks can reference files stored in MinIO. The file service provides:
MethodEndpointDescription
POST/api/file/uploadUpload file to MinIO
GET/api/file/download/:fileUuidDownload a file
DELETE/api/file/:fileUuidDelete a file

Finance & Payments

Coin consumption powers the pay-to-view model

Agent Platform

AutoClaw agents process submitted tasks