@teamvibe/poller 0.7.2 → 0.8.0
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/auto-update.js +11 -4
- package/dist/config.js +6 -2
- package/package.json +1 -1
package/dist/auto-update.js
CHANGED
|
@@ -72,10 +72,17 @@ export async function checkForUpdate() {
|
|
|
72
72
|
logger.info(`[AutoUpdate] Already on latest version (${POLLER_VERSION})`);
|
|
73
73
|
return false;
|
|
74
74
|
}
|
|
75
|
-
// Check if update type is within policy
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
// Check if update type is within policy. Explicit 'off' branch (tv#312):
|
|
76
|
+
// startAutoUpdateCron() never schedules this job at all when policy is
|
|
77
|
+
// 'off', so this path is currently unreachable in practice — kept
|
|
78
|
+
// explicit so a future caller of checkForUpdate() outside the cron
|
|
79
|
+
// (manual trigger, control message) can't silently apply patch updates
|
|
80
|
+
// to a poller configured not to auto-update.
|
|
81
|
+
const policyAllows = config.AUTO_UPDATE_POLICY === 'off'
|
|
82
|
+
? false
|
|
83
|
+
: config.AUTO_UPDATE_POLICY === 'minor'
|
|
84
|
+
? updateType === 'patch' || updateType === 'minor'
|
|
85
|
+
: updateType === 'patch'; // policy === 'patch'
|
|
79
86
|
if (!policyAllows) {
|
|
80
87
|
logger.info(`[AutoUpdate] ${updateType} update available (${POLLER_VERSION} → ${latestVersion}) but policy is "${config.AUTO_UPDATE_POLICY}", skipping`);
|
|
81
88
|
return false;
|
package/dist/config.js
CHANGED
|
@@ -65,8 +65,12 @@ const configSchema = z.object({
|
|
|
65
65
|
POLLER_TZ: z.string().optional(),
|
|
66
66
|
MAINTENANCE_CRON: z.string().default('30 3 * * *'), // Daily at 03:30 in POLLER_TZ (or host TZ)
|
|
67
67
|
MAINTENANCE_ENABLED: z.string().default('true').transform((v) => v.toLowerCase() === 'true'),
|
|
68
|
-
// Auto-update settings
|
|
69
|
-
|
|
68
|
+
// Auto-update settings — defaults to 'off': most pollers run as pinned
|
|
69
|
+
// Railway container images (see Dockerfile), where an in-process
|
|
70
|
+
// `npm install -g` update can't survive the next redeploy anyway. Set
|
|
71
|
+
// explicitly (e.g. AUTO_UPDATE_POLICY=patch) for bare-metal/VM installs
|
|
72
|
+
// that actually benefit from self-updating.
|
|
73
|
+
AUTO_UPDATE_POLICY: z.enum(['patch', 'minor', 'off']).default('off'),
|
|
70
74
|
AUTO_UPDATE_SCHEDULE: z.string().default('03:00'), // HH:MM in UTC — daily check time
|
|
71
75
|
// Inbox watcher (teamvibe.ai#242): fs.watch()'s .inbox/ per tracked brain so a
|
|
72
76
|
// file dropped while no session is running (e.g. a background-task result)
|