agentbnb 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -39
- package/dist/{card-REW7BSWW.js → card-EX2EYGCZ.js} +1 -1
- package/dist/{chunk-C6KPAFCC.js → chunk-3LWBH7P3.js} +94 -3
- package/dist/{chunk-YRRVFTDR.js → chunk-5AAFG2V2.js} +3 -3
- package/dist/{chunk-C2T4BMRW.js → chunk-5GME4KJZ.js} +8 -6
- package/dist/{chunk-VPQ44XKE.js → chunk-64AK4FJM.js} +2 -2
- package/dist/{chunk-2TLZ6G2B.js → chunk-7EF3HYVZ.js} +158 -18
- package/dist/{chunk-JR6TJDIF.js → chunk-ALX4WS3A.js} +9 -4
- package/dist/{chunk-7XHDSWRD.js → chunk-B2VJTKO5.js} +2 -2
- package/dist/{chunk-TR6UZDNX.js → chunk-C537SFHV.js} +8 -6
- package/dist/{chunk-F53QQIM2.js → chunk-CUONY5TO.js} +1 -1
- package/dist/chunk-D6RKW2XG.js +395 -0
- package/dist/{chunk-NYV3NE5Z.js → chunk-E2OKP5CY.js} +4 -4
- package/dist/{chunk-TQDV254A.js → chunk-FTZTEHYG.js} +117 -117
- package/dist/{chunk-Y7T6IMM3.js → chunk-GKVTD4EZ.js} +1 -1
- package/dist/{chunk-VMH2YS2I.js → chunk-KF3TZHA5.js} +1 -1
- package/dist/{chunk-574W3HHE.js → chunk-LJM7FHPM.js} +1 -1
- package/dist/chunk-NWIQJ2CL.js +108 -0
- package/dist/{chunk-KA2VIEGM.js → chunk-O2OYBAVR.js} +1 -1
- package/dist/{chunk-NQTE577Q.js → chunk-OCSU2S6W.js} +9 -0
- package/dist/{chunk-PSQHUZ7X.js → chunk-OH7BP5NP.js} +1 -1
- package/dist/chunk-SSK653A6.js +169 -0
- package/dist/{chunk-BP3L2TET.js → chunk-TBJ3FZKZ.js} +2 -2
- package/dist/{chunk-3CIMVISQ.js → chunk-WVY2W7AA.js} +4 -0
- package/dist/{chunk-OZXCRLP3.js → chunk-X32NE6V4.js} +5 -2
- package/dist/{chunk-7YLFLC5C.js → chunk-YHY7OG6S.js} +5 -5
- package/dist/{chunk-JOY533UH.js → chunk-Z4MCGKTL.js} +6 -2
- package/dist/cli/index.js +530 -269
- package/dist/{client-HRYRJKSA.js → client-HKV3QWZ3.js} +3 -3
- package/dist/{conduct-LF6FYPLD.js → conduct-W6XF6DJW.js} +14 -13
- package/dist/conduct-YB64OHI6.js +22 -0
- package/dist/{conductor-mode-NUDQLZFM.js → conductor-mode-2GSLHVN6.js} +7 -4
- package/dist/{conductor-mode-YQ6QSPPT.js → conductor-mode-AKREGDIU.js} +11 -10
- package/dist/execute-AYQWORVH.js +15 -0
- package/dist/{execute-ITHIYYOX.js → execute-EPE6MZLT.js} +4 -3
- package/dist/index.d.ts +502 -12
- package/dist/index.js +706 -53
- package/dist/{process-guard-QCCBGILS.js → process-guard-GH5LRNWO.js} +1 -1
- package/dist/{publish-capability-TS6CNR5G.js → publish-capability-AH2HDW54.js} +3 -3
- package/dist/reliability-metrics-QG7WC5QK.js +18 -0
- package/dist/{request-P6QCTCCG.js → request-HCCXSKAY.js} +15 -14
- package/dist/{serve-skill-EZOL7UYN.js → serve-skill-SZAQT5T5.js} +9 -8
- package/dist/{server-3G6ZTASA.js → server-MHMAYXWZ.js} +12 -11
- package/dist/{service-coordinator-CRSE4GWC.js → service-coordinator-WGH6B2VT.js} +572 -68
- package/dist/{skill-config-4W5W5O6T.js → skill-config-FETXPNVP.js} +1 -1
- package/dist/skills/agentbnb/bootstrap.js +594 -73
- package/dist/{websocket-client-WRN3HO73.js → websocket-client-4Z5P54RU.js} +1 -1
- package/dist/websocket-client-QOVARTRN.js +7 -0
- package/openclaw.plugin.json +2 -2
- package/package.json +18 -11
- package/skills/agentbnb/bootstrap.test.ts +9 -0
- package/skills/agentbnb/bootstrap.ts +51 -26
- package/skills/agentbnb/install.sh +0 -0
- package/dist/chunk-QT7TEVNV.js +0 -82
- package/dist/chunk-RVYQSC6L.js +0 -212
- package/dist/conduct-QAFZIEY6.js +0 -21
- package/dist/execute-PNJFABVJ.js +0 -14
- package/dist/websocket-client-6IIDGXKB.js +0 -7
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ declare const CapabilityCardSchema: z.ZodObject<{
|
|
|
13
13
|
spec_version: z.ZodDefault<z.ZodLiteral<"1.0">>;
|
|
14
14
|
id: z.ZodString;
|
|
15
15
|
owner: z.ZodString;
|
|
16
|
+
/** V8: Cryptographic agent identity (Ed25519 public key hash). */
|
|
17
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
16
18
|
name: z.ZodString;
|
|
17
19
|
description: z.ZodString;
|
|
18
20
|
level: z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
@@ -148,6 +150,7 @@ declare const CapabilityCardSchema: z.ZodObject<{
|
|
|
148
150
|
online: boolean;
|
|
149
151
|
schedule?: string | undefined;
|
|
150
152
|
};
|
|
153
|
+
agent_id?: string | undefined;
|
|
151
154
|
powered_by?: {
|
|
152
155
|
provider: string;
|
|
153
156
|
model?: string | undefined;
|
|
@@ -194,6 +197,7 @@ declare const CapabilityCardSchema: z.ZodObject<{
|
|
|
194
197
|
schedule?: string | undefined;
|
|
195
198
|
};
|
|
196
199
|
spec_version?: "1.0" | undefined;
|
|
200
|
+
agent_id?: string | undefined;
|
|
197
201
|
powered_by?: {
|
|
198
202
|
provider: string;
|
|
199
203
|
model?: string | undefined;
|
|
@@ -222,6 +226,8 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
|
|
|
222
226
|
spec_version: z.ZodLiteral<"2.0">;
|
|
223
227
|
id: z.ZodString;
|
|
224
228
|
owner: z.ZodString;
|
|
229
|
+
/** V8: Cryptographic agent identity (Ed25519 public key hash). */
|
|
230
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
225
231
|
/** Agent display name — was 'name' in v1.0. */
|
|
226
232
|
agent_name: z.ZodString;
|
|
227
233
|
/** Short one-liner shown in Hub v2 Identity Header. */
|
|
@@ -635,6 +641,7 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
|
|
|
635
641
|
requires_capabilities?: string[] | undefined;
|
|
636
642
|
visibility?: "public" | "private" | undefined;
|
|
637
643
|
}[];
|
|
644
|
+
agent_id?: string | undefined;
|
|
638
645
|
_internal?: Record<string, unknown> | undefined;
|
|
639
646
|
gateway_url?: string | undefined;
|
|
640
647
|
created_at?: string | undefined;
|
|
@@ -724,6 +731,7 @@ declare const CapabilityCardV2Schema: z.ZodObject<{
|
|
|
724
731
|
requires_capabilities?: string[] | undefined;
|
|
725
732
|
visibility?: "public" | "private" | undefined;
|
|
726
733
|
}[];
|
|
734
|
+
agent_id?: string | undefined;
|
|
727
735
|
_internal?: Record<string, unknown> | undefined;
|
|
728
736
|
gateway_url?: string | undefined;
|
|
729
737
|
created_at?: string | undefined;
|
|
@@ -766,6 +774,8 @@ type CapabilityCardV2 = z.infer<typeof CapabilityCardV2Schema>;
|
|
|
766
774
|
interface EscrowReceipt {
|
|
767
775
|
/** Agent owner identifier of the requester. */
|
|
768
776
|
requester_owner: string;
|
|
777
|
+
/** V8: Cryptographic agent identity of the requester. */
|
|
778
|
+
requester_agent_id?: string;
|
|
769
779
|
/** Hex-encoded Ed25519 public key of the requester. */
|
|
770
780
|
requester_public_key: string;
|
|
771
781
|
/** Number of credits committed. */
|
|
@@ -1192,6 +1202,22 @@ declare const CommandSkillConfigSchema: z.ZodObject<{
|
|
|
1192
1202
|
output_type: z.ZodEnum<["json", "text", "file"]>;
|
|
1193
1203
|
allowed_commands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1194
1204
|
working_dir: z.ZodOptional<z.ZodString>;
|
|
1205
|
+
claude_code: z.ZodOptional<z.ZodObject<{
|
|
1206
|
+
/** Optional system prompt passed via `-p` flag. */
|
|
1207
|
+
system_prompt: z.ZodOptional<z.ZodString>;
|
|
1208
|
+
/** Model to use (e.g. 'claude-opus-4-6', 'claude-sonnet-4-6'). */
|
|
1209
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1210
|
+
/** When true, passes `--dangerously-skip-permissions` to claude CLI. */
|
|
1211
|
+
auto_mode: z.ZodDefault<z.ZodBoolean>;
|
|
1212
|
+
}, "strip", z.ZodTypeAny, {
|
|
1213
|
+
auto_mode: boolean;
|
|
1214
|
+
model?: string | undefined;
|
|
1215
|
+
system_prompt?: string | undefined;
|
|
1216
|
+
}, {
|
|
1217
|
+
model?: string | undefined;
|
|
1218
|
+
system_prompt?: string | undefined;
|
|
1219
|
+
auto_mode?: boolean | undefined;
|
|
1220
|
+
}>>;
|
|
1195
1221
|
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
1196
1222
|
pricing: z.ZodObject<{
|
|
1197
1223
|
credits_per_call: z.ZodNumber;
|
|
@@ -1234,6 +1260,11 @@ declare const CommandSkillConfigSchema: z.ZodObject<{
|
|
|
1234
1260
|
} | undefined;
|
|
1235
1261
|
allowed_commands?: string[] | undefined;
|
|
1236
1262
|
working_dir?: string | undefined;
|
|
1263
|
+
claude_code?: {
|
|
1264
|
+
auto_mode: boolean;
|
|
1265
|
+
model?: string | undefined;
|
|
1266
|
+
system_prompt?: string | undefined;
|
|
1267
|
+
} | undefined;
|
|
1237
1268
|
}, {
|
|
1238
1269
|
name: string;
|
|
1239
1270
|
type: "command";
|
|
@@ -1255,6 +1286,11 @@ declare const CommandSkillConfigSchema: z.ZodObject<{
|
|
|
1255
1286
|
timeout_ms?: number | undefined;
|
|
1256
1287
|
allowed_commands?: string[] | undefined;
|
|
1257
1288
|
working_dir?: string | undefined;
|
|
1289
|
+
claude_code?: {
|
|
1290
|
+
model?: string | undefined;
|
|
1291
|
+
system_prompt?: string | undefined;
|
|
1292
|
+
auto_mode?: boolean | undefined;
|
|
1293
|
+
} | undefined;
|
|
1258
1294
|
}>;
|
|
1259
1295
|
/**
|
|
1260
1296
|
* Schema for conductor orchestration skills (Mode E).
|
|
@@ -1647,6 +1683,22 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
1647
1683
|
output_type: z.ZodEnum<["json", "text", "file"]>;
|
|
1648
1684
|
allowed_commands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1649
1685
|
working_dir: z.ZodOptional<z.ZodString>;
|
|
1686
|
+
claude_code: z.ZodOptional<z.ZodObject<{
|
|
1687
|
+
/** Optional system prompt passed via `-p` flag. */
|
|
1688
|
+
system_prompt: z.ZodOptional<z.ZodString>;
|
|
1689
|
+
/** Model to use (e.g. 'claude-opus-4-6', 'claude-sonnet-4-6'). */
|
|
1690
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1691
|
+
/** When true, passes `--dangerously-skip-permissions` to claude CLI. */
|
|
1692
|
+
auto_mode: z.ZodDefault<z.ZodBoolean>;
|
|
1693
|
+
}, "strip", z.ZodTypeAny, {
|
|
1694
|
+
auto_mode: boolean;
|
|
1695
|
+
model?: string | undefined;
|
|
1696
|
+
system_prompt?: string | undefined;
|
|
1697
|
+
}, {
|
|
1698
|
+
model?: string | undefined;
|
|
1699
|
+
system_prompt?: string | undefined;
|
|
1700
|
+
auto_mode?: boolean | undefined;
|
|
1701
|
+
}>>;
|
|
1650
1702
|
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
1651
1703
|
pricing: z.ZodObject<{
|
|
1652
1704
|
credits_per_call: z.ZodNumber;
|
|
@@ -1689,6 +1741,11 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
1689
1741
|
} | undefined;
|
|
1690
1742
|
allowed_commands?: string[] | undefined;
|
|
1691
1743
|
working_dir?: string | undefined;
|
|
1744
|
+
claude_code?: {
|
|
1745
|
+
auto_mode: boolean;
|
|
1746
|
+
model?: string | undefined;
|
|
1747
|
+
system_prompt?: string | undefined;
|
|
1748
|
+
} | undefined;
|
|
1692
1749
|
}, {
|
|
1693
1750
|
name: string;
|
|
1694
1751
|
type: "command";
|
|
@@ -1710,6 +1767,11 @@ declare const SkillConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
1710
1767
|
timeout_ms?: number | undefined;
|
|
1711
1768
|
allowed_commands?: string[] | undefined;
|
|
1712
1769
|
working_dir?: string | undefined;
|
|
1770
|
+
claude_code?: {
|
|
1771
|
+
model?: string | undefined;
|
|
1772
|
+
system_prompt?: string | undefined;
|
|
1773
|
+
auto_mode?: boolean | undefined;
|
|
1774
|
+
} | undefined;
|
|
1713
1775
|
}>, z.ZodObject<{
|
|
1714
1776
|
description: z.ZodOptional<z.ZodString>;
|
|
1715
1777
|
capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -2098,6 +2160,22 @@ declare const SkillsFileSchema: z.ZodObject<{
|
|
|
2098
2160
|
output_type: z.ZodEnum<["json", "text", "file"]>;
|
|
2099
2161
|
allowed_commands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2100
2162
|
working_dir: z.ZodOptional<z.ZodString>;
|
|
2163
|
+
claude_code: z.ZodOptional<z.ZodObject<{
|
|
2164
|
+
/** Optional system prompt passed via `-p` flag. */
|
|
2165
|
+
system_prompt: z.ZodOptional<z.ZodString>;
|
|
2166
|
+
/** Model to use (e.g. 'claude-opus-4-6', 'claude-sonnet-4-6'). */
|
|
2167
|
+
model: z.ZodOptional<z.ZodString>;
|
|
2168
|
+
/** When true, passes `--dangerously-skip-permissions` to claude CLI. */
|
|
2169
|
+
auto_mode: z.ZodDefault<z.ZodBoolean>;
|
|
2170
|
+
}, "strip", z.ZodTypeAny, {
|
|
2171
|
+
auto_mode: boolean;
|
|
2172
|
+
model?: string | undefined;
|
|
2173
|
+
system_prompt?: string | undefined;
|
|
2174
|
+
}, {
|
|
2175
|
+
model?: string | undefined;
|
|
2176
|
+
system_prompt?: string | undefined;
|
|
2177
|
+
auto_mode?: boolean | undefined;
|
|
2178
|
+
}>>;
|
|
2101
2179
|
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
2102
2180
|
pricing: z.ZodObject<{
|
|
2103
2181
|
credits_per_call: z.ZodNumber;
|
|
@@ -2140,6 +2218,11 @@ declare const SkillsFileSchema: z.ZodObject<{
|
|
|
2140
2218
|
} | undefined;
|
|
2141
2219
|
allowed_commands?: string[] | undefined;
|
|
2142
2220
|
working_dir?: string | undefined;
|
|
2221
|
+
claude_code?: {
|
|
2222
|
+
auto_mode: boolean;
|
|
2223
|
+
model?: string | undefined;
|
|
2224
|
+
system_prompt?: string | undefined;
|
|
2225
|
+
} | undefined;
|
|
2143
2226
|
}, {
|
|
2144
2227
|
name: string;
|
|
2145
2228
|
type: "command";
|
|
@@ -2161,6 +2244,11 @@ declare const SkillsFileSchema: z.ZodObject<{
|
|
|
2161
2244
|
timeout_ms?: number | undefined;
|
|
2162
2245
|
allowed_commands?: string[] | undefined;
|
|
2163
2246
|
working_dir?: string | undefined;
|
|
2247
|
+
claude_code?: {
|
|
2248
|
+
model?: string | undefined;
|
|
2249
|
+
system_prompt?: string | undefined;
|
|
2250
|
+
auto_mode?: boolean | undefined;
|
|
2251
|
+
} | undefined;
|
|
2164
2252
|
}>, z.ZodObject<{
|
|
2165
2253
|
description: z.ZodOptional<z.ZodString>;
|
|
2166
2254
|
capability_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -2328,6 +2416,11 @@ declare const SkillsFileSchema: z.ZodObject<{
|
|
|
2328
2416
|
} | undefined;
|
|
2329
2417
|
allowed_commands?: string[] | undefined;
|
|
2330
2418
|
working_dir?: string | undefined;
|
|
2419
|
+
claude_code?: {
|
|
2420
|
+
auto_mode: boolean;
|
|
2421
|
+
model?: string | undefined;
|
|
2422
|
+
system_prompt?: string | undefined;
|
|
2423
|
+
} | undefined;
|
|
2331
2424
|
} | {
|
|
2332
2425
|
name: string;
|
|
2333
2426
|
type: "conductor";
|
|
@@ -2447,6 +2540,11 @@ declare const SkillsFileSchema: z.ZodObject<{
|
|
|
2447
2540
|
timeout_ms?: number | undefined;
|
|
2448
2541
|
allowed_commands?: string[] | undefined;
|
|
2449
2542
|
working_dir?: string | undefined;
|
|
2543
|
+
claude_code?: {
|
|
2544
|
+
model?: string | undefined;
|
|
2545
|
+
system_prompt?: string | undefined;
|
|
2546
|
+
auto_mode?: boolean | undefined;
|
|
2547
|
+
} | undefined;
|
|
2450
2548
|
} | {
|
|
2451
2549
|
name: string;
|
|
2452
2550
|
type: "conductor";
|
|
@@ -2529,6 +2627,45 @@ interface ExecutionResult {
|
|
|
2529
2627
|
error?: string;
|
|
2530
2628
|
/** Wall-clock execution time in milliseconds. */
|
|
2531
2629
|
latency_ms: number;
|
|
2630
|
+
/** Structured failure reason (e.g. 'overload' when at max_concurrent capacity). */
|
|
2631
|
+
failure_reason?: string;
|
|
2632
|
+
}
|
|
2633
|
+
/**
|
|
2634
|
+
* Tracks in-flight concurrent executions per skill ID.
|
|
2635
|
+
* Used by SkillExecutor to enforce `capacity.max_concurrent` limits.
|
|
2636
|
+
*
|
|
2637
|
+
* Thread-safe within a single Node.js event loop (no true parallelism).
|
|
2638
|
+
* acquire/release must always be paired (use try/finally).
|
|
2639
|
+
*/
|
|
2640
|
+
declare class ConcurrencyGuard {
|
|
2641
|
+
private active;
|
|
2642
|
+
/**
|
|
2643
|
+
* Check whether the skill can accept another concurrent execution.
|
|
2644
|
+
*
|
|
2645
|
+
* @param skillId - The skill ID to check.
|
|
2646
|
+
* @param maxConcurrent - The maximum allowed concurrent executions.
|
|
2647
|
+
* @returns true if current load is below the limit.
|
|
2648
|
+
*/
|
|
2649
|
+
canAccept(skillId: string, maxConcurrent: number): boolean;
|
|
2650
|
+
/**
|
|
2651
|
+
* Increment the in-flight counter for a skill. Call before execution starts.
|
|
2652
|
+
*
|
|
2653
|
+
* @param skillId - The skill ID to acquire a slot for.
|
|
2654
|
+
*/
|
|
2655
|
+
acquire(skillId: string): void;
|
|
2656
|
+
/**
|
|
2657
|
+
* Decrement the in-flight counter for a skill. Call after execution completes (in finally block).
|
|
2658
|
+
*
|
|
2659
|
+
* @param skillId - The skill ID to release a slot for.
|
|
2660
|
+
*/
|
|
2661
|
+
release(skillId: string): void;
|
|
2662
|
+
/**
|
|
2663
|
+
* Returns the current number of in-flight executions for a skill.
|
|
2664
|
+
*
|
|
2665
|
+
* @param skillId - The skill ID to check.
|
|
2666
|
+
* @returns Current in-flight count (0 if no executions tracked).
|
|
2667
|
+
*/
|
|
2668
|
+
getCurrentLoad(skillId: string): number;
|
|
2532
2669
|
}
|
|
2533
2670
|
/**
|
|
2534
2671
|
* Interface that all executor mode implementations must satisfy.
|
|
@@ -2557,11 +2694,13 @@ interface ExecutorMode {
|
|
|
2557
2694
|
declare class SkillExecutor {
|
|
2558
2695
|
private readonly skillMap;
|
|
2559
2696
|
private readonly modeMap;
|
|
2697
|
+
private readonly concurrencyGuard?;
|
|
2560
2698
|
/**
|
|
2561
2699
|
* @param configs - Parsed SkillConfig array (from parseSkillsFile).
|
|
2562
2700
|
* @param modes - Map from skill type string to its executor implementation.
|
|
2701
|
+
* @param concurrencyGuard - Optional ConcurrencyGuard to enforce max_concurrent limits.
|
|
2563
2702
|
*/
|
|
2564
|
-
constructor(configs: SkillConfig[], modes: Map<string, ExecutorMode
|
|
2703
|
+
constructor(configs: SkillConfig[], modes: Map<string, ExecutorMode>, concurrencyGuard?: ConcurrencyGuard);
|
|
2565
2704
|
/**
|
|
2566
2705
|
* Execute a skill by ID with the given input parameters.
|
|
2567
2706
|
*
|
|
@@ -2595,9 +2734,10 @@ declare class SkillExecutor {
|
|
|
2595
2734
|
*
|
|
2596
2735
|
* @param configs - Array of parsed SkillConfig objects.
|
|
2597
2736
|
* @param modes - Map from type key to ExecutorMode implementation.
|
|
2737
|
+
* @param concurrencyGuard - Optional ConcurrencyGuard to enforce max_concurrent limits.
|
|
2598
2738
|
* @returns A configured SkillExecutor instance.
|
|
2599
2739
|
*/
|
|
2600
|
-
declare function createSkillExecutor(configs: SkillConfig[], modes: Map<string, ExecutorMode
|
|
2740
|
+
declare function createSkillExecutor(configs: SkillConfig[], modes: Map<string, ExecutorMode>, concurrencyGuard?: ConcurrencyGuard): SkillExecutor;
|
|
2601
2741
|
|
|
2602
2742
|
/**
|
|
2603
2743
|
* Options for creating a gateway server.
|
|
@@ -2769,22 +2909,41 @@ declare class OpenClawBridge implements ExecutorMode {
|
|
|
2769
2909
|
* - Three output types: text (raw stdout), json (parsed), file (path from stdout)
|
|
2770
2910
|
* - Security allowlist via `allowed_commands` (base command checked against list)
|
|
2771
2911
|
* - Configurable timeout and working directory
|
|
2912
|
+
* - SIGTERM → SIGKILL escalation on timeout (prevents zombie processes)
|
|
2913
|
+
* - Process registry for graceful shutdown of all active children
|
|
2914
|
+
* - Per-skill concurrency enforcement via capacity.max_concurrent
|
|
2772
2915
|
*/
|
|
2773
2916
|
declare class CommandExecutor implements ExecutorMode {
|
|
2917
|
+
/** Active child processes — killed on shutdown(). */
|
|
2918
|
+
private readonly activeProcesses;
|
|
2919
|
+
/** In-flight execution count per skill ID for concurrency limiting. */
|
|
2920
|
+
private readonly inflight;
|
|
2774
2921
|
/**
|
|
2775
2922
|
* Execute a command skill with the provided parameters.
|
|
2776
2923
|
*
|
|
2777
2924
|
* Steps:
|
|
2778
|
-
* 1.
|
|
2779
|
-
* 2.
|
|
2780
|
-
* 3.
|
|
2781
|
-
* 4.
|
|
2925
|
+
* 1. Concurrency check: reject if at capacity.max_concurrent limit.
|
|
2926
|
+
* 2. Security check: base command must be in `allowed_commands` if set.
|
|
2927
|
+
* 3. Interpolate `config.command` using `{ params }` context.
|
|
2928
|
+
* 4. Run via spawn with SIGTERM→SIGKILL timeout handling.
|
|
2929
|
+
* 5. Parse stdout based on `output_type`: text | json | file.
|
|
2782
2930
|
*
|
|
2783
2931
|
* @param config - Validated CommandSkillConfig.
|
|
2784
2932
|
* @param params - Input parameters passed by the caller.
|
|
2785
2933
|
* @returns Partial ExecutionResult (without latency_ms).
|
|
2786
2934
|
*/
|
|
2787
2935
|
execute(config: SkillConfig, params: Record<string, unknown>): Promise<Omit<ExecutionResult, 'latency_ms'>>;
|
|
2936
|
+
/**
|
|
2937
|
+
* Kill all active child processes. Called during service shutdown
|
|
2938
|
+
* to prevent zombie processes.
|
|
2939
|
+
*/
|
|
2940
|
+
shutdown(): void;
|
|
2941
|
+
/** Returns the number of currently active child processes. */
|
|
2942
|
+
get activeCount(): number;
|
|
2943
|
+
/** Returns the in-flight count for a specific skill ID. */
|
|
2944
|
+
getInflight(skillId: string): number;
|
|
2945
|
+
/** Decrement the inflight counter for a skill ID. */
|
|
2946
|
+
private decrementInflight;
|
|
2788
2947
|
}
|
|
2789
2948
|
|
|
2790
2949
|
/**
|
|
@@ -3151,21 +3310,58 @@ declare function registerConductorCard(db: Database.Database): CapabilityCardV2;
|
|
|
3151
3310
|
declare const RegisterMessageSchema: z.ZodObject<{
|
|
3152
3311
|
type: z.ZodLiteral<"register">;
|
|
3153
3312
|
owner: z.ZodString;
|
|
3313
|
+
/** V8: Cryptographic agent identity. When present, used as the canonical key. */
|
|
3314
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
3315
|
+
/** V8 Phase 3: Server identifier for multi-agent delegation. */
|
|
3316
|
+
server_id: z.ZodOptional<z.ZodString>;
|
|
3154
3317
|
token: z.ZodString;
|
|
3155
3318
|
card: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
3156
3319
|
cards: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
3320
|
+
/** V8 Phase 3: Additional agents served by this server (multi-agent registration). */
|
|
3321
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3322
|
+
agent_id: z.ZodString;
|
|
3323
|
+
display_name: z.ZodString;
|
|
3324
|
+
cards: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
3325
|
+
delegation_token: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3326
|
+
}, "strip", z.ZodTypeAny, {
|
|
3327
|
+
agent_id: string;
|
|
3328
|
+
display_name: string;
|
|
3329
|
+
cards: Record<string, unknown>[];
|
|
3330
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3331
|
+
}, {
|
|
3332
|
+
agent_id: string;
|
|
3333
|
+
display_name: string;
|
|
3334
|
+
cards: Record<string, unknown>[];
|
|
3335
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3336
|
+
}>, "many">>;
|
|
3157
3337
|
}, "strip", z.ZodTypeAny, {
|
|
3158
3338
|
type: "register";
|
|
3159
3339
|
owner: string;
|
|
3160
3340
|
token: string;
|
|
3161
3341
|
card: Record<string, unknown>;
|
|
3342
|
+
agent_id?: string | undefined;
|
|
3343
|
+
server_id?: string | undefined;
|
|
3162
3344
|
cards?: Record<string, unknown>[] | undefined;
|
|
3345
|
+
agents?: {
|
|
3346
|
+
agent_id: string;
|
|
3347
|
+
display_name: string;
|
|
3348
|
+
cards: Record<string, unknown>[];
|
|
3349
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3350
|
+
}[] | undefined;
|
|
3163
3351
|
}, {
|
|
3164
3352
|
type: "register";
|
|
3165
3353
|
owner: string;
|
|
3166
3354
|
token: string;
|
|
3167
3355
|
card: Record<string, unknown>;
|
|
3356
|
+
agent_id?: string | undefined;
|
|
3357
|
+
server_id?: string | undefined;
|
|
3168
3358
|
cards?: Record<string, unknown>[] | undefined;
|
|
3359
|
+
agents?: {
|
|
3360
|
+
agent_id: string;
|
|
3361
|
+
display_name: string;
|
|
3362
|
+
cards: Record<string, unknown>[];
|
|
3363
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3364
|
+
}[] | undefined;
|
|
3169
3365
|
}>;
|
|
3170
3366
|
/** Registry → Agent: Acknowledge registration */
|
|
3171
3367
|
declare const RegisteredMessageSchema: z.ZodObject<{
|
|
@@ -3183,6 +3379,8 @@ declare const RelayRequestMessageSchema: z.ZodObject<{
|
|
|
3183
3379
|
type: z.ZodLiteral<"relay_request">;
|
|
3184
3380
|
id: z.ZodString;
|
|
3185
3381
|
target_owner: z.ZodString;
|
|
3382
|
+
/** V8: Target agent's cryptographic identity. Preferred over target_owner. */
|
|
3383
|
+
target_agent_id: z.ZodOptional<z.ZodString>;
|
|
3186
3384
|
card_id: z.ZodString;
|
|
3187
3385
|
skill_id: z.ZodOptional<z.ZodString>;
|
|
3188
3386
|
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -3197,6 +3395,7 @@ declare const RelayRequestMessageSchema: z.ZodObject<{
|
|
|
3197
3395
|
skill_id?: string | undefined;
|
|
3198
3396
|
requester?: string | undefined;
|
|
3199
3397
|
escrow_receipt?: Record<string, unknown> | undefined;
|
|
3398
|
+
target_agent_id?: string | undefined;
|
|
3200
3399
|
}, {
|
|
3201
3400
|
type: "relay_request";
|
|
3202
3401
|
id: string;
|
|
@@ -3206,6 +3405,7 @@ declare const RelayRequestMessageSchema: z.ZodObject<{
|
|
|
3206
3405
|
skill_id?: string | undefined;
|
|
3207
3406
|
requester?: string | undefined;
|
|
3208
3407
|
escrow_receipt?: Record<string, unknown> | undefined;
|
|
3408
|
+
target_agent_id?: string | undefined;
|
|
3209
3409
|
}>;
|
|
3210
3410
|
/** Registry → Agent B: Incoming request forwarded from Agent A */
|
|
3211
3411
|
declare const IncomingRequestMessageSchema: z.ZodObject<{
|
|
@@ -3321,21 +3521,58 @@ declare const ErrorMessageSchema: z.ZodObject<{
|
|
|
3321
3521
|
declare const RelayMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3322
3522
|
type: z.ZodLiteral<"register">;
|
|
3323
3523
|
owner: z.ZodString;
|
|
3524
|
+
/** V8: Cryptographic agent identity. When present, used as the canonical key. */
|
|
3525
|
+
agent_id: z.ZodOptional<z.ZodString>;
|
|
3526
|
+
/** V8 Phase 3: Server identifier for multi-agent delegation. */
|
|
3527
|
+
server_id: z.ZodOptional<z.ZodString>;
|
|
3324
3528
|
token: z.ZodString;
|
|
3325
3529
|
card: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
3326
3530
|
cards: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
3531
|
+
/** V8 Phase 3: Additional agents served by this server (multi-agent registration). */
|
|
3532
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3533
|
+
agent_id: z.ZodString;
|
|
3534
|
+
display_name: z.ZodString;
|
|
3535
|
+
cards: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
3536
|
+
delegation_token: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3537
|
+
}, "strip", z.ZodTypeAny, {
|
|
3538
|
+
agent_id: string;
|
|
3539
|
+
display_name: string;
|
|
3540
|
+
cards: Record<string, unknown>[];
|
|
3541
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3542
|
+
}, {
|
|
3543
|
+
agent_id: string;
|
|
3544
|
+
display_name: string;
|
|
3545
|
+
cards: Record<string, unknown>[];
|
|
3546
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3547
|
+
}>, "many">>;
|
|
3327
3548
|
}, "strip", z.ZodTypeAny, {
|
|
3328
3549
|
type: "register";
|
|
3329
3550
|
owner: string;
|
|
3330
3551
|
token: string;
|
|
3331
3552
|
card: Record<string, unknown>;
|
|
3553
|
+
agent_id?: string | undefined;
|
|
3554
|
+
server_id?: string | undefined;
|
|
3332
3555
|
cards?: Record<string, unknown>[] | undefined;
|
|
3556
|
+
agents?: {
|
|
3557
|
+
agent_id: string;
|
|
3558
|
+
display_name: string;
|
|
3559
|
+
cards: Record<string, unknown>[];
|
|
3560
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3561
|
+
}[] | undefined;
|
|
3333
3562
|
}, {
|
|
3334
3563
|
type: "register";
|
|
3335
3564
|
owner: string;
|
|
3336
3565
|
token: string;
|
|
3337
3566
|
card: Record<string, unknown>;
|
|
3567
|
+
agent_id?: string | undefined;
|
|
3568
|
+
server_id?: string | undefined;
|
|
3338
3569
|
cards?: Record<string, unknown>[] | undefined;
|
|
3570
|
+
agents?: {
|
|
3571
|
+
agent_id: string;
|
|
3572
|
+
display_name: string;
|
|
3573
|
+
cards: Record<string, unknown>[];
|
|
3574
|
+
delegation_token?: Record<string, unknown> | undefined;
|
|
3575
|
+
}[] | undefined;
|
|
3339
3576
|
}>, z.ZodObject<{
|
|
3340
3577
|
type: z.ZodLiteral<"registered">;
|
|
3341
3578
|
agent_id: z.ZodString;
|
|
@@ -3349,6 +3586,8 @@ declare const RelayMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
3349
3586
|
type: z.ZodLiteral<"relay_request">;
|
|
3350
3587
|
id: z.ZodString;
|
|
3351
3588
|
target_owner: z.ZodString;
|
|
3589
|
+
/** V8: Target agent's cryptographic identity. Preferred over target_owner. */
|
|
3590
|
+
target_agent_id: z.ZodOptional<z.ZodString>;
|
|
3352
3591
|
card_id: z.ZodString;
|
|
3353
3592
|
skill_id: z.ZodOptional<z.ZodString>;
|
|
3354
3593
|
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -3363,6 +3602,7 @@ declare const RelayMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
3363
3602
|
skill_id?: string | undefined;
|
|
3364
3603
|
requester?: string | undefined;
|
|
3365
3604
|
escrow_receipt?: Record<string, unknown> | undefined;
|
|
3605
|
+
target_agent_id?: string | undefined;
|
|
3366
3606
|
}, {
|
|
3367
3607
|
type: "relay_request";
|
|
3368
3608
|
id: string;
|
|
@@ -3372,6 +3612,7 @@ declare const RelayMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
3372
3612
|
skill_id?: string | undefined;
|
|
3373
3613
|
requester?: string | undefined;
|
|
3374
3614
|
escrow_receipt?: Record<string, unknown> | undefined;
|
|
3615
|
+
target_agent_id?: string | undefined;
|
|
3375
3616
|
}>, z.ZodObject<{
|
|
3376
3617
|
type: z.ZodLiteral<"incoming_request">;
|
|
3377
3618
|
id: z.ZodString;
|
|
@@ -3489,6 +3730,224 @@ declare const RelayMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
3489
3730
|
id: string;
|
|
3490
3731
|
message?: string | undefined;
|
|
3491
3732
|
progress?: number | undefined;
|
|
3733
|
+
}>, z.ZodObject<{
|
|
3734
|
+
type: z.ZodLiteral<"heartbeat">;
|
|
3735
|
+
owner: z.ZodString;
|
|
3736
|
+
capacity: z.ZodObject<{
|
|
3737
|
+
current_load: z.ZodNumber;
|
|
3738
|
+
max_concurrent: z.ZodNumber;
|
|
3739
|
+
queue_depth: z.ZodNumber;
|
|
3740
|
+
}, "strip", z.ZodTypeAny, {
|
|
3741
|
+
max_concurrent: number;
|
|
3742
|
+
current_load: number;
|
|
3743
|
+
queue_depth: number;
|
|
3744
|
+
}, {
|
|
3745
|
+
max_concurrent: number;
|
|
3746
|
+
current_load: number;
|
|
3747
|
+
queue_depth: number;
|
|
3748
|
+
}>;
|
|
3749
|
+
self_summary: z.ZodObject<{
|
|
3750
|
+
capabilities: z.ZodArray<z.ZodString, "many">;
|
|
3751
|
+
success_rate: z.ZodNumber;
|
|
3752
|
+
credit_balance: z.ZodNumber;
|
|
3753
|
+
total_completed: z.ZodNumber;
|
|
3754
|
+
provider_number: z.ZodNumber;
|
|
3755
|
+
reliability: z.ZodObject<{
|
|
3756
|
+
current_streak: z.ZodNumber;
|
|
3757
|
+
repeat_hire_rate: z.ZodNumber;
|
|
3758
|
+
avg_feedback: z.ZodNumber;
|
|
3759
|
+
}, "strip", z.ZodTypeAny, {
|
|
3760
|
+
current_streak: number;
|
|
3761
|
+
repeat_hire_rate: number;
|
|
3762
|
+
avg_feedback: number;
|
|
3763
|
+
}, {
|
|
3764
|
+
current_streak: number;
|
|
3765
|
+
repeat_hire_rate: number;
|
|
3766
|
+
avg_feedback: number;
|
|
3767
|
+
}>;
|
|
3768
|
+
}, "strip", z.ZodTypeAny, {
|
|
3769
|
+
success_rate: number;
|
|
3770
|
+
capabilities: string[];
|
|
3771
|
+
credit_balance: number;
|
|
3772
|
+
total_completed: number;
|
|
3773
|
+
provider_number: number;
|
|
3774
|
+
reliability: {
|
|
3775
|
+
current_streak: number;
|
|
3776
|
+
repeat_hire_rate: number;
|
|
3777
|
+
avg_feedback: number;
|
|
3778
|
+
};
|
|
3779
|
+
}, {
|
|
3780
|
+
success_rate: number;
|
|
3781
|
+
capabilities: string[];
|
|
3782
|
+
credit_balance: number;
|
|
3783
|
+
total_completed: number;
|
|
3784
|
+
provider_number: number;
|
|
3785
|
+
reliability: {
|
|
3786
|
+
current_streak: number;
|
|
3787
|
+
repeat_hire_rate: number;
|
|
3788
|
+
avg_feedback: number;
|
|
3789
|
+
};
|
|
3790
|
+
}>;
|
|
3791
|
+
}, "strip", z.ZodTypeAny, {
|
|
3792
|
+
type: "heartbeat";
|
|
3793
|
+
owner: string;
|
|
3794
|
+
capacity: {
|
|
3795
|
+
max_concurrent: number;
|
|
3796
|
+
current_load: number;
|
|
3797
|
+
queue_depth: number;
|
|
3798
|
+
};
|
|
3799
|
+
self_summary: {
|
|
3800
|
+
success_rate: number;
|
|
3801
|
+
capabilities: string[];
|
|
3802
|
+
credit_balance: number;
|
|
3803
|
+
total_completed: number;
|
|
3804
|
+
provider_number: number;
|
|
3805
|
+
reliability: {
|
|
3806
|
+
current_streak: number;
|
|
3807
|
+
repeat_hire_rate: number;
|
|
3808
|
+
avg_feedback: number;
|
|
3809
|
+
};
|
|
3810
|
+
};
|
|
3811
|
+
}, {
|
|
3812
|
+
type: "heartbeat";
|
|
3813
|
+
owner: string;
|
|
3814
|
+
capacity: {
|
|
3815
|
+
max_concurrent: number;
|
|
3816
|
+
current_load: number;
|
|
3817
|
+
queue_depth: number;
|
|
3818
|
+
};
|
|
3819
|
+
self_summary: {
|
|
3820
|
+
success_rate: number;
|
|
3821
|
+
capabilities: string[];
|
|
3822
|
+
credit_balance: number;
|
|
3823
|
+
total_completed: number;
|
|
3824
|
+
provider_number: number;
|
|
3825
|
+
reliability: {
|
|
3826
|
+
current_streak: number;
|
|
3827
|
+
repeat_hire_rate: number;
|
|
3828
|
+
avg_feedback: number;
|
|
3829
|
+
};
|
|
3830
|
+
};
|
|
3831
|
+
}>, z.ZodObject<{
|
|
3832
|
+
type: z.ZodLiteral<"escrow_hold">;
|
|
3833
|
+
consumer_agent_id: z.ZodString;
|
|
3834
|
+
provider_agent_id: z.ZodString;
|
|
3835
|
+
skill_id: z.ZodString;
|
|
3836
|
+
amount: z.ZodNumber;
|
|
3837
|
+
request_id: z.ZodString;
|
|
3838
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
3839
|
+
public_key: z.ZodOptional<z.ZodString>;
|
|
3840
|
+
}, "strip", z.ZodTypeAny, {
|
|
3841
|
+
type: "escrow_hold";
|
|
3842
|
+
skill_id: string;
|
|
3843
|
+
amount: number;
|
|
3844
|
+
request_id: string;
|
|
3845
|
+
consumer_agent_id: string;
|
|
3846
|
+
provider_agent_id: string;
|
|
3847
|
+
public_key?: string | undefined;
|
|
3848
|
+
signature?: string | undefined;
|
|
3849
|
+
}, {
|
|
3850
|
+
type: "escrow_hold";
|
|
3851
|
+
skill_id: string;
|
|
3852
|
+
amount: number;
|
|
3853
|
+
request_id: string;
|
|
3854
|
+
consumer_agent_id: string;
|
|
3855
|
+
provider_agent_id: string;
|
|
3856
|
+
public_key?: string | undefined;
|
|
3857
|
+
signature?: string | undefined;
|
|
3858
|
+
}>, z.ZodObject<{
|
|
3859
|
+
type: z.ZodLiteral<"escrow_hold_confirmed">;
|
|
3860
|
+
request_id: z.ZodString;
|
|
3861
|
+
escrow_id: z.ZodString;
|
|
3862
|
+
hold_amount: z.ZodNumber;
|
|
3863
|
+
consumer_remaining: z.ZodNumber;
|
|
3864
|
+
}, "strip", z.ZodTypeAny, {
|
|
3865
|
+
type: "escrow_hold_confirmed";
|
|
3866
|
+
request_id: string;
|
|
3867
|
+
escrow_id: string;
|
|
3868
|
+
hold_amount: number;
|
|
3869
|
+
consumer_remaining: number;
|
|
3870
|
+
}, {
|
|
3871
|
+
type: "escrow_hold_confirmed";
|
|
3872
|
+
request_id: string;
|
|
3873
|
+
escrow_id: string;
|
|
3874
|
+
hold_amount: number;
|
|
3875
|
+
consumer_remaining: number;
|
|
3876
|
+
}>, z.ZodObject<{
|
|
3877
|
+
type: z.ZodLiteral<"escrow_settle">;
|
|
3878
|
+
escrow_id: z.ZodString;
|
|
3879
|
+
request_id: z.ZodString;
|
|
3880
|
+
success: z.ZodBoolean;
|
|
3881
|
+
failure_reason: z.ZodOptional<z.ZodEnum<["bad_execution", "overload", "timeout", "auth_error", "not_found"]>>;
|
|
3882
|
+
result_hash: z.ZodOptional<z.ZodString>;
|
|
3883
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
3884
|
+
public_key: z.ZodOptional<z.ZodString>;
|
|
3885
|
+
consumer_agent_id: z.ZodOptional<z.ZodString>;
|
|
3886
|
+
}, "strip", z.ZodTypeAny, {
|
|
3887
|
+
type: "escrow_settle";
|
|
3888
|
+
success: boolean;
|
|
3889
|
+
request_id: string;
|
|
3890
|
+
escrow_id: string;
|
|
3891
|
+
public_key?: string | undefined;
|
|
3892
|
+
failure_reason?: "timeout" | "bad_execution" | "overload" | "auth_error" | "not_found" | undefined;
|
|
3893
|
+
signature?: string | undefined;
|
|
3894
|
+
consumer_agent_id?: string | undefined;
|
|
3895
|
+
result_hash?: string | undefined;
|
|
3896
|
+
}, {
|
|
3897
|
+
type: "escrow_settle";
|
|
3898
|
+
success: boolean;
|
|
3899
|
+
request_id: string;
|
|
3900
|
+
escrow_id: string;
|
|
3901
|
+
public_key?: string | undefined;
|
|
3902
|
+
failure_reason?: "timeout" | "bad_execution" | "overload" | "auth_error" | "not_found" | undefined;
|
|
3903
|
+
signature?: string | undefined;
|
|
3904
|
+
consumer_agent_id?: string | undefined;
|
|
3905
|
+
result_hash?: string | undefined;
|
|
3906
|
+
}>, z.ZodObject<{
|
|
3907
|
+
type: z.ZodLiteral<"escrow_settled">;
|
|
3908
|
+
escrow_id: z.ZodString;
|
|
3909
|
+
request_id: z.ZodString;
|
|
3910
|
+
provider_earned: z.ZodNumber;
|
|
3911
|
+
network_fee: z.ZodNumber;
|
|
3912
|
+
consumer_remaining: z.ZodNumber;
|
|
3913
|
+
provider_balance: z.ZodNumber;
|
|
3914
|
+
}, "strip", z.ZodTypeAny, {
|
|
3915
|
+
type: "escrow_settled";
|
|
3916
|
+
network_fee: number;
|
|
3917
|
+
request_id: string;
|
|
3918
|
+
escrow_id: string;
|
|
3919
|
+
consumer_remaining: number;
|
|
3920
|
+
provider_earned: number;
|
|
3921
|
+
provider_balance: number;
|
|
3922
|
+
}, {
|
|
3923
|
+
type: "escrow_settled";
|
|
3924
|
+
network_fee: number;
|
|
3925
|
+
request_id: string;
|
|
3926
|
+
escrow_id: string;
|
|
3927
|
+
consumer_remaining: number;
|
|
3928
|
+
provider_earned: number;
|
|
3929
|
+
provider_balance: number;
|
|
3930
|
+
}>, z.ZodObject<{
|
|
3931
|
+
type: z.ZodLiteral<"balance_sync">;
|
|
3932
|
+
agent_id: z.ZodString;
|
|
3933
|
+
}, "strip", z.ZodTypeAny, {
|
|
3934
|
+
type: "balance_sync";
|
|
3935
|
+
agent_id: string;
|
|
3936
|
+
}, {
|
|
3937
|
+
type: "balance_sync";
|
|
3938
|
+
agent_id: string;
|
|
3939
|
+
}>, z.ZodObject<{
|
|
3940
|
+
type: z.ZodLiteral<"balance_sync_response">;
|
|
3941
|
+
agent_id: z.ZodString;
|
|
3942
|
+
balance: z.ZodNumber;
|
|
3943
|
+
}, "strip", z.ZodTypeAny, {
|
|
3944
|
+
type: "balance_sync_response";
|
|
3945
|
+
agent_id: string;
|
|
3946
|
+
balance: number;
|
|
3947
|
+
}, {
|
|
3948
|
+
type: "balance_sync_response";
|
|
3949
|
+
agent_id: string;
|
|
3950
|
+
balance: number;
|
|
3492
3951
|
}>]>;
|
|
3493
3952
|
type RegisterMessage = z.infer<typeof RegisterMessageSchema>;
|
|
3494
3953
|
type RegisteredMessage = z.infer<typeof RegisteredMessageSchema>;
|
|
@@ -3512,6 +3971,12 @@ interface PendingRelayRequest {
|
|
|
3512
3971
|
/** Job ID if this request was dispatched from the job queue (relay bridge) */
|
|
3513
3972
|
jobId?: string;
|
|
3514
3973
|
}
|
|
3974
|
+
/** Capacity data reported by agent heartbeats */
|
|
3975
|
+
interface AgentCapacityData {
|
|
3976
|
+
current_load: number;
|
|
3977
|
+
max_concurrent: number;
|
|
3978
|
+
queue_depth: number;
|
|
3979
|
+
}
|
|
3515
3980
|
/** Relay server state returned from registerWebSocketRelay */
|
|
3516
3981
|
interface RelayState {
|
|
3517
3982
|
/** Number of currently connected agents */
|
|
@@ -3528,6 +3993,10 @@ interface RelayState {
|
|
|
3528
3993
|
getPendingRequests?(): Map<string, PendingRelayRequest>;
|
|
3529
3994
|
/** Send a JSON message over a WebSocket */
|
|
3530
3995
|
sendMessage?(ws: unknown, msg: Record<string, unknown>): void;
|
|
3996
|
+
/** Get capacity data for an agent (from heartbeat) */
|
|
3997
|
+
getAgentCapacity?(owner: string): AgentCapacityData | undefined;
|
|
3998
|
+
/** Get all agent capacity data */
|
|
3999
|
+
getAllCapacities?(): Map<string, AgentCapacityData>;
|
|
3531
4000
|
}
|
|
3532
4001
|
|
|
3533
4002
|
/** Result of handling an incoming relay request */
|
|
@@ -3539,17 +4008,31 @@ interface RelayHandlerResult {
|
|
|
3539
4008
|
};
|
|
3540
4009
|
}
|
|
3541
4010
|
/** Options for the RelayClient constructor */
|
|
4011
|
+
/** V8 Phase 3: Additional agent to register on the same connection */
|
|
4012
|
+
interface DelegatedAgent {
|
|
4013
|
+
agent_id: string;
|
|
4014
|
+
display_name: string;
|
|
4015
|
+
cards: Record<string, unknown>[];
|
|
4016
|
+
delegation_token?: Record<string, unknown>;
|
|
4017
|
+
}
|
|
4018
|
+
/** Options for the RelayClient constructor */
|
|
3542
4019
|
interface RelayClientOptions {
|
|
3543
4020
|
/** Registry WebSocket URL (e.g., "wss://hub.agentbnb.dev/ws") */
|
|
3544
4021
|
registryUrl: string;
|
|
3545
4022
|
/** Agent owner identifier */
|
|
3546
4023
|
owner: string;
|
|
4024
|
+
/** V8: Cryptographic agent identity */
|
|
4025
|
+
agent_id?: string;
|
|
4026
|
+
/** V8 Phase 3: Server identifier for multi-agent delegation */
|
|
4027
|
+
server_id?: string;
|
|
3547
4028
|
/** Authentication token */
|
|
3548
4029
|
token: string;
|
|
3549
4030
|
/** Capability card data to register */
|
|
3550
4031
|
card: Record<string, unknown>;
|
|
3551
4032
|
/** Additional cards to register alongside the primary card (e.g., conductor card) */
|
|
3552
4033
|
cards?: Record<string, unknown>[];
|
|
4034
|
+
/** V8 Phase 3: Additional agents served by this connection */
|
|
4035
|
+
agents?: DelegatedAgent[];
|
|
3553
4036
|
/** Handler for incoming relay requests from other agents */
|
|
3554
4037
|
onRequest: (req: IncomingRequestMessage) => Promise<RelayHandlerResult>;
|
|
3555
4038
|
/** Suppress logging. Default false. */
|
|
@@ -3558,6 +4041,8 @@ interface RelayClientOptions {
|
|
|
3558
4041
|
/** Options for making a relay request to another agent */
|
|
3559
4042
|
interface RelayRequestOptions$1 {
|
|
3560
4043
|
targetOwner: string;
|
|
4044
|
+
/** V8: Target agent's cryptographic identity. Preferred for routing. */
|
|
4045
|
+
targetAgentId?: string;
|
|
3561
4046
|
cardId: string;
|
|
3562
4047
|
skillId?: string;
|
|
3563
4048
|
params: Record<string, unknown>;
|
|
@@ -3852,6 +4337,7 @@ declare function verifyEscrowReceipt(data: Record<string, unknown>, signature: s
|
|
|
3852
4337
|
*/
|
|
3853
4338
|
declare const EscrowReceiptSchema: z.ZodObject<{
|
|
3854
4339
|
requester_owner: z.ZodString;
|
|
4340
|
+
requester_agent_id: z.ZodOptional<z.ZodString>;
|
|
3855
4341
|
requester_public_key: z.ZodString;
|
|
3856
4342
|
amount: z.ZodNumber;
|
|
3857
4343
|
card_id: z.ZodString;
|
|
@@ -3868,6 +4354,7 @@ declare const EscrowReceiptSchema: z.ZodObject<{
|
|
|
3868
4354
|
card_id: string;
|
|
3869
4355
|
nonce: string;
|
|
3870
4356
|
skill_id?: string | undefined;
|
|
4357
|
+
requester_agent_id?: string | undefined;
|
|
3871
4358
|
}, {
|
|
3872
4359
|
timestamp: string;
|
|
3873
4360
|
signature: string;
|
|
@@ -3877,6 +4364,7 @@ declare const EscrowReceiptSchema: z.ZodObject<{
|
|
|
3877
4364
|
card_id: string;
|
|
3878
4365
|
nonce: string;
|
|
3879
4366
|
skill_id?: string | undefined;
|
|
4367
|
+
requester_agent_id?: string | undefined;
|
|
3880
4368
|
}>;
|
|
3881
4369
|
/**
|
|
3882
4370
|
* Options for creating a signed escrow receipt.
|
|
@@ -3884,6 +4372,8 @@ declare const EscrowReceiptSchema: z.ZodObject<{
|
|
|
3884
4372
|
interface CreateReceiptOpts {
|
|
3885
4373
|
/** Agent owner identifier (requester). */
|
|
3886
4374
|
owner: string;
|
|
4375
|
+
/** V8: Cryptographic agent identity (preferred over owner). */
|
|
4376
|
+
agent_id?: string;
|
|
3887
4377
|
/** Number of credits to commit. */
|
|
3888
4378
|
amount: number;
|
|
3889
4379
|
/** Capability Card ID being requested. */
|
|
@@ -3968,8 +4458,8 @@ declare const AgentIdentitySchema: z.ZodObject<{
|
|
|
3968
4458
|
}>>;
|
|
3969
4459
|
}, "strip", z.ZodTypeAny, {
|
|
3970
4460
|
owner: string;
|
|
3971
|
-
created_at: string;
|
|
3972
4461
|
agent_id: string;
|
|
4462
|
+
created_at: string;
|
|
3973
4463
|
public_key: string;
|
|
3974
4464
|
guarantor?: {
|
|
3975
4465
|
github_login: string;
|
|
@@ -3977,8 +4467,8 @@ declare const AgentIdentitySchema: z.ZodObject<{
|
|
|
3977
4467
|
} | undefined;
|
|
3978
4468
|
}, {
|
|
3979
4469
|
owner: string;
|
|
3980
|
-
created_at: string;
|
|
3981
4470
|
agent_id: string;
|
|
4471
|
+
created_at: string;
|
|
3982
4472
|
public_key: string;
|
|
3983
4473
|
guarantor?: {
|
|
3984
4474
|
github_login: string;
|
|
@@ -4013,8 +4503,8 @@ declare const AgentCertificateSchema: z.ZodObject<{
|
|
|
4013
4503
|
}>>;
|
|
4014
4504
|
}, "strip", z.ZodTypeAny, {
|
|
4015
4505
|
owner: string;
|
|
4016
|
-
created_at: string;
|
|
4017
4506
|
agent_id: string;
|
|
4507
|
+
created_at: string;
|
|
4018
4508
|
public_key: string;
|
|
4019
4509
|
guarantor?: {
|
|
4020
4510
|
github_login: string;
|
|
@@ -4022,8 +4512,8 @@ declare const AgentCertificateSchema: z.ZodObject<{
|
|
|
4022
4512
|
} | undefined;
|
|
4023
4513
|
}, {
|
|
4024
4514
|
owner: string;
|
|
4025
|
-
created_at: string;
|
|
4026
4515
|
agent_id: string;
|
|
4516
|
+
created_at: string;
|
|
4027
4517
|
public_key: string;
|
|
4028
4518
|
guarantor?: {
|
|
4029
4519
|
github_login: string;
|
|
@@ -4042,8 +4532,8 @@ declare const AgentCertificateSchema: z.ZodObject<{
|
|
|
4042
4532
|
signature: string;
|
|
4043
4533
|
identity: {
|
|
4044
4534
|
owner: string;
|
|
4045
|
-
created_at: string;
|
|
4046
4535
|
agent_id: string;
|
|
4536
|
+
created_at: string;
|
|
4047
4537
|
public_key: string;
|
|
4048
4538
|
guarantor?: {
|
|
4049
4539
|
github_login: string;
|
|
@@ -4057,8 +4547,8 @@ declare const AgentCertificateSchema: z.ZodObject<{
|
|
|
4057
4547
|
signature: string;
|
|
4058
4548
|
identity: {
|
|
4059
4549
|
owner: string;
|
|
4060
|
-
created_at: string;
|
|
4061
4550
|
agent_id: string;
|
|
4551
|
+
created_at: string;
|
|
4062
4552
|
public_key: string;
|
|
4063
4553
|
guarantor?: {
|
|
4064
4554
|
github_login: string;
|