@camstack/server 1.2.944 → 1.2.946

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 (66) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/generated-cap-mounts.js +18 -1
  3. package/dist/api/trpc/generated-cap-routers.js +2596 -2559
  4. package/package.json +9 -17
  5. package/system/assets/apps-aggregator/icon.svg +5 -0
  6. package/system/dist/{action-index-Dz9rd1qa.js → action-index-Bcnb-jyg.js} +8 -0
  7. package/system/dist/{action-index-DpYmsOKh.mjs → action-index-DwPHO2nz.mjs} +8 -0
  8. package/system/dist/apps.cap-Bqb9NpYx.mjs +130 -0
  9. package/system/dist/apps.cap-CLjgnuUe.js +141 -0
  10. package/system/dist/builtins/alerts/alerts.addon.js +2 -2
  11. package/system/dist/builtins/alerts/alerts.addon.mjs +2 -2
  12. package/system/dist/builtins/apps-aggregator/aggregate-apps.d.ts +24 -0
  13. package/system/dist/builtins/apps-aggregator/apps-aggregator.addon.d.ts +16 -0
  14. package/system/dist/builtins/apps-aggregator/apps-aggregator.addon.js +109 -0
  15. package/system/dist/builtins/apps-aggregator/apps-aggregator.addon.mjs +103 -0
  16. package/system/dist/builtins/apps-aggregator/index.d.ts +1 -0
  17. package/system/dist/builtins/apps-aggregator/index.js +8 -0
  18. package/system/dist/builtins/apps-aggregator/index.mjs +2 -0
  19. package/system/dist/builtins/camera-grid/index.js +1 -1
  20. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/system/dist/builtins/composer/composer.addon.js +4 -4
  22. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  23. package/system/dist/builtins/core-blocks/core-blocks.addon.js +68 -23
  24. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +68 -23
  25. package/system/dist/builtins/core-blocks/timed-run/timed-run-service.d.ts +19 -2
  26. package/system/dist/builtins/device-history/device-history.addon.js +1 -1
  27. package/system/dist/builtins/device-history/device-history.addon.mjs +1 -1
  28. package/system/dist/builtins/device-manager/device-manager.addon.js +31 -9
  29. package/system/dist/builtins/device-manager/device-manager.addon.mjs +31 -9
  30. package/system/dist/builtins/keychain/index.js +1 -1
  31. package/system/dist/builtins/keychain/index.mjs +1 -1
  32. package/system/dist/builtins/local-auth/local-auth.addon.js +1 -1
  33. package/system/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  34. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  35. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  36. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  37. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  38. package/system/dist/builtins/system-config/system-config.addon.js +1 -1
  39. package/system/dist/builtins/system-config/system-config.addon.mjs +1 -1
  40. package/system/dist/{command-catalog-CI0tu1Nt.js → command-catalog-A_ONlLfF.js} +1 -1
  41. package/system/dist/{command-catalog-zwlIA3T5.mjs → command-catalog-CZDlLhxO.mjs} +1 -1
  42. package/system/dist/{compile-SpeAhaZ6.js → compile-BpAtMSvc.js} +1 -1
  43. package/system/dist/{compile-OBMHlqD-.mjs → compile-DPGk4aRg.mjs} +1 -1
  44. package/system/dist/{composition-sources-CXxXfh1z.mjs → composition-sources-D5bWS3nC.mjs} +2 -2
  45. package/system/dist/{composition-sources-DNgSItK-.js → composition-sources-hmri4Cu4.js} +2 -2
  46. package/system/dist/{core-blocks.cap-BHEok4VO.js → core-blocks.cap-9xvotd_3.js} +3 -3
  47. package/system/dist/{core-blocks.cap-CPgZRcpj.mjs → core-blocks.cap-C6REo0Dd.mjs} +3 -3
  48. package/system/dist/{device-kind-C37Ra2wd.mjs → device-kind-B6G_HfgC.mjs} +19 -2
  49. package/system/dist/{device-kind-FMhJg8uC.js → device-kind-B7ESmha7.js} +24 -1
  50. package/system/dist/file-host-worker.js +1 -1
  51. package/system/dist/file-host-worker.mjs +1 -1
  52. package/system/dist/index.js +4 -4
  53. package/system/dist/index.mjs +4 -4
  54. package/system/dist/{named-entity-store-DFwLij9c.js → named-entity-store-CzJ28TsK.js} +2 -2
  55. package/system/dist/{named-entity-store-DOnyyFFf.mjs → named-entity-store-DJxyweoS.mjs} +2 -2
  56. package/system/dist/{record-kinds-BV8Gcpsx.js → record-kinds-DP2-HG3W.js} +1 -1
  57. package/system/dist/{record-kinds-BD2xv4Pd.mjs → record-kinds-WosKAa-D.mjs} +1 -1
  58. package/system/dist/{rename-composition-block-Cx3X8QSm.js → rename-composition-block--abG_xyW.js} +31 -36
  59. package/system/dist/{rename-composition-block-C3QQ9UUE.mjs → rename-composition-block-kmkoIx0R.mjs} +31 -36
  60. package/system/dist/{user-management.cap-4IEUCSdL.mjs → user-management.cap-C3eqqVdz.mjs} +1 -1
  61. package/system/dist/{user-management.cap-DV9Jfsj3.js → user-management.cap-D4r3UKtG.js} +1 -1
  62. package/system/dist/{wal-maintenance-CkPfVApC.js → wal-maintenance-CZKvoKfx.js} +0 -0
  63. package/system/dist/{wal-maintenance-u84_1sVl.mjs → wal-maintenance-WLoThDXX.mjs} +0 -0
  64. package/system/package.json +16 -1
  65. /package/system/dist/{constants-Ba3FTIHl.js → constants-Ba3FTIHl2.js} +0 -0
  66. /package/system/dist/{constants-DB4piTD5.mjs → constants-DB4piTD52.mjs} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.944",
