@revoengine/cli 1.0.20 → 1.0.22
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/README.md +48 -10
- package/dist/src/cli.js +5 -1
- package/dist/src/client.d.ts +37 -8
- package/dist/src/client.js +58 -0
- package/dist/src/commands/agents.d.ts +2 -0
- package/dist/src/commands/agents.js +56 -0
- package/dist/src/commands/component.js +19 -0
- package/dist/src/commands/env.js +8 -5
- package/dist/src/commands/index.d.ts +1 -0
- package/dist/src/commands/index.js +1 -0
- package/dist/src/commands/migrate.js +19 -3
- package/dist/src/commands/schedules.js +11 -9
- package/dist/src/component-contract.d.ts +8 -0
- package/dist/src/component-contract.js +68 -0
- package/dist/src/component-lock.d.ts +6 -2
- package/dist/src/component-lock.js +42 -2
- package/dist/src/database-indexes.d.ts +14 -0
- package/dist/src/database-indexes.js +124 -0
- package/dist/src/env-sync.d.ts +2 -0
- package/dist/src/env-sync.js +18 -2
- package/dist/src/metadata-backfill.js +39 -1
- package/dist/src/migration-actions.js +1 -1
- package/dist/src/migration.d.ts +9 -2
- package/dist/src/migration.js +61 -2
- package/dist/src/resource-inventory.d.ts +4 -2
- package/dist/src/resource-inventory.js +11 -1
- package/dist/src/resource-syncs/agent-sync.d.ts +98 -0
- package/dist/src/resource-syncs/agent-sync.js +612 -0
- package/dist/src/resource-syncs/database-table-sync.d.ts +3 -0
- package/dist/src/resource-syncs/database-table-sync.js +10 -6
- package/dist/src/resource-syncs/database-view-sync.d.ts +2 -4
- package/dist/src/resource-syncs/database-view-sync.js +16 -38
- package/dist/src/resource-syncs/endpoint-sync.js +53 -26
- package/dist/src/resource-syncs/job-template-sync.d.ts +1 -0
- package/dist/src/resource-syncs/job-template-sync.js +31 -10
- package/dist/src/resource-syncs/schedule-sync.d.ts +7 -3
- package/dist/src/resource-syncs/schedule-sync.js +85 -16
- package/dist/src/tracked-resources.d.ts +1 -1
- package/dist/src/tracked-resources.js +4 -2
- package/dist/src/types.d.ts +14 -0
- package/dist/src/ui.js +6 -2
- package/dist/src/workspace-diff.js +2 -0
- package/dist/src/workspace-prune.js +38 -2
- package/package.json +2 -2
|
@@ -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
|
|
730
|
+
...(changedFields.length > 0 ? { changedFields, fieldChanges } : {}),
|
|
717
731
|
};
|
|
718
732
|
const baselineHash = lock.schedules[desired.stableKey]?.environments[input.envName]?.remoteHash;
|
|
719
|
-
if (
|
|
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
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
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
|
|
1422
|
+
action,
|
|
1367
1423
|
status: 'skipped',
|
|
1368
1424
|
targetPath: candidate.targetPath,
|
|
1369
|
-
reason: 'already
|
|
1425
|
+
reason: 'already aligned',
|
|
1370
1426
|
});
|
|
1371
1427
|
continue;
|
|
1372
1428
|
}
|
|
1373
|
-
|
|
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 !==
|
|
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
|
|
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
|
|
1457
|
+
action,
|
|
1389
1458
|
status: 'failed',
|
|
1390
1459
|
targetPath: candidate.targetPath,
|
|
1391
1460
|
error: schedulePushError(error),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const TRACK_ALL_RESOURCES = "all";
|
|
2
|
-
export declare const TRACKABLE_RESOURCE_TYPES: readonly ["component", "endpoint", "group", "role-group", "job-template", "schedule", "event", "database-table", "database-view", "service-account"];
|
|
2
|
+
export declare const TRACKABLE_RESOURCE_TYPES: readonly ["component", "endpoint", "group", "role-group", "job-template", "schedule", "event", "database-table", "database-view", "service-account", "agent-plugin", "agent"];
|
|
3
3
|
export type TrackableResourceType = typeof TRACKABLE_RESOURCE_TYPES[number];
|
|
4
4
|
export type TrackedResource = typeof TRACK_ALL_RESOURCES | TrackableResourceType;
|
|
5
5
|
export declare function normalizeTrackedResources(value: string | string[] | null | undefined): TrackedResource[];
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export const TRACK_ALL_RESOURCES = 'all';
|
|
2
|
-
export const TRACKABLE_RESOURCE_TYPES = ['component', 'endpoint', 'group', 'role-group', 'job-template', 'schedule', 'event', 'database-table', 'database-view', 'service-account'];
|
|
2
|
+
export const TRACKABLE_RESOURCE_TYPES = ['component', 'endpoint', 'group', 'role-group', 'job-template', 'schedule', 'event', 'database-table', 'database-view', 'service-account', 'agent-plugin', 'agent'];
|
|
3
3
|
const RESOURCE_ALIASES = {
|
|
4
4
|
'service-account': 'service-account',
|
|
5
5
|
'service-accounts': 'service-account',
|
|
6
6
|
serviceaccount: 'service-account',
|
|
7
7
|
serviceaccounts: 'service-account',
|
|
8
|
+
agent: 'agent', agents: 'agent',
|
|
9
|
+
'agent-plugin': 'agent-plugin', 'agent-plugins': 'agent-plugin',
|
|
8
10
|
all: TRACK_ALL_RESOURCES,
|
|
9
11
|
'*': TRACK_ALL_RESOURCES,
|
|
10
12
|
component: 'component',
|
|
@@ -47,7 +49,7 @@ export function normalizeTrackedResources(value) {
|
|
|
47
49
|
}
|
|
48
50
|
const resource = RESOURCE_ALIASES[key];
|
|
49
51
|
if (!resource) {
|
|
50
|
-
throw new Error(`Unsupported tracked resource "${part.trim()}". Supported values: all, component, endpoint, group, role-group, job-template, schedule, event, database-table, database-view.`);
|
|
52
|
+
throw new Error(`Unsupported tracked resource "${part.trim()}". Supported values: all, component, endpoint, group, role-group, job-template, schedule, event, database-table, database-view, service-account, agent-plugin, agent.`);
|
|
51
53
|
}
|
|
52
54
|
if (!normalized.includes(resource)) {
|
|
53
55
|
normalized.push(resource);
|
package/dist/src/types.d.ts
CHANGED
|
@@ -16,6 +16,18 @@ export type CommandContext = {
|
|
|
16
16
|
error: (message: string) => void;
|
|
17
17
|
warn?: (message: string) => void;
|
|
18
18
|
};
|
|
19
|
+
export type AgentRecord = ComponentRecord & {
|
|
20
|
+
agentId?: string;
|
|
21
|
+
serviceAccountUserId?: string;
|
|
22
|
+
config?: Record<string, unknown>;
|
|
23
|
+
policy?: Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
export type AgentPluginRecord = ComponentRecord & {
|
|
26
|
+
agentPluginId?: string;
|
|
27
|
+
pluginSlug?: string;
|
|
28
|
+
kind?: string;
|
|
29
|
+
config?: Record<string, unknown>;
|
|
30
|
+
};
|
|
19
31
|
export type ComponentElementRecord = {
|
|
20
32
|
componentElementId?: string;
|
|
21
33
|
key: string;
|
|
@@ -150,6 +162,7 @@ export type EndpointRecord = {
|
|
|
150
162
|
method?: string;
|
|
151
163
|
componentId?: string | null;
|
|
152
164
|
componentVersion?: number | null;
|
|
165
|
+
componentDigest?: string | null;
|
|
153
166
|
active?: boolean;
|
|
154
167
|
parts?: number;
|
|
155
168
|
options?: EndpointOptions | null;
|
|
@@ -251,6 +264,7 @@ export type JobTemplateRecord = {
|
|
|
251
264
|
componentId?: string;
|
|
252
265
|
component?: ComponentRecord;
|
|
253
266
|
componentVersion?: number | null;
|
|
267
|
+
componentDigest?: string | null;
|
|
254
268
|
timeout?: number;
|
|
255
269
|
triggerUser?: string | null;
|
|
256
270
|
options?: unknown;
|
package/dist/src/ui.js
CHANGED
|
@@ -146,6 +146,10 @@ function renderCommandCatalog() {
|
|
|
146
146
|
commandRow('revo endpoints plan --all [--project <name>] [--json] [--strict]', 'Preview Endpoint state and Component compatibility'),
|
|
147
147
|
commandRow('revo endpoints push --all [--project <name>] [--yes] [--force]', 'Deploy and verify managed endpoints'),
|
|
148
148
|
'',
|
|
149
|
+
paintHeader('Agents and Agent Plugins'),
|
|
150
|
+
commandRow('revo agents <pull|plan|push> --all [--project <name>] [--json]', 'Sync Agent definitions; memory and execution state stay local'),
|
|
151
|
+
commandRow('revo agent-plugins <pull|plan|push> --all [--project <name>] [--json]', 'Sync tools, MCP servers, skills and packages'),
|
|
152
|
+
'',
|
|
149
153
|
paintHeader('Access'),
|
|
150
154
|
commandRow('revo service-accounts pull --all [--project <name>] [--force]', 'Pull portable service-account definitions'),
|
|
151
155
|
commandRow('revo service-accounts plan --all [--project <name>] [--json] [--strict]', 'Plan accounts, owners and manual credential setup'),
|
|
@@ -163,7 +167,7 @@ function renderCommandCatalog() {
|
|
|
163
167
|
commandRow('revo job-templates push --all [--project <name>] --yes [--force] [--json]', 'Create or safely update job templates with live lock checks'),
|
|
164
168
|
commandRow('revo schedules pull --all [--project <name>] [--force]', 'Pull Job Template and Materialized View schedules into the configured workspace'),
|
|
165
169
|
commandRow('revo schedules plan --all [--project <name>] [--json] [--strict]', 'Preview workspace, lock, target schedules, and portable dependencies'),
|
|
166
|
-
commandRow('revo schedules push --all [--project <name>] --yes [--force] [--activate] [--json]', '
|
|
170
|
+
commandRow('revo schedules push --all [--project <name>] --yes [--force] [--activate] [--json]', 'Sync Schedule definitions; --activate also aligns enabled/disabled state'),
|
|
167
171
|
commandRow('revo events pull --all [--project <name>] [--force] [--json]', 'Pull portable Job Template Event definitions into the configured workspace'),
|
|
168
172
|
commandRow('revo events plan --all [--project <name>] [--json] [--strict]', 'Preview Event manifests, lock baselines, target state, and Job Template dependencies'),
|
|
169
173
|
commandRow('revo events push --all [--project <name>] --yes [--force] [--activate] [--json]', 'Create or safely update disabled-by-default Event definitions'),
|
|
@@ -177,7 +181,7 @@ function renderCommandCatalog() {
|
|
|
177
181
|
commandRow('revo diff [--json]', 'Show only workspace-to-target resource differences without writes'),
|
|
178
182
|
commandRow('revo plan [--prune] [--out file] [--force] [--strict] [--json] [--hints]', 'Plan tracked workspace upserts and optional Stable Key deletions without writes'),
|
|
179
183
|
commandRow('revo deploy [--yes] [--prune] [--reviewed-plan file] [--force] [--json]', 'Review, confirm, deploy and prune tracked resources in dependency order'),
|
|
180
|
-
commandRow('revo migrate plan --from <env> --to <env> [--resources <list>] [--skip-groups] [--force] [--json] [--hints]', 'Preview
|
|
184
|
+
commandRow('revo migrate plan --from <env> --to <env> [--resources <list>] [--skip-groups] [--force] [--json] [--hints]', 'Preview twelve resource families and identity dependencies'),
|
|
181
185
|
commandRow('revo migrate run --from <env> --to <env> [--resources <list>] [--skip-groups] --yes [--force] [--json]', 'Pull, plan, migrate, and verify resources in dependency order'),
|
|
182
186
|
commandRow('revo migrate verify --from <env> --to <env> [--resources <list>] [--json]', 'Verify target resources against a fresh temporary source pull'),
|
|
183
187
|
commandRow('revo search <CODE|SIMPLE> <term>', 'Search code references or all platform content'),
|
|
@@ -9,6 +9,8 @@ function resourceItems(plan, resource) {
|
|
|
9
9
|
case 'schedule': return plan.schedules?.items || [];
|
|
10
10
|
case 'event': return plan.events?.items || [];
|
|
11
11
|
case 'group': return plan.groups?.items || [];
|
|
12
|
+
case 'agent': return plan.agents?.items || [];
|
|
13
|
+
case 'agent-plugin': return plan.agentPlugins?.items || [];
|
|
12
14
|
case 'service-account': return plan.serviceAccounts?.items || [];
|
|
13
15
|
case 'role-group': return plan.roleGroups?.items || [];
|
|
14
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { agentDependencies } from "./resource-syncs/agent-sync.js";
|
|
1
2
|
import fs from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { hashStable, readComponentLock, removeComponentLockBaseline, writeComponentLock } from "./component-lock.js";
|
|
@@ -7,6 +8,8 @@ import { normalizeStableKeyValue, readConfiguredResourceMetadataStableKey } from
|
|
|
7
8
|
import { isBuiltinSystemAccount } from "./resource-syncs/account-principal.js";
|
|
8
9
|
import { findManifestFiles, isRecord, requireProjectLayout } from "./resource-syncs/util.js";
|
|
9
10
|
const manifests = {
|
|
11
|
+
agent: ['Agents', 'agent.json'],
|
|
12
|
+
'agent-plugin': ['AgentPlugins', 'agent-plugin.json'],
|
|
10
13
|
component: ['Components', 'component.json'],
|
|
11
14
|
'job-template': ['JobTemplates', 'job-template.json'],
|
|
12
15
|
endpoint: ['Endpoints', 'endpoint.json'],
|
|
@@ -19,7 +22,7 @@ const manifests = {
|
|
|
19
22
|
'service-account': ['ServiceAccounts', 'service-account.json'],
|
|
20
23
|
};
|
|
21
24
|
const deletionOrder = [
|
|
22
|
-
'event', 'schedule', 'endpoint', 'job-template', 'component',
|
|
25
|
+
'agent', 'agent-plugin', 'event', 'schedule', 'endpoint', 'job-template', 'component',
|
|
23
26
|
'database-view', 'database-table', 'role-group', 'service-account', 'group',
|
|
24
27
|
];
|
|
25
28
|
function key(resource, identity) {
|
|
@@ -65,6 +68,9 @@ function localReferences(resource, manifest) {
|
|
|
65
68
|
if (typeof value === 'string' && value)
|
|
66
69
|
refs.push({ resource: family, identity: value });
|
|
67
70
|
};
|
|
71
|
+
if (resource === 'agent' || resource === 'agent-plugin')
|
|
72
|
+
for (const [family, dependency] of agentDependencies(manifest))
|
|
73
|
+
add(family, dependency);
|
|
68
74
|
if (resource === 'job-template' && isRecord(manifest.component))
|
|
69
75
|
add('component', manifest.component.stableKey);
|
|
70
76
|
if (resource === 'endpoint') {
|
|
@@ -102,6 +108,29 @@ function remoteReferences(resource, record, tables) {
|
|
|
102
108
|
if (typeof value === 'string' && value)
|
|
103
109
|
refs.push({ resource: family, identity: value, targetLocal });
|
|
104
110
|
};
|
|
111
|
+
if (resource === 'agent')
|
|
112
|
+
add('service-account', record.serviceAccountUserId);
|
|
113
|
+
const sections = resource === 'agent' ? [record.config, record.policy] : resource === 'agent-plugin' ? [record.config] : [];
|
|
114
|
+
function pluginRefs(value) {
|
|
115
|
+
if (!isRecord(value))
|
|
116
|
+
return;
|
|
117
|
+
add('component', value.componentId);
|
|
118
|
+
for (const kind of ['skill', 'package'])
|
|
119
|
+
if (isRecord(value[kind]) && Array.isArray(value[kind].pluginIds))
|
|
120
|
+
for (const id of value[kind].pluginIds)
|
|
121
|
+
add('agent-plugin', id);
|
|
122
|
+
}
|
|
123
|
+
for (const section of sections)
|
|
124
|
+
if (isRecord(section)) {
|
|
125
|
+
for (const field of ['pluginIds', 'eagerPluginIds'])
|
|
126
|
+
if (Array.isArray(section[field]))
|
|
127
|
+
for (const id of section[field])
|
|
128
|
+
add('agent-plugin', id);
|
|
129
|
+
if (Array.isArray(section.plugins))
|
|
130
|
+
for (const plugin of section.plugins)
|
|
131
|
+
pluginRefs(plugin);
|
|
132
|
+
pluginRefs(section);
|
|
133
|
+
}
|
|
105
134
|
if (resource === 'job-template' || resource === 'endpoint')
|
|
106
135
|
add('component', record.componentId);
|
|
107
136
|
if (resource === 'endpoint' && isRecord(record.options))
|
|
@@ -187,6 +216,8 @@ export function planWorkspacePrune(input) {
|
|
|
187
216
|
keys.add(identity);
|
|
188
217
|
if (!input.resources.includes(resource) || input.local[resource]?.has(identity))
|
|
189
218
|
continue;
|
|
219
|
+
if (resource === 'agent' || resource === 'agent-plugin')
|
|
220
|
+
blockers.push(`Prune of ${resource} is not supported; remove it explicitly after reviewing runs and dependencies.`);
|
|
190
221
|
if (resource === 'service-account' && (record.serviceAccount !== true || id === input.actorId)) {
|
|
191
222
|
blockers.push(`Cannot prune the authenticated account or a human account "${stableKey}".`);
|
|
192
223
|
}
|
|
@@ -308,7 +339,11 @@ export async function buildWorkspacePrunePlan(input) {
|
|
|
308
339
|
if (resources.has('component')) {
|
|
309
340
|
resources.add('job-template');
|
|
310
341
|
resources.add('endpoint');
|
|
342
|
+
resources.add('agent-plugin');
|
|
343
|
+
resources.add('agent');
|
|
311
344
|
}
|
|
345
|
+
if (resources.has('agent-plugin'))
|
|
346
|
+
resources.add('agent');
|
|
312
347
|
if (resources.has('job-template')) {
|
|
313
348
|
resources.add('event');
|
|
314
349
|
resources.add('schedule');
|
|
@@ -324,6 +359,7 @@ export async function buildWorkspacePrunePlan(input) {
|
|
|
324
359
|
resources.add('group');
|
|
325
360
|
resources.add('service-account');
|
|
326
361
|
resources.add('job-template');
|
|
362
|
+
resources.add('agent');
|
|
327
363
|
}
|
|
328
364
|
const local = readPruneManifests(input.cwd, input.resources);
|
|
329
365
|
const inventory = {};
|
|
@@ -373,7 +409,7 @@ function clearPruneBaseline(cwd, envName, item) {
|
|
|
373
409
|
const fields = {
|
|
374
410
|
'job-template': 'jobTemplates', endpoint: 'endpoints', schedule: 'schedules', event: 'events',
|
|
375
411
|
'database-table': 'databaseSchemas', 'database-view': 'databaseViews', group: 'groups',
|
|
376
|
-
'role-group': 'roleGroups', 'service-account': 'serviceAccounts',
|
|
412
|
+
'role-group': 'roleGroups', 'service-account': 'serviceAccounts', agent: 'agents', 'agent-plugin': 'agentPlugins',
|
|
377
413
|
};
|
|
378
414
|
const entries = lock[fields[item.resource]];
|
|
379
415
|
const entry = Object.values(entries).find((value) => normalizeStableKeyValue(value.stableKey) === normalizeStableKeyValue(item.stableKey));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revoengine/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
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/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/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",
|