@companion-module/base 2.1.3 → 2.2.0-nightly-main-20260902-210244-eaa0afd

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2026 Bitfocus AS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -19,7 +19,9 @@ Each version of Companion supports a limited range of versions of this library l
19
19
  | v4.0 | v1.0 - v1.12 |
20
20
  | v4.1 | v1.0 - v1.13 |
21
21
  | v4.2 | v1.0 - v1.14 |
22
- | v4.3 | v1.0 - v2.0 (unconfirmed) |
22
+ | v4.3 | v1.0 - v2.0 |
23
+ | v5.0 | v1.0 - v2.1 |
24
+ | v5.1 | v1.0 - v2.2 (unconfirmed) |
23
25
 
24
26
  ## Getting started with a new module
25
27
 
@@ -1,172 +1,62 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "type": "object",
3
+ "$id": "/assets/manifest.schema.json",
4
4
  "title": "ModuleManifest",
5
+ "type": "object",
5
6
  "properties": {
6
- "$schema": {
7
- "type": "string"
8
- },
9
- "type": {
10
- "type": "string",
11
- "enum": ["connection"],
12
- "description": "Type of module. Must be: connection"
13
- },
7
+ "$schema": { "type": "string" },
8
+ "type": { "type": "string", "enum": ["connection"], "description": "Type of module. Must be: connection" },
14
9
  "id": {
15
10
  "type": "string",
11
+ "pattern": "^((?!companion-module-your-module-name)[\\s\\S])*$",
16
12
  "description": "Unique identifier for the module"
17
13
  },
18
14
  "name": {
19
15
  "type": "string",
16
+ "pattern": "^((?!companion-module-your-module-name)[\\s\\S])*$",
20
17
  "description": "Name of the module"
21
18
  },
22
- "shortname": {
23
- "type": "string"
24
- },
19
+ "shortname": { "type": "string", "pattern": "^((?!module-shortname)[\\s\\S])*$" },
25
20
  "description": {
26
21
  "type": "string",
27
- "description": "Description of the module "
28
- },
29
- "version": {
30
- "type": "string",
31
- "description": "Current version of the module"
32
- },
33
- "isPrerelease": {
34
- "type": "boolean",
35
- "description": "Is this a pre-release version"
36
- },
37
- "license": {
38
- "type": "string",
39
- "description": "SPDX identifier for license of the module"
40
- },
41
- "repository": {
42
- "type": "string",
43
- "description": "URL to the source repository"
44
- },
45
- "bugs": {
46
- "type": "string",
47
- "description": "URL to bug tracker"
48
- },
22
+ "pattern": "^((?!A short one line description of your module)[\\s\\S])*$",
23
+ "description": "Description of the module"
24
+ },
25
+ "version": { "type": "string", "description": "Current version of the module" },
26
+ "isPrerelease": { "description": "Is this a pre-release version", "type": "boolean" },
27
+ "license": { "type": "string", "description": "SPDX identifier for license of the module" },
28
+ "repository": { "type": "string", "description": "URL to the source repository" },
29
+ "bugs": { "type": "string", "description": "URL to bug tracker" },
49
30
  "maintainers": {
50
31
  "type": "array",
51
- "description": "List of active maintainers",
32
+ "items": { "$ref": "#/$defs/ModuleManifestMaintainer" },
52
33
  "uniqueItems": true,
53
- "items": {
54
- "type": "object",
55
- "title": "ModuleManifestMaintainer",
56
- "properties": {
57
- "name": {
58
- "type": "string"
59
- },
60
- "email": {
61
- "type": "string"
62
- },
63
- "github": {
64
- "type": "string"
65
- },
66
- "url": {
67
- "type": "string"
68
- }
69
- },
70
- "required": ["name"],
71
- "additionalProperties": false
72
- }
34
+ "description": "List of active maintainers"
73
35
  },
74
36
  "legacyIds": {
75
37
  "type": "array",
76
- "description": "If the module had a different unique identifier previously, then specify it here",
38
+ "items": { "type": "string" },
77
39
  "uniqueItems": true,
78
- "items": {
79
- "type": "string"
80
- }
81
- },
82
- "runtime": {
83
- "type": "object",
84
- "title": "ModuleManifestRuntime",
85
- "description": "Information on how to execute the module",
86
- "properties": {
87
- "type": {
88
- "type": "string",
89
- "description": "Type of the module. Must be: node22 or node26",
90
- "enum": ["node22", "node26"]
91
- },
92
- "api": {
93
- "type": "string",
94
- "description": "Which host-api does it use. In the future alternate options will be allowed",
95
- "enum": ["nodejs-ipc"]
96
- },
97
- "apiVersion": {
98
- "type": "string",
99
- "description": "The version of the host-api used"
100
- },
101
- "entrypoint": {
102
- "type": "string",
103
- "description": "Entrypoint to pass to the runtime. eg index.js"
104
- },
105
- "permissions": {
106
- "type": "object",
107
- "description": "Permissions required by the module. This is used to inform the user of the permissions required by the module.",
108
- "properties": {
109
- "worker-threads": {
110
- "type": "boolean",
111
- "description": "Enable if the module uses worker threads"
112
- },
113
- "child-process": {
114
- "type": "boolean",
115
- "description": "Enable if the module uses child processes"
116
- },
117
- "native-addons": {
118
- "type": "boolean",
119
- "description": "Enable if the module uses native addons"
120
- },
121
- "filesystem": {
122
- "type": "boolean",
123
- "description": "Enable if the module requires read/write access to the filesystem"
124
- },
125
- "insecure-algorithms": {
126
- "type": "boolean",
127
- "description": "Enable if the module requires legacy openssl algorithms"
128
- }
129
- },
130
- "additionalProperties": false
131
- }
132
- },
133
- "required": ["type", "api", "apiVersion", "entrypoint"]
134
- },
135
- "manufacturer": {
136
- "type": "string"
40
+ "description": "If the module had a different unique identifier previously, then specify it here"
137
41
  },
42
+ "runtime": { "$ref": "#/$defs/ModuleManifestRuntime" },
43
+ "manufacturer": { "type": "string", "pattern": "^((?!Your company)[\\s\\S])*$" },
138
44
  "products": {
45
+ "minItems": 1,
139
46
  "type": "array",
140
- "uniqueItems": true,
141
- "items": {
142
- "type": "string"
143
- },
144
- "minItems": 1
145
- },
146
- "keywords": {
147
- "type": "array",
148
- "uniqueItems": true,
149
- "items": {
150
- "type": "string"
151
- }
47
+ "items": { "type": "string", "pattern": "^((?!Your product)[\\s\\S])*$" },
48
+ "uniqueItems": true
152
49
  },
50
+ "keywords": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
153
51
  "bonjourQueries": {
154
- "type": "object",
155
52
  "description": "If the device or software for your module supports bonjour announcements, Companion will offer an easy way to watch for these announcements.\nEach query you define must have a matching config field of type 'bonjour-device' with the same name",
156
- "patternProperties": {
157
- "": {
158
- "oneOf": [
159
- {
160
- "$ref": "#/$defs/bonjourQuery"
161
- },
162
- {
163
- "type": "array",
164
- "items": {
165
- "$ref": "#/$defs/bonjourQuery"
166
- }
167
- }
168
- ]
169
- }
53
+ "type": "object",
54
+ "propertyNames": { "type": "string" },
55
+ "additionalProperties": {
56
+ "anyOf": [
57
+ { "$ref": "#/$defs/ModuleBonjourQuery" },
58
+ { "type": "array", "items": { "$ref": "#/$defs/ModuleBonjourQuery" } }
59
+ ]
170
60
  }
171
61
  }
172
62
  },
