@plasius/ai-game 0.1.12 → 0.2.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.
package/dist/index.cjs CHANGED
@@ -31,23 +31,39 @@ __export(index_exports, {
31
31
  AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID: () => AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID,
32
32
  AI_GAME_PACKAGE: () => AI_GAME_PACKAGE,
33
33
  AI_GAME_PERSPECTIVE_FEATURE_FLAG_ID: () => AI_GAME_PERSPECTIVE_FEATURE_FLAG_ID,
34
+ AI_GAME_PLAYER_SYSTEM_ALERT_PRIORITIES: () => AI_GAME_PLAYER_SYSTEM_ALERT_PRIORITIES,
35
+ AI_GAME_PLAYER_SYSTEM_CONFIDENCE_BANDS: () => AI_GAME_PLAYER_SYSTEM_CONFIDENCE_BANDS,
36
+ AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION: () => AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
37
+ AI_GAME_PLAYER_SYSTEM_FEATURE_FLAG_ID: () => AI_GAME_PLAYER_SYSTEM_FEATURE_FLAG_ID,
38
+ AI_GAME_PLAYER_SYSTEM_FOCUS_MODES: () => AI_GAME_PLAYER_SYSTEM_FOCUS_MODES,
39
+ AI_GAME_PLAYER_SYSTEM_FOCUS_MODE_CONTRACTS: () => AI_GAME_PLAYER_SYSTEM_FOCUS_MODE_CONTRACTS,
40
+ AI_GAME_PLAYER_SYSTEM_INPUT_MODALITIES: () => AI_GAME_PLAYER_SYSTEM_INPUT_MODALITIES,
41
+ AI_GAME_PLAYER_SYSTEM_MODULES: () => AI_GAME_PLAYER_SYSTEM_MODULES,
42
+ AI_GAME_PLAYER_SYSTEM_MODULE_CONTRACTS: () => AI_GAME_PLAYER_SYSTEM_MODULE_CONTRACTS,
43
+ AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS: () => AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS,
44
+ AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES: () => AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES,
34
45
  AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID: () => AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID,
35
46
  AI_GAME_TASK_AUTHORITY_BOUNDARIES: () => AI_GAME_TASK_AUTHORITY_BOUNDARIES,
36
47
  AI_GAME_TASK_DECISIONS: () => AI_GAME_TASK_DECISIONS,
37
48
  AI_GAME_TASK_KINDS: () => AI_GAME_TASK_KINDS,
38
49
  AI_GAME_TASK_RESULTS: () => AI_GAME_TASK_RESULTS,
39
50
  AI_GAME_TASK_RISK_CLASSES: () => AI_GAME_TASK_RISK_CLASSES,
51
+ AI_GAME_TRAINING_ACADEMIC_PROGRESS_STAGES: () => import_training.TRAINING_ACADEMIC_PROGRESS_STAGES,
52
+ AI_GAME_TRAINING_ACADEMIES_FEATURE_FLAG_ID: () => import_training.TRAINING_ACADEMIES_FEATURE_FLAG_ID,
53
+ AI_GAME_TRAINING_ACADEMY_ADMISSION_DECISIONS: () => import_training.TRAINING_ACADEMY_ADMISSION_DECISIONS,
40
54
  AI_GAME_TRAINING_ANTI_SPELL_COUNTER_WINDOWS: () => import_training.TRAINING_ANTI_SPELL_COUNTER_WINDOWS,
41
55
  AI_GAME_TRAINING_ANTI_SPELL_FIELDCRAFT_FAMILIES: () => import_training.TRAINING_ANTI_SPELL_FIELDCRAFT_FAMILIES,
42
56
  AI_GAME_TRAINING_BARRACKS_DRILL_DELIVERY_MODES: () => import_training.TRAINING_BARRACKS_DRILL_DELIVERY_MODES,
43
57
  AI_GAME_TRAINING_INSTITUTIONS_FEATURE_FLAG_ID: () => import_training.TRAINING_FEATURE_FLAG_ID,
58
+ AI_GAME_TRAINING_INSTRUCTION_ACCESS_LEVELS: () => import_training.TRAINING_INSTRUCTION_ACCESS_LEVELS,
44
59
  AI_GAME_TRAINING_MARTIAL_FEATURE_FLAG_ID: () => import_training.TRAINING_MARTIAL_FEATURE_FLAG_ID,
45
60
  AI_GAME_TRAINING_MARTIAL_TECHNIQUE_FAMILIES: () => import_training.TRAINING_MARTIAL_TECHNIQUE_FAMILIES,
46
61
  AI_GAME_TRAINING_MARTIAL_TECHNIQUE_TRACKS: () => import_training.TRAINING_MARTIAL_TECHNIQUE_TRACKS,
47
62
  AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS: () => AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS,
48
63
  AI_GAME_TRAINING_RECOMMENDATION_READINESS: () => AI_GAME_TRAINING_RECOMMENDATION_READINESS,
49
64
  AI_GAME_TRAINING_STAGE_GATES: () => AI_GAME_TRAINING_STAGE_GATES,
50
- AI_GAME_TRAINING_TRUST_MARKER_SOURCES: () => AI_GAME_TRAINING_TRUST_MARKER_SOURCES,
65
+ AI_GAME_TRAINING_TECHNIQUE_MASTERY_STATES: () => import_training.TRAINING_TECHNIQUE_MASTERY_STATES,
66
+ AI_GAME_TRAINING_TRUST_MARKER_SOURCES: () => import_training.TRAINING_TRUST_MARKER_SOURCES,
51
67
  AI_GAME_TTS_CACHE_POLICIES: () => AI_GAME_TTS_CACHE_POLICIES,
52
68
  QUIET_MEASURE_AXES: () => QUIET_MEASURE_AXES,
53
69
  QUIET_MEASURE_CONFIDENCE_BANDS: () => QUIET_MEASURE_CONFIDENCE_BANDS,
@@ -62,23 +78,47 @@ __export(index_exports, {
62
78
  QUIET_MEASURE_SIGNAL_BANDS: () => QUIET_MEASURE_SIGNAL_BANDS,
63
79
  aiGameFeatureFlags: () => aiGameFeatureFlags,
64
80
  classifyAiGameTask: () => classifyAiGameTask,
81
+ createAiGameAcademicTrainingSnapshot: () => createAiGameAcademicTrainingSnapshot,
65
82
  createAiGameInstitutionEligibility: () => createAiGameInstitutionEligibility,
66
83
  createAiGameMartialTrainingSnapshot: () => createAiGameMartialTrainingSnapshot,
84
+ createAiGamePlayerSystemAlert: () => createAiGamePlayerSystemAlert,
85
+ createAiGamePlayerSystemPreferenceConfidenceState: () => createAiGamePlayerSystemPreferenceConfidenceState,
86
+ createAiGamePlayerSystemPreferenceInput: () => createAiGamePlayerSystemPreferenceInput,
87
+ createAiGamePlayerSystemPreferenceProfile: () => createAiGamePlayerSystemPreferenceProfile,
88
+ createAiGamePlayerSystemSession: () => createAiGamePlayerSystemSession,
67
89
  createAiGameSpecializationRecommendation: () => createAiGameSpecializationRecommendation,
90
+ createAiGameTrainingAcademicMissionPrerequisite: () => import_training.createTrainingAcademicMissionPrerequisite,
91
+ createAiGameTrainingAcademyAdmission: () => import_training.createTrainingAcademyAdmission,
92
+ createAiGameTrainingSchoolProgression: () => import_training.createTrainingSchoolProgression,
68
93
  createAiGameTrainingStateSnapshot: () => createAiGameTrainingStateSnapshot,
94
+ createAiGameTrainingTrackSelection: () => import_training.createTrainingTrackSelection,
69
95
  createAiGameTrainingTrustMarker: () => createAiGameTrainingTrustMarker,
70
96
  createQuietMeasureJudgmentEligibility: () => createQuietMeasureJudgmentEligibility,
71
97
  createQuietMeasureJudgmentResponse: () => createQuietMeasureJudgmentResponse,
72
98
  gameEventFeatureFlags: () => gameEventFeatureFlags,
99
+ getAiGamePlayerSystemFocusModeContract: () => getAiGamePlayerSystemFocusModeContract,
100
+ getAiGamePlayerSystemModuleContract: () => getAiGamePlayerSystemModuleContract,
101
+ isAiGamePlayerSystemAlertDeliverable: () => isAiGamePlayerSystemAlertDeliverable,
102
+ isAiGamePlayerSystemAlertPriority: () => isAiGamePlayerSystemAlertPriority,
103
+ isAiGamePlayerSystemConfidenceBand: () => isAiGamePlayerSystemConfidenceBand,
104
+ isAiGamePlayerSystemFocusMode: () => isAiGamePlayerSystemFocusMode,
105
+ isAiGamePlayerSystemInputModality: () => isAiGamePlayerSystemInputModality,
106
+ isAiGamePlayerSystemModule: () => isAiGamePlayerSystemModule,
107
+ isAiGamePlayerSystemPreferenceKind: () => isAiGamePlayerSystemPreferenceKind,
108
+ isAiGamePlayerSystemPreferenceSource: () => isAiGamePlayerSystemPreferenceSource,
109
+ isAiGameTrainingAcademicProgressStage: () => import_training.isTrainingAcademicProgressStage,
110
+ isAiGameTrainingAcademyAdmissionDecision: () => import_training.isTrainingAcademyAdmissionDecision,
73
111
  isAiGameTrainingAntiSpellCounterWindow: () => import_training.isTrainingAntiSpellCounterWindow,
74
112
  isAiGameTrainingAntiSpellFieldcraftFamily: () => import_training.isTrainingAntiSpellFieldcraftFamily,
75
113
  isAiGameTrainingBarracksDrillDeliveryMode: () => import_training.isTrainingBarracksDrillDeliveryMode,
114
+ isAiGameTrainingInstructionAccessLevel: () => import_training.isTrainingInstructionAccessLevel,
76
115
  isAiGameTrainingMartialTechniqueFamily: () => import_training.isTrainingMartialTechniqueFamily,
77
116
  isAiGameTrainingMartialTechniqueTrack: () => import_training.isTrainingMartialTechniqueTrack,
78
117
  isAiGameTrainingRecommendationConfidenceBand: () => isAiGameTrainingRecommendationConfidenceBand,
79
118
  isAiGameTrainingRecommendationReadiness: () => isAiGameTrainingRecommendationReadiness,
80
119
  isAiGameTrainingStageGate: () => isAiGameTrainingStageGate,
81
- isAiGameTrainingTrustMarkerSource: () => isAiGameTrainingTrustMarkerSource,
120
+ isAiGameTrainingTechniqueMasteryState: () => import_training.isTrainingTechniqueMasteryState,
121
+ isAiGameTrainingTrustMarkerSource: () => import_training.isTrainingTrustMarkerSource,
82
122
  isCandidateWorldEvent: () => isCandidateWorldEvent,
83
123
  isCanonicalWorldEvent: () => isCanonicalWorldEvent,
84
124
  isGossipTopicActive: () => isGossipTopicActive,
@@ -94,7 +134,9 @@ __export(index_exports, {
94
134
  packageDescriptor: () => packageDescriptor,
95
135
  projectTopicForAudience: () => projectTopicForAudience,
96
136
  resolveAiGamePlayerAddressText: () => resolveAiGamePlayerAddressText,
97
- resolveAiGameTaskBatch: () => resolveAiGameTaskBatch
137
+ resolveAiGamePlayerSystemConfidenceBand: () => resolveAiGamePlayerSystemConfidenceBand,
138
+ resolveAiGameTaskBatch: () => resolveAiGameTaskBatch,
139
+ selectAiGamePlayerSystemAlertsForFocusMode: () => selectAiGamePlayerSystemAlertsForFocusMode
98
140
  });
99
141
  module.exports = __toCommonJS(index_exports);
100
142
 
@@ -107,12 +149,6 @@ var AI_GAME_TRAINING_STAGE_GATES = [
107
149
  "advanced-specialization",
108
150
  "dominion-and-divine"
109
151
  ];
110
- var AI_GAME_TRAINING_TRUST_MARKER_SOURCES = [
111
- "system",
112
- "mission",
113
- "institution",
114
- "sponsor"
115
- ];
116
152
  var AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS = [
117
153
  "low",
118
154
  "medium",
@@ -131,21 +167,12 @@ function assertNonEmptyString(value, label) {
131
167
  throw new Error(`${label} must be a non-empty string`);
132
168
  }
133
169
  }
134
- function assertIsoTimestamp(value, label) {
135
- assertNonEmptyString(value, label);
136
- if (Number.isNaN(Date.parse(value))) {
137
- throw new Error(`${label} must be an ISO-8601 timestamp`);
138
- }
139
- }
140
170
  function isTrainingInstitutionType(value) {
141
171
  return value === "school" || value === "barracks" || value === "academy" || value === "apprenticeship";
142
172
  }
143
173
  function isAiGameTrainingStageGate(value) {
144
174
  return AI_GAME_TRAINING_STAGE_GATES.includes(value);
145
175
  }
146
- function isAiGameTrainingTrustMarkerSource(value) {
147
- return AI_GAME_TRAINING_TRUST_MARKER_SOURCES.includes(value);
148
- }
149
176
  function isAiGameTrainingRecommendationConfidenceBand(value) {
150
177
  return AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS.includes(value);
151
178
  }
@@ -173,19 +200,7 @@ function createAiGameInstitutionEligibility(input) {
173
200
  });
174
201
  }
175
202
  function createAiGameTrainingTrustMarker(input) {
176
- assertNonEmptyString(input.markerId, "markerId");
177
- assertNonEmptyString(input.institutionId, "institutionId");
178
- assertIsoTimestamp(input.awardedAtIso, "awardedAtIso");
179
- if (!(0, import_training.isTrainingTrustLevel)(input.trustLevel)) {
180
- throw new Error("trustLevel must be a supported training trust level");
181
- }
182
- if (!isAiGameTrainingTrustMarkerSource(input.source)) {
183
- throw new Error("source must be a supported training trust marker source");
184
- }
185
- return Object.freeze({
186
- ...input,
187
- reasonCodes: freezeReadonlyArray(input.reasonCodes)
188
- });
203
+ return (0, import_training.createTrainingTrustMarker)(input);
189
204
  }
190
205
  function createAiGameSpecializationRecommendation(input) {
191
206
  assertNonEmptyString(input.recommendationId, "recommendationId");
@@ -226,6 +241,20 @@ function createAiGameTrainingStateSnapshot(input) {
226
241
  )
227
242
  });
228
243
  }
