agentbnb 5.1.11 → 7.0.0-beta.1

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 (60) hide show
  1. package/README.md +245 -39
  2. package/dist/{card-RSGDCHCV.js → card-REW7BSWW.js} +1 -1
  3. package/dist/{chunk-FLY3WIQR.js → chunk-2HSUPCBT.js} +3 -3
  4. package/dist/{chunk-WGZ5AGOX.js → chunk-3CIMVISQ.js} +24 -1
  5. package/dist/{chunk-NH2FIERR.js → chunk-574W3HHE.js} +1 -1
  6. package/dist/{chunk-WTXRY7R2.js → chunk-APEG4QIN.js} +157 -9
  7. package/dist/chunk-BP3L2TET.js +148 -0
  8. package/dist/{chunk-NLAWT4DT.js → chunk-CWYPTQRQ.js} +7 -7
  9. package/dist/{chunk-UKT6H7YT.js → chunk-DUW6RX6I.js} +5 -2
  10. package/dist/chunk-EAD4A4KG.js +430 -0
  11. package/dist/{chunk-QT7TEVNV.js → chunk-EHSHB7TY.js} +23 -1
  12. package/dist/{chunk-B5FTAGFN.js → chunk-ETGOKDFR.js} +75 -75
  13. package/dist/{chunk-5KFI5X7B.js → chunk-F53QQIM2.js} +1 -1
  14. package/dist/{chunk-MLS6IGGG.js → chunk-FK2MDNTB.js} +117 -117
  15. package/dist/{chunk-EGUOAHCW.js → chunk-GO4FVRVN.js} +15 -13
  16. package/dist/{chunk-CRFCWD6V.js → chunk-J2K5S5MX.js} +136 -173
  17. package/dist/chunk-K5FO42YF.js +1136 -0
  18. package/dist/{chunk-DFBX3BBD.js → chunk-KA2VIEGM.js} +211 -16
  19. package/dist/chunk-NWIQJ2CL.js +108 -0
  20. package/dist/chunk-OCSU2S6W.js +168 -0
  21. package/dist/{chunk-QQFBFV4V.js → chunk-PGDBUUGR.js} +60 -19
  22. package/dist/{chunk-QITOPASZ.js → chunk-PSQHUZ7X.js} +1 -1
  23. package/dist/{chunk-C6KPAFCC.js → chunk-PU7LXOQ3.js} +23 -1
  24. package/dist/{chunk-JOY533UH.js → chunk-TW65F5EU.js} +1 -1
  25. package/dist/{chunk-ZX5623ER.js → chunk-VMH2YS2I.js} +1 -1
  26. package/dist/{chunk-XND2DWTZ.js → chunk-VPQ44XKE.js} +2 -2
  27. package/dist/{chunk-CSATDXZC.js → chunk-Y7T6IMM3.js} +1 -1
  28. package/dist/cli/index.js +755 -379
  29. package/dist/{client-T5MTY3CS.js → client-HRYRJKSA.js} +3 -3
  30. package/dist/{conduct-WU3VEXB6.js → conduct-JNYJCDHQ.js} +14 -13
  31. package/dist/conduct-KJUD2RTB.js +22 -0
  32. package/dist/{conductor-mode-ZMTFZGJP.js → conductor-mode-2VVFMKVE.js} +313 -14
  33. package/dist/conductor-mode-VGUU54QI.js +276 -0
  34. package/dist/execute-I4PKSNJM.js +12 -0
  35. package/dist/execute-MOXSSA3Q.js +15 -0
  36. package/dist/index.d.ts +795 -2
  37. package/dist/index.js +861 -111
  38. package/dist/{process-guard-CC7CNRQJ.js → process-guard-QCCBGILS.js} +1 -1
  39. package/dist/publish-capability-TS6CNR5G.js +12 -0
  40. package/dist/reliability-metrics-QG7WC5QK.js +18 -0
  41. package/dist/{request-VOXBFUOG.js → request-E7TA7COA.js} +19 -18
  42. package/dist/{serve-skill-IH7UAJNR.js → serve-skill-HIOWYKRU.js} +13 -11
  43. package/dist/{server-JVQW2TID.js → server-I63CXFX3.js} +17 -16
  44. package/dist/{service-coordinator-EYRDTHL5.js → service-coordinator-XBNT3SMU.js} +369 -260
  45. package/dist/skill-config-FETXPNVP.js +22 -0
  46. package/dist/skills/agentbnb/bootstrap.js +430 -84
  47. package/dist/websocket-client-5MH6QRJK.js +7 -0
  48. package/dist/{websocket-client-WRN3HO73.js → websocket-client-PFGVTXNE.js} +1 -1
  49. package/openclaw.plugin.json +2 -2
  50. package/package.json +2 -1
  51. package/skills/agentbnb/SKILL.md +35 -0
  52. package/skills/agentbnb/bootstrap.ts +126 -8
  53. package/skills/agentbnb/install.sh +49 -9
  54. package/dist/chunk-EANI2N2V.js +0 -309
  55. package/dist/chunk-EPIWHNB2.js +0 -946
  56. package/dist/conduct-6LKIJJKQ.js +0 -21
  57. package/dist/conductor-mode-Q4IIDY5E.js +0 -123
  58. package/dist/execute-4D4ITQCL.js +0 -10
  59. package/dist/execute-T7Y6RKSW.js +0 -13
  60. package/dist/websocket-client-6IIDGXKB.js +0 -7
package/dist/index.d.ts CHANGED
@@ -116,6 +116,8 @@ declare const CapabilityCardSchema: z.ZodObject<{
116
116
  }>>;
117
117
  created_at: z.ZodOptional<z.ZodString>;
118
118
  updated_at: z.ZodOptional<z.ZodString>;
119
+ /** Exact-match capability type key for network routing (e.g. 'task_decomposition'). Optional — backward-compatible. */
120
+ capability_type: z.ZodOptional<z.ZodString>;
119
121
  }, "strip", z.ZodTypeAny, {
120
122
  name: string;
121
123
  description: string;
@@ -161,6 +163,7 @@ declare const CapabilityCardSchema: z.ZodObject<{
161
163
  } | undefined;
162
164
  created_at?: string | undefined;
163
165
  updated_at?: string | undefined;
166
+ capability_type?: string | undefined;
164
167
  }, {
165
168
  name: string;
166
169
  description: string;
@@ -206,6 +209,7 @@ declare const CapabilityCardSchema: z.ZodObject<{
206
209
  } | undefined;
207
210
  created_at?: string | undefined;
208
211
  updated_at?: string | undefined;
212
+ capability_type?: string | undefined;
209
213
  }>;
210
214
  type CapabilityCard = z.infer<typeof CapabilityCardSchema>;
211
215
  /**
@@ -231,6 +235,25 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
231
235
  level: z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
232
236
  /** Optional grouping category, e.g. 'tts' | 'video_gen' | 'code_review'. */
233
237
  category: z.ZodOptional<z.ZodString>;
238
+ /** Exact-match capability type key for network routing (e.g. 'task_decomposition'). Optional — per-skill routing hint. */
239
+ capability_type: z.ZodOptional<z.ZodString>;
240
+ /**
241
+ * Multi-value capability routing tags — what this skill IS / offers to the outside.
242
+ * Used by Conductor for precise skill-level matching.
243
+ * Example: ["audio_generation", "audio_editing", "content_production"]
244
+ */
245
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
246
+ /**
247
+ * Capabilities this skill internally depends on when executing.
248
+ * Used by Conductor for decomposition planning and cost estimation.
249
+ * Example: ["tts", "sound_effects", "audio_mixing"]
250
+ */
251
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
252
+ /**
253
+ * Publishing visibility. 'private' skills are excluded from published CapabilityCards.
254
+ * Defaults to 'public' when omitted.
255
+ */
256
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
234
257
  inputs: z.ZodArray<z.ZodObject<{
235
258
  name: z.ZodString;
236
259
  type: z.ZodEnum<["text", "json", "file", "audio", "image", "video", "stream"]>;
@@ -379,7 +402,11 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
379
402
  calls_per_hour: number;
380
403
  } | undefined;
381
404
  } | undefined;
405
+ capability_type?: string | undefined;
382
406
  category?: string | undefined;
407
+ capability_types?: string[] | undefined;
408
+ requires_capabilities?: string[] | undefined;
409
+ visibility?: "public" | "private" | undefined;
383
410
  }, {
384
411
  name: string;
385
412
  description: string;
@@ -422,7 +449,11 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
422
449
  calls_per_hour?: number | undefined;
423
450
  } | undefined;
424
451
  } | undefined;
452
+ capability_type?: string | undefined;
425
453
  category?: string | undefined;
454
+ capability_types?: string[] | undefined;
455
+ requires_capabilities?: string[] | undefined;
456
+ visibility?: "public" | "private" | undefined;
426
457
  }>, "many">;
