@camstack/types 1.2.95 → 1.2.97

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_event_category = require("./event-category-CRPORAAz.js");
3
- const require_sleep = require("./sleep-CMRLJj2e.js");
2
+ const require_event_category = require("./event-category-EY0GNjV9.js");
3
+ const require_sleep = require("./sleep-C2XhJhkd.js");
4
4
  const require_canonical_hash = require("./canonical-hash-DNV8S5ET.js");
5
5
  const require_enums = require("./enums.js");
6
6
  const require_err_msg = require("./err-msg-COpsHMw2.js");
@@ -19808,7 +19808,12 @@ var TerminalSessionInfoSchema = zod.z.object({
19808
19808
  var TerminalProfileInfoSchema = zod.z.object({
19809
19809
  profileId: zod.z.string(),
19810
19810
  label: zod.z.string(),
19811
- description: zod.z.string().optional()
19811
+ description: zod.z.string().optional(),
19812
+ /** Spawn defaults the instance form copies on create. */
19813
+ executable: zod.z.string().optional(),
19814
+ args: zod.z.array(zod.z.string()).readonly().optional(),
19815
+ cwd: zod.z.string().optional(),
19816
+ environment: zod.z.array(zod.z.string()).readonly().optional()
19812
19817
  });
19813
19818
  /**
19814
19819
  * A durable operator-created Terminal instance. Profiles are templates; only
@@ -19821,7 +19826,11 @@ var TerminalInstanceInfoSchema = zod.z.object({
19821
19826
  profileId: zod.z.string(),
19822
19827
  profileLabel: zod.z.string(),
19823
19828
  name: zod.z.string(),
19824
- enabled: zod.z.boolean()
19829
+ enabled: zod.z.boolean(),
19830
+ executable: zod.z.string(),
19831
+ args: zod.z.array(zod.z.string()).readonly(),
19832
+ cwd: zod.z.string(),
19833
+ environment: zod.z.array(zod.z.string()).readonly()
19825
19834
  });
19826
19835
  var TerminalLegacyCameraSchema = zod.z.object({
19827
19836
  stableId: zod.z.string(),
@@ -19867,7 +19876,22 @@ var terminalSessionCapability = {
19867
19876
  createInstance: require_sleep.method(zod.z.object({
19868
19877
  targetNodeId: zod.z.string().min(1),
19869
19878
  profileId: zod.z.string().min(1),
19870
- name: zod.z.string().trim().min(1).max(160).optional()
19879
+ name: zod.z.string().trim().min(1).max(160).optional(),
19880
+ executable: zod.z.string().max(1024).optional(),
19881
+ args: zod.z.array(zod.z.string().max(2048)).max(64).optional(),
19882
+ cwd: zod.z.string().max(1024).optional(),
19883
+ environment: zod.z.array(zod.z.string().max(4096)).max(64).optional()
19884
+ }), TerminalInstanceInfoSchema, {
19885
+ kind: "mutation",
19886
+ auth: "admin"
19887
+ }),
19888
+ updateInstance: require_sleep.method(zod.z.object({
19889
+ instanceId: zod.z.string().min(1),
19890
+ name: zod.z.string().trim().min(1).max(160).optional(),
19891
+ executable: zod.z.string().max(1024).optional(),
19892
+ args: zod.z.array(zod.z.string().max(2048)).max(64).optional(),
19893
+ cwd: zod.z.string().max(1024).optional(),
19894
+ environment: zod.z.array(zod.z.string().max(4096)).max(64).optional()
19871
19895
  }), TerminalInstanceInfoSchema, {
19872
19896
  kind: "mutation",
19873
19897
  auth: "admin"
@@ -19902,7 +19926,11 @@ var terminalSessionCapability = {
19902
19926
  openSession: require_sleep.method(zod.z.object({
19903
19927
  profileId: zod.z.string(),
19904
19928
  cols: zod.z.number().int().positive(),
19905
- rows: zod.z.number().int().positive()
19929
+ rows: zod.z.number().int().positive(),
19930
+ executable: zod.z.string().max(1024).optional(),
19931
+ args: zod.z.array(zod.z.string().max(2048)).max(64).optional(),
19932
+ cwd: zod.z.string().max(1024).optional(),
19933
+ environment: zod.z.array(zod.z.string().max(4096)).max(64).optional()
19906
19934
  }), TerminalSessionInfoSchema, {
19907
19935
  kind: "mutation",
19908
19936
  auth: "admin"
@@ -24668,6 +24696,20 @@ var AllowedAddressesSchema = zod.z.object({
24668
24696
  * Network Addresses admin page and persisted by the addon.
24669
24697
  */
24670
24698
  addresses: zod.z.array(zod.z.string()).readonly() });
