-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNPCVoiceControl.csproj
More file actions
1212 lines (1099 loc) · 83 KB
/
Copy pathNPCVoiceControl.csproj
File metadata and controls
1212 lines (1099 loc) · 83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Project Sdk="Microsoft.NET.Sdk">
<!-- Optional per-machine overrides, git-ignored. Never committed, never synced. -->
<Import Project="$(MSBuildProjectDirectory)\Local.props" Condition="Exists('$(MSBuildProjectDirectory)\Local.props')" />
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<AssemblyName>1-XNPCVoiceControl</AssemblyName>
<RootNamespace>XNPCVoiceControl</RootNamespace>
<LangVersion>9.0</LangVersion>
<Nullable>disable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<!-- Output directly to mod folder -->
<OutputPath>bin\$(Configuration)\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<!-- Suppress warnings about missing XML docs and Unsafe version conflict (game's MemoryPack.dll refs v6.0.0.0, NuGet ships v4.0.4.1) -->
<NoWarn>CS1591;CS0436;MSB3277</NoWarn>
<!-- Define UNITY_STANDALONE_WIN for Windows builds -->
<DefineConstants>$(DefineConstants);UNITY_STANDALONE_WIN</DefineConstants>
<BaseOutputPath>.\</BaseOutputPath>
</PropertyGroup>
<!--
Location of tools/*.ps1, resolved for BOTH repo layouts:
dev repo - csproj lives in NPCVoiceControlMod/NPCVoiceControl/, tools/ is its sibling -> ../tools
public repo - sync-to-public.bat copies the csproj to the repo ROOT, tools/ sits beside it -> ./tools
Hardcoding ../tools resolved OUTSIDE the public repo, so every public clone failed its build
on the unconditional ValidateModXml target (MSB3073, script not found). Probe for the script
itself rather than the directory, so a partial sync is treated as missing rather than silently
passing an empty path to powershell.
-->
<PropertyGroup>
<ToolsDir Condition="Exists('$(MSBuildProjectDirectory)/../tools/Validate-ModXml.ps1')">$(MSBuildProjectDirectory)/../tools</ToolsDir>
<ToolsDir Condition="'$(ToolsDir)' == '' AND Exists('$(MSBuildProjectDirectory)/tools/Validate-ModXml.ps1')">$(MSBuildProjectDirectory)/tools</ToolsDir>
</PropertyGroup>
<!-- The sidecar sources exist only in the dev repo. A source-only clone (public
repo, release ZIP) has Scripts/ and the csproj but no sidecar projects, so
the publish/copy/dist targets below must not run there: they fail into
ContinueOnError warnings, and AssembleDist writes to ../dist which sits
OUTSIDE a source-only clone. Probe for a sidecar project, not a folder. -->
<PropertyGroup>
<!-- PROBE A SIDECAR THAT SURVIVES. Keyed off sherpa-server until 2026-08-26; when
Kokoro was removed that would have flipped FullPipeline FALSE and SILENTLY disabled
ELEVEN targets (Supertonic, Llama, Whisper, wake-word ONNX, the Resources and Config
copies, and AssembleDist ITSELF) while the build still reported success. -->
<FullPipeline Condition="Exists('$(MSBuildProjectDirectory)\..\supertonic-server\supertonic-server.csproj')">true</FullPipeline>
<FullPipeline Condition="'$(FullPipeline)' == ''">false</FullPipeline>
</PropertyGroup>
<!--
B35 (2026-08-31): the dedicated server build (DediBuild) and the lite client
build (LiteBuild) are the SAME profile now: the merged no-payload Core build.
The two old flags keep working as aliases for one or two releases so existing
commands do not silently stop building it; AssembleDistCore warns when an alias
triggered the build. -p:DeployToDedi=true is NOT an alias: it is the live
server's command and keeps its name, its Q:\ default path and its
-p:DediModsFolder override.
-->
<PropertyGroup>
<CoreBuild Condition="'$(CoreBuild)' == '' AND ('$(DediBuild)' == 'true' OR '$(LiteBuild)' == 'true')">true</CoreBuild>
</PropertyGroup>
<!--
B36 (2026-08-31): the LITE-VOICE profile was renamed VOICE: -p:VoiceBuild=true,
dist-voice/, archive -Voice.zip. -p:LiteVoiceBuild=true keeps working as a
deprecated alias for one or two releases (Dave's muscle memory), exactly as B35
did for DediBuild/LiteBuild -> CoreBuild; AssembleDistVoice warns when the
alias triggered the build. NOTE: the FULL build has NO flag - it is the default
assembly (dist/); "Complete" is an archive name and a doc convention, not a
profile. Do not invent a CompleteBuild flag.
-->
<PropertyGroup>
<VoiceBuild Condition="'$(VoiceBuild)' == '' AND '$(LiteVoiceBuild)' == 'true'">true</VoiceBuild>
</PropertyGroup>
<!--
p1 (2026-09-05): ONE deploy entry point that takes a PROFILE.
-p:DeployProfile=core|voice|complete (lowercase; see the DeployToProfile*
targets below). It implies the matching build (core -> CoreBuild, voice ->
VoiceBuild) and overlays the matching complete dist into -p:DeployModsFolder
(default: the SP/listen-host mod folder the game loads), then validates the
deploy against that dist - so any of the three profiles can be put into the
test install and the build PROVES it matches exactly.
This replaces the old workaround of "-p:DeployToDedi=true -p:DediModsFolder=<SP path>"
for putting Core into the SP folder. That workaround KEEPS WORKING (the
old targets are not removed); DeployProfile is the honest spelling of it.
-p:CleanDeploy=true (optional, any deploy target) deliberately deletes the
previous profile's leftover files before copying - NEVER the runtime
artifact ignore list (tools/Deploy-IgnoreList.psm1, shared with the
validator). Without it a profile switch leaves a mixed folder and the
post-deploy validation fails on purpose (EXTRA in deploy).
-->
<PropertyGroup>
<CoreBuild Condition="'$(CoreBuild)' == '' AND '$(DeployProfile)' == 'core'">true</CoreBuild>
<VoiceBuild Condition="'$(VoiceBuild)' == '' AND '$(DeployProfile)' == 'voice'">true</VoiceBuild>
<DeployProfileDistDir Condition="'$(DeployProfile)' == 'core'">$(MSBuildProjectDirectory)/../dist-core</DeployProfileDistDir>
<DeployProfileDistDir Condition="'$(DeployProfile)' == 'voice'">$(MSBuildProjectDirectory)/../dist-voice</DeployProfileDistDir>
<DeployProfileDistDir Condition="'$(DeployProfile)' == 'complete'">$(MSBuildProjectDirectory)/../dist</DeployProfileDistDir>
<!-- ProfileModsFolder is resolved INSIDE each DeployToProfile* target: GamePath
is defined later in this file, so a project-level $(GamePath) here would be
empty. A target-level PropertyGroup runs after full project evaluation. -->
</PropertyGroup>
<!-- Remove stale NPCLLMChat.dll artifacts from old builds -->
<Target Name="CleanStaleArtifacts" BeforeTargets="Build">
<ItemGroup>
<_StaleDll Include="$(OutputPath)NPCLLMChat.dll" />
<_StaleDll Include="$(OutputPath)NPCLLMChat.pdb" />
<_StaleDll Include="$(OutputPath)Whisper.net.dll" />
<_StaleDll Include="$(OutputPath)whisper.dll" />
</ItemGroup>
<Delete Files="@(_StaleDll)" ContinueOnError="true" />
</Target>
<!-- Validate shipped XML: no em-dash or en-dash in comments, no encoding UTF-8 declaration -->
<Target Name="ValidateModXml" BeforeTargets="AssembleDist;Build">
<Message Text="=== Validating Config XML ===" Importance="high" />
<!-- This target is unconditional, so a missing tools/ must WARN rather than fail the build —
otherwise a clone without tools/ cannot build at all. Warn, never silently skip. -->
<Warning Condition="'$(ToolsDir)' == ''" Text="tools/Validate-ModXml.ps1 not found - skipping Config XML validation. Bad XML (em-dash or -- in comments, encoding=UTF-8 in the declaration) will NOT be caught and crashes Unity Mono at runtime. Copy the tools/ folder next to the csproj to re-enable." />
<Exec Condition="'$(ToolsDir)' != ''" Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Validate-ModXml.ps1" -ConfigPath "$(MSBuildProjectDirectory)/Config"">
<Output TaskParameter="ExitCode" PropertyName="XmlValidationExitCode" />
</Exec>
<Error Condition="'$(XmlValidationExitCode)' != '0' AND '$(XmlValidationExitCode)' != ''" Text="Config XML validation failed! Check output above." />
</Target>
<!--
Platform-specific paths. Nothing here needs editing for a standard Steam install.
Override for a custom install, in order of precedence:
1. dotnet build -p:GamePath="E:\My Games\7 Days To Die"
2. set SDTD_GAMEPATH=E:\My Games\7 Days To Die
3. create Local.props next to this csproj (see Local.props.example)
Probes test for Assembly-CSharp.dll so an empty leftover folder cannot win.
-->
<!-- Windows paths -->
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<GamePath Condition="'$(GamePath)' == '' AND '$(SDTD_GAMEPATH)' != ''">$(SDTD_GAMEPATH)</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('C:\Program Files\Steam\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">C:\Program Files\Steam\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('C:\SteamLibrary\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">C:\SteamLibrary\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('D:\SteamLibrary\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">D:\SteamLibrary\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('D:\Steam\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">D:\Steam\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('E:\SteamLibrary\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">E:\SteamLibrary\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('E:\Steam\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">E:\Steam\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == '' AND Exists('F:\SteamLibrary\steamapps\common\7 Days To Die\7DaysToDie_Data\Managed\Assembly-CSharp.dll')">F:\SteamLibrary\steamapps\common\7 Days To Die</GamePath>
<GamePath Condition="'$(GamePath)' == ''">C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die</GamePath>
<ManagedPath>$(GamePath)\7DaysToDie_Data\Managed</ManagedPath>
<SCorePath>$(GamePath)\Mods\0-SCore</SCorePath>
<HarmonyPath>$(GamePath)\Mods\0_TFP_Harmony</HarmonyPath>
</PropertyGroup>
<!-- Linux paths (customize for your system) -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<GamePath>$(HOME)/.steam/steam/steamapps/common/7 Days To Die</GamePath>
<ManagedPath>$(GamePath)/7DaysToDie_Data/Managed</ManagedPath>
<SCorePath>$(GamePath)/Mods/0-SCore</SCorePath>
<HarmonyPath>$(GamePath)/Mods/0_TFP_Harmony</HarmonyPath>
</PropertyGroup>
<!-- A wrong GamePath otherwise produces hundreds of unrelated CS0246 errors and
the actual cause never appears. Fail once, before the compiler, saying what to do. -->
<Target Name="VerifyGamePath" BeforeTargets="CoreCompile">
<Error Condition="!Exists('$(ManagedPath)\Assembly-CSharp.dll')"
Text="7 Days To Die not found at: $(GamePath)%0A%0AExpected: $(ManagedPath)\Assembly-CSharp.dll%0A%0AFix by passing your install path:%0A dotnet build -p:GamePath="E:\Your\Path\7 Days To Die"%0Aor set the SDTD_GAMEPATH environment variable, or create Local.props (see Local.props.example)." />
<Error Condition="!Exists('$(SCorePath)\SCore.dll')"
Text="0-SCore not found at: $(SCorePath)%0ANPCVoiceControl requires SphereII's 0-SCore installed in the game's Mods folder. Install it, then rebuild." />
<Error Condition="!Exists('$(HarmonyPath)\0Harmony.dll')"
Text="0_TFP_Harmony not found at: $(HarmonyPath)%0AThis ships with the game. If it is missing, verify the game files in Steam." />
</Target>
<!-- Game Assembly References -->
<ItemGroup>
<!-- Core Unity -->
<Reference Include="UnityEngine">
<HintPath>$(ManagedPath)/UnityEngine.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>$(ManagedPath)/UnityEngine.CoreModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestModule">
<HintPath>$(ManagedPath)/UnityEngine.UnityWebRequestModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.JSONSerializeModule">
<HintPath>$(ManagedPath)/UnityEngine.JSONSerializeModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>$(ManagedPath)/UnityEngine.AnimationModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>$(ManagedPath)/UnityEngine.PhysicsModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>$(ManagedPath)/UnityEngine.IMGUIModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>$(ManagedPath)/UnityEngine.AudioModule.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>$(ManagedPath)/UnityEngine.InputLegacyModule.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- UnityWebRequestAudioModule for UnityWebRequestMultimedia.GetAudioClip -->
<Reference Include="UnityEngine.UnityWebRequestAudioModule">
<HintPath>$(ManagedPath)/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- NGUI (UILabel, UIWidget, UIPanel — needed for subtitle font assignment) -->
<Reference Include="NGUI">
<HintPath>$(ManagedPath)/NGUI.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- UnityEngine.TextRenderingModule (Font, Resources.Load<Font>) -->
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>$(ManagedPath)/UnityEngine.TextRenderingModule.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- 7DTD Game Assembly -->
<Reference Include="Assembly-CSharp">
<HintPath>$(ManagedPath)/Assembly-CSharp.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- Harmony (from TFP_Harmony) -->
<Reference Include="0Harmony">
<HintPath>$(HarmonyPath)/0Harmony.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- SCore mod (EntityUtilities, HarvestManager, EntitySyncUtils, IEntityAliveSDX) -->
<Reference Include="SCore">
<HintPath>$(SCorePath)/SCore.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- Newtonsoft.Json (from game's Managed folder) -->
<Reference Include="Newtonsoft.Json">
<HintPath>$(ManagedPath)/Newtonsoft.Json.dll</HintPath>
<Private>false</Private>
</Reference>
<!-- System libs -->
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<!-- TTS runs in an out-of-process HTTP sidecar (supertonic-server), never in-process -->
<!-- Whisper.net STT removed — STT now runs via whisper-server HTTP process -->
<!-- NanoWakeWord ONNX runtime -->
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.27.0" />
</ItemGroup>
<!-- Item groups for build/deploy targets -->
<ItemGroup>
<!-- Resources (models, voices, espeak data) -->
<ResourcesFiles Include="Resources\*" />
<ResourcesFiles Include="Resources\**\*" />
</ItemGroup>
<!-- Publish supertonic-server to bin/SupertonicServer/ -->
<Target Name="PublishSupertonicServer" AfterTargets="Build" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<PropertyGroup>
<SupertonicServerProject>$(MSBuildProjectDirectory)/../supertonic-server/supertonic-server.csproj</SupertonicServerProject>
<SupertonicServerOutput>$(MSBuildProjectDirectory)/$(OutputPath)bin/SupertonicServer</SupertonicServerOutput>
</PropertyGroup>
<Message Text="Publishing supertonic-server to $(SupertonicServerOutput)..." Importance="high" />
<!-- Wipe output first so removed source files don't ship forever -->
<RemoveDir Directories="$(SupertonicServerOutput)" ContinueOnError="true" />
<MakeDir Directories="$(SupertonicServerOutput)" />
<Exec Command="dotnet publish "$(SupertonicServerProject)" -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o "$(SupertonicServerOutput)"" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="SupertonicPublishExitCode" />
</Exec>
<Message Text="supertonic-server publish exit code: $(SupertonicPublishExitCode)" Importance="high" />
</Target>
<!-- Trim SupertonicServer: remove build artifacts from self-contained single-file publish -->
<Target Name="TrimSupertonicServer" AfterTargets="PublishSupertonicServer" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<Message Text="Trimming SupertonicServer bloat..." Importance="high" />
<!-- Remove non-Windows runtimes (we only need win-x64 for a self-contained win-x64 publish) -->
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/android" Condition="Exists('$(SupertonicServerOutput)/runtimes/android')" />
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/ios" Condition="Exists('$(SupertonicServerOutput)/runtimes/ios')" />
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/linux-arm64" Condition="Exists('$(SupertonicServerOutput)/runtimes/linux-arm64')" />
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/linux-x64" Condition="Exists('$(SupertonicServerOutput)/runtimes/linux-x64')" />
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/osx-arm64" Condition="Exists('$(SupertonicServerOutput)/runtimes/osx-arm64')" />
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/osx-x64" Condition="Exists('$(SupertonicServerOutput)/runtimes/osx-x64')" />
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/win-arm64" Condition="Exists('$(SupertonicServerOutput)/runtimes/win-arm64')" />
<RemoveDir Directories="$(SupertonicServerOutput)/runtimes/win-x86" Condition="Exists('$(SupertonicServerOutput)/runtimes/win-x86')" />
<!-- Remove build artifacts from self-contained single-file publish -->
<!-- aspnetcorev2_inprocess.dll is an IIS in-process module; these are Kestrel self-hosted -->
<ItemGroup>
<_SupertonicTrim Include="$(SupertonicServerOutput)/*.pdb" />
<_SupertonicTrim Include="$(SupertonicServerOutput)/*.deps.json" />
<_SupertonicTrim Include="$(SupertonicServerOutput)/*.runtimeconfig.json" />
<_SupertonicTrim Include="$(SupertonicServerOutput)/*.staticwebassets.endpoints.json" />
<_SupertonicTrim Include="$(SupertonicServerOutput)/*.lib" />
<_SupertonicTrim Include="$(SupertonicServerOutput)/aspnetcorev2_inprocess.dll" />
</ItemGroup>
<Delete Files="@(_SupertonicTrim)" ContinueOnError="true" />
</Target>
<!-- Ship MSVC runtime app-local next to supertonic-server.exe so ONNX doesn't grab a stale copy from System32 -->
<Target Name="ShipSupertonicVcRuntime" AfterTargets="TrimSupertonicServer" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<Message Text="Shipping MSVC runtime to SupertonicServer..." Importance="high" />
<ItemGroup>
<_VcDlls Include="$(SystemRoot)/System32/vcruntime140.dll;$(SystemRoot)/System32/vcruntime140_1.dll;$(SystemRoot)/System32/msvcp140.dll" />
</ItemGroup>
<Copy SourceFiles="@(_VcDlls)" DestinationFolder="$(SupertonicServerOutput)" SkipUnchangedFiles="true" ContinueOnError="true" />
</Target>
<!-- Copy llama-server to bin/LlamaServer/ -->
<Target Name="CopyLlamaServer" AfterTargets="Build" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<PropertyGroup>
<LlamaServerSource>$(MSBuildProjectDirectory)/LlamaServer</LlamaServerSource>
<LlamaServerOutput>$(MSBuildProjectDirectory)/$(OutputPath)bin/LlamaServer</LlamaServerOutput>
</PropertyGroup>
<Message Text="Copying llama-server to $(LlamaServerOutput)..." Importance="high" />
<!-- Wipe output first so removed source files don't ship forever -->
<RemoveDir Directories="$(LlamaServerOutput)" ContinueOnError="true" />
<MakeDir Directories="$(LlamaServerOutput)" />
<ItemGroup>
<LlamaServerFiles Include="$(LlamaServerSource)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(LlamaServerFiles)" DestinationFiles="@(LlamaServerFiles->'$(LlamaServerOutput)/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<!-- Trim LlamaServer: remove benchmark/utility DLLs not needed at runtime -->
<Target Name="TrimLlamaServer" AfterTargets="CopyLlamaServer" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<Message Text="Trimming LlamaServer bloat..." Importance="high" />
<ItemGroup>
<_LlamaTrim Include="$(LlamaServerOutput)/llama-batched-bench-impl.dll" />
<_LlamaTrim Include="$(LlamaServerOutput)/llama-bench-impl.dll" />
<_LlamaTrim Include="$(LlamaServerOutput)/llama-cli-impl.dll" />
<_LlamaTrim Include="$(LlamaServerOutput)/llama-completion-impl.dll" />
<_LlamaTrim Include="$(LlamaServerOutput)/llama-fit-params-impl.dll" />
<_LlamaTrim Include="$(LlamaServerOutput)/llama-perplexity-impl.dll" />
<_LlamaTrim Include="$(LlamaServerOutput)/llama-quantize-impl.dll" />
</ItemGroup>
<Delete Files="@(_LlamaTrim)" ContinueOnError="true" />
</Target>
<!-- Copy whisper-server to bin/WhisperServer/ -->
<Target Name="CopyWhisperServer" AfterTargets="Build" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<PropertyGroup>
<WhisperServerSource>$(MSBuildProjectDirectory)/WhisperServer</WhisperServerSource>
<WhisperServerOutput>$(MSBuildProjectDirectory)/$(OutputPath)bin/WhisperServer</WhisperServerOutput>
</PropertyGroup>
<Message Text="Copying whisper-server to $(WhisperServerOutput)..." Importance="high" />
<!-- Wipe output first so removed source files don't ship forever -->
<RemoveDir Directories="$(WhisperServerOutput)" ContinueOnError="true" />
<MakeDir Directories="$(WhisperServerOutput)" />
<ItemGroup>
<!-- ggml-base.en.bin (the retired "Fast" tier) never ships, even if a local copy
lingers in the build-input folder (that folder is gitignored, so this exclusion,
not the disk state, is the shipping decision). 2026-08-28: single model tier. -->
<WhisperServerFiles Include="$(WhisperServerSource)\**\*" Exclude="$(WhisperServerSource)\ggml-base.en.bin" />
</ItemGroup>
<Copy SourceFiles="@(WhisperServerFiles)" DestinationFiles="@(WhisperServerFiles->'$(WhisperServerOutput)/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<!-- Trim WhisperServer: remove .pdb and staticwebassets metadata -->
<!-- KEEP .deps.json and .runtimeconfig.json — whisper-server is framework-dependent and needs them to launch -->
<Target Name="TrimWhisperServer" AfterTargets="CopyWhisperServer" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<Message Text="Trimming WhisperServer bloat..." Importance="high" />
<ItemGroup>
<_WhisperTrim Include="$(WhisperServerOutput)/*.pdb" />
<_WhisperTrim Include="$(WhisperServerOutput)/*.staticwebassets.endpoints.json" />
</ItemGroup>
<Delete Files="@(_WhisperTrim)" ContinueOnError="true" />
</Target>
<!-- Copy the audio.cpp sidecar (TtsEngine=audiocpp) to bin/AudioCppServer/.
Source is the git-ignored build-input folder NPCVoiceControl/AudioCppServer/ (same
shape as WhisperServer/LlamaServer, see BINARIES.md): audiocpp_server.exe + the MSVC
runtime DLLs it needs + model_specs/ + the Supertonic GGUF. The Supertonic ONNX path
(bin/SupertonicServer + Resources/Supertonic) ships UNCHANGED alongside - this is an
additive A/B engine, not a replacement. -->
<Target Name="CopyAudioCppServer" AfterTargets="Build" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<PropertyGroup>
<AudioCppServerSource>$(MSBuildProjectDirectory)/AudioCppServer</AudioCppServerSource>
<AudioCppServerOutput>$(MSBuildProjectDirectory)/$(OutputPath)bin/AudioCppServer</AudioCppServerOutput>
</PropertyGroup>
<Message Text="Copying audiocpp_server to $(AudioCppServerOutput)..." Importance="high" />
<!-- Wipe output first so removed source files don't ship forever -->
<RemoveDir Directories="$(AudioCppServerOutput)" ContinueOnError="true" />
<MakeDir Directories="$(AudioCppServerOutput)" />
<ItemGroup>
<AudioCppServerFiles Include="$(AudioCppServerSource)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AudioCppServerFiles)" DestinationFiles="@(AudioCppServerFiles->'$(AudioCppServerOutput)/%(RecursiveDir)%(Filename)%(Extension)')" />
<!-- v2c: voice_styles (the 51 style JSONs: 10 built-ins + 40 VoiceLab pack + harley) come
from the MAINTAINED source NPCVoiceControl/Resources/Supertonic/voice_styles - the same
folder the Supertonic ONNX path uses - not from the hand-staged build-input folder above.
The runtime model spec override (ServerManager.WriteAudioCppModelSpec) and the client
voice allow-list (AudioCppVoices.Load) are both generated from THIS directory, so the
override, the allow-list and the files on disk cannot drift apart. ~15 MB; ships in
Voice + Complete only (dist-core has no bin/ at all). The two engine config files and
the spec template stay hand-staged in the source folder (they are GGUF sidecar content,
same treatment as the GGUF itself - see model_specs/supertonic-embedded.json). -->
<ItemGroup>
<AudioCppStyleFiles Include="$(MSBuildProjectDirectory)/Resources/Supertonic/voice_styles/*.json" />
</ItemGroup>
<MakeDir Directories="$(AudioCppServerOutput)/voice_styles" />
<Copy SourceFiles="@(AudioCppStyleFiles)" DestinationFiles="@(AudioCppStyleFiles->'$(AudioCppServerOutput)/voice_styles/%(Filename)%(Extension)')" />
</Target>
<!-- Ship wake-word ONNX + MSVC runtime into Plugins/OnnxRuntime/ so NativeLibrary.Load pins the correct DLL -->
<Target Name="ShipWakeWordOnnxRuntime" AfterTargets="TrimWhisperServer" Condition="'$(OS)' == 'Windows_NT' AND '$(FullPipeline)' == 'true'">
<PropertyGroup>
<WakeWordOnnxOutput>$(MSBuildProjectDirectory)/$(OutputPath)Plugins/OnnxRuntime</WakeWordOnnxOutput>
</PropertyGroup>
<Message Text="Shipping wake-word ONNX runtime to Plugins/OnnxRuntime..." Importance="high" />
<MakeDir Directories="$(WakeWordOnnxOutput)" />
<!-- Copy ONNX native DLLs from Plugins/ root -->
<ItemGroup>
<_OnnxDlls Include="$(MSBuildProjectDirectory)/Plugins/onnxruntime.dll;$(MSBuildProjectDirectory)/Plugins/onnxruntime_providers_shared.dll" />
</ItemGroup>
<Copy SourceFiles="@(_OnnxDlls)" DestinationFolder="$(WakeWordOnnxOutput)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- Copy MSVC runtime app-local so ONNX doesn't grab a stale copy from System32 -->
<ItemGroup>
<_VcDlls Include="$(SystemRoot)/System32/vcruntime140.dll;$(SystemRoot)/System32/vcruntime140_1.dll;$(SystemRoot)/System32/msvcp140.dll" />
</ItemGroup>
<Copy SourceFiles="@(_VcDlls)" DestinationFolder="$(WakeWordOnnxOutput)" SkipUnchangedFiles="true" ContinueOnError="true" />
</Target>
<!-- Copy DLL to mod folder after build -->
<Target Name="CopyToModFolder" AfterTargets="Build">
<Message Text="Build complete! DLL at: $(OutputPath)$(AssemblyName).dll" Importance="high" />
<Message Text="Copy to your 7DTD Mods folder to install." Importance="high" />
<!-- Copy Resources to output directory (recursive) -->
<ItemGroup>
<_AllResourceFiles Include="$(MSBuildProjectDirectory)/Resources/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_AllResourceFiles->'%(FullPath)')" DestinationFiles="@(_AllResourceFiles->'$(OutputPath)Resources/%(RecursiveDir)%(Filename)%(Extension)')" Condition="'$(FullPipeline)' == 'true'" />
<!-- Copy Config XMLs to output directory (so servers find them at ../../Config/) -->
<ItemGroup>
<_AllConfigFiles Include="$(MSBuildProjectDirectory)/Config/*.xml" />
</ItemGroup>
<Copy SourceFiles="@(_AllConfigFiles)" DestinationFolder="$(OutputPath)Config" SkipUnchangedFiles="true" Condition="'$(FullPipeline)' == 'true'" />
</Target>
<!-- Assemble dist/ — clean, drift-proof mod package assembled after all staging targets -->
<!-- p1 (2026-09-05): dist/ is now COMPLETE for the Complete profile - it carries the
full model payload (Resources/), mirrored incrementally from the repo by
tools/Sync-DistResources.ps1. Validate-DistComplete.ps1 (wired as a target below)
fails the build if any promised payload is absent: a missing model must fail the
build, not warn (b73, 2026-09-04: absence was quiet). -->
<!-- DependsOnTargets(CopyAudioCppServer) is LOAD-BEARING: AfterTargets does not AND-join,
and MSBuild measured 2026-08-27 assembled dist/ with an EMPTY bin/AudioCppServer because
the AfterTargets=Build queue ran the ShipWakeWordOnnxRuntime chain before the audiocpp
copy. DependsOnTargets is the hard prerequisite that makes the order guaranteed. -->
<Target Name="AssembleDist" AfterTargets="ShipWakeWordOnnxRuntime;CopyToModFolder" DependsOnTargets="CopyAudioCppServer" Condition="'$(FullPipeline)' == 'true'">
<PropertyGroup>
<DistDir>$(MSBuildProjectDirectory)/../dist</DistDir>
</PropertyGroup>
<Message Text="=== Assembling dist/ ===" Importance="high" />
<!-- (a) Fresh start for everything EXCEPT Resources/ - the model payload is multi-GB
and is mirrored incrementally (Sync-DistResources below: copies new + changed,
prunes removed, so it is a mirror, not an append). Wiping it every build would
re-copy gigabytes every build; the first build pays the copy, every later one
is fast. Everything else is small and IS wiped, so a file removed from the
allowlists cannot ship forever (top-level files pruned, dirs wiped - same
drift rule as the sidecar RemoveDir targets). Resources/ is the ONLY subtree
that survives between builds, and the mirror keeps it exact. -->
<ItemGroup>
<_DistStaleRoot Include="$(DistDir)\*.*" />
</ItemGroup>
<Delete Files="@(_DistStaleRoot)" ContinueOnError="true" />
<RemoveDir Directories="$(DistDir)/Config" ContinueOnError="true" />
<RemoveDir Directories="$(DistDir)/Plugins" ContinueOnError="true" />
<RemoveDir Directories="$(DistDir)/bin" ContinueOnError="true" />
<MakeDir Directories="$(DistDir)" />
<MakeDir Directories="$(DistDir)/Config/XUi_InGame" />
<MakeDir Directories="$(DistDir)/Plugins/OnnxRuntime" />
<MakeDir Directories="$(DistDir)/bin/SupertonicServer" />
<MakeDir Directories="$(DistDir)/bin/LlamaServer" />
<MakeDir Directories="$(DistDir)/bin/WhisperServer" />
<MakeDir Directories="$(DistDir)/bin/AudioCppServer" />
<!-- (b) ALLOWLIST copies — nothing sneaks in -->
<!-- Managed DLLs + main mod DLL from build output -->
<ItemGroup>
<_DistDlls Include="$(OutputPath)1-XNPCVoiceControl.dll;$(OutputPath)Microsoft.ML.OnnxRuntime.dll;$(OutputPath)System.Buffers.dll;$(OutputPath)System.Memory.dll;$(OutputPath)System.Numerics.Vectors.dll;$(OutputPath)System.Runtime.CompilerServices.Unsafe.dll" />
</ItemGroup>
<Copy SourceFiles="@(_DistDlls)" DestinationFolder="$(DistDir)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- ModInfo.xml -->
<Copy SourceFiles="$(MSBuildProjectDirectory)/ModInfo.xml" DestinationFolder="$(DistDir)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- Test_Servers.bat (tester-facing sidecar diagnostic) -->
<Copy SourceFiles="$(MSBuildProjectDirectory)/../Test_Servers.bat" DestinationFolder="$(DistDir)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- Config/*.xml (8 files) + Localization.csv + ReadMeFirst.md + voice-command-card.html + MANUAL.md + CHANGELOG.md.
ALLOWLIST, not a glob: a new Config file is NOT deployed until it is added here.
ServerConfig.xml was REMOVED 2026-08-29 (per-profile content audit): it existed only
for the sherpa sidecar retired 2026-08-26 and NO C# reads it. -->
<ItemGroup>
<_DistConfig Include="$(MSBuildProjectDirectory)/Config/modconfig.xml;$(MSBuildProjectDirectory)/Config/SupertonicConfig.xml;$(MSBuildProjectDirectory)/Config/personalities.xml;$(MSBuildProjectDirectory)/Config/phrasetriggers.xml;$(MSBuildProjectDirectory)/Config/utilityai.xml;$(MSBuildProjectDirectory)/Config/buffs.xml;$(MSBuildProjectDirectory)/Config/dialogs.xml;$(MSBuildProjectDirectory)/Config/Localization.csv;$(MSBuildProjectDirectory)/Config/ReadMeFirst.md;$(MSBuildProjectDirectory)/Config/voice-command-card.html;$(MSBuildProjectDirectory)/Config/entityclasses.xml;$(MSBuildProjectDirectory)/Config/MANUAL.md;$(MSBuildProjectDirectory)/Config/CHANGELOG.md" />
</ItemGroup>
<Copy SourceFiles="@(_DistConfig)" DestinationFolder="$(DistDir)/Config" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- Config/XUi_InGame/{windows,xui}.xml -->
<ItemGroup>
<_DistXUi Include="$(MSBuildProjectDirectory)/Config/XUi_InGame/windows.xml;$(MSBuildProjectDirectory)/Config/XUi_InGame/xui.xml" />
</ItemGroup>
<Copy SourceFiles="@(_DistXUi)" DestinationFolder="$(DistDir)/Config/XUi_InGame" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- Plugins/OnnxRuntime/** (native onnxruntime + vcruntime) -->
<ItemGroup>
<_DistOnnx Include="$(OutputPath)Plugins/OnnxRuntime/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_DistOnnx->'%(FullPath)')" DestinationFiles="@(_DistOnnx->'$(DistDir)/Plugins/OnnxRuntime/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- bin/SupertonicServer/** -->
<ItemGroup>
<_DistSuper Include="$(OutputPath)bin/SupertonicServer/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_DistSuper->'%(FullPath)')" DestinationFiles="@(_DistSuper->'$(DistDir)/bin/SupertonicServer/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- bin/LlamaServer/** -->
<ItemGroup>
<_DistLlama Include="$(OutputPath)bin/LlamaServer/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_DistLlama->'%(FullPath)')" DestinationFiles="@(_DistLlama->'$(DistDir)/bin/LlamaServer/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- bin/WhisperServer/** -->
<ItemGroup>
<_DistWhisper Include="$(OutputPath)bin/WhisperServer/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_DistWhisper->'%(FullPath)')" DestinationFiles="@(_DistWhisper->'$(DistDir)/bin/WhisperServer/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- bin/AudioCppServer/** (audiocpp TTS engine + Supertonic GGUF; additive to the
Supertonic ONNX path, which ships unchanged in bin/SupertonicServer) -->
<ItemGroup>
<_DistAudioCpp Include="$(OutputPath)bin/AudioCppServer/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_DistAudioCpp->'%(FullPath)')" DestinationFiles="@(_DistAudioCpp->'$(DistDir)/bin/AudioCppServer/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (c) Resources: the COMPLETE model payload, mirrored from the repo (p1, 2026-09-05).
The old README placeholder is gone: dist/Resources IS the payload now. The mirror
excludes the retired sherpa tree (Resources/KokoroSherpa, left on disk 2026-08-26).
Whether what the repo has is ENOUGH is not this target's job - that is
Validate-DistComplete, and it fails the build on a missing model. -->
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Sync-DistResources.ps1" -SourceDir "$(MSBuildProjectDirectory)/Resources" -DestDir "$(DistDir)/Resources"">
<Output TaskParameter="ExitCode" PropertyName="DistResourcesSyncExitCode" />
</Exec>
<Error Condition="'$(DistResourcesSyncExitCode)' != '0' AND '$(DistResourcesSyncExitCode)' != ''" Text="dist/Resources sync failed! Check output above." />
<Message Text="dist/ assembled complete (COMPLETE profile: full model payload included)." Importance="high" />
</Target>
<!-- Validate dist/ for the COMPLETE profile (p1, 2026-09-05): every promised payload
present, no forbidden paths, shipped modconfig all-ON. A missing model FAILS THE
BUILD, it does not warn - that is the b73 fix. Until the repo's Resources hold the
payload (e.g. the RAG embedding GGUF), EVERY default build fails on purpose until
it is restored; see .pi/queue/p1-three-complete-dists-report.md. -->
<Target Name="ValidateDistComplete" AfterTargets="AssembleDist" Condition="'$(FullPipeline)' == 'true'">
<Message Text="=== Validating dist/ (Complete profile) ===" Importance="high" />
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Validate-DistComplete.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist"">
<Output TaskParameter="ExitCode" PropertyName="CompleteValidationExitCode" />
</Exec>
<Error Condition="'$(CompleteValidationExitCode)' != '0' AND '$(CompleteValidationExitCode)' != ''" Text="dist/ (Complete) validation failed - a promised payload is missing or wrong. Check output above." />
</Target>
<!--
================================================================
CORE BUILD — CoreBuild=true
One no-payload profile instead of two (B35, 2026-08-31). The dedicated
server build and the lite client build were byte-identical for 18 of 19
files, and the ONLY content difference (four <Enabled> flags + the profile
lock in modconfig.xml) is INERT on a dedicated server: ServerManager.
StartServers returns on IsDedicatedServer, NPCWarmUpManager.cs:60 returns
early, and a dedicated server runs no AI at all - every client does its
own STT/LLM/TTS locally and relays audio via NetPackageNPCVoice. Dave's
call: the merged archive is called Core, it carries the SUPERSET content
(the old lite file list, so it also ships MANUAL.md and
voice-command-card.html - a server operator is MORE likely to want the
manual, not less), and it carries the CLIENT config (TTS/STT/LLM/RAG off
+ the profile lock), which is load-bearing for clients and inert on a
server. One download serves lite clients AND dedicated servers.
Produces dist-core/ (~20MB, hard budget 50MB) - the SAME DLL as every
other profile plus a GENERATED modconfig. No bin/ sidecars, no Resources/
models. Movement, phrase triggers, formation radial and UAI all still
work: the startup gates (ServerManager.StartServersRoutine) skip every
disabled subsystem without error, so a core install just works.
-p:DediBuild=true / -p:LiteBuild=true still work as DEPRECATED aliases
(PropertyGroup above maps them to CoreBuild); this target warns when an
alias triggered it. -p:DeployToDedi=true is NOT an alias - it is the
live server's command and keeps its name and Q:\ path.
================================================================
-->
<!-- Assemble dist-core/ — allowlist only, nothing sneaks in -->
<Target Name="AssembleDistCore" AfterTargets="CopyToModFolder" Condition="'$(CoreBuild)' == 'true'">
<Error Condition="'$(VoiceBuild)' == 'true'" Text="CoreBuild and VoiceBuild cannot be combined in one build. Run them separately: -p:CoreBuild=true for the Core (all-off) profile, -p:VoiceBuild=true for the TTS+STT profile." />
<Warning Condition="'$(DediBuild)' == 'true' OR '$(LiteBuild)' == 'true'" Text="DediBuild / LiteBuild are deprecated aliases for CoreBuild (B35, 2026-08-31 - dedi and lite are one profile now). Use -p:CoreBuild=true." />
<PropertyGroup>
<CoreDistDir>$(MSBuildProjectDirectory)/../dist-core</CoreDistDir>
</PropertyGroup>
<Message Text="=== Assembling dist-core/ (Core: lite clients + dedicated servers, no payload) ===" Importance="high" />
<!-- Wipe + recreate -->
<RemoveDir Directories="$(CoreDistDir)" ContinueOnError="true" />
<MakeDir Directories="$(CoreDistDir)/Config/XUi_InGame" />
<!--
ALLOWLIST — copy exactly these files, nothing globbed.
Config/XUi_InGame/ IS INCLUDED — do not "optimise" it out again.
It was excluded in the first dedi build on the reasoning that XUi is client-only.
That is WRONG: a client joining the dedi rebuilds XUi against the SERVER's mod
config, so with these files absent server-side the client throws
"Window 'NPCSubtitlesGroup' unknown" on every subtitle show/clear and all NPC
subtitles are dead — even though the client has the files locally.
Verified on a real dedi 2026-07-26.
Deliberately EXCLUDED (not an oversight):
- bin/** : all sidecars; none start on a dedicated server
(ServerManager.StartServers returns on
IsDedicatedServer), and a client install of THIS
profile ships no sidecars to start anyway (the four
subsystems are off in the generated modconfig).
- Resources/** : all models; every AI stage (STT/LLM/TTS/embeddings)
runs on the client. NPC_Voices excluded safe -
VoiceClipLibrary.cs:60 skips a missing directory.
- Plugins/OnnxRuntime/ : native ONNX, used only by the client-side wake word,
which is off AND profile-locked in this profile.
- ServerConfig.xml REMOVED 2026-08-29: only consumer was the retired sherpa
sidecar; no C# reader exists.
- SupertonicConfig.xml REMOVED 2026-08-29: its C# readers (TtsCache stamp
TtsCache.cs:429, AudioCppVoices.cs:39) all sit behind
the client-only TTS init this profile never runs
(TTS is off and profile-locked).
INCLUDED (B35, 2026-08-31 - the old dedi exclusion of these two is retired):
- voice-command-card.html / MANUAL.md: user documentation; a server operator
is MORE likely to want the manual, not less. The merged
Core archive is the SUPERSET (the old lite file list).
-->
<!-- (a) Managed DLLs from build output (main mod DLL + the managed ONNX set) -->
<ItemGroup>
<_CoreDlls Include="$(OutputPath)1-XNPCVoiceControl.dll" />
<!-- ⛔ THE MANAGED ONNX ASSEMBLIES MUST SHIP EVEN THOUGH NOTHING HERE RUNS THEM.
7DTD's mod loader calls Assembly.GetTypes(), which resolves every FIELD TYPE
eagerly - including WakeWordRuntime._melSession (InferenceSession) - and
throws ReflectionTypeLoadException without them, killing the whole mod.
Removing them in the 2026-08-29 audit armed exactly that failure; the lite
boot caught it before any dedi restart. The NATIVE runtime
(Plugins/OnnxRuntime, 16.3 MB) stays OUT: it is only touched when an
InferenceSession is constructed, which this profile cannot do. Cost of
being wrong in the other direction is the entire mod failing to load, so
these 528 KB are not a candidate for trimming again. -->
<_CoreDlls Include="$(OutputPath)Microsoft.ML.OnnxRuntime.dll" />
<_CoreDlls Include="$(OutputPath)System.Buffers.dll" />
<_CoreDlls Include="$(OutputPath)System.Memory.dll" />
<_CoreDlls Include="$(OutputPath)System.Numerics.Vectors.dll" />
<_CoreDlls Include="$(OutputPath)System.Runtime.CompilerServices.Unsafe.dll" />
</ItemGroup>
<Copy SourceFiles="@(_CoreDlls)" DestinationFolder="$(CoreDistDir)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (b) ModInfo.xml -->
<Copy SourceFiles="$(MSBuildProjectDirectory)/ModInfo.xml" DestinationFolder="$(CoreDistDir)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (c) Config allowlist (11 files, modconfig.xml excluded: it is GENERATED, never
forked. ServerConfig.xml / SupertonicConfig.xml removed 2026-08-29, see audit note) -->
<ItemGroup>
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/personalities.xml" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/phrasetriggers.xml" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/utilityai.xml" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/buffs.xml" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/entityclasses.xml" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/dialogs.xml" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/Localization.csv" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/ReadMeFirst.md" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/voice-command-card.html" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/MANUAL.md" />
<_CoreConfig Include="$(MSBuildProjectDirectory)/Config/CHANGELOG.md" />
</ItemGroup>
<Copy SourceFiles="@(_CoreConfig)" DestinationFolder="$(CoreDistDir)/Config" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (d) Config/XUi_InGame — REQUIRED. See the note above: a client joining the dedi
rebuilds XUi against the server's mod config, so omitting these kills
NPC subtitles for every connected client. -->
<ItemGroup>
<_CoreXUi Include="$(MSBuildProjectDirectory)/Config/XUi_InGame/windows.xml" />
<_CoreXUi Include="$(MSBuildProjectDirectory)/Config/XUi_InGame/xui.xml" />
</ItemGroup>
<Copy SourceFiles="@(_CoreXUi)" DestinationFolder="$(CoreDistDir)/Config/XUi_InGame" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (e) GENERATED core modconfig: the shipped file with TTS/STT/LLM/RAG Enabled=false
and the build-stamped profile lock. Produced at assembly time so the two files
cannot drift; the source file is NEVER forked. The dedicated server never reads
the four switches (sidecars cannot start there), so the CLIENT shape is the
right one for both audiences of this profile - the lock is what keeps a
player machine from booting sidecars it does not have, via the PlayerPrefs
override. Fails the build if the transform cannot touch all four switches
or stamp the lock. -->
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Make-CoreModconfig.ps1" -Source "$(MSBuildProjectDirectory)/Config/modconfig.xml" -Destination "$(CoreDistDir)/Config/modconfig.xml"">
<Output TaskParameter="ExitCode" PropertyName="CoreModconfigExitCode" />
</Exec>
<Error Condition="'$(CoreModconfigExitCode)' != '0'" Text="core modconfig generation failed! Check output above." />
<Message Text="dist-core/ assembled complete." Importance="high" />
</Target>
<!-- Validate dist-core/: presence of allowlist files + absence of forbidden dirs +
the four subsystem switches off + the profile lock + the 50MB size budget.
Merged 2026-08-31 (B35) from Validate-DistDedi.ps1 and Validate-DistLite.ps1;
the STRICTER assertion of each survives in tools/Validate-DistCore.ps1.
The old dedi FORBIDDEN check on MANUAL.md / voice-command-card.html is inverted:
they are REQUIRED now (the Core archive is the superset). -->
<Target Name="ValidateDistCore" AfterTargets="AssembleDistCore" Condition="'$(CoreBuild)' == 'true'">
<Message Text="=== Validating dist-core/ ===" Importance="high" />
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Validate-DistCore.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist-core"">
<Output TaskParameter="ExitCode" PropertyName="CoreValidationExitCode" />
</Exec>
<Error Condition="'$(CoreValidationExitCode)' != '0' AND '$(CoreValidationExitCode)' != ''" Text="dist-core/ validation failed! Check output above." />
</Target>
<!-- Deploy dist-core/ to dedi server mods folder (overlay, no deletes) -->
<!-- FLAG, DEFAULT PATH AND OVERRIDE SURVIVE THE B35 MERGE UNCHANGED: -p:DeployToDedi=true
-> Q:\SteamCMD\a3_0\Mods\1-XNPCVoiceControl, overridable via -p:DediModsFolder.
Only the SOURCE changed: the old dist-dedi/ is now dist-core/.
DependsOnTargets (not just AfterTargets) so validation is GUARANTEED to run before
we deploy. Both targets hook AfterTargets="AssembleDistCore", and MSBuild would
otherwise order them by declaration position alone — a reorder could silently
deploy an unvalidated package. -->
<Target Name="DeployToDedi" AfterTargets="AssembleDistCore" DependsOnTargets="ValidateDistCore" Condition="'$(DeployToDedi)' == 'true'">
<PropertyGroup>
<DediModsFolder Condition="'$(DediModsFolder)' == ''">Q:\SteamCMD\a3_0\Mods\1-XNPCVoiceControl</DediModsFolder>
</PropertyGroup>
<Message Text="=== Deploying dist-core/ to $(DediModsFolder) ===" Importance="high" />
<MakeDir Directories="$(DediModsFolder)" />
<!-- PROFILE-SWITCH DETECTION + optional CleanDeploy (same shared scripts as DeployToGame).
Note: this target with a -p:DediModsFolder override pointing at the SP folder is the
OLD workaround for "put Core into the test install". It keeps working; the honest
spelling is now -p:DeployProfile=core -p:DeployModsFolder=<path>. -->
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Check-ProfileSwitch.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist-core" -DeployDir "$(DediModsFolder)"">
<Output TaskParameter="ExitCode" PropertyName="ProfileSwitchCheckExitCode" />
</Exec>
<Error Condition="'$(ProfileSwitchCheckExitCode)' != '0' AND '$(ProfileSwitchCheckExitCode)' != ''" Text="profile-switch pre-check failed!" />
<Exec Condition="'$(CleanDeploy)' == 'true'" Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Clean-Deploy.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist-core" -DeployDir "$(DediModsFolder)"">
<Output TaskParameter="ExitCode" PropertyName="CleanDeployExitCode" />
</Exec>
<Error Condition="'$(CleanDeploy)' == 'true' AND '$(CleanDeployExitCode)' != '0'" Text="CleanDeploy failed - the deploy folder still holds files the overlay cannot remove." />
<!-- Overlay-copy everything from dist-core/ into dedi Mods folder; SkipUnchangedFiles=true, NO delete -->
<ItemGroup>
<_DediDeployAll Include="$(MSBuildProjectDirectory)/../dist-core/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_DediDeployAll->'%(FullPath)')" DestinationFiles="@(_DediDeployAll->'$(DediModsFolder)/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<Message Text="Dedi deploy complete (overlay from dist-core/, no deletes)." Importance="high" />
</Target>
<!-- Deploy dist-core/ to the client Mods folder (overlay, no deletes) - OPT-IN.
Replaces the old DeployToLite (B35) for testing the Core profile on a client.
Same rules, same reason: it deploys to ITS OWN folder, because an overlay copy
NEVER deletes - deploying core into the FULL install's folder would leave all
~3.7GB of models and sidecars in place and merely switch the four subsystems
off. That is a core CONFIG, not a core INSTALL. The packages CANNOT be loaded
at the same time (the game keys a loaded mod on ModInfo's Name, NOT the folder):
park the other 1-XNPCVoiceControl* folder OUTSIDE Mods/ before launching. -->
<Target Name="DeployToCore" AfterTargets="AssembleDistCore" DependsOnTargets="ValidateDistCore" Condition="'$(DeployToCore)' == 'true'">
<PropertyGroup>
<CoreModsFolder Condition="'$(CoreModsFolder)' == ''">$(GamePath)/Mods/1-XNPCVoiceControl-Core</CoreModsFolder>
</PropertyGroup>
<Message Text="=== Deploying dist-core/ to $(CoreModsFolder) ===" Importance="high" />
<MakeDir Directories="$(CoreModsFolder)" />
<!-- PROFILE-SWITCH DETECTION + optional CleanDeploy (shared scripts, see DeployToGame) -->
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Check-ProfileSwitch.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist-core" -DeployDir "$(CoreModsFolder)"">
<Output TaskParameter="ExitCode" PropertyName="ProfileSwitchCheckExitCode" />
</Exec>
<Error Condition="'$(ProfileSwitchCheckExitCode)' != '0' AND '$(ProfileSwitchCheckExitCode)' != ''" Text="profile-switch pre-check failed!" />
<Exec Condition="'$(CleanDeploy)' == 'true'" Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Clean-Deploy.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist-core" -DeployDir "$(CoreModsFolder)"">
<Output TaskParameter="ExitCode" PropertyName="CleanDeployExitCode" />
</Exec>
<Error Condition="'$(CleanDeploy)' == 'true' AND '$(CleanDeployExitCode)' != '0'" Text="CleanDeploy failed - the deploy folder still holds files the overlay cannot remove." />
<!-- Overlay-copy everything from dist-core/ into the client Mods folder; SkipUnchangedFiles=true, NO delete -->
<ItemGroup>
<_CoreDeployAll Include="$(MSBuildProjectDirectory)/../dist-core/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_CoreDeployAll->'%(FullPath)')" DestinationFiles="@(_CoreDeployAll->'$(CoreModsFolder)/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<Message Text="Core client deploy complete (overlay from dist-core/, no deletes)." Importance="high" />
</Target>
<!-- Optional: Auto-deploy to game mods folder (overlay dist/ into live Mods, never delete) -->
<!-- p1 (2026-09-05): the Resources/ exclusion is GONE - dist/ is a complete tree for
the Complete profile and is copied straight, no exclusions. The profile-switch
pre-check + optional CleanDeploy apply here exactly as on the other deploy targets.
Prefer -p:DeployProfile=complete -p:DeployModsFolder=<path> for the new spelling. -->
<Target Name="DeployToGame" AfterTargets="AssembleDist" Condition="'$(DeployToGame)' == 'true'">
<PropertyGroup>
<ModsFolder>$(GamePath)/Mods/1-XNPCVoiceControl</ModsFolder>
</PropertyGroup>
<Message Text="=== Deploying dist/ to $(ModsFolder) ===" Importance="high" />
<MakeDir Directories="$(ModsFolder)" />
<!-- PROFILE-SWITCH DETECTION: say so before copying; the post-deploy validator then
fails on the leftovers on purpose. CleanDeploy deletes ONLY the leftover files.
(shared scripts + ignore list: tools/Check-ProfileSwitch.ps1, tools/Clean-Deploy.ps1,
tools/Deploy-IgnoreList.psm1) -->
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Check-ProfileSwitch.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist" -DeployDir "$(ModsFolder)"">
<Output TaskParameter="ExitCode" PropertyName="ProfileSwitchCheckExitCode" />
</Exec>
<Error Condition="'$(ProfileSwitchCheckExitCode)' != '0' AND '$(ProfileSwitchCheckExitCode)' != ''" Text="profile-switch pre-check failed!" />
<Exec Condition="'$(CleanDeploy)' == 'true'" Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Clean-Deploy.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist" -DeployDir "$(ModsFolder)"">
<Output TaskParameter="ExitCode" PropertyName="CleanDeployExitCode" />
</Exec>
<Error Condition="'$(CleanDeploy)' == 'true' AND '$(CleanDeployExitCode)' != '0'" Text="CleanDeploy failed - the deploy folder still holds files the overlay cannot remove." />
<!-- Overlay-copy everything from dist/ into live Mods folder; SkipUnchangedFiles=true, NO delete -->
<ItemGroup>
<_DeployAll Include="$(MSBuildProjectDirectory)/../dist/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_DeployAll->'%(FullPath)')" DestinationFiles="@(_DeployAll->'$(ModsFolder)/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" ContinueOnError="true" />
<Message Text="Deploy complete (overlay from dist/, no deletes)." Importance="high" />
</Target>
<!-- Validate deploy folder matches dist/ exactly (SP/listen-host) -->
<Target Name="ValidateDeploy" AfterTargets="DeployToGame" Condition="'$(DeployToGame)' == 'true'">
<PropertyGroup>
<ModsFolderForValidate>$(GamePath)/Mods/1-XNPCVoiceControl</ModsFolderForValidate>
</PropertyGroup>
<Message Text="=== Validating deploy (SP) ===" Importance="high" />
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Validate-Deploy.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist" -DeployDir "$(ModsFolderForValidate)"">
<Output TaskParameter="ExitCode" PropertyName="DeployValidationExitCode" />
</Exec>
<Error Condition="'$(DeployValidationExitCode)' != '0' AND '$(DeployValidationExitCode)' != ''" Text="Deploy validation failed (SP)! Check output above." />
</Target>
<!-- Validate deploy folder matches dist-core/ exactly (dedicated server) -->
<Target Name="ValidateDeployDedi" AfterTargets="DeployToDedi" Condition="'$(DeployToDedi)' == 'true'">
<PropertyGroup>
<DediModsFolderForValidate>$(DediModsFolder)</DediModsFolderForValidate>
</PropertyGroup>
<Message Text="=== Validating deploy (dedi) ===" Importance="high" />
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Validate-Deploy.ps1" -DistDir "$(MSBuildProjectDirectory)/../dist-core" -DeployDir "$(DediModsFolderForValidate)"">
<Output TaskParameter="ExitCode" PropertyName="DediDeployValidationExitCode" />
</Exec>
<Error Condition="'$(DediDeployValidationExitCode)' != '0' AND '$(DediDeployValidationExitCode)' != ''" Text="Deploy validation failed (dedi)! Check output above." />
</Target>
<!--
================================================================
RELEASE PREP — ReleasePrep=true (OPT-IN, NOT part of normal deploy)
Deletes runtime artifacts from BOTH deploy folders so the zip
does not include sidecar stdout logs or debug pdbs.
Warns on NPC_Memories files (never deletes them).
Prints READY TO ZIP summary. Verifies cleanup by re-scanning.
================================================================
-->
<Target Name="ReleasePrep" AfterTargets="DeployToGame;DeployToDedi" Condition="'$(ReleasePrep)' == 'true'">
<PropertyGroup>
<SpDeployPath Condition="'$(SpDeployPath)' == ''">$(GamePath)/Mods/1-XNPCVoiceControl</SpDeployPath>
<DediDeployPath Condition="'$(DediDeployPath)' == ''">Q:\SteamCMD\a3_0\Mods\1-XNPCVoiceControl</DediDeployPath>
</PropertyGroup>
<Message Text="=== Release prep (opt-in) ===" Importance="high" />
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ToolsDir)/Release-Prep.ps1" -SpPath "$(SpDeployPath)" -DediPath "$(DediDeployPath)"">
<Output TaskParameter="ExitCode" PropertyName="ReleasePrepExitCode" />
</Exec>
<Error Condition="'$(ReleasePrepExitCode)' != '0' AND '$(ReleasePrepExitCode)' != ''" Text="Release prep failed! Check output above." />
</Target>
<!-- B35 (2026-08-31) TOMBSTONE: the LITE BUILD section (LiteBuild / dist-lite/ /
ValidateDistLite / DeployToLite) was MERGED into the CORE BUILD section above.
-p:LiteBuild=true still works as a deprecated alias for -p:CoreBuild=true;
-p:DeployToLite=true is gone, use -p:DeployToCore=true for the client-side test
deploy (same own-folder rules the old DeployToLite had). Keep this comment so a
search for the old target names finds the explanation, not a dead end. -->
<!--
================================================================
VOICE BUILD (client, TTS + STT on, AI off) - VoiceBuild=true
Produces dist-voice/ (~740MB, hard budget 1.5GB) - the SAME
DLL as every other profile plus a GENERATED modconfig with
TTS on (TtsEngine=audiocpp) + STT on + wake word on, LLM/RAG off.
Kept SEPARATE from the Core build on purpose (Dave, 2026-08-30; still
true after the 2026-08-31 dedi+lite merge into Core): the all-off Core
package (~17MB, movement-and-radial-only) is a legitimate product in its
own right; this one adds the voice payload. The two cannot be combined
in one build (Error guards on both assemble targets).
Content = the Core (all-off) base, plus:
+ bin/AudioCppServer/ audiocpp TTS exe + Supertonic GGUF +
model_specs (self-contained, the GGUF
ships beside the exe)
+ bin/WhisperServer/ whisper STT exe + ggml libs + the
ggml-small-q8_0.bin model
+ Resources/WakeWord/models the 3 wake-word ONNX files; the ONE
Resources/ subdirectory this profile
ships (the loader keys on
melspectrogram.onnx there -
NPCVoiceControlMod.ResolveWakeWordModelsDir)
Deliberately EXCLUDED (not an oversight):
- bin/LlamaServer/ LLM is off; nothing starts llama-server
- bin/SupertonicServer/ the Supertonic TTS engine is a dead
switch: TtsEngine is fixed to audiocpp
and this profile will not ship
Resources/Supertonic (396MB) beside it
- Resources/Models/ LLM + embedding GGUFs (1.3GB); RAG and
LLM are off
- Resources/Supertonic/ 396MB, only the (excluded) Supertonic
TTS engine consumes it
- Test_Servers.bat its checks target llama/supertonic/
sherpa sidecars this profile does not
ship; it would report nearly
everything MISSING
The LLM-off NPC is not mute: the canned greeting fallback (cfb1c1f)
greets from personalities.xml.
================================================================
-->
<!-- Assemble dist-voice/ - allowlist only, nothing sneaks in -->
<!-- DependsOnTargets is LOAD-BEARING for the same reason as AssembleDist:
the sidecar staging targets are AfterTargets=Build and their completion
is NOT guaranteed by our AfterTargets="CopyToModFolder" hook alone.
TrimWhisperServer (AfterTargets=CopyWhisperServer) is the right anchor:
depending on it forces BOTH the whisper copy and its trim to finish. -->
<Target Name="AssembleDistVoice" AfterTargets="CopyToModFolder" DependsOnTargets="CopyAudioCppServer;TrimWhisperServer" Condition="'$(VoiceBuild)' == 'true'">
<Error Condition="'$(CoreBuild)' == 'true'" Text="CoreBuild and VoiceBuild cannot be combined in one build. Run them separately: -p:CoreBuild=true for the Core (all-off) profile, -p:VoiceBuild=true for the TTS+STT profile." />
<Warning Condition="'$(LiteVoiceBuild)' == 'true'" Text="LiteVoiceBuild is a deprecated alias for VoiceBuild (B36, 2026-08-31 - the profile and archive were renamed Core / Voice / Complete). Use -p:VoiceBuild=true." />
<PropertyGroup>
<VoiceDistDir>$(MSBuildProjectDirectory)/../dist-voice</VoiceDistDir>
</PropertyGroup>
<Message Text="=== Assembling dist-voice/ (client, TTS + STT on, AI off) ===" Importance="high" />
<!-- Wipe + recreate -->
<RemoveDir Directories="$(VoiceDistDir)" ContinueOnError="true" />
<MakeDir Directories="$(VoiceDistDir)/Config/XUi_InGame" />
<MakeDir Directories="$(VoiceDistDir)/Plugins/OnnxRuntime" />
<MakeDir Directories="$(VoiceDistDir)/bin/AudioCppServer" />
<MakeDir Directories="$(VoiceDistDir)/bin/WhisperServer" />
<MakeDir Directories="$(VoiceDistDir)/Resources/WakeWord/models" />
<!-- (a) Managed DLLs from build output - IDENTICAL to every other profile -->
<ItemGroup>
<_VoiceDlls Include="$(OutputPath)1-XNPCVoiceControl.dll" />
<_VoiceDlls Include="$(OutputPath)Microsoft.ML.OnnxRuntime.dll" />
<_VoiceDlls Include="$(OutputPath)System.Buffers.dll" />
<_VoiceDlls Include="$(OutputPath)System.Memory.dll" />
<_VoiceDlls Include="$(OutputPath)System.Numerics.Vectors.dll" />
<_VoiceDlls Include="$(OutputPath)System.Runtime.CompilerServices.Unsafe.dll" />
</ItemGroup>
<Copy SourceFiles="@(_VoiceDlls)" DestinationFolder="$(VoiceDistDir)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (b) ModInfo.xml -->
<Copy SourceFiles="$(MSBuildProjectDirectory)/ModInfo.xml" DestinationFolder="$(VoiceDistDir)" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (c) Config allowlist (11 files, modconfig.xml excluded: it is GENERATED, never
forked. ServerConfig.xml removed 2026-08-29 - no C# reader. SupertonicConfig.xml
is KEPT: it is the audiocpp VoiceMap (AudioCppVoices.cs:39 -> TTSService.cs:149)
plus the TtsCache stamp (TtsCache.cs:429), and this profile's TTS engine is
audiocpp, so it is load-bearing here. -->
<ItemGroup>
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/SupertonicConfig.xml" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/personalities.xml" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/phrasetriggers.xml" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/utilityai.xml" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/buffs.xml" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/entityclasses.xml" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/dialogs.xml" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/Localization.csv" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/ReadMeFirst.md" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/voice-command-card.html" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/MANUAL.md" />
<_VoiceConfig Include="$(MSBuildProjectDirectory)/Config/CHANGELOG.md" />
</ItemGroup>
<Copy SourceFiles="@(_VoiceConfig)" DestinationFolder="$(VoiceDistDir)/Config" SkipUnchangedFiles="true" ContinueOnError="true" />
<!-- (d) Config/XUi_InGame - the client's own windows.xml / xui.xml (radial, config menu) -->
<ItemGroup>
<_VoiceXUi Include="$(MSBuildProjectDirectory)/Config/XUi_InGame/windows.xml" />
<_VoiceXUi Include="$(MSBuildProjectDirectory)/Config/XUi_InGame/xui.xml" />
</ItemGroup>