427
458
  availability: z.ZodObject<{
428
459
  online: z.ZodBoolean;
@@ -543,6 +574,8 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
543
574
  _internal: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
544
575
  /** Public gateway URL where this agent accepts requests. Populated on remote publish. */
545
576
  gateway_url: z.ZodOptional<z.ZodString>;
577
+ /** Exact-match capability type key for network routing (e.g. 'task_decomposition'). Optional — backward-compatible. */
578
+ capability_type: z.ZodOptional<z.ZodString>;
546
579
  created_at: z.ZodOptional<z.ZodString>;
547
580
  updated_at: z.ZodOptional<z.ZodString>;
548
581
  }, "strip", z.ZodTypeAny, {
@@ -596,12 +629,17 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
596
629
  calls_per_hour: number;
597
630
  } | undefined;
598
631
  } | undefined;
632
+ capability_type?: string | undefined;
599
633
  category?: string | undefined;
634
+ capability_types?: string[] | undefined;
635
+ requires_capabilities?: string[] | undefined;
636
+ visibility?: "public" | "private" | undefined;
600
637
  }[];
601
638
  _internal?: Record<string, unknown> | undefined;
602
639
  gateway_url?: string | undefined;
603
640
  created_at?: string | undefined;
604
641
  updated_at?: string | undefined;
642
+ capability_type?: string | undefined;
605
643
  short_description?: string | undefined;
606
644
  environment?: {
607
645
  runtime: string;
@@ -680,12 +718,17 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
680
718
  calls_per_hour?: number | undefined;
681
719
  } | undefined;
682
720
  } | undefined;
721
+ capability_type?: string | undefined;
683
722
  category?: string | undefined;
723
+ capability_types?: string[] | undefined;
724
+ requires_capabilities?: string[] | undefined;
725
+ visibility?: "public" | "private" | undefined;
684
726
  }[];
685
727
  _internal?: Record<string, unknown> | undefined;
686
728
  gateway_url?: string | undefined;
687
729
  created_at?: string | undefined;
688
730
  updated_at?: string | undefined;
731
+ capability_type?: string | undefined;
689
732
  short_description?: string | undefined;
