@plasius/ai-game 0.1.7 → 0.1.9

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 CHANGED
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/)**, and this project adheres to **[Semantic Versioning](https://semver.org/spec/v2.0.0.html)**.
6
6
  ## [Unreleased]
7
+
7
8
  - **Added**
8
9
  - (placeholder)
9
10
 
@@ -15,6 +16,34 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
15
16
 
16
17
  - **Security**
17
18
  - (placeholder)
19
+
20
+ ## [0.1.9] - 2026-06-22
21
+
22
+ - **Added**
23
+ - Added Player System-readable training bridge contracts that re-export canonical institutional progression state from `@plasius/training` and bundle stage-gated eligibility, trust markers, and specialization recommendations.
24
+
25
+ - **Changed**
26
+ - Extended the public package surface to consume the published `@plasius/training` authority boundary instead of redefining institution, trust, or specialization vocabulary locally.
27
+
28
+ - **Fixed**
29
+ - (placeholder)
30
+
31
+ - **Security**
32
+ - (placeholder)
33
+
34
+ ## [0.1.8] - 2026-06-22
35
+ - **Added**
36
+ - (placeholder)
37
+
38
+ - **Changed**
39
+ - (placeholder)
40
+
41
+ - **Fixed**
42
+ - (placeholder)
43
+
44
+ - **Security**
45
+ - (placeholder)
46
+
18
47
  ## [0.1.7] - 2026-06-14
19
48
 
20
49
  - **Added**
@@ -57,3 +86,5 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
57
86
  [0.1.1]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.1.1
58
87
  [0.1.2]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.1.2
59
88
  [0.1.7]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.1.7
89
+ [0.1.8]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.1.8
90
+ [0.1.9]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.1.9
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @plasius/ai-game
2
2
 
3
- Game-domain AI contracts for player action validation, NPC actions, gossip, Quiet Measure mission probes, and Judgment disclosure surfaces.
3
+ Game-domain AI contracts for player action validation, NPC actions, gossip, Quiet Measure mission probes, Judgment disclosure surfaces, and Player System-readable training recommendations.
4
4
 
5
5
  ## Scope
6
6
 
7
- This package is part of the layered `@plasius/ai-*` package family. It exports canonical public contracts for world events, world-event ingestion, incident impact state, gossip topic projection, and Quiet Measure hidden-runtime integration surfaces.
7
+ This package is part of the layered `@plasius/ai-*` package family. It exports canonical public contracts for world events, world-event ingestion, incident impact state, gossip topic projection, Quiet Measure hidden-runtime integration surfaces, and the Player System bridge layer that consumes `@plasius/training`.
8
8
 
9
9
  ## Install
10
10
 
@@ -18,9 +18,13 @@ npm install @plasius/ai-game
18
18
  import {
19
19
  AI_GAME_PACKAGE,
20
20
  AI_GAME_FEATURE_FLAG_ID,
21
+ AI_GAME_TRAINING_INSTITUTIONS_FEATURE_FLAG_ID,
21
22
  aiGameFeatureFlags,
22
23
  packageDescriptor,
23
24
  AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID,
25
+ type AiGameTrainingState,
26
+ type AiGameInstitutionEligibility,
27
+ type AiGameSpecializationRecommendation,
24
28
  type GameWorldEvent,
25
29
  type WorldEventIngestionPort,
26
30
  type WorldIncidentThread,
@@ -32,6 +36,16 @@ import {
32
36
  } from "@plasius/ai-game";
33
37
  ```
34
38
 
39
+ ## Training bridge contracts
40
+
41
+ The training surface intentionally reuses `@plasius/training` as the authority for institutions, trust tiers, and specialization tracks.
42
+
43
+ - `AiGameTrainingState` re-exports the canonical progression record from `@plasius/training`.
44
+ - `AiGameInstitutionEligibility` makes stage-gated institutional availability explicit for Player System consumers.
45
+ - `AiGameTrainingTrustMarker` carries trust evidence without copying broader profile state.
46
+ - `AiGameSpecializationRecommendation` keeps leaning and recommended-track output inside the canonical `internalized` / `externalized` / `hybrid` MCC doctrine.
47
+ - `createAiGameTrainingStateSnapshot` freezes a Player System-readable bundle of progression, institution, eligibility, trust-marker, and recommendation data.
48
+
35
49
  ## Quiet Measure contracts
36
50
 
37
51
  The Quiet Measure surface is intentionally structured as a hidden-runtime contract, not a turnkey morality meter.
@@ -61,6 +75,7 @@ npm run pack:check
61
75
  - `ai.game.npc-gossip.perspective.enabled`
62
76
  - `ai.game.npc-gossip.lifecycle.enabled`
63
77
  - `isekai.player-system.quiet-measure.enabled`
78
+ - `isekai.training.institutions.enabled`
64
79
 
65
80
  ## Governance
66
81
 
package/dist/index.cjs CHANGED
@@ -37,6 +37,11 @@ __export(index_exports, {
37
37
  AI_GAME_TASK_KINDS: () => AI_GAME_TASK_KINDS,
38
38
  AI_GAME_TASK_RESULTS: () => AI_GAME_TASK_RESULTS,
39
39
  AI_GAME_TASK_RISK_CLASSES: () => AI_GAME_TASK_RISK_CLASSES,
40
+ AI_GAME_TRAINING_INSTITUTIONS_FEATURE_FLAG_ID: () => import_training.TRAINING_FEATURE_FLAG_ID,
41
+ AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS: () => AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS,
42
+ AI_GAME_TRAINING_RECOMMENDATION_READINESS: () => AI_GAME_TRAINING_RECOMMENDATION_READINESS,
43
+ AI_GAME_TRAINING_STAGE_GATES: () => AI_GAME_TRAINING_STAGE_GATES,
44
+ AI_GAME_TRAINING_TRUST_MARKER_SOURCES: () => AI_GAME_TRAINING_TRUST_MARKER_SOURCES,
40
45
  AI_GAME_TTS_CACHE_POLICIES: () => AI_GAME_TTS_CACHE_POLICIES,
41
46
  QUIET_MEASURE_AXES: () => QUIET_MEASURE_AXES,
42
47
  QUIET_MEASURE_CONFIDENCE_BANDS: () => QUIET_MEASURE_CONFIDENCE_BANDS,
@@ -51,17 +56,27 @@ __export(index_exports, {
51
56
  QUIET_MEASURE_SIGNAL_BANDS: () => QUIET_MEASURE_SIGNAL_BANDS,
52
57
  aiGameFeatureFlags: () => aiGameFeatureFlags,
53
58
  classifyAiGameTask: () => classifyAiGameTask,
59
+ createAiGameInstitutionEligibility: () => createAiGameInstitutionEligibility,
60
+ createAiGameSpecializationRecommendation: () => createAiGameSpecializationRecommendation,
61
+ createAiGameTrainingStateSnapshot: () => createAiGameTrainingStateSnapshot,
62
+ createAiGameTrainingTrustMarker: () => createAiGameTrainingTrustMarker,
54
63
  createQuietMeasureJudgmentEligibility: () => createQuietMeasureJudgmentEligibility,
55
64
  createQuietMeasureJudgmentResponse: () => createQuietMeasureJudgmentResponse,
56
65
  gameEventFeatureFlags: () => gameEventFeatureFlags,
66
+ isAiGameTrainingRecommendationConfidenceBand: () => isAiGameTrainingRecommendationConfidenceBand,
67
+ isAiGameTrainingRecommendationReadiness: () => isAiGameTrainingRecommendationReadiness,
68
+ isAiGameTrainingStageGate: () => isAiGameTrainingStageGate,
69
+ isAiGameTrainingTrustMarkerSource: () => isAiGameTrainingTrustMarkerSource,
57
70
  isCandidateWorldEvent: () => isCandidateWorldEvent,
58
71
  isCanonicalWorldEvent: () => isCanonicalWorldEvent,
59
72
  isGossipTopicActive: () => isGossipTopicActive,
60
73
  isGossipTopicCorrected: () => isGossipTopicCorrected,
61
74
  isIncidentResolved: () => isIncidentResolved,
75
+ isMccExpressionTrack: () => import_training.isMccExpressionTrack,
62
76
  isQuietMeasureAxis: () => isQuietMeasureAxis,
63
77
  isQuietMeasureMissionProbeMode: () => isQuietMeasureMissionProbeMode,
64
78
  isQuietMeasureMissionResolutionShape: () => isQuietMeasureMissionResolutionShape,
79
+ isTrainingTrustLevel: () => import_training.isTrainingTrustLevel,
65
80
  listQuietMeasureMissingEvidence: () => listQuietMeasureMissingEvidence,
66
81
  normalizeIncidentImpactVector: () => normalizeIncidentImpactVector,
67
82
  packageDescriptor: () => packageDescriptor,
@@ -71,6 +86,135 @@ __export(index_exports, {
71
86
  });
72
87
  module.exports = __toCommonJS(index_exports);
73
88
 
89
+ // src/training-state.ts
90
+ var import_training = require("@plasius/training");
91
+ var AI_GAME_TRAINING_STAGE_GATES = [
92
+ "system-first-awakening",
93
+ "field-repetition",
94
+ "first-social-institution",
95
+ "advanced-specialization",
96
+ "dominion-and-divine"
97
+ ];
98
+ var AI_GAME_TRAINING_TRUST_MARKER_SOURCES = [
99
+ "system",
100
+ "mission",
101
+ "institution",
102
+ "sponsor"
103
+ ];
104
+ var AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS = [
105
+ "low",
106
+ "medium",
107
+ "high"
108
+ ];
109
+ var AI_GAME_TRAINING_RECOMMENDATION_READINESS = [
110
+ "ready",
111
+ "needs-prerequisites",
112
+ "institution-gated"
113
+ ];
114
+ function freezeReadonlyArray(items) {
115
+ return Object.freeze([...items]);
116
+ }
117
+ function assertNonEmptyString(value, label) {
118
+ if (value.trim().length === 0) {
119
+ throw new Error(`${label} must be a non-empty string`);
120
+ }
121
+ }
122
+ function assertIsoTimestamp(value, label) {
123
+ assertNonEmptyString(value, label);
124
+ if (Number.isNaN(Date.parse(value))) {
125
+ throw new Error(`${label} must be an ISO-8601 timestamp`);
126
+ }
127
+ }
128
+ function isTrainingInstitutionType(value) {
129
+ return value === "school" || value === "barracks" || value === "academy" || value === "apprenticeship";
130
+ }
131
+ function isAiGameTrainingStageGate(value) {
132
+ return AI_GAME_TRAINING_STAGE_GATES.includes(value);
133
+ }
134
+ function isAiGameTrainingTrustMarkerSource(value) {
135
+ return AI_GAME_TRAINING_TRUST_MARKER_SOURCES.includes(value);
136
+ }
137
+ function isAiGameTrainingRecommendationConfidenceBand(value) {
138
+ return AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS.includes(value);
139
+ }
140
+ function isAiGameTrainingRecommendationReadiness(value) {
141
+ return AI_GAME_TRAINING_RECOMMENDATION_READINESS.includes(value);
142
+ }
143
+ function createAiGameInstitutionEligibility(input) {
144
+ assertNonEmptyString(input.institutionId, "institutionId");
145
+ if (!isTrainingInstitutionType(input.institutionType)) {
146
+ throw new Error("institutionType must be a supported training institution type");
147
+ }
148
+ if (!(0, import_training.isMccExpressionTrack)(input.track)) {
149
+ throw new Error("track must be a supported MCC expression track");
150
+ }
151
+ if (!isAiGameTrainingStageGate(input.requiredStageGate)) {
152
+ throw new Error("requiredStageGate must be a supported training stage gate");
153
+ }
154
+ if (!(0, import_training.isTrainingTrustLevel)(input.trustLevel)) {
155
+ throw new Error("trustLevel must be a supported training trust level");
156
+ }
157
+ return Object.freeze({
158
+ ...input,
159
+ unmetPrerequisiteCodes: freezeReadonlyArray(input.unmetPrerequisiteCodes),
160
+ reasonCodes: freezeReadonlyArray(input.reasonCodes)
161
+ });
162
+ }
163
+ function createAiGameTrainingTrustMarker(input) {
164
+ assertNonEmptyString(input.markerId, "markerId");
165
+ assertNonEmptyString(input.institutionId, "institutionId");
166
+ assertIsoTimestamp(input.awardedAtIso, "awardedAtIso");
167
+ if (!(0, import_training.isTrainingTrustLevel)(input.trustLevel)) {
168
+ throw new Error("trustLevel must be a supported training trust level");
169
+ }
170
+ if (!isAiGameTrainingTrustMarkerSource(input.source)) {
171
+ throw new Error("source must be a supported training trust marker source");
172
+ }
173
+ return Object.freeze({
174
+ ...input,
175
+ reasonCodes: freezeReadonlyArray(input.reasonCodes)
176
+ });
177
+ }
178
+ function createAiGameSpecializationRecommendation(input) {
179
+ assertNonEmptyString(input.recommendationId, "recommendationId");
180
+ assertNonEmptyString(input.institutionId, "institutionId");
181
+ if (!isTrainingInstitutionType(input.institutionType)) {
182
+ throw new Error("institutionType must be a supported training institution type");
183
+ }
184
+ if (!(0, import_training.isMccExpressionTrack)(input.leaning)) {
185
+ throw new Error("leaning must be a supported MCC expression track");
186
+ }
187
+ if (!(0, import_training.isMccExpressionTrack)(input.recommendedTrack)) {
188
+ throw new Error("recommendedTrack must be a supported MCC expression track");
189
+ }
190
+ if (!isAiGameTrainingRecommendationConfidenceBand(input.confidenceBand)) {
191
+ throw new Error("confidenceBand must be a supported training recommendation confidence band");
192
+ }
193
+ if (!isAiGameTrainingRecommendationReadiness(input.readiness)) {
194
+ throw new Error("readiness must be a supported training recommendation readiness");
195
+ }
196
+ return Object.freeze({
197
+ ...input,
198
+ unmetPrerequisiteCodes: freezeReadonlyArray(input.unmetPrerequisiteCodes),
199
+ reasonCodes: freezeReadonlyArray(input.reasonCodes)
200
+ });
201
+ }
202
+ function createAiGameTrainingStateSnapshot(input) {
203
+ return Object.freeze({
204
+ progression: (0, import_training.createTrainingProgressionRecord)(input.progression),
205
+ institution: (0, import_training.createTrainingInstitution)(input.institution),
206
+ eligibility: freezeReadonlyArray(
207
+ input.eligibility.map(createAiGameInstitutionEligibility)
208
+ ),
209
+ trustMarkers: freezeReadonlyArray(
210
+ input.trustMarkers.map(createAiGameTrainingTrustMarker)
211
+ ),
212
+ recommendations: freezeReadonlyArray(
213
+ input.recommendations.map(createAiGameSpecializationRecommendation)
214
+ )
215
+ });
216
+ }
217
+
74
218
  // src/world-events.ts
75
219
  function isCanonicalWorldEvent(event) {
76
220
  return event.recordType === "canonical";
@@ -917,6 +1061,11 @@ var gameEventFeatureFlags = Object.freeze([
917
1061
  AI_GAME_TASK_KINDS,
918
1062
  AI_GAME_TASK_RESULTS,
919
1063
  AI_GAME_TASK_RISK_CLASSES,
1064
+ AI_GAME_TRAINING_INSTITUTIONS_FEATURE_FLAG_ID,
1065
+ AI_GAME_TRAINING_RECOMMENDATION_CONFIDENCE_BANDS,
1066
+ AI_GAME_TRAINING_RECOMMENDATION_READINESS,
1067
+ AI_GAME_TRAINING_STAGE_GATES,
1068
+ AI_GAME_TRAINING_TRUST_MARKER_SOURCES,
920
1069
  AI_GAME_TTS_CACHE_POLICIES,
921
1070
  QUIET_MEASURE_AXES,
922
1071
  QUIET_MEASURE_CONFIDENCE_BANDS,
@@ -931,17 +1080,27 @@ var gameEventFeatureFlags = Object.freeze([
931
1080
  QUIET_MEASURE_SIGNAL_BANDS,
932
1081
  aiGameFeatureFlags,
933
1082
  classifyAiGameTask,
1083
+ createAiGameInstitutionEligibility,
1084
+ createAiGameSpecializationRecommendation,
1085
+ createAiGameTrainingStateSnapshot,
1086
+ createAiGameTrainingTrustMarker,
934
1087
  createQuietMeasureJudgmentEligibility,
935
1088
  createQuietMeasureJudgmentResponse,
936
1089
  gameEventFeatureFlags,
1090
+ isAiGameTrainingRecommendationConfidenceBand,
1091
+ isAiGameTrainingRecommendationReadiness,
1092
+ isAiGameTrainingStageGate,
1093
+ isAiGameTrainingTrustMarkerSource,
937
1094
  isCandidateWorldEvent,
938
1095
  isCanonicalWorldEvent,
939
1096
  isGossipTopicActive,
940
1097
  isGossipTopicCorrected,
941
1098
  isIncidentResolved,
1099
+ isMccExpressionTrack,
942
1100
  isQuietMeasureAxis,
943
1101
  isQuietMeasureMissionProbeMode,
944
1102
  isQuietMeasureMissionResolutionShape,
1103
+ isTrainingTrustLevel,
945
1104
  listQuietMeasureMissingEvidence,
946
1105
  normalizeIncidentImpactVector,
947
1106
  packageDescriptor,