@camstack/system 1.2.363 → 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.
- package/dist/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/addon-utils.d.ts +1 -1
- package/dist/addon-utils.js +3 -1
- package/dist/addon-utils.mjs +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-DvV1td5E.js → child-cap-dispatch-C0m_Q3S1.js} +1 -1
- package/dist/{child-cap-dispatch-CKZCOBm0.mjs → child-cap-dispatch-DVawueyL.mjs} +1 -1
- package/dist/{composition-sources-FoswqEZ-.mjs → composition-sources-BMsVkvaT.mjs} +1 -1
- package/dist/{composition-sources-DpynNuXQ.js → composition-sources-BYZglxTf.js} +1 -1
- package/dist/{dist-C-m7Stog.js → dist-B22ObVxi.js} +36 -1
- package/dist/{dist-COE6aOde.mjs → dist-BIGk6VLF.mjs} +19 -2
- package/dist/download/hosted-model-revisions.d.ts +10 -0
- package/dist/download/model-download-service.d.ts +8 -14
- package/dist/download/model-downloader.d.ts +53 -1
- package/dist/{event-loop-stall-monitor-ey4mbofz.js → event-loop-stall-monitor-B687EIFo.js} +376 -114
- package/dist/{event-loop-stall-monitor-EXjzIxDz.mjs → event-loop-stall-monitor-DxiaIssh.mjs} +359 -115
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -3
- package/dist/index.mjs +4 -4
- package/dist/{retired-settings-keys-DzYUNQaI.mjs → retired-settings-keys-C149_dvi.mjs} +1 -1
- package/dist/{retired-settings-keys-BLzKiTzp.js → retired-settings-keys-C8F8g0Oz.js} +1 -1
- package/package.json +1 -1
|
@@ -7915,7 +7915,19 @@ var ModelFormatEntrySchema = zod.z.object({
|
|
|
7915
7915
|
/** Multi-file payload (directory members or sibling files). */
|
|
7916
7916
|
files: zod.z.array(zod.z.string()).readonly().optional(),
|
|
7917
7917
|
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
7918
|
-
runtimes: zod.z.array(zod.z.enum(["python"])).readonly().optional()
|
|
7918
|
+
runtimes: zod.z.array(zod.z.enum(["python"])).readonly().optional(),
|
|
7919
|
+
/**
|
|
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
|
|
7925
|
+
* (`<file>.revision`); a copy with no record or a different one is stale
|
|
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).
|
|
7929
|
+
*/
|
|
7930
|
+
revision: zod.z.string().min(1).optional()
|
|
7919
7931
|
});
|
|
7920
7932
|
/**
|
|
7921
7933
|
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
@@ -45913,6 +45925,8 @@ Object.freeze({
|
|
|
45913
45925
|
vehicle: .65,
|
|
45914
45926
|
animal: .65
|
|
45915
45927
|
});
|
|
45928
|
+
var HF_REPO = "camstack/camstack-models";
|
|
45929
|
+
`${HF_REPO}`;
|
|
45916
45930
|
/**
|
|
45917
45931
|
* Runtime defaults -- used by ConfigManager.get() for backward compatibility
|
|
45918
45932
|
* until Plan B wires all runtime settings to the system_settings SQL table.
|
|
@@ -60191,6 +60205,9 @@ var ADDON_ID_PREFIX = "addon:";
|
|
|
60191
60205
|
function bareAddonId(id) {
|
|
60192
60206
|
return id.startsWith(ADDON_ID_PREFIX) ? id.slice(6) : id;
|
|
60193
60207
|
}
|
|
60208
|
+
function hfModelUrl(repo, path) {
|
|
60209
|
+
return `https://huggingface.co/${repo}/resolve/main/${path}`;
|
|
60210
|
+
}
|
|
60194
60211
|
var MB = 1024 * 1024;
|
|
60195
60212
|
1024 * MB, 3072 * MB;
|
|
60196
60213
|
/**
|
|
@@ -60523,6 +60540,12 @@ Object.defineProperty(exports, "FieldClaimSchema", {
|
|
|
60523
60540
|
return FieldClaimSchema;
|
|
60524
60541
|
}
|
|
60525
60542
|
});
|
|
60543
|
+
Object.defineProperty(exports, "HF_REPO", {
|
|
60544
|
+
enumerable: true,
|
|
60545
|
+
get: function() {
|
|
60546
|
+
return HF_REPO;
|
|
60547
|
+
}
|
|
60548
|
+
});
|
|
60526
60549
|
Object.defineProperty(exports, "LOG_LEVEL_RANK", {
|
|
60527
60550
|
enumerable: true,
|
|
60528
60551
|
get: function() {
|
|
@@ -60553,6 +60576,12 @@ Object.defineProperty(exports, "MINUTES_PER_DAY", {
|
|
|
60553
60576
|
return MINUTES_PER_DAY;
|
|
60554
60577
|
}
|
|
60555
60578
|
});
|
|
60579
|
+
Object.defineProperty(exports, "MODEL_FORMATS", {
|
|
60580
|
+
enumerable: true,
|
|
60581
|
+
get: function() {
|
|
60582
|
+
return MODEL_FORMATS;
|
|
60583
|
+
}
|
|
60584
|
+
});
|
|
60556
60585
|
Object.defineProperty(exports, "MOTION_CLOSE_AFTER_MS", {
|
|
60557
60586
|
enumerable: true,
|
|
60558
60587
|
get: function() {
|
|
@@ -61033,6 +61062,12 @@ Object.defineProperty(exports, "gbToBytes", {
|
|
|
61033
61062
|
return gbToBytes;
|
|
61034
61063
|
}
|
|
61035
61064
|
});
|
|
61065
|
+
Object.defineProperty(exports, "hfModelUrl", {
|
|
61066
|
+
enumerable: true,
|
|
61067
|
+
get: function() {
|
|
61068
|
+
return hfModelUrl;
|
|
61069
|
+
}
|
|
61070
|
+
});
|
|
61036
61071
|
Object.defineProperty(exports, "hydrateSchema", {
|
|
61037
61072
|
enumerable: true,
|
|
61038
61073
|
get: function() {
|
|
@@ -7915,7 +7915,19 @@ var ModelFormatEntrySchema = z.object({
|
|
|
7915
7915
|
/** Multi-file payload (directory members or sibling files). */
|
|
7916
7916
|
files: z.array(z.string()).readonly().optional(),
|
|
7917
7917
|
/** Runtime(s) that can use this format. If omitted, inferred from ModelFormat key */
|
|
7918
|
-
runtimes: z.array(z.enum(["python"])).readonly().optional()
|
|
7918
|
+
runtimes: z.array(z.enum(["python"])).readonly().optional(),
|
|
7919
|
+
/**
|
|
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
|
|
7925
|
+
* (`<file>.revision`); a copy with no record or a different one is stale
|
|
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).
|
|
7929
|
+
*/
|
|
7930
|
+
revision: z.string().min(1).optional()
|
|
7919
7931
|
});
|
|
7920
7932
|
/**
|
|
7921
7933
|
* Extra file that must be downloaded alongside the model (e.g., labels JSON, dict.txt).
|
|
@@ -45913,6 +45925,8 @@ Object.freeze({
|
|
|
45913
45925
|
vehicle: .65,
|
|
45914
45926
|
animal: .65
|
|
45915
45927
|
});
|
|
45928
|
+
var HF_REPO = "camstack/camstack-models";
|
|
45929
|
+
`${HF_REPO}`;
|
|
45916
45930
|
/**
|
|
45917
45931
|
* Runtime defaults -- used by ConfigManager.get() for backward compatibility
|
|
45918
45932
|
* until Plan B wires all runtime settings to the system_settings SQL table.
|
|
@@ -60191,6 +60205,9 @@ var ADDON_ID_PREFIX = "addon:";
|
|
|
60191
60205
|
function bareAddonId(id) {
|
|
60192
60206
|
return id.startsWith(ADDON_ID_PREFIX) ? id.slice(6) : id;
|
|
60193
60207
|
}
|
|
60208
|
+
function hfModelUrl(repo, path) {
|
|
60209
|
+
return `https://huggingface.co/${repo}/resolve/main/${path}`;
|
|
60210
|
+
}
|
|
60194
60211
|
var MB = 1024 * 1024;
|
|
60195
60212
|
1024 * MB, 3072 * MB;
|
|
60196
60213
|
/**
|
|
@@ -60325,4 +60342,4 @@ function enumerateInferenceDevices(hw) {
|
|
|
60325
60342
|
return out;
|
|
60326
60343
|
}
|
|
60327
60344
|
//#endregion
|
|
60328
|
-
export {
|
|
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
|
-
*
|
|
3
|
+
* A catalog-bound face over the shared downloader.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
/**
|
|
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
|
}
|
|
@@ -73,15 +73,67 @@ export declare function fetchJson(url: string): Promise<unknown>;
|
|
|
73
73
|
export declare function downloadModel(options: ModelDownloadOptions): Promise<ModelDownloadResult>;
|
|
74
74
|
/** Progress callback: (downloadedBytes, totalBytes | undefined) */
|
|
75
75
|
export type DownloadProgressCallback = (downloaded: number, total: number | undefined) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Where a node records the catalog `revision` of the format it downloaded:
|
|
78
|
+
* a sibling of the file or bundle, `<name>.revision` (D743). Outside the
|
|
79
|
+
* bundle, so a `.mlpackage` keeps exactly the hosted files.
|
|
80
|
+
*/
|
|
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;
|
|
76
108
|
/**
|
|
77
109
|
* Resolve a `ModelCatalogEntry` against `modelsDir`: download model file
|
|
78
110
|
* (or directory bundle) + extra files (labels JSON, charset dict, …),
|
|
79
111
|
* skip if already on disk. Returns the local model path.
|
|
80
112
|
*/
|
|
81
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>;
|
|
82
128
|
/** Compute the on-disk path for a given model + format, even when not yet downloaded. */
|
|
83
129
|
export declare function getModelFilePath(modelsDir: string, entry: ModelCatalogEntry, format: ModelFormat): string | null;
|
|
84
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* True iff the model file (or `Manifest.json` for directory bundles) exists and
|
|
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.
|
|
136
|
+
*/
|
|
85
137
|
export declare function isModelDownloaded(modelsDir: string, entry: ModelCatalogEntry, format: ModelFormat): boolean;
|
|
86
138
|
/** Remove the on-disk model file/directory. Returns true if something was deleted. */
|
|
87
139
|
export declare function deleteModelFromDisk(modelsDir: string, entry: ModelCatalogEntry, format: ModelFormat): boolean;
|