690
733
  environment?: {
691
734
  runtime: string;
@@ -819,6 +862,10 @@ declare function getBalance(db: Database.Database, owner: string): number;
819
862
  * Wraps a REST API call with input/output mapping.
820
863
  */
821
864
  declare const ApiSkillConfigSchema: z.ZodObject<{
865
+ description: z.ZodOptional<z.ZodString>;
866
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
867
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
868
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
822
869
  id: z.ZodString;
823
870
  type: z.ZodLiteral<"api">;
824
871
  name: z.ZodString;
@@ -876,6 +923,13 @@ declare const ApiSkillConfigSchema: z.ZodObject<{
876
923
  timeout_ms: z.ZodDefault<z.ZodNumber>;
877
924
  retries: z.ZodDefault<z.ZodNumber>;
878
925
  provider: z.ZodOptional<z.ZodString>;
926
+ capacity: z.ZodOptional<z.ZodObject<{
927
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
928
+ }, "strip", z.ZodTypeAny, {
929
+ max_concurrent?: number | undefined;
930
+ }, {
931
+ max_concurrent?: number | undefined;
932
+ }>>;
879
933
  }, "strip", z.ZodTypeAny, {
880
934
  name: string;
881
935
  type: "api";
@@ -891,7 +945,14 @@ declare const ApiSkillConfigSchema: z.ZodObject<{
891
945
  output_mapping: Record<string, string>;
892
946
  timeout_ms: number;
893
947
  retries: number;
948
+ description?: string | undefined;
894
949
  provider?: string | undefined;
950
+ capability_types?: string[] | undefined;
951
+ requires_capabilities?: string[] | undefined;
952
+ visibility?: "public" | "private" | undefined;
953
+ capacity?: {
954
+ max_concurrent?: number | undefined;
955
+ } | undefined;
895
956
  auth?: {
896
957
  type: "bearer";
897
958
  token: string;
@@ -915,7 +976,14 @@ declare const ApiSkillConfigSchema: z.ZodObject<{
915
976
  };
916
977
  endpoint: string;
917
978
  method: "GET" | "POST" | "PUT" | "DELETE";
979
+ description?: string | undefined;
918
980
  provider?: string | undefined;
981
+ capability_types?: string[] | undefined;
982
+ requires_capabilities?: string[] | undefined;
983
+ visibility?: "public" | "private" | undefined;
984
+ capacity?: {
985
+ max_concurrent?: number | undefined;
986
+ } | undefined;
919
987
  auth?: {
920
988
  type: "bearer";
921
989
  token: string;
@@ -938,6 +1006,10 @@ declare const ApiSkillConfigSchema: z.ZodObject<{
938
1006
  * Chains multiple skills or commands sequentially.
939
1007
  */
940
1008
  declare const PipelineSkillConfigSchema: z.ZodObject<{
1009
+ description: z.ZodOptional<z.ZodString>;
1010
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1011
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1012
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
941
1013
  id: z.ZodString;
942
1014
  type: z.ZodLiteral<"pipeline">;
943
1015
  name: z.ZodString;
@@ -974,6 +1046,13 @@ declare const PipelineSkillConfigSchema: z.ZodObject<{
974
1046
  free_tier?: number | undefined;
975
1047
  }>;
976
1048
  timeout_ms: z.ZodOptional<z.ZodNumber>;
1049
+ capacity: z.ZodOptional<z.ZodObject<{
1050
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1051
+ }, "strip", z.ZodTypeAny, {
1052
+ max_concurrent?: number | undefined;
1053
+ }, {
1054
+ max_concurrent?: number | undefined;
1055
+ }>>;
977
1056
  }, "strip", z.ZodTypeAny, {
978
1057
  name: string;
979
1058
  type: "pipeline";
@@ -990,6 +1069,13 @@ declare const PipelineSkillConfigSchema: z.ZodObject<{
990
1069
  input_mapping: Record<string, string>;
991
1070
  command: string;
992
1071
  })[];
1072
+ description?: string | undefined;
1073
+ capability_types?: string[] | undefined;
1074
+ requires_capabilities?: string[] | undefined;
1075
+ visibility?: "public" | "private" | undefined;
1076
+ capacity?: {
1077
+ max_concurrent?: number | undefined;
1078
+ } | undefined;
993
1079
  timeout_ms?: number | undefined;
994
1080
  }, {
995
1081
  name: string;
@@ -1007,6 +1093,13 @@ declare const PipelineSkillConfigSchema: z.ZodObject<{
1007
1093
  command: string;
1008
1094
  input_mapping?: Record<string, string> | undefined;
1009
1095
  })[];
1096
+ description?: string | undefined;
1097
+ capability_types?: string[] | undefined;
1098
+ requires_capabilities?: string[] | undefined;
1099
+ visibility?: "public" | "private" | undefined;
1100
+ capacity?: {
1101
+ max_concurrent?: number | undefined;
1102
+ } | undefined;
1010
1103
  timeout_ms?: number | undefined;
1011
1104
  }>;
1012
1105
  /**
@@ -1014,6 +1107,10 @@ declare const PipelineSkillConfigSchema: z.ZodObject<{
1014
1107
  * Forwards execution to a local OpenClaw agent.
1015
1108
  */
1016
1109
  declare const OpenClawSkillConfigSchema: z.ZodObject<{
1110
+ description: z.ZodOptional<z.ZodString>;
1111
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1112
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1113
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1017
1114
  id: z.ZodString;
1018
1115
  type: z.ZodLiteral<"openclaw">;
1019
1116
  name: z.ZodString;
@@ -1033,6 +1130,13 @@ declare const OpenClawSkillConfigSchema: z.ZodObject<{
1033
1130
  free_tier?: number | undefined;
1034
1131
  }>;
1035
1132
  timeout_ms: z.ZodOptional<z.ZodNumber>;
1133
+ capacity: z.ZodOptional<z.ZodObject<{
1134
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1135
+ }, "strip", z.ZodTypeAny, {
1136
+ max_concurrent?: number | undefined;
1137
+ }, {
1138
+ max_concurrent?: number | undefined;
1139
+ }>>;
1036
1140
  }, "strip", z.ZodTypeAny, {
1037
1141
  name: string;
1038
1142
  type: "openclaw";
@@ -1044,6 +1148,13 @@ declare const OpenClawSkillConfigSchema: z.ZodObject<{
1044
1148
  };
1045
1149
  agent_name: string;
1046
1150
  channel: "telegram" | "webhook" | "process";
1151
+ description?: string | undefined;
1152
+ capability_types?: string[] | undefined;
1153
+ requires_capabilities?: string[] | undefined;
1154
+ visibility?: "public" | "private" | undefined;
1155
+ capacity?: {
1156
+ max_concurrent?: number | undefined;
1157
+ } | undefined;
1047
1158
  timeout_ms?: number | undefined;
1048
1159
  }, {
1049
1160
  name: string;
@@ -1056,6 +1167,13 @@ declare const OpenClawSkillConfigSchema: z.ZodObject<{
1056
1167
  };
1057
1168
  agent_name: string;
1058
1169
  channel: "telegram" | "webhook" | "process";
1170
+ description?: string | undefined;
1171
+ capability_types?: string[] | undefined;
1172
+ requires_capabilities?: string[] | undefined;
1173
+ visibility?: "public" | "private" | undefined;
1174
+ capacity?: {
1175
+ max_concurrent?: number | undefined;
1176
+ } | undefined;
1059
1177
  timeout_ms?: number | undefined;
1060
1178
  }>;
1061
1179
  /**
@@ -1063,6 +1181,10 @@ declare const OpenClawSkillConfigSchema: z.ZodObject<{
1063
1181
  * Runs local shell commands with parameter substitution.
1064
1182
  */
1065
1183
  declare const CommandSkillConfigSchema: z.ZodObject<{
1184
+ description: z.ZodOptional<z.ZodString>;
1185
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1186
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1187
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1066
1188
  id: z.ZodString;
1067
1189
  type: z.ZodLiteral<"command">;
1068
1190
  name: z.ZodString;
@@ -1070,6 +1192,22 @@ declare const CommandSkillConfigSchema: z.ZodObject<{
1070
1192
  output_type: z.ZodEnum<["json", "text", "file"]>;
1071
1193
  allowed_commands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1072
1194
  working_dir: z.ZodOptional<z.ZodString>;
1195
+ claude_code: z.ZodOptional<z.ZodObject<{
1196
+ /** Optional system prompt passed via `-p` flag. */
1197
+ system_prompt: z.ZodOptional<z.ZodString>;
1198
+ /** Model to use (e.g. 'claude-opus-4-6', 'claude-sonnet-4-6'). */
1199
+ model: z.ZodOptional<z.ZodString>;
1200
+ /** When true, passes `--dangerously-skip-permissions` to claude CLI. */
1201
+ auto_mode: z.ZodDefault<z.ZodBoolean>;
1202
+ }, "strip", z.ZodTypeAny, {
1203
+ auto_mode: boolean;
1204
+ model?: string | undefined;
1205
+ system_prompt?: string | undefined;
1206
+ }, {
1207
+ model?: string | undefined;
1208
+ system_prompt?: string | undefined;
1209
+ auto_mode?: boolean | undefined;
1210
+ }>>;
1073
1211
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1074
1212
  pricing: z.ZodObject<{
1075
1213
  credits_per_call: z.ZodNumber;
@@ -1084,6 +1222,13 @@ declare const CommandSkillConfigSchema: z.ZodObject<{
1084
1222
  credits_per_minute?: number | undefined;
1085
1223
  free_tier?: number | undefined;
1086
1224
  }>;
1225
+ capacity: z.ZodOptional<z.ZodObject<{
1226
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1227
+ }, "strip", z.ZodTypeAny, {
1228
+ max_concurrent?: number | undefined;
1229
+ }, {
1230
+ max_concurrent?: number | undefined;
1231
+ }>>;
1087
1232
  }, "strip", z.ZodTypeAny, {
1088
1233
  name: string;
1089
1234
  type: "command";
@@ -1096,8 +1241,20 @@ declare const CommandSkillConfigSchema: z.ZodObject<{
1096
1241
  timeout_ms: number;
1097
1242
  command: string;
1098
1243
  output_type: "text" | "json" | "file";
1244
+ description?: string | undefined;
1245
+ capability_types?: string[] | undefined;
1246
+ requires_capabilities?: string[] | undefined;
1247
+ visibility?: "public" | "private" | undefined;
1248
+ capacity?: {
1249
+ max_concurrent?: number | undefined;
1250
+ } | undefined;
1099
1251
  allowed_commands?: string[] | undefined;
1100
1252
  working_dir?: string | undefined;
1253
+ claude_code?: {
1254
+ auto_mode: boolean;
1255
+ model?: string | undefined;
1256
+ system_prompt?: string | undefined;
1257
+ } | undefined;
1101
1258
  }, {
1102
1259
  name: string;
1103
1260
  type: "command";
@@ -1109,15 +1266,31 @@ declare const CommandSkillConfigSchema: z.ZodObject<{
1109
1266
  };
1110
1267
  command: string;
1111
1268
  output_type: "text" | "json" | "file";
1269
+ description?: string | undefined;
1270
+ capability_types?: string[] | undefined;
1271
+ requires_capabilities?: string[] | undefined;
1272
+ visibility?: "public" | "private" | undefined;
1273
+ capacity?: {
1274
+ max_concurrent?: number | undefined;
1275
+ } | undefined;
1112
1276
  timeout_ms?: number | undefined;
1113
1277
  allowed_commands?: string[] | undefined;
1114
1278
  working_dir?: string | undefined;
1279
+ claude_code?: {
1280
+ model?: string | undefined;
1281
+ system_prompt?: string | undefined;
1282
+ auto_mode?: boolean | undefined;
1283
+ } | undefined;
1115
1284
  }>;
1116
1285
  /**
1117
1286
  * Schema for conductor orchestration skills (Mode E).
1118
1287
  * Routes execution to the ConductorMode for task decomposition and multi-agent orchestration.
1119
1288
  */
1120
1289
  declare const ConductorSkillConfigSchema: z.ZodObject<{
1290
+ description: z.ZodOptional<z.ZodString>;
1291
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1292
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1293
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1121
1294
  id: z.ZodString;
1122
1295
  type: z.ZodLiteral<"conductor">;
1123
1296
  name: z.ZodString;
@@ -1136,6 +1309,13 @@ declare const ConductorSkillConfigSchema: z.ZodObject<{
1136
1309
  free_tier?: number | undefined;
1137
1310
  }>;
1138
1311
  timeout_ms: z.ZodOptional<z.ZodNumber>;
1312
+ capacity: z.ZodOptional<z.ZodObject<{
1313
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1314
+ }, "strip", z.ZodTypeAny, {
1315
+ max_concurrent?: number | undefined;
1316
+ }, {
1317
+ max_concurrent?: number | undefined;
1318
+ }>>;
1139
1319
  }, "strip", z.ZodTypeAny, {
1140
1320
  name: string;
1141
1321
  type: "conductor";
@@ -1146,6 +1326,13 @@ declare const ConductorSkillConfigSchema: z.ZodObject<{
1146
1326
  free_tier?: number | undefined;
1147
1327
  };
1148
1328
  conductor_skill: "orchestrate" | "plan";
1329
+ description?: string | undefined;
1330
+ capability_types?: string[] | undefined;
1331
+ requires_capabilities?: string[] | undefined;
1332
+ visibility?: "public" | "private" | undefined;
1333
+ capacity?: {
1334
+ max_concurrent?: number | undefined;
1335
+ } | undefined;
1149
1336
  timeout_ms?: number | undefined;
1150
1337
  }, {
1151
1338
  name: string;
@@ -1157,6 +1344,13 @@ declare const ConductorSkillConfigSchema: z.ZodObject<{
1157
1344
  free_tier?: number | undefined;
1158
1345
  };
1159
1346
  conductor_skill: "orchestrate" | "plan";
1347
+ description?: string | undefined;
1348
+ capability_types?: string[] | undefined;
1349
+ requires_capabilities?: string[] | undefined;
1350
+ visibility?: "public" | "private" | undefined;
1351
+ capacity?: {
1352
+ max_concurrent?: number | undefined;
1353
+ } | undefined;
1160
1354
  timeout_ms?: number | undefined;
1161
1355
  }>;
1162
1356
  /**
@@ -1164,6 +1358,10 @@ declare const ConductorSkillConfigSchema: z.ZodObject<{
1164
1358
  * Used by SkillExecutor to dispatch to the correct executor mode.
1165
1359
  */
1166
1360
  declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1361
+ description: z.ZodOptional<z.ZodString>;
1362
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1363
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1364
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1167
1365
  id: z.ZodString;
1168
1366
  type: z.ZodLiteral<"api">;
1169
1367
  name: z.ZodString;
@@ -1221,6 +1419,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1221
1419
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1222
1420
  retries: z.ZodDefault<z.ZodNumber>;
1223
1421
  provider: z.ZodOptional<z.ZodString>;
1422
+ capacity: z.ZodOptional<z.ZodObject<{
1423
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1424
+ }, "strip", z.ZodTypeAny, {
1425
+ max_concurrent?: number | undefined;
1426
+ }, {
1427
+ max_concurrent?: number | undefined;
1428
+ }>>;
1224
1429
  }, "strip", z.ZodTypeAny, {
1225
1430
  name: string;
1226
1431
  type: "api";
@@ -1236,7 +1441,14 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1236
1441
  output_mapping: Record<string, string>;
1237
1442
  timeout_ms: number;
1238
1443
  retries: number;
1444
+ description?: string | undefined;
1239
1445
  provider?: string | undefined;
1446
+ capability_types?: string[] | undefined;
1447
+ requires_capabilities?: string[] | undefined;
1448
+ visibility?: "public" | "private" | undefined;
1449
+ capacity?: {
1450
+ max_concurrent?: number | undefined;
1451
+ } | undefined;
1240
1452
  auth?: {
1241
1453
  type: "bearer";
1242
1454
  token: string;
@@ -1260,7 +1472,14 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1260
1472
  };
1261
1473
  endpoint: string;
1262
1474
  method: "GET" | "POST" | "PUT" | "DELETE";
1475
+ description?: string | undefined;
1263
1476
  provider?: string | undefined;
1477
+ capability_types?: string[] | undefined;
1478
+ requires_capabilities?: string[] | undefined;
1479
+ visibility?: "public" | "private" | undefined;
1480
+ capacity?: {
1481
+ max_concurrent?: number | undefined;
1482
+ } | undefined;
1264
1483
  auth?: {
1265
1484
  type: "bearer";
1266
1485
  token: string;
@@ -1278,6 +1497,10 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1278
1497
  timeout_ms?: number | undefined;
1279
1498
  retries?: number | undefined;
1280
1499
  }>, z.ZodObject<{
1500
+ description: z.ZodOptional<z.ZodString>;
1501
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1502
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1503
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1281
1504
  id: z.ZodString;
1282
1505
  type: z.ZodLiteral<"pipeline">;
1283
1506
  name: z.ZodString;
@@ -1314,6 +1537,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1314
1537
  free_tier?: number | undefined;
1315
1538
  }>;
1316
1539
  timeout_ms: z.ZodOptional<z.ZodNumber>;
1540
+ capacity: z.ZodOptional<z.ZodObject<{
1541
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1542
+ }, "strip", z.ZodTypeAny, {
1543
+ max_concurrent?: number | undefined;
1544
+ }, {
1545
+ max_concurrent?: number | undefined;
1546
+ }>>;
1317
1547
  }, "strip", z.ZodTypeAny, {
1318
1548
  name: string;
1319
1549
  type: "pipeline";
@@ -1330,6 +1560,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1330
1560
  input_mapping: Record<string, string>;
1331
1561
  command: string;
1332
1562
  })[];
1563
+ description?: string | undefined;
1564
+ capability_types?: string[] | undefined;
1565
+ requires_capabilities?: string[] | undefined;
1566
+ visibility?: "public" | "private" | undefined;
1567
+ capacity?: {
1568
+ max_concurrent?: number | undefined;
1569
+ } | undefined;
1333
1570
  timeout_ms?: number | undefined;
1334
1571
  }, {
1335
1572
  name: string;
@@ -1347,8 +1584,19 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1347
1584
  command: string;
1348
1585
  input_mapping?: Record<string, string> | undefined;
1349
1586
  })[];
1587
+ description?: string | undefined;
1588
+ capability_types?: string[] | undefined;
1589
+ requires_capabilities?: string[] | undefined;
1590
+ visibility?: "public" | "private" | undefined;
1591
+ capacity?: {
1592
+ max_concurrent?: number | undefined;
1593
+ } | undefined;
1350
1594
  timeout_ms?: number | undefined;
1351
1595
  }>, z.ZodObject<{
1596
+ description: z.ZodOptional<z.ZodString>;
1597
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1598
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1599
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1352
1600
  id: z.ZodString;
1353
1601
  type: z.ZodLiteral<"openclaw">;
1354
1602
  name: z.ZodString;
@@ -1368,6 +1616,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1368
1616
  free_tier?: number | undefined;
1369
1617
  }>;
1370
1618
  timeout_ms: z.ZodOptional<z.ZodNumber>;
1619
+ capacity: z.ZodOptional<z.ZodObject<{
1620
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1621
+ }, "strip", z.ZodTypeAny, {
1622
+ max_concurrent?: number | undefined;
1623
+ }, {
1624
+ max_concurrent?: number | undefined;
1625
+ }>>;
1371
1626
  }, "strip", z.ZodTypeAny, {
1372
1627
  name: string;
1373
1628
  type: "openclaw";
@@ -1379,6 +1634,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1379
1634
  };
1380
1635
  agent_name: string;
1381
1636
  channel: "telegram" | "webhook" | "process";
1637
+ description?: string | undefined;
1638
+ capability_types?: string[] | undefined;
1639
+ requires_capabilities?: string[] | undefined;
1640
+ visibility?: "public" | "private" | undefined;
1641
+ capacity?: {
1642
+ max_concurrent?: number | undefined;
1643
+ } | undefined;
1382
1644
  timeout_ms?: number | undefined;
1383
1645
  }, {
1384
1646
  name: string;
@@ -1391,8 +1653,19 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1391
1653
  };
1392
1654
  agent_name: string;
1393
1655
  channel: "telegram" | "webhook" | "process";
1656
+ description?: string | undefined;
1657
+ capability_types?: string[] | undefined;
1658
+ requires_capabilities?: string[] | undefined;
1659
+ visibility?: "public" | "private" | undefined;
1660
+ capacity?: {
1661
+ max_concurrent?: number | undefined;
1662
+ } | undefined;
1394
1663
  timeout_ms?: number | undefined;
1395
1664
  }>, z.ZodObject<{
1665
+ description: z.ZodOptional<z.ZodString>;
1666
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1667
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1668
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1396
1669
  id: z.ZodString;
1397
1670
  type: z.ZodLiteral<"command">;
1398
1671
  name: z.ZodString;
@@ -1400,6 +1673,22 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1400
1673
  output_type: z.ZodEnum<["json", "text", "file"]>;
1401
1674
  allowed_commands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1402
1675
  working_dir: z.ZodOptional<z.ZodString>;
1676
+ claude_code: z.ZodOptional<z.ZodObject<{
1677
+ /** Optional system prompt passed via `-p` flag. */
1678
+ system_prompt: z.ZodOptional<z.ZodString>;
1679
+ /** Model to use (e.g. 'claude-opus-4-6', 'claude-sonnet-4-6'). */
1680
+ model: z.ZodOptional<z.ZodString>;
1681
+ /** When true, passes `--dangerously-skip-permissions` to claude CLI. */
1682
+ auto_mode: z.ZodDefault<z.ZodBoolean>;
1683
+ }, "strip", z.ZodTypeAny, {
1684
+ auto_mode: boolean;
1685
+ model?: string | undefined;
1686
+ system_prompt?: string | undefined;
1687
+ }, {
1688
+ model?: string | undefined;
1689
+ system_prompt?: string | undefined;
1690
+ auto_mode?: boolean | undefined;
1691
+ }>>;
1403
1692
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1404
1693
  pricing: z.ZodObject<{
1405
1694
  credits_per_call: z.ZodNumber;
@@ -1414,6 +1703,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1414
1703
  credits_per_minute?: number | undefined;
1415
1704
  free_tier?: number | undefined;
1416
1705
  }>;
1706
+ capacity: z.ZodOptional<z.ZodObject<{
1707
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1708
+ }, "strip", z.ZodTypeAny, {
1709
+ max_concurrent?: number | undefined;
1710
+ }, {
1711
+ max_concurrent?: number | undefined;
1712
+ }>>;
1417
1713
  }, "strip", z.ZodTypeAny, {
1418
1714
  name: string;
1419
1715
  type: "command";
@@ -1426,8 +1722,20 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1426
1722
  timeout_ms: number;
1427
1723
  command: string;
1428
1724
  output_type: "text" | "json" | "file";
1725
+ description?: string | undefined;
1726
+ capability_types?: string[] | undefined;
1727
+ requires_capabilities?: string[] | undefined;
1728
+ visibility?: "public" | "private" | undefined;
1729
+ capacity?: {
1730
+ max_concurrent?: number | undefined;
1731
+ } | undefined;
1429
1732
  allowed_commands?: string[] | undefined;
1430
1733
  working_dir?: string | undefined;
1734
+ claude_code?: {
1735
+ auto_mode: boolean;
1736
+ model?: string | undefined;
1737
+ system_prompt?: string | undefined;
1738
+ } | undefined;
1431
1739
  }, {
1432
1740
  name: string;
1433
1741
  type: "command";
@@ -1439,10 +1747,26 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1439
1747
  };
