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

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