cwtools-shared 0.2.9 → 0.4.0

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.
Files changed (65) hide show
  1. package/dist/debug/zz.d.ts +1 -0
  2. package/dist/debug/zz.js +12 -0
  3. package/dist/generated/mcpTools.d.ts +49 -4
  4. package/dist/generated/mcpTools.js +94 -49
  5. package/dist/generated/workshopDetection.d.ts +22 -0
  6. package/dist/generated/workshopDetection.js +50 -0
  7. package/dist/generated/workspaceDetectionProfiles.d.ts +2 -0
  8. package/dist/generated/workspaceDetectionProfiles.js +84 -0
  9. package/dist/generated/workspaceGameDetection.d.ts +39 -0
  10. package/dist/generated/workspaceGameDetection.js +424 -0
  11. package/dist/host/capabilities.d.ts +39 -0
  12. package/dist/host/capabilities.js +128 -0
  13. package/dist/host/diagnostics.d.ts +8 -1
  14. package/dist/host/filesystem.d.ts +2 -0
  15. package/dist/host/hostServices.d.ts +47 -0
  16. package/dist/host/indexing.d.ts +3 -0
  17. package/dist/host/lsp.d.ts +9 -0
  18. package/dist/host/lsp.js +27 -0
  19. package/dist/host/readiness.js +10 -0
  20. package/dist/host/vanillaCache.js +1 -1
  21. package/dist/index.d.ts +16 -1
  22. package/dist/index.js +22 -1
  23. package/dist/knowledge/interfaceKnowledge.d.ts +8 -0
  24. package/dist/knowledge/interfaceKnowledge.js +222 -0
  25. package/dist/project/descriptor.d.ts +12 -0
  26. package/dist/project/descriptor.js +69 -0
  27. package/dist/project/init.d.ts +11 -0
  28. package/dist/project/init.js +356 -0
  29. package/dist/project/knowledge.d.ts +6 -0
  30. package/dist/project/knowledge.js +20 -8
  31. package/dist/project/profile.d.ts +62 -7
  32. package/dist/project/profile.js +4 -3
  33. package/dist/project/profileBuilder.d.ts +31 -0
  34. package/dist/project/profileBuilder.js +989 -0
  35. package/dist/tools/archetypeArtifacts.d.ts +29 -0
  36. package/dist/tools/archetypeArtifacts.js +136 -0
  37. package/dist/tools/archetypeSlots.d.ts +32 -0
  38. package/dist/tools/archetypeSlots.js +257 -0
  39. package/dist/tools/archetypeTools.d.ts +4 -0
  40. package/dist/tools/archetypeTools.js +118 -0
  41. package/dist/tools/callHandler.d.ts +10 -0
  42. package/dist/tools/callHandler.js +76 -0
  43. package/dist/tools/catalog.d.ts +4094 -0
  44. package/dist/tools/catalog.js +5031 -0
  45. package/dist/tools/domainTools.d.ts +8 -0
  46. package/dist/tools/domainTools.js +222 -0
  47. package/dist/tools/mcpSchema.d.ts +20 -3
  48. package/dist/tools/mcpSchema.js +55 -7
  49. package/dist/tools/mediaWrites.d.ts +52 -0
  50. package/dist/tools/mediaWrites.js +322 -0
  51. package/dist/tools/names.d.ts +4 -4
  52. package/dist/tools/names.js +14 -1
  53. package/dist/tools/pdxWriteCore.d.ts +51 -0
  54. package/dist/tools/pdxWriteCore.js +628 -0
  55. package/dist/tools/pdxWrites.d.ts +88 -0
  56. package/dist/tools/pdxWrites.js +629 -0
  57. package/dist/tools/registry.d.ts +1 -0
  58. package/dist/tools/scopeBridge.d.ts +36 -0
  59. package/dist/tools/scopeBridge.js +173 -0
  60. package/dist/tools/symbols.js +22 -2
  61. package/dist/tools/targetingWeights.d.ts +206 -0
  62. package/dist/tools/targetingWeights.js +350 -0
  63. package/dist/tools/toolHandlers.d.ts +5 -1
  64. package/dist/tools/toolHandlers.js +146 -33
  65. package/package.json +1 -1
