@ever-works/everworks-playbooks-plugin 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +779 -20
  2. package/dist/index.js +779 -20
  3. package/package.json +6 -6
package/dist/index.cjs 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,721 @@ 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; P2 the idle policy
1348
+ // (`PUT` answers the same as `PATCH`). A create, a power change and a destroy are held for the
1349
+ // owner's approval by the Agent tools (`agent-fleet-cloud-tools.ts`).
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", "live", 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) ── P1 shipped: list, install, start / stop / restart, remove. An install, a
1394
+ // stop, a restart and a remove asked by an Agent are held for the owner's approval
1395
+ // (`agent-fleet-runners-tools.ts`). The Actions jobs read and Cancel workflow run arrive with P2.
1396
+ read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
1397
+ phase: "P3",
1398
+ route: GET("/api/fleet/nodes/{id}/runners"),
1399
+ cli: "fleet runners list"
1400
+ }),
1401
+ read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "planned", {
1402
+ phase: "P3",
1403
+ route: GET("/api/fleet/runners/jobs"),
1404
+ cli: "fleet runners jobs"
1405
+ }),
1406
+ act(
1407
+ "fleet_runners_install",
1408
+ "machines",
1409
+ "FL-18",
1410
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1411
+ "live",
1412
+ confirm("machine.admin"),
1413
+ {
1414
+ phase: "P3",
1415
+ route: POST("/api/fleet/nodes/{id}/runners"),
1416
+ cli: "fleet runners install",
1417
+ waitable: true,
1418
+ alwaysHeld: true
1419
+ }
1420
+ ),
1421
+ act(
1422
+ "fleet_runners_action",
1423
+ "machines",
1424
+ "FL-18",
1425
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1426
+ "live",
1427
+ confirm("machine.admin"),
1428
+ {
1429
+ phase: "P3",
1430
+ route: POST("/api/fleet/nodes/{id}/runners/{runnerId}/{action}"),
1431
+ cli: "fleet runners action",
1432
+ waitable: true,
1433
+ confirmationNote: "plain to start; confirm to stop and restart (an Agent's stop or restart is held for the owner)"
1434
+ }
1435
+ ),
1436
+ act(
1437
+ "fleet_runners_remove",
1438
+ "machines",
1439
+ "FL-18",
1440
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1441
+ "live",
1442
+ typed("write.destructive"),
1443
+ {
1444
+ phase: "P3",
1445
+ route: POST("/api/fleet/nodes/{id}/runners/{runnerId}/remove"),
1446
+ cli: "fleet runners remove",
1447
+ waitable: true,
1448
+ alwaysHeld: true
1449
+ }
1450
+ ),
1451
+ act(
1452
+ "fleet_runners_cancel_run",
1453
+ "machines",
1454
+ "FL-18",
1455
+ "FLEET_ACTIONS_RUNNERS_ENABLED",
1456
+ "planned",
1457
+ confirm("machine.admin"),
1458
+ { phase: "P3", route: POST("/api/fleet/runners/jobs/cancel"), cli: "fleet runners cancel-run" }
1459
+ ),
1460
+ // ── usage (FL-20) ── P1 shipped: the Usage object (totals, by model, by computer, busiest
1461
+ // checkouts, sessions) every surface renders, read-only, with the payer sentence in `note`.
1462
+ read("fleet_usage_get", "view", "FL-20", "FLEET_USAGE_SCAN_ENABLED", "live", {
1463
+ phase: "P3",
1464
+ route: GET("/api/fleet/usage"),
1465
+ cli: "fleet usage"
1466
+ }),
1467
+ // ── operations (FL-02, FL-19) ──
1468
+ read("fleet_operations_get", "view", "FL-02", "FLEET_NODE_LINK_ENABLED", "live", {
1469
+ route: GET("/api/fleet/operations/{id}"),
1470
+ cli: "fleet operations get"
1471
+ }),
1472
+ read("fleet_operations_list", "view", "FL-19", "FLEET_NODE_LINK_ENABLED", "live", {
1473
+ route: GET("/api/fleet/operations"),
1474
+ cli: "fleet operations list"
1475
+ }),
1476
+ act("fleet_operations_cancel", "view", "FL-02", "FLEET_NODE_LINK_ENABLED", "live", plain("machine.run"), {
1477
+ route: DELETE("/api/fleet/operations/{id}"),
1478
+ cli: "fleet operations cancel"
1479
+ })
1480
+ ]);
1481
+ new Map(
1482
+ FLEET_TOOL_CATALOGUE.map((entry) => [entry.name, entry])
1483
+ );
1484
+ var FLEET_VIRTUAL_SYSTEMS = [
1485
+ {
1486
+ id: "windows-11",
1487
+ kind: "vm",
1488
+ label: "Windows 11",
1489
+ family: "windows",
1490
+ arch: ["x64"],
1491
+ windowsEdition: "11",
1492
+ approxDiskGiB: 64,
1493
+ approxDownloadGiB: 6
1494
+ },
1495
+ {
1496
+ id: "windows-10",
1497
+ kind: "vm",
1498
+ label: "Windows 10",
1499
+ family: "windows",
1500
+ arch: ["x64"],
1501
+ windowsEdition: "10",
1502
+ approxDiskGiB: 64,
1503
+ approxDownloadGiB: 6
1504
+ },
1505
+ {
1506
+ id: "windows-server-2025",
1507
+ kind: "vm",
1508
+ label: "Windows Server 2025",
1509
+ family: "windows",
1510
+ arch: ["x64"],
1511
+ windowsEdition: "2025",
1512
+ approxDiskGiB: 64,
1513
+ approxDownloadGiB: 6
1514
+ },
1515
+ {
1516
+ id: "windows-server-2022",
1517
+ kind: "vm",
1518
+ label: "Windows Server 2022",
1519
+ family: "windows",
1520
+ arch: ["x64"],
1521
+ windowsEdition: "2022",
1522
+ approxDiskGiB: 64,
1523
+ approxDownloadGiB: 6
1524
+ },
1525
+ {
1526
+ id: "ubuntu-26.04",
1527
+ kind: "container",
1528
+ label: "Ubuntu 26.04",
1529
+ family: "ubuntu",
1530
+ arch: ["x64", "arm64"],
1531
+ approxDiskGiB: 3,
1532
+ approxDownloadGiB: 0.5
1533
+ },
1534
+ {
1535
+ id: "ubuntu-24.04",
1536
+ kind: "container",
1537
+ label: "Ubuntu 24.04",
1538
+ family: "ubuntu",
1539
+ arch: ["x64", "arm64"],
1540
+ approxDiskGiB: 3,
1541
+ approxDownloadGiB: 0.5
1542
+ },
1543
+ {
1544
+ id: "debian-13",
1545
+ kind: "container",
1546
+ label: "Debian 13",
1547
+ family: "debian",
1548
+ arch: ["x64", "arm64"],
1549
+ approxDiskGiB: 3,
1550
+ approxDownloadGiB: 0.5
1551
+ },
1552
+ {
1553
+ id: "fedora",
1554
+ kind: "container",
1555
+ label: "Fedora",
1556
+ family: "fedora",
1557
+ arch: ["x64", "arm64"],
1558
+ approxDiskGiB: 3,
1559
+ approxDownloadGiB: 0.6
1560
+ },
1561
+ {
1562
+ id: "alpine",
1563
+ kind: "container",
1564
+ label: "Alpine",
1565
+ family: "alpine",
1566
+ arch: ["x64", "arm64"],
1567
+ approxDiskGiB: 1,
1568
+ approxDownloadGiB: 0.2
1569
+ },
1570
+ {
1571
+ // Arch Linux publishes no official arm64 image (FR-6).
1572
+ id: "arch",
1573
+ kind: "container",
1574
+ label: "Arch Linux",
1575
+ family: "arch",
1576
+ arch: ["x64"],
1577
+ approxDiskGiB: 3,
1578
+ approxDownloadGiB: 0.7
1579
+ }
1580
+ ];
1581
+ FLEET_VIRTUAL_SYSTEMS.map((system) => system.id);
823
1582
  var WORKFLOW_EDGE_KINDS = [
824
1583
  "sequential",
825
1584
  "on_failure",
@@ -877,9 +1636,9 @@ function validateWorkflowGraph(graph) {
877
1636
  if (!nodeIds.has(edge.from)) errors.push(`edge "${edge.id}" leaves unknown node "${edge.from}"`);
878
1637
  if (!nodeIds.has(edge.to)) errors.push(`edge "${edge.id}" points at unknown node "${edge.to}"`);
879
1638
  if (edge.kind === "sequential") {
880
- const count = (sequentialBySource.get(edge.from) ?? 0) + 1;
881
- sequentialBySource.set(edge.from, count);
882
- if (count === 2) {
1639
+ const count5 = (sequentialBySource.get(edge.from) ?? 0) + 1;
1640
+ sequentialBySource.set(edge.from, count5);
1641
+ if (count5 === 2) {
883
1642
  errors.push(
884
1643
  `node "${edge.from}" has more than one sequential edge \u2014 use conditional or llm_decide to branch`
885
1644
  );
@@ -902,9 +1661,9 @@ function validateWorkflowGraph(graph) {
902
1661
  choicesBySource.set(edge.from, choices);
903
1662
  }
904
1663
  if (edge.fallback) {
905
- const count = (fallbacksBySource.get(edge.from) ?? 0) + 1;
906
- fallbacksBySource.set(edge.from, count);
907
- if (count === 2) {
1664
+ const count5 = (fallbacksBySource.get(edge.from) ?? 0) + 1;
1665
+ fallbacksBySource.set(edge.from, count5);
1666
+ if (count5 === 2) {
908
1667
  errors.push(`node "${edge.from}" has more than one llm_decide fallback arm`);
909
1668
  }
910
1669
  }
@@ -949,7 +1708,7 @@ var PLAYBOOK_MIN_STEPS = 2;
949
1708
  var PLAYBOOK_MAX_STEPS = 8;
950
1709
  var PLAYBOOK_CAP_KEYS = ["maxPerRun", "maxSourcesTracked", "maxWordCount", "maxDecisionsPerRun"];
951
1710
  var PLAYBOOK_CAP_MAX = 1e5;
952
- function isRecord6(value) {
1711
+ function isRecord7(value) {
953
1712
  return typeof value === "object" && value !== null && !Array.isArray(value);
954
1713
  }
955
1714
  function isNonEmptyString(value, max) {
@@ -959,7 +1718,7 @@ function isOneOf2(value, allowed) {
959
1718
  return typeof value === "string" && allowed.includes(value);
960
1719
  }
961
1720
  function validateGuardrailsShape(value, path) {
962
- if (!isRecord6(value)) return `${path} must be an object`;
1721
+ if (!isRecord7(value)) return `${path} must be an object`;
963
1722
  if (!isOneOf2(value.mode, PLAYBOOK_GUARDRAIL_MODES)) return `${path}.mode is not a known guardrail mode`;
964
1723
  for (const key of ["autoApproveActionTypes", "blockedActionTypes"]) {
965
1724
  const list = value[key];
@@ -974,7 +1733,7 @@ function isFiniteNonNegative(value) {
974
1733
  return typeof value === "number" && Number.isFinite(value) && value >= 0;
975
1734
  }
976
1735
  function validateCapsShape(value) {
977
- if (!isRecord6(value)) return "caps must be an object";
1736
+ if (!isRecord7(value)) return "caps must be an object";
978
1737
  for (const key of PLAYBOOK_CAP_KEYS) {
979
1738
  const cap = value[key];
980
1739
  if (cap === void 0) continue;
@@ -985,14 +1744,14 @@ function validateCapsShape(value) {
985
1744
  return null;
986
1745
  }
987
1746
  function validateProvisionGraph(value) {
988
- if (!isRecord6(value)) return "provision.workflowGraph must be an object";
1747
+ if (!isRecord7(value)) return "provision.workflowGraph must be an object";
989
1748
  if (!Array.isArray(value.nodes)) return "provision.workflowGraph.nodes must be a list";
990
1749
  if (!Array.isArray(value.edges)) return "provision.workflowGraph.edges must be a list";
991
1750
  const { valid, errors } = validateWorkflowGraph(value);
992
1751
  return valid ? null : `provision.workflowGraph is invalid: ${errors[0] ?? "unknown error"}`;
993
1752
  }
994
1753
  function validatePlaybookEntry(value) {
995
- if (!isRecord6(value)) return "entry must be an object";
1754
+ if (!isRecord7(value)) return "entry must be an object";
996
1755
  if (typeof value.slug !== "string" || !PLAYBOOK_SLUG_PATTERN.test(value.slug)) {
997
1756
  return "slug must match ^[a-z0-9][a-z0-9-]{0,63}$";
998
1757
  }
@@ -1008,11 +1767,11 @@ function validatePlaybookEntry(value) {
1008
1767
  if (typeof value.icon !== "string") return "icon must be a string";
1009
1768
  if (!isOneOf2(value.costBand, PLAYBOOK_COST_BANDS)) return "costBand is not a known cost band";
1010
1769
  const estimate = value.estimatedTokensPerRun;
1011
- if (!isRecord6(estimate) || !isFiniteNonNegative(estimate.min) || !isFiniteNonNegative(estimate.max) || estimate.max < estimate.min) {
1770
+ if (!isRecord7(estimate) || !isFiniteNonNegative(estimate.min) || !isFiniteNonNegative(estimate.max) || estimate.max < estimate.min) {
1012
1771
  return "estimatedTokensPerRun must be { min, max } with 0 <= min <= max";
1013
1772
  }
1014
1773
  const trigger = value.trigger;
1015
- if (!isRecord6(trigger)) return "trigger must be an object";
1774
+ if (!isRecord7(trigger)) return "trigger must be an object";
1016
1775
  if (!isOneOf2(trigger.kind, PLAYBOOK_TRIGGER_KINDS)) return "trigger.kind is not a known trigger kind";
1017
1776
  if (!isNonEmptyString(trigger.description, PLAYBOOK_TEXT_LIMITS.shortText)) {
1018
1777
  return "trigger.description must be 1-200 characters";
@@ -1022,7 +1781,7 @@ function validatePlaybookEntry(value) {
1022
1781
  return "steps must hold between 2 and 8 steps";
1023
1782
  }
1024
1783
  for (const [index, step] of steps2.entries()) {
1025
- if (!isRecord6(step)) return `steps[${index}] must be an object`;
1784
+ if (!isRecord7(step)) return `steps[${index}] must be an object`;
1026
1785
  if (!isNonEmptyString(step.title, PLAYBOOK_TEXT_LIMITS.stepTitle)) {
1027
1786
  return `steps[${index}].title must be 1-120 characters`;
1028
1787
  }
@@ -1034,7 +1793,7 @@ function validatePlaybookEntry(value) {
1034
1793
  const connections = value.connections;
1035
1794
  if (!Array.isArray(connections)) return "connections must be a list";
1036
1795
  for (const [index, need] of connections.entries()) {
1037
- if (!isRecord6(need)) return `connections[${index}] must be an object`;
1796
+ if (!isRecord7(need)) return `connections[${index}] must be an object`;
1038
1797
  if (!isNonEmptyString(need.capability, 64)) return `connections[${index}].capability must be a capability name`;
1039
1798
  if (typeof need.required !== "boolean") return `connections[${index}].required must be a boolean`;
1040
1799
  if (!isNonEmptyString(need.reason, PLAYBOOK_TEXT_LIMITS.reason)) {
@@ -1044,14 +1803,14 @@ function validatePlaybookEntry(value) {
1044
1803
  const artefacts = value.artefacts;
1045
1804
  if (!Array.isArray(artefacts)) return "artefacts must be a list";
1046
1805
  for (const [index, artefact] of artefacts.entries()) {
1047
- if (!isRecord6(artefact) || !isOneOf2(artefact.kind, PLAYBOOK_ARTEFACT_KINDS)) {
1806
+ if (!isRecord7(artefact) || !isOneOf2(artefact.kind, PLAYBOOK_ARTEFACT_KINDS)) {
1048
1807
  return `artefacts[${index}].kind is not a known artefact kind`;
1049
1808
  }
1050
1809
  }
1051
1810
  const escalations = value.escalations;
1052
1811
  if (!Array.isArray(escalations)) return "escalations must be a list";
1053
1812
  for (const [index, point] of escalations.entries()) {
1054
- if (!isRecord6(point) || !isOneOf2(point.becomes, PLAYBOOK_ESCALATION_TARGETS)) {
1813
+ if (!isRecord7(point) || !isOneOf2(point.becomes, PLAYBOOK_ESCALATION_TARGETS)) {
1055
1814
  return `escalations[${index}].becomes must be approval or escalation`;
1056
1815
  }
1057
1816
  }
@@ -1061,14 +1820,14 @@ function validatePlaybookEntry(value) {
1061
1820
  return "tags must be a list of strings";
1062
1821
  }
1063
1822
  const provision = value.provision;
1064
- if (!isRecord6(provision)) return "provision must be an object";
1823
+ if (!isRecord7(provision)) return "provision must be an object";
1065
1824
  if (!isNonEmptyString(provision.agentTemplateSlug, 64)) return "provision.agentTemplateSlug is required";
1066
1825
  if (!isNonEmptyString(provision.agentName, PLAYBOOK_TEXT_LIMITS.shortText))
1067
1826
  return "provision.agentName is required";
1068
1827
  if (!Array.isArray(provision.skillSlugs) || provision.skillSlugs.some((slug) => typeof slug !== "string")) {
1069
1828
  return "provision.skillSlugs must be a list of skill slugs";
1070
1829
  }
1071
- if (!isRecord6(provision.taskTemplate) || !isNonEmptyString(provision.taskTemplate.name, PLAYBOOK_TEXT_LIMITS.title)) {
1830
+ if (!isRecord7(provision.taskTemplate) || !isNonEmptyString(provision.taskTemplate.name, PLAYBOOK_TEXT_LIMITS.title)) {
1072
1831
  return "provision.taskTemplate.name is required";
1073
1832
  }
1074
1833
  const guardrailsError = validateGuardrailsShape(provision.guardrailsAtAdoption, "provision.guardrailsAtAdoption");
@@ -1107,7 +1866,7 @@ function sanitizePlaybookText(value, max) {
1107
1866
  return value.replace(HTML_TAG_PATTERN, "").trim().slice(0, max);
1108
1867
  }
1109
1868
  function acceptPlaybookEntry(value) {
1110
- if (!isRecord6(value)) return { entry: null, violation: "entry must be an object" };
1869
+ if (!isRecord7(value)) return { entry: null, violation: "entry must be an object" };
1111
1870
  let sanitized;
1112
1871
  try {
1113
1872
  sanitized = sanitizePlaybookEntry(value);