@plasius/player-system-demo-viewer 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -4
- package/dist/index.cjs +186 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -3
- package/dist/index.d.ts +65 -3
- package/dist/index.js +178 -3
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -26,6 +26,9 @@ npm install @plasius/player-system-demo-viewer
|
|
|
26
26
|
- combat-safe reduction demos
|
|
27
27
|
- institution-routing demos
|
|
28
28
|
- points-ledger demos
|
|
29
|
+
- launch, transition, and steady-state validation budgets for demo runs
|
|
30
|
+
- degraded-path expectations for runtime failures surfaced through demos
|
|
31
|
+
- privacy-safe sample personas and scaled composition evidence for runtime adoption
|
|
29
32
|
|
|
30
33
|
## Demo
|
|
31
34
|
|
|
@@ -37,15 +40,43 @@ node demo/example.mjs
|
|
|
37
40
|
## Usage
|
|
38
41
|
|
|
39
42
|
```ts
|
|
40
|
-
import {
|
|
43
|
+
import {
|
|
44
|
+
createPlayerSystemDemoManifest,
|
|
45
|
+
defaultPrivacySafeDemoScenarios,
|
|
46
|
+
defaultPlayerSystemDemoPortabilityContract,
|
|
47
|
+
defaultPlayerSystemDemoValidationContract,
|
|
48
|
+
} from "@plasius/player-system-demo-viewer";
|
|
41
49
|
|
|
42
|
-
const manifest = createPlayerSystemDemoManifest(
|
|
43
|
-
{ scenarioId: "awakening", title: "Awakening" },
|
|
44
|
-
]);
|
|
50
|
+
const manifest = createPlayerSystemDemoManifest(defaultPrivacySafeDemoScenarios);
|
|
45
51
|
|
|
46
52
|
console.log(manifest.scenarios.length);
|
|
53
|
+
console.log(defaultPlayerSystemDemoValidationContract.performanceBudget.launchMs);
|
|
54
|
+
console.log(defaultPlayerSystemDemoPortabilityContract.sampleData.sampleClassification);
|
|
47
55
|
```
|
|
48
56
|
|
|
57
|
+
## Demo Validation Contract
|
|
58
|
+
|
|
59
|
+
The inherited feature flag for this work is `isekai.player-system.runtime-nfr.enabled`.
|
|
60
|
+
|
|
61
|
+
`defaultPlayerSystemDemoValidationContract` and `createPlayerSystemDemoValidationContract()` define:
|
|
62
|
+
|
|
63
|
+
- launch, transition, and steady-state frame budgets for demo validation
|
|
64
|
+
- warm-frame expectations before a scenario is considered stable
|
|
65
|
+
- degraded/failure handling that stays bounded and testable
|
|
66
|
+
|
|
67
|
+
## Demo Portability Contract
|
|
68
|
+
|
|
69
|
+
The inherited feature flag for this work is `isekai.player-system.runtime-portability.enabled`.
|
|
70
|
+
|
|
71
|
+
`defaultPlayerSystemDemoPortabilityContract`,
|
|
72
|
+
`createPlayerSystemDemoPortabilityContract()`,
|
|
73
|
+
`defaultPrivacySafeDemoScenarios`, and
|
|
74
|
+
`assessPlayerSystemDemoScenarioPortability()` define:
|
|
75
|
+
|
|
76
|
+
- synthetic-only sample personas that avoid direct real-user-like identifiers
|
|
77
|
+
- composition scenarios sized to the documented runtime and interface budgets
|
|
78
|
+
- reusable validation metadata for scaled demo evidence
|
|
79
|
+
|
|
49
80
|
## Governance
|
|
50
81
|
|
|
51
82
|
- ADRs: [docs/adrs](./docs/adrs)
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,15 @@ __export(index_exports, {
|
|
|
24
24
|
PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID,
|
|
25
25
|
PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE: () => PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,
|
|
26
26
|
PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,
|
|
27
|
+
PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
28
|
+
PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID: () => PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
29
|
+
assessPlayerSystemDemoScenarioPortability: () => assessPlayerSystemDemoScenarioPortability,
|
|
27
30
|
createPlayerSystemDemoManifest: () => createPlayerSystemDemoManifest,
|
|
31
|
+
createPlayerSystemDemoPortabilityContract: () => createPlayerSystemDemoPortabilityContract,
|
|
32
|
+
createPlayerSystemDemoValidationContract: () => createPlayerSystemDemoValidationContract,
|
|
33
|
+
defaultPlayerSystemDemoPortabilityContract: () => defaultPlayerSystemDemoPortabilityContract,
|
|
34
|
+
defaultPlayerSystemDemoValidationContract: () => defaultPlayerSystemDemoValidationContract,
|
|
35
|
+
defaultPrivacySafeDemoScenarios: () => defaultPrivacySafeDemoScenarios,
|
|
28
36
|
packageDescriptor: () => packageDescriptor
|
|
29
37
|
});
|
|
30
38
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -32,14 +40,181 @@ var PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = "@plasius/player-system-demo-viewer";
|
|
|
32
40
|
var PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = "PLAYER_SYSTEM_DEMO_VIEWER";
|
|
33
41
|
var PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "isekai.player-system.packages.enabled";
|
|
34
42
|
var PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID = PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID;
|
|
43
|
+
var PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "isekai.player-system.runtime-nfr.enabled";
|
|
44
|
+
var PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "isekai.player-system.runtime-portability.enabled";
|
|
35
45
|
var packageDescriptor = Object.freeze({
|
|
36
46
|
packageName: PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,
|
|
37
|
-
featureFlagId:
|
|
47
|
+
featureFlagId: PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID,
|
|
38
48
|
envPrefix: PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX,
|
|
39
49
|
summary: "Static validation launcher and scenario manifest surface for Player System demos."
|
|
40
50
|
});
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
var defaultPlayerSystemDemoValidationContract = Object.freeze({
|
|
52
|
+
featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
53
|
+
performanceBudget: Object.freeze({
|
|
54
|
+
launchMs: 1500,
|
|
55
|
+
transitionMs: 200,
|
|
56
|
+
steadyStateFrameMs: 16,
|
|
57
|
+
warmFrames: 5
|
|
58
|
+
}),
|
|
59
|
+
failureExpectation: Object.freeze({
|
|
60
|
+
degradedMode: "freeze-last-good-frame",
|
|
61
|
+
boundedErrorCodes: Object.freeze([
|
|
62
|
+
"PLAYER_SYSTEM_DEMO_TIMEOUT",
|
|
63
|
+
"PLAYER_SYSTEM_DEMO_DEGRADED"
|
|
64
|
+
])
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
var defaultPlayerSystemDemoPortabilityContract = Object.freeze({
|
|
68
|
+
featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
69
|
+
sampleData: Object.freeze({
|
|
70
|
+
sampleClassification: "synthetic-only",
|
|
71
|
+
forbiddenSensitiveFields: Object.freeze([
|
|
72
|
+
"email",
|
|
73
|
+
"accountId",
|
|
74
|
+
"oauthSubject",
|
|
75
|
+
"accessToken",
|
|
76
|
+
"refreshToken"
|
|
77
|
+
])
|
|
78
|
+
}),
|
|
79
|
+
compositionScale: Object.freeze({
|
|
80
|
+
maxRuntimeModules: 3,
|
|
81
|
+
maxWorldPanels: 6,
|
|
82
|
+
maxAlertMarkers: 8,
|
|
83
|
+
maxFocusPanes: 3
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
var defaultPrivacySafeDemoScenarios = Object.freeze([
|
|
87
|
+
Object.freeze({
|
|
88
|
+
scenarioId: "awakening",
|
|
89
|
+
title: "Awakening",
|
|
90
|
+
description: "Synthetic single-player baseline for onboarding validation.",
|
|
91
|
+
samplePersona: Object.freeze({
|
|
92
|
+
personaId: "persona-awakening-001",
|
|
93
|
+
characterHandle: "Dawnstrider",
|
|
94
|
+
classification: "synthetic"
|
|
95
|
+
}),
|
|
96
|
+
composition: Object.freeze({
|
|
97
|
+
runtimeModules: 2,
|
|
98
|
+
worldPanels: 3,
|
|
99
|
+
alertMarkers: 2,
|
|
100
|
+
focusPanes: 1
|
|
101
|
+
})
|
|
102
|
+
}),
|
|
103
|
+
Object.freeze({
|
|
104
|
+
scenarioId: "scaled-composition",
|
|
105
|
+
title: "Scaled Composition",
|
|
106
|
+
description: "Synthetic max-budget composition exercising runtime module and overlay limits.",
|
|
107
|
+
samplePersona: Object.freeze({
|
|
108
|
+
personaId: "persona-scale-001",
|
|
109
|
+
characterHandle: "LanternKeep",
|
|
110
|
+
classification: "synthetic"
|
|
111
|
+
}),
|
|
112
|
+
composition: Object.freeze({
|
|
113
|
+
runtimeModules: 3,
|
|
114
|
+
worldPanels: 6,
|
|
115
|
+
alertMarkers: 8,
|
|
116
|
+
focusPanes: 3
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
]);
|
|
120
|
+
function createPlayerSystemDemoManifest(scenarios, validationContract = defaultPlayerSystemDemoValidationContract, portabilityContract = defaultPlayerSystemDemoPortabilityContract) {
|
|
121
|
+
return Object.freeze({
|
|
122
|
+
scenarios: Object.freeze(
|
|
123
|
+
scenarios.map(
|
|
124
|
+
(scenario) => Object.freeze({
|
|
125
|
+
...scenario,
|
|
126
|
+
samplePersona: scenario.samplePersona ? Object.freeze({ ...scenario.samplePersona }) : void 0,
|
|
127
|
+
composition: scenario.composition ? Object.freeze({ ...scenario.composition }) : void 0
|
|
128
|
+
})
|
|
129
|
+
)
|
|
130
|
+
),
|
|
131
|
+
validationContract: Object.freeze({
|
|
132
|
+
featureFlagId: validationContract.featureFlagId,
|
|
133
|
+
performanceBudget: Object.freeze({
|
|
134
|
+
...validationContract.performanceBudget
|
|
135
|
+
}),
|
|
136
|
+
failureExpectation: Object.freeze({
|
|
137
|
+
...validationContract.failureExpectation,
|
|
138
|
+
boundedErrorCodes: Object.freeze([
|
|
139
|
+
...validationContract.failureExpectation.boundedErrorCodes
|
|
140
|
+
])
|
|
141
|
+
})
|
|
142
|
+
}),
|
|
143
|
+
portabilityContract: Object.freeze({
|
|
144
|
+
featureFlagId: portabilityContract.featureFlagId,
|
|
145
|
+
sampleData: Object.freeze({
|
|
146
|
+
...portabilityContract.sampleData,
|
|
147
|
+
forbiddenSensitiveFields: Object.freeze([
|
|
148
|
+
...portabilityContract.sampleData.forbiddenSensitiveFields
|
|
149
|
+
])
|
|
150
|
+
}),
|
|
151
|
+
compositionScale: Object.freeze({
|
|
152
|
+
...portabilityContract.compositionScale
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function createPlayerSystemDemoValidationContract(input = {}) {
|
|
158
|
+
return Object.freeze({
|
|
159
|
+
featureFlagId: input.featureFlagId ?? defaultPlayerSystemDemoValidationContract.featureFlagId,
|
|
160
|
+
performanceBudget: Object.freeze({
|
|
161
|
+
...defaultPlayerSystemDemoValidationContract.performanceBudget,
|
|
162
|
+
...input.performanceBudget
|
|
163
|
+
}),
|
|
164
|
+
failureExpectation: Object.freeze({
|
|
165
|
+
...defaultPlayerSystemDemoValidationContract.failureExpectation,
|
|
166
|
+
...input.failureExpectation,
|
|
167
|
+
boundedErrorCodes: input.failureExpectation?.boundedErrorCodes ?? defaultPlayerSystemDemoValidationContract.failureExpectation.boundedErrorCodes
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function createPlayerSystemDemoPortabilityContract(input = {}) {
|
|
172
|
+
return Object.freeze({
|
|
173
|
+
featureFlagId: input.featureFlagId ?? defaultPlayerSystemDemoPortabilityContract.featureFlagId,
|
|
174
|
+
sampleData: Object.freeze({
|
|
175
|
+
...defaultPlayerSystemDemoPortabilityContract.sampleData,
|
|
176
|
+
...input.sampleData,
|
|
177
|
+
forbiddenSensitiveFields: Object.freeze([
|
|
178
|
+
...input.sampleData?.forbiddenSensitiveFields ?? defaultPlayerSystemDemoPortabilityContract.sampleData.forbiddenSensitiveFields
|
|
179
|
+
])
|
|
180
|
+
}),
|
|
181
|
+
compositionScale: Object.freeze({
|
|
182
|
+
...defaultPlayerSystemDemoPortabilityContract.compositionScale,
|
|
183
|
+
...input.compositionScale
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function assessPlayerSystemDemoScenarioPortability(scenario, contract = defaultPlayerSystemDemoPortabilityContract) {
|
|
188
|
+
const violations = [];
|
|
189
|
+
if (scenario.samplePersona?.classification !== "synthetic") {
|
|
190
|
+
violations.push("samplePersona.classification");
|
|
191
|
+
}
|
|
192
|
+
if (scenario.samplePersona) {
|
|
193
|
+
for (const sensitiveField of contract.sampleData.forbiddenSensitiveFields) {
|
|
194
|
+
if (Object.prototype.hasOwnProperty.call(
|
|
195
|
+
scenario.samplePersona,
|
|
196
|
+
sensitiveField
|
|
197
|
+
)) {
|
|
198
|
+
violations.push(`samplePersona.${sensitiveField}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (scenario.composition && scenario.composition.runtimeModules > contract.compositionScale.maxRuntimeModules) {
|
|
203
|
+
violations.push("composition.runtimeModules");
|
|
204
|
+
}
|
|
205
|
+
if (scenario.composition && scenario.composition.worldPanels > contract.compositionScale.maxWorldPanels) {
|
|
206
|
+
violations.push("composition.worldPanels");
|
|
207
|
+
}
|
|
208
|
+
if (scenario.composition && scenario.composition.alertMarkers > contract.compositionScale.maxAlertMarkers) {
|
|
209
|
+
violations.push("composition.alertMarkers");
|
|
210
|
+
}
|
|
211
|
+
if (scenario.composition && scenario.composition.focusPanes > contract.compositionScale.maxFocusPanes) {
|
|
212
|
+
violations.push("composition.focusPanes");
|
|
213
|
+
}
|
|
214
|
+
return Object.freeze({
|
|
215
|
+
accepted: violations.length === 0,
|
|
216
|
+
violations: Object.freeze(violations)
|
|
217
|
+
});
|
|
43
218
|
}
|
|
44
219
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
220
|
0 && (module.exports = {
|
|
@@ -47,7 +222,15 @@ function createPlayerSystemDemoManifest(scenarios) {
|
|
|
47
222
|
PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID,
|
|
48
223
|
PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,
|
|
49
224
|
PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,
|
|
225
|
+
PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
226
|
+
PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
227
|
+
assessPlayerSystemDemoScenarioPortability,
|
|
50
228
|
createPlayerSystemDemoManifest,
|
|
229
|
+
createPlayerSystemDemoPortabilityContract,
|
|
230
|
+
createPlayerSystemDemoValidationContract,
|
|
231
|
+
defaultPlayerSystemDemoPortabilityContract,
|
|
232
|
+
defaultPlayerSystemDemoValidationContract,
|
|
233
|
+
defaultPrivacySafeDemoScenarios,
|
|
51
234
|
packageDescriptor
|
|
52
235
|
});
|
|
53
236
|
//# sourceMappingURL=index.cjs.map
|
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 PlayerSystemDemoScenarioId =\n | \"awakening\"\n | \"combat-safe\"\n | \"institution-routing\"\n | \"points-ledgers\";\n\nexport interface PlayerSystemDemoScenario {\n readonly scenarioId: PlayerSystemDemoScenarioId;\n readonly title: string;\n readonly description?: string;\n}\n\nexport interface PlayerSystemDemoManifest {\n readonly scenarios: readonly PlayerSystemDemoScenario[];\n}\n\nexport const PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = \"@plasius/player-system-demo-viewer\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = \"PLAYER_SYSTEM_DEMO_VIEWER\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n \"isekai.player-system.packages.enabled\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID;\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX,\n summary: \"Static validation launcher and scenario manifest surface for Player System demos.\",\n});\n\nexport function createPlayerSystemDemoManifest(\n scenarios: readonly PlayerSystemDemoScenario[]\n): PlayerSystemDemoManifest {\n return Object.freeze({ scenarios });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBO,IAAM,oCAAoC;AAC1C,IAAM,uCAAuC;AAC7C,IAAM,yCACX;AACK,IAAM,4CACX;AAEK,IAAM,oBAAuC,OAAO,OAAO;AAAA,EAChE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SAAS;AACX,CAAC;AAEM,SAAS,+BACd,WAC0B;AAC1B,SAAO,OAAO,OAAO,EAAE,UAAU,CAAC;AACpC;","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 interface DemoPerformanceBudget {\n readonly launchMs: number;\n readonly transitionMs: number;\n readonly steadyStateFrameMs: number;\n readonly warmFrames: number;\n}\n\nexport interface DemoFailureExpectation {\n readonly degradedMode:\n | \"freeze-last-good-frame\"\n | \"fallback-overlay\"\n | \"skip-scenario\";\n readonly boundedErrorCodes: readonly string[];\n}\n\nexport interface DemoSampleDataPolicy {\n readonly sampleClassification: \"synthetic-only\";\n readonly forbiddenSensitiveFields: readonly string[];\n}\n\nexport interface DemoCompositionScaleContract {\n readonly maxRuntimeModules: number;\n readonly maxWorldPanels: number;\n readonly maxAlertMarkers: number;\n readonly maxFocusPanes: number;\n}\n\nexport interface PlayerSystemDemoValidationContract {\n readonly featureFlagId: string;\n readonly performanceBudget: DemoPerformanceBudget;\n readonly failureExpectation: DemoFailureExpectation;\n}\n\nexport interface PlayerSystemDemoPortabilityContract {\n readonly featureFlagId: string;\n readonly sampleData: DemoSampleDataPolicy;\n readonly compositionScale: DemoCompositionScaleContract;\n}\n\nexport type PlayerSystemDemoScenarioId =\n | \"awakening\"\n | \"combat-safe\"\n | \"institution-routing\"\n | \"points-ledgers\"\n | \"scaled-composition\";\n\nexport interface PlayerSystemDemoSamplePersona {\n readonly personaId: string;\n readonly characterHandle: string;\n readonly classification: \"synthetic\";\n}\n\nexport interface PlayerSystemDemoScenarioComposition {\n readonly runtimeModules: number;\n readonly worldPanels: number;\n readonly alertMarkers: number;\n readonly focusPanes: number;\n}\n\nexport interface PlayerSystemDemoScenario {\n readonly scenarioId: PlayerSystemDemoScenarioId;\n readonly title: string;\n readonly description?: string;\n readonly samplePersona?: PlayerSystemDemoSamplePersona;\n readonly composition?: PlayerSystemDemoScenarioComposition;\n}\n\nexport interface PlayerSystemDemoManifest {\n readonly scenarios: readonly PlayerSystemDemoScenario[];\n readonly validationContract?: PlayerSystemDemoValidationContract;\n readonly portabilityContract?: PlayerSystemDemoPortabilityContract;\n}\n\nexport interface PlayerSystemDemoPortabilityContractInput {\n readonly featureFlagId?: string;\n readonly sampleData?: Partial<DemoSampleDataPolicy>;\n readonly compositionScale?: Partial<DemoCompositionScaleContract>;\n}\n\nexport interface DemoPortabilityAssessment {\n readonly accepted: boolean;\n readonly violations: readonly string[];\n}\n\nexport const PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = \"@plasius/player-system-demo-viewer\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = \"PLAYER_SYSTEM_DEMO_VIEWER\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n \"isekai.player-system.packages.enabled\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID =\n \"isekai.player-system.runtime-nfr.enabled\";\nexport const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID =\n \"isekai.player-system.runtime-portability.enabled\";\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX,\n summary: \"Static validation launcher and scenario manifest surface for Player System demos.\",\n});\n\nexport const defaultPlayerSystemDemoValidationContract: PlayerSystemDemoValidationContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,\n performanceBudget: Object.freeze({\n launchMs: 1_500,\n transitionMs: 200,\n steadyStateFrameMs: 16,\n warmFrames: 5,\n }),\n failureExpectation: Object.freeze({\n degradedMode: \"freeze-last-good-frame\",\n boundedErrorCodes: Object.freeze([\n \"PLAYER_SYSTEM_DEMO_TIMEOUT\",\n \"PLAYER_SYSTEM_DEMO_DEGRADED\",\n ]),\n }),\n });\n\nexport const defaultPlayerSystemDemoPortabilityContract: PlayerSystemDemoPortabilityContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,\n sampleData: Object.freeze({\n sampleClassification: \"synthetic-only\",\n forbiddenSensitiveFields: Object.freeze([\n \"email\",\n \"accountId\",\n \"oauthSubject\",\n \"accessToken\",\n \"refreshToken\",\n ]),\n }),\n compositionScale: Object.freeze({\n maxRuntimeModules: 3,\n maxWorldPanels: 6,\n maxAlertMarkers: 8,\n maxFocusPanes: 3,\n }),\n });\n\nexport const defaultPrivacySafeDemoScenarios: readonly PlayerSystemDemoScenario[] =\n Object.freeze([\n Object.freeze({\n scenarioId: \"awakening\",\n title: \"Awakening\",\n description: \"Synthetic single-player baseline for onboarding validation.\",\n samplePersona: Object.freeze({\n personaId: \"persona-awakening-001\",\n characterHandle: \"Dawnstrider\",\n classification: \"synthetic\",\n }),\n composition: Object.freeze({\n runtimeModules: 2,\n worldPanels: 3,\n alertMarkers: 2,\n focusPanes: 1,\n }),\n }),\n Object.freeze({\n scenarioId: \"scaled-composition\",\n title: \"Scaled Composition\",\n description:\n \"Synthetic max-budget composition exercising runtime module and overlay limits.\",\n samplePersona: Object.freeze({\n personaId: \"persona-scale-001\",\n characterHandle: \"LanternKeep\",\n classification: \"synthetic\",\n }),\n composition: Object.freeze({\n runtimeModules: 3,\n worldPanels: 6,\n alertMarkers: 8,\n focusPanes: 3,\n }),\n }),\n ]);\n\nexport function createPlayerSystemDemoManifest(\n scenarios: readonly PlayerSystemDemoScenario[],\n validationContract: PlayerSystemDemoValidationContract = defaultPlayerSystemDemoValidationContract,\n portabilityContract: PlayerSystemDemoPortabilityContract = defaultPlayerSystemDemoPortabilityContract\n): PlayerSystemDemoManifest {\n return Object.freeze({\n scenarios: Object.freeze(\n scenarios.map((scenario) =>\n Object.freeze({\n ...scenario,\n samplePersona: scenario.samplePersona\n ? Object.freeze({ ...scenario.samplePersona })\n : undefined,\n composition: scenario.composition\n ? Object.freeze({ ...scenario.composition })\n : undefined,\n })\n )\n ),\n validationContract: Object.freeze({\n featureFlagId: validationContract.featureFlagId,\n performanceBudget: Object.freeze({\n ...validationContract.performanceBudget,\n }),\n failureExpectation: Object.freeze({\n ...validationContract.failureExpectation,\n boundedErrorCodes: Object.freeze([\n ...validationContract.failureExpectation.boundedErrorCodes,\n ]),\n }),\n }),\n portabilityContract: Object.freeze({\n featureFlagId: portabilityContract.featureFlagId,\n sampleData: Object.freeze({\n ...portabilityContract.sampleData,\n forbiddenSensitiveFields: Object.freeze([\n ...portabilityContract.sampleData.forbiddenSensitiveFields,\n ]),\n }),\n compositionScale: Object.freeze({\n ...portabilityContract.compositionScale,\n }),\n }),\n });\n}\n\nexport function createPlayerSystemDemoValidationContract(\n input: Partial<PlayerSystemDemoValidationContract> = {}\n): PlayerSystemDemoValidationContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ?? defaultPlayerSystemDemoValidationContract.featureFlagId,\n performanceBudget: Object.freeze({\n ...defaultPlayerSystemDemoValidationContract.performanceBudget,\n ...input.performanceBudget,\n }),\n failureExpectation: Object.freeze({\n ...defaultPlayerSystemDemoValidationContract.failureExpectation,\n ...input.failureExpectation,\n boundedErrorCodes:\n input.failureExpectation?.boundedErrorCodes ??\n defaultPlayerSystemDemoValidationContract.failureExpectation.boundedErrorCodes,\n }),\n });\n}\n\nexport function createPlayerSystemDemoPortabilityContract(\n input: PlayerSystemDemoPortabilityContractInput = {}\n): PlayerSystemDemoPortabilityContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ??\n defaultPlayerSystemDemoPortabilityContract.featureFlagId,\n sampleData: Object.freeze({\n ...defaultPlayerSystemDemoPortabilityContract.sampleData,\n ...input.sampleData,\n forbiddenSensitiveFields: Object.freeze([\n ...(input.sampleData?.forbiddenSensitiveFields ??\n defaultPlayerSystemDemoPortabilityContract.sampleData\n .forbiddenSensitiveFields),\n ]),\n }),\n compositionScale: Object.freeze({\n ...defaultPlayerSystemDemoPortabilityContract.compositionScale,\n ...input.compositionScale,\n }),\n });\n}\n\nexport function assessPlayerSystemDemoScenarioPortability(\n scenario: PlayerSystemDemoScenario,\n contract: PlayerSystemDemoPortabilityContract = defaultPlayerSystemDemoPortabilityContract\n): DemoPortabilityAssessment {\n const violations: string[] = [];\n\n if (scenario.samplePersona?.classification !== \"synthetic\") {\n violations.push(\"samplePersona.classification\");\n }\n\n if (scenario.samplePersona) {\n for (const sensitiveField of contract.sampleData.forbiddenSensitiveFields) {\n if (\n Object.prototype.hasOwnProperty.call(\n scenario.samplePersona,\n sensitiveField\n )\n ) {\n violations.push(`samplePersona.${sensitiveField}`);\n }\n }\n }\n\n if (\n scenario.composition &&\n scenario.composition.runtimeModules >\n contract.compositionScale.maxRuntimeModules\n ) {\n violations.push(\"composition.runtimeModules\");\n }\n\n if (\n scenario.composition &&\n scenario.composition.worldPanels > contract.compositionScale.maxWorldPanels\n ) {\n violations.push(\"composition.worldPanels\");\n }\n\n if (\n scenario.composition &&\n scenario.composition.alertMarkers >\n contract.compositionScale.maxAlertMarkers\n ) {\n violations.push(\"composition.alertMarkers\");\n }\n\n if (\n scenario.composition &&\n scenario.composition.focusPanes > contract.compositionScale.maxFocusPanes\n ) {\n violations.push(\"composition.focusPanes\");\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;AA2FO,IAAM,oCAAoC;AAC1C,IAAM,uCAAuC;AAC7C,IAAM,yCACX;AACK,IAAM,4CACX;AACK,IAAM,4CACX;AACK,IAAM,oDACX;AAEK,IAAM,oBAAuC,OAAO,OAAO;AAAA,EAChE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SAAS;AACX,CAAC;AAEM,IAAM,4CACX,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B;AAAA,EAC3C;AAEA,MACE,SAAS,eACT,SAAS,YAAY,eACnB,SAAS,iBAAiB,iBAC5B;AACA,eAAW,KAAK,0BAA0B;AAAA,EAC5C;AAEA,MACE,SAAS,eACT,SAAS,YAAY,aAAa,SAAS,iBAAiB,eAC5D;AACA,eAAW,KAAK,wBAAwB;AAAA,EAC1C;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
|
@@ -4,20 +4,82 @@ interface PackageDescriptor {
|
|
|
4
4
|
readonly envPrefix: string;
|
|
5
5
|
readonly summary: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface DemoPerformanceBudget {
|
|
8
|
+
readonly launchMs: number;
|
|
9
|
+
readonly transitionMs: number;
|
|
10
|
+
readonly steadyStateFrameMs: number;
|
|
11
|
+
readonly warmFrames: number;
|
|
12
|
+
}
|
|
13
|
+
interface DemoFailureExpectation {
|
|
14
|
+
readonly degradedMode: "freeze-last-good-frame" | "fallback-overlay" | "skip-scenario";
|
|
15
|
+
readonly boundedErrorCodes: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
interface DemoSampleDataPolicy {
|
|
18
|
+
readonly sampleClassification: "synthetic-only";
|
|
19
|
+
readonly forbiddenSensitiveFields: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
interface DemoCompositionScaleContract {
|
|
22
|
+
readonly maxRuntimeModules: number;
|
|
23
|
+
readonly maxWorldPanels: number;
|
|
24
|
+
readonly maxAlertMarkers: number;
|
|
25
|
+
readonly maxFocusPanes: number;
|
|
26
|
+
}
|
|
27
|
+
interface PlayerSystemDemoValidationContract {
|
|
28
|
+
readonly featureFlagId: string;
|
|
29
|
+
readonly performanceBudget: DemoPerformanceBudget;
|
|
30
|
+
readonly failureExpectation: DemoFailureExpectation;
|
|
31
|
+
}
|
|
32
|
+
interface PlayerSystemDemoPortabilityContract {
|
|
33
|
+
readonly featureFlagId: string;
|
|
34
|
+
readonly sampleData: DemoSampleDataPolicy;
|
|
35
|
+
readonly compositionScale: DemoCompositionScaleContract;
|
|
36
|
+
}
|
|
37
|
+
type PlayerSystemDemoScenarioId = "awakening" | "combat-safe" | "institution-routing" | "points-ledgers" | "scaled-composition";
|
|
38
|
+
interface PlayerSystemDemoSamplePersona {
|
|
39
|
+
readonly personaId: string;
|
|
40
|
+
readonly characterHandle: string;
|
|
41
|
+
readonly classification: "synthetic";
|
|
42
|
+
}
|
|
43
|
+
interface PlayerSystemDemoScenarioComposition {
|
|
44
|
+
readonly runtimeModules: number;
|
|
45
|
+
readonly worldPanels: number;
|
|
46
|
+
readonly alertMarkers: number;
|
|
47
|
+
readonly focusPanes: number;
|
|
48
|
+
}
|
|
8
49
|
interface PlayerSystemDemoScenario {
|
|
9
50
|
readonly scenarioId: PlayerSystemDemoScenarioId;
|
|
10
51
|
readonly title: string;
|
|
11
52
|
readonly description?: string;
|
|
53
|
+
readonly samplePersona?: PlayerSystemDemoSamplePersona;
|
|
54
|
+
readonly composition?: PlayerSystemDemoScenarioComposition;
|
|
12
55
|
}
|
|
13
56
|
interface PlayerSystemDemoManifest {
|
|
14
57
|
readonly scenarios: readonly PlayerSystemDemoScenario[];
|
|
58
|
+
readonly validationContract?: PlayerSystemDemoValidationContract;
|
|
59
|
+
readonly portabilityContract?: PlayerSystemDemoPortabilityContract;
|
|
60
|
+
}
|
|
61
|
+
interface PlayerSystemDemoPortabilityContractInput {
|
|
62
|
+
readonly featureFlagId?: string;
|
|
63
|
+
readonly sampleData?: Partial<DemoSampleDataPolicy>;
|
|
64
|
+
readonly compositionScale?: Partial<DemoCompositionScaleContract>;
|
|
65
|
+
}
|
|
66
|
+
interface DemoPortabilityAssessment {
|
|
67
|
+
readonly accepted: boolean;
|
|
68
|
+
readonly violations: readonly string[];
|
|
15
69
|
}
|
|
16
70
|
declare const PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = "@plasius/player-system-demo-viewer";
|
|
17
71
|
declare const PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = "PLAYER_SYSTEM_DEMO_VIEWER";
|
|
18
72
|
declare const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "isekai.player-system.packages.enabled";
|
|
19
73
|
declare const PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID = "isekai.player-system.packages.enabled";
|
|
74
|
+
declare const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "isekai.player-system.runtime-nfr.enabled";
|
|
75
|
+
declare const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "isekai.player-system.runtime-portability.enabled";
|
|
20
76
|
declare const packageDescriptor: PackageDescriptor;
|
|
21
|
-
declare
|
|
77
|
+
declare const defaultPlayerSystemDemoValidationContract: PlayerSystemDemoValidationContract;
|
|
78
|
+
declare const defaultPlayerSystemDemoPortabilityContract: PlayerSystemDemoPortabilityContract;
|
|
79
|
+
declare const defaultPrivacySafeDemoScenarios: readonly PlayerSystemDemoScenario[];
|
|
80
|
+
declare function createPlayerSystemDemoManifest(scenarios: readonly PlayerSystemDemoScenario[], validationContract?: PlayerSystemDemoValidationContract, portabilityContract?: PlayerSystemDemoPortabilityContract): PlayerSystemDemoManifest;
|
|
81
|
+
declare function createPlayerSystemDemoValidationContract(input?: Partial<PlayerSystemDemoValidationContract>): PlayerSystemDemoValidationContract;
|
|
82
|
+
declare function createPlayerSystemDemoPortabilityContract(input?: PlayerSystemDemoPortabilityContractInput): PlayerSystemDemoPortabilityContract;
|
|
83
|
+
declare function assessPlayerSystemDemoScenarioPortability(scenario: PlayerSystemDemoScenario, contract?: PlayerSystemDemoPortabilityContract): DemoPortabilityAssessment;
|
|
22
84
|
|
|
23
|
-
export { PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX, PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID, PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemDemoManifest, type PlayerSystemDemoScenario, type PlayerSystemDemoScenarioId, createPlayerSystemDemoManifest, packageDescriptor };
|
|
85
|
+
export { type DemoCompositionScaleContract, type DemoFailureExpectation, type DemoPerformanceBudget, type DemoPortabilityAssessment, type DemoSampleDataPolicy, PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX, PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID, PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemDemoManifest, type PlayerSystemDemoPortabilityContract, type PlayerSystemDemoPortabilityContractInput, type PlayerSystemDemoSamplePersona, type PlayerSystemDemoScenario, type PlayerSystemDemoScenarioComposition, type PlayerSystemDemoScenarioId, type PlayerSystemDemoValidationContract, assessPlayerSystemDemoScenarioPortability, createPlayerSystemDemoManifest, createPlayerSystemDemoPortabilityContract, createPlayerSystemDemoValidationContract, defaultPlayerSystemDemoPortabilityContract, defaultPlayerSystemDemoValidationContract, defaultPrivacySafeDemoScenarios, packageDescriptor };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,20 +4,82 @@ interface PackageDescriptor {
|
|
|
4
4
|
readonly envPrefix: string;
|
|
5
5
|
readonly summary: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface DemoPerformanceBudget {
|
|
8
|
+
readonly launchMs: number;
|
|
9
|
+
readonly transitionMs: number;
|
|
10
|
+
readonly steadyStateFrameMs: number;
|
|
11
|
+
readonly warmFrames: number;
|
|
12
|
+
}
|
|
13
|
+
interface DemoFailureExpectation {
|
|
14
|
+
readonly degradedMode: "freeze-last-good-frame" | "fallback-overlay" | "skip-scenario";
|
|
15
|
+
readonly boundedErrorCodes: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
interface DemoSampleDataPolicy {
|
|
18
|
+
readonly sampleClassification: "synthetic-only";
|
|
19
|
+
readonly forbiddenSensitiveFields: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
interface DemoCompositionScaleContract {
|
|
22
|
+
readonly maxRuntimeModules: number;
|
|
23
|
+
readonly maxWorldPanels: number;
|
|
24
|
+
readonly maxAlertMarkers: number;
|
|
25
|
+
readonly maxFocusPanes: number;
|
|
26
|
+
}
|
|
27
|
+
interface PlayerSystemDemoValidationContract {
|
|
28
|
+
readonly featureFlagId: string;
|
|
29
|
+
readonly performanceBudget: DemoPerformanceBudget;
|
|
30
|
+
readonly failureExpectation: DemoFailureExpectation;
|
|
31
|
+
}
|
|
32
|
+
interface PlayerSystemDemoPortabilityContract {
|
|
33
|
+
readonly featureFlagId: string;
|
|
34
|
+
readonly sampleData: DemoSampleDataPolicy;
|
|
35
|
+
readonly compositionScale: DemoCompositionScaleContract;
|
|
36
|
+
}
|
|
37
|
+
type PlayerSystemDemoScenarioId = "awakening" | "combat-safe" | "institution-routing" | "points-ledgers" | "scaled-composition";
|
|
38
|
+
interface PlayerSystemDemoSamplePersona {
|
|
39
|
+
readonly personaId: string;
|
|
40
|
+
readonly characterHandle: string;
|
|
41
|
+
readonly classification: "synthetic";
|
|
42
|
+
}
|
|
43
|
+
interface PlayerSystemDemoScenarioComposition {
|
|
44
|
+
readonly runtimeModules: number;
|
|
45
|
+
readonly worldPanels: number;
|
|
46
|
+
readonly alertMarkers: number;
|
|
47
|
+
readonly focusPanes: number;
|
|
48
|
+
}
|
|
8
49
|
interface PlayerSystemDemoScenario {
|
|
9
50
|
readonly scenarioId: PlayerSystemDemoScenarioId;
|
|
10
51
|
readonly title: string;
|
|
11
52
|
readonly description?: string;
|
|
53
|
+
readonly samplePersona?: PlayerSystemDemoSamplePersona;
|
|
54
|
+
readonly composition?: PlayerSystemDemoScenarioComposition;
|
|
12
55
|
}
|
|
13
56
|
interface PlayerSystemDemoManifest {
|
|
14
57
|
readonly scenarios: readonly PlayerSystemDemoScenario[];
|
|
58
|
+
readonly validationContract?: PlayerSystemDemoValidationContract;
|
|
59
|
+
readonly portabilityContract?: PlayerSystemDemoPortabilityContract;
|
|
60
|
+
}
|
|
61
|
+
interface PlayerSystemDemoPortabilityContractInput {
|
|
62
|
+
readonly featureFlagId?: string;
|
|
63
|
+
readonly sampleData?: Partial<DemoSampleDataPolicy>;
|
|
64
|
+
readonly compositionScale?: Partial<DemoCompositionScaleContract>;
|
|
65
|
+
}
|
|
66
|
+
interface DemoPortabilityAssessment {
|
|
67
|
+
readonly accepted: boolean;
|
|
68
|
+
readonly violations: readonly string[];
|
|
15
69
|
}
|
|
16
70
|
declare const PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = "@plasius/player-system-demo-viewer";
|
|
17
71
|
declare const PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = "PLAYER_SYSTEM_DEMO_VIEWER";
|
|
18
72
|
declare const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "isekai.player-system.packages.enabled";
|
|
19
73
|
declare const PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID = "isekai.player-system.packages.enabled";
|
|
74
|
+
declare const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "isekai.player-system.runtime-nfr.enabled";
|
|
75
|
+
declare const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "isekai.player-system.runtime-portability.enabled";
|
|
20
76
|
declare const packageDescriptor: PackageDescriptor;
|
|
21
|
-
declare
|
|
77
|
+
declare const defaultPlayerSystemDemoValidationContract: PlayerSystemDemoValidationContract;
|
|
78
|
+
declare const defaultPlayerSystemDemoPortabilityContract: PlayerSystemDemoPortabilityContract;
|
|
79
|
+
declare const defaultPrivacySafeDemoScenarios: readonly PlayerSystemDemoScenario[];
|
|
80
|
+
declare function createPlayerSystemDemoManifest(scenarios: readonly PlayerSystemDemoScenario[], validationContract?: PlayerSystemDemoValidationContract, portabilityContract?: PlayerSystemDemoPortabilityContract): PlayerSystemDemoManifest;
|
|
81
|
+
declare function createPlayerSystemDemoValidationContract(input?: Partial<PlayerSystemDemoValidationContract>): PlayerSystemDemoValidationContract;
|
|
82
|
+
declare function createPlayerSystemDemoPortabilityContract(input?: PlayerSystemDemoPortabilityContractInput): PlayerSystemDemoPortabilityContract;
|
|
83
|
+
declare function assessPlayerSystemDemoScenarioPortability(scenario: PlayerSystemDemoScenario, contract?: PlayerSystemDemoPortabilityContract): DemoPortabilityAssessment;
|
|
22
84
|
|
|
23
|
-
export { PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX, PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID, PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemDemoManifest, type PlayerSystemDemoScenario, type PlayerSystemDemoScenarioId, createPlayerSystemDemoManifest, packageDescriptor };
|
|
85
|
+
export { type DemoCompositionScaleContract, type DemoFailureExpectation, type DemoPerformanceBudget, type DemoPortabilityAssessment, type DemoSampleDataPolicy, PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX, PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID, PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE, PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID, PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID, type PackageDescriptor, type PlayerSystemDemoManifest, type PlayerSystemDemoPortabilityContract, type PlayerSystemDemoPortabilityContractInput, type PlayerSystemDemoSamplePersona, type PlayerSystemDemoScenario, type PlayerSystemDemoScenarioComposition, type PlayerSystemDemoScenarioId, type PlayerSystemDemoValidationContract, assessPlayerSystemDemoScenarioPortability, createPlayerSystemDemoManifest, createPlayerSystemDemoPortabilityContract, createPlayerSystemDemoValidationContract, defaultPlayerSystemDemoPortabilityContract, defaultPlayerSystemDemoValidationContract, defaultPrivacySafeDemoScenarios, packageDescriptor };
|
package/dist/index.js
CHANGED
|
@@ -3,21 +3,196 @@ var PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = "@plasius/player-system-demo-viewer";
|
|
|
3
3
|
var PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = "PLAYER_SYSTEM_DEMO_VIEWER";
|
|
4
4
|
var PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID = "isekai.player-system.packages.enabled";
|
|
5
5
|
var PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID = PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID;
|
|
6
|
+
var PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID = "isekai.player-system.runtime-nfr.enabled";
|
|
7
|
+
var PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID = "isekai.player-system.runtime-portability.enabled";
|
|
6
8
|
var packageDescriptor = Object.freeze({
|
|
7
9
|
packageName: PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,
|
|
8
|
-
featureFlagId:
|
|
10
|
+
featureFlagId: PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID,
|
|
9
11
|
envPrefix: PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX,
|
|
10
12
|
summary: "Static validation launcher and scenario manifest surface for Player System demos."
|
|
11
13
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
var defaultPlayerSystemDemoValidationContract = Object.freeze({
|
|
15
|
+
featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
16
|
+
performanceBudget: Object.freeze({
|
|
17
|
+
launchMs: 1500,
|
|
18
|
+
transitionMs: 200,
|
|
19
|
+
steadyStateFrameMs: 16,
|
|
20
|
+
warmFrames: 5
|
|
21
|
+
}),
|
|
22
|
+
failureExpectation: Object.freeze({
|
|
23
|
+
degradedMode: "freeze-last-good-frame",
|
|
24
|
+
boundedErrorCodes: Object.freeze([
|
|
25
|
+
"PLAYER_SYSTEM_DEMO_TIMEOUT",
|
|
26
|
+
"PLAYER_SYSTEM_DEMO_DEGRADED"
|
|
27
|
+
])
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
var defaultPlayerSystemDemoPortabilityContract = Object.freeze({
|
|
31
|
+
featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
32
|
+
sampleData: Object.freeze({
|
|
33
|
+
sampleClassification: "synthetic-only",
|
|
34
|
+
forbiddenSensitiveFields: Object.freeze([
|
|
35
|
+
"email",
|
|
36
|
+
"accountId",
|
|
37
|
+
"oauthSubject",
|
|
38
|
+
"accessToken",
|
|
39
|
+
"refreshToken"
|
|
40
|
+
])
|
|
41
|
+
}),
|
|
42
|
+
compositionScale: Object.freeze({
|
|
43
|
+
maxRuntimeModules: 3,
|
|
44
|
+
maxWorldPanels: 6,
|
|
45
|
+
maxAlertMarkers: 8,
|
|
46
|
+
maxFocusPanes: 3
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
var defaultPrivacySafeDemoScenarios = Object.freeze([
|
|
50
|
+
Object.freeze({
|
|
51
|
+
scenarioId: "awakening",
|
|
52
|
+
title: "Awakening",
|
|
53
|
+
description: "Synthetic single-player baseline for onboarding validation.",
|
|
54
|
+
samplePersona: Object.freeze({
|
|
55
|
+
personaId: "persona-awakening-001",
|
|
56
|
+
characterHandle: "Dawnstrider",
|
|
57
|
+
classification: "synthetic"
|
|
58
|
+
}),
|
|
59
|
+
composition: Object.freeze({
|
|
60
|
+
runtimeModules: 2,
|
|
61
|
+
worldPanels: 3,
|
|
62
|
+
alertMarkers: 2,
|
|
63
|
+
focusPanes: 1
|
|
64
|
+
})
|
|
65
|
+
}),
|
|
66
|
+
Object.freeze({
|
|
67
|
+
scenarioId: "scaled-composition",
|
|
68
|
+
title: "Scaled Composition",
|
|
69
|
+
description: "Synthetic max-budget composition exercising runtime module and overlay limits.",
|
|
70
|
+
samplePersona: Object.freeze({
|
|
71
|
+
personaId: "persona-scale-001",
|
|
72
|
+
characterHandle: "LanternKeep",
|
|
73
|
+
classification: "synthetic"
|
|
74
|
+
}),
|
|
75
|
+
composition: Object.freeze({
|
|
76
|
+
runtimeModules: 3,
|
|
77
|
+
worldPanels: 6,
|
|
78
|
+
alertMarkers: 8,
|
|
79
|
+
focusPanes: 3
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
]);
|
|
83
|
+
function createPlayerSystemDemoManifest(scenarios, validationContract = defaultPlayerSystemDemoValidationContract, portabilityContract = defaultPlayerSystemDemoPortabilityContract) {
|
|
84
|
+
return Object.freeze({
|
|
85
|
+
scenarios: Object.freeze(
|
|
86
|
+
scenarios.map(
|
|
87
|
+
(scenario) => Object.freeze({
|
|
88
|
+
...scenario,
|
|
89
|
+
samplePersona: scenario.samplePersona ? Object.freeze({ ...scenario.samplePersona }) : void 0,
|
|
90
|
+
composition: scenario.composition ? Object.freeze({ ...scenario.composition }) : void 0
|
|
91
|
+
})
|
|
92
|
+
)
|
|
93
|
+
),
|
|
94
|
+
validationContract: Object.freeze({
|
|
95
|
+
featureFlagId: validationContract.featureFlagId,
|
|
96
|
+
performanceBudget: Object.freeze({
|
|
97
|
+
...validationContract.performanceBudget
|
|
98
|
+
}),
|
|
99
|
+
failureExpectation: Object.freeze({
|
|
100
|
+
...validationContract.failureExpectation,
|
|
101
|
+
boundedErrorCodes: Object.freeze([
|
|
102
|
+
...validationContract.failureExpectation.boundedErrorCodes
|
|
103
|
+
])
|
|
104
|
+
})
|
|
105
|
+
}),
|
|
106
|
+
portabilityContract: Object.freeze({
|
|
107
|
+
featureFlagId: portabilityContract.featureFlagId,
|
|
108
|
+
sampleData: Object.freeze({
|
|
109
|
+
...portabilityContract.sampleData,
|
|
110
|
+
forbiddenSensitiveFields: Object.freeze([
|
|
111
|
+
...portabilityContract.sampleData.forbiddenSensitiveFields
|
|
112
|
+
])
|
|
113
|
+
}),
|
|
114
|
+
compositionScale: Object.freeze({
|
|
115
|
+
...portabilityContract.compositionScale
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function createPlayerSystemDemoValidationContract(input = {}) {
|
|
121
|
+
return Object.freeze({
|
|
122
|
+
featureFlagId: input.featureFlagId ?? defaultPlayerSystemDemoValidationContract.featureFlagId,
|
|
123
|
+
performanceBudget: Object.freeze({
|
|
124
|
+
...defaultPlayerSystemDemoValidationContract.performanceBudget,
|
|
125
|
+
...input.performanceBudget
|
|
126
|
+
}),
|
|
127
|
+
failureExpectation: Object.freeze({
|
|
128
|
+
...defaultPlayerSystemDemoValidationContract.failureExpectation,
|
|
129
|
+
...input.failureExpectation,
|
|
130
|
+
boundedErrorCodes: input.failureExpectation?.boundedErrorCodes ?? defaultPlayerSystemDemoValidationContract.failureExpectation.boundedErrorCodes
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function createPlayerSystemDemoPortabilityContract(input = {}) {
|
|
135
|
+
return Object.freeze({
|
|
136
|
+
featureFlagId: input.featureFlagId ?? defaultPlayerSystemDemoPortabilityContract.featureFlagId,
|
|
137
|
+
sampleData: Object.freeze({
|
|
138
|
+
...defaultPlayerSystemDemoPortabilityContract.sampleData,
|
|
139
|
+
...input.sampleData,
|
|
140
|
+
forbiddenSensitiveFields: Object.freeze([
|
|
141
|
+
...input.sampleData?.forbiddenSensitiveFields ?? defaultPlayerSystemDemoPortabilityContract.sampleData.forbiddenSensitiveFields
|
|
142
|
+
])
|
|
143
|
+
}),
|
|
144
|
+
compositionScale: Object.freeze({
|
|
145
|
+
...defaultPlayerSystemDemoPortabilityContract.compositionScale,
|
|
146
|
+
...input.compositionScale
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function assessPlayerSystemDemoScenarioPortability(scenario, contract = defaultPlayerSystemDemoPortabilityContract) {
|
|
151
|
+
const violations = [];
|
|
152
|
+
if (scenario.samplePersona?.classification !== "synthetic") {
|
|
153
|
+
violations.push("samplePersona.classification");
|
|
154
|
+
}
|
|
155
|
+
if (scenario.samplePersona) {
|
|
156
|
+
for (const sensitiveField of contract.sampleData.forbiddenSensitiveFields) {
|
|
157
|
+
if (Object.prototype.hasOwnProperty.call(
|
|
158
|
+
scenario.samplePersona,
|
|
159
|
+
sensitiveField
|
|
160
|
+
)) {
|
|
161
|
+
violations.push(`samplePersona.${sensitiveField}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (scenario.composition && scenario.composition.runtimeModules > contract.compositionScale.maxRuntimeModules) {
|
|
166
|
+
violations.push("composition.runtimeModules");
|
|
167
|
+
}
|
|
168
|
+
if (scenario.composition && scenario.composition.worldPanels > contract.compositionScale.maxWorldPanels) {
|
|
169
|
+
violations.push("composition.worldPanels");
|
|
170
|
+
}
|
|
171
|
+
if (scenario.composition && scenario.composition.alertMarkers > contract.compositionScale.maxAlertMarkers) {
|
|
172
|
+
violations.push("composition.alertMarkers");
|
|
173
|
+
}
|
|
174
|
+
if (scenario.composition && scenario.composition.focusPanes > contract.compositionScale.maxFocusPanes) {
|
|
175
|
+
violations.push("composition.focusPanes");
|
|
176
|
+
}
|
|
177
|
+
return Object.freeze({
|
|
178
|
+
accepted: violations.length === 0,
|
|
179
|
+
violations: Object.freeze(violations)
|
|
180
|
+
});
|
|
14
181
|
}
|
|
15
182
|
export {
|
|
16
183
|
PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX,
|
|
17
184
|
PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID,
|
|
18
185
|
PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,
|
|
19
186
|
PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,
|
|
187
|
+
PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,
|
|
188
|
+
PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,
|
|
189
|
+
assessPlayerSystemDemoScenarioPortability,
|
|
20
190
|
createPlayerSystemDemoManifest,
|
|
191
|
+
createPlayerSystemDemoPortabilityContract,
|
|
192
|
+
createPlayerSystemDemoValidationContract,
|
|
193
|
+
defaultPlayerSystemDemoPortabilityContract,
|
|
194
|
+
defaultPlayerSystemDemoValidationContract,
|
|
195
|
+
defaultPrivacySafeDemoScenarios,
|
|
21
196
|
packageDescriptor
|
|
22
197
|
};
|
|
23
198
|
//# sourceMappingURL=index.js.map
|
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 PlayerSystemDemoScenarioId =\n | \"awakening\"\n | \"combat-safe\"\n | \"institution-routing\"\n | \"points-ledgers\";\n\nexport interface PlayerSystemDemoScenario {\n readonly scenarioId: PlayerSystemDemoScenarioId;\n readonly title: string;\n readonly description?: string;\n}\n\nexport interface PlayerSystemDemoManifest {\n readonly scenarios: readonly PlayerSystemDemoScenario[];\n}\n\nexport const PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = \"@plasius/player-system-demo-viewer\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = \"PLAYER_SYSTEM_DEMO_VIEWER\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n \"isekai.player-system.packages.enabled\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID;\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX,\n summary: \"Static validation launcher and scenario manifest surface for Player System demos.\",\n});\n\nexport function createPlayerSystemDemoManifest(\n scenarios: readonly PlayerSystemDemoScenario[]\n): PlayerSystemDemoManifest {\n return Object.freeze({ scenarios });\n}\n"],"mappings":";AAuBO,IAAM,oCAAoC;AAC1C,IAAM,uCAAuC;AAC7C,IAAM,yCACX;AACK,IAAM,4CACX;AAEK,IAAM,oBAAuC,OAAO,OAAO;AAAA,EAChE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SAAS;AACX,CAAC;AAEM,SAAS,+BACd,WAC0B;AAC1B,SAAO,OAAO,OAAO,EAAE,UAAU,CAAC;AACpC;","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 interface DemoPerformanceBudget {\n readonly launchMs: number;\n readonly transitionMs: number;\n readonly steadyStateFrameMs: number;\n readonly warmFrames: number;\n}\n\nexport interface DemoFailureExpectation {\n readonly degradedMode:\n | \"freeze-last-good-frame\"\n | \"fallback-overlay\"\n | \"skip-scenario\";\n readonly boundedErrorCodes: readonly string[];\n}\n\nexport interface DemoSampleDataPolicy {\n readonly sampleClassification: \"synthetic-only\";\n readonly forbiddenSensitiveFields: readonly string[];\n}\n\nexport interface DemoCompositionScaleContract {\n readonly maxRuntimeModules: number;\n readonly maxWorldPanels: number;\n readonly maxAlertMarkers: number;\n readonly maxFocusPanes: number;\n}\n\nexport interface PlayerSystemDemoValidationContract {\n readonly featureFlagId: string;\n readonly performanceBudget: DemoPerformanceBudget;\n readonly failureExpectation: DemoFailureExpectation;\n}\n\nexport interface PlayerSystemDemoPortabilityContract {\n readonly featureFlagId: string;\n readonly sampleData: DemoSampleDataPolicy;\n readonly compositionScale: DemoCompositionScaleContract;\n}\n\nexport type PlayerSystemDemoScenarioId =\n | \"awakening\"\n | \"combat-safe\"\n | \"institution-routing\"\n | \"points-ledgers\"\n | \"scaled-composition\";\n\nexport interface PlayerSystemDemoSamplePersona {\n readonly personaId: string;\n readonly characterHandle: string;\n readonly classification: \"synthetic\";\n}\n\nexport interface PlayerSystemDemoScenarioComposition {\n readonly runtimeModules: number;\n readonly worldPanels: number;\n readonly alertMarkers: number;\n readonly focusPanes: number;\n}\n\nexport interface PlayerSystemDemoScenario {\n readonly scenarioId: PlayerSystemDemoScenarioId;\n readonly title: string;\n readonly description?: string;\n readonly samplePersona?: PlayerSystemDemoSamplePersona;\n readonly composition?: PlayerSystemDemoScenarioComposition;\n}\n\nexport interface PlayerSystemDemoManifest {\n readonly scenarios: readonly PlayerSystemDemoScenario[];\n readonly validationContract?: PlayerSystemDemoValidationContract;\n readonly portabilityContract?: PlayerSystemDemoPortabilityContract;\n}\n\nexport interface PlayerSystemDemoPortabilityContractInput {\n readonly featureFlagId?: string;\n readonly sampleData?: Partial<DemoSampleDataPolicy>;\n readonly compositionScale?: Partial<DemoCompositionScaleContract>;\n}\n\nexport interface DemoPortabilityAssessment {\n readonly accepted: boolean;\n readonly violations: readonly string[];\n}\n\nexport const PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE = \"@plasius/player-system-demo-viewer\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX = \"PLAYER_SYSTEM_DEMO_VIEWER\";\nexport const PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID =\n \"isekai.player-system.packages.enabled\";\nexport const PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID =\n PLAYER_SYSTEM_PACKAGES_FEATURE_FLAG_ID;\nexport const PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID =\n \"isekai.player-system.runtime-nfr.enabled\";\nexport const PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID =\n \"isekai.player-system.runtime-portability.enabled\";\n\nexport const packageDescriptor: PackageDescriptor = Object.freeze({\n packageName: PLAYER_SYSTEM_DEMO_VIEWER_PACKAGE,\n featureFlagId: PLAYER_SYSTEM_DEMO_VIEWER_FEATURE_FLAG_ID,\n envPrefix: PLAYER_SYSTEM_DEMO_VIEWER_ENV_PREFIX,\n summary: \"Static validation launcher and scenario manifest surface for Player System demos.\",\n});\n\nexport const defaultPlayerSystemDemoValidationContract: PlayerSystemDemoValidationContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_NFR_FEATURE_FLAG_ID,\n performanceBudget: Object.freeze({\n launchMs: 1_500,\n transitionMs: 200,\n steadyStateFrameMs: 16,\n warmFrames: 5,\n }),\n failureExpectation: Object.freeze({\n degradedMode: \"freeze-last-good-frame\",\n boundedErrorCodes: Object.freeze([\n \"PLAYER_SYSTEM_DEMO_TIMEOUT\",\n \"PLAYER_SYSTEM_DEMO_DEGRADED\",\n ]),\n }),\n });\n\nexport const defaultPlayerSystemDemoPortabilityContract: PlayerSystemDemoPortabilityContract =\n Object.freeze({\n featureFlagId: PLAYER_SYSTEM_RUNTIME_PORTABILITY_FEATURE_FLAG_ID,\n sampleData: Object.freeze({\n sampleClassification: \"synthetic-only\",\n forbiddenSensitiveFields: Object.freeze([\n \"email\",\n \"accountId\",\n \"oauthSubject\",\n \"accessToken\",\n \"refreshToken\",\n ]),\n }),\n compositionScale: Object.freeze({\n maxRuntimeModules: 3,\n maxWorldPanels: 6,\n maxAlertMarkers: 8,\n maxFocusPanes: 3,\n }),\n });\n\nexport const defaultPrivacySafeDemoScenarios: readonly PlayerSystemDemoScenario[] =\n Object.freeze([\n Object.freeze({\n scenarioId: \"awakening\",\n title: \"Awakening\",\n description: \"Synthetic single-player baseline for onboarding validation.\",\n samplePersona: Object.freeze({\n personaId: \"persona-awakening-001\",\n characterHandle: \"Dawnstrider\",\n classification: \"synthetic\",\n }),\n composition: Object.freeze({\n runtimeModules: 2,\n worldPanels: 3,\n alertMarkers: 2,\n focusPanes: 1,\n }),\n }),\n Object.freeze({\n scenarioId: \"scaled-composition\",\n title: \"Scaled Composition\",\n description:\n \"Synthetic max-budget composition exercising runtime module and overlay limits.\",\n samplePersona: Object.freeze({\n personaId: \"persona-scale-001\",\n characterHandle: \"LanternKeep\",\n classification: \"synthetic\",\n }),\n composition: Object.freeze({\n runtimeModules: 3,\n worldPanels: 6,\n alertMarkers: 8,\n focusPanes: 3,\n }),\n }),\n ]);\n\nexport function createPlayerSystemDemoManifest(\n scenarios: readonly PlayerSystemDemoScenario[],\n validationContract: PlayerSystemDemoValidationContract = defaultPlayerSystemDemoValidationContract,\n portabilityContract: PlayerSystemDemoPortabilityContract = defaultPlayerSystemDemoPortabilityContract\n): PlayerSystemDemoManifest {\n return Object.freeze({\n scenarios: Object.freeze(\n scenarios.map((scenario) =>\n Object.freeze({\n ...scenario,\n samplePersona: scenario.samplePersona\n ? Object.freeze({ ...scenario.samplePersona })\n : undefined,\n composition: scenario.composition\n ? Object.freeze({ ...scenario.composition })\n : undefined,\n })\n )\n ),\n validationContract: Object.freeze({\n featureFlagId: validationContract.featureFlagId,\n performanceBudget: Object.freeze({\n ...validationContract.performanceBudget,\n }),\n failureExpectation: Object.freeze({\n ...validationContract.failureExpectation,\n boundedErrorCodes: Object.freeze([\n ...validationContract.failureExpectation.boundedErrorCodes,\n ]),\n }),\n }),\n portabilityContract: Object.freeze({\n featureFlagId: portabilityContract.featureFlagId,\n sampleData: Object.freeze({\n ...portabilityContract.sampleData,\n forbiddenSensitiveFields: Object.freeze([\n ...portabilityContract.sampleData.forbiddenSensitiveFields,\n ]),\n }),\n compositionScale: Object.freeze({\n ...portabilityContract.compositionScale,\n }),\n }),\n });\n}\n\nexport function createPlayerSystemDemoValidationContract(\n input: Partial<PlayerSystemDemoValidationContract> = {}\n): PlayerSystemDemoValidationContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ?? defaultPlayerSystemDemoValidationContract.featureFlagId,\n performanceBudget: Object.freeze({\n ...defaultPlayerSystemDemoValidationContract.performanceBudget,\n ...input.performanceBudget,\n }),\n failureExpectation: Object.freeze({\n ...defaultPlayerSystemDemoValidationContract.failureExpectation,\n ...input.failureExpectation,\n boundedErrorCodes:\n input.failureExpectation?.boundedErrorCodes ??\n defaultPlayerSystemDemoValidationContract.failureExpectation.boundedErrorCodes,\n }),\n });\n}\n\nexport function createPlayerSystemDemoPortabilityContract(\n input: PlayerSystemDemoPortabilityContractInput = {}\n): PlayerSystemDemoPortabilityContract {\n return Object.freeze({\n featureFlagId:\n input.featureFlagId ??\n defaultPlayerSystemDemoPortabilityContract.featureFlagId,\n sampleData: Object.freeze({\n ...defaultPlayerSystemDemoPortabilityContract.sampleData,\n ...input.sampleData,\n forbiddenSensitiveFields: Object.freeze([\n ...(input.sampleData?.forbiddenSensitiveFields ??\n defaultPlayerSystemDemoPortabilityContract.sampleData\n .forbiddenSensitiveFields),\n ]),\n }),\n compositionScale: Object.freeze({\n ...defaultPlayerSystemDemoPortabilityContract.compositionScale,\n ...input.compositionScale,\n }),\n });\n}\n\nexport function assessPlayerSystemDemoScenarioPortability(\n scenario: PlayerSystemDemoScenario,\n contract: PlayerSystemDemoPortabilityContract = defaultPlayerSystemDemoPortabilityContract\n): DemoPortabilityAssessment {\n const violations: string[] = [];\n\n if (scenario.samplePersona?.classification !== \"synthetic\") {\n violations.push(\"samplePersona.classification\");\n }\n\n if (scenario.samplePersona) {\n for (const sensitiveField of contract.sampleData.forbiddenSensitiveFields) {\n if (\n Object.prototype.hasOwnProperty.call(\n scenario.samplePersona,\n sensitiveField\n )\n ) {\n violations.push(`samplePersona.${sensitiveField}`);\n }\n }\n }\n\n if (\n scenario.composition &&\n scenario.composition.runtimeModules >\n contract.compositionScale.maxRuntimeModules\n ) {\n violations.push(\"composition.runtimeModules\");\n }\n\n if (\n scenario.composition &&\n scenario.composition.worldPanels > contract.compositionScale.maxWorldPanels\n ) {\n violations.push(\"composition.worldPanels\");\n }\n\n if (\n scenario.composition &&\n scenario.composition.alertMarkers >\n contract.compositionScale.maxAlertMarkers\n ) {\n violations.push(\"composition.alertMarkers\");\n }\n\n if (\n scenario.composition &&\n scenario.composition.focusPanes > contract.compositionScale.maxFocusPanes\n ) {\n violations.push(\"composition.focusPanes\");\n }\n\n return Object.freeze({\n accepted: violations.length === 0,\n violations: Object.freeze(violations),\n });\n}\n"],"mappings":";AA2FO,IAAM,oCAAoC;AAC1C,IAAM,uCAAuC;AAC7C,IAAM,yCACX;AACK,IAAM,4CACX;AACK,IAAM,4CACX;AACK,IAAM,oDACX;AAEK,IAAM,oBAAuC,OAAO,OAAO;AAAA,EAChE,aAAa;AAAA,EACb,eAAe;AAAA,EACf,WAAW;AAAA,EACX,SAAS;AACX,CAAC;AAEM,IAAM,4CACX,OAAO,OAAO;AAAA,EACZ,eAAe;AAAA,EACf,mBAAmB,OAAO,OAAO;AAAA,IAC/B,UAAU;AAAA,IACV,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,YAAY;AAAA,EACd,CAAC;AAAA,EACD,oBAAoB,OAAO,OAAO;AAAA,IAChC,cAAc;AAAA,IACd,mBAAmB,OAAO,OAAO;AAAA,MAC/B;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH,CAAC;AAEI,IAAM,6CACX,OAAO,OAAO;AAAA,EACZ,eAAe;AAAA,EACf,YAAY,OAAO,OAAO;AAAA,IACxB,sBAAsB;AAAA,IACtB,0BAA0B,OAAO,OAAO;AAAA,MACtC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAAA,EACD,kBAAkB,OAAO,OAAO;AAAA,IAC9B,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,eAAe;AAAA,EACjB,CAAC;AACH,CAAC;AAEI,IAAM,kCACX,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AAC;AACH;AAEO,SAAS,0CACd,UACA,WAAgD,4CACrB;AAC3B,QAAM,aAAuB,CAAC;AAE9B,MAAI,SAAS,eAAe,mBAAmB,aAAa;AAC1D,eAAW,KAAK,8BAA8B;AAAA,EAChD;AAEA,MAAI,SAAS,eAAe;AAC1B,eAAW,kBAAkB,SAAS,WAAW,0BAA0B;AACzE,UACE,OAAO,UAAU,eAAe;AAAA,QAC9B,SAAS;AAAA,QACT;AAAA,MACF,GACA;AACA,mBAAW,KAAK,iBAAiB,cAAc,EAAE;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AAEA,MACE,SAAS,eACT,SAAS,YAAY,iBACnB,SAAS,iBAAiB,mBAC5B;AACA,eAAW,KAAK,4BAA4B;AAAA,EAC9C;AAEA,MACE,SAAS,eACT,SAAS,YAAY,cAAc,SAAS,iBAAiB,gBAC7D;AACA,eAAW,KAAK,yBAAyB;AAAA,EAC3C;AAEA,MACE,SAAS,eACT,SAAS,YAAY,eACnB,SAAS,iBAAiB,iBAC5B;AACA,eAAW,KAAK,0BAA0B;AAAA,EAC5C;AAEA,MACE,SAAS,eACT,SAAS,YAAY,aAAa,SAAS,iBAAiB,eAC5D;AACA,eAAW,KAAK,wBAAwB;AAAA,EAC1C;AAEA,SAAO,OAAO,OAAO;AAAA,IACnB,UAAU,WAAW,WAAW;AAAA,IAChC,YAAY,OAAO,OAAO,UAAU;AAAA,EACtC,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasius/player-system-demo-viewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Static validation launcher and scenario manifest surface for Player System demos",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"homepage": "https://github.com/Plasius-LTD/player-system-demo-viewer#readme",
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@eslint/js": "^10.0.1",
|
|
57
|
-
"@types/node": "^25.
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
59
|
-
"@typescript-eslint/parser": "^8.59.
|
|
60
|
-
"@vitest/coverage-v8": "^4.1.
|
|
61
|
-
"eslint": "^10.
|
|
57
|
+
"@types/node": "^25.9.1",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
|
59
|
+
"@typescript-eslint/parser": "^8.59.4",
|
|
60
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
61
|
+
"eslint": "^10.4.0",
|
|
62
62
|
"globals": "^17.6.0",
|
|
63
63
|
"rimraf": "^6.0.1",
|
|
64
64
|
"tsup": "^8.5.1",
|
|
65
|
-
"tsx": "^4.
|
|
65
|
+
"tsx": "^4.22.3",
|
|
66
66
|
"typescript": "^6.0.3",
|
|
67
|
-
"vitest": "^4.1.
|
|
67
|
+
"vitest": "^4.1.7"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|