@camstack/types 1.2.72 → 1.2.73

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
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_event_category = require("./event-category-D3gG7oil.js");
3
- const require_sleep = require("./sleep-CKWYtvXl.js");
3
+ const require_sleep = require("./sleep-B-mRsuDp.js");
4
4
  const require_canonical_hash = require("./canonical-hash-DNV8S5ET.js");
5
5
  const require_enums = require("./enums.js");
6
6
  const require_err_msg = require("./err-msg-COpsHMw2.js");
@@ -9438,6 +9438,35 @@ var LlmImageSchema = zod.z.object({
9438
9438
  bytes: zod.z.instanceof(Uint8Array),
9439
9439
  mimeType: zod.z.string()
9440
9440
  });
9441
+ /**
9442
+ * Retry policy. `enabled: false` is NOT the same as `maxAttempts: 1` in intent —
9443
+ * the flag is what a consumer table flips, the count is what the operator tunes.
9444
+ * A retry doubles the wall time of a call, so the two gates that run inside a
9445
+ * notification's budget keep it off (see `CONSUMER_RETRY_POLICY` in addon-ai).
9446
+ */
9447
+ var LlmRetryPolicySchema = zod.z.object({
9448
+ enabled: zod.z.boolean().default(false),
9449
+ /** Total attempts INCLUDING the first. 1 = no retry. */
9450
+ maxAttempts: zod.z.number().int().min(1).max(5).default(1)
9451
+ });
9452
+ /**
9453
+ * The four bounds, as ONE vocabulary.
9454
+ *
9455
+ * These were three magic constants inside the test chat (`connect` 10 s,
9456
+ * `first token` 120 s, `idle` 60 s) plus a separate `timeoutMs` on the profile.
9457
+ * They are the same four questions on every call path, so they are profile
9458
+ * fields with defaults — and each still names a DIFFERENT failure:
9459
+ * - `connect` — the endpoint never accepted the request (port closed).
9460
+ * - `firstToken` — accepted, nothing produced yet (cold model loading).
9461
+ * - `idle` — tokens started then stopped (a stall, model proven up).
9462
+ * - `total` — the whole generation, the only bound a unary call has.
9463
+ */
9464
+ var LlmTimeoutDefaults = {
9465
+ totalMs: 6e4,
9466
+ connectMs: 1e4,
9467
+ firstTokenMs: 12e4,
9468
+ idleMs: 6e4
9469
+ };
9441
9470
  var LlmGenerateBaseInputSchema = zod.z.object({
9442
9471
  /** Collection routing (the notification-output posture). */
9443
9472
  addonId: zod.z.string().optional(),
@@ -9452,7 +9481,28 @@ var LlmGenerateBaseInputSchema = zod.z.object({
9452
9481
  jsonSchema: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
9453
9482
  /** Per-call override of the profile default. */
9454
9483
  maxTokens: zod.z.number().int().positive().optional(),
9455
- temperature: zod.z.number().optional()
9484
+ temperature: zod.z.number().optional(),
9485
+ /** Per-call override of the profile default (nucleus sampling). */
9486
+ topP: zod.z.number().min(0).max(1).optional(),
9487
+ /** Per-call override of the profile default (top-k sampling). */
9488
+ topK: zod.z.number().int().positive().optional(),
9489
+ /** Per-call override of `profile.timeoutMs` — the total generation bound. */
9490
+ timeoutMs: zod.z.number().int().positive().optional(),
9491
+ /** Per-call override; beats both the consumer table and the profile. */
9492
+ retry: LlmRetryPolicySchema.optional(),
9493
+ /**
9494
+ * Caller-minted id that makes this generation CANCELLABLE.
9495
+ *
9496
+ * Without it a caller that stops waiting cannot stop the work: the gates race
9497
+ * the call against 8 s and free their own slot when the timer wins, while the
9498
+ * generation upstream keeps running to `profile.timeoutMs` — 60 s by default,
9499
+ * on a single-threaded local model. The per-camera bound then counts WAITS,
9500
+ * not generations, and the real load is unbounded.
9501
+ *
9502
+ * `AbortSignal` cannot cross a process boundary; an id can. Pass one here and
9503
+ * `llm.cancel({ requestId })` tears the socket down.
9504
+ */
9505
+ requestId: zod.z.string().optional()
9456
9506
  });
9457
9507
  //#endregion
9458
9508
  //#region src/capabilities/llm-runtime.cap.ts
@@ -9493,8 +9543,49 @@ var ManagedRuntimeConfigSchema = zod.z.object({
9493
9543
  gpuLayers: zod.z.number().int().default(0),
9494
9544
  /** Default: cpus-2, clamped ≥1 (resolved node-side). */
9495
9545
  threads: zod.z.number().int().optional(),
9496
- /** Concurrent slots. */
9546
+ /** Concurrent slots (`--parallel`). */
9497
9547
  parallel: zod.z.number().int().default(1),
9548
+ /** Logical batch size (`-b`). Larger = faster prompt ingest, more RAM. */
9549
+ batchSize: zod.z.number().int().positive().optional(),
9550
+ /** Physical batch / micro-batch (`-ub`). */
9551
+ ubatchSize: zod.z.number().int().positive().optional(),
9552
+ /**
9553
+ * `--flash-attn`. Cuts KV-cache memory on the backends that implement it and
9554
+ * is a no-op elsewhere, so it is offered rather than assumed.
9555
+ */
9556
+ flashAttention: zod.z.boolean().default(false),
9557
+ /**
9558
+ * `--mlock`. Pins the weights in RAM so the OS cannot page them out mid
9559
+ * inference. Costs the full model size in resident memory — which is exactly
9560
+ * what the RAM budget is counting.
9561
+ */
9562
+ mlock: zod.z.boolean().default(false),
9563
+ /**
9564
+ * `--no-mmap`. Reads the whole GGUF up front instead of mapping it. Slower to
9565
+ * start, but avoids the page-fault stalls a network or spinning-disk model
9566
+ * store produces on every first token.
9567
+ */
9568
+ noMmap: zod.z.boolean().default(false),
9569
+ /** `--cache-type-k` / `--cache-type-v` — quantising the KV cache is the
9570
+ * cheapest way to fit a longer context in the same RAM. */
9571
+ cacheTypeK: zod.z.enum([
9572
+ "f32",
9573
+ "f16",
9574
+ "q8_0",
9575
+ "q5_1",
9576
+ "q5_0",
9577
+ "q4_1",
9578
+ "q4_0"
9579
+ ]).optional(),
9580
+ cacheTypeV: zod.z.enum([
9581
+ "f32",
9582
+ "f16",
9583
+ "q8_0",
9584
+ "q5_1",
9585
+ "q5_0",
9586
+ "q4_1",
9587
+ "q4_0"
9588
+ ]).optional(),
9498
9589
  /** Else lazy: first generate boots it. */
9499
9590
  autoStart: zod.z.boolean().default(false),
9500
9591
  /** 0 = never; frees RAM after quiet periods. */
@@ -9600,10 +9691,44 @@ var LlmProfileSchema = zod.z.object({
9600
9691
  baseUrl: zod.z.string().optional(),
9601
9692
  /** ConfigUISchema type:'password' — never round-trips (spec §5). */
9602
9693
  apiKey: zod.z.string().optional(),
9694
+ /** Vision on/off. A vision call against a `false` profile is REFUSED, never
9695
+ * degraded to text — that shipped once and produced a confident answer to a
9696
+ * question about a picture nobody sent. */
9603
9697
  supportsVision: zod.z.boolean(),
9604
9698
  temperature: zod.z.number().min(0).max(2).optional(),
9699
+ /** Nucleus sampling. Every wire we speak has it. */
9700
+ topP: zod.z.number().min(0).max(1).optional(),
9701
+ /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
9702
+ * wire does, and the client drops it there (measured: the request body gets
9703
+ * `top_p` and no `top_k`). The profile editor hides the field wherever it
9704
+ * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
9705
+ topK: zod.z.number().int().positive().optional(),
9605
9706
  maxTokens: zod.z.number().int().positive().optional(),
9707
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own);
9708
+ * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
9709
+ * the model with, so it is the one field that changes a PROCESS. */
9710
+ contextLength: zod.z.number().int().positive().optional(),
9711
+ /** Default system prompt. A caller's `system` REPLACES it (never appends —
9712
+ * two system prompts fighting is worse than either alone). */
9713
+ systemPrompt: zod.z.string().optional(),
9714
+ /** Total generation bound — the only one a unary call has. */
9606
9715
  timeoutMs: zod.z.number().int().positive().default(6e4),
9716
+ /** Wait for response headers only. */
9717
+ connectTimeoutMs: zod.z.number().int().positive().default(1e4),
9718
+ /** Accepted, but no output yet — a cold GPU load lives here. */
9719
+ firstTokenTimeoutMs: zod.z.number().int().positive().default(12e4),
9720
+ /** Output started then stopped. */
9721
+ idleTimeoutMs: zod.z.number().int().positive().default(6e4),
9722
+ /** Profile-level default. The per-consumer table and a per-call override
9723
+ * both beat it — see `resolveRetryPolicy`. */
9724
+ retry: LlmRetryPolicySchema.default({
9725
+ enabled: false,
9726
+ maxAttempts: 1
9727
+ }),
9728
+ /** Whether this profile may use tools. The tool-call plumbing rides the
9729
+ * library; the REGISTRY of callable tools is ours and is empty in v1, so a
9730
+ * `true` here buys the wiring, not behaviour, until tools are registered. */
9731
+ toolsEnabled: zod.z.boolean().default(false),
9607
9732
  extraHeaders: zod.z.record(zod.z.string(), zod.z.string()).optional(),
9608
9733
  /** kind === 'managed-local' only (spec §4). */
9609
9734
  runtime: ManagedRuntimeConfigSchema.optional()
@@ -9676,6 +9801,17 @@ var llmCapability = {
9676
9801
  methods: {
9677
9802
  generate: require_sleep.method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }),
9678
9803
  generateVision: require_sleep.method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }),
9804
+ /**
9805
+ * Stop a generation started with a `requestId`.
9806
+ *
9807
+ * Idempotent and always successful: cancelling an id that already finished,
9808
+ * never existed, or was cancelled a moment ago is a no-op. A caller that has
9809
+ * given up must never have to handle an error from giving up.
9810
+ */
9811
+ cancel: require_sleep.method(zod.z.object({
9812
+ addonId: zod.z.string().optional(),
9813
+ requestId: zod.z.string()
9814
+ }), zod.z.void(), { kind: "mutation" }),
9679
9815
  listProfileKinds: require_sleep.method(zod.z.object({}), zod.z.array(LlmProfileKindDescriptorSchema)),
9680
9816
  listProfiles: require_sleep.method(zod.z.object({}), zod.z.array(LlmProfileSchema)),
9681
9817
  upsertProfile: require_sleep.method(zod.z.object({ profile: LlmProfileSchema }), LlmProfileSchema, {
@@ -12125,28 +12261,36 @@ var NC_AUDIO_DBFS_FLOOR = -96;
12125
12261
  /**
12126
12262
  * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
12127
12263
  *
12128
- * Operator-approved vocabulary (2026-08-12, option A — the same one the
12129
- * reference notifier uses, so an operator moving between them re-uses what
12130
- * they already know): a rule matches when, over a sampling window of
12131
- * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
12132
- * window are HITS. A sample is a hit when it satisfies BOTH present filters:
12133
- *
12134
- * - `dbThreshold` its level is at or above this many dBFS (see
12135
- * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
12136
- * - `labels` the classifier put at least one of these labels on it.
12137
- *
12138
- * Both are OPTIONAL and independent, which is the point of the shape: a
12139
- * loudness rule ("something loud at 3am") needs no model to be right, and a
12140
- * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
12141
- * is given** a window in which every sample is trivially a hit would fire on
12142
- * silence, so the engine refuses such a condition rather than notifying on
12143
- * nothing (the schema cannot express "at least one of" without becoming a
12144
- * ZodEffects the cap path would have to special-case).
12145
- *
12146
- * `hitPercent` is over the samples the window actually HOLDS, and the window
12147
- * must be FULL before it can match a window that has been open for two
12148
- * seconds of its ten is 100% of nothing, and firing on it would make
12149
- * `samplingSeconds` decorative.
12264
+ * **TWO EXCLUSIVE MODES** (operator decision 2026-08-14, D157). Which one a
12265
+ * rule is in is not a stored field it is WHICH FILTER the rule carries, so
12266
+ * there is no second switch that can disagree with the first and every rule
12267
+ * authored before the decision migrates for free (`audioModeOf`):
12268
+ *
12269
+ * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
12270
+ * classifier labels with one of them. No window, no percentage:
12271
+ * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
12272
+ * `throttle` cooldown is the only brake. The per-label confidence floor is
12273
+ * the analyzer's (`classificationMinScore`, per device) — a label only
12274
+ * reaches this condition if the classifier was already confident enough.
12275
+ * - **LEVEL mode `dbThreshold` present, no labels.** The sampling window IS
12276
+ * the condition: at least `hitPercent`% of the samples over
12277
+ * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
12278
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale). The window
12279
+ * must be FULL before it can match a window open for two of its ten
12280
+ * seconds is 100% of nothing.
12281
+ *
12282
+ * **Why label mode has no window.** It had one, and it never fired: the
12283
+ * analyzer emits ~1 audio frame per second but YAMNet only LABELS one to three
12284
+ * of them per episode, even through continuous crying. The measured maximum
12285
+ * `hitPercent` over the whole live history was 40 — under the shipped default
12286
+ * of 60, so a label rule could not fire at all, ever. A percentage of frames is
12287
+ * the wrong question to ask of a sparse classifier.
12288
+ *
12289
+ * **Fail-closed when NEITHER is given** — every sample would be a trivial hit
12290
+ * and the rule would fire on silence. The schema cannot express "exactly one
12291
+ * of" without becoming a ZodEffects the cap path would have to special-case, so
12292
+ * the exclusivity is enforced where every editor writes (`patchAudio`) and a
12293
+ * legacy rule carrying both resolves to LABEL (the mode that fires).
12150
12294
  *
12151
12295
  * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
12152
12296
  * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
@@ -12154,13 +12298,13 @@ var NC_AUDIO_DBFS_FLOOR = -96;
12154
12298
  * an operator who typed `dog` mean the same thing.
12155
12299
  */
12156
12300
  var NcAudioConditionSchema = zod.z.object({
12157
- /** Audio macro labels; absent = any sound (level-only rule). */
12301
+ /** LABEL MODE: audio macro labels. Present fires on the first labelled frame. */
12158
12302
  labels: zod.z.array(zod.z.string().min(1)).min(1).optional(),
12159
- /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
12303
+ /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
12160
12304
  dbThreshold: zod.z.number().min(-96).max(0).optional(),
12161
- /** Percentage of the window's samples that must be hits (1–100). */
12305
+ /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
12162
12306
  hitPercent: zod.z.number().int().min(1).max(100).default(60),
12163
- /** Length of the sampling window in seconds. */
12307
+ /** LEVEL MODE ONLY: length of the sampling window in seconds. */
12164
12308
  samplingSeconds: zod.z.number().int().min(1).max(300).default(10)
12165
12309
  });
12166
12310
  /**
@@ -27373,10 +27517,22 @@ var recordingExportCapability = {
27373
27517
  * thing except the comparator: `similarity` (CLIP cosine at the same ROI coords
27374
27518
  * vs condition-tagged references) and `llm` (vision-LLM judgment over the crop).
27375
27519
  *
27376
- * D14 device-config archetype (`deviceConfig.ui.kind:'widget'`) the framework
27377
- * derives the device-detail contribution; the provider carries NO hand-written
27378
- * settings-contribution methods. `status.kind:'push'` the engine pushes on
27379
- * every hysteresis flip / availability change; consumers never poll.
27520
+ * **No `deviceConfig`, deliberately.** This shipped as the D14 widget archetype,
27521
+ * which put a "Scenes" tab on one camera's detail page. That is the wrong shape
27522
+ * for the thing: a scene is a standing question about the property ("is the bin
27523
+ * still out"), and the operator's question is "which of my scenes have tripped",
27524
+ * across every camera at once — not "what does camera 617 think". Buried one
27525
+ * camera deep it also could not be found. The surface is now a top-level admin
27526
+ * page (`/scenes`, `pages/Scenes.tsx`) that lists every scene on every camera and
27527
+ * picks the camera inside the create flow, the same shape Events and Faces have.
27528
+ *
27529
+ * The consequence to keep in mind: `host/scene-monitor-editor` is gone from
27530
+ * `HOST_WIDGETS` too. `scripts/check-host-widget-resolves.ts` asserts BOTH
27531
+ * directions, so a registration nobody declares fails exactly as loudly as a
27532
+ * declaration nobody registers. The editor is imported directly by the page.
27533
+ *
27534
+ * `status.kind:'push'` — the engine pushes on every hysteresis flip /
27535
+ * availability change; consumers never poll.
27380
27536
  */
27381
27537
  /** Extensible condition tag. Seeded 'day' | 'ir' (the two variants the operator
27382
27538
  * captures) plus 'night' | 'dawn' | 'dusk' from the resolver's sun-times band.
@@ -27552,12 +27708,6 @@ var sceneMonitorCapability = {
27552
27708
  kind: "wrapper",
27553
27709
  defaultActive: true,
27554
27710
  deviceTypes: [require_sleep.DeviceType.Camera],
27555
- deviceConfig: { ui: {
27556
- kind: "widget",
27557
- widgetId: "host/scene-monitor-editor",
27558
- tab: "scenes",
27559
- label: "Scenes"
27560
- } },
27561
27711
  methods: {
27562
27712
  listScenes: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), SceneMonitorStatusSchema),
27563
27713
  createScene: require_sleep.method(zod.z.object({
@@ -28436,6 +28586,61 @@ var NetworkAddressSchema = zod.z.object({
28436
28586
  family: zod.z.string(),
28437
28587
  internal: zod.z.boolean()
28438
28588
  });
28589
+ /**
28590
+ * Provenance of the site coordinates, and the whole reason this is not just two
28591
+ * numbers.
28592
+ *
28593
+ * - `operator-set` — a human typed it, or accepted a detection. Authoritative;
28594
+ * nothing overwrites it.
28595
+ * - `derived-from-ip` — the hub geolocated its own public IP once, because a
28596
+ * default that is right to a few kilometres beats the coarse UTC clock split
28597
+ * the sun-times consumers otherwise fall back to.
28598
+ *
28599
+ * The UI shows which one it is. An operator who cannot tell a guess from their
28600
+ * own input will eventually trust the guess.
28601
+ */
28602
+ var SiteLocationSourceSchema = zod.z.enum(["operator-set", "derived-from-ip"]);
28603
+ /**
28604
+ * Where the installation physically is — a fact of the SITE, not of any addon.
28605
+ *
28606
+ * It used to live in `pipeline-analytics`' global settings, which made a
28607
+ * property of the building a property of one analytics addon. Anything that
28608
+ * needs sun-times (scene condition variants today; anything solar tomorrow)
28609
+ * reads it from here.
28610
+ */
28611
+ var SiteLocationSchema = zod.z.object({
28612
+ /** WGS84 decimal degrees. */
28613
+ latitude: zod.z.number().min(-90).max(90),
28614
+ longitude: zod.z.number().min(-180).max(180),
28615
+ source: SiteLocationSourceSchema,
28616
+ /** Epoch ms the value was last written. */
28617
+ updatedAt: zod.z.number(),
28618
+ /**
28619
+ * Human-readable place the geo-IP service reported ("Napoli, IT"). Display
28620
+ * only — never parsed, never matched on. Absent for an operator-typed value.
28621
+ */
28622
+ label: zod.z.string().optional()
28623
+ });
28624
+ /**
28625
+ * The read shape: the location plus the honest state of the one-shot derivation.
28626
+ *
28627
+ * `derivationAttemptedAt` is what makes the "one call, ever" contract
28628
+ * inspectable. When it is set and `location` is null, the geo-IP lookup ran and
28629
+ * failed; the hub will NOT try again on its own — the fallback is declared
28630
+ * (consumers degrade to their own last resort) and the operator either types the
28631
+ * coordinates or presses detect.
28632
+ */
28633
+ var SiteLocationStatusSchema = zod.z.object({
28634
+ location: SiteLocationSchema.nullable(),
28635
+ derivationAttemptedAt: zod.z.number().nullable(),
28636
+ /** Why the last derivation failed, for the UI to show instead of a shrug. */
28637
+ derivationError: zod.z.string().nullable()
28638
+ });
28639
+ /** `null` clears the location and re-arms nothing — the derivation stays spent. */
28640
+ var SetSiteLocationInputSchema = zod.z.object({
28641
+ latitude: zod.z.number().min(-90).max(90),
28642
+ longitude: zod.z.number().min(-180).max(180)
28643
+ }).nullable();
28439
28644
  var systemCapability = {
28440
28645
  name: "system",
28441
28646
  scope: "system",
@@ -28453,6 +28658,32 @@ var systemCapability = {
28453
28658
  forceRetentionCleanup: require_sleep.method(zod.z.void(), zod.z.void(), {
28454
28659
  kind: "mutation",
28455
28660
  auth: "admin"
28661
+ }),
28662
+ /**
28663
+ * The site coordinates, deriving a default from the hub's public IP on the
28664
+ * FIRST read that finds nothing stored.
28665
+ *
28666
+ * The derivation is one-shot and bounded: one outbound request, a few
28667
+ * seconds, its outcome persisted either way. A hub with no internet pays it
28668
+ * once and never again, and neither boot nor any consumer is blocked on it —
28669
+ * the caller gets `location: null` and degrades exactly as it did before this
28670
+ * method existed.
28671
+ */
28672
+ getSiteLocation: require_sleep.method(zod.z.void(), SiteLocationStatusSchema),
28673
+ /** Operator input. Always lands as `source: 'operator-set'`. */
28674
+ setSiteLocation: require_sleep.method(SetSiteLocationInputSchema, SiteLocationStatusSchema, {
28675
+ kind: "mutation",
28676
+ auth: "admin"
28677
+ }),
28678
+ /**
28679
+ * Re-run the geo-IP derivation now. The ONLY way a spent or failed
28680
+ * derivation is retried — there is no timer, and no read path retries.
28681
+ * Overwrites an existing `derived-from-ip` value; refuses to clobber an
28682
+ * `operator-set` one.
28683
+ */
28684
+ detectSiteLocation: require_sleep.method(zod.z.void(), SiteLocationStatusSchema, {
28685
+ kind: "mutation",
28686
+ auth: "admin"
28456
28687
  })
28457
28688
  },
28458
28689
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
@@ -35366,6 +35597,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
35366
35597
  addonId: null,
35367
35598
  access: "create"
35368
35599
  },
35600
+ "llm.cancel": {
35601
+ capName: "llm",
35602
+ capScope: "system",
35603
+ addonId: null,
35604
+ access: "create"
35605
+ },
35369
35606
  "llm.deleteModel": {
35370
35607
  capName: "llm",
35371
35608
  capScope: "system",
@@ -38300,6 +38537,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
38300
38537
  addonId: null,
38301
38538
  access: "create"
38302
38539
  },
38540
+ "system.detectSiteLocation": {
38541
+ capName: "system",
38542
+ capScope: "system",
38543
+ addonId: null,
38544
+ access: "create"
38545
+ },
38303
38546
  "system.featureFlags": {
38304
38547
  capName: "system",
38305
38548
  capScope: "system",
@@ -38318,6 +38561,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
38318
38561
  addonId: null,
38319
38562
  access: "view"
38320
38563
  },
38564
+ "system.getSiteLocation": {
38565
+ capName: "system",
38566
+ capScope: "system",
38567
+ addonId: null,
38568
+ access: "view"
38569
+ },
38321
38570
  "system.health": {
38322
38571
  capName: "system",
38323
38572
  capScope: "system",
@@ -38342,6 +38591,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
38342
38591
  addonId: null,
38343
38592
  access: "create"
38344
38593
  },
38594
+ "system.setSiteLocation": {
38595
+ capName: "system",
38596
+ capScope: "system",
38597
+ addonId: null,
38598
+ access: "create"
38599
+ },
38345
38600
  "terminalSession.adoptLegacyMonitor": {
38346
38601
  capName: "terminal-session",
38347
38602
  capScope: "system",
@@ -41662,6 +41917,7 @@ function createSystemProxy(api) {
41662
41917
  llm: {
41663
41918
  generate: (input) => dispatch("llm", "generate", "mutation", input),
41664
41919
  generateVision: (input) => dispatch("llm", "generateVision", "mutation", input),
41920
+ cancel: (input) => dispatch("llm", "cancel", "mutation", input),
41665
41921
  listProfileKinds: (input) => dispatch("llm", "listProfileKinds", "query", input),
41666
41922
  listProfiles: (input) => dispatch("llm", "listProfiles", "query", input),
41667
41923
  upsertProfile: (input) => dispatch("llm", "upsertProfile", "mutation", input),
@@ -41958,7 +42214,10 @@ function createSystemProxy(api) {
41958
42214
  networkAddresses: (input) => dispatch("system", "networkAddresses", "query", input),
41959
42215
  getRetentionConfig: (input) => dispatch("system", "getRetentionConfig", "query", input),
41960
42216
  setRetentionConfig: (input) => dispatch("system", "setRetentionConfig", "mutation", input),
41961
- forceRetentionCleanup: (input) => dispatch("system", "forceRetentionCleanup", "mutation", input)
42217
+ forceRetentionCleanup: (input) => dispatch("system", "forceRetentionCleanup", "mutation", input),
42218
+ getSiteLocation: (input) => dispatch("system", "getSiteLocation", "query", input),
42219
+ setSiteLocation: (input) => dispatch("system", "setSiteLocation", "mutation", input),
42220
+ detectSiteLocation: (input) => dispatch("system", "detectSiteLocation", "mutation", input)
41962
42221
  },
41963
42222
  terminalSession: {
41964
42223
  listProfiles: (input) => dispatch("terminalSession", "listProfiles", "query", input),
@@ -42058,8 +42317,16 @@ var NC_AUDIO_DB_STEP = 3;
42058
42317
  * an absent `dbThreshold` means "any level" and stays absent until asked for,
42059
42318
  * and a stepper seeded at the -96 floor would need thirty taps to reach a
42060
42319
  * threshold that can actually fire.
42320
+ *
42321
+ * **It was -30 and -30 is a trap.** dBFS is negative-going, so a HIGHER number
42322
+ * is a NARROWER filter, and the sounds this hub is actually asked about are not
42323
+ * loud: measured on the live installation, real crying sits between -55 and
42324
+ * -26 dBFS. A floor at -30 therefore rejects most of the very sound the
42325
+ * operator turned the filter on for, and the rule looks broken rather than
42326
+ * mis-seeded. The offered floor is the QUIET end of that measured band; the
42327
+ * editor says which way the number runs rather than leaving it to be inferred.
42061
42328
  */
42062
- var NC_AUDIO_DB_OFFERED = -30;
42329
+ var NC_AUDIO_DB_OFFERED = -55;
42063
42330
  var NC_AUDIO_HIT_PERCENT_MIN = 1;
42064
42331
  var NC_AUDIO_HIT_PERCENT_MAX = 100;
42065
42332
  var NC_AUDIO_SAMPLING_MIN_SEC = 1;
@@ -42074,6 +42341,26 @@ function audioOrDefaults(value) {
42074
42341
  return value ?? NC_AUDIO_DEFAULTS;
42075
42342
  }
42076
42343
  /**
42344
+ * Which mode this condition is in — the ONE place that question is answered.
42345
+ *
42346
+ * The mode is NOT a stored field, deliberately. It is which filter the rule
42347
+ * carries, so every rule authored before the modes existed migrates for free
42348
+ * and there is no second switch that can disagree with the first (the failure
42349
+ * this repo has shipped twice). `null` = neither filter, which the engine
42350
+ * refuses (see {@link audioIsFailClosed}).
42351
+ *
42352
+ * A LEGACY rule carrying BOTH resolves to `label`: it is the mode that fires,
42353
+ * and the alternative is silently keeping a window the operator can no longer
42354
+ * see in the editor. Nothing new can reach this branch — {@link patchAudio}
42355
+ * clears the other filter on every write.
42356
+ */
42357
+ function audioModeOf(value) {
42358
+ if (value === void 0) return null;
42359
+ if (value.labels !== void 0 && value.labels.length > 0) return "label";
42360
+ if (value.dbThreshold !== void 0) return "level";
42361
+ return null;
42362
+ }
42363
+ /**
42077
42364
  * True when the condition names NEITHER a level floor NOR any label. The engine
42078
42365
  * refuses such a rule (every sample is a hit, so the window fires on silence) —
42079
42366
  * an editor warns instead of letting the operator ship a rule that never
@@ -42098,13 +42385,29 @@ function has(patch, key) {
42098
42385
  * The result is always in-bounds for `NcAudioConditionSchema`, and a cleared
42099
42386
  * filter is OMITTED rather than written as an explicit `undefined` (which
42100
42387
  * survives a merge patch as a deliberate erase and reads as authored).
42388
+ *
42389
+ * **The two modes are exclusive here, structurally.** Writing labels drops any
42390
+ * stored `dbThreshold`; writing a `dbThreshold` drops the labels. The schema
42391
+ * cannot say "exactly one of" without becoming a ZodEffects the cap path would
42392
+ * have to special-case, so the exclusivity lives in the ONE function every
42393
+ * editor writes through — which also means a legacy both-filters rule is
42394
+ * normalized the first time it is touched, onto the mode {@link audioModeOf}
42395
+ * already reads it as.
42396
+ *
42397
+ * Switching to `level` with nothing stored seeds {@link NC_AUDIO_DB_OFFERED}:
42398
+ * a level rule with no floor is fail-closed, and handing the operator a mode
42399
+ * that cannot fire is the trap this whole change exists to remove.
42101
42400
  */
42102
42401
  function patchAudio(current, patch) {
42103
42402
  const base = audioOrDefaults(current);
42104
- const labels = has(patch, "labels") ? patch.labels : base.labels;
42105
- const dbThreshold = has(patch, "dbThreshold") ? patch.dbThreshold : base.dbThreshold;
42403
+ const wantedLabels = has(patch, "labels") ? patch.labels : base.labels;
42404
+ const wantedDb = has(patch, "dbThreshold") ? patch.dbThreshold : base.dbThreshold;
42405
+ const hasLabels = wantedLabels !== void 0 && wantedLabels.length > 0;
42406
+ const mode = patch.mode ?? (has(patch, "labels") && hasLabels ? "label" : has(patch, "dbThreshold") && wantedDb !== void 0 ? "level" : hasLabels ? "label" : wantedDb !== void 0 ? "level" : null);
42407
+ const labels = mode === "label" && hasLabels ? wantedLabels : void 0;
42408
+ const dbThreshold = mode !== "level" ? void 0 : wantedDb ?? (patch.mode === "level" ? -55 : void 0);
42106
42409
  return {
42107
- ...labels !== void 0 && labels.length > 0 ? { labels: [...labels] } : {},
42410
+ ...labels !== void 0 ? { labels: [...labels] } : {},
42108
42411
  ...dbThreshold !== void 0 ? { dbThreshold: clampInt(dbThreshold, NC_AUDIO_DB_MIN, 0) } : {},
42109
42412
  hitPercent: clampInt(patch.hitPercent ?? base.hitPercent, 1, 100),
42110
42413
  samplingSeconds: clampInt(patch.samplingSeconds ?? base.samplingSeconds, 1, 300)
@@ -45294,10 +45597,12 @@ exports.LlmNodeModelSchema = LlmNodeModelSchema;
45294
45597
  exports.LlmProfileKindDescriptorSchema = LlmProfileKindDescriptorSchema;
45295
45598
  exports.LlmProfileKindSchema = LlmProfileKindSchema;
45296
45599
  exports.LlmProfileSchema = LlmProfileSchema;
45600
+ exports.LlmRetryPolicySchema = LlmRetryPolicySchema;
45297
45601
  exports.LlmRuntimeCompleteInputSchema = LlmRuntimeCompleteInputSchema;
45298
45602
  exports.LlmRuntimeDiskUsageSchema = LlmRuntimeDiskUsageSchema;
45299
45603
  exports.LlmRuntimeNodeSchema = LlmRuntimeNodeSchema;
45300
45604
  exports.LlmRuntimeStatusSchema = LlmRuntimeStatusSchema;
45605
+ exports.LlmTimeoutDefaults = LlmTimeoutDefaults;
45301
45606
  exports.LlmUsageRollupSchema = LlmUsageRollupSchema;
45302
45607
  exports.LlmUsageSchema = LlmUsageSchema;
45303
45608
  exports.LocateSegmentResultSchema = LocateSegmentResultSchema;
@@ -45652,11 +45957,15 @@ exports.ServerRollbackInfoSchema = ServerRollbackInfoSchema;
45652
45957
  exports.ServerUpdateActionResultSchema = ServerUpdateActionResultSchema;
45653
45958
  exports.ServerUpdateCheckResultSchema = ServerUpdateCheckResultSchema;
45654
45959
  exports.ServerUpdateStateSchema = ServerUpdateStateSchema;
45960
+ exports.SetSiteLocationInputSchema = SetSiteLocationInputSchema;
45655
45961
  exports.SettingsPatchSchema = SettingsPatchSchema;
45656
45962
  exports.SettingsRecordSchema = SettingsRecordSchema;
45657
45963
  exports.SettingsSchemaWithValuesSchema = SettingsSchemaWithValuesSchema;
45658
45964
  exports.SettingsUpdateResultSchema = SettingsUpdateResultSchema;
45659
45965
  exports.ShmRingStatsSchema = ShmRingStatsSchema;
45966
+ exports.SiteLocationSchema = SiteLocationSchema;
45967
+ exports.SiteLocationSourceSchema = SiteLocationSourceSchema;
45968
+ exports.SiteLocationStatusSchema = SiteLocationStatusSchema;
45660
45969
  exports.SmokeStatusSchema = SmokeStatusSchema;
45661
45970
  exports.SmtpStatusSchema = SmtpStatusSchema;
45662
45971
  exports.SnapshotImageSchema = SnapshotImageSchema;
@@ -45832,6 +46141,7 @@ exports.audioCodecCapability = audioCodecCapability;
45832
46141
  exports.audioIsFailClosed = audioIsFailClosed;
45833
46142
  exports.audioLabelChoices = audioLabelChoices;
45834
46143
  exports.audioMetricsCapability = audioMetricsCapability;
46144
+ exports.audioModeOf = audioModeOf;
45835
46145
  exports.audioOrDefaults = audioOrDefaults;
45836
46146
  exports.audioPlanFromEncodeProfile = require_canonical_hash.audioPlanFromEncodeProfile;
45837
46147
  exports.authProviderCapability = authProviderCapability;