@dominevo/addon-media-library 0.1.14 → 0.1.16

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/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.16] - 2026-12-04
11
+
12
+ ### Changed
13
+
14
+ - Media opens as the addon's own app inside the Viewer (needs Viewer 0.1.44)
15
+ - The Media app now ships from the addon as a native plugin (full browse, details and player)
16
+
17
+ ## [0.1.15] - 2026-12-04
18
+
19
+ ### Changed
20
+
21
+ - The media plugin app is now offered to viewers as well as admins by default
22
+
10
23
  ## [0.1.14] - 2026-12-04
11
24
 
12
25
  ### Removed
@@ -8605,57 +8605,6 @@ var NOT_A_DEVICE = {
8605
8605
  INTERNAL: "internal plumbing between addons — never operator-facing"
8606
8606
  };
8607
8607
  //#endregion
8608
- //#region ../types/dist/esm/capabilities/address-role-source.cap.mjs
8609
- /**
8610
- * `address-role-source` — the connection kinds an addon needs of the hub's address
8611
- * palette (D1124). A collection cap, shaped like `retention-source` (D1084): each addon
8612
- * that wants its OWN kind of connection (media playback, a notification link, …)
8613
- * registers a provider and lists its declarations; the hub's collection fan-out
8614
- * concatenates the answers, so no central list has to be edited and `local-network`
8615
- * (which owns the palette and the operator's flags) hardcodes none.
8616
- *
8617
- * A declaration stores nothing. The operator's choice lives in `local-network`
8618
- * (`setDeclaredAddressRole`), validated against the same palette every fixed role uses
8619
- * (`HUB_ADDRESS_ROLES` stays the framework's own four). `default` says what the role
8620
- * resolves to while nothing is flagged: `follow: 'connection'` means "whatever the client
8621
- * is connected to" (the behaviour before the role existed), the others name a fixed role.
8622
- */
8623
- var AddressRoleCardinalitySchema = /* @__PURE__ */ _enum(["many", "single"]);
8624
- /** What an unflagged declared role resolves to. */
8625
- var AddressRoleFollowSchema = /* @__PURE__ */ _enum([
8626
- "connection",
8627
- "appConnections",
8628
- "publicEndpoint",
8629
- "internal"
8630
- ]);
8631
- var addressRoleSourceCapability = {
8632
- name: "address-role-source",
8633
- scope: "system",
8634
- mode: "collection",
8635
- internal: true,
8636
- methods: {
8637
- /** List the address roles this addon declares. */
8638
- listAddressRoles: /* @__PURE__ */ method(/* @__PURE__ */ _void(), /* @__PURE__ */ array(/* @__PURE__ */ object({
8639
- /** Stable id: `<addonId>:<kind>`. */
8640
- id: /* @__PURE__ */ string().min(1),
8641
- /** The addon that declares and consumes the role. */
8642
- owner: /* @__PURE__ */ string().min(1),
8643
- /** i18n key of the label (`addressRole.<owner>.<kind>`). */
8644
- labelKey: /* @__PURE__ */ string().min(1),
8645
- /** English fallback when the key has no translation. */
8646
- label: /* @__PURE__ */ string().min(1),
8647
- /** i18n key of the description. */
8648
- descriptionKey: /* @__PURE__ */ string().min(1).optional(),
8649
- /** English fallback of the description. */
8650
- description: /* @__PURE__ */ string().min(1).optional(),
8651
- /** `many`: a set of addresses the client races; `single`: at most one address carries it. */
8652
- cardinality: AddressRoleCardinalitySchema,
8653
- /** What the role resolves to while the operator has flagged nothing. */
8654
- default: /* @__PURE__ */ object({ follow: AddressRoleFollowSchema })
8655
- })).readonly(), { auth: "admin" }) },
8656
- vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
8657
- };
8658
- //#endregion
8659
8608
  //#region ../types/dist/esm/capabilities/app-source.cap.mjs
