@plasius/player-system-interface 0.1.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -4
- package/dist/index.cjs +62 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -6
- package/dist/index.d.ts +39 -6
- package/dist/index.js +59 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ npm install @plasius/player-system-interface
|
|
|
25
25
|
- focus panes and combat-safe reductions
|
|
26
26
|
- world-space overlay panel definitions
|
|
27
27
|
- target popup anchors and alert markers
|
|
28
|
+
- self-state and line-of-sight identity projection overlays
|
|
28
29
|
- overlay accessibility contracts for keyboard, focus restoration, and announcements
|
|
29
30
|
- frame-budget assumptions for diegetic panel updates
|
|
30
31
|
- Party/System composition metadata
|
|
@@ -94,7 +95,7 @@ console.log(
|
|
|
94
95
|
|
|
95
96
|
## Interface NFR Contract
|
|
96
97
|
|
|
97
|
-
The inherited feature flag for this work is `
|
|
98
|
+
The inherited feature flag for this work is `harmony.player-system.interface.enabled`.
|
|
98
99
|
|
|
99
100
|
`defaultPlayerSystemInterfaceContract` and `createPlayerSystemInterfaceContract()` make these host expectations explicit:
|
|
100
101
|
|
|
@@ -106,7 +107,7 @@ The inherited feature flag for this work is `isekai.player-system.interface.enab
|
|
|
106
107
|
|
|
107
108
|
## Interface Portability Contract
|
|
108
109
|
|
|
109
|
-
The inherited feature flag for this work is `
|
|
110
|
+
The inherited feature flag for this work is `harmony.player-system.interface.enabled`.
|
|
110
111
|
|
|
111
112
|
`defaultPlayerSystemInterfacePortabilityContract`,
|
|
112
113
|
`createPlayerSystemInterfacePortabilityContract()`, and
|
|
@@ -127,6 +128,42 @@ The inherited feature flag for this work is `isekai.player-system.interface.enab
|
|
|
127
128
|
- Party and Player System surfaces can coexist in one shell definition
|
|
128
129
|
- reduced-combat behavior is explicit per surface and bounded by the shell policy
|
|
129
130
|
|
|
131
|
+
## Identity Status Overlays
|
|
132
|
+
|
|
133
|
+
`createIdentityStatusOverlayDefinition()` represents the Identity System's
|
|
134
|
+
self-state and explicit external target projections. The inherited feature
|
|
135
|
+
flag is `harmony.player-system.identity.enabled`.
|
|
136
|
+
|
|
137
|
+
- Self-state overlays use the `self-state` invocation and never require line of
|
|
138
|
+
sight.
|
|
139
|
+
- External overlays require an explicit `identity-sweep` or `spell-targeting`
|
|
140
|
+
invocation and line of sight.
|
|
141
|
+
- `allied`, `neutral`, `unknown`, and `unfriendly` are operational targeting
|
|
142
|
+
categories, not absolute moral truth labels.
|
|
143
|
+
- `readableFacts` must be a subset of `perceivableFacts`; use `partial`,
|
|
144
|
+
`fuzzy`, or `withheld` confidence when identity truth is incomplete.
|
|
145
|
+
- Add identity overlays to a shell with an `identity-overlay` surface and use
|
|
146
|
+
`assessIdentityStatusOverlayDefinition()` / `assessInterfaceShellDefinition()`
|
|
147
|
+
before rendering.
|
|
148
|
+
|
|
149
|
+
## Project Harmony namespace migration
|
|
150
|
+
|
|
151
|
+
The Project Harmony cutover is a breaking public-contract change. Consumers
|
|
152
|
+
moving to the next major release must replace these rollout values before
|
|
153
|
+
enabling `harmony.namespace-cutover.enabled`:
|
|
154
|
+
|
|
155
|
+
| Previous key | Harmony key |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `isekai.player-system.interface.enabled` | `harmony.player-system.interface.enabled` |
|
|
158
|
+
| `isekai.player-system.identity.enabled` | `harmony.player-system.identity.enabled` |
|
|
159
|
+
| `isekai.player-system.packages.enabled` | `harmony.player-system.packages.enabled` |
|
|
160
|
+
| `isekai.player-system.runtime-nfr.enabled` | `harmony.player-system.runtime-nfr.enabled` |
|
|
161
|
+
| `isekai.player-system.runtime-portability.enabled` | `harmony.player-system.runtime-portability.enabled` |
|
|
162
|
+
|
|
163
|
+
The package publishes only Harmony values. It provides no aliases, dual-read
|
|
164
|
+
parsing, environment fallback, or runtime translation for the previous product
|
|
165
|
+
namespace. Caller-supplied interface overrides must also use `harmony.*` keys.
|
|
166
|
+
|
|
130
167
|
## Shell State, 3D Panes, and Ambient Alerts
|
|
131
168
|
|
|
132
169
|
`createInterfaceShellState()` represents ambient, focused, and combat-safe
|
|
@@ -149,6 +186,8 @@ map with an explicit live-region mode. Resolve the best available copy with
|
|
|
149
186
|
- ADRs: [docs/adrs](./docs/adrs)
|
|
150
187
|
- TDRs: [docs/tdrs](./docs/tdrs)
|
|
151
188
|
- Design notes: [docs/design](./docs/design)
|
|
152
|
-
- Parent feature flag: `
|
|
189
|
+
- Parent feature flag: `harmony.player-system.interface.enabled`
|
|
153
190
|
- Capability: not required for package bootstrap; interface adoption remains feature-flag led
|
|
154
|
-
- Rollback: disable `
|
|
191
|
+
- Rollback: disable `harmony.player-system.interface.enabled` to halt package-family adoption without changing package code
|
|
192
|
+
- Identity rollback: disable `harmony.player-system.identity.enabled` to stop identity projection adoption without changing package code
|
|
193
|
+
- Namespace rollback: disable `harmony.namespace-cutover.enabled`, restore the previous coordinated package majors, and complete the approved reverse stored-value migration before re-enabling consumers
|
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID,
|
|
23
24
|
PLAYER_SYSTEM_INTERFACE_ENV_PREFIX: () => PLAYER_SYSTEM_INTERFACE_ENV_PREFIX,
|
|
24
25
|
PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,
|
|
25
26
|
PLAYER_SYSTEM_INTERFACE_PACKAGE: () => PLAYER_SYSTEM_INTERFACE_PACKAGE,
|
|
@@ -27,9 +28,11 @@ __export(index_exports, {
|
|
|
27
28
|
PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
28
29
|
PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
29
30
|
applyInterfaceShellFocusShift: () => applyInterfaceShellFocusShift,
|
|
31
|
+
assessIdentityStatusOverlayDefinition: () => assessIdentityStatusOverlayDefinition,
|
|
30
32
|
assessInterfaceShellDefinition: () => assessInterfaceShellDefinition,
|
|
31
33
|
assessPlayerSystemInterfaceComposition: () => assessPlayerSystemInterfaceComposition,
|
|
32
34
|
createFocusPaneShellDefinition: () => createFocusPaneShellDefinition,
|
|
35
|
+
createIdentityStatusOverlayDefinition: () => createIdentityStatusOverlayDefinition,
|
|
33
36
|
createInterfaceShellDefinition: () => createInterfaceShellDefinition,
|
|
34
37
|
createInterfaceShellState: () => createInterfaceShellState,
|
|
35
38
|
createInterfaceShellSurfaceDefinition: () => createInterfaceShellSurfaceDefinition,
|
|
@@ -49,10 +52,11 @@ __export(index_exports, {
|
|
|
49
52
|
module.exports = __toCommonJS(index_exports);
|
|
50
53
|
var PLAYER_SYSTEM_INTERFACE_PACKAGE = "@plasius/player-system-interface";
|
|
51
54
|
var PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = "PLAYER_SYSTEM_INTERFACE";
|
|
52
|
-
var PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "
|
|
55
|
+
var PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
53
56
|
var PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;
|
|
54
57
|
var PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;
|
|
55
58
|
var PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;
|
|
59
|
+
var PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID = "harmony.player-system.identity.enabled";
|
|
56
60
|
var packageDescriptor = Object.freeze({
|
|
57
61
|
packageName: PLAYER_SYSTEM_INTERFACE_PACKAGE,
|
|
58
62
|
featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,
|
|
@@ -105,7 +109,8 @@ var defaultReducedCombatOverlayPolicy = Object.freeze({
|
|
|
105
109
|
retainedSurfaceKinds: Object.freeze([
|
|
106
110
|
"alert-marker",
|
|
107
111
|
"target-popup",
|
|
108
|
-
"focus-pane"
|
|
112
|
+
"focus-pane",
|
|
113
|
+
"identity-overlay"
|
|
109
114
|
]),
|
|
110
115
|
maxInteractiveSurfaces: 1
|
|
111
116
|
});
|
|
@@ -159,6 +164,13 @@ function createFocusPaneShellDefinition(input) {
|
|
|
159
164
|
function createLineOfSightTargetPopupDefinition(input) {
|
|
160
165
|
return Object.freeze({ ...input });
|
|
161
166
|
}
|
|
167
|
+
function createIdentityStatusOverlayDefinition(input) {
|
|
168
|
+
return Object.freeze({
|
|
169
|
+
...input,
|
|
170
|
+
perceivableFacts: Object.freeze([...input.perceivableFacts]),
|
|
171
|
+
readableFacts: Object.freeze([...input.readableFacts])
|
|
172
|
+
});
|
|
173
|
+
}
|
|
162
174
|
function createThreeDPaneHostDefinition(input) {
|
|
163
175
|
return Object.freeze({
|
|
164
176
|
...input,
|
|
@@ -177,6 +189,7 @@ function createInterfaceShellDefinition(input = {}) {
|
|
|
177
189
|
surfaces: Object.freeze([...input.surfaces ?? []]),
|
|
178
190
|
focusPane: input.focusPane ? Object.freeze({ ...input.focusPane }) : void 0,
|
|
179
191
|
targetPopups: Object.freeze([...input.targetPopups ?? []]),
|
|
192
|
+
identityOverlays: Object.freeze([...input.identityOverlays ?? []]),
|
|
180
193
|
paneHosts: Object.freeze([...input.paneHosts ?? []]),
|
|
181
194
|
ambientAlerts: Object.freeze([...input.ambientAlerts ?? []]),
|
|
182
195
|
reducedCombat: Object.freeze({
|
|
@@ -223,6 +236,38 @@ function applyInterfaceShellFocusShift(state, focusShift) {
|
|
|
223
236
|
function resolveLocalizedAmbientAlertMessage(alert, locale, fallbackLocale = "en-GB") {
|
|
224
237
|
return alert.localizedMessages[locale] ?? alert.localizedMessages[fallbackLocale];
|
|
225
238
|
}
|
|
239
|
+
function assessIdentityStatusOverlayDefinition(overlay) {
|
|
240
|
+
const violations = [];
|
|
241
|
+
const perceivableFacts = new Set(overlay.perceivableFacts);
|
|
242
|
+
if (overlay.readableFacts.some((fact) => !perceivableFacts.has(fact))) {
|
|
243
|
+
violations.push("readableFacts");
|
|
244
|
+
}
|
|
245
|
+
if (overlay.readConfidence === "withheld" && overlay.readableFacts.length > 0) {
|
|
246
|
+
violations.push("withheldRead");
|
|
247
|
+
}
|
|
248
|
+
if (overlay.targetKind === "self") {
|
|
249
|
+
if (overlay.relation !== "self") {
|
|
250
|
+
violations.push("selfRelation");
|
|
251
|
+
}
|
|
252
|
+
if (overlay.invocation !== "self-state") {
|
|
253
|
+
violations.push("selfInvocation");
|
|
254
|
+
}
|
|
255
|
+
if (overlay.requiresLineOfSight) {
|
|
256
|
+
violations.push("selfLineOfSight");
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
if (overlay.targetId.length === 0) {
|
|
260
|
+
violations.push("targetId");
|
|
261
|
+
}
|
|
262
|
+
if (!overlay.requiresLineOfSight) {
|
|
263
|
+
violations.push("lineOfSight");
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return Object.freeze({
|
|
267
|
+
accepted: violations.length === 0,
|
|
268
|
+
violations: Object.freeze(violations)
|
|
269
|
+
});
|
|
270
|
+
}
|
|
226
271
|
function assessPlayerSystemInterfaceComposition(sample, contract = defaultPlayerSystemInterfacePortabilityContract) {
|
|
227
272
|
const violations = [];
|
|
228
273
|
if (sample.panelCount > contract.compositionScale.maxWorldPanels) {
|
|
@@ -272,6 +317,18 @@ function assessInterfaceShellDefinition(shell) {
|
|
|
272
317
|
violations.push(`popup:${popup.popupId}`);
|
|
273
318
|
}
|
|
274
319
|
}
|
|
320
|
+
for (const overlay of shell.identityOverlays) {
|
|
321
|
+
const identityAssessment = assessIdentityStatusOverlayDefinition(overlay);
|
|
322
|
+
for (const violation of identityAssessment.violations) {
|
|
323
|
+
violations.push(`identityOverlay:${overlay.overlayId}:${violation}`);
|
|
324
|
+
}
|
|
325
|
+
const matchingSurface = shell.surfaces.find(
|
|
326
|
+
(surface) => surface.surfaceId === overlay.surfaceId && surface.kind === "identity-overlay"
|
|
327
|
+
);
|
|
328
|
+
if (!matchingSurface) {
|
|
329
|
+
violations.push(`identityOverlaySurface:${overlay.overlayId}`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
275
332
|
for (const paneHost of shell.paneHosts) {
|
|
276
333
|
const matchingSurface = shell.surfaces.find(
|
|
277
334
|
(surface) => surface.surfaceId === paneHost.surfaceId && surface.owner === paneHost.owner && surface.anchorId === paneHost.anchorId
|
|
@@ -295,6 +352,7 @@ function assessInterfaceShellDefinition(shell) {
|
|
|
295
352
|
}
|
|
296
353
|
// Annotate the CommonJS export names for ESM import in node:
|
|
297
354
|
0 && (module.exports = {
|
|
355
|
+
PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID,
|
|
298
356
|
PLAYER_SYSTEM_INTERFACE_ENV_PREFIX,
|
|
299
357
|
PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,
|
|
300
358
|
PLAYER_SYSTEM_INTERFACE_PACKAGE,
|
|
@@ -302,9 +360,11 @@ function assessInterfaceShellDefinition(shell) {
|
|
|
302
360
|
PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
303
361
|
PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
304
362
|
applyInterfaceShellFocusShift,
|
|
363
|
+
assessIdentityStatusOverlayDefinition,
|
|
305
364
|
assessInterfaceShellDefinition,
|
|
306
365
|
assessPlayerSystemInterfaceComposition,
|
|
307
366
|
createFocusPaneShellDefinition,
|
|
367
|
+
createIdentityStatusOverlayDefinition,
|
|
308
368
|
createInterfaceShellDefinition,
|
|
309
369
|
createInterfaceShellState,
|
|
310
370
|
createInterfaceShellSurfaceDefinition,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface PackageDescriptor {\n readonly packageName: string;\n readonly featureFlagId: string;\n readonly envPrefix: string;\n readonly summary: string;\n}\n\nexport type OverlayKeyboardPath = \"sequential\" | \"direct-hotkey\" | \"read-only\";\n\nexport interface OverlayAccessibilityContract {\n readonly keyboardPath: OverlayKeyboardPath;\n readonly focusRestorationTarget: \"trigger\" | \"pane-heading\" | \"nearest-anchor\";\n readonly liveRegionMode: \"polite\" | \"assertive\" | \"off\";\n readonly requiresAccessibleName: boolean;\n}\n\nexport interface InterfaceFrameBudget {\n readonly targetFps: number;\n readonly maxFrameMs: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport type OverlayHostKind =\n | \"dom-overlay\"\n | \"native-overlay\"\n | \"headless-snapshot\";\n\nexport type OverlayAdapterCapability =\n | \"focus-restoration\"\n | \"live-region\"\n | \"anchor-registry\";\n\nexport interface OverlayHostAdapterContract {\n readonly supportedHosts: readonly OverlayHostKind[];\n readonly requiredCapabilities: readonly OverlayAdapterCapability[];\n readonly forbiddenAssumptions: readonly string[];\n}\n\nexport interface OverlayCompositionScaleContract {\n readonly maxWorldPanels: number;\n readonly maxFocusPanes: number;\n readonly maxAlertMarkers: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport interface PlayerSystemInterfaceContract {\n readonly featureFlagId: string;\n readonly accessibility: OverlayAccessibilityContract;\n readonly frameBudget: InterfaceFrameBudget;\n}\n\nexport interface PlayerSystemInterfacePortabilityContract {\n readonly featureFlagId: string;\n readonly hostAdapters: OverlayHostAdapterContract;\n readonly compositionScale: OverlayCompositionScaleContract;\n}\n\nexport interface PlayerSystemInterfaceContractInput {\n readonly featureFlagId?: string;\n readonly accessibility?: Partial<OverlayAccessibilityContract>;\n readonly frameBudget?: Partial<InterfaceFrameBudget>;\n}\n\nexport interface PlayerSystemInterfacePortabilityContractInput {\n readonly featureFlagId?: string;\n readonly hostAdapters?: Partial<OverlayHostAdapterContract>;\n readonly compositionScale?: Partial<OverlayCompositionScaleContract>;\n}\n\nexport type PlayerSystemInterfaceMode = \"ambient\" | \"focused\" | \"combat-safe\";\n\nexport type PlayerSystemPaneId =\n | \"identity\"\n | \"missions\"\n | \"guild-quests\"\n | \"logs\"\n | \"mcc\"\n | \"tutorial\"\n | \"points-store\";\n\nexport type InterfaceShellOwner = \"player-system\" | \"party-system\";\nexport type InterfaceShellSurfaceKind =\n | \"world-panel\"\n | \"focus-pane\"\n | \"target-popup\"\n | \"alert-marker\";\nexport type InterfaceCombatBehavior = \"persist\" | \"reduce\" | \"suspend\";\n\nexport interface InterfaceShellSurfaceDefinition {\n readonly surfaceId: string;\n readonly owner: InterfaceShellOwner;\n readonly kind: InterfaceShellSurfaceKind;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly priority: number;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface FocusPaneShellDefinition {\n readonly panelId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly heading: string;\n readonly interactive: boolean;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface LineOfSightTargetPopupDefinition {\n readonly popupId: string;\n readonly owner: InterfaceShellOwner;\n readonly anchorId: string;\n readonly targetId: string;\n readonly summary: string;\n readonly requiresLineOfSight: boolean;\n readonly actionLabel?: string;\n}\n\nexport interface ReducedCombatOverlayPolicy {\n readonly featureFlagId: string;\n readonly mode: \"combat-safe\";\n readonly retainedSurfaceKinds: readonly InterfaceShellSurfaceKind[];\n readonly maxInteractiveSurfaces: number;\n}\n\nexport interface InterfaceShellDefinition {\n readonly featureFlagId: string;\n readonly surfaces: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups: readonly LineOfSightTargetPopupDefinition[];\n readonly paneHosts: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat: ReducedCombatOverlayPolicy;\n}\n\nexport interface InterfaceShellDefinitionInput {\n readonly featureFlagId?: string;\n readonly surfaces?: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups?: readonly LineOfSightTargetPopupDefinition[];\n readonly paneHosts?: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts?: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat?: Partial<ReducedCombatOverlayPolicy>;\n}\n\nexport type InterfaceFocusShiftReason =\n | \"keyboard\"\n | \"direct-hotkey\"\n | \"restore\"\n | \"system\";\n\nexport interface InterfaceFocusShift {\n readonly fromSurfaceId?: string;\n readonly toSurfaceId: string;\n readonly reason: InterfaceFocusShiftReason;\n}\n\nexport interface InterfaceShellStateDefinition {\n readonly featureFlagId: string;\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n readonly visibleSurfaceIds: readonly string[];\n readonly focusShift?: InterfaceFocusShift;\n}\n\nexport interface InterfaceShellStateInput {\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n}\n\nexport interface ThreeDPaneHostDefinition {\n readonly hostId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly surfaceId: string;\n readonly anchorId: string;\n readonly supportedHosts: readonly OverlayHostKind[];\n}\n\nexport type AmbientAlertSeverity = \"info\" | \"warning\" | \"danger\";\n\nexport interface LocalizedAmbientAlertDefinition {\n readonly alertId: string;\n readonly owner: InterfaceShellOwner;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n readonly messageKey: string;\n readonly localizedMessages: Readonly<Record<string, string>>;\n readonly liveRegionMode: \"polite\" | \"assertive\";\n}\n\nexport interface WorldSpacePanelDefinition {\n readonly panelId: string;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly accessibilityLabel?: string;\n readonly focusOrder?: number;\n}\n\nexport interface OverlayAlertMarker {\n readonly markerId: string;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n}\n\nexport interface WorldSpaceCompositionSample {\n readonly panelCount: number;\n readonly focusPaneCount: number;\n readonly alertMarkerCount: number;\n readonly interactivePanelCount: number;\n}\n\nexport interface InterfaceContractAssessment {\n readonly accepted: boolean;\n readonly violations: readonly string[];\n}\n\nexport const PLAYER_SYSTEM_INTERFACE_PACKAGE = \"@plasius/player-system-interface\";\nexport const PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = \"PLAYER_SYSTEM_INTERFACE\";\nexport const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID =\n \"isekai.player-system.interface.enabled\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_INTERFACE_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_INTERFACE_ENV_PREFIX,\n summary:\n \"World-space Player System overlays, focus panes, and target-surface contracts for Plasius game experiences.\",\n});\n\nexport const defaultPlayerSystemInterfaceContract: PlayerSystemInterfaceContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,\n accessibility: Object.freeze({\n keyboardPath: \"sequential\",\n focusRestorationTarget: \"trigger\",\n liveRegionMode: \"polite\",\n requiresAccessibleName: true,\n }),\n frameBudget: Object.freeze({\n targetFps: 60,\n maxFrameMs: 16,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultPlayerSystemInterfacePortabilityContract: PlayerSystemInterfacePortabilityContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,\n hostAdapters: Object.freeze({\n supportedHosts: Object.freeze([\n \"dom-overlay\",\n \"native-overlay\",\n \"headless-snapshot\",\n ] satisfies OverlayHostKind[]),\n requiredCapabilities: Object.freeze([\n \"focus-restoration\",\n \"live-region\",\n \"anchor-registry\",\n ] satisfies OverlayAdapterCapability[]),\n forbiddenAssumptions: Object.freeze([\n \"window-global\",\n \"single-pane-layout\",\n \"absolute-scene-coordinates\",\n ]),\n }),\n compositionScale: Object.freeze({\n maxWorldPanels: 6,\n maxFocusPanes: 3,\n maxAlertMarkers: 8,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultReducedCombatOverlayPolicy: ReducedCombatOverlayPolicy =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n mode: \"combat-safe\",\n retainedSurfaceKinds: Object.freeze([\n \"alert-marker\",\n \"target-popup\",\n \"focus-pane\",\n ] satisfies InterfaceShellSurfaceKind[]),\n maxInteractiveSurfaces: 1,\n });\n\nexport function isPlayerSystemInterfaceMode(\n value: string\n): value is PlayerSystemInterfaceMode {\n return value === \"ambient\" || value === \"focused\" || value === \"combat-safe\";\n}\n\nexport function createWorldSpacePanelDefinition(\n input: WorldSpacePanelDefinition\n): WorldSpacePanelDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createPlayerSystemInterfaceContract(\n input: PlayerSystemInterfaceContractInput = {}\n): PlayerSystemInterfaceContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ?? defaultPlayerSystemInterfaceContract.featureFlagId,\n accessibility: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.accessibility,\n ...input.accessibility,\n }),\n frameBudget: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.frameBudget,\n ...input.frameBudget,\n }),\n });\n}\n\nexport function createPlayerSystemInterfacePortabilityContract(\n input: PlayerSystemInterfacePortabilityContractInput = {}\n): PlayerSystemInterfacePortabilityContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ??\n defaultPlayerSystemInterfacePortabilityContract.featureFlagId,\n hostAdapters: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.hostAdapters,\n ...input.hostAdapters,\n supportedHosts: Object.freeze([\n ...(input.hostAdapters?.supportedHosts ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .supportedHosts),\n ]),\n requiredCapabilities: Object.freeze([\n ...(input.hostAdapters?.requiredCapabilities ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .requiredCapabilities),\n ]),\n forbiddenAssumptions: Object.freeze([\n ...(input.hostAdapters?.forbiddenAssumptions ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .forbiddenAssumptions),\n ]),\n }),\n compositionScale: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.compositionScale,\n ...input.compositionScale,\n }),\n });\n}\n\nexport function createInterfaceShellSurfaceDefinition(\n input: InterfaceShellSurfaceDefinition\n): InterfaceShellSurfaceDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createFocusPaneShellDefinition(\n input: FocusPaneShellDefinition\n): FocusPaneShellDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createLineOfSightTargetPopupDefinition(\n input: LineOfSightTargetPopupDefinition\n): LineOfSightTargetPopupDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createThreeDPaneHostDefinition(\n input: ThreeDPaneHostDefinition\n): ThreeDPaneHostDefinition {\n return Object.freeze({\n ...input,\n supportedHosts: Object.freeze([...input.supportedHosts]),\n });\n}\n\nexport function createLocalizedAmbientAlertDefinition(\n input: LocalizedAmbientAlertDefinition\n): LocalizedAmbientAlertDefinition {\n return Object.freeze({\n ...input,\n localizedMessages: Object.freeze({ ...input.localizedMessages }),\n });\n}\n\nexport function createInterfaceShellDefinition(\n input: InterfaceShellDefinitionInput = {}\n): InterfaceShellDefinition {\n return Object.freeze({\n featureFlagId: input.featureFlagId ?? PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n surfaces: Object.freeze([...(input.surfaces ?? [])]),\n focusPane: input.focusPane ? Object.freeze({ ...input.focusPane }) : undefined,\n targetPopups: Object.freeze([...(input.targetPopups ?? [])]),\n paneHosts: Object.freeze([...(input.paneHosts ?? [])]),\n ambientAlerts: Object.freeze([...(input.ambientAlerts ?? [])]),\n reducedCombat: Object.freeze({\n ...defaultReducedCombatOverlayPolicy,\n ...input.reducedCombat,\n retainedSurfaceKinds: Object.freeze([\n ...(input.reducedCombat?.retainedSurfaceKinds ??\n defaultReducedCombatOverlayPolicy.retainedSurfaceKinds),\n ]),\n }),\n });\n}\n\nexport function createInterfaceShellState(\n shell: InterfaceShellDefinition,\n input: InterfaceShellStateInput\n): InterfaceShellStateDefinition {\n const retainedSurfaceKinds = new Set(\n shell.reducedCombat.retainedSurfaceKinds\n );\n const visibleSurfaceIds = shell.surfaces\n .filter(\n (surface) =>\n input.mode !== \"combat-safe\" ||\n (surface.combatBehavior !== \"suspend\" &&\n retainedSurfaceKinds.has(surface.kind))\n )\n .map((surface) => surface.surfaceId);\n\n if (\n input.focusedSurfaceId &&\n !visibleSurfaceIds.includes(input.focusedSurfaceId)\n ) {\n throw new RangeError(\n `Focused surface '${input.focusedSurfaceId}' is not visible in ${input.mode} mode`\n );\n }\n\n return Object.freeze({\n featureFlagId: shell.featureFlagId,\n mode: input.mode,\n focusedSurfaceId:\n input.mode === \"focused\" ? input.focusedSurfaceId : undefined,\n visibleSurfaceIds: Object.freeze(visibleSurfaceIds),\n });\n}\n\nexport function applyInterfaceShellFocusShift(\n state: InterfaceShellStateDefinition,\n focusShift: InterfaceFocusShift\n): InterfaceShellStateDefinition {\n if (!state.visibleSurfaceIds.includes(focusShift.toSurfaceId)) {\n throw new RangeError(\n `Focused surface '${focusShift.toSurfaceId}' is not visible in ${state.mode} mode`\n );\n }\n\n return Object.freeze({\n ...state,\n mode: \"focused\",\n focusedSurfaceId: focusShift.toSurfaceId,\n focusShift: Object.freeze({ ...focusShift }),\n });\n}\n\nexport function resolveLocalizedAmbientAlertMessage(\n alert: LocalizedAmbientAlertDefinition,\n locale: string,\n fallbackLocale = \"en-GB\"\n): string | undefined {\n return alert.localizedMessages[locale] ?? alert.localizedMessages[fallbackLocale];\n}\n\nexport function assessPlayerSystemInterfaceComposition(\n sample: WorldSpaceCompositionSample,\n contract: PlayerSystemInterfacePortabilityContract = defaultPlayerSystemInterfacePortabilityContract\n): InterfaceContractAssessment {\n const violations: string[] = [];\n\n if (sample.panelCount > contract.compositionScale.maxWorldPanels) {\n violations.push(\"panelCount\");\n }\n\n if (sample.focusPaneCount > contract.compositionScale.maxFocusPanes) {\n violations.push(\"focusPaneCount\");\n }\n\n if (sample.alertMarkerCount > contract.compositionScale.maxAlertMarkers) {\n violations.push(\"alertMarkerCount\");\n }\n\n if (\n sample.interactivePanelCount >\n contract.compositionScale.maxInteractivePanelsPerFrame\n ) {\n violations.push(\"interactivePanelCount\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n\nexport function assessInterfaceShellDefinition(\n shell: InterfaceShellDefinition\n): InterfaceContractAssessment {\n const violations: string[] = [];\n const ownerSet = new Set(shell.surfaces.map((surface) => surface.owner));\n const retainedSurfaceKinds = new Set(shell.reducedCombat.retainedSurfaceKinds);\n const interactiveSurfaceCount = shell.surfaces.filter(\n (surface) => surface.interactive && retainedSurfaceKinds.has(surface.kind)\n ).length;\n const focusPane = shell.focusPane;\n\n if (shell.surfaces.length === 0) {\n violations.push(\"surfaces\");\n }\n\n if (focusPane && !ownerSet.has(focusPane.owner)) {\n violations.push(\"focusPaneOwner\");\n }\n\n if (focusPane) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.kind === \"focus-pane\" &&\n surface.anchorId === focusPane.anchorId &&\n surface.owner === focusPane.owner\n );\n if (!matchingSurface) {\n violations.push(\"focusPaneSurface\");\n }\n }\n\n if (\n interactiveSurfaceCount > shell.reducedCombat.maxInteractiveSurfaces\n ) {\n violations.push(\"interactiveSurfaceCount\");\n }\n\n for (const popup of shell.targetPopups) {\n if (popup.requiresLineOfSight && popup.anchorId.length === 0) {\n violations.push(`popup:${popup.popupId}`);\n }\n }\n\n for (const paneHost of shell.paneHosts) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.surfaceId === paneHost.surfaceId &&\n surface.owner === paneHost.owner &&\n surface.anchorId === paneHost.anchorId\n );\n if (!matchingSurface) {\n violations.push(`paneHost:${paneHost.hostId}`);\n }\n }\n\n for (const alert of shell.ambientAlerts) {\n if (Object.keys(alert.localizedMessages).length === 0) {\n violations.push(`alert:${alert.alertId}`);\n }\n }\n\n if (\n ownerSet.has(\"player-system\") &&\n ownerSet.has(\"party-system\") &&\n shell.reducedCombat.retainedSurfaceKinds.length === 0\n ) {\n violations.push(\"reducedCombat\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\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;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C3B,QAAQ,aAAa,SAAS;AAAA,IAClC;AACA,QAAI,CAAC,iBAAiB;AACpB,iBAAW,KAAK,YAAY,SAAS,MAAM,EAAE;AAAA,IAC/C;AAAA,EACF;AAEA,aAAW,SAAS,MAAM,eAAe;AACvC,QAAI,OAAO,KAAK,MAAM,iBAAiB,EAAE,WAAW,GAAG;AACrD,iBAAW,KAAK,SAAS,MAAM,OAAO,EAAE;AAAA,IAC1C;AAAA,EACF;AAEA,MACE,SAAS,IAAI,eAAe,KAC5B,SAAS,IAAI,cAAc,KAC3B,MAAM,cAAc,qBAAqB,WAAW,GACpD;AACA,eAAW,KAAK,eAAe;AAAA,EACjC;AAEA,SAAO,OAAO,OAAO;AAAA,IACnB,UAAU,WAAW,WAAW;AAAA,IAChC,YAAY,OAAO,OAAO,UAAU;AAAA,EACtC,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface PackageDescriptor {\n readonly packageName: string;\n readonly featureFlagId: string;\n readonly envPrefix: string;\n readonly summary: string;\n}\n\nexport type OverlayKeyboardPath = \"sequential\" | \"direct-hotkey\" | \"read-only\";\n\nexport interface OverlayAccessibilityContract {\n readonly keyboardPath: OverlayKeyboardPath;\n readonly focusRestorationTarget: \"trigger\" | \"pane-heading\" | \"nearest-anchor\";\n readonly liveRegionMode: \"polite\" | \"assertive\" | \"off\";\n readonly requiresAccessibleName: boolean;\n}\n\nexport interface InterfaceFrameBudget {\n readonly targetFps: number;\n readonly maxFrameMs: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport type OverlayHostKind =\n | \"dom-overlay\"\n | \"native-overlay\"\n | \"headless-snapshot\";\n\nexport type OverlayAdapterCapability =\n | \"focus-restoration\"\n | \"live-region\"\n | \"anchor-registry\";\n\nexport interface OverlayHostAdapterContract {\n readonly supportedHosts: readonly OverlayHostKind[];\n readonly requiredCapabilities: readonly OverlayAdapterCapability[];\n readonly forbiddenAssumptions: readonly string[];\n}\n\nexport interface OverlayCompositionScaleContract {\n readonly maxWorldPanels: number;\n readonly maxFocusPanes: number;\n readonly maxAlertMarkers: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport interface PlayerSystemInterfaceContract {\n readonly featureFlagId: string;\n readonly accessibility: OverlayAccessibilityContract;\n readonly frameBudget: InterfaceFrameBudget;\n}\n\nexport interface PlayerSystemInterfacePortabilityContract {\n readonly featureFlagId: string;\n readonly hostAdapters: OverlayHostAdapterContract;\n readonly compositionScale: OverlayCompositionScaleContract;\n}\n\nexport interface PlayerSystemInterfaceContractInput {\n readonly featureFlagId?: string;\n readonly accessibility?: Partial<OverlayAccessibilityContract>;\n readonly frameBudget?: Partial<InterfaceFrameBudget>;\n}\n\nexport interface PlayerSystemInterfacePortabilityContractInput {\n readonly featureFlagId?: string;\n readonly hostAdapters?: Partial<OverlayHostAdapterContract>;\n readonly compositionScale?: Partial<OverlayCompositionScaleContract>;\n}\n\nexport type PlayerSystemInterfaceMode = \"ambient\" | \"focused\" | \"combat-safe\";\n\nexport type PlayerSystemPaneId =\n | \"identity\"\n | \"missions\"\n | \"guild-quests\"\n | \"logs\"\n | \"mcc\"\n | \"tutorial\"\n | \"points-store\";\n\nexport type InterfaceShellOwner = \"player-system\" | \"party-system\";\nexport type InterfaceShellSurfaceKind =\n | \"world-panel\"\n | \"focus-pane\"\n | \"target-popup\"\n | \"alert-marker\"\n | \"identity-overlay\";\nexport type InterfaceCombatBehavior = \"persist\" | \"reduce\" | \"suspend\";\n\nexport type IdentityProjectionRelation =\n | \"self\"\n | \"allied\"\n | \"neutral\"\n | \"unknown\"\n | \"unfriendly\";\nexport type IdentityProjectionInvocation =\n | \"self-state\"\n | \"identity-sweep\"\n | \"spell-targeting\";\nexport type IdentityProjectionReadConfidence =\n | \"complete\"\n | \"partial\"\n | \"fuzzy\"\n | \"withheld\";\nexport type IdentityProjectionPresentation = \"full\" | \"condensed\";\nexport type IdentityProjectionFact =\n | \"display-name\"\n | \"relation\"\n | \"health-band\"\n | \"status-summary\"\n | \"threat-band\"\n | \"targeting-affordance\";\n\nexport interface IdentityStatusOverlayBaseDefinition {\n readonly overlayId: string;\n readonly surfaceId: string;\n readonly readConfidence: IdentityProjectionReadConfidence;\n readonly perceivableFacts: readonly IdentityProjectionFact[];\n readonly readableFacts: readonly IdentityProjectionFact[];\n readonly presentation: IdentityProjectionPresentation;\n}\n\nexport interface IdentitySelfStateOverlayDefinition\n extends IdentityStatusOverlayBaseDefinition {\n readonly targetKind: \"self\";\n readonly relation: \"self\";\n readonly invocation: \"self-state\";\n readonly requiresLineOfSight: false;\n readonly targetId?: never;\n}\n\nexport interface IdentityTargetProjectionOverlayDefinition\n extends IdentityStatusOverlayBaseDefinition {\n readonly targetKind: \"external\";\n readonly targetId: string;\n readonly relation: Exclude<IdentityProjectionRelation, \"self\">;\n readonly invocation: Exclude<IdentityProjectionInvocation, \"self-state\">;\n readonly requiresLineOfSight: true;\n}\n\nexport type IdentityStatusOverlayDefinition =\n | IdentitySelfStateOverlayDefinition\n | IdentityTargetProjectionOverlayDefinition;\n\nexport interface InterfaceShellSurfaceDefinition {\n readonly surfaceId: string;\n readonly owner: InterfaceShellOwner;\n readonly kind: InterfaceShellSurfaceKind;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly priority: number;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface FocusPaneShellDefinition {\n readonly panelId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly heading: string;\n readonly interactive: boolean;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface LineOfSightTargetPopupDefinition {\n readonly popupId: string;\n readonly owner: InterfaceShellOwner;\n readonly anchorId: string;\n readonly targetId: string;\n readonly summary: string;\n readonly requiresLineOfSight: boolean;\n readonly actionLabel?: string;\n}\n\nexport interface ReducedCombatOverlayPolicy {\n readonly featureFlagId: string;\n readonly mode: \"combat-safe\";\n readonly retainedSurfaceKinds: readonly InterfaceShellSurfaceKind[];\n readonly maxInteractiveSurfaces: number;\n}\n\nexport interface InterfaceShellDefinition {\n readonly featureFlagId: string;\n readonly surfaces: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups: readonly LineOfSightTargetPopupDefinition[];\n readonly identityOverlays: readonly IdentityStatusOverlayDefinition[];\n readonly paneHosts: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat: ReducedCombatOverlayPolicy;\n}\n\nexport interface InterfaceShellDefinitionInput {\n readonly featureFlagId?: string;\n readonly surfaces?: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups?: readonly LineOfSightTargetPopupDefinition[];\n readonly identityOverlays?: readonly IdentityStatusOverlayDefinition[];\n readonly paneHosts?: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts?: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat?: Partial<ReducedCombatOverlayPolicy>;\n}\n\nexport type InterfaceFocusShiftReason =\n | \"keyboard\"\n | \"direct-hotkey\"\n | \"restore\"\n | \"system\";\n\nexport interface InterfaceFocusShift {\n readonly fromSurfaceId?: string;\n readonly toSurfaceId: string;\n readonly reason: InterfaceFocusShiftReason;\n}\n\nexport interface InterfaceShellStateDefinition {\n readonly featureFlagId: string;\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n readonly visibleSurfaceIds: readonly string[];\n readonly focusShift?: InterfaceFocusShift;\n}\n\nexport interface InterfaceShellStateInput {\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n}\n\nexport interface ThreeDPaneHostDefinition {\n readonly hostId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly surfaceId: string;\n readonly anchorId: string;\n readonly supportedHosts: readonly OverlayHostKind[];\n}\n\nexport type AmbientAlertSeverity = \"info\" | \"warning\" | \"danger\";\n\nexport interface LocalizedAmbientAlertDefinition {\n readonly alertId: string;\n readonly owner: InterfaceShellOwner;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n readonly messageKey: string;\n readonly localizedMessages: Readonly<Record<string, string>>;\n readonly liveRegionMode: \"polite\" | \"assertive\";\n}\n\nexport interface WorldSpacePanelDefinition {\n readonly panelId: string;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly accessibilityLabel?: string;\n readonly focusOrder?: number;\n}\n\nexport interface OverlayAlertMarker {\n readonly markerId: string;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n}\n\nexport interface WorldSpaceCompositionSample {\n readonly panelCount: number;\n readonly focusPaneCount: number;\n readonly alertMarkerCount: number;\n readonly interactivePanelCount: number;\n}\n\nexport interface InterfaceContractAssessment {\n readonly accepted: boolean;\n readonly violations: readonly string[];\n}\n\nexport const PLAYER_SYSTEM_INTERFACE_PACKAGE = \"@plasius/player-system-interface\";\nexport const PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = \"PLAYER_SYSTEM_INTERFACE\";\nexport const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID =\n \"harmony.player-system.interface.enabled\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID =\n \"harmony.player-system.identity.enabled\";\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_INTERFACE_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_INTERFACE_ENV_PREFIX,\n summary:\n \"World-space Player System overlays, focus panes, and target-surface contracts for Plasius game experiences.\",\n});\n\nexport const defaultPlayerSystemInterfaceContract: PlayerSystemInterfaceContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,\n accessibility: Object.freeze({\n keyboardPath: \"sequential\",\n focusRestorationTarget: \"trigger\",\n liveRegionMode: \"polite\",\n requiresAccessibleName: true,\n }),\n frameBudget: Object.freeze({\n targetFps: 60,\n maxFrameMs: 16,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultPlayerSystemInterfacePortabilityContract: PlayerSystemInterfacePortabilityContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,\n hostAdapters: Object.freeze({\n supportedHosts: Object.freeze([\n \"dom-overlay\",\n \"native-overlay\",\n \"headless-snapshot\",\n ] satisfies OverlayHostKind[]),\n requiredCapabilities: Object.freeze([\n \"focus-restoration\",\n \"live-region\",\n \"anchor-registry\",\n ] satisfies OverlayAdapterCapability[]),\n forbiddenAssumptions: Object.freeze([\n \"window-global\",\n \"single-pane-layout\",\n \"absolute-scene-coordinates\",\n ]),\n }),\n compositionScale: Object.freeze({\n maxWorldPanels: 6,\n maxFocusPanes: 3,\n maxAlertMarkers: 8,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultReducedCombatOverlayPolicy: ReducedCombatOverlayPolicy =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n mode: \"combat-safe\",\n retainedSurfaceKinds: Object.freeze([\n \"alert-marker\",\n \"target-popup\",\n \"focus-pane\",\n \"identity-overlay\",\n ] satisfies InterfaceShellSurfaceKind[]),\n maxInteractiveSurfaces: 1,\n });\n\nexport function isPlayerSystemInterfaceMode(\n value: string\n): value is PlayerSystemInterfaceMode {\n return value === \"ambient\" || value === \"focused\" || value === \"combat-safe\";\n}\n\nexport function createWorldSpacePanelDefinition(\n input: WorldSpacePanelDefinition\n): WorldSpacePanelDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createPlayerSystemInterfaceContract(\n input: PlayerSystemInterfaceContractInput = {}\n): PlayerSystemInterfaceContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ?? defaultPlayerSystemInterfaceContract.featureFlagId,\n accessibility: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.accessibility,\n ...input.accessibility,\n }),\n frameBudget: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.frameBudget,\n ...input.frameBudget,\n }),\n });\n}\n\nexport function createPlayerSystemInterfacePortabilityContract(\n input: PlayerSystemInterfacePortabilityContractInput = {}\n): PlayerSystemInterfacePortabilityContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ??\n defaultPlayerSystemInterfacePortabilityContract.featureFlagId,\n hostAdapters: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.hostAdapters,\n ...input.hostAdapters,\n supportedHosts: Object.freeze([\n ...(input.hostAdapters?.supportedHosts ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .supportedHosts),\n ]),\n requiredCapabilities: Object.freeze([\n ...(input.hostAdapters?.requiredCapabilities ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .requiredCapabilities),\n ]),\n forbiddenAssumptions: Object.freeze([\n ...(input.hostAdapters?.forbiddenAssumptions ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .forbiddenAssumptions),\n ]),\n }),\n compositionScale: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.compositionScale,\n ...input.compositionScale,\n }),\n });\n}\n\nexport function createInterfaceShellSurfaceDefinition(\n input: InterfaceShellSurfaceDefinition\n): InterfaceShellSurfaceDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createFocusPaneShellDefinition(\n input: FocusPaneShellDefinition\n): FocusPaneShellDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createLineOfSightTargetPopupDefinition(\n input: LineOfSightTargetPopupDefinition\n): LineOfSightTargetPopupDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createIdentityStatusOverlayDefinition(\n input: IdentityStatusOverlayDefinition\n): IdentityStatusOverlayDefinition {\n return Object.freeze({\n ...input,\n perceivableFacts: Object.freeze([...input.perceivableFacts]),\n readableFacts: Object.freeze([...input.readableFacts]),\n });\n}\n\nexport function createThreeDPaneHostDefinition(\n input: ThreeDPaneHostDefinition\n): ThreeDPaneHostDefinition {\n return Object.freeze({\n ...input,\n supportedHosts: Object.freeze([...input.supportedHosts]),\n });\n}\n\nexport function createLocalizedAmbientAlertDefinition(\n input: LocalizedAmbientAlertDefinition\n): LocalizedAmbientAlertDefinition {\n return Object.freeze({\n ...input,\n localizedMessages: Object.freeze({ ...input.localizedMessages }),\n });\n}\n\nexport function createInterfaceShellDefinition(\n input: InterfaceShellDefinitionInput = {}\n): InterfaceShellDefinition {\n return Object.freeze({\n featureFlagId: input.featureFlagId ?? PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n surfaces: Object.freeze([...(input.surfaces ?? [])]),\n focusPane: input.focusPane ? Object.freeze({ ...input.focusPane }) : undefined,\n targetPopups: Object.freeze([...(input.targetPopups ?? [])]),\n identityOverlays: Object.freeze([...(input.identityOverlays ?? [])]),\n paneHosts: Object.freeze([...(input.paneHosts ?? [])]),\n ambientAlerts: Object.freeze([...(input.ambientAlerts ?? [])]),\n reducedCombat: Object.freeze({\n ...defaultReducedCombatOverlayPolicy,\n ...input.reducedCombat,\n retainedSurfaceKinds: Object.freeze([\n ...(input.reducedCombat?.retainedSurfaceKinds ??\n defaultReducedCombatOverlayPolicy.retainedSurfaceKinds),\n ]),\n }),\n });\n}\n\nexport function createInterfaceShellState(\n shell: InterfaceShellDefinition,\n input: InterfaceShellStateInput\n): InterfaceShellStateDefinition {\n const retainedSurfaceKinds = new Set(\n shell.reducedCombat.retainedSurfaceKinds\n );\n const visibleSurfaceIds = shell.surfaces\n .filter(\n (surface) =>\n input.mode !== \"combat-safe\" ||\n (surface.combatBehavior !== \"suspend\" &&\n retainedSurfaceKinds.has(surface.kind))\n )\n .map((surface) => surface.surfaceId);\n\n if (\n input.focusedSurfaceId &&\n !visibleSurfaceIds.includes(input.focusedSurfaceId)\n ) {\n throw new RangeError(\n `Focused surface '${input.focusedSurfaceId}' is not visible in ${input.mode} mode`\n );\n }\n\n return Object.freeze({\n featureFlagId: shell.featureFlagId,\n mode: input.mode,\n focusedSurfaceId:\n input.mode === \"focused\" ? input.focusedSurfaceId : undefined,\n visibleSurfaceIds: Object.freeze(visibleSurfaceIds),\n });\n}\n\nexport function applyInterfaceShellFocusShift(\n state: InterfaceShellStateDefinition,\n focusShift: InterfaceFocusShift\n): InterfaceShellStateDefinition {\n if (!state.visibleSurfaceIds.includes(focusShift.toSurfaceId)) {\n throw new RangeError(\n `Focused surface '${focusShift.toSurfaceId}' is not visible in ${state.mode} mode`\n );\n }\n\n return Object.freeze({\n ...state,\n mode: \"focused\",\n focusedSurfaceId: focusShift.toSurfaceId,\n focusShift: Object.freeze({ ...focusShift }),\n });\n}\n\nexport function resolveLocalizedAmbientAlertMessage(\n alert: LocalizedAmbientAlertDefinition,\n locale: string,\n fallbackLocale = \"en-GB\"\n): string | undefined {\n return alert.localizedMessages[locale] ?? alert.localizedMessages[fallbackLocale];\n}\n\nexport function assessIdentityStatusOverlayDefinition(\n overlay: IdentityStatusOverlayDefinition\n): InterfaceContractAssessment {\n const violations: string[] = [];\n const perceivableFacts = new Set(overlay.perceivableFacts);\n\n if (overlay.readableFacts.some((fact) => !perceivableFacts.has(fact))) {\n violations.push(\"readableFacts\");\n }\n\n if (overlay.readConfidence === \"withheld\" && overlay.readableFacts.length > 0) {\n violations.push(\"withheldRead\");\n }\n\n if (overlay.targetKind === \"self\") {\n if (overlay.relation !== \"self\") {\n violations.push(\"selfRelation\");\n }\n if (overlay.invocation !== \"self-state\") {\n violations.push(\"selfInvocation\");\n }\n if (overlay.requiresLineOfSight) {\n violations.push(\"selfLineOfSight\");\n }\n } else {\n if (overlay.targetId.length === 0) {\n violations.push(\"targetId\");\n }\n if (!overlay.requiresLineOfSight) {\n violations.push(\"lineOfSight\");\n }\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n\nexport function assessPlayerSystemInterfaceComposition(\n sample: WorldSpaceCompositionSample,\n contract: PlayerSystemInterfacePortabilityContract = defaultPlayerSystemInterfacePortabilityContract\n): InterfaceContractAssessment {\n const violations: string[] = [];\n\n if (sample.panelCount > contract.compositionScale.maxWorldPanels) {\n violations.push(\"panelCount\");\n }\n\n if (sample.focusPaneCount > contract.compositionScale.maxFocusPanes) {\n violations.push(\"focusPaneCount\");\n }\n\n if (sample.alertMarkerCount > contract.compositionScale.maxAlertMarkers) {\n violations.push(\"alertMarkerCount\");\n }\n\n if (\n sample.interactivePanelCount >\n contract.compositionScale.maxInteractivePanelsPerFrame\n ) {\n violations.push(\"interactivePanelCount\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n\nexport function assessInterfaceShellDefinition(\n shell: InterfaceShellDefinition\n): InterfaceContractAssessment {\n const violations: string[] = [];\n const ownerSet = new Set(shell.surfaces.map((surface) => surface.owner));\n const retainedSurfaceKinds = new Set(shell.reducedCombat.retainedSurfaceKinds);\n const interactiveSurfaceCount = shell.surfaces.filter(\n (surface) => surface.interactive && retainedSurfaceKinds.has(surface.kind)\n ).length;\n const focusPane = shell.focusPane;\n\n if (shell.surfaces.length === 0) {\n violations.push(\"surfaces\");\n }\n\n if (focusPane && !ownerSet.has(focusPane.owner)) {\n violations.push(\"focusPaneOwner\");\n }\n\n if (focusPane) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.kind === \"focus-pane\" &&\n surface.anchorId === focusPane.anchorId &&\n surface.owner === focusPane.owner\n );\n if (!matchingSurface) {\n violations.push(\"focusPaneSurface\");\n }\n }\n\n if (\n interactiveSurfaceCount > shell.reducedCombat.maxInteractiveSurfaces\n ) {\n violations.push(\"interactiveSurfaceCount\");\n }\n\n for (const popup of shell.targetPopups) {\n if (popup.requiresLineOfSight && popup.anchorId.length === 0) {\n violations.push(`popup:${popup.popupId}`);\n }\n }\n\n for (const overlay of shell.identityOverlays) {\n const identityAssessment = assessIdentityStatusOverlayDefinition(overlay);\n for (const violation of identityAssessment.violations) {\n violations.push(`identityOverlay:${overlay.overlayId}:${violation}`);\n }\n\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.surfaceId === overlay.surfaceId &&\n surface.kind === \"identity-overlay\"\n );\n if (!matchingSurface) {\n violations.push(`identityOverlaySurface:${overlay.overlayId}`);\n }\n }\n\n for (const paneHost of shell.paneHosts) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.surfaceId === paneHost.surfaceId &&\n surface.owner === paneHost.owner &&\n surface.anchorId === paneHost.anchorId\n );\n if (!matchingSurface) {\n violations.push(`paneHost:${paneHost.hostId}`);\n }\n }\n\n for (const alert of shell.ambientAlerts) {\n if (Object.keys(alert.localizedMessages).length === 0) {\n violations.push(`alert:${alert.alertId}`);\n }\n }\n\n if (\n ownerSet.has(\"player-system\") &&\n ownerSet.has(\"party-system\") &&\n shell.reducedCombat.retainedSurfaceKinds.length === 0\n ) {\n violations.push(\"reducedCombat\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\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;AAoRO,IAAM,kCAAkC;AACxC,IAAM,qC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,QAAQ,aAC9B,QAAQ,SAAS;AAAA,IACrB;AACA,QAAI,CAAC,iBAAiB;AACpB,iBAAW,KAAK,0BAA0B,QAAQ,SAAS,EAAE;AAAA,IAC/D;AAAA,EACF;AAEA,aAAW,YAAY,MAAM,WAAW;AACtC,UAAM,kBAAkB,MAAM,SAAS;AAAA,MACrC,CAAC,YACC,QAAQ,cAAc,SAAS,aAC/B,QAAQ,UAAU,SAAS,SAC3B,QAAQ,aAAa,SAAS;AAAA,IAClC;AACA,QAAI,CAAC,iBAAiB;AACpB,iBAAW,KAAK,YAAY,SAAS,MAAM,EAAE;AAAA,IAC/C;AAAA,EACF;AAEA,aAAW,SAAS,MAAM,eAAe;AACvC,QAAI,OAAO,KAAK,MAAM,iBAAiB,EAAE,WAAW,GAAG;AACrD,iBAAW,KAAK,SAAS,MAAM,OAAO,EAAE;AAAA,IAC1C;AAAA,EACF;AAEA,MACE,SAAS,IAAI,eAAe,KAC5B,SAAS,IAAI,cAAc,KAC3B,MAAM,cAAc,qBAAqB,WAAW,GACpD;AACA,eAAW,KAAK,eAAe;AAAA,EACjC;AAEA,SAAO,OAAO,OAAO;AAAA,IACnB,UAAU,WAAW,WAAW;AAAA,IAChC,YAAY,OAAO,OAAO,UAAU;AAAA,EACtC,CAAC;AACH;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -52,8 +52,36 @@ interface PlayerSystemInterfacePortabilityContractInput {
|
|
|
52
52
|
type PlayerSystemInterfaceMode = "ambient" | "focused" | "combat-safe";
|
|
53
53
|
type PlayerSystemPaneId = "identity" | "missions" | "guild-quests" | "logs" | "mcc" | "tutorial" | "points-store";
|
|
54
54
|
type InterfaceShellOwner = "player-system" | "party-system";
|
|
55
|
-
type InterfaceShellSurfaceKind = "world-panel" | "focus-pane" | "target-popup" | "alert-marker";
|
|
55
|
+
type InterfaceShellSurfaceKind = "world-panel" | "focus-pane" | "target-popup" | "alert-marker" | "identity-overlay";
|
|
56
56
|
type InterfaceCombatBehavior = "persist" | "reduce" | "suspend";
|
|
57
|
+
type IdentityProjectionRelation = "self" | "allied" | "neutral" | "unknown" | "unfriendly";
|
|
58
|
+
type IdentityProjectionInvocation = "self-state" | "identity-sweep" | "spell-targeting";
|
|
59
|
+
type IdentityProjectionReadConfidence = "complete" | "partial" | "fuzzy" | "withheld";
|
|
60
|
+
type IdentityProjectionPresentation = "full" | "condensed";
|
|
61
|
+
type IdentityProjectionFact = "display-name" | "relation" | "health-band" | "status-summary" | "threat-band" | "targeting-affordance";
|
|
62
|
+
interface IdentityStatusOverlayBaseDefinition {
|
|
63
|
+
readonly overlayId: string;
|
|
64
|
+
readonly surfaceId: string;
|
|
65
|
+
readonly readConfidence: IdentityProjectionReadConfidence;
|
|
66
|
+
readonly perceivableFacts: readonly IdentityProjectionFact[];
|
|
67
|
+
readonly readableFacts: readonly IdentityProjectionFact[];
|
|
68
|
+
readonly presentation: IdentityProjectionPresentation;
|
|
69
|
+
}
|
|
70
|
+
interface IdentitySelfStateOverlayDefinition extends IdentityStatusOverlayBaseDefinition {
|
|
71
|
+
readonly targetKind: "self";
|
|
72
|
+
readonly relation: "self";
|
|
73
|
+
readonly invocation: "self-state";
|
|
74
|
+
readonly requiresLineOfSight: false;
|
|
75
|
+
readonly targetId?: never;
|
|
76
|
+
}
|
|
77
|
+
interface IdentityTargetProjectionOverlayDefinition extends IdentityStatusOverlayBaseDefinition {
|
|
78
|
+
readonly targetKind: "external";
|
|
79
|
+
readonly targetId: string;
|
|
80
|
+
readonly relation: Exclude<IdentityProjectionRelation, "self">;
|
|
81
|
+
readonly invocation: Exclude<IdentityProjectionInvocation, "self-state">;
|
|
82
|
+
readonly requiresLineOfSight: true;
|
|
83
|
+
}
|
|
84
|
+
type IdentityStatusOverlayDefinition = IdentitySelfStateOverlayDefinition | IdentityTargetProjectionOverlayDefinition;
|
|
57
85
|
interface InterfaceShellSurfaceDefinition {
|
|
58
86
|
readonly surfaceId: string;
|
|
59
87
|
readonly owner: InterfaceShellOwner;
|
|
@@ -92,6 +120,7 @@ interface InterfaceShellDefinition {
|
|
|
92
120
|
readonly surfaces: readonly InterfaceShellSurfaceDefinition[];
|
|
93
121
|
readonly focusPane?: FocusPaneShellDefinition;
|
|
94
122
|
readonly targetPopups: readonly LineOfSightTargetPopupDefinition[];
|
|
123
|
+
readonly identityOverlays: readonly IdentityStatusOverlayDefinition[];
|
|
95
124
|
readonly paneHosts: readonly ThreeDPaneHostDefinition[];
|
|
96
125
|
readonly ambientAlerts: readonly LocalizedAmbientAlertDefinition[];
|
|
97
126
|
readonly reducedCombat: ReducedCombatOverlayPolicy;
|
|
@@ -101,6 +130,7 @@ interface InterfaceShellDefinitionInput {
|
|
|
101
130
|
readonly surfaces?: readonly InterfaceShellSurfaceDefinition[];
|
|
102
131
|
readonly focusPane?: FocusPaneShellDefinition;
|
|
103
132
|
readonly targetPopups?: readonly LineOfSightTargetPopupDefinition[];
|
|
133
|
+
readonly identityOverlays?: readonly IdentityStatusOverlayDefinition[];
|
|
104
134
|
readonly paneHosts?: readonly ThreeDPaneHostDefinition[];
|
|
105
135
|
readonly ambientAlerts?: readonly LocalizedAmbientAlertDefinition[];
|
|
106
136
|
readonly reducedCombat?: Partial<ReducedCombatOverlayPolicy>;
|
|
@@ -165,10 +195,11 @@ interface InterfaceContractAssessment {
|
|
|
165
195
|
}
|
|
166
196
|
declare const PLAYER_SYSTEM_INTERFACE_PACKAGE = "@plasius/player-system-interface";
|
|
167
197
|
declare const PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = "PLAYER_SYSTEM_INTERFACE";
|
|
168
|
-
declare const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "
|
|
169
|
-
declare const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "
|
|
170
|
-
declare const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "
|
|
171
|
-
declare const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "
|
|
198
|
+
declare const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
199
|
+
declare const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
200
|
+
declare const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
201
|
+
declare const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
202
|
+
declare const PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID = "harmony.player-system.identity.enabled";
|
|
172
203
|
declare const packageDescriptor: PackageDescriptor;
|
|
173
204
|
declare const defaultPlayerSystemInterfaceContract: PlayerSystemInterfaceContract;
|
|
174
205
|
declare const defaultPlayerSystemInterfacePortabilityContract: PlayerSystemInterfacePortabilityContract;
|
|
@@ -180,13 +211,15 @@ declare function createPlayerSystemInterfacePortabilityContract(input?: PlayerSy
|
|
|
180
211
|
declare function createInterfaceShellSurfaceDefinition(input: InterfaceShellSurfaceDefinition): InterfaceShellSurfaceDefinition;
|
|
181
212
|
declare function createFocusPaneShellDefinition(input: FocusPaneShellDefinition): FocusPaneShellDefinition;
|
|
182
213
|
declare function createLineOfSightTargetPopupDefinition(input: LineOfSightTargetPopupDefinition): LineOfSightTargetPopupDefinition;
|
|
214
|
+
declare function createIdentityStatusOverlayDefinition(input: IdentityStatusOverlayDefinition): IdentityStatusOverlayDefinition;
|
|
183
215
|
declare function createThreeDPaneHostDefinition(input: ThreeDPaneHostDefinition): ThreeDPaneHostDefinition;
|
|
184
216
|
declare function createLocalizedAmbientAlertDefinition(input: LocalizedAmbientAlertDefinition): LocalizedAmbientAlertDefinition;
|
|
185
217
|
declare function createInterfaceShellDefinition(input?: InterfaceShellDefinitionInput): InterfaceShellDefinition;
|
|
186
218
|
declare function createInterfaceShellState(shell: InterfaceShellDefinition, input: InterfaceShellStateInput): InterfaceShellStateDefinition;
|
|
187
219
|
declare function applyInterfaceShellFocusShift(state: InterfaceShellStateDefinition, focusShift: InterfaceFocusShift): InterfaceShellStateDefinition;
|
|
188
220
|
declare function resolveLocalizedAmbientAlertMessage(alert: LocalizedAmbientAlertDefinition, locale: string, fallbackLocale?: string): string | undefined;
|
|
221
|
+
declare function assessIdentityStatusOverlayDefinition(overlay: IdentityStatusOverlayDefinition): InterfaceContractAssessment;
|
|
189
222
|
declare function assessPlayerSystemInterfaceComposition(sample: WorldSpaceCompositionSample, contract?: PlayerSystemInterfacePortabilityContract): InterfaceContractAssessment;
|
|
190
223
|
declare function assessInterfaceShellDefinition(shell: InterfaceShellDefinition): InterfaceContractAssessment;
|
|
191
224
|
|
|
192
|
-
export { type AmbientAlertSeverity, type FocusPaneShellDefinition, type InterfaceCombatBehavior, type InterfaceContractAssessment, type InterfaceFocusShift, type InterfaceFocusShiftReason, type InterfaceFrameBudget, type InterfaceShellDefinition, type InterfaceShellDefinitionInput, type InterfaceShellOwner, type InterfaceShellStateDefinition, type InterfaceShellStateInput, type InterfaceShellSurfaceDefinition, type InterfaceShellSurfaceKind, type LineOfSightTargetPopupDefinition, type LocalizedAmbientAlertDefinition, type OverlayAccessibilityContract, type OverlayAdapterCapability, type OverlayAlertMarker, type OverlayCompositionScaleContract, type OverlayHostAdapterContract, type OverlayHostKind, type OverlayKeyboardPath, PLAYER_SYSTEM_INTERFACE_ENV_PREFIX, PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID, PLAYER_SYSTEM_INTERFACE_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemInterfaceContract, type PlayerSystemInterfaceContractInput, type PlayerSystemInterfaceMode, type PlayerSystemInterfacePortabilityContract, type PlayerSystemInterfacePortabilityContractInput, type PlayerSystemPaneId, type ReducedCombatOverlayPolicy, type ThreeDPaneHostDefinition, type WorldSpaceCompositionSample, type WorldSpacePanelDefinition, applyInterfaceShellFocusShift, assessInterfaceShellDefinition, assessPlayerSystemInterfaceComposition, createFocusPaneShellDefinition, createInterfaceShellDefinition, createInterfaceShellState, createInterfaceShellSurfaceDefinition, createLineOfSightTargetPopupDefinition, createLocalizedAmbientAlertDefinition, createPlayerSystemInterfaceContract, createPlayerSystemInterfacePortabilityContract, createThreeDPaneHostDefinition, createWorldSpacePanelDefinition, defaultPlayerSystemInterfaceContract, defaultPlayerSystemInterfacePortabilityContract, defaultReducedCombatOverlayPolicy, isPlayerSystemInterfaceMode, packageDescriptor, resolveLocalizedAmbientAlertMessage };
|
|
225
|
+
export { type AmbientAlertSeverity, type FocusPaneShellDefinition, type IdentityProjectionFact, type IdentityProjectionInvocation, type IdentityProjectionPresentation, type IdentityProjectionReadConfidence, type IdentityProjectionRelation, type IdentitySelfStateOverlayDefinition, type IdentityStatusOverlayBaseDefinition, type IdentityStatusOverlayDefinition, type IdentityTargetProjectionOverlayDefinition, type InterfaceCombatBehavior, type InterfaceContractAssessment, type InterfaceFocusShift, type InterfaceFocusShiftReason, type InterfaceFrameBudget, type InterfaceShellDefinition, type InterfaceShellDefinitionInput, type InterfaceShellOwner, type InterfaceShellStateDefinition, type InterfaceShellStateInput, type InterfaceShellSurfaceDefinition, type InterfaceShellSurfaceKind, type LineOfSightTargetPopupDefinition, type LocalizedAmbientAlertDefinition, type OverlayAccessibilityContract, type OverlayAdapterCapability, type OverlayAlertMarker, type OverlayCompositionScaleContract, type OverlayHostAdapterContract, type OverlayHostKind, type OverlayKeyboardPath, PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID, PLAYER_SYSTEM_INTERFACE_ENV_PREFIX, PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID, PLAYER_SYSTEM_INTERFACE_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemInterfaceContract, type PlayerSystemInterfaceContractInput, type PlayerSystemInterfaceMode, type PlayerSystemInterfacePortabilityContract, type PlayerSystemInterfacePortabilityContractInput, type PlayerSystemPaneId, type ReducedCombatOverlayPolicy, type ThreeDPaneHostDefinition, type WorldSpaceCompositionSample, type WorldSpacePanelDefinition, applyInterfaceShellFocusShift, assessIdentityStatusOverlayDefinition, assessInterfaceShellDefinition, assessPlayerSystemInterfaceComposition, createFocusPaneShellDefinition, createIdentityStatusOverlayDefinition, createInterfaceShellDefinition, createInterfaceShellState, createInterfaceShellSurfaceDefinition, createLineOfSightTargetPopupDefinition, createLocalizedAmbientAlertDefinition, createPlayerSystemInterfaceContract, createPlayerSystemInterfacePortabilityContract, createThreeDPaneHostDefinition, createWorldSpacePanelDefinition, defaultPlayerSystemInterfaceContract, defaultPlayerSystemInterfacePortabilityContract, defaultReducedCombatOverlayPolicy, isPlayerSystemInterfaceMode, packageDescriptor, resolveLocalizedAmbientAlertMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -52,8 +52,36 @@ interface PlayerSystemInterfacePortabilityContractInput {
|
|
|
52
52
|
type PlayerSystemInterfaceMode = "ambient" | "focused" | "combat-safe";
|
|
53
53
|
type PlayerSystemPaneId = "identity" | "missions" | "guild-quests" | "logs" | "mcc" | "tutorial" | "points-store";
|
|
54
54
|
type InterfaceShellOwner = "player-system" | "party-system";
|
|
55
|
-
type InterfaceShellSurfaceKind = "world-panel" | "focus-pane" | "target-popup" | "alert-marker";
|
|
55
|
+
type InterfaceShellSurfaceKind = "world-panel" | "focus-pane" | "target-popup" | "alert-marker" | "identity-overlay";
|
|
56
56
|
type InterfaceCombatBehavior = "persist" | "reduce" | "suspend";
|
|
57
|
+
type IdentityProjectionRelation = "self" | "allied" | "neutral" | "unknown" | "unfriendly";
|
|
58
|
+
type IdentityProjectionInvocation = "self-state" | "identity-sweep" | "spell-targeting";
|
|
59
|
+
type IdentityProjectionReadConfidence = "complete" | "partial" | "fuzzy" | "withheld";
|
|
60
|
+
type IdentityProjectionPresentation = "full" | "condensed";
|
|
61
|
+
type IdentityProjectionFact = "display-name" | "relation" | "health-band" | "status-summary" | "threat-band" | "targeting-affordance";
|
|
62
|
+
interface IdentityStatusOverlayBaseDefinition {
|
|
63
|
+
readonly overlayId: string;
|
|
64
|
+
readonly surfaceId: string;
|
|
65
|
+
readonly readConfidence: IdentityProjectionReadConfidence;
|
|
66
|
+
readonly perceivableFacts: readonly IdentityProjectionFact[];
|
|
67
|
+
readonly readableFacts: readonly IdentityProjectionFact[];
|
|
68
|
+
readonly presentation: IdentityProjectionPresentation;
|
|
69
|
+
}
|
|
70
|
+
interface IdentitySelfStateOverlayDefinition extends IdentityStatusOverlayBaseDefinition {
|
|
71
|
+
readonly targetKind: "self";
|
|
72
|
+
readonly relation: "self";
|
|
73
|
+
readonly invocation: "self-state";
|
|
74
|
+
readonly requiresLineOfSight: false;
|
|
75
|
+
readonly targetId?: never;
|
|
76
|
+
}
|
|
77
|
+
interface IdentityTargetProjectionOverlayDefinition extends IdentityStatusOverlayBaseDefinition {
|
|
78
|
+
readonly targetKind: "external";
|
|
79
|
+
readonly targetId: string;
|
|
80
|
+
readonly relation: Exclude<IdentityProjectionRelation, "self">;
|
|
81
|
+
readonly invocation: Exclude<IdentityProjectionInvocation, "self-state">;
|
|
82
|
+
readonly requiresLineOfSight: true;
|
|
83
|
+
}
|
|
84
|
+
type IdentityStatusOverlayDefinition = IdentitySelfStateOverlayDefinition | IdentityTargetProjectionOverlayDefinition;
|
|
57
85
|
interface InterfaceShellSurfaceDefinition {
|
|
58
86
|
readonly surfaceId: string;
|
|
59
87
|
readonly owner: InterfaceShellOwner;
|
|
@@ -92,6 +120,7 @@ interface InterfaceShellDefinition {
|
|
|
92
120
|
readonly surfaces: readonly InterfaceShellSurfaceDefinition[];
|
|
93
121
|
readonly focusPane?: FocusPaneShellDefinition;
|
|
94
122
|
readonly targetPopups: readonly LineOfSightTargetPopupDefinition[];
|
|
123
|
+
readonly identityOverlays: readonly IdentityStatusOverlayDefinition[];
|
|
95
124
|
readonly paneHosts: readonly ThreeDPaneHostDefinition[];
|
|
96
125
|
readonly ambientAlerts: readonly LocalizedAmbientAlertDefinition[];
|
|
97
126
|
readonly reducedCombat: ReducedCombatOverlayPolicy;
|
|
@@ -101,6 +130,7 @@ interface InterfaceShellDefinitionInput {
|
|
|
101
130
|
readonly surfaces?: readonly InterfaceShellSurfaceDefinition[];
|
|
102
131
|
readonly focusPane?: FocusPaneShellDefinition;
|
|
103
132
|
readonly targetPopups?: readonly LineOfSightTargetPopupDefinition[];
|
|
133
|
+
readonly identityOverlays?: readonly IdentityStatusOverlayDefinition[];
|
|
104
134
|
readonly paneHosts?: readonly ThreeDPaneHostDefinition[];
|
|
105
135
|
readonly ambientAlerts?: readonly LocalizedAmbientAlertDefinition[];
|
|
106
136
|
readonly reducedCombat?: Partial<ReducedCombatOverlayPolicy>;
|
|
@@ -165,10 +195,11 @@ interface InterfaceContractAssessment {
|
|
|
165
195
|
}
|
|
166
196
|
declare const PLAYER_SYSTEM_INTERFACE_PACKAGE = "@plasius/player-system-interface";
|
|
167
197
|
declare const PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = "PLAYER_SYSTEM_INTERFACE";
|
|
168
|
-
declare const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "
|
|
169
|
-
declare const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "
|
|
170
|
-
declare const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "
|
|
171
|
-
declare const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "
|
|
198
|
+
declare const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
199
|
+
declare const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
200
|
+
declare const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
201
|
+
declare const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
202
|
+
declare const PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID = "harmony.player-system.identity.enabled";
|
|
172
203
|
declare const packageDescriptor: PackageDescriptor;
|
|
173
204
|
declare const defaultPlayerSystemInterfaceContract: PlayerSystemInterfaceContract;
|
|
174
205
|
declare const defaultPlayerSystemInterfacePortabilityContract: PlayerSystemInterfacePortabilityContract;
|
|
@@ -180,13 +211,15 @@ declare function createPlayerSystemInterfacePortabilityContract(input?: PlayerSy
|
|
|
180
211
|
declare function createInterfaceShellSurfaceDefinition(input: InterfaceShellSurfaceDefinition): InterfaceShellSurfaceDefinition;
|
|
181
212
|
declare function createFocusPaneShellDefinition(input: FocusPaneShellDefinition): FocusPaneShellDefinition;
|
|
182
213
|
declare function createLineOfSightTargetPopupDefinition(input: LineOfSightTargetPopupDefinition): LineOfSightTargetPopupDefinition;
|
|
214
|
+
declare function createIdentityStatusOverlayDefinition(input: IdentityStatusOverlayDefinition): IdentityStatusOverlayDefinition;
|
|
183
215
|
declare function createThreeDPaneHostDefinition(input: ThreeDPaneHostDefinition): ThreeDPaneHostDefinition;
|
|
184
216
|
declare function createLocalizedAmbientAlertDefinition(input: LocalizedAmbientAlertDefinition): LocalizedAmbientAlertDefinition;
|
|
185
217
|
declare function createInterfaceShellDefinition(input?: InterfaceShellDefinitionInput): InterfaceShellDefinition;
|
|
186
218
|
declare function createInterfaceShellState(shell: InterfaceShellDefinition, input: InterfaceShellStateInput): InterfaceShellStateDefinition;
|
|
187
219
|
declare function applyInterfaceShellFocusShift(state: InterfaceShellStateDefinition, focusShift: InterfaceFocusShift): InterfaceShellStateDefinition;
|
|
188
220
|
declare function resolveLocalizedAmbientAlertMessage(alert: LocalizedAmbientAlertDefinition, locale: string, fallbackLocale?: string): string | undefined;
|
|
221
|
+
declare function assessIdentityStatusOverlayDefinition(overlay: IdentityStatusOverlayDefinition): InterfaceContractAssessment;
|
|
189
222
|
declare function assessPlayerSystemInterfaceComposition(sample: WorldSpaceCompositionSample, contract?: PlayerSystemInterfacePortabilityContract): InterfaceContractAssessment;
|
|
190
223
|
declare function assessInterfaceShellDefinition(shell: InterfaceShellDefinition): InterfaceContractAssessment;
|
|
191
224
|
|
|
192
|
-
export { type AmbientAlertSeverity, type FocusPaneShellDefinition, type InterfaceCombatBehavior, type InterfaceContractAssessment, type InterfaceFocusShift, type InterfaceFocusShiftReason, type InterfaceFrameBudget, type InterfaceShellDefinition, type InterfaceShellDefinitionInput, type InterfaceShellOwner, type InterfaceShellStateDefinition, type InterfaceShellStateInput, type InterfaceShellSurfaceDefinition, type InterfaceShellSurfaceKind, type LineOfSightTargetPopupDefinition, type LocalizedAmbientAlertDefinition, type OverlayAccessibilityContract, type OverlayAdapterCapability, type OverlayAlertMarker, type OverlayCompositionScaleContract, type OverlayHostAdapterContract, type OverlayHostKind, type OverlayKeyboardPath, PLAYER_SYSTEM_INTERFACE_ENV_PREFIX, PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID, PLAYER_SYSTEM_INTERFACE_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemInterfaceContract, type PlayerSystemInterfaceContractInput, type PlayerSystemInterfaceMode, type PlayerSystemInterfacePortabilityContract, type PlayerSystemInterfacePortabilityContractInput, type PlayerSystemPaneId, type ReducedCombatOverlayPolicy, type ThreeDPaneHostDefinition, type WorldSpaceCompositionSample, type WorldSpacePanelDefinition, applyInterfaceShellFocusShift, assessInterfaceShellDefinition, assessPlayerSystemInterfaceComposition, createFocusPaneShellDefinition, createInterfaceShellDefinition, createInterfaceShellState, createInterfaceShellSurfaceDefinition, createLineOfSightTargetPopupDefinition, createLocalizedAmbientAlertDefinition, createPlayerSystemInterfaceContract, createPlayerSystemInterfacePortabilityContract, createThreeDPaneHostDefinition, createWorldSpacePanelDefinition, defaultPlayerSystemInterfaceContract, defaultPlayerSystemInterfacePortabilityContract, defaultReducedCombatOverlayPolicy, isPlayerSystemInterfaceMode, packageDescriptor, resolveLocalizedAmbientAlertMessage };
|
|
225
|
+
export { type AmbientAlertSeverity, type FocusPaneShellDefinition, type IdentityProjectionFact, type IdentityProjectionInvocation, type IdentityProjectionPresentation, type IdentityProjectionReadConfidence, type IdentityProjectionRelation, type IdentitySelfStateOverlayDefinition, type IdentityStatusOverlayBaseDefinition, type IdentityStatusOverlayDefinition, type IdentityTargetProjectionOverlayDefinition, type InterfaceCombatBehavior, type InterfaceContractAssessment, type InterfaceFocusShift, type InterfaceFocusShiftReason, type InterfaceFrameBudget, type InterfaceShellDefinition, type InterfaceShellDefinitionInput, type InterfaceShellOwner, type InterfaceShellStateDefinition, type InterfaceShellStateInput, type InterfaceShellSurfaceDefinition, type InterfaceShellSurfaceKind, type LineOfSightTargetPopupDefinition, type LocalizedAmbientAlertDefinition, type OverlayAccessibilityContract, type OverlayAdapterCapability, type OverlayAlertMarker, type OverlayCompositionScaleContract, type OverlayHostAdapterContract, type OverlayHostKind, type OverlayKeyboardPath, PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID, PLAYER_SYSTEM_INTERFACE_ENV_PREFIX, PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID, PLAYER_SYSTEM_INTERFACE_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemInterfaceContract, type PlayerSystemInterfaceContractInput, type PlayerSystemInterfaceMode, type PlayerSystemInterfacePortabilityContract, type PlayerSystemInterfacePortabilityContractInput, type PlayerSystemPaneId, type ReducedCombatOverlayPolicy, type ThreeDPaneHostDefinition, type WorldSpaceCompositionSample, type WorldSpacePanelDefinition, applyInterfaceShellFocusShift, assessIdentityStatusOverlayDefinition, assessInterfaceShellDefinition, assessPlayerSystemInterfaceComposition, createFocusPaneShellDefinition, createIdentityStatusOverlayDefinition, createInterfaceShellDefinition, createInterfaceShellState, createInterfaceShellSurfaceDefinition, createLineOfSightTargetPopupDefinition, createLocalizedAmbientAlertDefinition, createPlayerSystemInterfaceContract, createPlayerSystemInterfacePortabilityContract, createThreeDPaneHostDefinition, createWorldSpacePanelDefinition, defaultPlayerSystemInterfaceContract, defaultPlayerSystemInterfacePortabilityContract, defaultReducedCombatOverlayPolicy, isPlayerSystemInterfaceMode, packageDescriptor, resolveLocalizedAmbientAlertMessage };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
var PLAYER_SYSTEM_INTERFACE_PACKAGE = "@plasius/player-system-interface";
|
|
3
3
|
var PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = "PLAYER_SYSTEM_INTERFACE";
|
|
4
|
-
var PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "
|
|
4
|
+
var PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID = "harmony.player-system.interface.enabled";
|
|
5
5
|
var PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;
|
|
6
6
|
var PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;
|
|
7
7
|
var PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;
|
|
8
|
+
var PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID = "harmony.player-system.identity.enabled";
|
|
8
9
|
var packageDescriptor = Object.freeze({
|
|
9
10
|
packageName: PLAYER_SYSTEM_INTERFACE_PACKAGE,
|
|
10
11
|
featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,
|
|
@@ -57,7 +58,8 @@ var defaultReducedCombatOverlayPolicy = Object.freeze({
|
|
|
57
58
|
retainedSurfaceKinds: Object.freeze([
|
|
58
59
|
"alert-marker",
|
|
59
60
|
"target-popup",
|
|
60
|
-
"focus-pane"
|
|
61
|
+
"focus-pane",
|
|
62
|
+
"identity-overlay"
|
|
61
63
|
]),
|
|
62
64
|
maxInteractiveSurfaces: 1
|
|
63
65
|
});
|
|
@@ -111,6 +113,13 @@ function createFocusPaneShellDefinition(input) {
|
|
|
111
113
|
function createLineOfSightTargetPopupDefinition(input) {
|
|
112
114
|
return Object.freeze({ ...input });
|
|
113
115
|
}
|
|
116
|
+
function createIdentityStatusOverlayDefinition(input) {
|
|
117
|
+
return Object.freeze({
|
|
118
|
+
...input,
|
|
119
|
+
perceivableFacts: Object.freeze([...input.perceivableFacts]),
|
|
120
|
+
readableFacts: Object.freeze([...input.readableFacts])
|
|
121
|
+
});
|
|
122
|
+
}
|
|
114
123
|
function createThreeDPaneHostDefinition(input) {
|
|
115
124
|
return Object.freeze({
|
|
116
125
|
...input,
|
|
@@ -129,6 +138,7 @@ function createInterfaceShellDefinition(input = {}) {
|
|
|
129
138
|
surfaces: Object.freeze([...input.surfaces ?? []]),
|
|
130
139
|
focusPane: input.focusPane ? Object.freeze({ ...input.focusPane }) : void 0,
|
|
131
140
|
targetPopups: Object.freeze([...input.targetPopups ?? []]),
|
|
141
|
+
identityOverlays: Object.freeze([...input.identityOverlays ?? []]),
|
|
132
142
|
paneHosts: Object.freeze([...input.paneHosts ?? []]),
|
|
133
143
|
ambientAlerts: Object.freeze([...input.ambientAlerts ?? []]),
|
|
134
144
|
reducedCombat: Object.freeze({
|
|
@@ -175,6 +185,38 @@ function applyInterfaceShellFocusShift(state, focusShift) {
|
|
|
175
185
|
function resolveLocalizedAmbientAlertMessage(alert, locale, fallbackLocale = "en-GB") {
|
|
176
186
|
return alert.localizedMessages[locale] ?? alert.localizedMessages[fallbackLocale];
|
|
177
187
|
}
|
|
188
|
+
function assessIdentityStatusOverlayDefinition(overlay) {
|
|
189
|
+
const violations = [];
|
|
190
|
+
const perceivableFacts = new Set(overlay.perceivableFacts);
|
|
191
|
+
if (overlay.readableFacts.some((fact) => !perceivableFacts.has(fact))) {
|
|
192
|
+
violations.push("readableFacts");
|
|
193
|
+
}
|
|
194
|
+
if (overlay.readConfidence === "withheld" && overlay.readableFacts.length > 0) {
|
|
195
|
+
violations.push("withheldRead");
|
|
196
|
+
}
|
|
197
|
+
if (overlay.targetKind === "self") {
|
|
198
|
+
if (overlay.relation !== "self") {
|
|
199
|
+
violations.push("selfRelation");
|
|
200
|
+
}
|
|
201
|
+
if (overlay.invocation !== "self-state") {
|
|
202
|
+
violations.push("selfInvocation");
|
|
203
|
+
}
|
|
204
|
+
if (overlay.requiresLineOfSight) {
|
|
205
|
+
violations.push("selfLineOfSight");
|
|
206
|
+
}
|
|
207
|
+
} else {
|
|
208
|
+
if (overlay.targetId.length === 0) {
|
|
209
|
+
violations.push("targetId");
|
|
210
|
+
}
|
|
211
|
+
if (!overlay.requiresLineOfSight) {
|
|
212
|
+
violations.push("lineOfSight");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return Object.freeze({
|
|
216
|
+
accepted: violations.length === 0,
|
|
217
|
+
violations: Object.freeze(violations)
|
|
218
|
+
});
|
|
219
|
+
}
|
|
178
220
|
function assessPlayerSystemInterfaceComposition(sample, contract = defaultPlayerSystemInterfacePortabilityContract) {
|
|
179
221
|
const violations = [];
|
|
180
222
|
if (sample.panelCount > contract.compositionScale.maxWorldPanels) {
|
|
@@ -224,6 +266,18 @@ function assessInterfaceShellDefinition(shell) {
|
|
|
224
266
|
violations.push(`popup:${popup.popupId}`);
|
|
225
267
|
}
|
|
226
268
|
}
|
|
269
|
+
for (const overlay of shell.identityOverlays) {
|
|
270
|
+
const identityAssessment = assessIdentityStatusOverlayDefinition(overlay);
|
|
271
|
+
for (const violation of identityAssessment.violations) {
|
|
272
|
+
violations.push(`identityOverlay:${overlay.overlayId}:${violation}`);
|
|
273
|
+
}
|
|
274
|
+
const matchingSurface = shell.surfaces.find(
|
|
275
|
+
(surface) => surface.surfaceId === overlay.surfaceId && surface.kind === "identity-overlay"
|
|
276
|
+
);
|
|
277
|
+
if (!matchingSurface) {
|
|
278
|
+
violations.push(`identityOverlaySurface:${overlay.overlayId}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
227
281
|
for (const paneHost of shell.paneHosts) {
|
|
228
282
|
const matchingSurface = shell.surfaces.find(
|
|
229
283
|
(surface) => surface.surfaceId === paneHost.surfaceId && surface.owner === paneHost.owner && surface.anchorId === paneHost.anchorId
|
|
@@ -246,6 +300,7 @@ function assessInterfaceShellDefinition(shell) {
|
|
|
246
300
|
});
|
|
247
301
|
}
|
|
248
302
|
export {
|
|
303
|
+
PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID,
|
|
249
304
|
PLAYER_SYSTEM_INTERFACE_ENV_PREFIX,
|
|
250
305
|
PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,
|
|
251
306
|
PLAYER_SYSTEM_INTERFACE_PACKAGE,
|
|
@@ -253,9 +308,11 @@ export {
|
|
|
253
308
|
PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
254
309
|
PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
255
310
|
applyInterfaceShellFocusShift,
|
|
311
|
+
assessIdentityStatusOverlayDefinition,
|
|
256
312
|
assessInterfaceShellDefinition,
|
|
257
313
|
assessPlayerSystemInterfaceComposition,
|
|
258
314
|
createFocusPaneShellDefinition,
|
|
315
|
+
createIdentityStatusOverlayDefinition,
|
|
259
316
|
createInterfaceShellDefinition,
|
|
260
317
|
createInterfaceShellState,
|
|
261
318
|
createInterfaceShellSurfaceDefinition,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface PackageDescriptor {\n readonly packageName: string;\n readonly featureFlagId: string;\n readonly envPrefix: string;\n readonly summary: string;\n}\n\nexport type OverlayKeyboardPath = \"sequential\" | \"direct-hotkey\" | \"read-only\";\n\nexport interface OverlayAccessibilityContract {\n readonly keyboardPath: OverlayKeyboardPath;\n readonly focusRestorationTarget: \"trigger\" | \"pane-heading\" | \"nearest-anchor\";\n readonly liveRegionMode: \"polite\" | \"assertive\" | \"off\";\n readonly requiresAccessibleName: boolean;\n}\n\nexport interface InterfaceFrameBudget {\n readonly targetFps: number;\n readonly maxFrameMs: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport type OverlayHostKind =\n | \"dom-overlay\"\n | \"native-overlay\"\n | \"headless-snapshot\";\n\nexport type OverlayAdapterCapability =\n | \"focus-restoration\"\n | \"live-region\"\n | \"anchor-registry\";\n\nexport interface OverlayHostAdapterContract {\n readonly supportedHosts: readonly OverlayHostKind[];\n readonly requiredCapabilities: readonly OverlayAdapterCapability[];\n readonly forbiddenAssumptions: readonly string[];\n}\n\nexport interface OverlayCompositionScaleContract {\n readonly maxWorldPanels: number;\n readonly maxFocusPanes: number;\n readonly maxAlertMarkers: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport interface PlayerSystemInterfaceContract {\n readonly featureFlagId: string;\n readonly accessibility: OverlayAccessibilityContract;\n readonly frameBudget: InterfaceFrameBudget;\n}\n\nexport interface PlayerSystemInterfacePortabilityContract {\n readonly featureFlagId: string;\n readonly hostAdapters: OverlayHostAdapterContract;\n readonly compositionScale: OverlayCompositionScaleContract;\n}\n\nexport interface PlayerSystemInterfaceContractInput {\n readonly featureFlagId?: string;\n readonly accessibility?: Partial<OverlayAccessibilityContract>;\n readonly frameBudget?: Partial<InterfaceFrameBudget>;\n}\n\nexport interface PlayerSystemInterfacePortabilityContractInput {\n readonly featureFlagId?: string;\n readonly hostAdapters?: Partial<OverlayHostAdapterContract>;\n readonly compositionScale?: Partial<OverlayCompositionScaleContract>;\n}\n\nexport type PlayerSystemInterfaceMode = \"ambient\" | \"focused\" | \"combat-safe\";\n\nexport type PlayerSystemPaneId =\n | \"identity\"\n | \"missions\"\n | \"guild-quests\"\n | \"logs\"\n | \"mcc\"\n | \"tutorial\"\n | \"points-store\";\n\nexport type InterfaceShellOwner = \"player-system\" | \"party-system\";\nexport type InterfaceShellSurfaceKind =\n | \"world-panel\"\n | \"focus-pane\"\n | \"target-popup\"\n | \"alert-marker\";\nexport type InterfaceCombatBehavior = \"persist\" | \"reduce\" | \"suspend\";\n\nexport interface InterfaceShellSurfaceDefinition {\n readonly surfaceId: string;\n readonly owner: InterfaceShellOwner;\n readonly kind: InterfaceShellSurfaceKind;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly priority: number;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface FocusPaneShellDefinition {\n readonly panelId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly heading: string;\n readonly interactive: boolean;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface LineOfSightTargetPopupDefinition {\n readonly popupId: string;\n readonly owner: InterfaceShellOwner;\n readonly anchorId: string;\n readonly targetId: string;\n readonly summary: string;\n readonly requiresLineOfSight: boolean;\n readonly actionLabel?: string;\n}\n\nexport interface ReducedCombatOverlayPolicy {\n readonly featureFlagId: string;\n readonly mode: \"combat-safe\";\n readonly retainedSurfaceKinds: readonly InterfaceShellSurfaceKind[];\n readonly maxInteractiveSurfaces: number;\n}\n\nexport interface InterfaceShellDefinition {\n readonly featureFlagId: string;\n readonly surfaces: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups: readonly LineOfSightTargetPopupDefinition[];\n readonly paneHosts: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat: ReducedCombatOverlayPolicy;\n}\n\nexport interface InterfaceShellDefinitionInput {\n readonly featureFlagId?: string;\n readonly surfaces?: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups?: readonly LineOfSightTargetPopupDefinition[];\n readonly paneHosts?: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts?: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat?: Partial<ReducedCombatOverlayPolicy>;\n}\n\nexport type InterfaceFocusShiftReason =\n | \"keyboard\"\n | \"direct-hotkey\"\n | \"restore\"\n | \"system\";\n\nexport interface InterfaceFocusShift {\n readonly fromSurfaceId?: string;\n readonly toSurfaceId: string;\n readonly reason: InterfaceFocusShiftReason;\n}\n\nexport interface InterfaceShellStateDefinition {\n readonly featureFlagId: string;\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n readonly visibleSurfaceIds: readonly string[];\n readonly focusShift?: InterfaceFocusShift;\n}\n\nexport interface InterfaceShellStateInput {\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n}\n\nexport interface ThreeDPaneHostDefinition {\n readonly hostId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly surfaceId: string;\n readonly anchorId: string;\n readonly supportedHosts: readonly OverlayHostKind[];\n}\n\nexport type AmbientAlertSeverity = \"info\" | \"warning\" | \"danger\";\n\nexport interface LocalizedAmbientAlertDefinition {\n readonly alertId: string;\n readonly owner: InterfaceShellOwner;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n readonly messageKey: string;\n readonly localizedMessages: Readonly<Record<string, string>>;\n readonly liveRegionMode: \"polite\" | \"assertive\";\n}\n\nexport interface WorldSpacePanelDefinition {\n readonly panelId: string;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly accessibilityLabel?: string;\n readonly focusOrder?: number;\n}\n\nexport interface OverlayAlertMarker {\n readonly markerId: string;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n}\n\nexport interface WorldSpaceCompositionSample {\n readonly panelCount: number;\n readonly focusPaneCount: number;\n readonly alertMarkerCount: number;\n readonly interactivePanelCount: number;\n}\n\nexport interface InterfaceContractAssessment {\n readonly accepted: boolean;\n readonly violations: readonly string[];\n}\n\nexport const PLAYER_SYSTEM_INTERFACE_PACKAGE = \"@plasius/player-system-interface\";\nexport const PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = \"PLAYER_SYSTEM_INTERFACE\";\nexport const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID =\n \"isekai.player-system.interface.enabled\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_INTERFACE_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_INTERFACE_ENV_PREFIX,\n summary:\n \"World-space Player System overlays, focus panes, and target-surface contracts for Plasius game experiences.\",\n});\n\nexport const defaultPlayerSystemInterfaceContract: PlayerSystemInterfaceContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,\n accessibility: Object.freeze({\n keyboardPath: \"sequential\",\n focusRestorationTarget: \"trigger\",\n liveRegionMode: \"polite\",\n requiresAccessibleName: true,\n }),\n frameBudget: Object.freeze({\n targetFps: 60,\n maxFrameMs: 16,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultPlayerSystemInterfacePortabilityContract: PlayerSystemInterfacePortabilityContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,\n hostAdapters: Object.freeze({\n supportedHosts: Object.freeze([\n \"dom-overlay\",\n \"native-overlay\",\n \"headless-snapshot\",\n ] satisfies OverlayHostKind[]),\n requiredCapabilities: Object.freeze([\n \"focus-restoration\",\n \"live-region\",\n \"anchor-registry\",\n ] satisfies OverlayAdapterCapability[]),\n forbiddenAssumptions: Object.freeze([\n \"window-global\",\n \"single-pane-layout\",\n \"absolute-scene-coordinates\",\n ]),\n }),\n compositionScale: Object.freeze({\n maxWorldPanels: 6,\n maxFocusPanes: 3,\n maxAlertMarkers: 8,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultReducedCombatOverlayPolicy: ReducedCombatOverlayPolicy =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n mode: \"combat-safe\",\n retainedSurfaceKinds: Object.freeze([\n \"alert-marker\",\n \"target-popup\",\n \"focus-pane\",\n ] satisfies InterfaceShellSurfaceKind[]),\n maxInteractiveSurfaces: 1,\n });\n\nexport function isPlayerSystemInterfaceMode(\n value: string\n): value is PlayerSystemInterfaceMode {\n return value === \"ambient\" || value === \"focused\" || value === \"combat-safe\";\n}\n\nexport function createWorldSpacePanelDefinition(\n input: WorldSpacePanelDefinition\n): WorldSpacePanelDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createPlayerSystemInterfaceContract(\n input: PlayerSystemInterfaceContractInput = {}\n): PlayerSystemInterfaceContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ?? defaultPlayerSystemInterfaceContract.featureFlagId,\n accessibility: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.accessibility,\n ...input.accessibility,\n }),\n frameBudget: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.frameBudget,\n ...input.frameBudget,\n }),\n });\n}\n\nexport function createPlayerSystemInterfacePortabilityContract(\n input: PlayerSystemInterfacePortabilityContractInput = {}\n): PlayerSystemInterfacePortabilityContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ??\n defaultPlayerSystemInterfacePortabilityContract.featureFlagId,\n hostAdapters: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.hostAdapters,\n ...input.hostAdapters,\n supportedHosts: Object.freeze([\n ...(input.hostAdapters?.supportedHosts ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .supportedHosts),\n ]),\n requiredCapabilities: Object.freeze([\n ...(input.hostAdapters?.requiredCapabilities ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .requiredCapabilities),\n ]),\n forbiddenAssumptions: Object.freeze([\n ...(input.hostAdapters?.forbiddenAssumptions ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .forbiddenAssumptions),\n ]),\n }),\n compositionScale: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.compositionScale,\n ...input.compositionScale,\n }),\n });\n}\n\nexport function createInterfaceShellSurfaceDefinition(\n input: InterfaceShellSurfaceDefinition\n): InterfaceShellSurfaceDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createFocusPaneShellDefinition(\n input: FocusPaneShellDefinition\n): FocusPaneShellDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createLineOfSightTargetPopupDefinition(\n input: LineOfSightTargetPopupDefinition\n): LineOfSightTargetPopupDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createThreeDPaneHostDefinition(\n input: ThreeDPaneHostDefinition\n): ThreeDPaneHostDefinition {\n return Object.freeze({\n ...input,\n supportedHosts: Object.freeze([...input.supportedHosts]),\n });\n}\n\nexport function createLocalizedAmbientAlertDefinition(\n input: LocalizedAmbientAlertDefinition\n): LocalizedAmbientAlertDefinition {\n return Object.freeze({\n ...input,\n localizedMessages: Object.freeze({ ...input.localizedMessages }),\n });\n}\n\nexport function createInterfaceShellDefinition(\n input: InterfaceShellDefinitionInput = {}\n): InterfaceShellDefinition {\n return Object.freeze({\n featureFlagId: input.featureFlagId ?? PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n surfaces: Object.freeze([...(input.surfaces ?? [])]),\n focusPane: input.focusPane ? Object.freeze({ ...input.focusPane }) : undefined,\n targetPopups: Object.freeze([...(input.targetPopups ?? [])]),\n paneHosts: Object.freeze([...(input.paneHosts ?? [])]),\n ambientAlerts: Object.freeze([...(input.ambientAlerts ?? [])]),\n reducedCombat: Object.freeze({\n ...defaultReducedCombatOverlayPolicy,\n ...input.reducedCombat,\n retainedSurfaceKinds: Object.freeze([\n ...(input.reducedCombat?.retainedSurfaceKinds ??\n defaultReducedCombatOverlayPolicy.retainedSurfaceKinds),\n ]),\n }),\n });\n}\n\nexport function createInterfaceShellState(\n shell: InterfaceShellDefinition,\n input: InterfaceShellStateInput\n): InterfaceShellStateDefinition {\n const retainedSurfaceKinds = new Set(\n shell.reducedCombat.retainedSurfaceKinds\n );\n const visibleSurfaceIds = shell.surfaces\n .filter(\n (surface) =>\n input.mode !== \"combat-safe\" ||\n (surface.combatBehavior !== \"suspend\" &&\n retainedSurfaceKinds.has(surface.kind))\n )\n .map((surface) => surface.surfaceId);\n\n if (\n input.focusedSurfaceId &&\n !visibleSurfaceIds.includes(input.focusedSurfaceId)\n ) {\n throw new RangeError(\n `Focused surface '${input.focusedSurfaceId}' is not visible in ${input.mode} mode`\n );\n }\n\n return Object.freeze({\n featureFlagId: shell.featureFlagId,\n mode: input.mode,\n focusedSurfaceId:\n input.mode === \"focused\" ? input.focusedSurfaceId : undefined,\n visibleSurfaceIds: Object.freeze(visibleSurfaceIds),\n });\n}\n\nexport function applyInterfaceShellFocusShift(\n state: InterfaceShellStateDefinition,\n focusShift: InterfaceFocusShift\n): InterfaceShellStateDefinition {\n if (!state.visibleSurfaceIds.includes(focusShift.toSurfaceId)) {\n throw new RangeError(\n `Focused surface '${focusShift.toSurfaceId}' is not visible in ${state.mode} mode`\n );\n }\n\n return Object.freeze({\n ...state,\n mode: \"focused\",\n focusedSurfaceId: focusShift.toSurfaceId,\n focusShift: Object.freeze({ ...focusShift }),\n });\n}\n\nexport function resolveLocalizedAmbientAlertMessage(\n alert: LocalizedAmbientAlertDefinition,\n locale: string,\n fallbackLocale = \"en-GB\"\n): string | undefined {\n return alert.localizedMessages[locale] ?? alert.localizedMessages[fallbackLocale];\n}\n\nexport function assessPlayerSystemInterfaceComposition(\n sample: WorldSpaceCompositionSample,\n contract: PlayerSystemInterfacePortabilityContract = defaultPlayerSystemInterfacePortabilityContract\n): InterfaceContractAssessment {\n const violations: string[] = [];\n\n if (sample.panelCount > contract.compositionScale.maxWorldPanels) {\n violations.push(\"panelCount\");\n }\n\n if (sample.focusPaneCount > contract.compositionScale.maxFocusPanes) {\n violations.push(\"focusPaneCount\");\n }\n\n if (sample.alertMarkerCount > contract.compositionScale.maxAlertMarkers) {\n violations.push(\"alertMarkerCount\");\n }\n\n if (\n sample.interactivePanelCount >\n contract.compositionScale.maxInteractivePanelsPerFrame\n ) {\n violations.push(\"interactivePanelCount\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n\nexport function assessInterfaceShellDefinition(\n shell: InterfaceShellDefinition\n): InterfaceContractAssessment {\n const violations: string[] = [];\n const ownerSet = new Set(shell.surfaces.map((surface) => surface.owner));\n const retainedSurfaceKinds = new Set(shell.reducedCombat.retainedSurfaceKinds);\n const interactiveSurfaceCount = shell.surfaces.filter(\n (surface) => surface.interactive && retainedSurfaceKinds.has(surface.kind)\n ).length;\n const focusPane = shell.focusPane;\n\n if (shell.surfaces.length === 0) {\n violations.push(\"surfaces\");\n }\n\n if (focusPane && !ownerSet.has(focusPane.owner)) {\n violations.push(\"focusPaneOwner\");\n }\n\n if (focusPane) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.kind === \"focus-pane\" &&\n surface.anchorId === focusPane.anchorId &&\n surface.owner === focusPane.owner\n );\n if (!matchingSurface) {\n violations.push(\"focusPaneSurface\");\n }\n }\n\n if (\n interactiveSurfaceCount > shell.reducedCombat.maxInteractiveSurfaces\n ) {\n violations.push(\"interactiveSurfaceCount\");\n }\n\n for (const popup of shell.targetPopups) {\n if (popup.requiresLineOfSight && popup.anchorId.length === 0) {\n violations.push(`popup:${popup.popupId}`);\n }\n }\n\n for (const paneHost of shell.paneHosts) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.surfaceId === paneHost.surfaceId &&\n surface.owner === paneHost.owner &&\n surface.anchorId === paneHost.anchorId\n );\n if (!matchingSurface) {\n violations.push(`paneHost:${paneHost.hostId}`);\n }\n }\n\n for (const alert of shell.ambientAlerts) {\n if (Object.keys(alert.localizedMessages).length === 0) {\n violations.push(`alert:${alert.alertId}`);\n }\n }\n\n if (\n ownerSet.has(\"player-system\") &&\n ownerSet.has(\"party-system\") &&\n shell.reducedCombat.retainedSurfaceKinds.length === 0\n ) {\n violations.push(\"reducedCombat\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n"],"mappings":";AA0NO,IAAM,kCAAkC;AACxC,IAAM,qCAAqC;AAC3C,IAAM,0CACX;AACK,IAAM,yCACX;AACK,IAAM,4CACX;AACK,IAAM,oDACX;AAEK,IAAM,oBAAuC,OAAO,OAAO;AAAA,EAChE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SACE;AACJ,CAAC;AAEM,IAAM,uCACX,OAAO,OAAO;AAAA,EACZ,eAAe;AAAA,EACf,eAAe,OAAO,OAAO;AAAA,IAC3B,cAAc;AAAA,IACd,wBAAwB;AAAA,IACxB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B,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eAAe;AAAA,EACjC;AAEA,SAAO,OAAO,OAAO;AAAA,IACnB,UAAU,WAAW,WAAW;AAAA,IAChC,YAAY,OAAO,OAAO,UAAU;AAAA,EACtC,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface PackageDescriptor {\n readonly packageName: string;\n readonly featureFlagId: string;\n readonly envPrefix: string;\n readonly summary: string;\n}\n\nexport type OverlayKeyboardPath = \"sequential\" | \"direct-hotkey\" | \"read-only\";\n\nexport interface OverlayAccessibilityContract {\n readonly keyboardPath: OverlayKeyboardPath;\n readonly focusRestorationTarget: \"trigger\" | \"pane-heading\" | \"nearest-anchor\";\n readonly liveRegionMode: \"polite\" | \"assertive\" | \"off\";\n readonly requiresAccessibleName: boolean;\n}\n\nexport interface InterfaceFrameBudget {\n readonly targetFps: number;\n readonly maxFrameMs: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport type OverlayHostKind =\n | \"dom-overlay\"\n | \"native-overlay\"\n | \"headless-snapshot\";\n\nexport type OverlayAdapterCapability =\n | \"focus-restoration\"\n | \"live-region\"\n | \"anchor-registry\";\n\nexport interface OverlayHostAdapterContract {\n readonly supportedHosts: readonly OverlayHostKind[];\n readonly requiredCapabilities: readonly OverlayAdapterCapability[];\n readonly forbiddenAssumptions: readonly string[];\n}\n\nexport interface OverlayCompositionScaleContract {\n readonly maxWorldPanels: number;\n readonly maxFocusPanes: number;\n readonly maxAlertMarkers: number;\n readonly maxInteractivePanelsPerFrame: number;\n}\n\nexport interface PlayerSystemInterfaceContract {\n readonly featureFlagId: string;\n readonly accessibility: OverlayAccessibilityContract;\n readonly frameBudget: InterfaceFrameBudget;\n}\n\nexport interface PlayerSystemInterfacePortabilityContract {\n readonly featureFlagId: string;\n readonly hostAdapters: OverlayHostAdapterContract;\n readonly compositionScale: OverlayCompositionScaleContract;\n}\n\nexport interface PlayerSystemInterfaceContractInput {\n readonly featureFlagId?: string;\n readonly accessibility?: Partial<OverlayAccessibilityContract>;\n readonly frameBudget?: Partial<InterfaceFrameBudget>;\n}\n\nexport interface PlayerSystemInterfacePortabilityContractInput {\n readonly featureFlagId?: string;\n readonly hostAdapters?: Partial<OverlayHostAdapterContract>;\n readonly compositionScale?: Partial<OverlayCompositionScaleContract>;\n}\n\nexport type PlayerSystemInterfaceMode = \"ambient\" | \"focused\" | \"combat-safe\";\n\nexport type PlayerSystemPaneId =\n | \"identity\"\n | \"missions\"\n | \"guild-quests\"\n | \"logs\"\n | \"mcc\"\n | \"tutorial\"\n | \"points-store\";\n\nexport type InterfaceShellOwner = \"player-system\" | \"party-system\";\nexport type InterfaceShellSurfaceKind =\n | \"world-panel\"\n | \"focus-pane\"\n | \"target-popup\"\n | \"alert-marker\"\n | \"identity-overlay\";\nexport type InterfaceCombatBehavior = \"persist\" | \"reduce\" | \"suspend\";\n\nexport type IdentityProjectionRelation =\n | \"self\"\n | \"allied\"\n | \"neutral\"\n | \"unknown\"\n | \"unfriendly\";\nexport type IdentityProjectionInvocation =\n | \"self-state\"\n | \"identity-sweep\"\n | \"spell-targeting\";\nexport type IdentityProjectionReadConfidence =\n | \"complete\"\n | \"partial\"\n | \"fuzzy\"\n | \"withheld\";\nexport type IdentityProjectionPresentation = \"full\" | \"condensed\";\nexport type IdentityProjectionFact =\n | \"display-name\"\n | \"relation\"\n | \"health-band\"\n | \"status-summary\"\n | \"threat-band\"\n | \"targeting-affordance\";\n\nexport interface IdentityStatusOverlayBaseDefinition {\n readonly overlayId: string;\n readonly surfaceId: string;\n readonly readConfidence: IdentityProjectionReadConfidence;\n readonly perceivableFacts: readonly IdentityProjectionFact[];\n readonly readableFacts: readonly IdentityProjectionFact[];\n readonly presentation: IdentityProjectionPresentation;\n}\n\nexport interface IdentitySelfStateOverlayDefinition\n extends IdentityStatusOverlayBaseDefinition {\n readonly targetKind: \"self\";\n readonly relation: \"self\";\n readonly invocation: \"self-state\";\n readonly requiresLineOfSight: false;\n readonly targetId?: never;\n}\n\nexport interface IdentityTargetProjectionOverlayDefinition\n extends IdentityStatusOverlayBaseDefinition {\n readonly targetKind: \"external\";\n readonly targetId: string;\n readonly relation: Exclude<IdentityProjectionRelation, \"self\">;\n readonly invocation: Exclude<IdentityProjectionInvocation, \"self-state\">;\n readonly requiresLineOfSight: true;\n}\n\nexport type IdentityStatusOverlayDefinition =\n | IdentitySelfStateOverlayDefinition\n | IdentityTargetProjectionOverlayDefinition;\n\nexport interface InterfaceShellSurfaceDefinition {\n readonly surfaceId: string;\n readonly owner: InterfaceShellOwner;\n readonly kind: InterfaceShellSurfaceKind;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly priority: number;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface FocusPaneShellDefinition {\n readonly panelId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly heading: string;\n readonly interactive: boolean;\n readonly combatBehavior: InterfaceCombatBehavior;\n}\n\nexport interface LineOfSightTargetPopupDefinition {\n readonly popupId: string;\n readonly owner: InterfaceShellOwner;\n readonly anchorId: string;\n readonly targetId: string;\n readonly summary: string;\n readonly requiresLineOfSight: boolean;\n readonly actionLabel?: string;\n}\n\nexport interface ReducedCombatOverlayPolicy {\n readonly featureFlagId: string;\n readonly mode: \"combat-safe\";\n readonly retainedSurfaceKinds: readonly InterfaceShellSurfaceKind[];\n readonly maxInteractiveSurfaces: number;\n}\n\nexport interface InterfaceShellDefinition {\n readonly featureFlagId: string;\n readonly surfaces: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups: readonly LineOfSightTargetPopupDefinition[];\n readonly identityOverlays: readonly IdentityStatusOverlayDefinition[];\n readonly paneHosts: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat: ReducedCombatOverlayPolicy;\n}\n\nexport interface InterfaceShellDefinitionInput {\n readonly featureFlagId?: string;\n readonly surfaces?: readonly InterfaceShellSurfaceDefinition[];\n readonly focusPane?: FocusPaneShellDefinition;\n readonly targetPopups?: readonly LineOfSightTargetPopupDefinition[];\n readonly identityOverlays?: readonly IdentityStatusOverlayDefinition[];\n readonly paneHosts?: readonly ThreeDPaneHostDefinition[];\n readonly ambientAlerts?: readonly LocalizedAmbientAlertDefinition[];\n readonly reducedCombat?: Partial<ReducedCombatOverlayPolicy>;\n}\n\nexport type InterfaceFocusShiftReason =\n | \"keyboard\"\n | \"direct-hotkey\"\n | \"restore\"\n | \"system\";\n\nexport interface InterfaceFocusShift {\n readonly fromSurfaceId?: string;\n readonly toSurfaceId: string;\n readonly reason: InterfaceFocusShiftReason;\n}\n\nexport interface InterfaceShellStateDefinition {\n readonly featureFlagId: string;\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n readonly visibleSurfaceIds: readonly string[];\n readonly focusShift?: InterfaceFocusShift;\n}\n\nexport interface InterfaceShellStateInput {\n readonly mode: PlayerSystemInterfaceMode;\n readonly focusedSurfaceId?: string;\n}\n\nexport interface ThreeDPaneHostDefinition {\n readonly hostId: string;\n readonly owner: InterfaceShellOwner;\n readonly pane: PlayerSystemPaneId;\n readonly surfaceId: string;\n readonly anchorId: string;\n readonly supportedHosts: readonly OverlayHostKind[];\n}\n\nexport type AmbientAlertSeverity = \"info\" | \"warning\" | \"danger\";\n\nexport interface LocalizedAmbientAlertDefinition {\n readonly alertId: string;\n readonly owner: InterfaceShellOwner;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n readonly messageKey: string;\n readonly localizedMessages: Readonly<Record<string, string>>;\n readonly liveRegionMode: \"polite\" | \"assertive\";\n}\n\nexport interface WorldSpacePanelDefinition {\n readonly panelId: string;\n readonly pane: PlayerSystemPaneId;\n readonly anchorId: string;\n readonly interactive: boolean;\n readonly accessibilityLabel?: string;\n readonly focusOrder?: number;\n}\n\nexport interface OverlayAlertMarker {\n readonly markerId: string;\n readonly severity: AmbientAlertSeverity;\n readonly anchorId: string;\n}\n\nexport interface WorldSpaceCompositionSample {\n readonly panelCount: number;\n readonly focusPaneCount: number;\n readonly alertMarkerCount: number;\n readonly interactivePanelCount: number;\n}\n\nexport interface InterfaceContractAssessment {\n readonly accepted: boolean;\n readonly violations: readonly string[];\n}\n\nexport const PLAYER_SYSTEM_INTERFACE_PACKAGE = \"@plasius/player-system-interface\";\nexport const PLAYER_SYSTEM_INTERFACE_ENV_PREFIX = \"PLAYER_SYSTEM_INTERFACE\";\nexport const PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID =\n \"harmony.player-system.interface.enabled\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_IDENTITY_FEATURE_FLAG_ID =\n \"harmony.player-system.identity.enabled\";\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_INTERFACE_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_INTERFACE_ENV_PREFIX,\n summary:\n \"World-space Player System overlays, focus panes, and target-surface contracts for Plasius game experiences.\",\n});\n\nexport const defaultPlayerSystemInterfaceContract: PlayerSystemInterfaceContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,\n accessibility: Object.freeze({\n keyboardPath: \"sequential\",\n focusRestorationTarget: \"trigger\",\n liveRegionMode: \"polite\",\n requiresAccessibleName: true,\n }),\n frameBudget: Object.freeze({\n targetFps: 60,\n maxFrameMs: 16,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultPlayerSystemInterfacePortabilityContract: PlayerSystemInterfacePortabilityContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,\n hostAdapters: Object.freeze({\n supportedHosts: Object.freeze([\n \"dom-overlay\",\n \"native-overlay\",\n \"headless-snapshot\",\n ] satisfies OverlayHostKind[]),\n requiredCapabilities: Object.freeze([\n \"focus-restoration\",\n \"live-region\",\n \"anchor-registry\",\n ] satisfies OverlayAdapterCapability[]),\n forbiddenAssumptions: Object.freeze([\n \"window-global\",\n \"single-pane-layout\",\n \"absolute-scene-coordinates\",\n ]),\n }),\n compositionScale: Object.freeze({\n maxWorldPanels: 6,\n maxFocusPanes: 3,\n maxAlertMarkers: 8,\n maxInteractivePanelsPerFrame: 2,\n }),\n });\n\nexport const defaultReducedCombatOverlayPolicy: ReducedCombatOverlayPolicy =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n mode: \"combat-safe\",\n retainedSurfaceKinds: Object.freeze([\n \"alert-marker\",\n \"target-popup\",\n \"focus-pane\",\n \"identity-overlay\",\n ] satisfies InterfaceShellSurfaceKind[]),\n maxInteractiveSurfaces: 1,\n });\n\nexport function isPlayerSystemInterfaceMode(\n value: string\n): value is PlayerSystemInterfaceMode {\n return value === \"ambient\" || value === \"focused\" || value === \"combat-safe\";\n}\n\nexport function createWorldSpacePanelDefinition(\n input: WorldSpacePanelDefinition\n): WorldSpacePanelDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createPlayerSystemInterfaceContract(\n input: PlayerSystemInterfaceContractInput = {}\n): PlayerSystemInterfaceContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ?? defaultPlayerSystemInterfaceContract.featureFlagId,\n accessibility: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.accessibility,\n ...input.accessibility,\n }),\n frameBudget: Object.freeze({\n ...defaultPlayerSystemInterfaceContract.frameBudget,\n ...input.frameBudget,\n }),\n });\n}\n\nexport function createPlayerSystemInterfacePortabilityContract(\n input: PlayerSystemInterfacePortabilityContractInput = {}\n): PlayerSystemInterfacePortabilityContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ??\n defaultPlayerSystemInterfacePortabilityContract.featureFlagId,\n hostAdapters: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.hostAdapters,\n ...input.hostAdapters,\n supportedHosts: Object.freeze([\n ...(input.hostAdapters?.supportedHosts ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .supportedHosts),\n ]),\n requiredCapabilities: Object.freeze([\n ...(input.hostAdapters?.requiredCapabilities ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .requiredCapabilities),\n ]),\n forbiddenAssumptions: Object.freeze([\n ...(input.hostAdapters?.forbiddenAssumptions ??\n defaultPlayerSystemInterfacePortabilityContract.hostAdapters\n .forbiddenAssumptions),\n ]),\n }),\n compositionScale: Object.freeze({\n ...defaultPlayerSystemInterfacePortabilityContract.compositionScale,\n ...input.compositionScale,\n }),\n });\n}\n\nexport function createInterfaceShellSurfaceDefinition(\n input: InterfaceShellSurfaceDefinition\n): InterfaceShellSurfaceDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createFocusPaneShellDefinition(\n input: FocusPaneShellDefinition\n): FocusPaneShellDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createLineOfSightTargetPopupDefinition(\n input: LineOfSightTargetPopupDefinition\n): LineOfSightTargetPopupDefinition {\n return Object.freeze({ ...input });\n}\n\nexport function createIdentityStatusOverlayDefinition(\n input: IdentityStatusOverlayDefinition\n): IdentityStatusOverlayDefinition {\n return Object.freeze({\n ...input,\n perceivableFacts: Object.freeze([...input.perceivableFacts]),\n readableFacts: Object.freeze([...input.readableFacts]),\n });\n}\n\nexport function createThreeDPaneHostDefinition(\n input: ThreeDPaneHostDefinition\n): ThreeDPaneHostDefinition {\n return Object.freeze({\n ...input,\n supportedHosts: Object.freeze([...input.supportedHosts]),\n });\n}\n\nexport function createLocalizedAmbientAlertDefinition(\n input: LocalizedAmbientAlertDefinition\n): LocalizedAmbientAlertDefinition {\n return Object.freeze({\n ...input,\n localizedMessages: Object.freeze({ ...input.localizedMessages }),\n });\n}\n\nexport function createInterfaceShellDefinition(\n input: InterfaceShellDefinitionInput = {}\n): InterfaceShellDefinition {\n return Object.freeze({\n featureFlagId: input.featureFlagId ?? PLAYER_SYSTEM_INTERFACE_FEATURE_FLAG_ID,\n surfaces: Object.freeze([...(input.surfaces ?? [])]),\n focusPane: input.focusPane ? Object.freeze({ ...input.focusPane }) : undefined,\n targetPopups: Object.freeze([...(input.targetPopups ?? [])]),\n identityOverlays: Object.freeze([...(input.identityOverlays ?? [])]),\n paneHosts: Object.freeze([...(input.paneHosts ?? [])]),\n ambientAlerts: Object.freeze([...(input.ambientAlerts ?? [])]),\n reducedCombat: Object.freeze({\n ...defaultReducedCombatOverlayPolicy,\n ...input.reducedCombat,\n retainedSurfaceKinds: Object.freeze([\n ...(input.reducedCombat?.retainedSurfaceKinds ??\n defaultReducedCombatOverlayPolicy.retainedSurfaceKinds),\n ]),\n }),\n });\n}\n\nexport function createInterfaceShellState(\n shell: InterfaceShellDefinition,\n input: InterfaceShellStateInput\n): InterfaceShellStateDefinition {\n const retainedSurfaceKinds = new Set(\n shell.reducedCombat.retainedSurfaceKinds\n );\n const visibleSurfaceIds = shell.surfaces\n .filter(\n (surface) =>\n input.mode !== \"combat-safe\" ||\n (surface.combatBehavior !== \"suspend\" &&\n retainedSurfaceKinds.has(surface.kind))\n )\n .map((surface) => surface.surfaceId);\n\n if (\n input.focusedSurfaceId &&\n !visibleSurfaceIds.includes(input.focusedSurfaceId)\n ) {\n throw new RangeError(\n `Focused surface '${input.focusedSurfaceId}' is not visible in ${input.mode} mode`\n );\n }\n\n return Object.freeze({\n featureFlagId: shell.featureFlagId,\n mode: input.mode,\n focusedSurfaceId:\n input.mode === \"focused\" ? input.focusedSurfaceId : undefined,\n visibleSurfaceIds: Object.freeze(visibleSurfaceIds),\n });\n}\n\nexport function applyInterfaceShellFocusShift(\n state: InterfaceShellStateDefinition,\n focusShift: InterfaceFocusShift\n): InterfaceShellStateDefinition {\n if (!state.visibleSurfaceIds.includes(focusShift.toSurfaceId)) {\n throw new RangeError(\n `Focused surface '${focusShift.toSurfaceId}' is not visible in ${state.mode} mode`\n );\n }\n\n return Object.freeze({\n ...state,\n mode: \"focused\",\n focusedSurfaceId: focusShift.toSurfaceId,\n focusShift: Object.freeze({ ...focusShift }),\n });\n}\n\nexport function resolveLocalizedAmbientAlertMessage(\n alert: LocalizedAmbientAlertDefinition,\n locale: string,\n fallbackLocale = \"en-GB\"\n): string | undefined {\n return alert.localizedMessages[locale] ?? alert.localizedMessages[fallbackLocale];\n}\n\nexport function assessIdentityStatusOverlayDefinition(\n overlay: IdentityStatusOverlayDefinition\n): InterfaceContractAssessment {\n const violations: string[] = [];\n const perceivableFacts = new Set(overlay.perceivableFacts);\n\n if (overlay.readableFacts.some((fact) => !perceivableFacts.has(fact))) {\n violations.push(\"readableFacts\");\n }\n\n if (overlay.readConfidence === \"withheld\" && overlay.readableFacts.length > 0) {\n violations.push(\"withheldRead\");\n }\n\n if (overlay.targetKind === \"self\") {\n if (overlay.relation !== \"self\") {\n violations.push(\"selfRelation\");\n }\n if (overlay.invocation !== \"self-state\") {\n violations.push(\"selfInvocation\");\n }\n if (overlay.requiresLineOfSight) {\n violations.push(\"selfLineOfSight\");\n }\n } else {\n if (overlay.targetId.length === 0) {\n violations.push(\"targetId\");\n }\n if (!overlay.requiresLineOfSight) {\n violations.push(\"lineOfSight\");\n }\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n\nexport function assessPlayerSystemInterfaceComposition(\n sample: WorldSpaceCompositionSample,\n contract: PlayerSystemInterfacePortabilityContract = defaultPlayerSystemInterfacePortabilityContract\n): InterfaceContractAssessment {\n const violations: string[] = [];\n\n if (sample.panelCount > contract.compositionScale.maxWorldPanels) {\n violations.push(\"panelCount\");\n }\n\n if (sample.focusPaneCount > contract.compositionScale.maxFocusPanes) {\n violations.push(\"focusPaneCount\");\n }\n\n if (sample.alertMarkerCount > contract.compositionScale.maxAlertMarkers) {\n violations.push(\"alertMarkerCount\");\n }\n\n if (\n sample.interactivePanelCount >\n contract.compositionScale.maxInteractivePanelsPerFrame\n ) {\n violations.push(\"interactivePanelCount\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n\nexport function assessInterfaceShellDefinition(\n shell: InterfaceShellDefinition\n): InterfaceContractAssessment {\n const violations: string[] = [];\n const ownerSet = new Set(shell.surfaces.map((surface) => surface.owner));\n const retainedSurfaceKinds = new Set(shell.reducedCombat.retainedSurfaceKinds);\n const interactiveSurfaceCount = shell.surfaces.filter(\n (surface) => surface.interactive && retainedSurfaceKinds.has(surface.kind)\n ).length;\n const focusPane = shell.focusPane;\n\n if (shell.surfaces.length === 0) {\n violations.push(\"surfaces\");\n }\n\n if (focusPane && !ownerSet.has(focusPane.owner)) {\n violations.push(\"focusPaneOwner\");\n }\n\n if (focusPane) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.kind === \"focus-pane\" &&\n surface.anchorId === focusPane.anchorId &&\n surface.owner === focusPane.owner\n );\n if (!matchingSurface) {\n violations.push(\"focusPaneSurface\");\n }\n }\n\n if (\n interactiveSurfaceCount > shell.reducedCombat.maxInteractiveSurfaces\n ) {\n violations.push(\"interactiveSurfaceCount\");\n }\n\n for (const popup of shell.targetPopups) {\n if (popup.requiresLineOfSight && popup.anchorId.length === 0) {\n violations.push(`popup:${popup.popupId}`);\n }\n }\n\n for (const overlay of shell.identityOverlays) {\n const identityAssessment = assessIdentityStatusOverlayDefinition(overlay);\n for (const violation of identityAssessment.violations) {\n violations.push(`identityOverlay:${overlay.overlayId}:${violation}`);\n }\n\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.surfaceId === overlay.surfaceId &&\n surface.kind === \"identity-overlay\"\n );\n if (!matchingSurface) {\n violations.push(`identityOverlaySurface:${overlay.overlayId}`);\n }\n }\n\n for (const paneHost of shell.paneHosts) {\n const matchingSurface = shell.surfaces.find(\n (surface) =>\n surface.surfaceId === paneHost.surfaceId &&\n surface.owner === paneHost.owner &&\n surface.anchorId === paneHost.anchorId\n );\n if (!matchingSurface) {\n violations.push(`paneHost:${paneHost.hostId}`);\n }\n }\n\n for (const alert of shell.ambientAlerts) {\n if (Object.keys(alert.localizedMessages).length === 0) {\n violations.push(`alert:${alert.alertId}`);\n }\n }\n\n if (\n ownerSet.has(\"player-system\") &&\n ownerSet.has(\"party-system\") &&\n shell.reducedCombat.retainedSurfaceKinds.length === 0\n ) {\n violations.push(\"reducedCombat\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n"],"mappings":";AAoRO,IAAM,kCAAkC;AACxC,IAAM,qCAAqC;AAC3C,IAAM,0CACX;AACK,IAAM,yCACX;AACK,IAAM,4CACX;AACK,IAAM,oDACX;AACK,IAAM,yCACX;AAEK,IAAM,oBAAuC,OAAO,OAAO;AAAA,EAChE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SACE;AACJ,CAAC;AAEM,IAAM,uCACX,OAAO,OAAO;AAAA,EACZ,eAAe;AAAA,EACf,eAAe,OAAO,OAAO;AAAA,IAC3B,cAAc;AAAA,IACd,wBAAwB;AAAA,IACxB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B,CAAC;AAAA,EACD,aAAa,OAAO,OAAO;AAAA,IACzB,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,8BAA8B;AAAA,EAChC,CAAC;AACH,CAAC;AAEI,IAAM,kDACX,OAAO,OAAO;AAAA,EACZ,eAAe;AAAA,EACf,cAAc,OAAO,OAAO;AAAA,IAC1B,gBAAgB,OAAO,OAAO;AAAA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