@nextera.one/axis-server-sdk 2.3.13 → 2.3.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/dist/index.js CHANGED
@@ -2708,9 +2708,14 @@ var init_intent_router = __esm({
2708
2708
  * Routes a decoded AXIS frame to the appropriate handler.
2709
2709
  *
2710
2710
  * **Precedence:**
2711
- * 1. System Built-ins (`system.ping`, `public.ping`, `system.time`, `system.echo`)
2712
- * 2. Meta-intent execution (`INTENT.EXEC` / `axis.intent.exec`)
2713
- * 3. Dynamically registered handlers from modules.
2711
+ * 1. SDK meta-intents (`CHAIN.EXEC`, `INTENT.EXEC`)
2712
+ * 2. Dynamically registered handlers from modules
2713
+ * 3. Simple SDK built-in fallback (`system.ping`, `public.ping`, `system.time`, `system.echo`)
2714
+ *
2715
+ * Registered app handlers intentionally win over simple built-ins. This lets
2716
+ * applications attach sensors, rate limits, and custom responses to intents
2717
+ * like `system.ping` while keeping a default fallback for apps that do not
2718
+ * register their own handler.
2714
2719
  *
2715
2720
  * @param {AxisFrame} frame - The validated and decoded binary frame
2716
2721
  * @returns {Promise<AxisEffect>} The resulting effect of the execution
@@ -2764,6 +2769,16 @@ var init_intent_router = __esm({
2764
2769
  * This keeps route() focused on observer/error lifecycle concerns.
2765
2770
  */
2766
2771
  async routeResolvedIntent(intent, frame) {
2772
+ if (isChainExecIntent(intent)) {
2773
+ const chainRequest = this.parseChainRequestBody(frame.body);
2774
+ return this.executeChainRequest(frame, chainRequest);
2775
+ }
2776
+ if (isIntentExecIntent(intent)) {
2777
+ return this.routeIntentExec(frame);
2778
+ }
2779
+ if (this.handlers.has(intent)) {
2780
+ return this.routeRegisteredIntent(intent, frame);
2781
+ }
2767
2782
  const builtinEffect = routeSystemBuiltinIntent(
2768
2783
  intent,
2769
2784
  frame.body,
@@ -2775,13 +2790,6 @@ var init_intent_router = __esm({
2775
2790
  }
2776
2791
  return builtinEffect;
2777
2792
  }
2778
- if (isChainExecIntent(intent)) {
2779
- const chainRequest = this.parseChainRequestBody(frame.body);
2780
- return this.executeChainRequest(frame, chainRequest);
2781
- }
2782
- if (isIntentExecIntent(intent)) {
2783
- return this.routeIntentExec(frame);
2784
- }
2785
2793
  return this.routeRegisteredIntent(intent, frame);
2786
2794
  }
2787
2795
  /**