3
+ "version": "1.2.946",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -68,17 +68,9 @@
68
68
  ],
69
69
  "requires": {
70
70
  "addons": {
71
- "@camstack/addon-admin-ui": ">=1.2.739",
72
- "@camstack/addon-agent-ui": ">=1.2.437",
73
- "@camstack/addon-export-alexa": ">=1.2.207",
74
- "@camstack/addon-matter-broker": ">=0.2.175",
75
- "@camstack/addon-pipeline": ">=1.2.683",
76
- "@camstack/addon-pipeline-orchestrator": ">=1.2.719",
77
- "@camstack/addon-post-analysis": ">=1.2.725",
78
- "@camstack/addon-provider-ecowitt": ">=0.2.175",
79
- "@camstack/addon-provider-homeassistant": ">=1.2.702",
80
- "@camstack/addon-provider-reolink": ">=1.2.261",
81
- "@camstack/addon-provider-rtsp": ">=1.2.161"
71
+ "@camstack/addon-admin-ui": ">=1.2.741",
72
+ "@camstack/addon-agent-ui": ">=1.2.439",
73
+ "@camstack/addon-pipeline-orchestrator": ">=1.2.720"
82
74
  },
83
75
  "wrapper": {
84
76
  "desktop": ">=0.0.1",
@@ -87,19 +79,19 @@
87
79
  }
88
80
  },
