@camstack/types 1.2.437 → 1.2.438
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 +8 -0
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/index.d.ts +3 -1
- package/dist/capabilities/ir-transmitter.cap.d.ts +84 -0
- package/dist/capabilities/pet-feeder.cap.d.ts +12 -0
- package/dist/client.js +5 -0
- package/dist/client.mjs +5 -0
- package/dist/{composition-WNkEpwkF.js → composition-DCmtFE-X.js} +1 -1
- package/dist/{composition-DwA0uVW5.mjs → composition-DpFv_J6D.mjs} +1 -1
- package/dist/device/cap-vocabulary/entries/actuators.d.ts +1 -1
- package/dist/device/device-type.d.ts +4 -1
- package/dist/{err-msg-DIorGYeC.mjs → err-msg-BCdlR2Li.mjs} +3 -0
- package/dist/{err-msg-U7lLUMNz.js → err-msg-COHgq7Mb.js} +3 -0
- package/dist/generated/addon-api.d.ts +22 -0
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/device-proxy.d.ts +2 -0
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +308 -5
- package/dist/index.mjs +296 -6
- package/dist/ir/index.d.ts +5 -0
- package/dist/ir/ir-error.d.ts +6 -0
- package/dist/ir/ir-payload.d.ts +23 -0
- package/dist/ir/ir-timings.d.ts +17 -0
- package/dist/ir/pronto.d.ts +10 -0
- package/dist/ir/smartir.d.ts +31 -0
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-Crlmu_tO.mjs → sleep-BAvUCi_2.mjs} +13 -1
- package/dist/{sleep-DHitF_e4.js → sleep-g6ZjBHBL.js} +13 -1
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Why an IR/RF codec refused an input. Callers branch on the code, never on the message. */
|
|
2
|
+
export type IrCodecErrorCode = 'invalid-timings' | 'invalid-raw' | 'pronto-malformed' | 'pronto-unsupported-form' | 'smartir-malformed';
|
|
3
|
+
export declare class IrCodecError extends Error {
|
|
4
|
+
readonly code: IrCodecErrorCode;
|
|
5
|
+
constructor(code: IrCodecErrorCode, message: string);
|
|
6
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type IrTimings, type TransmitSettings } from './ir-timings.js';
|
|
3
|
+
/** What a remote command stores: a raw pulse train, or a learned Pronto code. */
|
|
4
|
+
export declare const IrPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
kind: z.ZodLiteral<"raw">;
|
|
6
|
+
timings: z.ZodArray<z.ZodNumber>;
|
|
7
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
carrierHz: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
dutyCyclePercent: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
repeat: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
repeatDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
kind: z.ZodLiteral<"pronto">;
|
|
15
|
+
code: z.ZodString;
|
|
16
|
+
}, z.core.$strip>], "kind">;
|
|
17
|
+
export type IrPayload = z.infer<typeof IrPayloadSchema>;
|
|
18
|
+
export interface ResolvedTransmission {
|
|
19
|
+
timings: IrTimings;
|
|
20
|
+
settings: TransmitSettings;
|
|
21
|
+
}
|
|
22
|
+
/** Resolve a payload to what `ir-transmitter.send` takes. Throws `IrCodecError`. */
|
|
23
|
+
export declare function toTimings(payload: IrPayload): ResolvedTransmission;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Maximum number of mark/space entries one pulse train may carry. */
|
|
3
|
+
export declare const IR_TIMINGS_MAX = 1024;
|
|
4
|
+
/**
|
|
5
|
+
* A pulse train in signed microseconds: mark (+) first, then space (-), strictly
|
|
6
|
+
* alternating, no zeros, 2..1024 entries.
|
|
7
|
+
*/
|
|
8
|
+
export declare const IrTimingsSchema: z.ZodArray<z.ZodNumber>;
|
|
9
|
+
export type IrTimings = z.infer<typeof IrTimingsSchema>;
|
|
10
|
+
/** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
|
|
11
|
+
export declare const TransmitSettingsSchema: z.ZodObject<{
|
|
12
|
+
carrierHz: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
dutyCyclePercent: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
repeat: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
repeatDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type TransmitSettings = z.infer<typeof TransmitSettingsSchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type IrTimings } from './ir-timings.js';
|
|
2
|
+
export interface ProntoDecoded {
|
|
3
|
+
timings: IrTimings;
|
|
4
|
+
carrierHz: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Decode a learned (0000 form) Pronto hex string. The intro burst is followed by
|
|
8
|
+
* the repeat burst once; a different form is refused with `pronto-unsupported-form`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function decodePronto(code: string): ProntoDecoded;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IrPayload } from './ir-payload.js';
|
|
2
|
+
export type RemoteCommandGroup = 'command' | 'source';
|
|
3
|
+
export interface RemoteCommand {
|
|
4
|
+
name: string;
|
|
5
|
+
group: RemoteCommandGroup;
|
|
6
|
+
payload: IrPayload;
|
|
7
|
+
/** Overrides the remote's default transmitter for this command. */
|
|
8
|
+
transmitterDeviceId?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface RemoteCommandTableOrigin {
|
|
11
|
+
format: 'smartir';
|
|
12
|
+
manufacturer?: string;
|
|
13
|
+
models?: string[];
|
|
14
|
+
controller?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RemoteCommandTable {
|
|
17
|
+
commands: RemoteCommand[];
|
|
18
|
+
interCommandDelayMs: number;
|
|
19
|
+
origin?: RemoteCommandTableOrigin;
|
|
20
|
+
}
|
|
21
|
+
export interface SkippedCommand {
|
|
22
|
+
name: string;
|
|
23
|
+
group: RemoteCommandGroup;
|
|
24
|
+
reason: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SmartIrParseResult {
|
|
27
|
+
table: RemoteCommandTable;
|
|
28
|
+
skipped: SkippedCommand[];
|
|
29
|
+
}
|
|
30
|
+
/** Parse a SmartIR media_player JSON. Raw and Pronto are imported; other encodings are reported in `skipped`. */
|
|
31
|
+
export declare function parseSmartIr(document: unknown): SmartIrParseResult;
|
package/dist/node.js
CHANGED
|
@@ -21,8 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
const require_composition = require("./composition-
|
|
25
|
-
const require_err_msg = require("./err-msg-
|
|
24
|
+
const require_composition = require("./composition-DCmtFE-X.js");
|
|
25
|
+
const require_err_msg = require("./err-msg-COHgq7Mb.js");
|
|
26
26
|
let node_crypto = require("node:crypto");
|
|
27
27
|
let node_fs = require("node:fs");
|
|
28
28
|
node_fs = __toESM(node_fs);
|
package/dist/node.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as compositionSourceKey, Fn as FFMPEG_RELEASE, In as getFfmpegArtifact, Ln as getFfmpegDownloadUrl, Mn as FFMPEG_PATH_ENV, Nn as chooseFfmpegBinary, Pn as ffmpegBinaryName, Rn as canonicalHash, Un as buildFfmpegArgs, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, qn as isSoftwareDecode, zn as Fmp4BoxSplitter } from "./composition-
|
|
2
|
-
import { t as errMsg } from "./err-msg-
|
|
1
|
+
import { F as compositionSourceKey, Fn as FFMPEG_RELEASE, In as getFfmpegArtifact, Ln as getFfmpegDownloadUrl, Mn as FFMPEG_PATH_ENV, Nn as chooseFfmpegBinary, Pn as ffmpegBinaryName, Rn as canonicalHash, Un as buildFfmpegArgs, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, qn as isSoftwareDecode, zn as Fmp4BoxSplitter } from "./composition-DpFv_J6D.mjs";
|
|
2
|
+
import { t as errMsg } from "./err-msg-BCdlR2Li.mjs";
|
|
3
3
|
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import { chmodSync, copyFileSync, createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -6726,6 +6726,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
6726
6726
|
"image-settings",
|
|
6727
6727
|
"integrations",
|
|
6728
6728
|
"intercom",
|
|
6729
|
+
"ir-transmitter",
|
|
6729
6730
|
"keychain",
|
|
6730
6731
|
"keychain-admin",
|
|
6731
6732
|
"lawn-mower-control",
|
|
@@ -7974,6 +7975,11 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
7974
7975
|
"path": "batteryPower",
|
|
7975
7976
|
"valueType": "number"
|
|
7976
7977
|
},
|
|
7978
|
+
{
|
|
7979
|
+
"path": "powerSource",
|
|
7980
|
+
"valueType": "enum",
|
|
7981
|
+
"enumValues": ["mains", "battery"]
|
|
7982
|
+
},
|
|
7977
7983
|
{
|
|
7978
7984
|
"path": "desiccantLeftDays",
|
|
7979
7985
|
"valueType": "number"
|
|
@@ -9149,6 +9155,10 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
9149
9155
|
endTalkSession: (input) => dispatch("intercom", "intercom", "endTalkSession", "mutation", input),
|
|
9150
9156
|
getStatus: (input) => dispatch("intercom", "intercom", "getStatus", "query", input)
|
|
9151
9157
|
};
|
|
9158
|
+
const irTransmitterInterface = {
|
|
9159
|
+
send: (input) => dispatch("ir-transmitter", "irTransmitter", "send", "mutation", input),
|
|
9160
|
+
getInfo: (input) => dispatch("ir-transmitter", "irTransmitter", "getInfo", "query", input)
|
|
9161
|
+
};
|
|
9152
9162
|
const lawnMowerControlInterface = {
|
|
9153
9163
|
startMowing: (input) => dispatch("lawn-mower-control", "lawnMowerControl", "startMowing", "mutation", input),
|
|
9154
9164
|
pause: (input) => dispatch("lawn-mower-control", "lawnMowerControl", "pause", "mutation", input),
|
|
@@ -9783,6 +9793,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
9783
9793
|
...bound("image") ? { image: imageInterface } : {},
|
|
9784
9794
|
...bound("image-settings") ? { imageSettings: imageSettingsInterface } : {},
|
|
9785
9795
|
...bound("intercom") ? { intercom: intercomInterface } : {},
|
|
9796
|
+
...bound("ir-transmitter") ? { irTransmitter: irTransmitterInterface } : {},
|
|
9786
9797
|
...bound("lawn-mower-control") ? { lawnMowerControl: lawnMowerControlInterface } : {},
|
|
9787
9798
|
...bound("lock-control") ? { lockControl: lockControlInterface } : {},
|
|
9788
9799
|
...bound("media-player") ? { mediaPlayer: mediaPlayerInterface } : {},
|
|
@@ -9861,7 +9872,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
9861
9872
|
* can answer "may a rule actuate this?" without importing the schema barrel
|
|
9862
9873
|
* (~144MB RSS per runner, D28).
|
|
9863
9874
|
*
|
|
9864
|
-
* Coverage:
|
|
9875
|
+
* Coverage: 96 device-scoped capabilities.
|
|
9865
9876
|
*/
|
|
9866
9877
|
var DEVICE_SCOPED_CAPS = new Set([
|
|
9867
9878
|
"accessories",
|
|
@@ -9911,6 +9922,7 @@ var DEVICE_SCOPED_CAPS = new Set([
|
|
|
9911
9922
|
"image",
|
|
9912
9923
|
"image-settings",
|
|
9913
9924
|
"intercom",
|
|
9925
|
+
"ir-transmitter",
|
|
9914
9926
|
"lawn-mower-control",
|
|
9915
9927
|
"lock-control",
|
|
9916
9928
|
"media-player",
|
|
@@ -6726,6 +6726,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
6726
6726
|
"image-settings",
|
|
6727
6727
|
"integrations",
|
|
6728
6728
|
"intercom",
|
|
6729
|
+
"ir-transmitter",
|
|
6729
6730
|
"keychain",
|
|
6730
6731
|
"keychain-admin",
|
|
6731
6732
|
"lawn-mower-control",
|
|
@@ -7974,6 +7975,11 @@ var CAP_STATE_LEAVES = Object.freeze({
|
|
|
7974
7975
|
"path": "batteryPower",
|
|
7975
7976
|
"valueType": "number"
|
|
7976
7977
|
},
|
|
7978
|
+
{
|
|
7979
|
+
"path": "powerSource",
|
|
7980
|
+
"valueType": "enum",
|
|
7981
|
+
"enumValues": ["mains", "battery"]
|
|
7982
|
+
},
|
|
7977
7983
|
{
|
|
7978
7984
|
"path": "desiccantLeftDays",
|
|
7979
7985
|
"valueType": "number"
|
|
@@ -9149,6 +9155,10 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
9149
9155
|
endTalkSession: (input) => dispatch("intercom", "intercom", "endTalkSession", "mutation", input),
|
|
9150
9156
|
getStatus: (input) => dispatch("intercom", "intercom", "getStatus", "query", input)
|
|
9151
9157
|
};
|
|
9158
|
+
const irTransmitterInterface = {
|
|
9159
|
+
send: (input) => dispatch("ir-transmitter", "irTransmitter", "send", "mutation", input),
|
|
9160
|
+
getInfo: (input) => dispatch("ir-transmitter", "irTransmitter", "getInfo", "query", input)
|
|
9161
|
+
};
|
|
9152
9162
|
const lawnMowerControlInterface = {
|
|
9153
9163
|
startMowing: (input) => dispatch("lawn-mower-control", "lawnMowerControl", "startMowing", "mutation", input),
|
|
9154
9164
|
pause: (input) => dispatch("lawn-mower-control", "lawnMowerControl", "pause", "mutation", input),
|
|
@@ -9783,6 +9793,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
9783
9793
|
...bound("image") ? { image: imageInterface } : {},
|
|
9784
9794
|
...bound("image-settings") ? { imageSettings: imageSettingsInterface } : {},
|
|
9785
9795
|
...bound("intercom") ? { intercom: intercomInterface } : {},
|
|
9796
|
+
...bound("ir-transmitter") ? { irTransmitter: irTransmitterInterface } : {},
|
|
9786
9797
|
...bound("lawn-mower-control") ? { lawnMowerControl: lawnMowerControlInterface } : {},
|
|
9787
9798
|
...bound("lock-control") ? { lockControl: lockControlInterface } : {},
|
|
9788
9799
|
...bound("media-player") ? { mediaPlayer: mediaPlayerInterface } : {},
|
|
@@ -9861,7 +9872,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
9861
9872
|
* can answer "may a rule actuate this?" without importing the schema barrel
|
|
9862
9873
|
* (~144MB RSS per runner, D28).
|
|
9863
9874
|
*
|
|
9864
|
-
* Coverage:
|
|
9875
|
+
* Coverage: 96 device-scoped capabilities.
|
|
9865
9876
|
*/
|
|
9866
9877
|
var DEVICE_SCOPED_CAPS = new Set([
|
|
9867
9878
|
"accessories",
|
|
@@ -9911,6 +9922,7 @@ var DEVICE_SCOPED_CAPS = new Set([
|
|
|
9911
9922
|
"image",
|
|
9912
9923
|
"image-settings",
|
|
9913
9924
|
"intercom",
|
|
9925
|
+
"ir-transmitter",
|
|
9914
9926
|
"lawn-mower-control",
|
|
9915
9927
|
"lock-control",
|
|
9916
9928
|
"media-player",
|