@syntrologie/runtime-sdk 2.2.0-canary.13 → 2.2.0-canary.14

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
@@ -1,6 +1,6 @@
1
1
  # Smart Canvas Runtime SDK
2
2
 
3
- ## Smart Canvas Runtime SDK (React + Shadow DOM)
3
+ ## Runtime SDK (React + Shadow DOM)
4
4
 
5
5
  The SDK ships a framework-agnostic `<smart-canvas>` custom element with an **open shadow root**. We render everything with React, but the canvas is encapsulated so host Tailwind configs, resets, or stacking contexts can't break the UI.
6
6
 
@@ -1858,8 +1858,8 @@ var AppRegistry = class {
1858
1858
  if (!registration) {
1859
1859
  throw new Error(`App not registered: ${appId}`);
1860
1860
  }
1861
- if (registration.state === "active") {
1862
- console.warn(`[AppRegistry] App already active: ${appId}`);
1861
+ if (registration.state === "active" || registration.state === "activating") {
1862
+ console.warn(`[AppRegistry] App already ${registration.state}: ${appId}`);
1863
1863
  return;
1864
1864
  }
1865
1865
  if (!this.runtime) {
@@ -2091,7 +2091,7 @@ function getAntiFlickerSnippet(config = {}) {
2091
2091
  }
2092
2092
 
2093
2093
  // src/version.ts
2094
- var SDK_VERSION = "2.2.0-canary.13";
2094
+ var SDK_VERSION = "2.2.0-canary.14";
2095
2095
 
2096
2096
  // src/types.ts
2097
2097
  var SDK_SCHEMA_VERSION = "2.0";
@@ -4203,12 +4203,22 @@ function decodeParam(paramName) {
4203
4203
  var _cachedSource;
4204
4204
  var _cachedConf;
4205
4205
  function getEditorSource() {
4206
+ var _a2;
4206
4207
  if (_cachedSource === void 0) {
4207
4208
  const globalParams = typeof window !== "undefined" ? window.__SYNTRO_EDITOR_PARAMS__ : null;
4208
4209
  if (globalParams == null ? void 0 : globalParams.token) {
4209
4210
  _cachedSource = { token: globalParams.token, api_base: globalParams.apiBase || "" };
4211
+ console.log(
4212
+ `[DIAG] getEditorSource: from __SYNTRO_EDITOR_PARAMS__ (token=${_cachedSource.token.slice(0, 15)}...)`
4213
+ );
4210
4214
  } else {
4211
4215
  _cachedSource = decodeParam("editor_source");
4216
+ console.log(
4217
+ `[DIAG] getEditorSource: from URL param \u2192 ${_cachedSource ? `token=${(_a2 = _cachedSource.token) == null ? void 0 : _a2.slice(0, 15)}...` : "NULL"}`
4218
+ );
4219
+ if (!_cachedSource && typeof window !== "undefined") {
4220
+ console.log(`[DIAG] getEditorSource: URL search = ${window.location.search.slice(0, 200)}`);
4221
+ }
4212
4222
  }
4213
4223
  }
4214
4224
  return _cachedSource;
@@ -4223,8 +4233,12 @@ function getEditorConf() {
4223
4233
  syntro_token: globalParams.syntroToken,
4224
4234
  workspace_id: globalParams.workspaceId
4225
4235
  };
4236
+ console.log(`[DIAG] getEditorConf: from __SYNTRO_EDITOR_PARAMS__ (mode=${_cachedConf.mode})`);
4226
4237
  } else {
4227
4238
  _cachedConf = decodeParam("editor_conf");
4239
+ console.log(
4240
+ `[DIAG] getEditorConf: from URL param \u2192 ${_cachedConf ? `mode=${_cachedConf.mode}` : "NULL"}`
4241
+ );
4228
4242
  }
4229
4243
  }
4230
4244
  return _cachedConf;
@@ -8906,7 +8920,15 @@ async function init(options) {
8906
8920
  const auditMode = isAuditMode();
8907
8921
  const reviewMode = isReviewMode();
8908
8922
  const sdkMode = editorMode ? "editor" : auditMode ? "audit" : reviewMode ? "review" : null;
8923
+ console.log(
8924
+ `[DIAG] Mode detection: editor=${editorMode}, audit=${auditMode}, review=${reviewMode}, sdkMode=${sdkMode}`
8925
+ );
8926
+ console.log(`[DIAG] editorSource:`, getEditorSource());
8927
+ console.log(`[DIAG] editorConf:`, getEditorConf());
8909
8928
  debug("Syntro Bootstrap", "SDK mode:", sdkMode != null ? sdkMode : "normal");
8929
+ console.log(
8930
+ `[DIAG] Token resolution: options.token=${options.token ? options.token.slice(0, 15) + "..." : "null"}`
8931
+ );
8910
8932
  let resolvedToken = options.token;
8911
8933
  if (!resolvedToken && sdkMode) {
8912
8934
  const conf = getEditorConf();
@@ -9045,15 +9067,24 @@ async function init(options) {
9045
9067
  debug("Syntro Bootstrap", "Global SynOS object exposed");
9046
9068
  }
9047
9069
  const registeredApps = (_e = (_d = (_c = runtime3.apps).list) == null ? void 0 : _d.call(_c)) != null ? _e : [];
9070
+ console.log(
9071
+ `[DIAG] Activation loop: ${registeredApps.length} apps in registry:`,
9072
+ registeredApps.map((a) => `${a.manifest.id}(${a.state})`).join(", ")
9073
+ );
9048
9074
  for (const app of registeredApps) {
9049
9075
  if (app.state === "registered") {
9050
9076
  try {
9051
9077
  await runtime3.apps.activate(app.manifest.id);
9078
+ console.log(
9079
+ `[DIAG] Activated: ${app.manifest.id} \u2192 widgets: [${runtime3.widgets.list().join(", ")}]`
9080
+ );
9052
9081
  } catch (err) {
9082
+ console.error(`[DIAG] FAILED to activate: ${app.manifest.id}`, err);
9053
9083
  warn("Syntro Bootstrap", `Failed to auto-activate built-in app: ${app.manifest.id}`, err);
9054
9084
  }
9055
9085
  }
9056
9086
  }
9087
+ console.log(`[DIAG] Activation complete. Total widgets: [${runtime3.widgets.list().join(", ")}]`);
9057
9088
  if (experiments == null ? void 0 : experiments.refreshFeatures) {
9058
9089
  try {
9059
9090
  await experiments.refreshFeatures();
@@ -9263,4 +9294,4 @@ export {
9263
9294
  encodeToken,
9264
9295
  Syntro
9265
9296
  };
9266
- //# sourceMappingURL=chunk-BBOM2MPC.js.map
9297
+ //# sourceMappingURL=chunk-GUDQECKY.js.map