@robota-sdk/agent-core 3.0.0-beta.81 → 3.0.0-beta.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
7
7
 
8
8
  `),n.beginAssistant();let b=Ba(),{wrappedOnTextDelta:x,wrappedOnProviderNativeRawPayload:S}=Ma(a,n,i,p),C=ua(s,o.defaultModel.model,i),w=await Na(_,o,s,f,a,n,p,i,b,u,x,S,t=>void(e.providerFailure=t),C);if(w===null)return!0;let{assistantResponse:T,assistantToolCalls:E}=va(w,i,a.conversationId,p,u);if(E.length>0&&(a.toolChoice??o.defaultModel?.toolChoice)===`none`)throw Error(`Provider returned tool calls despite toolChoice none; no tools were executed.`);await J(l,`afterProviderCall`,{messages:m,responseMessage:w},u),await J(l,`onMessageAdded`,{message:w},u);let ee=typeof T.content==`string`&&T.content.trim().length>0;if(E.length===0&&!ee)return u.warn(`[ROUND] Provider returned empty assistant response without tool calls`,{executionId:i,conversationId:a.conversationId,round:p}),n.discardPending(),!0;let te=Va(T),ne=te?.inputTokens??0;ne>0&&(e.cumulativeInputTokens=ne);for(let e of E)n.appendToolCall(e);let re=a.signal?.aborted?`interrupted`:`complete`;n.commitAssistant(re,{round:p,usageObservationId:b,executionId:i,providerId:Y(C,s),modelId:X(C,s.aiProviderInfo.model),...te??{}});let ie=n.getMessages().at(-1);if(a.onExecutionEvent?.(`assistant_message_committed`,{executionId:i,conversationId:a.conversationId,round:p,message:T}),ie&&a.onExecutionEvent?.(`history_mutation`,{executionId:i,conversationId:a.conversationId,round:p,mutation:`append_message`,index:n.getMessages().length-1,message:ie}),e.runningAssistantCount++,e.lastTrackedAssistantMessage=T,E.length===0)return u.debug(`[AGENT-FLOW-CONTROL] Round ${p} completed - no tool calls, execution finished for agent ${a.conversationId}`),d.emitAssistantMessageComplete(T,i,p,r,v,y),!0;let ae=await Ra(E,n,r,i,p,v,y,e,c,o,a.signal,a.onExecutionEvent,a.maxSameToolInputs??o.maxSameToolInputs,a.traceContext);if(ae.contextOverflowed&&u.warn(`[ROUND] Tool results partially skipped due to context overflow — continuing to let AI respond`,{added:ae.addedCount,skipped:ae.skippedCount,round:p}),ae.unknownToolFailureCount>0?e.consecutiveUnknownToolFailureRounds+=1:e.consecutiveUnknownToolFailureRounds=0,e.consecutiveUnknownToolFailureRounds>=2){let t=[...new Set(ae.unknownToolNames)].sort();return e.forcedSummaryInstruction=[`The model repeatedly requested unavailable tool(s): ${t.join(`, `)}.`,`Those tool calls were not executed because they are not registered tools.`,`Respond to the user now with that reason and use the available tool results already in the conversation history.`].join(` `),u.warn(`[ROUND] Stopping repeated unavailable tool-call loop`,{unavailableTools:t,consecutiveRounds:e.consecutiveUnknownToolFailureRounds,round:p}),!0}return u.debug(`Round ${p} completed for agent ${a.conversationId}`),!1}function Ua(e,t){let n=t.maxExecutionRounds??e.maxExecutionRounds;if(n===void 0)return 10;if(!Number.isInteger(n)||n<0)throw Error(`[EXECUTION] maxExecutionRounds must be a non-negative integer`);return n}function Wa(e,t){return t===0||e<t}async function Ga(e,t,n,r,i,a,o,s,c){let l=Ua(i,r);for(;Wa(o.currentRound,l)&&!(s?.aborted||(o.currentRound++,await Ha(o,l,e,t,n,r,i,a,c))||s?.aborted););let u=e.getMessages(),d=u.length>0?u[u.length-1]:void 0,f=d?.role===`assistant`&&typeof d.content==`string`&&d.content.length>0&&(!(`toolCalls`in d)||d.toolCalls.length===0);s?.aborted||r.allowToolOnlyCompletion!==!0&&(f||await Oa(e,a,i,n,o,t,r,c.logger,l))}async function Ka(e,t,n,r,i,a,o,s,c,l,u){let d={...Wi(t,n,r,i.toolsExecuted,i.providerFailure),interrupted:o};await J(c,`afterRun`,{input:e,response:d.response,metadata:s?.metadata},l);let f={messages:d.messages,executionContext:{executionId:n,conversationId:a},executionResult:{response:d.response,duration:d.duration,...d.tokensUsed===void 0?{}:{tokensUsed:d.tokensUsed},toolsExecuted:d.toolsExecuted.length,success:d.success,toolCalls:d.toolsExecuted.map(e=>({name:e}))}};for(let e of[`afterExecution`,`afterConversation`,`afterToolExecution`])await J(c,e,f,l);return l.debug(`Execution pipeline completed successfully`,{executionId:n,conversationId:a,duration:d.duration,tokensUsed:d.tokensUsed,toolsExecuted:d.toolsExecuted.length,rounds:i.currentRound}),u.emitExecution(M.COMPLETE,{result:{success:!0,data:d.response.substring(0,100)+`...`},metadata:{method:`execute`,success:!0,duration:d.duration,tokensUsed:d.tokensUsed,toolsExecuted:d.toolsExecuted}},a,n),d}async function*qa(e,t,n,r,i){let a=[],o=null,s=!1,c=null,l={result:null},u=new AbortController,d=r?.signal,f=d?AbortSignal.any([d,u.signal]):u.signal,p=r?.onTextDelta,m=e=>{a.push(e),p?.(e),o?.()},h=i(e,t,n,{...r,signal:f,onTextDelta:m}).then(e=>{l.result=e},e=>{c=e}).finally(()=>{s=!0,o?.()});try{for(;;){for(;a.length>0;)yield a.shift();if(s)break;await new Promise(e=>{o=()=>{o=null,e()}})}if(c!==null)throw c;if(l.result===null)throw Error(`[EXECUTION] streaming turn settled without a result`);return l.result}finally{u.abort(),await h}}function Ja(e,t){return{executionId:e,...t===void 0?{}:{driverId:t}}}var Ya=class{toolExecutionService;aiProviders;tools;conversationHistory;plugins=[];logger;eventEmitter;cacheService;constructor(e,t,n,r,i,a){if(this.toolExecutionService=new Ni(t),this.aiProviders=e,this.tools=t,this.conversationHistory=n,this.plugins=[],this.logger=k(`ExecutionService`),!r)throw Error(`[EXECUTION] EventService is required`);this.eventEmitter=new Hi(r,this.logger,i),this.cacheService=a}setAskHandler(e){this.toolExecutionService.setAskHandler(e)}invokeRuntimeTool(e,t,n){return this.toolExecutionService.executeTool(e,t,n,`registered`)}registerPlugin(e){let t=e.priority??0,n=this.plugins.findIndex(e=>(e.priority??0)<t);n===-1?this.plugins.push(e):this.plugins.splice(n,0,e),this.logger.debug(`Plugin registered`,{pluginName:e.name,priority:t})}removePlugin(e){let t=this.plugins.findIndex(t=>t.name===e);return t===-1?!1:(this.plugins.splice(t,1),this.logger.debug(`Plugin removed`,{pluginName:e}),!0)}getPlugin(e){return this.plugins.find(t=>t.name===e)}getPlugins(){return[...this.plugins]}async execute(e,t,n,r){let i=ia(),a=new Date,o=aa(r,`execute`),s=oa(t,n,a,i,o,r);this.eventEmitter.prepareOwnerPathBases(o),this.logger.debug(`Starting execution pipeline`,{executionId:i,conversationId:o,messageCount:t.length,hasContext:!!r});let c=ea(this.aiProviders,this.tools,n);this.eventEmitter.emitExecutionStartEvent(e,n,t,c,o,i);let l=na(this.conversationHistory,o,t,n,i);try{let t=l.getMessages().length;l.addUserMessage(e,Ja(i,r?.driverId));let u=l.getMessages()[t];u&&s.onExecutionEvent?.(`history_mutation`,{executionId:i,conversationId:o,mutation:`append_message`,index:t,message:u}),this.eventEmitter.emitUserMessageEvent(e,o,i),await J(this.plugins,`beforeRun`,{input:e,...r?.metadata?{metadata:r.metadata}:{}},this.logger);let d={executionId:i,conversationId:o};u&&await J(this.plugins,`onMessageAdded`,{message:u,executionContext:d},this.logger),await J(this.plugins,`beforeExecution`,{messages:l.getMessages(),executionContext:d},this.logger),ta(c);let f={toolsExecuted:[],currentRound:0,runningAssistantCount:0,lastTrackedAssistantMessage:void 0,cumulativeInputTokens:0,consecutiveUnknownToolFailureRounds:0,sameToolInputCounts:new Map};for(let e of l.getMessages())e.role===`assistant`&&(f.runningAssistantCount++,f.lastTrackedAssistantMessage=e);return await Ga(l,o,i,s,n,c,f,r?.signal,{toolExecutionService:this.toolExecutionService,plugins:this.plugins,logger:this.logger,eventEmitter:this.eventEmitter,cacheService:this.cacheService}),Ka(e,l,i,a,f,o,r?.signal?.aborted??!1,r,this.plugins,this.logger,this.eventEmitter)}catch(e){return $e(e,r?.signal)?{response:``,messages:l.getMessages(),executionId:i,duration:Date.now()-a.getTime(),toolsExecuted:[],success:!0,interrupted:!0}:(await ra(e,s,a,o,i,this.plugins,this.logger,this.eventEmitter),{response:``,messages:[],tokensUsed:0,toolsExecuted:[],duration:Date.now()-a.getTime(),executionId:i,success:!1,error:e instanceof Error?e:Error(String(e))})}finally{this.eventEmitter.resetOwnerPathBases()}}async*executeStream(e,t,n,r){return yield*qa(e,t,n,r,this.execute.bind(this))}async getStats(){return{pluginCount:this.plugins.length,pluginNames:this.plugins.map(e=>e.name),historyStats:this.conversationHistory.getStats()}}clearPlugins(){this.plugins=[],this.logger.debug(`All plugins cleared`)}};function Xa(e){let t=new li;if(e.aiProviders)for(let n of e.aiProviders)t.addProvider(n.name,n);return e.defaultModel&&t.setCurrentProvider(e.defaultModel.provider,e.defaultModel.model),t}async function Za(e){let{config:t,aiProviders:n,tools:r,agentFactory:i,conversationHistory:a,moduleRegistry:o,eventEmitter:s,eventService:c,logger:l}=e;if(l.debug(`Starting Robota initialization with independent managers`),await Promise.all([n.initialize(),r.initialize(),i.initialize()]),t.modules){for(let e of t.modules)await o.registerModule(e,{autoInitialize:!0,validateDependencies:!0});l.debug(`Modules registered and initialized`,{moduleCount:t.modules.length,moduleNames:t.modules.map(e=>e.name)})}if(t.tools)for(let e of t.tools)e instanceof Ze&&c&&e.setEventService(c),r.addTool(e.schema,async(t,n)=>{if(!n)throw Error(`[ROBOTA] Missing ToolExecutionContext for tool execution`);let r=await e.execute(t,n);return cr(e.schema.name,r)}),l.debug(`Tool registered during initialization`,{toolName:e.schema.name});let u;t.cache?.enabled&&(u=new fi(new di({maxEntries:t.cache.maxEntries,ttlMs:t.cache.ttlMs}),new ui));let d=new Ya(n,r,a,c,t.executionContext,u);if(t.ask&&d.setAskHandler(t.ask),t.plugins)for(let e of t.plugins)d.registerPlugin(e),e.subscribeToModuleEvents&&(await e.subscribeToModuleEvents(s),l.debug(`Plugin subscribed to module events`,{pluginName:e.name}));return l.debug(`Robota initialization completed successfully with independent managers`),d}async function Qa(e){try{let t=await Za(e.ctx);e.setExecutionService(t),e.setFullyInitialized(!0)}catch(t){throw e.ctx.logger.error(`Robota initialization failed`,{error:t instanceof Error?t.message:String(t)}),t}}function $a(e){let t=e.isFullyInitialized?e.aiProviders.getProviderNames():[],n=e.isFullyInitialized?e.aiProviders.getCurrentProvider():null,r=n?n.provider:null,i=e.isFullyInitialized?e.tools.getTools().map(e=>e.name):[],a=e.getPluginNames(),o=e.getModuleNames(),s=e.getHistory(),c=Date.now()-e.startTime,l={user:0,assistant:0,system:0,tool:0};for(let e of s)e.role in l&&l[e.role]++;return{name:e.name,version:e.version,conversationId:e.conversationId,providers:t,currentProvider:r,tools:i,plugins:a,modules:o,historyLength:s.length,historyStats:{userMessages:l.user,assistantMessages:l.assistant,systemMessages:l.system,toolMessages:l.tool},uptime:c}}async function eo(e){e.logger.debug(`Destroying Robota instance`,{name:e.name});let t=[],n=async(n,r)=>{try{await r(),e.logger.debug(n)}catch(r){let i=r instanceof Error?r:Error(String(r));t.push(i),e.logger.error(`Error during Robota destruction step`,{step:n,error:i.message})}};if(e.isFullyInitialized&&e.moduleRegistry&&await n(`All modules disposed`,()=>e.moduleRegistry.disposeAllModules()),e.executionService){let t=e.executionService.getPlugins();for(let e of t)await n(`Plugin disposed: ${e.name}`,()=>e.dispose());e.logger.debug(`ExecutionService plugins cleaned up`)}return e.moduleRegistry&&await n(`ModuleRegistry cleared`,()=>e.moduleRegistry.clearAllModules()),e.eventEmitter&&await n(`EventEmitter disposed`,()=>e.eventEmitter.dispose()),await n(`Tools disposed`,()=>e.tools.dispose()),await n(`AIProviders disposed`,()=>e.aiProviders.dispose()),e.resetState(),t.length===0?e.logger.info(`Robota instance destroyed successfully`,{name:e.name}):e.logger.warn(`Robota instance destroyed with cleanup failures`,{name:e.name,failureCount:t.length}),{errors:t}}var to=class{tail=Promise.resolve();async acquire(e){let t=this.tail,n=()=>{};if(this.tail=new Promise(e=>{n=e}),await t,e?.aborted)throw n(),Error(`Run aborted while queued behind another run on this instance`);return n}async run(e,t){let n=await this.acquire(e);try{return await t()}finally{n()}}get drained(){return this.tail}};function no(e){return{maxConcurrentAgents:e.maxConcurrentAgents||100,defaultSystemMessage:e.defaultSystemMessage??``,strictValidation:e.strictValidation??!0,idFactory:e.idFactory??io,...e.defaultModel!==void 0&&{defaultModel:e.defaultModel},...e.defaultProvider!==void 0&&{defaultProvider:e.defaultProvider}}}function ro(e,t){if(!e.aiProviders||e.aiProviders.length===0)throw new n.y(`At least one AI provider must be specified in aiProviders array`);let r=e.defaultModel,i=r?.model??t.defaultModel;if(!i)throw new n.y(`No model specified: set config.defaultModel.model or the AgentFactory defaultModel option`);let a=r?.provider??e.aiProviders[0]?.name??t.defaultProvider;if(!a)throw new n.y(`No provider specified: set config.defaultModel.provider, an aiProviders entry, or the AgentFactory defaultProvider option`);return{id:e.id||io(),name:e.name||`Unnamed Agent`,aiProviders:e.aiProviders,defaultModel:{provider:a,model:i,temperature:r?.temperature??.7,...r?.maxTokens!==void 0&&{maxTokens:r.maxTokens},...r?.topP!==void 0&&{topP:r.topP}},systemMessage:e.systemMessage??t.defaultSystemMessage,tools:e.tools||[],plugins:e.plugins||[],metadata:e.metadata||{},...e.logging&&{logging:e.logging},...e.conversationId&&{conversationId:e.conversationId},...e}}function io(){return`agent_${Date.now()}_${Math.random().toString(36).substring(2,8)}`}function ao(e,t){return e.totalCreated++,e.activeCount++,t?e.fromTemplates++:e.customConfigured++,e.templateUsageRatio=e.totalCreated>0?e.fromTemplates/e.totalCreated:0,e}var oo=class{templates=new Map;logger;constructor(){this.logger=k(`AgentTemplates`),this.logger.info(`AgentTemplates initialized`)}registerTemplate(e){if(!e.id)throw Error(`Template must have an ID`);this.templates.has(e.id)&&this.logger.warn(`Template "${e.id}" is already registered, overriding`),this.templates.set(e.id,e),this.logger.info(`Template "${e.id}" registered successfully`,{templateId:e.id,category:e.category,tags:e.tags})}unregisterTemplate(e){let t=this.templates.delete(e);return t?this.logger.info(`Template "${e}" unregistered`):this.logger.warn(`Attempted to unregister non-existent template "${e}"`),t}getTemplates(){return Array.from(this.templates.values())}getTemplate(e){return this.templates.get(e)}findTemplates(e){return this.getTemplates().filter(t=>!(e.category&&t.category!==e.category||e.tags&&e.tags.length>0&&!e.tags.some(e=>t.tags?.includes(e))||e.provider&&t.config.defaultModel?.provider!==e.provider||e.model&&t.config.defaultModel?.model!==e.model))}applyTemplate(e,t={}){let n=[],r=!1,i={...e.config},a={...i,...t},o=e=>{e in t&&i[e]!==t[e]&&(r=!0,i[e]!==void 0&&n.push(`Override: ${e} changed from "${String(i[e])}" to "${String(t[e])}"`))};t.name!==void 0&&o(`name`),t.systemMessage!==void 0&&o(`systemMessage`);let s=a;return this.logger.debug(`Template applied`,{templateId:e.id,overridesCount:Object.keys(t).length,warningsCount:n.length,modified:r}),{config:s,template:e,warnings:n,modified:r}}hasTemplate(e){return this.templates.has(e)}getTemplateCount(){return this.templates.size}clearAll(){this.templates.clear(),this.logger.info(`All templates cleared`)}getStats(){let e=this.getTemplates(),t=[...new Set(e.map(e=>e.category).filter(e=>typeof e==`string`&&e.length>0))],n=[...new Set(e.flatMap(e=>e.tags||[]))],r=[...new Set(e.map(e=>e.config.defaultModel?.provider).filter(e=>typeof e==`string`&&e.length>0))],i=[...new Set(e.map(e=>e.config.defaultModel?.model).filter(e=>typeof e==`string`&&e.length>0))];return{totalTemplates:e.length,categories:t,tags:n,providers:r,models:i}}};function so(e){let t=e,n=typeof t.initialize==`function`?t.initialize:void 0,r=typeof t.cleanup==`function`?t.cleanup:void 0;if(n!==void 0||r!==void 0)return{...n?{initialize:()=>n.call(e)}:{},...r?{cleanup:()=>r.call(e)}:{}}}function co(e){return e instanceof Error&&`failedStep`in e&&`rollbackErrors`in e}async function lo(e){let t=[];for(let n of e){try{await n.run()}catch(e){let r=[];for(let e of t.reverse())if(e.undo!==void 0)try{await e.undo()}catch(t){r.push({step:e.name,error:t})}throw uo(e,n.name,r)}t.push(n)}}function uo(e,t,n){let r=e instanceof Error?e:Error(String(e));return Object.assign(r,{failedStep:t,rollbackErrors:n})}var fo=class{agentTemplates;initialized=!1;logger;options;activeAgents;pendingAgents=new Set;creationStats;lifecycleEvents;constructor(e={},t={}){this.agentTemplates=new oo,this.logger=k(`AgentFactory`),this.options=no(e),this.activeAgents=new Map,this.creationStats={totalCreated:0,activeCount:0,fromTemplates:0,customConfigured:0,templateUsageRatio:0},this.lifecycleEvents=t,this.logger.debug(`AgentFactory initialized`,{maxConcurrentAgents:this.options.maxConcurrentAgents,strictValidation:this.options.strictValidation,hasDefaultModel:!!this.options.defaultModel,hasDefaultProvider:!!this.options.defaultProvider,hasLifecycleEvents:this.lifecycleEvents!==null})}async initialize(){this.initialized||(this.logger.debug(`Initializing AgentFactory`),this.initialized=!0,this.logger.debug(`AgentFactory initialization completed`))}async createAgent(e,t,r=!1){let i,a=this.admit();try{i=ro(t,this.options);let o=i;if(this.options.strictValidation){let e=tt(i);if(!e.isValid)throw new n.A(`Invalid agent configuration: ${e.errors.join(`, `)}`)}let s;if(await lo([{name:`beforeCreate`,run:()=>this.lifecycleEvents.beforeCreate?.(o)},{name:`construct`,run:()=>{s=new e(o)}},{name:`initialize`,run:()=>s?so(s)?.initialize?.():void 0,undo:()=>s?so(s)?.cleanup?.():void 0},{name:`commit`,run:()=>{if(!s)throw new n.y(`Agent was not constructed`);this.activeAgents.set(a,s),ao(this.creationStats,r)},undo:()=>{this.activeAgents.delete(a),this.creationStats.activeCount--,this.creationStats.totalCreated--,r?this.creationStats.fromTemplates--:this.creationStats.customConfigured--}},{name:`afterCreate`,run:()=>s?this.lifecycleEvents.afterCreate?.(s,o):void 0}]),this.pendingAgents.delete(a),!s)throw new n.y(`Agent was not constructed`);return this.logger.info(`Agent created successfully`,{agentId:a,model:i.defaultModel.model,provider:i.defaultModel.provider}),s}catch(e){this.pendingAgents.delete(a);let n=e instanceof Error?e:Error(String(e));throw this.lifecycleEvents.onCreateError&&i&&await this.lifecycleEvents.onCreateError(n,i),this.logger.error(`Failed to create agent`,{error:n.message,model:t.defaultModel?.model,provider:t.defaultModel?.provider,hasTools:!!t.tools?.length}),n}}admit(){if(this.activeAgents.size+this.pendingAgents.size>=this.options.maxConcurrentAgents)throw new n.y(`Maximum concurrent agents limit reached: ${this.options.maxConcurrentAgents}`);let e=this.options.idFactory(),t=0;for(;this.activeAgents.has(e)||this.pendingAgents.has(e);){if(t+=1,t>16)throw new n.y(`Agent id factory keeps returning ids that are already in use`);e=this.options.idFactory()}return this.pendingAgents.add(e),e}async createFromTemplate(e,t,r={}){let i=this.agentTemplates.getTemplate(t);if(!i)throw new n.y(`Template not found: ${t}`);let a=this.applyTemplate(i,r);a.warnings.length>0&&this.logger.warn(`Template application warnings`,{templateId:t,warnings:a.warnings});let o=await this.createAgent(e,a.config,!0);return this.logger.info(`Agent created from template`,{templateId:t,modified:a.modified,warnings:a.warnings.length}),o}registerTemplate(e){this.agentTemplates.registerTemplate(e)}unregisterTemplate(e){return this.agentTemplates.unregisterTemplate(e)}getTemplates(){return this.agentTemplates.getTemplates()}getTemplate(e){return this.agentTemplates.getTemplate(e)}findTemplates(e){return this.agentTemplates.findTemplates(e)}applyTemplate(e,t={}){return this.agentTemplates.applyTemplate(e,t)}async destroyAgent(e){let t=this.activeAgents.get(e);if(!t)return!1;try{return await so(t)?.cleanup?.(),this.activeAgents.delete(e),this.creationStats.activeCount--,this.lifecycleEvents.onDestroy&&await this.lifecycleEvents.onDestroy(e),this.logger.info(`Agent destroyed`,{agentId:e}),!0}catch(t){throw this.logger.error(`Error destroying agent`,{agentId:e,error:t instanceof Error?t.message:String(t)}),t}}getCreationStats(){return{...this.creationStats}}getActiveAgents(){return new Map(this.activeAgents)}validateConfiguration(e){return tt(e)}};function po(e,t,r){if(!e.name||e.name.trim()===``)throw new n.y(`Module name is required`);if(!e.version||e.version.trim()===``)throw new n.y(`Module version is required`);let i=e.getModuleType(),a=t.validateTypeDescriptor(i);if(!a.valid)throw new n.y(`Invalid module type: ${a.errors.join(`, `)}`,{moduleName:e.name,errors:a.errors});a.warnings.length>0&&r.warn(`Module type validation warnings`,{moduleName:e.name,warnings:a.warnings})}async function mo(e,t,r,i){let a=e.getModuleType();if(!a.dependencies||a.dependencies.length===0)return;for(let r of a.dependencies)if(!t.hasType(r))throw new n.y(`Module '${e.name}' depends on unregistered type '${r}'`,{moduleName:e.name,dependencyType:r});let o=new Set;for(let e of r.values())o.add(e.getModuleType().type);let s=[];for(let e of a.dependencies)o.has(e)||s.push(e);s.length>0&&i.warn(`Module has unmet dependencies`,{moduleName:e.name,missingDependencies:s})}function ho(e,t){let n=t.get(e);if(!n)return[];let r=n.getModuleType().type,i=[];for(let[n,a]of t.entries())n!==e&&a.getModuleType().dependencies?.includes(r)&&i.push(n);return i}function go(e,t){let n={},r=0,i=0,a=0,o=0,s=0,c=0;for(let t of e.values()){let e=t.getModuleType().type;n[e]=(n[e]||0)+1,t.isInitialized()&&r++,t.isEnabled()&&i++}for(let e of t.values())a+=e.totalExecutions,o+=e.successfulExecutions,s+=e.failedExecutions,c+=e.totalExecutionTime;return{totalModules:e.size,initializedModules:r,enabledModules:i,modulesByType:n,totalExecutions:a,totalSuccessfulExecutions:o,totalFailedExecutions:s,averageExecutionTime:a>0?c/a:0}}function _o(){return[{type:`storage`,category:`storage`,layer:`infrastructure`,capabilities:[`data-persistence`,`data-retrieval`]},{type:`memory-storage`,category:`storage`,layer:`infrastructure`,dependencies:[`storage`],capabilities:[`in-memory-storage`,`fast-access`]},{type:`file-storage`,category:`storage`,layer:`infrastructure`,dependencies:[`storage`],capabilities:[`persistent-storage`,`file-system-access`]},{type:`text-processing`,category:`processing`,layer:`application`,capabilities:[`text-analysis`,`content-transformation`]},{type:`file-processing`,category:`processing`,layer:`application`,dependencies:[`storage`],capabilities:[`file-parsing`,`content-extraction`]},{type:`api-integration`,category:`integration`,layer:`application`,capabilities:[`external-api-access`,`data-synchronization`]},{type:`database-integration`,category:`integration`,layer:`infrastructure`,dependencies:[`storage`],capabilities:[`database-access`,`query-execution`]},{type:`rag`,category:`capability`,layer:`domain`,dependencies:[`storage`,`text-processing`],capabilities:[`document-search`,`context-retrieval`,`semantic-search`]},{type:`speech-processing`,category:`capability`,layer:`domain`,capabilities:[`speech-to-text`,`text-to-speech`,`audio-processing`]},{type:`image-analysis`,category:`capability`,layer:`domain`,capabilities:[`image-recognition`,`visual-analysis`,`content-extraction`]}]}function vo(e,t){let n=[],r=[];if((!e.type||e.type.trim()===``)&&n.push(`Module type is required and cannot be empty`),e.category||n.push(`Module category is required`),e.layer||n.push(`Module layer is required`),e.type&&!/^[a-zA-Z][a-zA-Z0-9-_]*$/.test(e.type)&&n.push(`Module type must start with a letter and contain only letters, numbers, hyphens, and underscores`),e.dependencies){for(let t of e.dependencies)(!t||t.trim()===``)&&n.push(`Dependencies cannot be empty`);e.dependencies.includes(e.type)&&n.push(`Module cannot depend on itself`)}if(e.capabilities)for(let t of e.capabilities)(!t||t.trim()===``)&&n.push(`Capabilities cannot be empty`);if(e.dependencies){let n=[`infrastructure`,`core`,`application`,`domain`,`presentation`],i=n.indexOf(e.layer);for(let a of e.dependencies){let o=t(a);o&&n.indexOf(o.layer)>i&&r.push(`Module '${e.type}' (${e.layer}) depends on '${a}' (${o.layer}) which is in a higher layer`)}}return{valid:n.length===0,errors:n,warnings:r}}function yo(e,t,n){let r=new Set,i=new Set,a=[],o=[],s=[];for(let r of e){let e=t(r);if(!e){s.push(r);continue}if(e.dependencies)for(let t of e.dependencies)!n(t)&&!s.includes(t)&&s.push(t)}let c=(s,l=[])=>{if(i.has(s)){let e=l.indexOf(s);o.push(l.slice(e).concat([s]));return}if(r.has(s))return;let u=t(s);if(!u)return;i.add(s);let d=[...l,s];if(u.dependencies)for(let t of u.dependencies)(e.includes(t)||n(t))&&c(t,d);i.delete(s),r.add(s),a.push(s)};for(let t of e)r.has(t)||c(t);return{resolved:s.length===0&&o.length===0,order:a,circularDependencies:o,missingDependencies:s}}function bo(e,t){let n=[],r=[],i=new Map;for(let n of e){let e=t(n);e&&(i.has(e.layer)||i.set(e.layer,[]),i.get(e.layer).push(n))}let a=new Map;for(let n of e){let e=t(n);if(e?.capabilities)for(let t of e.capabilities)a.has(t)||a.set(t,[]),a.get(t).push(n)}for(let[e,t]of Array.from(a.entries()))if(t.length>1)for(let r=0;r<t.length;r++)for(let i=r+1;i<t.length;i++){let a=t[r],o=t[i];a&&o&&n.push({module1:a,module2:o,reason:`Both modules provide capability '${e}'`})}return n.length>0&&(r.push(`Consider using only one module per capability`),r.push(`Check if modules can be configured to avoid conflicts`)),!i.has(`infrastructure`)&&e.length>1&&r.push(`Consider adding infrastructure modules for better foundation`),{compatible:n.length===0,conflicts:n,suggestions:r}}function xo(e){let t={core:0,storage:0,processing:0,integration:0,interface:0,capability:0},n={infrastructure:0,core:0,application:0,domain:0,presentation:0},r=0,i=0;for(let a of e.values())t[a.category]++,n[a.layer]++,a.dependencies&&a.dependencies.length>0&&r++,a.capabilities&&a.capabilities.length>0&&i++;return{totalTypes:e.size,typesByCategory:t,typesByLayer:n,typesWithDependencies:r,typesWithCapabilities:i}}var So=class{registeredTypes=new Map;logger;constructor(){this.logger=k(`ModuleDescriptorRegistry`),this.registerBuiltinTypes()}registerType(e){let t=this.validateTypeDescriptor(e);if(!t.valid)throw new n.y(`Invalid module type descriptor: ${t.errors.join(`, `)}`,{type:e.type,errors:t.errors});if(this.registeredTypes.has(e.type)){let t=this.registeredTypes.get(e.type);this.logger.warn(`Overriding existing module type`,{type:e.type,previousCategory:t?.category||`unknown`,newCategory:e.category})}this.registeredTypes.set(e.type,e),this.logger.info(`Module type registered`,{type:e.type,category:e.category,layer:e.layer,dependencies:e.dependencies?.length||0,capabilities:e.capabilities?.length||0})}unregisterType(e){if(!this.registeredTypes.has(e))return!1;let t=this.findDependentTypes(e);if(t.length>0)throw new n.y(`Cannot unregister module type '${e}' - it is required by: ${t.join(`, `)}`,{type:e,dependentTypes:t});return this.registeredTypes.delete(e),this.logger.info(`Module type unregistered`,{type:e}),!0}getType(e){return this.registeredTypes.get(e)}getAllTypes(){return Array.from(this.registeredTypes.values())}getTypesByCategory(e){return Array.from(this.registeredTypes.values()).filter(t=>t.category===e)}getTypesByLayer(e){return Array.from(this.registeredTypes.values()).filter(t=>t.layer===e)}hasType(e){return this.registeredTypes.has(e)}validateTypeDescriptor(e){return vo(e,e=>this.getType(e))}resolveDependencies(e){return yo(e,e=>this.getType(e),e=>this.hasType(e))}checkCompatibility(e){return bo(e,e=>this.getType(e))}findDependentTypes(e){let t=[];for(let[n,r]of this.registeredTypes)r.dependencies?.includes(e)&&t.push(n);return t}registerBuiltinTypes(){for(let e of _o())this.registerType(e);this.logger.info(`Built-in module types registered`,{totalTypes:this.registeredTypes.size})}clearAllTypes(){this.registeredTypes.clear(),this.logger.info(`All module types cleared`)}getStats(){return xo(this.registeredTypes)}};const Co={REGISTERED:`module.registered`,UNREGISTERED:`module.unregistered`};var wo=class{modules=new Map;moduleOptions=new Map;moduleStatuses=new Map;moduleStats=new Map;registrationOrder=[];initializationOrder=[];typeRegistry;eventEmitter;logger;isDisposing=!1;constructor(e,t){this.eventEmitter=e,this.typeRegistry=t??new So,this.logger=k(`ModuleRegistry`)}async registerModule(e,t={}){if(this.isDisposing)throw new n.y(`Cannot register modules during disposal`);if(po(e,this.typeRegistry,this.logger),this.modules.has(e.name))throw new n.y(`Module with name '${e.name}' is already registered`,{moduleName:e.name});t.validateDependencies!==!1&&await mo(e,this.typeRegistry,this.modules,this.logger),this.modules.set(e.name,e),this.moduleOptions.set(e.name,t.initOptions||{}),this.registrationOrder.push(e.name);let r=e.getModuleType();this.moduleStatuses.set(e.name,{name:e.name,type:r.type,enabled:e.isEnabled(),initialized:!1,hasEventEmitter:!!this.eventEmitter,registrationTime:new Date,dependencies:r.dependencies||[],dependents:[]}),this.moduleStats.set(e.name,{totalExecutions:0,successfulExecutions:0,failedExecutions:0,averageExecutionTime:0,totalExecutionTime:0}),t.autoInitialize&&await this.initializeModule(e.name,t.initTimeout),this.eventEmitter&&await this.eventEmitter.emit(Co.REGISTERED,{data:{moduleName:e.name,moduleType:r.type},timestamp:new Date})}async unregisterModule(e){let t=this.modules.get(e);if(!t)return!1;let r=ho(e,this.modules);if(r.length>0)throw new n.y(`Cannot unregister module '${e}' - it is required by: ${r.join(`, `)}`,{moduleName:e,dependents:r});t.isInitialized()&&t.dispose&&await t.dispose(),this.modules.delete(e),this.moduleOptions.delete(e),this.moduleStatuses.delete(e),this.moduleStats.delete(e);let i=this.registrationOrder.indexOf(e);i!==-1&&this.registrationOrder.splice(i,1);let a=this.initializationOrder.indexOf(e);return a!==-1&&this.initializationOrder.splice(a,1),this.eventEmitter&&await this.eventEmitter.emit(Co.UNREGISTERED,{data:{moduleName:e},timestamp:new Date}),!0}async initializeModule(e,t){let r=this.modules.get(e);if(!r)throw new n.y(`Module '${e}' not found`);if(r.isInitialized())return;let i=this.moduleOptions.get(e),a=r.initialize(i,this.eventEmitter);if(t&&t>0){let n,r=new Promise((r,i)=>{n=setTimeout(()=>{i(Error(`Module '${e}' initialization timed out after ${t}ms`))},t)});await Promise.race([a.then(e=>(clearTimeout(n),e)),r])}else await a;let o=this.moduleStatuses.get(e);o&&(o.initialized=!0,o.initializationTime=new Date),this.initializationOrder.includes(e)||this.initializationOrder.push(e)}async initializeAllModules(e){let t=Array.from(this.modules.keys());if(t.length===0)return;let r=t.map(e=>this.modules.get(e).getModuleType().type),i=this.typeRegistry.resolveDependencies(r);if(!i.resolved){let e=[];throw i.missingDependencies.length>0&&e.push(`Missing dependencies: ${i.missingDependencies.join(`, `)}`),i.circularDependencies.length>0&&e.push(`Circular dependencies: ${i.circularDependencies.map(e=>e.join(` -> `)).join(`; `)}`),new n.y(`Cannot initialize modules: ${e.join(`; `)}`,{missingDependencies:i.missingDependencies,circularDependencies:i.circularDependencies.map(e=>e.join(` -> `))})}for(let n of i.order){let r=t.find(e=>this.modules.get(e).getModuleType().type===n);r&&await this.initializeModule(r,e)}}async executeModule(e,t){let r=this.modules.get(e);if(!r)throw new n.y(`Module '${e}' not found`);if(!r.isInitialized())throw new n.y(`Module '${e}' is not initialized`);if(!r.isEnabled())throw new n.y(`Module '${e}' is disabled`);let i=this.moduleStats.get(e),a=Date.now();try{if(!r.execute)throw new n.y(`Module '${e}' does not support execute()`);let o=await r.execute(t),s=Date.now()-a;i.totalExecutions++,i.successfulExecutions++,i.totalExecutionTime+=s,i.averageExecutionTime=i.totalExecutionTime/i.totalExecutions,i.lastExecutionTime=new Date;let c=this.moduleStatuses.get(e);return c&&(c.lastActivity=new Date),o}catch(e){let t=Date.now()-a;throw i.totalExecutions++,i.failedExecutions++,i.totalExecutionTime+=t,i.averageExecutionTime=i.totalExecutionTime/i.totalExecutions,i.lastExecutionTime=new Date,e}}getModule(e){return this.modules.get(e)}getModulesByType(e){return Array.from(this.modules.values()).filter(t=>t.getModuleType().type===e)}getAllModules(){return Array.from(this.modules.values())}getModuleNames(){return Array.from(this.modules.keys())}hasModule(e){return this.modules.has(e)}getModuleStatus(e){return this.moduleStatuses.get(e)}getAllModuleStatuses(){return Array.from(this.moduleStatuses.values())}getModuleStats(e){return this.moduleStats.get(e)}getAllModuleStats(){let e={};for(let[t,n]of this.moduleStats.entries())e[t]={...n};return e}async disposeAllModules(){this.isDisposing=!0;let e=[...this.initializationOrder].reverse();for(let t of e){let e=this.modules.get(t);if(e&&e.isInitialized())try{e.dispose&&await e.dispose();let n=this.moduleStatuses.get(t);n&&(n.initialized=!1)}catch(e){this.logger.error(`Failed to dispose module`,{name:t,error:e instanceof Error?e.message:String(e)})}}this.initializationOrder=[],this.isDisposing=!1}clearAllModules(){this.modules.clear(),this.moduleOptions.clear(),this.moduleStatuses.clear(),this.moduleStats.clear(),this.registrationOrder=[],this.initializationOrder=[],this.isDisposing=!1}getRegistryStats(){return go(this.modules,this.moduleStats)}},To=class extends sr{version=`1.0.0`;aiProviders;tools;agentFactory;conversationHistory;moduleRegistry;eventEmitter;executionService;eventService;agentEventService;conversationId;logger;initializationPromise;destroyed=!1;isFullyInitialized=!1;startTime;configVersion=1;configUpdatedAt=Date.now();configManager;constructor(e){super(),this.config=e,this.conversationId=Rr(e);let t=e.logging?.enabled===!1?`silent`:e.logging?.level;this.logger=k(`Robota`,t?{level:t}:{}),this.startTime=Date.now(),lr(e),this.aiProviders=Xa(e),this.tools=zr(()=>this.config),this.agentFactory=new fo,this.conversationHistory=new hn,this.eventEmitter=qr(),this.moduleRegistry=new wo(this.eventEmitter),this.eventService=e.eventService||Hn,this.agentEventService=q(this.eventService,{ownerType:`agent`,ownerId:this.conversationId,ownerPath:Jr(this.conversationId,this.config.executionContext)});let n=Hr({getName:()=>this.name,getModuleRegistry:()=>this.moduleRegistry,getLogger:()=>this.logger,getIsFullyInitialized:()=>this.isFullyInitialized,ensureFullyInitialized:()=>this.ensureFullyInitialized(),getExecutionService:()=>this.executionService,getAiProviders:()=>this.aiProviders,getTools:()=>this.tools,getEventService:()=>this.eventService,getConfig:()=>this.config,setConfig:e=>{this.config=e},getConfigVersion:()=>this.configVersion,incrementConfigVersion:()=>++this.configVersion,getConfigUpdatedAt:()=>this.configUpdatedAt,setConfigUpdatedAt:e=>{this.configUpdatedAt=e},emitAgentEvent:(e,t)=>this.emitAgentEvent(e,t)});this.moduleManager=n.moduleManager,this.pluginManager=n.pluginManager,this.configManager=n.configManager,Gr(this.config,(e,t)=>this.emitAgentEvent(e,t))}async ensureReady(){await this.ensureFullyInitialized()}async listRuntimeTools(){return await this.ensureReady(),this.tools.getTools()}async invokeRuntimeTool(e,t,n){await this.ensureReady();let r=[...Jr(this.conversationId,this.config.executionContext),{type:`tool`,id:n.executionId??e}];return this.executionService.invokeRuntimeTool(e,t,{...n,baseEventService:this.eventService,eventService:q(this.eventService,{ownerPath:r,ownerType:`tool`,ownerId:n.executionId??e}),ownerPath:r,ownerType:`tool`,ownerId:n.executionId})}async run(e,t={}){return this.assertNotDestroyed(),this.runQueue.run(t.signal,async()=>{await this.ensureFullyInitialized();try{if(t.output){let n=Vt(t.output);return await ei(this.executionDeps(),e,t,n)}return await Xr(this.executionDeps(),e,t)}finally{this.resetEphemeralHistory()}})}async*runStream(e,t={}){this.assertNotDestroyed();let n=await this.runQueue.acquire(t.signal);try{if(await this.ensureFullyInitialized(),t.output){let n=Vt(t.output);return yield*ti(this.executionDeps(),e,t,n)}return yield*Zr(this.executionDeps(),e,t)}finally{this.resetEphemeralHistory(),n()}}resetEphemeralHistory(){this.config.retainHistory===!1&&this.clearHistory()}runQueue=new to;executionDeps(){return{conversationId:this.conversationId,config:this.config,logger:this.logger,getHistory:()=>this.getHistory(),getExecutionService:()=>this.executionService,emitAgentEvent:(e,t)=>this.emitAgentEvent(e,t)}}getHistory(){return ri(this.conversationHistory,this.conversationId)}getFullHistory(){return ii(this.conversationHistory,this.conversationId)}addHistoryEntry(e){ai(this.conversationHistory,this.conversationId,e)}clearHistory(){oi(this.conversationHistory,this.conversationId)}injectMessage(e,t,n){si(this.conversationHistory,this.conversationId,e,t,n)}injectRawMessage(e){ci(this.conversationHistory,this.conversationId,e)}async updateTools(e){return this.configManager.updateTools(e)}async updateConfiguration(e){return this.configManager.updateConfiguration(e)}async getConfiguration(){return this.configManager.getConfiguration()}setModel(e){this.configManager.setModel(e)}getModel(){return this.configManager.getModel()}updateSystemPrompt(e){this.configManager.setSystemMessage(e),this.conversationHistory.getConversationStore(this.conversationId).setSystemPrompt(e)}getSystemPrompt(){return this.configManager.getSystemMessage()}registerTool(e){this.configManager.registerTool(e,this.tools)}unregisterTool(e){this.tools.removeTool(e)}getOfferedToolSchemas(){return this.tools.getOfferedTools()}getConfig(){return{...this.config}}swapDefaultProvider(e,t){this.aiProviders.addProvider(e.name,e),this.configManager.setModel({provider:e.name,model:t})}getStats(){return $a({name:this.name,version:this.version,conversationId:this.conversationId,startTime:this.startTime,isFullyInitialized:this.isFullyInitialized,aiProviders:this.aiProviders,tools:this.tools,getPluginNames:()=>this.getPluginNames(),getModuleNames:()=>this.getModuleNames(),getHistory:()=>this.getHistory()})}async destroy(){return this.destroyed?{errors:[]}:(this.destroyed=!0,await this.runQueue.drained,eo({name:this.name,isFullyInitialized:this.isFullyInitialized,moduleRegistry:this.moduleRegistry,eventEmitter:this.eventEmitter,executionService:this.executionService,tools:this.tools,aiProviders:this.aiProviders,logger:this.logger,resetState:()=>{this.isFullyInitialized=!1,this.initializationPromise=void 0}}))}assertNotDestroyed(){if(this.destroyed)throw Error(`[LIFECYCLE] Agent "${this.name}" has been destroyed — create a new instance`)}async initialize(){await this.ensureFullyInitialized()}async ensureFullyInitialized(){this.assertNotDestroyed(),!this.isFullyInitialized&&(this.initializationPromise||=this.doAsyncInit().catch(e=>{throw this.initializationPromise=void 0,e}),await this.initializationPromise)}doAsyncInit(){return Qa({ctx:{config:this.config,aiProviders:this.aiProviders,tools:this.tools,agentFactory:this.agentFactory,conversationHistory:this.conversationHistory,moduleRegistry:this.moduleRegistry,eventEmitter:this.eventEmitter,eventService:this.eventService,logger:this.logger},setExecutionService:e=>{this.executionService=e},setFullyInitialized:e=>{this.isFullyInitialized=e}})}emitAgentEvent(e,t){Kr(this.agentEventService,this.conversationId,this.config.executionContext,e,t)}};const Eo=/^tool-result:[A-Za-z0-9_-]{22,64}$/u,Do=Symbol.for(`@robota-sdk/tool-result-admitted`);var Oo=class extends Error{code;constructor(e){super(`Tool result admission failed (${e})`),this.code=e,this.name=`ToolResultAdmissionError`}};function ko(e){return Object.getOwnPropertyDescriptor(e,Do)?.value===!0}function Ao(e){return Object.defineProperty({...e},Do,{value:!0})}function jo(e){if(e.success)return typeof e.data==`string`?e.data:JSON.stringify(e.data)??``;let t=e.data===void 0?``:typeof e.data==`string`?e.data:JSON.stringify(e.data)??``;return`${e.error??``}${t}`}function Mo(e){return Number.isSafeInteger(e)&&e>0}function No(e,t){let n=e.warningChars??1e4,r=e.hardChars??25e3,i=e.repositoryMaxChars??5e5;if(!Mo(n)||!Mo(r)||!Mo(i)||n>=r||r>i||i>5e5)throw new Oo(`invalid-policy`);if(t===void 0)return{warningChars:n,hardChars:r};if(!Mo(t))throw new Oo(`invalid-override`);return{warningChars:n,hardChars:Math.max(r,Math.min(t,i))}}async function Po(e,t,n={},r){let{warningChars:i,hardChars:a}=No(n,r),o=jo(t),s=o.length;if(s>i&&n.onWarning?.({toolName:e,resultChars:s,warningChars:i}),s>a){if(!n.spillStore)throw new Oo(`spill-unavailable`);let e;try{e=(await n.spillStore.write(o)).reference}catch{throw new Oo(`spill-write-failed`)}if(!Eo.test(e)||e.length>a)throw new Oo(`invalid-reference`);return Ao(t.success?{success:!0,data:e}:{success:!1,error:`Tool failure details: ${e}`})}return Ao(t)}var Fo=class{store;listener;sequenceId=0;constructor(e,t){this.store=e,this.listener=(e,t,n)=>{if(!n?.ownerPath?.length)throw Error(`[HISTORY-MODULE] Missing ownerPath for ${e}`);let r={eventName:e,sequenceId:this.nextSequenceId(),timestamp:t.timestamp,eventData:t,context:n};this.store.append(r)},t.subscribe(this.listener)}append(e){this.store.append(e)}read(e,t){return this.store.read(e,t)}readStream(e,t){return this.store.readStream(e,t)}getSnapshot(){return this.store.getSnapshot?.()}detach(e){e.unsubscribe(this.listener)}nextSequenceId(){return this.sequenceId+=1,this.sequenceId}};const Io={STARTED:`started`,STEP_STARTED:`step_started`,STEP_COMPLETED:`step_completed`,COMPLETED:`completed`,FAILED:`failed`};function Z(e){if(!(!e||typeof e!=`object`||Array.isArray(e)||e instanceof Date))return e}function Lo(e){return typeof e==`string`?e.length:0}var Ro=class{config;methodConfigs=new Map;constructor(e){this.config=e}configureMethod(e,t){return this.methodConfigs.set(e,t),this}configureStandardMethods(){return this.config.sourceType===`agent`&&(this.configureMethod(`run`,{startEvent:j.EXECUTION_START,completeEvent:j.EXECUTION_COMPLETE,errorEvent:j.EXECUTION_ERROR,extractMetadata:(e,t,n)=>({inputLength:Lo(n[0]),conversationId:e.conversationId,options:Z(n[1])||{}}),extractResult:e=>({response:e})}),this.configureMethod(`runStream`,{startEvent:j.EXECUTION_START,completeEvent:j.EXECUTION_COMPLETE,errorEvent:j.EXECUTION_ERROR,extractMetadata:(e,t,n)=>({inputLength:Lo(n[0]),conversationId:e.conversationId,streaming:!0,options:Z(n[1])||{}})})),this.config.sourceType===`tool`&&this.configureMethod(`execute`,{startEvent:P.CALL_START,completeEvent:P.CALL_COMPLETE,errorEvent:P.CALL_ERROR,extractMetadata:(e,t,n)=>({toolName:Z(e.schema)?.name||e.constructor.name,parameters:n[0],parametersCount:Z(n[0])?Object.keys(Z(n[0])||{}).length:0,context:n[1]}),extractResult:e=>({result:typeof Z(e)?.data==`string`?Z(e)?.data||``:JSON.stringify(Z(e)?.data),success:Z(e)?.success})}),this}wrap(e){return new Proxy(e,{get:(e,t,n)=>{let r=Reflect.get(e,t,n);if(typeof t!=`string`)return r;let i=t;if(typeof r==`function`&&this.methodConfigs.has(i)){let t=this.methodConfigs.get(i);return async(...n)=>{let a=Date.now(),o=this.generateExecutionId(),s=e;try{if(t.startEvent){let e=t.extractMetadata?.(s,i,n)||{};this.emitEvent(t.startEvent,{timestamp:new Date,metadata:{...e,executionId:o,methodName:i,phase:`start`}})}let c=await r.apply(e,n),l=Date.now()-a;if(t.completeEvent){let e=t.extractResult?.(c)||{},r=t.extractMetadata?.(s,i,n)||{};this.emitEvent(t.completeEvent,{timestamp:new Date,...e,metadata:{...r,executionId:o,methodName:i,duration:l,phase:`complete`,success:!0}})}return c}catch(e){let r=Date.now()-a;if(t.errorEvent){let a=t.extractMetadata?.(s,i,n)||{};this.emitEvent(t.errorEvent,{timestamp:new Date,error:e instanceof Error?e.message:String(e),metadata:{...a,executionId:o,methodName:i,duration:r,phase:`error`,errorName:e instanceof Error?e.name:`UnknownError`,success:!1}})}throw e}}}return r}})}emitEvent(e,t){let n={emitterSourceType:this.config.sourceType,emitterSourceId:this.config.sourceId},r={timestamp:new Date,...t.metadata?{metadata:{...n,...t.metadata}}:{metadata:n},...t};this.config.eventService.emit(e,r)}generateExecutionId(){return`${this.config.sourceType}-${this.config.sourceId}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}};function zo(e,t){let n=new Ro(t);return n.configureStandardMethods(),n.wrap(e)}function Bo(e,t,n){return function(r){return zo(r,{eventService:e,sourceType:t,sourceId:n})}}const Vo={safe:`plan`,moderate:`default`,full:`acceptEdits`};function Ho(e){let t;for(let n=0;n<e.length;n+=1){let r=e[n];if(t===`'`){r===`'`&&(t=void 0);continue}if(r===`\\`){n+=1;continue}let i=e[n+1];if(r==="`"||r===`$`&&i===`(`)return!0;if(t===`"`){r===`"`&&(t=void 0);continue}if(r===`'`||r===`"`){t=r;continue}if(r===`;`||r===`|`||r===`
9
9
  `||(r===`<`||r===`>`)&&i===`(`)return!0;if(r===`&`){let t=e[n-1];if(t!==`>`&&t!==`<`&&i!==`>`)return!0}}return!1}function Uo(e){let t={segments:[],current:``,quote:void 0,substitutionDepth:0};for(let n=0;n<e.length;n+=1){let r=Go(t,e,n);if(r!==void 0){n=r;continue}let i=Ko(t,e,n);if(i!==void 0){n=i;continue}if(qo(t,e[n]))continue;let a=Jo(t,e,n);if(a!==void 0){n=a;continue}t.current+=e[n]}return Wo(t),t.segments}function Wo(e){let t=e.current.trim();t!==``&&e.segments.push(t),e.current=``}function Go(e,t,n){let r=t[n];if(e.quote===`'`)return e.current+=r,r===`'`&&(e.quote=void 0),n;if(r===`\\`){let i=t[n+1];return e.current+=i===void 0?r:r+i,n+1}}function Ko(e,t,n){let r=t[n];if(r==="`")return Wo(e),n;if(r===`$`&&t[n+1]===`(`)return Wo(e),e.substitutionDepth+=1,n+1}function qo(e,t){return e.quote===`"`?(e.current+=t,t===`"`&&(e.quote=void 0),!0):t===`'`||t===`"`?(e.quote=t,e.current+=t,!0):!1}function Jo(e,t,n){let r=t[n];if((r===`<`||r===`>`)&&t[n+1]===`(`)return Wo(e),e.substitutionDepth+=1,n+1;if(r===`)`&&e.substitutionDepth>0)return Wo(e),--e.substitutionDepth,n;if(r===`;`||r===`|`||r===`
10
- `||r===`&`&&Yo(t,n))return Wo(e),n}function Yo(e,t){let n=e[t-1];return n!==`>`&&n!==`<`&&e[t+1]!==`>`}const Xo=/[.+^${}()|[\]\\]/g;function Zo(e){let t=e.replace(Xo,`\\$&`).replace(/\*\*/g,`.+`).replace(/\*/g,`.*`);return RegExp(`^${t}$`)}function Qo(e,t,n){let r=Zo(e);return n===`deny`?r.test(t)||Uo(t).some(e=>r.test(e))?`match`:`no-match`:r.test(t)?e.includes(`*`)&&Ho(t)?`no-match`:`match`:`no-match`}function $o(e){let t=e.replace(/\*\*(?:\/\*\*)+/g,`**`).split(/(\/\*\*\/|\/\*\*$|^\*\*\/|\*\*)/).map(e=>e===`/**/`?`(?:/.*)?/`:e===`/**`?`(?:/.*)?`:e===`**/`?`(?:.*/)?`:e===`**`?`.*`:e.replace(Xo,`\\$&`).replace(/\*/g,`[^/]*`).replace(/\uE000/g,`\\*`)).join(``);return RegExp(`^${t}$`)}function es(e){return e.startsWith(`/`)||/^[A-Za-z]:(?=\/|$)/.test(e)}function ts(e){let t=e.replace(/\\/g,`/`),n=t.startsWith(`/`),r=[];for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){r.length>0&&r[r.length-1]!==`..`?r.pop():n||r.push(`..`);continue}r.push(e)}let i=(n?`/`:``)+r.join(`/`);return(i===``?`.`:i).replace(/^[A-Za-z]:(?=\/|$)/,e=>e.toLowerCase())}function ns(e,t){let n=ts(e),r=ts(t);return es(n)&&!es(r)?`unevaluable`:$o(n).test(r)?`match`:`no-match`}const rs=/^(\*|[a-z][a-z0-9+.-]*):\/\/(\[[0-9a-fA-F:.]+\]|[^/\\:?#@[\]]+)(?::(\d+|\*))?(\/[^?#]*)?$/i,is=new Set([`http`,`https`,`ws`,`wss`,`ftp`]),as={http:`80`,https:`443`,ws:`80`,wss:`443`,ftp:`21`};function os(e){return e.replace(/\.$/,``).toLowerCase()}function ss(e){try{let t=new URL(`http://${e}/`).hostname;return t===``||t.includes(`.`)?null:t}catch{return null}}function cs(e){let t=os(e).replace(/\*\*(?:\.\*\*)+/g,`**`).split(`.`),n=[],r=`[^.]+(?:\\.[^.]+)*`;for(let[e,i]of t.entries()){let a=e===0,o=e===t.length-1;if(i===`**`){a&&o?n.push(r):o?n.push(`(?:\\.${r})?`):n.push(`${a?``:`\\.`}(?:${r}\\.)?`);continue}let s=!a&&t[e-1]===`**`,c=a||s?``:`\\.`;if(i===`*`)n.push(`${c}${r}`);else if(i.includes(`**`))return null;else if(i.includes(`*`))n.push(`${c}${i.replace(Xo,`\\$&`).replace(/\*/g,`[^.]*`)}`);else{let e=ss(i);if(e===null)return null;n.push(`${c}${e.replace(Xo,`\\$&`)}`)}}return RegExp(`^${n.join(``)}$`)}function ls(e){try{let t=e.split(`/`).map(e=>decodeURIComponent(e));return t.some(e=>e.includes(`/`))?null:t.join(`/`)}catch{return null}}function us(e){let t;try{t=new URL(e)}catch{return null}let n=t.protocol.slice(0,-1).toLowerCase();return!is.has(n)||t.hostname===``||t.username!==``||t.password!==``?null:t}function ds(e,t){if(e.includes(`*`)){let n=cs(e);return n===null?`unevaluable`:n.test(t)?`match`:`no-match`}let n;try{n=new URL(`http://${e}/`).hostname}catch{return`unevaluable`}return os(n)===t?`match`:`no-match`}function fs(e,t,n){return e===void 0?t.port===``:e===`*`||e===(t.port===``?as[n]:t.port)}function ps(e,t){let n=ls(t),r=ls(e.replace(/%2a/gi,``));return n===null||r===null?`unevaluable`:$o(r).test(n)?`match`:`no-match`}function ms(e,t){let n=rs.exec(e);if(n===null)return`unevaluable`;let[,r,i,a,o]=n,s=us(t);if(s===null)return`unevaluable`;let c=s.protocol.slice(0,-1).toLowerCase();if(r!==`*`&&r.toLowerCase()!==c)return`no-match`;let l=ds(i,os(s.hostname));return l===`match`?fs(a,s,c)?o===void 0?`match`:ps(o,s.pathname):`no-match`:l}const hs={plan:{inspect:`auto`,modify:`deny`,execute:`deny`},default:{inspect:`auto`,modify:`approve`,execute:`approve`},acceptEdits:{inspect:`auto`,modify:`auto`,execute:`approve`},bypassPermissions:{inspect:`auto`,modify:`auto`,execute:`auto`},auto:{inspect:`auto`,modify:`auto`,execute:`approve`}},gs={plan:`deny`,default:`approve`,acceptEdits:`approve`,bypassPermissions:`auto`,auto:`approve`},_s=[`.git`,`.robota`,`.claude`,`.agents`],vs=[`.mcp.json`,`.gitconfig`,`.npmrc`,`.bashrc`,`.bash_profile`,`.bash_login`,`.zshrc`,`.zshenv`,`.zprofile`,`.profile`];function ys(e){return e.replace(/\\/g,`/`).split(`/`).filter(e=>e!==``&&e!==`.`)}function bs(e){let t=[];for(let n of ys(e))n===`..`&&t.length>0&&t[t.length-1]!==`..`?t.pop():t.push(n);return t}function xs(e){let t=bs(e),n=t[t.length-1];if(n!==void 0&&vs.includes(n))return!0;for(let e=0;e<t.length;e+=1){let n=t[e];if(_s.includes(n)){if((n===`.robota`||n===`.claude`)&&t[e+1]===`worktrees`&&t[e+2]!==void 0){e+=2;continue}return!0}}return!1}function Ss(e){let t=[];for(let n of ys(e))n===`..`?t.pop():t.push(n);return`/${t.join(`/`)}`}function Cs(e){return e.replace(/^(['"])(.*)\1$/,`$2`)}const ws=/^(?:~|\$HOME|\$\{HOME\})(?=\/|$)(.*)$/;function Ts(e,t){let n=Cs(e),r=ws.exec(n),i;if(r!==null){let e=r[1]??``;if(t.homeDirectory===void 0)return e.replace(/\/+/g,``)===``;i=Ss(`${t.homeDirectory}/${e}`)}else if(n===``||n.startsWith(`$`))return!1;else if(n.startsWith(`/`))i=Ss(n);else{if(t.cwd===void 0)return!1;i=Ss(`${t.cwd}/${n}`)}if(ys(i).length<=1||t.homeDirectory!==void 0&&i===Ss(t.homeDirectory))return!0;if(t.cwd!==void 0){let e=Ss(t.cwd);if(e===i||e.startsWith(`${i}/`))return!0}return!1}const Es=new Set([`rm`,`rmdir`]),Ds=new Map([[`sudo`,new Set([`-u`,`-g`,`-h`,`-p`,`-C`,`-D`,`-r`,`-t`,`-U`,`-T`])],[`nice`,new Set([`-n`])],[`env`,new Set([`-u`,`-C`,`-S`])],[`command`,new Set],[`builtin`,new Set],[`nohup`,new Set],[`time`,new Set]]);function Os(e){let t=0,n;for(;t<e.length;){let r=e[t];if(/^[A-Za-z_]\w*=/.test(r)){t+=1;continue}let i=Ds.get(r);if(i!==void 0){n=i,t+=1;continue}if(n!==void 0&&r.startsWith(`-`)){t+=n.has(r)?2:1;continue}return t}return t}function ks(e,t){return Uo(e).some(e=>{let n=e.split(/\s+/).filter(e=>e!==``),r=Os(n),i=n[r];if(i===void 0)return!1;let a=i.slice(i.lastIndexOf(`/`)+1);if(!Es.has(a))return!1;let o=!1;return n.slice(r+1).some(e=>!o&&e===`--`?(o=!0,!1):!o&&e.startsWith(`-`)?!1:Ts(e,t))})}const As=new Set([`ls`,`cat`,`echo`,`pwd`,`head`,`tail`,`grep`,`wc`,`which`,`stat`,`du`,`cd`]),js=new Set([`-exec`,`-execdir`,`-ok`,`-okdir`,`-delete`,`-fprint`,`-fprint0`,`-fprintf`,`-fls`]),Ms={ls:`aAlhtrSR1dFGinpsucCgmoQvx`,cat:`nbsvetAE`,head:`nqvc`,tail:`nqvcfF`,grep:`rinlLvcwxEFGPHhoqsABCmz`,wc:`lwcmL`,stat:`cftx`,du:`hsacdkmx`,which:`a`,pwd:`LP`,cd:`LP`},Ns=/^--?[A-Za-z0-9-]*(file|from|contents)(=|$)/,Ps=[`--dereference`,`--dereference-recursive`,`--dereference-args`,`--dereference-command-line`,`--file`,`--files0-from`,`--exclude-from`,`--from-file`,`--to-file`,`--contents`,`--ignore-revs-file`,`--output`,`--output-directory`,`--ext-diff`,`--no-index`,`--open-files-in-pager`];function Fs(e){if(!e.startsWith(`--`)||e.length<=2)return!1;let t=e.split(`=`,1)[0];return Ps.some(e=>e.startsWith(t))}function Is(e,t){if(Js(t).some(e=>Ns.test(e.text)||Fs(e.text)))return!0;if(e===`find`)return Js(t).some(e=>e.text===`-L`||e.text===`-follow`);let n=Ms[e];return n!==void 0&&Js(t).some(({text:e})=>e.startsWith(`--`)||!/^-[A-Za-z]/.test(e)?!1:[...e.slice(1)].some(e=>!/\d/.test(e)&&!n.includes(e)))}const Ls=new Set([`status`,`log`,`diff`,`show`,`rev-parse`,`ls-files`,`describe`,`branch`,`remote`]),Rs=new Set([`-l`,`--list`,`--show-current`,`--merged`,`--no-merged`,`--contains`,`--no-contains`,`--points-at`]),zs=new Set([`-a`,`--all`,`-r`,`--remotes`,`-v`,`-vv`,`--verbose`,`--color`,`--no-color`]),Bs=new Set([`/dev/null`]),Vs=/[A-Za-z0-9_./:=@+,*?[\]~-]/,Hs=new Set([`$`,"`",`\\`,`!`]),Us=new Set([`*`,`?`,`[`]);function Ws(e){return/(^|[=,:])[/~]/.test(e)||/^-[A-Za-z]+[/~]/.test(e)||/(^|[/=,:]|^-[A-Za-z]+)\.\.(\/|$)/.test(e)||/(^|[=,])[A-Za-z][A-Za-z0-9]*:/.test(e)||Gs(e)}function Gs(e){let t=e.split(`/`),n=e=>/[*?[]/.test(e);if(t.slice(0,-1).some(n))return!0;let r=t[t.length-1];return n(r)&&/^[.?[]/.test(r)}function Ks(e){let t;for(let n of e){if(t===`'`){n===`'`&&(t=void 0);continue}if(n===`$`||n==="`"||n===`\\`)return!0;if(t===`"`){n===`"`&&(t=void 0);continue}if(n===`'`||n===`"`)t=n;else if(n===`(`||n===`)`||n===`{`||n===`}`)return!0}return!1}function qs(e){let t=[],n=``,r=!1,i=!1,a,o,s=!1,c=()=>{i&&=(o===`output`?(!Bs.has(n)||r)&&(s=!0):o===`duplicate`?/^(\d+|-)$/.test(n)||(s=!0):o===`input`?(r||Ws(n))&&(s=!0):t.push({text:n,expands:r}),o=void 0,n=``,r=!1,!1)};for(let t=0;t<e.length&&!s;t+=1){let l=e[t];if(a===`'`){l===`'`?a=void 0:n+=l;continue}if(a===`"`){l===`"`?a=void 0:Hs.has(l)?s=!0:n+=l;continue}if(l===`'`||l===`"`){a=l,i=!0;continue}if(l===` `||l===` `){c();continue}if(l===`>`||l===`<`||l===`&`&&e[t+1]===`>`){i&&!/^\d+$/.test(n)&&c(),n=``,r=!1,i=!1,l===`&`&&(t+=1);let a=l===`&`?`>`:l,u=e[t+1];if(a===`<`&&(u===`<`||u===`>`)){s=!0;break}if((u===a||u===`|`)&&(t+=1,u=e[t+1]),u===`&`&&l!==`&`){t+=1,o=`duplicate`;continue}o=a===`>`?`output`:`input`;continue}if(!Vs.test(l)){s=!0;break}Us.has(l)&&(r=!0),n+=l,i=!0}return a!==void 0&&(s=!0),c(),o!==void 0&&(s=!0),{words:t,refused:s}}function Js(e){let t=e.findIndex(e=>e.text===`--`);return(t<0?e:e.slice(0,t)).filter(e=>e.text.startsWith(`-`))}function Ys(e){return e.every(e=>!e.expands&&!js.has(e.text))}function Xs(e){let t=e.filter(e=>e.text.startsWith(`-`)),n=t.some(e=>Rs.has(e.text));return t.every(e=>Rs.has(e.text)||zs.has(e.text))&&(n||t.length===e.length)}function Zs(e){let[t,...n]=e[0]?.text===`--no-pager`?e.slice(1):e;return t===void 0||t.expands||!Ls.has(t.text)||n.some(e=>e.expands)||n.some(e=>/^-[XO]/.test(e.text))||n.some(e=>/^--(output|ext-diff|open-files-in-pager|no-index)/.test(e.text))?!1:t.text===`branch`?Xs(n):t.text!==`remote`||n.every(e=>e.text===`-v`||e.text===`--verbose`)}function Qs(e){let[t,...n]=e;return t===void 0||t.expands||t.text.includes(`=`)||t.text.includes(`/`)||n.some(e=>/^[@=]/.test(e.text))||n.some(e=>e.expands)?!1:t.text===`echo`?!0:n.some(e=>Ws(e.text))||Is(t.text,n)?!1:t.text===`cd`?n.length===1&&n[0].text!==`-`&&!n[0].expands:As.has(t.text)?!0:t.text===`find`?Ys(n):t.text===`git`&&Zs(n)}const $s=new Set([`echo`,`which`,`git`]);function ec(e,t){let n;for(let[r,...i]of e)if(!$s.has(r.text))for(let e of i){if(e.text===`--`)continue;if(t===void 0)return!1;let i=t(n,e.text);if(i===void 0)return!1;r.text===`cd`&&(n=i)}return!0}function tc(e,t={}){if(t.otherDirectory===!0||e.length>1e4||Ks(e)||/[^\t\n\x20-\x7e]/.test(e))return!1;let n=Uo(e);if(n.length===0)return!1;let r=n.map(qs);if(r.some(e=>e.refused||!Qs(e.words)))return!1;let i=r.map(e=>e.words[0].text);return i.includes(`git`)&&i.includes(`cd`)?!1:ec(r.map(e=>e.words),t.resolveInWorkspace)}function nc(e){let t=e.indexOf(`(`);return t===-1?{toolName:e.trim(),argPattern:void 0}:{toolName:e.slice(0,t).trim(),argPattern:e.slice(t+1,e.lastIndexOf(`)`)).trim()}}const Q=new Map;function rc(e,t){Q.set(e,{...Q.get(e),...t})}function ic(){Q.clear()}function ac(e){return Q.get(e)??{}}function oc(e,t){let n=[t,...Q.get(t)?.aliases??[]];if(!e.includes(`*`))return n.includes(e);let r=Zo(e);return n.some(e=>r.test(e))}function sc(e,t){let n=/^([A-Za-z_]\w*):([\s\S]*)$/.exec(t);if(n===null)return;let r=n[1],i=Q.get(e);if(i?.argument?.key===r)return`primary`;if(i?.parameters?.includes(r)===!0)return{name:r,value:n[2]}}function cc(e,t){if(!Object.prototype.hasOwnProperty.call(t,e.name))return`no-match`;let n=t[e.name];return n===void 0?`no-match`:typeof n!=`string`&&typeof n!=`number`&&typeof n!=`boolean`?`unevaluable`:Zo(e.value).test(String(n))?`match`:`no-match`}function lc(e,t){return t.some(t=>{let n=nc(t);return(n.argPattern===void 0||n.argPattern===`*`||n.argPattern===`**`)&&oc(n.toolName,e)})}function uc(e){return Q.get(e)?.argument?.key}function dc(e,t){let n=uc(e);if(n===void 0)return;let r=t[n];return typeof r==`string`?r:void 0}function fc(e,t,n,r=`allow`){return n.some(n=>mc(e,t,n,r)===`match`)}function pc(e,t,n){return n.some(n=>mc(e,t,n,`deny`)===`unevaluable`)}function mc(e,t,n,r){let i=nc(n);if(!oc(i.toolName,e))return`no-match`;if(i.argPattern===void 0||i.argPattern===`*`||i.argPattern===`**`)return`match`;let a=sc(e,i.argPattern);if(a===`primary`)return`unevaluable`;if(a!==void 0)return r===`deny`?cc(a,t):`no-match`;let o=Q.get(e)?.argument;if(o===void 0)return`unevaluable`;let s=dc(e,t);if(s===void 0)return`no-match`;switch(o.kind){case`url`:return ms(i.argPattern,s);case`path`:return ns(i.argPattern,s);case`command`:return Qo(i.argPattern,s,r);case`text`:return Zo(i.argPattern).test(s)?`match`:`no-match`;default:{let e=o.kind;throw Error(`unknown argument kind: ${String(e)}`)}}}function hc(e,t,n){let r=Q.get(e),i=r?.argument;if(i===void 0)return!1;let a=t[i.key];return typeof a==`string`?i.kind===`command`?ks(a,n):i.kind===`path`&&r?.riskClass===`modify`&&xs(a):!1}function gc(e,t,n,r){return fc(e,t,n,`deny`)||pc(e,t,n)||hc(e,t,r)}function _c(e,t,n={},r={}){return pc(e,t,n.deny??[])||gc(e,t,n.ask??[],r)}const vc=[`workingDirectory`,`cwd`];function yc(e,t,n){let r=Q.get(e);if(r?.riskClass!==`execute`||r.argument?.kind!==`command`)return r?.riskClass;let i=t[r.argument.key];return typeof i==`string`&&tc(i,{otherDirectory:vc.some(e=>t[e]!==void 0),...n.resolveInWorkspace===void 0?{}:{resolveInWorkspace:n.resolveInWorkspace}})?`inspect`:r.riskClass}function bc(e,t,n,r={},i={}){let{allow:a=[],deny:o=[],ask:s=[]}=r,c=yc(e,t,i),l=n===`plan`&&c!==`inspect`?`deny`:`approve`;return fc(e,t,o,`deny`)||i.ceiling!==void 0&&!fc(e,t,i.ceiling)||Q.get(e)?.repliesToPeer===!0&&i.peerTurn!==!0?`deny`:pc(e,t,o)?n===`plan`?`deny`:`approve`:gc(e,t,s,i)||i.askAll===!0?l:n===`bypassPermissions`||fc(e,t,a)||i.sandboxAutoApproved===!0&&c===`execute`&&(n==="default"||n===`acceptEdits`||n===`auto`)?`auto`:c===void 0?gs[n]:hs[n][c]}function xc(e,t={}){let n=t.taskDeny??[];switch(e){case`deny`:return{ceiling:[],askAll:!1,allow:[],deny:n};case`prompt`:return{askAll:!0,allow:[],deny:n};case`preapproved`:{let e=t.taskAllow??[];return{ceiling:e,askAll:!1,allow:e,deny:n}}case`inherit-allowlist`:return{ceiling:t.parentAllow??[],askAll:!1,allow:[],deny:n};default:throw Error(`unknown permission policy: ${String(e)}`)}}const Sc=/^[A-Za-z_]\w*:(?!\/\/)/;function Cc(e){return e.slice(0,e.indexOf(`*`)).includes(`__`)}function wc(e,t=`deny`){let n=e.trim();if(n===``)return`is empty`;if(n.includes(`(`)&&!n.endsWith(`)`))return`opens "(" without closing it`;let{toolName:r,argPattern:i}=nc(n);if(r===``)return`names no tool`;if(t===`allow`&&r.includes(`*`)&&!Cc(r))return`globs the tool name without a literal "<server>__" prefix, which an allow rule may not do`;if(i===void 0||i===`*`||i===`**`)return;if(i===``)return`has an empty argument pattern; write Tool or Tool(*) instead`;if(r.includes(`*`))return t===`allow`&&Sc.test(i)?`matches a named parameter, which only deny and ask rules may do`:void 0;let a=sc(r,i);if(a!==void 0&&a!==`primary`)return t===`allow`?`matches a named parameter, which only deny and ask rules may do`:void 0;let o=ac(r);if(!(o.parameters===void 0&&Sc.test(i)&&sc(r,i)===void 0)){if(o.argument===void 0)return o.riskClass===void 0?void 0:`tool "${r}" declares no argument key, so an argument-scoped pattern can never be evaluated`;if(o.argument.kind===`url`&&ms(i,`https://probe.invalid/`)===`unevaluable`)return`does not fit the URL pattern grammar scheme://host[:port][/path] that "${r}" is matched by`}}function Tc(e,t=`deny`){let n=[];for(let r of e){let e=wc(r,t);e!==void 0&&n.push({pattern:r,reason:e})}return n}function Ec(e){let t=[];for(let n of e){let{toolName:e,argPattern:r}=nc(n.trim());if(r===void 0||e.includes(`*`))continue;let i=ac(e),a=sc(e,r);if(a===void 0&&i.parameters!==void 0&&i.argument?.kind!==`url`&&Sc.test(r)){t.push({pattern:n,reason:`names no parameter of "${e}" (${i.parameters.join(`, `)}), so it is read as an ordinary argument pattern`});continue}if(a!==`primary`)continue;let o=ac(e).argument?.key??``;t.push({pattern:n,reason:`names "${e}"'s primary field "${o}", so it asks on every call; write ${e}(${r.slice(o.length+1)}) instead`})}return t}function Dc(e){return(e??[]).map(e=>`${e}(*)`)}function Oc(e,t){let n=Dc(t.allowedTools),r=Tc(n,`allow`);if(r.length>0){let e=r.map(({pattern:e,reason:t})=>`"${e}" ${t}`).join(`; `);throw Error(`Invalid preset allowedTools: ${e}.`)}return{allow:[...e.allow,...n],deny:[...new Set([...e.deny,...Dc(t.deniedTools)])]}}const kc=[`Bash`,`Shell`,`BackgroundProcess`],Ac=[`Agent`],jc=[...kc,...Ac,`ExecuteCommand`,`Computer`],Mc=`python.node.deno.bun.ruby.perl.php.bash.sh.zsh.fish.pwsh.powershell.cmd.env.xargs.eval.exec.sudo.timeout.nohup.nice.time.command.setsid.stdbuf.watch.ssh.docker.podman.find`.split(`.`),Nc=[`npm run`,`npm run-script`,`npm exec`,`npm x`,`npx`,`pnpm`,`pnpx`,`yarn`,`bunx`,`uv run`,`uvx`,`pipx run`,`cargo run`,`go run`,`make`,`just`].map(e=>e.split(` `)),Pc=new Set([`run`,`run-script`,`exec`,`dlx`,`x`,`--`]);function Fc(e){return(e.split(/[\\/]/).pop()??e).replace(/(\.exe)?$/i,``).replace(/[\d.]+$/,``)}function Ic(e,t){if(e.length===0)return!0;let n=(e,n,r)=>t&&r?e.startsWith(n):e===n,r=Fc(e[0]);if(Mc.some(t=>n(t,r,e.length===1)))return!0;for(let i of Nc){let a=Math.min(i.length,e.length);if(!i.slice(0,a).every((t,i)=>n(t,i===0?r:e[i],i===e.length-1)))continue;if(e.length<=i.length)return!0;let o=e.slice(i.length);for(;o.length>0&&(o[0].startsWith(`-`)||Pc.has(o[0]));)o=o.slice(1);return o.length===0||Ic(o,t)}return!1}function Lc(e){let t=e.trim();if(!t.includes(`*`))return!1;let n=t.slice(0,t.indexOf(`*`));return Ic(n.trim().split(/\s+/).filter(e=>e.length>0),n.length>0&&!/\s$/.test(n))}function Rc(e){let{toolName:t,argPattern:n}=nc(e),r=e=>e.some(e=>oc(t,e));return r(Ac)?!0:t.includes(`*`)?r(jc):jc.includes(t)||ac(t).riskClass===`execute`?n===void 0||n.trim()===`*`||kc.includes(t)&&Lc(n):!1}function zc(e){return e.filter(e=>!Rc(e))}const Bc=1e6,Vc={"claude-opus-4-7":{inputPerMillion:15,outputPerMillion:75},"claude-opus-4-5":{inputPerMillion:15,outputPerMillion:75},"claude-sonnet-4-6":{inputPerMillion:3,outputPerMillion:15},"claude-sonnet-4-5":{inputPerMillion:3,outputPerMillion:15},"claude-haiku-4-5":{inputPerMillion:.8,outputPerMillion:4},"claude-3-5-sonnet-20241022":{inputPerMillion:3,outputPerMillion:15},"claude-3-5-haiku-20241022":{inputPerMillion:.8,outputPerMillion:4},"claude-3-opus-20240229":{inputPerMillion:15,outputPerMillion:75},"gpt-4o":{inputPerMillion:2.5,outputPerMillion:10},"gpt-4o-mini":{inputPerMillion:.15,outputPerMillion:.6},o1:{inputPerMillion:15,outputPerMillion:60},"o1-mini":{inputPerMillion:3,outputPerMillion:12},o3:{inputPerMillion:10,outputPerMillion:40},"o3-mini":{inputPerMillion:1.1,outputPerMillion:4.4},"deepseek-chat":{inputPerMillion:.14,outputPerMillion:.28},"deepseek-reasoner":{inputPerMillion:.55,outputPerMillion:2.19},"gemini-2.0-flash":{inputPerMillion:.1,outputPerMillion:.4},"gemini-2.0-flash-thinking":{inputPerMillion:.35,outputPerMillion:3.5},"gemini-1.5-pro":{inputPerMillion:1.25,outputPerMillion:5},"gemini-1.5-flash":{inputPerMillion:.075,outputPerMillion:.3}},Hc=[{pattern:/claude-opus/i,price:{inputPerMillion:15,outputPerMillion:75}},{pattern:/claude-sonnet/i,price:{inputPerMillion:3,outputPerMillion:15}},{pattern:/claude-haiku/i,price:{inputPerMillion:.8,outputPerMillion:4}},{pattern:/gpt-4o-mini/i,price:{inputPerMillion:.15,outputPerMillion:.6}},{pattern:/gpt-4/i,price:{inputPerMillion:2.5,outputPerMillion:10}},{pattern:/deepseek/i,price:{inputPerMillion:.14,outputPerMillion:.28}},{pattern:/gemini-2/i,price:{inputPerMillion:.1,outputPerMillion:.4}},{pattern:/gemini-1/i,price:{inputPerMillion:1.25,outputPerMillion:5}}];function Uc(e){let t=Object.hasOwn(Vc,e)?Vc[e]:void 0;if(t)return t;for(let{pattern:t,price:n}of Hc)if(t.test(e))return n}function Wc(e,t,n){let r=Uc(e);if(r)return t/Bc*r.inputPerMillion+n/Bc*r.outputPerMillion}function Gc(e){let t=Uc(e);if(t)return(t.inputPerMillion+t.outputPerMillion)/2/1e3}function Kc(e,t){if(!e.matcher)return!0;if(!t)return!1;try{return new RegExp(e.matcher).test(t)}catch{return e.matcher===t}}function qc(e){if(e.tool_name)return e.tool_name;if(e.hook_event_name===`SubagentStart`||e.hook_event_name===`SubagentStop`)return e.agent_type??e.agent_id;if(e.hook_event_name===`SessionEnd`)return e.reason}async function Jc(){let[{CommandExecutor:e},{HttpExecutor:t}]=await Promise.all([Promise.resolve().then(()=>require("./command-executor-Aat_q7P2.cjs")).then(e=>e.n),Promise.resolve().then(()=>require("./http-executor-71JiIdFP.cjs")).then(e=>e.n)]);return[new e,new t]}async function Yc(e,t,r,i,a){if(!e)return{blocked:!1,stdout:``};let o=new Set,s=[],c=()=>({...o.size>0&&{unknownHookTypes:[...o].sort()},...s.length>0&&{errors:[...s]}}),l=e[t];if(!l||l.length===0)return{blocked:!1,stdout:``};let u=i??await Jc(),d=new Map;for(let e of u)d.set(e.type,e);let f=[],p=qc(r),m=-1,h,g;for(let e of l){if(!Kc(e,p))continue;let i=e.env?{...r,env:{...r.env,...e.env}}:r;for(let r of e.hooks){let e=d.get(r.type);if(!e){o.add(r.type);continue}let l=r.type===`command`&&a!==void 0?await e.execute(r,i,a):await e.execute(r,i);if(l.outcome===`deny`)return{blocked:!0,reason:l.reason||`Blocked by hook`,stdout:f.join(`
10
+ `||r===`&`&&Yo(t,n))return Wo(e),n}function Yo(e,t){let n=e[t-1];return n!==`>`&&n!==`<`&&e[t+1]!==`>`}const Xo=/[.+^${}()|[\]\\]/g;function Zo(e){let t=e.replace(Xo,`\\$&`).replace(/\*\*/g,`.+`).replace(/\*/g,`.*`);return RegExp(`^${t}$`)}function Qo(e,t,n){let r=Zo(e);return n===`deny`?r.test(t)||Uo(t).some(e=>r.test(e))?`match`:`no-match`:r.test(t)?e.includes(`*`)&&Ho(t)?`no-match`:`match`:`no-match`}function $o(e){let t=e.replace(/\*\*(?:\/\*\*)+/g,`**`).split(/(\/\*\*\/|\/\*\*$|^\*\*\/|\*\*)/).map(e=>e===`/**/`?`(?:/.*)?/`:e===`/**`?`(?:/.*)?`:e===`**/`?`(?:.*/)?`:e===`**`?`.*`:e.replace(Xo,`\\$&`).replace(/\*/g,`[^/]*`).replace(/\uE000/g,`\\*`)).join(``);return RegExp(`^${t}$`)}function es(e){return e.startsWith(`/`)||/^[A-Za-z]:(?=\/|$)/.test(e)}function ts(e){let t=e.replace(/\\/g,`/`),n=t.startsWith(`/`),r=[];for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){r.length>0&&r[r.length-1]!==`..`?r.pop():n||r.push(`..`);continue}r.push(e)}let i=(n?`/`:``)+r.join(`/`);return(i===``?`.`:i).replace(/^[A-Za-z]:(?=\/|$)/,e=>e.toLowerCase())}function ns(e,t){let n=ts(e),r=ts(t);return es(n)&&!es(r)?`unevaluable`:$o(n).test(r)?`match`:`no-match`}const rs=/^(\*|[a-z][a-z0-9+.-]*):\/\/(\[[0-9a-fA-F:.]+\]|[^/\\:?#@[\]]+)(?::(\d+|\*))?(\/[^?#]*)?$/i,is=new Set([`http`,`https`,`ws`,`wss`,`ftp`]),as={http:`80`,https:`443`,ws:`80`,wss:`443`,ftp:`21`};function os(e){return e.replace(/\.$/,``).toLowerCase()}function ss(e){try{let t=new URL(`http://${e}/`).hostname;return t===``||t.includes(`.`)?null:t}catch{return null}}function cs(e){let t=os(e).replace(/\*\*(?:\.\*\*)+/g,`**`).split(`.`),n=[],r=`[^.]+(?:\\.[^.]+)*`;for(let[e,i]of t.entries()){let a=e===0,o=e===t.length-1;if(i===`**`){a&&o?n.push(r):o?n.push(`(?:\\.${r})?`):n.push(`${a?``:`\\.`}(?:${r}\\.)?`);continue}let s=!a&&t[e-1]===`**`,c=a||s?``:`\\.`;if(i===`*`)n.push(`${c}${r}`);else if(i.includes(`**`))return null;else if(i.includes(`*`))n.push(`${c}${i.replace(Xo,`\\$&`).replace(/\*/g,`[^.]*`)}`);else{let e=ss(i);if(e===null)return null;n.push(`${c}${e.replace(Xo,`\\$&`)}`)}}return RegExp(`^${n.join(``)}$`)}function ls(e){try{let t=e.split(`/`).map(e=>decodeURIComponent(e));return t.some(e=>e.includes(`/`))?null:t.join(`/`)}catch{return null}}function us(e){let t;try{t=new URL(e)}catch{return null}let n=t.protocol.slice(0,-1).toLowerCase();return!is.has(n)||t.hostname===``||t.username!==``||t.password!==``?null:t}function ds(e,t){if(e.includes(`*`)){let n=cs(e);return n===null?`unevaluable`:n.test(t)?`match`:`no-match`}let n;try{n=new URL(`http://${e}/`).hostname}catch{return`unevaluable`}return os(n)===t?`match`:`no-match`}function fs(e,t,n){return e===void 0?t.port===``:e===`*`||e===(t.port===``?as[n]:t.port)}function ps(e,t){let n=ls(t),r=ls(e.replace(/%2a/gi,``));return n===null||r===null?`unevaluable`:$o(r).test(n)?`match`:`no-match`}function ms(e,t){let n=rs.exec(e);if(n===null)return`unevaluable`;let[,r,i,a,o]=n,s=us(t);if(s===null)return`unevaluable`;let c=s.protocol.slice(0,-1).toLowerCase();if(r!==`*`&&r.toLowerCase()!==c)return`no-match`;let l=ds(i,os(s.hostname));return l===`match`?fs(a,s,c)?o===void 0?`match`:ps(o,s.pathname):`no-match`:l}const hs={plan:{inspect:`auto`,modify:`deny`,execute:`deny`},default:{inspect:`auto`,modify:`approve`,execute:`approve`},acceptEdits:{inspect:`auto`,modify:`auto`,execute:`approve`},bypassPermissions:{inspect:`auto`,modify:`auto`,execute:`auto`},auto:{inspect:`auto`,modify:`auto`,execute:`approve`}},gs={plan:`deny`,default:`approve`,acceptEdits:`approve`,bypassPermissions:`auto`,auto:`approve`},_s=[`.git`,`.robota`,`.claude`,`.agents`],vs=[`.mcp.json`,`.gitconfig`,`.npmrc`,`.bashrc`,`.bash_profile`,`.bash_login`,`.zshrc`,`.zshenv`,`.zprofile`,`.profile`];function ys(e){return e.replace(/\\/g,`/`).split(`/`).filter(e=>e!==``&&e!==`.`)}function bs(e){let t=[];for(let n of ys(e))n===`..`&&t.length>0&&t[t.length-1]!==`..`?t.pop():t.push(n);return t}function xs(e){let t=bs(e),n=t[t.length-1];if(n!==void 0&&vs.includes(n))return!0;for(let e=0;e<t.length;e+=1){let n=t[e];if(_s.includes(n)){if((n===`.robota`||n===`.claude`)&&t[e+1]===`worktrees`&&t[e+2]!==void 0){e+=2;continue}return!0}}return!1}function Ss(e){let t=[];for(let n of ys(e))n===`..`?t.pop():t.push(n);return`/${t.join(`/`)}`}function Cs(e){return e.replace(/^(['"])(.*)\1$/,`$2`)}const ws=/^(?:~|\$HOME|\$\{HOME\})(?=\/|$)(.*)$/;function Ts(e,t){let n=Cs(e),r=ws.exec(n),i;if(r!==null){let e=r[1]??``;if(t.homeDirectory===void 0)return e.replace(/\/+/g,``)===``;i=Ss(`${t.homeDirectory}/${e}`)}else if(n===``||n.startsWith(`$`))return!1;else if(n.startsWith(`/`))i=Ss(n);else{if(t.cwd===void 0)return!1;i=Ss(`${t.cwd}/${n}`)}if(ys(i).length<=1||t.homeDirectory!==void 0&&i===Ss(t.homeDirectory))return!0;if(t.cwd!==void 0){let e=Ss(t.cwd);if(e===i||e.startsWith(`${i}/`))return!0}return!1}const Es=new Set([`rm`,`rmdir`]),Ds=new Map([[`sudo`,new Set([`-u`,`-g`,`-h`,`-p`,`-C`,`-D`,`-r`,`-t`,`-U`,`-T`])],[`nice`,new Set([`-n`])],[`env`,new Set([`-u`,`-C`,`-S`])],[`command`,new Set],[`builtin`,new Set],[`nohup`,new Set],[`time`,new Set]]);function Os(e){let t=0,n;for(;t<e.length;){let r=e[t];if(/^[A-Za-z_]\w*=/.test(r)){t+=1;continue}let i=Ds.get(r);if(i!==void 0){n=i,t+=1;continue}if(n!==void 0&&r.startsWith(`-`)){t+=n.has(r)?2:1;continue}return t}return t}function ks(e,t){return Uo(e).some(e=>{let n=e.split(/\s+/).filter(e=>e!==``),r=Os(n),i=n[r];if(i===void 0)return!1;let a=i.slice(i.lastIndexOf(`/`)+1);if(!Es.has(a))return!1;let o=!1;return n.slice(r+1).some(e=>!o&&e===`--`?(o=!0,!1):!o&&e.startsWith(`-`)?!1:Ts(e,t))})}const As=new Set([`ls`,`cat`,`echo`,`pwd`,`head`,`tail`,`grep`,`wc`,`which`,`stat`,`du`,`cd`]),js=new Set([`-exec`,`-execdir`,`-ok`,`-okdir`,`-delete`,`-fprint`,`-fprint0`,`-fprintf`,`-fls`]),Ms={ls:`aAlhtrSR1dFGinpsucCgmoQvx`,cat:`nbsvetAE`,head:`nqvc`,tail:`nqvcfF`,grep:`rinlLvcwxEFGPHhoqsABCmz`,wc:`lwcmL`,stat:`cftx`,du:`hsacdkmx`,which:`a`,pwd:`LP`,cd:`LP`},Ns=/^--?[A-Za-z0-9-]*(file|from|contents)(=|$)/,Ps=[`--dereference`,`--dereference-recursive`,`--dereference-args`,`--dereference-command-line`,`--file`,`--files0-from`,`--exclude-from`,`--from-file`,`--to-file`,`--contents`,`--ignore-revs-file`,`--output`,`--output-directory`,`--ext-diff`,`--no-index`,`--open-files-in-pager`];function Fs(e){if(!e.startsWith(`--`)||e.length<=2)return!1;let t=e.split(`=`,1)[0];return Ps.some(e=>e.startsWith(t))}function Is(e,t){if(Js(t).some(e=>Ns.test(e.text)||Fs(e.text)))return!0;if(e===`find`)return Js(t).some(e=>e.text===`-L`||e.text===`-follow`);let n=Ms[e];return n!==void 0&&Js(t).some(({text:e})=>e.startsWith(`--`)||!/^-[A-Za-z]/.test(e)?!1:[...e.slice(1)].some(e=>!/\d/.test(e)&&!n.includes(e)))}const Ls=new Set([`status`,`log`,`diff`,`show`,`rev-parse`,`ls-files`,`describe`,`branch`,`remote`]),Rs=new Set([`-l`,`--list`,`--show-current`,`--merged`,`--no-merged`,`--contains`,`--no-contains`,`--points-at`]),zs=new Set([`-a`,`--all`,`-r`,`--remotes`,`-v`,`-vv`,`--verbose`,`--color`,`--no-color`]),Bs=new Set([`/dev/null`]),Vs=/[A-Za-z0-9_./:=@+,*?[\]~-]/,Hs=new Set([`$`,"`",`\\`,`!`]),Us=new Set([`*`,`?`,`[`]);function Ws(e){return/(^|[=,:])[/~]/.test(e)||/^-[A-Za-z]+[/~]/.test(e)||/(^|[/=,:]|^-[A-Za-z]+)\.\.(\/|$)/.test(e)||/(^|[=,])[A-Za-z][A-Za-z0-9]*:/.test(e)||Gs(e)}function Gs(e){let t=e.split(`/`),n=e=>/[*?[]/.test(e);if(t.slice(0,-1).some(n))return!0;let r=t[t.length-1];return n(r)&&/^[.?[]/.test(r)}function Ks(e){let t;for(let n of e){if(t===`'`){n===`'`&&(t=void 0);continue}if(n===`$`||n==="`"||n===`\\`)return!0;if(t===`"`){n===`"`&&(t=void 0);continue}if(n===`'`||n===`"`)t=n;else if(n===`(`||n===`)`||n===`{`||n===`}`)return!0}return!1}function qs(e){let t=[],n=``,r=!1,i=!1,a,o,s=!1,c=()=>{i&&=(o===`output`?(!Bs.has(n)||r)&&(s=!0):o===`duplicate`?/^(\d+|-)$/.test(n)||(s=!0):o===`input`?(r||Ws(n))&&(s=!0):t.push({text:n,expands:r}),o=void 0,n=``,r=!1,!1)};for(let t=0;t<e.length&&!s;t+=1){let l=e[t];if(a===`'`){l===`'`?a=void 0:n+=l;continue}if(a===`"`){l===`"`?a=void 0:Hs.has(l)?s=!0:n+=l;continue}if(l===`'`||l===`"`){a=l,i=!0;continue}if(l===` `||l===` `){c();continue}if(l===`>`||l===`<`||l===`&`&&e[t+1]===`>`){i&&!/^\d+$/.test(n)&&c(),n=``,r=!1,i=!1,l===`&`&&(t+=1);let a=l===`&`?`>`:l,u=e[t+1];if(a===`<`&&(u===`<`||u===`>`)){s=!0;break}if((u===a||u===`|`)&&(t+=1,u=e[t+1]),u===`&`&&l!==`&`){t+=1,o=`duplicate`;continue}o=a===`>`?`output`:`input`;continue}if(!Vs.test(l)){s=!0;break}Us.has(l)&&(r=!0),n+=l,i=!0}return a!==void 0&&(s=!0),c(),o!==void 0&&(s=!0),{words:t,refused:s}}function Js(e){let t=e.findIndex(e=>e.text===`--`);return(t<0?e:e.slice(0,t)).filter(e=>e.text.startsWith(`-`))}function Ys(e){return e.every(e=>!e.expands&&!js.has(e.text))}function Xs(e){let t=e.filter(e=>e.text.startsWith(`-`)),n=t.some(e=>Rs.has(e.text));return t.every(e=>Rs.has(e.text)||zs.has(e.text))&&(n||t.length===e.length)}function Zs(e){let[t,...n]=e[0]?.text===`--no-pager`?e.slice(1):e;return t===void 0||t.expands||!Ls.has(t.text)||n.some(e=>e.expands)||n.some(e=>/^-[XO]/.test(e.text))||n.some(e=>/^--(output|ext-diff|open-files-in-pager|no-index)/.test(e.text))?!1:t.text===`branch`?Xs(n):t.text!==`remote`||n.every(e=>e.text===`-v`||e.text===`--verbose`)}function Qs(e){let[t,...n]=e;return t===void 0||t.expands||t.text.includes(`=`)||t.text.includes(`/`)||n.some(e=>/^[@=]/.test(e.text))||n.some(e=>e.expands)?!1:t.text===`echo`?!0:n.some(e=>Ws(e.text))||Is(t.text,n)?!1:t.text===`cd`?n.length===1&&n[0].text!==`-`&&!n[0].expands:As.has(t.text)?!0:t.text===`find`?Ys(n):t.text===`git`&&Zs(n)}const $s=new Set([`echo`,`which`,`git`]);function ec(e,t){let n;for(let[r,...i]of e)if(!$s.has(r.text))for(let e of i){if(e.text===`--`)continue;if(t===void 0)return!1;let i=t(n,e.text);if(i===void 0)return!1;r.text===`cd`&&(n=i)}return!0}function tc(e,t={}){if(t.otherDirectory===!0||e.length>1e4||Ks(e)||/[^\t\n\x20-\x7e]/.test(e))return!1;let n=Uo(e);if(n.length===0)return!1;let r=n.map(qs);if(r.some(e=>e.refused||!Qs(e.words)))return!1;let i=r.map(e=>e.words[0].text);return i.includes(`git`)&&i.includes(`cd`)?!1:ec(r.map(e=>e.words),t.resolveInWorkspace)}function nc(e){let t=e.indexOf(`(`);return t===-1?{toolName:e.trim(),argPattern:void 0}:{toolName:e.slice(0,t).trim(),argPattern:e.slice(t+1,e.lastIndexOf(`)`)).trim()}}const Q=new Map;function rc(e,t){Q.set(e,{...Q.get(e),...t})}function ic(){Q.clear()}function ac(e){return Q.get(e)??{}}function oc(e,t){let n=[t,...Q.get(t)?.aliases??[]];if(!e.includes(`*`))return n.includes(e);let r=Zo(e);return n.some(e=>r.test(e))}function sc(e,t){let n=/^([A-Za-z_]\w*):([\s\S]*)$/.exec(t);if(n===null)return;let r=n[1],i=Q.get(e);if(i?.argument?.key===r)return`primary`;if(i?.parameters?.includes(r)===!0)return{name:r,value:n[2]}}function cc(e,t){if(!Object.prototype.hasOwnProperty.call(t,e.name))return`no-match`;let n=t[e.name];return n===void 0?`no-match`:typeof n!=`string`&&typeof n!=`number`&&typeof n!=`boolean`?`unevaluable`:Zo(e.value).test(String(n))?`match`:`no-match`}function lc(e,t){return t.some(t=>{let n=nc(t);return(n.argPattern===void 0||n.argPattern===`*`||n.argPattern===`**`)&&oc(n.toolName,e)})}function uc(e){return Q.get(e)?.argument?.key}function dc(e,t){let n=uc(e);if(n===void 0)return;let r=t[n];return typeof r==`string`?r:void 0}function fc(e,t,n,r=`allow`){return n.some(n=>mc(e,t,n,r)===`match`)}function pc(e,t,n){return n.some(n=>mc(e,t,n,`deny`)===`unevaluable`)}function mc(e,t,n,r){let i=nc(n);if(!oc(i.toolName,e))return`no-match`;if(i.argPattern===void 0||i.argPattern===`*`||i.argPattern===`**`)return`match`;let a=sc(e,i.argPattern);if(a===`primary`)return`unevaluable`;if(a!==void 0)return r===`deny`?cc(a,t):`no-match`;let o=Q.get(e)?.argument;if(o===void 0)return`unevaluable`;let s=dc(e,t);if(s===void 0)return`no-match`;switch(o.kind){case`url`:return ms(i.argPattern,s);case`path`:return ns(i.argPattern,s);case`command`:return Qo(i.argPattern,s,r);case`text`:return Zo(i.argPattern).test(s)?`match`:`no-match`;default:{let e=o.kind;throw Error(`unknown argument kind: ${String(e)}`)}}}function hc(e,t,n){let r=Q.get(e),i=r?.argument;if(i===void 0)return!1;let a=t[i.key];return typeof a==`string`?i.kind===`command`?ks(a,n):i.kind===`path`&&r?.riskClass===`modify`&&xs(a):!1}function gc(e,t,n,r){return fc(e,t,n,`deny`)||pc(e,t,n)||hc(e,t,r)}function _c(e,t,n={},r={}){return pc(e,t,n.deny??[])||gc(e,t,n.ask??[],r)}const vc=[`workingDirectory`,`cwd`];function yc(e,t,n){let r=Q.get(e);if(r?.riskClass!==`execute`||r.argument?.kind!==`command`)return r?.riskClass;let i=t[r.argument.key];return typeof i==`string`&&tc(i,{otherDirectory:vc.some(e=>t[e]!==void 0),...n.resolveInWorkspace===void 0?{}:{resolveInWorkspace:n.resolveInWorkspace}})?`inspect`:r.riskClass}function bc(e,t,n,r={},i={}){let{allow:a=[],deny:o=[],ask:s=[]}=r,c=yc(e,t,i),l=n===`plan`&&c!==`inspect`?`deny`:`approve`;return fc(e,t,o,`deny`)||i.ceiling!==void 0&&!fc(e,t,i.ceiling)||Q.get(e)?.repliesToPeer===!0&&i.peerTurn!==!0||Q.get(e)?.notInPeerTurn===!0&&i.peerTurn===!0?`deny`:pc(e,t,o)?n===`plan`?`deny`:`approve`:gc(e,t,s,i)||i.askAll===!0?l:n===`bypassPermissions`||fc(e,t,a)||i.sandboxAutoApproved===!0&&c===`execute`&&(n==="default"||n===`acceptEdits`||n===`auto`)?`auto`:c===void 0?gs[n]:hs[n][c]}function xc(e,t={}){let n=t.taskDeny??[];switch(e){case`deny`:return{ceiling:[],askAll:!1,allow:[],deny:n};case`prompt`:return{askAll:!0,allow:[],deny:n};case`preapproved`:{let e=t.taskAllow??[];return{ceiling:e,askAll:!1,allow:e,deny:n}}case`inherit-allowlist`:return{ceiling:t.parentAllow??[],askAll:!1,allow:[],deny:n};default:throw Error(`unknown permission policy: ${String(e)}`)}}const Sc=/^[A-Za-z_]\w*:(?!\/\/)/;function Cc(e){return e.slice(0,e.indexOf(`*`)).includes(`__`)}function wc(e,t=`deny`){let n=e.trim();if(n===``)return`is empty`;if(n.includes(`(`)&&!n.endsWith(`)`))return`opens "(" without closing it`;let{toolName:r,argPattern:i}=nc(n);if(r===``)return`names no tool`;if(t===`allow`&&r.includes(`*`)&&!Cc(r))return`globs the tool name without a literal "<server>__" prefix, which an allow rule may not do`;if(i===void 0||i===`*`||i===`**`)return;if(i===``)return`has an empty argument pattern; write Tool or Tool(*) instead`;if(r.includes(`*`))return t===`allow`&&Sc.test(i)?`matches a named parameter, which only deny and ask rules may do`:void 0;let a=sc(r,i);if(a!==void 0&&a!==`primary`)return t===`allow`?`matches a named parameter, which only deny and ask rules may do`:void 0;let o=ac(r);if(!(o.parameters===void 0&&Sc.test(i)&&sc(r,i)===void 0)){if(o.argument===void 0)return o.riskClass===void 0?void 0:`tool "${r}" declares no argument key, so an argument-scoped pattern can never be evaluated`;if(o.argument.kind===`url`&&ms(i,`https://probe.invalid/`)===`unevaluable`)return`does not fit the URL pattern grammar scheme://host[:port][/path] that "${r}" is matched by`}}function Tc(e,t=`deny`){let n=[];for(let r of e){let e=wc(r,t);e!==void 0&&n.push({pattern:r,reason:e})}return n}function Ec(e){let t=[];for(let n of e){let{toolName:e,argPattern:r}=nc(n.trim());if(r===void 0||e.includes(`*`))continue;let i=ac(e),a=sc(e,r);if(a===void 0&&i.parameters!==void 0&&i.argument?.kind!==`url`&&Sc.test(r)){t.push({pattern:n,reason:`names no parameter of "${e}" (${i.parameters.join(`, `)}), so it is read as an ordinary argument pattern`});continue}if(a!==`primary`)continue;let o=ac(e).argument?.key??``;t.push({pattern:n,reason:`names "${e}"'s primary field "${o}", so it asks on every call; write ${e}(${r.slice(o.length+1)}) instead`})}return t}function Dc(e){return(e??[]).map(e=>`${e}(*)`)}function Oc(e,t){let n=Dc(t.allowedTools),r=Tc(n,`allow`);if(r.length>0){let e=r.map(({pattern:e,reason:t})=>`"${e}" ${t}`).join(`; `);throw Error(`Invalid preset allowedTools: ${e}.`)}return{allow:[...e.allow,...n],deny:[...new Set([...e.deny,...Dc(t.deniedTools)])]}}const kc=[`Bash`,`Shell`,`BackgroundProcess`],Ac=[`Agent`],jc=[...kc,...Ac,`ExecuteCommand`,`Computer`],Mc=`python.node.deno.bun.ruby.perl.php.bash.sh.zsh.fish.pwsh.powershell.cmd.env.xargs.eval.exec.sudo.timeout.nohup.nice.time.command.setsid.stdbuf.watch.ssh.docker.podman.find`.split(`.`),Nc=[`npm run`,`npm run-script`,`npm exec`,`npm x`,`npx`,`pnpm`,`pnpx`,`yarn`,`bunx`,`uv run`,`uvx`,`pipx run`,`cargo run`,`go run`,`make`,`just`].map(e=>e.split(` `)),Pc=new Set([`run`,`run-script`,`exec`,`dlx`,`x`,`--`]);function Fc(e){return(e.split(/[\\/]/).pop()??e).replace(/(\.exe)?$/i,``).replace(/[\d.]+$/,``)}function Ic(e,t){if(e.length===0)return!0;let n=(e,n,r)=>t&&r?e.startsWith(n):e===n,r=Fc(e[0]);if(Mc.some(t=>n(t,r,e.length===1)))return!0;for(let i of Nc){let a=Math.min(i.length,e.length);if(!i.slice(0,a).every((t,i)=>n(t,i===0?r:e[i],i===e.length-1)))continue;if(e.length<=i.length)return!0;let o=e.slice(i.length);for(;o.length>0&&(o[0].startsWith(`-`)||Pc.has(o[0]));)o=o.slice(1);return o.length===0||Ic(o,t)}return!1}function Lc(e){let t=e.trim();if(!t.includes(`*`))return!1;let n=t.slice(0,t.indexOf(`*`));return Ic(n.trim().split(/\s+/).filter(e=>e.length>0),n.length>0&&!/\s$/.test(n))}function Rc(e){let{toolName:t,argPattern:n}=nc(e),r=e=>e.some(e=>oc(t,e));return r(Ac)?!0:t.includes(`*`)?r(jc):jc.includes(t)||ac(t).riskClass===`execute`?n===void 0||n.trim()===`*`||kc.includes(t)&&Lc(n):!1}function zc(e){return e.filter(e=>!Rc(e))}const Bc=1e6,Vc={"claude-opus-4-7":{inputPerMillion:15,outputPerMillion:75},"claude-opus-4-5":{inputPerMillion:15,outputPerMillion:75},"claude-sonnet-4-6":{inputPerMillion:3,outputPerMillion:15},"claude-sonnet-4-5":{inputPerMillion:3,outputPerMillion:15},"claude-haiku-4-5":{inputPerMillion:.8,outputPerMillion:4},"claude-3-5-sonnet-20241022":{inputPerMillion:3,outputPerMillion:15},"claude-3-5-haiku-20241022":{inputPerMillion:.8,outputPerMillion:4},"claude-3-opus-20240229":{inputPerMillion:15,outputPerMillion:75},"gpt-4o":{inputPerMillion:2.5,outputPerMillion:10},"gpt-4o-mini":{inputPerMillion:.15,outputPerMillion:.6},o1:{inputPerMillion:15,outputPerMillion:60},"o1-mini":{inputPerMillion:3,outputPerMillion:12},o3:{inputPerMillion:10,outputPerMillion:40},"o3-mini":{inputPerMillion:1.1,outputPerMillion:4.4},"deepseek-chat":{inputPerMillion:.14,outputPerMillion:.28},"deepseek-reasoner":{inputPerMillion:.55,outputPerMillion:2.19},"gemini-2.0-flash":{inputPerMillion:.1,outputPerMillion:.4},"gemini-2.0-flash-thinking":{inputPerMillion:.35,outputPerMillion:3.5},"gemini-1.5-pro":{inputPerMillion:1.25,outputPerMillion:5},"gemini-1.5-flash":{inputPerMillion:.075,outputPerMillion:.3}},Hc=[{pattern:/claude-opus/i,price:{inputPerMillion:15,outputPerMillion:75}},{pattern:/claude-sonnet/i,price:{inputPerMillion:3,outputPerMillion:15}},{pattern:/claude-haiku/i,price:{inputPerMillion:.8,outputPerMillion:4}},{pattern:/gpt-4o-mini/i,price:{inputPerMillion:.15,outputPerMillion:.6}},{pattern:/gpt-4/i,price:{inputPerMillion:2.5,outputPerMillion:10}},{pattern:/deepseek/i,price:{inputPerMillion:.14,outputPerMillion:.28}},{pattern:/gemini-2/i,price:{inputPerMillion:.1,outputPerMillion:.4}},{pattern:/gemini-1/i,price:{inputPerMillion:1.25,outputPerMillion:5}}];function Uc(e){let t=Object.hasOwn(Vc,e)?Vc[e]:void 0;if(t)return t;for(let{pattern:t,price:n}of Hc)if(t.test(e))return n}function Wc(e,t,n){let r=Uc(e);if(r)return t/Bc*r.inputPerMillion+n/Bc*r.outputPerMillion}function Gc(e){let t=Uc(e);if(t)return(t.inputPerMillion+t.outputPerMillion)/2/1e3}function Kc(e,t){if(!e.matcher)return!0;if(!t)return!1;try{return new RegExp(e.matcher).test(t)}catch{return e.matcher===t}}function qc(e){if(e.tool_name)return e.tool_name;if(e.hook_event_name===`SubagentStart`||e.hook_event_name===`SubagentStop`)return e.agent_type??e.agent_id;if(e.hook_event_name===`SessionEnd`)return e.reason}async function Jc(){let[{CommandExecutor:e},{HttpExecutor:t}]=await Promise.all([Promise.resolve().then(()=>require("./command-executor-Aat_q7P2.cjs")).then(e=>e.n),Promise.resolve().then(()=>require("./http-executor-71JiIdFP.cjs")).then(e=>e.n)]);return[new e,new t]}async function Yc(e,t,r,i,a){if(!e)return{blocked:!1,stdout:``};let o=new Set,s=[],c=()=>({...o.size>0&&{unknownHookTypes:[...o].sort()},...s.length>0&&{errors:[...s]}}),l=e[t];if(!l||l.length===0)return{blocked:!1,stdout:``};let u=i??await Jc(),d=new Map;for(let e of u)d.set(e.type,e);let f=[],p=qc(r),m=-1,h,g;for(let e of l){if(!Kc(e,p))continue;let i=e.env?{...r,env:{...r.env,...e.env}}:r;for(let r of e.hooks){let e=d.get(r.type);if(!e){o.add(r.type);continue}let l=r.type===`command`&&a!==void 0?await e.execute(r,i,a):await e.execute(r,i);if(l.outcome===`deny`)return{blocked:!0,reason:l.reason||`Blocked by hook`,stdout:f.join(`
11
11
  `),...c()};if(l.outcome===`error`){s.push(l);continue}let u=n.r(l.stdout,t);if(f.push(...u.context),u.blockReason!==void 0)return{blocked:!0,reason:u.blockReason,stdout:f.join(`
12
12
  `),...u.permissionDecision===`deny`&&{permissionDecision:`deny`},...c()};if(u.permissionDecision!==void 0){let e=n.n[u.permissionDecision];e>m&&(m=e,h=u.permissionDecision),e>=m&&u.updatedInput!==void 0&&(g=u.updatedInput)}}}let _={blocked:!1,stdout:f.join(`
13
13
  `)};h!==void 0&&(_.permissionDecision=h),g!==void 0&&(_.updatedInput=g);let{unknownHookTypes:v,errors:y}=c();return v!==void 0&&(_.unknownHookTypes=v),y!==void 0&&(_.errors=y),_}var Xc=class extends Error{guardrailName;guardrailReason;constructor(e,t){super(t),this.guardrailName=e,this.guardrailReason=t,this.name=`GuardrailBlock`}},Zc=class{type=`guardrail`;guardrails;constructor(e){this.guardrails=e instanceof Map?new Map(e):new Map(Object.entries(e))}async execute(e,t){if(e.type!==`guardrail`)return{outcome:`error`,source:`guardrail`,kind:`malformed-response`,reason:`GuardrailExecutor received a '${e.type}' definition`};if(e.guardrails){let t=e.guardrails.filter(e=>!this.guardrails.has(e));if(t.length>0)return{outcome:`deny`,source:`guardrail`,reason:`Unknown guardrail(s) referenced but not registered: ${t.join(`, `)}`}}let n=this.selectGuardrails(e.guardrails);if(n.length===0)return{outcome:`allow`,source:`guardrail`,stdout:``};try{await Promise.all(n.map(async([e,n])=>{let r;try{r=await n(t)}catch(t){throw new Xc(e,`Guardrail "${e}" errored: ${t instanceof Error?t.message:String(t)}`)}if(!r.pass)throw new Xc(e,r.reason??`Guardrail "${e}" blocked the turn`)}))}catch(e){if(e instanceof Xc)return{outcome:`deny`,source:`guardrail`,reason:e.guardrailReason};throw e}return{outcome:`allow`,source:`guardrail`,stdout:``}}selectGuardrails(e){if(!e)return[...this.guardrails.entries()];let t=[];for(let n of e){let e=this.guardrails.get(n);e&&t.push([n,e])}return t}};function $(e){return{posture:`advisory`,enforcementReachable:!1,rationale:`Fire-and-forget at ${e}: the result is never awaited, so no posture can be honoured here.`}}function Qc(e,t){return{posture:`advisory`,enforcementReachable:!1,rationale:`Awaited at ${e} but only ${t} is read; \`blocked\` is never consulted.`}}function $c(e){for(let t of Object.values(e))Object.freeze(t);return Object.freeze(e)}const el=$c({PreToolUse:{posture:`enforcing`,enforcementReachable:!0,rationale:"The tool-execution gate. `runPreToolHook` awaits the result and turns `blocked` into a denial, so a hook that reached no verdict must not read as approval (tracker issue #2075)."},SessionEnd:Qc(`session-lifecycle.ts`,`nothing`),PreCompact:Qc(`compaction-orchestrator.ts`,`nothing`),UserPromptSubmit:Qc(`session-run.ts`,"`stdout`"),PostToolUse:$(`tool-hook-helpers.ts`),SessionStart:$(`session-lifecycle.ts`),PostCompact:$(`session-history-ops.ts`),Stop:$(`session-run.ts`),StopFailure:$(`session-run.ts`),SubagentStart:$(`background-task-hooks.ts`),SubagentStop:$(`background-task-hooks.ts`),WorktreeCreate:$(`worktree-subagent-runner.ts`),WorktreeRemove:$(`worktree-subagent-runner.ts`),PreModelCall:$(`session-run.ts`),PostModelCall:$(`session-run.ts`),PermissionDecision:$(`permission-enforcer.ts`)});function tl(e){return el[e].posture===`enforcing`}exports.AGENT_EVENTS=j,exports.AGENT_EVENT_PREFIX=He,exports.AbstractAIProvider=Le,exports.AbstractAgent=ue,exports.AbstractEventService=Bn,exports.AbstractExecutor=Xe,exports.AbstractManager=de,exports.AbstractPlugin=Ye,exports.AbstractTool=Ze,exports.AgentFactory=fo,exports.AgentTemplates=oo,exports.AuthenticationError=n.g,exports.CONFIRM_NO=`no`,exports.CONFIRM_YES=`yes`,exports.CONTEXT_ESTIMATE_CHARS_PER_TOKEN=4,exports.CacheIntegrityError=n._,exports.CircuitBreakerOpenError=n.v,exports.ConfigurationError=n.y,exports.ConsoleLogger=Ae,exports.ConversationHistory=hn,exports.ConversationStore=mn,exports.DEFAULT_ABSTRACT_EVENT_SERVICE=Hn,exports.DEFAULT_BACKGROUND_PERMISSION_POLICY=`inherit-allowlist`,exports.DEFAULT_CONTEXT_WINDOW=Dr,exports.DEFAULT_MAX_OUTPUT=Nr,exports.DEFAULT_TOOL_RESULT_HARD_CHARS=25e3,exports.DEFAULT_TOOL_RESULT_WARNING_CHARS=1e4,exports.DEFERRED_WITHOUT_LOADER_MESSAGE=rr,exports.DefaultEventService=Vn,exports.ENV_REFERENCE_PREFIX=Qt,exports.EVENT_EMITTER_EVENTS=I,exports.EXECUTION_EVENTS=M,exports.EXECUTION_EVENT_PREFIX=N,exports.ErrorUtils=ot,exports.EventEmitterPlugin=An,exports.EventHistoryModule=Fo,exports.ExecutionProxy=Ro,exports.FunctionTool=tr,exports.GuardrailExecutor=Zc,exports.InMemoryEventEmitterMetrics=xn,exports.LocalExecutor=vn,exports.MAX_TOOL_RESULT_CHARS=5e5,exports.MODEL_EFFORT_VALUES=l,exports.MODEL_PRICES=Vc,exports.MessageConverter=et,exports.ModelNotAvailableError=n.b,exports.NetworkError=n.x,exports.ORCHESTRATION_EVENTS=Io,exports.ORCHESTRATION_EVENT_PREFIX=`orchestration`,exports.ObservableEventService=Jn,exports.PARAMETER_SCHEMA_KEYWORDS=t.t,exports.PERMISSIVE_TOOL_SCHEMA_PROFILE=t.n,exports.PROTECTED_DIRECTORY_NAMES=_s,exports.PROTECTED_FILE_NAMES=vs,exports.PROVIDER_CALL_EVENTS=Xn,exports.PROVIDER_FALLBACK_EVENTS=Zn,exports.PluginCategory=Be,exports.PluginError=n.S,exports.PluginPriority=Ve,exports.ProviderError=n.C,exports.RISK_CLASS_POLICY=hs,exports.RateLimitError=n.w,exports.Robota=To,exports.RobotaError=n.T,exports.SPAN_EVENTS=Yn,exports.SPAN_EVENT_PREFIX=`span`,exports.STRICT_TOOL_SCHEMA_PROFILE=t.r,exports.SameToolInputLoopError=n.E,exports.SilentLogger=Oe,exports.StorageError=n.D,exports.StructuredEventService=Kn,exports.StructuredOutputError=n.O,exports.TASK_EVENTS=Ur,exports.TASK_EVENT_PREFIX=`task`,exports.TOOL_BODY_EVENTS=$n,exports.TOOL_EVENTS=P,exports.TOOL_EVENT_PREFIX=Ue,exports.TOOL_PERMISSION_EVENTS=er,exports.TOOL_SCHEMA_PROJECTION_MAX_DEPTH=t.i,exports.TOOL_SCHEMA_PROJECTION_MAX_NODES=t.a,exports.TOOL_SEARCH_TOOL_NAME=E,exports.TRUST_TO_MODE=Vo,exports.ToolExecutionError=n.k,exports.ToolRegistry=Mn,exports.ToolResultAdmissionError=Oo,exports.TypeUtils=i,exports.UNCLASSIFIED_TOOL_FALLBACK=gs,exports.USER_EVENTS=Wr,exports.USER_EVENT_PREFIX=`user`,exports.UnsupportedShellError=n.m,exports.ValidationError=n.A,exports.Validator=L,exports.admitToolResult=Po,exports.allowRulesForAutoMode=zc,exports.applyPresetToolLists=Oc,exports.assertProviderNativeWebToolsAvailable=o,exports.assertResidentToolRemains=or,exports.bindEventServiceOwner=qn,exports.bindWithOwnerPath=q,exports.buildTraceparent=n.a,exports.calculateModelCost=Wc,exports.chatEntryToMessage=O,exports.classifyProviderFailure=St,exports.clearRegisteredToolProfiles=ic,exports.closeObjectSchemas=t.c,exports.collectAssistantUsageMetadata=Va,exports.composeEventName=Wn,exports.confirmAction=te,exports.createAssistantMessage=un,exports.createBoundedOutput=n.i,exports.createDefaultProviderCapabilities=a,exports.createExecutionProxy=zo,exports.createImageProviderFromDefinition=Xt,exports.createLogger=k,exports.createModelEffortOutcome=d,exports.createProviderFromConfig=an,exports.createRecordEnvResolver=qt,exports.createSystemMessage=dn,exports.createToolMessage=fn,exports.createUserMessage=ln,exports.createVideoProviderFromDefinition=Zt,exports.decodeHookVerdict=n.t,exports.estimateBlendedCostPer1000=Gc,exports.estimateContextTokensFromMessages=xr,exports.estimateSerializedContextTokens=yr,exports.estimateToolSchemaTokens=br,exports.evaluatePermission=bc,exports.extractEnumValues=At,exports.findInvalidPermissionPatterns=Tc,exports.findMediaProviderDefinition=T,exports.findModelDefinition=jr,exports.findPermissionPatternWarnings=Ec,exports.findProviderDefinition=g,exports.formatEnvReference=en,exports.formatSupportedProviderTypes=_,exports.formatTokenCount=Ir,exports.generateSpanId=Gn,exports.getGlobalLogLevel=Ne,exports.getGlobalLoggerSink=Fe,exports.getMessagesForAPI=ve,exports.getModelContextWindow=Mr,exports.getModelMaxOutput=Pr,exports.getModelName=Fr,exports.getProviderCapabilities=h,exports.getProviderCredentialRequirement=v,exports.getSchemaTypeName=Mt,exports.getToolEstimatedDuration=se,exports.getToolExecutionSteps=ce,exports.getToolPermissionProfile=ac,exports.hasUsableSecretReference=nn,exports.hasValidationConstraints=jt,exports.hashToolSchema=t.o,exports.isAbortFailure=$e,exports.isAssistantMessage=be,exports.isBroadExecutionAllowRule=Rc,exports.isChatEntry=D,exports.isConfirmed=ae,exports.isDefaultEventService=Un,exports.isEnforcing=tl,exports.isEnvReference=$t,exports.isImageGenerationProvider=S,exports.isMediaProviderDefinition=w,exports.isMintedSpanId=n.o,exports.isModelEffort=u,exports.isProgressReportingTool=oe,exports.isProtectedPath=xs,exports.isReadOnlyCommandLine=tc,exports.isRegistryTransactionError=co,exports.isSystemMessage=xe,exports.isToolDeniedOutright=lc,exports.isToolMessage=Se,exports.isUserMessage=ye,exports.isVideoGenerationProvider=C,exports.lifecycleOf=so,exports.logger=A,exports.lookupModelPrice=Uc,exports.matchesAnyPattern=fc,exports.messageToHistoryEntry=_e,exports.modelDeclaresCapability=b,exports.multiSelectAction=re,exports.normalizeProviderConfig=rn,exports.normalizeStructuredOutput=Vt,exports.outboundTraceContextFor=n.s,exports.parseParameterRule=sc,exports.parseStructuredResponseText=Wt,exports.peerDriverOf=Ca,exports.printablePeerDriver=wa,exports.processEnvResolver=G,exports.projectPermissionPolicy=xc,exports.projectToolSchema=t.s,exports.providerCallSpanId=n.c,exports.readModelFallbackNotice=Qn,exports.readProviderFailureDetails=pt,exports.readTokenUsageFromMessage=fr,exports.readTokenUsageFromMetadata=pr,exports.registerModelMetadata=kr,exports.registerToolPermissionProfile=rc,exports.removesCriticalPath=ks,exports.requiresFreshApproval=_c,exports.resolveEnvReference=tn,exports.resolveMediaProviderConfig=Yt,exports.resolveModelCapabilities=y,exports.resolveModelCapability=x,exports.resolveModelEffort=m,exports.resolvePlatformShell=n.h,exports.resolveStructuredOutputCapability=Kt,exports.runHooks=Yc,exports.runRegistryTransaction=lo,exports.selectAction=ne,exports.setGlobalLogLevel=Me,exports.setGlobalLoggerSink=Pe,exports.setToolProgressCallback=le,exports.shellArgumentForDisplay=bn,exports.spanIdFromMintedId=n.l,exports.splitCommandSegments=Uo,exports.startPeriodicTask=Ct,exports.stopPeriodicTask=wt,exports.subprocessTraceEnvironment=n.u,exports.sumHistoryUsage=za,exports.textAction=ie,exports.toProviderError=gt,exports.toolNameMatches=oc,exports.toolNamesToPatterns=Dc,exports.toolTraceContextFor=n.d,exports.traceEnvFor=n.f,exports.traceHeadersFor=n.p,exports.validateAgainstJsonSchema=U,exports.validateAgentConfig=tt,exports.validateApiKey=at,exports.validateModelName=it,exports.validatePermissionPattern=wc,exports.validateProviderName=rt,exports.validateUserInput=nt,exports.wasToolResultAdmitted=ko,exports.withEventEmission=Bo,exports.zodToJsonSchema=Nt;
