@camstack/addon-ai 0.4.53 → 0.4.55

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/addon.js CHANGED
@@ -13460,6 +13460,35 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
13460
13460
  auth: "admin"
13461
13461
  });
13462
13462
  /**
13463
+ * Transport bounds for AI capability methods.
13464
+ *
13465
+ * Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
13466
+ * each other: declaring the constant in either one hands the other `undefined`
13467
+ * at module-init time, and an undefined `timeoutMs` silently falls back to the
13468
+ * kernel's 60 s default — the exact failure this constant exists to prevent,
13469
+ * reintroduced invisibly. Found by the guard, not by review.
13470
+ */
13471
+ /**
13472
+ * Ceiling for a cap method that runs inference or loads a model.
13473
+ *
13474
+ * Deliberately far above anything the AI layer itself may wait for (a summary
13475
+ * asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
13476
+ * never be the layer that gives up first: when it does, the failure is
13477
+ * reported as a transport error for a model that was still thinking, naming
13478
+ * the wrong layer and hiding the real one.
13479
+ *
13480
+ * Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
13481
+ * more on a cold model load. With no declaration every digest failed at
13482
+ * exactly 60 s and shipped without its text.
13483
+ *
13484
+ * A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
13485
+ * the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
13486
+ * decide when to stop, because only they can say WHY.
13487
+ */
13488
+ var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
13489
+ /** A multi-gigabyte download. An hour is not generous, it is honest. */
13490
+ var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
13491
+ /**
13463
13492
  * Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
13464
13493
  * surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
13465
13494
  * caps stay wire-compatible without a circular cap→cap import.
@@ -13768,11 +13797,13 @@ var llmRuntimeCapability = {
13768
13797
  timeoutMs: number$1().int().positive().optional()
13769
13798
  }), LlmGenerateResultSchema, {
13770
13799
  kind: "mutation",
13771
- auth: "admin"
13800
+ auth: "admin",
13801
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
13772
13802
  }),
13773
13803
  ensureStarted: method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
13774
13804
  kind: "mutation",
13775
- auth: "admin"
13805
+ auth: "admin",
13806
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
13776
13807
  }),
13777
13808
  stop: method(object({}), _void(), {
13778
13809
  kind: "mutation",
@@ -13781,7 +13812,8 @@ var llmRuntimeCapability = {
13781
13812
  status: method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }),
13782
13813
  installModel: method(object({ model: ManagedModelRefSchema }), _void(), {
13783
13814
  kind: "mutation",
13784
- auth: "admin"
13815
+ auth: "admin",
13816
+ timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
13785
13817
  }),
13786
13818
  deleteModel: method(object({ file: string() }), _void(), {
13787
13819
  kind: "mutation",
@@ -13963,8 +13995,14 @@ var llmCapability = {
13963
13995
  /** `nodeId` inputs below are DATA (the hub provider pins itself), never routing. */
13964
13996
  nodeIdMode: "data",
13965
13997
  methods: {
13966
- generate: method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }),
13967
- generateVision: method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }),
13998
+ generate: method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
13999
+ kind: "mutation",
14000
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14001
+ }),
14002
+ generateVision: method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
14003
+ kind: "mutation",
14004
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14005
+ }),
13968
14006
  /**
13969
14007
  * Stop a generation started with a `requestId`.
13970
14008
  *
@@ -13988,7 +14026,8 @@ var llmCapability = {
13988
14026
  }),
13989
14027
  testProfile: method(ProfileRefInputSchema, LlmGenerateResultSchema, {
13990
14028
  kind: "mutation",
13991
- auth: "admin"
14029
+ auth: "admin",
14030
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
13992
14031
  }),
13993
14032
  /** Live vendor enumeration (GET /models etc.). */
13994
14033
  listModels: method(ProfileRefInputSchema, array(string())),
@@ -73861,6 +73900,10 @@ var CONSUMER_RETRY_POLICY = {
73861
73900
  "ai-summary": RETRYING,
73862
73901
  /** NcConfirmGate — 8 s total budget, fail-OPEN. */
73863
73902
  "notifier-rules": NOT_RETRYING,
73903
+ /** NcRuleAiAnalyst — the sentence on ONE notification, same 8 s budget and
73904
+ * the same reason: somebody is holding a phone, and a retry produces a
73905
+ * later notification rather than a better one. */
73906
+ "notifier-narration": NOT_RETRYING,
73864
73907
  /** SceneConfirmGate + checkSceneLlm — 8 s total budget, fail-CLOSED. */
73865
73908
  "scene-monitor": NOT_RETRYING
73866
73909
  };