8660
8609
  /**
8661
8610
  * `app-source` — collection cap: every addon that offers an app in the viewer
@@ -8758,6 +8707,57 @@ var appSourceCapability = {
8758
8707
  })).readonly(), { auth: "admin" }) },
8759
8708
  vocabulary: { notOperatorFacing: NOT_A_DEVICE.UI_PLUMBING }
8760
8709
  };
8710
+ //#endregion
8711
+ //#region ../types/dist/esm/capabilities/address-role-source.cap.mjs
8712
+ /**
8713
+ * `address-role-source` — the connection kinds an addon needs of the hub's address
8714
+ * palette (D1124). A collection cap, shaped like `retention-source` (D1084): each addon
8715
+ * that wants its OWN kind of connection (media playback, a notification link, …)
8716
+ * registers a provider and lists its declarations; the hub's collection fan-out
8717
+ * concatenates the answers, so no central list has to be edited and `local-network`
8718
+ * (which owns the palette and the operator's flags) hardcodes none.
8719
+ *
8720
+ * A declaration stores nothing. The operator's choice lives in `local-network`
8721
+ * (`setDeclaredAddressRole`), validated against the same palette every fixed role uses
8722
+ * (`HUB_ADDRESS_ROLES` stays the framework's own four). `default` says what the role
8723
+ * resolves to while nothing is flagged: `follow: 'connection'` means "whatever the client
8724
+ * is connected to" (the behaviour before the role existed), the others name a fixed role.
8725
+ */
8726
+ var AddressRoleCardinalitySchema = /* @__PURE__ */ _enum(["many", "single"]);
8727
+ /** What an unflagged declared role resolves to. */
8728
+ var AddressRoleFollowSchema = /* @__PURE__ */ _enum([
8729
+ "connection",
8730
+ "appConnections",
8731
+ "publicEndpoint",
8732
+ "internal"
8733
+ ]);
8734
+ var addressRoleSourceCapability = {
8735
+ name: "address-role-source",
8736
+ scope: "system",
8737
+ mode: "collection",
8738
+ internal: true,
8739
+ methods: {
8740
+ /** List the address roles this addon declares. */
8741
+ listAddressRoles: /* @__PURE__ */ method(/* @__PURE__ */ _void(), /* @__PURE__ */ array(/* @__PURE__ */ object({
8742
+ /** Stable id: `<addonId>:<kind>`. */
8743
+ id: /* @__PURE__ */ string().min(1),
8744
+ /** The addon that declares and consumes the role. */
8745
+ owner: /* @__PURE__ */ string().min(1),
8746
+ /** i18n key of the label (`addressRole.<owner>.<kind>`). */
8747
+ labelKey: /* @__PURE__ */ string().min(1),
8748
+ /** English fallback when the key has no translation. */
8749
+ label: /* @__PURE__ */ string().min(1),
8750
+ /** i18n key of the description. */
8751
+ descriptionKey: /* @__PURE__ */ string().min(1).optional(),
8752
+ /** English fallback of the description. */
8753
+ description: /* @__PURE__ */ string().min(1).optional(),
8754
+ /** `many`: a set of addresses the client races; `single`: at most one address carries it. */
8755
+ cardinality: AddressRoleCardinalitySchema,
8756
+ /** What the role resolves to while the operator has flagged nothing. */
8757
+ default: /* @__PURE__ */ object({ follow: AddressRoleFollowSchema })
8758
+ })).readonly(), { auth: "admin" }) },
8759
+ vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
8760
+ };
8761
8761
  var MediaItemKindSchema = /* @__PURE__ */ _enum([
8762
8762
  "series",
8763
8763
  "movie",
@@ -8967,7 +8967,20 @@ var mediaLibraryCapability = {
8967
8967
  name: "media-library",
8968
8968
  scope: "system",
8969
8969
  mode: "singleton",
8970
- role: { feature: "media" },
8970
+ role: { feature: "media.library" },
8971
+ features: [{
8972
+ id: "media.library",
8973
+ app: "media",
8974
+ label: {
8975
+ key: "feature.media.library",
8976
+ fallback: "Media library"
8977
+ },
8978
+ description: {
8979
+ key: "feature.media.library.description",
8980
+ fallback: "Browse the media library."
8981
+ },
8982
+ defaultRoles: ["admin", "viewer"]
8983
+ }],
8971
8984
  methods: {
8972
8985
  /** Series, sorted by title. */
8973
8986
  listSeries: /* @__PURE__ */ method(PageInputSchema, MediaItemPageSchema, { caller: "required" }),
@@ -9080,7 +9093,8 @@ function customAction(input, output, options) {
9080
9093
  kind: options?.kind ?? "query",
9081
9094
  auth: options?.auth ?? "protected",
9082
9095
  scope: options?.scope ?? { kind: "system" },
9083
- ...options?.caller ? { caller: "required" } : {}
9096
+ ...options?.caller ? { caller: "required" } : {},
9097
+ ...options?.feature !== void 0 ? { feature: options.feature } : {}
9084
9098
  };
9085
9099
  }
9086
9100
  //#endregion
@@ -9118,7 +9132,13 @@ function readPluginVersion(packageDir) {
9118
9132
  //#endregion
9119
9133
  //#region src/app-source.ts
9120
9134
  var APP_ID = "media";
9121
- function buildApp() {
9135
+ /** The host API the plugin bundle is built against (`hostApi` of its `index.tsx`). */
9136
+ var PLUGIN_HOST_API = 2;
9137
+ /**
9138
+ * The Media app. `version` is the build's cache key (`readPluginVersion`); a checkout whose bundle is
9139
+ * not built (`null`) falls back to the viewer's native `/media` route, so the app is never absent.
9140
+ */
9141
+ function buildApp(version) {
9122
9142
  return {
9123
9143
  id: APP_ID,
9124
9144
  label: {
@@ -9129,36 +9149,10 @@ function buildApp() {
9129
9149
  kind: "image",
9130
9150
  asset: "assets/app-icon.svg"
9131
9151
  },
9132
- entry: {
9152
+ entry: version === null ? {
9133
9153
  kind: "native",
9134
9154
  route: "/media"
9135
- },
9136
- reach: { kind: "hub" },
9137
- adminOnly: false,
9138
- nav: [],
9139
- takesSharedSearch: false,
9140
- settings: null
9141
- };
9142
- }
9143
- var PLUGIN_APP_ID = "media-plugin";
9144
- /** The host API the plugin bundle is built against (`hostApi` of its `index.tsx`). */
9145
- var PLUGIN_HOST_API = 1;
9146
- /**
9147
- * The React Native plugin spike (planning#908), declared next to the native Media app and
9148
- * admin-only until phase 2 replaces it. `version` is the build's cache key (`readPluginVersion`).
9149
- */
9150
- function buildPluginApp(version) {
9151
- return {
9152
- id: PLUGIN_APP_ID,
9153
- label: {
9154
- key: "media-library:apps.mediaPlugin",
9155
- fallback: "Media (plugin)"
9156
- },
9157
- icon: {
9158
- kind: "image",
9159
- asset: "assets/app-icon.svg"
9160
- },
9161
- entry: {
9155
+ } : {
9162
9156
  kind: "rn-plugin",
9163
9157
  native: PLUGIN_NATIVE_ASSET,
9164
9158
  web: PLUGIN_WEB_ASSET,
@@ -9166,7 +9160,7 @@ function buildPluginApp(version) {
9166
9160
  version
9167
9161
  },
9168
9162
  reach: { kind: "hub" },
9169
- adminOnly: true,
9163
+ adminOnly: false,
9170
9164
  nav: [],
9171
9165
  takesSharedSearch: false,
9172
9166
  settings: null
@@ -15732,8 +15726,7 @@ var MediaLibraryAddon = class extends BaseAddon {
15732
15726
  scans.schedule(settings.rescanMinutes);
15733
15727
  scans.start("boot");
15734
15728
  const apps = { listApps: async () => {
15735
- const pluginVersion = readPluginVersion((0, node_path.join)(__dirname, ".."));
15736
- return pluginVersion === null ? [buildApp()] : [buildApp(), buildPluginApp(pluginVersion)];
15729
+ return [buildApp(readPluginVersion((0, node_path.join)(__dirname, "..")))];
15737
15730
  } };
15738
15731
  const addressRoles = { listAddressRoles: async () => buildAddressRoles() };
15739
15732
  logger.info("media-library initialized");
@@ -8601,57 +8601,6 @@ var NOT_A_DEVICE = {
8601
8601
  INTERNAL: "internal plumbing between addons — never operator-facing"
8602
8602
  };
8603
8603
  //#endregion
8604
- //#region ../types/dist/esm/capabilities/address-role-source.cap.mjs
8605
- /**
8606
- * `address-role-source` — the connection kinds an addon needs of the hub's address
8607
- * palette (D1124). A collection cap, shaped like `retention-source` (D1084): each addon
8608
- * that wants its OWN kind of connection (media playback, a notification link, …)
8609
- * registers a provider and lists its declarations; the hub's collection fan-out
8610
- * concatenates the answers, so no central list has to be edited and `local-network`
8611
- * (which owns the palette and the operator's flags) hardcodes none.
8612
- *
8613
- * A declaration stores nothing. The operator's choice lives in `local-network`
8614
- * (`setDeclaredAddressRole`), validated against the same palette every fixed role uses
8615
- * (`HUB_ADDRESS_ROLES` stays the framework's own four). `default` says what the role
8616
- * resolves to while nothing is flagged: `follow: 'connection'` means "whatever the client
8617
- * is connected to" (the behaviour before the role existed), the others name a fixed role.
8618
- */
8619
- var AddressRoleCardinalitySchema = /* @__PURE__ */ _enum(["many", "single"]);
8620
- /** What an unflagged declared role resolves to. */
8621
- var AddressRoleFollowSchema = /* @__PURE__ */ _enum([
8622
- "connection",
8623
- "appConnections",
8624
- "publicEndpoint",
8625
- "internal"
8626
- ]);
8627
- var addressRoleSourceCapability = {
8628
- name: "address-role-source",
8629
- scope: "system",
8630
- mode: "collection",
8631
- internal: true,
8632
- methods: {
8633
- /** List the address roles this addon declares. */
8634
- listAddressRoles: /* @__PURE__ */ method(/* @__PURE__ */ _void(), /* @__PURE__ */ array(/* @__PURE__ */ object({
8635
- /** Stable id: `<addonId>:<kind>`. */
8636
- id: /* @__PURE__ */ string().min(1),
8637
- /** The addon that declares and consumes the role. */
8638
- owner: /* @__PURE__ */ string().min(1),
8639
- /** i18n key of the label (`addressRole.<owner>.<kind>`). */
8640
- labelKey: /* @__PURE__ */ string().min(1),
8641
- /** English fallback when the key has no translation. */
8642
- label: /* @__PURE__ */ string().min(1),
8643
- /** i18n key of the description. */
8644
- descriptionKey: /* @__PURE__ */ string().min(1).optional(),
8645
- /** English fallback of the description. */
8646
- description: /* @__PURE__ */ string().min(1).optional(),
8647
- /** `many`: a set of addresses the client races; `single`: at most one address carries it. */
8648
- cardinality: AddressRoleCardinalitySchema,
8649
- /** What the role resolves to while the operator has flagged nothing. */
8650
- default: /* @__PURE__ */ object({ follow: AddressRoleFollowSchema })
8651
- })).readonly(), { auth: "admin" }) },
8652
- vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
8653
- };
8654
- //#endregion
8655
8604
  //#region ../types/dist/esm/capabilities/app-source.cap.mjs
8656
8605
  /**
8657
8606
  * `app-source` — collection cap: every addon that offers an app in the viewer
@@ -8754,6 +8703,57 @@ var appSourceCapability = {
8754
8703
  })).readonly(), { auth: "admin" }) },
8755
8704
  vocabulary: { notOperatorFacing: NOT_A_DEVICE.UI_PLUMBING }
8756
8705
  };
8706
+ //#endregion
8707
+ //#region ../types/dist/esm/capabilities/address-role-source.cap.mjs
8708
+ /**
8709
+ * `address-role-source` — the connection kinds an addon needs of the hub's address
8710
+ * palette (D1124). A collection cap, shaped like `retention-source` (D1084): each addon
8711
+ * that wants its OWN kind of connection (media playback, a notification link, …)
8712
+ * registers a provider and lists its declarations; the hub's collection fan-out
8713
+ * concatenates the answers, so no central list has to be edited and `local-network`
8714
+ * (which owns the palette and the operator's flags) hardcodes none.
8715
+ *
8716
+ * A declaration stores nothing. The operator's choice lives in `local-network`
8717
+ * (`setDeclaredAddressRole`), validated against the same palette every fixed role uses
8718
+ * (`HUB_ADDRESS_ROLES` stays the framework's own four). `default` says what the role
8719
+ * resolves to while nothing is flagged: `follow: 'connection'` means "whatever the client
8720
+ * is connected to" (the behaviour before the role existed), the others name a fixed role.
8721
+ */
8722
+ var AddressRoleCardinalitySchema = /* @__PURE__ */ _enum(["many", "single"]);
8723
+ /** What an unflagged declared role resolves to. */
8724
+ var AddressRoleFollowSchema = /* @__PURE__ */ _enum([
8725
+ "connection",
8726
+ "appConnections",
8727
+ "publicEndpoint",
8728
+ "internal"
8729
+ ]);
8730
+ var addressRoleSourceCapability = {
8731
+ name: "address-role-source",
8732
+ scope: "system",
8733
+ mode: "collection",
8734
+ internal: true,
8735
+ methods: {
8736
+ /** List the address roles this addon declares. */
8737
+ listAddressRoles: /* @__PURE__ */ method(/* @__PURE__ */ _void(), /* @__PURE__ */ array(/* @__PURE__ */ object({
8738
+ /** Stable id: `<addonId>:<kind>`. */
8739
+ id: /* @__PURE__ */ string().min(1),
8740
+ /** The addon that declares and consumes the role. */
8741
+ owner: /* @__PURE__ */ string().min(1),
8742
+ /** i18n key of the label (`addressRole.<owner>.<kind>`). */
8743
+ labelKey: /* @__PURE__ */ string().min(1),
8744
+ /** English fallback when the key has no translation. */
8745
+ label: /* @__PURE__ */ string().min(1),
8746
+ /** i18n key of the description. */
8747
+ descriptionKey: /* @__PURE__ */ string().min(1).optional(),
8748
+ /** English fallback of the description. */
8749
+ description: /* @__PURE__ */ string().min(1).optional(),
8750
+ /** `many`: a set of addresses the client races; `single`: at most one address carries it. */
8751
+ cardinality: AddressRoleCardinalitySchema,
8752
+ /** What the role resolves to while the operator has flagged nothing. */
8753
+ default: /* @__PURE__ */ object({ follow: AddressRoleFollowSchema })
8754
+ })).readonly(), { auth: "admin" }) },
8755
+ vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
8756
+ };
8757
8757
  var MediaItemKindSchema = /* @__PURE__ */ _enum([
8758
8758
  "series",
8759
8759
  "movie",
@@ -8963,7 +8963,20 @@ var mediaLibraryCapability = {
8963
8963
  name: "media-library",
8964
8964
  scope: "system",
8965
8965
  mode: "singleton",
8966
- role: { feature: "media" },
8966
+ role: { feature: "media.library" },
8967
+ features: [{
8968
+ id: "media.library",
8969
+ app: "media",
8970
+ label: {
8971
+ key: "feature.media.library",
8972
+ fallback: "Media library"
8973
+ },
8974
+ description: {
8975
+ key: "feature.media.library.description",
8976
+ fallback: "Browse the media library."
8977
+ },
8978
+ defaultRoles: ["admin", "viewer"]
8979
+ }],
8967
8980
  methods: {
8968
8981
  /** Series, sorted by title. */
8969
8982
  listSeries: /* @__PURE__ */ method(PageInputSchema, MediaItemPageSchema, { caller: "required" }),
@@ -9076,7 +9089,8 @@ function customAction(input, output, options) {
9076
9089
  kind: options?.kind ?? "query",
9077
9090
  auth: options?.auth ?? "protected",
9078
9091
  scope: options?.scope ?? { kind: "system" },
9079
- ...options?.caller ? { caller: "required" } : {}
9092
+ ...options?.caller ? { caller: "required" } : {},
9093
+ ...options?.feature !== void 0 ? { feature: options.feature } : {}
9080
9094
  };
9081
9095
  }
9082
9096
  //#endregion
@@ -9114,7 +9128,13 @@ function readPluginVersion(packageDir) {
9114
9128
  //#endregion
9115
9129
  //#region src/app-source.ts
9116
9130
  var APP_ID = "media";
9117
- function buildApp() {
9131
+ /** The host API the plugin bundle is built against (`hostApi` of its `index.tsx`). */
9132
+ var PLUGIN_HOST_API = 2;
9133
+ /**
9134
+ * The Media app. `version` is the build's cache key (`readPluginVersion`); a checkout whose bundle is
9135
+ * not built (`null`) falls back to the viewer's native `/media` route, so the app is never absent.
9136
+ */
9137
+ function buildApp(version) {
9118
9138
  return {
9119
9139
  id: APP_ID,
9120
9140
  label: {
@@ -9125,36 +9145,10 @@ function buildApp() {
9125
9145
  kind: "image",
9126
9146
  asset: "assets/app-icon.svg"
9127
9147
  },
9128
- entry: {
9148
+ entry: version === null ? {
9129
9149
  kind: "native",
9130
9150
  route: "/media"
9131
- },
9132
- reach: { kind: "hub" },
9133
- adminOnly: false,
9134
- nav: [],
9135
- takesSharedSearch: false,
9136
- settings: null
9137
- };
9138
- }
9139
- var PLUGIN_APP_ID = "media-plugin";
9140
- /** The host API the plugin bundle is built against (`hostApi` of its `index.tsx`). */
9141
- var PLUGIN_HOST_API = 1;
9142
- /**
9143
- * The React Native plugin spike (planning#908), declared next to the native Media app and
9144
- * admin-only until phase 2 replaces it. `version` is the build's cache key (`readPluginVersion`).
9145
- */
9146
- function buildPluginApp(version) {
9147
- return {
9148
- id: PLUGIN_APP_ID,
9149
- label: {
9150
- key: "media-library:apps.mediaPlugin",
9151
- fallback: "Media (plugin)"
9152
- },
9153
- icon: {
9154
- kind: "image",
9155
- asset: "assets/app-icon.svg"
9156
- },
9157
- entry: {
9151
+ } : {
9158
9152
  kind: "rn-plugin",
9159
9153
  native: PLUGIN_NATIVE_ASSET,
9160
9154
  web: PLUGIN_WEB_ASSET,
@@ -9162,7 +9156,7 @@ function buildPluginApp(version) {
9162
9156
  version
9163
9157
  },
9164
9158
  reach: { kind: "hub" },
9165
- adminOnly: true,
9159
+ adminOnly: false,
9166
9160
  nav: [],
9167
9161
  takesSharedSearch: false,
9168
9162
  settings: null
@@ -15728,8 +15722,7 @@ var MediaLibraryAddon = class extends BaseAddon {
15728
15722
  scans.schedule(settings.rescanMinutes);
15729
15723
  scans.start("boot");
15730
15724
  const apps = { listApps: async () => {
15731
- const pluginVersion = readPluginVersion(join(__dirname, ".."));
15732
- return pluginVersion === null ? [buildApp()] : [buildApp(), buildPluginApp(pluginVersion)];
15725
+ return [buildApp(readPluginVersion(join(__dirname, "..")))];
15733
15726
  } };
15734
15727
  const addressRoles = { listAddressRoles: async () => buildAddressRoles() };
15735
15728
  logger.info("media-library initialized");