@@ -1,3 +1,3 @@
1
1
  import { A as TModelEffortProviderDispatch, C as IModelEffortResolution, D as TModelEffortDisposition, E as TModelEffort, F as IUniversalObjectValue, I as TPrimitiveValue, L as TUniversalArrayValue, M as createModelEffortOutcome, N as isModelEffort, O as TModelEffortNativeControl, P as resolveModelEffort, R as TUniversalValue, S as IModelEffortOutcome, T as MODEL_EFFORT_VALUES, _ as IOutboundTraceContext, b as TSubprocessTraceClass, c as IHookTypeExecutor, d as TGuardrail, f as THookDefinition, g as TSessionEndReason, h as THooksConfig, i as IGuardrailResult, j as TModelEffortSelection, k as TModelEffortOutcomeCallback, l as IHttpHookDefinition, m as THookOutcome, n as ICommandHookDefinition, o as IHookGroup, p as THookEvent, r as IGuardrailHookDefinition, s as IHookInput, t as IAgentHookDefinition, u as IPromptHookDefinition, v as IRunTraceContext, w as IProviderModelEffortTable, x as IModelEffortCapability, y as ISubprocessTraceEnv } from "./types-gNrckgFE.cjs";
2
- import { $ as parseParameterRule, $a as IAgentConfig, $c as resolveModelCapabilities, $i as isConfirmed, $n as createImageProviderFromDefinition, $o as TASK_EVENT_PREFIX, $r as IToolSchemaProjectionProfile, $s as IRawProviderResponse, $t as lifecycleOf, A as allowRulesForAutoMode, Aa as IProviderStructuredOutputCapability, Ac as AuthenticationError, Ai as IRemoteExecutorConfig, Al as ICacheEntry, An as IEventEmitterMetricsSnapshot, Ao as PluginPriority, Ar as TTimerId, As as TOOL_SEARCH_TOOL_NAME, At as IHandoffOrchestrationSpec, B as IPermissionPolicyProjection, Ba as IProviderProfileConfig, Bc as RobotaError, Bi as TConversationContextMetadata, Bl as TMetadata, Bn as isEnvReference, Bo as ISpanCompletionEventData, Br as TMessageConverterRegistry, Bs as normalizeStructuredOutput, Bt as AGENT_EVENTS, C as IContextTokenEstimate, Ca as IVideoGenerationRequest, Cc as IModelFallbackNotice, Ci as IEventHistorySnapshot, Cl as isUserMessage, Cn as assertResidentToolRemains, Co as IPluginErrorContext, Cr as IPlatformShell, Cs as EVENT_EMITTER_EVENTS, Ct as createExecutionProxy, D as estimateToolSchemaTokens, Da as TProviderMediaResult, Dc as classifyProviderFailure, Di as IExecutorStreamMessageEvent, Dl as IActionRequest, Dn as IEventEmitterHierarchicalEventData, Do as IPluginOptions, Dr as resolvePlatformShell, Ds as TEventName, Dt as ORCHESTRATION_EVENT_PREFIX, E as estimateSerializedContextTokens, Ea as TImageInputSource, Ec as TProviderFailureReason, Ei as IExecutorChatResult, El as IActionOption, En as EventEmitterPlugin, Eo as IPluginHooks, Er as UnsupportedShellError, Es as TEventEmitterListener, Et as ORCHESTRATION_EVENTS, F as IPermissionPatternProblem, Fa as IProviderDefinitionConfig, Fc as ModelNotAvailableError, Fi as IConversationResponse, Fl as TComplexConfigValue, Fn as TOutputRetention, Fo as IToolExecutionResult, Fr as validateApiKey, Fs as TExecutionEventData, Ft as IOrchestrationStep, G as IToolPermissionArgument, Ga as TProviderModelCatalogStatus, Gc as TErrorExternalInput, Gi as TToolProgressCallback, Gn as createAssistantMessage, Go as TOOL_BODY_EVENTS, Gr as AbstractExecutor, Gs as IZodSchema, Gt as IAssistantUsageMetadata, H as IParameterRule, Ha as IProviderSetupHelpLink, Hc as StorageError, Hi as TToolExecutionParameters, Hl as TToolParameters, Hn as IAIProviderInstance, Ho as PROVIDER_FALLBACK_EVENTS, Hr as TProviderMessage, Hs as validateAgainstJsonSchema, Ht as peerDriverOf, I as findInvalidPermissionPatterns, Ia as IProviderEndpoint, Ic as NetworkError, Ii as IConversationService, Il as TConfigData, In as createBoundedOutput, Io as IToolRegistry, Ir as validateModelName, Is as IJsonSchemaOutput, It as IOrchestrationStepResult, J as clearRegisteredToolProfiles, Ja as TProviderSetupHelpLinkKind, Jc as IModelRef, Ji as isProgressReportingTool, Jn as createUserMessage, Jo as readModelFallbackNotice, Jr as IExecutorAwareProviderConfig, Js as IAIProvider, Jt as sumHistoryUsage, K as IToolPermissionProfile, Ka as TProviderModelLifecycle, Kc as ToolExecutionError, Ki as getToolEstimatedDuration, Kn as createSystemMessage, Ko as TOOL_PERMISSION_EVENTS, Kr as AbstractPlugin, Ks as IZodSchemaDef, Kt as ISessionUsageTotals, L as findPermissionPatternWarnings, La as IProviderModelCatalog, Lc as PluginError, Li as IConversationServiceOptions, Ll as TConfigValue, Ln as ENV_REFERENCE_PREFIX, Lo as IToolResult, Lr as validateProviderName, Ls as IStructuredOutputSpec, Lt as IParallelOrchestrationSpec, M as splitCommandSegments, Ma as TStructuredOutputProvenance, Mc as CircuitBreakerOpenError, Mi as TExecutorStreamEvent, Ml as ICacheOptions, Mn as shellArgumentForDisplay, Mo as IParameterValidationResult, Mr as ISimpleValidationResult, Ms as TToolSearchSetting, Mt as IOrchestrationDelegation, N as applyPresetToolLists, Na as IProviderCredentialRequirement, Nc as ConfigurationError, Ni as IContextOptions, Nl as ICacheStats, Nn as IBoundedOutput, No as ITool, Nr as Validator, Ns as IRunOptions, Nt as IOrchestrationEventData, O as IContextTokenUsage, Oa as isImageGenerationProvider, Oc as readProviderFailureDetails, Oi as IExecutorStreamTerminalEvent, Ol as IUserInteraction, On as IEventEmitterPluginOptions, Oo as IPluginStats, Or as startPeriodicTask, Os as TExecutionEventName, Ot as TOrchestrationEvent, P as toolNamesToPatterns, Pa as IProviderDefinition, Pc as IProviderFailureDetails, Pi as IConversationContext, Pl as ICacheStorage, Pn as IBoundedOutputOptions, Po as IToolExecutionContext, Pr as validateAgentConfig, Ps as TExecutionEventCallback, Pt as IOrchestrationRunResult, Q as matchesAnyPattern, Qa as IAgent, Qc as modelDeclaresCapability, Qi as confirmAction, Qn as IMediaProviderOverrides, Qo as TASK_EVENTS, Qr as IToolSchemaProjectionChange, Qs as IProviderRequest, Qt as isRegistryTransactionError, R as validatePermissionPattern, Ra as IProviderModelCatalogEntry, Rc as ProviderError, Ri as IStreamingChunk, Rl as TContextData, Rn as formatEnvReference, Ro as TToolExecutor, Rr as validateUserInput, Rs as TStructuredOutputSchema, Rt as ISequentialOrchestrationSpec, S as CONTEXT_ESTIMATE_CHARS_PER_TOKEN, Sa as IVideoGenerationProvider, Sc as createDefaultProviderCapabilities, Si as IEventHistoryRecord, Sl as isToolMessage, Sn as DEFERRED_WITHOUT_LOADER_MESSAGE, So as IPluginData, Sr as traceHeadersFor, Ss as TEventUniversalValue, St as ExecutionProxy, T as estimateContextTokensFromMessages, Ta as IVideoJobSnapshot, Tc as IProviderFailureClassification, Ti as IExecutor, Tl as IActionDefault, Tn as ToolRegistry, To as IPluginExecutionResult, Tr as TShellKind, Ts as IEventEmitterPlugin, Tt as IExecutionProxyConfig, U as IPermissionEvaluationContext, Ua as IProviderSetupStepDefinition, Uc as StructuredOutputError, Ui as IProgressReportingTool, Ul as TypeUtils, Un as LocalExecutor, Uo as SPAN_EVENTS, Ur as isAbortFailure, Us as ISchemaConversionOptions, Ut as printablePeerDriver, V as projectPermissionPolicy, Va as IProviderProfileDefaults, Vc as SameToolInputLoopError, Vi as TResponseMetadata, Vl as TMetadataValue, Vn as resolveEnvReference, Vo as PROVIDER_CALL_EVENTS, Vr as TMessageFormatConverter, Vs as parseStructuredResponseText, Vt as AGENT_EVENT_PREFIX, W as IPermissionLists, Wa as TProviderCredentialField, Wc as TErrorContextData, Wi as IToolExecutionStep, Wn as ConversationHistory, Wo as SPAN_EVENT_PREFIX, Wr as AbstractTool, Ws as IZodParseResult, Wt as EventHistoryModule, X as getToolPermissionProfile, Xa as formatSupportedProviderTypes, Xc as IModelCapabilityDeviation, Xi as CONFIRM_NO, Xn as createProviderFromConfig, Xo as USER_EVENTS, Xr as TProviderLoggingData, Xs as IProviderNativeRawPayloadEvent, Xt as IRegistryTransactionError, Y as evaluatePermission, Ya as findProviderDefinition, Yc as TRoleModelMap, Yi as setToolProgressCallback, Yn as ConversationStore, Yo as TUserEvent, Yr as IProviderRuntimeConfig, Ys as IChatOptions, Yt as IRegistryOwnedLifecycle, Z as isToolDeniedOutright, Za as getProviderCredentialRequirement, Zc as IProviderCapabilityTable, Zi as CONFIRM_YES, Zn as normalizeProviderConfig, Zo as USER_EVENT_PREFIX, Zr as IToolSchemaProjection, Zs as IProviderOptions, Zt as IRegistryTransactionStep, _ as getModelName, _a as IImageGenerationResult, _c as IProviderFunctionCallingCapability, _i as IStats, _l as chatEntryToMessage, _n as IDestroyResult, _o as setGlobalLoggerSink, _r as providerCallSpanId, _s as IOwnerPathSegment, _t as TBackgroundPermissionPolicy, a as IModelPrice, aa as IAIProviderManager, ac as TProviderOptionValueBase, ai as TToolSchemaProjectionOutcome, al as IInlineImageMessagePart, an as IAgentFactoryOptions, ao as TToolExecutionFunction, ar as IStructuredOutputResolutionInput, as as bindEventServiceOwner, at as PROTECTED_FILE_NAMES, b as readTokenUsageFromMessage, ba as IProviderMediaError, bc as IProviderNativeWebToolRequest, bi as ITerminalOutput, bl as isChatEntry, bn as TOOL_EVENTS, bo as IPluginContext, br as toolTraceContextFor, bs as TEventListener, bt as TRUST_TO_MODE, c as estimateBlendedCostPer1000, ca as IMediaProviderConfig, cc as getProviderCapabilities, ci as projectToolSchema, cl as IToolCall, cn as DEFAULT_TOOL_RESULT_WARNING_CHARS, co as ILoggerOptions, cr as getSchemaTypeName, cs as generateSpanId, ct as RISK_CLASS_POLICY, d as DEFAULT_MAX_OUTPUT, da as findMediaProviderDefinition, dc as IToolSchema, di as AbstractAgent, dl as IUserMessage, dn as MAX_TOOL_RESULT_CHARS, do as TUtilLogLevel, dr as ISchemaClosureOptions, ds as IBaseEventData, dt as TArgumentKind, ea as multiSelectAction, ec as ITokenUsage, ei as PARAMETER_SCHEMA_KEYWORDS, el as resolveModelCapability, en as runRegistryTransaction, eo as IAgentTemplate, er as createVideoProviderFromDefinition, es as AbstractEventService, et as registerToolPermissionProfile, f as IModelDefinition, fa as isMediaProviderDefinition, fc as TJSONSchemaEnum, fi as ICredentialKey, fl as TMessageState, fn as TToolResultAdmissionErrorCode, fo as createLogger, fr as closeObjectSchemas, fs as IEventContext, ft as TMatchDirection, g as getModelMaxOutput, ga as IImageGenerationRequest, gc as IProviderCapabilities, gi as IFileSystemAsync, gl as TUniversalMessageRole, gn as Robota, go as setGlobalLogLevel, gr as outboundTraceContextFor, gs as IExecutionEventData, gt as DEFAULT_BACKGROUND_PERMISSION_POLICY, h as getModelContextWindow, ha as IImageGenerationProvider, hc as IProviderSpecificOptions, hi as IFileSystem, hl as TUniversalMessagePart, hn as wasToolResultAdmitted, ho as logger, hr as isMintedSpanId, hs as IEventServiceOwnerBinding, ht as isReadOnlyCommandLine, i as runHooks, ia as IToolFactory, ic as TProviderNativeRawPayloadKind, ii as TOOL_SCHEMA_PROJECTION_MAX_NODES, il as IHistoryEntry, in as IAgentCreationStats, io as IToolWithEventService, ir as processEnvResolver, is as StructuredEventService, it as PROTECTED_DIRECTORY_NAMES, j as isBroadExecutionAllowRule, ja as TStructuredOutputMechanism, jc as CacheIntegrityError, ji as IStreamExecutionRequest, jl as ICacheKey, jn as InMemoryEventEmitterMetrics, jo as IFunctionTool, jr as ErrorUtils, js as TToolSearchMode, jt as IHierarchicalOrchestrationSpec, k as IContextWindowState, ka as isVideoGenerationProvider, kc as toProviderError, ki as ILocalExecutorConfig, kl as TActionResponse, kn as IEventEmitterMetrics, ko as PluginCategory, kr as stopPeriodicTask, ks as IDeferredToolCatalog, kt as IGroupChatOrchestrationSpec, l as lookupModelPrice, la as IMediaProviderCredentialRequirement, lc as IObjectParameterSchema, li as AbstractManager, ll as IToolMessage, ln as IToolResultAdmissionOptions, lo as IUtilLogEntry, lr as hasValidationConstraints, ls as isDefaultEventService, lt as TToolRiskClass, m as formatTokenCount, ma as IImageEditRequest, mc as TParameterDefaultValue, mi as IDirent, ml as TUniversalMessageMetadata, mn as admitToolResult, mo as getGlobalLoggerSink, mr as buildTraceparent, ms as IEventService, mt as TResolveInWorkspace, n as decodeHookVerdict, na as textAction, nc as TProviderNativeRawPayload, ni as STRICT_TOOL_SCHEMA_PROFILE, nl as IAssistantMessage, nn as AgentTemplates, no as IAbstractToolOptions, nr as TEnvResolver, ns as DefaultEventService, nt as toolNameMatches, o as MODEL_PRICES, oa as IToolManager, oc as TTextDeltaCallback, oi as TToolSchemaProjectionProfileBase, ol as ISystemMessage, on as IAgentLifecycleEvents, oo as ConsoleLogger, or as resolveStructuredOutputCapability, os as bindWithOwnerPath, ot as isProtectedPath, p as findModelDefinition, pa as IImageComposeRequest, pc as TJSONSchemaKind, pi as ICredentialStore, pl as TUniversalMessage, pn as ToolResultAdmissionError, po as getGlobalLogLevel, pr as zodToJsonSchema, ps as IEventObjectValue, pt as IReadOnlyCommandContext, q as TToolArgs, qa as TProviderSetupField, qc as ValidationError, qi as getToolExecutionSteps, qn as createToolMessage, qo as TSpanEvent, qr as AbstractAIProvider, qs as IResponseFormatConfig, qt as collectAssistantUsageMetadata, r as GuardrailExecutor, ra as IOpenAPIToolConfig, rc as TProviderNativeRawPayloadCallback, ri as TOOL_SCHEMA_PROJECTION_MAX_DEPTH, rl as IBaseMessage, rn as ITemplateApplicationResult, ro as IToolContract, rr as createRecordEnvResolver, rs as ObservableEventService, rt as ICriticalPathContext, s as calculateModelCost, sa as TManagerToolParameters, sc as TToolChoice, si as hashToolSchema, sl as ITextMessagePart, sn as DEFAULT_TOOL_RESULT_HARD_CHARS, so as ILogger, sr as extractEnumValues, ss as composeEventName, st as removesCriticalPath, t as isEnforcing, ta as selectAction, tc as TProviderConfigValue, ti as PERMISSIVE_TOOL_SCHEMA_PROFILE, tl as TProviderModelCapability, tn as AgentFactory, to as IAbstractTool, tr as resolveMediaProviderConfig, ts as DEFAULT_ABSTRACT_EVENT_SERVICE, tt as requiresFreshApproval, u as DEFAULT_CONTEXT_WINDOW, ua as IMediaProviderDefinition, uc as IParameterSchema, ui as IManagerLifecycleOptions, ul as IUriImageMessagePart, un as IToolResultSpillStore, uo as SilentLogger, ur as ISchemaClosureChange, us as IAgentEventData, ut as UNCLASSIFIED_TOOL_FALLBACK, v as registerModelMetadata, va as IInlineImageInputSource, vc as IProviderNativeWebToolCapabilities, vi as ISession, vl as getMessagesForAPI, vn as EXECUTION_EVENTS, vo as IPlugin, vr as spanIdFromMintedId, vs as IToolEventData, vt as TPermissionDecision, w as IContextTokenEstimateOptions, wa as IVideoJobAccepted, wc as TModelFallbackCallback, wi as IChatExecutionRequest, wl as messageToHistoryEntry, wn as FunctionTool, wo as IPluginExecutionContext, wr as IPlatformShellResolutionRequest, ws as IEventEmitterEventData, wt as withEventEmission, x as readTokenUsageFromMetadata, xa as IUriImageInputSource, xc as assertProviderNativeWebToolsAvailable, xi as IEventHistoryModule, xl as isSystemMessage, xn as TOOL_EVENT_PREFIX, xo as IPluginContract, xr as traceEnvFor, xs as TEventLoggerData, xt as TTrustLevel, y as IMessageTokenUsage, ya as IMediaOutputRef, yc as IProviderNativeWebToolCapability, yi as ISpinner, yl as isAssistantMessage, yn as EXECUTION_EVENT_PREFIX, yo as IPluginConfig, yr as subprocessTraceEnvironment, ys as TEventExtensionValue, yt as TPermissionMode, z as IPermissionPolicyContext, za as IProviderProbeResult, zc as RateLimitError, zi as IToolExecutionRequest, zl as TLoggerData, zn as hasUsableSecretReference, zo as TToolMetadata, zr as MessageConverter, zs as TStructuredOutputValidation, zt as TOrchestrationPrimitive } from "./index-CiFlpr7-.cjs";
2
+ import { $ as parseParameterRule, $a as IAgentConfig, $c as resolveModelCapabilities, $i as isConfirmed, $n as createImageProviderFromDefinition, $o as TASK_EVENT_PREFIX, $r as IToolSchemaProjectionProfile, $s as IRawProviderResponse, $t as lifecycleOf, A as allowRulesForAutoMode, Aa as IProviderStructuredOutputCapability, Ac as AuthenticationError, Ai as IRemoteExecutorConfig, Al as ICacheEntry, An as IEventEmitterMetricsSnapshot, Ao as PluginPriority, Ar as TTimerId, As as TOOL_SEARCH_TOOL_NAME, At as IHandoffOrchestrationSpec, B as IPermissionPolicyProjection, Ba as IProviderProfileConfig, Bc as RobotaError, Bi as TConversationContextMetadata, Bl as TMetadata, Bn as isEnvReference, Bo as ISpanCompletionEventData, Br as TMessageConverterRegistry, Bs as normalizeStructuredOutput, Bt as AGENT_EVENTS, C as IContextTokenEstimate, Ca as IVideoGenerationRequest, Cc as IModelFallbackNotice, Ci as IEventHistorySnapshot, Cl as isUserMessage, Cn as assertResidentToolRemains, Co as IPluginErrorContext, Cr as IPlatformShell, Cs as EVENT_EMITTER_EVENTS, Ct as createExecutionProxy, D as estimateToolSchemaTokens, Da as TProviderMediaResult, Dc as classifyProviderFailure, Di as IExecutorStreamMessageEvent, Dl as IActionRequest, Dn as IEventEmitterHierarchicalEventData, Do as IPluginOptions, Dr as resolvePlatformShell, Ds as TEventName, Dt as ORCHESTRATION_EVENT_PREFIX, E as estimateSerializedContextTokens, Ea as TImageInputSource, Ec as TProviderFailureReason, Ei as IExecutorChatResult, El as IActionOption, En as EventEmitterPlugin, Eo as IPluginHooks, Er as UnsupportedShellError, Es as TEventEmitterListener, Et as ORCHESTRATION_EVENTS, F as IPermissionPatternProblem, Fa as IProviderDefinitionConfig, Fc as ModelNotAvailableError, Fi as IConversationResponse, Fl as TComplexConfigValue, Fn as TOutputRetention, Fo as IToolExecutionResult, Fr as validateApiKey, Fs as TExecutionEventData, Ft as IOrchestrationStep, G as IToolPermissionArgument, Ga as TProviderModelCatalogStatus, Gc as TErrorExternalInput, Gi as TToolProgressCallback, Gn as createAssistantMessage, Go as TOOL_BODY_EVENTS, Gr as AbstractExecutor, Gs as IZodSchema, Gt as IAssistantUsageMetadata, H as IParameterRule, Ha as IProviderSetupHelpLink, Hc as StorageError, Hi as TToolExecutionParameters, Hl as TToolParameters, Hn as IAIProviderInstance, Ho as PROVIDER_FALLBACK_EVENTS, Hr as TProviderMessage, Hs as validateAgainstJsonSchema, Ht as peerDriverOf, I as findInvalidPermissionPatterns, Ia as IProviderEndpoint, Ic as NetworkError, Ii as IConversationService, Il as TConfigData, In as createBoundedOutput, Io as IToolRegistry, Ir as validateModelName, Is as IJsonSchemaOutput, It as IOrchestrationStepResult, J as clearRegisteredToolProfiles, Ja as TProviderSetupHelpLinkKind, Jc as IModelRef, Ji as isProgressReportingTool, Jn as createUserMessage, Jo as readModelFallbackNotice, Jr as IExecutorAwareProviderConfig, Js as IAIProvider, Jt as sumHistoryUsage, K as IToolPermissionProfile, Ka as TProviderModelLifecycle, Kc as ToolExecutionError, Ki as getToolEstimatedDuration, Kn as createSystemMessage, Ko as TOOL_PERMISSION_EVENTS, Kr as AbstractPlugin, Ks as IZodSchemaDef, Kt as ISessionUsageTotals, L as findPermissionPatternWarnings, La as IProviderModelCatalog, Lc as PluginError, Li as IConversationServiceOptions, Ll as TConfigValue, Ln as ENV_REFERENCE_PREFIX, Lo as IToolResult, Lr as validateProviderName, Ls as IStructuredOutputSpec, Lt as IParallelOrchestrationSpec, M as splitCommandSegments, Ma as TStructuredOutputProvenance, Mc as CircuitBreakerOpenError, Mi as TExecutorStreamEvent, Ml as ICacheOptions, Mn as shellArgumentForDisplay, Mo as IParameterValidationResult, Mr as ISimpleValidationResult, Ms as TToolSearchSetting, Mt as IOrchestrationDelegation, N as applyPresetToolLists, Na as IProviderCredentialRequirement, Nc as ConfigurationError, Ni as IContextOptions, Nl as ICacheStats, Nn as IBoundedOutput, No as ITool, Nr as Validator, Ns as IRunOptions, Nt as IOrchestrationEventData, O as IContextTokenUsage, Oa as isImageGenerationProvider, Oc as readProviderFailureDetails, Oi as IExecutorStreamTerminalEvent, Ol as IUserInteraction, On as IEventEmitterPluginOptions, Oo as IPluginStats, Or as startPeriodicTask, Os as TExecutionEventName, Ot as TOrchestrationEvent, P as toolNamesToPatterns, Pa as IProviderDefinition, Pc as IProviderFailureDetails, Pi as IConversationContext, Pl as ICacheStorage, Pn as IBoundedOutputOptions, Po as IToolExecutionContext, Pr as validateAgentConfig, Ps as TExecutionEventCallback, Pt as IOrchestrationRunResult, Q as matchesAnyPattern, Qa as IAgent, Qc as modelDeclaresCapability, Qi as confirmAction, Qn as IMediaProviderOverrides, Qo as TASK_EVENTS, Qr as IToolSchemaProjectionChange, Qs as IProviderRequest, Qt as isRegistryTransactionError, R as validatePermissionPattern, Ra as IProviderModelCatalogEntry, Rc as ProviderError, Ri as IStreamingChunk, Rl as TContextData, Rn as formatEnvReference, Ro as TToolExecutor, Rr as validateUserInput, Rs as TStructuredOutputSchema, Rt as ISequentialOrchestrationSpec, S as CONTEXT_ESTIMATE_CHARS_PER_TOKEN, Sa as IVideoGenerationProvider, Sc as createDefaultProviderCapabilities, Si as IEventHistoryRecord, Sl as isToolMessage, Sn as DEFERRED_WITHOUT_LOADER_MESSAGE, So as IPluginData, Sr as traceHeadersFor, Ss as TEventUniversalValue, St as ExecutionProxy, T as estimateContextTokensFromMessages, Ta as IVideoJobSnapshot, Tc as IProviderFailureClassification, Ti as IExecutor, Tl as IActionDefault, Tn as ToolRegistry, To as IPluginExecutionResult, Tr as TShellKind, Ts as IEventEmitterPlugin, Tt as IExecutionProxyConfig, U as IPermissionEvaluationContext, Ua as IProviderSetupStepDefinition, Uc as StructuredOutputError, Ui as IProgressReportingTool, Ul as TypeUtils, Un as LocalExecutor, Uo as SPAN_EVENTS, Ur as isAbortFailure, Us as ISchemaConversionOptions, Ut as printablePeerDriver, V as projectPermissionPolicy, Va as IProviderProfileDefaults, Vc as SameToolInputLoopError, Vi as TResponseMetadata, Vl as TMetadataValue, Vn as resolveEnvReference, Vo as PROVIDER_CALL_EVENTS, Vr as TMessageFormatConverter, Vs as parseStructuredResponseText, Vt as AGENT_EVENT_PREFIX, W as IPermissionLists, Wa as TProviderCredentialField, Wc as TErrorContextData, Wi as IToolExecutionStep, Wn as ConversationHistory, Wo as SPAN_EVENT_PREFIX, Wr as AbstractTool, Ws as IZodParseResult, Wt as EventHistoryModule, X as getToolPermissionProfile, Xa as formatSupportedProviderTypes, Xc as IModelCapabilityDeviation, Xi as CONFIRM_NO, Xn as createProviderFromConfig, Xo as USER_EVENTS, Xr as TProviderLoggingData, Xs as IProviderNativeRawPayloadEvent, Xt as IRegistryTransactionError, Y as evaluatePermission, Ya as findProviderDefinition, Yc as TRoleModelMap, Yi as setToolProgressCallback, Yn as ConversationStore, Yo as TUserEvent, Yr as IProviderRuntimeConfig, Ys as IChatOptions, Yt as IRegistryOwnedLifecycle, Z as isToolDeniedOutright, Za as getProviderCredentialRequirement, Zc as IProviderCapabilityTable, Zi as CONFIRM_YES, Zn as normalizeProviderConfig, Zo as USER_EVENT_PREFIX, Zr as IToolSchemaProjection, Zs as IProviderOptions, Zt as IRegistryTransactionStep, _ as getModelName, _a as IImageGenerationResult, _c as IProviderFunctionCallingCapability, _i as IStats, _l as chatEntryToMessage, _n as IDestroyResult, _o as setGlobalLoggerSink, _r as providerCallSpanId, _s as IOwnerPathSegment, _t as TBackgroundPermissionPolicy, a as IModelPrice, aa as IAIProviderManager, ac as TProviderOptionValueBase, ai as TToolSchemaProjectionOutcome, al as IInlineImageMessagePart, an as IAgentFactoryOptions, ao as TToolExecutionFunction, ar as IStructuredOutputResolutionInput, as as bindEventServiceOwner, at as PROTECTED_FILE_NAMES, b as readTokenUsageFromMessage, ba as IProviderMediaError, bc as IProviderNativeWebToolRequest, bi as ITerminalOutput, bl as isChatEntry, bn as TOOL_EVENTS, bo as IPluginContext, br as toolTraceContextFor, bs as TEventListener, bt as TRUST_TO_MODE, c as estimateBlendedCostPer1000, ca as IMediaProviderConfig, cc as getProviderCapabilities, ci as projectToolSchema, cl as IToolCall, cn as DEFAULT_TOOL_RESULT_WARNING_CHARS, co as ILoggerOptions, cr as getSchemaTypeName, cs as generateSpanId, ct as RISK_CLASS_POLICY, d as DEFAULT_MAX_OUTPUT, da as findMediaProviderDefinition, dc as IToolSchema, di as AbstractAgent, dl as IUserMessage, dn as MAX_TOOL_RESULT_CHARS, do as TUtilLogLevel, dr as ISchemaClosureOptions, ds as IBaseEventData, dt as TArgumentKind, ea as multiSelectAction, ec as ITokenUsage, ei as PARAMETER_SCHEMA_KEYWORDS, el as resolveModelCapability, en as runRegistryTransaction, eo as IAgentTemplate, er as createVideoProviderFromDefinition, es as AbstractEventService, et as registerToolPermissionProfile, f as IModelDefinition, fa as isMediaProviderDefinition, fc as TJSONSchemaEnum, fi as ICredentialKey, fl as TMessageState, fn as TToolResultAdmissionErrorCode, fo as createLogger, fr as closeObjectSchemas, fs as IEventContext, ft as TMatchDirection, g as getModelMaxOutput, ga as IImageGenerationRequest, gc as IProviderCapabilities, gi as IFileSystemAsync, gl as TUniversalMessageRole, gn as Robota, go as setGlobalLogLevel, gr as outboundTraceContextFor, gs as IExecutionEventData, gt as DEFAULT_BACKGROUND_PERMISSION_POLICY, h as getModelContextWindow, ha as IImageGenerationProvider, hc as IProviderSpecificOptions, hi as IFileSystem, hl as TUniversalMessagePart, hn as wasToolResultAdmitted, ho as logger, hr as isMintedSpanId, hs as IEventServiceOwnerBinding, ht as isReadOnlyCommandLine, i as runHooks, ia as IToolFactory, ic as TProviderNativeRawPayloadKind, ii as TOOL_SCHEMA_PROJECTION_MAX_NODES, il as IHistoryEntry, in as IAgentCreationStats, io as IToolWithEventService, ir as processEnvResolver, is as StructuredEventService, it as PROTECTED_DIRECTORY_NAMES, j as isBroadExecutionAllowRule, ja as TStructuredOutputMechanism, jc as CacheIntegrityError, ji as IStreamExecutionRequest, jl as ICacheKey, jn as InMemoryEventEmitterMetrics, jo as IFunctionTool, jr as ErrorUtils, js as TToolSearchMode, jt as IHierarchicalOrchestrationSpec, k as IContextWindowState, ka as isVideoGenerationProvider, kc as toProviderError, ki as ILocalExecutorConfig, kl as TActionResponse, kn as IEventEmitterMetrics, ko as PluginCategory, kr as stopPeriodicTask, ks as IDeferredToolCatalog, kt as IGroupChatOrchestrationSpec, l as lookupModelPrice, la as IMediaProviderCredentialRequirement, lc as IObjectParameterSchema, li as AbstractManager, ll as IToolMessage, ln as IToolResultAdmissionOptions, lo as IUtilLogEntry, lr as hasValidationConstraints, ls as isDefaultEventService, lt as TToolRiskClass, m as formatTokenCount, ma as IImageEditRequest, mc as TParameterDefaultValue, mi as IDirent, ml as TUniversalMessageMetadata, mn as admitToolResult, mo as getGlobalLoggerSink, mr as buildTraceparent, ms as IEventService, mt as TResolveInWorkspace, n as decodeHookVerdict, na as textAction, nc as TProviderNativeRawPayload, ni as STRICT_TOOL_SCHEMA_PROFILE, nl as IAssistantMessage, nn as AgentTemplates, no as IAbstractToolOptions, nr as TEnvResolver, ns as DefaultEventService, nt as toolNameMatches, o as MODEL_PRICES, oa as IToolManager, oc as TTextDeltaCallback, oi as TToolSchemaProjectionProfileBase, ol as ISystemMessage, on as IAgentLifecycleEvents, oo as ConsoleLogger, or as resolveStructuredOutputCapability, os as bindWithOwnerPath, ot as isProtectedPath, p as findModelDefinition, pa as IImageComposeRequest, pc as TJSONSchemaKind, pi as ICredentialStore, pl as TUniversalMessage, pn as ToolResultAdmissionError, po as getGlobalLogLevel, pr as zodToJsonSchema, ps as IEventObjectValue, pt as IReadOnlyCommandContext, q as TToolArgs, qa as TProviderSetupField, qc as ValidationError, qi as getToolExecutionSteps, qn as createToolMessage, qo as TSpanEvent, qr as AbstractAIProvider, qs as IResponseFormatConfig, qt as collectAssistantUsageMetadata, r as GuardrailExecutor, ra as IOpenAPIToolConfig, rc as TProviderNativeRawPayloadCallback, ri as TOOL_SCHEMA_PROJECTION_MAX_DEPTH, rl as IBaseMessage, rn as ITemplateApplicationResult, ro as IToolContract, rr as createRecordEnvResolver, rs as ObservableEventService, rt as ICriticalPathContext, s as calculateModelCost, sa as TManagerToolParameters, sc as TToolChoice, si as hashToolSchema, sl as ITextMessagePart, sn as DEFAULT_TOOL_RESULT_HARD_CHARS, so as ILogger, sr as extractEnumValues, ss as composeEventName, st as removesCriticalPath, t as isEnforcing, ta as selectAction, tc as TProviderConfigValue, ti as PERMISSIVE_TOOL_SCHEMA_PROFILE, tl as TProviderModelCapability, tn as AgentFactory, to as IAbstractTool, tr as resolveMediaProviderConfig, ts as DEFAULT_ABSTRACT_EVENT_SERVICE, tt as requiresFreshApproval, u as DEFAULT_CONTEXT_WINDOW, ua as IMediaProviderDefinition, uc as IParameterSchema, ui as IManagerLifecycleOptions, ul as IUriImageMessagePart, un as IToolResultSpillStore, uo as SilentLogger, ur as ISchemaClosureChange, us as IAgentEventData, ut as UNCLASSIFIED_TOOL_FALLBACK, v as registerModelMetadata, va as IInlineImageInputSource, vc as IProviderNativeWebToolCapabilities, vi as ISession, vl as getMessagesForAPI, vn as EXECUTION_EVENTS, vo as IPlugin, vr as spanIdFromMintedId, vs as IToolEventData, vt as TPermissionDecision, w as IContextTokenEstimateOptions, wa as IVideoJobAccepted, wc as TModelFallbackCallback, wi as IChatExecutionRequest, wl as messageToHistoryEntry, wn as FunctionTool, wo as IPluginExecutionContext, wr as IPlatformShellResolutionRequest, ws as IEventEmitterEventData, wt as withEventEmission, x as readTokenUsageFromMetadata, xa as IUriImageInputSource, xc as assertProviderNativeWebToolsAvailable, xi as IEventHistoryModule, xl as isSystemMessage, xn as TOOL_EVENT_PREFIX, xo as IPluginContract, xr as traceEnvFor, xs as TEventLoggerData, xt as TTrustLevel, y as IMessageTokenUsage, ya as IMediaOutputRef, yc as IProviderNativeWebToolCapability, yi as ISpinner, yl as isAssistantMessage, yn as EXECUTION_EVENT_PREFIX, yo as IPluginConfig, yr as subprocessTraceEnvironment, ys as TEventExtensionValue, yt as TPermissionMode, z as IPermissionPolicyContext, za as IProviderProbeResult, zc as RateLimitError, zi as IToolExecutionRequest, zl as TLoggerData, zn as hasUsableSecretReference, zo as TToolMetadata, zr as MessageConverter, zs as TStructuredOutputValidation, zt as TOrchestrationPrimitive } from "./index-BhfNtQJk.cjs";
3
3
  export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractEventService, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CONFIRM_NO, CONFIRM_YES, CONTEXT_ESTIMATE_CHARS_PER_TOKEN, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError, ConsoleLogger, ConversationHistory, ConversationStore, DEFAULT_ABSTRACT_EVENT_SERVICE, DEFAULT_BACKGROUND_PERMISSION_POLICY, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT, DEFAULT_TOOL_RESULT_HARD_CHARS, DEFAULT_TOOL_RESULT_WARNING_CHARS, DEFERRED_WITHOUT_LOADER_MESSAGE, DefaultEventService, ENV_REFERENCE_PREFIX, EVENT_EMITTER_EVENTS, EXECUTION_EVENTS, EXECUTION_EVENT_PREFIX, ErrorUtils, EventEmitterPlugin, EventHistoryModule, ExecutionProxy, FunctionTool, GuardrailExecutor, type IAIProvider, type IAIProviderInstance, type IAIProviderManager, type IAbstractTool, type IAbstractToolOptions, type IActionDefault, type IActionOption, type IActionRequest, type IAgent, type IAgentConfig, type IAgentCreationStats, type IAgentEventData, type IAgentFactoryOptions, type IAgentHookDefinition, type IAgentLifecycleEvents, type IAgentTemplate, type IAssistantMessage, type IAssistantUsageMetadata, type IBaseEventData, type IBaseMessage, type IBoundedOutput, type IBoundedOutputOptions, type ICacheEntry, type ICacheKey, type ICacheOptions, type ICacheStats, type ICacheStorage, type IChatExecutionRequest, type IChatOptions, type ICommandHookDefinition, type IContextOptions, type IContextTokenEstimate, type IContextTokenEstimateOptions, type IContextTokenUsage, type IContextWindowState, type IConversationContext, type IConversationResponse, type IConversationService, type IConversationServiceOptions, type ICredentialKey, type ICredentialStore, type ICriticalPathContext, type IDeferredToolCatalog, type IDestroyResult, type IDirent, type IEventContext, type IEventEmitterEventData, type IEventEmitterHierarchicalEventData, type IEventEmitterMetrics, type IEventEmitterMetricsSnapshot, type IEventEmitterPlugin, type IEventEmitterPluginOptions, type IEventHistoryModule, type IEventHistoryRecord, type IEventHistorySnapshot, type IEventObjectValue, type IEventService, type IEventServiceOwnerBinding, type IExecutionEventData, type IExecutionProxyConfig, type IExecutor, IExecutorAwareProviderConfig, type IExecutorChatResult, type IExecutorStreamMessageEvent, type IExecutorStreamTerminalEvent, type IFileSystem, type IFileSystemAsync, type IFunctionTool, type IGroupChatOrchestrationSpec, type IGuardrailHookDefinition, type IGuardrailResult, type IHandoffOrchestrationSpec, type IHierarchicalOrchestrationSpec, type IHistoryEntry, type IHookGroup, type IHookInput, type IHookTypeExecutor, type IHttpHookDefinition, type IImageComposeRequest, type IImageEditRequest, type IImageGenerationProvider, type IImageGenerationRequest, type IImageGenerationResult, type IInlineImageInputSource, type IInlineImageMessagePart, type IJsonSchemaOutput, type ILocalExecutorConfig, ILogger, ILoggerOptions, IManagerLifecycleOptions, type IMediaOutputRef, type IMediaProviderConfig, type IMediaProviderCredentialRequirement, type IMediaProviderDefinition, type IMediaProviderOverrides, type IMessageTokenUsage, type IModelCapabilityDeviation, type IModelDefinition, type IModelEffortCapability, type IModelEffortOutcome, type IModelEffortResolution, type IModelFallbackNotice, type IModelPrice, type IModelRef, type IObjectParameterSchema, type IOpenAPIToolConfig, type IOrchestrationDelegation, type IOrchestrationEventData, type IOrchestrationRunResult, type IOrchestrationStep, type IOrchestrationStepResult, type IOutboundTraceContext, type IOwnerPathSegment, type IParallelOrchestrationSpec, type IParameterRule, type IParameterSchema, type IParameterValidationResult, type IPermissionEvaluationContext, type IPermissionLists, type IPermissionPatternProblem, type IPermissionPolicyContext, type IPermissionPolicyProjection, IPlatformShell, IPlatformShellResolutionRequest, type IPlugin, type IPluginConfig, type IPluginContext, type IPluginContract, type IPluginData, type IPluginErrorContext, type IPluginExecutionContext, type IPluginExecutionResult, type IPluginHooks, type IPluginOptions, type IPluginStats, type IProgressReportingTool, type IPromptHookDefinition, type IProviderCapabilities, type IProviderCapabilityTable, type IProviderCredentialRequirement, type IProviderDefinition, type IProviderDefinitionConfig, type IProviderEndpoint, type IProviderFailureClassification, IProviderFailureDetails, type IProviderFunctionCallingCapability, type IProviderMediaError, type IProviderModelCatalog, type IProviderModelCatalogEntry, type IProviderModelEffortTable, type IProviderNativeRawPayloadEvent, type IProviderNativeWebToolCapabilities, type IProviderNativeWebToolCapability, type IProviderNativeWebToolRequest, type IProviderOptions, type IProviderProbeResult, type IProviderProfileConfig, type IProviderProfileDefaults, type IProviderRequest, IProviderRuntimeConfig, type IProviderSetupHelpLink, type IProviderSetupStepDefinition, type IProviderSpecificOptions, type IProviderStructuredOutputCapability, type IRawProviderResponse, type IReadOnlyCommandContext, type IRegistryOwnedLifecycle, type IRegistryTransactionError, type IRegistryTransactionStep, type IRemoteExecutorConfig, type IResponseFormatConfig, type IRunOptions, type IRunTraceContext, type ISchemaClosureChange, type ISchemaClosureOptions, type ISchemaConversionOptions, type ISequentialOrchestrationSpec, type ISession, type ISessionUsageTotals, ISimpleValidationResult, type ISpanCompletionEventData, type ISpinner, type IStats, type IStreamExecutionRequest, type IStreamingChunk, type IStructuredOutputResolutionInput, type IStructuredOutputSpec, type ISubprocessTraceEnv, type ISystemMessage, type ITemplateApplicationResult, type ITerminalOutput, type ITextMessagePart, type ITokenUsage, type ITool, type IToolCall, type IToolContract, type IToolEventData, type IToolExecutionContext, type IToolExecutionRequest, type IToolExecutionResult, type IToolExecutionStep, type IToolFactory, type IToolManager, type IToolMessage, type IToolPermissionArgument, type IToolPermissionProfile, type IToolRegistry, type IToolResult, type IToolResultAdmissionOptions, type IToolResultSpillStore, type IToolSchema, type IToolSchemaProjection, type IToolSchemaProjectionChange, type IToolSchemaProjectionProfile, type IToolWithEventService, type IUniversalObjectValue, type IUriImageInputSource, type IUriImageMessagePart, type IUserInteraction, type IUserMessage, IUtilLogEntry, type IVideoGenerationProvider, type IVideoGenerationRequest, type IVideoJobAccepted, type IVideoJobSnapshot, type IZodParseResult, type IZodSchema, type IZodSchemaDef, InMemoryEventEmitterMetrics, LocalExecutor, MAX_TOOL_RESULT_CHARS, MODEL_EFFORT_VALUES, MODEL_PRICES, MessageConverter, ModelNotAvailableError, NetworkError, ORCHESTRATION_EVENTS, ORCHESTRATION_EVENT_PREFIX, ObservableEventService, PARAMETER_SCHEMA_KEYWORDS, PERMISSIVE_TOOL_SCHEMA_PROFILE, PROTECTED_DIRECTORY_NAMES, PROTECTED_FILE_NAMES, PROVIDER_CALL_EVENTS, PROVIDER_FALLBACK_EVENTS, PluginCategory, PluginError, PluginPriority, ProviderError, RISK_CLASS_POLICY, RateLimitError, Robota, RobotaError, SPAN_EVENTS, SPAN_EVENT_PREFIX, STRICT_TOOL_SCHEMA_PROFILE, SameToolInputLoopError, SilentLogger, StorageError, StructuredEventService, StructuredOutputError, TASK_EVENTS, TASK_EVENT_PREFIX, type TActionResponse, type TArgumentKind, type TBackgroundPermissionPolicy, TComplexConfigValue, TConfigData, TConfigValue, TContextData, type TConversationContextMetadata, type TEnvResolver, TErrorContextData, TErrorExternalInput, type TEventEmitterListener, type TEventExtensionValue, type TEventListener, type TEventLoggerData, type TEventName, type TEventUniversalValue, type TExecutionEventCallback, type TExecutionEventData, type TExecutionEventName, type TExecutorStreamEvent, type TGuardrail, type THookDefinition, type THookEvent, type THookOutcome, type THooksConfig, type TImageInputSource, type TJSONSchemaEnum, type TJSONSchemaKind, TLoggerData, type TManagerToolParameters, type TMatchDirection, TMessageConverterRegistry, TMessageFormatConverter, type TMessageState, TMetadata, TMetadataValue, type TModelEffort, type TModelEffortDisposition, type TModelEffortNativeControl, type TModelEffortOutcomeCallback, type TModelEffortProviderDispatch, type TModelEffortSelection, type TModelFallbackCallback, TOOL_BODY_EVENTS, TOOL_EVENTS, TOOL_EVENT_PREFIX, TOOL_PERMISSION_EVENTS, TOOL_SCHEMA_PROJECTION_MAX_DEPTH, TOOL_SCHEMA_PROJECTION_MAX_NODES, TOOL_SEARCH_TOOL_NAME, type TOrchestrationEvent, type TOrchestrationPrimitive, type TOutputRetention, type TParameterDefaultValue, type TPermissionDecision, type TPermissionMode, type TPrimitiveValue, type TProviderConfigValue, type TProviderCredentialField, type TProviderFailureReason, TProviderLoggingData, type TProviderMediaResult, TProviderMessage, type TProviderModelCapability, type TProviderModelCatalogStatus, type TProviderModelLifecycle, type TProviderNativeRawPayload, type TProviderNativeRawPayloadCallback, type TProviderNativeRawPayloadKind, type TProviderOptionValueBase, type TProviderSetupField, type TProviderSetupHelpLinkKind, TRUST_TO_MODE, type TResolveInWorkspace, type TResponseMetadata, type TRoleModelMap, type TSessionEndReason, TShellKind, type TSpanEvent, type TStructuredOutputMechanism, type TStructuredOutputProvenance, type TStructuredOutputSchema, type TStructuredOutputValidation, type TSubprocessTraceClass, type TTextDeltaCallback, type TTimerId, type TToolArgs, type TToolChoice, type TToolExecutionFunction, type TToolExecutionParameters, type TToolExecutor, type TToolMetadata, TToolParameters, type TToolProgressCallback, type TToolResultAdmissionErrorCode, type TToolRiskClass, type TToolSchemaProjectionOutcome, type TToolSchemaProjectionProfileBase, type TToolSearchMode, type TToolSearchSetting, type TTrustLevel, type TUniversalArrayValue, type TUniversalMessage, type TUniversalMessageMetadata, type TUniversalMessagePart, type TUniversalMessageRole, type TUniversalValue, type TUserEvent, TUtilLogLevel, ToolExecutionError, ToolRegistry, ToolResultAdmissionError, TypeUtils, UNCLASSIFIED_TOOL_FALLBACK, USER_EVENTS, USER_EVENT_PREFIX, UnsupportedShellError, ValidationError, Validator, admitToolResult, allowRulesForAutoMode, applyPresetToolLists, assertProviderNativeWebToolsAvailable, assertResidentToolRemains, bindEventServiceOwner, bindWithOwnerPath, buildTraceparent, calculateModelCost, chatEntryToMessage, classifyProviderFailure, clearRegisteredToolProfiles, closeObjectSchemas, collectAssistantUsageMetadata, composeEventName, confirmAction, createAssistantMessage, createBoundedOutput, createDefaultProviderCapabilities, createExecutionProxy, createImageProviderFromDefinition, createLogger, createModelEffortOutcome, createProviderFromConfig, createRecordEnvResolver, createSystemMessage, createToolMessage, createUserMessage, createVideoProviderFromDefinition, decodeHookVerdict, estimateBlendedCostPer1000, estimateContextTokensFromMessages, estimateSerializedContextTokens, estimateToolSchemaTokens, evaluatePermission, extractEnumValues, findInvalidPermissionPatterns, findMediaProviderDefinition, findModelDefinition, findPermissionPatternWarnings, findProviderDefinition, formatEnvReference, formatSupportedProviderTypes, formatTokenCount, generateSpanId, getGlobalLogLevel, getGlobalLoggerSink, getMessagesForAPI, getModelContextWindow, getModelMaxOutput, getModelName, getProviderCapabilities, getProviderCredentialRequirement, getSchemaTypeName, getToolEstimatedDuration, getToolExecutionSteps, getToolPermissionProfile, hasUsableSecretReference, hasValidationConstraints, hashToolSchema, isAbortFailure, isAssistantMessage, isBroadExecutionAllowRule, isChatEntry, isConfirmed, isDefaultEventService, isEnforcing, isEnvReference, isImageGenerationProvider, isMediaProviderDefinition, isMintedSpanId, isModelEffort, isProgressReportingTool, isProtectedPath, isReadOnlyCommandLine, isRegistryTransactionError, isSystemMessage, isToolDeniedOutright, isToolMessage, isUserMessage, isVideoGenerationProvider, lifecycleOf, logger, lookupModelPrice, matchesAnyPattern, messageToHistoryEntry, modelDeclaresCapability, multiSelectAction, normalizeProviderConfig, normalizeStructuredOutput, outboundTraceContextFor, parseParameterRule, parseStructuredResponseText, peerDriverOf, printablePeerDriver, processEnvResolver, projectPermissionPolicy, projectToolSchema, providerCallSpanId, readModelFallbackNotice, readProviderFailureDetails, readTokenUsageFromMessage, readTokenUsageFromMetadata, registerModelMetadata, registerToolPermissionProfile, removesCriticalPath, requiresFreshApproval, resolveEnvReference, resolveMediaProviderConfig, resolveModelCapabilities, resolveModelCapability, resolveModelEffort, resolvePlatformShell, resolveStructuredOutputCapability, runHooks, runRegistryTransaction, selectAction, setGlobalLogLevel, setGlobalLoggerSink, setToolProgressCallback, shellArgumentForDisplay, spanIdFromMintedId, splitCommandSegments, startPeriodicTask, stopPeriodicTask, subprocessTraceEnvironment, sumHistoryUsage, textAction, toProviderError, toolNameMatches, toolNamesToPatterns, toolTraceContextFor, traceEnvFor, traceHeadersFor, validateAgainstJsonSchema, validateAgentConfig, validateApiKey, validateModelName, validatePermissionPattern, validateProviderName, validateUserInput, wasToolResultAdmitted, withEventEmission, zodToJsonSchema };
