@ever-works/mailchimp-transactional-plugin 1.0.8 → 1.0.9

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/dist/index.js CHANGED
@@ -713,6 +713,44 @@ var FLEET_LINK_CONTROL_TYPES = [
713
713
  "operation.done",
714
714
  "operation.cancel"
715
715
  ];
716
+ var FLEET_CREDENTIAL_FILE_PATTERNS = [
717
+ ".env",
718
+ ".env.*",
719
+ "*.pem",
720
+ "*.key",
721
+ "*.p12",
722
+ "*.pfx",
723
+ "*.jks",
724
+ "*.keystore",
725
+ "*.kdbx",
726
+ "id_rsa*",
727
+ "id_dsa*",
728
+ "id_ecdsa*",
729
+ "id_ed25519*",
730
+ "*.ppk",
731
+ ".netrc",
732
+ ".npmrc",
733
+ ".pypirc",
734
+ "credentials",
735
+ "credentials.json",
736
+ "service-account*.json",
737
+ ".aws/credentials",
738
+ "*.gpg",
739
+ "*.asc",
740
+ ".docker/config.json",
741
+ "kubeconfig",
742
+ ".kube/config"
743
+ ];
744
+ function globToRegExp(glob) {
745
+ const escaped = glob.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
746
+ return new RegExp(`^${escaped}$`, "i");
747
+ }
748
+ FLEET_CREDENTIAL_FILE_PATTERNS.filter((pattern) => !pattern.includes("/")).map(
749
+ globToRegExp
750
+ );
751
+ FLEET_CREDENTIAL_FILE_PATTERNS.filter((pattern) => pattern.includes("/")).map(
752
+ (pattern) => ({ segments: pattern.split("/").length, matcher: globToRegExp(pattern) })
753
+ );
716
754
  new Set(FLEET_LINK_CONTROL_TYPES);
717
755
  new TextEncoder();