1440
1748
  command: string;
1441
1749
  output_type: "text" | "json" | "file";
1750
+ description?: string | undefined;
1751
+ capability_types?: string[] | undefined;
1752
+ requires_capabilities?: string[] | undefined;
1753
+ visibility?: "public" | "private" | undefined;
1754
+ capacity?: {
1755
+ max_concurrent?: number | undefined;
1756
+ } | undefined;
1442
1757
  timeout_ms?: number | undefined;
1443
1758
  allowed_commands?: string[] | undefined;
1444
1759
  working_dir?: string | undefined;
1760
+ claude_code?: {
1761
+ model?: string | undefined;
1762
+ system_prompt?: string | undefined;
1763
+ auto_mode?: boolean | undefined;
1764
+ } | undefined;
1445
1765
  }>, z.ZodObject<{
1766
+ description: z.ZodOptional<z.ZodString>;
1767
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1768
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1769
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1446
1770
  id: z.ZodString;
1447
1771
  type: z.ZodLiteral<"conductor">;
1448
1772
  name: z.ZodString;
@@ -1461,6 +1785,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1461
1785
  free_tier?: number | undefined;
1462
1786
  }>;
1463
1787
  timeout_ms: z.ZodOptional<z.ZodNumber>;
1788
+ capacity: z.ZodOptional<z.ZodObject<{
1789
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1790
+ }, "strip", z.ZodTypeAny, {
1791
+ max_concurrent?: number | undefined;
1792
+ }, {
1793
+ max_concurrent?: number | undefined;
1794
+ }>>;
1464
1795
  }, "strip", z.ZodTypeAny, {
1465
1796
  name: string;
1466
1797
  type: "conductor";
@@ -1471,6 +1802,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1471
1802
  free_tier?: number | undefined;
1472
1803
  };
