l0.DependencyControl.Updater¶
Updater ¶
Coordinates background update checks and update task lifecycle.
Constructor ¶
Creates an updater coordinator for one host script context.
| param | type | description |
|---|---|---|
| host? | string |
Host script namespace (default script_namespace). |
| config | ConfigView | The global DependencyControl config view. |
| logger? | Logger |
Instance methods¶
addTask ¶
Creates or updates a queued update task for a record.
| param | type | description |
|---|---|---|
| record | PackageRecord|table |
A record, or a plain table to construct one from. |
| targetVersion? | number|string |
Minimum version to install. |
| addFeeds? | string[] |
|
| optional? | boolean |
Treat this as an optional dependency. |
| channel? | string |
Update channel to use. |
| reason? | UpdateReason | Why the task runs; the configured update mode must allow it, and it gates interactive prompts. Defaults to AutoUpdate, the least interactive. |
Returns:
taskUpdateTask?codeUpdateStatus?detailstring?
require ¶
Ensures a module dependency is installed/updated and loadable.
| param | type | description |
|---|---|---|
| record | PackageRecord | |
| targetVersion? | number|string |
Minimum version to install. |
| addFeeds? | string[] |
|
| optional? | boolean |
Treat this as an optional dependency. |
| channel? | string |
Update channel to use. |
| reason? | UpdateReason | Defaults to DependencyResolution — the reason this method exists; a caller (e.g. an installed provider) may pass another to carry its own reason through. |
Returns:
refany— The loaded module reference, or nil when the module couldn't be provided.codeUpdateStatus? — Outcome of the update run; always present when the ref is nil, withSkippedOptionalmarking a skipped optional dependency rather than a failure.detailstring? — Error detail for a failing code, or the paradox reason when an up-to-date module then can't be loaded.
scheduleUpdate ¶
Performs a periodic non-blocking update check for a managed record.
| param | type | description |
|---|---|---|
| record | PackageRecord |
Returns:
statusUpdateStatus — The status code (the task's run result when an update actually runs).entryPathstring? — The resolved entry-point path, returned only with a ProtectedInstall status.
acquireLock ¶
Acquires the global updater lock shared across scripts and processes.
| param | type | description |
|---|---|---|
| doWait | boolean |
Wait for a concurrent update to finish instead of bailing out. |
| waitTimeout? | number |
Seconds to wait when doWait is set. |
Returns:
acquiredbooleanlockOwnerstring? — The holder script's name when acquisition failed.
renewLock ¶
Renews the updater lock's lease if we currently hold it.
releaseLock ¶
Releases the global updater lock.
Returns:
releasedboolean
Class methods¶
isRunning ¶
Reports whether an update is currently running in any script or process.
Returns:
runningbooleanholderNamestring? — The name of the script holding the updater lock.
Fields¶
| field | type | description |
|---|---|---|
| feedTrust | FeedTrust | The feed-trust model (official + user trust merge, trust queries, mutations). |
| feedLoader | FeedLoader | The shared feed loader (owns the feed cache; builds every UpdateFeed). |
| defaultMode | UpdateContextCeiling | |
| defaultCheckInterval | integer |
|
| defaultWaitTimeout | integer |
|
| defaultOrphanTimeout | integer |