@revoengine/cli 1.0.31 → 1.0.34
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/CHANGELOG.md +25 -0
- package/README.md +152 -24
- package/dist/src/argument-contract.d.ts +17 -0
- package/dist/src/argument-contract.js +359 -0
- package/dist/src/automation-contract.generated.d.ts +56 -22
- package/dist/src/automation-contract.generated.js +68 -26
- package/dist/src/cli.js +15 -13
- package/dist/src/client.d.ts +34 -2
- package/dist/src/client.js +76 -13
- package/dist/src/commands/agents.js +5 -1
- package/dist/src/commands/auth.js +2 -0
- package/dist/src/commands/component.js +34 -17
- package/dist/src/commands/database-tables.js +15 -4
- package/dist/src/commands/database-views.js +5 -1
- package/dist/src/commands/endpoints.js +5 -1
- package/dist/src/commands/env.js +5 -1
- package/dist/src/commands/events.js +5 -1
- package/dist/src/commands/groups.js +5 -1
- package/dist/src/commands/info.js +2 -0
- package/dist/src/commands/job-templates.js +5 -1
- package/dist/src/commands/metadata.js +2 -0
- package/dist/src/commands/migrate.d.ts +2 -2
- package/dist/src/commands/migrate.js +33 -7
- package/dist/src/commands/project.js +19 -14
- package/dist/src/commands/request.js +2 -0
- package/dist/src/commands/role-groups.js +5 -1
- package/dist/src/commands/schedules.js +5 -1
- package/dist/src/commands/search.js +2 -0
- package/dist/src/commands/service-accounts.js +5 -1
- package/dist/src/commands/studio.js +2 -0
- package/dist/src/commands/terminal-browser-central-profile.d.ts +65 -0
- package/dist/src/commands/terminal-browser-central-profile.js +203 -0
- package/dist/src/commands/terminal-browser-human-input.d.ts +3 -1
- package/dist/src/commands/terminal-browser-human-input.js +3 -1
- package/dist/src/commands/terminal-browser-interaction.js +1 -1
- package/dist/src/commands/terminal-browser-live-protocol.d.ts +34 -2
- package/dist/src/commands/terminal-browser-live-protocol.js +28 -12
- package/dist/src/commands/terminal-browser-live-transport.d.ts +1 -0
- package/dist/src/commands/terminal-browser-live-transport.js +9 -5
- package/dist/src/commands/terminal-browser-live.d.ts +24 -3
- package/dist/src/commands/terminal-browser-live.js +199 -30
- package/dist/src/commands/terminal-browser-page-input.d.ts +4 -1
- package/dist/src/commands/terminal-browser-page-input.js +46 -1
- package/dist/src/commands/terminal-browser-profile-crypto.d.ts +30 -0
- package/dist/src/commands/terminal-browser-profile-crypto.js +101 -0
- package/dist/src/commands/terminal-browser-profile-import-runner.d.ts +31 -0
- package/dist/src/commands/terminal-browser-profile-import-runner.js +112 -0
- package/dist/src/commands/terminal-browser-profile-import.d.ts +28 -0
- package/dist/src/commands/terminal-browser-profile-import.js +125 -0
- package/dist/src/commands/terminal-browser-profile-import.protocol.d.ts +50 -0
- package/dist/src/commands/terminal-browser-profile-import.protocol.js +52 -0
- package/dist/src/commands/terminal-browser-profile-preferences.d.ts +1 -0
- package/dist/src/commands/terminal-browser-profile-preferences.js +16 -0
- package/dist/src/commands/terminal-browser-profile-sync.d.ts +14 -0
- package/dist/src/commands/terminal-browser-profile-sync.js +169 -0
- package/dist/src/commands/terminal-browser-profile-sync.protocol.d.ts +50 -0
- package/dist/src/commands/terminal-browser-profile-sync.protocol.js +19 -0
- package/dist/src/commands/terminal-browser-profile.d.ts +10 -1
- package/dist/src/commands/terminal-browser-profile.js +30 -4
- package/dist/src/commands/terminal-browser-recording.d.ts +39 -0
- package/dist/src/commands/terminal-browser-recording.js +74 -0
- package/dist/src/commands/terminal-browser-recording.protocol.d.ts +49 -0
- package/dist/src/commands/terminal-browser-recording.protocol.js +16 -0
- package/dist/src/commands/terminal-browser.d.ts +14 -1
- package/dist/src/commands/terminal-browser.js +98 -33
- package/dist/src/commands/terminal-file-descriptor.d.ts +9 -0
- package/dist/src/commands/terminal-file-descriptor.js +39 -0
- package/dist/src/commands/terminal-file.js +41 -6
- package/dist/src/commands/terminal-image.js +3 -31
- package/dist/src/commands/terminal-output-buffer.d.ts +18 -1
- package/dist/src/commands/terminal-output-buffer.js +95 -8
- package/dist/src/commands/terminal-process-group.d.ts +25 -0
- package/dist/src/commands/terminal-process-group.js +144 -0
- package/dist/src/commands/terminal.d.ts +3 -1
- package/dist/src/commands/terminal.js +366 -80
- package/dist/src/commands/tests.js +2 -0
- package/dist/src/component-lock.d.ts +15 -1
- package/dist/src/component-lock.js +96 -10
- package/dist/src/env-sync.js +12 -6
- package/dist/src/migration.d.ts +7 -0
- package/dist/src/migration.js +39 -21
- package/dist/src/planning-snapshot.d.ts +3 -0
- package/dist/src/planning-snapshot.js +60 -2
- package/dist/src/project.d.ts +1 -0
- package/dist/src/project.js +7 -8
- package/dist/src/resource-syncs/agent-sync.js +76 -24
- package/dist/src/resource-syncs/database-table-sync.d.ts +8 -1
- package/dist/src/resource-syncs/database-table-sync.js +66 -32
- package/dist/src/resource-syncs/database-view-sync.js +41 -28
- package/dist/src/resource-syncs/endpoint-sync.js +90 -18
- package/dist/src/resource-syncs/event-sync.js +33 -14
- package/dist/src/resource-syncs/group-sync.js +21 -11
- package/dist/src/resource-syncs/job-template-sync.js +98 -37
- package/dist/src/resource-syncs/role-group-sync.js +22 -11
- package/dist/src/resource-syncs/schedule-sync.js +26 -11
- package/dist/src/resource-syncs/service-account-sync.js +22 -11
- package/dist/src/reviewed-plan.js +3 -0
- package/dist/src/runtime-view.js +2 -18
- package/dist/src/sync-omit-command.d.ts +6 -0
- package/dist/src/sync-omit-command.js +49 -0
- package/dist/src/sync-omit-write-fence.d.ts +10 -0
- package/dist/src/sync-omit-write-fence.js +134 -0
- package/dist/src/sync-omit.d.ts +59 -0
- package/dist/src/sync-omit.js +469 -0
- package/dist/src/sync-output.d.ts +3 -3
- package/dist/src/ui.js +11 -5
- package/dist/src/update-notifier.d.ts +1 -1
- package/dist/src/update-notifier.js +2 -1
- package/dist/src/utils.js +46 -17
- package/dist/src/workspace-prune.js +11 -3
- package/dist/src/workspace-write-lock.d.ts +7 -0
- package/dist/src/workspace-write-lock.js +144 -0
- package/package.json +6 -5
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import { isInteractiveTerminal, promptConfirm } from "../prompt.js";
|
|
2
3
|
import { readProjectStableKeyName } from "../project.js";
|
|
3
4
|
import { resolveResourceTarget } from "../resource-target.js";
|
|
4
5
|
import { buildDatabaseSchemasPlan, pullDatabaseSchemasToWorkspace, pushDatabaseSchemas } from "../resource-syncs/database-table-sync.js";
|
|
5
6
|
import { planValueChanges, printSyncPlan, printSyncStatus, printSyncSummary } from "../sync-output.js";
|
|
6
|
-
import { readBoolFlag } from "../utils.js";
|
|
7
|
-
|
|
7
|
+
import { readBoolFlag, readFlag } from "../utils.js";
|
|
8
|
+
async function executeDatabaseTablesCommand(context) {
|
|
8
9
|
const subcommand = context.args._[1] || '';
|
|
9
10
|
if (subcommand !== 'pull' && subcommand !== 'plan' && subcommand !== 'push') {
|
|
10
11
|
throw new Error('Unknown database-tables command. Usage: revo database-tables <pull|plan|push> --all [--env <name>]');
|
|
11
12
|
}
|
|
12
13
|
const selectedStableKey = context.args._[2];
|
|
14
|
+
if (readFlag(context.args, ['idempotency-key']) && !selectedStableKey)
|
|
15
|
+
throw new Error('--idempotency-key requires one explicit Database Table Stable Key.');
|
|
16
|
+
const asyncExecution = readBoolFlag(context.args, ['async']);
|
|
17
|
+
if (asyncExecution && subcommand !== 'push')
|
|
18
|
+
throw new Error('--async is supported only for Database Table push.');
|
|
13
19
|
const all = readBoolFlag(context.args, ['all', 'a']);
|
|
14
20
|
const skipPartitions = readBoolFlag(context.args, ['skip-partitions']);
|
|
15
21
|
const pruneOrphans = readBoolFlag(context.args, ['prune-orphans']);
|
|
@@ -48,13 +54,15 @@ export async function handleDatabaseTablesCommand(context) {
|
|
|
48
54
|
prunePartitionsConfirmed: confirmed,
|
|
49
55
|
pruneOrphans,
|
|
50
56
|
pruneOrphansConfirmed: confirmed,
|
|
57
|
+
async: asyncExecution,
|
|
58
|
+
idempotencyKey: readFlag(context.args, ['idempotency-key']),
|
|
51
59
|
});
|
|
52
60
|
if (readBoolFlag(context.args, ['json'])) {
|
|
53
61
|
context.print(result);
|
|
54
62
|
}
|
|
55
63
|
else {
|
|
56
64
|
for (const item of result.results) {
|
|
57
|
-
const label = item.status === 'deployed'
|
|
65
|
+
const label = item.status === 'accepted' ? 'Accepted' : item.status === 'deployed'
|
|
58
66
|
? 'Deployed'
|
|
59
67
|
: item.status === 'failed'
|
|
60
68
|
? 'Failed'
|
|
@@ -68,7 +76,7 @@ export async function handleDatabaseTablesCommand(context) {
|
|
|
68
76
|
reason: item.error || item.reason,
|
|
69
77
|
});
|
|
70
78
|
}
|
|
71
|
-
printSyncSummary(context.println, 'Deployed', result.results, Date.now() - startedAt);
|
|
79
|
+
printSyncSummary(context.println, asyncExecution ? 'Accepted' : 'Deployed', result.results, Date.now() - startedAt);
|
|
72
80
|
}
|
|
73
81
|
const failed = result.results.filter((item) => item.status === 'failed');
|
|
74
82
|
const unverifiedWrites = result.results.filter((item) => item.status === 'write-unverified');
|
|
@@ -167,3 +175,6 @@ export async function handleDatabaseTablesCommand(context) {
|
|
|
167
175
|
}
|
|
168
176
|
printSyncSummary(context.println, 'Pulled', output, Date.now() - startedAt);
|
|
169
177
|
}
|
|
178
|
+
export async function handleDatabaseTablesCommand(context) {
|
|
179
|
+
return withCommandSyncOmit(context, ['database-table'], scoped => executeDatabaseTablesCommand(scoped));
|
|
180
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import { isInteractiveTerminal, promptConfirm } from "../prompt.js";
|
|
2
3
|
import { readProjectStableKeyName } from "../project.js";
|
|
3
4
|
import { resolveResourceTarget } from "../resource-target.js";
|
|
4
5
|
import { buildDatabaseViewsPlan, pullDatabaseViewsToWorkspace, pushDatabaseViews } from "../resource-syncs/database-view-sync.js";
|
|
5
6
|
import { printSyncNotice, printSyncPlan, printSyncStatus, printSyncSummary } from "../sync-output.js";
|
|
6
7
|
import { readBoolFlag } from "../utils.js";
|
|
7
|
-
|
|
8
|
+
async function executeDatabaseViewsCommand(context) {
|
|
8
9
|
const subcommand = context.args._[1] || '';
|
|
9
10
|
if (subcommand !== 'pull' && subcommand !== 'plan' && subcommand !== 'push') {
|
|
10
11
|
throw new Error('Unknown database-views command. Usage: revo database-views <pull|plan|push> --all [--env <name>]');
|
|
@@ -124,3 +125,6 @@ export async function handleDatabaseViewsCommand(context) {
|
|
|
124
125
|
}
|
|
125
126
|
printSyncSummary(context.println, 'Pulled', output, Date.now() - startedAt);
|
|
126
127
|
}
|
|
128
|
+
export async function handleDatabaseViewsCommand(context) {
|
|
129
|
+
return withCommandSyncOmit(context, ['database-view'], scoped => executeDatabaseViewsCommand(scoped));
|
|
130
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import { isInteractiveTerminal, promptConfirm } from "../prompt.js";
|
|
2
3
|
import { readProjectStableKeyName } from "../project.js";
|
|
3
4
|
import { resolveResourceTarget } from "../resource-target.js";
|
|
4
5
|
import { buildEndpointsPlan, pullEndpointsToWorkspace, pushEndpoints } from "../resource-syncs/endpoint-sync.js";
|
|
5
6
|
import { printSyncPlan, printSyncStatus, printSyncSummary } from "../sync-output.js";
|
|
6
7
|
import { readBoolFlag } from "../utils.js";
|
|
7
|
-
|
|
8
|
+
async function executeEndpointsCommand(context) {
|
|
8
9
|
const subcommand = context.args._[1] || '';
|
|
9
10
|
if (subcommand === 'pull' || subcommand === 'plan' || subcommand === 'push') {
|
|
10
11
|
if (!readBoolFlag(context.args, ['all', 'a'])) {
|
|
@@ -126,3 +127,6 @@ export async function handleEndpointsCommand(context) {
|
|
|
126
127
|
const endpoints = await context.client.listEndpoints();
|
|
127
128
|
context.print(endpoints);
|
|
128
129
|
}
|
|
130
|
+
export async function handleEndpointsCommand(context) {
|
|
131
|
+
return withCommandSyncOmit(context, ['endpoint'], scoped => executeEndpointsCommand(scoped));
|
|
132
|
+
}
|
package/dist/src/commands/env.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import { RevoClient } from "../client.js";
|
|
2
3
|
import { DEFAULT_BASE_URL, DEFAULT_ENV_NAME, getActiveEnvironmentName, getConfigDir, getEnvironmentProfile, listEnvironmentProfiles, removeEnvironmentProfile, resolveRuntimeConfig, saveEnvironmentProfile, setActiveEnvironmentName, } from "../config.js";
|
|
3
4
|
import { applyEnvSyncPlan, buildEnvSyncPlan, captureEnvSnapshot, } from "../env-sync.js";
|
|
@@ -349,7 +350,7 @@ async function handleEnvApply(context) {
|
|
|
349
350
|
throw new Error(`Apply finished with ${failed.length} failure(s), ${unverified.length} verification mismatch(es).`);
|
|
350
351
|
}
|
|
351
352
|
}
|
|
352
|
-
|
|
353
|
+
async function executeEnvCommand(context) {
|
|
353
354
|
const subcommand = context.args._[1] || 'list';
|
|
354
355
|
if (subcommand === 'add') {
|
|
355
356
|
await handleEnvAdd(context);
|
|
@@ -377,3 +378,6 @@ export async function handleEnvCommand(context) {
|
|
|
377
378
|
}
|
|
378
379
|
throw new Error(`Unknown projects command: ${subcommand}. Available: add, list, set, remove, diff, apply.`);
|
|
379
380
|
}
|
|
381
|
+
export async function handleEnvCommand(context) {
|
|
382
|
+
return withCommandSyncOmit(context, ['component'], scoped => executeEnvCommand(scoped));
|
|
383
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import { readProjectStableKeyName } from "../project.js";
|
|
2
3
|
import { resolveResourceTarget } from "../resource-target.js";
|
|
3
4
|
import { activateVerifiedEvents, buildEventsPlan, pullEventsToWorkspace, pushEvents } from "../resource-syncs/event-sync.js";
|
|
4
5
|
import { isInteractiveTerminal, promptConfirm } from "../prompt.js";
|
|
5
6
|
import { planDependencyHints, printSyncNotice, printSyncPlan, printSyncStatus, printSyncSummary } from "../sync-output.js";
|
|
6
7
|
import { readBoolFlag } from "../utils.js";
|
|
7
|
-
|
|
8
|
+
async function executeEventsCommand(context) {
|
|
8
9
|
const subcommand = context.args._[1] || '';
|
|
9
10
|
if (!['pull', 'plan', 'push'].includes(subcommand)) {
|
|
10
11
|
throw new Error('Unknown events command. Usage: revo events <pull|plan|push> --all [--env <name>]');
|
|
@@ -142,3 +143,6 @@ export async function handleEventsCommand(context) {
|
|
|
142
143
|
}
|
|
143
144
|
printSyncSummary(context.println, 'Pulled', output, Date.now() - startedAt);
|
|
144
145
|
}
|
|
146
|
+
export async function handleEventsCommand(context) {
|
|
147
|
+
return withCommandSyncOmit(context, ['event'], scoped => executeEventsCommand(scoped));
|
|
148
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import fs from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { resolveProjectRoot, readProjectStableKeyName } from "../project.js";
|
|
@@ -141,7 +142,7 @@ async function handlePush(context) {
|
|
|
141
142
|
throw new Error(`Group push finished with ${failed.length} failure(s).`);
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
+
async function executeGroupsCommand(context) {
|
|
145
146
|
warnAboutExperimentalState(context);
|
|
146
147
|
const subcommand = context.args._[1] || '';
|
|
147
148
|
if (subcommand === 'pull') {
|
|
@@ -158,3 +159,6 @@ export async function handleGroupsCommand(context) {
|
|
|
158
159
|
}
|
|
159
160
|
throw new Error('Unknown groups command. Usage: revo groups <pull|plan|push> --all [--env <name>]');
|
|
160
161
|
}
|
|
162
|
+
export async function handleGroupsCommand(context) {
|
|
163
|
+
return withCommandSyncOmit(context, ['group'], scoped => executeGroupsCommand(scoped));
|
|
164
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { validateCommandArguments } from "../argument-contract.js";
|
|
1
2
|
import { buildRuntimeViewModel } from "../runtime-view.js";
|
|
2
3
|
import { renderRuntimeInfo } from "../ui.js";
|
|
3
4
|
export async function handleInfoCommand(context) {
|
|
5
|
+
validateCommandArguments(context.args);
|
|
4
6
|
const view = await buildRuntimeViewModel(context);
|
|
5
7
|
context.print(renderRuntimeInfo(view));
|
|
6
8
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import { buildJobTemplatesPlan, pullJobTemplatesToWorkspace, pushJobTemplates } from "../resource-syncs/job-template-sync.js";
|
|
2
3
|
import { isInteractiveTerminal, promptConfirm } from "../prompt.js";
|
|
3
4
|
import { readProjectStableKeyName } from "../project.js";
|
|
4
5
|
import { resolveResourceTarget } from "../resource-target.js";
|
|
5
6
|
import { printSyncNotice, printSyncPlan, printSyncStatus, printSyncSummary } from "../sync-output.js";
|
|
6
7
|
import { readBoolFlag } from "../utils.js";
|
|
7
|
-
|
|
8
|
+
async function executeJobTemplatesCommand(context) {
|
|
8
9
|
const subcommand = context.args._[1] || '';
|
|
9
10
|
if (!['pull', 'plan', 'push'].includes(subcommand))
|
|
10
11
|
throw new Error('Unknown job-templates command. Usage: revo job-templates <pull|plan|push> --all [--env <name>]');
|
|
@@ -105,3 +106,6 @@ export async function handleJobTemplatesCommand(context) {
|
|
|
105
106
|
printSyncNotice(context.println, `${warning.stableKey}: ${warning.reason}`);
|
|
106
107
|
printSyncSummary(context.println, 'Pulled', output, Date.now() - startedAt);
|
|
107
108
|
}
|
|
109
|
+
export async function handleJobTemplatesCommand(context) {
|
|
110
|
+
return withCommandSyncOmit(context, ['job-template'], scoped => executeJobTemplatesCommand(scoped));
|
|
111
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { validateCommandArguments } from "../argument-contract.js";
|
|
1
2
|
import { RevoClient } from "../client.js";
|
|
2
3
|
import { DEFAULT_ENV_NAME } from "../config.js";
|
|
3
4
|
import { applyMetadataBackfillPlan, buildMetadataBackfillPlan, } from "../metadata-backfill.js";
|
|
@@ -189,6 +190,7 @@ async function handleMetadataApply(context) {
|
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
export async function handleMetadataCommand(context) {
|
|
193
|
+
validateCommandArguments(context.args);
|
|
192
194
|
const subcommand = context.args._[1] || 'plan';
|
|
193
195
|
if (subcommand === 'plan') {
|
|
194
196
|
await handleMetadataPlan(context);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommandContext } from '../types.ts';
|
|
2
|
-
export declare function handleDiffCommand(context: CommandContext): Promise<void>;
|
|
3
2
|
export declare function handlePlanCommand(context: CommandContext): Promise<void>;
|
|
4
|
-
export declare function
|
|
3
|
+
export declare function handleDiffCommand(context: CommandContext): Promise<void>;
|
|
5
4
|
export declare function handleDeployCommand(context: CommandContext): Promise<void>;
|
|
5
|
+
export declare function handlePullCommand(context: CommandContext): Promise<void>;
|
|
6
6
|
export declare function handleMigrateCommand(context: CommandContext): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withCommandSyncOmit, workspaceSyncOmitFamilies } from "../sync-omit-command.js";
|
|
1
2
|
import { updateWorkspaceDigests } from "../workspace-digests.js";
|
|
2
3
|
import fs from 'node:fs';
|
|
3
4
|
import path from 'node:path';
|
|
@@ -20,6 +21,7 @@ const RESOURCE_ALIASES = {
|
|
|
20
21
|
'database-schema': 'database-table',
|
|
21
22
|
'database-schemas': 'database-table',
|
|
22
23
|
database: 'database-table',
|
|
24
|
+
databases: 'database-table',
|
|
23
25
|
'database-view': 'database-view',
|
|
24
26
|
'database-views': 'database-view',
|
|
25
27
|
dbview: 'database-view',
|
|
@@ -447,7 +449,7 @@ async function handleMigrationRead(context, input, command) {
|
|
|
447
449
|
throw new Error('Migration verification failed: target still requires changes.');
|
|
448
450
|
}
|
|
449
451
|
}
|
|
450
|
-
|
|
452
|
+
async function executeDiffCommand(context) {
|
|
451
453
|
if (readBoolFlag(context.args, ['prune']))
|
|
452
454
|
throw new Error('Review deletions with revo plan --prune; diff compares content only.');
|
|
453
455
|
if (readBoolFlag(context.args, ['force', 'f'])) {
|
|
@@ -455,7 +457,7 @@ export async function handleDiffCommand(context) {
|
|
|
455
457
|
}
|
|
456
458
|
await handleMigrationRead(context, await readWorkspaceDeploymentInput(context), 'diff');
|
|
457
459
|
}
|
|
458
|
-
|
|
460
|
+
async function executePlanCommand(context) {
|
|
459
461
|
if (context.args._[1] === 'update') {
|
|
460
462
|
if (Object.keys(context.args).some(key => !['_', 'json', 'project', 'update-notifier'].includes(key))) {
|
|
461
463
|
throw new Error('Offline plan update accepts --json and --project only; target/deployment flags require revo plan.');
|
|
@@ -483,14 +485,21 @@ export async function handlePlanCommand(context) {
|
|
|
483
485
|
function readPullResources(context) {
|
|
484
486
|
const all = readBoolFlag(context.args, ['all', 'a']);
|
|
485
487
|
const values = readValues(context.args, ['resources', 'resource']);
|
|
486
|
-
|
|
488
|
+
const positional = context.args._.slice(1);
|
|
489
|
+
if (positional.length && (all || values.length)) {
|
|
490
|
+
throw new Error('Repository pull accepts positional resources, --all, or --resources <list>; choose one selection form.');
|
|
491
|
+
}
|
|
492
|
+
if (!all && values.length === 0 && positional.length === 0) {
|
|
487
493
|
throw new Error('Repository pull requires --all or --resources <list>.');
|
|
488
494
|
}
|
|
489
495
|
if (all && values.length > 0) {
|
|
490
496
|
throw new Error('Repository pull accepts either --all or --resources <list>, not both.');
|
|
491
497
|
}
|
|
492
498
|
if (!all) {
|
|
493
|
-
return readMigrationResources(
|
|
499
|
+
return readMigrationResources(positional.length ? {
|
|
500
|
+
...context,
|
|
501
|
+
args: { ...context.args, resources: positional },
|
|
502
|
+
} : context, 'Repository pull');
|
|
494
503
|
}
|
|
495
504
|
const resources = [...MIGRATION_RESOURCE_ORDER];
|
|
496
505
|
return readBoolFlag(context.args, ['skip-groups'])
|
|
@@ -505,7 +514,7 @@ async function confirmPull(context) {
|
|
|
505
514
|
throw new Error('Repository pull requires confirmation. Re-run with --yes or use an interactive terminal.');
|
|
506
515
|
}
|
|
507
516
|
}
|
|
508
|
-
|
|
517
|
+
async function executePullCommand(context) {
|
|
509
518
|
const resources = readPullResources(context);
|
|
510
519
|
await confirmPull(context);
|
|
511
520
|
const authenticatedInstance = await resolveAuthenticatedInstance(context.client, 'source');
|
|
@@ -576,7 +585,9 @@ function printRunResult(context, result, showPlan = true) {
|
|
|
576
585
|
}
|
|
577
586
|
context.println(`Final verdict: ${result.verdict}.`);
|
|
578
587
|
}
|
|
579
|
-
|
|
588
|
+
async function executeDeployCommand(context) {
|
|
589
|
+
if (readBoolFlag(context.args, ['async']))
|
|
590
|
+
throw new Error('Full deploy waits for schema readiness and verified readback before dependent phases; use database-tables push <stableKey> --async for admission only.');
|
|
580
591
|
if (readBoolFlag(context.args, ['changed']) || readFlag(context.args, ['base']) || readValues(context.args, ['resources', 'resource']).length > 0) {
|
|
581
592
|
throw new Error('Repository deployment evaluates all tracked resources; select resources in .revoengine/revo.json.');
|
|
582
593
|
}
|
|
@@ -620,7 +631,7 @@ export async function handleDeployCommand(context) {
|
|
|
620
631
|
throw new Error(`Deployment finished with verdict "${result.verdict}".`);
|
|
621
632
|
}
|
|
622
633
|
}
|
|
623
|
-
|
|
634
|
+
async function executeMigrateCommand(context) {
|
|
624
635
|
if (readBoolFlag(context.args, ['prune']))
|
|
625
636
|
throw new Error('Prune requires repository plan/deploy; named migration remains upsert-only.');
|
|
626
637
|
const requestedSubcommand = context.args._[1] || 'plan';
|
|
@@ -649,3 +660,18 @@ export async function handleMigrateCommand(context) {
|
|
|
649
660
|
throw new Error(`Migration run finished with verdict "${result.verdict}".`);
|
|
650
661
|
}
|
|
651
662
|
}
|
|
663
|
+
export async function handlePlanCommand(context) {
|
|
664
|
+
return withCommandSyncOmit(context, workspaceSyncOmitFamilies(context), scoped => executePlanCommand(scoped));
|
|
665
|
+
}
|
|
666
|
+
export async function handleDiffCommand(context) {
|
|
667
|
+
return withCommandSyncOmit(context, workspaceSyncOmitFamilies(context), scoped => executeDiffCommand(scoped));
|
|
668
|
+
}
|
|
669
|
+
export async function handleDeployCommand(context) {
|
|
670
|
+
return withCommandSyncOmit(context, workspaceSyncOmitFamilies(context), scoped => executeDeployCommand(scoped));
|
|
671
|
+
}
|
|
672
|
+
export async function handlePullCommand(context) {
|
|
673
|
+
return withCommandSyncOmit(context, readPullResources(context), scoped => executePullCommand(scoped));
|
|
674
|
+
}
|
|
675
|
+
export async function handleMigrateCommand(context) {
|
|
676
|
+
return withCommandSyncOmit(context, readMigrationResources(context), scoped => executeMigrateCommand(scoped));
|
|
677
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import { validateCommandArguments } from "../argument-contract.js";
|
|
3
|
+
import { withWorkspaceWriteLockAtRoot } from "../workspace-write-lock.js";
|
|
2
4
|
import { readComponentLock } from "../component-lock.js";
|
|
3
5
|
import { applyMetadataBackfillPlan, buildMetadataBackfillPlan, } from "../metadata-backfill.js";
|
|
4
6
|
import { buildProjectSyncState, buildEditorTypesUrl, extractSandboxEndpoint, extractEditorTypesBundle, readProjectComponentIdentity, readProjectMetadata, readProjectStableKeyName, readProjectTrackedResources, resolveProjectInvocation, resolveProjectTarget, syncProjectFiles, } from "../project.js";
|
|
@@ -102,24 +104,27 @@ async function backfillStableKeyMetadata(context, stableKeyName, trackedResource
|
|
|
102
104
|
context.println(`Backfilled stable-key metadata on ${updated} component(s).`);
|
|
103
105
|
}
|
|
104
106
|
export async function handleProjectCommand(context) {
|
|
107
|
+
validateCommandArguments(context.args);
|
|
105
108
|
const { args, client, cwd, println } = context;
|
|
106
109
|
const invocation = resolveProjectInvocation(args);
|
|
107
110
|
if (invocation.extraArgs.length > 0) {
|
|
108
111
|
throw new Error(`Project ${invocation.action} accepts at most one path argument.`);
|
|
109
112
|
}
|
|
110
113
|
const layout = resolveProjectTarget(cwd, invocation.targetArg);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
return withWorkspaceWriteLockAtRoot(layout.projectRoot, async () => {
|
|
115
|
+
const syncInput = await resolveProjectSyncInput(context);
|
|
116
|
+
syncInput.authProfile = context.componentEnvironment || 'default';
|
|
117
|
+
syncInput.componentIdentity = await resolveComponentIdentity(invocation, layout.projectRoot);
|
|
118
|
+
syncInput.trackedResources = await resolveTrackedResources(invocation, layout.projectRoot);
|
|
119
|
+
const result = syncProjectFiles(layout, syncInput);
|
|
120
|
+
printSyncSummary(println, layout.projectRoot, layout.workspaceRoot, result, invocation.action === 'update' ? 'Updated Revo project in' : 'Initialized Revo project in');
|
|
121
|
+
if (invocation.action === 'init'
|
|
122
|
+
&& syncInput.componentIdentity.mode === 'stableKey'
|
|
123
|
+
&& context.args['metadata-backfill'] !== false) {
|
|
124
|
+
await backfillStableKeyMetadata(context, syncInput.componentIdentity.metadataProperty || DEFAULT_STABLE_KEY_NAME, syncInput.trackedResources);
|
|
125
|
+
}
|
|
126
|
+
if (invocation.action === 'init' && shouldTrackResource(syncInput.trackedResources, 'database-table')) {
|
|
127
|
+
context.println('Database Table Stable Keys require an explicit review: revo metadata plan --resources database-table --project <source>');
|
|
128
|
+
}
|
|
129
|
+
});
|
|
125
130
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { validateCommandArguments } from "../argument-contract.js";
|
|
1
2
|
import { readFlag, readValues } from "../utils.js";
|
|
2
3
|
function parseJsonMaybe(value) {
|
|
3
4
|
if (!value) {
|
|
@@ -31,6 +32,7 @@ function parseQueryValue(value) {
|
|
|
31
32
|
return query;
|
|
32
33
|
}
|
|
33
34
|
export async function handleRequestCommand(context) {
|
|
35
|
+
validateCommandArguments(context.args);
|
|
34
36
|
const { args, client } = context;
|
|
35
37
|
const method = (args._[1] || readFlag(args, ['method', 'm']) || 'GET').toUpperCase();
|
|
36
38
|
const requestPath = args._[2] || readFlag(args, ['path', 'p']) || '';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import fs from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { resolveProjectRoot, readProjectStableKeyName } from "../project.js";
|
|
@@ -122,7 +123,7 @@ async function handlePush(context) {
|
|
|
122
123
|
if (failed.length > 0)
|
|
123
124
|
throw new Error(`Role-group push finished with ${failed.length} failure(s).`);
|
|
124
125
|
}
|
|
125
|
-
|
|
126
|
+
async function executeRoleGroupsCommand(context) {
|
|
126
127
|
warnAboutExperimentalState(context);
|
|
127
128
|
const subcommand = context.args._[1] || '';
|
|
128
129
|
if (subcommand === 'pull') {
|
|
@@ -139,3 +140,6 @@ export async function handleRoleGroupsCommand(context) {
|
|
|
139
140
|
}
|
|
140
141
|
throw new Error('Unknown role-groups command. Usage: revo role-groups <pull|plan|push> --all [--env <name>]');
|
|
141
142
|
}
|
|
143
|
+
export async function handleRoleGroupsCommand(context) {
|
|
144
|
+
return withCommandSyncOmit(context, ['role-group'], scoped => executeRoleGroupsCommand(scoped));
|
|
145
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import { isInteractiveTerminal, promptConfirm } from "../prompt.js";
|
|
2
3
|
import { readProjectStableKeyName } from "../project.js";
|
|
3
4
|
import { resolveResourceTarget } from "../resource-target.js";
|
|
4
5
|
import { activateVerifiedSchedules, buildSchedulesPlan, pullSchedulesToWorkspace, pushSchedules } from "../resource-syncs/schedule-sync.js";
|
|
5
6
|
import { planDependencyHints, printSyncNotice, printSyncPlan, printSyncStatus, printSyncSummary } from "../sync-output.js";
|
|
6
7
|
import { readBoolFlag } from "../utils.js";
|
|
7
|
-
|
|
8
|
+
async function executeSchedulesCommand(context) {
|
|
8
9
|
const subcommand = context.args._[1] || '';
|
|
9
10
|
if (!['pull', 'plan', 'push'].includes(subcommand)) {
|
|
10
11
|
throw new Error('Unknown schedules command. Usage: revo schedules <pull|plan|push> --all [--env <name>]');
|
|
@@ -140,3 +141,6 @@ export async function handleSchedulesCommand(context) {
|
|
|
140
141
|
}
|
|
141
142
|
printSyncSummary(context.println, 'Pulled', output, Date.now() - startedAt);
|
|
142
143
|
}
|
|
144
|
+
export async function handleSchedulesCommand(context) {
|
|
145
|
+
return withCommandSyncOmit(context, ['schedule'], scoped => executeSchedulesCommand(scoped));
|
|
146
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { validateCommandArguments } from "../argument-contract.js";
|
|
1
2
|
import { readFlag } from "../utils.js";
|
|
2
3
|
const SEARCH_TYPES = new Set(['CODE', 'SIMPLE']);
|
|
3
4
|
export async function handleSearchCommand(context) {
|
|
5
|
+
validateCommandArguments(context.args);
|
|
4
6
|
const { args, client } = context;
|
|
5
7
|
const type = (readFlag(args, ['type', 't']) || args._[1] || '').toUpperCase();
|
|
6
8
|
const term = readFlag(args, ['term']) || args._[2] || '';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withCommandSyncOmit } from "../sync-omit-command.js";
|
|
1
2
|
import fs from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { resolveProjectRoot, readProjectStableKeyName } from "../project.js";
|
|
@@ -130,7 +131,7 @@ async function handlePush(context) {
|
|
|
130
131
|
throw new Error(`Service-account push finished with ${failed.length} failure(s).`);
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
+
async function executeServiceAccountsCommand(context) {
|
|
134
135
|
warnAboutExperimentalState(context);
|
|
135
136
|
const subcommand = context.args._[1] || '';
|
|
136
137
|
if (subcommand === 'pull') {
|
|
@@ -147,3 +148,6 @@ export async function handleServiceAccountsCommand(context) {
|
|
|
147
148
|
}
|
|
148
149
|
throw new Error('Unknown service-accounts command. Usage: revo service-accounts <pull|plan|push> --all [--env <name>]');
|
|
149
150
|
}
|
|
151
|
+
export async function handleServiceAccountsCommand(context) {
|
|
152
|
+
return withCommandSyncOmit(context, ['service-account'], scoped => executeServiceAccountsCommand(scoped));
|
|
153
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
|
+
import { validateCommandArguments } from "../argument-contract.js";
|
|
4
5
|
import { readFlag } from "../utils.js";
|
|
5
6
|
const mutations = { patch: 'patch', attach: 'resources', fork: 'fork', test: 'test-runs', freeze: 'proposals', commit: 'commit', prepare: 'prepare', activate: 'activate', rebase: 'rebase', share: 'share', participant: 'participants', presence: 'presence', claim: 'claims', message: 'chat/message', baseline: 'runtime/baseline', rollback: 'runtime/rollback' };
|
|
6
7
|
const reads = new Set(['diff', 'files', 'events', 'chat', 'search', 'preview-rebase', 'claims']);
|
|
@@ -28,6 +29,7 @@ function readBody(context) {
|
|
|
28
29
|
}
|
|
29
30
|
/** Never turns a rejected legacy write into an unreviewed source commit. */
|
|
30
31
|
export async function handleStudioCommand(context) {
|
|
32
|
+
validateCommandArguments(context.args);
|
|
31
33
|
const { args, client } = context;
|
|
32
34
|
const action = args._[1] || 'list';
|
|
33
35
|
const sessionId = args._[2];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type KeyObject } from 'node:crypto';
|
|
2
|
+
import type { BrowserContext } from 'playwright-core';
|
|
3
|
+
import { type BrowserProfileKeyScope, type BrowserProfileSealedKey } from './terminal-browser-profile-crypto.ts';
|
|
4
|
+
type ProfileState = Awaited<ReturnType<BrowserContext['storageState']>>;
|
|
5
|
+
export type CentralBrowserProfileGrant = {
|
|
6
|
+
scope: BrowserProfileKeyScope;
|
|
7
|
+
sealedKey: BrowserProfileSealedKey;
|
|
8
|
+
revision: number;
|
|
9
|
+
leaseRemainingMs: number;
|
|
10
|
+
digest?: string;
|
|
11
|
+
};
|
|
12
|
+
export type CentralBrowserProfileTransport = {
|
|
13
|
+
read(): Promise<Buffer | null>;
|
|
14
|
+
readback?(expectedRevision: number): Promise<{
|
|
15
|
+
revision: number;
|
|
16
|
+
keyVersion: string;
|
|
17
|
+
ciphertext: Buffer;
|
|
18
|
+
digest: string;
|
|
19
|
+
}>;
|
|
20
|
+
save(input: {
|
|
21
|
+
operationId: string;
|
|
22
|
+
expectedRevision: number;
|
|
23
|
+
keyVersion: string;
|
|
24
|
+
ciphertext: Buffer;
|
|
25
|
+
digest: string;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
revision: number;
|
|
28
|
+
}>;
|
|
29
|
+
renew(): Promise<{
|
|
30
|
+
leaseRemainingMs: number;
|
|
31
|
+
}>;
|
|
32
|
+
release(): Promise<void>;
|
|
33
|
+
};
|
|
34
|
+
/** Cross-platform in-memory profile lease. No local catalog, cookie file, passcode or OS keychain. */
|
|
35
|
+
export declare class CentralBrowserProfileLease {
|
|
36
|
+
private key;
|
|
37
|
+
private currentState?;
|
|
38
|
+
private revision;
|
|
39
|
+
private stateDigest?;
|
|
40
|
+
private closed;
|
|
41
|
+
private deadline;
|
|
42
|
+
private expiry?;
|
|
43
|
+
private renewal?;
|
|
44
|
+
private saves;
|
|
45
|
+
private queuedSaves;
|
|
46
|
+
private releaseRequest?;
|
|
47
|
+
private readonly grant;
|
|
48
|
+
private readonly transport;
|
|
49
|
+
private readonly onExpired;
|
|
50
|
+
private constructor();
|
|
51
|
+
static open(grant: CentralBrowserProfileGrant, privateKey: KeyObject, transport: CentralBrowserProfileTransport, onExpired: () => void | Promise<void>): Promise<CentralBrowserProfileLease>;
|
|
52
|
+
get state(): ProfileState | undefined;
|
|
53
|
+
get currentRevision(): number;
|
|
54
|
+
private assertActive;
|
|
55
|
+
private arm;
|
|
56
|
+
private scheduleRenewal;
|
|
57
|
+
private renew;
|
|
58
|
+
private expire;
|
|
59
|
+
save(state: ProfileState): Promise<void>;
|
|
60
|
+
/** An explicit migration proof, not an extra download on every ordinary checkpoint. */
|
|
61
|
+
verifySavedState(): Promise<ProfileState>;
|
|
62
|
+
private dispose;
|
|
63
|
+
release(): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
export {};
|