@camstack/system 1.2.364 → 1.2.365

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 (72) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/addon-utils.d.ts +1 -1
  4. package/dist/addon-utils.js +3 -1
  5. package/dist/addon-utils.mjs +2 -2
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/autotrack/index.js +1 -1
  13. package/dist/builtins/autotrack/index.mjs +1 -1
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  16. package/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/dist/builtins/camera-grid/index.js +1 -1
  19. package/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/dist/builtins/composer/composer.addon.js +2 -2
  21. package/dist/builtins/composer/composer.addon.mjs +2 -2
  22. package/dist/builtins/console-logging/index.js +1 -1
  23. package/dist/builtins/console-logging/index.mjs +1 -1
  24. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  25. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  26. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  27. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  28. package/dist/builtins/hub-forwarder/index.js +1 -1
  29. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  30. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  31. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  32. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  33. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  34. package/dist/builtins/local-network/local-network.addon.js +1 -1
  35. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  36. package/dist/builtins/loki-logging/index.js +1 -1
  37. package/dist/builtins/loki-logging/index.mjs +1 -1
  38. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  39. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  40. package/dist/builtins/platform-probe/index.js +1 -1
  41. package/dist/builtins/platform-probe/index.mjs +1 -1
  42. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  43. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/snapshot/index.js +1 -1
  45. package/dist/builtins/snapshot/index.mjs +1 -1
  46. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  47. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  48. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  49. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  50. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  51. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  52. package/dist/builtins/system-config/system-config.addon.js +1 -1
  53. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  54. package/dist/builtins/winston-logging/index.js +1 -1
  55. package/dist/builtins/winston-logging/index.mjs +1 -1
  56. package/dist/{child-cap-dispatch-B79ITdeA.js → child-cap-dispatch-C0m_Q3S1.js} +1 -1
  57. package/dist/{child-cap-dispatch-CtBHqm2J.mjs → child-cap-dispatch-DVawueyL.mjs} +1 -1
  58. package/dist/{composition-sources-Dj84elbu.mjs → composition-sources-BMsVkvaT.mjs} +1 -1
  59. package/dist/{composition-sources-CNVBIV_9.js → composition-sources-BYZglxTf.js} +1 -1
  60. package/dist/{dist-DiScyAO6.js → dist-B22ObVxi.js} +31 -5
  61. package/dist/{dist-C-IdBSWx.mjs → dist-BIGk6VLF.mjs} +14 -6
  62. package/dist/download/hosted-model-revisions.d.ts +10 -0
  63. package/dist/download/model-download-service.d.ts +8 -14
  64. package/dist/download/model-downloader.d.ts +44 -2
  65. package/dist/{event-loop-stall-monitor-CuTt1wq7.js → event-loop-stall-monitor-B687EIFo.js} +317 -125
  66. package/dist/{event-loop-stall-monitor-NFG6boF5.mjs → event-loop-stall-monitor-DxiaIssh.mjs} +300 -126
  67. package/dist/index.d.ts +2 -2
  68. package/dist/index.js +6 -3
  69. package/dist/index.mjs +4 -4
  70. package/dist/{retired-settings-keys-DIzyi9Jf.mjs → retired-settings-keys-C149_dvi.mjs} +1 -1
  71. package/dist/{retired-settings-keys-CJpnYIp1.js → retired-settings-keys-C8F8g0Oz.js} +1 -1
  72. package/package.json +1 -1
@@ -7917,12 +7917,15 @@ var ModelFormatEntrySchema = zod.z.object({
7917
7917
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
7918
7918
  runtimes: zod.z.array(zod.z.enum(["python"])).readonly().optional(),
7919
7919
  /**
7920
- * Content revision of the hosted artefact. Set it, or change it, whenever
7921
- * the bytes at `url` are replaced in place (same path, new content). A node
7922
- * records the revision it downloaded next to the file
7920
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
7921
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
7922
+ * weight file) comes from the downloader's generated table, kept in step
7923
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
7924
+ * node records the revision it downloaded next to the file
7923
7925
  * (`<file>.revision`); a copy with no record or a different one is stale
7924
- * and is downloaded again, the old copy serving until the new one is
7925
- * complete. Omitted ⇒ a file on disk is current, whatever it holds (D743).
7926
+ * unless its weight file hashes to the revision, and a stale copy is
7927
+ * downloaded again, the old one serving until the new one is complete. No
7928
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
7926
7929
  */
7927
7930
  revision: zod.z.string().min(1).optional()
7928
7931
  });
