chore: checkpoint browser tooling and routing updates

This commit is contained in:
William Valentin
2026-02-17 15:18:37 -08:00
parent 0a4cfda787
commit 9a2f1e2bb2
15 changed files with 499 additions and 67 deletions
+40
View File
@@ -17,6 +17,17 @@ export interface ToolUseEvent {
result?: ToolResult;
}
export interface ToolInventorySnapshot {
sessionId: string;
agent: string;
provider: string;
skill: string;
internalCount: number;
exposedCount: number;
internalBrowser: string[];
exposedBrowser: string[];
}
export interface NativeAgentConfig {
modelClient: ModelClient | ModelRouter;
systemPrompt: string;
@@ -453,6 +464,35 @@ export class NativeAgent {
return this._toolPolicyContext;
}
getToolInventorySnapshot(): ToolInventorySnapshot {
if (!this.toolRegistry) {
return {
sessionId: '-',
agent: '-',
provider: '-',
skill: '-',
internalCount: 0,
exposedCount: 0,
internalBrowser: [],
exposedBrowser: [],
};
}
const internal = this.toolRegistry.filteredList(this._toolPolicyContext).map((tool) => tool.name);
const exposed = this.toolRegistry.filteredToAnthropicFormat(this._toolPolicyContext).map((tool) => tool.name);
const context = this._toolPolicyContext;
return {
sessionId: context?.sessionId ?? '-',
agent: context?.agent ?? '-',
provider: context?.provider ?? '-',
skill: context?.skillName ?? '-',
internalCount: internal.length,
exposedCount: exposed.length,
internalBrowser: internal.filter((name) => name.startsWith('browser.')),
exposedBrowser: exposed.filter((name) => name.startsWith('browser_')),
};
}
setAttachmentCollector(collector: OutboundAttachmentCollector | undefined): void {
this._attachmentCollector = collector;
}