718
756
  var FLEET_RUN_TOKEN_ROUTES = Object.freeze([
@@ -798,6 +836,12 @@ var FLEET_RUN_TOKEN_ROUTES = Object.freeze([
798
836
  { method: "GET", pathPattern: "/api/fleet/runner-status" },
799
837
  { method: "GET", pathPattern: "/api/fleet/execution-preferences" },
800
838
  { method: "GET", pathPattern: "/api/fleet/agents/{agentId}/node-affinity" },
839
+ // Session git & actions (FL-06 FR-18): an Agent session asks the platform to
840
+ // open or update the pull request of ITS OWN checkout. The route refuses a
841
+ // checkout that is not the token's session's, and the Agent's "may open pull
842
+ // requests" permission applies; it never merges anything.
843
+ { method: "GET", pathPattern: "/api/fleet/checkouts/{id}/pull-request" },
844
+ { method: "POST", pathPattern: "/api/fleet/checkouts/{id}/pull-request" },
801
845
  // Agents — reads, plus cancel and pause (the safe direction).
802
846
  { method: "GET", pathPattern: "/api/agents" },
803
847
  { method: "GET", pathPattern: "/api/agents/{id}" },
@@ -819,6 +863,705 @@ FLEET_RUN_TOKEN_ROUTES.map((route) => ({
819
863
  method: route.method.toUpperCase(),
820
864
  shape: splitSegments(route.pathPattern).map((part) => /^\{[^}]+\}$/.test(part) ? "*" : part.toLowerCase())
821
865
  }));
866
+ function row(input) {
867
+ const rest = input.name.slice("fleet_".length);
868
+ const cut = rest.indexOf("_");
869
+ const family = cut === -1 ? rest : rest.slice(0, cut);
870
+ const verb = cut === -1 ? "" : rest.slice(cut + 1);
871
+ return Object.freeze({ ...input, family, verb });
872
+ }
873
+ function read(name, permissionFamily, owner, flag, status, extra = {}) {
874
+ return row({
875
+ name,
876
+ readOnly: true,
877
+ category: "read.internal",
878
+ permissionFamily,
879
+ owner,
880
+ phase: "P1",
881
+ flag,
882
+ status,
883
+ ...extra
884
+ });
885
+ }
886
+ function act(name, permissionFamily, owner, flag, status, annotation, extra = {}) {
887
+ return row({ name, permissionFamily, owner, phase: "P2", flag, status, ...annotation, ...extra });
888
+ }
889
+ var plain = (category, destructive = false) => ({
890
+ destructive,
891
+ confirmationClass: "plain",
892
+ category
893
+ });
894
+ var confirm = (category, destructive = true) => ({
895
+ destructive,
896
+ confirmationClass: "confirm",
897
+ category
898
+ });
899
+ var typed = (category) => ({
900
+ destructive: true,
901
+ confirmationClass: "confirm-destructive",
902
+ category
903
+ });
904
+ var GET = (path) => ({ method: "GET", path });
905
+ var POST = (path) => ({ method: "POST", path });
906
+ var PATCH = (path) => ({ method: "PATCH", path });
907
+ var DELETE = (path) => ({ method: "DELETE", path });
908
+ var FLEET_TOOL_CATALOGUE = Object.freeze([
909
+ // ── status (FL-19) ──
910
+ read("fleet_status", "view", "FL-19", "FLEET_ENABLED", "live", {
911
+ route: GET("/api/fleet/status"),
912
+ cli: "fleet status"
913
+ }),
914
+ // ── nodes (FL-19, FL-03, FL-15) ──
915
+ read("fleet_nodes_list", "view", "FL-19", "FLEET_ENABLED", "live", {
916
+ route: GET("/api/fleet/nodes"),
917
+ cli: "fleet nodes list"
918
+ }),
919
+ read("fleet_nodes_get", "view", "FL-19", "FLEET_ENABLED", "live", {
920
+ route: GET("/api/fleet/nodes/{id}"),
921
+ cli: "fleet nodes get"
922
+ }),
923
+ read("fleet_nodes_health", "view", "FL-03", "FLEET_ENABLED", "live", {
924
+ route: GET("/api/fleet/nodes/{id}/health"),
925
+ cli: "fleet nodes health"
926
+ }),
927
+ read("fleet_nodes_needs_a_look", "view", "FL-03", "FLEET_ENABLED", "live", {
928
+ route: GET("/api/fleet/nodes/{id}/needs-a-look"),
929
+ cli: "fleet nodes needs-a-look"
930
+ }),
931
+ read("fleet_nodes_git_identity_get", "view", "FL-15", "FLEET_CHECKOUTS_ENABLED", "live", {
932
+ route: GET("/api/fleet/nodes/{id}/git/identity"),
933
+ cli: "fleet nodes git-identity"
934
+ }),
935
+ act("fleet_nodes_wake", "machines", "FL-03", "FLEET_ENABLED", "live", plain("machine.admin"), {
936
+ route: POST("/api/fleet/nodes/{id}/wake"),
937
+ cli: "fleet nodes wake"
938
+ }),
939
+ act(
940
+ "fleet_nodes_git_identity_set",
941
+ "commands",
942
+ "FL-15",
943
+ "FLEET_CHECKOUTS_ENABLED",
944
+ "live",
945
+ confirm("machine.admin", false),
946
+ { route: POST("/api/fleet/nodes/{id}/git/identity"), cli: "fleet nodes git-identity --set" }
947
+ ),
948
+ // ── sessions (FL-04, FL-05, FL-06) ──
949
+ read("fleet_sessions_list", "sessions", "FL-04", "FLEET_SESSIONS_ENABLED", "live", {
950
+ route: GET("/api/fleet/sessions"),
951
+ cli: "fleet sessions list"
952
+ }),
953
+ read("fleet_sessions_read", "sessions", "FL-04", "FLEET_SESSIONS_ENABLED", "live", {
954
+ route: GET("/api/fleet/sessions/{id}"),
955
+ cli: "fleet sessions read"
956
+ }),
957
+ read("fleet_sessions_question", "sessions", "FL-05", "FLEET_SESSIONS_ENABLED", "live", {
958
+ route: GET("/api/fleet/sessions/{id}"),
959
+ cli: "fleet sessions question"
960
+ }),
961
+ read("fleet_sessions_actions_list", "sessions", "FL-06", "FLEET_SESSIONS_ENABLED", "planned", {
962
+ route: GET("/api/fleet/sessions/{id}/actions"),
963
+ cli: "fleet sessions actions"
964
+ }),
965
+ act("fleet_sessions_start", "sessions", "FL-04", "FLEET_SESSIONS_ENABLED", "live", plain("machine.run"), {
966
+ route: POST("/api/fleet/nodes/{id}/sessions"),
967
+ cli: "fleet sessions start"
968
+ }),
969
+ act("fleet_sessions_send", "sessions", "FL-04", "FLEET_SESSIONS_ENABLED", "live", plain("machine.run")),
970
+ act("fleet_sessions_answer", "sessions", "FL-05", "FLEET_SESSIONS_ENABLED", "live", confirm("machine.run", false), {
971
+ route: POST("/api/fleet/sessions/{id}/answer"),
972
+ cli: "fleet sessions answer",
973
+ confirmationNote: "questions only; a permission prompt is answered by a person (CONTRACTS R-32)"
974
+ }),
975
+ act("fleet_sessions_rename", "sessions", "FL-04", "FLEET_SESSIONS_ENABLED", "live", plain("write.internal"), {
976
+ route: PATCH("/api/fleet/sessions/{id}"),
977
+ cli: "fleet sessions rename"
978
+ }),
979
+ act("fleet_sessions_end", "sessions", "FL-04", "FLEET_SESSIONS_ENABLED", "live", confirm("machine.run"), {
980
+ route: POST("/api/fleet/sessions/{id}/end"),
981
+ cli: "fleet sessions end"
982
+ }),
983
+ act("fleet_sessions_action", "sessions", "FL-06", "FLEET_SESSIONS_ENABLED", "planned", plain("machine.run"), {
984
+ route: POST("/api/fleet/sessions/{id}/actions"),
985
+ cli: "fleet sessions action"
986
+ }),
987
+ // ── desktop (FL-07, FL-11 paste) ──
988
+ read("fleet_desktop_screenshot", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", {
989
+ route: GET("/api/fleet/nodes/{id}/desktop/screenshot"),
990
+ cli: "fleet desktop screenshot"
991
+ }),
992
+ read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", {
993
+ route: GET("/api/fleet/nodes/{id}/desktop/displays"),
994
+ cli: "fleet desktop displays"
995
+ }),
996
+ read("fleet_desktop_recordings_list", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", {
997
+ route: GET("/api/fleet/nodes/{id}/desktop/recordings"),
998
+ cli: "fleet desktop recordings"
999
+ }),
1000
+ act("fleet_desktop_input", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", plain("machine.admin", true), {
1001
+ route: POST("/api/fleet/nodes/{id}/desktop/input"),
1002
+ cli: "fleet desktop input"
1003
+ }),
1004
+ act("fleet_desktop_set_display", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", plain("machine.admin"), {
1005
+ route: POST("/api/fleet/nodes/{id}/desktop/displays"),
1006
+ cli: "fleet desktop set-display"
1007
+ }),
1008
+ act("fleet_desktop_display_add", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", confirm("machine.admin"), {
1009
+ phase: "P3",
1010
+ route: POST("/api/fleet/nodes/{id}/desktop/displays/virtual"),
1011
+ cli: "fleet desktop display-add"
1012
+ }),
1013
+ act(
1014
+ "fleet_desktop_display_remove",
1015
+ "desktop",
1016
+ "FL-07",
1017
+ "FLEET_DESKTOP_ENABLED",
1018
+ "planned",
1019
+ confirm("machine.admin"),
1020
+ {
1021
+ phase: "P3",
1022
+ route: DELETE("/api/fleet/nodes/{id}/desktop/displays/virtual/{displayId}"),
1023
+ cli: "fleet desktop display-remove"
1024
+ }
1025
+ ),
1026
+ act(
1027
+ "fleet_desktop_paste",
1028
+ "desktop",
1029
+ "FL-11",
1030
+ "FLEET_MACHINE_FACTS_ENABLED",
1031
+ "planned",
1032
+ plain("machine.admin", true),
1033
+ {
1034
+ route: POST("/api/fleet/nodes/{id}/desktop/paste"),
1035
+ cli: "fleet desktop paste",
1036
+ confirmationNote: "denied unless a tool grant allows it (AW-15)"
1037
+ }
1038
+ ),
1039
+ // ── logs (FL-08) ──
1040
+ read("fleet_logs_sources", "logs", "FL-08", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1041
+ route: GET("/api/fleet/nodes/{id}/logs/sources"),
1042
+ cli: "fleet logs sources"
1043
+ }),
1044
+ read("fleet_logs_read", "logs", "FL-08", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1045
+ route: POST("/api/fleet/nodes/{id}/logs/read"),
1046
+ cli: "fleet logs read"
1047
+ }),
1048
+ // ── services (FL-09) ──
1049
+ read("fleet_services_list", "services", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1050
+ route: GET("/api/fleet/nodes/{id}/services"),
1051
+ cli: "fleet services list"
1052
+ }),
1053
+ act("fleet_services_action", "services", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", confirm("machine.admin"), {
1054
+ route: POST("/api/fleet/nodes/{id}/services/{name}/{action}"),
1055
+ cli: "fleet services action",
1056
+ waitable: true,
1057
+ confirmationNote: "confirm; blast-radius when the node warns it could cut the machine off"
1058
+ }),
1059
+ // ── processes (FL-09) ──
1060
+ read("fleet_processes_list", "processes", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1061
+ route: GET("/api/fleet/nodes/{id}/processes"),
1062
+ cli: "fleet processes list"
1063
+ }),
1064
+ act(
1065
+ "fleet_processes_signal",
1066
+ "processes",
1067
+ "FL-09",
1068
+ "FLEET_MACHINE_FACTS_ENABLED",
1069
+ "live",
1070
+ confirm("machine.admin"),
1071
+ { route: POST("/api/fleet/nodes/{id}/processes/{pid}/signal"), cli: "fleet processes signal" }
1072
+ ),
1073
+ // ── docker (FL-09) ──
1074
+ read("fleet_docker_containers_list", "docker", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1075
+ route: GET("/api/fleet/nodes/{id}/docker/containers"),
1076
+ cli: "fleet docker containers"
1077
+ }),
1078
+ read("fleet_docker_images_list", "docker", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1079
+ route: GET("/api/fleet/nodes/{id}/docker/images"),
1080
+ cli: "fleet docker images"
1081
+ }),
1082
+ read("fleet_docker_compose_list", "docker", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1083
+ route: GET("/api/fleet/nodes/{id}/docker/compose"),
1084
+ cli: "fleet docker compose"
1085
+ }),
1086
+ read("fleet_docker_compose_describe", "docker", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1087
+ cli: "fleet docker compose-describe"
1088
+ }),
1089
+ act(
1090
+ "fleet_docker_container_action",
1091
+ "docker",
1092
+ "FL-09",
1093
+ "FLEET_MACHINE_FACTS_ENABLED",
1094
+ "live",
1095
+ confirm("machine.admin"),
1096
+ {
1097
+ route: POST("/api/fleet/nodes/{id}/docker/containers/{cid}/{action}"),
1098
+ cli: "fleet docker container",
1099
+ waitable: true,
1100
+ confirmationNote: "confirm; remove is confirm-destructive"
1101
+ }
1102
+ ),
1103
+ act("fleet_docker_run", "docker", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "live", confirm("machine.admin", false), {
1104
+ route: POST("/api/fleet/nodes/{id}/docker/containers"),
1105
+ cli: "fleet docker run",
1106
+ waitable: true,
1107
+ alwaysHeld: true,
1108
+ confirmationNote: "an Agent proposes a run; a person types any secret values"
1109
+ }),
1110
+ act(
1111
+ "fleet_docker_image_action",
1112
+ "docker",
1113
+ "FL-09",
1114
+ "FLEET_MACHINE_FACTS_ENABLED",
1115
+ "live",
1116
+ confirm("machine.admin"),
1117
+ {
1118
+ route: POST("/api/fleet/nodes/{id}/docker/images/{iid}/{action}"),
1119
+ cli: "fleet docker image",
1120
+ waitable: true,
1121
+ confirmationNote: "pull is plain and not destructive; remove and prune confirm"
1122
+ }
1123
+ ),
1124
+ act(
1125
+ "fleet_docker_compose_action",
1126
+ "docker",
1127
+ "FL-09",
1128
+ "FLEET_MACHINE_FACTS_ENABLED",
1129
+ "live",
1130
+ confirm("machine.admin"),
1131
+ {
1132
+ route: POST("/api/fleet/nodes/{id}/docker/compose/{project}/{action}"),
1133
+ cli: "fleet docker compose-action",
1134
+ waitable: true,
1135
+ confirmationNote: "destructive for down"
1136
+ }
1137
+ ),
1138
+ act("fleet_docker_exec", "docker", "FL-09", "FLEET_MACHINE_FACTS_ENABLED", "planned", plain("machine.run"), {
1139
+ phase: "P3",
1140
+ cli: "fleet docker exec"
1141
+ }),
1142
+ // ── ports (FL-10) ──
1143
+ read("fleet_ports_list", "view", "FL-10", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1144
+ route: GET("/api/fleet/nodes/{id}/ports"),
1145
+ cli: "fleet ports list"
1146
+ }),
1147
+ act("fleet_ports_open", "ports", "FL-10", "FLEET_MACHINE_FACTS_ENABLED", "live", plain("machine.run"), {
1148
+ route: POST("/api/fleet/nodes/{id}/ports/{port}/open"),
1149
+ cli: "fleet ports open"
1150
+ }),
1151
+ act("fleet_ports_preview_open", "ports", "FL-10", "FLEET_PORT_TUNNEL_ENABLED", "live", plain("machine.run"), {
1152
+ route: POST("/api/fleet/nodes/{id}/ports/{port}/preview"),
1153
+ cli: "fleet ports preview"
1154
+ }),
1155
+ act("fleet_ports_preview_close", "ports", "FL-10", "FLEET_PORT_TUNNEL_ENABLED", "live", plain("machine.run"), {
1156
+ route: DELETE("/api/fleet/nodes/{id}/ports/{port}/preview"),
1157
+ cli: "fleet ports preview-close"
1158
+ }),
1159
+ // ── files (FL-11) ──
1160
+ // P1 (FL-11 lane log decision 15): the roots read joins the family, and the list's route is the
1161
+ // one FL-11 built (`…/files/list` — `…/files` is the family's prefix, not a route).
1162
+ read("fleet_files_roots", "files", "FL-11", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1163
+ route: GET("/api/fleet/nodes/{id}/files/roots"),
1164
+ cli: "fleet files roots"
1165
+ }),
1166
+ read("fleet_files_list", "files", "FL-11", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1167
+ route: GET("/api/fleet/nodes/{id}/files/list"),
1168
+ cli: "fleet files list"
1169
+ }),
1170
+ read("fleet_files_stat", "files", "FL-11", "FLEET_MACHINE_FACTS_ENABLED", "live", {
1171
+ route: GET("/api/fleet/nodes/{id}/files/stat"),
1172
+ cli: "fleet files stat"
1173
+ }),
1174
+ read("fleet_files_read", "files", "FL-11", "FLEET_MACHINE_FACTS_ENABLED", "planned", {
1175
+ route: GET("/api/fleet/nodes/{id}/files/download"),
1176
+ cli: "fleet files get"
1177
+ }),
1178
+ act("fleet_files_write", "files", "FL-11", "FLEET_MACHINE_FACTS_ENABLED", "planned", confirm("machine.admin"), {
1179
+ route: POST("/api/fleet/nodes/{id}/files/upload"),
1180
+ cli: "fleet files put"
1181
+ }),
1182
+ act("fleet_files_copy", "files", "FL-11", "FLEET_MACHINE_FACTS_ENABLED", "live", confirm("machine.admin"), {
1183
+ route: POST("/api/fleet/nodes/{id}/files/copy"),
1184
+ cli: "fleet files cp",
1185
+ // FL-11 P2 (lane log decision 18): an Agent's copy is held for a person, like its delete.
1186
+ alwaysHeld: true
1187
+ }),
1188
+ act("fleet_files_delete", "files", "FL-11", "FLEET_MACHINE_FACTS_ENABLED", "live", typed("write.destructive"), {
1189
+ route: POST("/api/fleet/nodes/{id}/files/delete"),
1190
+ cli: "fleet files rm",
1191
+ alwaysHeld: true
1192
+ }),
1193
+ // ── commands (FL-12) ──
1194
+ read("fleet_commands_list", "commands", "FL-12", "FLEET_COMMANDS_ENABLED", "live", {
1195
+ route: GET("/api/fleet/commands"),
1196
+ cli: "fleet commands list"
1197
+ }),
1198
+ read("fleet_commands_get", "commands", "FL-12", "FLEET_COMMANDS_ENABLED", "live", {
1199
+ route: GET("/api/fleet/commands/{id}"),
1200
+ cli: "fleet commands get"
1201
+ }),
1202
+ act("fleet_commands_run", "commands", "FL-12", "FLEET_COMMANDS_ENABLED", "live", confirm("machine.run"), {
1203
+ route: POST("/api/fleet/commands"),
1204
+ cli: "fleet commands run",
1205
+ alwaysHeld: true
1206
+ }),
1207
+ act("fleet_commands_cancel", "commands", "FL-12", "FLEET_COMMANDS_ENABLED", "live", plain("machine.run"), {
1208
+ route: POST("/api/fleet/commands/{id}/cancel"),
1209
+ cli: "fleet commands cancel"
1210
+ }),
1211
+ // ── schedules (FL-13 P2: live — `apps/api/src/fleet/schedules/fleet-schedules.controller.ts`) ──
1212
+ read("fleet_schedules_list", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", {
1213
+ route: GET("/api/fleet/schedules"),
1214
+ cli: "fleet schedules list"
1215
+ }),
1216
+ read("fleet_schedules_get", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", {
1217
+ route: GET("/api/fleet/schedules/{id}"),
1218
+ cli: "fleet schedules get"
1219
+ }),
1220
+ read("fleet_schedules_runs", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", {
1221
+ route: GET("/api/fleet/schedules/{id}/runs"),
1222
+ cli: "fleet schedules runs"
1223
+ }),
1224
+ act("fleet_schedules_create", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", confirm("agent.fanout"), {
1225
+ route: POST("/api/fleet/schedules"),
1226
+ cli: "fleet schedules create"
1227
+ }),
1228
+ act("fleet_schedules_update", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", confirm("agent.fanout"), {
1229
+ route: PATCH("/api/fleet/schedules/{id}"),
1230
+ cli: "fleet schedules update"
1231
+ }),
1232
+ act(
1233
+ "fleet_schedules_delete",
1234
+ "schedules",
1235
+ "FL-13",
1236
+ "FLEET_COMMANDS_ENABLED",
1237
+ "live",
1238
+ confirm("write.destructive"),
1239
+ { route: DELETE("/api/fleet/schedules/{id}"), cli: "fleet schedules delete" }
1240
+ ),
1241
+ act("fleet_schedules_run", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", confirm("machine.run"), {
1242
+ route: POST("/api/fleet/schedules/{id}/run"),
1243
+ cli: "fleet schedules run"
1244
+ }),
1245
+ act("fleet_schedules_pause", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", plain("agent.fanout"), {
1246
+ route: POST("/api/fleet/schedules/{id}/pause"),
1247
+ cli: "fleet schedules pause"
1248
+ }),
1249
+ act("fleet_schedules_resume", "schedules", "FL-13", "FLEET_COMMANDS_ENABLED", "live", plain("agent.fanout"), {
1250
+ route: POST("/api/fleet/schedules/{id}/resume"),
1251
+ cli: "fleet schedules resume"
1252
+ }),
1253
+ // ── checkouts (FL-14, FL-06) ──
1254
+ read("fleet_checkouts_list", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", {
1255
+ route: GET("/api/fleet/checkouts"),
1256
+ cli: "fleet checkouts list"
1257
+ }),
1258
+ read("fleet_checkouts_get", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", {
1259
+ route: GET("/api/fleet/checkouts/{id}"),
1260
+ cli: "fleet checkouts get"
1261
+ }),
1262
+ read("fleet_checkouts_changes", "checkouts", "FL-06", "FLEET_CHECKOUTS_ENABLED", "planned", {
1263
+ route: GET("/api/fleet/checkouts/{id}/changes"),
1264
+ cli: "fleet checkouts changes"
1265
+ }),
1266
+ act("fleet_checkouts_create", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
1267
+ route: POST("/api/fleet/checkouts"),
1268
+ cli: "fleet checkouts create",
1269
+ waitable: true
1270
+ }),
1271
+ act("fleet_checkouts_sync", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
1272
+ route: POST("/api/fleet/checkouts/{id}/sync"),
1273
+ cli: "fleet checkouts sync",
1274
+ waitable: true,
1275
+ confirmationNote: "plain for fetch; confirm for pull and push"
1276
+ }),
1277
+ act(
1278
+ "fleet_checkouts_archive",
1279
+ "checkouts",
1280
+ "FL-14",
1281
+ "FLEET_CHECKOUTS_ENABLED",
1282
+ "live",
1283
+ confirm("machine.run", false),
1284
+ { route: POST("/api/fleet/checkouts/{id}/archive"), cli: "fleet checkouts archive" }
1285
+ ),
1286
+ act(
1287
+ "fleet_checkouts_delete",
1288
+ "checkouts",
1289
+ "FL-14",
1290
+ "FLEET_CHECKOUTS_ENABLED",
1291
+ "live",
1292
+ confirm("write.destructive"),
1293
+ {
1294
+ route: DELETE("/api/fleet/checkouts/{id}"),
1295
+ cli: "fleet checkouts delete",
1296
+ confirmationNote: "confirm; confirm-destructive when it has uncommitted changes"
1297
+ }
1298
+ ),
1299
+ act(
1300
+ "fleet_checkouts_open_pull_request",
1301
+ "checkouts",
1302
+ "FL-06",
1303
+ "FLEET_CHECKOUTS_ENABLED",
1304
+ "planned",
1305
+ plain("publish.external"),
1306
+ { route: POST("/api/fleet/checkouts/{id}/pull-request"), cli: "fleet checkouts pull-request" }
1307
+ ),
1308
+ // ── tasks (FL-15) ── the hand-off itself is `fleet_sessions_start` with `taskId`
1309
+ read("fleet_tasks_handoff_options", "sessions", "FL-15", "FLEET_CHECKOUTS_ENABLED", "live", {
1310
+ route: GET("/api/fleet/tasks/{taskId}/handoff-options"),
1311
+ cli: "fleet tasks handoff-options"
1312
+ }),
1313
+ // ── virtual (FL-16) ── P1 shipped: Containers. A create, a stop and a destroy are held for
1314
+ // the owner's approval by the Agent tools (`agent-fleet-virtual-tools.ts`).
1315
+ read("fleet_virtual_list", "view", "FL-16", "FLEET_VIRTUAL_ENABLED", "live", {
1316
+ phase: "P3",
1317
+ route: GET("/api/fleet/nodes/{id}/virtual"),
1318
+ cli: "fleet virtual list"
1319
+ }),
1320
+ read("fleet_virtual_options", "view", "FL-16", "FLEET_VIRTUAL_ENABLED", "live", {
1321
+ phase: "P3",
1322
+ route: GET("/api/fleet/nodes/{id}/virtual/options"),
1323
+ cli: "fleet virtual options"
1324
+ }),
1325
+ act("fleet_virtual_create", "machines", "FL-16", "FLEET_VIRTUAL_ENABLED", "live", confirm("machine.admin"), {
1326
+ phase: "P3",
1327
+ route: POST("/api/fleet/nodes/{id}/virtual"),
1328
+ cli: "fleet virtual create",
1329
+ waitable: true,
1330
+ alwaysHeld: true
1331
+ }),
1332
+ act("fleet_virtual_power", "machines", "FL-16", "FLEET_VIRTUAL_ENABLED", "live", confirm("machine.admin"), {
1333
+ phase: "P3",
1334
+ route: POST("/api/fleet/nodes/{id}/virtual/{childId}/power"),
1335
+ cli: "fleet virtual power",
1336
+ waitable: true,
1337
+ confirmationNote: "plain to start; confirm to stop (an Agent's stop is held for the owner)"
1338
+ }),
1339
+ act("fleet_virtual_destroy", "machines", "FL-16", "FLEET_VIRTUAL_ENABLED", "live", typed("write.destructive"), {
1340
+ phase: "P3",
1341
+ route: POST("/api/fleet/nodes/{id}/virtual/{childId}/destroy"),
1342
+ cli: "fleet virtual destroy",
1343
+ waitable: true,
1344
+ alwaysHeld: true
1345
+ }),
1346
+ // ── cloud (FL-17) ── P1 shipped: providers, create, power, destroy, usage. A create, a power
1347
+ // change and a destroy are held for the owner's approval by the Agent tools
1348
+ // (`agent-fleet-cloud-tools.ts`); the idle policy arrives with P2.
1349
+ read("fleet_cloud_list", "view", "FL-17", "FLEET_CLOUD_ENABLED", "live", {
1350
+ phase: "P3",
1351
+ route: GET("/api/fleet/cloud"),
1352
+ cli: "fleet cloud list"
1353
+ }),
1354
+ read("fleet_cloud_options", "view", "FL-17", "FLEET_CLOUD_ENABLED", "live", {
1355
+ phase: "P3",
1356
+ route: GET("/api/fleet/providers/{plugin}/options"),
1357
+ cli: "fleet cloud options"
1358
+ }),
1359
+ read("fleet_cloud_usage", "view", "FL-17", "FLEET_CLOUD_ENABLED", "live", {
1360
+ phase: "P3",
1361
+ route: GET("/api/fleet/cloud/usage"),
1362
+ cli: "fleet cloud usage"
1363
+ }),
1364
+ act("fleet_cloud_create", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "live", confirm("spend.metered"), {
1365
+ phase: "P3",
1366
+ route: POST("/api/fleet/cloud"),
1367
+ cli: "fleet cloud create",
1368
+ waitable: true,
1369
+ alwaysHeld: true,
1370
+ confirmationNote: "confirm with the price (acknowledgedPriceCents); also machine.admin"
1371
+ }),
1372
+ act("fleet_cloud_power", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "live", confirm("machine.admin"), {
1373
+ phase: "P3",
1374
+ route: POST("/api/fleet/cloud/{id}/power"),
1375
+ cli: "fleet cloud power",
1376
+ waitable: true,
1377
+ alwaysHeld: true
1378
+ }),
1379
+ act("fleet_cloud_destroy", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "live", typed("write.destructive"), {
1380
+ phase: "P3",
1381
+ // FL-17 plan §5 — `DELETE /api/fleet/cloud/{id}` answers the same (an alias).
1382
+ route: POST("/api/fleet/cloud/{id}/destroy"),
1383
+ cli: "fleet cloud destroy",
1384
+ waitable: true,
1385
+ alwaysHeld: true
1386
+ }),
1387
+ act("fleet_cloud_idle_policy", "machines", "FL-17", "FLEET_CLOUD_ENABLED", "planned", plain("machine.admin"), {
1388
+ phase: "P3",
1389
+ route: PATCH("/api/fleet/cloud/{id}/idle-policy"),
1390
+ cli: "fleet cloud idle-policy"
1391
+ }),
1392
+ // ── runners (FL-18) ──
1393
+ read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "planned", {
1394
+ phase: "P3",
1395
+ route: GET("/api/fleet/nodes/{id}/runners"),
1396
+ cli: "fleet runners list"
1397
+ }),
1398
+ read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "planned", {
1399
+ phase: "P3",
1400
+ route: GET("/api/fleet/runners/jobs"),
1401
+ cli: "fleet runners jobs"
1402
+ }),
1403
+ act(
1404
+ "fleet_runners_install",
1405
+ "machines",
1406
+ "FL-18",
1407
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1408
+ "planned",
1409
+ confirm("machine.admin"),
1410
+ { phase: "P3", route: POST("/api/fleet/nodes/{id}/runners"), cli: "fleet runners install", waitable: true }
1411
+ ),
1412
+ act(
1413
+ "fleet_runners_action",
1414
+ "machines",
1415
+ "FL-18",
1416
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1417
+ "planned",
1418
+ confirm("machine.admin"),
1419
+ {
1420
+ phase: "P3",
1421
+ route: POST("/api/fleet/nodes/{id}/runners/{runnerId}/{action}"),
1422
+ cli: "fleet runners action",
1423
+ waitable: true,
1424
+ confirmationNote: "plain to start; confirm to stop and restart"
1425
+ }
1426
+ ),
1427
+ act(
1428
+ "fleet_runners_remove",
1429
+ "machines",
1430
+ "FL-18",
1431
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1432
+ "planned",
1433
+ typed("write.destructive"),
1434
+ { phase: "P3", route: DELETE("/api/fleet/nodes/{id}/runners/{runnerId}"), cli: "fleet runners remove" }
1435
+ ),
1436
+ act(
1437
+ "fleet_runners_cancel_run",
1438
+ "machines",
1439
+ "FL-18",
1440
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1441
+ "planned",
1442
+ confirm("machine.admin"),
1443
+ { phase: "P3", route: POST("/api/fleet/runners/jobs/{jobId}/cancel"), cli: "fleet runners cancel-run" }
1444
+ ),
1445
+ // ── usage (FL-20) ──
1446
+ read("fleet_usage_get", "view", "FL-20", "FLEET_USAGE_SCAN_ENABLED", "planned", {
1447
+ route: GET("/api/fleet/usage"),
1448
+ cli: "fleet usage"
1449
+ }),
1450
+ // ── operations (FL-02, FL-19) ──
1451
+ read("fleet_operations_get", "view", "FL-02", "FLEET_NODE_LINK_ENABLED", "live", {
1452
+ route: GET("/api/fleet/operations/{id}"),
1453
+ cli: "fleet operations get"
1454
+ }),
1455
+ read("fleet_operations_list", "view", "FL-19", "FLEET_NODE_LINK_ENABLED", "live", {
1456
+ route: GET("/api/fleet/operations"),
1457
+ cli: "fleet operations list"
1458
+ }),
1459
+ act("fleet_operations_cancel", "view", "FL-02", "FLEET_NODE_LINK_ENABLED", "live", plain("machine.run"), {
1460
+ route: DELETE("/api/fleet/operations/{id}"),
1461
+ cli: "fleet operations cancel"
1462
+ })
1463
+ ]);
1464
+ new Map(
1465
+ FLEET_TOOL_CATALOGUE.map((entry) => [entry.name, entry])
1466
+ );
1467
+ var FLEET_VIRTUAL_SYSTEMS = [
1468
+ {
1469
+ id: "windows-11",
1470
+ kind: "vm",
1471
+ label: "Windows 11",
1472
+ family: "windows",
1473
+ arch: ["x64"],
1474
+ windowsEdition: "11",
1475
+ approxDiskGiB: 64,
1476
+ approxDownloadGiB: 6
1477
+ },
1478
+ {
1479
+ id: "windows-10",
1480
+ kind: "vm",
1481
+ label: "Windows 10",
1482
+ family: "windows",
1483
+ arch: ["x64"],
1484
+ windowsEdition: "10",
1485
+ approxDiskGiB: 64,
1486
+ approxDownloadGiB: 6
1487
+ },
1488
+ {
1489
+ id: "windows-server-2025",
1490
+ kind: "vm",
1491
+ label: "Windows Server 2025",
1492
+ family: "windows",
1493
+ arch: ["x64"],
1494
+ windowsEdition: "2025",
1495
+ approxDiskGiB: 64,
1496
+ approxDownloadGiB: 6
1497
+ },
1498
+ {
1499
+ id: "windows-server-2022",
1500
+ kind: "vm",
1501
+ label: "Windows Server 2022",
1502
+ family: "windows",
1503
+ arch: ["x64"],
1504
+ windowsEdition: "2022",
1505
+ approxDiskGiB: 64,
1506
+ approxDownloadGiB: 6
1507
+ },
1508
+ {
1509
+ id: "ubuntu-26.04",
1510
+ kind: "container",
1511
+ label: "Ubuntu 26.04",
1512
+ family: "ubuntu",
1513
+ arch: ["x64", "arm64"],
1514
+ approxDiskGiB: 3,
1515
+ approxDownloadGiB: 0.5
1516
+ },
1517
+ {
1518
+ id: "ubuntu-24.04",
1519
+ kind: "container",
1520
+ label: "Ubuntu 24.04",
1521
+ family: "ubuntu",
1522
+ arch: ["x64", "arm64"],
1523
+ approxDiskGiB: 3,
1524
+ approxDownloadGiB: 0.5
1525
+ },
1526
+ {
1527
+ id: "debian-13",
1528
+ kind: "container",
1529
+ label: "Debian 13",
1530
+ family: "debian",
1531
+ arch: ["x64", "arm64"],
1532
+ approxDiskGiB: 3,
1533
+ approxDownloadGiB: 0.5
1534
+ },
1535
+ {
1536
+ id: "fedora",
1537
+ kind: "container",
1538
+ label: "Fedora",
1539
+ family: "fedora",
1540
+ arch: ["x64", "arm64"],
1541
+ approxDiskGiB: 3,
1542
+ approxDownloadGiB: 0.6
1543
+ },
1544
+ {
1545
+ id: "alpine",
1546
+ kind: "container",
1547
+ label: "Alpine",
1548
+ family: "alpine",
1549
+ arch: ["x64", "arm64"],
1550
+ approxDiskGiB: 1,
1551
+ approxDownloadGiB: 0.2
1552
+ },
1553
+ {
1554
+ // Arch Linux publishes no official arm64 image (FR-6).
1555
+ id: "arch",
1556
+ kind: "container",
1557
+ label: "Arch Linux",
1558
+ family: "arch",
1559
+ arch: ["x64"],
1560
+ approxDiskGiB: 3,
1561
+ approxDownloadGiB: 0.7
1562
+ }
1563
+ ];
1564
+ FLEET_VIRTUAL_SYSTEMS.map((system) => system.id);
822
1565
  var EMAIL_INBOX_CAP_FIELDS = [
823
1566
  "inboxDailySends",
824
1567
  "inboxBurstSends",