@@ -0,0 +1,350 @@
1
+ "use strict";
2
+ /**
3
+ * Stellaris 4.5.2 战斗索敌权重计算(纯计算,无副作用)。
4
+ *
5
+ * 实现 docs/stellaris-targeting-weight-4.5.2.md §2(舰船层乘法链 W1..W6 与整目标否决)
6
+ * 与 §3(武器层 p / ΣD 三层分摊 / S0..S + wk 加法项)的**归一化形式**:把引擎内部的
7
+ * 定点数 F = 100000 当作实数 1.0,除法按 C 风格向零截断的误差忽略不计。
8
+ *
9
+ * 两层互不相乘,各自 argmax(CShipTargeting::CalcBestTarget 与
10
+ * CWeaponComponentTargeting::CalcBestTarget);武器模板写 use_ship_main_target = yes 时
11
+ * 武器直接沿用舰船主目标,武器层分数不参与(误区 8)。
12
+ *
13
+ * 本模块刻意不 import vscode / fs / path,供后续 webview 面板(P3-1)直接复用。
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.VANILLA_TARGETING_DEFINES = void 0;
17
+ exports.computeTargetingChain = computeTargetingChain;
18
+ exports.executeTargetingWeightQuery = executeTargetingWeightQuery;
19
+ exports.parseTargetingChainInput = parseTargetingChainInput;
20
+ /** vanilla 取值(Stellaris 4.5.2 common/defines/00_defines.txt, NCombat / NShip)。 */
21
+ exports.VANILLA_TARGETING_DEFINES = {
22
+ sizeSlope: 0.03,
23
+ sizeMax: 10,
24
+ trackingMult: 2.0,
25
+ evasionWeight: 2.0,
26
+ lowHealthThreshold: 0.5,
27
+ lowHealthWeight: 1.5,
28
+ distanceWeight: 0.002,
29
+ distanceWeightMin: 0.10,
30
+ unarmedWeight: 0.005,
31
+ starbaseWeight: 0.75,
32
+ avoidMinShipSize: 8,
33
+ avoidThreshold: 0.7,
34
+ randomWeight: 3.0,
35
+ currentTargetMultiplier: 1.1,
36
+ recentTargetPenalizer: 0.3,
37
+ };
38
+ /** NShip 块常量:尺寸放大上限 MAX_DAMAGE_SCALING。 */
39
+ const MAX_DAMAGE_SCALING = 100;
40
+ function clamp(value, min, max) {
41
+ return value < min ? min : value > max ? max : value;
42
+ }
43
+ function resolveDefines(partial) {
44
+ const merged = { ...exports.VANILLA_TARGETING_DEFINES };
45
+ if (!partial) {
46
+ return merged;
47
+ }
48
+ for (const key of Object.keys(exports.VANILLA_TARGETING_DEFINES)) {
49
+ const value = partial[key];
50
+ if (typeof value === 'number' && Number.isFinite(value)) {
51
+ merged[key] = value;
52
+ }
53
+ }
54
+ return merged;
55
+ }
56
+ /**
57
+ * 计算单个候选目标的完整索敌权重链。纯函数:不读文件、不依赖 vscode。
58
+ */
59
+ function computeTargetingChain(input) {
60
+ const defs = resolveDefines(input.defines);
61
+ const attacker = input.attacker;
62
+ const weapon = input.weapon;
63
+ const target = input.target;
64
+ // ---- 舰船层(§2) ----------------------------------------------------
65
+ const sizeCapped = Math.min(target.sizeMultiplier, defs.sizeMax);
66
+ const W1 = 1 / (1 + sizeCapped * defs.sizeSlope);
67
+ const shipTracking = attacker.tracking * defs.trackingMult;
68
+ const evasionDelta = target.evasion - shipTracking;
69
+ const vetoCheck = {
70
+ evasionDeltaPositive: evasionDelta > 0,
71
+ attackerSizeLargeEnough: attacker.sizeMultiplier >= defs.avoidMinShipSize,
72
+ deltaAboveThreshold: evasionDelta >= defs.avoidThreshold,
73
+ fleetHasHittable: input.fleetHasHittable === true,
74
+ };
75
+ const veto = vetoCheck.evasionDeltaPositive
76
+ && vetoCheck.attackerSizeLargeEnough
77
+ && vetoCheck.deltaAboveThreshold
78
+ && vetoCheck.fleetHasHittable;
79
+ const evasionFactor = evasionDelta > 0 ? 1 / (1 + evasionDelta * defs.evasionWeight) : 1;
80
+ const distanceFactor = Math.max(1 - target.distance * defs.distanceWeight, defs.distanceWeightMin);
81
+ const targetWeight = 1 + (input.rho ?? 0) + (input.targetWeightMultModifier ?? 0);
82
+ const maxHull = target.maxHull;
83
+ const hasHealthRatio = typeof maxHull === 'number' && Number.isFinite(maxHull) && maxHull > 0;
84
+ const healthRatio = hasHealthRatio ? clamp(target.hull / maxHull, 0, 1) : null;
85
+ const lowHealthFactor = healthRatio !== null && healthRatio < defs.lowHealthThreshold ? defs.lowHealthWeight : 1;
86
+ const unarmedFactor = target.armed ? 1 : defs.unarmedWeight;
87
+ const starbaseFactor = target.isStarbase === true && target.isCurrentMainTarget !== true
88
+ ? defs.starbaseWeight
89
+ : 1;
90
+ const randomRoll = clamp(input.randomRoll ?? 0, 0, 1);
91
+ const randomFactor = input.useRandom === true ? 1 + randomRoll * defs.randomWeight : 1;
92
+ // 引擎在否决时直接 return 0,后续各项不再计算;这里保留因子供诊断,但把 W2..W6 归零。
93
+ const W2 = veto ? 0 : W1 * evasionFactor;
94
+ const W3 = veto ? 0 : W2 * distanceFactor;
95
+ const W4 = veto ? 0 : W3 * targetWeight;
96
+ const W5 = veto ? 0 : W4 * lowHealthFactor * unarmedFactor * starbaseFactor;
97
+ const W6 = veto ? 0 : W5 * randomFactor;
98
+ const shipChain = {
99
+ veto,
100
+ vetoCheck,
101
+ sizeCapped,
102
+ W1,
103
+ shipTracking,
104
+ evasionDelta,
105
+ evasionFactor,
106
+ W2,
107
+ distanceFactor,
108
+ W3,
109
+ targetWeight,
110
+ W4,
111
+ lowHealthFactor,
112
+ unarmedFactor,
113
+ starbaseFactor,
114
+ W5,
115
+ randomFactor,
116
+ W6,
117
+ weight: W6,
118
+ };
119
+ // ---- 武器层(§3) ----------------------------------------------------
120
+ const baseDamage = (weapon.minDamage + weapon.maxDamage) / 2;
121
+ const sizeFactor = weapon.sizeDamageFactor ?? 0;
122
+ const scaledDamage = sizeFactor > 0
123
+ ? baseDamage * (1 + clamp(target.sizeMultiplier, 1, MAX_DAMAGE_SCALING) * sizeFactor)
124
+ : baseDamage;
125
+ // D 在每一层都被 min(·) 扣减,层分量本身不被该层存量夹住——这就是"盾甲吸引仇恨"的根因。
126
+ let remaining = scaledDamage;
127
+ let Ds = 0;
128
+ let Da = 0;
129
+ if (target.shield > 0) {
130
+ const s = clamp((weapon.shieldPenetration ?? 0) - (target.shieldHardening ?? 0), 0, 1);
131
+ const Cs = (1 - s) * remaining;
132
+ remaining -= Math.min(Cs, target.shield);
133
+ Ds = weapon.shieldDamage * Cs;
134
+ }
135
+ if (target.armor > 0) {
136
+ const a = clamp((weapon.armorPenetration ?? 0) - (target.armorHardening ?? 0), 0, 1);
137
+ const Ca = (1 - a) * remaining;
138
+ remaining -= Math.min(Ca, target.armor);
139
+ Da = weapon.armorDamage * Ca;
140
+ }
141
+ const Dh = weapon.hullDamage * remaining;
142
+ const p = clamp(weapon.accuracy - clamp(target.evasion - weapon.tracking, 0, 1), 0, 1);
143
+ const sumD = Ds + Da + Dh;
144
+ const S0 = sumD * p * targetWeight;
145
+ const killBonus = Dh >= target.hull ? 1.5 : 1;
146
+ const S1 = S0 * killBonus;
147
+ const unarmedPenalty = target.armed ? 1 : defs.unarmedWeight;
148
+ const S2 = S1 * unarmedPenalty;
149
+ const wk = target.shipSizeId !== undefined ? weapon.targetWeights?.[target.shipSizeId] ?? 0 : 0;
150
+ const score = S2 + wk;
151
+ const currentTargetMultiplier = target.isCurrentMainTarget === true && input.targetFocus !== true
152
+ ? defs.currentTargetMultiplier
153
+ : 1;
154
+ const recentTargetPenalizer = target.isRecentNonLatest === true ? defs.recentTargetPenalizer : 1;
155
+ const weaponLayer = {
156
+ p,
157
+ baseDamage,
158
+ damageSplit: { Ds, Da, Dh },
159
+ sumD,
160
+ S0,
161
+ killBonus,
162
+ S1,
163
+ unarmedPenalty,
164
+ S2,
165
+ wk,
166
+ score,
167
+ currentTargetMultiplier,
168
+ recentTargetPenalizer,
169
+ final: score * currentTargetMultiplier * recentTargetPenalizer,
170
+ };
171
+ const notes = buildNotes(input, defs, shipChain, weaponLayer, healthRatio !== null);
172
+ return { veto, shipChain, weapon: weaponLayer, defines: defs, notes };
173
+ }
174
+ function buildNotes(input, defs, shipChain, weaponLayer, hasHealthRatio) {
175
+ const notes = [];
176
+ notes.push('两层互不相乘:舰船层与武器层各自 argmax;武器模板写 use_ship_main_target = yes 时武器直接沿用舰船主目标,武器层分数不参与(误区 8)。');
177
+ notes.push('索敌不是每 tick 重算:已有有效主目标时只在 (TotalTicks + shipID) mod fp == 0 的 tick 重算,fp = 50(targetFocus = 1)或 10。');
178
+ if (shipChain.veto) {
179
+ notes.push('触发整目标否决:直接 return 0,该候选从候选集中剔除,不参与 argmax(误区 6)。判据为 Δ>0 且 σatt ≥ σavoidmin 且 Δ ≥ Tavoid 且目标舰队存在可命中目标。');
180
+ }
181
+ if (shipChain.evasionDelta <= 0) {
182
+ notes.push('Δ ≤ 0(追踪盖过闪避),舰船层不施加闪避惩罚。');
183
+ }
184
+ if (shipChain.distanceFactor === defs.distanceWeightMin) {
185
+ notes.push(`距离因子已触下限 ${defs.distanceWeightMin}(d ≥ ${(1 - defs.distanceWeightMin) / defs.distanceWeight}),更远不再衰减。`);
186
+ }
187
+ if (input.randomRoll === undefined && input.useRandom !== true) {
188
+ notes.push(`本次未启用随机扰动(useRandom 默认 false)。引擎默认开启,末项乘数 ∈ [1, 1+κr) = [1, ${1 + defs.randomWeight}),是索敌不稳定的主因之一(误区 10)。`);
189
+ }
190
+ if (!hasHealthRatio) {
191
+ notes.push('未提供 target.maxHull,舰船层不做残血判定(h < θh 收人头加成未生效)。');
192
+ }
193
+ if (weaponLayer.damageSplit.Ds > 0 || weaponLayer.damageSplit.Da > 0) {
194
+ notes.push('目标带盾/甲:层分量不被该层存量夹住,只有从剩余伤害里扣减的量才被 min 夹住,所以 ΣD 反而更大。有效反制只有高闪避(压低 p)(误区 1)。');
195
+ }
196
+ if (weaponLayer.killBonus > 1) {
197
+ notes.push('斩杀加成触发:判据是船体分量 Dh ≥ 目标当前船体,不是总伤(误区 7)。');
198
+ }
199
+ if (weaponLayer.wk > 0) {
200
+ notes.push('命中 weapon.target_weights:wk 是**加法项**而非倍率,可以盖过整条乘法链,用法与直觉相反(误区 4)。');
201
+ }
202
+ if (input.rho !== undefined && input.rho > 0) {
203
+ notes.push('ρ 是开战瞬间每艘船各掷一次、整场不变的随机量,所以两条设计完全相同的船每场战斗的 ŵtgt 也不同(误区 5)。');
204
+ }
205
+ notes.push('ai_weight 是 AI 建造/决策权重,与战斗索敌无关(误区 2)。');
206
+ return notes;
207
+ }
208
+ /** 工具调用入口:校验并收窄不可信的工具参数,失败时返回结构化错误而不是抛出。 */
209
+ function executeTargetingWeightQuery(args) {
210
+ let input;
211
+ try {
212
+ input = parseTargetingChainInput(args);
213
+ }
214
+ catch (error) {
215
+ return {
216
+ error: `query_targeting_weight: ${error instanceof Error ? error.message : String(error)}`,
217
+ hint: 'Pass numeric attacker/weapon/target fields; every field must be a finite number.',
218
+ };
219
+ }
220
+ return computeTargetingChain(input);
221
+ }
222
+ function isRecord(value) {
223
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
224
+ }
225
+ function requireNumber(source, key, path) {
226
+ const value = source[key];
227
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
228
+ throw new Error(`${path}.${key} must be a finite number.`);
229
+ }
230
+ return value;
231
+ }
232
+ function optionalNumber(source, key, path) {
233
+ const value = source[key];
234
+ if (value === undefined || value === null) {
235
+ return undefined;
236
+ }
237
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
238
+ throw new Error(`${path}.${key} must be a finite number when provided.`);
239
+ }
240
+ return value;
241
+ }
242
+ function requireBoolean(source, key, path) {
243
+ const value = source[key];
244
+ if (typeof value !== 'boolean') {
245
+ throw new Error(`${path}.${key} must be a boolean.`);
246
+ }
247
+ return value;
248
+ }
249
+ function optionalBoolean(source, key, path) {
250
+ const value = source[key];
251
+ if (value === undefined || value === null) {
252
+ return undefined;
253
+ }
254
+ if (typeof value !== 'boolean') {
255
+ throw new Error(`${path}.${key} must be a boolean when provided.`);
256
+ }
257
+ return value;
258
+ }
259
+ function optionalNumberRecord(source, key, path) {
260
+ const value = source[key];
261
+ if (value === undefined || value === null) {
262
+ return undefined;
263
+ }
264
+ if (!isRecord(value)) {
265
+ throw new Error(`${path}.${key} must be an object mapping ship_size id to number.`);
266
+ }
267
+ const out = {};
268
+ for (const [entryKey, entryValue] of Object.entries(value)) {
269
+ if (typeof entryValue !== 'number' || !Number.isFinite(entryValue)) {
270
+ throw new Error(`${path}.${key}.${entryKey} must be a finite number.`);
271
+ }
272
+ out[entryKey] = entryValue;
273
+ }
274
+ return out;
275
+ }
276
+ /**
277
+ * 把工具参数(不可信输入)收窄为 TargetingChainInput。
278
+ * 未知字段一律忽略并按缺省处理;类型错误立即抛出带字段路径的消息。
279
+ */
280
+ function parseTargetingChainInput(args) {
281
+ if (!isRecord(args)) {
282
+ throw new Error('arguments must be an object.');
283
+ }
284
+ const attackerRaw = args.attacker;
285
+ const weaponRaw = args.weapon;
286
+ const targetRaw = args.target;
287
+ if (!isRecord(attackerRaw) || !isRecord(weaponRaw) || !isRecord(targetRaw)) {
288
+ throw new Error('attacker, weapon and target must all be objects.');
289
+ }
290
+ const definesRaw = args.defines;
291
+ let defines;
292
+ if (definesRaw !== undefined && definesRaw !== null) {
293
+ if (!isRecord(definesRaw)) {
294
+ throw new Error('defines must be an object when provided.');
295
+ }
296
+ defines = {};
297
+ for (const key of Object.keys(exports.VANILLA_TARGETING_DEFINES)) {
298
+ const value = optionalNumber(definesRaw, key, 'defines');
299
+ if (value !== undefined) {
300
+ defines[key] = value;
301
+ }
302
+ }
303
+ }
304
+ const shipSizeIdRaw = targetRaw.shipSizeId;
305
+ if (shipSizeIdRaw !== undefined && shipSizeIdRaw !== null && typeof shipSizeIdRaw !== 'string') {
306
+ throw new Error('target.shipSizeId must be a string when provided.');
307
+ }
308
+ return {
309
+ attacker: {
310
+ tracking: requireNumber(attackerRaw, 'tracking', 'attacker'),
311
+ sizeMultiplier: requireNumber(attackerRaw, 'sizeMultiplier', 'attacker'),
312
+ },
313
+ weapon: {
314
+ minDamage: requireNumber(weaponRaw, 'minDamage', 'weapon'),
315
+ maxDamage: requireNumber(weaponRaw, 'maxDamage', 'weapon'),
316
+ accuracy: requireNumber(weaponRaw, 'accuracy', 'weapon'),
317
+ tracking: requireNumber(weaponRaw, 'tracking', 'weapon'),
318
+ shieldDamage: requireNumber(weaponRaw, 'shieldDamage', 'weapon'),
319
+ armorDamage: requireNumber(weaponRaw, 'armorDamage', 'weapon'),
320
+ hullDamage: requireNumber(weaponRaw, 'hullDamage', 'weapon'),
321
+ shieldPenetration: optionalNumber(weaponRaw, 'shieldPenetration', 'weapon'),
322
+ armorPenetration: optionalNumber(weaponRaw, 'armorPenetration', 'weapon'),
323
+ sizeDamageFactor: optionalNumber(weaponRaw, 'sizeDamageFactor', 'weapon'),
324
+ targetWeights: optionalNumberRecord(weaponRaw, 'targetWeights', 'weapon'),
325
+ },
326
+ target: {
327
+ shipSizeId: shipSizeIdRaw === null ? undefined : shipSizeIdRaw,
328
+ sizeMultiplier: requireNumber(targetRaw, 'sizeMultiplier', 'target'),
329
+ evasion: requireNumber(targetRaw, 'evasion', 'target'),
330
+ distance: requireNumber(targetRaw, 'distance', 'target'),
331
+ hull: requireNumber(targetRaw, 'hull', 'target'),
332
+ maxHull: optionalNumber(targetRaw, 'maxHull', 'target'),
333
+ shield: requireNumber(targetRaw, 'shield', 'target'),
334
+ armor: requireNumber(targetRaw, 'armor', 'target'),
335
+ shieldHardening: optionalNumber(targetRaw, 'shieldHardening', 'target'),
336
+ armorHardening: optionalNumber(targetRaw, 'armorHardening', 'target'),
337
+ armed: requireBoolean(targetRaw, 'armed', 'target'),
338
+ isStarbase: optionalBoolean(targetRaw, 'isStarbase', 'target'),
339
+ isCurrentMainTarget: optionalBoolean(targetRaw, 'isCurrentMainTarget', 'target'),
340
+ isRecentNonLatest: optionalBoolean(targetRaw, 'isRecentNonLatest', 'target'),
341
+ },
342
+ defines,
343
+ rho: optionalNumber(args, 'rho', 'root'),
344
+ targetWeightMultModifier: optionalNumber(args, 'targetWeightMultModifier', 'root'),
345
+ randomRoll: optionalNumber(args, 'randomRoll', 'root'),
346
+ useRandom: optionalBoolean(args, 'useRandom', 'root'),
347
+ fleetHasHittable: optionalBoolean(args, 'fleetHasHittable', 'root'),
348
+ targetFocus: optionalBoolean(args, 'targetFocus', 'root'),
349
+ };
350
+ }
@@ -1,4 +1,8 @@
1
1
  import type { HostServices } from '../host/hostServices';
2
2
  import { type SharedToolResult } from './schema';
3
- export type SharedToolDispatcher = (host: HostServices, name: string, args: Record<string, unknown>) => Promise<SharedToolResult>;
3
+ /** Per-call context threaded from the transport (cancellation, and future knobs). */
4
+ export interface SharedToolContext {
5
+ signal?: AbortSignal;
6
+ }
7
+ export type SharedToolDispatcher = (host: HostServices, name: string, args: Record<string, unknown>, context?: SharedToolContext) => Promise<SharedToolResult>;
4
8
  export declare const defaultSharedToolDispatcher: SharedToolDispatcher;