@plasius/ai-game
Game-domain AI contracts for player action validation, NPC actions, gossip, Quiet Measure mission probes, Judgment disclosure surfaces, and Player System-readable training recommendations.
Scope
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.
Install
npm install @plasius/ai-gameExports
import {
AI_GAME_PACKAGE,
AI_GAME_FEATURE_FLAG_ID,
AI_GAME_TRAINING_INSTITUTIONS_FEATURE_FLAG_ID,
aiGameFeatureFlags,
packageDescriptor,
AI_GAME_QUIET_MEASURE_FEATURE_FLAG_ID,
type AiGameTrainingState,
type AiGameInstitutionEligibility,
type AiGameSpecializationRecommendation,
type GameWorldEvent,
type WorldEventIngestionPort,
type WorldIncidentThread,
type GossipTopic,
type GossipPerspectiveProjection,
type QuietMeasureAxisSummary,
type QuietMeasureMissionProbe,
type QuietMeasureJudgmentResponse
} from "@plasius/ai-game";Training bridge contracts
The training surface intentionally reuses @plasius/training as the authority for institutions, trust tiers, and specialization tracks.
AiGameTrainingStatere-exports the canonical progression record from@plasius/training.AiGameInstitutionEligibilitymakes stage-gated institutional availability explicit for Player System consumers.AiGameTrainingTrustMarkercarries trust evidence without copying broader profile state.AiGameTrainingAcademicMissionPrerequisite,AiGameTrainingSchoolProgression,AiGameTrainingAcademyAdmission, andAiGameTrainingTrackSelectionre-export the academy authority contracts from@plasius/training.AiGameSpecializationRecommendationkeeps leaning and recommended-track output inside the canonicalinternalized/externalized/hybridMCC doctrine.createAiGameTrainingStateSnapshotfreezes a Player System-readable bundle of progression, institution, eligibility, trust-marker, and recommendation data.createAiGameAcademicTrainingSnapshotpackages school-stage progress, academy admissions, track-selection authority, and Player System recommendations into one frozen bridge payload.
Martial training bridge contracts
The martial slice remains a bridge surface over the published
@plasius/training authority package rather than a second source of truth.
AI_GAME_TRAINING_MARTIAL_FEATURE_FLAG_IDre-exports the inheritedisekai.training.martial.enabledrollout key.AI_GAME_TRAINING_BARRACKS_DRILL_DELIVERY_MODES,AI_GAME_TRAINING_MARTIAL_TECHNIQUE_FAMILIES, andAI_GAME_TRAINING_ANTI_SPELL_FIELDCRAFT_FAMILIESexpose the canonical barracks and bounded anti-spell vocabulary to ai-game consumers.AiGameTrainingBarracksDrill,AiGameTrainingMissionTechniqueUnlock,AiGameTrainingMartialTechnique, andAiGameTrainingAntiSpellFieldcraftDisciplinere-export the authoritative training contracts directly.createAiGameMartialTrainingSnapshotfreezes a Player System-readable bundle of barracks drills, mission-earned unlocks, martial techniques, and bounded anti-spell fieldcraft without redefining those authority models locally.
Quiet Measure contracts
The Quiet Measure surface is intentionally structured as a hidden-runtime contract, not a turnkey morality meter.
- Axis and derived-read contracts expose bounded summaries, confidence bands, evidence windows, and perspective scope without publishing host-specific raw score storage.
- Mission probe contracts model
Clarify,Tempt, andReinforcemodes plusRestorative,Dominant,Detached, and optionalPerformativeresolution shapes. - Judgment contracts model request, eligibility, insufficient-evidence, and verdict responses with
title-and-verdict-onlydisclosure as the default public output. - Runtime helpers validate and defensively copy public Quiet Measure request, title, dominant-read, and reason-code payloads so malformed host input fails closed without leaking hidden-score internals.
- Evaluation fixtures for hero, villain, counterfeit, tyrant, and redemption regression cases belong in
@plasius/ai-evals, not this package.
Development
npm install
npm run build
npm test
npm run test:coverage
npm run pack:checkFeature flags
ai.game.event-recorder.contracts.enabledai.game.event-recorder.ingestion.enabledai.game.event-recorder.impact.enabledai.game.npc-gossip.topics.enabledai.game.npc-gossip.perspective.enabledai.game.npc-gossip.lifecycle.enabledisekai.player-system.quiet-measure.enabledisekai.training.institutions.enabledisekai.training.academies.enabledisekai.training.martial.enabled
Governance
- Security policy: SECURITY.md
- Code of conduct: CODE_OF_CONDUCT.md
- ADRs: docs/adrs
- CLA and legal docs: legal
License
Apache-2.0