@@ -27,7 +27,7 @@ import { ORCHESTRATOR_TOOLS, READ_TOOLS } from "./directors/tool-sets.js";
2727// so tool_search finds it on demand. Write/edit/delete stay in CORE so the
2828// primary dispatch can do tiny/bounded edits without a search round-trip;
2929// substantial work spawns build / docs directors. Codex natives
30- // (apply_patch / shell / update_plan) are not advertised .
30+ // (apply_patch / shell / update_plan) stay off .
3131export const CORE_TOOL_NAMES : readonly string [ ] = [
3232 "read" ,
3333 "write" ,
@@ -63,8 +63,8 @@ const ORCHESTRATOR_ONLY_TOOL_NAMES: readonly string[] = [
6363] ;
6464
6565// Session-start facts gating a core tool's advertisement, fixed for the
66- // session: the tools array is a provider cache prefix, so a value that
67- // could flip mid-session forces a re-prefill worse than the bytes it saves.
66+ // session: the tools array is a provider cache prefix, so a value that flips
67+ // mid-session forces a re-prefill worse than the bytes it saves.
6868export interface ToolAvailability {
6969 // Whether a language server was resolvable for this project at startup.
7070 languageServerAvailable : boolean ;
@@ -74,7 +74,7 @@ export interface ToolAvailability {
7474 operatorAvailable ?: boolean ;
7575 // Whether createAgentToolset mounted wait_agents: true only on exec
7676 // primary; TUI primary and nested orchestrators collect via mailbox mail.
77- // False/omitted filters it out of the core and advertised name sets.
77+ // False/omitted filters it out of the core and advertised sets.
7878 waitAgentsMounted ?: boolean ;
7979}
8080
@@ -110,11 +110,9 @@ const WORKER_WIRE_ALWAYS: readonly string[] = [
110110 "submit_result" ,
111111] ;
112112
113- /**
114- * Advertised wire prefix for a spawned worker: the director's tool allowlist
115- * plus `tool_search` and the leaf reporting channel. No shared preset across
116- * roles; MCP stays off until tool_search / promote-on-execute.
117- */
113+ /** Advertised wire prefix for a spawned worker: the director's tool
114+ * allowlist plus `tool_search` and the leaf reporting channel. No shared
115+ * preset across roles; MCP stays off until tool_search / promote-on-execute. */
118116export function advertisedToolNamesForWorker ( opts : {
119117 allow ?: readonly string [ ] ;
120118 orchestrator ?: boolean ;
@@ -141,7 +139,7 @@ export function advertisedToolNamesForWorker(opts: {
141139}
142140
143141// Built-in file/search/web tools advertised with full schema alongside the
144- // core set; MCP tools are absent — discovered blind via tool_search. list_dir
142+ // core set; MCP tools are absent — found blind via tool_search. list_dir
145143// stays mounted but unadvertised and excluded from tool_search (use glob).
146144// web_fetch/web_search are catalog, not deferred: URL reads and search are
147145// first-class primary work; gating them behind tool_search thrashed on
@@ -192,8 +190,8 @@ export const UNADVERTISED_MOUNTED_BUILTINS = new Set([
192190// followed by wire-committed tools in first-commit order. Callers pass names
193191// committed via flushPromotions (on promote and at cache-safe boundaries),
194192// never the live activation list, so a mid-handler discovery cannot append
195- // until the promoter commits it. Names are deduped so raw matches cannot
196- // reorder or duplicate an entry.
193+ // until the promoter commits it. Deduped so raw matches cannot reorder or
194+ // duplicate an entry.
197195export function advertisedTools (
198196 all : readonly ToolDefinition [ ] ,
199197 activated : readonly string [ ] = [ ] ,
@@ -225,15 +223,15 @@ export function advertisedTools(
225223
226224// Non-built-in tool names the session has activated (promote-on-execute of a
227225// called name, or a director-side trigger like the lsp hint), in
228- // first-activation order. Backed by a Set: re-activating a known name is a
229- // no-op.
226+ // first-activation order. Backed by a Set, so re-activating a known name is
227+ // a no-op.
230228export interface ActivatedToolTracker {
231229 // Adds any new names; returns whether the set changed.
232230 activate ( names : readonly string [ ] ) : boolean ;
233231 has ( name : string ) : boolean ;
234232 list ( ) : string [ ] ;
235233 // Session rotation (/clear, /new) mints a fresh transcript whose model
236- // never saw the activations — the advertised set starts clean with it .
234+ // never saw the activations — the advertised set starts clean.
237235 clear ( ) : void ;
238236}
239237
@@ -352,7 +350,7 @@ export interface ToolSearchDeps {
352350 promote ?: ( names : string [ ] ) => void ;
353351 // Remaining in-flight MCP handshake count after a bounded wait. The
354352 // handler re-races this so a stuck dependency (hung OAuth) cannot hang the
355- // call. Omitted callers have no pending handshakes .
353+ // call. Omitted callers have none .
356354 awaitPendingConnections ?: ( timeoutMs ?: number ) => Promise < number > ;
357355 // True when a reconnecting MCP server holds tools that could match
358356 // `query`, justifying one short extra wait for the redial to remount them.
0 commit comments