@nextera.one/axis-server-sdk 2.3.13 → 2.3.15

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.
@@ -2803,6 +2803,15 @@ var init_intent_router = __esm({
2803
2803
  const resolved = this.resolveIntentAlias(intent);
2804
2804
  return this.handlers.has(resolved) || isBuiltinIntent(resolved);
2805
2805
  }
2806
+ /**
2807
+ * True only when the application registered a concrete handler.
2808
+ * Unlike `has()`, this intentionally ignores SDK built-in fallbacks so
2809
+ * discovery layers can override simple built-ins such as `system.ping`.
2810
+ */
2811
+ hasRegisteredHandler(intent) {
2812
+ const resolved = this.resolveIntentAlias(intent);
2813
+ return this.handlers.has(resolved);
2814
+ }
2806
2815
  getRegisteredIntents() {
2807
2816
  return [...BUILTIN_INTENTS, ...this.handlers.keys()];
2808
2817
  }
@@ -2922,9 +2931,14 @@ var init_intent_router = __esm({
2922
2931
  * Routes a decoded AXIS frame to the appropriate handler.
2923
2932
  *
2924
2933
  * **Precedence:**
2925
- * 1. System Built-ins (`system.ping`, `public.ping`, `system.time`, `system.echo`)
2926
- * 2. Meta-intent execution (`INTENT.EXEC` / `axis.intent.exec`)
2927
- * 3. Dynamically registered handlers from modules.
2934
+ * 1. SDK meta-intents (`CHAIN.EXEC`, `INTENT.EXEC`)
2935
+ * 2. Dynamically registered handlers from modules
2936
+ * 3. Simple SDK built-in fallback (`system.ping`, `public.ping`, `system.time`, `system.echo`)
2937
+ *
2938
+ * Registered app handlers intentionally win over simple built-ins. This lets
2939
+ * applications attach sensors, rate limits, and custom responses to intents
2940
+ * like `system.ping` while keeping a default fallback for apps that do not
2941
+ * register their own handler.
2928
2942
  *
2929
2943
  * @param {AxisFrame} frame - The validated and decoded binary frame
2930
2944
  * @returns {Promise<AxisEffect>} The resulting effect of the execution
@@ -2978,6 +2992,16 @@ var init_intent_router = __esm({
2978
2992
  * This keeps route() focused on observer/error lifecycle concerns.
2979
2993
  */
2980
2994
  async routeResolvedIntent(intent, frame) {
2995
+ if (isChainExecIntent(intent)) {
2996
+ const chainRequest = this.parseChainRequestBody(frame.body);
2997
+ return this.executeChainRequest(frame, chainRequest);
2998
+ }
2999
+ if (isIntentExecIntent(intent)) {
3000
+ return this.routeIntentExec(frame);
3001
+ }
3002
+ if (this.handlers.has(intent)) {
3003
+ return this.routeRegisteredIntent(intent, frame);
3004
+ }
2981
3005
  const builtinEffect = routeSystemBuiltinIntent(
2982
3006
  intent,
2983
3007
  frame.body,
@@ -2989,13 +3013,6 @@ var init_intent_router = __esm({
2989
3013
  }
2990
3014
  return builtinEffect;
2991
3015
  }
2992
- if (isChainExecIntent(intent)) {
2993
- const chainRequest = this.parseChainRequestBody(frame.body);
2994
- return this.executeChainRequest(frame, chainRequest);
2995
- }
2996
- if (isIntentExecIntent(intent)) {
2997
- return this.routeIntentExec(frame);
2998
- }
2999
3016
  return this.routeRegisteredIntent(intent, frame);
3000
3017
  }
3001
3018
  /**