@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.
Files changed (113) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +152 -24
  3. package/dist/src/argument-contract.d.ts +17 -0
  4. package/dist/src/argument-contract.js +359 -0
  5. package/dist/src/automation-contract.generated.d.ts +56 -22
  6. package/dist/src/automation-contract.generated.js +68 -26
  7. package/dist/src/cli.js +15 -13
  8. package/dist/src/client.d.ts +34 -2
  9. package/dist/src/client.js +76 -13
  10. package/dist/src/commands/agents.js +5 -1
  11. package/dist/src/commands/auth.js +2 -0
  12. package/dist/src/commands/component.js +34 -17
  13. package/dist/src/commands/database-tables.js +15 -4
  14. package/dist/src/commands/database-views.js +5 -1
  15. package/dist/src/commands/endpoints.js +5 -1
  16. package/dist/src/commands/env.js +5 -1
  17. package/dist/src/commands/events.js +5 -1
  18. package/dist/src/commands/groups.js +5 -1
  19. package/dist/src/commands/info.js +2 -0
  20. package/dist/src/commands/job-templates.js +5 -1
  21. package/dist/src/commands/metadata.js +2 -0
  22. package/dist/src/commands/migrate.d.ts +2 -2
  23. package/dist/src/commands/migrate.js +33 -7
  24. package/dist/src/commands/project.js +19 -14
  25. package/dist/src/commands/request.js +2 -0
  26. package/dist/src/commands/role-groups.js +5 -1
  27. package/dist/src/commands/schedules.js +5 -1
  28. package/dist/src/commands/search.js +2 -0
  29. package/dist/src/commands/service-accounts.js +5 -1
  30. package/dist/src/commands/studio.js +2 -0
  31. package/dist/src/commands/terminal-browser-central-profile.d.ts +65 -0
  32. package/dist/src/commands/terminal-browser-central-profile.js +203 -0
  33. package/dist/src/commands/terminal-browser-human-input.d.ts +3 -1
  34. package/dist/src/commands/terminal-browser-human-input.js +3 -1
  35. package/dist/src/commands/terminal-browser-interaction.js +1 -1
  36. package/dist/src/commands/terminal-browser-live-protocol.d.ts +34 -2
  37. package/dist/src/commands/terminal-browser-live-protocol.js +28 -12
  38. package/dist/src/commands/terminal-browser-live-transport.d.ts +1 -0
  39. package/dist/src/commands/terminal-browser-live-transport.js +9 -5
  40. package/dist/src/commands/terminal-browser-live.d.ts +24 -3
  41. package/dist/src/commands/terminal-browser-live.js +199 -30
  42. package/dist/src/commands/terminal-browser-page-input.d.ts +4 -1
  43. package/dist/src/commands/terminal-browser-page-input.js +46 -1
  44. package/dist/src/commands/terminal-browser-profile-crypto.d.ts +30 -0
  45. package/dist/src/commands/terminal-browser-profile-crypto.js +101 -0
  46. package/dist/src/commands/terminal-browser-profile-import-runner.d.ts +31 -0
  47. package/dist/src/commands/terminal-browser-profile-import-runner.js +112 -0
  48. package/dist/src/commands/terminal-browser-profile-import.d.ts +28 -0
  49. package/dist/src/commands/terminal-browser-profile-import.js +125 -0
  50. package/dist/src/commands/terminal-browser-profile-import.protocol.d.ts +50 -0
  51. package/dist/src/commands/terminal-browser-profile-import.protocol.js +52 -0
  52. package/dist/src/commands/terminal-browser-profile-preferences.d.ts +1 -0
  53. package/dist/src/commands/terminal-browser-profile-preferences.js +16 -0
  54. package/dist/src/commands/terminal-browser-profile-sync.d.ts +14 -0
  55. package/dist/src/commands/terminal-browser-profile-sync.js +169 -0
  56. package/dist/src/commands/terminal-browser-profile-sync.protocol.d.ts +50 -0
  57. package/dist/src/commands/terminal-browser-profile-sync.protocol.js +19 -0
  58. package/dist/src/commands/terminal-browser-profile.d.ts +10 -1
  59. package/dist/src/commands/terminal-browser-profile.js +30 -4
  60. package/dist/src/commands/terminal-browser-recording.d.ts +39 -0
  61. package/dist/src/commands/terminal-browser-recording.js +74 -0
  62. package/dist/src/commands/terminal-browser-recording.protocol.d.ts +49 -0
  63. package/dist/src/commands/terminal-browser-recording.protocol.js +16 -0
  64. package/dist/src/commands/terminal-browser.d.ts +14 -1
  65. package/dist/src/commands/terminal-browser.js +98 -33
  66. package/dist/src/commands/terminal-file-descriptor.d.ts +9 -0
  67. package/dist/src/commands/terminal-file-descriptor.js +39 -0
  68. package/dist/src/commands/terminal-file.js +41 -6
  69. package/dist/src/commands/terminal-image.js +3 -31
  70. package/dist/src/commands/terminal-output-buffer.d.ts +18 -1
  71. package/dist/src/commands/terminal-output-buffer.js +95 -8
  72. package/dist/src/commands/terminal-process-group.d.ts +25 -0
  73. package/dist/src/commands/terminal-process-group.js +144 -0
  74. package/dist/src/commands/terminal.d.ts +3 -1
  75. package/dist/src/commands/terminal.js +366 -80
  76. package/dist/src/commands/tests.js +2 -0
  77. package/dist/src/component-lock.d.ts +15 -1
  78. package/dist/src/component-lock.js +96 -10
  79. package/dist/src/env-sync.js +12 -6
  80. package/dist/src/migration.d.ts +7 -0
  81. package/dist/src/migration.js +39 -21
  82. package/dist/src/planning-snapshot.d.ts +3 -0
  83. package/dist/src/planning-snapshot.js +60 -2
  84. package/dist/src/project.d.ts +1 -0
  85. package/dist/src/project.js +7 -8
  86. package/dist/src/resource-syncs/agent-sync.js +76 -24
  87. package/dist/src/resource-syncs/database-table-sync.d.ts +8 -1
  88. package/dist/src/resource-syncs/database-table-sync.js +66 -32
  89. package/dist/src/resource-syncs/database-view-sync.js +41 -28
  90. package/dist/src/resource-syncs/endpoint-sync.js +90 -18
  91. package/dist/src/resource-syncs/event-sync.js +33 -14
  92. package/dist/src/resource-syncs/group-sync.js +21 -11
  93. package/dist/src/resource-syncs/job-template-sync.js +98 -37
  94. package/dist/src/resource-syncs/role-group-sync.js +22 -11
  95. package/dist/src/resource-syncs/schedule-sync.js +26 -11
  96. package/dist/src/resource-syncs/service-account-sync.js +22 -11
  97. package/dist/src/reviewed-plan.js +3 -0
  98. package/dist/src/runtime-view.js +2 -18
  99. package/dist/src/sync-omit-command.d.ts +6 -0
  100. package/dist/src/sync-omit-command.js +49 -0
  101. package/dist/src/sync-omit-write-fence.d.ts +10 -0
  102. package/dist/src/sync-omit-write-fence.js +134 -0
  103. package/dist/src/sync-omit.d.ts +59 -0
  104. package/dist/src/sync-omit.js +469 -0
  105. package/dist/src/sync-output.d.ts +3 -3
  106. package/dist/src/ui.js +11 -5
  107. package/dist/src/update-notifier.d.ts +1 -1
  108. package/dist/src/update-notifier.js +2 -1
  109. package/dist/src/utils.js +46 -17
  110. package/dist/src/workspace-prune.js +11 -3
  111. package/dist/src/workspace-write-lock.d.ts +7 -0
  112. package/dist/src/workspace-write-lock.js +144 -0
  113. package/package.json +6 -5
@@ -0,0 +1,359 @@
1
+ const occurrences = new WeakMap();
2
+ /** Keep repetitions for validation without changing the public parsed argument shape. */
3
+ export function recordParsedOption(args, name, value) {
4
+ if (['_', '__proto__', 'prototype', 'constructor'].includes(name))
5
+ throw new Error(`Unknown option --${name}: reserved argument name.`);
6
+ const entries = occurrences.get(args) || [];
7
+ entries.push({ name, value });
8
+ occurrences.set(args, entries);
9
+ }
10
+ function booleanValue(name, value) {
11
+ if (value === true || value === 'true')
12
+ return true;
13
+ if (value === false || value === 'false')
14
+ return false;
15
+ throw new Error(`--${name} accepts only true or false (or a bare flag / --no-${name}).`);
16
+ }
17
+ export function readBooleanOption(args, names) {
18
+ const recorded = occurrences.get(args)?.filter(entry => names.includes(entry.name));
19
+ const entries = recorded?.length ? recorded : names.flatMap(name => {
20
+ const value = args[name];
21
+ return value === undefined ? [] : (Array.isArray(value) ? value : [value]).map(value => ({ name, value }));
22
+ });
23
+ const values = entries.map(entry => booleanValue(names[0], entry.value));
24
+ if (new Set(values).size > 1)
25
+ throw new Error(`Conflicting values for --${names[0]}. Specify one boolean value.`);
26
+ return values[0] ?? false;
27
+ }
28
+ function flags(kind, names) {
29
+ return Object.fromEntries(names.split(' ').filter(Boolean).map(name => [name, kind]));
30
+ }
31
+ const b = (names) => flags('boolean', names);
32
+ const v = (names) => flags('value', names);
33
+ const many = (names) => flags('values', names);
34
+ const runtime = v('url baseUrl instance i token t project env');
35
+ const output = b('json');
36
+ const all = b('all a');
37
+ const force = b('force f');
38
+ const yes = b('yes y');
39
+ const plan = { ...output, ...b('strict hints') };
40
+ const omit = many('omit');
41
+ const resources = many('resources resource tracked-resources trackedResources');
42
+ const stableKey = v('stable-key-name stableKeyName');
43
+ const changed = { ...b('changed changed-only'), ...v('base git-base') };
44
+ function shortTokenIsRuntime(args) {
45
+ return args._[0] !== 'search' && !(args._[0] === 'component' && args._[1] === 'debug');
46
+ }
47
+ function runtimeContract(args) {
48
+ if (args._[0] === 'terminal')
49
+ return args._[1] === 'service' ? v('project env') : v('url token instance project env');
50
+ const result = { ...runtime };
51
+ if (args._[0] === 'component')
52
+ delete result.i;
53
+ if (!shortTokenIsRuntime(args))
54
+ delete result.t;
55
+ return result;
56
+ }
57
+ /** Short options owned by a command never become authentication overrides. */
58
+ export function runtimeConnectionOverrides(args) {
59
+ const string = (name) => typeof args[name] === 'string' ? args[name] : undefined;
60
+ return {
61
+ baseUrl: string('url') ?? string('baseUrl'),
62
+ token: string('token') ?? (shortTokenIsRuntime(args) ? string('t') : undefined),
63
+ instance: string('instance') ?? (args._[0] !== 'component' ? string('i') : undefined),
64
+ envName: string('env'),
65
+ };
66
+ }
67
+ const aliases = [
68
+ ['yes', 'y'], ['force', 'f'], ['all', 'a'], ['stale', 's'], ['changed', 'changed-only'],
69
+ ['dry-run', 'dryRun'], ['skip-partitions', 'skipPartitions'], ['offline', 'o'],
70
+ ['raw-debug', 'debug-raw', 'debug-payload'], ['help', 'h'], ['version', 'V'],
71
+ ];
72
+ function actionContract(args) {
73
+ const command = args._[0] || '';
74
+ const action = args._[1] || '';
75
+ if (!command || command === 'info')
76
+ return command ? {} : {
77
+ ...b('info help h version V'),
78
+ ...(typeof args.i === 'string' && !['true', 'false'].includes(args.i) ? v('i') : b('i')),
79
+ ...(readBooleanOption(args, ['version', 'V']) ? output : {}),
80
+ };
81
+ if (command === 'help')
82
+ return {};
83
+ if (command === 'version')
84
+ return output;
85
+ if (command === 'auth') {
86
+ if (action && !['login', 'logout', 'status', 'get', 'set', 'key'].includes(action))
87
+ throw new Error('Unknown auth command.');
88
+ return action === 'key' ? { ...v('file f'), ...b('offline o') } : {};
89
+ }
90
+ if (command === 'project') {
91
+ if (action && !['init', 'update', 'switch'].includes(action))
92
+ throw new Error(`Unknown project action "${action}". Use revo project init or update.`);
93
+ return { ...resources, ...stableKey, ...v('identity-mode identityMode'), ...(action === 'init' ? b('metadata-backfill') : {}) };
94
+ }
95
+ if (command === 'projects' || command === 'env') {
96
+ const selected = action || 'list';
97
+ if (!['add', 'list', 'set', 'remove', 'diff', 'apply'].includes(selected))
98
+ throw new Error(`Unknown projects command: ${selected}.`);
99
+ if (selected === 'add')
100
+ return b('offline');
101
+ if (selected === 'list')
102
+ return output;
103
+ if (['set', 'remove'].includes(selected))
104
+ return {};
105
+ return { ...output, ...v('from to'), ...many('key category'), ...resources, ...stableKey, ...omit, ...b('prune'),
106
+ ...(selected === 'diff' ? b('strict') : { ...yes, ...force, ...b('dry-run dryRun') }) };
107
+ }
108
+ if (command === 'request')
109
+ return { ...v('method m path p body d'), ...many('query q') };
110
+ if (command === 'search')
111
+ return v('type t term componentType caseSensitive take skip');
112
+ if (command === 'metadata') {
113
+ if (action && !['plan', 'apply'].includes(action))
114
+ throw new Error('Unknown metadata command. Use plan or apply.');
115
+ return { ...output, ...resources, ...stableKey, ...b('force skip-partitions skipPartitions'), ...(action === 'apply' ? b('yes') : {}) };
116
+ }
117
+ if (command === 'studio') {
118
+ const selected = action || 'list';
119
+ if (selected === 'list')
120
+ return { ...output, ...v('status') };
121
+ if (['get', 'file'].includes(selected))
122
+ return output;
123
+ if (['diff', 'files', 'events', 'chat', 'search', 'preview-rebase', 'claims'].includes(selected))
124
+ return { ...output, ...v('afterCursor take q') };
125
+ if (!['create', 'promote', 'update', 'delete', 'review', 'release-claim', 'cancel-test', 'patch', 'attach', 'fork', 'test', 'freeze', 'commit', 'prepare', 'activate', 'rebase', 'share', 'participant', 'presence', 'claim', 'message', 'baseline', 'rollback'].includes(selected))
126
+ throw new Error(`Unknown Studio action: ${selected}.`);
127
+ return { ...output, ...v('body body-file operation-id'), ...(selected === 'patch' ? v('patch-file') : {}) };
128
+ }
129
+ if (command === 'tests') {
130
+ const selected = action || 'list';
131
+ if (!['list', 'run', 'resume', 'cancel'].includes(selected))
132
+ throw new Error(`Unknown tests action: ${selected}. Use list, run, resume or cancel.`);
133
+ if (selected === 'cancel')
134
+ return output;
135
+ if (selected === 'resume')
136
+ return { ...output, ...b('wait no-wait'), ...v('wait-timeout') };
137
+ return { ...output, ...b('remote'), ...v('workspace search'), ...(selected === 'run' ? {
138
+ ...b('all wait no-wait'), ...many('suite'), ...v('timeout wait-timeout operation-id'),
139
+ } : {}) };
140
+ }
141
+ if (command === 'terminal') {
142
+ const selected = action || 'help';
143
+ if (!['connect', 'status', 'disconnect', 'service', 'browser-profile', 'help'].includes(selected))
144
+ throw new Error(`Unknown command: ${selected}`);
145
+ if (selected === 'service' && args._[2] && !['install', 'uninstall', 'help'].includes(args._[2]))
146
+ throw new Error('Use revo terminal service install|uninstall.');
147
+ if (selected === 'browser-profile' && args._[2] !== 'forget')
148
+ throw new Error('Use terminal browser-profile forget --browser-profile NAME.');
149
+ if (selected === 'help')
150
+ return b('help');
151
+ if (selected === 'status')
152
+ return b('help');
153
+ if (selected === 'connect')
154
+ return { ...v('workspace name terminal-id realtime-url browser-profile'), ...b('service-runner help') };
155
+ return { ...v('workspace name terminal-id'), ...b('help'), ...(['service', 'browser-profile'].includes(selected) ? v('browser-profile') : {}) };
156
+ }
157
+ if (['plan', 'diff', 'deploy', 'pull', 'migrate'].includes(command)) {
158
+ if (command === 'pull')
159
+ return { ...output, ...all, ...yes, ...force, ...many('resources resource'), ...b('skip-groups'), ...omit };
160
+ if (command === 'diff')
161
+ return { ...output, ...omit, ...b('activate prune with-stats'), ...force };
162
+ if (command === 'plan') {
163
+ if (action && action !== 'update')
164
+ throw new Error('Unknown plan command; use revo plan or revo plan update.');
165
+ return { ...plan, ...omit, ...b('activate prune changed'), ...force, ...v('out base from to'), ...many('resources resource'), ...b('with-stats') };
166
+ }
167
+ if (command === 'deploy')
168
+ return { ...output, ...omit, ...yes, ...force, ...b('activate prune async changed hints'), ...v('reviewed-plan base'), ...many('resources resource'), ...b('with-stats') };
169
+ if (action && !['plan', 'run', 'verify'].includes(action))
170
+ throw new Error(`Unknown migrate command: ${action}. Use plan, run or verify.`);
171
+ const effectivePlan = !action || action === 'plan' || readBooleanOption(args, ['dry-run']);
172
+ return { ...output, ...v('from to'), ...many('resources resource'), ...b('skip-groups with-stats dry-run prune'), ...force, ...omit,
173
+ ...(effectivePlan ? v('out') : {}), ...(effectivePlan || action === 'verify' ? b('hints') : {}), ...(action === 'run' ? yes : {}) };
174
+ }
175
+ const family = ['component', 'database-tables', 'database-schemas', 'database-views', 'endpoints', 'job-templates', 'schedules', 'events', 'groups', 'role-groups', 'service-accounts', 'agents', 'agent-plugins'].includes(command);
176
+ if (!family)
177
+ throw new Error(`Unknown command: ${command}`);
178
+ const component = command === 'component';
179
+ const actions = component ? ['pull', 'pull-all', 'plan', 'push', 'push-all', 'debug'] : ['pull', 'plan', 'push'];
180
+ if (action && !actions.includes(action))
181
+ throw new Error(`Unknown ${command} command.`);
182
+ if (!action)
183
+ return {};
184
+ if (component && action === 'debug')
185
+ return { ...v('id i body d timeout t memory m'), ...b('read-only stream extra-libs no-extra-libs raw-debug debug-raw debug-payload') };
186
+ const result = { ...all, ...output, ...omit,
187
+ ...(action === 'plan' ? plan : force),
188
+ ...(['push', 'push-all'].includes(action) ? yes : {}),
189
+ };
190
+ if (component) {
191
+ Object.assign(result, action === 'plan' ? {} : many('id i'), b('prune'), ['plan', 'push', 'push-all'].includes(action) ? changed : {}, ['pull', 'pull-all'].includes(action) ? { ...yes, ...b('stale s') } : {});
192
+ if (action !== 'plan')
193
+ delete result.json;
194
+ }
195
+ if (['agents', 'agent-plugins'].includes(command))
196
+ delete result.hints;
197
+ if (['database-tables', 'database-schemas'].includes(command))
198
+ Object.assign(result, action === 'plan' ? b('with-stats skip-partitions') : { ...b('prune-orphans'), ...yes }, action === 'pull' ? b('strict') : {}, action === 'push' ? { ...b('prune-partitions async'), ...v('idempotency-key') } : {});
199
+ if (command === 'database-views' && action === 'pull')
200
+ Object.assign(result, b('strict'));
201
+ if (['schedules', 'events'].includes(command) && ['plan', 'push'].includes(action))
202
+ Object.assign(result, b('activate'));
203
+ // These handlers explicitly reject prune; recognize it so their diagnostic remains specific.
204
+ if (['agents', 'agent-plugins'].includes(command) || ['groups', 'role-groups', 'service-accounts'].includes(command) && action !== 'pull' || command === 'endpoints' && action === 'push')
205
+ Object.assign(result, b('prune'));
206
+ return result;
207
+ }
208
+ /** Pure preflight: no configuration, filesystem, authentication or network effects. */
209
+ export function validateCommandArguments(args, options = {}) {
210
+ if (args.omit !== undefined && !['plan', 'diff', 'deploy', 'pull', 'migrate', 'component', 'database-tables', 'database-schemas', 'database-views', 'job-templates', 'endpoints', 'schedules', 'events', 'groups', 'role-groups', 'service-accounts', 'agents', 'agent-plugins', 'env', 'projects'].includes(args._[0])) {
211
+ throw new Error('--omit is a synchronization option; it cannot change raw requests or other commands.');
212
+ }
213
+ const contract = { ...runtimeContract(args), ...b('update-notifier no-update-notifier'), ...actionContract(args),
214
+ ...(options.allowHelp ? b('help h') : {}) };
215
+ if (args['dry-run'] !== undefined || args.dryRun !== undefined) {
216
+ const supported = args._[0] === 'migrate' || (['env', 'projects'].includes(args._[0]) && args._[1] === 'apply');
217
+ if (!supported)
218
+ throw new Error(`${args._.slice(0, 2).join(' ') || 'This command'} does not support --dry-run. Use revo plan or the resource plan command to review changes.`);
219
+ }
220
+ const recorded = occurrences.get(args);
221
+ const optionEntries = recorded?.length
222
+ ? [...recorded.map(({ name, value }) => [name, value]), ...Object.entries(args).filter(([name]) => name !== '_' && !recorded.some(entry => entry.name === name))]
223
+ : Object.entries(args);
224
+ for (const [name, value] of optionEntries) {
225
+ if (name === '_')
226
+ continue;
227
+ const kind = Object.hasOwn(contract, name) ? contract[name] : undefined;
228
+ if (!kind)
229
+ throw new Error(`Unknown option --${name} for ${args._.slice(0, 2).join(' ') || 'overview'}. Run revo help.`);
230
+ if (kind === 'boolean')
231
+ continue;
232
+ const values = Array.isArray(value) ? value : [value];
233
+ if (values.some(value => typeof value !== 'string' || !value.trim()))
234
+ throw new Error(`--${name} requires a value.`);
235
+ if (kind === 'value' && (values.length > 1 || (recorded?.filter(entry => entry.name === name).length || 0) > 1))
236
+ throw new Error(`--${name} accepts one value.`);
237
+ }
238
+ const valueAliases = [
239
+ ['url', 'baseUrl'], ['stable-key-name', 'stableKeyName'], ['identity-mode', 'identityMode'],
240
+ ['method', 'm'], ['path', 'p'], ['body', 'd'], ['file', 'f'], ['base', 'git-base'],
241
+ ...(shortTokenIsRuntime(args) ? [['token', 't']] : args._[0] === 'search' ? [['type', 't']] : [['timeout', 't']]),
242
+ ...(args._[0] === 'component' ? args._[1] === 'debug' ? [['id', 'i'], ['memory', 'm']] : [] : [['instance', 'i']]),
243
+ ];
244
+ for (const group of valueAliases) {
245
+ const supplied = group.filter(name => contract[name] === 'value' && args[name] !== undefined);
246
+ if (new Set(supplied.map(name => args[name])).size > 1)
247
+ throw new Error(`Conflicting values for ${supplied.map(name => `--${name}`).join(' and ')}.`);
248
+ }
249
+ // Main rejects dual profile flags; command contexts also carry the normalized env alias.
250
+ if (args.project !== undefined && args.env !== undefined && args.project !== args.env)
251
+ throw new Error('Use either --project or --env, not both.');
252
+ const visited = new Set();
253
+ for (const [name, kind] of Object.entries(contract)) {
254
+ if (kind !== 'boolean' || visited.has(name))
255
+ continue;
256
+ const group = aliases.find(group => group.includes(name))?.filter(alias => contract[alias] === 'boolean') || [name];
257
+ group.forEach(alias => visited.add(alias));
258
+ const value = readBooleanOption(args, group);
259
+ for (const alias of group)
260
+ if (args[alias] !== undefined)
261
+ args[alias] = value;
262
+ }
263
+ const [command, action] = args._;
264
+ if (command === 'deploy' && readBooleanOption(args, ['async']))
265
+ throw new Error('Full deploy waits for schema readiness and verified readback before dependent phases; use database-tables push <stableKey> --async for admission only.');
266
+ const positionalAliases = command === 'request'
267
+ ? [[1, ['method', 'm'], true], [2, ['path', 'p']], [3, ['body', 'd']]]
268
+ : command === 'search' ? [[1, ['type', 't'], true], [2, ['term']]]
269
+ : command === 'component' && action === 'debug' ? [[2, ['id', 'i']], [3, ['body', 'd']]] : [];
270
+ for (const [index, names, uppercase] of positionalAliases) {
271
+ const positional = args._[index];
272
+ if (positional === undefined)
273
+ continue;
274
+ for (const name of names) {
275
+ const value = args[name];
276
+ if (typeof value === 'string' && (uppercase ? value.toUpperCase() !== positional.toUpperCase() : value !== positional))
277
+ throw new Error(`Conflicting positional value and --${name}. Choose one value.`);
278
+ }
279
+ }
280
+ if (command === 'terminal' && args.name !== undefined && args['terminal-id'] !== undefined)
281
+ throw new Error('Use either --name or --terminal-id, not both.');
282
+ let maximum;
283
+ if (['deploy', 'diff', 'info', 'help', 'version'].includes(command))
284
+ maximum = 1;
285
+ else if (command === 'plan')
286
+ maximum = action === 'update' ? 2 : 1;
287
+ else if (command === 'auth' || command === 'metadata' || command === 'migrate')
288
+ maximum = 2;
289
+ else if (command === 'project' || command === 'search')
290
+ maximum = 3;
291
+ else if (command === 'request')
292
+ maximum = 4;
293
+ else if (['env', 'projects'].includes(command))
294
+ maximum = ['add', 'set', 'remove'].includes(action) ? 3 : 2;
295
+ else if (command === 'tests' && action !== 'run')
296
+ maximum = ['resume', 'cancel'].includes(action) ? 3 : 2;
297
+ else if (command === 'studio')
298
+ maximum = ['file', 'review', 'release-claim', 'cancel-test'].includes(action) ? 4 : ['list', 'create', 'promote'].includes(action || 'list') ? 2 : 3;
299
+ else if (command === 'terminal')
300
+ maximum = ['service', 'browser-profile'].includes(action) ? 3 : 2;
301
+ else if (command === 'component' && action === 'debug')
302
+ maximum = 4;
303
+ else if (command === 'component' && action === 'plan')
304
+ maximum = 2;
305
+ else if (['database-tables', 'database-schemas', 'database-views'].includes(command))
306
+ maximum = action === 'push' ? 3 : 2;
307
+ else if (['endpoints', 'job-templates', 'schedules', 'events', 'groups', 'role-groups', 'service-accounts', 'agents', 'agent-plugins'].includes(command))
308
+ maximum = 2;
309
+ if (maximum !== undefined && args._.length > maximum)
310
+ throw new Error(`Unexpected positional argument for ${command}${action ? ` ${action}` : ''}. Run revo help.`);
311
+ if (command === 'endpoints' && action === 'push' && readBooleanOption(args, ['prune']))
312
+ throw new Error('Endpoint prune is disabled until a reviewed deletion contract is introduced.');
313
+ if (command === 'component' && ['pull', 'push', 'pull-all', 'push-all'].includes(action)) {
314
+ const ids = args.id !== undefined || args.i !== undefined;
315
+ const positionals = args._.length > 2;
316
+ if (ids && positionals || (ids || positionals) && (readBooleanOption(args, ['all', 'a']) || action.endsWith('-all')))
317
+ throw new Error('Choose one Component selector: positional identities, --id, or --all.');
318
+ }
319
+ }
320
+ /** Terminal owns connection arguments only; a suffix after -- is not a child command. */
321
+ export function validateTerminalArguments(argv) {
322
+ const args = { _: ['terminal'] };
323
+ const normalized = [];
324
+ for (let index = 0; index < argv.length; index++) {
325
+ const token = argv[index];
326
+ if (token === '--') {
327
+ if (index < argv.length - 1)
328
+ throw new Error('Unexpected positional argument after -- for terminal. Terminal commands do not accept a child command.');
329
+ break;
330
+ }
331
+ if (!token.startsWith('-')) {
332
+ args._.push(token);
333
+ normalized.push(token);
334
+ continue;
335
+ }
336
+ if (!token.startsWith('--'))
337
+ throw new Error(`Unknown option ${token} for terminal. Use long options.`);
338
+ const equal = token.indexOf('=');
339
+ const rawName = token.slice(2, equal < 0 ? undefined : equal);
340
+ if (rawName.startsWith('no-') && equal >= 0)
341
+ throw new Error('Negated terminal flags do not accept a value; use the bare --no-flag form.');
342
+ const name = rawName.startsWith('no-') ? rawName.slice(3) : rawName;
343
+ const bool = ['help', 'service-runner', 'update-notifier'].includes(name);
344
+ let value = rawName.startsWith('no-') ? false : equal >= 0 ? token.slice(equal + 1) : true;
345
+ if (equal < 0 && !rawName.startsWith('no-') && argv[index + 1] !== undefined && !argv[index + 1].startsWith('--'))
346
+ value = argv[++index];
347
+ recordParsedOption(args, name, value);
348
+ const previous = args[name];
349
+ args[name] = previous === undefined ? value : Array.isArray(previous) ? [...previous, String(value)] : [String(previous), String(value)];
350
+ if (bool) {
351
+ if (booleanValue(name, value))
352
+ normalized.push(`--${name}`);
353
+ }
354
+ else
355
+ normalized.push(`--${name}`, String(value));
356
+ }
357
+ validateCommandArguments(args);
358
+ return normalized;
359
+ }
@@ -163,6 +163,14 @@ export declare const requestContracts: {
163
163
  readonly type: "integer";
164
164
  readonly maximum: 1024;
165
165
  };
166
+ readonly responseMode: {
167
+ readonly nullable: true;
168
+ readonly enum: readonly ["http", "sse"];
169
+ };
170
+ readonly sse: {
171
+ readonly $ref: "#/components/schemas/EndpointSseDto";
172
+ readonly nullable: true;
173
+ };
166
174
  readonly input: {
167
175
  readonly nullable: true;
168
176
  readonly type: "object";
@@ -237,6 +245,37 @@ export declare const requestContracts: {
237
245
  };
238
246
  readonly additionalProperties: false;
239
247
  };
248
+ readonly EndpointSseDto: {
249
+ readonly type: "object";
250
+ readonly properties: {
251
+ readonly disconnect: {
252
+ readonly nullable: true;
253
+ readonly enum: readonly ["cancel", "continue", "continue-and-notify"];
254
+ };
255
+ readonly resultEvent: {
256
+ readonly nullable: true;
257
+ readonly type: "string";
258
+ readonly maxLength: 1024;
259
+ readonly pattern: "^[^\\r\\n\\0]+$";
260
+ readonly patternFlags: "";
261
+ };
262
+ readonly errorEvent: {
263
+ readonly nullable: true;
264
+ readonly type: "string";
265
+ readonly maxLength: 1024;
266
+ readonly pattern: "^[^\\r\\n\\0]+$";
267
+ readonly patternFlags: "";
268
+ };
269
+ readonly doneEvent: {
270
+ readonly nullable: true;
271
+ readonly type: "string";
272
+ readonly maxLength: 1024;
273
+ readonly pattern: "^[^\\r\\n\\0]+$";
274
+ readonly patternFlags: "";
275
+ };
276
+ };
277
+ readonly additionalProperties: false;
278
+ };
240
279
  readonly JobTemplateRequestDto: {
241
280
  readonly type: "object";
242
281
  readonly properties: {
@@ -523,6 +562,12 @@ export declare const requestContracts: {
523
562
  readonly UpdateComponentDto: {
524
563
  readonly type: "object";
525
564
  readonly properties: {
565
+ readonly testConfig: {
566
+ readonly allOf: readonly [{
567
+ readonly $ref: "#/components/schemas/ComponentTestConfigDto";
568
+ }];
569
+ readonly nullable: true;
570
+ };
526
571
  readonly name: {
527
572
  readonly nullable: true;
528
573
  readonly type: "string";
@@ -548,12 +593,6 @@ export declare const requestContracts: {
548
593
  readonly version: {
549
594
  readonly type: "integer";
550
595
  };
551
- readonly testConfig: {
552
- readonly allOf: readonly [{
553
- readonly $ref: "#/components/schemas/ComponentTestConfigDto";
554
- }];
555
- readonly nullable: true;
556
- };
557
596
  };
558
597
  readonly required: readonly ["version"];
559
598
  readonly additionalProperties: false;
@@ -655,10 +694,10 @@ export declare const requestContractDefaults: {
655
694
  readonly maxBytes: 1048576;
656
695
  };
657
696
  readonly componentElements: {
658
- readonly lowCodeTypes: readonly ["CODE_JS", "CODE_JS_LIB", "CODE_TS", "CODE_TS_LIB", "CODE_JS_TEST", "CODE_TS_TEST"];
697
+ readonly lowCodeTypes: readonly ["CODE_JS", "CODE_JS_LIB", "CODE_TS", "CODE_JS_TEST", "CODE_TS_TEST", "CODE_TS_LIB"];
659
698
  readonly libraryTypes: readonly ["CODE_JS_LIB", "CODE_TS_LIB"];
660
699
  readonly defaultLibraryKey: "@default";
661
- readonly reservedKeys: readonly ["_", "api", "arguments", "as", "async", "await", "boolean", "break", "case", "catch", "class", "const", "constructor", "continue", "debugger", "declare", "default", "delete", "do", "else", "enum", "eval", "export", "extends", "false", "finally", "for", "from", "function", "get", "global", "if", "implements", "import", "in", "instance", "instanceof", "interface", "let", "lib", "libs", "module", "namespace", "never", "new", "null", "number", "of", "package", "private", "protected", "provider", "public", "r", "readonly", "require", "return", "revo", "revong", "set", "static", "string", "super", "switch", "symbol", "this", "throw", "true", "try", "type", "typeof", "undefined", "unique", "unknown", "var", "void", "while", "with", "yield"];
700
+ readonly reservedKeys: readonly ["_", "api", "arguments", "as", "async", "await", "boolean", "break", "case", "catch", "class", "const", "constructor", "continue", "debugger", "declare", "default", "delete", "do", "else", "enum", "eval", "export", "extends", "false", "finally", "for", "from", "function", "get", "global", "if", "implements", "import", "in", "instance", "instanceof", "interface", "let", "lib", "libs", "module", "namespace", "never", "new", "null", "number", "of", "package", "private", "protected", "provider", "public", "r", "readonly", "require", "return", "revo", "revong", "set", "static", "string", "super", "switch", "symbol", "this", "test", "throw", "true", "try", "type", "typeof", "undefined", "unique", "unknown", "var", "void", "while", "with", "yield"];
662
701
  readonly identifierPattern: {
663
702
  readonly pattern: "^[A-Za-z_$][A-Za-z0-9_$]*$";
664
703
  readonly patternFlags: "";
@@ -698,17 +737,17 @@ export declare const requestContractSemanticSources: {
698
737
  readonly "packages/platform-shared/src/utils/job-retry-policy.util.ts#normalizeJobRetryPolicy": "facef84884b5b4311af06bfb4469f071ff42a4bca067b6d9092d4f6571e8ee86";
699
738
  readonly "packages/platform-shared/src/utils/job-retry-policy.util.ts#assertJobRetryPolicyValid": "6511ccafc15233a4ffe4e024f13e6c0e5c9d8a53c261ecc571300495afd804cf";
700
739
  readonly "packages/domain/src/dto/components/component.validator.ts#validateEndpointGuardSemantics": "fd885b48c2990e47d1f05965af044aef8e2256da5fa4a86d1248967b04a3fd1e";
701
- readonly "apps/api/src/modules/endpoints/endpoint.service.ts#create": "67e4b6747981dd61cb33ca9f72e49d8d7ccfaa41f16bd57780591e1e5939d51d";
702
- readonly "apps/api/src/modules/endpoints/endpoint.service.ts#update": "9f8e05e2f68248bcff43d2f5a5430c372ab61c2c00efd2dd8214229fa313f47f";
740
+ readonly "apps/api/src/modules/endpoints/endpoint.service.ts#create": "cb10fc198892423088d396acd09618d8c64504a57fac0df3a892d57993913067";
741
+ readonly "apps/api/src/modules/endpoints/endpoint.service.ts#update": "bc59acaffdb7275659bddb65b8d71e9d8266447054723ea87495eaa0dd512fe1";
703
742
  readonly "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "07401218669a87a9488b0aeb59f15b8d51341a172fb346ff83d38ed563a2988f";
704
743
  readonly "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "990c27ae925b613215601c215a6e38f6ecb4e2b34b77d6e2819f0921d4e56230";
705
744
  readonly "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "1513bad8634fdf6abcca52f0041044512b3e53b3e7451f1b443f7e79fc026b01";
706
- readonly "apps/api/src/modules/automation/jobs.service.ts#update": "f11808497fa36a7965b496314e1255920945df365ee62aba810612bf6b2cd30c";
745
+ readonly "apps/api/src/modules/automation/jobs.service.ts#update": "950fad34e7ac3ffdfce9114ba213c11e113aea036a44569b126a8c1e5e589228";
707
746
  readonly "packages/platform-shared/src/services/job.scheduler.service.ts#resolveTemplateInputs": "a9a4cc5df4627abf7ee2d2df7f2494d290292a15f4889a5f07a9de104ee33d9f";
708
- readonly "packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "f597e0a4bb99ec8cc5cd327f2556592471d62258366bd55b12ce321ad44cce9b";
747
+ readonly "packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "4918470ef562727becb8c97c5afb7761a49734ecd21a6d3d5436576dbd10a6da";
709
748
  readonly "packages/domain/src/dto/components/component-element-key.const.ts#isDefaultLibraryElement": "4faa356b91be5c44ebe3d442b6da26088d6d35d2db5fb073e1103165431cee48";
710
749
  readonly "apps/api/src/modules/components/component.service.ts#assertComponentElementsSize": "30b14e4c7a1c62b4061aa13b1476d815002bf3273b4129551dde9b9a45bb87ca";
711
- readonly "apps/api/src/modules/components/component.service.ts#validateElements": "1ff874a47bf80ed760c292c8ec9fb9b6fe48d185ea080098ff21ef8f6ac93bfa";
750
+ readonly "apps/api/src/modules/components/component.service.ts#validateElements": "57b292450bfdd3d26c11b4b4f12160848f4983e4b5f74850aca69b92fa2b751c";
712
751
  readonly "packages/execution-core/src/modules/@core/services/virtualization.service.ts#requestedMemoryLimit": "ca32691eb31e1bf5d17d80d56861bb73fa698b6f08ae047ab48a1a4927594fe4";
713
752
  readonly "packages/platform-shared/src/utils/custom-node-component.util.ts#normalizeCustomNodeElementPath": "486eb7ca53b95d7b49de4735d5b5ca8f15dc994852eeff0009d8a72189474455";
714
753
  readonly "packages/platform-shared/src/utils/custom-node-component.util.ts#hasExportedCustomNodeInit": "9979558e29219c2545a11b20924b14401aef26df99d251efe261f0447aebd98b";
@@ -717,7 +756,8 @@ export declare const requestContractSourceProvenance: {
717
756
  readonly main: {
718
757
  readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointRequestDto": "45a1a84e200b2cdf9b44051fe36cb7bda1b577a0f5bbcc88942764336a6d7302";
719
758
  readonly "packages/domain/src/dto/automation/update.api.template.request.dto.ts#UpdateEndpointRequestDto": "20ee0c9afbfa594f189ead2b751aa00b6003efe0b70c5e1158ee78c1e0d29567";
720
- readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "398396ec9aa9a592f7e26bed333aa050d0b24adb35a314c64144f3a0528a1623";
759
+ readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "acb07cc1e2c80d1721150691ea185eb3fa2f255a0833749973bf8175d85d9a32";
760
+ readonly "packages/domain/src/dto/automation/endpoint.sse.dto.ts#EndpointSseDto": "960d56ebb300ded00f61f1318522c010135675e0f32a8084fb3e9b16a1c20ecc";
721
761
  readonly "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "c47123206c187f0e16b08d7033ed9c455932f2e78e34455577663eb09410559d";
722
762
  readonly "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "0f79fefc76e749a331b5c848b9dcd6061e7dc247c2094dd975d7d2fe9a101c08";
723
763
  readonly "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "6e8f3f4b7aa6d8f38bc9227ced3158e4697031e68c78be9ea0e24e5af29e37d3";
@@ -725,18 +765,12 @@ export declare const requestContractSourceProvenance: {
725
765
  readonly "packages/domain/src/dto/automation/run.options.dto.ts#RetryJobDto": "e42fcd447fe111bdf2da20ad42654e536a01d566f33a1d8f52ec1bb0bd1ee8b1";
726
766
  readonly "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeExecutionPolicyDto": "9978ee21a9b7da26c93a4e1516dfc319166a2b55520edee9319d17922b375474";
727
767
  readonly "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeJobExecutionPolicyDto": "d900a693362a9de02839e2ae959c4e8ac2ac8e0206a4cbe69e889a3636793d23";
728
- readonly "packages/domain/src/dto/components/update.component.dto.ts#UpdateComponentDto": "c0e39996b17c6d3cb46f4bda921dfe45e21e18ef6dbcd4ed55eb7ede82aeabe0";
768
+ readonly "packages/domain/src/dto/components/update.component.dto.ts#UpdateComponentDto": "bac5c210c38eb230ae6ca2b42428956ea1c2065ffc947c40478152098a50e673";
729
769
  readonly "packages/domain/src/dto/components/component.element.dto.ts#ComponentElementsDto": "4aa2ccd5613c116213525b0c686060973f657e7b81bed7362d925958d829c527";
730
- };
731
- readonly studioOverlay: {
732
- readonly "packages/domain/src/dto/components/update.component.dto.ts": "afce9903cf51c6f6cb670b9c2be15e6e6a2c6d842b4155966c26c4f82106ee2a";
733
- readonly "packages/domain/src/dto/components/component.test-config.dto.ts": "7d52ad25cd536115d10024f11ce101c21d1070f7ddb2da49a014a53ca40c2b74";
734
- readonly "packages/domain/src/dto/components/component-element-key.const.ts": "270b1198d0538b1d0e3b74912185d016075e21900c04e7a79747f9b7199919f6";
735
- readonly "packages/domain/src/enum/component.element.type.enum.ts": "898f455e0512063de81bda9eeb9e9fb4f7719dc66de172a1d61caaac9baf6f66";
736
- readonly "packages/domain/src/dto/components/update.component.dto.ts#UpdateComponentDto": "f54a535edf919df5ff1d6e3653a8df9c54ff51eb766a131ccdf6592291b83146";
737
770
  readonly "packages/domain/src/dto/components/component.test-config.dto.ts#ComponentTestConfigDto": "bd160d9217d45584cd7ab29680edef807d8a56fa61283000e1a3db88b8d74d19";
738
771
  readonly "apps/api/src/modules/components/component.service.ts#assertNativeTestConfiguration": "f2089642a94765e9f6168fcf39204c18a8585cdb377ada3ed98f53b2c21aae0c";
739
772
  readonly "packages/domain/src/dto/components/component-element-key.const.ts#COMPONENT_ELEMENT_RESERVED_KEYS": "ef9367438b70f78facd959c66002f51e3b035b5b23594a7850d3d86bf75ea4e9";
740
773
  readonly "packages/domain/src/dto/components/component-element-key.const.ts#COMPONENT_ELEMENT_JS_IDENTIFIER_PATTERN": "9d2b9a943361651239e3730e29cc11e0e204d46f3b8f03f69a6bef38c1754c7c";
741
774
  };
775
+ readonly studioOverlay: {};
742
776
  };