@@ -45922,6 +45925,8 @@ Object.freeze({
45922
45925
  vehicle: .65,
45923
45926
  animal: .65
45924
45927
  });
45928
+ var HF_REPO = "camstack/camstack-models";
45929
+ `${HF_REPO}`;
45925
45930
  /**
45926
45931
  * Runtime defaults -- used by ConfigManager.get() for backward compatibility
45927
45932
  * until Plan B wires all runtime settings to the system_settings SQL table.
@@ -60200,6 +60205,9 @@ var ADDON_ID_PREFIX = "addon:";
60200
60205
  function bareAddonId(id) {
60201
60206
  return id.startsWith(ADDON_ID_PREFIX) ? id.slice(6) : id;
60202
60207
  }
60208
+ function hfModelUrl(repo, path) {
60209
+ return `https://huggingface.co/${repo}/resolve/main/${path}`;
60210
+ }
60203
60211
  var MB = 1024 * 1024;
60204
60212
  1024 * MB, 3072 * MB;
60205
60213
  /**
@@ -60532,6 +60540,12 @@ Object.defineProperty(exports, "FieldClaimSchema", {
60532
60540
  return FieldClaimSchema;
60533
60541
  }
60534
60542
  });
60543
+ Object.defineProperty(exports, "HF_REPO", {
60544
+ enumerable: true,
60545
+ get: function() {
60546
+ return HF_REPO;
60547
+ }
60548
+ });
60535
60549
  Object.defineProperty(exports, "LOG_LEVEL_RANK", {
60536
60550
  enumerable: true,
60537
60551
  get: function() {
@@ -60562,6 +60576,12 @@ Object.defineProperty(exports, "MINUTES_PER_DAY", {
60562
60576
  return MINUTES_PER_DAY;
60563
60577
  }
60564
60578
  });
60579
+ Object.defineProperty(exports, "MODEL_FORMATS", {
60580
+ enumerable: true,
60581
+ get: function() {
60582
+ return MODEL_FORMATS;
60583
+ }
60584
+ });
60565
60585
  Object.defineProperty(exports, "MOTION_CLOSE_AFTER_MS", {
60566
60586
  enumerable: true,
60567
60587
  get: function() {
@@ -61042,6 +61062,12 @@ Object.defineProperty(exports, "gbToBytes", {
61042
61062
  return gbToBytes;
61043
61063
  }
61044
61064
  });
61065
+ Object.defineProperty(exports, "hfModelUrl", {
61066
+ enumerable: true,
61067
+ get: function() {
61068
+ return hfModelUrl;
61069
+ }
61070
+ });
61045
61071
  Object.defineProperty(exports, "hydrateSchema", {
61046
61072
  enumerable: true,
61047
61073
  get: function() {
@@ -7917,12 +7917,15 @@ var ModelFormatEntrySchema = z.object({
7917
7917
  /** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
7918
7918
  runtimes: z.array(z.enum(["python"])).readonly().optional(),
7919
7919
  /**
7920
- * Content revision of the hosted artefact. Set it, or change it, whenever
7921
- * the bytes at `url` are replaced in place (same path, new content). A node
7922
- * records the revision it downloaded next to the file
7920
+ * Content revision of the artefact, for one hosted OFF the CamStack mirror.
7921
+ * A format on the mirror leaves it unset: its revision (the sha256 of its
7922
+ * weight file) comes from the downloader's generated table, kept in step
7923
+ * with the mirror by `scripts/check-hosted-model-revisions.ts` (D744). A
7924
+ * node records the revision it downloaded next to the file
7923
7925
  * (`<file>.revision`); a copy with no record or a different one is stale
7924
- * and is downloaded again, the old copy serving until the new one is
7925
- * complete. Omitted ⇒ a file on disk is current, whatever it holds (D743).
7926
+ * unless its weight file hashes to the revision, and a stale copy is
7927
+ * downloaded again, the old one serving until the new one is complete. No
7928
+ * revision at all ⇒ a file on disk is current, whatever it holds (D743).
7926
7929
  */
7927
7930
  revision: z.string().min(1).optional()
7928
7931
  });
@@ -45922,6 +45925,8 @@ Object.freeze({
45922
45925
  vehicle: .65,
45923
45926
  animal: .65
45924
45927
  });