@@ -1,3 +1,3 @@
1
1
  import { A as TModelEffortProviderDispatch, C as IModelEffortResolution, D as TModelEffortDisposition, E as TModelEffort, F as IUniversalObjectValue, I as TPrimitiveValue, L as TUniversalArrayValue, M as createModelEffortOutcome, N as isModelEffort, O as TModelEffortNativeControl, P as resolveModelEffort, R as TUniversalValue, S as IModelEffortOutcome, T as MODEL_EFFORT_VALUES, _ as IOutboundTraceContext, b as TSubprocessTraceClass, c as IHookTypeExecutor, d as TGuardrail, f as THookDefinition, g as TSessionEndReason, h as THooksConfig, i as IGuardrailResult, j as TModelEffortSelection, k as TModelEffortOutcomeCallback, l as IHttpHookDefinition, m as THookOutcome, n as ICommandHookDefinition, o as IHookGroup, p as THookEvent, r as IGuardrailHookDefinition, s as IHookInput, t as IAgentHookDefinition, u as IPromptHookDefinition, v as IRunTraceContext, w as IProviderModelEffortTable, x as IModelEffortCapability, y as ISubprocessTraceEnv } from "./types-gNrckgFE.js";
2
- import { $ as parseParameterRule, $a as IAgentConfig, $c as resolveModelCapabilities, $i as isConfirmed, $n as createImageProviderFromDefinition, $o as TASK_EVENT_PREFIX, $r as IToolSchemaProjectionProfile, $s as IRawProviderResponse, $t as lifecycleOf, A as allowRulesForAutoMode, Aa as IProviderStructuredOutputCapability, Ac as AuthenticationError, Ai as IRemoteExecutorConfig, Al as ICacheEntry, An as IEventEmitterMetricsSnapshot, Ao as PluginPriority, Ar as TTimerId, As as TOOL_SEARCH_TOOL_NAME, At as IHandoffOrchestrationSpec, B as IPermissionPolicyProjection, Ba as IProviderProfileConfig, Bc as RobotaError, Bi as TConversationContextMetadata, Bl as TMetadata, Bn as isEnvReference, Bo as ISpanCompletionEventData, Br as TMessageConverterRegistry, Bs as normalizeStructuredOutput, Bt as AGENT_EVENTS, C as IContextTokenEstimate, Ca as IVideoGenerationRequest, Cc as IModelFallbackNotice, Ci as IEventHistorySnapshot, Cl as isUserMessage, Cn as assertResidentToolRemains, Co as IPluginErrorContext, Cr as IPlatformShell, Cs as EVENT_EMITTER_EVENTS, Ct as createExecutionProxy, D as estimateToolSchemaTokens, Da as TProviderMediaResult, Dc as classifyProviderFailure, Di as IExecutorStreamMessageEvent, Dl as IActionRequest, Dn as IEventEmitterHierarchicalEventData, Do as IPluginOptions, Dr as resolvePlatformShell, Ds as TEventName, Dt as ORCHESTRATION_EVENT_PREFIX, E as estimateSerializedContextTokens, Ea as TImageInputSource, Ec as TProviderFailureReason, Ei as IExecutorChatResult, El as IActionOption, En as EventEmitterPlugin, Eo as IPluginHooks, Er as UnsupportedShellError, Es as TEventEmitterListener, Et as ORCHESTRATION_EVENTS, F as IPermissionPatternProblem, Fa as IProviderDefinitionConfig, Fc as ModelNotAvailableError, Fi as IConversationResponse, Fl as TComplexConfigValue, Fn as TOutputRetention, Fo as IToolExecutionResult, Fr as validateApiKey, Fs as TExecutionEventData, Ft as IOrchestrationStep, G as IToolPermissionArgument, Ga as TProviderModelCatalogStatus, Gc as TErrorExternalInput, Gi as TToolProgressCallback, Gn as createAssistantMessage, Go as TOOL_BODY_EVENTS, Gr as AbstractExecutor, Gs as IZodSchema, Gt as IAssistantUsageMetadata, H as IParameterRule, Ha as IProviderSetupHelpLink, Hc as StorageError, Hi as TToolExecutionParameters, Hl as TToolParameters, Hn as IAIProviderInstance, Ho as PROVIDER_FALLBACK_EVENTS, Hr as TProviderMessage, Hs as validateAgainstJsonSchema, Ht as peerDriverOf, I as findInvalidPermissionPatterns, Ia as IProviderEndpoint, Ic as NetworkError, Ii as IConversationService, Il as TConfigData, In as createBoundedOutput, Io as IToolRegistry, Ir as validateModelName, Is as IJsonSchemaOutput, It as IOrchestrationStepResult, J as clearRegisteredToolProfiles, Ja as TProviderSetupHelpLinkKind, Jc as IModelRef, Ji as isProgressReportingTool, Jn as createUserMessage, Jo as readModelFallbackNotice, Jr as IExecutorAwareProviderConfig, Js as IAIProvider, Jt as sumHistoryUsage, K as IToolPermissionProfile, Ka as TProviderModelLifecycle, Kc as ToolExecutionError, Ki as getToolEstimatedDuration, Kn as createSystemMessage, Ko as TOOL_PERMISSION_EVENTS, Kr as AbstractPlugin, Ks as IZodSchemaDef, Kt as ISessionUsageTotals, L as findPermissionPatternWarnings, La as IProviderModelCatalog, Lc as PluginError, Li as IConversationServiceOptions, Ll as TConfigValue, Ln as ENV_REFERENCE_PREFIX, Lo as IToolResult, Lr as validateProviderName, Ls as IStructuredOutputSpec, Lt as IParallelOrchestrationSpec, M as splitCommandSegments, Ma as TStructuredOutputProvenance, Mc as CircuitBreakerOpenError, Mi as TExecutorStreamEvent, Ml as ICacheOptions, Mn as shellArgumentForDisplay, Mo as IParameterValidationResult, Mr as ISimpleValidationResult, Ms as TToolSearchSetting, Mt as IOrchestrationDelegation, N as applyPresetToolLists, Na as IProviderCredentialRequirement, Nc as ConfigurationError, Ni as IContextOptions, Nl as ICacheStats, Nn as IBoundedOutput, No as ITool, Nr as Validator, Ns as IRunOptions, Nt as IOrchestrationEventData, O as IContextTokenUsage, Oa as isImageGenerationProvider, Oc as readProviderFailureDetails, Oi as IExecutorStreamTerminalEvent, Ol as IUserInteraction, On as IEventEmitterPluginOptions, Oo as IPluginStats, Or as startPeriodicTask, Os as TExecutionEventName, Ot as TOrchestrationEvent, P as toolNamesToPatterns, Pa as IProviderDefinition, Pc as IProviderFailureDetails, Pi as IConversationContext, Pl as ICacheStorage, Pn as IBoundedOutputOptions, Po as IToolExecutionContext, Pr as validateAgentConfig, Ps as TExecutionEventCallback, Pt as IOrchestrationRunResult, Q as matchesAnyPattern, Qa as IAgent, Qc as modelDeclaresCapability, Qi as confirmAction, Qn as IMediaProviderOverrides, Qo as TASK_EVENTS, Qr as IToolSchemaProjectionChange, Qs as IProviderRequest, Qt as isRegistryTransactionError, R as validatePermissionPattern, Ra as IProviderModelCatalogEntry, Rc as ProviderError, Ri as IStreamingChunk, Rl as TContextData, Rn as formatEnvReference, Ro as TToolExecutor, Rr as validateUserInput, Rs as TStructuredOutputSchema, Rt as ISequentialOrchestrationSpec, S as CONTEXT_ESTIMATE_CHARS_PER_TOKEN, Sa as IVideoGenerationProvider, Sc as createDefaultProviderCapabilities, Si as IEventHistoryRecord, Sl as isToolMessage, Sn as DEFERRED_WITHOUT_LOADER_MESSAGE, So as IPluginData, Sr as traceHeadersFor, Ss as TEventUniversalValue, St as ExecutionProxy, T as estimateContextTokensFromMessages, Ta as IVideoJobSnapshot, Tc as IProviderFailureClassification, Ti as IExecutor, Tl as IActionDefault, Tn as ToolRegistry, To as IPluginExecutionResult, Tr as TShellKind, Ts as IEventEmitterPlugin, Tt as IExecutionProxyConfig, U as IPermissionEvaluationContext, Ua as IProviderSetupStepDefinition, Uc as StructuredOutputError, Ui as IProgressReportingTool, Ul as TypeUtils, Un as LocalExecutor, Uo as SPAN_EVENTS, Ur as isAbortFailure, Us as ISchemaConversionOptions, Ut as printablePeerDriver, V as projectPermissionPolicy, Va as IProviderProfileDefaults, Vc as SameToolInputLoopError, Vi as TResponseMetadata, Vl as TMetadataValue, Vn as resolveEnvReference, Vo as PROVIDER_CALL_EVENTS, Vr as TMessageFormatConverter, Vs as parseStructuredResponseText, Vt as AGENT_EVENT_PREFIX, W as IPermissionLists, Wa as TProviderCredentialField, Wc as TErrorContextData, Wi as IToolExecutionStep, Wn as ConversationHistory, Wo as SPAN_EVENT_PREFIX, Wr as AbstractTool, Ws as IZodParseResult, Wt as EventHistoryModule, X as getToolPermissionProfile, Xa as formatSupportedProviderTypes, Xc as IModelCapabilityDeviation, Xi as CONFIRM_NO, Xn as createProviderFromConfig, Xo as USER_EVENTS, Xr as TProviderLoggingData, Xs as IProviderNativeRawPayloadEvent, Xt as IRegistryTransactionError, Y as evaluatePermission, Ya as findProviderDefinition, Yc as TRoleModelMap, Yi as setToolProgressCallback, Yn as ConversationStore, Yo as TUserEvent, Yr as IProviderRuntimeConfig, Ys as IChatOptions, Yt as IRegistryOwnedLifecycle, Z as isToolDeniedOutright, Za as getProviderCredentialRequirement, Zc as IProviderCapabilityTable, Zi as CONFIRM_YES, Zn as normalizeProviderConfig, Zo as USER_EVENT_PREFIX, Zr as IToolSchemaProjection, Zs as IProviderOptions, Zt as IRegistryTransactionStep, _ as getModelName, _a as IImageGenerationResult, _c as IProviderFunctionCallingCapability, _i as IStats, _l as chatEntryToMessage, _n as IDestroyResult, _o as setGlobalLoggerSink, _r as providerCallSpanId, _s as IOwnerPathSegment, _t as TBackgroundPermissionPolicy, a as IModelPrice, aa as IAIProviderManager, ac as TProviderOptionValueBase, ai as TToolSchemaProjectionOutcome, al as IInlineImageMessagePart, an as IAgentFactoryOptions, ao as TToolExecutionFunction, ar as IStructuredOutputResolutionInput, as as bindEventServiceOwner, at as PROTECTED_FILE_NAMES, b as readTokenUsageFromMessage, ba as IProviderMediaError, bc as IProviderNativeWebToolRequest, bi as ITerminalOutput, bl as isChatEntry, bn as TOOL_EVENTS, bo as IPluginContext, br as toolTraceContextFor, bs as TEventListener, bt as TRUST_TO_MODE, c as estimateBlendedCostPer1000, ca as IMediaProviderConfig, cc as getProviderCapabilities, ci as projectToolSchema, cl as IToolCall, cn as DEFAULT_TOOL_RESULT_WARNING_CHARS, co as ILoggerOptions, cr as getSchemaTypeName, cs as generateSpanId, ct as RISK_CLASS_POLICY, d as DEFAULT_MAX_OUTPUT, da as findMediaProviderDefinition, dc as IToolSchema, di as AbstractAgent, dl as IUserMessage, dn as MAX_TOOL_RESULT_CHARS, do as TUtilLogLevel, dr as ISchemaClosureOptions, ds as IBaseEventData, dt as TArgumentKind, ea as multiSelectAction, ec as ITokenUsage, ei as PARAMETER_SCHEMA_KEYWORDS, el as resolveModelCapability, en as runRegistryTransaction, eo as IAgentTemplate, er as createVideoProviderFromDefinition, es as AbstractEventService, et as registerToolPermissionProfile, f as IModelDefinition, fa as isMediaProviderDefinition, fc as TJSONSchemaEnum, fi as ICredentialKey, fl as TMessageState, fn as TToolResultAdmissionErrorCode, fo as createLogger, fr as closeObjectSchemas, fs as IEventContext, ft as TMatchDirection, g as getModelMaxOutput, ga as IImageGenerationRequest, gc as IProviderCapabilities, gi as IFileSystemAsync, gl as TUniversalMessageRole, gn as Robota, go as setGlobalLogLevel, gr as outboundTraceContextFor, gs as IExecutionEventData, gt as DEFAULT_BACKGROUND_PERMISSION_POLICY, h as getModelContextWindow, ha as IImageGenerationProvider, hc as IProviderSpecificOptions, hi as IFileSystem, hl as TUniversalMessagePart, hn as wasToolResultAdmitted, ho as logger, hr as isMintedSpanId, hs as IEventServiceOwnerBinding, ht as isReadOnlyCommandLine, i as runHooks, ia as IToolFactory, ic as TProviderNativeRawPayloadKind, ii as TOOL_SCHEMA_PROJECTION_MAX_NODES, il as IHistoryEntry, in as IAgentCreationStats, io as IToolWithEventService, ir as processEnvResolver, is as StructuredEventService, it as PROTECTED_DIRECTORY_NAMES, j as isBroadExecutionAllowRule, ja as TStructuredOutputMechanism, jc as CacheIntegrityError, ji as IStreamExecutionRequest, jl as ICacheKey, jn as InMemoryEventEmitterMetrics, jo as IFunctionTool, jr as ErrorUtils, js as TToolSearchMode, jt as IHierarchicalOrchestrationSpec, k as IContextWindowState, ka as isVideoGenerationProvider, kc as toProviderError, ki as ILocalExecutorConfig, kl as TActionResponse, kn as IEventEmitterMetrics, ko as PluginCategory, kr as stopPeriodicTask, ks as IDeferredToolCatalog, kt as IGroupChatOrchestrationSpec, l as lookupModelPrice, la as IMediaProviderCredentialRequirement, lc as IObjectParameterSchema, li as AbstractManager, ll as IToolMessage, ln as IToolResultAdmissionOptions, lo as IUtilLogEntry, lr as hasValidationConstraints, ls as isDefaultEventService, lt as TToolRiskClass, m as formatTokenCount, ma as IImageEditRequest, mc as TParameterDefaultValue, mi as IDirent, ml as TUniversalMessageMetadata, mn as admitToolResult, mo as getGlobalLoggerSink, mr as buildTraceparent, ms as IEventService, mt as TResolveInWorkspace, n as decodeHookVerdict, na as textAction, nc as TProviderNativeRawPayload, ni as STRICT_TOOL_SCHEMA_PROFILE, nl as IAssistantMessage, nn as AgentTemplates, no as IAbstractToolOptions, nr as TEnvResolver, ns as DefaultEventService, nt as toolNameMatches, o as MODEL_PRICES, oa as IToolManager, oc as TTextDeltaCallback, oi as TToolSchemaProjectionProfileBase, ol as ISystemMessage, on as IAgentLifecycleEvents, oo as ConsoleLogger, or as resolveStructuredOutputCapability, os as bindWithOwnerPath, ot as isProtectedPath, p as findModelDefinition, pa as IImageComposeRequest, pc as TJSONSchemaKind, pi as ICredentialStore, pl as TUniversalMessage, pn as ToolResultAdmissionError, po as getGlobalLogLevel, pr as zodToJsonSchema, ps as IEventObjectValue, pt as IReadOnlyCommandContext, q as TToolArgs, qa as TProviderSetupField, qc as ValidationError, qi as getToolExecutionSteps, qn as createToolMessage, qo as TSpanEvent, qr as AbstractAIProvider, qs as IResponseFormatConfig, qt as collectAssistantUsageMetadata, r as GuardrailExecutor, ra as IOpenAPIToolConfig, rc as TProviderNativeRawPayloadCallback, ri as TOOL_SCHEMA_PROJECTION_MAX_DEPTH, rl as IBaseMessage, rn as ITemplateApplicationResult, ro as IToolContract, rr as createRecordEnvResolver, rs as ObservableEventService, rt as ICriticalPathContext, s as calculateModelCost, sa as TManagerToolParameters, sc as TToolChoice, si as hashToolSchema, sl as ITextMessagePart, sn as DEFAULT_TOOL_RESULT_HARD_CHARS, so as ILogger, sr as extractEnumValues, ss as composeEventName, st as removesCriticalPath, t as isEnforcing, ta as selectAction, tc as TProviderConfigValue, ti as PERMISSIVE_TOOL_SCHEMA_PROFILE, tl as TProviderModelCapability, tn as AgentFactory, to as IAbstractTool, tr as resolveMediaProviderConfig, ts as DEFAULT_ABSTRACT_EVENT_SERVICE, tt as requiresFreshApproval, u as DEFAULT_CONTEXT_WINDOW, ua as IMediaProviderDefinition, uc as IParameterSchema, ui as IManagerLifecycleOptions, ul as IUriImageMessagePart, un as IToolResultSpillStore, uo as SilentLogger, ur as ISchemaClosureChange, us as IAgentEventData, ut as UNCLASSIFIED_TOOL_FALLBACK, v as registerModelMetadata, va as IInlineImageInputSource, vc as IProviderNativeWebToolCapabilities, vi as ISession, vl as getMessagesForAPI, vn as EXECUTION_EVENTS, vo as IPlugin, vr as spanIdFromMintedId, vs as IToolEventData, vt as TPermissionDecision, w as IContextTokenEstimateOptions, wa as IVideoJobAccepted, wc as TModelFallbackCallback, wi as IChatExecutionRequest, wl as messageToHistoryEntry, wn as FunctionTool, wo as IPluginExecutionContext, wr as IPlatformShellResolutionRequest, ws as IEventEmitterEventData, wt as withEventEmission, x as readTokenUsageFromMetadata, xa as IUriImageInputSource, xc as assertProviderNativeWebToolsAvailable, xi as IEventHistoryModule, xl as isSystemMessage, xn as TOOL_EVENT_PREFIX, xo as IPluginContract, xr as traceEnvFor, xs as TEventLoggerData, xt as TTrustLevel, y as IMessageTokenUsage, ya as IMediaOutputRef, yc as IProviderNativeWebToolCapability, yi as ISpinner, yl as isAssistantMessage, yn as EXECUTION_EVENT_PREFIX, yo as IPluginConfig, yr as subprocessTraceEnvironment, ys as TEventExtensionValue, yt as TPermissionMode, z as IPermissionPolicyContext, za as IProviderProbeResult, zc as RateLimitError, zi as IToolExecutionRequest, zl as TLoggerData, zn as hasUsableSecretReference, zo as TToolMetadata, zr as MessageConverter, zs as TStructuredOutputValidation, zt as TOrchestrationPrimitive } from "./index-DFlMw376.js";
2
+ import { $ as parseParameterRule, $a as IAgentConfig, $c as resolveModelCapabilities, $i as isConfirmed, $n as createImageProviderFromDefinition, $o as TASK_EVENT_PREFIX, $r as IToolSchemaProjectionProfile, $s as IRawProviderResponse, $t as lifecycleOf, A as allowRulesForAutoMode, Aa as IProviderStructuredOutputCapability, Ac as AuthenticationError, Ai as IRemoteExecutorConfig, Al as ICacheEntry, An as IEventEmitterMetricsSnapshot, Ao as PluginPriority, Ar as TTimerId, As as TOOL_SEARCH_TOOL_NAME, At as IHandoffOrchestrationSpec, B as IPermissionPolicyProjection, Ba as IProviderProfileConfig, Bc as RobotaError, Bi as TConversationContextMetadata, Bl as TMetadata, Bn as isEnvReference, Bo as ISpanCompletionEventData, Br as TMessageConverterRegistry, Bs as normalizeStructuredOutput, Bt as AGENT_EVENTS, C as IContextTokenEstimate, Ca as IVideoGenerationRequest, Cc as IModelFallbackNotice, Ci as IEventHistorySnapshot, Cl as isUserMessage, Cn as assertResidentToolRemains, Co as IPluginErrorContext, Cr as IPlatformShell, Cs as EVENT_EMITTER_EVENTS, Ct as createExecutionProxy, D as estimateToolSchemaTokens, Da as TProviderMediaResult, Dc as classifyProviderFailure, Di as IExecutorStreamMessageEvent, Dl as IActionRequest, Dn as IEventEmitterHierarchicalEventData, Do as IPluginOptions, Dr as resolvePlatformShell, Ds as TEventName, Dt as ORCHESTRATION_EVENT_PREFIX, E as estimateSerializedContextTokens, Ea as TImageInputSource, Ec as TProviderFailureReason, Ei as IExecutorChatResult, El as IActionOption, En as EventEmitterPlugin, Eo as IPluginHooks, Er as UnsupportedShellError, Es as TEventEmitterListener, Et as ORCHESTRATION_EVENTS, F as IPermissionPatternProblem, Fa as IProviderDefinitionConfig, Fc as ModelNotAvailableError, Fi as IConversationResponse, Fl as TComplexConfigValue, Fn as TOutputRetention, Fo as IToolExecutionResult, Fr as validateApiKey, Fs as TExecutionEventData, Ft as IOrchestrationStep, G as IToolPermissionArgument, Ga as TProviderModelCatalogStatus, Gc as TErrorExternalInput, Gi as TToolProgressCallback, Gn as createAssistantMessage, Go as TOOL_BODY_EVENTS, Gr as AbstractExecutor, Gs as IZodSchema, Gt as IAssistantUsageMetadata, H as IParameterRule, Ha as IProviderSetupHelpLink, Hc as StorageError, Hi as TToolExecutionParameters, Hl as TToolParameters, Hn as IAIProviderInstance, Ho as PROVIDER_FALLBACK_EVENTS, Hr as TProviderMessage, Hs as validateAgainstJsonSchema, Ht as peerDriverOf, I as findInvalidPermissionPatterns, Ia as IProviderEndpoint, Ic as NetworkError, Ii as IConversationService, Il as TConfigData, In as createBoundedOutput, Io as IToolRegistry, Ir as validateModelName, Is as IJsonSchemaOutput, It as IOrchestrationStepResult, J as clearRegisteredToolProfiles, Ja as TProviderSetupHelpLinkKind, Jc as IModelRef, Ji as isProgressReportingTool, Jn as createUserMessage, Jo as readModelFallbackNotice, Jr as IExecutorAwareProviderConfig, Js as IAIProvider, Jt as sumHistoryUsage, K as IToolPermissionProfile, Ka as TProviderModelLifecycle, Kc as ToolExecutionError, Ki as getToolEstimatedDuration, Kn as createSystemMessage, Ko as TOOL_PERMISSION_EVENTS, Kr as AbstractPlugin, Ks as IZodSchemaDef, Kt as ISessionUsageTotals, L as findPermissionPatternWarnings, La as IProviderModelCatalog, Lc as PluginError, Li as IConversationServiceOptions, Ll as TConfigValue, Ln as ENV_REFERENCE_PREFIX, Lo as IToolResult, Lr as validateProviderName, Ls as IStructuredOutputSpec, Lt as IParallelOrchestrationSpec, M as splitCommandSegments, Ma as TStructuredOutputProvenance, Mc as CircuitBreakerOpenError, Mi as TExecutorStreamEvent, Ml as ICacheOptions, Mn as shellArgumentForDisplay, Mo as IParameterValidationResult, Mr as ISimpleValidationResult, Ms as TToolSearchSetting, Mt as IOrchestrationDelegation, N as applyPresetToolLists, Na as IProviderCredentialRequirement, Nc as ConfigurationError, Ni as IContextOptions, Nl as ICacheStats, Nn as IBoundedOutput, No as ITool, Nr as Validator, Ns as IRunOptions, Nt as IOrchestrationEventData, O as IContextTokenUsage, Oa as isImageGenerationProvider, Oc as readProviderFailureDetails, Oi as IExecutorStreamTerminalEvent, Ol as IUserInteraction, On as IEventEmitterPluginOptions, Oo as IPluginStats, Or as startPeriodicTask, Os as TExecutionEventName, Ot as TOrchestrationEvent, P as toolNamesToPatterns, Pa as IProviderDefinition, Pc as IProviderFailureDetails, Pi as IConversationContext, Pl as ICacheStorage, Pn as IBoundedOutputOptions, Po as IToolExecutionContext, Pr as validateAgentConfig, Ps as TExecutionEventCallback, Pt as IOrchestrationRunResult, Q as matchesAnyPattern, Qa as IAgent, Qc as modelDeclaresCapability, Qi as confirmAction, Qn as IMediaProviderOverrides, Qo as TASK_EVENTS, Qr as IToolSchemaProjectionChange, Qs as IProviderRequest, Qt as isRegistryTransactionError, R as validatePermissionPattern, Ra as IProviderModelCatalogEntry, Rc as ProviderError, Ri as IStreamingChunk, Rl as TContextData, Rn as formatEnvReference, Ro as TToolExecutor, Rr as validateUserInput, Rs as TStructuredOutputSchema, Rt as ISequentialOrchestrationSpec, S as CONTEXT_ESTIMATE_CHARS_PER_TOKEN, Sa as IVideoGenerationProvider, Sc as createDefaultProviderCapabilities, Si as IEventHistoryRecord, Sl as isToolMessage, Sn as DEFERRED_WITHOUT_LOADER_MESSAGE, So as IPluginData, Sr as traceHeadersFor, Ss as TEventUniversalValue, St as ExecutionProxy, T as estimateContextTokensFromMessages, Ta as IVideoJobSnapshot, Tc as IProviderFailureClassification, Ti as IExecutor, Tl as IActionDefault, Tn as ToolRegistry, To as IPluginExecutionResult, Tr as TShellKind, Ts as IEventEmitterPlugin, Tt as IExecutionProxyConfig, U as IPermissionEvaluationContext, Ua as IProviderSetupStepDefinition, Uc as StructuredOutputError, Ui as IProgressReportingTool, Ul as TypeUtils, Un as LocalExecutor, Uo as SPAN_EVENTS, Ur as isAbortFailure, Us as ISchemaConversionOptions, Ut as printablePeerDriver, V as projectPermissionPolicy, Va as IProviderProfileDefaults, Vc as SameToolInputLoopError, Vi as TResponseMetadata, Vl as TMetadataValue, Vn as resolveEnvReference, Vo as PROVIDER_CALL_EVENTS, Vr as TMessageFormatConverter, Vs as parseStructuredResponseText, Vt as AGENT_EVENT_PREFIX, W as IPermissionLists, Wa as TProviderCredentialField, Wc as TErrorContextData, Wi as IToolExecutionStep, Wn as ConversationHistory, Wo as SPAN_EVENT_PREFIX, Wr as AbstractTool, Ws as IZodParseResult, Wt as EventHistoryModule, X as getToolPermissionProfile, Xa as formatSupportedProviderTypes, Xc as IModelCapabilityDeviation, Xi as CONFIRM_NO, Xn as createProviderFromConfig, Xo as USER_EVENTS, Xr as TProviderLoggingData, Xs as IProviderNativeRawPayloadEvent, Xt as IRegistryTransactionError, Y as evaluatePermission, Ya as findProviderDefinition, Yc as TRoleModelMap, Yi as setToolProgressCallback, Yn as ConversationStore, Yo as TUserEvent, Yr as IProviderRuntimeConfig, Ys as IChatOptions, Yt as IRegistryOwnedLifecycle, Z as isToolDeniedOutright, Za as getProviderCredentialRequirement, Zc as IProviderCapabilityTable, Zi as CONFIRM_YES, Zn as normalizeProviderConfig, Zo as USER_EVENT_PREFIX, Zr as IToolSchemaProjection, Zs as IProviderOptions, Zt as IRegistryTransactionStep, _ as getModelName, _a as IImageGenerationResult, _c as IProviderFunctionCallingCapability, _i as IStats, _l as chatEntryToMessage, _n as IDestroyResult, _o as setGlobalLoggerSink, _r as providerCallSpanId, _s as IOwnerPathSegment, _t as TBackgroundPermissionPolicy, a as IModelPrice, aa as IAIProviderManager, ac as TProviderOptionValueBase, ai as TToolSchemaProjectionOutcome, al as IInlineImageMessagePart, an as IAgentFactoryOptions, ao as TToolExecutionFunction, ar as IStructuredOutputResolutionInput, as as bindEventServiceOwner, at as PROTECTED_FILE_NAMES, b as readTokenUsageFromMessage, ba as IProviderMediaError, bc as IProviderNativeWebToolRequest, bi as ITerminalOutput, bl as isChatEntry, bn as TOOL_EVENTS, bo as IPluginContext, br as toolTraceContextFor, bs as TEventListener, bt as TRUST_TO_MODE, c as estimateBlendedCostPer1000, ca as IMediaProviderConfig, cc as getProviderCapabilities, ci as projectToolSchema, cl as IToolCall, cn as DEFAULT_TOOL_RESULT_WARNING_CHARS, co as ILoggerOptions, cr as getSchemaTypeName, cs as generateSpanId, ct as RISK_CLASS_POLICY, d as DEFAULT_MAX_OUTPUT, da as findMediaProviderDefinition, dc as IToolSchema, di as AbstractAgent, dl as IUserMessage, dn as MAX_TOOL_RESULT_CHARS, do as TUtilLogLevel, dr as ISchemaClosureOptions, ds as IBaseEventData, dt as TArgumentKind, ea as multiSelectAction, ec as ITokenUsage, ei as PARAMETER_SCHEMA_KEYWORDS, el as resolveModelCapability, en as runRegistryTransaction, eo as IAgentTemplate, er as createVideoProviderFromDefinition, es as AbstractEventService, et as registerToolPermissionProfile, f as IModelDefinition, fa as isMediaProviderDefinition, fc as TJSONSchemaEnum, fi as ICredentialKey, fl as TMessageState, fn as TToolResultAdmissionErrorCode, fo as createLogger, fr as closeObjectSchemas, fs as IEventContext, ft as TMatchDirection, g as getModelMaxOutput, ga as IImageGenerationRequest, gc as IProviderCapabilities, gi as IFileSystemAsync, gl as TUniversalMessageRole, gn as Robota, go as setGlobalLogLevel, gr as outboundTraceContextFor, gs as IExecutionEventData, gt as DEFAULT_BACKGROUND_PERMISSION_POLICY, h as getModelContextWindow, ha as IImageGenerationProvider, hc as IProviderSpecificOptions, hi as IFileSystem, hl as TUniversalMessagePart, hn as wasToolResultAdmitted, ho as logger, hr as isMintedSpanId, hs as IEventServiceOwnerBinding, ht as isReadOnlyCommandLine, i as runHooks, ia as IToolFactory, ic as TProviderNativeRawPayloadKind, ii as TOOL_SCHEMA_PROJECTION_MAX_NODES, il as IHistoryEntry, in as IAgentCreationStats, io as IToolWithEventService, ir as processEnvResolver, is as StructuredEventService, it as PROTECTED_DIRECTORY_NAMES, j as isBroadExecutionAllowRule, ja as TStructuredOutputMechanism, jc as CacheIntegrityError, ji as IStreamExecutionRequest, jl as ICacheKey, jn as InMemoryEventEmitterMetrics, jo as IFunctionTool, jr as ErrorUtils, js as TToolSearchMode, jt as IHierarchicalOrchestrationSpec, k as IContextWindowState, ka as isVideoGenerationProvider, kc as toProviderError, ki as ILocalExecutorConfig, kl as TActionResponse, kn as IEventEmitterMetrics, ko as PluginCategory, kr as stopPeriodicTask, ks as IDeferredToolCatalog, kt as IGroupChatOrchestrationSpec, l as lookupModelPrice, la as IMediaProviderCredentialRequirement, lc as IObjectParameterSchema, li as AbstractManager, ll as IToolMessage, ln as IToolResultAdmissionOptions, lo as IUtilLogEntry, lr as hasValidationConstraints, ls as isDefaultEventService, lt as TToolRiskClass, m as formatTokenCount, ma as IImageEditRequest, mc as TParameterDefaultValue, mi as IDirent, ml as TUniversalMessageMetadata, mn as admitToolResult, mo as getGlobalLoggerSink, mr as buildTraceparent, ms as IEventService, mt as TResolveInWorkspace, n as decodeHookVerdict, na as textAction, nc as TProviderNativeRawPayload, ni as STRICT_TOOL_SCHEMA_PROFILE, nl as IAssistantMessage, nn as AgentTemplates, no as IAbstractToolOptions, nr as TEnvResolver, ns as DefaultEventService, nt as toolNameMatches, o as MODEL_PRICES, oa as IToolManager, oc as TTextDeltaCallback, oi as TToolSchemaProjectionProfileBase, ol as ISystemMessage, on as IAgentLifecycleEvents, oo as ConsoleLogger, or as resolveStructuredOutputCapability, os as bindWithOwnerPath, ot as isProtectedPath, p as findModelDefinition, pa as IImageComposeRequest, pc as TJSONSchemaKind, pi as ICredentialStore, pl as TUniversalMessage, pn as ToolResultAdmissionError, po as getGlobalLogLevel, pr as zodToJsonSchema, ps as IEventObjectValue, pt as IReadOnlyCommandContext, q as TToolArgs, qa as TProviderSetupField, qc as ValidationError, qi as getToolExecutionSteps, qn as createToolMessage, qo as TSpanEvent, qr as AbstractAIProvider, qs as IResponseFormatConfig, qt as collectAssistantUsageMetadata, r as GuardrailExecutor, ra as IOpenAPIToolConfig, rc as TProviderNativeRawPayloadCallback, ri as TOOL_SCHEMA_PROJECTION_MAX_DEPTH, rl as IBaseMessage, rn as ITemplateApplicationResult, ro as IToolContract, rr as createRecordEnvResolver, rs as ObservableEventService, rt as ICriticalPathContext, s as calculateModelCost, sa as TManagerToolParameters, sc as TToolChoice, si as hashToolSchema, sl as ITextMessagePart, sn as DEFAULT_TOOL_RESULT_HARD_CHARS, so as ILogger, sr as extractEnumValues, ss as composeEventName, st as removesCriticalPath, t as isEnforcing, ta as selectAction, tc as TProviderConfigValue, ti as PERMISSIVE_TOOL_SCHEMA_PROFILE, tl as TProviderModelCapability, tn as AgentFactory, to as IAbstractTool, tr as resolveMediaProviderConfig, ts as DEFAULT_ABSTRACT_EVENT_SERVICE, tt as requiresFreshApproval, u as DEFAULT_CONTEXT_WINDOW, ua as IMediaProviderDefinition, uc as IParameterSchema, ui as IManagerLifecycleOptions, ul as IUriImageMessagePart, un as IToolResultSpillStore, uo as SilentLogger, ur as ISchemaClosureChange, us as IAgentEventData, ut as UNCLASSIFIED_TOOL_FALLBACK, v as registerModelMetadata, va as IInlineImageInputSource, vc as IProviderNativeWebToolCapabilities, vi as ISession, vl as getMessagesForAPI, vn as EXECUTION_EVENTS, vo as IPlugin, vr as spanIdFromMintedId, vs as IToolEventData, vt as TPermissionDecision, w as IContextTokenEstimateOptions, wa as IVideoJobAccepted, wc as TModelFallbackCallback, wi as IChatExecutionRequest, wl as messageToHistoryEntry, wn as FunctionTool, wo as IPluginExecutionContext, wr as IPlatformShellResolutionRequest, ws as IEventEmitterEventData, wt as withEventEmission, x as readTokenUsageFromMetadata, xa as IUriImageInputSource, xc as assertProviderNativeWebToolsAvailable, xi as IEventHistoryModule, xl as isSystemMessage, xn as TOOL_EVENT_PREFIX, xo as IPluginContract, xr as traceEnvFor, xs as TEventLoggerData, xt as TTrustLevel, y as IMessageTokenUsage, ya as IMediaOutputRef, yc as IProviderNativeWebToolCapability, yi as ISpinner, yl as isAssistantMessage, yn as EXECUTION_EVENT_PREFIX, yo as IPluginConfig, yr as subprocessTraceEnvironment, ys as TEventExtensionValue, yt as TPermissionMode, z as IPermissionPolicyContext, za as IProviderProbeResult, zc as RateLimitError, zi as IToolExecutionRequest, zl as TLoggerData, zn as hasUsableSecretReference, zo as TToolMetadata, zr as MessageConverter, zs as TStructuredOutputValidation, zt as TOrchestrationPrimitive } from "./index-D2rky0wZ.js";
3
3
  export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractEventService, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CONFIRM_NO, CONFIRM_YES, CONTEXT_ESTIMATE_CHARS_PER_TOKEN, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError, ConsoleLogger, ConversationHistory, ConversationStore, DEFAULT_ABSTRACT_EVENT_SERVICE, DEFAULT_BACKGROUND_PERMISSION_POLICY, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT, DEFAULT_TOOL_RESULT_HARD_CHARS, DEFAULT_TOOL_RESULT_WARNING_CHARS, DEFERRED_WITHOUT_LOADER_MESSAGE, DefaultEventService, ENV_REFERENCE_PREFIX, EVENT_EMITTER_EVENTS, EXECUTION_EVENTS, EXECUTION_EVENT_PREFIX, ErrorUtils, EventEmitterPlugin, EventHistoryModule, ExecutionProxy, FunctionTool, GuardrailExecutor, type IAIProvider, type IAIProviderInstance, type IAIProviderManager, type IAbstractTool, type IAbstractToolOptions, type IActionDefault, type IActionOption, type IActionRequest, type IAgent, type IAgentConfig, type IAgentCreationStats, type IAgentEventData, type IAgentFactoryOptions, type IAgentHookDefinition, type IAgentLifecycleEvents, type IAgentTemplate, type IAssistantMessage, type IAssistantUsageMetadata, type IBaseEventData, type IBaseMessage, type IBoundedOutput, type IBoundedOutputOptions, type ICacheEntry, type ICacheKey, type ICacheOptions, type ICacheStats, type ICacheStorage, type IChatExecutionRequest, type IChatOptions, type ICommandHookDefinition, type IContextOptions, type IContextTokenEstimate, type IContextTokenEstimateOptions, type IContextTokenUsage, type IContextWindowState, type IConversationContext, type IConversationResponse, type IConversationService, type IConversationServiceOptions, type ICredentialKey, type ICredentialStore, type ICriticalPathContext, type IDeferredToolCatalog, type IDestroyResult, type IDirent, type IEventContext, type IEventEmitterEventData, type IEventEmitterHierarchicalEventData, type IEventEmitterMetrics, type IEventEmitterMetricsSnapshot, type IEventEmitterPlugin, type IEventEmitterPluginOptions, type IEventHistoryModule, type IEventHistoryRecord, type IEventHistorySnapshot, type IEventObjectValue, type IEventService, type IEventServiceOwnerBinding, type IExecutionEventData, type IExecutionProxyConfig, type IExecutor, IExecutorAwareProviderConfig, type IExecutorChatResult, type IExecutorStreamMessageEvent, type IExecutorStreamTerminalEvent, type IFileSystem, type IFileSystemAsync, type IFunctionTool, type IGroupChatOrchestrationSpec, type IGuardrailHookDefinition, type IGuardrailResult, type IHandoffOrchestrationSpec, type IHierarchicalOrchestrationSpec, type IHistoryEntry, type IHookGroup, type IHookInput, type IHookTypeExecutor, type IHttpHookDefinition, type IImageComposeRequest, type IImageEditRequest, type IImageGenerationProvider, type IImageGenerationRequest, type IImageGenerationResult, type IInlineImageInputSource, type IInlineImageMessagePart, type IJsonSchemaOutput, type ILocalExecutorConfig, ILogger, ILoggerOptions, IManagerLifecycleOptions, type IMediaOutputRef, type IMediaProviderConfig, type IMediaProviderCredentialRequirement, type IMediaProviderDefinition, type IMediaProviderOverrides, type IMessageTokenUsage, type IModelCapabilityDeviation, type IModelDefinition, type IModelEffortCapability, type IModelEffortOutcome, type IModelEffortResolution, type IModelFallbackNotice, type IModelPrice, type IModelRef, type IObjectParameterSchema, type IOpenAPIToolConfig, type IOrchestrationDelegation, type IOrchestrationEventData, type IOrchestrationRunResult, type IOrchestrationStep, type IOrchestrationStepResult, type IOutboundTraceContext, type IOwnerPathSegment, type IParallelOrchestrationSpec, type IParameterRule, type IParameterSchema, type IParameterValidationResult, type IPermissionEvaluationContext, type IPermissionLists, type IPermissionPatternProblem, type IPermissionPolicyContext, type IPermissionPolicyProjection, IPlatformShell, IPlatformShellResolutionRequest, type IPlugin, type IPluginConfig, type IPluginContext, type IPluginContract, type IPluginData, type IPluginErrorContext, type IPluginExecutionContext, type IPluginExecutionResult, type IPluginHooks, type IPluginOptions, type IPluginStats, type IProgressReportingTool, type IPromptHookDefinition, type IProviderCapabilities, type IProviderCapabilityTable, type IProviderCredentialRequirement, type IProviderDefinition, type IProviderDefinitionConfig, type IProviderEndpoint, type IProviderFailureClassification, IProviderFailureDetails, type IProviderFunctionCallingCapability, type IProviderMediaError, type IProviderModelCatalog, type IProviderModelCatalogEntry, type IProviderModelEffortTable, type IProviderNativeRawPayloadEvent, type IProviderNativeWebToolCapabilities, type IProviderNativeWebToolCapability, type IProviderNativeWebToolRequest, type IProviderOptions, type IProviderProbeResult, type IProviderProfileConfig, type IProviderProfileDefaults, type IProviderRequest, IProviderRuntimeConfig, type IProviderSetupHelpLink, type IProviderSetupStepDefinition, type IProviderSpecificOptions, type IProviderStructuredOutputCapability, type IRawProviderResponse, type IReadOnlyCommandContext, type IRegistryOwnedLifecycle, type IRegistryTransactionError, type IRegistryTransactionStep, type IRemoteExecutorConfig, type IResponseFormatConfig, type IRunOptions, type IRunTraceContext, type ISchemaClosureChange, type ISchemaClosureOptions, type ISchemaConversionOptions, type ISequentialOrchestrationSpec, type ISession, type ISessionUsageTotals, ISimpleValidationResult, type ISpanCompletionEventData, type ISpinner, type IStats, type IStreamExecutionRequest, type IStreamingChunk, type IStructuredOutputResolutionInput, type IStructuredOutputSpec, type ISubprocessTraceEnv, type ISystemMessage, type ITemplateApplicationResult, type ITerminalOutput, type ITextMessagePart, type ITokenUsage, type ITool, type IToolCall, type IToolContract, type IToolEventData, type IToolExecutionContext, type IToolExecutionRequest, type IToolExecutionResult, type IToolExecutionStep, type IToolFactory, type IToolManager, type IToolMessage, type IToolPermissionArgument, type IToolPermissionProfile, type IToolRegistry, type IToolResult, type IToolResultAdmissionOptions, type IToolResultSpillStore, type IToolSchema, type IToolSchemaProjection, type IToolSchemaProjectionChange, type IToolSchemaProjectionProfile, type IToolWithEventService, type IUniversalObjectValue, type IUriImageInputSource, type IUriImageMessagePart, type IUserInteraction, type IUserMessage, IUtilLogEntry, type IVideoGenerationProvider, type IVideoGenerationRequest, type IVideoJobAccepted, type IVideoJobSnapshot, type IZodParseResult, type IZodSchema, type IZodSchemaDef, InMemoryEventEmitterMetrics, LocalExecutor, MAX_TOOL_RESULT_CHARS, MODEL_EFFORT_VALUES, MODEL_PRICES, MessageConverter, ModelNotAvailableError, NetworkError, ORCHESTRATION_EVENTS, ORCHESTRATION_EVENT_PREFIX, ObservableEventService, PARAMETER_SCHEMA_KEYWORDS, PERMISSIVE_TOOL_SCHEMA_PROFILE, PROTECTED_DIRECTORY_NAMES, PROTECTED_FILE_NAMES, PROVIDER_CALL_EVENTS, PROVIDER_FALLBACK_EVENTS, PluginCategory, PluginError, PluginPriority, ProviderError, RISK_CLASS_POLICY, RateLimitError, Robota, RobotaError, SPAN_EVENTS, SPAN_EVENT_PREFIX, STRICT_TOOL_SCHEMA_PROFILE, SameToolInputLoopError, SilentLogger, StorageError, StructuredEventService, StructuredOutputError, TASK_EVENTS, TASK_EVENT_PREFIX, type TActionResponse, type TArgumentKind, type TBackgroundPermissionPolicy, TComplexConfigValue, TConfigData, TConfigValue, TContextData, type TConversationContextMetadata, type TEnvResolver, TErrorContextData, TErrorExternalInput, type TEventEmitterListener, type TEventExtensionValue, type TEventListener, type TEventLoggerData, type TEventName, type TEventUniversalValue, type TExecutionEventCallback, type TExecutionEventData, type TExecutionEventName, type TExecutorStreamEvent, type TGuardrail, type THookDefinition, type THookEvent, type THookOutcome, type THooksConfig, type TImageInputSource, type TJSONSchemaEnum, type TJSONSchemaKind, TLoggerData, type TManagerToolParameters, type TMatchDirection, TMessageConverterRegistry, TMessageFormatConverter, type TMessageState, TMetadata, TMetadataValue, type TModelEffort, type TModelEffortDisposition, type TModelEffortNativeControl, type TModelEffortOutcomeCallback, type TModelEffortProviderDispatch, type TModelEffortSelection, type TModelFallbackCallback, TOOL_BODY_EVENTS, TOOL_EVENTS, TOOL_EVENT_PREFIX, TOOL_PERMISSION_EVENTS, TOOL_SCHEMA_PROJECTION_MAX_DEPTH, TOOL_SCHEMA_PROJECTION_MAX_NODES, TOOL_SEARCH_TOOL_NAME, type TOrchestrationEvent, type TOrchestrationPrimitive, type TOutputRetention, type TParameterDefaultValue, type TPermissionDecision, type TPermissionMode, type TPrimitiveValue, type TProviderConfigValue, type TProviderCredentialField, type TProviderFailureReason, TProviderLoggingData, type TProviderMediaResult, TProviderMessage, type TProviderModelCapability, type TProviderModelCatalogStatus, type TProviderModelLifecycle, type TProviderNativeRawPayload, type TProviderNativeRawPayloadCallback, type TProviderNativeRawPayloadKind, type TProviderOptionValueBase, type TProviderSetupField, type TProviderSetupHelpLinkKind, TRUST_TO_MODE, type TResolveInWorkspace, type TResponseMetadata, type TRoleModelMap, type TSessionEndReason, TShellKind, type TSpanEvent, type TStructuredOutputMechanism, type TStructuredOutputProvenance, type TStructuredOutputSchema, type TStructuredOutputValidation, type TSubprocessTraceClass, type TTextDeltaCallback, type TTimerId, type TToolArgs, type TToolChoice, type TToolExecutionFunction, type TToolExecutionParameters, type TToolExecutor, type TToolMetadata, TToolParameters, type TToolProgressCallback, type TToolResultAdmissionErrorCode, type TToolRiskClass, type TToolSchemaProjectionOutcome, type TToolSchemaProjectionProfileBase, type TToolSearchMode, type TToolSearchSetting, type TTrustLevel, type TUniversalArrayValue, type TUniversalMessage, type TUniversalMessageMetadata, type TUniversalMessagePart, type TUniversalMessageRole, type TUniversalValue, type TUserEvent, TUtilLogLevel, ToolExecutionError, ToolRegistry, ToolResultAdmissionError, TypeUtils, UNCLASSIFIED_TOOL_FALLBACK, USER_EVENTS, USER_EVENT_PREFIX, UnsupportedShellError, ValidationError, Validator, admitToolResult, allowRulesForAutoMode, applyPresetToolLists, assertProviderNativeWebToolsAvailable, assertResidentToolRemains, bindEventServiceOwner, bindWithOwnerPath, buildTraceparent, calculateModelCost, chatEntryToMessage, classifyProviderFailure, clearRegisteredToolProfiles, closeObjectSchemas, collectAssistantUsageMetadata, composeEventName, confirmAction, createAssistantMessage, createBoundedOutput, createDefaultProviderCapabilities, createExecutionProxy, createImageProviderFromDefinition, createLogger, createModelEffortOutcome, createProviderFromConfig, createRecordEnvResolver, createSystemMessage, createToolMessage, createUserMessage, createVideoProviderFromDefinition, decodeHookVerdict, estimateBlendedCostPer1000, estimateContextTokensFromMessages, estimateSerializedContextTokens, estimateToolSchemaTokens, evaluatePermission, extractEnumValues, findInvalidPermissionPatterns, findMediaProviderDefinition, findModelDefinition, findPermissionPatternWarnings, findProviderDefinition, formatEnvReference, formatSupportedProviderTypes, formatTokenCount, generateSpanId, getGlobalLogLevel, getGlobalLoggerSink, getMessagesForAPI, getModelContextWindow, getModelMaxOutput, getModelName, getProviderCapabilities, getProviderCredentialRequirement, getSchemaTypeName, getToolEstimatedDuration, getToolExecutionSteps, getToolPermissionProfile, hasUsableSecretReference, hasValidationConstraints, hashToolSchema, isAbortFailure, isAssistantMessage, isBroadExecutionAllowRule, isChatEntry, isConfirmed, isDefaultEventService, isEnforcing, isEnvReference, isImageGenerationProvider, isMediaProviderDefinition, isMintedSpanId, isModelEffort, isProgressReportingTool, isProtectedPath, isReadOnlyCommandLine, isRegistryTransactionError, isSystemMessage, isToolDeniedOutright, isToolMessage, isUserMessage, isVideoGenerationProvider, lifecycleOf, logger, lookupModelPrice, matchesAnyPattern, messageToHistoryEntry, modelDeclaresCapability, multiSelectAction, normalizeProviderConfig, normalizeStructuredOutput, outboundTraceContextFor, parseParameterRule, parseStructuredResponseText, peerDriverOf, printablePeerDriver, processEnvResolver, projectPermissionPolicy, projectToolSchema, providerCallSpanId, readModelFallbackNotice, readProviderFailureDetails, readTokenUsageFromMessage, readTokenUsageFromMetadata, registerModelMetadata, registerToolPermissionProfile, removesCriticalPath, requiresFreshApproval, resolveEnvReference, resolveMediaProviderConfig, resolveModelCapabilities, resolveModelCapability, resolveModelEffort, resolvePlatformShell, resolveStructuredOutputCapability, runHooks, runRegistryTransaction, selectAction, setGlobalLogLevel, setGlobalLoggerSink, setToolProgressCallback, shellArgumentForDisplay, spanIdFromMintedId, splitCommandSegments, startPeriodicTask, stopPeriodicTask, subprocessTraceEnvironment, sumHistoryUsage, textAction, toProviderError, toolNameMatches, toolNamesToPatterns, toolTraceContextFor, traceEnvFor, traceHeadersFor, validateAgainstJsonSchema, validateAgentConfig, validateApiKey, validateModelName, validatePermissionPattern, validateProviderName, validateUserInput, wasToolResultAdmitted, withEventEmission, zodToJsonSchema };