@ever-works/mailgun-plugin 1.0.9 → 1.0.11

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