@revoengine/cli 1.0.21 → 1.0.23

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.
@@ -359,6 +359,7 @@ function emptyPlanCounts() {
359
359
  'remote-changed': 0,
360
360
  conflict: 0,
361
361
  'missing-lock': 0,
362
+ 'activation-drift': 0,
362
363
  orphan: 0,
363
364
  collision: 0,
364
365
  skipped: 0,
@@ -375,6 +376,9 @@ export async function buildSchedulesPlan(input) {
375
376
  const blockers = [];
376
377
  const warnings = [];
377
378
  const exclusions = [];
379
+ for (const record of targetRecords)
380
+ if (record.targetVersion != null)
381
+ warnings.push(`Schedule "${String(record.name || '')}" has deprecated targetVersion=${String(record.targetVersion)}; this field does not select a Job Template revision at runtime.`);
378
382
  const items = [];
379
383
  const lockEntriesByPath = new Map(Object.values(lock.schedules).map((entry) => [entry.path, entry]));
380
384
  const identityConflictedTargetKeys = new Set();
@@ -706,17 +710,30 @@ export async function buildSchedulesPlan(input) {
706
710
  continue;
707
711
  }
708
712
  const changedFields = diffSchedules(desired, target.manifest);
713
+ const desiredActive = desired.activationCandidate;
714
+ const currentActive = target.record.active === true;
715
+ const activationDiffers = typeof desiredActive === 'boolean' && desiredActive !== currentActive;
716
+ const fieldChanges = describeFieldChanges(desired, target.manifest, changedFields);
717
+ if (activationDiffers) {
718
+ changedFields.push('active');
719
+ fieldChanges.push(...describeFieldChanges({ active: desiredActive }, { active: currentActive }, ['active']));
720
+ warnings.push(`Schedule "${desired.stableKey}" has activation drift: desired active=${desiredActive}; target active=${currentActive}. Align with schedules push --all --yes --activate.`);
721
+ }
709
722
  const common = {
710
723
  stableKey: desired.stableKey,
711
724
  name: desired.name,
712
725
  desiredHash,
713
726
  currentHash: target.hash,
727
+ ...(typeof desiredActive === 'boolean' ? { desiredActive, currentActive } : {}),
714
728
  ...dependencyDetails,
715
729
  ...planTargetDetails(desired.target),
716
- ...(changedFields.length > 0 ? { changedFields, fieldChanges: describeFieldChanges(desired, target.manifest, changedFields) } : {}),
730
+ ...(changedFields.length > 0 ? { changedFields, fieldChanges } : {}),
717
731
  };
718
732
  const baselineHash = lock.schedules[desired.stableKey]?.environments[input.envName]?.remoteHash;
719
- if (!baselineHash) {
733
+ if (desiredHash === target.hash && activationDiffers) {
734
+ items.push({ status: 'activation-drift', ...common, reason: `desired active=${desiredActive}; target active=${currentActive}`, ...(baselineHash ? { baselineHash } : {}) });
735
+ }
736
+ else if (!baselineHash) {
720
737
  items.push({ status: 'missing-lock', ...common, reason: `missing ${input.envName} lock baseline` });
721
738
  }
722
739
  else if (desiredHash === target.hash) {
@@ -777,10 +794,11 @@ export async function buildSchedulesPlan(input) {
777
794
  'remote-changed': 2,
778
795
  conflict: 3,
779
796
  'missing-lock': 4,
780
- clean: 5,
781
- orphan: 6,
782
- collision: 7,
783
- skipped: 8,
797
+ 'activation-drift': 5,
798
+ clean: 6,
799
+ orphan: 7,
800
+ collision: 8,
801
+ skipped: 9,
784
802
  };
785
803
  items.sort((left, right) => {
786
804
  const leftKey = left.stableKey || left.name;
@@ -1158,6 +1176,7 @@ async function verifyScheduleWrite(input) {
1158
1176
  if (hashPortableSchedule(verifiedManifest) !== input.desiredHash) {
1159
1177
  throw new Error('written Schedule did not match desired portable hash');
1160
1178
  }
1179
+ return schedule;
1161
1180
  }
1162
1181
  export async function pushSchedules(input) {
1163
1182
  const plan = await buildSchedulesPlan(input);
@@ -1210,7 +1229,7 @@ export async function pushSchedules(input) {
1210
1229
  await input.client.updateSchedule(live.scheduleId, buildScheduleUpdatePayload(local.manifest, live.targetId, live.schedule.version));
1211
1230
  scheduleId = live.scheduleId;
1212
1231
  }
1213
- await verifyScheduleWrite({
1232
+ const verified = await verifyScheduleWrite({
1214
1233
  client: input.client,
1215
1234
  stableKeyName: input.stableKeyName,
1216
1235
  manifest: local.manifest,
@@ -1226,7 +1245,7 @@ export async function pushSchedules(input) {
1226
1245
  remoteHash: desiredHash,
1227
1246
  });
1228
1247
  results.push({ stableKey, action, status: 'deployed', targetPath });
1229
- if (local.manifest.activationCandidate === true) {
1248
+ if (typeof local.manifest.activationCandidate === 'boolean' && (verified.active === true) !== local.manifest.activationCandidate) {
1230
1249
  verifiedActivationCandidates.push({
1231
1250
  stableKey,
1232
1251
  scheduleId,
@@ -1234,6 +1253,8 @@ export async function pushSchedules(input) {
1234
1253
  stableKeyName: input.stableKeyName,
1235
1254
  targetId: live.targetId,
1236
1255
  target: local.manifest.target,
1256
+ desiredActive: local.manifest.activationCandidate,
1257
+ portableHash: desiredHash,
1237
1258
  });
1238
1259
  }
1239
1260
  }
@@ -1263,6 +1284,35 @@ export async function pushSchedules(input) {
1263
1284
  reason: 'no local changes',
1264
1285
  });
1265
1286
  }
1287
+ for (const item of plan.items.filter((candidate) => candidate.status === 'activation-drift')) {
1288
+ const stableKey = item.stableKey || '';
1289
+ const local = localByKey.get(stableKey);
1290
+ const targetPath = local ? localTargetPath(input.cwd, local.manifestPath) : stableKey;
1291
+ try {
1292
+ if (!local || !item.desiredHash || hashPortableSchedule(local.manifest) !== item.desiredHash) {
1293
+ throw new Error('desired Schedule manifest changed after planning');
1294
+ }
1295
+ const live = await resolveLiveScheduleWriteTarget({ client: input.client, stableKeyName: input.stableKeyName,
1296
+ manifest: local.manifest, action: 'update' });
1297
+ if (!live.scheduleId || live.currentHash !== item.currentHash) {
1298
+ throw new Error('target Schedule changed after planning');
1299
+ }
1300
+ const verified = await verifyScheduleWrite({ client: input.client, stableKeyName: input.stableKeyName,
1301
+ manifest: local.manifest, scheduleId: live.scheduleId, targetId: live.targetId, desiredHash: item.desiredHash });
1302
+ updateScheduleEnvironmentBaseline({ cwd: input.cwd, envName: input.envName, manifest: local.manifest,
1303
+ manifestPath: local.manifestPath, remoteHash: item.desiredHash });
1304
+ if ((verified.active === true) !== local.manifest.activationCandidate) {
1305
+ verifiedActivationCandidates.push({ stableKey, scheduleId: live.scheduleId, targetPath,
1306
+ stableKeyName: input.stableKeyName, targetId: live.targetId, target: local.manifest.target,
1307
+ desiredActive: local.manifest.activationCandidate, portableHash: item.desiredHash });
1308
+ }
1309
+ results.push({ stableKey, action: 'noop', status: 'skipped', targetPath,
1310
+ reason: 'activation differs; re-run with --activate to align it with source' });
1311
+ }
1312
+ catch (error) {
1313
+ results.push({ stableKey, action: 'noop', status: 'failed', targetPath, error: schedulePushError(error) });
1314
+ }
1315
+ }
1266
1316
  for (const item of plan.items.filter((candidate) => (input.force === true
1267
1317
  && candidate.status === 'missing-lock'
1268
1318
  && candidate.desiredHash === candidate.currentHash))) {
@@ -1337,6 +1387,7 @@ export async function pushSchedules(input) {
1337
1387
  export async function activateVerifiedSchedules(input) {
1338
1388
  const results = [];
1339
1389
  for (const candidate of input.candidates) {
1390
+ const action = candidate.desiredActive ? 'activate' : 'disable';
1340
1391
  try {
1341
1392
  const current = unwrapData(await input.client.getSchedule(candidate.scheduleId));
1342
1393
  if (readConfiguredResourceMetadataStableKey(current, candidate.stableKeyName) !== candidate.stableKey) {
@@ -1346,6 +1397,11 @@ export async function activateVerifiedSchedules(input) {
1346
1397
  if (current.targetType !== expectedTargetType || current.targetId !== candidate.targetId) {
1347
1398
  throw new Error('target Schedule dependency changed after activation preflight');
1348
1399
  }
1400
+ const currentManifest = manifestFromRecord({ record: current, stableKey: candidate.stableKey,
1401
+ target: candidate.target, stableKeyName: candidate.stableKeyName });
1402
+ if (schedulePlanExclusionReason(current) || hashPortableSchedule(currentManifest) !== candidate.portableHash) {
1403
+ throw new Error('target Schedule definition changed after activation preflight');
1404
+ }
1349
1405
  if (candidate.target.type === 'MATERIALIZED_VIEW'
1350
1406
  && materializedRefreshMode(current) !== candidate.target.refreshMode) {
1351
1407
  throw new Error('target Schedule materialized view refresh mode changed after activation preflight');
@@ -1360,24 +1416,37 @@ export async function activateVerifiedSchedules(input) {
1360
1416
  !== targetDependencyStableKey(candidate.target)) {
1361
1417
  throw new Error('target Schedule dependency stable key changed after activation preflight');
1362
1418
  }
1363
- if (current.active === true) {
1419
+ if ((current.active === true) === candidate.desiredActive) {
1364
1420
  results.push({
1365
1421
  stableKey: candidate.stableKey,
1366
- action: 'activate',
1422
+ action,
1367
1423
  status: 'skipped',
1368
1424
  targetPath: candidate.targetPath,
1369
- reason: 'already active',
1425
+ reason: 'already aligned',
1370
1426
  });
1371
1427
  continue;
1372
1428
  }
1373
- await input.client.activateSchedule(candidate.scheduleId);
1429
+ if (candidate.desiredActive) {
1430
+ await input.client.activateSchedule(candidate.scheduleId);
1431
+ }
1432
+ else {
1433
+ await input.client.disableSchedule(candidate.scheduleId);
1434
+ }
1374
1435
  const verified = unwrapData(await input.client.getSchedule(candidate.scheduleId));
1375
- if (verified.active !== true) {
1376
- throw new Error('activation did not leave the Schedule active');
1436
+ if (verified.active !== candidate.desiredActive) {
1437
+ throw new Error('activation did not leave the Schedule in the desired active state');
1438
+ }
1439
+ const verifiedManifest = manifestFromRecord({ record: verified, stableKey: candidate.stableKey,
1440
+ target: candidate.target, stableKeyName: candidate.stableKeyName });
1441
+ if (readConfiguredResourceMetadataStableKey(verified, candidate.stableKeyName) !== candidate.stableKey
1442
+ || verified.targetType !== expectedTargetType || verified.targetId !== candidate.targetId
1443
+ || (candidate.target.type === 'MATERIALIZED_VIEW' && materializedRefreshMode(verified) !== candidate.target.refreshMode)
1444
+ || hashPortableSchedule(verifiedManifest) !== candidate.portableHash) {
1445
+ throw new Error('activated Schedule definition does not match the verified candidate');
1377
1446
  }
1378
1447
  results.push({
1379
1448
  stableKey: candidate.stableKey,
1380
- action: 'activate',
1449
+ action,
1381
1450
  status: 'deployed',
1382
1451
  targetPath: candidate.targetPath,
1383
1452
  });
@@ -1385,7 +1454,7 @@ export async function activateVerifiedSchedules(input) {
1385
1454
  catch (error) {
1386
1455
  results.push({
1387
1456
  stableKey: candidate.stableKey,
1388
- action: 'activate',
1457
+ action,
1389
1458
  status: 'failed',
1390
1459
  targetPath: candidate.targetPath,
1391
1460
  error: schedulePushError(error),
@@ -162,6 +162,7 @@ export type EndpointRecord = {
162
162
  method?: string;
163
163
  componentId?: string | null;
164
164
  componentVersion?: number | null;
165
+ componentDigest?: string | null;
165
166
  active?: boolean;
166
167
  parts?: number;
167
168
  options?: EndpointOptions | null;
@@ -263,6 +264,7 @@ export type JobTemplateRecord = {
263
264
  componentId?: string;
264
265
  component?: ComponentRecord;
265
266
  componentVersion?: number | null;
267
+ componentDigest?: string | null;
266
268
  timeout?: number;
267
269
  triggerUser?: string | null;
268
270
  options?: unknown;
package/dist/src/ui.js CHANGED
@@ -167,7 +167,7 @@ function renderCommandCatalog() {
167
167
  commandRow('revo job-templates push --all [--project <name>] --yes [--force] [--json]', 'Create or safely update job templates with live lock checks'),
168
168
  commandRow('revo schedules pull --all [--project <name>] [--force]', 'Pull Job Template and Materialized View schedules into the configured workspace'),
169
169
  commandRow('revo schedules plan --all [--project <name>] [--json] [--strict]', 'Preview workspace, lock, target schedules, and portable dependencies'),
170
- commandRow('revo schedules push --all [--project <name>] --yes [--force] [--activate] [--json]', 'Create or safely update disabled-by-default Schedule definitions'),
170
+ commandRow('revo schedules push --all [--project <name>] --yes [--force] [--activate] [--json]', 'Sync Schedule definitions; --activate also aligns enabled/disabled state'),
171
171
  commandRow('revo events pull --all [--project <name>] [--force] [--json]', 'Pull portable Job Template Event definitions into the configured workspace'),
172
172
  commandRow('revo events plan --all [--project <name>] [--json] [--strict]', 'Preview Event manifests, lock baselines, target state, and Job Template dependencies'),
173
173
  commandRow('revo events push --all [--project <name>] --yes [--force] [--activate] [--json]', 'Create or safely update disabled-by-default Event definitions'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revoengine/cli",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "CLI package for the RevoEngine Platform API",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -11,7 +11,7 @@
11
11
  "scripts": {
12
12
  "build": "npm run clean && tsc -p tsconfig.build.json",
13
13
  "clean": "node --input-type=module -e \"import fs from 'node:fs'; fs.rmSync('dist', { recursive: true, force: true });\"",
14
- "check": "node --input-type=module -e \"await import('./src/config.ts'); await import('./src/legacy.ts'); await import('./src/http-trace.ts'); await import('./src/request-queue.ts'); await import('./src/client.ts'); await import('./src/component-lock.ts'); await import('./src/diff-details.ts'); await import('./src/resource-metadata.ts'); await import('./src/tracked-resources.ts'); await import('./src/resource-inventory.ts'); await import('./src/metadata-backfill.ts'); await import('./src/workspace-component.ts'); await import('./src/workspace-resource.ts'); await import('./src/database-table-artifacts.ts'); await import('./src/project.ts'); await import('./src/prompt.ts'); await import('./src/runtime-view.ts'); await import('./src/spinner.ts'); await import('./src/types.ts'); await import('./src/utils.ts'); await import('./src/resource-syncs/util.ts'); await import('./src/resource-syncs/agent-sync.ts'); await import('./src/resource-syncs/database-table-sync.ts'); await import('./src/resource-syncs/database-view-sync.ts'); await import('./src/resource-syncs/endpoint-sync.ts'); await import('./src/resource-syncs/group-sync.ts'); await import('./src/resource-syncs/role-group-sync.ts'); await import('./src/resource-syncs/job-template-sync.ts'); await import('./src/resource-syncs/schedule-sync.ts'); await import('./src/resource-syncs/event-sync.ts'); await import('./src/resource-syncs/account-principal.ts'); await import('./src/resource-syncs/identity-migration.ts'); await import('./src/resource-syncs/service-account-sync.ts'); await import('./src/commands/service-accounts.ts'); await import('./src/commands/agents.ts'); await import('./src/migration-actions.ts'); await import('./src/migration.ts'); await import('./src/workspace-diff.ts'); await import('./src/workspace-prune.ts'); await import('./src/sync-output.ts'); await import('./src/ui.ts'); await import('./src/update-notifier.ts'); await import('./src/env-sync.ts'); await import('./src/commands/auth.ts'); await import('./src/commands/component.ts'); await import('./src/commands/database-tables.ts'); await import('./src/commands/database-views.ts'); await import('./src/commands/endpoints.ts'); await import('./src/commands/env.ts'); await import('./src/commands/events.ts'); await import('./src/commands/groups.ts'); await import('./src/commands/info.ts'); await import('./src/commands/job-templates.ts'); await import('./src/commands/metadata.ts'); await import('./src/commands/migrate.ts'); await import('./src/commands/request.ts'); await import('./src/commands/role-groups.ts'); await import('./src/commands/search.ts'); await import('./src/commands/schedules.ts'); await import('./src/commands/terminal-service.ts'); await import('./src/commands/terminal-browser.ts'); await import('./src/commands/terminal-image.ts'); await import('./src/commands/terminal-sandbox.ts'); await import('./src/commands/terminal-patch.ts'); await import('./src/commands/terminal-patch-worker.ts'); await import('./src/commands/terminal.ts'); await import('./src/cli.ts'); await import('./src/index.ts'); await import('./bin/revo.ts'); await import('./scripts/dev.ts')\"",
14
+ "check": "node --input-type=module -e \"await import('./src/config.ts'); await import('./src/legacy.ts'); await import('./src/http-trace.ts'); await import('./src/request-queue.ts'); await import('./src/client.ts'); await import('./src/component-lock.ts'); await import('./src/component-contract.ts'); await import('./src/database-indexes.ts'); await import('./src/diff-details.ts'); await import('./src/resource-metadata.ts'); await import('./src/tracked-resources.ts'); await import('./src/resource-inventory.ts'); await import('./src/metadata-backfill.ts'); await import('./src/workspace-component.ts'); await import('./src/workspace-resource.ts'); await import('./src/database-table-artifacts.ts'); await import('./src/project.ts'); await import('./src/prompt.ts'); await import('./src/runtime-view.ts'); await import('./src/spinner.ts'); await import('./src/types.ts'); await import('./src/utils.ts'); await import('./src/resource-syncs/util.ts'); await import('./src/resource-syncs/agent-sync.ts'); await import('./src/resource-syncs/database-table-sync.ts'); await import('./src/resource-syncs/database-view-sync.ts'); await import('./src/resource-syncs/endpoint-sync.ts'); await import('./src/resource-syncs/group-sync.ts'); await import('./src/resource-syncs/role-group-sync.ts'); await import('./src/resource-syncs/job-template-sync.ts'); await import('./src/resource-syncs/schedule-sync.ts'); await import('./src/resource-syncs/event-sync.ts'); await import('./src/resource-syncs/account-principal.ts'); await import('./src/resource-syncs/identity-migration.ts'); await import('./src/resource-syncs/service-account-sync.ts'); await import('./src/commands/service-accounts.ts'); await import('./src/commands/agents.ts'); await import('./src/migration-actions.ts'); await import('./src/migration.ts'); await import('./src/workspace-diff.ts'); await import('./src/workspace-prune.ts'); await import('./src/sync-output.ts'); await import('./src/ui.ts'); await import('./src/update-notifier.ts'); await import('./src/env-sync.ts'); await import('./src/commands/auth.ts'); await import('./src/commands/component.ts'); await import('./src/commands/database-tables.ts'); await import('./src/commands/database-views.ts'); await import('./src/commands/endpoints.ts'); await import('./src/commands/env.ts'); await import('./src/commands/events.ts'); await import('./src/commands/groups.ts'); await import('./src/commands/info.ts'); await import('./src/commands/job-templates.ts'); await import('./src/commands/metadata.ts'); await import('./src/commands/migrate.ts'); await import('./src/commands/request.ts'); await import('./src/commands/role-groups.ts'); await import('./src/commands/search.ts'); await import('./src/commands/schedules.ts'); await import('./src/commands/terminal-service.ts'); await import('./src/commands/terminal-browser.ts'); await import('./src/commands/terminal-image.ts'); await import('./src/commands/terminal-sandbox.ts'); await import('./src/commands/terminal-patch.ts'); await import('./src/commands/terminal-patch-worker.ts'); await import('./src/commands/terminal.ts'); await import('./src/cli.ts'); await import('./src/index.ts'); await import('./bin/revo.ts'); await import('./scripts/dev.ts')\"",
15
15
  "dev": "node ./scripts/dev.ts",
16
16
  "prepack": "npm run build",
17
17
  "test": "node --test ./test/*.test.ts",