1473
1804
  conductor_skill: "orchestrate" | "plan";
1805
+ description?: string | undefined;
1806
+ capability_types?: string[] | undefined;
1807
+ requires_capabilities?: string[] | undefined;
1808
+ visibility?: "public" | "private" | undefined;
1809
+ capacity?: {
1810
+ max_concurrent?: number | undefined;
1811
+ } | undefined;
1474
1812
  timeout_ms?: number | undefined;
1475
1813
  }, {
1476
1814
  name: string;
@@ -1482,6 +1820,13 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1482
1820
  free_tier?: number | undefined;
1483
1821
  };
1484
1822
  conductor_skill: "orchestrate" | "plan";
1823
+ description?: string | undefined;
1824
+ capability_types?: string[] | undefined;
1825
+ requires_capabilities?: string[] | undefined;
1826
+ visibility?: "public" | "private" | undefined;
1827
+ capacity?: {
1828
+ max_concurrent?: number | undefined;
1829
+ } | undefined;
1485
1830
  timeout_ms?: number | undefined;
1486
1831
  }>]>;
1487
1832
  /**
@@ -1490,6 +1835,10 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1490
1835
  */
1491
1836
  declare const SkillsFileSchema: z.ZodObject<{
1492
1837
  skills: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1838
+ description: z.ZodOptional<z.ZodString>;
1839
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1840
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1841
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1493
1842
  id: z.ZodString;
1494
1843
  type: z.ZodLiteral<"api">;
1495
1844
  name: z.ZodString;
@@ -1547,6 +1896,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1547
1896
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1548
1897
  retries: z.ZodDefault<z.ZodNumber>;
1549
1898
  provider: z.ZodOptional<z.ZodString>;
1899
+ capacity: z.ZodOptional<z.ZodObject<{
1900
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
1901
+ }, "strip", z.ZodTypeAny, {
1902
+ max_concurrent?: number | undefined;
1903
+ }, {
1904
+ max_concurrent?: number | undefined;
1905
+ }>>;
1550
1906
  }, "strip", z.ZodTypeAny, {
1551
1907
  name: string;
1552
1908
  type: "api";
@@ -1562,7 +1918,14 @@ declare const SkillsFileSchema: z.ZodObject<{
1562
1918
  output_mapping: Record<string, string>;
1563
1919
  timeout_ms: number;
1564
1920
  retries: number;
1921
+ description?: string | undefined;
1565
1922
  provider?: string | undefined;
1923
+ capability_types?: string[] | undefined;
1924
+ requires_capabilities?: string[] | undefined;
1925
+ visibility?: "public" | "private" | undefined;
1926
+ capacity?: {
1927
+ max_concurrent?: number | undefined;
1928
+ } | undefined;
1566
1929
  auth?: {
1567
1930
  type: "bearer";
1568
1931
  token: string;
@@ -1586,7 +1949,14 @@ declare const SkillsFileSchema: z.ZodObject<{
1586
1949
  };
1587
1950
  endpoint: string;
1588
1951
  method: "GET" | "POST" | "PUT" | "DELETE";
1952
+ description?: string | undefined;
1589
1953
  provider?: string | undefined;
1954
+ capability_types?: string[] | undefined;
1955
+ requires_capabilities?: string[] | undefined;
1956
+ visibility?: "public" | "private" | undefined;
1957
+ capacity?: {
1958
+ max_concurrent?: number | undefined;
1959
+ } | undefined;
1590
1960
  auth?: {
1591
1961
  type: "bearer";
1592
1962
  token: string;
@@ -1604,6 +1974,10 @@ declare const SkillsFileSchema: z.ZodObject<{
1604
1974
  timeout_ms?: number | undefined;
1605
1975
  retries?: number | undefined;
1606
1976
  }>, z.ZodObject<{
1977
+ description: z.ZodOptional<z.ZodString>;
1978
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1979
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1980
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1607
1981
  id: z.ZodString;
1608
1982
  type: z.ZodLiteral<"pipeline">;
1609
1983
  name: z.ZodString;
@@ -1640,6 +2014,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1640
2014
  free_tier?: number | undefined;
1641
2015
  }>;
1642
2016
  timeout_ms: z.ZodOptional<z.ZodNumber>;
2017
+ capacity: z.ZodOptional<z.ZodObject<{
2018
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
2019
+ }, "strip", z.ZodTypeAny, {
2020
+ max_concurrent?: number | undefined;
2021
+ }, {
2022
+ max_concurrent?: number | undefined;
2023
+ }>>;
1643
2024
  }, "strip", z.ZodTypeAny, {
1644
2025
  name: string;
1645
2026
  type: "pipeline";
@@ -1656,6 +2037,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1656
2037
  input_mapping: Record<string, string>;
1657
2038
  command: string;
1658
2039
  })[];
2040
+ description?: string | undefined;
2041
+ capability_types?: string[] | undefined;
2042
+ requires_capabilities?: string[] | undefined;
2043
+ visibility?: "public" | "private" | undefined;
2044
+ capacity?: {
2045
+ max_concurrent?: number | undefined;
2046
+ } | undefined;
1659
2047
  timeout_ms?: number | undefined;
1660
2048
  }, {
1661
2049
  name: string;
@@ -1673,8 +2061,19 @@ declare const SkillsFileSchema: z.ZodObject<{
1673
2061
  command: string;
1674
2062
  input_mapping?: Record<string, string> | undefined;
1675
2063
  })[];
2064
+ description?: string | undefined;
2065
+ capability_types?: string[] | undefined;
2066
+ requires_capabilities?: string[] | undefined;
2067
+ visibility?: "public" | "private" | undefined;
2068
+ capacity?: {
2069
+ max_concurrent?: number | undefined;
2070
+ } | undefined;
1676
2071
  timeout_ms?: number | undefined;
1677
2072
  }>, z.ZodObject<{
2073
+ description: z.ZodOptional<z.ZodString>;
2074
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2075
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2076
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1678
2077
  id: z.ZodString;
1679
2078
  type: z.ZodLiteral<"openclaw">;
1680
2079
  name: z.ZodString;
@@ -1694,6 +2093,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1694
2093
  free_tier?: number | undefined;
1695
2094
  }>;
1696
2095
  timeout_ms: z.ZodOptional<z.ZodNumber>;
2096
+ capacity: z.ZodOptional<z.ZodObject<{
2097
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
2098
+ }, "strip", z.ZodTypeAny, {
2099
+ max_concurrent?: number | undefined;
2100
+ }, {
2101
+ max_concurrent?: number | undefined;
2102
+ }>>;
1697
2103
  }, "strip", z.ZodTypeAny, {
1698
2104
  name: string;
1699
2105
  type: "openclaw";
@@ -1705,6 +2111,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1705
2111
  };
1706
2112
  agent_name: string;
1707
2113
  channel: "telegram" | "webhook" | "process";
2114
+ description?: string | undefined;
2115
+ capability_types?: string[] | undefined;
2116
+ requires_capabilities?: string[] | undefined;
2117
+ visibility?: "public" | "private" | undefined;
2118
+ capacity?: {
2119
+ max_concurrent?: number | undefined;
2120
+ } | undefined;
1708
2121
  timeout_ms?: number | undefined;