45928
+ var HF_REPO = "camstack/camstack-models";
45929
+ `${HF_REPO}`;
45925
45930
  /**
45926
45931
  * Runtime defaults -- used by ConfigManager.get() for backward compatibility
45927
45932
  * until Plan B wires all runtime settings to the system_settings SQL table.
@@ -60200,6 +60205,9 @@ var ADDON_ID_PREFIX = "addon:";
60200
60205
  function bareAddonId(id) {
60201
60206
  return id.startsWith(ADDON_ID_PREFIX) ? id.slice(6) : id;
60202
60207
  }
60208
+ function hfModelUrl(repo, path) {
60209
+ return `https://huggingface.co/${repo}/resolve/main/${path}`;
60210
+ }
60203
60211
  var MB = 1024 * 1024;
60204
60212
  1024 * MB, 3072 * MB;
60205
60213
  /**
@@ -60334,4 +60342,4 @@ function enumerateInferenceDevices(hw) {
60334
60342
  return out;
60335
60343
  }
60336
60344
  //#endregion
60337
- export { calendarsCapability as $, disarmRoseMemory as $n, memoizePinnedFfmpeg as $t, MOTION_CLOSE_AFTER_MS as A, storageCapability as An, EventCategory as Ar, extractNestedAddonId as At, StorageLocationTypeSchema as B, vectorIndexDimConflictError as Bn, isObjectInput as Bt, FieldClaimModeSchema as C, runtimeStatePolicyFor as Cn, parseJsonObject as Cr, enumerateInferenceDevices as Ct, LocationIconIdSchema as D, settingsStoreCapability as Dn, scopeKey as Dr, evictionPolicyOfLocation as Dt, LegacyStorageLocationDefaultSchema as E, scoreRuntimes as En, resolveCapMount as Er, evaluateCompositionField as Et, STORAGE_ACCESS_FALLBACK as F, streamQualityLabel as Fn, isAppLinkBase as Ft, addonWidgetsCapability as G, cloneStatefulExpressionMemory as Gn, lifecycleJobSchema as Gt, UserRecordSchema as H, withLocationMode as Hn, kebabToCamel as Ht, STREAM_PROFILE_META as I, userManagementCapability as In, isArrayOutputSchema as It, backupCapability as J, compositionFeatureEnabled as Jn, logDestinationCapability as Jt, alertsCapability as K, composedDeviceRef as Kn, localNetworkCapability as Kt, ScopedTokenSchema as L, validateComposition as Ln, isCollectionArrayMethod as Lt, REDACTED_SECRET as M, storageOccupancyCapability as Mn, foldSnapshotByFunction as Mt, RUNTIME_DEFAULTS as N, storageProviderCapability as Nn, formatMinutes as Nt, METHOD_ACCESS_MAP as O, siteZoneKey as On, sleep as Or, expandContainer as Ot, RecordingStatusSchema as P, streamCatalogCapability as Pn, gbToBytes as Pt, buildStreamParamsConfigSchema as Q, createStatefulExpressionMemory as Qn, mayWriteToLocation as Qt, StorageCleanupJobSchema as R, validateCustomAddress as Rn, isDefaultAppConnectionEndpoint as Rt, FIRST_LEVEL_MACRO_CLASSES as S, resolveNotificationTapAddress as Sn, nodePin as Sr, deviceStatusCapability as St, LOG_LEVEL_RANK as T, scopesAllowDeviceCap as Tn, readinessKey as Tr, enumerateSchemaFields as Tt, addonPagesCapability as U, COMPOSER_ADDON_ID as Un, legacyAutoLinkIds as Ut, StorageMigrationJobSchema as V, vectorStoreCapability as Vn, isVoidInput as Vt, addonSettingsCapability as W, buildFfmpegArgs as Wn, legacyModeOf as Wt, batteryCapability as X, compositionSliceKey as Xn, looseSchema as Xt, bareAddonId as Y, compositionItemFieldPath as Yn, logLevelAtMost as Yt, buildCapabilityLookup as Z, compositionSourceKey as Zn, mayReadLocation as Zt, DATABASE_SNAPSHOT_TIMEOUT_MS as _, resolveCoreBlockEntry as _n, emitReadiness as _r, deriveBatteryPresence as _t, BatteryStatusSchema as a, objectInputDeclaresAddonId as an, BaseAddon as ar, compositionSourceRefs as at, DeclaredDevices as b, resolveLocationMode as bn, isDeviceConfigCap as br, deviceManagerCapability as bt, CAP_NAMES_WITH_STATUS as c, pickAppLinkHub as cn, DEVICE_STATUS_METHOD as cr, coreBlockIdFromAddonId as ct, CORE_BLOCKS_ADDON_ID as d, procedureAuthKey as dn, WELL_KNOWN_TAB_MAP as dr, createDeviceExtensionProvider as dt, metricsProviderCapability as en, toExpressionValue as er, cameraGridLayoutCapability as et, CORE_BLOCK_ADDON_PREFIX as f, ptzAutotrackCapability as fn, asJsonObject as fr, dataStoreProviderCapability as ft, DATABASE_SNAPSHOT_SUFFIX as g, resolveBucketMs as gn, emitDownForOwnedCaps as gr, defineExtensionSlotProvider as gt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as h, resolveAppConnections as hn, createEvent as hr, decodeVectorBase64 as ht, BaseDevice as i, normalizeUnit as in, errMsg as ir, compositionFieldKey as it, RECORDING_SOURCE_CAMSTACK_ADDON as j, storageMigrationCapability as jn, filesystemBrowseCapability as jt, MINUTES_PER_DAY as k, snapshotCapability as kn, toNodeId as kr, expressionContainsBuiltinCall as kt, COMPOSED_ITEM_FIXED_FIELDS as l, planComposition as ln, ReadinessRegistry as lr, coreBlockSourceKind as lt, CoreBlockSchema as m, replacedFieldKeys as mn, asString$1 as mr, declarationOwnerNodeId as mt, AlertSchema as n, motionCapability as nn, DeviceRole as nr, collectSecretConfigKeys as nt, CAMERA_SWITCH_ORDER as o, objectInputDeclaresRequiredDeviceId as on, DATAPLANE_SECRET_HEADER as or, coreBlockAddonId as ot, CalendarPreferencesSchema as p, reducePoints as pn, asNumber as pr, databaseSnapshotCapability as pt, authProviderCapability as q, composedDeviceStableId as qn, locationIconKey as qt, ApiKeyRecordSchema as r, normalizeCoreBlockWrite as rn, DeviceType as rr, composerCapability as rt, CAMSTACK_APP_LINK_ORIGIN as s, parseStreamParamsFormPatch as sn, DEVICE_SETTINGS_CONTRIBUTION_METHODS as sr, coreBlockComposition as st, ALL_CAPABILITY_DEFINITIONS as t, modeMayWrite as tn, DeviceFeature as tr, checkRoleAddress as tt, COMPOSER_RUNNER_ID as u, platformProbeCapability as un, ReadinessTimeoutError as ur, coreBlocksCapability as ut, DAY_NAMES as v, resolveCoreBlockFiles as vn, expandCapMethods as vr, describeComposableCaps as vt, FieldClaimSchema as w, scopesAllowAddon as wn, parseJsonUnknown as wr, enumerateItemArrayFields as wt, DeviceStatusSchema as x, resolveMethodAuth as xn, isEvent as xr, deviceStateCapability as xt, DERIVED_CAMERA_SILENCED_CAP_NAMES as y, resolveHubAddressRoles as yn, hydrateSchema as yr, deviceExtensionCapability as yt, StorageLocationModeSchema as z, vectorDimFromBase64 as zn, isLocationEnabled as zt };
60345
+ export { buildCapabilityLookup as $, compositionSliceKey as $n, looseSchema as $t, MINUTES_PER_DAY as A, settingsStoreCapability as An, scopeKey as Ar, expandContainer as At, StorageCleanupJobSchema as B, validateComposition as Bn, isCollectionArrayMethod as Bt, FieldClaimModeSchema as C, resolveLocationMode as Cn, isDeviceConfigCap as Cr, deviceStateCapability as Ct, LegacyStorageLocationDefaultSchema as D, scopesAllowAddon as Dn, parseJsonUnknown as Dr, enumerateSchemaFields as Dt, LOG_LEVEL_RANK as E, runtimeStatePolicyFor as En, parseJsonObject as Er, enumerateItemArrayFields as Et, RUNTIME_DEFAULTS as F, storageOccupancyCapability as Fn, formatMinutes as Ft, addonPagesCapability as G, withLocationMode as Gn, kebabToCamel as Gt, StorageLocationTypeSchema as H, vectorDimFromBase64 as Hn, isLocationEnabled as Ht, RecordingStatusSchema as I, storageProviderCapability as In, gbToBytes as It, alertsCapability as J, cloneStatefulExpressionMemory as Jn, lifecycleJobSchema as Jt, addonSettingsCapability as K, COMPOSER_ADDON_ID as Kn, legacyAutoLinkIds as Kt, STORAGE_ACCESS_FALLBACK as L, streamCatalogCapability as Ln, hfModelUrl as Lt, MOTION_CLOSE_AFTER_MS as M, snapshotCapability as Mn, toNodeId as Mr, extractNestedAddonId as Mt, RECORDING_SOURCE_CAMSTACK_ADDON as N, storageCapability as Nn, EventCategory as Nr, filesystemBrowseCapability as Nt, LocationIconIdSchema as O, scopesAllowDeviceCap as On, readinessKey as Or, evaluateCompositionField as Ot, REDACTED_SECRET as P, storageMigrationCapability as Pn, foldSnapshotByFunction as Pt, batteryCapability as Q, compositionItemFieldPath as Qn, logLevelAtMost as Qt, STREAM_PROFILE_META as R, streamQualityLabel as Rn, isAppLinkBase as Rt, FIRST_LEVEL_MACRO_CLASSES as S, resolveHubAddressRoles as Sn, hydrateSchema as Sr, deviceManagerCapability as St, HF_REPO as T, resolveNotificationTapAddress as Tn, nodePin as Tr, enumerateInferenceDevices as Tt, StorageMigrationJobSchema as U, vectorIndexDimConflictError as Un, isObjectInput as Ut, StorageLocationModeSchema as V, validateCustomAddress as Vn, isDefaultAppConnectionEndpoint as Vt, UserRecordSchema as W, vectorStoreCapability as Wn, isVoidInput as Wt, backupCapability as X, composedDeviceStableId as Xn, locationIconKey as Xt, authProviderCapability as Y, composedDeviceRef as Yn, localNetworkCapability as Yt, bareAddonId as Z, compositionFeatureEnabled as Zn, logDestinationCapability as Zt, DATABASE_SNAPSHOT_TIMEOUT_MS as _, replacedFieldKeys as _n, asString$1 as _r, decodeVectorBase64 as _t, BatteryStatusSchema as a, motionCapability as an, DeviceRole as ar, composerCapability as at, DeclaredDevices as b, resolveCoreBlockEntry as bn, emitReadiness as br, describeComposableCaps as bt, CAP_NAMES_WITH_STATUS as c, objectInputDeclaresAddonId as cn, BaseAddon as cr, coreBlockAddonId as ct, CORE_BLOCKS_ADDON_ID as d, pickAppLinkHub as dn, DEVICE_STATUS_METHOD as dr, coreBlockSourceKind as dt, mayReadLocation as en, compositionSourceKey as er, buildStreamParamsConfigSchema as et, CORE_BLOCK_ADDON_PREFIX as f, planComposition as fn, ReadinessRegistry as fr, coreBlocksCapability as ft, DATABASE_SNAPSHOT_SUFFIX as g, reducePoints as gn, asNumber as gr, declarationOwnerNodeId as gt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as h, ptzAutotrackCapability as hn, asJsonObject as hr, databaseSnapshotCapability as ht, BaseDevice as i, modeMayWrite as in, DeviceFeature as ir, collectSecretConfigKeys as it, MODEL_FORMATS as j, siteZoneKey as jn, sleep as jr, expressionContainsBuiltinCall as jt, METHOD_ACCESS_MAP as k, scoreRuntimes as kn, resolveCapMount as kr, evictionPolicyOfLocation as kt, COMPOSED_ITEM_FIXED_FIELDS as l, objectInputDeclaresRequiredDeviceId as ln, DATAPLANE_SECRET_HEADER as lr, coreBlockComposition as lt, CoreBlockSchema as m, procedureAuthKey as mn, WELL_KNOWN_TAB_MAP as mr, dataStoreProviderCapability as mt, AlertSchema as n, memoizePinnedFfmpeg as nn, disarmRoseMemory as nr, cameraGridLayoutCapability as nt, CAMERA_SWITCH_ORDER as o, normalizeCoreBlockWrite as on, DeviceType as or, compositionFieldKey as ot, CalendarPreferencesSchema as p, platformProbeCapability as pn, ReadinessTimeoutError as pr, createDeviceExtensionProvider as pt, addonWidgetsCapability as q, buildFfmpegArgs as qn, legacyModeOf as qt, ApiKeyRecordSchema as r, metricsProviderCapability as rn, toExpressionValue as rr, checkRoleAddress as rt, CAMSTACK_APP_LINK_ORIGIN as s, normalizeUnit as sn, errMsg as sr, compositionSourceRefs as st, ALL_CAPABILITY_DEFINITIONS as t, mayWriteToLocation as tn, createStatefulExpressionMemory as tr, calendarsCapability as tt, COMPOSER_RUNNER_ID as u, parseStreamParamsFormPatch as un, DEVICE_SETTINGS_CONTRIBUTION_METHODS as ur, coreBlockIdFromAddonId as ut, DAY_NAMES as v, resolveAppConnections as vn, createEvent as vr, defineExtensionSlotProvider as vt, FieldClaimSchema as w, resolveMethodAuth as wn, isEvent as wr, deviceStatusCapability as wt, DeviceStatusSchema as x, resolveCoreBlockFiles as xn, expandCapMethods as xr, deviceExtensionCapability as xt, DERIVED_CAMERA_SILENCED_CAP_NAMES as y, resolveBucketMs as yn, emitDownForOwnedCaps as yr, deriveBatteryPresence as yt, ScopedTokenSchema as z, userManagementCapability as zn, isArrayOutputSchema as zt };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * GENERATED by `scripts/check-hosted-model-revisions.ts --write` — DO NOT EDIT.
3
+ *
4
+ * The revision of every artefact on the CamStack model mirror, keyed by its
5
+ * path under `https://huggingface.co/camstack/camstack-models/resolve/main/`: the sha256 (`lfs.oid`)
6
+ * of its weight file (`revisionWeightUrl`). `resolveFormatRevision` reads
7
+ * it for every catalog format hosted there (D743, D744). Regenerate after
8
+ * any upload to the mirror; the script without `--write` says when it is due.
9
+ */
10
+ export declare const HOSTED_MODEL_REVISIONS: Readonly<Record<string, string>>;
@@ -1,10 +1,12 @@
1
1
  import { ModelCatalogEntry, ModelFormat, IAddonModelManager } from '@camstack/types';