89
81
  "dependencies": {
90
- "@camstack/addon-admin-ui": "1.2.739",
91
- "@camstack/addon-agent-ui": "1.2.437",
82
+ "@camstack/addon-admin-ui": "1.2.741",
83
+ "@camstack/addon-agent-ui": "1.2.439",
92
84
  "@camstack/addon-auth": "1.2.183",
93
85
  "@camstack/addon-benchmark": "1.2.316",
94
86
  "@camstack/addon-decoder-nodeav": "1.2.150",
95
87
  "@camstack/addon-notifiers": "1.2.642",
96
88
  "@camstack/addon-pipeline": "1.2.683",
97
- "@camstack/addon-pipeline-orchestrator": "1.2.719",
89
+ "@camstack/addon-pipeline-orchestrator": "1.2.720",
98
90
  "@camstack/addon-post-analysis": "1.2.725",
99
91
  "@camstack/develop": "0.1.58",
100
92
  "@camstack/sdk": "1.2.160",
101
- "@camstack/types": "1.2.627",
102
- "@camstack/ui-library": "1.2.500",
93
+ "@camstack/types": "1.2.629",
94
+ "@camstack/ui-library": "1.2.502",
103
95
  "@fastify/compress": "^9.0.0",
104
96
  "@fastify/cookie": "^11.0.2",
105
97
  "@fastify/cors": "^11.2.0",
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#4f46e5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2
+ <rect x="3" y="3" width="18" height="18" rx="2"/>
3
+ <path d="M3 9h18"/>
4
+ <path d="M9 21V9"/>
5
+ </svg>
@@ -9431,6 +9431,14 @@ var CAP_VOCABULARY_BY_NAME = {
9431
9431
  scope: "system",
9432
9432
  notOperatorFacing: "the alert centre — read and acknowledged on its own page"
9433
9433
  },
9434
+ "app-source": {
9435
+ scope: "system",
9436
+ notOperatorFacing: "admin UI plumbing — pages, widgets and routes, not something a device does"
9437
+ },
9438
+ "apps": {
9439
+ scope: "system",
9440
+ notOperatorFacing: "admin UI plumbing — pages, widgets and routes, not something a device does"
9441
+ },
9434
9442
  "audio-analyzer": {
9435
9443
  scope: "system",
9436
9444
  notOperatorFacing: "detection pipeline machinery — tuned on the pipeline pages, never actuated per device"
@@ -9431,6 +9431,14 @@ var CAP_VOCABULARY_BY_NAME = {
9431
9431
  scope: "system",
9432
9432
  notOperatorFacing: "the alert centre — read and acknowledged on its own page"
9433
9433
  },
9434
+ "app-source": {
9435
+ scope: "system",
9436
+ notOperatorFacing: "admin UI plumbing — pages, widgets and routes, not something a device does"
9437
+ },
9438
+ "apps": {
9439
+ scope: "system",
9440
+ notOperatorFacing: "admin UI plumbing — pages, widgets and routes, not something a device does"
9441
+ },
9434
9442
  "audio-analyzer": {
9435
9443
  scope: "system",
9436
9444
  notOperatorFacing: "detection pipeline machinery — tuned on the pipeline pages, never actuated per device"
@@ -0,0 +1,130 @@
1
+ import { c as method } from "./capability-definition-C1TLUVJR.mjs";
2
+ import { t as NOT_A_DEVICE } from "./system-reasons-CYj4qwyS.mjs";
3
+ import { z } from "zod";
4
+ //#region ../types/dist/esm/capabilities/app-source.cap.mjs
5
+ /**
6
+ * `app-source` — collection cap: every addon that offers an app in the viewer
7
+ * shell registers a provider and lists its declarations. The hub singleton
8
+ * `apps` (see `apps.cap.ts`) aggregates them. No app id is spelled in the
9
+ * shell (D1096).
10
+ */
11
+ /** An i18n key with its English fallback, translated by the shell per app bundle. */
12
+ var AppLabelSchema = /* @__PURE__ */ z.object({
13
+ key: /* @__PURE__ */ z.string().min(1),
14
+ fallback: /* @__PURE__ */ z.string()
15
+ });
16
+ /** How the shell opens the app. */
17
+ var AppEntrySchema = /* @__PURE__ */ z.discriminatedUnion("kind", [
18
+ /* @__PURE__ */ z.object({
19
+ kind: /* @__PURE__ */ z.literal("native"),
20
+ route: /* @__PURE__ */ z.string()
21
+ }),
22
+ /* @__PURE__ */ z.object({
23
+ kind: /* @__PURE__ */ z.literal("web"),
24
+ /** Hub-relative path; the shell prefixes the mount (D373). */
25
+ path: /* @__PURE__ */ z.string(),
26
+ auth: /* @__PURE__ */ z.enum(["session-cookie", "handoff"])
27
+ }),
28
+ /* @__PURE__ */ z.object({
29
+ kind: /* @__PURE__ */ z.literal("addon-page"),
30
+ pageId: /* @__PURE__ */ z.string()
31
+ })
32
+ ]);
33
+ /**
34
+ * Where the app can be reached from. `lan-only` and `node` are interpreted by the
35
+ * shell (phase 4); the aggregator passes them through untouched.
36
+ */
37
+ var AppReachSchema = /* @__PURE__ */ z.discriminatedUnion("kind", [
38
+ /* @__PURE__ */ z.object({ kind: /* @__PURE__ */ z.literal("hub") }),
39
+ /* @__PURE__ */ z.object({ kind: /* @__PURE__ */ z.literal("lan-only") }),
40
+ /* @__PURE__ */ z.object({
41
+ kind: /* @__PURE__ */ z.literal("node"),
42
+ nodeId: /* @__PURE__ */ z.string()
43
+ })
44
+ ]);
45
+ /** The role an app is offered to. */
46
+ var AppRoleSchema = /* @__PURE__ */ z.enum(["admin", "user"]);
47
+ var AppNavItemSchema = /* @__PURE__ */ z.object({
48
+ id: /* @__PURE__ */ z.string(),
49
+ label: AppLabelSchema,
50
+ /** A lucide icon name. */
51
+ icon: /* @__PURE__ */ z.string(),
52
+ path: /* @__PURE__ */ z.string(),
53
+ adminOnly: /* @__PURE__ */ z.boolean().optional(),
54
+ keywords: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
55
+ badgeKey: /* @__PURE__ */ z.string().optional(),
56
+ /** Interpreted by the shell (phase 4): the item is hidden while the capability is absent. */
57
+ requiresCapability: /* @__PURE__ */ z.string().optional()
58
+ });
59
+ var AppNavSectionSchema = /* @__PURE__ */ z.object({
60
+ id: /* @__PURE__ */ z.string(),
61
+ label: /* @__PURE__ */ AppLabelSchema.nullable(),
62
+ items: /* @__PURE__ */ z.array(AppNavItemSchema)
63
+ });
64
+ var AppDeclarationSchema = /* @__PURE__ */ z.object({
65
+ id: /* @__PURE__ */ z.string(),
66
+ label: AppLabelSchema,
67
+ icon: /* @__PURE__ */ z.string(),
68
+ order: /* @__PURE__ */ z.number().optional(),
69
+ entry: AppEntrySchema,
70
+ reach: AppReachSchema,
71
+ adminOnly: /* @__PURE__ */ z.boolean(),
72
+ /** Only these roles; `["user"]` excludes admins; absent = every role `adminOnly` allows. */
73
+ roles: /* @__PURE__ */ z.array(AppRoleSchema).optional(),
74
+ nav: /* @__PURE__ */ z.array(AppNavSectionSchema),
75
+ takesSharedSearch: /* @__PURE__ */ z.boolean(),
76
+ settings: /* @__PURE__ */ z.object({
77
+ label: /* @__PURE__ */ AppLabelSchema.optional(),
78
+ path: /* @__PURE__ */ z.string()
79
+ }).nullable()
80
+ });
81
+ var appSourceCapability = {
82
+ name: "app-source",
83
+ scope: "system",
84
+ mode: "collection",
85
+ internal: true,
86
+ mount: { kind: "skip" },
87
+ methods: { listApps: /* @__PURE__ */ method(/* @__PURE__ */ z.void(), /* @__PURE__ */ z.array(AppDeclarationSchema).readonly(), { auth: "admin" }) },
88
+ vocabulary: { notOperatorFacing: NOT_A_DEVICE.UI_PLUMBING }
89
+ };
90
+ //#endregion
91
+ //#region ../types/dist/esm/capabilities/apps.cap.mjs
92
+ /**
93
+ * `apps` — hub singleton aggregator over `app-source`. The shell reads the apps
94
+ * it may offer here (D1096). `listApps` is filtered by the caller's role.
95
+ */
96
+ /** One app as the shell receives it: the declaration, stamped with its provider. */
97
+ var AppInfoSchema = /* @__PURE__ */ z.object({
98
+ addonId: /* @__PURE__ */ z.string(),
99
+ app: AppDeclarationSchema
100
+ });
101
+ /** A badge count that could not be measured is `null`, never `0` (D393). */
102
+ var AppNavBadgeSchema = /* @__PURE__ */ z.object({
103
+ count: /* @__PURE__ */ z.number().nullable(),
104
+ tone: /* @__PURE__ */ z.enum([
105
+ "neutral",
106
+ "info",
107
+ "warning",
108
+ "danger"
109
+ ])
110
+ });
111
+ var appsCapability = {
112
+ name: "apps",
113
+ scope: "system",
114
+ mode: "singleton",
115
+ methods: {
116
+ listApps: /* @__PURE__ */ method(/* @__PURE__ */ z.object({}), /* @__PURE__ */ z.array(AppInfoSchema).readonly(), {
117
+ auth: "protected",
118
+ caller: "required",
119
+ role: "viewer"
120
+ }),
121
+ getNavBadges: /* @__PURE__ */ method(/* @__PURE__ */ z.object({ appId: /* @__PURE__ */ z.string() }), /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), AppNavBadgeSchema), {
122
+ auth: "protected",
123
+ caller: "required",
124
+ role: "viewer"
125
+ })
126
+ },
127
+ vocabulary: { notOperatorFacing: NOT_A_DEVICE.UI_PLUMBING }
128
+ };
129
+ //#endregion
130
+ export { appSourceCapability as n, appsCapability as t };
@@ -0,0 +1,141 @@
1
+ const require_capability_definition = require("./capability-definition-BEVd01Xj.js");
2
+ const require_system_reasons = require("./system-reasons-Be_k1W8g.js");
3
+ let zod = require("zod");
4
+ //#region ../types/dist/esm/capabilities/app-source.cap.mjs
5
+ /**
6
+ * `app-source` — collection cap: every addon that offers an app in the viewer
7
+ * shell registers a provider and lists its declarations. The hub singleton
8
+ * `apps` (see `apps.cap.ts`) aggregates them. No app id is spelled in the
9
+ * shell (D1096).
10
+ */
11
+ /** An i18n key with its English fallback, translated by the shell per app bundle. */
12
+ var AppLabelSchema = /* @__PURE__ */ zod.z.object({
13
+ key: /* @__PURE__ */ zod.z.string().min(1),
14
+ fallback: /* @__PURE__ */ zod.z.string()
15
+ });
16
+ /** How the shell opens the app. */
17
+ var AppEntrySchema = /* @__PURE__ */ zod.z.discriminatedUnion("kind", [
18
+ /* @__PURE__ */ zod.z.object({
19
+ kind: /* @__PURE__ */ zod.z.literal("native"),
20
+ route: /* @__PURE__ */ zod.z.string()
21
+ }),
22
+ /* @__PURE__ */ zod.z.object({
23
+ kind: /* @__PURE__ */ zod.z.literal("web"),
24
+ /** Hub-relative path; the shell prefixes the mount (D373). */
25
+ path: /* @__PURE__ */ zod.z.string(),
26
+ auth: /* @__PURE__ */ zod.z.enum(["session-cookie", "handoff"])
27
+ }),
28
+ /* @__PURE__ */ zod.z.object({
29
+ kind: /* @__PURE__ */ zod.z.literal("addon-page"),
30
+ pageId: /* @__PURE__ */ zod.z.string()
31
+ })
32
+ ]);
33
+ /**
34
+ * Where the app can be reached from. `lan-only` and `node` are interpreted by the
35
+ * shell (phase 4); the aggregator passes them through untouched.
36
+ */
37
+ var AppReachSchema = /* @__PURE__ */ zod.z.discriminatedUnion("kind", [
38
+ /* @__PURE__ */ zod.z.object({ kind: /* @__PURE__ */ zod.z.literal("hub") }),
39
+ /* @__PURE__ */ zod.z.object({ kind: /* @__PURE__ */ zod.z.literal("lan-only") }),
40
+ /* @__PURE__ */ zod.z.object({
41
+ kind: /* @__PURE__ */ zod.z.literal("node"),
42
+ nodeId: /* @__PURE__ */ zod.z.string()
43
+ })
44
+ ]);
45
+ /** The role an app is offered to. */
46
+ var AppRoleSchema = /* @__PURE__ */ zod.z.enum(["admin", "user"]);
47
+ var AppNavItemSchema = /* @__PURE__ */ zod.z.object({
48
+ id: /* @__PURE__ */ zod.z.string(),
49
+ label: AppLabelSchema,
50
+ /** A lucide icon name. */
51
+ icon: /* @__PURE__ */ zod.z.string(),
52
+ path: /* @__PURE__ */ zod.z.string(),
53
+ adminOnly: /* @__PURE__ */ zod.z.boolean().optional(),
54
+ keywords: /* @__PURE__ */ zod.z.array(/* @__PURE__ */ zod.z.string()).optional(),
55
+ badgeKey: /* @__PURE__ */ zod.z.string().optional(),
56
+ /** Interpreted by the shell (phase 4): the item is hidden while the capability is absent. */
57
+ requiresCapability: /* @__PURE__ */ zod.z.string().optional()
58
+ });
59
+ var AppNavSectionSchema = /* @__PURE__ */ zod.z.object({
60
+ id: /* @__PURE__ */ zod.z.string(),
61
+ label: /* @__PURE__ */ AppLabelSchema.nullable(),
62
+ items: /* @__PURE__ */ zod.z.array(AppNavItemSchema)
63
+ });
64
+ var AppDeclarationSchema = /* @__PURE__ */ zod.z.object({
65
+ id: /* @__PURE__ */ zod.z.string(),
66
+ label: AppLabelSchema,
67
+ icon: /* @__PURE__ */ zod.z.string(),
68
+ order: /* @__PURE__ */ zod.z.number().optional(),
69
+ entry: AppEntrySchema,
70
+ reach: AppReachSchema,
71
+ adminOnly: /* @__PURE__ */ zod.z.boolean(),
72
+ /** Only these roles; `["user"]` excludes admins; absent = every role `adminOnly` allows. */
73
+ roles: /* @__PURE__ */ zod.z.array(AppRoleSchema).optional(),
74
+ nav: /* @__PURE__ */ zod.z.array(AppNavSectionSchema),
75
+ takesSharedSearch: /* @__PURE__ */ zod.z.boolean(),
76
+ settings: /* @__PURE__ */ zod.z.object({
77
+ label: /* @__PURE__ */ AppLabelSchema.optional(),
78
+ path: /* @__PURE__ */ zod.z.string()
79
+ }).nullable()
80
+ });
81
+ var appSourceCapability = {
82
+ name: "app-source",
83
+ scope: "system",
84
+ mode: "collection",
85
+ internal: true,
86
+ mount: { kind: "skip" },
87
+ methods: { listApps: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.void(), /* @__PURE__ */ zod.z.array(AppDeclarationSchema).readonly(), { auth: "admin" }) },
88
+ vocabulary: { notOperatorFacing: require_system_reasons.NOT_A_DEVICE.UI_PLUMBING }
89
+ };
90
+ //#endregion
91
+ //#region ../types/dist/esm/capabilities/apps.cap.mjs
92
+ /**
93
+ * `apps` — hub singleton aggregator over `app-source`. The shell reads the apps
94
+ * it may offer here (D1096). `listApps` is filtered by the caller's role.
95
+ */
96
+ /** One app as the shell receives it: the declaration, stamped with its provider. */
97
+ var AppInfoSchema = /* @__PURE__ */ zod.z.object({
98
+ addonId: /* @__PURE__ */ zod.z.string(),
99
+ app: AppDeclarationSchema
100
+ });
101
+ /** A badge count that could not be measured is `null`, never `0` (D393). */
102
+ var AppNavBadgeSchema = /* @__PURE__ */ zod.z.object({
103
+ count: /* @__PURE__ */ zod.z.number().nullable(),
104
+ tone: /* @__PURE__ */ zod.z.enum([
105
+ "neutral",
106
+ "info",
107
+ "warning",
108
+ "danger"
109
+ ])
110
+ });
111
+ var appsCapability = {
112
+ name: "apps",
113
+ scope: "system",
114
+ mode: "singleton",
115
+ methods: {
116
+ listApps: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({}), /* @__PURE__ */ zod.z.array(AppInfoSchema).readonly(), {
117
+ auth: "protected",
118
+ caller: "required",
119
+ role: "viewer"
120
+ }),
121
+ getNavBadges: /* @__PURE__ */ require_capability_definition.method(/* @__PURE__ */ zod.z.object({ appId: /* @__PURE__ */ zod.z.string() }), /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), AppNavBadgeSchema), {
122
+ auth: "protected",
123
+ caller: "required",
124
+ role: "viewer"
125
+ })
126
+ },
127
+ vocabulary: { notOperatorFacing: require_system_reasons.NOT_A_DEVICE.UI_PLUMBING }
128
+ };
129
+ //#endregion
130
+ Object.defineProperty(exports, "appSourceCapability", {
131
+ enumerable: true,
132
+ get: function() {
133
+ return appSourceCapability;
134
+ }
135
+ });
136
+ Object.defineProperty(exports, "appsCapability", {
137
+ enumerable: true,
138
+ get: function() {
139
+ return appsCapability;
140
+ }
141
+ });
@@ -6,8 +6,8 @@ const require_chunk = require("../../chunk-Cek0wNdY.js");
6
6
  const require_base_addon = require("../../base-addon-BG7p06Hb.js");
