mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 16:00:58 +00:00
Update plan: HookCommandContext without sendMessage (use pi closure)
This commit is contained in:
parent
60130a4c53
commit
09e7e9196c
5 changed files with 22 additions and 27 deletions
|
|
@ -28,9 +28,9 @@ import {
|
|||
import type { LoadedCustomTool, SessionEvent as ToolSessionEvent } from "./custom-tools/index.js";
|
||||
import { exportSessionToHtml } from "./export-html.js";
|
||||
import {
|
||||
type CommandContext,
|
||||
type ExecOptions,
|
||||
execCommand,
|
||||
type HookCommandContext,
|
||||
type HookMessage,
|
||||
type HookRunner,
|
||||
type SessionEventResult,
|
||||
|
|
@ -512,18 +512,13 @@ export class AgentSession {
|
|||
|
||||
// Build command context
|
||||
const cwd = process.cwd();
|
||||
const ctx: CommandContext = {
|
||||
const ctx: HookCommandContext = {
|
||||
args,
|
||||
ui: uiContext,
|
||||
hasUI: this._hookRunner.getHasUI(),
|
||||
cwd,
|
||||
sessionManager: this.sessionManager,
|
||||
modelRegistry: this._modelRegistry,
|
||||
sendMessage: (message, triggerTurn) => {
|
||||
this.sendHookMessage(message, triggerTurn).catch(() => {
|
||||
// Error handling is done in sendHookMessage
|
||||
});
|
||||
},
|
||||
exec: (cmd: string, cmdArgs: string[], options?: ExecOptions) => execCommand(cmd, cmdArgs, cwd, options),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue