Interface ContractProvider
- All Known Implementing Classes:
SessionBridge
public interface ContractProvider
Backing data for the
/agentscope/* HTTP contract, implemented by the bridge.
Every method returns JSON-serializable maps and lists. Throwing ContractProvider.NotFoundException maps
to 404 and UnsupportedOperationException to 501; anything else becomes a 500.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classSignals the session is busy and the caller should wait until idle.static classSignals that the requested session or resource does not exist on this instance.static classSignals a missing or invalid internal token on a write endpoint. -
Method Summary
Modifier and TypeMethodDescriptionvoidAborts the current turn without terminating the session.default voidcancelSubagentTask(String sessionId, String taskId) Cancel a background subagent task.voidexportTranscript(String sessionId) Optional transcript export.info()default voidEnter/exit plan mode.default voidpostMessage(String sessionId, byte[] body) Inject a user message into the live session.default StringsessionPhase(String sessionId) Current phase string for command success responses.sessions()sessionState(String sessionId) subagentTasks(String sessionId) Background subagent tasks (not todolist).Session task inventory.void
-
Method Details
-
info
-
sessions
-
sessionState
-
context
-
messages
-
subagents
-
workspaces
-
compress
-
terminate
-
abort
Aborts the current turn without terminating the session. Capability:session-abort. -
tasks
Session task inventory. Capability:task-query. Returns a map with ataskslist. -
subagentTasks
Background subagent tasks (not todolist). Capability:subagent-task-query. -
cancelSubagentTask
Cancel a background subagent task. Capability:subagent-task-command. -
planMode
Enter/exit plan mode. Body is JSON{"active":true|false}. Capability:plan-mode. -
postMessage
Inject a user message into the live session. Body is JSON{"content":"..."}. Busy sessions should throwContractProvider.BusyException. -
exportTranscript
Optional transcript export. Capability:export-transcript. -
sessionPhase
Current phase string for command success responses.
-