1709
2122
  }, {
1710
2123
  name: string;
@@ -1717,8 +2130,19 @@ declare const SkillsFileSchema: z.ZodObject<{
1717
2130
  };
1718
2131
  agent_name: string;
1719
2132
  channel: "telegram" | "webhook" | "process";
2133
+ description?: string | undefined;
2134
+ capability_types?: string[] | undefined;
2135
+ requires_capabilities?: string[] | undefined;
2136
+ visibility?: "public" | "private" | undefined;
2137
+ capacity?: {
2138
+ max_concurrent?: number | undefined;
2139
+ } | undefined;
1720
2140
  timeout_ms?: number | undefined;
1721
2141
  }>, z.ZodObject<{
2142
+ description: z.ZodOptional<z.ZodString>;
2143
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2144
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2145
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1722
2146
  id: z.ZodString;
1723
2147
  type: z.ZodLiteral<"command">;
1724
2148
  name: z.ZodString;
@@ -1726,6 +2150,22 @@ declare const SkillsFileSchema: z.ZodObject<{
1726
2150
  output_type: z.ZodEnum<["json", "text", "file"]>;
1727
2151
  allowed_commands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1728
2152
  working_dir: z.ZodOptional<z.ZodString>;
2153
+ claude_code: z.ZodOptional<z.ZodObject<{
2154
+ /** Optional system prompt passed via `-p` flag. */
2155
+ system_prompt: z.ZodOptional<z.ZodString>;
2156
+ /** Model to use (e.g. 'claude-opus-4-6', 'claude-sonnet-4-6'). */
2157
+ model: z.ZodOptional<z.ZodString>;
2158
+ /** When true, passes `--dangerously-skip-permissions` to claude CLI. */
2159
+ auto_mode: z.ZodDefault<z.ZodBoolean>;
2160
+ }, "strip", z.ZodTypeAny, {
2161
+ auto_mode: boolean;
2162
+ model?: string | undefined;
2163
+ system_prompt?: string | undefined;
2164
+ }, {
2165
+ model?: string | undefined;
2166
+ system_prompt?: string | undefined;
2167
+ auto_mode?: boolean | undefined;
2168
+ }>>;
1729
2169
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1730
2170
  pricing: z.ZodObject<{
1731
2171
  credits_per_call: z.ZodNumber;
@@ -1740,6 +2180,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1740
2180
  credits_per_minute?: number | undefined;
1741
2181
  free_tier?: number | undefined;
1742
2182
  }>;
2183
+ capacity: z.ZodOptional<z.ZodObject<{
2184
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
2185
+ }, "strip", z.ZodTypeAny, {
2186
+ max_concurrent?: number | undefined;
2187
+ }, {
2188
+ max_concurrent?: number | undefined;
2189
+ }>>;
1743
2190
  }, "strip", z.ZodTypeAny, {
1744
2191
  name: string;
1745
2192
  type: "command";
@@ -1752,8 +2199,20 @@ declare const SkillsFileSchema: z.ZodObject<{
1752
2199
  timeout_ms: number;
1753
2200
  command: string;
1754
2201
  output_type: "text" | "json" | "file";
2202
+ description?: string | undefined;
2203
+ capability_types?: string[] | undefined;
2204
+ requires_capabilities?: string[] | undefined;
2205
+ visibility?: "public" | "private" | undefined;
2206
+ capacity?: {
2207
+ max_concurrent?: number | undefined;
2208
+ } | undefined;
1755
2209
  allowed_commands?: string[] | undefined;
1756
2210
  working_dir?: string | undefined;
2211
+ claude_code?: {
2212
+ auto_mode: boolean;
2213
+ model?: string | undefined;
2214
+ system_prompt?: string | undefined;
2215
+ } | undefined;
1757
2216
  }, {
1758
2217
  name: string;
1759
2218
  type: "command";
@@ -1765,10 +2224,26 @@ declare const SkillsFileSchema: z.ZodObject<{
1765
2224
  };
1766
2225
  command: string;
1767
2226
  output_type: "text" | "json" | "file";
2227
+ description?: string | undefined;
2228
+ capability_types?: string[] | undefined;
2229
+ requires_capabilities?: string[] | undefined;
2230
+ visibility?: "public" | "private" | undefined;
2231
+ capacity?: {
2232
+ max_concurrent?: number | undefined;
2233
+ } | undefined;
1768
2234
  timeout_ms?: number | undefined;
1769
2235
  allowed_commands?: string[] | undefined;
1770
2236
  working_dir?: string | undefined;
2237
+ claude_code?: {
2238
+ model?: string | undefined;
2239
+ system_prompt?: string | undefined;
2240
+ auto_mode?: boolean | undefined;
2241
+ } | undefined;
1771
2242
  }>, z.ZodObject<{
2243
+ description: z.ZodOptional<z.ZodString>;
2244
+ capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2245
+ requires_capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2246
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
1772
2247
  id: z.ZodString;
1773
2248
  type: z.ZodLiteral<"conductor">;
1774
2249
  name: z.ZodString;
@@ -1787,6 +2262,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1787
2262
  free_tier?: number | undefined;
1788
2263
  }>;
1789
2264
  timeout_ms: z.ZodOptional<z.ZodNumber>;
2265
+ capacity: z.ZodOptional<z.ZodObject<{
2266
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
2267
+ }, "strip", z.ZodTypeAny, {
2268
+ max_concurrent?: number | undefined;
2269
+ }, {
2270
+ max_concurrent?: number | undefined;
2271
+ }>>;
1790
2272
  }, "strip", z.ZodTypeAny, {
1791
2273
  name: string;
1792
2274
  type: "conductor";
@@ -1797,6 +2279,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1797
2279
  free_tier?: number | undefined;
1798
2280
  };
1799
2281
  conductor_skill: "orchestrate" | "plan";
2282
+ description?: string | undefined;
2283
+ capability_types?: string[] | undefined;
2284
+ requires_capabilities?: string[] | undefined;
2285
+ visibility?: "public" | "private" | undefined;
2286
+ capacity?: {
2287
+ max_concurrent?: number | undefined;
2288
+ } | undefined;
1800
2289
  timeout_ms?: number | undefined;
1801
2290
  }, {
1802
2291
  name: string;
@@ -1808,6 +2297,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1808
2297
  free_tier?: number | undefined;
1809
2298
  };
1810
2299
  conductor_skill: "orchestrate" | "plan";
2300
+ description?: string | undefined;
2301
+ capability_types?: string[] | undefined;
2302
+ requires_capabilities?: string[] | undefined;
2303
+ visibility?: "public" | "private" | undefined;
2304
+ capacity?: {
2305
+ max_concurrent?: number | undefined;
2306
+ } | undefined;
1811
2307
  timeout_ms?: number | undefined;
1812
2308
  }>]>, "many">;
1813
2309
  }, "strip", z.ZodTypeAny, {
@@ -1826,7 +2322,14 @@ declare const SkillsFileSchema: z.ZodObject<{
1826
2322
  output_mapping: Record<string, string>;
1827
2323
  timeout_ms: number;
1828
2324
  retries: number;
2325
+ description?: string | undefined;
1829
2326
  provider?: string | undefined;
2327
+ capability_types?: string[] | undefined;
2328
+ requires_capabilities?: string[] | undefined;
2329
+ visibility?: "public" | "private" | undefined;
2330
+ capacity?: {
2331
+ max_concurrent?: number | undefined;
2332
+ } | undefined;
1830
2333
  auth?: {
1831
2334
  type: "bearer";
1832
2335
  token: string;
@@ -1855,6 +2358,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1855
2358
  input_mapping: Record<string, string>;
1856
2359
  command: string;
1857
2360
  })[];
2361
+ description?: string | undefined;
2362
+ capability_types?: string[] | undefined;
2363
+ requires_capabilities?: string[] | undefined;
2364
+ visibility?: "public" | "private" | undefined;
2365
+ capacity?: {
2366
+ max_concurrent?: number | undefined;
2367
+ } | undefined;
1858
2368
  timeout_ms?: number | undefined;
1859
2369
  } | {
1860
2370
  name: string;
@@ -1867,6 +2377,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1867
2377
  };
1868
2378
  agent_name: string;
1869
2379
  channel: "telegram" | "webhook" | "process";
2380
+ description?: string | undefined;
2381
+ capability_types?: string[] | undefined;
2382
+ requires_capabilities?: string[] | undefined;
2383
+ visibility?: "public" | "private" | undefined;
2384
+ capacity?: {
2385
+ max_concurrent?: number | undefined;
2386
+ } | undefined;
1870
2387
  timeout_ms?: number | undefined;