7
7
  const require_scoped_settings = require("../../scoped-settings-CylSSq_8.js");
8
8
  const require_record_kind = require("../../record-kind-DoBfYHCs.js");
9
- const require_core_blocks_cap = require("../../core-blocks.cap-BHEok4VO.js");
10
- const require_compile = require("../../compile-SpeAhaZ6.js");
9
+ const require_core_blocks_cap = require("../../core-blocks.cap-9xvotd_3.js");
10
+ const require_compile = require("../../compile-BpAtMSvc.js");
11
11
  const require_alert_episode = require("../../alert-episode-DaQ3prSe.js");
12
12
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
13
13
  const require_log_redactor = require("../../log-redactor-BhIEMaG9.js");
@@ -1,8 +1,8 @@
1
1
  import { b as EventCategory, p as createEvent, t as BaseAddon } from "../../base-addon-BcVoYZbC.mjs";
2
2
  import { Z as errMsg } from "../../scoped-settings-DVWUIP7Z.mjs";
3
3
  import { s as defineRecordKinds } from "../../record-kind-ub6NXqfh.mjs";
4
- import { n as CORE_BLOCK_ADDON_PREFIX } from "../../core-blocks.cap-CPgZRcpj.mjs";
5
- import { it as alertsCapability, rt as AlertSchema } from "../../compile-OBMHlqD-.mjs";
4
+ import { n as CORE_BLOCK_ADDON_PREFIX } from "../../core-blocks.cap-C6REo0Dd.mjs";
5
+ import { it as alertsCapability, rt as AlertSchema } from "../../compile-DPGk4aRg.mjs";
6
6
  import { a as isAlertEpisodeOpen, i as alertEpisodeRank, n as alertEpisodeId, r as alertEpisodePayload } from "../../alert-episode-D-1VUUkZ.mjs";
