@plasius/ai-game 0.6.0 → 0.6.1
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/CHANGELOG.md +16 -0
- package/README.md +24 -1
- package/dist/index.cjs +383 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +140 -1
- package/dist/index.d.ts +140 -1
- package/dist/index.js +349 -5
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0015-mcc-guidance-contract-boundary.md +62 -0
- package/docs/adrs/index.md +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,21 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
|
|
|
17
17
|
- **Security**
|
|
18
18
|
- (placeholder)
|
|
19
19
|
|
|
20
|
+
## [0.6.1] - 2026-07-11
|
|
21
|
+
|
|
22
|
+
- **Added**
|
|
23
|
+
- Added bounded MCC focus-target, readiness-warning, spellcraft recommendation, and preview-only advisory contracts under `isekai.player-system.mcc-guidance.enabled`.
|
|
24
|
+
- Added immutable guidance snapshot factories with reference, severity, and collection-bound validation.
|
|
25
|
+
|
|
26
|
+
- **Changed**
|
|
27
|
+
- (placeholder)
|
|
28
|
+
|
|
29
|
+
- **Fixed**
|
|
30
|
+
- (placeholder)
|
|
31
|
+
|
|
32
|
+
- **Security**
|
|
33
|
+
- (placeholder)
|
|
34
|
+
|
|
20
35
|
## [0.6.0] - 2026-07-11
|
|
21
36
|
|
|
22
37
|
- **Added**
|
|
@@ -230,3 +245,4 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
|
|
|
230
245
|
[0.4.0]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.4.0
|
|
231
246
|
[0.5.0]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.5.0
|
|
232
247
|
[0.6.0]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.6.0
|
|
248
|
+
[0.6.1]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.6.1
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @plasius/ai-game
|
|
2
2
|
|
|
3
|
-
Game-domain AI contracts for player action validation, adaptive System missions, NPC actions, gossip, observed event logs, Quiet Measure mission probes, Judgment disclosure surfaces, and Player System-readable training recommendations.
|
|
3
|
+
Game-domain AI contracts for player action validation, adaptive System missions, NPC actions, gossip, observed event logs, Quiet Measure mission probes, Judgment disclosure surfaces, MCC guidance, and Player System-readable training recommendations.
|
|
4
4
|
|
|
5
5
|
## Scope
|
|
6
6
|
|
|
@@ -128,6 +128,28 @@ Use `createAiGameMissionDefinition()`,
|
|
|
128
128
|
surface intentionally avoids raw telemetry, progression writes, and
|
|
129
129
|
authority-owned tuning data.
|
|
130
130
|
|
|
131
|
+
## MCC guidance contracts
|
|
132
|
+
|
|
133
|
+
MCC guidance contracts provide a bounded Player System bridge under
|
|
134
|
+
`isekai.player-system.mcc-guidance.enabled`:
|
|
135
|
+
|
|
136
|
+
- `AiGameMccFocusTarget` carries a declared `internalized`, `externalized`, or
|
|
137
|
+
`hybrid` growth direction with bounded mission influence.
|
|
138
|
+
- `AiGameMccReadinessState` exposes `stable`, `pressured`, or `restricted`
|
|
139
|
+
readiness plus explicit thermal, fatigue, chaos-pressure, target-burden,
|
|
140
|
+
stage-gate, and death-impairment warnings.
|
|
141
|
+
- `AiGameSpellcraftRecommendation` describes training, material,
|
|
142
|
+
social-prerequisite, or refinement guidance without becoming an authority
|
|
143
|
+
write.
|
|
144
|
+
- `AiGameSpellcraftAdvisory` is explicitly `preview-only` and points to the
|
|
145
|
+
`spellcraft-system` as the authoritative owner for feasibility and authoring.
|
|
146
|
+
- `createAiGameMccGuidanceSnapshot()` validates references, bounds collection
|
|
147
|
+
sizes, and freezes the complete payload for transport.
|
|
148
|
+
|
|
149
|
+
The growth-direction vocabulary is validated through the published
|
|
150
|
+
`@plasius/training` authority package. MCC feasibility, spell grammar, risk
|
|
151
|
+
validation, and state mutation remain outside `@plasius/ai-game`.
|
|
152
|
+
|
|
131
153
|
## Quiet Measure contracts
|
|
132
154
|
|
|
133
155
|
The Quiet Measure surface is intentionally structured as a hidden-runtime contract, not a turnkey morality meter.
|
|
@@ -198,6 +220,7 @@ npm run pack:check
|
|
|
198
220
|
- `isekai.player-system.quiet-measure.enabled`
|
|
199
221
|
- `isekai.player-system.core.enabled`
|
|
200
222
|
- `isekai.player-system.guidance-nfr.enabled`
|
|
223
|
+
- `isekai.player-system.mcc-guidance.enabled`
|
|
201
224
|
- `isekai.player-system.identity.enabled`
|
|
202
225
|
- `isekai.player-system.logs.enabled`
|
|
203
226
|
- `isekai.training.institutions.enabled`
|
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,15 @@ __export(index_exports, {
|
|
|
37
37
|
AI_GAME_IDENTITY_TARGET_CATEGORIES: () => AI_GAME_IDENTITY_TARGET_CATEGORIES,
|
|
38
38
|
AI_GAME_IDENTITY_VISIBILITY_STATES: () => AI_GAME_IDENTITY_VISIBILITY_STATES,
|
|
39
39
|
AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID: () => AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID,
|
|
40
|
+
AI_GAME_MCC_FOCUS_PRIORITIES: () => AI_GAME_MCC_FOCUS_PRIORITIES,
|
|
41
|
+
AI_GAME_MCC_GROWTH_DIRECTIONS: () => AI_GAME_MCC_GROWTH_DIRECTIONS,
|
|
42
|
+
AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION: () => AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
43
|
+
AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID: () => AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
44
|
+
AI_GAME_MCC_GUIDANCE_MAX_FOCUS_TARGETS: () => AI_GAME_MCC_GUIDANCE_MAX_FOCUS_TARGETS,
|
|
45
|
+
AI_GAME_MCC_GUIDANCE_MAX_RECOMMENDATIONS: () => AI_GAME_MCC_GUIDANCE_MAX_RECOMMENDATIONS,
|
|
46
|
+
AI_GAME_MCC_READINESS_BANDS: () => AI_GAME_MCC_READINESS_BANDS,
|
|
47
|
+
AI_GAME_MCC_WARNING_KINDS: () => AI_GAME_MCC_WARNING_KINDS,
|
|
48
|
+
AI_GAME_MCC_WARNING_STATES: () => AI_GAME_MCC_WARNING_STATES,
|
|
40
49
|
AI_GAME_MISSIONS_CONTRACT_VERSION: () => AI_GAME_MISSIONS_CONTRACT_VERSION,
|
|
41
50
|
AI_GAME_MISSIONS_FEATURE_FLAG_ID: () => AI_GAME_MISSIONS_FEATURE_FLAG_ID,
|
|
42
51
|
AI_GAME_MISSION_CLASSES: () => AI_GAME_MISSION_CLASSES,
|
|
@@ -81,6 +90,14 @@ __export(index_exports, {
|
|
|
81
90
|
AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS: () => AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS,
|
|
82
91
|
AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES: () => AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES,
|
|
83
92
|
AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID: () => AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID,
|
|
93
|
+
AI_GAME_SPELLCRAFT_AUTHORITATIVE_OWNER: () => AI_GAME_SPELLCRAFT_AUTHORITATIVE_OWNER,
|
|
94
|
+
AI_GAME_SPELLCRAFT_CHAOS_PRESSURES: () => AI_GAME_SPELLCRAFT_CHAOS_PRESSURES,
|
|
95
|
+
AI_GAME_SPELLCRAFT_COMMITMENT: () => AI_GAME_SPELLCRAFT_COMMITMENT,
|
|
96
|
+
AI_GAME_SPELLCRAFT_COMPLEXITIES: () => AI_GAME_SPELLCRAFT_COMPLEXITIES,
|
|
97
|
+
AI_GAME_SPELLCRAFT_FATIGUE_STATES: () => AI_GAME_SPELLCRAFT_FATIGUE_STATES,
|
|
98
|
+
AI_GAME_SPELLCRAFT_RECOMMENDATION_KINDS: () => AI_GAME_SPELLCRAFT_RECOMMENDATION_KINDS,
|
|
99
|
+
AI_GAME_SPELLCRAFT_TARGET_MODES: () => AI_GAME_SPELLCRAFT_TARGET_MODES,
|
|
100
|
+
AI_GAME_SPELLCRAFT_VERDICTS: () => AI_GAME_SPELLCRAFT_VERDICTS,
|
|
84
101
|
AI_GAME_TASK_AUTHORITY_BOUNDARIES: () => AI_GAME_TASK_AUTHORITY_BOUNDARIES,
|
|
85
102
|
AI_GAME_TASK_DECISIONS: () => AI_GAME_TASK_DECISIONS,
|
|
86
103
|
AI_GAME_TASK_KINDS: () => AI_GAME_TASK_KINDS,
|
|
@@ -126,6 +143,10 @@ __export(index_exports, {
|
|
|
126
143
|
createAiGameIdentityTargetProjection: () => createAiGameIdentityTargetProjection,
|
|
127
144
|
createAiGameInstitutionEligibility: () => createAiGameInstitutionEligibility,
|
|
128
145
|
createAiGameMartialTrainingSnapshot: () => createAiGameMartialTrainingSnapshot,
|
|
146
|
+
createAiGameMccFocusTarget: () => createAiGameMccFocusTarget,
|
|
147
|
+
createAiGameMccGuidanceSnapshot: () => createAiGameMccGuidanceSnapshot,
|
|
148
|
+
createAiGameMccReadinessState: () => createAiGameMccReadinessState,
|
|
149
|
+
createAiGameMccWarning: () => createAiGameMccWarning,
|
|
129
150
|
createAiGameMissionDefinition: () => createAiGameMissionDefinition,
|
|
130
151
|
createAiGameMissionMccFocusInfluence: () => createAiGameMissionMccFocusInfluence,
|
|
131
152
|
createAiGameMissionObjectiveState: () => createAiGameMissionObjectiveState,
|
|
@@ -146,6 +167,8 @@ __export(index_exports, {
|
|
|
146
167
|
createAiGamePlayerSystemPreferenceProfile: () => createAiGamePlayerSystemPreferenceProfile,
|
|
147
168
|
createAiGamePlayerSystemSession: () => createAiGamePlayerSystemSession,
|
|
148
169
|
createAiGameSpecializationRecommendation: () => createAiGameSpecializationRecommendation,
|
|
170
|
+
createAiGameSpellcraftAdvisory: () => createAiGameSpellcraftAdvisory,
|
|
171
|
+
createAiGameSpellcraftRecommendation: () => createAiGameSpellcraftRecommendation,
|
|
149
172
|
createAiGameTrainingAcademicMissionPrerequisite: () => import_training.createTrainingAcademicMissionPrerequisite,
|
|
150
173
|
createAiGameTrainingAcademyAdmission: () => import_training.createTrainingAcademyAdmission,
|
|
151
174
|
createAiGameTrainingSchoolProgression: () => import_training.createTrainingSchoolProgression,
|
|
@@ -163,6 +186,11 @@ __export(index_exports, {
|
|
|
163
186
|
isAiGameIdentityProjectionRead: () => isAiGameIdentityProjectionRead,
|
|
164
187
|
isAiGameIdentityTargetCategory: () => isAiGameIdentityTargetCategory,
|
|
165
188
|
isAiGameIdentityVisibilityState: () => isAiGameIdentityVisibilityState,
|
|
189
|
+
isAiGameMccFocusPriority: () => isAiGameMccFocusPriority,
|
|
190
|
+
isAiGameMccGrowthDirection: () => isAiGameMccGrowthDirection,
|
|
191
|
+
isAiGameMccReadinessBand: () => isAiGameMccReadinessBand,
|
|
192
|
+
isAiGameMccWarningKind: () => isAiGameMccWarningKind,
|
|
193
|
+
isAiGameMccWarningState: () => isAiGameMccWarningState,
|
|
166
194
|
isAiGameMissionClass: () => isAiGameMissionClass,
|
|
167
195
|
isAiGameMissionConfidenceBand: () => isAiGameMissionConfidenceBand,
|
|
168
196
|
isAiGameMissionFeedbackChannel: () => isAiGameMissionFeedbackChannel,
|
|
@@ -189,6 +217,12 @@ __export(index_exports, {
|
|
|
189
217
|
isAiGamePlayerSystemModule: () => isAiGamePlayerSystemModule,
|
|
190
218
|
isAiGamePlayerSystemPreferenceKind: () => isAiGamePlayerSystemPreferenceKind,
|
|
191
219
|
isAiGamePlayerSystemPreferenceSource: () => isAiGamePlayerSystemPreferenceSource,
|
|
220
|
+
isAiGameSpellcraftChaosPressure: () => isAiGameSpellcraftChaosPressure,
|
|
221
|
+
isAiGameSpellcraftComplexity: () => isAiGameSpellcraftComplexity,
|
|
222
|
+
isAiGameSpellcraftFatigueState: () => isAiGameSpellcraftFatigueState,
|
|
223
|
+
isAiGameSpellcraftRecommendationKind: () => isAiGameSpellcraftRecommendationKind,
|
|
224
|
+
isAiGameSpellcraftTargetMode: () => isAiGameSpellcraftTargetMode,
|
|
225
|
+
isAiGameSpellcraftVerdict: () => isAiGameSpellcraftVerdict,
|
|
192
226
|
isAiGameTrainingAcademicProgressStage: () => import_training.isTrainingAcademicProgressStage,
|
|
193
227
|
isAiGameTrainingAcademyAdmissionDecision: () => import_training.isTrainingAcademyAdmissionDecision,
|
|
194
228
|
isAiGameTrainingAntiSpellCounterWindow: () => import_training.isTrainingAntiSpellCounterWindow,
|
|
@@ -1690,6 +1724,316 @@ function assertAiGameObservedEventLogContractVersion(value) {
|
|
|
1690
1724
|
assertContractVersion4(value);
|
|
1691
1725
|
}
|
|
1692
1726
|
|
|
1727
|
+
// src/mcc-guidance.ts
|
|
1728
|
+
var AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID = "isekai.player-system.mcc-guidance.enabled";
|
|
1729
|
+
var AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION = "1.0";
|
|
1730
|
+
var AI_GAME_MCC_GROWTH_DIRECTIONS = [
|
|
1731
|
+
"internalized",
|
|
1732
|
+
"externalized",
|
|
1733
|
+
"hybrid"
|
|
1734
|
+
];
|
|
1735
|
+
var AI_GAME_MCC_FOCUS_PRIORITIES = ["primary", "secondary"];
|
|
1736
|
+
var AI_GAME_MCC_READINESS_BANDS = [
|
|
1737
|
+
"stable",
|
|
1738
|
+
"pressured",
|
|
1739
|
+
"restricted"
|
|
1740
|
+
];
|
|
1741
|
+
var AI_GAME_MCC_WARNING_STATES = [
|
|
1742
|
+
"clear",
|
|
1743
|
+
"advisory",
|
|
1744
|
+
"elevated",
|
|
1745
|
+
"critical"
|
|
1746
|
+
];
|
|
1747
|
+
var AI_GAME_MCC_WARNING_KINDS = [
|
|
1748
|
+
"thermal",
|
|
1749
|
+
"fatigue",
|
|
1750
|
+
"chaos-pressure",
|
|
1751
|
+
"target-burden",
|
|
1752
|
+
"stage-gate",
|
|
1753
|
+
"death-impairment"
|
|
1754
|
+
];
|
|
1755
|
+
var AI_GAME_SPELLCRAFT_RECOMMENDATION_KINDS = [
|
|
1756
|
+
"training",
|
|
1757
|
+
"material",
|
|
1758
|
+
"social-prerequisite",
|
|
1759
|
+
"refinement"
|
|
1760
|
+
];
|
|
1761
|
+
var AI_GAME_SPELLCRAFT_VERDICTS = [
|
|
1762
|
+
"recommended",
|
|
1763
|
+
"conditional",
|
|
1764
|
+
"blocked"
|
|
1765
|
+
];
|
|
1766
|
+
var AI_GAME_SPELLCRAFT_TARGET_MODES = [
|
|
1767
|
+
"self",
|
|
1768
|
+
"single-target",
|
|
1769
|
+
"area"
|
|
1770
|
+
];
|
|
1771
|
+
var AI_GAME_SPELLCRAFT_COMPLEXITIES = ["low", "medium", "high"];
|
|
1772
|
+
var AI_GAME_SPELLCRAFT_CHAOS_PRESSURES = [
|
|
1773
|
+
"low",
|
|
1774
|
+
"elevated",
|
|
1775
|
+
"volatile"
|
|
1776
|
+
];
|
|
1777
|
+
var AI_GAME_SPELLCRAFT_FATIGUE_STATES = [
|
|
1778
|
+
"steady",
|
|
1779
|
+
"strained",
|
|
1780
|
+
"exhausted"
|
|
1781
|
+
];
|
|
1782
|
+
var AI_GAME_SPELLCRAFT_COMMITMENT = "preview-only";
|
|
1783
|
+
var AI_GAME_SPELLCRAFT_AUTHORITATIVE_OWNER = "spellcraft-system";
|
|
1784
|
+
var AI_GAME_MCC_GUIDANCE_MAX_FOCUS_TARGETS = 3;
|
|
1785
|
+
var AI_GAME_MCC_GUIDANCE_MAX_RECOMMENDATIONS = 5;
|
|
1786
|
+
function freezeReadonlyArray6(items) {
|
|
1787
|
+
return Object.freeze([...items]);
|
|
1788
|
+
}
|
|
1789
|
+
function createStringArray3(values, label) {
|
|
1790
|
+
const normalized = values ?? [];
|
|
1791
|
+
normalized.forEach((value) => assertNonEmptyString6(value, `${label} entry`));
|
|
1792
|
+
return freezeReadonlyArray6(normalized);
|
|
1793
|
+
}
|
|
1794
|
+
function assertNonEmptyString6(value, label) {
|
|
1795
|
+
if (value.trim().length === 0) {
|
|
1796
|
+
throw new Error(`${label} must be a non-empty string`);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
function assertContractVersion5(value, label = "contractVersion") {
|
|
1800
|
+
if (value !== AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION) {
|
|
1801
|
+
throw new Error(`${label} must be ${AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION}`);
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
function assertBoundedFraction(value, label) {
|
|
1805
|
+
if (!Number.isFinite(value) || value < 0 || value > 1) {
|
|
1806
|
+
throw new Error(`${label} must be between 0 and 1`);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
function isMember5(value, members) {
|
|
1810
|
+
return members.includes(value);
|
|
1811
|
+
}
|
|
1812
|
+
function getWarningStateRank(state) {
|
|
1813
|
+
return AI_GAME_MCC_WARNING_STATES.indexOf(state);
|
|
1814
|
+
}
|
|
1815
|
+
function resolveWarningState(warnings) {
|
|
1816
|
+
return warnings.reduce(
|
|
1817
|
+
(mostSevere, warning) => getWarningStateRank(warning.state) > getWarningStateRank(mostSevere) ? warning.state : mostSevere,
|
|
1818
|
+
"clear"
|
|
1819
|
+
);
|
|
1820
|
+
}
|
|
1821
|
+
function isAiGameMccGrowthDirection(value) {
|
|
1822
|
+
return (0, import_training.isMccExpressionTrack)(value);
|
|
1823
|
+
}
|
|
1824
|
+
function isAiGameMccFocusPriority(value) {
|
|
1825
|
+
return isMember5(value, AI_GAME_MCC_FOCUS_PRIORITIES);
|
|
1826
|
+
}
|
|
1827
|
+
function isAiGameMccReadinessBand(value) {
|
|
1828
|
+
return isMember5(value, AI_GAME_MCC_READINESS_BANDS);
|
|
1829
|
+
}
|
|
1830
|
+
function isAiGameMccWarningState(value) {
|
|
1831
|
+
return isMember5(value, AI_GAME_MCC_WARNING_STATES);
|
|
1832
|
+
}
|
|
1833
|
+
function isAiGameMccWarningKind(value) {
|
|
1834
|
+
return isMember5(value, AI_GAME_MCC_WARNING_KINDS);
|
|
1835
|
+
}
|
|
1836
|
+
function isAiGameSpellcraftRecommendationKind(value) {
|
|
1837
|
+
return isMember5(value, AI_GAME_SPELLCRAFT_RECOMMENDATION_KINDS);
|
|
1838
|
+
}
|
|
1839
|
+
function isAiGameSpellcraftVerdict(value) {
|
|
1840
|
+
return isMember5(value, AI_GAME_SPELLCRAFT_VERDICTS);
|
|
1841
|
+
}
|
|
1842
|
+
function isAiGameSpellcraftTargetMode(value) {
|
|
1843
|
+
return isMember5(value, AI_GAME_SPELLCRAFT_TARGET_MODES);
|
|
1844
|
+
}
|
|
1845
|
+
function isAiGameSpellcraftComplexity(value) {
|
|
1846
|
+
return isMember5(value, AI_GAME_SPELLCRAFT_COMPLEXITIES);
|
|
1847
|
+
}
|
|
1848
|
+
function isAiGameSpellcraftChaosPressure(value) {
|
|
1849
|
+
return isMember5(value, AI_GAME_SPELLCRAFT_CHAOS_PRESSURES);
|
|
1850
|
+
}
|
|
1851
|
+
function isAiGameSpellcraftFatigueState(value) {
|
|
1852
|
+
return isMember5(value, AI_GAME_SPELLCRAFT_FATIGUE_STATES);
|
|
1853
|
+
}
|
|
1854
|
+
function createAiGameMccFocusTarget(input) {
|
|
1855
|
+
assertNonEmptyString6(input.targetId, "targetId");
|
|
1856
|
+
assertContractVersion5(input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION);
|
|
1857
|
+
if (!isAiGameMccGrowthDirection(input.growthDirection)) {
|
|
1858
|
+
throw new Error("growthDirection must be a supported MCC growth direction");
|
|
1859
|
+
}
|
|
1860
|
+
if (!isAiGameMccFocusPriority(input.priority)) {
|
|
1861
|
+
throw new Error("priority must be a supported MCC focus priority");
|
|
1862
|
+
}
|
|
1863
|
+
assertNonEmptyString6(input.label, "label");
|
|
1864
|
+
assertNonEmptyString6(input.summary, "summary");
|
|
1865
|
+
assertBoundedFraction(input.influenceWeight, "influenceWeight");
|
|
1866
|
+
return Object.freeze({
|
|
1867
|
+
contractVersion: input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
1868
|
+
featureFlagId: AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
1869
|
+
targetId: input.targetId,
|
|
1870
|
+
growthDirection: input.growthDirection,
|
|
1871
|
+
label: input.label,
|
|
1872
|
+
summary: input.summary,
|
|
1873
|
+
priority: input.priority,
|
|
1874
|
+
influenceWeight: input.influenceWeight,
|
|
1875
|
+
reasonCodes: createStringArray3(input.reasonCodes, "reasonCodes")
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
function createAiGameMccWarning(input) {
|
|
1879
|
+
assertNonEmptyString6(input.warningId, "warningId");
|
|
1880
|
+
assertContractVersion5(input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION);
|
|
1881
|
+
if (!isAiGameMccWarningKind(input.kind)) {
|
|
1882
|
+
throw new Error("kind must be a supported MCC warning kind");
|
|
1883
|
+
}
|
|
1884
|
+
if (!isAiGameMccWarningState(input.state) || input.state === "clear") {
|
|
1885
|
+
throw new Error("state must be an active MCC warning state");
|
|
1886
|
+
}
|
|
1887
|
+
assertNonEmptyString6(input.summary, "summary");
|
|
1888
|
+
return Object.freeze({
|
|
1889
|
+
contractVersion: input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
1890
|
+
featureFlagId: AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
1891
|
+
warningId: input.warningId,
|
|
1892
|
+
kind: input.kind,
|
|
1893
|
+
state: input.state,
|
|
1894
|
+
summary: input.summary,
|
|
1895
|
+
reasonCodes: createStringArray3(input.reasonCodes, "reasonCodes")
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
function createAiGameMccReadinessState(input) {
|
|
1899
|
+
assertNonEmptyString6(input.readinessId, "readinessId");
|
|
1900
|
+
assertContractVersion5(input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION);
|
|
1901
|
+
if (!isAiGameMccReadinessBand(input.band)) {
|
|
1902
|
+
throw new Error("band must be a supported MCC readiness band");
|
|
1903
|
+
}
|
|
1904
|
+
const warnings = freezeReadonlyArray6(
|
|
1905
|
+
input.warnings.map((warning) => createAiGameMccWarning(warning))
|
|
1906
|
+
);
|
|
1907
|
+
const derivedWarningState = resolveWarningState(warnings);
|
|
1908
|
+
const warningState = input.warningState ?? derivedWarningState;
|
|
1909
|
+
if (!isAiGameMccWarningState(warningState)) {
|
|
1910
|
+
throw new Error("warningState must be a supported MCC warning state");
|
|
1911
|
+
}
|
|
1912
|
+
if (warningState !== derivedWarningState) {
|
|
1913
|
+
throw new Error("warningState must match the most severe warning");
|
|
1914
|
+
}
|
|
1915
|
+
return Object.freeze({
|
|
1916
|
+
contractVersion: input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
1917
|
+
featureFlagId: AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
1918
|
+
readinessId: input.readinessId,
|
|
1919
|
+
band: input.band,
|
|
1920
|
+
warningState,
|
|
1921
|
+
warnings,
|
|
1922
|
+
reasonCodes: createStringArray3(input.reasonCodes, "reasonCodes")
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
function createAiGameSpellcraftRecommendation(input) {
|
|
1926
|
+
assertNonEmptyString6(input.recommendationId, "recommendationId");
|
|
1927
|
+
assertNonEmptyString6(input.focusTargetId, "focusTargetId");
|
|
1928
|
+
assertContractVersion5(input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION);
|
|
1929
|
+
if (!isAiGameSpellcraftRecommendationKind(input.kind)) {
|
|
1930
|
+
throw new Error("kind must be a supported spellcraft recommendation kind");
|
|
1931
|
+
}
|
|
1932
|
+
assertNonEmptyString6(input.title, "title");
|
|
1933
|
+
assertNonEmptyString6(input.summary, "summary");
|
|
1934
|
+
if (!isAiGameMccReadinessBand(input.readinessBand)) {
|
|
1935
|
+
throw new Error("readinessBand must be a supported MCC readiness band");
|
|
1936
|
+
}
|
|
1937
|
+
return Object.freeze({
|
|
1938
|
+
contractVersion: input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
1939
|
+
featureFlagId: AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
1940
|
+
recommendationId: input.recommendationId,
|
|
1941
|
+
kind: input.kind,
|
|
1942
|
+
focusTargetId: input.focusTargetId,
|
|
1943
|
+
title: input.title,
|
|
1944
|
+
summary: input.summary,
|
|
1945
|
+
readinessBand: input.readinessBand,
|
|
1946
|
+
prerequisiteCodes: createStringArray3(input.prerequisiteCodes, "prerequisiteCodes"),
|
|
1947
|
+
reasonCodes: createStringArray3(input.reasonCodes, "reasonCodes")
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
function createAiGameSpellcraftAdvisory(input) {
|
|
1951
|
+
assertNonEmptyString6(input.advisoryId, "advisoryId");
|
|
1952
|
+
assertNonEmptyString6(input.recommendationId, "recommendationId");
|
|
1953
|
+
assertContractVersion5(input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION);
|
|
1954
|
+
if (!isAiGameSpellcraftVerdict(input.verdict)) {
|
|
1955
|
+
throw new Error("verdict must be a supported spellcraft verdict");
|
|
1956
|
+
}
|
|
1957
|
+
if (!isAiGameSpellcraftTargetMode(input.targetMode)) {
|
|
1958
|
+
throw new Error("targetMode must be a supported spellcraft target mode");
|
|
1959
|
+
}
|
|
1960
|
+
if (!isAiGameSpellcraftComplexity(input.complexity)) {
|
|
1961
|
+
throw new Error("complexity must be a supported spellcraft complexity");
|
|
1962
|
+
}
|
|
1963
|
+
if (!isAiGameSpellcraftChaosPressure(input.chaosPressure)) {
|
|
1964
|
+
throw new Error("chaosPressure must be a supported spellcraft chaos pressure");
|
|
1965
|
+
}
|
|
1966
|
+
if (!isAiGameSpellcraftFatigueState(input.fatigueState)) {
|
|
1967
|
+
throw new Error("fatigueState must be a supported spellcraft fatigue state");
|
|
1968
|
+
}
|
|
1969
|
+
if (!isAiGameMccReadinessBand(input.readinessBand)) {
|
|
1970
|
+
throw new Error("readinessBand must be a supported MCC readiness band");
|
|
1971
|
+
}
|
|
1972
|
+
assertNonEmptyString6(input.summary, "summary");
|
|
1973
|
+
return Object.freeze({
|
|
1974
|
+
contractVersion: input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
1975
|
+
featureFlagId: AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
1976
|
+
advisoryId: input.advisoryId,
|
|
1977
|
+
recommendationId: input.recommendationId,
|
|
1978
|
+
verdict: input.verdict,
|
|
1979
|
+
targetMode: input.targetMode,
|
|
1980
|
+
complexity: input.complexity,
|
|
1981
|
+
chaosPressure: input.chaosPressure,
|
|
1982
|
+
fatigueState: input.fatigueState,
|
|
1983
|
+
readinessBand: input.readinessBand,
|
|
1984
|
+
prerequisiteCodes: createStringArray3(input.prerequisiteCodes, "prerequisiteCodes"),
|
|
1985
|
+
warningCodes: createStringArray3(input.warningCodes, "warningCodes"),
|
|
1986
|
+
summary: input.summary,
|
|
1987
|
+
reasonCodes: createStringArray3(input.reasonCodes, "reasonCodes"),
|
|
1988
|
+
commitment: AI_GAME_SPELLCRAFT_COMMITMENT,
|
|
1989
|
+
authoritativeOwner: AI_GAME_SPELLCRAFT_AUTHORITATIVE_OWNER
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
function createAiGameMccGuidanceSnapshot(input) {
|
|
1993
|
+
assertNonEmptyString6(input.guidanceId, "guidanceId");
|
|
1994
|
+
assertContractVersion5(input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION);
|
|
1995
|
+
if (input.focusTargets.length === 0 || input.focusTargets.length > AI_GAME_MCC_GUIDANCE_MAX_FOCUS_TARGETS) {
|
|
1996
|
+
throw new Error(
|
|
1997
|
+
`focusTargets must contain between 1 and ${AI_GAME_MCC_GUIDANCE_MAX_FOCUS_TARGETS} targets`
|
|
1998
|
+
);
|
|
1999
|
+
}
|
|
2000
|
+
if (input.recommendations.length === 0 || input.recommendations.length > AI_GAME_MCC_GUIDANCE_MAX_RECOMMENDATIONS) {
|
|
2001
|
+
throw new Error(
|
|
2002
|
+
`recommendations must contain between 1 and ${AI_GAME_MCC_GUIDANCE_MAX_RECOMMENDATIONS} items`
|
|
2003
|
+
);
|
|
2004
|
+
}
|
|
2005
|
+
const focusTargets = freezeReadonlyArray6(
|
|
2006
|
+
input.focusTargets.map((target) => createAiGameMccFocusTarget(target))
|
|
2007
|
+
);
|
|
2008
|
+
const focusTargetIds = new Set(focusTargets.map((target) => target.targetId));
|
|
2009
|
+
if (focusTargetIds.size !== focusTargets.length) {
|
|
2010
|
+
throw new Error("focusTargets must have unique targetId values");
|
|
2011
|
+
}
|
|
2012
|
+
const readiness = createAiGameMccReadinessState(input.readiness);
|
|
2013
|
+
const recommendations = freezeReadonlyArray6(
|
|
2014
|
+
input.recommendations.map((recommendation) => {
|
|
2015
|
+
const created = createAiGameSpellcraftRecommendation(recommendation);
|
|
2016
|
+
if (!focusTargetIds.has(created.focusTargetId)) {
|
|
2017
|
+
throw new Error("focusTargetId must reference a supplied focus target");
|
|
2018
|
+
}
|
|
2019
|
+
return created;
|
|
2020
|
+
})
|
|
2021
|
+
);
|
|
2022
|
+
const advisory = createAiGameSpellcraftAdvisory(input.advisory);
|
|
2023
|
+
if (!recommendations.some((recommendation) => recommendation.recommendationId === advisory.recommendationId)) {
|
|
2024
|
+
throw new Error("advisory recommendationId must reference a supplied recommendation");
|
|
2025
|
+
}
|
|
2026
|
+
return Object.freeze({
|
|
2027
|
+
contractVersion: input.contractVersion ?? AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
2028
|
+
featureFlagId: AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
2029
|
+
guidanceId: input.guidanceId,
|
|
2030
|
+
focusTargets,
|
|
2031
|
+
readiness,
|
|
2032
|
+
recommendations,
|
|
2033
|
+
advisory
|
|
2034
|
+
});
|
|
2035
|
+
}
|
|
2036
|
+
|
|
1693
2037
|
// src/world-events.ts
|
|
1694
2038
|
function isCanonicalWorldEvent(event) {
|
|
1695
2039
|
return event.recordType === "canonical";
|
|
@@ -1841,7 +2185,7 @@ var QUIET_MEASURE_JUDGMENT_MISSING_EVIDENCE = [
|
|
|
1841
2185
|
"private-or-low-witness-evidence",
|
|
1842
2186
|
"costly-pressure-event"
|
|
1843
2187
|
];
|
|
1844
|
-
function
|
|
2188
|
+
function isMember6(value, members) {
|
|
1845
2189
|
return members.includes(value);
|
|
1846
2190
|
}
|
|
1847
2191
|
function assertRecord(value, label) {
|
|
@@ -1882,7 +2226,7 @@ function normalizeTimestamp(value, label) {
|
|
|
1882
2226
|
}
|
|
1883
2227
|
function normalizeMember(value, members, label) {
|
|
1884
2228
|
const normalized = normalizeNonEmptyString(value, label);
|
|
1885
|
-
if (!
|
|
2229
|
+
if (!isMember6(normalized, members)) {
|
|
1886
2230
|
throw new TypeError(`${label} must be one of: ${members.join(", ")}.`);
|
|
1887
2231
|
}
|
|
1888
2232
|
return normalized;
|
|
@@ -2015,13 +2359,13 @@ function normalizeDominantReads(value) {
|
|
|
2015
2359
|
return Object.freeze(value.map((entry, index) => normalizeDerivedReadSummary(entry, index)));
|
|
2016
2360
|
}
|
|
2017
2361
|
function isQuietMeasureAxis(value) {
|
|
2018
|
-
return
|
|
2362
|
+
return isMember6(value, QUIET_MEASURE_AXES);
|
|
2019
2363
|
}
|
|
2020
2364
|
function isQuietMeasureMissionProbeMode(value) {
|
|
2021
|
-
return
|
|
2365
|
+
return isMember6(value, QUIET_MEASURE_MISSION_PROBE_MODES);
|
|
2022
2366
|
}
|
|
2023
2367
|
function isQuietMeasureMissionResolutionShape(value) {
|
|
2024
|
-
return
|
|
2368
|
+
return isMember6(value, QUIET_MEASURE_MISSION_RESOLUTION_SHAPES);
|
|
2025
2369
|
}
|
|
2026
2370
|
function createQuietMeasureJudgmentEligibility(input = {}) {
|
|
2027
2371
|
const repeatedMeaningfulEvidence = normalizeOptionalBoolean(
|
|
@@ -2536,6 +2880,15 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
2536
2880
|
AI_GAME_IDENTITY_TARGET_CATEGORIES,
|
|
2537
2881
|
AI_GAME_IDENTITY_VISIBILITY_STATES,
|
|
2538
2882
|
AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID,
|
|
2883
|
+
AI_GAME_MCC_FOCUS_PRIORITIES,
|
|
2884
|
+
AI_GAME_MCC_GROWTH_DIRECTIONS,
|
|
2885
|
+
AI_GAME_MCC_GUIDANCE_CONTRACT_VERSION,
|
|
2886
|
+
AI_GAME_MCC_GUIDANCE_FEATURE_FLAG_ID,
|
|
2887
|
+
AI_GAME_MCC_GUIDANCE_MAX_FOCUS_TARGETS,
|
|
2888
|
+
AI_GAME_MCC_GUIDANCE_MAX_RECOMMENDATIONS,
|
|
2889
|
+
AI_GAME_MCC_READINESS_BANDS,
|
|
2890
|
+
AI_GAME_MCC_WARNING_KINDS,
|
|
2891
|
+
AI_GAME_MCC_WARNING_STATES,
|
|
2539
2892
|
AI_GAME_MISSIONS_CONTRACT_VERSION,
|
|
2540
2893
|
AI_GAME_MISSIONS_FEATURE_FLAG_ID,
|
|
2541
2894
|
AI_GAME_MISSION_CLASSES,
|
|
@@ -2580,6 +2933,14 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
2580
2933
|
AI_GAME_PLAYER_SYSTEM_PREFERENCE_KINDS,
|
|
2581
2934
|
AI_GAME_PLAYER_SYSTEM_PREFERENCE_SOURCES,
|
|
2582
2935
|
AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID,
|
|
2936
|
+
AI_GAME_SPELLCRAFT_AUTHORITATIVE_OWNER,
|
|
2937
|
+
AI_GAME_SPELLCRAFT_CHAOS_PRESSURES,
|
|
2938
|
+
AI_GAME_SPELLCRAFT_COMMITMENT,
|
|
2939
|
+
AI_GAME_SPELLCRAFT_COMPLEXITIES,
|
|
2940
|
+
AI_GAME_SPELLCRAFT_FATIGUE_STATES,
|
|
2941
|
+
AI_GAME_SPELLCRAFT_RECOMMENDATION_KINDS,
|
|
2942
|
+
AI_GAME_SPELLCRAFT_TARGET_MODES,
|
|
2943
|
+
AI_GAME_SPELLCRAFT_VERDICTS,
|
|
2583
2944
|
AI_GAME_TASK_AUTHORITY_BOUNDARIES,
|
|
2584
2945
|
AI_GAME_TASK_DECISIONS,
|
|
2585
2946
|
AI_GAME_TASK_KINDS,
|
|
@@ -2625,6 +2986,10 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
2625
2986
|
createAiGameIdentityTargetProjection,
|
|
2626
2987
|
createAiGameInstitutionEligibility,
|
|
2627
2988
|
createAiGameMartialTrainingSnapshot,
|
|
2989
|
+
createAiGameMccFocusTarget,
|
|
2990
|
+
createAiGameMccGuidanceSnapshot,
|
|
2991
|
+
createAiGameMccReadinessState,
|
|
2992
|
+
createAiGameMccWarning,
|
|
2628
2993
|
createAiGameMissionDefinition,
|
|
2629
2994
|
createAiGameMissionMccFocusInfluence,
|
|
2630
2995
|
createAiGameMissionObjectiveState,
|
|
@@ -2645,6 +3010,8 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
2645
3010
|
createAiGamePlayerSystemPreferenceProfile,
|
|
2646
3011
|
createAiGamePlayerSystemSession,
|
|
2647
3012
|
createAiGameSpecializationRecommendation,
|
|
3013
|
+
createAiGameSpellcraftAdvisory,
|
|
3014
|
+
createAiGameSpellcraftRecommendation,
|
|
2648
3015
|
createAiGameTrainingAcademicMissionPrerequisite,
|
|
2649
3016
|
createAiGameTrainingAcademyAdmission,
|
|
2650
3017
|
createAiGameTrainingSchoolProgression,
|
|
@@ -2662,6 +3029,11 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
2662
3029
|
isAiGameIdentityProjectionRead,
|
|
2663
3030
|
isAiGameIdentityTargetCategory,
|
|
2664
3031
|
isAiGameIdentityVisibilityState,
|
|
3032
|
+
isAiGameMccFocusPriority,
|
|
3033
|
+
isAiGameMccGrowthDirection,
|
|
3034
|
+
isAiGameMccReadinessBand,
|
|
3035
|
+
isAiGameMccWarningKind,
|
|
3036
|
+
isAiGameMccWarningState,
|
|
2665
3037
|
isAiGameMissionClass,
|
|
2666
3038
|
isAiGameMissionConfidenceBand,
|
|
2667
3039
|
isAiGameMissionFeedbackChannel,
|
|
@@ -2688,6 +3060,12 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
2688
3060
|
isAiGamePlayerSystemModule,
|
|
2689
3061
|
isAiGamePlayerSystemPreferenceKind,
|
|
2690
3062
|
isAiGamePlayerSystemPreferenceSource,
|
|
3063
|
+
isAiGameSpellcraftChaosPressure,
|
|
3064
|
+
isAiGameSpellcraftComplexity,
|
|
3065
|
+
isAiGameSpellcraftFatigueState,
|
|
3066
|
+
isAiGameSpellcraftRecommendationKind,
|
|
3067
|
+
isAiGameSpellcraftTargetMode,
|
|
3068
|
+
isAiGameSpellcraftVerdict,
|
|
2691
3069
|
isAiGameTrainingAcademicProgressStage,
|
|
2692
3070
|
isAiGameTrainingAcademyAdmissionDecision,
|
|
2693
3071
|
isAiGameTrainingAntiSpellCounterWindow,
|