@camstack/addon-post-analysis 1.2.27 → 1.2.28

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.
@@ -20770,6 +20770,103 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
20770
20770
  enabled: boolean()
20771
20771
  }), _void(), { kind: "mutation" });
20772
20772
  /**
20773
+ * core-blocks — user-authored TypeScript, stored in the kernel and executed in
20774
+ * its own process.
20775
+ *
20776
+ * Spec: `docs/superpowers/specs/2026-08-04-core-blocks-and-synthetic-devices-design.md`.
20777
+ *
20778
+ * The first use is **owning devices without being a device provider**: a block
20779
+ * declares devices under a system or custom integration and drives their state,
20780
+ * with the same `ctx` an addon gets. Automations come later; nothing here
20781
+ * models a trigger.
20782
+ *
20783
+ * **Stated plainly, because it does not change by being true:** a block has an
20784
+ * addon's powers — devices, storage, the event bus, `ctx.api`. It is a plugin
20785
+ * with no review step. What makes that survivable is not a sandbox, it is
20786
+ * PROCESS ISOLATION: one process per block, supervised by `CrashSupervisor`,
20787
+ * so a block that throws or never returns is marked `failed` and visible
20788
+ * instead of taking the hub with it (D6). Every method here is admin-only, and
20789
+ * must stay so.
20790
+ */
20791
+ /** Where a block runs. The operator chooses — a block driving a device on an
20792
+ * agent is the reason placement is not fixed to the hub. */
20793
+ var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
20794
+ /** What a block's process is doing. Mirrors the addon runner's own lifecycle so
20795
+ * a failing block reads the same way a failing addon does. */
20796
+ var CoreBlockStatusSchema = _enum([
20797
+ "stopped",
20798
+ "starting",
20799
+ "running",
20800
+ "failed"
20801
+ ]);
20802
+ /** Client-authored fields. */
20803
+ var CoreBlockInputSchema = object({
20804
+ name: string().min(1).max(120),
20805
+ /** TypeScript source. Compiled server-side before it is ever stored — a
20806
+ * block that does not compile is a fork failure the operator would meet
20807
+ * minutes later, in a log, instead of in the editor. */
20808
+ code: string().max(2e5),
20809
+ enabled: boolean(),
20810
+ placement: CoreBlockPlacementSchema,
20811
+ /**
20812
+ * Integration the block's devices hang from. Absent = the system integration
20813
+ * blocks share. A block may declare its own instead.
20814
+ */
20815
+ integrationId: string().optional()
20816
+ });
20817
+ /** A stored block. */
20818
+ var CoreBlockSchema = CoreBlockInputSchema.extend({
20819
+ id: string(),
20820
+ createdAt: number(),
20821
+ updatedAt: number(),
20822
+ /** Server-stamped author. */
20823
+ createdBy: string(),
20824
+ status: CoreBlockStatusSchema,
20825
+ /**
20826
+ * Why the block is not running, when it is not. The operator's ONLY window
20827
+ * into a block that failed at load — a block that is silently absent is the
20828
+ * failure mode this whole feature has to avoid.
20829
+ */
20830
+ lastError: string().optional(),
20831
+ /** Ms epoch of the last state change. */
20832
+ lastChangedAt: number()
20833
+ });
20834
+ /** What a compile attempt produced. */
20835
+ var CoreBlockCompileResultSchema = object({
20836
+ ok: boolean(),
20837
+ /** Present when `ok` is false — the first error, in the author's words. */
20838
+ error: string().optional(),
20839
+ line: number().optional(),
20840
+ column: number().optional()
20841
+ });
20842
+ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }), method(object({ blockId: string() }), object({ block: CoreBlockSchema.nullable() }), { auth: "admin" }), method(object({ block: CoreBlockInputSchema }), object({ block: CoreBlockSchema }), {
20843
+ kind: "mutation",
20844
+ auth: "admin",
20845
+ caller: "required"
20846
+ }), method(object({
20847
+ blockId: string(),
20848
+ block: CoreBlockInputSchema.partial()
20849
+ }), object({ block: CoreBlockSchema }), {
20850
+ kind: "mutation",
20851
+ auth: "admin",
20852
+ caller: "required"
20853
+ }), method(object({ blockId: string() }), object({ success: literal(true) }), {
20854
+ kind: "mutation",
20855
+ auth: "admin"
20856
+ }), method(object({
20857
+ blockId: string(),
20858
+ enabled: boolean()
20859
+ }), object({ block: CoreBlockSchema }), {
20860
+ kind: "mutation",
20861
+ auth: "admin"
20862
+ }), method(object({ code: string() }), CoreBlockCompileResultSchema, {
20863
+ kind: "mutation",
20864
+ auth: "admin"
20865
+ }), method(object({}), object({ libs: array(object({
20866
+ filePath: string(),
20867
+ content: string()
20868
+ })) }), { auth: "admin" });
20869
+ /**
20773
20870
  * Zod schemas for persisted record types.
20774
20871
  *
20775
20872
  * These schemas serve as the single source of truth for types that are
@@ -26348,6 +26445,54 @@ Object.freeze({
26348
26445
  addonId: null,
26349
26446
  access: "create"
26350
26447
  },
26448
+ "coreBlocks.compile": {
26449
+ capName: "core-blocks",
26450
+ capScope: "system",
26451
+ addonId: null,
26452
+ access: "create"
26453
+ },
26454
+ "coreBlocks.create": {
26455
+ capName: "core-blocks",
26456
+ capScope: "system",
26457
+ addonId: null,
26458
+ access: "create"
26459
+ },
26460
+ "coreBlocks.delete": {
26461
+ capName: "core-blocks",
26462
+ capScope: "system",
26463
+ addonId: null,
26464
+ access: "delete"
26465
+ },
26466
+ "coreBlocks.get": {
26467
+ capName: "core-blocks",
26468
+ capScope: "system",
26469
+ addonId: null,
26470
+ access: "view"
26471
+ },
26472
+ "coreBlocks.getTypeDefs": {
26473
+ capName: "core-blocks",
26474
+ capScope: "system",
26475
+ addonId: null,
26476
+ access: "view"
26477
+ },
26478
+ "coreBlocks.list": {
26479
+ capName: "core-blocks",
26480
+ capScope: "system",
26481
+ addonId: null,
26482
+ access: "view"
26483
+ },
26484
+ "coreBlocks.setEnabled": {
26485
+ capName: "core-blocks",
26486
+ capScope: "system",
26487
+ addonId: null,
26488
+ access: "create"
26489
+ },
26490
+ "coreBlocks.update": {
26491
+ capName: "core-blocks",
26492
+ capScope: "system",
26493
+ addonId: null,
26494
+ access: "create"
26495
+ },
26351
26496
  "cover.close": {
26352
26497
  capName: "cover",
26353
26498
  capScope: "device",
@@ -20748,6 +20748,103 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
20748
20748
  enabled: boolean()
20749
20749
  }), _void(), { kind: "mutation" });
20750
20750
  /**
20751
+ * core-blocks — user-authored TypeScript, stored in the kernel and executed in
20752
+ * its own process.
20753
+ *
20754
+ * Spec: `docs/superpowers/specs/2026-08-04-core-blocks-and-synthetic-devices-design.md`.
20755
+ *
20756
+ * The first use is **owning devices without being a device provider**: a block
20757
+ * declares devices under a system or custom integration and drives their state,
20758
+ * with the same `ctx` an addon gets. Automations come later; nothing here
20759
+ * models a trigger.
20760
+ *
20761
+ * **Stated plainly, because it does not change by being true:** a block has an
20762
+ * addon's powers — devices, storage, the event bus, `ctx.api`. It is a plugin
20763
+ * with no review step. What makes that survivable is not a sandbox, it is
20764
+ * PROCESS ISOLATION: one process per block, supervised by `CrashSupervisor`,
20765
+ * so a block that throws or never returns is marked `failed` and visible
20766
+ * instead of taking the hub with it (D6). Every method here is admin-only, and
20767
+ * must stay so.
20768
+ */
20769
+ /** Where a block runs. The operator chooses — a block driving a device on an
20770
+ * agent is the reason placement is not fixed to the hub. */
20771
+ var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
20772
+ /** What a block's process is doing. Mirrors the addon runner's own lifecycle so
20773
+ * a failing block reads the same way a failing addon does. */
20774
+ var CoreBlockStatusSchema = _enum([
20775
+ "stopped",
20776
+ "starting",
20777
+ "running",
20778
+ "failed"
20779
+ ]);
20780
+ /** Client-authored fields. */
20781
+ var CoreBlockInputSchema = object({
20782
+ name: string().min(1).max(120),
20783
+ /** TypeScript source. Compiled server-side before it is ever stored — a
20784
+ * block that does not compile is a fork failure the operator would meet
20785
+ * minutes later, in a log, instead of in the editor. */
20786
+ code: string().max(2e5),
20787
+ enabled: boolean(),
20788
+ placement: CoreBlockPlacementSchema,
20789
+ /**
20790
+ * Integration the block's devices hang from. Absent = the system integration
20791
+ * blocks share. A block may declare its own instead.
20792
+ */
20793
+ integrationId: string().optional()
20794
+ });
20795
+ /** A stored block. */
20796
+ var CoreBlockSchema = CoreBlockInputSchema.extend({
20797
+ id: string(),
20798
+ createdAt: number(),
20799
+ updatedAt: number(),
20800
+ /** Server-stamped author. */
20801
+ createdBy: string(),
20802
+ status: CoreBlockStatusSchema,
20803
+ /**
20804
+ * Why the block is not running, when it is not. The operator's ONLY window
20805
+ * into a block that failed at load — a block that is silently absent is the
20806
+ * failure mode this whole feature has to avoid.
20807
+ */
20808
+ lastError: string().optional(),
20809
+ /** Ms epoch of the last state change. */
20810
+ lastChangedAt: number()
20811
+ });
20812
+ /** What a compile attempt produced. */
20813
+ var CoreBlockCompileResultSchema = object({
20814
+ ok: boolean(),
20815
+ /** Present when `ok` is false — the first error, in the author's words. */
20816
+ error: string().optional(),
20817
+ line: number().optional(),
20818
+ column: number().optional()
20819
+ });
20820
+ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }), method(object({ blockId: string() }), object({ block: CoreBlockSchema.nullable() }), { auth: "admin" }), method(object({ block: CoreBlockInputSchema }), object({ block: CoreBlockSchema }), {
20821
+ kind: "mutation",
20822
+ auth: "admin",
20823
+ caller: "required"
20824
+ }), method(object({
20825
+ blockId: string(),
20826
+ block: CoreBlockInputSchema.partial()
20827
+ }), object({ block: CoreBlockSchema }), {
20828
+ kind: "mutation",
20829
+ auth: "admin",
20830
+ caller: "required"
20831
+ }), method(object({ blockId: string() }), object({ success: literal(true) }), {
20832
+ kind: "mutation",
20833
+ auth: "admin"
20834
+ }), method(object({
20835
+ blockId: string(),
20836
+ enabled: boolean()
20837
+ }), object({ block: CoreBlockSchema }), {
20838
+ kind: "mutation",
20839
+ auth: "admin"
20840
+ }), method(object({ code: string() }), CoreBlockCompileResultSchema, {
20841
+ kind: "mutation",
20842
+ auth: "admin"
20843
+ }), method(object({}), object({ libs: array(object({
20844
+ filePath: string(),
20845
+ content: string()
20846
+ })) }), { auth: "admin" });
20847
+ /**
20751
20848
  * Zod schemas for persisted record types.
20752
20849
  *
20753
20850
  * These schemas serve as the single source of truth for types that are
@@ -26326,6 +26423,54 @@ Object.freeze({
26326
26423
  addonId: null,
26327
26424
  access: "create"
26328
26425
  },
26426
+ "coreBlocks.compile": {
26427
+ capName: "core-blocks",
26428
+ capScope: "system",
26429
+ addonId: null,
26430
+ access: "create"
26431
+ },
26432
+ "coreBlocks.create": {
26433
+ capName: "core-blocks",
26434
+ capScope: "system",
26435
+ addonId: null,
26436
+ access: "create"
26437
+ },
26438
+ "coreBlocks.delete": {
26439
+ capName: "core-blocks",
26440
+ capScope: "system",
26441
+ addonId: null,
26442
+ access: "delete"
26443
+ },
26444
+ "coreBlocks.get": {
26445
+ capName: "core-blocks",
26446
+ capScope: "system",
26447
+ addonId: null,
26448
+ access: "view"
26449
+ },
26450
+ "coreBlocks.getTypeDefs": {
26451
+ capName: "core-blocks",
26452
+ capScope: "system",
26453
+ addonId: null,
26454
+ access: "view"
26455
+ },
26456
+ "coreBlocks.list": {
26457
+ capName: "core-blocks",
26458
+ capScope: "system",
26459
+ addonId: null,
26460
+ access: "view"
26461
+ },
26462
+ "coreBlocks.setEnabled": {
26463
+ capName: "core-blocks",
26464
+ capScope: "system",
26465
+ addonId: null,
26466
+ access: "create"
26467
+ },
26468
+ "coreBlocks.update": {
26469
+ capName: "core-blocks",
26470
+ capScope: "system",
26471
+ addonId: null,
26472
+ access: "create"
26473
+ },
26329
26474
  "cover.close": {
26330
26475
  capName: "cover",
26331
26476
  capScope: "device",
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-Be0WkqVJ.js");
5
+ const require_dist = require("../dist-DY_XHH2r.js");
6
6
  let node_fs = require("node:fs");
7
7
  let node_fs$1 = require_dist.__toESM(node_fs, 1);
8
8
  node_fs = require_dist.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { E as embeddingEncoderCapability, O as hfModelUrl, R as BaseAddon } from "../dist-D7FtjvAJ.mjs";
1
+ import { E as embeddingEncoderCapability, O as hfModelUrl, R as BaseAddon } from "../dist-DvGwl3d2.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import * as fs from "node:fs";
4
4
  import "node:fs";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Be0WkqVJ.js");
1
+ const require_dist = require("./dist-DY_XHH2r.js");
2
2
  let node_fs = require("node:fs");
3
3
  node_fs = require_dist.__toESM(node_fs, 1);
4
4
  let node_path = require("node:path");
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.27",
21
+ version: "1.2.28",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_pipeline_analytics_widgets",
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.27",
39
+ version: "1.2.28",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-Be0WkqVJ.js");
5
+ const require_dist = require("../dist-DY_XHH2r.js");
6
6
  let node_fs = require("node:fs");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_dist.__toESM(node_path);
@@ -634,7 +634,8 @@ var NC_ALARM_DEVICE_NAME = "Alarm";
634
634
  async function ensureAlarmPanel(deps) {
635
635
  const integration = await deps.getIntegration(deps.addonId) ?? await deps.createIntegration({
636
636
  addonId: deps.addonId,
637
- name: deps.integrationName
637
+ name: deps.integrationName,
638
+ info: { fixed: true }
638
639
  });
639
640
  const existingDevice = await deps.findDeviceByStableId(NC_ALARM_STABLE_ID);
640
641
  if (existingDevice !== null) return {
@@ -22389,7 +22390,7 @@ var PipelineAnalyticsAddon = class extends require_dist.BaseAddon {
22389
22390
  let storage = this.ctx.kernel.storage;
22390
22391
  const mediaRoot = process.env.CAMSTACK_MEDIA_ROOT?.trim();
22391
22392
  if (mediaRoot) {
22392
- const { FilesystemStorageProvider } = await Promise.resolve().then(() => require("../node-C5glqf4X.js"));
22393
+ const { FilesystemStorageProvider } = await Promise.resolve().then(() => require("../node-DSR4j3NF.js"));
22393
22394
  storage = new FilesystemStorageProvider(mediaRoot, { eventMedia: mediaRoot });
22394
22395
  logger.info("pipeline-analytics: event media rooted at CAMSTACK_MEDIA_ROOT", { meta: { mediaRoot } });
22395
22396
  }
@@ -1,4 +1,4 @@
1
- import { $ as EventCategory, A as notificationRulesCapability, B as createEvent, C as cosineSimilarity, D as faceGalleryCapability, F as videoclipsCapability, G as array, H as isDeviceScopedCap, I as zoneAnalyticsCapability, J as number, K as boolean, L as errMsg, M as plateGalleryCapability, N as readDeviceStateFrom, P as subKindsOf, Q as unknown, R as BaseAddon, S as buildEventKindDescriptor, T as defineCustomActions, U as nodePin, V as hydrateSchema, W as _enum, X as record, Y as object, Z as string, _ as TimelapseRuleInputSchema, a as MACRO_LABELS, b as alarmPanelCapability, c as NcConditionDescriptorSchema, d as NcRuleSchema, f as NcSnoozeInputSchema, g as OpsLogEntrySchema, h as NcTaxonomySchema, i as EVENT_PAD_MS, j as pipelineAnalyticsCapability, k as kebabToCamel, l as NcRuleInputSchema, m as NcSnoozeSuppressedSchema, n as DEFAULT_EVENT_COLOR, o as NC_CONDITION_CATALOG, p as NcSnoozeSchema, q as literal, r as EVENT_KIND_BY_CAP, s as NC_TAXONOMY, t as BaseDevice, u as NcRulePatchSchema, v as TimelapseRuleSchema, w as customAction, x as audioMetricsCapability, y as addonWidgetsSourceCapability, z as DeviceType } from "../dist-D7FtjvAJ.mjs";
1
+ import { $ as EventCategory, A as notificationRulesCapability, B as createEvent, C as cosineSimilarity, D as faceGalleryCapability, F as videoclipsCapability, G as array, H as isDeviceScopedCap, I as zoneAnalyticsCapability, J as number, K as boolean, L as errMsg, M as plateGalleryCapability, N as readDeviceStateFrom, P as subKindsOf, Q as unknown, R as BaseAddon, S as buildEventKindDescriptor, T as defineCustomActions, U as nodePin, V as hydrateSchema, W as _enum, X as record, Y as object, Z as string, _ as TimelapseRuleInputSchema, a as MACRO_LABELS, b as alarmPanelCapability, c as NcConditionDescriptorSchema, d as NcRuleSchema, f as NcSnoozeInputSchema, g as OpsLogEntrySchema, h as NcTaxonomySchema, i as EVENT_PAD_MS, j as pipelineAnalyticsCapability, k as kebabToCamel, l as NcRuleInputSchema, m as NcSnoozeSuppressedSchema, n as DEFAULT_EVENT_COLOR, o as NC_CONDITION_CATALOG, p as NcSnoozeSchema, q as literal, r as EVENT_KIND_BY_CAP, s as NC_TAXONOMY, t as BaseDevice, u as NcRulePatchSchema, v as TimelapseRuleSchema, w as customAction, x as audioMetricsCapability, y as addonWidgetsSourceCapability, z as DeviceType } from "../dist-DvGwl3d2.mjs";
2
2
  import { promises } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
@@ -628,7 +628,8 @@ var NC_ALARM_DEVICE_NAME = "Alarm";
628
628
  async function ensureAlarmPanel(deps) {
629
629
  const integration = await deps.getIntegration(deps.addonId) ?? await deps.createIntegration({
630
630
  addonId: deps.addonId,
631
- name: deps.integrationName
631
+ name: deps.integrationName,
632
+ info: { fixed: true }
632
633
  });
633
634
  const existingDevice = await deps.findDeviceByStableId(NC_ALARM_STABLE_ID);
634
635
  if (existingDevice !== null) return {
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-CgiwmstG.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-B7qyOMi9.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-post-analysis",
3
- "version": "1.2.27",
3
+ "version": "1.2.28",
4
4
  "description": "Post-Analysis bundle — enrichment, embedding-encoder, pipeline-analytics. Multi-entry npm package shipping addons that consume pipeline output.",
5
5
  "keywords": [
6
6
  "camstack",