@revoengine/cli 2.0.0 → 2.1.1

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.1 — 2026-11-11
4
+
5
+ - Prepare native terminal permissions automatically during macOS installation, while retaining preparation at the first PTY launch when installation scripts are disabled.
6
+ - Pin the optional native dependency and verify fresh packaged installations through the real CLI runner, including interactive input and terminal size. Ordinary commands remain available without native PTY support.
7
+
8
+ ## 2.1.0 — 2026-11-11
9
+
10
+ - Pull, plan and push Job Template Batch or Debounce delivery across every trigger source and dynamic concurrency paths on Platform 1.9.0. Reject retired Event-level collection policies with explicit migration guidance. Preserve source-specific Event and Schedule input and ignore retired merge modes in existing manifests.
11
+
12
+ - Refresh reviewed automation plans after upgrading and follow the [1.9 migration guide](https://docs.revoengine.com/developers/upgrading-to-1-9).
13
+
3
14
  ## 2.0.0 — 2026-11-07
4
15
 
5
16
  ### Upgrade requirements
package/README.md CHANGED
@@ -10,11 +10,13 @@ The CLI has three main capabilities:
10
10
  2. **Project migration** — plan, run, and verify a direct migration between two saved projects with `--from` and `--to`.
11
11
  3. **Resource synchronization** — work with one supported resource family through its dedicated `pull`, `plan`, and `push` commands.
12
12
 
13
- ## Version 2.0.0
13
+ ## Version 2.1.1
14
14
 
15
- Use this release with Platform 1.8.0 or later and VS Code extension 2.0.0 or later. Update the compatible clients and backend together. Endpoint and Job configurations no longer accept `skipLibs`, `includeLibs` or `excludeLibs`, including `false` and empty arrays. Remove these fields from current manifests; review and test non-default selections first. Ordinary business payload fields are unaffected.
15
+ On macOS, package installation prepares the native terminal helper automatically. The runner retains the same preparation when installation scripts are disabled. This patch keeps the Platform 1.9 automation contract unchanged.
16
16
 
17
- Debugger execution defaults to the caller and can explicitly select the global endpoint or job policy. Browser Live Preview supports pointer gestures, selected-text feedback and active-session status while retaining privacy controls. See the [2.0.0 changelog](CHANGELOG.md).
17
+ Use this release with Platform 1.9.0 or later and VS Code extension 2.1.0 or later. Update the compatible clients and backend together. Endpoint and Job configurations no longer accept `skipLibs`, `includeLibs` or `excludeLibs`, including `false` and empty arrays. Remove these fields from current manifests; review and test non-default selections first. Ordinary business payload fields are unaffected.
18
+
19
+ Debugger execution defaults to the caller and can explicitly select the global endpoint or job policy. Browser Live Preview supports pointer gestures, selected-text feedback and active-session status while retaining privacy controls. See the [2.1.1 changelog](CHANGELOG.md).
18
20
 
19
21
  Component creation and reviewed source saves can wait up to ten minutes, including cold Sandbox startup. This also extends Node fetch's response-header waiting limit. Upgrade the matching API/Sandbox services to receive the longer server-side validation budget. See the [1.0.35 changelog](CHANGELOG.md). Writes with `--omit` still require the matching API capability `atomicResourceUpdates`.
20
22
 
@@ -227,7 +229,7 @@ For explicit cleanup of an older local snapshot, `terminal browser-profile forge
227
229
 
228
230
  `upload_file` and `download_file` stream an explicit authorized workspace file directly to/from GCS HTTPS signed/resumable URLs with permitted headers. Full network permission is required. WebSocket carries metadata only. Resumable uploads report committed offsets and partial completion; do not finalize a Storage upload before completion or blindly repeat an uncertain upload. Downloads commit atomically and do not overwrite unless explicitly requested. The stream's idle timeout is 90 seconds; grant expiry and runner lifetime still apply. Signed URLs/headers are credentials and must not be copied into logs or source files.
229
231
 
230
- Interactive PTY commands use the optional native `node-pty` package. An unavailable native build does not block CLI installation; PTY requests return `pty_unavailable` until the optional package can be installed. To skip native installation when PTY is not needed, install locally with `npm install --omit=optional @revoengine/cli` and run `npx revo`; npm 11.9 may still install the optional dependency during a global installation. On macOS, the runner verifies the spawn helper's executable permission when a PTY starts. Ordinary commands and local development servers run with pipes.
232
+ Interactive PTY commands use the optional native `node-pty` package. An unavailable native build does not block CLI installation; PTY requests return `pty_unavailable` until the optional package can be installed. To skip native installation when PTY is not needed, install locally with `npm install --omit=optional @revoengine/cli` and run `npx revo`; npm 11.9 may still install the optional dependency during a global installation. On macOS, installation prepares the spawn helper's executable permission, and the runner verifies it again when a PTY starts. If installation scripts are disabled, the first PTY request performs preparation automatically using the installed native prebuild. The optional native dependency is pinned so CI and fresh installations use the same version. Ordinary commands and local development servers run with pipes.
231
233
 
232
234
  Local Browser mode filters HTTP and WebSocket requests and disables WebRTC, WebTransport, Worker and SharedWorker before page scripts. Worker-dependent pages may not work in this mode; Chromium is not enclosed in an OS network sandbox. A temporary Local or Full network lease closes the Browser context at expiry when the current permanent grant does not cover it, including before a queued secure credential fill. A lost WebSocket connection, a controlled Realtime restart, or a temporary dependency outage retains running processes and Browser contexts for one two-minute (120-second) reconnect period; repeated failures do not renew it. Receiving `ready` alone does not reset that period while executions still await resume confirmation. Handshake, ready and execution resume each have a ten-second transport deadline. Access revocation and malformed runner frames stop the runner and its processes. Grant revision changes reject older execute frames and stop only work outside the remaining permanent or temporary scope. A network upgrade preserves the original temporary lease for a subsequent downgrade.
233
235
 
@@ -534,11 +536,11 @@ Existing `database-schema` selectors and `revo database-schemas` commands remain
534
536
 
535
537
  Older Event manifests without `custom` must be refreshed with `revo events pull` from the source environment or edited to set `custom` explicitly. The pull upgrades an unchanged, locked manifest without `--force`. Check the `type` too: a legacy `CUSTOM_EXPORT` event now uses `type: "EXPORT", custom: true` when that is the source definition. An Event plan blocks manifests with no `custom` classifier.
536
538
 
537
- Event and Schedule manifests retain runtime `input` (a JSON object) and `inputMode` at the top level. Pull, plan, push, migration and readback verification include both fields. Supported modes are `override` (shallow overlay onto Job template input), `deep_override` (nested object overlay, replacing arrays and retaining null values), and `replace` (whole-input replacement, including clearing it with `{}`). The CLI migrates these definitions; the backend resolves the Job input. Unknown modes, null/scalar/array input and duplicate top-level/extension fields block writes, including with `--force`.
539
+ Event and Schedule manifests retain a JSON object `input` at the top level. Pull, plan, push, migration and readback verification preserve it. The runtime exposes it on each trigger. Invalid input and duplicate top-level/extension input block writes, including with `--force`.
538
540
 
539
- Previously pulled Event manifests with `extensions.input` and `extensions.inputMode` remain accepted; only those extension fields are writable. A fresh pull writes them at the top level. With `--omit`, both layouts share runtime ownership and pulls retain the existing destination layout while refreshing managed nested siblings. Omitting all `extensions` also preserves runtime input and mode. Old Event lock hashes are recognized using the complete live input values, so they cannot hide remote drift. Other extension fields still block deployment.
541
+ Previously pulled Event manifests can still supply input through `extensions.input`. A fresh pull writes `input` at the top level. With `--omit`, the two input layouts share ownership, and pulls retain omitted destination values while refreshing managed nested siblings. The retired `inputMode` field is ignored. Old Event lock hashes are recognized using the complete live input values, so they cannot hide remote drift. Other extension fields still block deployment.
540
542
 
541
- Omitted fields mean `input: {}` and `inputMode: "override"` in the CLI's desired definition, including updates. Older Schedule pulls did not export these fields: re-pull from the source before promotion if that source uses nondefault automation input. A plan shows any difference from the target; approving an overwrite applies the manifest defaults. Regenerate saved reviewed plans after updating the CLI because input and mode now participate in definition hashes.
543
+ Omitting `input` means `{}` in the portable definition. Older Schedule pulls may omit this field. Pull the source before promotion if a Schedule uses nonempty input, and regenerate saved reviewed plans after upgrading the CLI.
542
544
 
543
545
  ### Definition contract checks
544
546
 
@@ -870,10 +872,10 @@ An unqualified path must be supported by every selected family. Qualify family-s
870
872
  | --- | --- |
871
873
  | `database-table`, `database-view` | `name`, `category`, `description`, `metadata.label` |
872
874
  | `component` | `name`, `description` (alias of `desc`), `active`, `testConfig`, `metadata.label` |
873
- | `job-template` | `name`, `category`, `description`, `timeout`, `inputs`, `options.retry.maxAttempts` |
875
+ | `job-template` | `name`, `category`, `description`, `timeout`, `inputs`, `delivery`, `options.retry.maxAttempts` |
874
876
  | `endpoint` | `name`, `category`, `description`, `active`, `timeout`, `options.input.tenant` |
875
- | `schedule` | `name`, `category`, `description`, `cron`, `timezone`, `input.tenant`, `inputMode` |
876
- | `event` | `name`, `category`, `description`, `filter`, `input.tenant`, `inputMode` |
877
+ | `schedule` | `name`, `category`, `description`, `cron`, `timezone`, `input.tenant` |
878
+ | `event` | `name`, `category`, `description`, `filter`, `input.tenant` |
877
879
  | `group`, `role-group` | `name`, `category`, `description`, `metadata.label` |
878
880
  | `service-account` | `name`, `metadata.label` |
879
881
  | `agent` | `name`, `description`, `definition.config.model`, `definition.policy.maxTicks` |
@@ -897,6 +899,8 @@ Endpoint and Job Template pins use the API content identity `v1:sha256:<64 lower
897
899
 
898
900
  Repository `plan/deploy` without `--activate` preserves existing Event and Schedule activation and creates new definitions inactive. Differences from manifest activation remain visible as `activation-drift`, but do not prevent definition convergence. With `--activate`, strict plans and final verification require activation to match the manifest. Reviewed deployment still fences live target activation and rejects changes after planning, in either mode. Named migration and dedicated family plans retain their activation-convergence checks. Deprecated Schedule `targetVersion` is reported diagnostically; the backend does not use it to select a Job Template revision.
899
901
 
902
+ On Platform 1.9.0, configure collection on the Job Template manifest with top-level `delivery`: `{ "mode": "BATCH", "maxSize": 100, "maxWaitSeconds": 600 }`, or use `"mode": "DEBOUNCE"` with `quietPeriodSeconds`. `maxSize` is 2–1000 and wait/quiet periods are 1–3600 seconds; the quiet period must not exceed the maximum wait. Remove `delivery` or set it to `null` for SINGLE. Collection combines Event, Schedule, manual Run and low-code/API admissions for the same Job configuration. Pull, plan and push preserve this policy, and removing it clears grouping on the target. Former Event-level `delivery` is rejected with an upgrade instruction; move the collection policy to the target Job and remove the former Event `keyPath`, since concurrency is configured separately. Job Template manifests can set `options.concurrency.keyPath` to a JSON Pointer such as `/message/orderId`. Event and Schedule manifests carry their own `input`, exposed on each `api.input().triggers` entry. The CLI ignores retired `inputMode` when reading existing manifests and omits it from pulled definitions and API writes.
903
+
900
904
  `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.
901
905
 
902
906
  Execution options are compared without hiding runtime differences: an explicit Job Template memory value remains distinct from missing/null memory, which falls back to template input or the current 128 MiB runtime default. The create API initially materializes 256 MiB; CLI creation restores the desired options with a version-guarded update before verification when needed. An empty `options.input` overrides legacy `inputs`. Endpoint null/zero memory is normalized to 32 MiB by both create and update. Old Job baselines that omitted explicit 256 MiB cannot prove memory convergence; re-pull and review those definitions before promotion.
@@ -261,6 +261,13 @@ export declare const requestContracts: {
261
261
  readonly JobTemplateRequestDto: {
262
262
  readonly type: "object";
263
263
  readonly properties: {
264
+ readonly delivery: {
265
+ readonly allOf: readonly [{
266
+ readonly $ref: "#/components/schemas/JobDeliveryDto";
267
+ }];
268
+ readonly nullable: true;
269
+ readonly type: "object";
270
+ };
264
271
  readonly executionPolicy: {
265
272
  readonly allOf: readonly [{
266
273
  readonly $ref: "#/components/schemas/RuntimeJobExecutionPolicyDto";
@@ -324,6 +331,13 @@ export declare const requestContracts: {
324
331
  readonly UpdateJobTemplate: {
325
332
  readonly type: "object";
326
333
  readonly properties: {
334
+ readonly delivery: {
335
+ readonly allOf: readonly [{
336
+ readonly $ref: "#/components/schemas/JobDeliveryDto";
337
+ }];
338
+ readonly nullable: true;
339
+ readonly type: "object";
340
+ };
327
341
  readonly executionPolicy: {
328
342
  readonly allOf: readonly [{
329
343
  readonly $ref: "#/components/schemas/RuntimeJobExecutionPolicyDto";
@@ -437,6 +451,13 @@ export declare const requestContracts: {
437
451
  readonly pattern: "^[a-zA-Z0-9_-]*$";
438
452
  readonly patternFlags: "";
439
453
  };
454
+ readonly keyPath: {
455
+ readonly nullable: true;
456
+ readonly type: "string";
457
+ readonly maxLength: 256;
458
+ readonly pattern: "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])";
459
+ readonly patternFlags: "u";
460
+ };
440
461
  readonly limit: {
441
462
  readonly nullable: true;
442
463
  readonly type: "integer";
@@ -498,6 +519,63 @@ export declare const requestContracts: {
498
519
  };
499
520
  readonly additionalProperties: false;
500
521
  };
522
+ readonly EventDeliveryDto: {
523
+ readonly type: "object";
524
+ readonly properties: {
525
+ readonly mode: {
526
+ readonly enum: readonly ["BATCH", "DEBOUNCE"];
527
+ };
528
+ readonly keyPath: {
529
+ readonly nullable: true;
530
+ readonly type: "string";
531
+ readonly maxLength: 256;
532
+ readonly pattern: "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])";
533
+ readonly patternFlags: "u";
534
+ };
535
+ readonly maxSize: {
536
+ readonly type: "integer";
537
+ readonly minimum: 2;
538
+ readonly maximum: 1000;
539
+ };
540
+ readonly maxWaitSeconds: {
541
+ readonly type: "integer";
542
+ readonly minimum: 1;
543
+ readonly maximum: 3600;
544
+ };
545
+ readonly quietPeriodSeconds: {
546
+ readonly type: "integer";
547
+ readonly minimum: 1;
548
+ readonly maximum: 3600;
549
+ };
550
+ };
551
+ readonly required: readonly ["mode", "maxSize", "maxWaitSeconds"];
552
+ readonly additionalProperties: false;
553
+ };
554
+ readonly JobDeliveryDto: {
555
+ readonly type: "object";
556
+ readonly properties: {
557
+ readonly mode: {
558
+ readonly enum: readonly ["BATCH", "DEBOUNCE"];
559
+ };
560
+ readonly maxSize: {
561
+ readonly type: "integer";
562
+ readonly minimum: 2;
563
+ readonly maximum: 1000;
564
+ };
565
+ readonly maxWaitSeconds: {
566
+ readonly type: "integer";
567
+ readonly minimum: 1;
568
+ readonly maximum: 3600;
569
+ };
570
+ readonly quietPeriodSeconds: {
571
+ readonly type: "integer";
572
+ readonly minimum: 1;
573
+ readonly maximum: 3600;
574
+ };
575
+ };
576
+ readonly required: readonly ["mode", "maxSize", "maxWaitSeconds"];
577
+ readonly additionalProperties: false;
578
+ };
501
579
  readonly RuntimeExecutionPolicyDto: {
502
580
  readonly type: "object";
503
581
  readonly properties: {
@@ -706,9 +784,10 @@ export declare const requestContractDefaults: {
706
784
  };
707
785
  };
708
786
  export declare const requestContractSemanticSources: {
709
- readonly "packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "a1e872a7d0699c55ab57bb60b02bcdb5545a1810766f2ca2f60de8101ffd9c22";
787
+ readonly "packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "e3856d26eb4c43aae24e033691f677f700d6d4f7793dd2be79ce89b8a60ad067";
710
788
  readonly "packages/domain/src/dto/automation/run.options.dto.ts#JobRetryMinBackoffWithinMaxConstraint": "2c8eb4f844ffabfd03f5ae9617a2b0e9e578fa0b9d2a563081648b6688629439";
711
789
  readonly "packages/execution-core/src/modules/@core/services/virtualization.service.ts#normalizeIsolateMemoryLimit": "4cce767b32d7b848cea9502eec5d3df2b7a7dc3e41227eeffda1a6a1e8fc9d96";
790
+ readonly "packages/domain/src/dto/automation/event-delivery.dto.ts#isValidEventDeliveryWait": "25fd97d39db416f9b3087ed29984f853d587b34d8ec54b7e7ac2378108bbd89f";
712
791
  readonly "packages/domain/src/utils/backend-metadata.util.ts#assertUserMetadataWritable": "ffc70235399e7542c71b58ae4c31ac55d7db29431fc2b3f51c690dba7281a66a";
713
792
  readonly "packages/platform-shared/src/utils/job-retry-policy.util.ts#normalizeJobRetryPolicy": "facef84884b5b4311af06bfb4469f071ff42a4bca067b6d9092d4f6571e8ee86";
714
793
  readonly "packages/platform-shared/src/utils/job-retry-policy.util.ts#assertJobRetryPolicyValid": "6511ccafc15233a4ffe4e024f13e6c0e5c9d8a53c261ecc571300495afd804cf";
@@ -717,8 +796,8 @@ export declare const requestContractSemanticSources: {
717
796
  readonly "apps/api/src/modules/endpoints/endpoint.service.ts#update": "bc59acaffdb7275659bddb65b8d71e9d8266447054723ea87495eaa0dd512fe1";
718
797
  readonly "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "64686ee1c1e2611aa00847b771de637797a3007062b95e303046ad2cba69e729";
719
798
  readonly "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "9da1bdfd83a3142b7f44d4ce5ee2aac6cf4ed70bef790f979c412c411fe2790d";
720
- readonly "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "e5230697a846e6a20f4cfe5f16eccdf27ba409f309d0e101b225cd4302c0cc48";
721
- readonly "apps/api/src/modules/automation/jobs.service.ts#update": "448412c945a9fef3792359df48fa7d27e5afa254e7c43c6cea64e518381e41a0";
799
+ readonly "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "59a8433530980f3970c5915f696611f14820c10183b0f917a74912245f1cbd78";
800
+ readonly "apps/api/src/modules/automation/jobs.service.ts#update": "d8b3ccef6ae812e8bcdcd21cf5184c2afe9ede28055f355f684e13a64b094933";
722
801
  readonly "packages/platform-shared/src/services/job.scheduler.service.ts#resolveTemplateInputs": "a9a4cc5df4627abf7ee2d2df7f2494d290292a15f4889a5f07a9de104ee33d9f";
723
802
  readonly "packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "4918470ef562727becb8c97c5afb7761a49734ecd21a6d3d5436576dbd10a6da";
724
803
  readonly "packages/domain/src/dto/components/component-element-key.const.ts#isDefaultLibraryElement": "4faa356b91be5c44ebe3d442b6da26088d6d35d2db5fb073e1103165431cee48";
@@ -734,11 +813,13 @@ export declare const requestContractSourceProvenance: {
734
813
  readonly "packages/domain/src/dto/automation/update.api.template.request.dto.ts#UpdateEndpointRequestDto": "20ee0c9afbfa594f189ead2b751aa00b6003efe0b70c5e1158ee78c1e0d29567";
735
814
  readonly "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "1ade11735627613a81b5cfaa796dfdc49d4c7e0db01ae6467da6a99a9f3af683";
736
815
  readonly "packages/domain/src/dto/automation/endpoint.sse.dto.ts#EndpointSseDto": "960d56ebb300ded00f61f1318522c010135675e0f32a8084fb3e9b16a1c20ecc";
737
- readonly "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "c47123206c187f0e16b08d7033ed9c455932f2e78e34455577663eb09410559d";
738
- readonly "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "0f79fefc76e749a331b5c848b9dcd6061e7dc247c2094dd975d7d2fe9a101c08";
816
+ readonly "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "fcbcfa8fd7b600dabe25d9d1e36414db1894bff89980a106b2cc7fbc7feb94d8";
817
+ readonly "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "bb83065b8ae816cc917ec73abc83af6749bc5fdc00e460b889c41cd34443123e";
739
818
  readonly "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "a4ee900b8610f7edbabf8d07738f99b33a288327ea0d66e67c0f8c28260215c8";
740
- readonly "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "529600772a878c5d26d55a70f5e562031169967051f5d0485ab4659a480d4a8d";
819
+ readonly "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "8410d5a666f02c0eb09d466f630fe63eb5bcdf77f245e1a8ff1a14894f314966";
741
820
  readonly "packages/domain/src/dto/automation/run.options.dto.ts#RetryJobDto": "e42fcd447fe111bdf2da20ad42654e536a01d566f33a1d8f52ec1bb0bd1ee8b1";
821
+ readonly "packages/domain/src/dto/automation/event-delivery.dto.ts#EventDeliveryDto": "0e126b97d338891c74c1e9eaebce5417b2ece210f991dde5dc4ee3b048ba9297";
822
+ readonly "packages/domain/src/dto/automation/job-delivery.dto.ts#JobDeliveryDto": "3c3cc0e3f03e0bd8853d63265218cd80876aca00b4b0ddcdea368f2a2831d922";
742
823
  readonly "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeExecutionPolicyDto": "9978ee21a9b7da26c93a4e1516dfc319166a2b55520edee9319d17922b375474";
743
824
  readonly "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeJobExecutionPolicyDto": "d900a693362a9de02839e2ae959c4e8ac2ac8e0206a4cbe69e889a3636793d23";
744
825
  readonly "packages/domain/src/dto/components/update.component.dto.ts#UpdateComponentDto": "bac5c210c38eb230ae6ca2b42428956ea1c2065ffc947c40478152098a50e673";
@@ -320,6 +320,15 @@ export const requestContracts = {
320
320
  "JobTemplateRequestDto": {
321
321
  "type": "object",
322
322
  "properties": {
323
+ "delivery": {
324
+ "allOf": [
325
+ {
326
+ "$ref": "#/components/schemas/JobDeliveryDto"
327
+ }
328
+ ],
329
+ "nullable": true,
330
+ "type": "object"
331
+ },
323
332
  "executionPolicy": {
324
333
  "allOf": [
325
334
  {
@@ -390,6 +399,15 @@ export const requestContracts = {
390
399
  "UpdateJobTemplate": {
391
400
  "type": "object",
392
401
  "properties": {
402
+ "delivery": {
403
+ "allOf": [
404
+ {
405
+ "$ref": "#/components/schemas/JobDeliveryDto"
406
+ }
407
+ ],
408
+ "nullable": true,
409
+ "type": "object"
410
+ },
393
411
  "executionPolicy": {
394
412
  "allOf": [
395
413
  {
@@ -513,6 +531,13 @@ export const requestContracts = {
513
531
  "pattern": "^[a-zA-Z0-9_-]*$",
514
532
  "patternFlags": ""
515
533
  },
534
+ "keyPath": {
535
+ "nullable": true,
536
+ "type": "string",
537
+ "maxLength": 256,
538
+ "pattern": "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])",
539
+ "patternFlags": "u"
540
+ },
516
541
  "limit": {
517
542
  "nullable": true,
518
543
  "type": "integer",
@@ -574,6 +599,77 @@ export const requestContracts = {
574
599
  },
575
600
  "additionalProperties": false
576
601
  },
602
+ "EventDeliveryDto": {
603
+ "type": "object",
604
+ "properties": {
605
+ "mode": {
606
+ "enum": [
607
+ "BATCH",
608
+ "DEBOUNCE"
609
+ ]
610
+ },
611
+ "keyPath": {
612
+ "nullable": true,
613
+ "type": "string",
614
+ "maxLength": 256,
615
+ "pattern": "^(?:\\/(?:[^~/\\u0000-\\u001f\\u007f]|~[01])*)+(?![\\s\\S])",
616
+ "patternFlags": "u"
617
+ },
618
+ "maxSize": {
619
+ "type": "integer",
620
+ "minimum": 2,
621
+ "maximum": 1000
622
+ },
623
+ "maxWaitSeconds": {
624
+ "type": "integer",
625
+ "minimum": 1,
626
+ "maximum": 3600
627
+ },
628
+ "quietPeriodSeconds": {
629
+ "type": "integer",
630
+ "minimum": 1,
631
+ "maximum": 3600
632
+ }
633
+ },
634
+ "required": [
635
+ "mode",
636
+ "maxSize",
637
+ "maxWaitSeconds"
638
+ ],
639
+ "additionalProperties": false
640
+ },
641
+ "JobDeliveryDto": {
642
+ "type": "object",
643
+ "properties": {
644
+ "mode": {
645
+ "enum": [
646
+ "BATCH",
647
+ "DEBOUNCE"
648
+ ]
649
+ },
650
+ "maxSize": {
651
+ "type": "integer",
652
+ "minimum": 2,
653
+ "maximum": 1000
654
+ },
655
+ "maxWaitSeconds": {
656
+ "type": "integer",
657
+ "minimum": 1,
658
+ "maximum": 3600
659
+ },
660
+ "quietPeriodSeconds": {
661
+ "type": "integer",
662
+ "minimum": 1,
663
+ "maximum": 3600
664
+ }
665
+ },
666
+ "required": [
667
+ "mode",
668
+ "maxSize",
669
+ "maxWaitSeconds"
670
+ ],
671
+ "additionalProperties": false
672
+ },
577
673
  "RuntimeExecutionPolicyDto": {
578
674
  "type": "object",
579
675
  "properties": {
@@ -993,9 +1089,10 @@ export const requestContractDefaults = {
993
1089
  }
994
1090
  };
995
1091
  export const requestContractSemanticSources = {
996
- "packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "a1e872a7d0699c55ab57bb60b02bcdb5545a1810766f2ca2f60de8101ffd9c22",
1092
+ "packages/domain/src/utils/backend-metadata.util.ts#assertJsonValue": "e3856d26eb4c43aae24e033691f677f700d6d4f7793dd2be79ce89b8a60ad067",
997
1093
  "packages/domain/src/dto/automation/run.options.dto.ts#JobRetryMinBackoffWithinMaxConstraint": "2c8eb4f844ffabfd03f5ae9617a2b0e9e578fa0b9d2a563081648b6688629439",
998
1094
  "packages/execution-core/src/modules/@core/services/virtualization.service.ts#normalizeIsolateMemoryLimit": "4cce767b32d7b848cea9502eec5d3df2b7a7dc3e41227eeffda1a6a1e8fc9d96",
1095
+ "packages/domain/src/dto/automation/event-delivery.dto.ts#isValidEventDeliveryWait": "25fd97d39db416f9b3087ed29984f853d587b34d8ec54b7e7ac2378108bbd89f",
999
1096
  "packages/domain/src/utils/backend-metadata.util.ts#assertUserMetadataWritable": "ffc70235399e7542c71b58ae4c31ac55d7db29431fc2b3f51c690dba7281a66a",
1000
1097
  "packages/platform-shared/src/utils/job-retry-policy.util.ts#normalizeJobRetryPolicy": "facef84884b5b4311af06bfb4469f071ff42a4bca067b6d9092d4f6571e8ee86",
1001
1098
  "packages/platform-shared/src/utils/job-retry-policy.util.ts#assertJobRetryPolicyValid": "6511ccafc15233a4ffe4e024f13e6c0e5c9d8a53c261ecc571300495afd804cf",
@@ -1004,8 +1101,8 @@ export const requestContractSemanticSources = {
1004
1101
  "apps/api/src/modules/endpoints/endpoint.service.ts#update": "bc59acaffdb7275659bddb65b8d71e9d8266447054723ea87495eaa0dd512fe1",
1005
1102
  "apps/api/src/modules/endpoints/endpoint.service.ts#validateEndpointOptions": "64686ee1c1e2611aa00847b771de637797a3007062b95e303046ad2cba69e729",
1006
1103
  "apps/api/src/modules/endpoints/endpoint.service.ts#applyEndpointOptionDefaults": "9da1bdfd83a3142b7f44d4ce5ee2aac6cf4ed70bef790f979c412c411fe2790d",
1007
- "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "e5230697a846e6a20f4cfe5f16eccdf27ba409f309d0e101b225cd4302c0cc48",
1008
- "apps/api/src/modules/automation/jobs.service.ts#update": "448412c945a9fef3792359df48fa7d27e5afa254e7c43c6cea64e518381e41a0",
1104
+ "apps/api/src/modules/automation/jobs.service.ts#createJobTemplate": "59a8433530980f3970c5915f696611f14820c10183b0f917a74912245f1cbd78",
1105
+ "apps/api/src/modules/automation/jobs.service.ts#update": "d8b3ccef6ae812e8bcdcd21cf5184c2afe9ede28055f355f684e13a64b094933",
1009
1106
  "packages/platform-shared/src/services/job.scheduler.service.ts#resolveTemplateInputs": "a9a4cc5df4627abf7ee2d2df7f2494d290292a15f4889a5f07a9de104ee33d9f",
1010
1107
  "packages/domain/src/dto/components/component-element-key.const.ts#isLowCodeComponentType": "4918470ef562727becb8c97c5afb7761a49734ecd21a6d3d5436576dbd10a6da",
1011
1108
  "packages/domain/src/dto/components/component-element-key.const.ts#isDefaultLibraryElement": "4faa356b91be5c44ebe3d442b6da26088d6d35d2db5fb073e1103165431cee48",
@@ -1021,11 +1118,13 @@ export const requestContractSourceProvenance = {
1021
1118
  "packages/domain/src/dto/automation/update.api.template.request.dto.ts#UpdateEndpointRequestDto": "20ee0c9afbfa594f189ead2b751aa00b6003efe0b70c5e1158ee78c1e0d29567",
1022
1119
  "packages/domain/src/dto/automation/endpoint.template.request.dto.ts#EndpointOptionsDto": "1ade11735627613a81b5cfaa796dfdc49d4c7e0db01ae6467da6a99a9f3af683",
1023
1120
  "packages/domain/src/dto/automation/endpoint.sse.dto.ts#EndpointSseDto": "960d56ebb300ded00f61f1318522c010135675e0f32a8084fb3e9b16a1c20ecc",
1024
- "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "c47123206c187f0e16b08d7033ed9c455932f2e78e34455577663eb09410559d",
1025
- "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "0f79fefc76e749a331b5c848b9dcd6061e7dc247c2094dd975d7d2fe9a101c08",
1121
+ "packages/domain/src/dto/automation/job.template.request.dto.ts#JobTemplateRequestDto": "fcbcfa8fd7b600dabe25d9d1e36414db1894bff89980a106b2cc7fbc7feb94d8",
1122
+ "packages/domain/src/dto/automation/update.job.template.dto.ts#UpdateJobTemplate": "bb83065b8ae816cc917ec73abc83af6749bc5fdc00e460b889c41cd34443123e",
1026
1123
  "packages/domain/src/dto/automation/run.options.dto.ts#JobOptionsDto": "a4ee900b8610f7edbabf8d07738f99b33a288327ea0d66e67c0f8c28260215c8",
1027
- "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "529600772a878c5d26d55a70f5e562031169967051f5d0485ab4659a480d4a8d",
1124
+ "packages/domain/src/dto/automation/run.options.dto.ts#ConcurrencyJobDto": "8410d5a666f02c0eb09d466f630fe63eb5bcdf77f245e1a8ff1a14894f314966",
1028
1125
  "packages/domain/src/dto/automation/run.options.dto.ts#RetryJobDto": "e42fcd447fe111bdf2da20ad42654e536a01d566f33a1d8f52ec1bb0bd1ee8b1",
1126
+ "packages/domain/src/dto/automation/event-delivery.dto.ts#EventDeliveryDto": "0e126b97d338891c74c1e9eaebce5417b2ece210f991dde5dc4ee3b048ba9297",
1127
+ "packages/domain/src/dto/automation/job-delivery.dto.ts#JobDeliveryDto": "3c3cc0e3f03e0bd8853d63265218cd80876aca00b4b0ddcdea368f2a2831d922",
1029
1128
  "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeExecutionPolicyDto": "9978ee21a9b7da26c93a4e1516dfc319166a2b55520edee9319d17922b375474",
1030
1129
  "packages/domain/src/dto/automation/runtime.execution.policy.dto.ts#RuntimeJobExecutionPolicyDto": "d900a693362a9de02839e2ae959c4e8ac2ac8e0206a4cbe69e889a3636793d23",
1031
1130
  "packages/domain/src/dto/components/update.component.dto.ts#UpdateComponentDto": "bac5c210c38eb230ae6ca2b42428956ea1c2065ffc947c40478152098a50e673",
@@ -225,6 +225,7 @@ export type EventMetadataWritePayload = {
225
225
  metadata: Record<string, unknown>;
226
226
  };
227
227
  export type EventWritePayload = EventMetadataWritePayload & AutomationRuntimeInputFields & {
228
+ delivery?: null;
228
229
  custom?: boolean;
229
230
  name?: string;
230
231
  category?: string | null;
@@ -273,6 +274,7 @@ export type ScheduleCreatePayload = AutomationRuntimeInputFields & {
273
274
  targetConfig?: Record<string, unknown> | null;
274
275
  };
275
276
  export type JobTemplateUpdatePayload = {
277
+ delivery?: import('./types.ts').JobDelivery | null;
276
278
  executionPolicy?: RuntimeExecutionPolicy;
277
279
  triggerUser?: string | null;
278
280
  version: number;
@@ -288,6 +290,7 @@ export type JobTemplateUpdatePayload = {
288
290
  inputs?: unknown;
289
291
  };
290
292
  export type JobTemplateCreatePayload = {
293
+ delivery?: import('./types.ts').JobDelivery | null;
291
294
  executionPolicy?: RuntimeExecutionPolicy;
292
295
  triggerUser?: string | null;
293
296
  name: string;
@@ -3,9 +3,10 @@ import path from 'node:path';
3
3
  import { createRequire } from 'node:module';
4
4
  const require = createRequire(import.meta.url);
5
5
  /** node-pty's macOS prebuild launches this helper with posix_spawn. */
6
- export function ensurePtyHelperExecutable(packageRoot = path.dirname(require.resolve('node-pty/package.json')), platform = process.platform, arch = process.arch) {
6
+ export function ensurePtyHelperExecutable(packageRoot, platform = process.platform, arch = process.arch) {
7
7
  if (platform !== 'darwin')
8
8
  return;
9
+ packageRoot ??= path.dirname(require.resolve('node-pty/package.json'));
9
10
  const candidates = [path.join(packageRoot, 'prebuilds', `darwin-${arch}`, 'spawn-helper'),
10
11
  path.join(packageRoot, 'build', 'Release', 'spawn-helper')];
11
12
  let found = false;
@@ -1,7 +1,7 @@
1
1
  import type { AutomationRuntimeInputFields } from '../types.ts';
2
2
  export declare const AUTOMATION_INPUT_FIELDS: Set<string>;
3
- /** Old Event pulls placed these known REST fields under extensions. */
3
+ /** Old Event exports placed input under extensions. The retired inputMode never enters a write. */
4
4
  export declare function readAutomationInput(value: Record<string, unknown>, legacyExtensions?: boolean): Required<AutomationRuntimeInputFields>;
5
5
  export declare function automationInputError(value: Record<string, unknown>, legacyExtensions?: boolean): string | undefined;
6
- /** Preserve pre-input hashes for the original empty-input / override behavior. */
6
+ /** Empty inputs retain the historical portable hash. */
7
7
  export declare function automationInputHashFields(value: Record<string, unknown>, legacyExtensions?: boolean): AutomationRuntimeInputFields;
@@ -1,23 +1,16 @@
1
1
  import { isRecord } from "./util.js";
2
2
  export const AUTOMATION_INPUT_FIELDS = new Set(['input', 'inputMode']);
3
- const INPUT_MODES = ['override', 'deep_override', 'replace'];
4
- /** Old Event pulls placed these known REST fields under extensions. */
3
+ /** Old Event exports placed input under extensions. The retired inputMode never enters a write. */
5
4
  export function readAutomationInput(value, legacyExtensions = false) {
6
5
  const extensions = legacyExtensions && isRecord(value.extensions) ? value.extensions : {};
7
- for (const field of AUTOMATION_INPUT_FIELDS) {
8
- if (value[field] !== undefined && extensions[field] !== undefined) {
9
- throw new Error(`Automation "${field}" is defined both at the top level and in extensions.`);
10
- }
6
+ if (value.input !== undefined && extensions.input !== undefined) {
7
+ throw new Error('Automation "input" is defined both at the top level and in extensions.');
11
8
  }
12
9
  const input = value.input === undefined ? extensions.input : value.input;
13
- const inputMode = value.inputMode === undefined ? extensions.inputMode : value.inputMode;
14
10
  if (input !== undefined && (!isRecord(input) || ![Object.prototype, null].includes(Object.getPrototypeOf(input)))) {
15
11
  throw new Error('Automation "input" must be a JSON object.');
16
12
  }
17
- if (inputMode !== undefined && !INPUT_MODES.includes(inputMode)) {
18
- throw new Error('Automation "inputMode" must be override, deep_override or replace.');
19
- }
20
- return { input: input === undefined ? {} : input, inputMode: (inputMode ?? 'override') };
13
+ return { input: input === undefined ? {} : input };
21
14
  }
22
15
  export function automationInputError(value, legacyExtensions = false) {
23
16
  try {
@@ -28,11 +21,8 @@ export function automationInputError(value, legacyExtensions = false) {
28
21
  return error.message;
29
22
  }
30
23
  }
31
- /** Preserve pre-input hashes for the original empty-input / override behavior. */
24
+ /** Empty inputs retain the historical portable hash. */
32
25
  export function automationInputHashFields(value, legacyExtensions = false) {
33
- const { input, inputMode } = readAutomationInput(value, legacyExtensions);
34
- return {
35
- ...(Object.keys(input).length === 0 ? {} : { input }),
36
- ...(inputMode === 'override' ? {} : { inputMode }),
37
- };
26
+ const { input } = readAutomationInput(value, legacyExtensions);
27
+ return Object.keys(input).length === 0 ? {} : { input };
38
28
  }
@@ -14,6 +14,8 @@ export type EventManifest = AutomationRuntimeInputFields & {
14
14
  custom: boolean;
15
15
  type: string;
16
16
  filter?: Record<string, unknown> | null;
17
+ delivery?: null;
18
+ inputMode?: unknown;
17
19
  target: {
18
20
  type: 'JOB_TEMPLATE';
19
21
  jobTemplateStableKey: string;
@@ -10,7 +10,7 @@ export const EVENTS_DIRECTORY = 'Events';
10
10
  export const EVENT_MANIFEST_FILE = 'event.json';
11
11
  const EVENT_TRANSPORT_FIELDS = new Set([
12
12
  'jobEventId', 'eventId', 'id', 'name', 'category', 'desc', 'description', 'active', 'type',
13
- 'targetType', 'targetId', 'targetVersion', 'targetConfig', 'filter', 'version', 'metadata',
13
+ 'targetType', 'targetId', 'targetVersion', 'targetConfig', 'filter', 'delivery', 'version', 'metadata',
14
14
  'metaData', 'resourceMetadata', 'topic', 'custom', 'input', 'inputMode', 'deletedAt', 'deletedBy', 'createdAt', 'createdBy',
15
15
  'lastUpdateAt', 'lastUpdateBy', 'updatedAt', 'updatedBy', 'history', 'jobEventHistory',
16
16
  ]);
@@ -84,6 +84,10 @@ function readWorkspaceEvents(cwd) {
84
84
  function nonEmptyString(value) {
85
85
  return typeof value === 'string' && value.trim().length > 0;
86
86
  }
87
+ const RETIRED_EVENT_DELIVERY = 'Event.delivery is retired in Platform 1.9.0. Configure delivery on the target Job Template, then remove Event.delivery (or set it to null); do not copy the former Event keyPath';
88
+ function validEventDelivery(value) {
89
+ return value === null || value === undefined;
90
+ }
87
91
  function validManifest(value, stableKeyName) {
88
92
  if (!isRecord(value) || value.kind !== 'event' || !nonEmptyString(value.stableKey) || !nonEmptyString(value.name)
89
93
  || !nonEmptyString(value.type) || typeof value.custom !== 'boolean' || !isRecord(value.metadata) || !isRecord(value.target)) {
@@ -107,7 +111,7 @@ function validManifest(value, stableKeyName) {
107
111
  if (value.extensions !== undefined && Object.keys(value.extensions).some((field) => !AUTOMATION_INPUT_FIELDS.has(field))) {
108
112
  return false;
109
113
  }
110
- if (automationInputError(value, true)) {
114
+ if (automationInputError(value, true) || !validEventDelivery(value.delivery)) {
111
115
  return false;
112
116
  }
113
117
  return readConfiguredResourceMetadataStableKey(value, stableKeyName) === value.stableKey;
@@ -118,6 +122,9 @@ function manifestFromRecord(input) {
118
122
  throw new Error(`Event "${stableKey}" is missing the custom classifier in the API response.`);
119
123
  }
120
124
  const extensions = extensionFields(record);
125
+ if (!validEventDelivery(record.delivery)) {
126
+ throw new Error(`Event "${stableKey}": ${RETIRED_EVENT_DELIVERY}.`);
127
+ }
121
128
  return {
122
129
  kind: 'event',
123
130
  stableKey,
@@ -155,15 +162,18 @@ export function hashEventContent(manifest) {
155
162
  }
156
163
  /** Recognize an old lock representation without discarding any live non-default input. */
157
164
  function legacyEventBaselineHash(manifest, layout) {
165
+ if (manifest.delivery)
166
+ return undefined;
158
167
  const fields = Object.keys(layout.extensions || {}).filter(field => AUTOMATION_INPUT_FIELDS.has(field));
159
168
  if (fields.length === 0)
160
169
  return undefined;
161
170
  const input = readAutomationInput(manifest, true);
162
171
  if (Object.keys(automationInputHashFields(manifest, true)).some(field => !fields.includes(field)))
163
172
  return undefined;
173
+ const legacyMode = manifest.inputMode ?? manifest.extensions?.inputMode ?? layout.extensions?.inputMode ?? 'override';
164
174
  const extensions = {
165
175
  ...unsupportedEventExtensions(manifest),
166
- ...Object.fromEntries(fields.map(field => [field, input[field]])),
176
+ ...Object.fromEntries(fields.map(field => [field, field === 'input' ? input.input : legacyMode])),
167
177
  };
168
178
  return hashStable({ content: hashStable(eventHashShape(manifest, extensions)), active: manifest.active });
169
179
  }
@@ -236,7 +246,6 @@ function diffEvents(desired, current) {
236
246
  ['filter', desired.filter ?? null, current.filter ?? null],
237
247
  ['target.jobTemplateStableKey', desired.target.jobTemplateStableKey, current.target.jobTemplateStableKey],
238
248
  ['input', desiredInput.input, currentInput.input],
239
- ['inputMode', desiredInput.inputMode, currentInput.inputMode],
240
249
  ['extensions', unsupportedEventExtensions(desired), unsupportedEventExtensions(current)],
241
250
  ];
242
251
  return fields
@@ -299,10 +308,11 @@ export async function buildEventsPlan(input) {
299
308
  const inputError = isRecord(manifest) ? automationInputError(manifest, true) : undefined;
300
309
  const reason = unsupportedExtensions.length > 0
301
310
  ? `unsupported extension fields: ${unsupportedExtensions.join(', ')}`
302
- : inputError ? inputError
303
- : isRecord(manifest) && manifest.custom === undefined
304
- ? 'missing custom classifier; re-pull the Event from its source or add custom: true/false explicitly'
305
- : 'invalid manifest';
311
+ : isRecord(manifest) && !validEventDelivery(manifest.delivery) ? RETIRED_EVENT_DELIVERY
312
+ : inputError ? inputError
313
+ : isRecord(manifest) && manifest.custom === undefined
314
+ ? 'missing custom classifier; re-pull the Event from its source or add custom: true/false explicitly'
315
+ : 'invalid manifest';
306
316
  blockers.push(`Invalid Event manifest ${path.relative(projectRoot, entry.manifestPath)}: ${reason}.`);
307
317
  items.push({ status: 'conflict', name: isRecord(manifest) && nonEmptyString(manifest.name) ? manifest.name : path.basename(entry.manifestPath), reason, blocked: true });
308
318
  continue;
@@ -1,9 +1,11 @@
1
1
  import { type PortableExecutionPolicy, type ExecutionPrincipal } from './account-principal.ts';
2
2
  import { type FieldChange } from '../diff-details.ts';
3
3
  import type { RevoClient } from '../client.ts';
4
+ import type { JobDelivery } from '../types.ts';
4
5
  export declare const JOB_TEMPLATES_DIRECTORY = "JobTemplates";
5
6
  export declare const JOB_TEMPLATE_MANIFEST_FILE = "job-template.json";
6
7
  export type JobTemplateManifest = {
8
+ delivery?: JobDelivery | null;
7
9
  kind: 'job-template';
8
10
  stableKey: string;
9
11
  name: string;
@@ -95,7 +95,7 @@ async function loadRemoteComponents(client, cwd) {
95
95
  const JOB_TEMPLATE_MANIFEST_FIELDS = new Set([
96
96
  'executionPrincipal', 'executionPolicy',
97
97
  'kind', 'stableKey', 'name', 'category', 'description', 'metadata', 'component',
98
- 'timeout', 'options', 'inputs', 'migration',
98
+ 'timeout', 'options', 'inputs', 'delivery', 'migration',
99
99
  ]);
100
100
  const JOB_TEMPLATE_MIGRATION_FIELDS = new Set(['componentBinding', 'executionPrincipal']);
101
101
  function hasOnlyKeys(value, allowed) {
@@ -184,6 +184,7 @@ function manifestFromRecord(record, stableKey, componentKey, stableKeyName) {
184
184
  ...(typeof record.timeout === 'number' ? { timeout: record.timeout } : {}),
185
185
  ...(record.options === undefined ? {} : { options: canonicalValue(record.options) }),
186
186
  ...(record.inputs === undefined ? {} : { inputs: canonicalValue(record.inputs) }),
187
+ ...(record.delivery == null ? {} : { delivery: canonicalValue(record.delivery) }),
187
188
  };
188
189
  const errors = jobTemplateDefinitionErrors(manifest);
189
190
  if (errors.length > 0)
@@ -229,6 +230,7 @@ function buildCreatePayload(manifest, componentId) {
229
230
  ...(manifest.timeout === undefined ? {} : { timeout: manifest.timeout }),
230
231
  ...(options === undefined ? {} : { options }),
231
232
  ...(manifest.inputs === undefined ? {} : { inputs: canonicalValue(manifest.inputs) }),
233
+ ...(manifest.delivery == null ? {} : { delivery: canonicalValue(manifest.delivery) }),
232
234
  };
233
235
  }
234
236
  function buildUpdatePayload(manifest, componentId, version) {
@@ -243,6 +245,7 @@ function buildUpdatePayload(manifest, componentId, version) {
243
245
  ...(manifest.timeout === undefined ? {} : { timeout: manifest.timeout }),
244
246
  options: isRecord(manifest.options) ? canonicalValue(manifest.options) : {},
245
247
  ...(manifest.inputs === undefined ? {} : { inputs: canonicalValue(manifest.inputs) }),
248
+ delivery: manifest.delivery ?? null,
246
249
  version,
247
250
  };
248
251
  }
@@ -306,6 +309,7 @@ function jobTemplateDefinitionShape(manifest, normalizeDefaults) {
306
309
  : manifest.timeout === undefined ? {} : { timeout: manifest.timeout }),
307
310
  ...(options === undefined ? {} : { options }),
308
311
  ...(inputs === undefined ? {} : { inputs }),
312
+ ...(manifest.delivery == null ? {} : { delivery: canonicalValue(manifest.delivery) }),
309
313
  };
310
314
  }
311
315
  function diffJobTemplates(desired, target) {
@@ -319,6 +323,7 @@ function diffJobTemplates(desired, target) {
319
323
  ['component.pinnedDigest', desired.component.pinnedDigest, target.component.pinnedDigest],
320
324
  ...(desired.executionPrincipal ? [['executionPrincipal', desired.executionPrincipal, target.executionPrincipal]] : []),
321
325
  ...(desired.executionPolicy ? [['executionPolicy', desired.executionPolicy, target.executionPolicy]] : []),
326
+ ['delivery', desired.delivery ?? null, target.delivery ?? null],
322
327
  ['timeout', desired.timeout ?? requestContractDefaults.job.timeout, target.timeout ?? requestContractDefaults.job.timeout],
323
328
  [
324
329
  'options',
@@ -40,7 +40,7 @@ export function canonicalJobRuntimeOptionDefaults(value) {
40
40
  delete normalized.concurrency;
41
41
  if (isRecord(normalized.concurrency)) {
42
42
  const concurrency = { ...normalized.concurrency };
43
- for (const key of ['key', 'limit', 'ttl'])
43
+ for (const key of ['key', 'keyPath', 'limit', 'ttl'])
44
44
  if (concurrency[key] === null || concurrency[key] === '')
45
45
  delete concurrency[key];
46
46
  if (Object.keys(concurrency).length === 0)
@@ -135,8 +135,16 @@ export function endpointDefinitionErrors(manifest) {
135
135
  }
136
136
  /** The runtime normalizes nullable option containers, then validates effective retry backoff. */
137
137
  export function jobTemplateDefinitionErrors(manifest) {
138
- const body = { ...requestFields(manifest), ...(manifest.description === undefined ? {} : { desc: manifest.description }) };
138
+ const body = { ...requestFields(manifest), ...(manifest.delivery === undefined ? {} : { delivery: manifest.delivery }), ...(manifest.description === undefined ? {} : { desc: manifest.description }) };
139
139
  const errors = validateRequestContract('JobTemplateRequestDto', body, { partial: true, path: 'JobTemplate' });
140
+ if (isRecord(manifest.delivery)) {
141
+ const delivery = manifest.delivery;
142
+ if (delivery.mode === 'BATCH' && delivery.quietPeriodSeconds !== undefined)
143
+ errors.push('JobTemplate.delivery.quietPeriodSeconds is only supported for DEBOUNCE');
144
+ if (delivery.mode === 'DEBOUNCE' && (typeof delivery.quietPeriodSeconds !== 'number' || delivery.quietPeriodSeconds > Number(delivery.maxWaitSeconds))) {
145
+ errors.push('JobTemplate.delivery.quietPeriodSeconds is required for DEBOUNCE and must not exceed maxWaitSeconds');
146
+ }
147
+ }
140
148
  const options = isRecord(manifest.options) ? manifest.options : {};
141
149
  if (isRecord(options.retry)) {
142
150
  const effective = { ...requestContractDefaults.retry, ...options.retry };
@@ -321,7 +321,6 @@ function diffSchedules(desired, target) {
321
321
  ['cron', desired.cron, target.cron],
322
322
  ['timezone', desired.timezone, target.timezone],
323
323
  ['input', desiredInput.input, targetInput.input],
324
- ['inputMode', desiredInput.inputMode, targetInput.inputMode],
325
324
  ['target', canonicalValue(desired.target), canonicalValue(target.target)],
326
325
  ];
327
326
  return fields
@@ -70,7 +70,7 @@ const ordinaryRoots = {
70
70
  'service-account': ['name'],
71
71
  'agent-plugin': ['name'],
72
72
  agent: ['name'],
73
- 'job-template': ['name', 'category', 'description', 'timeout', 'inputs'],
73
+ 'job-template': ['name', 'category', 'description', 'timeout', 'inputs', 'delivery'],
74
74
  endpoint: ['name', 'category', 'description', 'active', 'timeout'],
75
75
  schedule: ['name', 'category', 'description', 'cron', 'timezone', 'input', 'inputMode'],
76
76
  event: ['name', 'category', 'description', 'filter', 'input', 'inputMode', 'extensions'],
@@ -96,6 +96,8 @@ function allowedPath(family, parts, stableKeyName = 'stableKey') {
96
96
  && !(second === 'details' && (parts.length === 2 || third === stableKeyName || third === 'stableKey'));
97
97
  if (family === 'event' && root === 'extensions' && second === 'inputMode' && parts.length > 2)
98
98
  return false;
99
+ if (family === 'job-template' && root === 'delivery')
100
+ return parts.length === 1 || schemaAllows(requestContracts.JobDeliveryDto, parts.slice(1));
99
101
  if (root === 'options' && runtimeOptionRoots[family]) {
100
102
  if (parts.length === 1)
101
103
  return true;
@@ -254,6 +254,7 @@ export type GroupRecord = {
254
254
  [key: string]: unknown;
255
255
  };
256
256
  export type JobTemplateRecord = {
257
+ delivery?: JobDelivery | null;
257
258
  executionPolicy?: RuntimeExecutionPolicy | null;
258
259
  jobTemplateId?: string;
259
260
  id?: string;
@@ -277,11 +278,19 @@ export type JobTemplateRecord = {
277
278
  deletedAt?: string | null;
278
279
  [key: string]: unknown;
279
280
  };
280
- export type AutomationInputMode = 'override' | 'deep_override' | 'replace';
281
281
  export type AutomationRuntimeInputFields = {
282
282
  input?: Record<string, unknown>;
283
- inputMode?: AutomationInputMode;
284
283
  };
284
+ export type JobDelivery = {
285
+ maxSize: number;
286
+ maxWaitSeconds: number;
287
+ } & ({
288
+ mode: 'BATCH';
289
+ quietPeriodSeconds?: never;
290
+ } | {
291
+ mode: 'DEBOUNCE';
292
+ quietPeriodSeconds: number;
293
+ });
285
294
  export type ScheduleRecord = AutomationRuntimeInputFields & {
286
295
  scheduleId?: string;
287
296
  id?: string;
@@ -306,6 +315,7 @@ export type ScheduleRecord = AutomationRuntimeInputFields & {
306
315
  [key: string]: unknown;
307
316
  };
308
317
  export type EventRecord = AutomationRuntimeInputFields & {
318
+ delivery?: unknown;
309
319
  jobEventId?: string;
310
320
  eventId?: string;
311
321
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revoengine/cli",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "CLI package for the RevoEngine Platform API",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -11,20 +11,22 @@
11
11
  "scripts": {
12
12
  "build": "npm run clean && tsc -p tsconfig.build.json",
13
13
  "clean": "node --input-type=module -e \"import fs from 'node:fs'; fs.rmSync('dist', { recursive: true, force: true });\"",
14
- "check": "node --input-type=module -e \"await import('./src/config.ts'); await import('./src/commands/terminal-process-group.ts'); await import('./src/commands/terminal-file-descriptor.ts'); await import('./src/workspace-write-lock.ts'); await import('./src/argument-contract.ts'); await import('./src/legacy.ts'); await import('./src/http-trace.ts'); await import('./src/request-queue.ts'); await import('./src/client.ts'); await import('./src/component-lock.ts'); await import('./src/component-lifecycle.ts'); await import('./src/component-element-validation.ts'); await import('./src/component-source-validation.ts'); await import('./src/request-contract.ts'); await import('./src/sync-omit.ts'); await import('./src/sync-omit-command.ts'); await import('./src/sync-omit-write-fence.ts'); await import('./src/component-contract.ts'); await import('./src/component-manifests.ts'); await import('./src/planning-snapshot.ts'); await import('./src/workspace-digests.ts'); await import('./src/database-indexes.ts'); await import('./src/diff-details.ts'); await import('./src/resource-metadata.ts'); await import('./src/tracked-resources.ts'); await import('./src/resource-inventory.ts'); await import('./src/metadata-backfill.ts'); await import('./src/workspace-component.ts'); await import('./src/workspace-resource.ts'); await import('./src/database-table-artifacts.ts'); await import('./src/project.ts'); await import('./src/prompt.ts'); await import('./src/runtime-view.ts'); await import('./src/spinner.ts'); await import('./src/types.ts'); await import('./src/utils.ts'); await import('./src/resource-syncs/util.ts'); await import('./src/resource-syncs/agent-sync.ts'); await import('./src/resource-syncs/database-table-sync.ts'); await import('./src/resource-syncs/database-view-sync.ts'); await import('./src/resource-syncs/endpoint-sync.ts'); await import('./src/resource-syncs/group-sync.ts'); await import('./src/resource-syncs/role-group-sync.ts'); await import('./src/resource-syncs/job-template-sync.ts'); await import('./src/resource-syncs/schedule-sync.ts'); await import('./src/resource-syncs/event-sync.ts'); await import('./src/resource-syncs/account-principal.ts'); await import('./src/resource-syncs/identity-migration.ts'); await import('./src/resource-syncs/service-account-sync.ts'); await import('./src/commands/service-accounts.ts'); await import('./src/commands/agents.ts'); await import('./src/migration-actions.ts'); await import('./src/reviewed-plan.ts'); await import('./src/migration.ts'); await import('./src/workspace-diff.ts'); await import('./src/workspace-prune.ts'); await import('./src/sync-output.ts'); await import('./src/ui.ts'); await import('./src/update-notifier.ts'); await import('./src/env-sync.ts'); await import('./src/commands/auth.ts'); await import('./src/commands/component.ts'); await import('./src/commands/database-tables.ts'); await import('./src/commands/database-views.ts'); await import('./src/commands/endpoints.ts'); await import('./src/commands/emulate.ts'); await import('./src/commands/env.ts'); await import('./src/commands/events.ts'); await import('./src/commands/groups.ts'); await import('./src/commands/info.ts'); await import('./src/commands/job-templates.ts'); await import('./src/commands/metadata.ts'); await import('./src/commands/migrate.ts'); await import('./src/commands/request.ts'); await import('./src/commands/studio.ts'); await import('./src/commands/tests.ts'); await import('./src/native-tests.ts'); await import('./src/test-workspace.ts'); await import('./src/commands/role-groups.ts'); await import('./src/commands/search.ts'); await import('./src/commands/schedules.ts'); await import('./src/commands/terminal-service.ts'); await import('./src/commands/terminal-browser.ts'); await import('./src/commands/terminal-image.ts'); await import('./src/commands/terminal-sandbox.ts'); await import('./src/commands/terminal-patch.ts'); await import('./src/commands/terminal-patch-worker.ts'); await import('./src/commands/terminal-browser-profile-import.protocol.ts'); await import('./src/commands/terminal-browser-profile-import.ts'); await import('./src/commands/terminal-browser-profile-import-runner.ts'); await import('./src/commands/terminal.ts'); await import('./src/cli.ts'); await import('./src/index.ts'); await import('./bin/revo.ts'); await import('./scripts/dev.ts')\"",
14
+ "check": "node --input-type=module -e \"await import('./src/config.ts'); await import('./scripts/postinstall.mjs'); await import('./src/commands/terminal-process-group.ts'); await import('./src/commands/terminal-file-descriptor.ts'); await import('./src/workspace-write-lock.ts'); await import('./src/argument-contract.ts'); await import('./src/legacy.ts'); await import('./src/http-trace.ts'); await import('./src/request-queue.ts'); await import('./src/client.ts'); await import('./src/component-lock.ts'); await import('./src/component-lifecycle.ts'); await import('./src/component-element-validation.ts'); await import('./src/component-source-validation.ts'); await import('./src/request-contract.ts'); await import('./src/sync-omit.ts'); await import('./src/sync-omit-command.ts'); await import('./src/sync-omit-write-fence.ts'); await import('./src/component-contract.ts'); await import('./src/component-manifests.ts'); await import('./src/planning-snapshot.ts'); await import('./src/workspace-digests.ts'); await import('./src/database-indexes.ts'); await import('./src/diff-details.ts'); await import('./src/resource-metadata.ts'); await import('./src/tracked-resources.ts'); await import('./src/resource-inventory.ts'); await import('./src/metadata-backfill.ts'); await import('./src/workspace-component.ts'); await import('./src/workspace-resource.ts'); await import('./src/database-table-artifacts.ts'); await import('./src/project.ts'); await import('./src/prompt.ts'); await import('./src/runtime-view.ts'); await import('./src/spinner.ts'); await import('./src/types.ts'); await import('./src/utils.ts'); await import('./src/resource-syncs/util.ts'); await import('./src/resource-syncs/agent-sync.ts'); await import('./src/resource-syncs/database-table-sync.ts'); await import('./src/resource-syncs/database-view-sync.ts'); await import('./src/resource-syncs/endpoint-sync.ts'); await import('./src/resource-syncs/group-sync.ts'); await import('./src/resource-syncs/role-group-sync.ts'); await import('./src/resource-syncs/job-template-sync.ts'); await import('./src/resource-syncs/schedule-sync.ts'); await import('./src/resource-syncs/event-sync.ts'); await import('./src/resource-syncs/account-principal.ts'); await import('./src/resource-syncs/identity-migration.ts'); await import('./src/resource-syncs/service-account-sync.ts'); await import('./src/commands/service-accounts.ts'); await import('./src/commands/agents.ts'); await import('./src/migration-actions.ts'); await import('./src/reviewed-plan.ts'); await import('./src/migration.ts'); await import('./src/workspace-diff.ts'); await import('./src/workspace-prune.ts'); await import('./src/sync-output.ts'); await import('./src/ui.ts'); await import('./src/update-notifier.ts'); await import('./src/env-sync.ts'); await import('./src/commands/auth.ts'); await import('./src/commands/component.ts'); await import('./src/commands/database-tables.ts'); await import('./src/commands/database-views.ts'); await import('./src/commands/endpoints.ts'); await import('./src/commands/emulate.ts'); await import('./src/commands/env.ts'); await import('./src/commands/events.ts'); await import('./src/commands/groups.ts'); await import('./src/commands/info.ts'); await import('./src/commands/job-templates.ts'); await import('./src/commands/metadata.ts'); await import('./src/commands/migrate.ts'); await import('./src/commands/request.ts'); await import('./src/commands/studio.ts'); await import('./src/commands/tests.ts'); await import('./src/native-tests.ts'); await import('./src/test-workspace.ts'); await import('./src/commands/role-groups.ts'); await import('./src/commands/search.ts'); await import('./src/commands/schedules.ts'); await import('./src/commands/terminal-service.ts'); await import('./src/commands/terminal-browser.ts'); await import('./src/commands/terminal-image.ts'); await import('./src/commands/terminal-sandbox.ts'); await import('./src/commands/terminal-patch.ts'); await import('./src/commands/terminal-patch-worker.ts'); await import('./src/commands/terminal-browser-profile-import.protocol.ts'); await import('./src/commands/terminal-browser-profile-import.ts'); await import('./src/commands/terminal-browser-profile-import-runner.ts'); await import('./src/commands/terminal.ts'); await import('./src/cli.ts'); await import('./src/index.ts'); await import('./bin/revo.ts'); await import('./scripts/dev.ts')\"",
15
15
  "dev": "node ./scripts/dev.ts",
16
16
  "prepack": "npm run build",
17
17
  "test": "node --test ./test/*.test.ts",
18
- "postinstall": "playwright-core install chromium",
18
+ "postinstall": "node scripts/postinstall.mjs",
19
19
  "generate:automation-contract": "node scripts/generate-automation-contract.ts --write",
20
- "check:automation-contract": "node scripts/generate-automation-contract.ts"
20
+ "check:automation-contract": "node scripts/generate-automation-contract.ts",
21
+ "test:installed": "node scripts/verify-installed-cli.mjs"
21
22
  },
22
23
  "files": [
23
24
  "dist/",
24
25
  "README.md",
25
26
  "CHANGELOG.md",
26
27
  "tsconfig.json",
27
- "tsconfig.build.json"
28
+ "tsconfig.build.json",
29
+ "scripts/postinstall.mjs"
28
30
  ],
29
31
  "engines": {
30
32
  "node": ">=24"
@@ -41,6 +43,9 @@
41
43
  "ws": "^8.19.0"
42
44
  },
43
45
  "optionalDependencies": {
44
- "node-pty": "^1.0.0"
46
+ "node-pty": "1.1.0"
47
+ },
48
+ "allowScripts": {
49
+ "node-pty": true
45
50
  }
46
51
  }
@@ -0,0 +1,40 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { existsSync, realpathSync } from 'node:fs';
3
+ import { createRequire } from 'node:module';
4
+ import path from 'node:path';
5
+ import { pathToFileURL } from 'node:url';
6
+ // Published packages use compiled code; source checkouts can run npm install before build.
7
+ const compiledHelper = new URL('../dist/src/commands/terminal-pty.js', import.meta.url);
8
+ const { ensurePtyHelperExecutable } = await import(existsSync(compiledHelper)
9
+ ? compiledHelper.href : new URL('../src/commands/terminal-pty.ts', import.meta.url).href);
10
+
11
+ const require = createRequire(import.meta.url);
12
+
13
+ /** Optional PTY support must not prevent installing the ordinary CLI commands. */
14
+ export function prepareOptionalPtyInstallation() {
15
+ try {
16
+ ensurePtyHelperExecutable();
17
+ } catch (error) {
18
+ if (error?.code === 'MODULE_NOT_FOUND') return;
19
+ process.stderr.write('Optional interactive terminal setup could not finish; the runner will retry before starting a PTY.\n');
20
+ }
21
+ }
22
+
23
+ export function postinstall() {
24
+ prepareOptionalPtyInstallation();
25
+ // Use this package's browser installer, independently of the caller's PATH.
26
+ const browserCli = path.join(path.dirname(require.resolve('playwright-core/package.json')), 'cli.js');
27
+ const result = spawnSync(process.execPath, [browserCli, 'install', 'chromium'], {
28
+ stdio: 'inherit',
29
+ });
30
+ if (result.error) throw result.error;
31
+ return result.status ?? 1;
32
+ }
33
+
34
+ if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
35
+ try { process.exitCode = postinstall(); }
36
+ catch (error) {
37
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
38
+ process.exitCode = 1;
39
+ }
40
+ }