package/dist/addon.mjs CHANGED
@@ -13487,6 +13487,35 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
13487
13487
  auth: "admin"
13488
13488
  });
13489
13489
  /**
13490
+ * Transport bounds for AI capability methods.
13491
+ *
13492
+ * Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
13493
+ * each other: declaring the constant in either one hands the other `undefined`
13494
+ * at module-init time, and an undefined `timeoutMs` silently falls back to the
13495
+ * kernel's 60 s default — the exact failure this constant exists to prevent,
13496
+ * reintroduced invisibly. Found by the guard, not by review.
13497
+ */
13498
+ /**
13499
+ * Ceiling for a cap method that runs inference or loads a model.
13500
+ *
13501
+ * Deliberately far above anything the AI layer itself may wait for (a summary
13502
+ * asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
13503
+ * never be the layer that gives up first: when it does, the failure is
13504
+ * reported as a transport error for a model that was still thinking, naming
13505
+ * the wrong layer and hiding the real one.
13506
+ *
13507
+ * Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
13508
+ * more on a cold model load. With no declaration every digest failed at
13509
+ * exactly 60 s and shipped without its text.
13510
+ *
13511
+ * A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
13512
+ * the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
13513
+ * decide when to stop, because only they can say WHY.
13514
+ */
13515
+ var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
13516
+ /** A multi-gigabyte download. An hour is not generous, it is honest. */
13517
+ var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
13518
+ /**
13490
13519
  * Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
13491
13520
  * surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
13492
13521
  * caps stay wire-compatible without a circular cap→cap import.
@@ -13795,11 +13824,13 @@ var llmRuntimeCapability = {
13795
13824
  timeoutMs: number$1().int().positive().optional()
13796
13825
  }), LlmGenerateResultSchema, {
13797
13826
  kind: "mutation",
13798
- auth: "admin"
13827
+ auth: "admin",
13828
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
13799
13829
  }),
13800
13830
  ensureStarted: method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
13801
13831
  kind: "mutation",
13802
- auth: "admin"
13832
+ auth: "admin",
13833
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
13803
13834
  }),
13804
13835
  stop: method(object({}), _void(), {
13805
13836
  kind: "mutation",
@@ -13808,7 +13839,8 @@ var llmRuntimeCapability = {
13808
13839
  status: method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }),
13809
13840
  installModel: method(object({ model: ManagedModelRefSchema }), _void(), {
13810
13841
  kind: "mutation",
13811
- auth: "admin"
13842
+ auth: "admin",
13843
+ timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
13812
13844
  }),
13813
13845
  deleteModel: method(object({ file: string() }), _void(), {
13814
13846
  kind: "mutation",
@@ -13990,8 +14022,14 @@ var llmCapability = {
13990
14022
  /** `nodeId` inputs below are DATA (the hub provider pins itself), never routing. */
13991
14023
  nodeIdMode: "data",
13992
14024
  methods: {
13993
- generate: method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }),
13994
- generateVision: method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }),
14025
+ generate: method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
14026
+ kind: "mutation",
14027
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14028
+ }),
14029
+ generateVision: method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
14030
+ kind: "mutation",
14031
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14032
+ }),
13995
14033
  /**
13996
14034
  * Stop a generation started with a `requestId`.
13997
14035
  *
@@ -14015,7 +14053,8 @@ var llmCapability = {
14015
14053
  }),
14016
14054
  testProfile: method(ProfileRefInputSchema, LlmGenerateResultSchema, {
14017
14055
  kind: "mutation",
14018
- auth: "admin"
14056
+ auth: "admin",
14057
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14019
14058
  }),
14020
14059
  /** Live vendor enumeration (GET /models etc.). */
14021
14060
  listModels: method(ProfileRefInputSchema, array(string())),
@@ -73888,6 +73927,10 @@ var CONSUMER_RETRY_POLICY = {
73888
73927
  "ai-summary": RETRYING,
73889
73928
  /** NcConfirmGate — 8 s total budget, fail-OPEN. */
73890
73929
  "notifier-rules": NOT_RETRYING,
73930
+ /** NcRuleAiAnalyst — the sentence on ONE notification, same 8 s budget and
73931
+ * the same reason: somebody is holding a phone, and a retry produces a
73932
+ * later notification rather than a better one. */
73933
+ "notifier-narration": NOT_RETRYING,
73891
73934
  /** SceneConfirmGate + checkSceneLlm — 8 s total budget, fail-CLOSED. */
73892
73935
  "scene-monitor": NOT_RETRYING
73893
73936
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.4.53",
3
+ "version": "0.4.55",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",