mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-09-18 01:34:44 -04:00
agent: fold the browser quartet onto lp.ToolSession
Agent held the same Browser/Session/Notification/registry fields and teardown order as mcp/Server.zig, plus its own "enableConsoleCapture after every newSession" for /reset. ToolSession.restartSession() owns that now; init is written in terms of it. Claude-Session: https://claude.ai/code/session_01M6WGk8wZSE28efFQkYT9SK
This commit is contained in:
1 parent
dadbae121c
commit
0865f4e337
2 files changed
+29
-38
No files matched your search
@@ -46,6 +46,12 @@ pub fn init(self: *ToolSession, app: *App) !void {
|
||||
try self.browser.init(app, .{}, null);
|
||||
errdefer self.browser.deinit();
|
||||
|
||||
try self.restartSession();
|
||||
}
|
||||
|
||||
/// Replace the session with a fresh one on the same browser: page, cookies,
|
||||
/// storage and history gone. The old `session` pointer is invalid afterwards.
|
||||
pub fn restartSession(self: *ToolSession) !void {
|
||||
self.session = try self.browser.newSession(self.notification);
|
||||
try self.session.enableConsoleCapture();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user