@appforge-ci/core 0.2.3 → 0.3.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.
Files changed (125) hide show
  1. package/dist/agent-readiness.d.ts +240 -1
  2. package/dist/agent-readiness.d.ts.map +1 -1
  3. package/dist/agent-readiness.js +304 -1
  4. package/dist/agent-readiness.js.map +1 -1
  5. package/dist/agent-readiness.test.js +277 -19
  6. package/dist/agent-readiness.test.js.map +1 -1
  7. package/dist/api-client.d.ts +80 -3
  8. package/dist/api-client.d.ts.map +1 -1
  9. package/dist/api-client.js +79 -0
  10. package/dist/api-client.js.map +1 -1
  11. package/dist/api-client.test.js +22 -0
  12. package/dist/api-client.test.js.map +1 -1
  13. package/dist/appforge-verify.test.d.ts +2 -0
  14. package/dist/appforge-verify.test.d.ts.map +1 -0
  15. package/dist/appforge-verify.test.js +958 -0
  16. package/dist/appforge-verify.test.js.map +1 -0
  17. package/dist/attestation-keys.d.ts +20 -0
  18. package/dist/attestation-keys.d.ts.map +1 -0
  19. package/dist/attestation-keys.js +27 -0
  20. package/dist/attestation-keys.js.map +1 -0
  21. package/dist/attestation-keys.test.d.ts +2 -0
  22. package/dist/attestation-keys.test.d.ts.map +1 -0
  23. package/dist/attestation-keys.test.js +45 -0
  24. package/dist/attestation-keys.test.js.map +1 -0
  25. package/dist/attestation-signing.d.ts +226 -0
  26. package/dist/attestation-signing.d.ts.map +1 -0
  27. package/dist/attestation-signing.js +276 -0
  28. package/dist/attestation-signing.js.map +1 -0
  29. package/dist/attestation-signing.test.d.ts +2 -0
  30. package/dist/attestation-signing.test.d.ts.map +1 -0
  31. package/dist/attestation-signing.test.js +250 -0
  32. package/dist/attestation-signing.test.js.map +1 -0
  33. package/dist/attestation-workerd.test.d.ts +2 -0
  34. package/dist/attestation-workerd.test.d.ts.map +1 -0
  35. package/dist/attestation-workerd.test.js +183 -0
  36. package/dist/attestation-workerd.test.js.map +1 -0
  37. package/dist/attestation.d.ts +412 -0
  38. package/dist/attestation.d.ts.map +1 -0
  39. package/dist/attestation.js +353 -0
  40. package/dist/attestation.js.map +1 -0
  41. package/dist/attestation.test.d.ts +2 -0
  42. package/dist/attestation.test.d.ts.map +1 -0
  43. package/dist/attestation.test.js +218 -0
  44. package/dist/attestation.test.js.map +1 -0
  45. package/dist/build-vpn.d.ts +20 -0
  46. package/dist/build-vpn.d.ts.map +1 -0
  47. package/dist/build-vpn.js +50 -0
  48. package/dist/build-vpn.js.map +1 -0
  49. package/dist/fleet-vpn.d.ts +64 -0
  50. package/dist/fleet-vpn.d.ts.map +1 -0
  51. package/dist/fleet-vpn.js +88 -0
  52. package/dist/fleet-vpn.js.map +1 -0
  53. package/dist/fleet-vpn.test.d.ts +2 -0
  54. package/dist/fleet-vpn.test.d.ts.map +1 -0
  55. package/dist/fleet-vpn.test.js +69 -0
  56. package/dist/fleet-vpn.test.js.map +1 -0
  57. package/dist/index.d.ts +11 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +11 -0
  60. package/dist/index.js.map +1 -1
  61. package/dist/schemas-repo-url.test.d.ts +2 -0
  62. package/dist/schemas-repo-url.test.d.ts.map +1 -0
  63. package/dist/schemas-repo-url.test.js +67 -0
  64. package/dist/schemas-repo-url.test.js.map +1 -0
  65. package/dist/schemas.d.ts +360 -7
  66. package/dist/schemas.d.ts.map +1 -1
  67. package/dist/schemas.js +148 -12
  68. package/dist/schemas.js.map +1 -1
  69. package/dist/ssh-deploy-key.d.ts +59 -0
  70. package/dist/ssh-deploy-key.d.ts.map +1 -0
  71. package/dist/ssh-deploy-key.js +124 -0
  72. package/dist/ssh-deploy-key.js.map +1 -0
  73. package/dist/ssh-deploy-key.test.d.ts +2 -0
  74. package/dist/ssh-deploy-key.test.d.ts.map +1 -0
  75. package/dist/ssh-deploy-key.test.js +117 -0
  76. package/dist/ssh-deploy-key.test.js.map +1 -0
  77. package/dist/types.d.ts +204 -0
  78. package/dist/types.d.ts.map +1 -1
  79. package/dist/types.js +0 -5
  80. package/dist/types.js.map +1 -1
  81. package/dist/vpn-attestation-workerd.test.d.ts +2 -0
  82. package/dist/vpn-attestation-workerd.test.d.ts.map +1 -0
  83. package/dist/vpn-attestation-workerd.test.js +184 -0
  84. package/dist/vpn-attestation-workerd.test.js.map +1 -0
  85. package/dist/vpn-attestation.d.ts +1015 -0
  86. package/dist/vpn-attestation.d.ts.map +1 -0
  87. package/dist/vpn-attestation.js +963 -0
  88. package/dist/vpn-attestation.js.map +1 -0
  89. package/dist/vpn-attestation.test.d.ts +2 -0
  90. package/dist/vpn-attestation.test.d.ts.map +1 -0
  91. package/dist/vpn-attestation.test.js +613 -0
  92. package/dist/vpn-attestation.test.js.map +1 -0
  93. package/dist/vpn-egress-presets.d.ts +142 -0
  94. package/dist/vpn-egress-presets.d.ts.map +1 -0
  95. package/dist/vpn-egress-presets.js +318 -0
  96. package/dist/vpn-egress-presets.js.map +1 -0
  97. package/dist/vpn-egress-presets.test.d.ts +2 -0
  98. package/dist/vpn-egress-presets.test.d.ts.map +1 -0
  99. package/dist/vpn-egress-presets.test.js +210 -0
  100. package/dist/vpn-egress-presets.test.js.map +1 -0
  101. package/dist/vpn-egress.d.ts +57 -0
  102. package/dist/vpn-egress.d.ts.map +1 -0
  103. package/dist/vpn-egress.js +126 -0
  104. package/dist/vpn-egress.js.map +1 -0
  105. package/dist/vpn-egress.test.d.ts +2 -0
  106. package/dist/vpn-egress.test.d.ts.map +1 -0
  107. package/dist/vpn-egress.test.js +133 -0
  108. package/dist/vpn-egress.test.js.map +1 -0
  109. package/dist/vpn-sandbox.d.ts +67 -0
  110. package/dist/vpn-sandbox.d.ts.map +1 -0
  111. package/dist/vpn-sandbox.js +22 -0
  112. package/dist/vpn-sandbox.js.map +1 -0
  113. package/dist/vpn-sandbox.test.d.ts +2 -0
  114. package/dist/vpn-sandbox.test.d.ts.map +1 -0
  115. package/dist/vpn-sandbox.test.js +34 -0
  116. package/dist/vpn-sandbox.test.js.map +1 -0
  117. package/dist/vpn-ssh.d.ts +138 -0
  118. package/dist/vpn-ssh.d.ts.map +1 -0
  119. package/dist/vpn-ssh.js +320 -0
  120. package/dist/vpn-ssh.js.map +1 -0
  121. package/dist/vpn-ssh.test.d.ts +2 -0
  122. package/dist/vpn-ssh.test.d.ts.map +1 -0
  123. package/dist/vpn-ssh.test.js +274 -0
  124. package/dist/vpn-ssh.test.js.map +1 -0
  125. package/package.json +1 -1
