mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 05:03:26 +00:00
feat(coding-agent): add extension compaction helpers
This commit is contained in:
parent
673916f63c
commit
9d3f8117a4
11 changed files with 190 additions and 4 deletions
|
|
@ -294,6 +294,18 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|||
shutdown: () => {
|
||||
shutdownRequested = true;
|
||||
},
|
||||
getContextUsage: () => session.getContextUsage(),
|
||||
compact: (options) => {
|
||||
void (async () => {
|
||||
try {
|
||||
const result = await session.compact(options?.customInstructions);
|
||||
options?.onComplete?.(result);
|
||||
} catch (error) {
|
||||
const err = error instanceof Error ? error : new Error(String(error));
|
||||
options?.onError?.(err);
|
||||
}
|
||||
})();
|
||||
},
|
||||
},
|
||||
// ExtensionCommandContextActions - commands invokable via prompt("/command")
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue