@camstack/addon-agent-ui 1.2.145 → 1.2.146

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.
Files changed (2) hide show
  1. package/dist/addon.js +222 -15
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -14537,18 +14537,30 @@ var LlmErrorCodeSchema = _enum([
14537
14537
  "budget-exceeded",
14538
14538
  "adapter-error"
14539
14539
  ]);
14540
- var LlmGenerateResultSchema = discriminatedUnion("ok", [object({
14540
+ var LlmGenerateOkSchema = object({
14541
14541
  ok: literal(true),
14542
14542
  text: string(),
14543
14543
  model: string(),
14544
14544
  usage: LlmUsageSchema,
14545
14545
  truncated: boolean(),
14546
14546
  latencyMs: number()
14547
- }), object({
14547
+ });
14548
+ /**
14549
+ * WHO refused, on a `refusal`. `guardrail` = a safety filter in front of the
14550
+ * model rejected the request before it answered (Apple Foundation Models
14551
+ * refuses surveillance-framed prompts in 0.1 s); `model` = the model itself
14552
+ * declined. They are different faults: a guardrail refusal is a property of
14553
+ * the BACKEND, so the provider falls back to the next profile; a model refusal
14554
+ * is an answer. Absent on every other code, and on a refusal a wire cannot
14555
+ * attribute.
14556
+ */
14557
+ var LlmRefusalSourceSchema = _enum(["guardrail", "model"]);
14558
+ var LlmGenerateResultSchema = discriminatedUnion("ok", [LlmGenerateOkSchema, object({
14548
14559
  ok: literal(false),
14549
14560
  code: LlmErrorCodeSchema,
14550
14561
  message: string(),
14551
- retryAfterMs: number().optional()
14562
+ retryAfterMs: number().optional(),
14563
+ refusalSource: LlmRefusalSourceSchema.optional()
14552
14564
  })]);
14553
14565
  /**
14554
14566
  * `Uint8Array` is the sanctioned binary convention — superjson + the UDS
@@ -14778,12 +14790,78 @@ var LlmRuntimeDiskUsageSchema = object({
14778
14790
  modelsBytes: number(),
14779
14791
  freeBytes: number().optional()
14780
14792
  });
14781
- method(LlmGenerateBaseInputSchema.extend({
14793
+ var LlmRuntimeCompleteInputSchema = LlmGenerateBaseInputSchema.extend({
14782
14794
  images: array(LlmImageSchema).optional(),
14783
14795
  runtime: ManagedRuntimeConfigSchema,
14784
14796
  /** The managed profile's timeout, threaded by the hub provider. */
14785
14797
  timeoutMs: number().int().positive().optional()
14786
- }), LlmGenerateResultSchema, {
14798
+ });
14799
+ /**
14800
+ * Why Apple Foundation Models cannot run on a node that has it in principle.
14801
+ * The first three are Apple's own `UnavailableReason`s, verbatim; the rest are
14802
+ * ours: the OS predates the framework (macOS < 26), the helper binary is not
14803
+ * in the installed addon, or it crashed past the respawn bound.
14804
+ */
14805
+ var AppleFmUnavailableReasonSchema = _enum([
14806
+ "deviceNotEligible",
14807
+ "appleIntelligenceNotEnabled",
14808
+ "modelNotReady",
14809
+ "osTooOld",
14810
+ "helperMissing",
14811
+ "helperCrashed"
14812
+ ]);
14813
+ /**
14814
+ * Apple Foundation Models on ONE node — four states, never a boolean (D315).
14815
+ *
14816
+ * - `available` — the helper probed it; what it CAN do is reported
14817
+ * here (`imageInput`, `contextSize`, languages),
14818
+ * never typed by an operator.
14819
+ * - `unavailable` — a known absence, with the reason to act on.
14820
+ * - `unsupported-platform` — not a Mac; there is nothing to enable.
14821
+ * - `unknown` — the probe did not answer (not yet run, timed
14822
+ * out, helper crashed mid-probe). A failed
14823
+ * measurement is NEVER `unavailable` (D393).
14824
+ */
14825
+ var AppleFmAvailabilitySchema = discriminatedUnion("state", [
14826
+ object({
14827
+ state: literal("available"),
14828
+ osVersion: string(),
14829
+ /** Tokens, as the framework reports it. Read at runtime, never assumed. */
14830
+ contextSize: number().int().positive(),
14831
+ /** BCP-47-ish tags (`it-IT`) of the languages the model supports. */
14832
+ languages: array(string()),
14833
+ /** Whether prompts may carry images. `false` on a macOS 26 build. */
14834
+ imageInput: boolean()
14835
+ }),
14836
+ object({
14837
+ state: literal("unavailable"),
14838
+ reason: AppleFmUnavailableReasonSchema,
14839
+ osVersion: string().nullable(),
14840
+ detail: string()
14841
+ }),
14842
+ object({
14843
+ state: literal("unsupported-platform"),
14844
+ platform: string()
14845
+ }),
14846
+ object({
14847
+ state: literal("unknown"),
14848
+ error: string()
14849
+ })
14850
+ ]);
14851
+ /**
14852
+ * A generation on the node's Apple Foundation Models helper. A separate verb
14853
+ * from `complete`, whose `runtime` is a llama.cpp config: overloading it would
14854
+ * drag a GGUF model reference into a backend that has none. `images` is part
14855
+ * of the contract so vision needs no cap change later; a node whose model has
14856
+ * no image input REFUSES them (`unavailable`), never drops them.
14857
+ */
14858
+ var LlmRuntimeAppleCompleteInputSchema = LlmGenerateBaseInputSchema.extend({
14859
+ images: array(LlmImageSchema).optional(),
14860
+ /** The profile's timeout, threaded by the hub provider. */
14861
+ timeoutMs: number().int().positive().optional()
14862
+ });
14863
+ var LlmRuntimeCancelInputSchema = object({ requestId: string() });
14864
+ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
14787
14865
  kind: "mutation",
14788
14866
  auth: "admin",
14789
14867
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
@@ -14801,7 +14879,14 @@ method(LlmGenerateBaseInputSchema.extend({
14801
14879
  }), method(object({ file: string() }), _void(), {
14802
14880
  kind: "mutation",
14803
14881
  auth: "admin"
14804
- }), method(object({}), array(LlmNodeModelSchema), { auth: "admin" }), method(object({}), LlmRuntimeDiskUsageSchema, { auth: "admin" });
14882
+ }), method(object({}), array(LlmNodeModelSchema), { auth: "admin" }), method(object({}), LlmRuntimeDiskUsageSchema, { auth: "admin" }), method(LlmRuntimeCancelInputSchema, _void(), {
14883
+ kind: "mutation",
14884
+ auth: "admin"
14885
+ }), method(object({}), AppleFmAvailabilitySchema, { auth: "admin" }), method(LlmRuntimeAppleCompleteInputSchema, LlmGenerateResultSchema, {
14886
+ kind: "mutation",
14887
+ auth: "admin",
14888
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14889
+ });
14805
14890
  /**
14806
14891
  * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
14807
14892
  * methods concat-fan across providers; single-row methods route to ONE
@@ -14818,7 +14903,8 @@ var LlmProfileKindSchema = _enum([
14818
14903
  "openai",
14819
14904
  "anthropic",
14820
14905
  "google",
14821
- "managed-local"
14906
+ "managed-local",
14907
+ "apple-foundation"
14822
14908
  ]);
14823
14909
  var LlmProfileSchema = object({
14824
14910
  id: string(),
@@ -14876,7 +14962,14 @@ var LlmProfileSchema = object({
14876
14962
  toolsEnabled: boolean().default(false),
14877
14963
  extraHeaders: record(string(), string()).optional(),
14878
14964
  /** kind === 'managed-local' only (spec §4). */
14879
- runtime: ManagedRuntimeConfigSchema.optional()
14965
+ runtime: ManagedRuntimeConfigSchema.optional(),
14966
+ /**
14967
+ * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
14968
+ * to configure (no key, no URL, no download; `model` is `apple-system`).
14969
+ * `supportsVision` on such a row is stamped by the provider from the node's
14970
+ * reported `imageInput`, never taken from the operator (D62).
14971
+ */
14972
+ appleFoundation: object({ nodeId: string() }).optional()
14880
14973
  });
14881
14974
  /** ConfigUISchema tree passed through untyped on the wire (the
14882
14975
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -14958,7 +15051,9 @@ var LlmRuntimeNodeSchema = object({
14958
15051
  reachable: boolean(),
14959
15052
  status: LlmRuntimeStatusSchema.optional(),
14960
15053
  disk: LlmRuntimeDiskUsageSchema.optional(),
14961
- error: string().optional()
15054
+ error: string().optional(),
15055
+ /** Absent = the node did not answer the question (render as unknown). */
15056
+ apple: AppleFmAvailabilitySchema.optional()
14962
15057
  });
14963
15058
  var GenerateVisionInputSchema = LlmGenerateBaseInputSchema.extend({ images: array(LlmImageSchema).min(1) });
14964
15059
  var ProfileRefInputSchema = object({
@@ -17937,9 +18032,29 @@ var NcTestResultSchema = object({
17937
18032
  className: string().optional(),
17938
18033
  label: string().optional()
17939
18034
  });
17940
- /** The five rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts`
17941
- * is the same union; the template-vars spec pins the two together. */
18035
+ /** The rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts` is the
18036
+ * same union; the template-vars spec pins the two together. `mixed` is DERIVED
18037
+ * (a stored system rule whose kinds span families, D637) and never authored. */
17942
18038
  var NcRuleKindSchema = _enum([
18039
+ "detection",
18040
+ "sensor",
18041
+ "occupancy",
18042
+ "sound",
18043
+ "device-events",
18044
+ "system",
18045
+ "alarm",
18046
+ "mixed"
18047
+ ]);
18048
+ /**
18049
+ * The kinds a SERVED template-variable descriptor may name: the five that
18050
+ * existed before D637, frozen. `getTemplateCatalog` ships `kinds` to every
18051
+ * installed viewer, and a viewer at `@camstack/types` 1.2.25x parses them with a
18052
+ * strict five-member enum — one `device-events` in one descriptor fails the
18053
+ * whole catalog parse. So the WIRE says `system`, and the MATCH widens it:
18054
+ * `templateVarKindApplies` reads a `system` descriptor as applying to every
18055
+ * system rule kind (`device-events`, `system`, `alarm`, `mixed`).
18056
+ */
18057
+ var NcTemplateVarKindSchema = _enum([
17943
18058
  "detection",
17944
18059
  "sensor",
17945
18060
  "occupancy",
@@ -17977,7 +18092,7 @@ var NcTemplateVarGroupSchema = _enum([
17977
18092
  *
17978
18093
  * `families` / `fields` / `kinds` / `deliveries` / `systemEventKinds` say WHERE
17979
18094
  * it has a value; absent = no restriction on that axis. `systemEventKinds` is
17980
- * read only for a `system` rule. `dynamic` declares a FAMILY of names
18095
+ * read only for a system-event rule (any family, or `mixed`). `dynamic` declares a FAMILY of names
17981
18096
  * (`count_<class>`): the descriptor's `name` is the example member.
17982
18097
  */
17983
18098
  var NcTemplateVarDescriptorSchema = object({
@@ -17988,7 +18103,7 @@ var NcTemplateVarDescriptorSchema = object({
17988
18103
  group: NcTemplateVarGroupSchema,
17989
18104
  families: array(NcTemplateFamilySchema).min(1),
17990
18105
  fields: array(NcTemplateFieldSchema).optional(),
17991
- kinds: array(NcRuleKindSchema).optional(),
18106
+ kinds: array(NcTemplateVarKindSchema).optional(),
17992
18107
  deliveries: array(NcDeliverySchema).optional(),
17993
18108
  systemEventKinds: array(NcSystemEventKindSchema).optional(),
17994
18109
  dynamic: object({
@@ -29100,7 +29215,30 @@ var RenameNodeResultSchema = object({
29100
29215
  nodeId: string(),
29101
29216
  name: string()
29102
29217
  });
29103
- method(_void(), array(TopologyNodeSchema).readonly(), { auth: "admin" }), method(NodeAddonInputSchema, SuccessSchema, {
29218
+ /**
29219
+ * The cheap node list. A consumer's rule for a STORED node id (a rule's
29220
+ * `nodeIds`) that is missing from `nodes`, whatever `complete` says: render it
29221
+ * as a removable chip labelled unknown, never drop it (D49). Even a complete
29222
+ * list omits a node that joined and left between two history captures, so a
29223
+ * missing id means "not known to the hub", never "removed". Only the operator
29224
+ * removes it.
29225
+ *
29226
+ * `complete` changes only the WORDING: `false` = no history read has ever
29227
+ * answered, so the list may be missing offline nodes the hub does know (D315).
29228
+ *
29229
+ * `name` is the history row's name (≤ 30 s behind a rename), or the id when
29230
+ * the history has none.
29231
+ */
29232
+ var NodeDirectorySchema = object({
29233
+ nodes: array(object({
29234
+ id: string(),
29235
+ name: string(),
29236
+ isHub: boolean(),
29237
+ isOnline: boolean()
29238
+ })).readonly(),
29239
+ complete: boolean()
29240
+ });
29241
+ method(_void(), array(TopologyNodeSchema).readonly(), { auth: "admin" }), method(_void(), NodeDirectorySchema, { auth: "admin" }), method(NodeAddonInputSchema, SuccessSchema, {
29104
29242
  kind: "mutation",
29105
29243
  auth: "admin"
29106
29244
  }), method(NodeAddonInputSchema, SuccessSchema, {
@@ -37529,12 +37667,30 @@ Object.freeze({
37529
37667
  addonId: null,
37530
37668
  access: "create"
37531
37669
  },
37670
+ "llmRuntime.appleAvailability": {
37671
+ capName: "llm-runtime",
37672
+ capScope: "system",
37673
+ addonId: null,
37674
+ access: "view"
37675
+ },
37676
+ "llmRuntime.cancel": {
37677
+ capName: "llm-runtime",
37678
+ capScope: "system",
37679
+ addonId: null,
37680
+ access: "create"
37681
+ },
37532
37682
  "llmRuntime.complete": {
37533
37683
  capName: "llm-runtime",
37534
37684
  capScope: "system",
37535
37685
  addonId: null,
37536
37686
  access: "create"
37537
37687
  },
37688
+ "llmRuntime.completeApple": {
37689
+ capName: "llm-runtime",
37690
+ capScope: "system",
37691
+ addonId: null,
37692
+ access: "create"
37693
+ },
37538
37694
  "llmRuntime.deleteModel": {
37539
37695
  capName: "llm-runtime",
37540
37696
  capScope: "system",
@@ -38207,6 +38363,12 @@ Object.freeze({
38207
38363
  addonId: null,
38208
38364
  access: "create"
38209
38365
  },
38366
+ "nodes.directory": {
38367
+ capName: "nodes",
38368
+ capScope: "system",
38369
+ addonId: null,
38370
+ access: "view"
38371
+ },
38210
38372
  "nodes.executeQuery": {
38211
38373
  capName: "nodes",
38212
38374
  capScope: "system",
@@ -43971,6 +44133,51 @@ var NC_AUDIO_DEFAULTS = {
43971
44133
  samplingSeconds: 10
43972
44134
  };
43973
44135
  new Set(["devices", "classes"]);
44136
+ /** Every filter, for the callers that must cover all four (guards, tests). */
44137
+ var NC_SYSTEM_EVENT_FILTER_KEYS = [
44138
+ "deviceIds",
44139
+ "deviceTypes",
44140
+ "nodeIds",
44141
+ "packageNames"
44142
+ ];
44143
+ new Map(Object.entries({
44144
+ "device-online": "device-events",
44145
+ "device-offline": "device-events",
44146
+ "device-disabled": "device-events",
44147
+ "device-enabled": "device-events",
44148
+ "device-battery-low": "device-events",
44149
+ "device-battery-normal": "device-events",
44150
+ "device-consumable-low": "device-events",
44151
+ "device-consumable-normal": "device-events",
44152
+ "stream-online": "device-events",
44153
+ "stream-offline": "device-events",
44154
+ "detection-blind": "device-events",
44155
+ "node-online": "system",
44156
+ "node-offline": "system",
44157
+ "node-inference-unavailable": "system",
44158
+ "addon-crash-loop": "system",
44159
+ "addon-update-available": "system",
44160
+ "addon-updated": "system",
44161
+ "server-update-available": "system",
44162
+ "server-updated": "system",
44163
+ "wrapper-update-available": "system",
44164
+ "backup-completed": "system",
44165
+ "export-completed": "system",
44166
+ "alarm-triggered": "alarm",
44167
+ "alarm-armed": "alarm",
44168
+ "alarm-disarmed": "alarm",
44169
+ "alarm-arming": "alarm",
44170
+ "alarm-arm-refused": "alarm",
44171
+ "alarm-pending": "alarm",
44172
+ "alarm-rearmed": "alarm",
44173
+ "alarm-sensor-bypass": "alarm",
44174
+ "alarm-check-failed": "alarm",
44175
+ "camera-online": null,
44176
+ "camera-offline": null,
44177
+ "camera-disabled": null,
44178
+ "camera-enabled": null
44179
+ }));
44180
+ [...NC_SYSTEM_EVENT_FILTER_KEYS];
43974
44181
  NC_AUDIO_DEFAULTS.hitPercent, NC_AUDIO_DEFAULTS.samplingSeconds;
43975
44182
  var RULE_BODY_ONLY = ["body"];
43976
44183
  var RULE_TEXT = ["title", "body"];
@@ -44503,7 +44710,7 @@ var AgentUIAddon = class extends BaseAddon {
44503
44710
  capability: adminUiCapability,
44504
44711
  provider: {
44505
44712
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
44506
- getVersion: async () => ({ version: "1.2.145" })
44713
+ getVersion: async () => ({ version: "1.2.146" })
44507
44714
  }
44508
44715
  }];
44509
44716
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.145",
3
+ "version": "1.2.146",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",