@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
20 lines • 752 B
JavaScript
export function createModuleHost(signal, send) {
return {
signal,
call: (name, args) => send("tool", name, args),
complete: (args) => send("completion", undefined, args),
reserved: (name, args) => send("reserved", name, args),
listTools: () => send("list_tools", undefined, undefined),
authorize: (request) => send("authorize", undefined, request),
withFileLock: async (path, fn) => {
const { lockId } = (await send("lock_file", undefined, { path }));
try {
return await fn();
}
finally {
await send("unlock_file", undefined, { lockId });
}
},
};
}
//# sourceMappingURL=module-host.js.map