copilot_sdk_dart 0.1.2
copilot_sdk_dart: ^0.1.2 copied to clipboard
Community-maintained Dart SDK for the GitHub Copilot CLI agent runtime. Unofficial and not affiliated with GitHub or Microsoft.
0.1.2 #
- Renamed main library file from
copilot_sdk.darttocopilot_sdk_dart.dartto follow Dart package layout conventions (main library matches package name). - Added missing dartdoc for
TcpTransportconstructor,host,port,connectionTimeout, andAbortEvent.
0.1.1 #
-
Fix: ContentLengthCodec false positive header size check
- The header size guard checked total buffer length before extracting the header
separator. During streaming responses with large stdout chunks (header + body >
16KB), the guard fired falsely, throwing
FormatExceptionand closing the session stream. Now only enforces the limit on actual header bytes (before\r\n\r\nseparator).
- The header size guard checked total buffer length before extracting the header
separator. During streaming responses with large stdout chunks (header + body >
16KB), the guard fired falsely, throwing
-
Fix: Wire
JsonRpcConnection.onErrorin CopilotClient- Decoder and transport errors were silently dropped because
connection.onErrorwas never assigned. Now routes tooptions.onErrorcallback.
- Decoder and transport errors were silently dropped because
-
Fix: Record CLI process exit code in StdioTransport
- Added
lastExitCodefield andonProcessExitcallback for immediate notification when the CLI process terminates.
- Added
-
Added decoder error logging to StdioTransport stderr buffer.
-
Feature parity with upstream Node.js SDK v0.1.8
-
P0 wire-format bug fixes:
- Fixed
SelectionPosition.column→characterto match upstream wire format - Fixed
MessageOptions.modeto useMessageDeliveryMode(enqueue/immediate) instead ofAgentMode - Fixed
SessionLifecycleEventType.fromString()to handlesession.prefix (CLI sends"session.created") - Rewrote all hook types to match upstream field names:
decision→permissionDecision,updatedArguments→modifiedArgs,updatedResult→modifiedResult,updatedPrompt→modifiedPrompt - Added
BaseHookInputwithtimestamp/cwdfields, all hook inputs extend it - Added
SessionStartOutput,SessionEndOutput,ErrorOccurredOutputtypes - Added
additionalContext/suppressOutputto all hook outputs
- Fixed
-
P1 features:
- Added dynamic handler registration:
registerPermissionHandler(),registerUserInputHandler(),registerHooks() - Added
autoStart— sessions auto-callstart()whenautoStart: true(default) - Added
sendMessage(MessageOptions)overload matching upstream API
- Added dynamic handler registration:
-
Added
workspacePathtoCopilotSession(returned from session.create/resume) -
Added agent management RPCs:
listAgents(),getCurrentAgent(),selectAgent(),deselectAgent() -
Added compaction RPC:
compact()→CompactionResult -
Added client methods:
forceStop(),getLastSessionId(),getForegroundSessionId(),setForegroundSessionId() -
Added lifecycle event subscription:
onLifecycleEvent()with typed filtering -
Fixed session.create to include capability flags (
requestPermission,requestUserInput,hooks,envValueMode) -
Fixed
mcpServerswire format fromListtoMap<String, McpServerConfig>(matches upstream) -
Fixed
resumeSession()to forward all config fields (was only sendingsessionId) -
Refactored
McpServerConfigto sealed hierarchy:McpLocalServerConfig/McpRemoteServerConfig -
Refactored
Attachmentto sealed hierarchy:FileAttachment/DirectoryAttachment/SelectionAttachment -
Added
InfiniteSessionConfigclass (replacesbool?forinfiniteSessions) -
Added
ToolBinaryResultfor binary tool results -
Added
AgentInfo,CompactionResult,SessionLifecycleEventtypes -
Added
AzureProviderOptions,wireApi,bearerTokentoProviderConfig -
Added
ReasoningEffort.xhighenum value -
Added structured
kind/toolCallIdfields toPermissionRequest -
Expanded
ResumeSessionConfigto 22 fields matching upstream -
Added
registerTools()batch convenience method toCopilotSession -
45+ session event types (up from 25)
0.1.0 #
- Initial release
- JSON-RPC 2.0 transport layer with Content-Length framing
- Pluggable transports: stdio, TCP, WebSocket
CopilotClientwith process lifecycle managementCopilotSessionwith event handling and tool dispatch- 25+ typed session events using Dart 3 sealed classes
- Custom tool registration with typed results
- 6 lifecycle hooks (preToolUse, postToolUse, userPromptSubmitted, sessionStart, sessionEnd, errorOccurred)
- Permission and user input request handlers
- Session RPC: model, mode, plan, workspace, fleet
- Full serialization/deserialization for all protocol types
- Comprehensive test suite (317+ tests)