package/dist/schemas.d.ts CHANGED
@@ -471,15 +471,20 @@ export declare const createAppSchema: z.ZodObject<{
471
471
  platform: z.ZodEnum<["ios", "android", "flutter", "react-native"]>;
472
472
  repoUrl: z.ZodEffects<z.ZodString, string, string>;
473
473
  defaultBranch: z.ZodDefault<z.ZodString>;
474
+ /** Build through the org's site-to-site VPN tunnel from the start. Needed to create an app with an ssh
475
+ * `repoUrl` (the route requires it, and an owner/admin); the same rules as `PATCH /apps/:appId`'s `useVpn`. */
476
+ useVpn: z.ZodOptional<z.ZodBoolean>;
474
477
  }, "strip", z.ZodTypeAny, {
475
478
  name: string;
476
479
  platform: "ios" | "android" | "flutter" | "react-native";
477
480
  repoUrl: string;
478
481
  defaultBranch: string;
482
+ useVpn?: boolean | undefined;
479
483
  }, {
480
484
  name: string;
481
485
  platform: "ios" | "android" | "flutter" | "react-native";
482
486
  repoUrl: string;
487
+ useVpn?: boolean | undefined;
483
488
  defaultBranch?: string | undefined;
484
489
  }>;
485
490
  export declare const updateAppSchema: z.ZodObject<{
@@ -492,14 +497,14 @@ export declare const updateAppSchema: z.ZodObject<{
492
497
  useVpn: z.ZodOptional<z.ZodBoolean>;
493
498
  }, "strip", z.ZodTypeAny, {
494
499
  name?: string | undefined;
500
+ useVpn?: boolean | undefined;
495
501
  repoUrl?: string | undefined;
496
502
  defaultBranch?: string | undefined;
497
- useVpn?: boolean | undefined;
498
503
  }, {
499
504
  name?: string | undefined;
505
+ useVpn?: boolean | undefined;
500
506
  repoUrl?: string | undefined;
501
507
  defaultBranch?: string | undefined;
502
- useVpn?: boolean | undefined;
503
508
  }>;
504
509
  export declare const updateOrgSchema: z.ZodObject<{
505
510
  name: z.ZodOptional<z.ZodString>;
@@ -629,6 +634,20 @@ export declare const agentHeartbeatSchema: z.ZodObject<{
629
634
  * predates the VPN feature omits it and stays `vpnCapable = 0`, so it
630
635
  * is never offered a VPN build. */
631
636
  vpnCapable: z.ZodOptional<z.ZodBoolean>;
637
+ /** VPN features this agent can enforce (migrations/0043) — ids matching
638
+ * `VPN_FEATURE_ID_PATTERN`, at most `MAX_VPN_FEATURES`. Like `vpnCapable`
639
+ * the stored value is derived from THIS heartbeat alone: omitting it (an
640
+ * older agent) means "no features", never "keep the last value". A
641
+ * malformed list is rejected (400) rather than half-trusted. */
642
+ vpnFeatures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
643
+ /** Build-isolation level this agent enforces (migrations/0043). Same
644
+ * omit-means-default (`none`) rule as `vpnFeatures`. */
645
+ enforcementLevel: z.ZodOptional<z.ZodEnum<["none", "sandbox", "sandbox_uid"]>>;
646
+ /** Whether a GitHub Actions self-hosted runner shares this machine
647
+ * (migrations/0047). Like `vpnFeatures`, stored from THIS heartbeat alone:
648
+ * omitted (an older agent, or a check that failed) means "unknown", never
649
+ * "keep the last value", and unknown refuses a dedicated host. */
650
+ coHostedRunner: z.ZodOptional<z.ZodBoolean>;
632
651
  }, "strip", z.ZodTypeAny, {
633
652
  status: "online" | "draining" | "building";
634
653
  xcodeVersion: string | null;
@@ -642,6 +661,9 @@ export declare const agentHeartbeatSchema: z.ZodObject<{
642
661
  agentVersion?: string | null | undefined;
643
662
  screenSharingEnabled?: boolean | null | undefined;
644
663
  vpnCapable?: boolean | undefined;
664
+ vpnFeatures?: string[] | undefined;
665
+ enforcementLevel?: "none" | "sandbox" | "sandbox_uid" | undefined;
666
+ coHostedRunner?: boolean | undefined;
645
667
  tailscaleHostname?: string | null | undefined;
646
668
  currentBuildId?: string | null | undefined;
647
669
  activeBuildIds?: string[] | undefined;
@@ -659,6 +681,9 @@ export declare const agentHeartbeatSchema: z.ZodObject<{
659
681
  agentVersion?: string | null | undefined;
660
682
  screenSharingEnabled?: boolean | null | undefined;
661
683
  vpnCapable?: boolean | undefined;
684
+ vpnFeatures?: string[] | undefined;
685
+ enforcementLevel?: "none" | "sandbox" | "sandbox_uid" | undefined;
686
+ coHostedRunner?: boolean | undefined;
662
687
  tailscaleHostname?: string | null | undefined;
663
688
  currentBuildId?: string | null | undefined;
664
689
  activeBuildIds?: string[] | undefined;
@@ -668,11 +693,11 @@ export declare const appendLogSchema: z.ZodObject<{
668
693
  chunk: z.ZodString;
669
694
  seq: z.ZodNumber;
670
695
  }, "strip", z.ZodTypeAny, {
671
- chunk: string;
672
696
  seq: number;
673
- }, {
674
697
  chunk: string;
698
+ }, {
675
699
  seq: number;
700
+ chunk: string;
676
701
  }>;
677
702
  export declare const completeBuildSchema: z.ZodObject<{
678
703
  status: z.ZodEnum<["succeeded", "failed"]>;
@@ -737,8 +762,8 @@ export declare const promoteOtaReleaseSchema: z.ZodObject<{
737
762
  rollout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
738
763
  }, "strip", z.ZodTypeAny, {
739
764
  channel: string;
740
- mandatory: boolean;
741
765
  buildId: string;
766
+ mandatory: boolean;
742
767
  rollout: number;
743
768
  }, {
744
769
  buildId: string;
@@ -785,6 +810,29 @@ export declare const setAgentVpnApprovedSchema: z.ZodObject<{
785
810
  }, {
786
811
  approved: boolean;
787
812
  }>;
813
+ /** `PATCH /orgs/:orgId/agents/:agentId/dedicated` (apps/admin-api) — the
814
+ * only way `Agent.dedicatedOrgId` ever changes (migrations/0043). An
815
+ * operator taint, deliberately not in agentHeartbeatSchema/agentEnrollSchema:
816
+ * an agent must never be able to widen or lift its own restriction. `null`
817
+ * clears it (the Mac goes back to being shared). */
818
+ export declare const setAgentDedicatedOrgSchema: z.ZodObject<{
819
+ dedicatedOrgId: z.ZodNullable<z.ZodString>;
820
+ }, "strip", z.ZodTypeAny, {
821
+ dedicatedOrgId: string | null;
822
+ }, {
823
+ dedicatedOrgId: string | null;
824
+ }>;
825
+ /** `PATCH /orgs/:orgId/vpn-hosts/:tunnelOrgId/policy` (apps/admin-api, platform
826
+ * admins only) — the only way `VpnTunnel.hostPolicy` ever changes
827
+ * (migrations/0047). Deliberately not in `updateVpnTunnelSchema`: an org
828
+ * admin must not be able to loosen the placement the operator set. */
829
+ export declare const setVpnHostPolicySchema: z.ZodObject<{
830
+ hostPolicy: z.ZodEnum<["shared", "pinned", "dedicated"]>;
831
+ }, "strip", z.ZodTypeAny, {
832
+ hostPolicy: "shared" | "pinned" | "dedicated";
833
+ }, {
834
+ hostPolicy: "shared" | "pinned" | "dedicated";
835
+ }>;
788
836
  /** `PATCH /orgs/:orgId/agents/:agentId/device-stream-hostname` (apps/
789
837
  * admin-api)'s request body — `hostname: null` clears it, going back
790
838
  * to the global DEVICE_STREAM_WS_URL fallback (see migrations/0034's
@@ -812,7 +860,159 @@ export declare const startVncSessionSchema: z.ZodObject<{
812
860
  }, {
813
861
  mode?: "view" | "control" | undefined;
814
862
  }>;
815
- export declare const createVpnTunnelSchema: z.ZodObject<{
863
+ /**
864
+ * The shape-only form of the create/update bodies, WITHOUT the egress rules. The
865
+ * API route parses with these and then runs `resolveEgressChange`, which applies
866
+ * the same `validateEgressSettings` but answers with a structured 400 listing
867
+ * every problem (`errors`) rather than a generic schema error. Anything else
868
+ * should use `createVpnTunnelSchema` / `updateVpnTunnelSchema` below.
869
+ */
870
+ export declare const createVpnTunnelBodySchema: z.ZodObject<{
871
+ /** `regulated` needs `strictEgress`, and the operator's REGULATED_VPN_ENABLED flag. */
872
+ complianceMode: z.ZodOptional<z.ZodEnum<["standard", "regulated"]>>;
873
+ strictEgress: z.ZodOptional<z.ZodBoolean>;
874
+ /** Preset ids; replaces the list. */
875
+ egressPresets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
876
+ /** Custom hosts (exact or `*.suffix`, port 443 unless `ports` says otherwise); replaces the list. */
877
+ egressAllow: z.ZodOptional<z.ZodArray<z.ZodObject<{
878
+ host: z.ZodString;
879
+ ports: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
880
+ }, "strip", z.ZodTypeAny, {
881
+ host: string;
882
+ ports?: number[] | undefined;
883
+ }, {
884
+ host: string;
885
+ ports?: number[] | undefined;
886
+ }>, "many">>;
887
+ name: z.ZodString;
888
+ gatewayEndpoint: z.ZodString;
889
+ gatewayPublicKey: z.ZodString;
890
+ lanCidrs: z.ZodArray<z.ZodString, "many">;
891
+ dnsServer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
892
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
893
+ /** Omit to have the server allocate a free /30. Supply it only when a
894
+ * customer network already routes the allocated range. */
895
+ tunnelCidr: z.ZodOptional<z.ZodString>;
896
+ /** Lab mode — allow a private (RFC1918/CGNAT) gateway endpoint. Setting it
897
+ * `true` is platform-admin only (enforced by the route, not here). */
898
+ allowPrivateEndpoint: z.ZodOptional<z.ZodBoolean>;
899
+ }, "strip", z.ZodTypeAny, {
900
+ name: string;
901
+ gatewayEndpoint: string;
902
+ gatewayPublicKey: string;
903
+ lanCidrs: string[];
904
+ egressAllow?: {
905
+ host: string;
906
+ ports?: number[] | undefined;
907
+ }[] | undefined;
908
+ egressPresets?: string[] | undefined;
909
+ dnsServer?: string | null | undefined;
910
+ allowedDomains?: string[] | undefined;
911
+ tunnelCidr?: string | undefined;
912
+ allowPrivateEndpoint?: boolean | undefined;
913
+ complianceMode?: "standard" | "regulated" | undefined;
914
+ strictEgress?: boolean | undefined;
915
+ }, {
916
+ name: string;
917
+ gatewayEndpoint: string;
918
+ gatewayPublicKey: string;
919
+ lanCidrs: string[];
920
+ egressAllow?: {
921
+ host: string;
922
+ ports?: number[] | undefined;
923
+ }[] | undefined;
924
+ egressPresets?: string[] | undefined;
925
+ dnsServer?: string | null | undefined;
926
+ allowedDomains?: string[] | undefined;
927
+ tunnelCidr?: string | undefined;
928
+ allowPrivateEndpoint?: boolean | undefined;
929
+ complianceMode?: "standard" | "regulated" | undefined;
930
+ strictEgress?: boolean | undefined;
931
+ }>;
932
+ export declare const updateVpnTunnelBodySchema: z.ZodObject<{
933
+ /** `regulated` needs `strictEgress`, and the operator's REGULATED_VPN_ENABLED flag. */
934
+ complianceMode: z.ZodOptional<z.ZodEnum<["standard", "regulated"]>>;
935
+ strictEgress: z.ZodOptional<z.ZodBoolean>;
936
+ /** Preset ids; replaces the list. */
937
+ egressPresets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
938
+ /** Custom hosts (exact or `*.suffix`, port 443 unless `ports` says otherwise); replaces the list. */
939
+ egressAllow: z.ZodOptional<z.ZodArray<z.ZodObject<{
940
+ host: z.ZodString;
941
+ ports: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
942
+ }, "strip", z.ZodTypeAny, {
943
+ host: string;
944
+ ports?: number[] | undefined;
945
+ }, {
946
+ host: string;
947
+ ports?: number[] | undefined;
948
+ }>, "many">>;
949
+ name: z.ZodOptional<z.ZodString>;
950
+ gatewayEndpoint: z.ZodOptional<z.ZodString>;
951
+ gatewayPublicKey: z.ZodOptional<z.ZodString>;
952
+ lanCidrs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
953
+ /** Explicit `null` clears it; omitted leaves it unchanged. */
954
+ dnsServer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
955
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
956
+ tunnelCidr: z.ZodOptional<z.ZodString>;
957
+ /** Lab mode. `true` is platform-admin only; omitted leaves it unchanged. */
958
+ allowPrivateEndpoint: z.ZodOptional<z.ZodBoolean>;
959
+ /** `false` disables the tunnel (builds that need it then fail fast
960
+ * instead of queueing); `true` re-enables it, back to `pending` until
961
+ * the next handshake proves it works. */
962
+ enabled: z.ZodOptional<z.ZodBoolean>;
963
+ }, "strip", z.ZodTypeAny, {
964
+ name?: string | undefined;
965
+ egressAllow?: {
966
+ host: string;
967
+ ports?: number[] | undefined;
968
+ }[] | undefined;
969
+ egressPresets?: string[] | undefined;
970
+ enabled?: boolean | undefined;
971
+ gatewayEndpoint?: string | undefined;
972
+ gatewayPublicKey?: string | undefined;
973
+ lanCidrs?: string[] | undefined;
974
+ dnsServer?: string | null | undefined;
975
+ allowedDomains?: string[] | undefined;
976
+ tunnelCidr?: string | undefined;
977
+ allowPrivateEndpoint?: boolean | undefined;
978
+ complianceMode?: "standard" | "regulated" | undefined;
979
+ strictEgress?: boolean | undefined;
980
+ }, {
981
+ name?: string | undefined;
982
+ egressAllow?: {
983
+ host: string;
984
+ ports?: number[] | undefined;
985
+ }[] | undefined;
986
+ egressPresets?: string[] | undefined;
987
+ enabled?: boolean | undefined;
988
+ gatewayEndpoint?: string | undefined;
989
+ gatewayPublicKey?: string | undefined;
990
+ lanCidrs?: string[] | undefined;
991
+ dnsServer?: string | null | undefined;
992
+ allowedDomains?: string[] | undefined;
993
+ tunnelCidr?: string | undefined;
994
+ allowPrivateEndpoint?: boolean | undefined;
995
+ complianceMode?: "standard" | "regulated" | undefined;
996
+ strictEgress?: boolean | undefined;
997
+ }>;
998
+ /** The create body, with the egress rules (bare `*`, IP literals, unknown presets, merged port limit) enforced too. */
999
+ export declare const createVpnTunnelSchema: z.ZodEffects<z.ZodObject<{
1000
+ /** `regulated` needs `strictEgress`, and the operator's REGULATED_VPN_ENABLED flag. */
1001
+ complianceMode: z.ZodOptional<z.ZodEnum<["standard", "regulated"]>>;
1002
+ strictEgress: z.ZodOptional<z.ZodBoolean>;
1003
+ /** Preset ids; replaces the list. */
1004
+ egressPresets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1005
+ /** Custom hosts (exact or `*.suffix`, port 443 unless `ports` says otherwise); replaces the list. */
1006
+ egressAllow: z.ZodOptional<z.ZodArray<z.ZodObject<{
1007
+ host: z.ZodString;
1008
+ ports: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1009
+ }, "strip", z.ZodTypeAny, {
1010
+ host: string;
1011
+ ports?: number[] | undefined;
1012
+ }, {
1013
+ host: string;
1014
+ ports?: number[] | undefined;
1015
+ }>, "many">>;
816
1016
  name: z.ZodString;
817
1017
  gatewayEndpoint: z.ZodString;
818
1018
  gatewayPublicKey: z.ZodString;
@@ -830,21 +1030,84 @@ export declare const createVpnTunnelSchema: z.ZodObject<{
830
1030
  gatewayEndpoint: string;
831
1031
  gatewayPublicKey: string;
832
1032
  lanCidrs: string[];
1033
+ egressAllow?: {
1034
+ host: string;
1035
+ ports?: number[] | undefined;
1036
+ }[] | undefined;
1037
+ egressPresets?: string[] | undefined;
1038
+ dnsServer?: string | null | undefined;
1039
+ allowedDomains?: string[] | undefined;
1040
+ tunnelCidr?: string | undefined;
1041
+ allowPrivateEndpoint?: boolean | undefined;
1042
+ complianceMode?: "standard" | "regulated" | undefined;
1043
+ strictEgress?: boolean | undefined;
1044
+ }, {
1045
+ name: string;
1046
+ gatewayEndpoint: string;
1047
+ gatewayPublicKey: string;
1048
+ lanCidrs: string[];
1049
+ egressAllow?: {
1050
+ host: string;
1051
+ ports?: number[] | undefined;
1052
+ }[] | undefined;
1053
+ egressPresets?: string[] | undefined;
1054
+ dnsServer?: string | null | undefined;
1055
+ allowedDomains?: string[] | undefined;
1056
+ tunnelCidr?: string | undefined;
1057
+ allowPrivateEndpoint?: boolean | undefined;
1058
+ complianceMode?: "standard" | "regulated" | undefined;
1059
+ strictEgress?: boolean | undefined;
1060
+ }>, {
1061
+ name: string;
1062
+ gatewayEndpoint: string;
1063
+ gatewayPublicKey: string;
1064
+ lanCidrs: string[];
1065
+ egressAllow?: {
1066
+ host: string;
1067
+ ports?: number[] | undefined;
1068
+ }[] | undefined;
1069
+ egressPresets?: string[] | undefined;
833
1070
  dnsServer?: string | null | undefined;
834
1071
  allowedDomains?: string[] | undefined;
835
1072
  tunnelCidr?: string | undefined;
836
1073
  allowPrivateEndpoint?: boolean | undefined;
1074
+ complianceMode?: "standard" | "regulated" | undefined;
1075
+ strictEgress?: boolean | undefined;
837
1076
  }, {
838
1077
  name: string;
839
1078
  gatewayEndpoint: string;
840
1079
  gatewayPublicKey: string;
841
1080
  lanCidrs: string[];
1081
+ egressAllow?: {
1082
+ host: string;
1083
+ ports?: number[] | undefined;
1084
+ }[] | undefined;
1085
+ egressPresets?: string[] | undefined;
842
1086
  dnsServer?: string | null | undefined;
843
1087
  allowedDomains?: string[] | undefined;
844
1088
  tunnelCidr?: string | undefined;
845
1089
  allowPrivateEndpoint?: boolean | undefined;
1090
+ complianceMode?: "standard" | "regulated" | undefined;
1091
+ strictEgress?: boolean | undefined;
846
1092
  }>;
847
- export declare const updateVpnTunnelSchema: z.ZodObject<{
1093
+ /** The update body, with the egress rules enforced too. */
1094
+ export declare const updateVpnTunnelSchema: z.ZodEffects<z.ZodObject<{
1095
+ /** `regulated` needs `strictEgress`, and the operator's REGULATED_VPN_ENABLED flag. */
1096
+ complianceMode: z.ZodOptional<z.ZodEnum<["standard", "regulated"]>>;
1097
+ strictEgress: z.ZodOptional<z.ZodBoolean>;
1098
+ /** Preset ids; replaces the list. */
1099
+ egressPresets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1100
+ /** Custom hosts (exact or `*.suffix`, port 443 unless `ports` says otherwise); replaces the list. */
1101
+ egressAllow: z.ZodOptional<z.ZodArray<z.ZodObject<{
1102
+ host: z.ZodString;
1103
+ ports: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1104
+ }, "strip", z.ZodTypeAny, {
1105
+ host: string;
1106
+ ports?: number[] | undefined;
1107
+ }, {
1108
+ host: string;
1109
+ ports?: number[] | undefined;
1110
+ }>, "many">>;
848
1111
  name: z.ZodOptional<z.ZodString>;
849
1112
  gatewayEndpoint: z.ZodOptional<z.ZodString>;
850
1113
  gatewayPublicKey: z.ZodOptional<z.ZodString>;
@@ -861,6 +1124,11 @@ export declare const updateVpnTunnelSchema: z.ZodObject<{
861
1124
  enabled: z.ZodOptional<z.ZodBoolean>;
862
1125
  }, "strip", z.ZodTypeAny, {
863
1126
  name?: string | undefined;
1127
+ egressAllow?: {
1128
+ host: string;
1129
+ ports?: number[] | undefined;
1130
+ }[] | undefined;
1131
+ egressPresets?: string[] | undefined;
864
1132
  enabled?: boolean | undefined;
865
1133
  gatewayEndpoint?: string | undefined;
866
1134
  gatewayPublicKey?: string | undefined;
@@ -869,8 +1137,32 @@ export declare const updateVpnTunnelSchema: z.ZodObject<{
869
1137
  allowedDomains?: string[] | undefined;
870
1138
  tunnelCidr?: string | undefined;
871
1139
  allowPrivateEndpoint?: boolean | undefined;
1140
+ complianceMode?: "standard" | "regulated" | undefined;
1141
+ strictEgress?: boolean | undefined;
872
1142
  }, {
873
1143
  name?: string | undefined;
1144
+ egressAllow?: {
1145
+ host: string;
1146
+ ports?: number[] | undefined;
1147
+ }[] | undefined;
1148
+ egressPresets?: string[] | undefined;
1149
+ enabled?: boolean | undefined;
1150
+ gatewayEndpoint?: string | undefined;
1151
+ gatewayPublicKey?: string | undefined;
1152
+ lanCidrs?: string[] | undefined;
1153
+ dnsServer?: string | null | undefined;
1154
+ allowedDomains?: string[] | undefined;
1155
+ tunnelCidr?: string | undefined;
1156
+ allowPrivateEndpoint?: boolean | undefined;
1157
+ complianceMode?: "standard" | "regulated" | undefined;
1158
+ strictEgress?: boolean | undefined;
1159
+ }>, {
1160
+ name?: string | undefined;
1161
+ egressAllow?: {
1162
+ host: string;
1163
+ ports?: number[] | undefined;
1164
+ }[] | undefined;
1165
+ egressPresets?: string[] | undefined;
874
1166
  enabled?: boolean | undefined;
875
1167
  gatewayEndpoint?: string | undefined;
876
1168
  gatewayPublicKey?: string | undefined;
@@ -879,6 +1171,54 @@ export declare const updateVpnTunnelSchema: z.ZodObject<{
879
1171
  allowedDomains?: string[] | undefined;
880
1172
  tunnelCidr?: string | undefined;
881
1173
  allowPrivateEndpoint?: boolean | undefined;
1174
+ complianceMode?: "standard" | "regulated" | undefined;
1175
+ strictEgress?: boolean | undefined;
1176
+ }, {
1177
+ name?: string | undefined;
1178
+ egressAllow?: {
1179
+ host: string;
1180
+ ports?: number[] | undefined;
1181
+ }[] | undefined;
1182
+ egressPresets?: string[] | undefined;
1183
+ enabled?: boolean | undefined;
1184
+ gatewayEndpoint?: string | undefined;
1185
+ gatewayPublicKey?: string | undefined;
1186
+ lanCidrs?: string[] | undefined;
1187
+ dnsServer?: string | null | undefined;
1188
+ allowedDomains?: string[] | undefined;
1189
+ tunnelCidr?: string | undefined;
1190
+ allowPrivateEndpoint?: boolean | undefined;
1191
+ complianceMode?: "standard" | "regulated" | undefined;
1192
+ strictEgress?: boolean | undefined;
1193
+ }>;
1194
+ /**
1195
+ * The strict-egress allow-list (`VpnJobConfig.egress`; docs in vpn-egress.ts).
1196
+ * Field-level shape and size bounds only; the host rules (no IP literals, no
1197
+ * bare `*`, no trailing dot ...) live in `validateVpnEgressPolicy` so the
1198
+ * server, the CLI and the agent apply the identical checks and report every
1199
+ * problem at once. Tunnel settings (PR-D) will embed this.
1200
+ */
1201
+ export declare const vpnEgressPolicySchema: z.ZodObject<{
1202
+ allow: z.ZodArray<z.ZodObject<{
1203
+ host: z.ZodString;
1204
+ ports: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1205
+ }, "strip", z.ZodTypeAny, {
1206
+ host: string;
1207
+ ports?: number[] | undefined;
1208
+ }, {
1209
+ host: string;
1210
+ ports?: number[] | undefined;
1211
+ }>, "many">;
1212
+ }, "strip", z.ZodTypeAny, {
1213
+ allow: {
1214
+ host: string;
1215
+ ports?: number[] | undefined;
1216
+ }[];
1217
+ }, {
1218
+ allow: {
1219
+ host: string;
1220
+ ports?: number[] | undefined;
1221
+ }[];
882
1222
  }>;
883
1223
  /** `POST /agents/vpn/report` (apps/admin-api) — what the agent that holds
884
1224
  * an org's tunnel for a build tells the control plane about it. The
@@ -898,4 +1238,17 @@ export declare const reportVpnEventSchema: z.ZodObject<{
898
1238
  event: "tunnel_up" | "tunnel_down" | "handshake_ok" | "handshake_failed";
899
1239
  detail?: string | undefined;
900
1240
  }>;
1241
+ /**
1242
+ * `PUT /orgs/:orgId/vpn/ssh-hosts` (regulated-VPN program, PR-G): replaces the
1243
+ * tunnel's pinned SSH host keys. Only the SHAPE is checked here (bounded array of
1244
+ * bounded strings); the content rules, with their per-line error messages, are
1245
+ * `validateKnownHostsInput` in vpn-ssh.ts, run by the route. `[]` clears them.
1246
+ */
1247
+ export declare const setVpnSshHostsSchema: z.ZodObject<{
1248
+ knownHosts: z.ZodArray<z.ZodString, "many">;
1249
+ }, "strip", z.ZodTypeAny, {
1250
+ knownHosts: string[];
1251
+ }, {
1252
+ knownHosts: string[];
1253
+ }>;
901
1254
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,0DAAwD,CAAC;AAEpF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwBjC;;;sEAGkE;;IAElE,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO7E,CAAC;AAEH,iDAAiD;AACjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAf/B;;;0EAGkE;;QAElE,6EAA6E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe7E,CAAC;AAgCH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAKvB,CAAC;AAEH,eAAO,MAAM,WAAW;;;IAGtB;;;uEAGmE;;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