@plasius/ai-game 0.1.2 → 0.1.6
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 +23 -3
- package/README.md +44 -6
- package/dist/index.cjs +751 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +471 -2
- package/dist/index.d.ts +471 -2
- package/dist/index.js +710 -3
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0002-canonical-world-event-envelope-and-classification.md +27 -0
- package/docs/adrs/adr-0002-game-task-contracts.md +29 -0
- package/docs/adrs/adr-0003-authoritative-ingestion-append-only-ledger-and-projections.md +28 -0
- package/docs/adrs/adr-0004-incident-lifecycle-resolution-and-world-impact.md +27 -0
- package/docs/adrs/adr-0005-structured-gossip-topics-as-the-output-boundary.md +26 -0
- package/docs/adrs/adr-0006-perspective-gated-relative-knowledge-projection.md +27 -0
- package/docs/adrs/adr-0007-gossip-spread-decay-correction-and-resolution.md +27 -0
- package/docs/adrs/adr-0008-quiet-measure-public-contracts-and-hidden-runtime-boundary.md +36 -0
- package/docs/adrs/adr-0009-protected-main-release-preparation-and-version-reconciliation.md +57 -0
- package/docs/adrs/index.md +8 -0
- package/package.json +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface AiPackageDescriptor {\n readonly packageName: string;\n readonly featureFlagId: string;\n readonly envPrefix: string;\n readonly summary: string;\n}\n\nexport const AI_GAME_PACKAGE = \"@plasius/ai-game\";\nexport const AI_GAME_FEATURE_FLAG_ID = \"ai.game.enabled\";\nexport const AI_GAME_ENV_PREFIX = \"AI_GAME\";\n\nexport const packageDescriptor: AiPackageDescriptor = Object.freeze({\n packageName: AI_GAME_PACKAGE,\n featureFlagId: AI_GAME_FEATURE_FLAG_ID,\n envPrefix: AI_GAME_ENV_PREFIX,\n summary: \"Game-domain AI contracts for player action validation, NPC actions, gossip, and feedback.\",\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,IAAM,kBAAkB;AACxB,IAAM,0BAA0B;AAChC,IAAM,qBAAqB;AAE3B,IAAM,oBAAyC,OAAO,OAAO;AAAA,EAClE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SAAS;AACX,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/points-store.ts","../src/world-events.ts","../src/gossip.ts"],"sourcesContent":["import { AI_GAME_POINTS_STORE_FEATURE_FLAG_ID } from \"./points-store.js\";\n\nexport interface AiPackageDescriptor {\n readonly packageName: string;\n readonly featureFlagId: string;\n readonly envPrefix: string;\n readonly summary: string;\n}\n\nexport const AI_GAME_PACKAGE = \"@plasius/ai-game\";\nexport const AI_GAME_ENV_PREFIX = \"AI_GAME\";\nexport const AI_GAME_FEATURE_FLAG_ID = \"ai.game.enabled\";\nexport const AI_GAME_EVENT_CONTRACTS_FEATURE_FLAG_ID = \"ai.game.event-recorder.contracts.enabled\";\nexport const AI_GAME_EVENT_INGESTION_FEATURE_FLAG_ID = \"ai.game.event-recorder.ingestion.enabled\";\nexport const AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID = \"ai.game.event-recorder.impact.enabled\";\nexport const AI_GAME_GOSSIP_TOPICS_FEATURE_FLAG_ID = \"ai.game.npc-gossip.topics.enabled\";\nexport const AI_GAME_PERSPECTIVE_FEATURE_FLAG_ID = \"ai.game.npc-gossip.perspective.enabled\";\nexport const AI_GAME_GOSSIP_LIFECYCLE_FEATURE_FLAG_ID = \"ai.game.npc-gossip.lifecycle.enabled\";\n\nexport const AI_GAME_FEATURE_FLAGS = {\n workloads: AI_GAME_FEATURE_FLAG_ID,\n ttsCacheEnabled: \"ai.tts.cache.enabled\",\n ttsNearReuseEnabled: \"ai.tts.near-reuse.enabled\",\n} as const;\n\nexport type AiGameFeatureFlagKey =\n (typeof AI_GAME_FEATURE_FLAGS)[keyof typeof AI_GAME_FEATURE_FLAGS];\n\nexport type AiGameFeatureFlagSnapshot = Partial<Record<AiGameFeatureFlagKey, boolean>>;\n\nexport const AI_GAME_TASK_KINDS = [\n \"player-action-validation\",\n \"npc-action\",\n \"npc-dialogue\",\n \"gossip\",\n \"governance-feedback\",\n \"feedback\",\n \"unknown\",\n] as const;\n\nexport type AiGameTaskKind = (typeof AI_GAME_TASK_KINDS)[number];\n\nexport const AI_GAME_TASK_RISK_CLASSES = [\n \"low\",\n \"medium\",\n \"high\",\n \"critical\",\n] as const;\n\nexport type AiGameTaskRiskClass = (typeof AI_GAME_TASK_RISK_CLASSES)[number];\n\nexport const AI_GAME_TASK_AUTHORITY_BOUNDARIES = [\n \"deterministic\",\n \"human-review\",\n \"operator-review\",\n \"blocked\",\n] as const;\n\nexport type AiGameAuthorityBoundary =\n (typeof AI_GAME_TASK_AUTHORITY_BOUNDARIES)[number];\n\nexport const AI_GAME_TASK_DECISIONS = [\"allow\", \"operator-review\", \"blocked\"] as const;\n\nexport type AiGameTaskDecisionResult =\n (typeof AI_GAME_TASK_DECISIONS)[number];\n\nexport const AI_GAME_TASK_RESULTS = [\"allow\", \"defer\", \"deny\"] as const;\n\nexport type AiGameTaskResult = (typeof AI_GAME_TASK_RESULTS)[number];\n\nexport const AI_GAME_TTS_CACHE_POLICIES = [\n \"exact-cache\",\n \"near-cache\",\n \"no-cache\",\n] as const;\n\nexport type AiGameTtsCachePolicy =\n (typeof AI_GAME_TTS_CACHE_POLICIES)[number];\n\nexport const AI_GAME_ACTOR_ROLES = [\"player\", \"npc\", \"operator\", \"system\"] as const;\n\nexport type AiGameActorRole = (typeof AI_GAME_ACTOR_ROLES)[number];\n\nexport interface AiGameTaskRequest {\n readonly taskId: string;\n readonly taskText: string;\n readonly taskKind?: AiGameTaskKind;\n}\n\nexport interface AiGameTaskDecision {\n readonly taskId: string;\n readonly taskKind: AiGameTaskKind;\n readonly riskClass: AiGameTaskRiskClass;\n readonly authorityBoundary: AiGameAuthorityBoundary;\n readonly decision: AiGameTaskDecisionResult;\n readonly needsOperatorReview: boolean;\n readonly reasonCodes: readonly string[];\n}\n\nexport interface AiGamePolicyAuditBase {\n readonly policyId: string;\n readonly policyVersion: string;\n readonly correlationId: string;\n readonly requestId?: string;\n readonly actorId?: string;\n readonly actorRole: AiGameActorRole;\n readonly evaluatedAtUtc: string;\n}\n\nexport interface ResolveAiGameTaskInput {\n readonly actorRole?: AiGameActorRole;\n readonly actorId?: string;\n readonly requestId?: string;\n readonly correlationId?: string;\n readonly policyId?: string;\n readonly policyVersion?: string;\n readonly featureFlags?: AiGameFeatureFlagSnapshot;\n readonly requests: readonly AiGameTaskRequest[];\n readonly reasonCodes?: readonly string[];\n}\n\nexport interface AiGameTaskResolution {\n readonly requestedTasks: readonly string[];\n readonly taskDecisions: readonly AiGameTaskDecision[];\n readonly allowedTaskIds: readonly string[];\n readonly reviewTaskIds: readonly string[];\n readonly blockedTaskIds: readonly string[];\n readonly needsOperatorReview: boolean;\n readonly featureEnabled: boolean;\n readonly enabledFeatureFlags: readonly AiGameFeatureFlagKey[];\n readonly source: \"policy\" | \"policy-disabled\" | \"policy-empty\";\n readonly audit: AiGamePolicyAuditBase & {\n readonly result: AiGameTaskResult;\n };\n}\n\nexport interface ResolveAiGamePlayerAddressInput {\n readonly playerAddressText: string;\n readonly playerAlias?: string;\n readonly accountAlias?: string;\n readonly actorRole?: AiGameActorRole;\n readonly actorId?: string;\n readonly requestId?: string;\n readonly correlationId?: string;\n readonly policyId?: string;\n readonly policyVersion?: string;\n readonly featureFlags?: AiGameFeatureFlagSnapshot;\n readonly reasonCodes?: readonly string[];\n}\n\nexport interface ResolveAiGamePlayerAddressResult {\n readonly sourceText: string;\n readonly renderText: string;\n readonly ttsCachePolicy: AiGameTtsCachePolicy;\n readonly reasonCodes: readonly string[];\n readonly enabledFeatureFlags: readonly AiGameFeatureFlagKey[];\n readonly source: \"policy\" | \"policy-disabled\" | \"policy-empty\";\n readonly audit: AiGamePolicyAuditBase & {\n readonly cachePolicy: AiGameTtsCachePolicy;\n };\n}\n\ninterface AiGameTaskProfile {\n readonly riskClass: AiGameTaskRiskClass;\n readonly authorityBoundary: AiGameAuthorityBoundary;\n readonly keywords: readonly string[];\n}\n\nconst AI_GAME_TASK_PROFILE_BY_KIND: Record<AiGameTaskKind, AiGameTaskProfile> = {\n \"player-action-validation\": {\n riskClass: \"medium\",\n authorityBoundary: \"human-review\",\n keywords: [\"move\", \"attack\", \"collect\", \"use\", \"open\", \"pick\", \"trade\", \"target\"],\n },\n \"npc-action\": {\n riskClass: \"high\",\n authorityBoundary: \"operator-review\",\n keywords: [\"summon\", \"kill\", \"ban\", \"spawn\", \"eject\", \"resurrect\", \"npc action\", \"npc-action\"],\n },\n \"npc-dialogue\": {\n riskClass: \"low\",\n authorityBoundary: \"deterministic\",\n keywords: [\"say\", \"says\", \"reply\", \"chat\", \"dialogue\", \"greet\", \"warn\", \"request\"],\n },\n gossip: {\n riskClass: \"high\",\n authorityBoundary: \"operator-review\",\n keywords: [\"rumor\", \"rumors\", \"gossip\", \"hearsay\", \"whisper\", \"spread\", \"denounce\"],\n },\n \"governance-feedback\": {\n riskClass: \"critical\",\n authorityBoundary: \"blocked\",\n keywords: [\"punish\", \"expel\", \"revoke\", \"ban\", \"forbid\", \"seize\"],\n },\n feedback: {\n riskClass: \"low\",\n authorityBoundary: \"operator-review\",\n keywords: [\"feedback\", \"rating\", \"report\", \"score\", \"review\", \"complaint\"],\n },\n unknown: {\n riskClass: \"low\",\n authorityBoundary: \"deterministic\",\n keywords: [\"\"],\n },\n};\n\nconst AI_GAME_TASK_KEYWORD_PATTERNS: Readonly<Record<AiGameTaskKind, RegExp>> = {\n \"player-action-validation\": buildTaskPattern(\n AI_GAME_TASK_PROFILE_BY_KIND[\"player-action-validation\"].keywords,\n ),\n \"npc-action\": buildTaskPattern(AI_GAME_TASK_PROFILE_BY_KIND[\"npc-action\"].keywords),\n \"npc-dialogue\": buildTaskPattern(AI_GAME_TASK_PROFILE_BY_KIND[\"npc-dialogue\"].keywords),\n gossip: buildTaskPattern(AI_GAME_TASK_PROFILE_BY_KIND.gossip.keywords),\n \"governance-feedback\": buildTaskPattern(AI_GAME_TASK_PROFILE_BY_KIND[\"governance-feedback\"].keywords),\n feedback: buildTaskPattern(AI_GAME_TASK_PROFILE_BY_KIND.feedback.keywords),\n unknown: buildTaskPattern(AI_GAME_TASK_PROFILE_BY_KIND.unknown.keywords),\n};\n\nfunction nowIsoString(): string {\n return new Date().toISOString();\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction normalizeToken(value: string): string {\n return value.trim().replace(/\\s+/g, \" \");\n}\n\nfunction buildTaskPattern(keywords: readonly string[]): RegExp {\n return new RegExp(\n keywords.filter((keyword) => keyword.length > 0).map((keyword) => `\\\\b${escapeRegExp(keyword)}\\\\b`).join(\"|\") || \"^$\",\n \"i\",\n );\n}\n\nfunction uniqueStrings(values: readonly string[]): string[] {\n return Array.from(new Set(values.filter((value) => value.length > 0)));\n}\n\nfunction isFeatureEnabled(\n featureFlag: AiGameFeatureFlagKey,\n snapshot: AiGameFeatureFlagSnapshot = {},\n): boolean {\n return snapshot[featureFlag] === true;\n}\n\nfunction normalizeTaskText(value: string): string {\n return value.trim().replace(/\\s+/g, \" \").toLowerCase();\n}\n\nfunction isActorRole(role?: AiGameActorRole): AiGameActorRole {\n return role ?? \"player\";\n}\n\nfunction normalizeTaskKind(taskKind?: AiGameTaskKind): AiGameTaskKind | undefined {\n if (!taskKind) {\n return undefined;\n }\n\n return (AI_GAME_TASK_KINDS as readonly string[]).includes(taskKind)\n ? taskKind\n : \"unknown\";\n}\n\nexport function classifyAiGameTask(taskText: string): AiGameTaskKind {\n const normalized = normalizeTaskText(taskText);\n\n if (!normalized) {\n return \"unknown\";\n }\n\n for (const taskKind of AI_GAME_TASK_KINDS) {\n if (AI_GAME_TASK_KEYWORD_PATTERNS[taskKind].test(normalized)) {\n return taskKind;\n }\n }\n\n return \"unknown\";\n}\n\nfunction resolveTaskAuthority(taskKind: AiGameTaskKind): AiGameTaskProfile {\n return AI_GAME_TASK_PROFILE_BY_KIND[taskKind];\n}\n\nfunction resolveTaskDecision(\n taskKind: AiGameTaskKind,\n profile: AiGameTaskProfile,\n actorRole: AiGameActorRole,\n): Omit<AiGameTaskDecision, \"taskId\" | \"taskKind\" | \"riskClass\" | \"authorityBoundary\" | \"reasonCodes\"> {\n if (profile.authorityBoundary === \"blocked\") {\n return {\n decision: \"blocked\",\n needsOperatorReview: actorRole !== \"system\",\n };\n }\n\n if (profile.authorityBoundary === \"deterministic\") {\n return {\n decision: \"allow\",\n needsOperatorReview: false,\n };\n }\n\n if (actorRole === \"system\") {\n return {\n decision: \"allow\",\n needsOperatorReview: false,\n };\n }\n\n return {\n decision: \"operator-review\",\n needsOperatorReview: true,\n };\n}\n\nfunction buildRequestIds(requests: readonly AiGameTaskRequest[]): string[] {\n return uniqueStrings(requests.map((request) => request.taskId.trim()).filter(Boolean));\n}\n\n/**\n * Resolve game AI task contracts for player actions, NPC actions, gossip, and governance.\n */\nexport function resolveAiGameTaskBatch(\n input: ResolveAiGameTaskInput,\n): AiGameTaskResolution {\n const actorRole = isActorRole(input.actorRole);\n const featureEnabled = isFeatureEnabled(\n AI_GAME_FEATURE_FLAGS.workloads,\n input.featureFlags,\n );\n const reasonCodes = [...(input.reasonCodes ?? [])];\n type ResolvedAiGameTaskRequest = AiGameTaskRequest & { taskKind: AiGameTaskKind };\n const requests: ResolvedAiGameTaskRequest[] = input.requests.map((request): ResolvedAiGameTaskRequest => ({\n ...request,\n taskKind: normalizeTaskKind(request.taskKind) ?? classifyAiGameTask(request.taskText),\n }));\n\n if (!featureEnabled) {\n reasonCodes.push(\"game-feature-disabled\");\n const requestIds = buildRequestIds(requests);\n\n return {\n requestedTasks: requestIds,\n taskDecisions: Object.freeze(\n requestIds.map<AiGameTaskDecision>((taskId) => ({\n taskId,\n taskKind: \"unknown\",\n riskClass: \"critical\",\n authorityBoundary: \"blocked\",\n decision: \"blocked\",\n needsOperatorReview: false,\n reasonCodes: [\"feature-disabled\"],\n })),\n ),\n allowedTaskIds: Object.freeze([] as const),\n reviewTaskIds: Object.freeze([] as const),\n blockedTaskIds: Object.freeze(requestIds),\n needsOperatorReview: false,\n featureEnabled,\n enabledFeatureFlags: [],\n source: \"policy-disabled\",\n audit: {\n policyId: input.policyId ?? \"game-task-policy-v1\",\n policyVersion: input.policyVersion ?? \"2026-05-01\",\n correlationId: input.correlationId ?? crypto.randomUUID(),\n requestId: input.requestId,\n actorId: input.actorId,\n actorRole,\n evaluatedAtUtc: nowIsoString(),\n result: \"deny\",\n },\n };\n }\n\n if (requests.length === 0) {\n reasonCodes.push(\"game-task-empty-request\");\n\n return {\n requestedTasks: Object.freeze([] as const),\n taskDecisions: Object.freeze([] as const),\n allowedTaskIds: Object.freeze([] as const),\n reviewTaskIds: Object.freeze([] as const),\n blockedTaskIds: Object.freeze([] as const),\n needsOperatorReview: false,\n featureEnabled,\n enabledFeatureFlags: [AI_GAME_FEATURE_FLAGS.workloads],\n source: \"policy-empty\",\n audit: {\n policyId: input.policyId ?? \"game-task-policy-v1\",\n policyVersion: input.policyVersion ?? \"2026-05-01\",\n correlationId: input.correlationId ?? crypto.randomUUID(),\n requestId: input.requestId,\n actorId: input.actorId,\n actorRole,\n evaluatedAtUtc: nowIsoString(),\n result: \"allow\",\n },\n };\n }\n const taskDecisions: AiGameTaskDecision[] = [];\n for (const request of requests) {\n const taskKind: AiGameTaskKind = request.taskKind;\n const profile = resolveTaskAuthority(taskKind);\n const decision: Omit<\n AiGameTaskDecision,\n \"taskId\" | \"taskKind\" | \"riskClass\" | \"authorityBoundary\" | \"reasonCodes\"\n > = resolveTaskDecision(taskKind, profile, actorRole);\n\n taskDecisions.push({\n taskId: request.taskId,\n taskKind,\n riskClass: profile.riskClass,\n authorityBoundary: profile.authorityBoundary,\n ...decision,\n reasonCodes: [`task-${taskKind}-${decision.decision}`],\n });\n }\n\n const allowedTaskIds: string[] = [];\n const reviewTaskIds: string[] = [];\n const blockedTaskIds: string[] = [];\n\n for (const decision of taskDecisions) {\n if (decision.decision === \"allow\") {\n allowedTaskIds.push(decision.taskId);\n } else if (decision.decision === \"operator-review\") {\n reviewTaskIds.push(decision.taskId);\n } else {\n blockedTaskIds.push(decision.taskId);\n }\n\n reasonCodes.push(...decision.reasonCodes);\n }\n\n const hasBlockedTasks = blockedTaskIds.length > 0;\n const needsOperatorReview = taskDecisions.some((decision) => decision.needsOperatorReview);\n\n return {\n requestedTasks: Object.freeze(buildRequestIds(requests)),\n taskDecisions: Object.freeze(taskDecisions),\n allowedTaskIds: Object.freeze(uniqueStrings(allowedTaskIds)),\n reviewTaskIds: Object.freeze(uniqueStrings(reviewTaskIds)),\n blockedTaskIds: Object.freeze(uniqueStrings(blockedTaskIds)),\n needsOperatorReview,\n featureEnabled,\n enabledFeatureFlags: [AI_GAME_FEATURE_FLAGS.workloads],\n source: \"policy\",\n audit: {\n policyId: input.policyId ?? \"game-task-policy-v1\",\n policyVersion: input.policyVersion ?? \"2026-05-01\",\n correlationId: input.correlationId ?? crypto.randomUUID(),\n requestId: input.requestId,\n actorId: input.actorId,\n actorRole,\n evaluatedAtUtc: nowIsoString(),\n result: hasBlockedTasks ? \"deny\" : needsOperatorReview ? \"defer\" : \"allow\",\n },\n };\n}\n\n/**\n * Resolve cache policy for player-account text before speech rendering.\n */\nexport function resolveAiGamePlayerAddressText(\n input: ResolveAiGamePlayerAddressInput,\n): ResolveAiGamePlayerAddressResult {\n const actorRole = isActorRole(input.actorRole);\n const cacheEnabled = isFeatureEnabled(\n AI_GAME_FEATURE_FLAGS.ttsCacheEnabled,\n input.featureFlags,\n );\n const sourceText = normalizeToken(input.playerAddressText);\n const reasonCodes = [...(input.reasonCodes ?? [])];\n\n if (!sourceText) {\n reasonCodes.push(\"tts-empty-text\");\n\n return {\n sourceText,\n renderText: \"\",\n ttsCachePolicy: \"no-cache\",\n reasonCodes,\n enabledFeatureFlags: [],\n source: \"policy-empty\",\n audit: {\n policyId: input.policyId ?? \"game-task-policy-v1\",\n policyVersion: input.policyVersion ?? \"2026-05-01\",\n correlationId: input.correlationId ?? crypto.randomUUID(),\n requestId: input.requestId,\n actorId: input.actorId,\n actorRole,\n evaluatedAtUtc: nowIsoString(),\n cachePolicy: \"no-cache\",\n },\n };\n }\n\n const aliasEntries = [\n ...uniqueStrings([normalizeToken(input.playerAlias ?? \"\")])\n .filter(Boolean)\n .map((alias) => ({\n alias,\n isAccountAlias: false,\n })),\n ...uniqueStrings([normalizeToken(input.accountAlias ?? \"\")])\n .filter(Boolean)\n .map((alias) => ({\n alias,\n isAccountAlias: true,\n })),\n ];\n\n let renderText = sourceText;\n let replaced = false;\n\n for (const alias of aliasEntries) {\n const pattern = new RegExp(`\\\\b${escapeRegExp(alias.alias)}\\\\b`, \"gi\");\n\n if (pattern.test(renderText)) {\n renderText = renderText.replace(pattern, alias.isAccountAlias ? \"[ACCOUNT]\" : \"[PLAYER]\");\n replaced = true;\n reasonCodes.push(`tts-redacted-${alias.alias.toLowerCase()}`);\n }\n }\n\n const nearCacheEnabled = isFeatureEnabled(\n AI_GAME_FEATURE_FLAGS.ttsNearReuseEnabled,\n input.featureFlags,\n );\n\n if (!cacheEnabled) {\n reasonCodes.push(\"tts-cache-disabled\");\n\n return {\n sourceText,\n renderText,\n ttsCachePolicy: \"no-cache\",\n reasonCodes,\n enabledFeatureFlags: [],\n source: \"policy-disabled\",\n audit: {\n policyId: input.policyId ?? \"game-task-policy-v1\",\n policyVersion: input.policyVersion ?? \"2026-05-01\",\n correlationId: input.correlationId ?? crypto.randomUUID(),\n requestId: input.requestId,\n actorId: input.actorId,\n actorRole,\n evaluatedAtUtc: nowIsoString(),\n cachePolicy: \"no-cache\",\n },\n };\n }\n\n const cachePolicy: AiGameTtsCachePolicy =\n !replaced\n ? \"exact-cache\"\n : nearCacheEnabled\n ? \"near-cache\"\n : \"no-cache\";\n\n if (cachePolicy === \"exact-cache\") {\n reasonCodes.push(\"tts-cache-exact\");\n }\n\n if (cachePolicy === \"near-cache\") {\n reasonCodes.push(\"tts-cache-near\");\n }\n\n if (cachePolicy === \"no-cache\") {\n reasonCodes.push(\"tts-cache-not-available\");\n }\n\n return {\n sourceText,\n renderText,\n ttsCachePolicy: cachePolicy,\n reasonCodes,\n enabledFeatureFlags: Object.freeze([\n AI_GAME_FEATURE_FLAGS.workloads,\n AI_GAME_FEATURE_FLAGS.ttsCacheEnabled,\n ...(nearCacheEnabled ? [AI_GAME_FEATURE_FLAGS.ttsNearReuseEnabled] : []),\n ]),\n source: \"policy\",\n audit: {\n policyId: input.policyId ?? \"game-task-policy-v1\",\n policyVersion: input.policyVersion ?? \"2026-05-01\",\n correlationId: input.correlationId ?? crypto.randomUUID(),\n requestId: input.requestId,\n actorId: input.actorId,\n actorRole,\n evaluatedAtUtc: nowIsoString(),\n cachePolicy,\n },\n };\n}\n\nexport const packageDescriptor: AiPackageDescriptor = Object.freeze({\n packageName: AI_GAME_PACKAGE,\n featureFlagId: AI_GAME_FEATURE_FLAG_ID,\n envPrefix: AI_GAME_ENV_PREFIX,\n summary: \"Game-domain AI contracts for event recorder, canonical world-state, and NPC gossip projections.\",\n});\n\nexport const aiGameFeatureFlags = Object.freeze({\n contract: AI_GAME_EVENT_CONTRACTS_FEATURE_FLAG_ID,\n ingestion: AI_GAME_EVENT_INGESTION_FEATURE_FLAG_ID,\n incident: AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID,\n gossipTopics: AI_GAME_GOSSIP_TOPICS_FEATURE_FLAG_ID,\n gossipPerspective: AI_GAME_PERSPECTIVE_FEATURE_FLAG_ID,\n gossipLifecycle: AI_GAME_GOSSIP_LIFECYCLE_FEATURE_FLAG_ID,\n pointsStore: AI_GAME_POINTS_STORE_FEATURE_FLAG_ID,\n});\n\nexport const gameEventFeatureFlags = Object.freeze([\n aiGameFeatureFlags.contract,\n aiGameFeatureFlags.ingestion,\n aiGameFeatureFlags.incident,\n aiGameFeatureFlags.gossipTopics,\n aiGameFeatureFlags.gossipPerspective,\n aiGameFeatureFlags.gossipLifecycle,\n aiGameFeatureFlags.pointsStore,\n]);\n\nexport {\n createAiGamePointsLedgerSnapshot,\n evaluateAiGameProtoSocialDevolutionEligibility,\n getAiGameProtoSocialDevolutionPolicy,\n getDefaultAiGamePointsSpendPolicies,\n isAiGamePlayerEvolutionStage,\n isAiGamePointsLedgerId,\n resolveAiGamePointsAuthorityBoundary,\n} from \"./points-store.js\";\n\nexport {\n isCanonicalWorldEvent,\n isCandidateWorldEvent,\n isIncidentResolved,\n normalizeIncidentImpactVector,\n} from \"./world-events.js\";\n\nexport {\n isGossipTopicActive,\n isGossipTopicCorrected,\n projectTopicForAudience,\n} from \"./gossip.js\";\n\nexport * from \"./points-store.js\";\nexport * from \"./world-events.js\";\nexport * from \"./gossip.js\";\n","export const AI_GAME_POINTS_STORE_FEATURE_FLAG_ID = \"isekai.player-system.points-store.enabled\";\n\nexport const AI_GAME_POINTS_LEDGER_IDS = [\"pp\", \"esp\", \"tis\", \"dis\"] as const;\n\nexport type AiGamePointsLedgerId = (typeof AI_GAME_POINTS_LEDGER_IDS)[number];\n\nexport const AI_GAME_PLAYER_EVOLUTION_STAGES = [\"proto-social\", \"social-lock\"] as const;\n\nexport type AiGamePlayerEvolutionStage =\n (typeof AI_GAME_PLAYER_EVOLUTION_STAGES)[number];\n\nexport const AI_GAME_POINTS_AUTHORITY_BANDS = [\n \"self\",\n \"frontier\",\n \"civic\",\n \"divine\",\n] as const;\n\nexport type AiGamePointsAuthorityBand =\n (typeof AI_GAME_POINTS_AUTHORITY_BANDS)[number];\n\nexport const AI_GAME_POINTS_AUTHORITY_SYSTEMS = [\n \"player-system\",\n \"exploration-system\",\n \"territorial-influence-system\",\n \"divine-influence-system\",\n] as const;\n\nexport type AiGamePointsAuthoritySystem =\n (typeof AI_GAME_POINTS_AUTHORITY_SYSTEMS)[number];\n\nexport interface AiGamePointsAuthorityBoundary {\n readonly ledgerId: AiGamePointsLedgerId;\n readonly authorityBand: AiGamePointsAuthorityBand;\n readonly authoritySystem: AiGamePointsAuthoritySystem;\n readonly requiresWorldAuthority: boolean;\n readonly combatSafeOnly: boolean;\n}\n\nexport interface AiGamePointsLedgerSnapshot {\n readonly ledgerId: AiGamePointsLedgerId;\n readonly balance: number;\n readonly earnedTotal: number;\n readonly spentTotal: number;\n readonly committedTotal: number;\n readonly asOfEpochMs?: number;\n}\n\nexport interface AiGamePointsSpendAction {\n readonly actionId: string;\n readonly title: string;\n readonly cost: number;\n readonly prerequisiteCodes: readonly string[];\n readonly consequenceCodes: readonly string[];\n}\n\nexport interface AiGamePointsSpendPolicy {\n readonly policyId: string;\n readonly ledgerId: AiGamePointsLedgerId;\n readonly authorityBoundary: AiGamePointsAuthorityBoundary;\n readonly actions: readonly AiGamePointsSpendAction[];\n}\n\nexport interface AiGameProtoSocialDevolutionPolicy {\n readonly actionId: \"return-to-slime\";\n readonly ledgerId: \"pp\";\n readonly cost: number;\n readonly requiredEvolutionStage: \"proto-social\";\n readonly closesAtEvolutionStage: \"social-lock\";\n readonly singleUse: true;\n readonly authorityBoundary: AiGamePointsAuthorityBoundary;\n readonly prerequisiteCodes: readonly string[];\n readonly consequenceCodes: readonly string[];\n}\n\nexport interface ResolveAiGameProtoSocialDevolutionEligibilityInput {\n readonly evolutionStage: AiGamePlayerEvolutionStage;\n readonly currentBalance: number;\n readonly alreadyUsed: boolean;\n}\n\nexport interface AiGameProtoSocialDevolutionEligibilityResult {\n readonly available: boolean;\n readonly reasonCodes: readonly string[];\n readonly policy: AiGameProtoSocialDevolutionPolicy;\n}\n\nexport interface AiGameProtoSocialDevolutionExecution {\n readonly actionId: \"return-to-slime\";\n readonly ledgerId: \"pp\";\n readonly cost: number;\n readonly authorityBoundary: AiGamePointsAuthorityBoundary;\n readonly previousEvolutionStage: \"proto-social\";\n readonly resultingEvolutionStage: \"proto-social\";\n readonly consequenceCodes: readonly string[];\n}\n\nconst AI_GAME_POINTS_AUTHORITY_BOUNDARY_BY_LEDGER: Readonly<\n Record<AiGamePointsLedgerId, AiGamePointsAuthorityBoundary>\n> = Object.freeze({\n pp: Object.freeze({\n ledgerId: \"pp\",\n authorityBand: \"self\",\n authoritySystem: \"player-system\",\n requiresWorldAuthority: false,\n combatSafeOnly: false,\n }),\n esp: Object.freeze({\n ledgerId: \"esp\",\n authorityBand: \"frontier\",\n authoritySystem: \"exploration-system\",\n requiresWorldAuthority: false,\n combatSafeOnly: true,\n }),\n tis: Object.freeze({\n ledgerId: \"tis\",\n authorityBand: \"civic\",\n authoritySystem: \"territorial-influence-system\",\n requiresWorldAuthority: true,\n combatSafeOnly: false,\n }),\n dis: Object.freeze({\n ledgerId: \"dis\",\n authorityBand: \"divine\",\n authoritySystem: \"divine-influence-system\",\n requiresWorldAuthority: true,\n combatSafeOnly: false,\n }),\n});\n\nconst AI_GAME_DEFAULT_POINTS_SPEND_POLICIES: readonly AiGamePointsSpendPolicy[] =\n Object.freeze([\n Object.freeze({\n policyId: \"pp-personal-respec\",\n ledgerId: \"pp\",\n authorityBoundary: AI_GAME_POINTS_AUTHORITY_BOUNDARY_BY_LEDGER.pp,\n actions: Object.freeze([\n Object.freeze({\n actionId: \"return-to-slime\",\n title: \"Return to slime\",\n cost: 12,\n prerequisiteCodes: Object.freeze([\"proto-social-window-open\", \"single-use-remaining\"]),\n consequenceCodes: Object.freeze([\"reset-social-form\", \"consume-pp-balance\"]),\n }),\n ]),\n }),\n Object.freeze({\n policyId: \"esp-exploration-routing\",\n ledgerId: \"esp\",\n authorityBoundary: AI_GAME_POINTS_AUTHORITY_BOUNDARY_BY_LEDGER.esp,\n actions: Object.freeze([\n Object.freeze({\n actionId: \"fast-travel-upgrade\",\n title: \"Unlock frontier fast travel\",\n cost: 8,\n prerequisiteCodes: Object.freeze([\"frontier-route-discovered\", \"out-of-combat-only\"]),\n consequenceCodes: Object.freeze([\"reduce-route-friction\"]),\n }),\n ]),\n }),\n Object.freeze({\n policyId: \"tis-civic-investment\",\n ledgerId: \"tis\",\n authorityBoundary: AI_GAME_POINTS_AUTHORITY_BOUNDARY_BY_LEDGER.tis,\n actions: Object.freeze([\n Object.freeze({\n actionId: \"district-favor\",\n title: \"Commit district influence favor\",\n cost: 5,\n prerequisiteCodes: Object.freeze([\"civic-authority-approval\"]),\n consequenceCodes: Object.freeze([\"alter-territorial-standing\"]),\n }),\n ]),\n }),\n Object.freeze({\n policyId: \"dis-divine-covenant\",\n ledgerId: \"dis\",\n authorityBoundary: AI_GAME_POINTS_AUTHORITY_BOUNDARY_BY_LEDGER.dis,\n actions: Object.freeze([\n Object.freeze({\n actionId: \"divine-oath\",\n title: \"Bind a divine covenant\",\n cost: 3,\n prerequisiteCodes: Object.freeze([\"divine-clearance-granted\"]),\n consequenceCodes: Object.freeze([\"alter-divine-standing\"]),\n }),\n ]),\n }),\n ]);\n\nconst AI_GAME_PROTO_SOCIAL_DEVOLUTION_POLICY: AiGameProtoSocialDevolutionPolicy =\n Object.freeze({\n actionId: \"return-to-slime\",\n ledgerId: \"pp\",\n cost: 12,\n requiredEvolutionStage: \"proto-social\",\n closesAtEvolutionStage: \"social-lock\",\n singleUse: true,\n authorityBoundary: AI_GAME_POINTS_AUTHORITY_BOUNDARY_BY_LEDGER.pp,\n prerequisiteCodes: Object.freeze([\"proto-social-window-open\", \"single-use-remaining\"]),\n consequenceCodes: Object.freeze([\"reset-social-form\", \"consume-pp-balance\"]),\n });\n\nfunction normalizeNonNegativeInteger(value: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.max(0, Math.trunc(value));\n}\n\nexport function isAiGamePointsLedgerId(value: string): value is AiGamePointsLedgerId {\n return (AI_GAME_POINTS_LEDGER_IDS as readonly string[]).includes(value);\n}\n\nexport function isAiGamePlayerEvolutionStage(\n value: string,\n): value is AiGamePlayerEvolutionStage {\n return (AI_GAME_PLAYER_EVOLUTION_STAGES as readonly string[]).includes(value);\n}\n\nexport function resolveAiGamePointsAuthorityBoundary(\n ledgerId: AiGamePointsLedgerId,\n): AiGamePointsAuthorityBoundary {\n return AI_GAME_POINTS_AUTHORITY_BOUNDARY_BY_LEDGER[ledgerId];\n}\n\nexport function createAiGamePointsLedgerSnapshot(\n input: AiGamePointsLedgerSnapshot,\n): AiGamePointsLedgerSnapshot {\n return Object.freeze({\n ledgerId: input.ledgerId,\n balance: normalizeNonNegativeInteger(input.balance),\n earnedTotal: normalizeNonNegativeInteger(input.earnedTotal),\n spentTotal: normalizeNonNegativeInteger(input.spentTotal),\n committedTotal: normalizeNonNegativeInteger(input.committedTotal),\n asOfEpochMs: input.asOfEpochMs,\n });\n}\n\nexport function getDefaultAiGamePointsSpendPolicies(): readonly AiGamePointsSpendPolicy[] {\n return AI_GAME_DEFAULT_POINTS_SPEND_POLICIES;\n}\n\nexport function getAiGameProtoSocialDevolutionPolicy(): AiGameProtoSocialDevolutionPolicy {\n return AI_GAME_PROTO_SOCIAL_DEVOLUTION_POLICY;\n}\n\n/**\n * Evaluate whether the one-time PP devolution action is still allowed.\n */\nexport function evaluateAiGameProtoSocialDevolutionEligibility(\n input: ResolveAiGameProtoSocialDevolutionEligibilityInput,\n): AiGameProtoSocialDevolutionEligibilityResult {\n const reasonCodes: string[] = [];\n const policy = AI_GAME_PROTO_SOCIAL_DEVOLUTION_POLICY;\n const currentBalance = normalizeNonNegativeInteger(input.currentBalance);\n\n if (input.evolutionStage !== policy.requiredEvolutionStage) {\n reasonCodes.push(\"devolution-window-closed\");\n }\n\n if (input.alreadyUsed) {\n reasonCodes.push(\"devolution-already-used\");\n }\n\n if (currentBalance < policy.cost) {\n reasonCodes.push(\"insufficient-pp-balance\");\n }\n\n if (reasonCodes.length === 0) {\n reasonCodes.push(\"devolution-allowed\");\n }\n\n return Object.freeze({\n available: reasonCodes.length === 1 && reasonCodes[0] === \"devolution-allowed\",\n reasonCodes: Object.freeze(reasonCodes),\n policy,\n });\n}\n","export type Version = string;\nexport type JsonValue =\n | null\n | boolean\n | number\n | string\n | readonly JsonValue[]\n | { readonly [key: string]: JsonValue };\n\nexport type GameWorldEventType =\n | \"monster.spawned\"\n | \"monster.killed\"\n | \"dungeon.created\"\n | \"dungeon.cleared\"\n | \"war.declared\"\n | \"war.resolved\"\n | \"famine.started\"\n | \"surplus.updated\"\n | \"system.checkpoint\";\n\nexport type GameEventVisibilityClass = \"global\" | \"regional\" | \"local\" | \"faction\" | \"secret\";\nexport type GameEventRecordType = \"candidate\" | \"canonical\";\nexport type GameEventSubmissionChannel = \"player\" | \"system\" | \"admin\" | \"simulation\";\nexport type GameEventActorKind = \"player\" | \"npc\" | \"monster\" | \"system\" | \"faction\" | \"environment\";\nexport type GameEventParticipantRole = \"causer\" | \"target\" | \"witness\" | \"owner\" | \"observer\";\nexport type GameEventSeverity = \"info\" | \"warning\" | \"critical\";\n\nexport interface GameEventActor {\n readonly kind: GameEventActorKind;\n readonly subjectRef: string;\n}\n\nexport interface GameEventParticipant {\n readonly role: GameEventParticipantRole;\n readonly actor: GameEventActor;\n}\n\nexport interface GameEventLocation {\n readonly world: string;\n readonly zone: string;\n readonly x?: number;\n readonly y?: number;\n readonly radiusMeters?: number;\n}\n\nexport interface GameEventCausation {\n readonly rootEventId?: string;\n readonly parentEventIds: readonly string[];\n readonly correlationId?: string;\n}\n\nexport interface GameWorldEventPayloadBase {\n readonly eventKind: GameEventSeverity;\n readonly summary: string;\n}\n\nexport interface MonsterSpawnedPayload extends GameWorldEventPayloadBase {\n readonly kind: \"monster.spawned\";\n readonly monsterType: string;\n readonly monsterRef: string;\n}\n\nexport interface MonsterKilledPayload extends GameWorldEventPayloadBase {\n readonly kind: \"monster.killed\";\n readonly monsterRef: string;\n readonly killerRef?: string;\n readonly encounterResult: \"vanquished\" | \"escaped\" | \"failed\";\n}\n\nexport interface DungeonCreatedPayload extends GameWorldEventPayloadBase {\n readonly kind: \"dungeon.created\";\n readonly dungeonRef: string;\n readonly dungeonType: string;\n readonly difficulty: number;\n}\n\nexport interface DungeonClearedPayload extends GameWorldEventPayloadBase {\n readonly kind: \"dungeon.cleared\";\n readonly dungeonRef: string;\n readonly clearedByPartyRef: string;\n readonly durationSeconds: number;\n}\n\nexport interface WarDeclaredPayload extends GameWorldEventPayloadBase {\n readonly kind: \"war.declared\";\n readonly aggressorFactionRef: string;\n readonly defenderFactionRef: string;\n readonly disputedZone: string;\n}\n\nexport interface WarResolvedPayload extends GameWorldEventPayloadBase {\n readonly kind: \"war.resolved\";\n readonly warEventRef: string;\n readonly outcome: \"ceasefire\" | \"victory\" | \"loss\" | \"draw\";\n readonly winnerFactionRef?: string;\n}\n\nexport interface FamineStartedPayload extends GameWorldEventPayloadBase {\n readonly kind: \"famine.started\";\n readonly zoneRef: string;\n readonly severity: \"low\" | \"moderate\" | \"high\" | \"critical\";\n}\n\nexport interface SurplusUpdatedPayload extends GameWorldEventPayloadBase {\n readonly kind: \"surplus.updated\";\n readonly commodity: string;\n readonly region: string;\n readonly previousBalance: number;\n readonly delta: number;\n}\n\nexport interface SystemCheckpointPayload extends GameWorldEventPayloadBase {\n readonly kind: \"system.checkpoint\";\n readonly sequence: string;\n readonly checkpointState: JsonValue;\n}\n\nexport type GameWorldEventPayload =\n | MonsterSpawnedPayload\n | MonsterKilledPayload\n | DungeonCreatedPayload\n | DungeonClearedPayload\n | WarDeclaredPayload\n | WarResolvedPayload\n | FamineStartedPayload\n | SurplusUpdatedPayload\n | SystemCheckpointPayload;\n\nexport interface GameWorldEventEnvelope {\n readonly eventId: string;\n readonly eventType: GameWorldEventType;\n readonly occurredAtEpochMs: number;\n readonly recordedAtEpochMs: number;\n readonly schemaVersion: string;\n readonly visibility: GameEventVisibilityClass;\n readonly location: GameEventLocation;\n readonly participants: readonly GameEventParticipant[];\n readonly causation: GameEventCausation;\n readonly source: string;\n readonly payload: GameWorldEventPayload;\n readonly tags: readonly string[];\n}\n\nexport interface GameWorldEventCandidate extends GameWorldEventEnvelope {\n readonly recordType: \"candidate\";\n readonly candidateId: string;\n readonly submittedBy?: GameEventActor;\n readonly submittedAtEpochMs: number;\n readonly submissionChannel: GameEventSubmissionChannel;\n}\n\nexport interface GameWorldEventCanonical extends GameWorldEventEnvelope {\n readonly recordType: \"canonical\";\n readonly canonicalEventId: string;\n readonly sourceCandidateId?: string;\n readonly approvedBy: string;\n readonly approvedAtEpochMs: number;\n}\n\nexport type GameWorldEvent = GameWorldEventCandidate | GameWorldEventCanonical;\n\nexport interface GameEventValidationIssue {\n readonly field: string;\n readonly message: string;\n readonly severity: GameEventSeverity;\n}\n\nexport interface GameEventValidationResult {\n readonly valid: boolean;\n readonly issues: readonly GameEventValidationIssue[];\n}\n\nexport interface GameEventSubmissionReceipt {\n readonly accepted: boolean;\n readonly candidateId: string;\n readonly eventId: string;\n readonly notes: readonly string[];\n}\n\nexport interface GameEventCommitReceipt {\n readonly committed: boolean;\n readonly eventId: string;\n readonly sequence: string;\n}\n\nexport interface ProjectionProjectorCheckpoint {\n readonly streamId: string;\n readonly lastAppliedEventOffset: number;\n readonly lastAppliedEventId: string;\n readonly eventVersion: Version;\n readonly updatedAtEpochMs: number;\n}\n\nexport interface ProjectionCheckpointStore {\n getCheckpoint(streamId: string): Promise<ProjectionProjectorCheckpoint | null>;\n setCheckpoint(checkpoint: ProjectionProjectorCheckpoint): Promise<void>;\n}\n\nexport interface WorldEventIngestionPort {\n submitCandidate(candidate: GameWorldEventCandidate): Promise<GameEventSubmissionReceipt>;\n commitCanonical(event: GameWorldEventCanonical): Promise<GameEventCommitReceipt>;\n validateCandidate(candidate: GameWorldEventCandidate): GameEventValidationResult;\n}\n\nexport interface WorldEventProjectorPort {\n readonly streamId: string;\n readonly checkpointStore: ProjectionCheckpointStore;\n project(event: GameWorldEventCanonical): Promise<void>;\n}\n\nexport type WorldIncidentImpactKey = \"security\" | \"economy\" | \"ecology\" | \"politics\" | \"morale\" | \"magic\" | \"population\";\n\nexport type WorldIncidentScope = \"local\" | \"regional\" | \"global\";\n\nexport type WorldIncidentLifecycle = \"active\" | \"resolved\" | \"superseded\" | \"expired\";\n\nexport interface WorldIncidentImpactVector {\n readonly security: number;\n readonly economy: number;\n readonly ecology: number;\n readonly politics: number;\n readonly morale: number;\n readonly magic: number;\n readonly population: number;\n}\n\nexport interface WorldIncidentResolution {\n readonly resolvedAtEpochMs: number;\n readonly closingEventRef: string;\n readonly summary: string;\n}\n\nexport interface WorldIncidentThread {\n readonly incidentId: string;\n readonly scope: WorldIncidentScope;\n readonly lifecycle: WorldIncidentLifecycle;\n readonly causeEventRef: string;\n readonly impact: WorldIncidentImpactVector;\n readonly openedAtEpochMs: number;\n readonly updatedAtEpochMs: number;\n readonly supersededBy?: string;\n readonly resolution?: WorldIncidentResolution;\n readonly affectedEventRefs: readonly string[];\n}\n\nexport interface WorldIncidentRegistry {\n readonly incidents: readonly WorldIncidentThread[];\n readonly activeCount: number;\n}\n\nexport function isCanonicalWorldEvent(event: GameWorldEvent): event is GameWorldEventCanonical {\n return event.recordType === \"canonical\";\n}\n\nexport function isCandidateWorldEvent(event: GameWorldEvent): event is GameWorldEventCandidate {\n return event.recordType === \"candidate\";\n}\n\nconst WORLD_IMPACT_SCALE_LIMIT = 100;\n\nfunction clampImpactValue(value: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n return Math.max(0, Math.min(WORLD_IMPACT_SCALE_LIMIT, value));\n}\n\nexport function normalizeIncidentImpactVector(\n impact: Partial<WorldIncidentImpactVector> | Record<string, number>,\n): Readonly<WorldIncidentImpactVector> {\n return Object.freeze({\n security: clampImpactValue(Number(impact.security ?? 0)),\n economy: clampImpactValue(Number(impact.economy ?? 0)),\n ecology: clampImpactValue(Number(impact.ecology ?? 0)),\n politics: clampImpactValue(Number(impact.politics ?? 0)),\n morale: clampImpactValue(Number(impact.morale ?? 0)),\n magic: clampImpactValue(Number(impact.magic ?? 0)),\n population: clampImpactValue(Number(impact.population ?? 0)),\n });\n}\n\nexport function isIncidentResolved(incident: WorldIncidentThread): boolean {\n return incident.lifecycle === \"resolved\" || incident.lifecycle === \"expired\";\n}\n","export type GossipSalience = \"low\" | \"medium\" | \"high\" | \"critical\";\nexport type GossipConfidence = \"uncertain\" | \"possible\" | \"strong\" | \"verified\";\nexport type GossipTopicStatus = \"active\" | \"corrected\" | \"resolved\" | \"stale\";\nexport type GossipAudienceSegment = \"player\" | \"npc\" | \"public\";\nexport type GossipProjectionMode = \"segment-level\" | \"npc-level\";\n\nexport interface EventSourceLink {\n readonly sourceType: \"event\" | \"incident\";\n readonly sourceId: string;\n}\n\nexport interface GossipSpeechHint {\n readonly sentenceTone: \"whisper\" | \"formal\" | \"urgent\";\n readonly localizedHintKey: string;\n}\n\nexport interface GossipTopicPayload {\n readonly factSummary: string;\n readonly certainty: number;\n readonly salience: GossipSalience;\n readonly evidenceRefs: readonly EventSourceLink[];\n readonly speechHint: GossipSpeechHint;\n}\n\nexport interface GossipTopic {\n readonly topicId: string;\n readonly status: GossipTopicStatus;\n readonly emittedAtEpochMs: number;\n readonly expiresAtEpochMs: number;\n readonly sourceLink: EventSourceLink;\n readonly sourceEventRef: string;\n readonly lineageOf?: string;\n readonly replacedBy?: string;\n readonly payload: GossipTopicPayload;\n readonly confidenceLevel: GossipConfidence;\n readonly audienceScope: \"faction\" | \"region\" | \"public\";\n}\n\nexport interface WitnessChannel {\n readonly witnessRef: string;\n readonly seenAtEpochMs: number;\n readonly confidenceWeight: number;\n}\n\nexport interface PerspectiveRule {\n readonly locality: readonly string[];\n readonly factions: readonly string[];\n readonly relationshipScore: number;\n}\n\nexport interface KnowledgeSource {\n readonly sourceType: \"segment\" | \"npc\";\n readonly sourceRef: string;\n readonly relationshipToAudience?: number;\n}\n\nexport interface GossipPerspectiveProjection {\n readonly projectionMode: GossipProjectionMode;\n readonly audienceSegment: GossipAudienceSegment;\n readonly requestedByNpcRef?: string;\n readonly locality: string;\n readonly faction: string;\n readonly segmentRules: readonly PerspectiveRule[];\n readonly witnessChannels: readonly WitnessChannel[];\n}\n\nexport interface ProjectedGossipEnvelope {\n readonly topicId: string;\n readonly visible: boolean;\n readonly redactedPayload?: GossipTopicPayload;\n readonly reasons: readonly string[];\n}\n\nexport interface GossipLifecyclePort {\n readonly topicId: string;\n load(): Promise<GossipTopic | null>;\n applyCorrection(next: GossipTopic): Promise<void>;\n markResolved(topicId: string, replacementTopicId?: string): Promise<void>;\n}\n\nexport interface GossipTopicEnvelope {\n readonly topic: GossipTopic;\n readonly topics: readonly EventSourceLink[];\n}\n\nexport function isGossipTopicActive(topic: GossipTopic, nowEpochMs = Date.now()): boolean {\n return topic.status === \"active\" && topic.expiresAtEpochMs > nowEpochMs && topic.payload.certainty >= 0.35;\n}\n\nexport function isGossipTopicCorrected(topic: GossipTopic): boolean {\n return topic.status === \"corrected\";\n}\n\nfunction matchSegmentAudience(\n sourceValue: readonly string[], targetValue: readonly string[], fallback: boolean,\n): boolean {\n if (sourceValue.length === 0 || targetValue.length === 0) {\n return fallback;\n }\n\n return sourceValue.some((value) => targetValue.includes(value));\n}\n\nexport function projectTopicForAudience(\n topic: GossipTopic,\n projection: GossipPerspectiveProjection,\n nowEpochMs = Date.now(),\n): ProjectedGossipEnvelope {\n if (!isGossipTopicActive(topic, nowEpochMs)) {\n return {\n topicId: topic.topicId,\n visible: false,\n reasons: [\"inactive-or-expired-topic\"],\n };\n }\n\n const hasMatchingRule = projection.segmentRules.some((rule) =>\n matchSegmentAudience(rule.locality, [projection.locality], true) &&\n matchSegmentAudience(rule.factions, [projection.faction], false)\n );\n\n if (!hasMatchingRule) {\n return {\n topicId: topic.topicId,\n visible: false,\n reasons: [\"audience-not-authorized\"],\n };\n }\n\n if (projection.projectionMode === \"segment-level\" && topic.audienceScope === \"public\") {\n return {\n topicId: topic.topicId,\n visible: true,\n redactedPayload: topic.payload,\n reasons: [\"segment-level-allowed\"],\n };\n }\n\n if (\n projection.projectionMode === \"npc-level\" &&\n projection.requestedByNpcRef &&\n topic.audienceScope === \"public\" &&\n projection.requestedByNpcRef.length > 0\n ) {\n return {\n topicId: topic.topicId,\n visible: true,\n redactedPayload: topic.payload,\n reasons: [\"npc-level-allowed\"],\n };\n }\n\n if (\n projection.projectionMode === \"npc-level\" &&\n projection.requestedByNpcRef &&\n topic.audienceScope !== \"public\" &&\n projection.requestedByNpcRef.length > 0\n ) {\n return {\n topicId: topic.topicId,\n visible: true,\n redactedPayload: topic.payload,\n reasons: [\"npc-level-allowed\"],\n };\n }\n\n return {\n topicId: topic.topicId,\n visible: false,\n reasons: [\"scope-constraints\"],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,uCAAuC;AAE7C,IAAM,4BAA4B,CAAC,MAAM,OAAO,OAAO,KAAK;AAI5D,IAAM,kCAAkC,CAAC,gBAAgB,aAAa;AAKtE,IAAM,iCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKO,IAAM,mCAAmC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAuEA,IAAM,8CAEF,OAAO,OAAO;AAAA,EAChB,IAAI,OAAO,OAAO;AAAA,IAChB,UAAU;AAAA,IACV,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,wBAAwB;AAAA,IACxB,gBAAgB;AAAA,EAClB,CAAC;AAAA,EACD,KAAK,OAAO,OAAO;AAAA,IACjB,UAAU;AAAA,IACV,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,wBAAwB;AAAA,IACxB,gBAAgB;AAAA,EAClB,CAAC;AA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,gBAAY,KAAK,gBAAgB;AAAA,EACnC;AAEA,MAAI,gBAAgB,YAAY;AAC9B,gBAAY,KAAK,yBAAyB;AAAA,EAC5C;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA,qBAAqB,OAAO,OAAO;AAAA,MACjC,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,GAAI,mBAAmB,CAAC,sBAAsB,mBAAmB,IAAI,CAAC;AAAA,IACxE,CAAC;AAAA,IACD,QAAQ;AAAA,IACR,OAAO;AAAA,MACL,UAAU,MAAM,YAAY;AAAA,MAC5B,eAAe,MAAM,iBAAiB;AAAA,MACtC,eAAe,MAAM,iBAAiB,OAAO,WAAW;AAAA,MACxD,WAAW,MAAM;AAAA,MACjB,SAAS,MAAM;AAAA,MACf;AAAA,MACA,gBAAgB,aAAa;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,oBAAyC,OAAO,OAAO;AAAA,EAClE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SAAS;AACX,CAAC;AAEM,IAAM,qBAAqB,OAAO,OAAO;AAAA,EAC9C,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,aAAa;AACf,CAAC;AAEM,IAAM,wBAAwB,OAAO,OAAO;AAAA,EACjD,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AACrB,CAAC;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,354 @@
|
|
|
1
|
+
declare const AI_GAME_POINTS_STORE_FEATURE_FLAG_ID = "isekai.player-system.points-store.enabled";
|
|
2
|
+
declare const AI_GAME_POINTS_LEDGER_IDS: readonly ["pp", "esp", "tis", "dis"];
|
|
3
|
+
type AiGamePointsLedgerId = (typeof AI_GAME_POINTS_LEDGER_IDS)[number];
|
|
4
|
+
declare const AI_GAME_PLAYER_EVOLUTION_STAGES: readonly ["proto-social", "social-lock"];
|
|
5
|
+
type AiGamePlayerEvolutionStage = (typeof AI_GAME_PLAYER_EVOLUTION_STAGES)[number];
|
|
6
|
+
declare const AI_GAME_POINTS_AUTHORITY_BANDS: readonly ["self", "frontier", "civic", "divine"];
|
|
7
|
+
type AiGamePointsAuthorityBand = (typeof AI_GAME_POINTS_AUTHORITY_BANDS)[number];
|
|
8
|
+
declare const AI_GAME_POINTS_AUTHORITY_SYSTEMS: readonly ["player-system", "exploration-system", "territorial-influence-system", "divine-influence-system"];
|
|
9
|
+
type AiGamePointsAuthoritySystem = (typeof AI_GAME_POINTS_AUTHORITY_SYSTEMS)[number];
|
|
10
|
+
interface AiGamePointsAuthorityBoundary {
|
|
11
|
+
readonly ledgerId: AiGamePointsLedgerId;
|
|
12
|
+
readonly authorityBand: AiGamePointsAuthorityBand;
|
|
13
|
+
readonly authoritySystem: AiGamePointsAuthoritySystem;
|
|
14
|
+
readonly requiresWorldAuthority: boolean;
|
|
15
|
+
readonly combatSafeOnly: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface AiGamePointsLedgerSnapshot {
|
|
18
|
+
readonly ledgerId: AiGamePointsLedgerId;
|
|
19
|
+
readonly balance: number;
|
|
20
|
+
readonly earnedTotal: number;
|
|
21
|
+
readonly spentTotal: number;
|
|
22
|
+
readonly committedTotal: number;
|
|
23
|
+
readonly asOfEpochMs?: number;
|
|
24
|
+
}
|
|
25
|
+
interface AiGamePointsSpendAction {
|
|
26
|
+
readonly actionId: string;
|
|
27
|
+
readonly title: string;
|
|
28
|
+
readonly cost: number;
|
|
29
|
+
readonly prerequisiteCodes: readonly string[];
|
|
30
|
+
readonly consequenceCodes: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
interface AiGamePointsSpendPolicy {
|
|
33
|
+
readonly policyId: string;
|
|
34
|
+
readonly ledgerId: AiGamePointsLedgerId;
|
|
35
|
+
readonly authorityBoundary: AiGamePointsAuthorityBoundary;
|
|
36
|
+
readonly actions: readonly AiGamePointsSpendAction[];
|
|
37
|
+
}
|
|
38
|
+
interface AiGameProtoSocialDevolutionPolicy {
|
|
39
|
+
readonly actionId: "return-to-slime";
|
|
40
|
+
readonly ledgerId: "pp";
|
|
41
|
+
readonly cost: number;
|
|
42
|
+
readonly requiredEvolutionStage: "proto-social";
|
|
43
|
+
readonly closesAtEvolutionStage: "social-lock";
|
|
44
|
+
readonly singleUse: true;
|
|
45
|
+
readonly authorityBoundary: AiGamePointsAuthorityBoundary;
|
|
46
|
+
readonly prerequisiteCodes: readonly string[];
|
|
47
|
+
readonly consequenceCodes: readonly string[];
|
|
48
|
+
}
|
|
49
|
+
interface ResolveAiGameProtoSocialDevolutionEligibilityInput {
|
|
50
|
+
readonly evolutionStage: AiGamePlayerEvolutionStage;
|
|
51
|
+
readonly currentBalance: number;
|
|
52
|
+
readonly alreadyUsed: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface AiGameProtoSocialDevolutionEligibilityResult {
|
|
55
|
+
readonly available: boolean;
|
|
56
|
+
readonly reasonCodes: readonly string[];
|
|
57
|
+
readonly policy: AiGameProtoSocialDevolutionPolicy;
|
|
58
|
+
}
|
|
59
|
+
interface AiGameProtoSocialDevolutionExecution {
|
|
60
|
+
readonly actionId: "return-to-slime";
|
|
61
|
+
readonly ledgerId: "pp";
|
|
62
|
+
readonly cost: number;
|
|
63
|
+
readonly authorityBoundary: AiGamePointsAuthorityBoundary;
|
|
64
|
+
readonly previousEvolutionStage: "proto-social";
|
|
65
|
+
readonly resultingEvolutionStage: "proto-social";
|
|
66
|
+
readonly consequenceCodes: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
declare function isAiGamePointsLedgerId(value: string): value is AiGamePointsLedgerId;
|
|
69
|
+
declare function isAiGamePlayerEvolutionStage(value: string): value is AiGamePlayerEvolutionStage;
|
|
70
|
+
declare function resolveAiGamePointsAuthorityBoundary(ledgerId: AiGamePointsLedgerId): AiGamePointsAuthorityBoundary;
|
|
71
|
+
declare function createAiGamePointsLedgerSnapshot(input: AiGamePointsLedgerSnapshot): AiGamePointsLedgerSnapshot;
|
|
72
|
+
declare function getDefaultAiGamePointsSpendPolicies(): readonly AiGamePointsSpendPolicy[];
|
|
73
|
+
declare function getAiGameProtoSocialDevolutionPolicy(): AiGameProtoSocialDevolutionPolicy;
|
|
74
|
+
/**
|
|
75
|
+
* Evaluate whether the one-time PP devolution action is still allowed.
|
|
76
|
+
*/
|
|
77
|
+
declare function evaluateAiGameProtoSocialDevolutionEligibility(input: ResolveAiGameProtoSocialDevolutionEligibilityInput): AiGameProtoSocialDevolutionEligibilityResult;
|
|
78
|
+
|
|
79
|
+
type Version = string;
|
|
80
|
+
type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
81
|
+
readonly [key: string]: JsonValue;
|
|
82
|
+
};
|
|
83
|
+
type GameWorldEventType = "monster.spawned" | "monster.killed" | "dungeon.created" | "dungeon.cleared" | "war.declared" | "war.resolved" | "famine.started" | "surplus.updated" | "system.checkpoint";
|
|
84
|
+
type GameEventVisibilityClass = "global" | "regional" | "local" | "faction" | "secret";
|
|
85
|
+
type GameEventRecordType = "candidate" | "canonical";
|
|
86
|
+
type GameEventSubmissionChannel = "player" | "system" | "admin" | "simulation";
|
|
87
|
+
type GameEventActorKind = "player" | "npc" | "monster" | "system" | "faction" | "environment";
|
|
88
|
+
type GameEventParticipantRole = "causer" | "target" | "witness" | "owner" | "observer";
|
|
89
|
+
type GameEventSeverity = "info" | "warning" | "critical";
|
|
90
|
+
interface GameEventActor {
|
|
91
|
+
readonly kind: GameEventActorKind;
|
|
92
|
+
readonly subjectRef: string;
|
|
93
|
+
}
|
|
94
|
+
interface GameEventParticipant {
|
|
95
|
+
readonly role: GameEventParticipantRole;
|
|
96
|
+
readonly actor: GameEventActor;
|
|
97
|
+
}
|
|
98
|
+
interface GameEventLocation {
|
|
99
|
+
readonly world: string;
|
|
100
|
+
readonly zone: string;
|
|
101
|
+
readonly x?: number;
|
|
102
|
+
readonly y?: number;
|
|
103
|
+
readonly radiusMeters?: number;
|
|
104
|
+
}
|
|
105
|
+
interface GameEventCausation {
|
|
106
|
+
readonly rootEventId?: string;
|
|
107
|
+
readonly parentEventIds: readonly string[];
|
|
108
|
+
readonly correlationId?: string;
|
|
109
|
+
}
|
|
110
|
+
interface GameWorldEventPayloadBase {
|
|
111
|
+
readonly eventKind: GameEventSeverity;
|
|
112
|
+
readonly summary: string;
|
|
113
|
+
}
|
|
114
|
+
interface MonsterSpawnedPayload extends GameWorldEventPayloadBase {
|
|
115
|
+
readonly kind: "monster.spawned";
|
|
116
|
+
readonly monsterType: string;
|
|
117
|
+
readonly monsterRef: string;
|
|
118
|
+
}
|
|
119
|
+
interface MonsterKilledPayload extends GameWorldEventPayloadBase {
|
|
120
|
+
readonly kind: "monster.killed";
|
|
121
|
+
readonly monsterRef: string;
|
|
122
|
+
readonly killerRef?: string;
|
|
123
|
+
readonly encounterResult: "vanquished" | "escaped" | "failed";
|
|
124
|
+
}
|
|
125
|
+
interface DungeonCreatedPayload extends GameWorldEventPayloadBase {
|
|
126
|
+
readonly kind: "dungeon.created";
|
|
127
|
+
readonly dungeonRef: string;
|
|
128
|
+
readonly dungeonType: string;
|
|
129
|
+
readonly difficulty: number;
|
|
130
|
+
}
|
|
131
|
+
interface DungeonClearedPayload extends GameWorldEventPayloadBase {
|
|
132
|
+
readonly kind: "dungeon.cleared";
|
|
133
|
+
readonly dungeonRef: string;
|
|
134
|
+
readonly clearedByPartyRef: string;
|
|
135
|
+
readonly durationSeconds: number;
|
|
136
|
+
}
|
|
137
|
+
interface WarDeclaredPayload extends GameWorldEventPayloadBase {
|
|
138
|
+
readonly kind: "war.declared";
|
|
139
|
+
readonly aggressorFactionRef: string;
|
|
140
|
+
readonly defenderFactionRef: string;
|
|
141
|
+
readonly disputedZone: string;
|
|
142
|
+
}
|
|
143
|
+
interface WarResolvedPayload extends GameWorldEventPayloadBase {
|
|
144
|
+
readonly kind: "war.resolved";
|
|
145
|
+
readonly warEventRef: string;
|
|
146
|
+
readonly outcome: "ceasefire" | "victory" | "loss" | "draw";
|
|
147
|
+
readonly winnerFactionRef?: string;
|
|
148
|
+
}
|
|
149
|
+
interface FamineStartedPayload extends GameWorldEventPayloadBase {
|
|
150
|
+
readonly kind: "famine.started";
|
|
151
|
+
readonly zoneRef: string;
|
|
152
|
+
readonly severity: "low" | "moderate" | "high" | "critical";
|
|
153
|
+
}
|
|
154
|
+
interface SurplusUpdatedPayload extends GameWorldEventPayloadBase {
|
|
155
|
+
readonly kind: "surplus.updated";
|
|
156
|
+
readonly commodity: string;
|
|
157
|
+
readonly region: string;
|
|
158
|
+
readonly previousBalance: number;
|
|
159
|
+
readonly delta: number;
|
|
160
|
+
}
|
|
161
|
+
interface SystemCheckpointPayload extends GameWorldEventPayloadBase {
|
|
162
|
+
readonly kind: "system.checkpoint";
|
|
163
|
+
readonly sequence: string;
|
|
164
|
+
readonly checkpointState: JsonValue;
|
|
165
|
+
}
|
|
166
|
+
type GameWorldEventPayload = MonsterSpawnedPayload | MonsterKilledPayload | DungeonCreatedPayload | DungeonClearedPayload | WarDeclaredPayload | WarResolvedPayload | FamineStartedPayload | SurplusUpdatedPayload | SystemCheckpointPayload;
|
|
167
|
+
interface GameWorldEventEnvelope {
|
|
168
|
+
readonly eventId: string;
|
|
169
|
+
readonly eventType: GameWorldEventType;
|
|
170
|
+
readonly occurredAtEpochMs: number;
|
|
171
|
+
readonly recordedAtEpochMs: number;
|
|
172
|
+
readonly schemaVersion: string;
|
|
173
|
+
readonly visibility: GameEventVisibilityClass;
|
|
174
|
+
readonly location: GameEventLocation;
|
|
175
|
+
readonly participants: readonly GameEventParticipant[];
|
|
176
|
+
readonly causation: GameEventCausation;
|
|
177
|
+
readonly source: string;
|
|
178
|
+
readonly payload: GameWorldEventPayload;
|
|
179
|
+
readonly tags: readonly string[];
|
|
180
|
+
}
|
|
181
|
+
interface GameWorldEventCandidate extends GameWorldEventEnvelope {
|
|
182
|
+
readonly recordType: "candidate";
|
|
183
|
+
readonly candidateId: string;
|
|
184
|
+
readonly submittedBy?: GameEventActor;
|
|
185
|
+
readonly submittedAtEpochMs: number;
|
|
186
|
+
readonly submissionChannel: GameEventSubmissionChannel;
|
|
187
|
+
}
|
|
188
|
+
interface GameWorldEventCanonical extends GameWorldEventEnvelope {
|
|
189
|
+
readonly recordType: "canonical";
|
|
190
|
+
readonly canonicalEventId: string;
|
|
191
|
+
readonly sourceCandidateId?: string;
|
|
192
|
+
readonly approvedBy: string;
|
|
193
|
+
readonly approvedAtEpochMs: number;
|
|
194
|
+
}
|
|
195
|
+
type GameWorldEvent = GameWorldEventCandidate | GameWorldEventCanonical;
|
|
196
|
+
interface GameEventValidationIssue {
|
|
197
|
+
readonly field: string;
|
|
198
|
+
readonly message: string;
|
|
199
|
+
readonly severity: GameEventSeverity;
|
|
200
|
+
}
|
|
201
|
+
interface GameEventValidationResult {
|
|
202
|
+
readonly valid: boolean;
|
|
203
|
+
readonly issues: readonly GameEventValidationIssue[];
|
|
204
|
+
}
|
|
205
|
+
interface GameEventSubmissionReceipt {
|
|
206
|
+
readonly accepted: boolean;
|
|
207
|
+
readonly candidateId: string;
|
|
208
|
+
readonly eventId: string;
|
|
209
|
+
readonly notes: readonly string[];
|
|
210
|
+
}
|
|
211
|
+
interface GameEventCommitReceipt {
|
|
212
|
+
readonly committed: boolean;
|
|
213
|
+
readonly eventId: string;
|
|
214
|
+
readonly sequence: string;
|
|
215
|
+
}
|
|
216
|
+
interface ProjectionProjectorCheckpoint {
|
|
217
|
+
readonly streamId: string;
|
|
218
|
+
readonly lastAppliedEventOffset: number;
|
|
219
|
+
readonly lastAppliedEventId: string;
|
|
220
|
+
readonly eventVersion: Version;
|
|
221
|
+
readonly updatedAtEpochMs: number;
|
|
222
|
+
}
|
|
223
|
+
interface ProjectionCheckpointStore {
|
|
224
|
+
getCheckpoint(streamId: string): Promise<ProjectionProjectorCheckpoint | null>;
|
|
225
|
+
setCheckpoint(checkpoint: ProjectionProjectorCheckpoint): Promise<void>;
|
|
226
|
+
}
|
|
227
|
+
interface WorldEventIngestionPort {
|
|
228
|
+
submitCandidate(candidate: GameWorldEventCandidate): Promise<GameEventSubmissionReceipt>;
|
|
229
|
+
commitCanonical(event: GameWorldEventCanonical): Promise<GameEventCommitReceipt>;
|
|
230
|
+
validateCandidate(candidate: GameWorldEventCandidate): GameEventValidationResult;
|
|
231
|
+
}
|
|
232
|
+
interface WorldEventProjectorPort {
|
|
233
|
+
readonly streamId: string;
|
|
234
|
+
readonly checkpointStore: ProjectionCheckpointStore;
|
|
235
|
+
project(event: GameWorldEventCanonical): Promise<void>;
|
|
236
|
+
}
|
|
237
|
+
type WorldIncidentImpactKey = "security" | "economy" | "ecology" | "politics" | "morale" | "magic" | "population";
|
|
238
|
+
type WorldIncidentScope = "local" | "regional" | "global";
|
|
239
|
+
type WorldIncidentLifecycle = "active" | "resolved" | "superseded" | "expired";
|
|
240
|
+
interface WorldIncidentImpactVector {
|
|
241
|
+
readonly security: number;
|
|
242
|
+
readonly economy: number;
|
|
243
|
+
readonly ecology: number;
|
|
244
|
+
readonly politics: number;
|
|
245
|
+
readonly morale: number;
|
|
246
|
+
readonly magic: number;
|
|
247
|
+
readonly population: number;
|
|
248
|
+
}
|
|
249
|
+
interface WorldIncidentResolution {
|
|
250
|
+
readonly resolvedAtEpochMs: number;
|
|
251
|
+
readonly closingEventRef: string;
|
|
252
|
+
readonly summary: string;
|
|
253
|
+
}
|
|
254
|
+
interface WorldIncidentThread {
|
|
255
|
+
readonly incidentId: string;
|
|
256
|
+
readonly scope: WorldIncidentScope;
|
|
257
|
+
readonly lifecycle: WorldIncidentLifecycle;
|
|
258
|
+
readonly causeEventRef: string;
|
|
259
|
+
readonly impact: WorldIncidentImpactVector;
|
|
260
|
+
readonly openedAtEpochMs: number;
|
|
261
|
+
readonly updatedAtEpochMs: number;
|
|
262
|
+
readonly supersededBy?: string;
|
|
263
|
+
readonly resolution?: WorldIncidentResolution;
|
|
264
|
+
readonly affectedEventRefs: readonly string[];
|
|
265
|
+
}
|
|
266
|
+
interface WorldIncidentRegistry {
|
|
267
|
+
readonly incidents: readonly WorldIncidentThread[];
|
|
268
|
+
readonly activeCount: number;
|
|
269
|
+
}
|
|
270
|
+
declare function isCanonicalWorldEvent(event: GameWorldEvent): event is GameWorldEventCanonical;
|
|
271
|
+
declare function isCandidateWorldEvent(event: GameWorldEvent): event is GameWorldEventCandidate;
|
|
272
|
+
declare function normalizeIncidentImpactVector(impact: Partial<WorldIncidentImpactVector> | Record<string, number>): Readonly<WorldIncidentImpactVector>;
|
|
273
|
+
declare function isIncidentResolved(incident: WorldIncidentThread): boolean;
|
|
274
|
+
|
|
275
|
+
type GossipSalience = "low" | "medium" | "high" | "critical";
|
|
276
|
+
type GossipConfidence = "uncertain" | "possible" | "strong" | "verified";
|
|
277
|
+
type GossipTopicStatus = "active" | "corrected" | "resolved" | "stale";
|
|
278
|
+
type GossipAudienceSegment = "player" | "npc" | "public";
|
|
279
|
+
type GossipProjectionMode = "segment-level" | "npc-level";
|
|
280
|
+
interface EventSourceLink {
|
|
281
|
+
readonly sourceType: "event" | "incident";
|
|
282
|
+
readonly sourceId: string;
|
|
283
|
+
}
|
|
284
|
+
interface GossipSpeechHint {
|
|
285
|
+
readonly sentenceTone: "whisper" | "formal" | "urgent";
|
|
286
|
+
readonly localizedHintKey: string;
|
|
287
|
+
}
|
|
288
|
+
interface GossipTopicPayload {
|
|
289
|
+
readonly factSummary: string;
|
|
290
|
+
readonly certainty: number;
|
|
291
|
+
readonly salience: GossipSalience;
|
|
292
|
+
readonly evidenceRefs: readonly EventSourceLink[];
|
|
293
|
+
readonly speechHint: GossipSpeechHint;
|
|
294
|
+
}
|
|
295
|
+
interface GossipTopic {
|
|
296
|
+
readonly topicId: string;
|
|
297
|
+
readonly status: GossipTopicStatus;
|
|
298
|
+
readonly emittedAtEpochMs: number;
|
|
299
|
+
readonly expiresAtEpochMs: number;
|
|
300
|
+
readonly sourceLink: EventSourceLink;
|
|
301
|
+
readonly sourceEventRef: string;
|
|
302
|
+
readonly lineageOf?: string;
|
|
303
|
+
readonly replacedBy?: string;
|
|
304
|
+
readonly payload: GossipTopicPayload;
|
|
305
|
+
readonly confidenceLevel: GossipConfidence;
|
|
306
|
+
readonly audienceScope: "faction" | "region" | "public";
|
|
307
|
+
}
|
|
308
|
+
interface WitnessChannel {
|
|
309
|
+
readonly witnessRef: string;
|
|
310
|
+
readonly seenAtEpochMs: number;
|
|
311
|
+
readonly confidenceWeight: number;
|
|
312
|
+
}
|
|
313
|
+
interface PerspectiveRule {
|
|
314
|
+
readonly locality: readonly string[];
|
|
315
|
+
readonly factions: readonly string[];
|
|
316
|
+
readonly relationshipScore: number;
|
|
317
|
+
}
|
|
318
|
+
interface KnowledgeSource {
|
|
319
|
+
readonly sourceType: "segment" | "npc";
|
|
320
|
+
readonly sourceRef: string;
|
|
321
|
+
readonly relationshipToAudience?: number;
|
|
322
|
+
}
|
|
323
|
+
interface GossipPerspectiveProjection {
|
|
324
|
+
readonly projectionMode: GossipProjectionMode;
|
|
325
|
+
readonly audienceSegment: GossipAudienceSegment;
|
|
326
|
+
readonly requestedByNpcRef?: string;
|
|
327
|
+
readonly locality: string;
|
|
328
|
+
readonly faction: string;
|
|
329
|
+
readonly segmentRules: readonly PerspectiveRule[];
|
|
330
|
+
readonly witnessChannels: readonly WitnessChannel[];
|
|
331
|
+
}
|
|
332
|
+
interface ProjectedGossipEnvelope {
|
|
333
|
+
readonly topicId: string;
|
|
334
|
+
readonly visible: boolean;
|
|
335
|
+
readonly redactedPayload?: GossipTopicPayload;
|
|
336
|
+
readonly reasons: readonly string[];
|
|
337
|
+
}
|
|
338
|
+
interface GossipLifecyclePort {
|
|
339
|
+
readonly topicId: string;
|
|
340
|
+
load(): Promise<GossipTopic | null>;
|
|
341
|
+
applyCorrection(next: GossipTopic): Promise<void>;
|
|
342
|
+
markResolved(topicId: string, replacementTopicId?: string): Promise<void>;
|
|
343
|
+
}
|
|
344
|
+
interface GossipTopicEnvelope {
|
|
345
|
+
readonly topic: GossipTopic;
|
|
346
|
+
readonly topics: readonly EventSourceLink[];
|
|
347
|
+
}
|
|
348
|
+
declare function isGossipTopicActive(topic: GossipTopic, nowEpochMs?: number): boolean;
|
|
349
|
+
declare function isGossipTopicCorrected(topic: GossipTopic): boolean;
|
|
350
|
+
declare function projectTopicForAudience(topic: GossipTopic, projection: GossipPerspectiveProjection, nowEpochMs?: number): ProjectedGossipEnvelope;
|
|
351
|
+
|
|
1
352
|
interface AiPackageDescriptor {
|
|
2
353
|
readonly packageName: string;
|
|
3
354
|
readonly featureFlagId: string;
|
|
@@ -5,8 +356,126 @@ interface AiPackageDescriptor {
|
|
|
5
356
|
readonly summary: string;
|
|
6
357
|
}
|
|
7
358
|
declare const AI_GAME_PACKAGE = "@plasius/ai-game";
|
|
8
|
-
declare const AI_GAME_FEATURE_FLAG_ID = "ai.game.enabled";
|
|
9
359
|
declare const AI_GAME_ENV_PREFIX = "AI_GAME";
|
|
360
|
+
declare const AI_GAME_FEATURE_FLAG_ID = "ai.game.enabled";
|
|
361
|
+
declare const AI_GAME_EVENT_CONTRACTS_FEATURE_FLAG_ID = "ai.game.event-recorder.contracts.enabled";
|
|
362
|
+
declare const AI_GAME_EVENT_INGESTION_FEATURE_FLAG_ID = "ai.game.event-recorder.ingestion.enabled";
|
|
363
|
+
declare const AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID = "ai.game.event-recorder.impact.enabled";
|
|
364
|
+
declare const AI_GAME_GOSSIP_TOPICS_FEATURE_FLAG_ID = "ai.game.npc-gossip.topics.enabled";
|
|
365
|
+
declare const AI_GAME_PERSPECTIVE_FEATURE_FLAG_ID = "ai.game.npc-gossip.perspective.enabled";
|
|
366
|
+
declare const AI_GAME_GOSSIP_LIFECYCLE_FEATURE_FLAG_ID = "ai.game.npc-gossip.lifecycle.enabled";
|
|
367
|
+
declare const AI_GAME_FEATURE_FLAGS: {
|
|
368
|
+
readonly workloads: "ai.game.enabled";
|
|
369
|
+
readonly ttsCacheEnabled: "ai.tts.cache.enabled";
|
|
370
|
+
readonly ttsNearReuseEnabled: "ai.tts.near-reuse.enabled";
|
|
371
|
+
};
|
|
372
|
+
type AiGameFeatureFlagKey = (typeof AI_GAME_FEATURE_FLAGS)[keyof typeof AI_GAME_FEATURE_FLAGS];
|
|
373
|
+
type AiGameFeatureFlagSnapshot = Partial<Record<AiGameFeatureFlagKey, boolean>>;
|
|
374
|
+
declare const AI_GAME_TASK_KINDS: readonly ["player-action-validation", "npc-action", "npc-dialogue", "gossip", "governance-feedback", "feedback", "unknown"];
|
|
375
|
+
type AiGameTaskKind = (typeof AI_GAME_TASK_KINDS)[number];
|
|
376
|
+
declare const AI_GAME_TASK_RISK_CLASSES: readonly ["low", "medium", "high", "critical"];
|
|
377
|
+
type AiGameTaskRiskClass = (typeof AI_GAME_TASK_RISK_CLASSES)[number];
|
|
378
|
+
declare const AI_GAME_TASK_AUTHORITY_BOUNDARIES: readonly ["deterministic", "human-review", "operator-review", "blocked"];
|
|
379
|
+
type AiGameAuthorityBoundary = (typeof AI_GAME_TASK_AUTHORITY_BOUNDARIES)[number];
|
|
380
|
+
declare const AI_GAME_TASK_DECISIONS: readonly ["allow", "operator-review", "blocked"];
|
|
381
|
+
type AiGameTaskDecisionResult = (typeof AI_GAME_TASK_DECISIONS)[number];
|
|
382
|
+
declare const AI_GAME_TASK_RESULTS: readonly ["allow", "defer", "deny"];
|
|
383
|
+
type AiGameTaskResult = (typeof AI_GAME_TASK_RESULTS)[number];
|
|
384
|
+
declare const AI_GAME_TTS_CACHE_POLICIES: readonly ["exact-cache", "near-cache", "no-cache"];
|
|
385
|
+
type AiGameTtsCachePolicy = (typeof AI_GAME_TTS_CACHE_POLICIES)[number];
|
|
386
|
+
declare const AI_GAME_ACTOR_ROLES: readonly ["player", "npc", "operator", "system"];
|
|
387
|
+
type AiGameActorRole = (typeof AI_GAME_ACTOR_ROLES)[number];
|
|
388
|
+
interface AiGameTaskRequest {
|
|
389
|
+
readonly taskId: string;
|
|
390
|
+
readonly taskText: string;
|
|
391
|
+
readonly taskKind?: AiGameTaskKind;
|
|
392
|
+
}
|
|
393
|
+
interface AiGameTaskDecision {
|
|
394
|
+
readonly taskId: string;
|
|
395
|
+
readonly taskKind: AiGameTaskKind;
|
|
396
|
+
readonly riskClass: AiGameTaskRiskClass;
|
|
397
|
+
readonly authorityBoundary: AiGameAuthorityBoundary;
|
|
398
|
+
readonly decision: AiGameTaskDecisionResult;
|
|
399
|
+
readonly needsOperatorReview: boolean;
|
|
400
|
+
readonly reasonCodes: readonly string[];
|
|
401
|
+
}
|
|
402
|
+
interface AiGamePolicyAuditBase {
|
|
403
|
+
readonly policyId: string;
|
|
404
|
+
readonly policyVersion: string;
|
|
405
|
+
readonly correlationId: string;
|
|
406
|
+
readonly requestId?: string;
|
|
407
|
+
readonly actorId?: string;
|
|
408
|
+
readonly actorRole: AiGameActorRole;
|
|
409
|
+
readonly evaluatedAtUtc: string;
|
|
410
|
+
}
|
|
411
|
+
interface ResolveAiGameTaskInput {
|
|
412
|
+
readonly actorRole?: AiGameActorRole;
|
|
413
|
+
readonly actorId?: string;
|
|
414
|
+
readonly requestId?: string;
|
|
415
|
+
readonly correlationId?: string;
|
|
416
|
+
readonly policyId?: string;
|
|
417
|
+
readonly policyVersion?: string;
|
|
418
|
+
readonly featureFlags?: AiGameFeatureFlagSnapshot;
|
|
419
|
+
readonly requests: readonly AiGameTaskRequest[];
|
|
420
|
+
readonly reasonCodes?: readonly string[];
|
|
421
|
+
}
|
|
422
|
+
interface AiGameTaskResolution {
|
|
423
|
+
readonly requestedTasks: readonly string[];
|
|
424
|
+
readonly taskDecisions: readonly AiGameTaskDecision[];
|
|
425
|
+
readonly allowedTaskIds: readonly string[];
|
|
426
|
+
readonly reviewTaskIds: readonly string[];
|
|
427
|
+
readonly blockedTaskIds: readonly string[];
|
|
428
|
+
readonly needsOperatorReview: boolean;
|
|
429
|
+
readonly featureEnabled: boolean;
|
|
430
|
+
readonly enabledFeatureFlags: readonly AiGameFeatureFlagKey[];
|
|
431
|
+
readonly source: "policy" | "policy-disabled" | "policy-empty";
|
|
432
|
+
readonly audit: AiGamePolicyAuditBase & {
|
|
433
|
+
readonly result: AiGameTaskResult;
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
interface ResolveAiGamePlayerAddressInput {
|
|
437
|
+
readonly playerAddressText: string;
|
|
438
|
+
readonly playerAlias?: string;
|
|
439
|
+
readonly accountAlias?: string;
|
|
440
|
+
readonly actorRole?: AiGameActorRole;
|
|
441
|
+
readonly actorId?: string;
|
|
442
|
+
readonly requestId?: string;
|
|
443
|
+
readonly correlationId?: string;
|
|
444
|
+
readonly policyId?: string;
|
|
445
|
+
readonly policyVersion?: string;
|
|
446
|
+
readonly featureFlags?: AiGameFeatureFlagSnapshot;
|
|
447
|
+
readonly reasonCodes?: readonly string[];
|
|
448
|
+
}
|
|
449
|
+
interface ResolveAiGamePlayerAddressResult {
|
|
450
|
+
readonly sourceText: string;
|
|
451
|
+
readonly renderText: string;
|
|
452
|
+
readonly ttsCachePolicy: AiGameTtsCachePolicy;
|
|
453
|
+
readonly reasonCodes: readonly string[];
|
|
454
|
+
readonly enabledFeatureFlags: readonly AiGameFeatureFlagKey[];
|
|
455
|
+
readonly source: "policy" | "policy-disabled" | "policy-empty";
|
|
456
|
+
readonly audit: AiGamePolicyAuditBase & {
|
|
457
|
+
readonly cachePolicy: AiGameTtsCachePolicy;
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
declare function classifyAiGameTask(taskText: string): AiGameTaskKind;
|
|
461
|
+
/**
|
|
462
|
+
* Resolve game AI task contracts for player actions, NPC actions, gossip, and governance.
|
|
463
|
+
*/
|
|
464
|
+
declare function resolveAiGameTaskBatch(input: ResolveAiGameTaskInput): AiGameTaskResolution;
|
|
465
|
+
/**
|
|
466
|
+
* Resolve cache policy for player-account text before speech rendering.
|
|
467
|
+
*/
|
|
468
|
+
declare function resolveAiGamePlayerAddressText(input: ResolveAiGamePlayerAddressInput): ResolveAiGamePlayerAddressResult;
|
|
10
469
|
declare const packageDescriptor: AiPackageDescriptor;
|
|
470
|
+
declare const aiGameFeatureFlags: Readonly<{
|
|
471
|
+
contract: "ai.game.event-recorder.contracts.enabled";
|
|
472
|
+
ingestion: "ai.game.event-recorder.ingestion.enabled";
|
|
473
|
+
incident: "ai.game.event-recorder.impact.enabled";
|
|
474
|
+
gossipTopics: "ai.game.npc-gossip.topics.enabled";
|
|
475
|
+
gossipPerspective: "ai.game.npc-gossip.perspective.enabled";
|
|
476
|
+
gossipLifecycle: "ai.game.npc-gossip.lifecycle.enabled";
|
|
477
|
+
pointsStore: "isekai.player-system.points-store.enabled";
|
|
478
|
+
}>;
|
|
479
|
+
declare const gameEventFeatureFlags: readonly ("ai.game.event-recorder.contracts.enabled" | "ai.game.event-recorder.ingestion.enabled" | "ai.game.event-recorder.impact.enabled" | "ai.game.npc-gossip.topics.enabled" | "ai.game.npc-gossip.perspective.enabled" | "ai.game.npc-gossip.lifecycle.enabled" | "isekai.player-system.points-store.enabled")[];
|
|
11
480
|
|
|
12
|
-
export { AI_GAME_ENV_PREFIX, AI_GAME_FEATURE_FLAG_ID, AI_GAME_PACKAGE, type AiPackageDescriptor, packageDescriptor };
|
|
481
|
+
export { AI_GAME_ACTOR_ROLES, AI_GAME_ENV_PREFIX, AI_GAME_EVENT_CONTRACTS_FEATURE_FLAG_ID, AI_GAME_EVENT_INGESTION_FEATURE_FLAG_ID, AI_GAME_FEATURE_FLAGS, AI_GAME_FEATURE_FLAG_ID, AI_GAME_GOSSIP_LIFECYCLE_FEATURE_FLAG_ID, AI_GAME_GOSSIP_TOPICS_FEATURE_FLAG_ID, AI_GAME_INCIDENT_IMPACT_FEATURE_FLAG_ID, AI_GAME_PACKAGE, AI_GAME_PERSPECTIVE_FEATURE_FLAG_ID, AI_GAME_PLAYER_EVOLUTION_STAGES, AI_GAME_POINTS_AUTHORITY_BANDS, AI_GAME_POINTS_AUTHORITY_SYSTEMS, AI_GAME_POINTS_LEDGER_IDS, AI_GAME_POINTS_STORE_FEATURE_FLAG_ID, AI_GAME_TASK_AUTHORITY_BOUNDARIES, AI_GAME_TASK_DECISIONS, AI_GAME_TASK_KINDS, AI_GAME_TASK_RESULTS, AI_GAME_TASK_RISK_CLASSES, AI_GAME_TTS_CACHE_POLICIES, type AiGameActorRole, type AiGameAuthorityBoundary, type AiGameFeatureFlagKey, type AiGameFeatureFlagSnapshot, type AiGamePlayerEvolutionStage, type AiGamePointsAuthorityBand, type AiGamePointsAuthorityBoundary, type AiGamePointsAuthoritySystem, type AiGamePointsLedgerId, type AiGamePointsLedgerSnapshot, type AiGamePointsSpendAction, type AiGamePointsSpendPolicy, type AiGamePolicyAuditBase, type AiGameProtoSocialDevolutionEligibilityResult, type AiGameProtoSocialDevolutionExecution, type AiGameProtoSocialDevolutionPolicy, type AiGameTaskDecision, type AiGameTaskDecisionResult, type AiGameTaskKind, type AiGameTaskRequest, type AiGameTaskResolution, type AiGameTaskResult, type AiGameTaskRiskClass, type AiGameTtsCachePolicy, type AiPackageDescriptor, type DungeonClearedPayload, type DungeonCreatedPayload, type EventSourceLink, type FamineStartedPayload, type GameEventActor, type GameEventActorKind, type GameEventCausation, type GameEventCommitReceipt, type GameEventLocation, type GameEventParticipant, type GameEventParticipantRole, type GameEventRecordType, type GameEventSeverity, type GameEventSubmissionChannel, type GameEventSubmissionReceipt, type GameEventValidationIssue, type GameEventValidationResult, type GameEventVisibilityClass, type GameWorldEvent, type GameWorldEventCandidate, type GameWorldEventCanonical, type GameWorldEventEnvelope, type GameWorldEventPayload, type GameWorldEventPayloadBase, type GameWorldEventType, type GossipAudienceSegment, type GossipConfidence, type GossipLifecyclePort, type GossipPerspectiveProjection, type GossipProjectionMode, type GossipSalience, type GossipSpeechHint, type GossipTopic, type GossipTopicEnvelope, type GossipTopicPayload, type GossipTopicStatus, type JsonValue, type KnowledgeSource, type MonsterKilledPayload, type MonsterSpawnedPayload, type PerspectiveRule, type ProjectedGossipEnvelope, type ProjectionCheckpointStore, type ProjectionProjectorCheckpoint, type ResolveAiGamePlayerAddressInput, type ResolveAiGamePlayerAddressResult, type ResolveAiGameProtoSocialDevolutionEligibilityInput, type ResolveAiGameTaskInput, type SurplusUpdatedPayload, type SystemCheckpointPayload, type Version, type WarDeclaredPayload, type WarResolvedPayload, type WitnessChannel, type WorldEventIngestionPort, type WorldEventProjectorPort, type WorldIncidentImpactKey, type WorldIncidentImpactVector, type WorldIncidentLifecycle, type WorldIncidentRegistry, type WorldIncidentResolution, type WorldIncidentScope, type WorldIncidentThread, aiGameFeatureFlags, classifyAiGameTask, createAiGamePointsLedgerSnapshot, evaluateAiGameProtoSocialDevolutionEligibility, gameEventFeatureFlags, getAiGameProtoSocialDevolutionPolicy, getDefaultAiGamePointsSpendPolicies, isAiGamePlayerEvolutionStage, isAiGamePointsLedgerId, isCandidateWorldEvent, isCanonicalWorldEvent, isGossipTopicActive, isGossipTopicCorrected, isIncidentResolved, normalizeIncidentImpactVector, packageDescriptor, projectTopicForAudience, resolveAiGamePlayerAddressText, resolveAiGamePointsAuthorityBoundary, resolveAiGameTaskBatch };
|