Implementation:0xsline OpenChatCut Copilot Agent Contract
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Agent, Copilot, Types |
| Last Updated | 2026-10-22 14:00 GMT |
Overview
Shared contract for GitHub Copilot agent communication, defining turn request/response types and stream events.
Description
The Copilot Agent Contract module defines shared types for Copilot agent communication: `CopilotTurnRequest`, `CopilotTurnStreamEvent`, `CopilotToolResultRequest`, and related interfaces.
Usage
- Copilot agent:*** Shared types between server and agent plugin.
Code Reference
Source Location
- Repository:*** OpenChatCut
- File:*** shared/copilot-agent.ts
- Lines:*** 1-95
Signature
export interface CopilotTurnRequest {
prompt: string;
tools: CodexAgentToolSpec[];
}
export type CopilotTurnStreamEvent =
| { type: 'text'; text: string }
| { type: 'tool_request'; toolCallId: string; name: string; args: unknown }
| { type: 'done'; summary: string }
| { type: 'error'; message: string };
Import
import type { CopilotTurnRequest, CopilotTurnStreamEvent } from '../shared/copilot-agent.ts';
I/O Contract
This module exports types only.
Usage Examples
Using Copilot Types
import type { CopilotTurnRequest } from '../shared/copilot-agent.ts';
function startTurn(req: CopilotTurnRequest) { /* ... */ }
Related Pages
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment