@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
package/README.md
CHANGED
|
@@ -301,7 +301,7 @@ revo plan --json
|
|
|
301
301
|
revo deploy --yes --json
|
|
302
302
|
```
|
|
303
303
|
|
|
304
|
-
Repository `plan` and `deploy` reports separate resource operations from lock bookkeeping across all
|
|
304
|
+
Repository `plan` and `deploy` reports separate resource operations from lock bookkeeping across all twelve resource families. An existing resource whose managed definition matches the repository is `operation: "noop"`, including when its baseline is absent or stale. Per-item `baselineAction` is `"adopt"` for a missing baseline, `"refresh"` for a stale baseline, or `"none"`. It describes separate bookkeeping for converged resources; create/update operations still save their verified baselines through the existing deployment flow. Use `revo plan --hints` to see this diagnostic in terminal output.
|
|
305
305
|
|
|
306
306
|
The JSON extension retains schema version 2, raw family `status`/`counts`, and `operations.adopt`. Repository summaries count converged resources as `operations.noop`; CI consumers should use item `operation` or aggregate `operations` rather than raw family status to identify resource changes. Validation failures, owner/role changes, and activation exclusions still take precedence over content equality. Dedicated resource commands and named `migrate` keep their existing contract.
|
|
307
307
|
|
|
@@ -394,16 +394,18 @@ Full pull, deployment, and migration use this fixed dependency order:
|
|
|
394
394
|
| 2 | `database-view` | `database-views` | `DatabaseViews/` | STRUCTURED and RAW_SQL views, including materialized views; target schemas must be ready first. |
|
|
395
395
|
| 3 | `component` | `component` | `Components/` | Portable code, libraries, and elements. Libraries are deployed before executable components. |
|
|
396
396
|
| 4 | `service-account` | `service-accounts` | `ServiceAccounts/` | Owner identities are resolved before dependent Groups and Job Templates; secrets are target-local. |
|
|
397
|
-
| 5 | `
|
|
398
|
-
| 6 | `
|
|
399
|
-
| 7 | `
|
|
400
|
-
| 8 | `
|
|
401
|
-
| 9 | `
|
|
402
|
-
| 10 | `
|
|
397
|
+
| 5 | `agent-plugin` | `agent-plugins` | `AgentPlugins/` | Tools, MCP servers, skills and packages; dependencies precede consumers and authentication remains target-local. |
|
|
398
|
+
| 6 | `agent` | `agents` | `Agents/` | Portable config/policy and execution identity; memory and runtime state remain target-local. |
|
|
399
|
+
| 7 | `job-template` | `job-templates` | `JobTemplates/` | Resolves Component and Service Account dependencies by Stable Key. Pull skips WIP templates without a Stable Key or with an unkeyed Component and reports each skip. |
|
|
400
|
+
| 8 | `endpoint` | `endpoints` | `Endpoints/` | Resolves Component dependencies and route ordering. |
|
|
401
|
+
| 9 | `schedule` | `schedules` | `Schedules/` | Targets Job Templates or Materialized Views. New schedules are inactive by default. |
|
|
402
|
+
| 10 | `event` | `events` | `Events/` | Supports Job Template event targets. Manifests retain `custom: true/false` alongside `type`; new events are inactive by default. |
|
|
403
|
+
| 11 | `group` | `groups` | `Groups/` | Group owners use Stable Keys; Service Account owners resolve early; human users and memberships remain target-local. |
|
|
404
|
+
| 12 | `role-group` | `role-groups` | `RoleGroups/` | Role assignments run last; members and user identifiers remain target-local. |
|
|
403
405
|
|
|
404
406
|
Active Materialized View refresh Schedules are reported in Database View plans but do not block push, repository deployment, or named migration. Updating a view preserves Schedule activation; API write failures and readback verification failures are still reported.
|
|
405
407
|
|
|
406
|
-
`--resources all` selects all
|
|
408
|
+
`--resources all` selects all twelve families. Singular, plural, and common compact aliases are accepted where the command parser documents them, but the selectors above are the canonical values.
|
|
407
409
|
|
|
408
410
|
Existing `database-schema` selectors and `revo database-schemas` commands remain accepted as compatibility aliases. New table manifests use `DatabaseTables/**/database-table.json`; older `DatabaseSchemas/**/database-schema.json` files remain readable and are relocated by the next successful table pull. A locally edited manifest still needs `--force` before pull replaces it. The manifest `kind` and `databaseSchemas` lock and plan keys retain their existing schema names for format compatibility.
|
|
409
411
|
|
|
@@ -431,7 +433,7 @@ revo schedules push --all --yes --force
|
|
|
431
433
|
|
|
432
434
|
`--force` permits adopting a missing Schedule baseline or overwriting reviewed target drift. It also approves a reviewed transition between Job Template and Materialized View targets under one Schedule Stable Key. Materialized View refresh Schedules are included with the other Schedules and identify their Database View by Stable Key and refresh mode, never by a source UUID. User-managed `JOB_TEMPLATE` and `PLATFORM_OPERATION` schedules of kind `refresh_materialized_view` are supported. Other platform operations, `AGENT`, and system-managed Schedules are excluded; `--strict` treats exclusions as incomplete coverage.
|
|
433
435
|
|
|
434
|
-
Pull initializes each Schedule's editable activation candidate from the source. A new target Schedule is created inactive, while a configuration update preserves its target activation state. `schedules push --all --yes --activate`
|
|
436
|
+
Pull initializes each Schedule's editable activation candidate from the source. A new target Schedule is created inactive, while a configuration update preserves its target activation state. `activationCandidate` records the desired active state. Plans report activation-only differences as `activation-drift`, including without a target lock baseline; repository plans mark them as pending changes, and strict plans or deployment verification do not report convergence until they are aligned. `schedules push --all --yes --activate` aligns verified new, updated and otherwise unchanged Schedules with manifest activation intent, including disabling them. Failed configuration preflight skips activation; changed definitions or dependencies block activation. Interactive activation asks for a second confirmation. Repository `deploy` and named `migrate` leave this activation step to the dedicated command.
|
|
435
437
|
|
|
436
438
|
Use `--project` to select a saved project explicitly (`--env` remains a compatible alias):
|
|
437
439
|
|
|
@@ -493,7 +495,7 @@ Resource plans support `--json` for automation and generally support `--strict`
|
|
|
493
495
|
- `--force` approves only explicitly supported risky or drifted operations; it is not a universal bypass.
|
|
494
496
|
- Writes resolve the target UUID and version immediately before mutation and verify the portable result afterward.
|
|
495
497
|
- Stable Keys cross environments; source UUIDs, versions, members, users, ACLs, and other target-local identities do not.
|
|
496
|
-
- New Schedules and Events are created inactive; ordinary updates preserve target activation. Dedicated `schedules push --all --yes --activate`
|
|
498
|
+
- New Schedules and Events are created inactive; ordinary updates preserve target activation. Dedicated `schedules push --all --yes --activate` aligns manifest activation intent for verified new, updated and otherwise unchanged Schedules, including disabling them. Activation drift is shown by plans and prevents repository strict-plan/deployment convergence until aligned. `events push --all --yes --activate` aligns verified Events with manifest activation intent, including disabling them; configuration failures skip Event activation. Interactive activation requires an additional confirmation. `deploy` and `migrate` do not run this activation phase.
|
|
497
499
|
- Groups and Role Groups are intentionally late phases because they can affect ownership and access.
|
|
498
500
|
- Lock data is stored in `.revoengine/revo.lock.json`; API tokens are never persisted in the project.
|
|
499
501
|
|
|
@@ -597,3 +599,39 @@ Both Endpoints and Job Templates accept `mode: "INHERIT"`, `"CALLER"` or `"SERVI
|
|
|
597
599
|
Job Template manifests retain the legacy `executionPrincipal` reference for existing definitions, including `{ "kind": "system" }`. Use either this field or `executionPolicy`, never both. Writing an explicit policy clears the legacy `triggerUser` alias. Definitions without either field retain target-local execution configuration. An explicit policy pointing to a human or an unkeyed ordinary account cannot be exported as a portable definition.
|
|
598
600
|
|
|
599
601
|
Selecting System or another instance administrator execution account approves the current instance Component and library code. Later source changes require administrator approval; ordinary editors cannot replace approved code silently. Authority selection preserves the caller in the audit trail.
|
|
602
|
+
|
|
603
|
+
### Agents and Agent Plugins
|
|
604
|
+
|
|
605
|
+
Agents and registry plugins participate in the same repository pull/plan/deploy and named migration flow as Service Accounts. Enable the families explicitly, or use `all`:
|
|
606
|
+
|
|
607
|
+
```bash
|
|
608
|
+
revo project update --resources component,service-account,group,agent-plugin,agent
|
|
609
|
+
revo metadata plan --project source --resources agent-plugin,agent
|
|
610
|
+
revo metadata apply --project source --resources agent-plugin,agent --yes
|
|
611
|
+
revo pull --project source --resources component,service-account,group,agent-plugin,agent --yes
|
|
612
|
+
revo plan --project target --json
|
|
613
|
+
revo deploy --project target --yes
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
Manifests live under `Agents/<name>-<key-suffix>/agent.json` and `AgentPlugins/<name>-<key-suffix>/agent-plugin.json` in the configured workspace. The shared lock stores portable hashes and per-instance baselines. Dedicated `revo agents` and `revo agent-plugins` commands support `pull`, `plan`, and `push` with `--all`, `--project`, `--json`, and `--force`; push requires `--yes` or interactive confirmation. Dedicated plan also supports `--strict`.
|
|
617
|
+
|
|
618
|
+
Plugin definitions cover `tools`, `mcp_server`, `skill`, and `package`, including routing, governance, schemas, toolsets, Markdown content and content token budgets. Read-only marketplace package metadata is excluded from portable manifests. Component references use `componentStableKey`; skill/package dependencies use `pluginStableKeys`. Agent config/policy attachments use `pluginStableKeys`, eager attachments use `eagerPluginStableKeys`, and `executionPrincipal` resolves a Service Account or the built-in System account. Portable Group and Service Account owners are resolved on the target; human ownership remains target-local. Plugins are deployed in dependency order before Agents. Missing/duplicate keys, unmanaged name/slug collisions, cycles and invalid references block writes even with force.
|
|
619
|
+
|
|
620
|
+
Agent `config.memory`, workspace files, conversations, runs, terminal selection, automation recipients, rollout state, avatars and MCP secrets/Vault UUIDs are instance-local. Export omits them; updates preserve target settings, including memory checkpoints, while replacing managed configuration. New Agents use the API's ordinary creation defaults and are not run by deployment. Configure their target execution permissions and automation separately. Tenant default plugin attachments are not synchronized; inherited eager attachments become explicit portable Agent attachments.
|
|
621
|
+
|
|
622
|
+
MCP URLs must use public HTTPS without embedded credentials, query or fragment. New authenticated MCP plugins (including inline plugins) require manual target-local authentication setup and the matching Stable Key before deployment. CLI preserves existing target MCP authentication; it neither provisions secrets nor invokes MCP test/sync or an external provider. Unauthenticated MCP definitions can be created normally. Legacy numeric Component revision pins require a portable `componentDigest` before export; Vault-bound tool inputs and instance-specific rollout snapshots are rejected rather than copied.
|
|
623
|
+
|
|
624
|
+
Agent and Agent Plugin synchronization is upsert-only. Repository prune blocks deletion of either family; retained Agents and inline/registry plugin references also protect Components, Groups and Service Accounts from unsafe pruning. Existing Service Account synchronization remains unchanged, including target-local credentials and membership policy.
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
### Deployment verification in 1.0.22
|
|
628
|
+
|
|
629
|
+
Portable comparison includes ordinary Component metadata and full structured Database Table / Materialized View index definitions (logical names, methods, expressions, predicates, ordering, null placement, collation, operator classes and included columns). Physical index names, resource IDs and backend-reserved metadata remain instance-local. Older table/view manifests that omitted index settings should be refreshed from the source before promotion.
|
|
630
|
+
|
|
631
|
+
Endpoint and Job Template pins use the API content identity `v1:sha256:<64 lowercase hex characters>`, independently of the configuration hash. Latest bindings explicitly clear old digest pins. Endpoint `pinnedDigest` fingerprints from older CLI versions are upgraded in memory only when their exact local Component source proves the content identity; otherwise re-pull the source definition. Numeric-only Job Template pins remain explicitly unsupported; use a canonical digest pin instead.
|
|
632
|
+
|
|
633
|
+
Schedule and Event activation differences remain pending changes even if their configuration matches. Ordinary deployment preserves activation; use the existing explicit `schedules push --all --yes --activate` or `events push --all --yes --activate` step to align it. Strict plans and final verification cannot report convergence until activation matches. Deprecated Schedule `targetVersion` is reported diagnostically; the backend does not use it to select a Job Template revision.
|
|
634
|
+
|
|
635
|
+
`CUSTOM_NODEJS` deployment verifies runtime availability and the active desired revision after source readback. Automatic deployment waits up to two minutes for readiness; failed attempts, manual activation requirements and unavailable/pending revisions fail verification without adopting a deployment baseline. Re-run after the runtime is ready. Named `env diff/apply` also reports unavailable unchanged custom runtimes and returns an error on unverified writes. Definition synchronization does not invoke provider/plugin tests; component dependencies and their pinned revisions are checked with read-only API calls, including unchanged definitions.
|
|
636
|
+
|
|
637
|
+
Execution options are compared without hiding runtime differences: missing Job Template memory means 256 MB; explicit 128 MB remains distinct. An empty `options.input` overrides legacy `inputs`. Endpoint `memory: null` remains distinct from 32 MB. If the backend substitutes a different value, readback verification fails rather than recording false convergence.
|
package/dist/src/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { pathToFileURL } from 'node:url';
|
|
|
3
3
|
import { RevoClient } from "./client.js";
|
|
4
4
|
import { readComponentLock } from "./component-lock.js";
|
|
5
5
|
import { getActiveEnvironmentName } from "./config.js";
|
|
6
|
-
import { handleAuthCommand, handleComponentCommand, handleDatabaseTablesCommand, handleDatabaseViewsCommand, handleDeployCommand, handleDiffCommand, handleEndpointsCommand, handleEnvCommand, handleEventsCommand, handleGroupsCommand, handleInfoCommand, handleJobTemplatesCommand, handleMetadataCommand, handleMigrateCommand, handlePlanCommand, handlePullCommand, handleProjectCommand, handleRequestCommand, handleRoleGroupsCommand, handleServiceAccountsCommand, handleSearchCommand, handleSchedulesCommand, handleTerminalCommand, } from "./commands/index.js";
|
|
6
|
+
import { handleAgentsCommand, handleAuthCommand, handleComponentCommand, handleDatabaseTablesCommand, handleDatabaseViewsCommand, handleDeployCommand, handleDiffCommand, handleEndpointsCommand, handleEnvCommand, handleEventsCommand, handleGroupsCommand, handleInfoCommand, handleJobTemplatesCommand, handleMetadataCommand, handleMigrateCommand, handlePlanCommand, handlePullCommand, handleProjectCommand, handleRequestCommand, handleRoleGroupsCommand, handleServiceAccountsCommand, handleSearchCommand, handleSchedulesCommand, handleTerminalCommand, } from "./commands/index.js";
|
|
7
7
|
import { createHttpTraceSession, finalizeHttpTraceSession, withHttpTraceSession, } from "./http-trace.js";
|
|
8
8
|
import { resolveProjectRoot } from "./project.js";
|
|
9
9
|
import { withRequestQueue } from "./request-queue.js";
|
|
@@ -293,6 +293,10 @@ async function runMain(args, argv) {
|
|
|
293
293
|
await handleRequestCommand(context);
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
|
+
if (command === 'agents' || command === 'agent-plugins') {
|
|
297
|
+
await handleAgentsCommand(context);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
296
300
|
if (command === 'service-accounts') {
|
|
297
301
|
await handleServiceAccountsCommand(context);
|
|
298
302
|
return;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RuntimeExecutionPolicy } from './types.ts';
|
|
2
2
|
import { RequestQueue } from './request-queue.ts';
|
|
3
|
-
import type { ComponentRecord, DatabaseSchemaRecord, DatabaseViewRecord, EndpointRecord, EventRecord, GroupRecord, JobTemplateRecord, RoleGroupRecord, ServiceAccountRecord, ScheduleRecord } from './types.ts';
|
|
3
|
+
import type { AgentRecord, AgentPluginRecord, ComponentRecord, DatabaseSchemaRecord, DatabaseViewRecord, EndpointRecord, EventRecord, GroupRecord, JobTemplateRecord, RoleGroupRecord, ServiceAccountRecord, ScheduleRecord } from './types.ts';
|
|
4
4
|
import type { TrackableResourceType } from './tracked-resources.ts';
|
|
5
5
|
export type RequestOptions = {
|
|
6
6
|
query?: Record<string, unknown>;
|
|
@@ -45,9 +45,12 @@ export type DatabaseSchemaMetadataWritePayload = {
|
|
|
45
45
|
export type DatabaseSchemaUpdatePayload = Omit<DatabaseSchemaMetadataWritePayload, 'metadata'> & {
|
|
46
46
|
name?: string;
|
|
47
47
|
metadata?: Record<string, unknown>;
|
|
48
|
-
category?: string;
|
|
48
|
+
category?: string | null;
|
|
49
49
|
desc?: string;
|
|
50
50
|
definition?: Record<string, unknown>[];
|
|
51
|
+
options?: {
|
|
52
|
+
indexes: Record<string, unknown>[];
|
|
53
|
+
};
|
|
51
54
|
};
|
|
52
55
|
export type DatabaseSchemaCreatePayload = {
|
|
53
56
|
name: string;
|
|
@@ -57,6 +60,9 @@ export type DatabaseSchemaCreatePayload = {
|
|
|
57
60
|
definition?: Record<string, unknown>[];
|
|
58
61
|
partition?: Record<string, unknown>;
|
|
59
62
|
parent?: string;
|
|
63
|
+
options?: {
|
|
64
|
+
indexes: Record<string, unknown>[];
|
|
65
|
+
};
|
|
60
66
|
audit?: false;
|
|
61
67
|
restricted?: boolean;
|
|
62
68
|
};
|
|
@@ -84,9 +90,8 @@ export type DatabaseViewCreatePayload = {
|
|
|
84
90
|
groups: [];
|
|
85
91
|
uniqueKey?: string[];
|
|
86
92
|
indexes?: Array<{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}>;
|
|
93
|
+
[key: string]: unknown;
|
|
94
|
+
columns: Array<Record<string, unknown>>;
|
|
90
95
|
unique?: boolean;
|
|
91
96
|
}>;
|
|
92
97
|
} & ({
|
|
@@ -109,9 +114,7 @@ export type DatabaseViewUpdatePayload = {
|
|
|
109
114
|
uniqueKey?: string[];
|
|
110
115
|
indexes?: Array<{
|
|
111
116
|
name?: string;
|
|
112
|
-
columns: Array<
|
|
113
|
-
name: string;
|
|
114
|
-
}>;
|
|
117
|
+
columns: Array<Record<string, unknown>>;
|
|
115
118
|
unique?: boolean;
|
|
116
119
|
[key: string]: unknown;
|
|
117
120
|
}>;
|
|
@@ -132,6 +135,7 @@ export type EndpointWritePayload = {
|
|
|
132
135
|
desc?: string;
|
|
133
136
|
componentId?: string | null;
|
|
134
137
|
componentVersion?: number | null;
|
|
138
|
+
componentDigest?: string | null;
|
|
135
139
|
timeout?: number;
|
|
136
140
|
path?: string;
|
|
137
141
|
method?: string;
|
|
@@ -251,6 +255,8 @@ export type JobTemplateUpdatePayload = {
|
|
|
251
255
|
desc?: string;
|
|
252
256
|
metadata?: Record<string, unknown>;
|
|
253
257
|
componentId?: string;
|
|
258
|
+
componentDigest?: string | null;
|
|
259
|
+
componentVersion?: number | null;
|
|
254
260
|
timeout?: number | null;
|
|
255
261
|
options?: unknown;
|
|
256
262
|
inputs?: unknown;
|
|
@@ -263,6 +269,8 @@ export type JobTemplateCreatePayload = {
|
|
|
263
269
|
desc?: string;
|
|
264
270
|
metadata: Record<string, unknown>;
|
|
265
271
|
componentId: string;
|
|
272
|
+
componentDigest?: string | null;
|
|
273
|
+
componentVersion?: number | null;
|
|
266
274
|
timeout?: number;
|
|
267
275
|
options?: unknown;
|
|
268
276
|
inputs?: unknown;
|
|
@@ -418,6 +426,13 @@ export declare class RevoClient {
|
|
|
418
426
|
activateEndpoint(endpointId: string): Promise<void>;
|
|
419
427
|
disableEndpoint(endpointId: string): Promise<void>;
|
|
420
428
|
restoreEndpoint(endpointId: string): Promise<void>;
|
|
429
|
+
resolveComponentDigest(digest: string): Promise<Array<{
|
|
430
|
+
componentId: string;
|
|
431
|
+
digest: string;
|
|
432
|
+
version: number;
|
|
433
|
+
current?: boolean;
|
|
434
|
+
}>>;
|
|
435
|
+
getComponentRuntime(componentId: string): Promise<unknown>;
|
|
421
436
|
getComponentSnapshotVersion(componentId: string, version: number): Promise<ComponentRecord>;
|
|
422
437
|
getEditorTypes(requestPath?: string): Promise<unknown>;
|
|
423
438
|
debugComponent(requestPath: string, body: unknown): Promise<unknown>;
|
|
@@ -451,6 +466,19 @@ export declare class RevoClient {
|
|
|
451
466
|
discoveredTotal: number | null;
|
|
452
467
|
}>;
|
|
453
468
|
getRoleGroup(roleGroupId: string, options?: Pick<RequestOptions, 'timeoutMs' | 'maxRetries'>): Promise<RoleGroupResponse>;
|
|
469
|
+
private listAgentDefinitions;
|
|
470
|
+
listAllAgents(): Promise<{
|
|
471
|
+
agents: AgentRecord[];
|
|
472
|
+
}>;
|
|
473
|
+
listAllAgentPlugins(): Promise<{
|
|
474
|
+
agentPlugins: AgentPluginRecord[];
|
|
475
|
+
}>;
|
|
476
|
+
getAgent(id: string): Promise<AgentRecord>;
|
|
477
|
+
getAgentPlugin(id: string): Promise<AgentPluginRecord>;
|
|
478
|
+
createAgent(body: Record<string, unknown>): Promise<AgentRecord>;
|
|
479
|
+
updateAgent(id: string, body: Record<string, unknown>): Promise<AgentRecord>;
|
|
480
|
+
createAgentPlugin(body: Record<string, unknown>): Promise<AgentPluginRecord>;
|
|
481
|
+
updateAgentPlugin(id: string, body: Record<string, unknown>): Promise<AgentPluginRecord>;
|
|
454
482
|
listGroups(options?: GroupListRequest): Promise<unknown>;
|
|
455
483
|
listAllGroups(): Promise<{
|
|
456
484
|
groups: GroupRecord[];
|
|
@@ -474,6 +502,7 @@ export declare class RevoClient {
|
|
|
474
502
|
createSchedule(body: ScheduleCreatePayload): Promise<ScheduleResponse>;
|
|
475
503
|
updateSchedule(scheduleId: string, body: ScheduleWritePayload): Promise<ScheduleResponse>;
|
|
476
504
|
activateSchedule(scheduleId: string): Promise<unknown>;
|
|
505
|
+
disableSchedule(scheduleId: string): Promise<unknown>;
|
|
477
506
|
listEvents(options?: EventListRequest): Promise<unknown>;
|
|
478
507
|
listAllEvents({ includeDeleted }?: EventListAllOptions): Promise<{
|
|
479
508
|
events: EventRecord[];
|
package/dist/src/client.js
CHANGED
|
@@ -1023,6 +1023,15 @@ export class RevoClient {
|
|
|
1023
1023
|
spinnerLabel: 'Restoring endpoint',
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
1026
|
+
async resolveComponentDigest(digest) {
|
|
1027
|
+
const result = await this.requestData('GET', `/api/v1/component/digest/${encodeURIComponent(digest)}`);
|
|
1028
|
+
if (!Array.isArray(result.data))
|
|
1029
|
+
throw new Error('Incomplete component digest response.');
|
|
1030
|
+
return result.data;
|
|
1031
|
+
}
|
|
1032
|
+
async getComponentRuntime(componentId) {
|
|
1033
|
+
return this.requestData('GET', `/api/v1/component/${encodeURIComponent(componentId)}/runtime`);
|
|
1034
|
+
}
|
|
1026
1035
|
async getComponentSnapshotVersion(componentId, version) {
|
|
1027
1036
|
return this.requestData('GET', `/api/v1/activity/${encodeURIComponent(componentId)}/${encodeURIComponent(String(version))}`, { query: { refType: 'COMPONENTS' } });
|
|
1028
1037
|
}
|
|
@@ -1180,6 +1189,7 @@ export class RevoClient {
|
|
|
1180
1189
|
async deleteWorkspaceResource(resource, id) {
|
|
1181
1190
|
const encoded = encodeURIComponent(id);
|
|
1182
1191
|
const single = {
|
|
1192
|
+
agent: `/api/v1/agents/${encoded}`,
|
|
1183
1193
|
component: `/api/v1/component/${encoded}`,
|
|
1184
1194
|
'database-table': `/api/v1/databases/${encoded}`,
|
|
1185
1195
|
group: `/api/v1/groups/${encoded}`,
|
|
@@ -1187,6 +1197,7 @@ export class RevoClient {
|
|
|
1187
1197
|
'service-account': `/api/v1/accounts/${encoded}`,
|
|
1188
1198
|
};
|
|
1189
1199
|
const bulk = {
|
|
1200
|
+
'agent-plugin': '/api/v1/agent/plugins/delete',
|
|
1190
1201
|
'job-template': '/api/v1/automation/template/delete',
|
|
1191
1202
|
schedule: '/api/v1/automation/schedule/delete',
|
|
1192
1203
|
event: '/api/v1/automation/event/delete',
|
|
@@ -1310,6 +1321,48 @@ export class RevoClient {
|
|
|
1310
1321
|
async getRoleGroup(roleGroupId, options = {}) {
|
|
1311
1322
|
return this.requestData('GET', `/api/v1/role-groups/${roleGroupId}`, options);
|
|
1312
1323
|
}
|
|
1324
|
+
async listAgentDefinitions(resourcePath) {
|
|
1325
|
+
const records = [];
|
|
1326
|
+
const seenIds = new Set();
|
|
1327
|
+
for (let skip = 0;;) {
|
|
1328
|
+
const raw = await this.requestData('GET', resourcePath, {
|
|
1329
|
+
query: { take: COMPONENT_LIST_PAGE_SIZE, skip, count: true, sort: resourcePath === '/api/v1/agents' ? 'agentId' : 'agentPluginId', ...ACTIVE_COMPONENT_LIST_FILTER },
|
|
1330
|
+
});
|
|
1331
|
+
if (!Array.isArray(raw) && !(isRecord(raw) && ['data', 'items', 'results'].some(key => Array.isArray(raw[key]))))
|
|
1332
|
+
throw new Error('Invalid agent definition inventory.');
|
|
1333
|
+
const page = unwrapListPage(raw);
|
|
1334
|
+
if (page.total !== null && (!Number.isInteger(page.total) || page.total < 0))
|
|
1335
|
+
throw new Error('Invalid agent inventory count.');
|
|
1336
|
+
for (const item of page.items) {
|
|
1337
|
+
if (!isRecord(item))
|
|
1338
|
+
throw new Error('Invalid agent definition record.');
|
|
1339
|
+
const id = String(item.agentId || item.agentPluginId || '');
|
|
1340
|
+
if (!id || seenIds.has(id))
|
|
1341
|
+
throw new Error('Agent definition pagination returned a missing or duplicate identity.');
|
|
1342
|
+
seenIds.add(id);
|
|
1343
|
+
records.push(item);
|
|
1344
|
+
}
|
|
1345
|
+
skip += page.items.length;
|
|
1346
|
+
if (page.total !== null && skip >= page.total)
|
|
1347
|
+
break;
|
|
1348
|
+
if (!page.items.length) {
|
|
1349
|
+
if (page.total !== null && skip < page.total)
|
|
1350
|
+
throw new Error('Incomplete agent definition inventory.');
|
|
1351
|
+
break;
|
|
1352
|
+
}
|
|
1353
|
+
if (page.total === null && page.items.length < COMPONENT_LIST_PAGE_SIZE)
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1356
|
+
return records;
|
|
1357
|
+
}
|
|
1358
|
+
async listAllAgents() { return { agents: await this.listAgentDefinitions('/api/v1/agents') }; }
|
|
1359
|
+
async listAllAgentPlugins() { return { agentPlugins: await this.listAgentDefinitions('/api/v1/agent/plugins') }; }
|
|
1360
|
+
async getAgent(id) { return this.requestData('GET', `/api/v1/agents/${encodeURIComponent(id)}`); }
|
|
1361
|
+
async getAgentPlugin(id) { return this.requestData('GET', `/api/v1/agent/plugins/${encodeURIComponent(id)}`, { query: { includeDeleted: false } }); }
|
|
1362
|
+
async createAgent(body) { return this.requestData('POST', '/api/v1/agents', { body, maxRetries: 0 }); }
|
|
1363
|
+
async updateAgent(id, body) { return this.requestData('PATCH', `/api/v1/agents/${encodeURIComponent(id)}`, { body, maxRetries: 0 }); }
|
|
1364
|
+
async createAgentPlugin(body) { return this.requestData('POST', '/api/v1/agent/plugins', { body, maxRetries: 0 }); }
|
|
1365
|
+
async updateAgentPlugin(id, body) { return this.requestData('PATCH', `/api/v1/agent/plugins/${encodeURIComponent(id)}`, { body, maxRetries: 0 }); }
|
|
1313
1366
|
async listGroups(options = {}) {
|
|
1314
1367
|
return this.requestData('GET', options.path || '/api/v1/groups', {
|
|
1315
1368
|
query: options.query,
|
|
@@ -1473,6 +1526,11 @@ export class RevoClient {
|
|
|
1473
1526
|
spinnerLabel: 'Activating schedule',
|
|
1474
1527
|
});
|
|
1475
1528
|
}
|
|
1529
|
+
async disableSchedule(scheduleId) {
|
|
1530
|
+
return this.requestData('POST', `/api/v1/automation/schedule/${scheduleId}/disable`, {
|
|
1531
|
+
spinnerLabel: 'Disabling schedule',
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1476
1534
|
async listEvents(options = {}) {
|
|
1477
1535
|
return this.requestData('GET', options.path || '/api/v1/automation/event', {
|
|
1478
1536
|
query: options.query,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { resolveResourceTarget } from "../resource-target.js";
|
|
2
|
+
import { readProjectStableKeyName } from "../project.js";
|
|
3
|
+
import { buildAgentsPlan, pullAgentsToWorkspace, pushAgents } from "../resource-syncs/agent-sync.js";
|
|
4
|
+
import { isInteractiveTerminal, promptConfirm } from "../prompt.js";
|
|
5
|
+
import { printSyncPlan, printSyncStatus, printSyncSummary } from "../sync-output.js";
|
|
6
|
+
import { readBoolFlag } from "../utils.js";
|
|
7
|
+
export async function handleAgentsCommand(context) {
|
|
8
|
+
const family = context.args._[0] === 'agent-plugins' ? 'agent-plugin' : 'agent';
|
|
9
|
+
const command = context.args._[1];
|
|
10
|
+
if (!['pull', 'plan', 'push'].includes(command))
|
|
11
|
+
throw new Error(`Usage: revo ${context.args._[0]} <pull|plan|push> --all [--project <name>] [--json]`);
|
|
12
|
+
if (!readBoolFlag(context.args, ['all', 'a']))
|
|
13
|
+
throw new Error(`${family} ${command} requires --all.`);
|
|
14
|
+
if (readBoolFlag(context.args, ['prune']))
|
|
15
|
+
throw new Error('Agent and Agent Plugin sync is upsert-only; review deletion explicitly.');
|
|
16
|
+
const target = await resolveResourceTarget(context, { resource: family, allowDefaultProfile: true });
|
|
17
|
+
const input = { client: target.client, envName: target.envName, cwd: context.cwd, stableKeyName: readProjectStableKeyName(context.cwd), family };
|
|
18
|
+
const json = readBoolFlag(context.args, ['json']);
|
|
19
|
+
const force = readBoolFlag(context.args, ['force', 'f']);
|
|
20
|
+
const started = Date.now();
|
|
21
|
+
if (command === 'plan') {
|
|
22
|
+
const plan = await buildAgentsPlan(input);
|
|
23
|
+
if (json)
|
|
24
|
+
context.print(plan);
|
|
25
|
+
else
|
|
26
|
+
printSyncPlan(context.println, { title: family, environment: target.displayName, counts: plan.counts, items: plan.items, warnings: plan.exclusions, blockers: plan.blockers });
|
|
27
|
+
if (readBoolFlag(context.args, ['strict']) && (plan.blockers.length || plan.items.some(item => !['clean', 'orphan', 'skipped'].includes(item.status))))
|
|
28
|
+
throw new Error(`${family} plan is not clean.`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (command === 'pull') {
|
|
32
|
+
const result = await pullAgentsToWorkspace({ ...input, force });
|
|
33
|
+
if (json)
|
|
34
|
+
context.print(result);
|
|
35
|
+
else {
|
|
36
|
+
for (const item of result.pulled)
|
|
37
|
+
printSyncStatus(context.println, { status: 'Pulled', direction: 'pull', targetPath: item.targetPath });
|
|
38
|
+
for (const item of result.skipped)
|
|
39
|
+
printSyncStatus(context.println, { status: 'Skipped', direction: 'pull', targetPath: item.name, reason: item.reason });
|
|
40
|
+
printSyncSummary(context.println, 'Pulled', [...result.pulled.map(item => ({ ...item, status: 'pulled' })), ...result.skipped.map(item => ({ ...item, status: 'skipped' }))], Date.now() - started);
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!readBoolFlag(context.args, ['yes', 'y']) && (!isInteractiveTerminal() || !await promptConfirm(`Push ${family} to "${target.displayName}"?`, false)))
|
|
45
|
+
throw new Error('Push requires confirmation. Use --yes or an interactive terminal.');
|
|
46
|
+
const result = await pushAgents({ ...input, force });
|
|
47
|
+
if (json)
|
|
48
|
+
context.print(result);
|
|
49
|
+
else {
|
|
50
|
+
for (const item of result.results)
|
|
51
|
+
printSyncStatus(context.println, { status: item.status === 'deployed' ? 'Deployed' : 'Failed', direction: 'push', targetPath: item.targetPath, reason: item.error });
|
|
52
|
+
printSyncSummary(context.println, 'Deployed', result.results, Date.now() - started);
|
|
53
|
+
}
|
|
54
|
+
if (result.results.some(item => item.status === 'failed'))
|
|
55
|
+
throw new Error(`${family} push failed; inspect results.`);
|
|
56
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { verifyComponentRuntime } from "../component-contract.js";
|
|
1
2
|
import fs from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { execFileSync } from 'node:child_process';
|
|
@@ -618,6 +619,8 @@ function migrateComponentLockIdentity(cwd, identity, localCatalog, remoteCatalog
|
|
|
618
619
|
groups: lock.groups,
|
|
619
620
|
roleGroups: lock.roleGroups,
|
|
620
621
|
serviceAccounts: lock.serviceAccounts,
|
|
622
|
+
agents: lock.agents,
|
|
623
|
+
agentPlugins: lock.agentPlugins,
|
|
621
624
|
jobTemplates: lock.jobTemplates,
|
|
622
625
|
schedules: lock.schedules,
|
|
623
626
|
events: lock.events,
|
|
@@ -1182,6 +1185,7 @@ async function pushSingleComponent(context, manifestPath, remoteCatalog) {
|
|
|
1182
1185
|
});
|
|
1183
1186
|
throw new Error(`Cannot push ${targetPath}: created component did not verify against local source. Diagnostic: ${logPath}`);
|
|
1184
1187
|
}
|
|
1188
|
+
await verifyComponentRuntime(client, refreshedRemote, 120_000);
|
|
1185
1189
|
upsertLockFromRemote(context, refreshedRemote, targetPath, component, context.componentEnvironment);
|
|
1186
1190
|
const result = { status: 'deployed', targetPath };
|
|
1187
1191
|
printSyncStatus(println, { status: 'Deployed', direction: 'push', targetPath });
|
|
@@ -1204,6 +1208,8 @@ async function pushSingleComponent(context, manifestPath, remoteCatalog) {
|
|
|
1204
1208
|
if (!remoteComponentId) {
|
|
1205
1209
|
throw new Error(`Remote component matched by ${identityDescription(identity)} "${identityKey}" has no componentId.`);
|
|
1206
1210
|
}
|
|
1211
|
+
if (componentSourceHash(component, identity) === componentSourceHash(remote, identity))
|
|
1212
|
+
await verifyComponentRuntime(client, remote);
|
|
1207
1213
|
const typeTransitionBlocker = componentTypeTransitionBlocker(component, remote);
|
|
1208
1214
|
if (typeTransitionBlocker) {
|
|
1209
1215
|
throw new Error(`Cannot push ${targetPath}: ${typeTransitionBlocker}`);
|
|
@@ -1363,6 +1369,7 @@ async function pushSingleComponent(context, manifestPath, remoteCatalog) {
|
|
|
1363
1369
|
});
|
|
1364
1370
|
throw new Error(`Cannot push ${targetPath}: updated component did not verify against local source. Diagnostic: ${logPath}`);
|
|
1365
1371
|
}
|
|
1372
|
+
await verifyComponentRuntime(client, refreshedRemote, 120_000);
|
|
1366
1373
|
upsertLockFromRemote(context, refreshedRemote, targetPath, component, context.componentEnvironment);
|
|
1367
1374
|
if (!configurationChanged && !elementsChanged) {
|
|
1368
1375
|
const result = {
|
|
@@ -1679,6 +1686,18 @@ export async function buildComponentPlan(context, scope = { enabled: false, base
|
|
|
1679
1686
|
...(scope.enabled ? { inScope } : {}),
|
|
1680
1687
|
};
|
|
1681
1688
|
});
|
|
1689
|
+
for (const item of items) {
|
|
1690
|
+
if (item.componentType !== 'CUSTOM_NODEJS' || item.status !== 'clean' || !item.remoteComponentId)
|
|
1691
|
+
continue;
|
|
1692
|
+
try {
|
|
1693
|
+
await verifyComponentRuntime(context.client, remoteCatalog.byIdentity.get(item.identityKey || item.componentId)?.component || { type: 'CUSTOM_NODEJS', componentId: item.remoteComponentId });
|
|
1694
|
+
}
|
|
1695
|
+
catch (error) {
|
|
1696
|
+
item.status = 'blocked';
|
|
1697
|
+
item.blocked = true;
|
|
1698
|
+
item.reason = error instanceof Error ? error.message : String(error);
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1682
1701
|
const scopedItems = (scope.enabled ? items.filter((item) => item.inScope) : items)
|
|
1683
1702
|
.sort((left, right) => (componentDeploymentRank(left.componentType) - componentDeploymentRank(right.componentType)
|
|
1684
1703
|
|| String(left.identityKey || left.componentId).localeCompare(String(right.identityKey || right.componentId))));
|
package/dist/src/commands/env.js
CHANGED
|
@@ -51,7 +51,7 @@ function printPlanText(context, plan) {
|
|
|
51
51
|
const { println } = context;
|
|
52
52
|
println(`Comparing ${paint(plan.from.env, ANSI.bold + ANSI.cyan)} -> ${paint(plan.to.env, ANSI.bold + ANSI.cyan)}`);
|
|
53
53
|
for (const item of plan.items) {
|
|
54
|
-
if (item.action === 'noop') {
|
|
54
|
+
if (item.action === 'noop' && !item.blocked) {
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
57
|
const mark = ACTION_MARKS[item.action];
|
|
@@ -60,7 +60,7 @@ function printPlanText(context, plan) {
|
|
|
60
60
|
: item.reason
|
|
61
61
|
? ` (${item.reason})`
|
|
62
62
|
: '';
|
|
63
|
-
const line = `${mark.symbol} ${item.action.padEnd(9)} ${item.resourceType} ${item.stableKey}${detail}`;
|
|
63
|
+
const line = `${item.blocked ? '!' : mark.symbol} ${(item.blocked ? 'blocked' : item.action).padEnd(9)} ${item.resourceType} ${item.stableKey}${detail}`;
|
|
64
64
|
println(paint(line, mark.code));
|
|
65
65
|
}
|
|
66
66
|
const { counts } = plan;
|
|
@@ -68,7 +68,7 @@ function printPlanText(context, plan) {
|
|
|
68
68
|
+ `${counts.noop} unchanged, ${counts.orphan} orphaned, ${counts.collision} collisions.`);
|
|
69
69
|
}
|
|
70
70
|
function hasBlockingDrift(plan) {
|
|
71
|
-
return plan.items.some((item) => item.action !== 'noop');
|
|
71
|
+
return plan.items.some((item) => item.action !== 'noop' || item.blocked);
|
|
72
72
|
}
|
|
73
73
|
function readScope(args) {
|
|
74
74
|
const keys = readValues(args, ['key']);
|
|
@@ -298,6 +298,9 @@ async function handleEnvApply(context) {
|
|
|
298
298
|
printPlanText(context, plan);
|
|
299
299
|
}
|
|
300
300
|
const changeCount = plan.counts.create + plan.counts.update + plan.counts.delete;
|
|
301
|
+
const blocked = plan.items.filter(item => item.blocked);
|
|
302
|
+
if (blocked.length)
|
|
303
|
+
throw new Error(`Cannot apply: ${blocked.length} component runtime(s) are not ready. ${blocked.map(item => item.reason).join(' ')}`);
|
|
301
304
|
if (plan.counts.collision > 0) {
|
|
302
305
|
throw new Error(`Cannot apply: ${plan.counts.collision} stable-key collision(s) in scope. Resolve duplicates or narrow the scope with --key/--category.`);
|
|
303
306
|
}
|
|
@@ -342,8 +345,8 @@ async function handleEnvApply(context) {
|
|
|
342
345
|
println(paint(`Warning: ${unverified.length} component(s) did not verify against the source after apply.`, ANSI.bold + ANSI.yellow));
|
|
343
346
|
}
|
|
344
347
|
}
|
|
345
|
-
if (failed.length > 0) {
|
|
346
|
-
throw new Error(`Apply finished with ${failed.length} failure(s).`);
|
|
348
|
+
if (failed.length > 0 || unverified.length > 0) {
|
|
349
|
+
throw new Error(`Apply finished with ${failed.length} failure(s), ${unverified.length} verification mismatch(es).`);
|
|
347
350
|
}
|
|
348
351
|
}
|
|
349
352
|
export async function handleEnvCommand(context) {
|
|
@@ -35,6 +35,8 @@ const RESOURCE_ALIASES = {
|
|
|
35
35
|
events: 'event',
|
|
36
36
|
group: 'group',
|
|
37
37
|
groups: 'group',
|
|
38
|
+
agent: 'agent', agents: 'agent',
|
|
39
|
+
'agent-plugin': 'agent-plugin', 'agent-plugins': 'agent-plugin',
|
|
38
40
|
'service-account': 'service-account',
|
|
39
41
|
'service-accounts': 'service-account',
|
|
40
42
|
'role-group': 'role-group',
|
|
@@ -47,6 +49,8 @@ const MIGRATION_RESOURCE_ORDER = [
|
|
|
47
49
|
'database-view',
|
|
48
50
|
'component',
|
|
49
51
|
'service-account',
|
|
52
|
+
'agent-plugin',
|
|
53
|
+
'agent',
|
|
50
54
|
'job-template',
|
|
51
55
|
'endpoint',
|
|
52
56
|
'schedule',
|
|
@@ -68,7 +72,7 @@ function readMigrationResources(context, commandLabel = 'Migration') {
|
|
|
68
72
|
for (const value of values) {
|
|
69
73
|
const resource = RESOURCE_ALIASES[value];
|
|
70
74
|
if (!resource) {
|
|
71
|
-
throw new Error(`${commandLabel} currently supports: database-table, database-view, component, job-template, endpoint, schedule, event, group, role-group, service-account, or all.`);
|
|
75
|
+
throw new Error(`${commandLabel} currently supports: database-table, database-view, component, job-template, endpoint, schedule, event, group, role-group, service-account, agent-plugin, agent, or all.`);
|
|
72
76
|
}
|
|
73
77
|
if (!resources.includes(resource)) {
|
|
74
78
|
resources.push(resource);
|
|
@@ -202,6 +206,14 @@ function printMigrationPlan(context, plan) {
|
|
|
202
206
|
blockers: phase.blockers,
|
|
203
207
|
});
|
|
204
208
|
}
|
|
209
|
+
if (phase.resource === 'agent' || phase.resource === 'agent-plugin') {
|
|
210
|
+
const familyPlan = phase.resource === 'agent' ? plan.agents : plan.agentPlugins;
|
|
211
|
+
if (familyPlan)
|
|
212
|
+
printSyncPlan(context.println, { title: `${phaseLabel} phase ${phase.order} / ${phase.resource}`, environment: plan.to,
|
|
213
|
+
counts: phase.operations, showHints: readBoolFlag(context.args, ['hints']),
|
|
214
|
+
items: familyPlan.items.map(item => ({ ...item, status: item.operation ?? item.status, hints: baselineHints(item) })),
|
|
215
|
+
warnings: phase.warnings, blockers: phase.blockers });
|
|
216
|
+
}
|
|
205
217
|
if (phase.resource === 'service-account' && plan.serviceAccounts) {
|
|
206
218
|
printSyncPlan(context.println, { title: `${phaseLabel} phase ${phase.order} / Service Account`, environment: plan.to,
|
|
207
219
|
counts: phase.operations, showHints: readBoolFlag(context.args, ['hints']),
|
|
@@ -352,6 +364,8 @@ function printMigrationPlan(context, plan) {
|
|
|
352
364
|
}
|
|
353
365
|
}
|
|
354
366
|
function migrationItemActionLabel(item, legacyAction) {
|
|
367
|
+
if (item.status === 'activation-drift')
|
|
368
|
+
return item.status;
|
|
355
369
|
return item.operation ?? (legacyAction === 'noop' ? item.status : legacyAction);
|
|
356
370
|
}
|
|
357
371
|
async function confirmRun(context, from, to) {
|
|
@@ -417,7 +431,9 @@ async function handleMigrationRead(context, input, command) {
|
|
|
417
431
|
}
|
|
418
432
|
if (command === 'plan' && input.sourceMode === 'workspace'
|
|
419
433
|
&& readBoolFlag(context.args, ['strict']) && plan.needsChanges) {
|
|
420
|
-
|
|
434
|
+
const eventActivationDrift = plan.events?.items.filter(item => item.status === 'activation-drift').length || 0;
|
|
435
|
+
const activationDrift = plan.schedules?.items.filter((item) => item.status === 'activation-drift').length || 0;
|
|
436
|
+
throw new Error(`Deployment strict plan has pending changes: ${plan.operations.create} create, ${plan.operations.update} update${activationDrift ? `, ${activationDrift} Schedule activation drift` : ''}${eventActivationDrift ? `, ${eventActivationDrift} Event activation drift` : ''}${plan.prune ? `, ${plan.operations.delete || 0} delete` : ''}.`);
|
|
421
437
|
}
|
|
422
438
|
if (command === 'verify' && plan.needsChanges) {
|
|
423
439
|
throw new Error('Migration verification failed: target still requires changes.');
|
|
@@ -581,7 +597,7 @@ export async function handleMigrateCommand(context) {
|
|
|
581
597
|
const dryRun = readBoolFlag(context.args, ['dry-run']);
|
|
582
598
|
const subcommand = dryRun ? 'plan' : requestedSubcommand;
|
|
583
599
|
if (requestedSubcommand !== 'plan' && requestedSubcommand !== 'run' && requestedSubcommand !== 'verify') {
|
|
584
|
-
throw new Error('Unknown migrate command. Usage: revo migrate <plan|run|verify> --from <env> --to <env> [--resources database-table,database-view,component,job-template,endpoint,schedule,event,group,role-group,service-account] [--skip-groups] [--dry-run]');
|
|
600
|
+
throw new Error('Unknown migrate command. Usage: revo migrate <plan|run|verify> --from <env> --to <env> [--resources database-table,database-view,component,job-template,endpoint,schedule,event,group,role-group,service-account,agent-plugin,agent] [--skip-groups] [--dry-run]');
|
|
585
601
|
}
|
|
586
602
|
const input = readMigrationInput(context);
|
|
587
603
|
const json = readBoolFlag(context.args, ['json']);
|
|
@@ -39,17 +39,19 @@ export async function handleSchedulesCommand(context) {
|
|
|
39
39
|
let activation;
|
|
40
40
|
if (activate) {
|
|
41
41
|
const candidateCount = pushed.verifiedActivationCandidates.length;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const activationResults = await activateVerifiedSchedules({
|
|
45
|
-
client,
|
|
46
|
-
candidates: pushed.verifiedActivationCandidates,
|
|
47
|
-
});
|
|
48
|
-
results.push(...activationResults);
|
|
49
|
-
activation = { candidateCount, results: activationResults };
|
|
42
|
+
if (pushed.results.some((item) => item.status === 'failed')) {
|
|
43
|
+
activation = { candidateCount, results: [], skipped: 'configuration phase has failures' };
|
|
50
44
|
}
|
|
51
45
|
else {
|
|
52
|
-
|
|
46
|
+
const confirmed = !isInteractiveTerminal() || await promptConfirm(`Align activation for ${candidateCount} verified Schedule(s) on "${displayName}"?`, false);
|
|
47
|
+
if (confirmed) {
|
|
48
|
+
const activationResults = await activateVerifiedSchedules({ client, candidates: pushed.verifiedActivationCandidates });
|
|
49
|
+
results.push(...activationResults);
|
|
50
|
+
activation = { candidateCount, results: activationResults };
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
activation = { candidateCount, results: [], skipped: 'activation not confirmed' };
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
if (readBoolFlag(context.args, ['json'])) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RevoClient } from './client.ts';
|
|
2
|
+
import type { ComponentRecord } from './types.ts';
|
|
3
|
+
export declare function isComponentDigest(value: unknown): value is string;
|
|
4
|
+
/** Canonical API content identity, separate from portable configuration hashes. */
|
|
5
|
+
export declare function componentContentDigest(component: ComponentRecord): string;
|
|
6
|
+
export declare function componentRevisionByDigest(client: RevoClient, componentId: string, digest: string): Promise<ComponentRecord>;
|
|
7
|
+
export declare function componentRuntimeBlocker(runtime: unknown, active?: boolean): string | null;
|
|
8
|
+
export declare function verifyComponentRuntime(client: RevoClient, component: ComponentRecord, waitMs?: number): Promise<void>;
|