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