2
2
  /**
3
- * Unified model download service.
3
+ * A catalog-bound face over the shared downloader.
4
4
  *
5
- * Handles downloading model files and extra files (labels, dicts) from a
6
- * catalog of ModelCatalogEntry items. Supports single-file models and
7
- * directory bundles (e.g., .mlpackage for CoreML).
5
+ * Downloading, completeness and the revision contract (D743) are
6
+ * `ensureModel` / `isModelDownloaded`'s — this class only resolves a model id
7
+ * (and a default format) against its catalog and keys progress by model id.
8
+ * It used to carry its own copy of the download loop, which never learnt the
9
+ * revision; one rule now lives in one place.
8
10
  *
9
11
  * Addons use this via `context.models.ensure(modelId, format)`.
10
12
  */
@@ -14,7 +16,7 @@ export declare class ModelDownloadService implements IAddonModelManager {
14
16
  private readonly catalog;
15
17
  constructor(modelsDir: string, catalog: readonly ModelCatalogEntry[], onProgress?: ((modelId: string, downloaded: number, total: number) => void) | undefined);
16
18
  /**
17
- * Ensure a model (and its extra files) is downloaded.
19
+ * Ensure a model (and its extra files) is downloaded and current.
18
20
  * Returns the local filesystem path to the model file/directory.
19
21
  */
20
22
  ensure(modelId: string, format?: ModelFormat): Promise<string>;
@@ -25,17 +27,9 @@ export declare class ModelDownloadService implements IAddonModelManager {
25
27
  ensureExtraFiles(modelId: string): Promise<readonly string[]>;
26
28
  /** Absolute path to the shared models directory. */
27
29
  getModelsDir(): string;
28
- /** Check if a model file is already present on disk. */
30
+ /** True when the model is on disk, complete, and at its revision (D743). */
29
31
  isDownloaded(modelId: string, format?: ModelFormat): boolean;
30
32
  /** Get the catalog entry for a model by ID. */
31
33
  getEntry(modelId: string): ModelCatalogEntry | undefined;
32
34
  private pickDefaultFormat;
33
- private modelFilePath;
34
- /**
35
- * Download a directory bundle (e.g., .mlpackage) from HuggingFace.
36
- * ATOMIC: downloads to temp dir, renames only on complete success.
37
- */
38
- private downloadDirectory;
39
- /** Recursively list all files in a HuggingFace directory via API. */
40
- private listHfFiles;
41
35
  }
@@ -79,18 +79,60 @@ export type DownloadProgressCallback = (downloaded: number, total: number | unde
79
79
  * bundle, so a `.mlpackage` keeps exactly the hosted files.
80
80
  */
81
81
  export declare function revisionRecordPath(modelPath: string): string;
82
+ /** The CamStack model mirror. Every artefact under it has a generated revision. */
83
+ export declare const HOSTED_MODEL_MIRROR_PREFIX: string;
84
+ /**
85
+ * The revision a format must be at — the ONE rule every model download path
86
+ * reads (D743, D744). An inline `revision` wins; otherwise a format hosted on
87
+ * the CamStack mirror takes the revision generated for its path from the
88
+ * mirror's LFS metadata (`hosted-model-revisions.ts`); anything else has none.
89
+ */
90
+ export declare function resolveFormatRevision(formatEntry: ModelFormatEntry): string | undefined;
91
+ /**
92
+ * The file whose sha256 IS a format's revision: a Core ML package's
93
+ * `weight.bin`, an OpenVINO IR's `.bin` sibling, otherwise the file itself.
94
+ * `null` for a bundle that is not a Core ML package (nothing to hash).
95
+ */
96
+ export type RevisionWeightFile = {
97
+ readonly in: 'bundle';
98
+ readonly member: string;
99
+ } | {
100
+ readonly in: 'sibling';
101
+ readonly name: string;
102
+ } | {
103
+ readonly in: 'main';
104
+ };
105
+ export declare function revisionWeightFile(formatEntry: ModelFormatEntry): RevisionWeightFile | null;
106
+ /** Where the revision's weight file is hosted — what the mirror's `lfs.oid` describes. */
107
+ export declare function revisionWeightUrl(formatEntry: ModelFormatEntry): string | null;
82
108
  /**
83
109
  * Resolve a `ModelCatalogEntry` against `modelsDir`: download model file
84
110
  * (or directory bundle) + extra files (labels JSON, charset dict, …),
85
111
  * skip if already on disk. Returns the local model path.
86
112
  */
87
113
  export declare function ensureModel(modelsDir: string, entry: ModelCatalogEntry, format: ModelFormat, onProgress?: DownloadProgressCallback): Promise<string>;
114
+ /** What {@link adoptModelRevisions} found: `<modelId>/<format>` keys. */
115
+ export interface ModelRevisionAdoption {
116
+ /** Copies proven current by hash and recorded — no download needed. */
117
+ readonly adopted: readonly string[];
118
+ /** Complete copies holding other bytes — `ensureModel` fetches them again. */
119
+ readonly stale: readonly string[];
120
+ }
121
+ /**
122
+ * Walk `entries` and record the revision of every complete copy on disk that
123
+ * hashes to it, so a node's listing reports present models as downloaded
124
+ * without waiting for something to `ensureModel` them. Offline: it reads
125
+ * files and never fetches. A copy already recorded current is not re-hashed.
126
+ */
127
+ export declare function adoptModelRevisions(modelsDir: string, entries: readonly ModelCatalogEntry[]): Promise<ModelRevisionAdoption>;
88
128
  /** Compute the on-disk path for a given model + format, even when not yet downloaded. */
89
129
  export declare function getModelFilePath(modelsDir: string, entry: ModelCatalogEntry, format: ModelFormat): string | null;
90
130
  /**
91
131
  * True iff the model file (or `Manifest.json` for directory bundles) exists and
92
- * is non-empty, and — when the catalog names a `revision` — the node recorded
93
- * that same revision for it (D743).
132
+ * is non-empty, and — when the format has a revision ({@link
133
+ * resolveFormatRevision}) — the node recorded that same revision for it
134
+ * (D743). Synchronous, so it never hashes: a copy not yet proven current
135
+ * answers false until `ensureModel` or {@link adoptModelRevisions} records it.
94
136
  */
95
137
  export declare function isModelDownloaded(modelsDir: string, entry: ModelCatalogEntry, format: ModelFormat): boolean;
96
138
  /** Remove the on-disk model file/directory. Returns true if something was deleted. */