1871
2388
  } | {
1872
2389
  name: string;
@@ -1880,8 +2397,20 @@ declare const SkillsFileSchema: z.ZodObject<{
1880
2397
  timeout_ms: number;
1881
2398
  command: string;
1882
2399
  output_type: "text" | "json" | "file";
2400
+ description?: string | undefined;
2401
+ capability_types?: string[] | undefined;
2402
+ requires_capabilities?: string[] | undefined;
2403
+ visibility?: "public" | "private" | undefined;
2404
+ capacity?: {
2405
+ max_concurrent?: number | undefined;
2406
+ } | undefined;
1883
2407
  allowed_commands?: string[] | undefined;
1884
2408
  working_dir?: string | undefined;
2409
+ claude_code?: {
2410
+ auto_mode: boolean;
2411
+ model?: string | undefined;
2412
+ system_prompt?: string | undefined;
2413
+ } | undefined;
1885
2414
  } | {
1886
2415
  name: string;
1887
2416
  type: "conductor";
@@ -1892,6 +2421,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1892
2421
  free_tier?: number | undefined;
1893
2422
  };
1894
2423
  conductor_skill: "orchestrate" | "plan";
2424
+ description?: string | undefined;
2425
+ capability_types?: string[] | undefined;
2426
+ requires_capabilities?: string[] | undefined;
2427
+ visibility?: "public" | "private" | undefined;
2428
+ capacity?: {
2429
+ max_concurrent?: number | undefined;
2430
+ } | undefined;
1895
2431
  timeout_ms?: number | undefined;
1896
2432
  })[];
1897
2433
  }, {
@@ -1906,7 +2442,14 @@ declare const SkillsFileSchema: z.ZodObject<{
1906
2442
  };
1907
2443
  endpoint: string;
1908
2444
  method: "GET" | "POST" | "PUT" | "DELETE";
2445
+ description?: string | undefined;
1909
2446
  provider?: string | undefined;
2447
+ capability_types?: string[] | undefined;
2448
+ requires_capabilities?: string[] | undefined;
2449
+ visibility?: "public" | "private" | undefined;
2450
+ capacity?: {
2451
+ max_concurrent?: number | undefined;
2452
+ } | undefined;
1910
2453
  auth?: {
1911
2454
  type: "bearer";
1912
2455
  token: string;
@@ -1939,6 +2482,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1939
2482
  command: string;
1940
2483
  input_mapping?: Record<string, string> | undefined;
1941
2484
  })[];
2485
+ description?: string | undefined;
2486
+ capability_types?: string[] | undefined;
2487
+ requires_capabilities?: string[] | undefined;
2488
+ visibility?: "public" | "private" | undefined;
2489
+ capacity?: {
2490
+ max_concurrent?: number | undefined;
2491
+ } | undefined;
1942
2492
  timeout_ms?: number | undefined;
1943
2493
  } | {
1944
2494
  name: string;
@@ -1951,6 +2501,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1951
2501
  };
1952
2502
  agent_name: string;
1953
2503
  channel: "telegram" | "webhook" | "process";
2504
+ description?: string | undefined;
2505
+ capability_types?: string[] | undefined;
2506
+ requires_capabilities?: string[] | undefined;
2507
+ visibility?: "public" | "private" | undefined;
2508
+ capacity?: {
2509
+ max_concurrent?: number | undefined;
2510
+ } | undefined;
1954
2511
  timeout_ms?: number | undefined;
1955
2512
  } | {
1956
2513
  name: string;
@@ -1963,9 +2520,21 @@ declare const SkillsFileSchema: z.ZodObject<{
1963
2520
  };
1964
2521
  command: string;
1965
2522
  output_type: "text" | "json" | "file";
2523
+ description?: string | undefined;
2524
+ capability_types?: string[] | undefined;
2525
+ requires_capabilities?: string[] | undefined;
2526
+ visibility?: "public" | "private" | undefined;
2527
+ capacity?: {
2528
+ max_concurrent?: number | undefined;
2529
+ } | undefined;
1966
2530
  timeout_ms?: number | undefined;
1967
2531
  allowed_commands?: string[] | undefined;
1968
2532
  working_dir?: string | undefined;
2533
+ claude_code?: {
2534
+ model?: string | undefined;
2535
+ system_prompt?: string | undefined;
2536
+ auto_mode?: boolean | undefined;
2537
+ } | undefined;
1969
2538
  } | {
1970
2539
  name: string;
1971
2540
  type: "conductor";
@@ -1976,6 +2545,13 @@ declare const SkillsFileSchema: z.ZodObject<{
1976
2545
  free_tier?: number | undefined;
1977
2546
  };
1978
2547
  conductor_skill: "orchestrate" | "plan";
2548
+ description?: string | undefined;
2549
+ capability_types?: string[] | undefined;
2550
+ requires_capabilities?: string[] | undefined;
2551
+ visibility?: "public" | "private" | undefined;
2552
+ capacity?: {
2553
+ max_concurrent?: number | undefined;
2554
+ } | undefined;
1979
2555
  timeout_ms?: number | undefined;
1980
2556
  })[];
1981
2557
  }>;
@@ -2041,6 +2617,45 @@ interface ExecutionResult {
2041
2617
  error?: string;
2042
2618
  /** Wall-clock execution time in milliseconds. */
2043
2619
  latency_ms: number;
2620
+ /** Structured failure reason (e.g. 'overload' when at max_concurrent capacity). */
2621
+ failure_reason?: string;
2622
+ }
2623
+ /**
2624
+ * Tracks in-flight concurrent executions per skill ID.
2625
+ * Used by SkillExecutor to enforce `capacity.max_concurrent` limits.
2626
+ *
2627
+ * Thread-safe within a single Node.js event loop (no true parallelism).
2628
+ * acquire/release must always be paired (use try/finally).
2629
+ */
2630
+ declare class ConcurrencyGuard {
2631
+ private active;
2632
+ /**
2633
+ * Check whether the skill can accept another concurrent execution.
2634
+ *
2635
+ * @param skillId - The skill ID to check.
2636
+ * @param maxConcurrent - The maximum allowed concurrent executions.
2637
+ * @returns true if current load is below the limit.
2638
+ */
2639
+ canAccept(skillId: string, maxConcurrent: number): boolean;
2640
+ /**
2641
+ * Increment the in-flight counter for a skill. Call before execution starts.
2642
+ *
2643
+ * @param skillId - The skill ID to acquire a slot for.
2644
+ */
2645
+ acquire(skillId: string): void;
2646
+ /**
2647
+ * Decrement the in-flight counter for a skill. Call after execution completes (in finally block).
2648
+ *
2649
+ * @param skillId - The skill ID to release a slot for.
2650
+ */
2651
+ release(skillId: string): void;
2652
+ /**
2653
+ * Returns the current number of in-flight executions for a skill.
2654
+ *
2655
+ * @param skillId - The skill ID to check.
2656
+ * @returns Current in-flight count (0 if no executions tracked).
2657
+ */
2658
+ getCurrentLoad(skillId: string): number;
2044
2659
  }
2045
2660
  /**
2046
2661
  * Interface that all executor mode implementations must satisfy.
@@ -2069,11 +2684,13 @@ interface ExecutorMode {
2069
2684
  declare class SkillExecutor {
2070
2685
  private readonly skillMap;
2071
2686
  private readonly modeMap;
2687
+ private readonly concurrencyGuard?;
2072
2688
  /**
2073
2689
  * @param configs - Parsed SkillConfig array (from parseSkillsFile).
2074
2690
  * @param modes - Map from skill type string to its executor implementation.
2691
+ * @param concurrencyGuard - Optional ConcurrencyGuard to enforce max_concurrent limits.
2075
2692
  */
2076
- constructor(configs: SkillConfig[], modes: Map<string, ExecutorMode>);
2693
+ constructor(configs: SkillConfig[], modes: Map<string, ExecutorMode>, concurrencyGuard?: ConcurrencyGuard);
2077
2694
  /**
2078
2695
  * Execute a skill by ID with the given input parameters.
2079
2696
  *
@@ -2107,9 +2724,10 @@ declare class SkillExecutor {
2107
2724
  *
2108
2725
  * @param configs - Array of parsed SkillConfig objects.
2109
2726
  * @param modes - Map from type key to ExecutorMode implementation.
2727
+ * @param concurrencyGuard - Optional ConcurrencyGuard to enforce max_concurrent limits.
2110
2728
  * @returns A configured SkillExecutor instance.
2111
2729
  */
2112
- declare function createSkillExecutor(configs: SkillConfig[], modes: Map<string, ExecutorMode>): SkillExecutor;
2730
+ declare function createSkillExecutor(configs: SkillConfig[], modes: Map<string, ExecutorMode>, concurrencyGuard?: ConcurrencyGuard): SkillExecutor;
2113
2731
 
2114
2732
  /**
2115
2733
  * Options for creating a gateway server.
@@ -2411,6 +3029,14 @@ interface OrchestrationResult {
2411
3029
  latency_ms: number;
2412
3030
  /** Error messages for failed sub-tasks. */
2413
3031
  errors?: string[];