@@ -188,37 +78,74 @@
188
78
  "keywords"
189
79
  ],
190
80
  "$defs": {
191
- "bonjourQuery": {
81
+ "ModuleManifestMaintainer": {
82
+ "type": "object",
83
+ "properties": {
84
+ "name": { "type": "string", "pattern": "^((?!Your name)[\\s\\S])*$" },
85
+ "email": { "type": "string", "pattern": "^((?!Your email)[\\s\\S])*$" },
86
+ "github": { "type": "string" },
87
+ "url": { "type": "string" }
88
+ },
89
+ "required": ["name"],
90
+ "title": "ModuleManifestMaintainer"
91
+ },
92
+ "ModuleManifestRuntime": {
192
93
  "type": "object",
193
- "title": "ModuleBonjourQuery",
194
- "description": "",
195
94
  "properties": {
196
95
  "type": {
197
- "type": "string"
198
- },
199
- "protocol": {
200
96
  "type": "string",
201
- "enum": ["tcp", "udp"]
97
+ "enum": ["node22", "node26"],
98
+ "description": "Type of the module. Must be: node22 or node26"
202
99
  },
203
- "port": {
204
- "type": "number"
100
+ "api": {
101
+ "type": "string",
102
+ "enum": ["nodejs-ipc"],
103
+ "description": "Which host-api does it use. In the future alternate options will be allowed"
205
104
  },
206
- "txt": {
105
+ "apiVersion": { "type": "string", "description": "The version of the host-api used" },
106
+ "entrypoint": { "type": "string", "description": "Entrypoint to pass to the runtime. eg index.js" },
107
+ "permissions": {
207
108
  "type": "object",
208
- "description": "Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported",
209
- "patternProperties": {
210
- "": {
211
- "type": "string"
109
+ "properties": {
110
+ "worker-threads": { "description": "Enable if the module uses worker threads", "type": "boolean" },
111
+ "child-process": { "description": "Enable if the module uses child processes", "type": "boolean" },
112
+ "native-addons": { "description": "Enable if the module uses native addons", "type": "boolean" },
113
+ "filesystem": {
114
+ "description": "Enable if the module requires read/write access to the filesystem",
115
+ "type": "boolean"
116
+ },
117
+ "insecure-algorithms": {
118
+ "description": "Enable if the module requires legacy openssl algorithms",
119
+ "type": "boolean"
212
120
  }
213
- }
121
+ },
122
+ "description": "Permissions required by the module. This is used to inform the user of the permissions required by the module."
123
+ }
124
+ },
125
+ "required": ["type", "api", "apiVersion", "entrypoint"],
126
+ "description": "Information on how to execute the module",
127
+ "title": "ModuleManifestRuntime"
128
+ },
129
+ "ModuleBonjourQuery": {
130
+ "type": "object",
131
+ "properties": {
132
+ "type": { "type": "string" },
133
+ "protocol": { "type": "string", "enum": ["tcp", "udp"] },
134
+ "port": { "type": "number" },
135
+ "txt": {
136
+ "description": "Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported",
137
+ "type": "object",
138
+ "propertyNames": { "type": "string" },
139
+ "additionalProperties": { "type": "string" }
214
140
  },
215
141
  "addressFamily": {
216
- "type": "string",
217
142
  "description": "The address family to use when connecting to the device. If not specified, it will default to ipv4. This is useful for devices or modules that do not support ipv4 and ipv6, but discovery will find them on both",
143
+ "type": "string",
218
144
  "enum": ["ipv4", "ipv6", "ipv4+6"]
219
145
  }
220
146
  },
221
- "required": ["type", "protocol"]
147
+ "required": ["type", "protocol"],
148
+ "title": "ModuleBonjourQuery"
222
149
  }
223
150
  }
224
151
  }
@@ -1 +1 @@
1
- {"version":3,"file":"osc.d.ts","sourceRoot":"","sources":["../../src/common/osc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;AACtD,MAAM,MAAM,eAAe,GACxB;IAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,CAAA"}
1
+ {"version":3,"file":"osc.d.ts","sourceRoot":"","sources":["../../src/common/osc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;AACtD,MAAM,MAAM,eAAe,GAC1B;IAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,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;YACxC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACnC,CAAC;QAED,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,GAAG,EAAE;YACtC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAA;YAEhC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;YAE3C,IAAI,CAAC,OAAO,EAAE,CAAA;QACf,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED,mBAAmB;IACnB,WAAW,CAAC,MAAmB,EAAE,OAAgB;QAChD,IAAI,IAAI,CAAC,WAAW,IAAI,MAAM,EAAE,CAAC;YAChC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAC5C,CAAC;IACF,CAAC;CACD"}
@@ -0,0 +1,123 @@
1
+ import z from 'zod';
2
+ declare const runtimeSchema: z.ZodObject<{
3
+ type: z.ZodEnum<{
4
+ node22: "node22";
5
+ node26: "node26";
6
+ }>;
7
+ api: z.ZodEnum<{
8
+ "nodejs-ipc": "nodejs-ipc";
9
+ }>;
10
+ apiVersion: z.ZodString;
11
+ entrypoint: z.ZodString;
12
+ permissions: z.ZodOptional<z.ZodObject<{
13
+ 'worker-threads': z.ZodOptional<z.ZodBoolean>;
14
+ 'child-process': z.ZodOptional<z.ZodBoolean>;
15
+ 'native-addons': z.ZodOptional<z.ZodBoolean>;
16
+ filesystem: z.ZodOptional<z.ZodBoolean>;
17
+ 'insecure-algorithms': z.ZodOptional<z.ZodBoolean>;
18
+ }, z.z.core.$strip>>;
19
+ }, z.z.core.$strip>;
20
+ declare const bonjourQuerySchema: z.ZodObject<{
21
+ type: z.ZodString;
22
+ protocol: z.ZodEnum<{
23
+ tcp: "tcp";
24
+ udp: "udp";
25
+ }>;
26
+ port: z.ZodOptional<z.ZodNumber>;
27
+ txt: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
28
+ addressFamily: z.ZodOptional<z.ZodEnum<{
29
+ ipv4: "ipv4";
30
+ ipv6: "ipv6";
31
+ "ipv4+6": "ipv4+6";
32
+ }>>;
33
+ }, z.z.core.$strip>;
34
+ /** Build the maintainer sub-schema for the given strictness. */
35
+ declare function buildMaintainerSchema(strict: boolean): z.ZodObject<{
36
+ name: z.ZodString;
37
+ email: z.ZodOptional<z.ZodString>;
38
+ github: z.ZodOptional<z.ZodString>;
39
+ url: z.ZodOptional<z.ZodString>;
40
+ }, z.z.core.$strip>;
41
+ declare function buildManifestSchemaObject(strict: boolean): z.ZodObject<{
42
+ $schema: z.ZodOptional<z.ZodString>;
43
+ type: z.ZodEnum<{
44
+ connection: "connection";
45
+ }>;
46
+ id: z.ZodString;
47
+ name: z.ZodString;
48
+ shortname: z.ZodString;
49
+ description: z.ZodString;
50
+ version: z.ZodString;
51
+ isPrerelease: z.ZodOptional<z.ZodBoolean>;
52
+ license: z.ZodString;
53
+ repository: z.ZodString;
54
+ bugs: z.ZodString;
55
+ maintainers: z.ZodArray<z.ZodObject<{
56
+ name: z.ZodString;
57
+ email: z.ZodOptional<z.ZodString>;
58
+ github: z.ZodOptional<z.ZodString>;
59
+ url: z.ZodOptional<z.ZodString>;
60
+ }, z.z.core.$strip>>;
61
+ legacyIds: z.ZodArray<z.ZodString>;
62
+ runtime: z.ZodObject<{
63
+ type: z.ZodEnum<{
64
+ node22: "node22";
65
+ node26: "node26";
66
+ }>;
67
+ api: z.ZodEnum<{
68
+ "nodejs-ipc": "nodejs-ipc";
69
+ }>;
70
+ apiVersion: z.ZodString;
71
+ entrypoint: z.ZodString;
72
+ permissions: z.ZodOptional<z.ZodObject<{
73
+ 'worker-threads': z.ZodOptional<z.ZodBoolean>;
74
+ 'child-process': z.ZodOptional<z.ZodBoolean>;
75
+ 'native-addons': z.ZodOptional<z.ZodBoolean>;
76
+ filesystem: z.ZodOptional<z.ZodBoolean>;
77
+ 'insecure-algorithms': z.ZodOptional<z.ZodBoolean>;
78
+ }, z.z.core.$strip>>;
79
+ }, z.z.core.$strip>;
80
+ manufacturer: z.ZodString;
81
+ products: z.ZodArray<z.ZodString>;
82
+ keywords: z.ZodArray<z.ZodString>;
83
+ bonjourQueries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
84
+ type: z.ZodString;
85
+ protocol: z.ZodEnum<{
86
+ tcp: "tcp";
87
+ udp: "udp";
88
+ }>;
89
+ port: z.ZodOptional<z.ZodNumber>;
90
+ txt: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
91
+ addressFamily: z.ZodOptional<z.ZodEnum<{
92
+ ipv4: "ipv4";
93
+ ipv6: "ipv6";
94
+ "ipv4+6": "ipv4+6";
95
+ }>>;
96
+ }, z.z.core.$strip>, z.ZodArray<z.ZodObject<{
97
+ type: z.ZodString;
98
+ protocol: z.ZodEnum<{
99
+ tcp: "tcp";
100
+ udp: "udp";
101
+ }>;
102
+ port: z.ZodOptional<z.ZodNumber>;
103
+ txt: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
104
+ addressFamily: z.ZodOptional<z.ZodEnum<{
105
+ ipv4: "ipv4";
106
+ ipv6: "ipv6";
107
+ "ipv4+6": "ipv4+6";
108
+ }>>;
109
+ }, z.z.core.$strip>>]>>>;
110
+ }, z.z.core.$strip>;
111
+ export type ModuleManifest = z.infer<ReturnType<typeof buildManifestSchemaObject>>;
112
+ export type ModuleManifestMaintainer = z.infer<ReturnType<typeof buildMaintainerSchema>>;
113
+ export type ModuleManifestRuntime = z.infer<typeof runtimeSchema>;
114
+ export type ModuleBonjourQuery = z.infer<typeof bonjourQuerySchema>;
115
+ /**
116
+ * Build the complete manifest schema.
117
+ *
118
+ * @param strict when `true`, additionally reject leftover module-template
119
+ * placeholder values (eg `Your company`, `companion-module-your-module-name`).
120
+ */
121
+ export declare function buildManifestSchema(strict: boolean): z.ZodType<ModuleManifest>;
122
+ export {};
123
+ //# sourceMappingURL=manifest-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-schema.d.ts","sourceRoot":"","sources":["../src/manifest-schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AA+EnB,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;mBASoD,CAAA;AAEvE,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;mBAkByC,CAAA;AAIjE,gEAAgE;AAChE,iBAAS,qBAAqB,CAAC,MAAM,EAAE,OAAO;;;;;oBAS7C;AAED,iBAAS,yBAAyB,CAAC,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkCjD;AAMD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAA;AAClF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAA;AACxF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACjE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAE9E"}
@@ -0,0 +1,145 @@
1
+ import z from 'zod';
2
+ /**
3
+ * Single source of truth for the module manifest schema.
4
+ *
5
+ * The manifest is validated in two modes:
6
+ * - `loose` – structural validation only. Used while a module is still being
7
+ * developed and may still contain template placeholder values.
8
+ * - `strict` – structural validation plus checks that the module has been
9
+ * filled in properly (ie no leftover template placeholders).
10
+ *
11
+ * Both modes are produced from the exact same code by the generator functions
12
+ * below, so there is only ever one description of the manifest to maintain. The
13
+ * generated JSON schema (`assets/manifest.schema.json`) and the TypeScript types
14
+ * are both derived from these definitions too.
15
+ */
16
+ /** Escape a string so it can be embedded literally into a `RegExp` source. */
17
+ function escapeRegExp(value) {
18
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
19
+ }
20
+ /**
21
+ * In strict mode, forbid a string field from containing one of the module
22
+ * template's placeholder values.
23
+ *
24
+ * The constraint is expressed as a regex (rather than a `.refine()`) so that it
25
+ * is carried through into the generated JSON schema as a `pattern`, and is
26
+ * therefore surfaced by editors as well as enforced at runtime. In loose mode
27
+ * the field is left untouched.
28
+ */
29
+ function forbidPlaceholder(base, placeholder, strict) {
30
+ if (!strict)
31
+ return base;
32
+ // Matches any string that does NOT contain `placeholder` anywhere ([\s\S] so
33
+ // that newlines in eg a description are covered too).
34
+ const pattern = new RegExp(`^((?!${escapeRegExp(placeholder)})[\\s\\S])*$`);
35
+ return base.regex(pattern, `must not contain the module template placeholder ${JSON.stringify(placeholder)}`);
36
+ }
37
+ /** True if `arr` contains two items that are deeply equal. */
38
+ function hasDuplicates(arr) {
39
+ const seen = new Set();
40
+ for (const item of arr) {
41
+ const key = typeof item === 'string' ? item : JSON.stringify(item, Object.keys(item).sort());
42
+ if (seen.has(key))
43
+ return true;
44
+ seen.add(key);
45
+ }
46
+ return false;
47
+ }
48
+ /**
49
+ * An array whose items must be unique. `uniqueItems` is attached to the JSON
50
+ * schema output, and the same constraint is enforced at runtime.
51
+ */
52
+ function uniqueArray(item, opts = {}) {
53
+ let arr = z.array(item);
54
+ if (opts.min !== undefined)
55
+ arr = arr.min(opts.min);
56
+ return arr
57
+ .refine((value) => !hasDuplicates(value), { error: 'must not contain duplicate items' })
58
+ .meta({
59
+ uniqueItems: true,
60
+ });
61
+ }
62
+ // ── Sub-schemas that do not depend on the strict/loose mode ────────────────────
63
+ const permissionsSchema = z
64
+ .object({
65
+ 'worker-threads': z.boolean().optional().describe('Enable if the module uses worker threads'),
66
+ 'child-process': z.boolean().optional().describe('Enable if the module uses child processes'),
67
+ 'native-addons': z.boolean().optional().describe('Enable if the module uses native addons'),
68
+ filesystem: z.boolean().optional().describe('Enable if the module requires read/write access to the filesystem'),
69
+ 'insecure-algorithms': z.boolean().optional().describe('Enable if the module requires legacy openssl algorithms'),
70
+ })
71
+ .describe('Permissions required by the module. This is used to inform the user of the permissions required by the module.');
72
+ const runtimeSchema = z
73
+ .object({
74
+ type: z.enum(['node22', 'node26']).describe('Type of the module. Must be: node22 or node26'),
75
+ api: z.enum(['nodejs-ipc']).describe('Which host-api does it use. In the future alternate options will be allowed'),
76
+ apiVersion: z.string().describe('The version of the host-api used'),
77
+ entrypoint: z.string().describe('Entrypoint to pass to the runtime. eg index.js'),
78
+ permissions: permissionsSchema.optional(),
79
+ })
80
+ .describe('Information on how to execute the module')
81
+ .meta({ id: 'ModuleManifestRuntime', title: 'ModuleManifestRuntime' });
82
+ const bonjourQuerySchema = z
83
+ .object({
84
+ type: z.string(),
85
+ protocol: z.enum(['tcp', 'udp']),
86
+ port: z.number().optional(),
87
+ txt: z
88
+ .record(z.string(), z.string())
89
+ .optional()
90
+ .describe("Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported"),
91
+ addressFamily: z
92
+ .enum(['ipv4', 'ipv6', 'ipv4+6'])
93
+ .optional()
94
+ .describe('The address family to use when connecting to the device. If not specified, it will default to ipv4. This is useful for devices or modules that do not support ipv4 and ipv6, but discovery will find them on both'),
95
+ })
96
+ .meta({ id: 'ModuleBonjourQuery', title: 'ModuleBonjourQuery' });
97
+ // ── Mode-dependent generators ──────────────────────────────────────────────────
98
+ /** Build the maintainer sub-schema for the given strictness. */
99
+ function buildMaintainerSchema(strict) {
100
+ return z
101
+ .object({
102
+ name: forbidPlaceholder(z.string(), 'Your name', strict),
103
+ email: forbidPlaceholder(z.string(), 'Your email', strict).optional(),
104
+ github: z.string().optional(),
105
+ url: z.string().optional(),
106
+ })
107
+ .meta({ id: 'ModuleManifestMaintainer', title: 'ModuleManifestMaintainer' });
108
+ }
109
+ function buildManifestSchemaObject(strict) {
110
+ return z
111
+ .object({
112
+ $schema: z.string().optional(),
113
+ type: z.enum(['connection']).describe('Type of module. Must be: connection'),
114
+ id: forbidPlaceholder(z.string(), 'companion-module-your-module-name', strict).describe('Unique identifier for the module'),
115
+ name: forbidPlaceholder(z.string(), 'companion-module-your-module-name', strict).describe('Name of the module'),
116
+ shortname: forbidPlaceholder(z.string(), 'module-shortname', strict),
117
+ description: forbidPlaceholder(z.string(), 'A short one line description of your module', strict).describe('Description of the module'),
118
+ version: z.string().describe('Current version of the module'),
119
+ isPrerelease: z.boolean().optional().describe('Is this a pre-release version'),
120
+ license: z.string().describe('SPDX identifier for license of the module'),
121
+ repository: z.string().describe('URL to the source repository'),
122
+ bugs: z.string().describe('URL to bug tracker'),
123
+ maintainers: uniqueArray(buildMaintainerSchema(strict)).describe('List of active maintainers'),
124
+ legacyIds: uniqueArray(z.string()).describe('If the module had a different unique identifier previously, then specify it here'),
125
+ runtime: runtimeSchema,
126
+ manufacturer: forbidPlaceholder(z.string(), 'Your company', strict),
127
+ products: uniqueArray(forbidPlaceholder(z.string(), 'Your product', strict), { min: 1 }),
128
+ keywords: uniqueArray(z.string()),
129
+ bonjourQueries: z
130
+ .record(z.string(), z.union([bonjourQuerySchema, z.array(bonjourQuerySchema)]))
131
+ .optional()
132
+ .describe("If the device or software for your module supports bonjour announcements, Companion will offer an easy way to watch for these announcements.\nEach query you define must have a matching config field of type 'bonjour-device' with the same name"),
133
+ })
134
+ .meta({ id: 'ModuleManifest', title: 'ModuleManifest' });
135
+ }
136
+ /**
137
+ * Build the complete manifest schema.
138
+ *
139
+ * @param strict when `true`, additionally reject leftover module-template
140
+ * placeholder values (eg `Your company`, `companion-module-your-module-name`).
141
+ */
142
+ export function buildManifestSchema(strict) {
143
+ return buildManifestSchemaObject(strict);
144
+ }
145
+ //# sourceMappingURL=manifest-schema.js.map