244
+ function createAiGameAcademicTrainingSnapshot(input) {
245
+ return Object.freeze({
246
+ schoolProgression: (0, import_training.createTrainingSchoolProgression)(input.schoolProgression),
247
+ academyAdmissions: freezeReadonlyArray(
248
+ input.academyAdmissions.map(import_training.createTrainingAcademyAdmission)
249
+ ),
250
+ trackSelections: freezeReadonlyArray(
251
+ input.trackSelections.map(import_training.createTrainingTrackSelection)
252
+ ),
253
+ recommendations: freezeReadonlyArray(
254
+ input.recommendations.map(createAiGameSpecializationRecommendation)
255
+ )
256
+ });
257
+ }
229
258
  function createAiGameMartialTrainingSnapshot(input) {
230
259
  return Object.freeze({
231
260
  barracksDrills: freezeReadonlyArray(
@@ -243,6 +272,390 @@ function createAiGameMartialTrainingSnapshot(input) {
243
272
  });
244
273
  }
245
274
 
275
+ // src/player-system.ts
276
+ var AI_GAME_PLAYER_SYSTEM_FEATURE_FLAG_ID = "isekai.player-system.core.enabled";
277
+ var AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION = "1.0";
278
+ var AI_GAME_PLAYER_SYSTEM_FOCUS_MODES = [
279
+ "ambient",
280
+ "focused",
281
+ "combat-safe"
282
+ ];
283
+ var AI_GAME_PLAYER_SYSTEM_INPUT_MODALITIES = ["voice", "touch"];
284
+ var AI_GAME_PLAYER_SYSTEM_MODULES = [
285
+ "identity",
286
+ "missions",
287
+ "guild-quests",
288
+ "event-log",
289
+ "mcc",
290
+ "tutorial",
291
+ "points-store"
292
+ ];
293
+ var AI_GAME_PLAYER_SYSTEM_ALERT_PRIORITIES = [
294
+ "critical",
295
+ "high",
296
+ "normal",
297
+ "low"
298
+ ];
299
+ var AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS = [
300
+ "combat",
301
+ "exploration",
302
+ "crafting",
303
+ "social",
304
+ "governance"
305
+ ];
306
+ var AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES = [
307
+ "explicit",
308
+ "observed"
309
+ ];
310
+ var AI_GAME_PLAYER_SYSTEM_CONFIDENCE_BANDS = [
311
+ "low",
312
+ "medium",
313
+ "high"
314
+ ];
315
+ var DEFAULT_FOCUS_MODE_CONTRACTS = Object.freeze({
316
+ ambient: Object.freeze({
317
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
318
+ mode: "ambient",
319
+ acceptsInputModalities: Object.freeze([]),
320
+ allowsFullNavigation: false,
321
+ maximumVisibleModules: 1,
322
+ deliverableAlertPriorities: Object.freeze([
323
+ "critical",
324
+ "high",
325
+ "normal",
326
+ "low"
327
+ ])
328
+ }),
329
+ focused: Object.freeze({
330
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
331
+ mode: "focused",
332
+ acceptsInputModalities: Object.freeze([
333
+ "voice",
334
+ "touch"
335
+ ]),
336
+ allowsFullNavigation: true,
337
+ maximumVisibleModules: 3,
338
+ deliverableAlertPriorities: Object.freeze([
339
+ "critical",
340
+ "high",
341
+ "normal",
342
+ "low"
343
+ ])
344
+ }),
345
+ "combat-safe": Object.freeze({
346
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
347
+ mode: "combat-safe",
348
+ acceptsInputModalities: Object.freeze([
349
+ "voice",
350
+ "touch"
351
+ ]),
352
+ allowsFullNavigation: false,
353
+ maximumVisibleModules: 1,
354
+ deliverableAlertPriorities: Object.freeze([
355
+ "critical",
356
+ "high"
357
+ ])
358
+ })
359
+ });
360
+ var DEFAULT_MODULE_CONTRACTS = Object.freeze({
361
+ identity: Object.freeze({
362
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
363
+ module: "identity",
364
+ requiresFocusedMode: false,
365
+ availableInCombatSafeMode: true,
366
+ supportedInputModalities: Object.freeze([
367
+ "voice",
368
+ "touch"
369
+ ])
370
+ }),
371
+ missions: Object.freeze({
372
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
373
+ module: "missions",
374
+ requiresFocusedMode: true,
375
+ availableInCombatSafeMode: false,
376
+ supportedInputModalities: Object.freeze([
377
+ "voice",
378
+ "touch"
379
+ ])
380
+ }),
381
+ "guild-quests": Object.freeze({
382
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
383
+ module: "guild-quests",
384
+ requiresFocusedMode: true,
385
+ availableInCombatSafeMode: false,
386
+ supportedInputModalities: Object.freeze([
387
+ "voice",
388
+ "touch"
389
+ ])
390
+ }),
391
+ "event-log": Object.freeze({
392
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
393
+ module: "event-log",
394
+ requiresFocusedMode: true,
395
+ availableInCombatSafeMode: false,
396
+ supportedInputModalities: Object.freeze([
397
+ "voice",
398
+ "touch"
399
+ ])
400
+ }),
401
+ mcc: Object.freeze({
402
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
403
+ module: "mcc",
404
+ requiresFocusedMode: true,
405
+ availableInCombatSafeMode: false,
406
+ supportedInputModalities: Object.freeze([
407
+ "voice",
408
+ "touch"
409
+ ])
410
+ }),
411
+ tutorial: Object.freeze({
412
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
413
+ module: "tutorial",
414
+ requiresFocusedMode: true,
415
+ availableInCombatSafeMode: false,
416
+ supportedInputModalities: Object.freeze([
417
+ "voice",
418
+ "touch"
419
+ ])
420
+ }),
421
+ "points-store": Object.freeze({
422
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
423
+ module: "points-store",
424
+ requiresFocusedMode: true,
425
+ availableInCombatSafeMode: false,
426
+ supportedInputModalities: Object.freeze([
427
+ "voice",
428
+ "touch"
429
+ ])
430
+ })
431
+ });
432
+ var DEFAULT_SESSION_MODULES = Object.freeze([DEFAULT_MODULE_CONTRACTS.identity]);
433
+ var AI_GAME_PLAYER_SYSTEM_FOCUS_MODE_CONTRACTS = Object.freeze(
434
+ AI_GAME_PLAYER_SYSTEM_FOCUS_MODES.map(
435
+ (mode) => DEFAULT_FOCUS_MODE_CONTRACTS[mode]
436
+ )
437
+ );
438
+ var AI_GAME_PLAYER_SYSTEM_MODULE_CONTRACTS = Object.freeze(
439
+ AI_GAME_PLAYER_SYSTEM_MODULES.map((module2) => DEFAULT_MODULE_CONTRACTS[module2])
440
+ );
441
+ function freezeReadonlyArray2(items) {
442
+ return Object.freeze([...items]);
443
+ }
444
+ function assertNonEmptyString2(value, label) {
445
+ if (value.trim().length === 0) {
446
+ throw new Error(`${label} must be a non-empty string`);
447
+ }
448
+ }
449
+ function assertContractVersion(value, label = "contractVersion") {
450
+ if (value !== AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION) {
451
+ throw new Error(`${label} must be ${AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION}`);
452
+ }
453
+ }
454
+ function assertIsoTimestamp(value, label) {
455
+ assertNonEmptyString2(value, label);
456
+ if (Number.isNaN(Date.parse(value))) {
457
+ throw new Error(`${label} must be an ISO-8601 timestamp`);
458
+ }
459
+ }
460
+ function assertConfidenceScore(value, label = "confidenceScore") {
461
+ if (!Number.isFinite(value) || value < 0 || value > 1) {
462
+ throw new Error(`${label} must be between 0 and 1`);
463
+ }
464
+ }
465
+ function assertNonNegativeInteger(value, label) {
466
+ if (!Number.isInteger(value) || value < 0) {
467
+ throw new Error(`${label} must be a non-negative integer`);
468
+ }
469
+ }
470
+ function isMember(value, members) {
471
+ return members.includes(value);
472
+ }
473
+ function isAiGamePlayerSystemFocusMode(value) {
474
+ return isMember(value, AI_GAME_PLAYER_SYSTEM_FOCUS_MODES);
475
+ }
476
+ function isAiGamePlayerSystemInputModality(value) {
477
+ return isMember(value, AI_GAME_PLAYER_SYSTEM_INPUT_MODALITIES);
478
+ }
479
+ function isAiGamePlayerSystemModule(value) {
480
+ return isMember(value, AI_GAME_PLAYER_SYSTEM_MODULES);
481
+ }
482
+ function isAiGamePlayerSystemAlertPriority(value) {
483
+ return isMember(value, AI_GAME_PLAYER_SYSTEM_ALERT_PRIORITIES);
484
+ }
485
+ function isAiGamePlayerSystemPreferenceKind(value) {
486
+ return isMember(value, AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS);
487
+ }
488
+ function isAiGamePlayerSystemPreferenceSource(value) {
489
+ return isMember(value, AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES);
490
+ }
491
+ function isAiGamePlayerSystemConfidenceBand(value) {
492
+ return isMember(value, AI_GAME_PLAYER_SYSTEM_CONFIDENCE_BANDS);
493
+ }
494
+ function getAiGamePlayerSystemFocusModeContract(mode) {
495
+ return DEFAULT_FOCUS_MODE_CONTRACTS[mode];
496
+ }
497
+ function getAiGamePlayerSystemModuleContract(module2) {
498
+ return DEFAULT_MODULE_CONTRACTS[module2];
499
+ }
500
+ function isAiGamePlayerSystemAlertDeliverable(alert, mode) {
501
+ return getAiGamePlayerSystemFocusModeContract(mode).deliverableAlertPriorities.includes(
502
+ alert.priority
503
+ );
504
+ }
505
+ function selectAiGamePlayerSystemAlertsForFocusMode(alerts, mode) {
506
+ return freezeReadonlyArray2(
507
+ alerts.filter((alert) => isAiGamePlayerSystemAlertDeliverable(alert, mode))
508
+ );
509
+ }
510
+ function createAiGamePlayerSystemAlert(input) {
511
+ assertNonEmptyString2(input.alertId, "alertId");
512
+ assertNonEmptyString2(input.title, "title");
513
+ assertNonEmptyString2(input.message, "message");
514
+ assertIsoTimestamp(input.createdAtIso, "createdAtIso");
515
+ assertContractVersion(input.contractVersion ?? AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION);
516
+ if (!isAiGamePlayerSystemAlertPriority(input.priority)) {
517
+ throw new Error("priority must be a supported Player System alert priority");
518
+ }
519
+ if (!isAiGamePlayerSystemModule(input.sourceModule)) {
520
+ throw new Error("sourceModule must be a supported Player System module");
521
+ }
522
+ return Object.freeze({
523
+ ...input,
524
+ contractVersion: input.contractVersion ?? AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION
525
+ });
526
+ }
527
+ function resolveAiGamePlayerSystemConfidenceBand(confidenceScore) {
528
+ assertConfidenceScore(confidenceScore);
529
+ if (confidenceScore >= 0.67) {
530
+ return "high";
531
+ }
532
+ if (confidenceScore >= 0.34) {
533
+ return "medium";
534
+ }
535
+ return "low";
536
+ }
537
+ function createAiGamePlayerSystemPreferenceInput(input) {
538
+ assertNonEmptyString2(input.inputId, "inputId");
539
+ assertIsoTimestamp(input.capturedAtIso, "capturedAtIso");
540
+ assertConfidenceScore(input.confidenceScore);
541
+ if (!isAiGamePlayerSystemPreferenceKind(input.kind)) {
542
+ throw new Error("kind must be a supported Player System preference kind");
543
+ }
544
+ if (!isAiGamePlayerSystemPreferenceSource(input.source)) {
545
+ throw new Error("source must be a supported Player System preference source");
546
+ }
547
+ return Object.freeze({
548
+ ...input,
549
+ reasonCodes: freezeReadonlyArray2(input.reasonCodes ?? [])
550
+ });
551
+ }
552
+ function createAiGamePlayerSystemPreferenceConfidenceState(input) {
553
+ assertConfidenceScore(input.confidenceScore);
554
+ assertNonNegativeInteger(input.sampleCount, "sampleCount");
555
+ assertIsoTimestamp(input.lastUpdatedAtIso, "lastUpdatedAtIso");
556
+ const confidenceBand = resolveAiGamePlayerSystemConfidenceBand(
557
+ input.confidenceScore
558
+ );
559
+ if (input.confidenceBand !== void 0 && input.confidenceBand !== confidenceBand) {
560
+ throw new Error("confidenceBand must match confidenceScore");
561
+ }
562
+ return Object.freeze({
563
+ confidenceScore: input.confidenceScore,
564
+ confidenceBand,
565
+ sampleCount: input.sampleCount,
566
+ lastUpdatedAtIso: input.lastUpdatedAtIso
567
+ });
568
+ }
569
+ function createAiGamePlayerSystemPreferenceProfile(input) {
570
+ assertNonEmptyString2(input.profileId, "profileId");
571
+ const inputs = (input.inputs ?? []).map(
572
+ (preferenceInput) => createAiGamePlayerSystemPreferenceInput(preferenceInput)
573
+ );
574
+ const lastUpdatedAtIso = input.confidence?.lastUpdatedAtIso ?? (/* @__PURE__ */ new Date(0)).toISOString();
575
+ const confidenceScore = input.confidence?.confidenceScore ?? (inputs.length === 0 ? 0 : inputs.reduce((total, preferenceInput) => total + preferenceInput.confidenceScore, 0) / inputs.length);
576
+ const confidence = createAiGamePlayerSystemPreferenceConfidenceState({
577
+ confidenceScore,
578
+ sampleCount: input.confidence?.sampleCount ?? inputs.length,
579
+ lastUpdatedAtIso,
580
+ confidenceBand: input.confidence?.confidenceBand
581
+ });
582
+ return Object.freeze({
583
+ profileId: input.profileId,
584
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
585
+ inputs: freezeReadonlyArray2(inputs),
586
+ confidence
587
+ });
588
+ }
589
+ function createAiGamePlayerSystemSession(input) {
590
+ assertNonEmptyString2(input.sessionId, "sessionId");
591
+ if (!isAiGamePlayerSystemFocusMode(input.focusMode)) {
592
+ throw new Error("focusMode must be a supported Player System focus mode");
593
+ }
594
+ if (input.activeModule !== null && input.activeModule !== void 0 && !isAiGamePlayerSystemModule(input.activeModule)) {
595
+ throw new Error("activeModule must be a supported Player System module");
596
+ }
597
+ const modeContract = getAiGamePlayerSystemFocusModeContract(input.focusMode);
598
+ const modules = freezeReadonlyArray2(
599
+ (input.modules ?? DEFAULT_SESSION_MODULES).map(
600
+ (moduleContract) => Object.freeze({
601
+ ...moduleContract,
602
+ supportedInputModalities: freezeReadonlyArray2(
603
+ moduleContract.supportedInputModalities
604
+ )
605
+ })
606
+ )
607
+ );
608
+ const acceptedInputModalities = freezeReadonlyArray2(
609
+ input.acceptedInputModalities ?? modeContract.acceptsInputModalities
610
+ );
611
+ const pendingAlerts = freezeReadonlyArray2(
612
+ (input.pendingAlerts ?? []).map((alert) => createAiGamePlayerSystemAlert(alert))
613
+ );
614
+ if (modules.length > modeContract.maximumVisibleModules) {
615
+ throw new Error("modules exceed the focus mode visibility limit");
616
+ }
617
+ for (const modality of acceptedInputModalities) {
618
+ if (!isAiGamePlayerSystemInputModality(modality)) {
619
+ throw new Error("acceptedInputModalities contains an unsupported modality");
620
+ }
621
+ }
622
+ if (input.focusMode === "focused" && (!acceptedInputModalities.includes("voice") || !acceptedInputModalities.includes("touch"))) {
623
+ throw new Error("focused sessions must accept both voice and touch input");
624
+ }
625
+ for (const moduleContract of modules) {
626
+ assertContractVersion(moduleContract.contractVersion, "module contractVersion");
627
+ if (!isAiGamePlayerSystemModule(moduleContract.module)) {
628
+ throw new Error("modules contains an unsupported Player System module");
629
+ }
630
+ for (const modality of moduleContract.supportedInputModalities) {
631
+ if (!isAiGamePlayerSystemInputModality(modality)) {
632
+ throw new Error("modules contains an unsupported input modality");
633
+ }
634
+ }
635
+ if (input.focusMode === "combat-safe" && !moduleContract.availableInCombatSafeMode) {
636
+ throw new Error("combat-safe sessions cannot expose unsafe modules");
637
+ }
638
+ }
639
+ if (input.activeModule !== null && input.activeModule !== void 0 && !modules.some((moduleContract) => moduleContract.module === input.activeModule)) {
640
+ throw new Error("activeModule must be included in modules");
641
+ }
642
+ return Object.freeze({
643
+ sessionId: input.sessionId,
644
+ contractVersion: AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
645
+ featureFlagId: AI_GAME_PLAYER_SYSTEM_FEATURE_FLAG_ID,
646
+ focusMode: input.focusMode,
647
+ activeModule: input.activeModule ?? null,
648
+ modules,
649
+ acceptedInputModalities,
650
+ pendingAlerts,
651
+ preferenceProfile: createAiGamePlayerSystemPreferenceProfile({
652
+ profileId: input.preferenceProfile.profileId,
653
+ inputs: input.preferenceProfile.inputs,
654
+ confidence: input.preferenceProfile.confidence
655
+ })
656
+ });
657
+ }
658
+
246
659
  // src/world-events.ts
247
660
  function isCanonicalWorldEvent(event) {
248
661
  return event.recordType === "canonical";
@@ -394,7 +807,7 @@ var QUIET_MEASURE_JUDGMENT_MISSING_EVIDENCE = [
394
807
  "private-or-low-witness-evidence",
395
808
  "costly-pressure-event"
396
809
  ];
397
- function isMember(value, members) {
810
+ function isMember2(value, members) {
398
811
  return members.includes(value);
399
812
  }
400
813
  function assertRecord(value, label) {
@@ -435,7 +848,7 @@ function normalizeTimestamp(value, label) {
435
848
  }
436
849
  function normalizeMember(value, members, label) {
437
850
  const normalized = normalizeNonEmptyString(value, label);
438
- if (!isMember(normalized, members)) {
851
+ if (!isMember2(normalized, members)) {
439
852
  throw new TypeError(`${label} must be one of: ${members.join(", ")}.`);
440
853
  }
441
854
  return normalized;
@@ -568,13 +981,13 @@ function normalizeDominantReads(value) {
568
981
  return Object.freeze(value.map((entry, index) => normalizeDerivedReadSummary(entry, index)));
569
982
  }
570
983
  function isQuietMeasureAxis(value) {
571
- return isMember(value, QUIET_MEASURE_AXES);
984
+ return isMember2(value, QUIET_MEASURE_AXES);
572
985
  }
573
986
  function isQuietMeasureMissionProbeMode(value) {
574
- return isMember(value, QUIET_MEASURE_MISSION_PROBE_MODES);
987
+ return isMember2(value, QUIET_MEASURE_MISSION_PROBE_MODES);
575
988
  }
576
989
  function isQuietMeasureMissionResolutionShape(value) {
577
- return isMember(value, QUIET_MEASURE_MISSION_RESOLUTION_SHAPES);
990
+ return isMember2(value, QUIET_MEASURE_MISSION_RESOLUTION_SHAPES);
578
991
  }
579
992
  function createQuietMeasureJudgmentEligibility(input = {}) {
580
993
  const repeatedMeaningfulEvidence = normalizeOptionalBoolean(
@@ -1083,22 +1496,38 @@ var gameEventFeatureFlags = Object.freeze([
1083
1496
  AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID,
1084
1497
  AI_GAME_PACKAGE,
1085
1498
  AI_GAME_PERSPECTIVE_FEATURE_FLAG_ID,
1499
+ AI_GAME_PLAYER_SYSTEM_ALERT_PRIORITIES,
1500
+ AI_GAME_PLAYER_SYSTEM_CONFIDENCE_BANDS,
1501
+ AI_GAME_PLAYER_SYSTEM_CONTRACT_VERSION,
1502
+ AI_GAME_PLAYER_SYSTEM_FEATURE_FLAG_ID,
1503
+ AI_GAME_PLAYER_SYSTEM_FOCUS_MODES,
1504
+ AI_GAME_PLAYER_SYSTEM_FOCUS_MODE_CONTRACTS,
1505
+ AI_GAME_PLAYER_SYSTEM_INPUT_MODALITIES,
1506
+ AI_GAME_PLAYER_SYSTEM_MODULES,
1507
+ AI_GAME_PLAYER_SYSTEM_MODULE_CONTRACTS,
1508
+ AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS,
1509
+ AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES,
1086
1510
  AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID,
1087
1511
  AI_GAME_TASK_AUTHORITY_BOUNDARIES,
1088
1512
  AI_GAME_TASK_DECISIONS,
1089
1513
  AI_GAME_TASK_KINDS,
1090
1514
  AI_GAME_TASK_RESULTS,
1091
1515
  AI_GAME_TASK_RISK_CLASSES,
1516
+ AI_GAME_TRAINING_ACADEMIC_PROGRESS_STAGES,
1517
+ AI_GAME_TRAINING_ACADEMIES_FEATURE_FLAG_ID,
1518
+ AI_GAME_TRAINING_ACADEMY_ADMISSION_DECISIONS,
1092
1519
  AI_GAME_TRAINING_ANTI_SPELL_COUNTER_WINDOWS,
1093
1520
  AI_GAME_TRAINING_ANTI_SPELL_FIELDCRAFT_FAMILIES,
1094
1521
  AI_GAME_TRAINING_BARRACKS_DRILL_DELIVERY_MODES,
1095
1522
  AI_GAME_TRAINING_INSTITUTIONS_FEATURE_FLAG_ID,
1523
+ AI_GAME_TRAINING_INSTRUCTION_ACCESS_LEVELS,
1096
1524
  AI_GAME_TRAINING_MARTIAL_FEATURE_FLAG_ID,
1097
1525
  AI_GAME_TRAINING_MARTIAL_TECHNIQUE_FAMILIES,
1098
1526
  AI_GAME_TRAINING_MARTIAL_TECHNIQUE_TRACKS,
1099
1527
  AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS,
1100
1528
  AI_GAME_TRAINING_RECOMMENDATION_READINESS,
1101
1529
  AI_GAME_TRAINING_STAGE_GATES,
1530
+ AI_GAME_TRAINING_TECHNIQUE_MASTERY_STATES,
1102
1531
  AI_GAME_TRAINING_TRUST_MARKER_SOURCES,
1103
1532
  AI_GAME_TTS_CACHE_POLICIES,
1104
1533
  QUIET_MEASURE_AXES,
@@ -1114,22 +1543,46 @@ var gameEventFeatureFlags = Object.freeze([
1114
1543
  QUIET_MEASURE_SIGNAL_BANDS,
1115
1544
  aiGameFeatureFlags,
1116
1545
  classifyAiGameTask,
1546
+ createAiGameAcademicTrainingSnapshot,
1117
1547
  createAiGameInstitutionEligibility,
1118
1548
  createAiGameMartialTrainingSnapshot,
1549
+ createAiGamePlayerSystemAlert,
1550
+ createAiGamePlayerSystemPreferenceConfidenceState,
1551
+ createAiGamePlayerSystemPreferenceInput,
1552
+ createAiGamePlayerSystemPreferenceProfile,
1553
+ createAiGamePlayerSystemSession,
1119
1554
  createAiGameSpecializationRecommendation,
1555
+ createAiGameTrainingAcademicMissionPrerequisite,
1556
+ createAiGameTrainingAcademyAdmission,
1557
+ createAiGameTrainingSchoolProgression,
1120
1558
  createAiGameTrainingStateSnapshot,
1559
+ createAiGameTrainingTrackSelection,
1121
1560
  createAiGameTrainingTrustMarker,
1122
1561
  createQuietMeasureJudgmentEligibility,
1123
1562
  createQuietMeasureJudgmentResponse,
1124
1563
  gameEventFeatureFlags,
1564
+ getAiGamePlayerSystemFocusModeContract,
1565
+ getAiGamePlayerSystemModuleContract,
1566
+ isAiGamePlayerSystemAlertDeliverable,
1567
+ isAiGamePlayerSystemAlertPriority,
1568
+ isAiGamePlayerSystemConfidenceBand,
1569
+ isAiGamePlayerSystemFocusMode,
1570
+ isAiGamePlayerSystemInputModality,
1571
+ isAiGamePlayerSystemModule,
1572
+ isAiGamePlayerSystemPreferenceKind,
1573
+ isAiGamePlayerSystemPreferenceSource,
1574
+ isAiGameTrainingAcademicProgressStage,
1575
+ isAiGameTrainingAcademyAdmissionDecision,
1125
1576
  isAiGameTrainingAntiSpellCounterWindow,
1126
1577
  isAiGameTrainingAntiSpellFieldcraftFamily,
1127
1578
  isAiGameTrainingBarracksDrillDeliveryMode,
1579
+ isAiGameTrainingInstructionAccessLevel,
1128
1580
  isAiGameTrainingMartialTechniqueFamily,
1129
1581
  isAiGameTrainingMartialTechniqueTrack,
1130
1582
  isAiGameTrainingRecommendationConfidenceBand,
1131
1583
  isAiGameTrainingRecommendationReadiness,
1132
1584
  isAiGameTrainingStageGate,
1585
+ isAiGameTrainingTechniqueMasteryState,
1133
1586
  isAiGameTrainingTrustMarkerSource,
1134
1587
  isCandidateWorldEvent,
1135
1588
  isCanonicalWorldEvent,
@@ -1146,6 +1599,8 @@ var gameEventFeatureFlags = Object.freeze([
1146
1599
  packageDescriptor,
1147
1600
  projectTopicForAudience,
1148
1601
  resolveAiGamePlayerAddressText,
1149
- resolveAiGameTaskBatch
1602
+ resolveAiGamePlayerSystemConfidenceBand,
1603
+ resolveAiGameTaskBatch,
1604
+ selectAiGamePlayerSystemAlertsForFocusMode
1150
1605
  });
1151
1606
  //# sourceMappingURL=index.cjs.map