@pie-players/pie-assessment-player 0.3.17 → 0.3.20

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 CHANGED
@@ -8,7 +8,59 @@ Primary entrypoint:
8
8
 
9
9
  - `@pie-players/pie-assessment-player`
10
10
 
11
+ ## Debug logging
12
+
13
+ Assessment-player now exposes a `debug` option on `pie-assessment-player-default`.
14
+
15
+ - Enable verbose debug logs: `<pie-assessment-player-default debug="true">`
16
+ - Disable verbose debug logs: `<pie-assessment-player-default debug="false">` (or `debug="0"`)
17
+
18
+ The setting is forwarded to the rendered section-player instance and also applies
19
+ the global flag (`window.PIE_DEBUG`) for shared runtime logging behavior.
20
+
11
21
  Component registration entrypoints:
12
22
 
13
23
  - `@pie-players/pie-assessment-player/components/assessment-player-default-element`
14
24
  - `@pie-players/pie-assessment-player/components/assessment-player-shell-element`
25
+
26
+ ## Instrumentation and observability
27
+
28
+ Assessment-player instrumentation is provider-agnostic and built on the shared
29
+ `InstrumentationProvider` contract used across players.
30
+
31
+ Canonical provider injection paths:
32
+
33
+ - `sectionPlayerRuntime.player.loaderConfig.instrumentationProvider`
34
+ - `sectionPlayerPlayer.loaderConfig.instrumentationProvider` (fallback)
35
+
36
+ Provider semantics:
37
+
38
+ - With `trackPageActions: true`, missing/`undefined` provider values use the default New Relic provider path.
39
+ - `instrumentationProvider: null` explicitly disables instrumentation.
40
+ - Invalid provider objects are ignored (optional debug warning), also no-op.
41
+ - Existing `item-player` behavior remains the compatibility anchor.
42
+ - To keep production telemetry while debugging, use `CompositeInstrumentationProvider`
43
+ with `NewRelicInstrumentationProvider` and `DebugPanelInstrumentationProvider`.
44
+ - Toolkit telemetry forwarding uses the same provider path, so tool/backend
45
+ operational events appear in production providers and debug overlays.
46
+
47
+ Assessment-player owned canonical stream:
48
+
49
+ - `pie-assessment-controller-ready`
50
+ - `pie-assessment-navigation-requested`
51
+ - `pie-assessment-route-changed`
52
+ - `pie-assessment-session-applied`
53
+ - `pie-assessment-session-changed`
54
+ - `pie-assessment-progress-changed`
55
+ - `pie-assessment-submission-state-changed`
56
+ - `pie-assessment-error`
57
+
58
+ Ownership boundary: assessment-player owns assessment semantics only. Section
59
+ and toolkit semantics remain in their own streams to avoid overlap. Bridge
60
+ dedupe is a safety net, not the primary correctness mechanism.
61
+
62
+ Toolkit tool/backend operational stream (when toolkit is mounted):
63
+
64
+ - `pie-tool-init-start|success|error`
65
+ - `pie-tool-backend-call-start|success|error`
66
+ - `pie-tool-library-load-start|success|error`
@@ -1,7 +1,7 @@
1
1
  import { Env } from '@pie-players/pie-players-shared/types';
2
2
  import { AssessmentControllerHandle } from '../controller/AssessmentController.js';
3
3
  import { AssessmentPlayerProgressSnapshot, AssessmentPlayerRuntimeHostContract, AssessmentPlayerSnapshot } from '../contracts/runtime-host-contract.js';
4
- import { AssessmentDefinition, AssessmentPlayerHooks } from '../types.js';
4
+ import { AssessmentDefinition, AssessmentPlayerHooks, AssessmentPlayerRuntimeConfig } from '../types.js';
5
5
  export declare class AssessmentPlayerDefaultElement extends HTMLElement implements AssessmentPlayerRuntimeHostContract {
6
6
  static get observedAttributes(): string[];
7
7
  assessmentId: string;
@@ -13,24 +13,37 @@ export declare class AssessmentPlayerDefaultElement extends HTMLElement implemen
13
13
  showNavigation: boolean | string | null | undefined;
14
14
  sectionPlayerLayout: "splitpane" | "vertical";
15
15
  playerType: "iife" | "esm" | "preloaded";
16
+ private _debug;
16
17
  private controller;
17
18
  private controllerReadyPromise;
18
19
  private controllerReadyResolve;
19
20
  private sectionHost;
20
21
  private sectionControllerRef;
21
22
  private unsubscribeController?;
23
+ private detachInstrumentationBridge?;
24
+ private _sectionPlayerRuntime;
25
+ private _sectionPlayerPlayer;
22
26
  private readiness;
23
27
  constructor();
24
28
  attributeChangedCallback(name: string, _oldValue: string | null, value: string | null): void;
29
+ get debug(): boolean | string | null | undefined;
30
+ set debug(value: boolean | string | null | undefined);
31
+ get sectionPlayerRuntime(): AssessmentPlayerRuntimeConfig["sectionPlayerRuntime"];
32
+ set sectionPlayerRuntime(value: AssessmentPlayerRuntimeConfig["sectionPlayerRuntime"]);
33
+ get sectionPlayerPlayer(): AssessmentPlayerRuntimeConfig["sectionPlayerPlayer"];
34
+ set sectionPlayerPlayer(value: AssessmentPlayerRuntimeConfig["sectionPlayerPlayer"]);
25
35
  connectedCallback(): void;
26
36
  disconnectedCallback(): void;
27
37
  private dispatch;
28
38
  private bootstrapController;
39
+ private resolveInstrumentationProvider;
40
+ private attachInstrumentationBridge;
29
41
  private renderEmptyState;
30
42
  private buildSectionPlayerTag;
31
43
  private syncCurrentSectionSessionIntoAssessment;
32
44
  private attachSectionControllerReadyListener;
33
45
  private render;
46
+ private applyDebugFlag;
34
47
  getSnapshot(): AssessmentPlayerSnapshot;
35
48
  selectNavigation(): import('../contracts/runtime-host-contract.js').AssessmentPlayerNavigationSnapshot;
36
49
  selectReadiness(): {
@@ -1 +1 @@
1
- {"version":3,"file":"AssessmentPlayerDefaultElement.d.ts","sourceRoot":"","sources":["../../src/components/AssessmentPlayerDefaultElement.ts"],"names":[],"mappings":"AAAA,OAAO,6EAA6E,CAAC;AACrF,OAAO,4EAA4E,CAAC;AACpF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAEjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAQxF,OAAO,KAAK,EACX,gCAAgC,EAChC,mCAAmC,EACnC,wBAAwB,EACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAoB/E,qBAAa,8BACZ,SAAQ,WACR,YAAW,mCAAmC;IAE9C,MAAM,KAAK,kBAAkB,aAQ5B;IAED,YAAY,SAAM;IAClB,SAAS,SAAM;IACf,UAAU,EAAE,oBAAoB,GAAG,IAAI,CAAQ;IAC/C,GAAG,EAAE,GAAG,GAAG,IAAI,CAA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