7
7
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
8
8
  import { a as redactLogText } from "../../log-redactor-XLDrPzOi.mjs";
@@ -0,0 +1,24 @@
1
+ import type { AppDeclaration, AppInfo, IAppSourceProvider } from "@camstack/types";
2
+ /** Per-source ceiling: one dead provider must not stall the shell's app list. */
3
+ export declare const APPS_PER_SOURCE_TIMEOUT_MS = 2500;
4
+ export interface AppsCaller {
5
+ readonly isAdmin: boolean;
6
+ }
7
+ export interface AppsLogger {
8
+ warn(message: string, context?: {
9
+ readonly meta?: Readonly<Record<string, unknown>>;
10
+ }): void;
11
+ }
12
+ export type AppSourceEntry = IAppSourceProvider & {
13
+ readonly id: string;
14
+ };
15
+ /**
16
+ * Merge every `app-source` provider into the caller's list (D1096): stamp the
17
+ * provider id, drop what the caller's role may not see, order by `order`.
18
+ * A provider that fails or times out is logged with its reason and answered
19
+ * from its last good snapshot (`lastGood`, owned by the caller) or skipped when
20
+ * it has none. The same app reported by several nodes (a collection registers
21
+ * one provider per node) is listed once, keyed on `(addonId, app.id)`, the
22
+ * first provider winning: the hub-local one precedes remote ones.
23
+ */
24
+ export declare function aggregateApps(sources: readonly AppSourceEntry[], caller: AppsCaller, logger: AppsLogger, lastGood?: Map<string, readonly AppDeclaration[]>): Promise<readonly AppInfo[]>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Apps Aggregator — hub-local builtin that owns the singleton `apps` cap (D1096).
3
+ *
4
+ * Walks every `app-source` (collection) provider, stamps each app with the
5
+ * provider's addon id and filters by the caller's role. The shell reads it; no
6
+ * app id is spelled anywhere else.
7
+ */
8
+ import { BaseAddon, type ProviderRegistration } from "@camstack/types";
9
+ export declare class AppsAggregatorAddon extends BaseAddon {
10
+ readonly id = "apps-aggregator";
11
+ /** Last good declarations per source, the fallback for a transient failure. */
12
+ private readonly lastGood;
13
+ constructor();
14
+ protected onInitialize(): Promise<ProviderRegistration[]>;
15
+ }
16
+ export default AppsAggregatorAddon;
@@ -0,0 +1,109 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ require("../../chunk-Cek0wNdY.js");
6
+ const require_base_addon = require("../../base-addon-BG7p06Hb.js");
7
+ const require_apps_cap = require("../../apps.cap-CLjgnuUe.js");
8
+ const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
9
+ //#region src/builtins/apps-aggregator/aggregate-apps.ts
10
+ /** Per-source ceiling: one dead provider must not stall the shell's app list. */
11
+ var APPS_PER_SOURCE_TIMEOUT_MS = 2500;
12
+ function offeredTo(app, caller) {
13
+ if (app.adminOnly && !caller.isAdmin) return false;
14
+ if (app.roles !== void 0 && !app.roles.includes(caller.isAdmin ? "admin" : "user")) return false;
15
+ return true;
16
+ }
17
+ function visibleNav(nav, caller) {
18
+ return nav.map((section) => ({
19
+ ...section,
20
+ items: section.items.filter((item) => caller.isAdmin || item.adminOnly !== true)
21
+ }));
22
+ }
23
+ /** Ordered apps first, ascending; an app with no `order` goes after them. */
24
+ function compareOrder(a, b) {
25
+ if (a === void 0) return b === void 0 ? 0 : 1;
26
+ if (b === void 0) return -1;
27
+ return a - b;
28
+ }
29
+ /**
30
+ * Merge every `app-source` provider into the caller's list (D1096): stamp the
31
+ * provider id, drop what the caller's role may not see, order by `order`.
32
+ * A provider that fails or times out is logged with its reason and answered
33
+ * from its last good snapshot (`lastGood`, owned by the caller) or skipped when
34
+ * it has none. The same app reported by several nodes (a collection registers
35
+ * one provider per node) is listed once, keyed on `(addonId, app.id)`, the
36
+ * first provider winning: the hub-local one precedes remote ones.
37
+ */
38
+ async function aggregateApps(sources, caller, logger, lastGood = /* @__PURE__ */ new Map()) {
39
+ const settled = await require_settle_sources.settleSourcesWithTimeout(sources.map((source) => [source.id, () => Promise.resolve(source.listApps())]), APPS_PER_SOURCE_TIMEOUT_MS);
40
+ const out = [];
41
+ const seen = /* @__PURE__ */ new Set();
42
+ const live = /* @__PURE__ */ new Set();
43
+ for (const [sourceId, result] of settled) {
44
+ live.add(sourceId);
45
+ let declared;
46
+ if (result.ok) {
47
+ declared = result.value;
48
+ lastGood.set(sourceId, declared);
49
+ } else {
50
+ logger.warn("app-source provider failed", { meta: {
51
+ sourceId,
52
+ error: result.error.message
53
+ } });
54
+ declared = lastGood.get(sourceId);
55
+ if (declared !== void 0) logger.warn("app-source serving its last good snapshot", { meta: {
56
+ sourceId,
57
+ apps: declared.length
58
+ } });
59
+ }
60
+ for (const app of declared ?? []) {
61
+ if (!offeredTo(app, caller)) continue;
62
+ const key = `${sourceId}::${app.id}`;
63
+ if (seen.has(key)) continue;
64
+ seen.add(key);
65
+ out.push({
66
+ addonId: sourceId,
67
+ app: {
68
+ ...app,
69
+ nav: visibleNav(app.nav, caller)
70
+ }
71
+ });
72
+ }
73
+ }
74
+ for (const cachedId of lastGood.keys()) if (!live.has(cachedId)) lastGood.delete(cachedId);
75
+ return out.sort((a, b) => compareOrder(a.app.order, b.app.order));
76
+ }
77
+ //#endregion
78
+ //#region src/builtins/apps-aggregator/apps-aggregator.addon.ts
79
+ /**
80
+ * Apps Aggregator — hub-local builtin that owns the singleton `apps` cap (D1096).
81
+ *
82
+ * Walks every `app-source` (collection) provider, stamps each app with the
83
+ * provider's addon id and filters by the caller's role. The shell reads it; no
84
+ * app id is spelled anywhere else.
85
+ */
86
+ var AppsAggregatorAddon = class extends require_base_addon.BaseAddon {
87
+ id = "apps-aggregator";
88
+ /** Last good declarations per source, the fallback for a transient failure. */
89
+ lastGood = /* @__PURE__ */ new Map();
90
+ constructor() {
91
+ super({});
92
+ }
93
+ async onInitialize() {
94
+ const provider = {
95
+ listApps: async (input) => {
96
+ return aggregateApps(this.capabilities?.getCollection("app-source") ?? [], input.caller, this.ctx.logger, this.lastGood);
97
+ },
98
+ getNavBadges: async () => ({})
99
+ };
100
+ this.ctx.logger.info("Initialized — aggregating app-source providers");
101
+ return [{
102
+ capability: require_apps_cap.appsCapability,
103
+ provider
104
+ }];
105
+ }
106
+ };
107
+ //#endregion
108
+ exports.AppsAggregatorAddon = AppsAggregatorAddon;
109
+ exports.default = AppsAggregatorAddon;
@@ -0,0 +1,103 @@
1
+ import { t as BaseAddon } from "../../base-addon-BcVoYZbC.mjs";
2
+ import { t as appsCapability } from "../../apps.cap-Bqb9NpYx.mjs";
3
+ import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
4
+ //#region src/builtins/apps-aggregator/aggregate-apps.ts
5
+ /** Per-source ceiling: one dead provider must not stall the shell's app list. */
6
+ var APPS_PER_SOURCE_TIMEOUT_MS = 2500;
7
+ function offeredTo(app, caller) {
8
+ if (app.adminOnly && !caller.isAdmin) return false;
9
+ if (app.roles !== void 0 && !app.roles.includes(caller.isAdmin ? "admin" : "user")) return false;
10
+ return true;
11
+ }
12
+ function visibleNav(nav, caller) {
13
+ return nav.map((section) => ({
14
+ ...section,
15
+ items: section.items.filter((item) => caller.isAdmin || item.adminOnly !== true)
16
+ }));
17
+ }
18
+ /** Ordered apps first, ascending; an app with no `order` goes after them. */
19
+ function compareOrder(a, b) {
20
+ if (a === void 0) return b === void 0 ? 0 : 1;
21
+ if (b === void 0) return -1;
22
+ return a - b;
23
+ }
24
+ /**
25
+ * Merge every `app-source` provider into the caller's list (D1096): stamp the
26
+ * provider id, drop what the caller's role may not see, order by `order`.
27
+ * A provider that fails or times out is logged with its reason and answered
28
+ * from its last good snapshot (`lastGood`, owned by the caller) or skipped when
29
+ * it has none. The same app reported by several nodes (a collection registers
30
+ * one provider per node) is listed once, keyed on `(addonId, app.id)`, the
31
+ * first provider winning: the hub-local one precedes remote ones.
32
+ */
33
+ async function aggregateApps(sources, caller, logger, lastGood = /* @__PURE__ */ new Map()) {
34
+ const settled = await settleSourcesWithTimeout(sources.map((source) => [source.id, () => Promise.resolve(source.listApps())]), APPS_PER_SOURCE_TIMEOUT_MS);
35
+ const out = [];
36
+ const seen = /* @__PURE__ */ new Set();
37
+ const live = /* @__PURE__ */ new Set();
38
+ for (const [sourceId, result] of settled) {
39
+ live.add(sourceId);
40
+ let declared;
41
+ if (result.ok) {
42
+ declared = result.value;
43
+ lastGood.set(sourceId, declared);
44
+ } else {
45
+ logger.warn("app-source provider failed", { meta: {
46
+ sourceId,
47
+ error: result.error.message
48
+ } });
49
+ declared = lastGood.get(sourceId);
50
+ if (declared !== void 0) logger.warn("app-source serving its last good snapshot", { meta: {
51
+ sourceId,
52
+ apps: declared.length
53
+ } });
54
+ }
55
+ for (const app of declared ?? []) {
56
+ if (!offeredTo(app, caller)) continue;
57
+ const key = `${sourceId}::${app.id}`;
58
+ if (seen.has(key)) continue;
59
+ seen.add(key);
60
+ out.push({
61
+ addonId: sourceId,
62
+ app: {
63
+ ...app,
64
+ nav: visibleNav(app.nav, caller)
65
+ }
66
+ });
67
+ }
68
+ }
69
+ for (const cachedId of lastGood.keys()) if (!live.has(cachedId)) lastGood.delete(cachedId);
70
+ return out.sort((a, b) => compareOrder(a.app.order, b.app.order));
71
+ }
72
+ //#endregion
73
+ //#region src/builtins/apps-aggregator/apps-aggregator.addon.ts
74
+ /**
75
+ * Apps Aggregator — hub-local builtin that owns the singleton `apps` cap (D1096).
76
+ *
77
+ * Walks every `app-source` (collection) provider, stamps each app with the
78
+ * provider's addon id and filters by the caller's role. The shell reads it; no
79
+ * app id is spelled anywhere else.
80
+ */
81
+ var AppsAggregatorAddon = class extends BaseAddon {
82
+ id = "apps-aggregator";
83
+ /** Last good declarations per source, the fallback for a transient failure. */
84
+ lastGood = /* @__PURE__ */ new Map();
85
+ constructor() {
86
+ super({});
87
+ }
88
+ async onInitialize() {
89
+ const provider = {
90
+ listApps: async (input) => {
91
+ return aggregateApps(this.capabilities?.getCollection("app-source") ?? [], input.caller, this.ctx.logger, this.lastGood);
92
+ },
93
+ getNavBadges: async () => ({})
94
+ };
95
+ this.ctx.logger.info("Initialized — aggregating app-source providers");
96
+ return [{
97
+ capability: appsCapability,
98
+ provider
99
+ }];
100
+ }
101
+ };
102
+ //#endregion
103
+ export { AppsAggregatorAddon, AppsAggregatorAddon as default };
@@ -0,0 +1 @@
1
+ export { AppsAggregatorAddon, default } from "./apps-aggregator.addon.js";
@@ -0,0 +1,8 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ require("../../chunk-Cek0wNdY.js");
6
+ const require_builtins_apps_aggregator_apps_aggregator_addon = require("./apps-aggregator.addon.js");
7
+ exports.AppsAggregatorAddon = require_builtins_apps_aggregator_apps_aggregator_addon.AppsAggregatorAddon;
8
+ exports.default = require_builtins_apps_aggregator_apps_aggregator_addon.AppsAggregatorAddon;
@@ -0,0 +1,2 @@
1
+ import { AppsAggregatorAddon } from "./apps-aggregator.addon.mjs";
2
+ export { AppsAggregatorAddon, AppsAggregatorAddon as default };