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