@patch-adams/core 1.4.18 → 1.4.19

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/dist/cli.js CHANGED
@@ -739,6 +739,12 @@ function generateLrsBridgeCode(options) {
739
739
  'use strict';
740
740
 
741
741
  var DEBUG = ${options.debug};
742
+ // Allow URL-based debug toggle: ?pa_debug=1 or #pa_debug
743
+ try {
744
+ if (window.location.search.indexOf('pa_debug') > -1 || window.location.hash.indexOf('pa_debug') > -1) {
745
+ DEBUG = true;
746
+ }
747
+ } catch (e) {}
742
748
  var TRACK_MEDIA = ${options.trackMedia};
743
749
  var TRACK_NAVIGATION = ${options.trackNavigation};
744
750
  var TRACK_QUIZZES = ${options.trackQuizzes};
@@ -3110,6 +3116,17 @@ function generateLrsBridgeCode(options) {
3110
3116
  function sendStatement(statement) {
3111
3117
  log('Sending statement:', statement.verb.display['en-US'] || statement.verb.id, statement);
3112
3118
 
3119
+ // Log first statement visibly (not gated by DEBUG) for production diagnostics
3120
+ if (LRS.stats.statementsSent === 0 && LRS.stats.statementsFailed === 0 && LRS.stats.statementsQueued === 0) {
3121
+ if (window.console && window.console.info) {
3122
+ var verb = statement.verb.display ? (statement.verb.display['en-US'] || statement.verb.id) : statement.verb.id;
3123
+ console.info('[PA-LRS] First statement: verb=' + verb +
3124
+ ', endpoint=' + (LRS_ENDPOINT || 'NONE') +
3125
+ ', proxy=' + (LRS_PROXY_ENDPOINT ? 'yes' : 'no') +
3126
+ ', mode=' + LRS.mode);
3127
+ }
3128
+ }
3129
+
3113
3130
  // Store in event log
3114
3131
  LRS.eventLog.push({
3115
3132
  statement: statement,
@@ -4289,6 +4306,15 @@ function generateLrsBridgeCode(options) {
4289
4306
  LRS.mode = 'offline';
4290
4307
  }
4291
4308
 
4309
+ // Always-visible bridge summary (not gated by DEBUG)
4310
+ // This ensures diagnostics are available even in production builds
4311
+ if (window.console && window.console.info) {
4312
+ console.info('[PA-LRS] Bridge: mode=' + LRS.mode +
4313
+ ', endpoint=' + (LRS_ENDPOINT ? LRS_ENDPOINT.substring(0, 30) + '...' : 'NONE') +
4314
+ ', proxy=' + (LRS_PROXY_ENDPOINT ? 'yes' : 'no') +
4315
+ ', actor=' + (LRS.actor ? (LRS.actor.name || 'anonymous') : 'none'));
4316
+ }
4317
+
4292
4318
  // Set up event interceptors
4293
4319
  setupMediaInterceptors();
4294
4320
  setupNavigationInterceptors();