refactor(coding-agent): simplify extension runtime architecture
- Replace per-extension closures with shared ExtensionRuntime - Split context actions: ExtensionContextActions (required) + ExtensionCommandContextActions (optional) - Rename LoadedExtension to Extension, remove setter methods - Change runner.initialize() from options object to positional params - Derive hasUI from uiContext presence (no separate param) - Add warning when extensions override built-in tools - RPC and print modes now provide full command context actions BREAKING CHANGE: Extension system types and initialization API changed. See CHANGELOG.md for migration details.
This commit is contained in:
@@ -784,15 +784,18 @@ interface CreateAgentSessionResult {
|
||||
// The session
|
||||
session: AgentSession;
|
||||
|
||||
// Custom tools (for UI setup)
|
||||
customToolsResult: {
|
||||
tools: LoadedCustomTool[];
|
||||
setUIContext: (ctx, hasUI) => void;
|
||||
};
|
||||
// Extensions result (for runner setup)
|
||||
extensionsResult: LoadExtensionsResult;
|
||||
|
||||
// Warning if session model couldn't be restored
|
||||
modelFallbackMessage?: string;
|
||||
}
|
||||
|
||||
interface LoadExtensionsResult {
|
||||
extensions: Extension[];
|
||||
errors: Array<{ path: string; error: string }>;
|
||||
runtime: ExtensionRuntime;
|
||||
}
|
||||
```
|
||||
|
||||
## Complete Example
|
||||
|
||||
Reference in New Issue
Block a user