3032
+ /**
3033
+ * Per-task team traceability context. Keys are subtask IDs.
3034
+ * Present only when the orchestration ran with a team.
3035
+ */
3036
+ trace?: Map<string, {
3037
+ team_id: string | null;
3038
+ capability_type: string | null;
3039
+ }>;
2414
3040
  }
2415
3041
 
2416
3042
  /**
@@ -2993,6 +3619,104 @@ declare const RelayMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2993
3619
  id: string;
2994
3620
  message?: string | undefined;
2995
3621
  progress?: number | undefined;
3622
+ }>, z.ZodObject<{
3623
+ type: z.ZodLiteral<"heartbeat">;
3624
+ owner: z.ZodString;
3625
+ capacity: z.ZodObject<{
3626
+ current_load: z.ZodNumber;
3627
+ max_concurrent: z.ZodNumber;
3628
+ queue_depth: z.ZodNumber;
3629
+ }, "strip", z.ZodTypeAny, {
3630
+ max_concurrent: number;
3631
+ current_load: number;
3632
+ queue_depth: number;
3633
+ }, {
3634
+ max_concurrent: number;
3635
+ current_load: number;
3636
+ queue_depth: number;
3637
+ }>;
3638
+ self_summary: z.ZodObject<{
3639
+ capabilities: z.ZodArray<z.ZodString, "many">;
3640
+ success_rate: z.ZodNumber;
3641
+ credit_balance: z.ZodNumber;
3642
+ total_completed: z.ZodNumber;
3643
+ provider_number: z.ZodNumber;
3644
+ reliability: z.ZodObject<{
3645
+ current_streak: z.ZodNumber;
3646
+ repeat_hire_rate: z.ZodNumber;
3647
+ avg_feedback: z.ZodNumber;
3648
+ }, "strip", z.ZodTypeAny, {
3649
+ current_streak: number;
3650
+ repeat_hire_rate: number;
3651
+ avg_feedback: number;
3652
+ }, {
3653
+ current_streak: number;
3654
+ repeat_hire_rate: number;
3655
+ avg_feedback: number;
3656
+ }>;
3657
+ }, "strip", z.ZodTypeAny, {
3658
+ success_rate: number;
3659
+ capabilities: string[];
3660
+ credit_balance: number;
3661
+ total_completed: number;
3662
+ provider_number: number;
3663
+ reliability: {
3664
+ current_streak: number;
3665
+ repeat_hire_rate: number;
3666
+ avg_feedback: number;
3667
+ };
3668
+ }, {
3669
+ success_rate: number;
3670
+ capabilities: string[];
3671
+ credit_balance: number;
3672
+ total_completed: number;
3673
+ provider_number: number;
3674
+ reliability: {
3675
+ current_streak: number;
3676
+ repeat_hire_rate: number;
3677
+ avg_feedback: number;
3678
+ };
3679
+ }>;
3680
+ }, "strip", z.ZodTypeAny, {
3681
+ type: "heartbeat";
3682
+ owner: string;
3683
+ capacity: {
3684
+ max_concurrent: number;
3685
+ current_load: number;
3686
+ queue_depth: number;
3687
+ };
3688
+ self_summary: {
3689
+ success_rate: number;
3690
+ capabilities: string[];
3691
+ credit_balance: number;
3692
+ total_completed: number;
3693
+ provider_number: number;
3694
+ reliability: {
3695
+ current_streak: number;
3696
+ repeat_hire_rate: number;
3697
+ avg_feedback: number;
3698
+ };
3699
+ };
3700
+ }, {
3701
+ type: "heartbeat";
3702
+ owner: string;
3703
+ capacity: {
3704
+ max_concurrent: number;
3705
+ current_load: number;
3706
+ queue_depth: number;
3707
+ };
3708
+ self_summary: {
3709
+ success_rate: number;
3710
+ capabilities: string[];
3711
+ credit_balance: number;
3712
+ total_completed: number;
3713
+ provider_number: number;
3714
+ reliability: {
3715
+ current_streak: number;
3716
+ repeat_hire_rate: number;
3717
+ avg_feedback: number;
3718
+ };
3719
+ };
2996
3720
  }>]>;
2997
3721
  type RegisterMessage = z.infer<typeof RegisterMessageSchema>;
2998
3722
  type RegisteredMessage = z.infer<typeof RegisteredMessageSchema>;
@@ -3016,6 +3740,12 @@ interface PendingRelayRequest {
3016
3740
  /** Job ID if this request was dispatched from the job queue (relay bridge) */
3017
3741
  jobId?: string;
3018
3742
  }
3743
+ /** Capacity data reported by agent heartbeats */
3744
+ interface AgentCapacityData {
3745
+ current_load: number;
3746
+ max_concurrent: number;
3747
+ queue_depth: number;
3748
+ }
3019
3749
  /** Relay server state returned from registerWebSocketRelay */
3020
3750
  interface RelayState {
3021
3751
  /** Number of currently connected agents */
@@ -3032,6 +3762,10 @@ interface RelayState {
3032
3762
  getPendingRequests?(): Map<string, PendingRelayRequest>;
3033
3763
  /** Send a JSON message over a WebSocket */
3034
3764
  sendMessage?(ws: unknown, msg: Record<string, unknown>): void;
3765
+ /** Get capacity data for an agent (from heartbeat) */
3766
+ getAgentCapacity?(owner: string): AgentCapacityData | undefined;
3767
+ /** Get all agent capacity data */
3768
+ getAllCapacities?(): Map<string, AgentCapacityData>;
3035
3769
  }
3036
3770
 
3037
3771
  /** Result of handling an incoming relay request */
@@ -3132,6 +3866,59 @@ declare class RelayClient {
3132
3866
  private scheduleReconnect;
3133
3867
  }
3134
3868
 
3869
+ /**
3870
+ * Capability-first team data model for Conductor team formation.
3871
+ *
3872
+ * TeamMember.capability_type is the required_capability value this member is fulfilling.
3873
+ * It is a direct match to SubTask.required_capability — not an abstract role hint.
3874
+ */
3875
+
3876
+ /**
3877
+ * A single team member: a SubTask matched to an agent.
3878
+ */
3879
+ interface TeamMember {
3880
+ /** The sub-task this member handles. */
3881
+ subtask: SubTask;
3882
+ /** The required_capability value this member is fulfilling (e.g. 'text_gen', 'tts'). */
3883
+ capability_type: string;
3884
+ /** Owner ID of the matched agent. */
3885
+ agent: string;
3886
+ /** Skill ID on the agent's card for this task. */
3887
+ skill: string;
3888
+ /** Card ID for relay-based execution. */
3889
+ card_id?: string;
3890
+ /** Negotiated credit cost. */
3891
+ credits: number;
3892
+ /** Match quality score (0-1). */
3893
+ score: number;
3894
+ }
3895
+ /**
3896
+ * A fully-formed team: matched members + unrouted subtasks.
3897
+ * Unrouted subtasks had no matching agent for their required_capability.
3898
+ */
3899
+ interface Team {
3900
+ /** Unique team identifier (UUID). */
3901
+ team_id: string;
3902
+ /** Formation strategy used to select agents. */
3903
+ strategy: FormationStrategy;
3904
+ /** Successfully matched team members. */
3905
+ matched: TeamMember[];
3906
+ /**
3907
+ * Sub-tasks that could not be matched — no available agent found in the registry
3908
+ * for the required_capability.
3909
+ * Callers should decide whether to fail-fast or proceed with partial teams.
3910
+ */
3911
+ unrouted: SubTask[];
3912
+ }
3913
+ /**
3914
+ * Agent selection strategy for team formation.
3915
+ *
3916
+ * cost_optimized — select the lowest-cost agent per sub-task
3917
+ * quality_optimized — select the highest-scored agent per sub-task (success_rate × cost_efficiency × idle_rate)
3918
+ * balanced — use the default scorePeers() composite ranking (same as standard matchSubTasks)
3919
+ */
3920
+ type FormationStrategy = 'cost_optimized' | 'quality_optimized' | 'balanced';
3921
+
3135
3922
  /**
3136
3923
  * PipelineOrchestrator — DAG-based remote execution engine for the Conductor.
3137
3924
  *
@@ -3166,6 +3953,12 @@ interface OrchestrateOptions {
3166
3953
  relayClient?: RelayClient;
3167
3954
  /** Owner identifier of the requester agent. Used for relay requests. */
3168
3955
  requesterOwner?: string;
3956
+ /**
3957
+ * Optional pre-formed team from formTeam(). When provided, agent assignments
3958
+ * for matched team members override the MatchResult selected_agent.
3959
+ * Same-role subtasks in the same wave are routed to the same agent.
3960
+ */
3961
+ team?: Team;
3169
3962
  }
3170
3963
  /**
3171
3964
  * Executes a DAG of sub-tasks across remote agents via Gateway.