24699
+ var TlsStatusSchema = zod.z.object({
24700
+ mode: zod.z.enum([
24701
+ "generated",
24702
+ "uploaded",
24703
+ "disabled"
24704
+ ]),
24705
+ leafFingerprintSha256: zod.z.string().nullable(),
24706
+ caFingerprintSha256: zod.z.string().nullable(),
24707
+ validTo: zod.z.string().nullable(),
24708
+ sans: zod.z.array(zod.z.string()),
24709
+ caCertPem: zod.z.string().nullable(),
24710
+ reissueError: zod.z.string().nullable(),
24711
+ restartRequired: zod.z.boolean()
24712
+ });
24671
24713
  var localNetworkCapability = {
24672
24714
  name: "local-network",
24673
24715
  scope: "system",
@@ -24773,7 +24815,34 @@ var localNetworkCapability = {
24773
24815
  * when the operator wants to wipe their manual edits and start
24774
24816
  * over from the auto-detected best matches.
24775
24817
  */
24776
- resetAllowlistToBestMatch: require_sleep.method(zod.z.void(), AllowedAddressesSchema, { kind: "mutation" })
24818
+ resetAllowlistToBestMatch: require_sleep.method(zod.z.void(), AllowedAddressesSchema, { kind: "mutation" }),
24819
+ /**
24820
+ * Live TLS material for the Network → Local access certificate card.
24821
+ * LAN HTTP / hostname are addon settings (`globalSettingsSchema`), not
24822
+ * a second store — this query is status, not configuration.
24823
+ */
24824
+ getTlsStatus: require_sleep.method(zod.z.void(), TlsStatusSchema),
24825
+ /** Issue a new leaf under the existing local CA. Disabled in uploaded mode. */
24826
+ regenerateCertificate: require_sleep.method(zod.z.object({ reason: zod.z.string().optional() }), TlsStatusSchema, {
24827
+ kind: "mutation",
24828
+ auth: "admin"
24829
+ }),
24830
+ /** Replace the served material with operator-supplied PEMs. */
24831
+ uploadCertificate: require_sleep.method(zod.z.object({
24832
+ certPem: zod.z.string().min(1),
24833
+ keyPem: zod.z.string().min(1),
24834
+ caPem: zod.z.string().optional()
24835
+ }), TlsStatusSchema, {
24836
+ kind: "mutation",
24837
+ auth: "admin"
24838
+ }),
24839
+ /** The local CA PEM, or empty when there is none to download. */
24840
+ downloadCa: require_sleep.method(zod.z.void(), zod.z.object({ pem: zod.z.string() })),
24841
+ /** Drop uploaded material and return to the generated local CA. */
24842
+ revertToGeneratedCertificate: require_sleep.method(zod.z.void(), TlsStatusSchema, {
24843
+ kind: "mutation",
24844
+ auth: "admin"
24845
+ })
24777
24846
  },
24778
24847
  /** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
24779
24848
  mount: { kind: "hub-only" }
@@ -36704,6 +36773,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36704
36773
  addonId: null,
36705
36774
  access: "create"
36706
36775
  },
36776
+ "localNetwork.downloadCa": {
36777
+ capName: "local-network",
36778
+ capScope: "system",
36779
+ addonId: null,
36780
+ access: "view"
36781
+ },
36707
36782
  "localNetwork.getAllowedAddresses": {
36708
36783
  capName: "local-network",
36709
36784
  capScope: "system",
@@ -36728,18 +36803,36 @@ var METHOD_ACCESS_MAP = Object.freeze({
36728
36803
  addonId: null,
36729
36804
  access: "view"
36730
36805
  },
36806
+ "localNetwork.getTlsStatus": {
36807
+ capName: "local-network",
36808
+ capScope: "system",
36809
+ addonId: null,
36810
+ access: "view"
36811
+ },
36731
36812
  "localNetwork.list": {
36732
36813
  capName: "local-network",
36733
36814
  capScope: "system",
36734
36815
  addonId: null,
36735
36816
  access: "view"
36736
36817
  },
36818
+ "localNetwork.regenerateCertificate": {
36819
+ capName: "local-network",
36820
+ capScope: "system",
36821
+ addonId: null,
36822
+ access: "create"
36823
+ },
36737
36824
  "localNetwork.resetAllowlistToBestMatch": {
36738
36825
  capName: "local-network",
36739
36826
  capScope: "system",
36740
36827
  addonId: null,
36741
36828
  access: "delete"
36742
36829
  },
36830
+ "localNetwork.revertToGeneratedCertificate": {
36831
+ capName: "local-network",
36832
+ capScope: "system",
36833
+ addonId: null,
36834
+ access: "create"
36835
+ },
36743
36836
  "localNetwork.setAllowedAddresses": {
36744
36837
  capName: "local-network",
36745
36838
  capScope: "system",
@@ -36752,6 +36845,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36752
36845
  addonId: null,
36753
36846
  access: "create"
36754
36847
  },
36848
+ "localNetwork.uploadCertificate": {
36849
+ capName: "local-network",
36850
+ capScope: "system",
36851
+ addonId: null,
36852
+ access: "create"
36853
+ },
36755
36854
  "lockControl.lock": {
36756
36855
  capName: "lock-control",
36757
36856
  capScope: "device",
@@ -39632,6 +39731,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
39632
39731
  addonId: null,
39633
39732
  access: "create"
39634
39733
  },
39734
+ "terminalSession.updateInstance": {
39735
+ capName: "terminal-session",
39736
+ capScope: "system",
39737
+ addonId: null,
39738
+ access: "create"
39739
+ },
39635
39740
  "terminalSession.writeInput": {
39636
39741
  capName: "terminal-session",
39637
39742
  capScope: "system",
@@ -42944,7 +43049,12 @@ function createSystemProxy(api) {
42944
43049
  setNotificationEndpoint: (input) => dispatch("localNetwork", "setNotificationEndpoint", "mutation", input),
42945
43050
  getAllowedAddresses: (input) => dispatch("localNetwork", "getAllowedAddresses", "query", input),
42946
43051
  setAllowedAddresses: (input) => dispatch("localNetwork", "setAllowedAddresses", "mutation", input),
42947
- resetAllowlistToBestMatch: (input) => dispatch("localNetwork", "resetAllowlistToBestMatch", "mutation", input)
43052
+ resetAllowlistToBestMatch: (input) => dispatch("localNetwork", "resetAllowlistToBestMatch", "mutation", input),
43053
+ getTlsStatus: (input) => dispatch("localNetwork", "getTlsStatus", "query", input),
43054
+ regenerateCertificate: (input) => dispatch("localNetwork", "regenerateCertificate", "mutation", input),
43055
+ uploadCertificate: (input) => dispatch("localNetwork", "uploadCertificate", "mutation", input),
43056
+ downloadCa: (input) => dispatch("localNetwork", "downloadCa", "query", input),
43057
+ revertToGeneratedCertificate: (input) => dispatch("localNetwork", "revertToGeneratedCertificate", "mutation", input)
42948
43058
  },
42949
43059
  meshNetwork: {
42950
43060
  getStatus: (input) => dispatch("meshNetwork", "getStatus", "query", input),
@@ -43226,6 +43336,7 @@ function createSystemProxy(api) {
43226
43336
  listProfiles: (input) => dispatch("terminalSession", "listProfiles", "query", input),
43227
43337
  listInstances: (input) => dispatch("terminalSession", "listInstances", "query", input),
43228
43338
  createInstance: (input) => dispatch("terminalSession", "createInstance", "mutation", input),
43339
+ updateInstance: (input) => dispatch("terminalSession", "updateInstance", "mutation", input),
43229
43340
  deleteInstance: (input) => dispatch("terminalSession", "deleteInstance", "mutation", input),
43230
43341
  setInstanceEnabled: (input) => dispatch("terminalSession", "setInstanceEnabled", "mutation", input),
43231
43342
  listLegacyCameras: (input) => dispatch("terminalSession", "listLegacyCameras", "query", input),
@@ -44733,6 +44844,63 @@ function resolveClusterStepModelId(stepId, models) {
44733
44844
  const chosen = models[stepId];
44734
44845
  return chosen !== void 0 && chosen !== "" ? chosen : step.defaultModelId;
44735
44846
  }
44847
+ /** Must match `DEFAULT_LANDMARK_PRECISION_FLOOR_PX` in the runner. */
44848
+ var DEFAULT_MIN_LANDMARK_FACE_SIZE_PX = 24;
44849
+ var CLUSTER_STEP_SETTING_FIELDS = [{
44850
+ stepId: "face-embedding",
44851
+ key: "minLandmarkFaceSize",
44852
+ label: "Min face size for recognition (detection px)",
44853
+ description: "Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",
44854
+ type: "slider",
44855
+ min: 0,
44856
+ max: 64,
44857
+ step: 2,
44858
+ default: 24
44859
+ }];
44860
+ function clusterStepSettingKey(stepId, fieldKey) {
44861
+ return `clusterStepSetting:${stepId}:${fieldKey}`;
44862
+ }
44863
+ function clusterStepSettingFieldsFor(stepId) {
44864
+ return CLUSTER_STEP_SETTING_FIELDS.filter((field) => field.stepId === stepId);
44865
+ }
44866
+ var ClusterSettingNumberSchema = zod.z.number().finite();
44867
+ function readClusterStepSettings(config) {
44868
+ const out = {};
44869
+ for (const field of CLUSTER_STEP_SETTING_FIELDS) {
44870
+ const parsed = ClusterSettingNumberSchema.safeParse(config[clusterStepSettingKey(field.stepId, field.key)]);
44871
+ const value = parsed.success ? parsed.data : field.default;
44872
+ const existing = out[field.stepId] ?? {};
44873
+ out[field.stepId] = {
44874
+ ...existing,
44875
+ [field.key]: value
44876
+ };
44877
+ }
44878
+ return out;
44879
+ }
44880
+ var DEFAULT_CLUSTER_STEP_SETTINGS = readClusterStepSettings({});
44881
+ function pickClusterStepSettings(view) {
44882
+ if (view === null) return DEFAULT_CLUSTER_STEP_SETTINGS;
44883
+ const flat = {};
44884
+ const wanted = new Set(CLUSTER_STEP_SETTING_FIELDS.map((field) => clusterStepSettingKey(field.stepId, field.key)));
44885
+ for (const section of view.sections) for (const entry of section.fields) {
44886
+ if (!isHydratedField$2(entry) || typeof entry.key !== "string") continue;
44887
+ if (wanted.has(entry.key)) flat[entry.key] = entry.value;
44888
+ }
44889
+ return readClusterStepSettings(flat);
44890
+ }
44891
+ /**
44892
+ * Cluster knobs win over leftover per-device values. The cluster row is the
44893
+ * authority; a device-local copy is a leftover of the old per-node editor.
44894
+ */
44895
+ function overlayClusterStepSettings(stepId, deviceSettings, cluster) {
44896
+ const overlay = cluster[stepId];
44897
+ if (overlay === void 0 || Object.keys(overlay).length === 0) return deviceSettings === void 0 ? void 0 : { ...deviceSettings };
44898
+ if (deviceSettings === void 0) return { ...overlay };
44899
+ return {
44900
+ ...deviceSettings,
44901
+ ...overlay
44902
+ };
44903
+ }
44736
44904
  //#endregion
44737
44905
  //#region src/pipeline/detail-crop.ts
44738
44906
  /**
@@ -47208,6 +47376,7 @@ exports.CAP_NODE_PIN_CONTEXT_KEY = require_sleep.CAP_NODE_PIN_CONTEXT_KEY;
47208
47376
  exports.CAP_PROVIDER_KIND_MAP = CAP_PROVIDER_KIND_MAP;
47209
47377
  exports.CLUSTER_MODEL_SCOPED_STEPS = CLUSTER_MODEL_SCOPED_STEPS;
47210
47378
  exports.CLUSTER_MODEL_SECTION_ID = CLUSTER_MODEL_SECTION_ID;
47379
+ exports.CLUSTER_STEP_SETTING_FIELDS = CLUSTER_STEP_SETTING_FIELDS;
47211
47380
  exports.COCO_80_LABELS = COCO_80_LABELS;
47212
47381
  exports.COCO_TO_MACRO = COCO_TO_MACRO;
47213
47382
  exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
@@ -47296,11 +47465,13 @@ exports.DECLARED_INTEGRATION_FIXED_KEY = DECLARED_INTEGRATION_FIXED_KEY;
47296
47465
  exports.DEFAULT_ADDON_PLACEMENT = DEFAULT_ADDON_PLACEMENT;
47297
47466
  exports.DEFAULT_AUDIO_ANALYZER_CONFIG = DEFAULT_AUDIO_ANALYZER_CONFIG;
47298
47467
  exports.DEFAULT_CLUSTER_STEP_MODELS = DEFAULT_CLUSTER_STEP_MODELS;
47468
+ exports.DEFAULT_CLUSTER_STEP_SETTINGS = DEFAULT_CLUSTER_STEP_SETTINGS;
47299
47469
  exports.DEFAULT_DECODER_HWACCEL_CONFIG = DEFAULT_DECODER_HWACCEL_CONFIG;
47300
47470
  exports.DEFAULT_DETAIL_CROP_CONVENTION = DEFAULT_DETAIL_CROP_CONVENTION;
47301
47471
  exports.DEFAULT_EVENTS_BAND_BUFFER_SEC = DEFAULT_EVENTS_BAND_BUFFER_SEC;
47302
47472
  exports.DEFAULT_EVENT_COLOR = DEFAULT_EVENT_COLOR;
47303
47473
  exports.DEFAULT_FEATURES = DEFAULT_FEATURES;
47474
+ exports.DEFAULT_MIN_LANDMARK_FACE_SIZE_PX = DEFAULT_MIN_LANDMARK_FACE_SIZE_PX;
47304
47475
  exports.DEFAULT_NATIVE_LEASE_SETTINGS = DEFAULT_NATIVE_LEASE_SETTINGS;
47305
47476
  exports.DEFAULT_POOL_MEMORY_POLICY = DEFAULT_POOL_MEMORY_POLICY;
47306
47477
  exports.DEFAULT_RECORDING_PROFILES = DEFAULT_RECORDING_PROFILES;
@@ -48078,6 +48249,8 @@ exports.classifyStream = classifyStream;
48078
48249
  exports.classifyStreams = classifyStreams;
48079
48250
  exports.climateControlCapability = climateControlCapability;
48080
48251
  exports.clusterModelSettingKey = clusterModelSettingKey;
48252
+ exports.clusterStepSettingFieldsFor = clusterStepSettingFieldsFor;
48253
+ exports.clusterStepSettingKey = clusterStepSettingKey;
48081
48254
  exports.collectHydratedFieldEntries = require_sleep.collectHydratedFieldEntries;
48082
48255
  exports.collectHydratedFieldValues = require_sleep.collectHydratedFieldValues;
48083
48256
  exports.colorCapability = colorCapability;
@@ -48268,6 +48441,7 @@ exports.oauthIntegrationCapability = oauthIntegrationCapability;
48268
48441
  exports.objectInputDeclaresAddonId = objectInputDeclaresAddonId;
48269
48442
  exports.osdCapability = osdCapability;
48270
48443
  exports.osdManagerCapability = osdManagerCapability;
48444
+ exports.overlayClusterStepSettings = overlayClusterStepSettings;
48271
48445
  exports.parseCameraStreamConfig = parseCameraStreamConfig;
48272
48446
  exports.parseExpression = parseExpression;
48273
48447
  exports.parseJsonArray = require_sleep.parseJsonArray;
@@ -48281,6 +48455,7 @@ exports.patchAudio = patchAudio;
48281
48455
  exports.petFeederCapability = petFeederCapability;
48282
48456
  exports.pickAccessoryControl = pickAccessoryControl;
48283
48457
  exports.pickClusterStepModels = pickClusterStepModels;
48458
+ exports.pickClusterStepSettings = pickClusterStepSettings;
48284
48459
  exports.pickDetailCropConvention = pickDetailCropConvention;
48285
48460
  exports.pickNativeLeaseOverride = pickNativeLeaseOverride;
48286
48461
  exports.pickPreferredRtspEntry = pickPreferredRtspEntry;
@@ -48305,6 +48480,7 @@ exports.ptzAutotrackCapability = ptzAutotrackCapability;
48305
48480
  exports.ptzCapability = ptzCapability;
48306
48481
  exports.pythonScriptForBackend = pythonScriptForBackend;
48307
48482
  exports.readClusterStepModels = readClusterStepModels;
48483
+ exports.readClusterStepSettings = readClusterStepSettings;
48308
48484
  exports.readDetailCropConvention = readDetailCropConvention;
48309
48485
  exports.readDeviceStateFrom = readDeviceStateFrom;
48310
48486
  exports.readNativeLeaseOverride = readNativeLeaseOverride;