@easbot/plugin 0.3.26 → 0.3.28
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.en.md +22 -19
- package/README.md +21 -18
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +39 -225
- package/dist/index.d.ts +39 -225
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Auth, Provider, createEasbotClient, Project, Event, Config } from '@easbot/sdk';
|
|
2
2
|
import { ToolContext, EasbotShell, ToolDefinition } from '@easbot/types';
|
|
3
|
-
export { AskInput, EasbotShell, EasbotShellError, EasbotShellOutput, EasbotShellPromise, ShellExpression, ShellFunction, ToolContext, ToolDefinition, ToolFunction as ToolFn, ToolFunction, buildToolArgs, createTool, toolSchema as schema } from '@easbot/types';
|
|
3
|
+
export { AgentPermission, AgentPermissionSchema, AskInput, EasbotShell, EasbotShellError, EasbotShellOutput, EasbotShellPromise, PermissionActionSchema, PermissionRuleSchema, ShellExpression, ShellFunction, ToolContext, ToolDefinition, ToolFunction as ToolFn, ToolFunction, buildToolArgs, createTool, toolSchema as schema } from '@easbot/types';
|
|
4
4
|
import z, { z as z$1 } from 'zod';
|
|
5
5
|
|
|
6
6
|
declare function tool<Args extends Record<string, z.ZodTypeAny>>(input: {
|
|
@@ -2375,192 +2375,6 @@ interface CommandDefinition extends Command {
|
|
|
2375
2375
|
init?: (context?: CommandInitContext) => Promise<CommandInitResult>;
|
|
2376
2376
|
}
|
|
2377
2377
|
|
|
2378
|
-
declare const PermissionActionSchema: z$1.ZodEnum<{
|
|
2379
|
-
ask: "ask";
|
|
2380
|
-
allow: "allow";
|
|
2381
|
-
deny: "deny";
|
|
2382
|
-
}>;
|
|
2383
|
-
type PermissionAction = z$1.infer<typeof PermissionActionSchema>;
|
|
2384
|
-
declare const PermissionRuleSchema: z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2385
|
-
ask: "ask";
|
|
2386
|
-
allow: "allow";
|
|
2387
|
-
deny: "deny";
|
|
2388
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2389
|
-
ask: "ask";
|
|
2390
|
-
allow: "allow";
|
|
2391
|
-
deny: "deny";
|
|
2392
|
-
}>>]>;
|
|
2393
|
-
type PermissionRule = z$1.infer<typeof PermissionRuleSchema>;
|
|
2394
|
-
declare const AgentPermissionSchema: z$1.ZodObject<{
|
|
2395
|
-
read: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2396
|
-
ask: "ask";
|
|
2397
|
-
allow: "allow";
|
|
2398
|
-
deny: "deny";
|
|
2399
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2400
|
-
ask: "ask";
|
|
2401
|
-
allow: "allow";
|
|
2402
|
-
deny: "deny";
|
|
2403
|
-
}>>]>>;
|
|
2404
|
-
edit: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2405
|
-
ask: "ask";
|
|
2406
|
-
allow: "allow";
|
|
2407
|
-
deny: "deny";
|
|
2408
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2409
|
-
ask: "ask";
|
|
2410
|
-
allow: "allow";
|
|
2411
|
-
deny: "deny";
|
|
2412
|
-
}>>]>>;
|
|
2413
|
-
write: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2414
|
-
ask: "ask";
|
|
2415
|
-
allow: "allow";
|
|
2416
|
-
deny: "deny";
|
|
2417
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2418
|
-
ask: "ask";
|
|
2419
|
-
allow: "allow";
|
|
2420
|
-
deny: "deny";
|
|
2421
|
-
}>>]>>;
|
|
2422
|
-
glob: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2423
|
-
ask: "ask";
|
|
2424
|
-
allow: "allow";
|
|
2425
|
-
deny: "deny";
|
|
2426
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2427
|
-
ask: "ask";
|
|
2428
|
-
allow: "allow";
|
|
2429
|
-
deny: "deny";
|
|
2430
|
-
}>>]>>;
|
|
2431
|
-
grep: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2432
|
-
ask: "ask";
|
|
2433
|
-
allow: "allow";
|
|
2434
|
-
deny: "deny";
|
|
2435
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2436
|
-
ask: "ask";
|
|
2437
|
-
allow: "allow";
|
|
2438
|
-
deny: "deny";
|
|
2439
|
-
}>>]>>;
|
|
2440
|
-
list: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2441
|
-
ask: "ask";
|
|
2442
|
-
allow: "allow";
|
|
2443
|
-
deny: "deny";
|
|
2444
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2445
|
-
ask: "ask";
|
|
2446
|
-
allow: "allow";
|
|
2447
|
-
deny: "deny";
|
|
2448
|
-
}>>]>>;
|
|
2449
|
-
bash: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2450
|
-
ask: "ask";
|
|
2451
|
-
allow: "allow";
|
|
2452
|
-
deny: "deny";
|
|
2453
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2454
|
-
ask: "ask";
|
|
2455
|
-
allow: "allow";
|
|
2456
|
-
deny: "deny";
|
|
2457
|
-
}>>]>>;
|
|
2458
|
-
webfetch: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2459
|
-
ask: "ask";
|
|
2460
|
-
allow: "allow";
|
|
2461
|
-
deny: "deny";
|
|
2462
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2463
|
-
ask: "ask";
|
|
2464
|
-
allow: "allow";
|
|
2465
|
-
deny: "deny";
|
|
2466
|
-
}>>]>>;
|
|
2467
|
-
websearch: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2468
|
-
ask: "ask";
|
|
2469
|
-
allow: "allow";
|
|
2470
|
-
deny: "deny";
|
|
2471
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2472
|
-
ask: "ask";
|
|
2473
|
-
allow: "allow";
|
|
2474
|
-
deny: "deny";
|
|
2475
|
-
}>>]>>;
|
|
2476
|
-
task: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2477
|
-
ask: "ask";
|
|
2478
|
-
allow: "allow";
|
|
2479
|
-
deny: "deny";
|
|
2480
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2481
|
-
ask: "ask";
|
|
2482
|
-
allow: "allow";
|
|
2483
|
-
deny: "deny";
|
|
2484
|
-
}>>]>>;
|
|
2485
|
-
todo: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2486
|
-
ask: "ask";
|
|
2487
|
-
allow: "allow";
|
|
2488
|
-
deny: "deny";
|
|
2489
|
-
}>>;
|
|
2490
|
-
question: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2491
|
-
ask: "ask";
|
|
2492
|
-
allow: "allow";
|
|
2493
|
-
deny: "deny";
|
|
2494
|
-
}>>;
|
|
2495
|
-
skill: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2496
|
-
ask: "ask";
|
|
2497
|
-
allow: "allow";
|
|
2498
|
-
deny: "deny";
|
|
2499
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2500
|
-
ask: "ask";
|
|
2501
|
-
allow: "allow";
|
|
2502
|
-
deny: "deny";
|
|
2503
|
-
}>>]>>;
|
|
2504
|
-
memory: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2505
|
-
ask: "ask";
|
|
2506
|
-
allow: "allow";
|
|
2507
|
-
deny: "deny";
|
|
2508
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2509
|
-
ask: "ask";
|
|
2510
|
-
allow: "allow";
|
|
2511
|
-
deny: "deny";
|
|
2512
|
-
}>>]>>;
|
|
2513
|
-
note: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2514
|
-
ask: "ask";
|
|
2515
|
-
allow: "allow";
|
|
2516
|
-
deny: "deny";
|
|
2517
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2518
|
-
ask: "ask";
|
|
2519
|
-
allow: "allow";
|
|
2520
|
-
deny: "deny";
|
|
2521
|
-
}>>]>>;
|
|
2522
|
-
pty_session: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2523
|
-
ask: "ask";
|
|
2524
|
-
allow: "allow";
|
|
2525
|
-
deny: "deny";
|
|
2526
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2527
|
-
ask: "ask";
|
|
2528
|
-
allow: "allow";
|
|
2529
|
-
deny: "deny";
|
|
2530
|
-
}>>]>>;
|
|
2531
|
-
pty_manage: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2532
|
-
ask: "ask";
|
|
2533
|
-
allow: "allow";
|
|
2534
|
-
deny: "deny";
|
|
2535
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2536
|
-
ask: "ask";
|
|
2537
|
-
allow: "allow";
|
|
2538
|
-
deny: "deny";
|
|
2539
|
-
}>>]>>;
|
|
2540
|
-
external_directory: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2541
|
-
ask: "ask";
|
|
2542
|
-
allow: "allow";
|
|
2543
|
-
deny: "deny";
|
|
2544
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2545
|
-
ask: "ask";
|
|
2546
|
-
allow: "allow";
|
|
2547
|
-
deny: "deny";
|
|
2548
|
-
}>>]>>;
|
|
2549
|
-
doom_loop: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2550
|
-
ask: "ask";
|
|
2551
|
-
allow: "allow";
|
|
2552
|
-
deny: "deny";
|
|
2553
|
-
}>>;
|
|
2554
|
-
}, z$1.core.$catchall<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2555
|
-
ask: "ask";
|
|
2556
|
-
allow: "allow";
|
|
2557
|
-
deny: "deny";
|
|
2558
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2559
|
-
ask: "ask";
|
|
2560
|
-
allow: "allow";
|
|
2561
|
-
deny: "deny";
|
|
2562
|
-
}>>]>>>;
|
|
2563
|
-
type AgentPermission = z$1.infer<typeof AgentPermissionSchema>;
|
|
2564
2378
|
declare const AgentModeSchema: z$1.ZodEnum<{
|
|
2565
2379
|
all: "all";
|
|
2566
2380
|
subagent: "subagent";
|
|
@@ -2602,172 +2416,172 @@ declare const AgentMetadataSchema: z$1.ZodObject<{
|
|
|
2602
2416
|
prompt: z$1.ZodOptional<z$1.ZodString>;
|
|
2603
2417
|
permission: z$1.ZodOptional<z$1.ZodObject<{
|
|
2604
2418
|
read: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2605
|
-
ask: "ask";
|
|
2606
2419
|
allow: "allow";
|
|
2607
2420
|
deny: "deny";
|
|
2608
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2609
2421
|
ask: "ask";
|
|
2422
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2610
2423
|
allow: "allow";
|
|
2611
2424
|
deny: "deny";
|
|
2425
|
+
ask: "ask";
|
|
2612
2426
|
}>>]>>;
|
|
2613
2427
|
edit: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2614
|
-
ask: "ask";
|
|
2615
2428
|
allow: "allow";
|
|
2616
2429
|
deny: "deny";
|
|
2617
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2618
2430
|
ask: "ask";
|
|
2431
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2619
2432
|
allow: "allow";
|
|
2620
2433
|
deny: "deny";
|
|
2434
|
+
ask: "ask";
|
|
2621
2435
|
}>>]>>;
|
|
2622
2436
|
write: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2623
|
-
ask: "ask";
|
|
2624
2437
|
allow: "allow";
|
|
2625
2438
|
deny: "deny";
|
|
2626
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2627
2439
|
ask: "ask";
|
|
2440
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2628
2441
|
allow: "allow";
|
|
2629
2442
|
deny: "deny";
|
|
2443
|
+
ask: "ask";
|
|
2630
2444
|
}>>]>>;
|
|
2631
2445
|
glob: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2632
|
-
ask: "ask";
|
|
2633
2446
|
allow: "allow";
|
|
2634
2447
|
deny: "deny";
|
|
2635
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2636
2448
|
ask: "ask";
|
|
2449
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2637
2450
|
allow: "allow";
|
|
2638
2451
|
deny: "deny";
|
|
2452
|
+
ask: "ask";
|
|
2639
2453
|
}>>]>>;
|
|
2640
2454
|
grep: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2641
|
-
ask: "ask";
|
|
2642
2455
|
allow: "allow";
|
|
2643
2456
|
deny: "deny";
|
|
2644
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2645
2457
|
ask: "ask";
|
|
2458
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2646
2459
|
allow: "allow";
|
|
2647
2460
|
deny: "deny";
|
|
2461
|
+
ask: "ask";
|
|
2648
2462
|
}>>]>>;
|
|
2649
2463
|
list: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2650
|
-
ask: "ask";
|
|
2651
2464
|
allow: "allow";
|
|
2652
2465
|
deny: "deny";
|
|
2653
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2654
2466
|
ask: "ask";
|
|
2467
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2655
2468
|
allow: "allow";
|
|
2656
2469
|
deny: "deny";
|
|
2470
|
+
ask: "ask";
|
|
2657
2471
|
}>>]>>;
|
|
2658
2472
|
bash: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2659
|
-
ask: "ask";
|
|
2660
2473
|
allow: "allow";
|
|
2661
2474
|
deny: "deny";
|
|
2662
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2663
2475
|
ask: "ask";
|
|
2476
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2664
2477
|
allow: "allow";
|
|
2665
2478
|
deny: "deny";
|
|
2479
|
+
ask: "ask";
|
|
2666
2480
|
}>>]>>;
|
|
2667
2481
|
webfetch: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2668
|
-
ask: "ask";
|
|
2669
2482
|
allow: "allow";
|
|
2670
2483
|
deny: "deny";
|
|
2671
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2672
2484
|
ask: "ask";
|
|
2485
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2673
2486
|
allow: "allow";
|
|
2674
2487
|
deny: "deny";
|
|
2488
|
+
ask: "ask";
|
|
2675
2489
|
}>>]>>;
|
|
2676
2490
|
websearch: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2677
|
-
ask: "ask";
|
|
2678
2491
|
allow: "allow";
|
|
2679
2492
|
deny: "deny";
|
|
2680
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2681
2493
|
ask: "ask";
|
|
2494
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2682
2495
|
allow: "allow";
|
|
2683
2496
|
deny: "deny";
|
|
2497
|
+
ask: "ask";
|
|
2684
2498
|
}>>]>>;
|
|
2685
2499
|
task: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2686
|
-
ask: "ask";
|
|
2687
2500
|
allow: "allow";
|
|
2688
2501
|
deny: "deny";
|
|
2689
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2690
2502
|
ask: "ask";
|
|
2503
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2691
2504
|
allow: "allow";
|
|
2692
2505
|
deny: "deny";
|
|
2506
|
+
ask: "ask";
|
|
2693
2507
|
}>>]>>;
|
|
2694
2508
|
todo: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2695
|
-
ask: "ask";
|
|
2696
2509
|
allow: "allow";
|
|
2697
2510
|
deny: "deny";
|
|
2511
|
+
ask: "ask";
|
|
2698
2512
|
}>>;
|
|
2699
2513
|
question: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2700
|
-
ask: "ask";
|
|
2701
2514
|
allow: "allow";
|
|
2702
2515
|
deny: "deny";
|
|
2516
|
+
ask: "ask";
|
|
2703
2517
|
}>>;
|
|
2704
2518
|
skill: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2705
|
-
ask: "ask";
|
|
2706
2519
|
allow: "allow";
|
|
2707
2520
|
deny: "deny";
|
|
2708
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2709
2521
|
ask: "ask";
|
|
2522
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2710
2523
|
allow: "allow";
|
|
2711
2524
|
deny: "deny";
|
|
2525
|
+
ask: "ask";
|
|
2712
2526
|
}>>]>>;
|
|
2713
2527
|
memory: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2714
|
-
ask: "ask";
|
|
2715
2528
|
allow: "allow";
|
|
2716
2529
|
deny: "deny";
|
|
2717
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2718
2530
|
ask: "ask";
|
|
2531
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2719
2532
|
allow: "allow";
|
|
2720
2533
|
deny: "deny";
|
|
2534
|
+
ask: "ask";
|
|
2721
2535
|
}>>]>>;
|
|
2722
2536
|
note: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2723
|
-
ask: "ask";
|
|
2724
2537
|
allow: "allow";
|
|
2725
2538
|
deny: "deny";
|
|
2726
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2727
2539
|
ask: "ask";
|
|
2540
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2728
2541
|
allow: "allow";
|
|
2729
2542
|
deny: "deny";
|
|
2543
|
+
ask: "ask";
|
|
2730
2544
|
}>>]>>;
|
|
2731
2545
|
pty_session: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2732
|
-
ask: "ask";
|
|
2733
2546
|
allow: "allow";
|
|
2734
2547
|
deny: "deny";
|
|
2735
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2736
2548
|
ask: "ask";
|
|
2549
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2737
2550
|
allow: "allow";
|
|
2738
2551
|
deny: "deny";
|
|
2552
|
+
ask: "ask";
|
|
2739
2553
|
}>>]>>;
|
|
2740
2554
|
pty_manage: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2741
|
-
ask: "ask";
|
|
2742
2555
|
allow: "allow";
|
|
2743
2556
|
deny: "deny";
|
|
2744
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2745
2557
|
ask: "ask";
|
|
2558
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2746
2559
|
allow: "allow";
|
|
2747
2560
|
deny: "deny";
|
|
2561
|
+
ask: "ask";
|
|
2748
2562
|
}>>]>>;
|
|
2749
2563
|
external_directory: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2750
|
-
ask: "ask";
|
|
2751
2564
|
allow: "allow";
|
|
2752
2565
|
deny: "deny";
|
|
2753
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2754
2566
|
ask: "ask";
|
|
2567
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2755
2568
|
allow: "allow";
|
|
2756
2569
|
deny: "deny";
|
|
2570
|
+
ask: "ask";
|
|
2757
2571
|
}>>]>>;
|
|
2758
2572
|
doom_loop: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2759
|
-
ask: "ask";
|
|
2760
2573
|
allow: "allow";
|
|
2761
2574
|
deny: "deny";
|
|
2575
|
+
ask: "ask";
|
|
2762
2576
|
}>>;
|
|
2763
2577
|
}, z$1.core.$catchall<z$1.ZodUnion<readonly [z$1.ZodEnum<{
|
|
2764
|
-
ask: "ask";
|
|
2765
2578
|
allow: "allow";
|
|
2766
2579
|
deny: "deny";
|
|
2767
|
-
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2768
2580
|
ask: "ask";
|
|
2581
|
+
}>, z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
|
|
2769
2582
|
allow: "allow";
|
|
2770
2583
|
deny: "deny";
|
|
2584
|
+
ask: "ask";
|
|
2771
2585
|
}>>]>>>>;
|
|
2772
2586
|
steps: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2773
2587
|
color: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodEnum<{
|
|
@@ -2980,4 +2794,4 @@ interface PluginDefinition {
|
|
|
2980
2794
|
'context.build.after'?: (input: ContextBuildAfterInput, output: HookOutputWrapper<ContextBuildAfterInput>) => Promise<void>;
|
|
2981
2795
|
}
|
|
2982
2796
|
|
|
2983
|
-
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, type AgentModel, AgentModelSchema,
|
|
2797
|
+
export { type AgentDefinition, AgentExecutorSchema, type AgentHookDefinition, type AgentMetadata, AgentMetadataSchema, type AgentMode, AgentModeSchema, type AgentModel, AgentModelSchema, AgentSchema, type AgentScope, AgentScopeSchema, type AuthHook, type AuthOuathResult, CallIDSchema, type CommandAfterInput, CommandAfterInputSchema, type CommandArguments, CommandArgumentsSchema, type CommandBeforeInput, CommandBeforeInputSchema, type CommandCompleteInput, CommandCompleteInputSchema, type CommandDefinition, type CommandExecuteResult, type CommandExecuteResultMetadata, CommandExecuteResultMetadataSchema, CommandExecuteResultSchema, type CommandExecutionContext, CommandExecutionContextSchema, CommandExecutorSchema, type CommandHookDefinition, type CommandInitContext, CommandInitContextSchema, type CommandInitResult, CommandInitResultSchema, type CommandMetadata, CommandMetadataSchema, type CommandPromptPart, CommandPromptPartSchema, type CommandSource, CommandSourceSchema, type CommandTaskDefinition, CommandTaskDefinitionSchema, type CommandTriggerInput, CommandTriggerInputSchema, ContentPartSchema, type ContextBuildAfterInput, ContextBuildAfterInputSchema, type ContextBuildBeforeInput, ContextBuildBeforeInputSchema, type CreationCompleteInput, CreationCompleteInputSchema, type CreationRequestInput, CreationRequestInputSchema, CwdSchema, EndReasonSchema, EventInputSchemas, type EvolutionCompleteInput, EvolutionCompleteInputSchema, type EvolutionRequestInput, EvolutionRequestInputSchema, FinishReasonSchema, FunctionExecutorSchema, type FunctionHookDefinition, type GatewayMessageCompleteInput, GatewayMessageCompleteInputSchema, type GatewayMessageDeliveredInput, GatewayMessageDeliveredInputSchema, type GatewayMessageProcessInput, GatewayMessageProcessInputSchema, type GatewayMessageReadInput, GatewayMessageReadInputSchema, type GatewayMessageReceiveInput, GatewayMessageReceiveInputSchema, type GatewayMessageSendInput, GatewayMessageSendInputSchema, HOOK_EVENTS, type HeartbeatCompleteInput, HeartbeatCompleteInputSchema, type HeartbeatTaskDefinition, HeartbeatTaskDefinitionSchema, type HeartbeatTriggerInput, HeartbeatTriggerInputSchema, type HookChainResult, type HookContext, type HookDefinition, type HookError, HookEvent, type HookExecutionDetail, HookExecutorSchema, type HookHandler, type HookMatcher, HookMatcherSchema, type HookOutputWrapper, type HookResult, HookType, type HooksConfig, HooksConfigSchema, HttpExecutorSchema, type HttpHookDefinition, type LlmHeadersInput, LlmHeadersInputSchema, type LlmParamsInput, LlmParamsInputSchema, LlmParamsSchema, LlmProviderSchema, type LoopEndInput, LoopEndInputSchema, type LoopStartInput, LoopStartInputSchema, type MarketplaceCategory, type MarketplaceDefinition, type MarketplaceEntry, MessageIDSchema, type MessageReceiveInput, MessageReceiveInputSchema, MessageRoleSchema, MessageSchema, type MessageTransformInput, MessageTransformInputSchema, ModelObjectSchema, ModelSchema, type PermissionAskInput, PermissionAskInputSchema, type PermissionDeniedInput, PermissionDeniedInputSchema, PermissionLevelSchema, PermissionRequestSchema, type Plugin, type PluginDefinition, type PluginInput, PromptExecutorSchema, type PromptHookDefinition, type ScheduledTaskCompleteInput, ScheduledTaskCompleteInputSchema, type ScheduledTaskTriggerInput, ScheduledTaskTriggerInputSchema, type SchedulerTaskDefinition, SchedulerTaskDefinitionSchema, type SessionCompactInput, SessionCompactInputSchema, type SessionCompactingInput, SessionCompactingInputSchema, type SessionEndInput, SessionEndInputSchema, SessionIDSchema, type SessionStartInput, SessionStartInputSchema, type ShellEnvInput, ShellEnvInputSchema, type SkillDefinition, type SkillInitContext, SkillInitContextSchema, type SkillInitResult, SkillInitResultSchema, type SkillMetadata, SkillMetadataSchema, type SkillScope, type StepFinishInput, StepFinishInputSchema, type StepStartInput, StepStartInputSchema, type StepStopFailureInput, StepStopFailureInputSchema, type StepStopInput, StepStopInputSchema, type StoreSourceType, type SystemTransformInput, SystemTransformInputSchema, type TaskCompleteInput, TaskCompleteInputSchema, type TaskDefinition, type TaskProgressInput, TaskProgressInputSchema, type TaskRunningInput, TaskRunningInputSchema, type TaskSource, TaskSourceSchema, type TaskStartInput, TaskStartInputSchema, type TextCompleteInput, TextCompleteInputSchema, type ToolAfterInput, ToolAfterInputSchema, ToolArgsSchema, type ToolBeforeInput, ToolBeforeInputSchema, type ToolDefinitionInput, ToolDefinitionInputSchema, type ToolFailureInput, ToolFailureInputSchema, ToolResultSchema, findMarketplace, findMarketplacesByCategory, getEventInputSchema, listMarketplaces, registerMarketplace, safeValidateHookInput, tool, unregisterMarketplace, validateHookInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import w,{z as z$1}from'zod';export{buildToolArgs,createTool,toolSchema as schema}from'@easbot/types';import'@easbot/sdk';function H(s){return {description:s.description,args:s.args,execute:s.execute}}H.schema=w;var u={Command:"command",Prompt:"prompt",Http:"http",Agent:"agent",Function:"function"},o={SessionStart:"session.start",SessionEnd:"session.end",SessionCompacting:"session.compacting",SessionCompact:"session.compact",StepStart:"step.start",StepFinish:"step.finish",StepStop:"step.stop",StepStopFailure:"step.stop.failure",MessageReceive:"message.receive",MessageTransform:"message.transform",SystemTransform:"system.transform",ToolBefore:"tool.before",ToolAfter:"tool.after",ToolFailure:"tool.failure",ToolDefinition:"tool.definition",CommandBefore:"command.before",CommandAfter:"command.after",PermissionAsk:"permission.ask",PermissionDenied:"permission.denied",LlmParams:"llm.params",LlmHeaders:"llm.headers",ShellEnv:"shell.env",TextComplete:"text.complete",GatewayMessageReceive:"gateway.message.receive",GatewayMessageProcess:"gateway.message.process",GatewayMessageComplete:"gateway.message.complete",GatewayMessageSend:"gateway.message.send",GatewayMessageDelivered:"gateway.message.delivered",GatewayMessageRead:"gateway.message.read",HeartbeatTrigger:"scheduler.heartbeat.trigger",HeartbeatComplete:"scheduler.heartbeat.complete",ScheduledTaskTrigger:"scheduler.task.trigger",ScheduledTaskComplete:"scheduler.task.complete",CommandTrigger:"scheduler.command.trigger",CommandComplete:"scheduler.command.complete",ContextBuildBefore:"context.build.before",ContextBuildAfter:"context.build.after",TaskStart:"task.start",TaskRunning:"task.running",TaskProgress:"task.progress",TaskComplete:"task.complete",LoopStart:"loop.start",LoopEnd:"loop.end",CreationRequest:"creation.request",CreationComplete:"creation.complete",EvolutionRequest:"evolution.request",EvolutionComplete:"evolution.complete"},et=Object.values(o);var I=z$1.string().optional(),E=z$1.object({type:z$1.literal(u.Command),command:z$1.string(),if:I,shell:z$1.enum(["bash","powershell"]).optional(),timeout:z$1.number().positive().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),async:z$1.boolean().optional()}),A=z$1.object({type:z$1.literal(u.Prompt),if:I,timeout:z$1.number().positive().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),runMode:z$1.enum(["session","fork"]).optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown())}),j=z$1.object({type:z$1.literal(u.Http),url:z$1.string(),if:I,timeout:z$1.number().positive().optional(),method:z$1.enum(["GET","POST","PUT","DELETE"]).optional(),headers:z$1.record(z$1.string(),z$1.string()).optional(),allowedEnvVars:z$1.array(z$1.string()).optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional()}),D=z$1.object({type:z$1.literal(u.Agent),if:I,timeout:z$1.number().positive().optional(),agent:z$1.string().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown())}),R=z$1.object({type:z$1.literal(u.Function),handler:z$1.function()}),z=z$1.discriminatedUnion("type",[E,A,j,D,R]),F=z$1.object({event:z$1.string(),matcher:z$1.string().optional(),hooks:z$1.array(z)}),st=z$1.record(z$1.string(),z$1.array(F)),n=z$1.string().min(1).describe("Session unique identifier"),a=z$1.string().min(1).describe("Message unique identifier"),b=z$1.string().min(1).describe("Tool call unique identifier"),l=z$1.string().optional().describe("Agent name"),y=z$1.string().optional().describe("Model identifier"),C=z$1.object({providerId:z$1.string().describe("Provider ID"),modelId:z$1.string().describe("Model ID"),api:z$1.object({id:z$1.string().describe("API ID"),npm:z$1.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),T=z$1.string().optional().describe("Working directory path"),O=z$1.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),G=z$1.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),W=z$1.object({sessionId:n,source:z$1.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:y,agent:l,cwd:T}),B=z$1.object({sessionId:n,reason:O,duration:z$1.number().positive().optional().describe("Session duration in milliseconds")}),L=z$1.object({sessionId:n,trigger:z$1.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:z$1.number().positive().describe("Current context length"),threshold:z$1.number().positive().describe("Trigger threshold")}),q=z$1.object({sessionId:n,summary:z$1.string().describe("Compaction summary"),previousLength:z$1.number().positive().describe("Previous context length"),newLength:z$1.number().positive().describe("New context length")}),_=z$1.object({sessionId:n,messageId:a,userMessageId:a.optional().describe("User message ID for the current step"),model:y,agent:l}),U=z$1.object({sessionId:n,messageId:a,userMessageId:a.optional().describe("User message ID for the current step"),model:y,agent:l,finishReason:G,tokens:z$1.object({input:z$1.number().int().nonnegative().optional(),output:z$1.number().int().nonnegative().optional(),total:z$1.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),N=z$1.object({sessionId:n,reason:z$1.string().describe("Stop reason")}),$=z$1.object({sessionId:n,error:z$1.string().describe("Error message"),errorType:z$1.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),Z=z$1.enum(["user","assistant","system","tool"]),v=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().optional().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),P=z$1.object({id:a,role:Z,content:z$1.union([z$1.string(),z$1.array(v)]),name:z$1.string().optional().describe("Message sender name"),tool_call_id:b.optional().describe("Related tool call ID")}),V=z$1.object({sessionId:n,agent:l,model:y,messageId:a,message:z$1.object({id:a,role:z$1.literal("user"),content:z$1.union([z$1.string(),z$1.array(v)])}).describe("User message")}),K=z$1.object({sessionId:n,messages:z$1.array(P).describe("Messages to transform")}),J=z$1.object({sessionId:n,model:y,system:z$1.array(z$1.string()).describe("Current system prompt")}),h=z$1.record(z$1.string(),z$1.unknown()).describe("Tool call arguments"),Q=z$1.object({title:z$1.string().optional().describe("Result title"),content:z$1.string().describe("Result content"),is_error:z$1.boolean().optional().describe("Is error result"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Extra metadata")}),X=z$1.object({sessionId:n,userMessageId:a.optional().describe("User message ID for the current step"),tool:z$1.string().describe("Tool name"),callId:b,args:h}),Y=z$1.object({sessionId:n,userMessageId:a.optional().describe("User message ID for the current step"),tool:z$1.string(),callId:b,args:h,result:Q,duration:z$1.number().nonnegative().optional().describe("Execution duration in milliseconds")}),ee=z$1.object({sessionId:n,tool:z$1.string(),callId:b,args:h,error:z$1.string().describe("Error message"),errorType:z$1.enum(["timeout","invalid_args","execution_error","permission_denied"])}),te=z$1.object({sessionId:n,toolID:z$1.string().describe("Tool ID"),definition:z$1.object({name:z$1.string(),description:z$1.string().optional(),parameters:z$1.record(z$1.string(),z$1.unknown()).optional()}).describe("Tool definition")}),oe=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments")}),ne=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional(),result:z$1.object({info:z$1.unknown().optional().describe("Message info"),parts:z$1.array(z$1.unknown()).optional().describe("Message parts"),title:z$1.string().optional().describe("Result title"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Result metadata"),output:z$1.string().optional().describe("Result output"),success:z$1.boolean().optional().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}).describe("Command execution result")}),re=z$1.enum(["read","write","exec","admin"]),se=z$1.object({tool:z$1.string().describe("Tool name requesting permission"),args:h.optional(),level:re.optional(),reason:z$1.string().optional().describe("Reason for permission request")}),ie=z$1.object({sessionId:n,request:se}),ae=z$1.object({sessionId:n,tool:z$1.string(),reason:z$1.string().optional()}),M=z$1.enum(["openai","anthropic","google","azure","custom"]),pe=z$1.object({temperature:z$1.number().min(0).max(2).optional(),topP:z$1.number().min(0).max(1).optional(),topK:z$1.number().int().positive().optional(),maxTokens:z$1.number().int().positive().optional(),stopSequences:z$1.array(z$1.string()).optional(),responseFormat:z$1.enum(["text","json_object"]).optional()}),me=z$1.object({sessionId:n,agent:l,model:C,provider:M,params:pe.partial().optional()}),ce=z$1.object({sessionId:n,agent:l,model:C,provider:M,headers:z$1.record(z$1.string(),z$1.string()).optional()}),ue=z$1.object({cwd:T.describe("Working directory"),sessionId:n.optional(),callId:b.optional()}),le=z$1.object({sessionId:n,messageId:a,partId:z$1.string().describe("Text part ID"),text:z$1.string().describe("Completed text")}),de=z$1.object({sessionId:n,mode:z$1.enum(["agent","chat","query"]).describe("Build mode"),providerId:z$1.string().optional()}),ge=z$1.object({sessionId:n,context:z$1.object({messages:z$1.array(P),system:z$1.array(z$1.string()),metadata:z$1.record(z$1.string(),z$1.unknown())}).describe("Built context")}),fe=z$1.object({gatewayID:z$1.string().describe("Gateway ID"),messageId:a,message:z$1.unknown().describe("Received message")}),be=z$1.object({gatewayID:z$1.string(),messageId:a,message:z$1.unknown(),sessionId:n.optional()}),ye=z$1.object({gatewayID:z$1.string(),messageId:a,result:z$1.unknown().optional()}),Se=z$1.object({gatewayID:z$1.string(),messageId:a,message:z$1.unknown(),target:z$1.string().optional().describe("Send target")}),Ie=z$1.object({gatewayID:z$1.string(),messageId:a,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Delivery timestamp")}),he=z$1.object({gatewayID:z$1.string(),messageId:a,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Read timestamp")}),xe=z$1.object({type:z$1.literal("command"),config:z$1.object({command:z$1.string(),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional()})}),ke=z$1.object({type:z$1.literal("heartbeat"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({session:z$1.string().optional(),mode:z$1.enum(["session","fork"]).optional(),agent:z$1.string().optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),Ce=z$1.object({type:z$1.literal("scheduler"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({agentType:z$1.string().optional(),transport:z$1.enum(["stdio","http","websocket","cli"]).optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),Te=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),timestamp:z$1.number().describe("Heartbeat timestamp"),name:z$1.string().optional().describe("Heartbeat name"),definition:ke.optional()}),ve=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),sessionId:n.optional(),timestamp:z$1.number(),duration:z$1.number().nonnegative().optional(),success:z$1.boolean().optional(),error:z$1.string().optional()}),Pe=z$1.object({taskId:z$1.string().describe("Task ID"),taskName:z$1.string().optional(),timestamp:z$1.number(),payload:z$1.record(z$1.string(),z$1.unknown()).optional(),definition:Ce.optional()}),Me=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),result:z$1.record(z$1.string(),z$1.unknown()).optional(),error:z$1.string().optional()}),we=z$1.object({taskId:z$1.string().describe("Command task unique identifier"),taskName:z$1.string().describe("Command task name"),command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional().describe("Command arguments"),timestamp:z$1.number().describe("Trigger timestamp"),definition:xe.optional()}),He=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),output:z$1.string().optional(),error:z$1.string().optional(),duration:z$1.number().describe("Execution duration in milliseconds")}),x=z$1.enum(["tool","scheduler","cli","api"]),Ee=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:x.describe("Task source: tool, scheduler, cli, api"),agentType:z$1.string().describe("Agent type to execute this task"),description:z$1.string().describe("Task description"),prompt:z$1.string().describe("Task prompt content"),timeout:z$1.number().positive().optional().describe("Task timeout in milliseconds")}),Ae=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:x.describe("Task source: tool, scheduler, cli, api")}),je=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:x,step:z$1.number().describe("Current step number"),totalSteps:z$1.number().optional().describe("Total number of steps"),output:z$1.string().describe("Progress output content"),timestamp:z$1.number().describe("Progress timestamp")}),De=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:x,result:z$1.string().describe("Task result content"),duration:z$1.number().nonnegative().describe("Task duration in milliseconds"),attachments:z$1.array(z$1.unknown()).optional().describe("Task result attachments"),error:z$1.string().optional().describe("Error message if task failed"),agentType:z$1.string().optional().describe("Agent type that executed the task"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional metadata for the task result")}),Re=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),ze=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["stop","continue"]).describe("Loop result: stop or continue")}),Fe=z$1.object({requestId:z$1.string(),kind:z$1.enum(["create-skill","create-workflow","create-bundle"]),requirement:z$1.string(),hints:z$1.array(z$1.string()),origin:z$1.object({source:z$1.enum(["human","tool","scheduler","namespace"]).optional(),timestamp:z$1.number().int().nonnegative()})}),Oe=z$1.object({requestId:z$1.string(),status:z$1.enum(["success","failed"]),specId:z$1.string().optional(),durationMs:z$1.number().int().nonnegative(),error:z$1.string().optional()}),Ge=z$1.object({dryRun:z$1.boolean()}),We=z$1.object({status:z$1.enum(["success","failed","awaiting-approval"]),applied:z$1.number().int().nonnegative().optional(),awaitingApproval:z$1.number().int().nonnegative().optional(),error:z$1.string().optional()}),k={[o.SessionStart]:W,[o.SessionEnd]:B,[o.SessionCompacting]:L,[o.SessionCompact]:q,[o.StepStart]:_,[o.StepFinish]:U,[o.StepStop]:N,[o.StepStopFailure]:$,[o.MessageReceive]:V,[o.MessageTransform]:K,[o.SystemTransform]:J,[o.ToolBefore]:X,[o.ToolAfter]:Y,[o.ToolFailure]:ee,[o.ToolDefinition]:te,[o.CommandBefore]:oe,[o.CommandAfter]:ne,[o.PermissionAsk]:ie,[o.PermissionDenied]:ae,[o.LlmParams]:me,[o.LlmHeaders]:ce,[o.ShellEnv]:ue,[o.TextComplete]:le,[o.ContextBuildBefore]:de,[o.ContextBuildAfter]:ge,[o.GatewayMessageReceive]:fe,[o.GatewayMessageProcess]:be,[o.GatewayMessageComplete]:ye,[o.GatewayMessageSend]:Se,[o.GatewayMessageDelivered]:Ie,[o.GatewayMessageRead]:he,[o.HeartbeatTrigger]:Te,[o.HeartbeatComplete]:ve,[o.ScheduledTaskTrigger]:Pe,[o.ScheduledTaskComplete]:Me,[o.CommandTrigger]:we,[o.CommandComplete]:He,[o.TaskStart]:Ee,[o.TaskRunning]:Ae,[o.TaskProgress]:je,[o.TaskComplete]:De,[o.LoopStart]:Re,[o.LoopEnd]:ze,[o.CreationRequest]:Fe,[o.CreationComplete]:Oe,[o.EvolutionRequest]:Ge,[o.EvolutionComplete]:We};function it(s){return k[s]}function at(s,g){let f=k[s];if(!f)throw new Error(`No schema found for event: ${s}`);return f.parse(g)}function pt(s,g){let f=k[s];return f?f.safeParse(g):{success:false,error:new z$1.ZodError([{code:"custom",path:[],message:`No schema found for event: ${s}`}])}}var yt=z$1.enum(["command","mcp","skill"]).describe("Command source"),Be=z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments"),Le=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),St=z$1.object({name:z$1.string().describe("Command name"),description:z$1.string().describe("Command description"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:z$1.string().optional().describe("Specified agent name"),model:z$1.string().optional().describe("Specified model"),hints:z$1.array(z$1.string()).optional().describe("Argument hints"),commandType:z$1.enum(["prompt","local"]).optional().describe("Command type"),hidden:z$1.boolean().optional().describe("Whether hidden")}),It=z$1.object({sessionId:z$1.string().describe("Session ID"),directory:z$1.string().describe("Working directory"),model:z$1.string().optional().describe("Model identifier"),agent:z$1.string().optional().describe("Agent name"),arguments:Be.describe("Command arguments")}),qe=z$1.record(z$1.string(),z$1.unknown()).describe("Result metadata"),ht=z$1.object({title:z$1.string().describe("Result title"),metadata:qe.describe("Result metadata"),output:z$1.string().describe("Result output"),parts:z$1.array(Le).optional().describe("Result parts"),success:z$1.boolean().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}),xt=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),kt=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var S=z$1.enum(["ask","allow","deny"]),i=z$1.union([S,z$1.record(z$1.string(),S)]),_e=z$1.object({read:i.optional(),edit:i.optional(),write:i.optional(),glob:i.optional(),grep:i.optional(),list:i.optional(),bash:i.optional(),webfetch:i.optional(),websearch:i.optional(),task:i.optional(),todo:S.optional(),question:S.optional(),skill:i.optional(),memory:i.optional(),note:i.optional(),pty_session:i.optional(),pty_manage:i.optional(),external_directory:i.optional(),doom_loop:S.optional()}).catchall(i),Ue=z$1.enum(["subagent","primary","all"]),Ne=z$1.enum(["general","coder","all"]),$e=z$1.object({providerId:z$1.string().min(1).describe("Model provider ID"),modelId:z$1.string().min(1).describe("Model ID")}),Ht=z$1.object({name:z$1.string().min(1).describe("Unique agent name"),description:z$1.string().optional().describe("When to use this agent"),mode:Ue.optional().describe("Agent mode"),hidden:z$1.boolean().optional().describe("Hide from @ autocomplete menu"),scope:Ne.optional().describe("Agent scope (general / coder / all)"),model:$e.optional().describe("Default model"),variant:z$1.string().optional().describe("Default model variant"),temperature:z$1.number().min(0).max(2).optional().describe("Sampling temperature"),topP:z$1.number().min(0).max(1).optional().describe("Top-p sampling"),prompt:z$1.string().optional().describe("System prompt"),permission:_e.optional().describe("Tool permissions"),steps:z$1.number().int().positive().optional().describe("Maximum execution steps"),color:z$1.union([z$1.string().regex(/^#[0-9a-fA-F]{6}$/),z$1.enum(["primary","secondary","accent","success","warning","error","info"])]).optional().describe("UI color (hex code or theme name)"),options:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional options")}).meta({ref:"PluginAgent"});var Ft=z$1.object({name:z$1.string().min(1).describe("Unique skill name"),description:z$1.string().min(1).describe("When to use this skill"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope")}),Ot=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),Gt=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var d=new Map;function Nt(s){if(d.has(s.id))throw new Error(`Marketplace with id "${s.id}" already registered`);d.set(s.id,s);}function $t(s){return d.delete(s)}function Zt(){return Array.from(d.values()).map(s=>s)}function Vt(s){return d.get(s)??null}function Kt(s){return Array.from(d.values()).filter(g=>g.category===s)}export{D as AgentExecutorSchema,Ht as AgentMetadataSchema,Ue as AgentModeSchema,$e as AgentModelSchema,_e as AgentPermissionSchema,l as AgentSchema,Ne as AgentScopeSchema,b as CallIDSchema,ne as CommandAfterInputSchema,Be as CommandArgumentsSchema,oe as CommandBeforeInputSchema,He as CommandCompleteInputSchema,qe as CommandExecuteResultMetadataSchema,ht as CommandExecuteResultSchema,It as CommandExecutionContextSchema,E as CommandExecutorSchema,xt as CommandInitContextSchema,kt as CommandInitResultSchema,St as CommandMetadataSchema,Le as CommandPromptPartSchema,yt as CommandSourceSchema,xe as CommandTaskDefinitionSchema,we as CommandTriggerInputSchema,v as ContentPartSchema,ge as ContextBuildAfterInputSchema,de as ContextBuildBeforeInputSchema,Oe as CreationCompleteInputSchema,Fe as CreationRequestInputSchema,T as CwdSchema,O as EndReasonSchema,k as EventInputSchemas,We as EvolutionCompleteInputSchema,Ge as EvolutionRequestInputSchema,G as FinishReasonSchema,R as FunctionExecutorSchema,ye as GatewayMessageCompleteInputSchema,Ie as GatewayMessageDeliveredInputSchema,be as GatewayMessageProcessInputSchema,he as GatewayMessageReadInputSchema,fe as GatewayMessageReceiveInputSchema,Se as GatewayMessageSendInputSchema,et as HOOK_EVENTS,ve as HeartbeatCompleteInputSchema,ke as HeartbeatTaskDefinitionSchema,Te as HeartbeatTriggerInputSchema,o as HookEvent,z as HookExecutorSchema,F as HookMatcherSchema,u as HookType,st as HooksConfigSchema,j as HttpExecutorSchema,ce as LlmHeadersInputSchema,me as LlmParamsInputSchema,pe as LlmParamsSchema,M as LlmProviderSchema,ze as LoopEndInputSchema,Re as LoopStartInputSchema,a as MessageIDSchema,V as MessageReceiveInputSchema,Z as MessageRoleSchema,P as MessageSchema,K as MessageTransformInputSchema,C as ModelObjectSchema,y as ModelSchema,S as PermissionActionSchema,ie as PermissionAskInputSchema,ae as PermissionDeniedInputSchema,re as PermissionLevelSchema,se as PermissionRequestSchema,i as PermissionRuleSchema,A as PromptExecutorSchema,Me as ScheduledTaskCompleteInputSchema,Pe as ScheduledTaskTriggerInputSchema,Ce as SchedulerTaskDefinitionSchema,q as SessionCompactInputSchema,L as SessionCompactingInputSchema,B as SessionEndInputSchema,n as SessionIDSchema,W as SessionStartInputSchema,ue as ShellEnvInputSchema,Ot as SkillInitContextSchema,Gt as SkillInitResultSchema,Ft as SkillMetadataSchema,U as StepFinishInputSchema,_ as StepStartInputSchema,$ as StepStopFailureInputSchema,N as StepStopInputSchema,J as SystemTransformInputSchema,De as TaskCompleteInputSchema,je as TaskProgressInputSchema,Ae as TaskRunningInputSchema,x as TaskSourceSchema,Ee as TaskStartInputSchema,le as TextCompleteInputSchema,Y as ToolAfterInputSchema,h as ToolArgsSchema,X as ToolBeforeInputSchema,te as ToolDefinitionInputSchema,ee as ToolFailureInputSchema,Q as ToolResultSchema,Vt as findMarketplace,Kt as findMarketplacesByCategory,it as getEventInputSchema,Zt as listMarketplaces,Nt as registerMarketplace,pt as safeValidateHookInput,H as tool,$t as unregisterMarketplace,at as validateHookInput};
|
|
1
|
+
import M,{z as z$1}from'zod';import {AgentPermissionSchema}from'@easbot/types';export{AgentPermissionSchema,PermissionActionSchema,PermissionRuleSchema,buildToolArgs,createTool,toolSchema as schema}from'@easbot/types';import'@easbot/sdk';function P(r){return {description:r.description,args:r.args,execute:r.execute}}P.schema=M;var c={Command:"command",Prompt:"prompt",Http:"http",Agent:"agent",Function:"function"},o={SessionStart:"session.start",SessionEnd:"session.end",SessionCompacting:"session.compacting",SessionCompact:"session.compact",StepStart:"step.start",StepFinish:"step.finish",StepStop:"step.stop",StepStopFailure:"step.stop.failure",MessageReceive:"message.receive",MessageTransform:"message.transform",SystemTransform:"system.transform",ToolBefore:"tool.before",ToolAfter:"tool.after",ToolFailure:"tool.failure",ToolDefinition:"tool.definition",CommandBefore:"command.before",CommandAfter:"command.after",PermissionAsk:"permission.ask",PermissionDenied:"permission.denied",LlmParams:"llm.params",LlmHeaders:"llm.headers",ShellEnv:"shell.env",TextComplete:"text.complete",GatewayMessageReceive:"gateway.message.receive",GatewayMessageProcess:"gateway.message.process",GatewayMessageComplete:"gateway.message.complete",GatewayMessageSend:"gateway.message.send",GatewayMessageDelivered:"gateway.message.delivered",GatewayMessageRead:"gateway.message.read",HeartbeatTrigger:"scheduler.heartbeat.trigger",HeartbeatComplete:"scheduler.heartbeat.complete",ScheduledTaskTrigger:"scheduler.task.trigger",ScheduledTaskComplete:"scheduler.task.complete",CommandTrigger:"scheduler.command.trigger",CommandComplete:"scheduler.command.complete",ContextBuildBefore:"context.build.before",ContextBuildAfter:"context.build.after",TaskStart:"task.start",TaskRunning:"task.running",TaskProgress:"task.progress",TaskComplete:"task.complete",LoopStart:"loop.start",LoopEnd:"loop.end",CreationRequest:"creation.request",CreationComplete:"creation.complete",EvolutionRequest:"evolution.request",EvolutionComplete:"evolution.complete"},Xe=Object.values(o);var y=z$1.string().optional(),w=z$1.object({type:z$1.literal(c.Command),command:z$1.string(),if:y,shell:z$1.enum(["bash","powershell"]).optional(),timeout:z$1.number().positive().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),async:z$1.boolean().optional()}),H=z$1.object({type:z$1.literal(c.Prompt),if:y,timeout:z$1.number().positive().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),runMode:z$1.enum(["session","fork"]).optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown())}),E=z$1.object({type:z$1.literal(c.Http),url:z$1.string(),if:y,timeout:z$1.number().positive().optional(),method:z$1.enum(["GET","POST","PUT","DELETE"]).optional(),headers:z$1.record(z$1.string(),z$1.string()).optional(),allowedEnvVars:z$1.array(z$1.string()).optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional()}),A=z$1.object({type:z$1.literal(c.Agent),if:y,timeout:z$1.number().positive().optional(),agent:z$1.string().optional(),model:z$1.string().optional(),statusMessage:z$1.string().optional(),once:z$1.boolean().optional(),system:z$1.string().optional(),parts:z$1.array(z$1.unknown())}),j=z$1.object({type:z$1.literal(c.Function),handler:z$1.function()}),D=z$1.discriminatedUnion("type",[w,H,E,A,j]),R=z$1.object({event:z$1.string(),matcher:z$1.string().optional(),hooks:z$1.array(D)}),nt=z$1.record(z$1.string(),z$1.array(R)),n=z$1.string().min(1).describe("Session unique identifier"),i=z$1.string().min(1).describe("Message unique identifier"),f=z$1.string().min(1).describe("Tool call unique identifier"),u=z$1.string().optional().describe("Agent name"),b=z$1.string().optional().describe("Model identifier"),x=z$1.object({providerId:z$1.string().describe("Provider ID"),modelId:z$1.string().describe("Model ID"),api:z$1.object({id:z$1.string().describe("API ID"),npm:z$1.string().optional().describe("NPM package name")}).optional().describe("API information")}).optional().describe("Model object"),k=z$1.string().optional().describe("Working directory path"),z=z$1.enum(["user_request","max_tokens","stop","error","timeout","cancelled"]).describe("Session end reason"),F=z$1.enum(["stop","max_tokens","end_turn","stop_sequence"]).describe("Step finish reason"),O=z$1.object({sessionId:n,source:z$1.enum(["user","agent","system","scheduled"]).optional().describe("Session source"),model:b,agent:u,cwd:k}),G=z$1.object({sessionId:n,reason:z,duration:z$1.number().positive().optional().describe("Session duration in milliseconds")}),W=z$1.object({sessionId:n,trigger:z$1.enum(["manual","auto","threshold"]).describe("Compaction trigger"),contextLength:z$1.number().positive().describe("Current context length"),threshold:z$1.number().positive().describe("Trigger threshold")}),B=z$1.object({sessionId:n,summary:z$1.string().describe("Compaction summary"),previousLength:z$1.number().positive().describe("Previous context length"),newLength:z$1.number().positive().describe("New context length")}),L=z$1.object({sessionId:n,messageId:i,userMessageId:i.optional().describe("User message ID for the current step"),model:b,agent:u}),q=z$1.object({sessionId:n,messageId:i,userMessageId:i.optional().describe("User message ID for the current step"),model:b,agent:u,finishReason:F,tokens:z$1.object({input:z$1.number().int().nonnegative().optional(),output:z$1.number().int().nonnegative().optional(),total:z$1.number().int().nonnegative().optional()}).optional().describe("Token usage statistics")}),_=z$1.object({sessionId:n,reason:z$1.string().describe("Stop reason")}),U=z$1.object({sessionId:n,error:z$1.string().describe("Error message"),errorType:z$1.enum(["rate_limit","auth_error","network_error","timeout","invalid_request","server_error"]).describe("Error type")}),N=z$1.enum(["user","assistant","system","tool"]),C=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().optional().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),T=z$1.object({id:i,role:N,content:z$1.union([z$1.string(),z$1.array(C)]),name:z$1.string().optional().describe("Message sender name"),tool_call_id:f.optional().describe("Related tool call ID")}),$=z$1.object({sessionId:n,agent:u,model:b,messageId:i,message:z$1.object({id:i,role:z$1.literal("user"),content:z$1.union([z$1.string(),z$1.array(C)])}).describe("User message")}),Z=z$1.object({sessionId:n,messages:z$1.array(T).describe("Messages to transform")}),V=z$1.object({sessionId:n,model:b,system:z$1.array(z$1.string()).describe("Current system prompt")}),S=z$1.record(z$1.string(),z$1.unknown()).describe("Tool call arguments"),K=z$1.object({title:z$1.string().optional().describe("Result title"),content:z$1.string().describe("Result content"),is_error:z$1.boolean().optional().describe("Is error result"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Extra metadata")}),J=z$1.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:z$1.string().describe("Tool name"),callId:f,args:S}),Q=z$1.object({sessionId:n,userMessageId:i.optional().describe("User message ID for the current step"),tool:z$1.string(),callId:f,args:S,result:K,duration:z$1.number().nonnegative().optional().describe("Execution duration in milliseconds")}),X=z$1.object({sessionId:n,tool:z$1.string(),callId:f,args:S,error:z$1.string().describe("Error message"),errorType:z$1.enum(["timeout","invalid_args","execution_error","permission_denied"])}),Y=z$1.object({sessionId:n,toolID:z$1.string().describe("Tool ID"),definition:z$1.object({name:z$1.string(),description:z$1.string().optional(),parameters:z$1.record(z$1.string(),z$1.unknown()).optional()}).describe("Tool definition")}),ee=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments")}),te=z$1.object({sessionId:n,command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional(),result:z$1.object({info:z$1.unknown().optional().describe("Message info"),parts:z$1.array(z$1.unknown()).optional().describe("Message parts"),title:z$1.string().optional().describe("Result title"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Result metadata"),output:z$1.string().optional().describe("Result output"),success:z$1.boolean().optional().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}).describe("Command execution result")}),oe=z$1.enum(["read","write","exec","admin"]),ne=z$1.object({tool:z$1.string().describe("Tool name requesting permission"),args:S.optional(),level:oe.optional(),reason:z$1.string().optional().describe("Reason for permission request")}),re=z$1.object({sessionId:n,request:ne}),se=z$1.object({sessionId:n,tool:z$1.string(),reason:z$1.string().optional()}),v=z$1.enum(["openai","anthropic","google","azure","custom"]),ie=z$1.object({temperature:z$1.number().min(0).max(2).optional(),topP:z$1.number().min(0).max(1).optional(),topK:z$1.number().int().positive().optional(),maxTokens:z$1.number().int().positive().optional(),stopSequences:z$1.array(z$1.string()).optional(),responseFormat:z$1.enum(["text","json_object"]).optional()}),ae=z$1.object({sessionId:n,agent:u,model:x,provider:v,params:ie.partial().optional()}),pe=z$1.object({sessionId:n,agent:u,model:x,provider:v,headers:z$1.record(z$1.string(),z$1.string()).optional()}),me=z$1.object({cwd:k.describe("Working directory"),sessionId:n.optional(),callId:f.optional()}),ce=z$1.object({sessionId:n,messageId:i,partId:z$1.string().describe("Text part ID"),text:z$1.string().describe("Completed text")}),ue=z$1.object({sessionId:n,mode:z$1.enum(["agent","chat","query"]).describe("Build mode"),providerId:z$1.string().optional()}),le=z$1.object({sessionId:n,context:z$1.object({messages:z$1.array(T),system:z$1.array(z$1.string()),metadata:z$1.record(z$1.string(),z$1.unknown())}).describe("Built context")}),de=z$1.object({gatewayID:z$1.string().describe("Gateway ID"),messageId:i,message:z$1.unknown().describe("Received message")}),ge=z$1.object({gatewayID:z$1.string(),messageId:i,message:z$1.unknown(),sessionId:n.optional()}),fe=z$1.object({gatewayID:z$1.string(),messageId:i,result:z$1.unknown().optional()}),be=z$1.object({gatewayID:z$1.string(),messageId:i,message:z$1.unknown(),target:z$1.string().optional().describe("Send target")}),ye=z$1.object({gatewayID:z$1.string(),messageId:i,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Delivery timestamp")}),Se=z$1.object({gatewayID:z$1.string(),messageId:i,sessionId:n.optional(),channel:z$1.object({platform:z$1.string(),channelId:z$1.string()}),timestamp:z$1.number().describe("Read timestamp")}),Ie=z$1.object({type:z$1.literal("command"),config:z$1.object({command:z$1.string(),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional()})}),he=z$1.object({type:z$1.literal("heartbeat"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({session:z$1.string().optional(),mode:z$1.enum(["session","fork"]).optional(),agent:z$1.string().optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),xe=z$1.object({type:z$1.literal("scheduler"),parts:z$1.array(z$1.unknown()),system:z$1.string().optional(),config:z$1.object({agentType:z$1.string().optional(),transport:z$1.enum(["stdio","http","websocket","cli"]).optional(),model:z$1.string().optional(),tools:z$1.record(z$1.string(),z$1.boolean()).optional()}).optional()}),ke=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),timestamp:z$1.number().describe("Heartbeat timestamp"),name:z$1.string().optional().describe("Heartbeat name"),definition:he.optional()}),Ce=z$1.object({taskId:z$1.string().describe("Heartbeat task ID"),sessionId:n.optional(),timestamp:z$1.number(),duration:z$1.number().nonnegative().optional(),success:z$1.boolean().optional(),error:z$1.string().optional()}),Te=z$1.object({taskId:z$1.string().describe("Task ID"),taskName:z$1.string().optional(),timestamp:z$1.number(),payload:z$1.record(z$1.string(),z$1.unknown()).optional(),definition:xe.optional()}),ve=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),result:z$1.record(z$1.string(),z$1.unknown()).optional(),error:z$1.string().optional()}),Me=z$1.object({taskId:z$1.string().describe("Command task unique identifier"),taskName:z$1.string().describe("Command task name"),command:z$1.string().describe("Command name"),arguments:z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).optional().describe("Command arguments"),timestamp:z$1.number().describe("Trigger timestamp"),definition:Ie.optional()}),Pe=z$1.object({taskId:z$1.string(),timestamp:z$1.number(),success:z$1.boolean(),output:z$1.string().optional(),error:z$1.string().optional(),duration:z$1.number().describe("Execution duration in milliseconds")}),I=z$1.enum(["tool","scheduler","cli","api"]),we=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:I.describe("Task source: tool, scheduler, cli, api"),agentType:z$1.string().describe("Agent type to execute this task"),description:z$1.string().describe("Task description"),prompt:z$1.string().describe("Task prompt content"),timeout:z$1.number().positive().optional().describe("Task timeout in milliseconds")}),He=z$1.object({taskId:z$1.string().describe("Task unique identifier"),sessionId:z$1.string().describe("Session ID for this task"),source:I.describe("Task source: tool, scheduler, cli, api")}),Ee=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:I,step:z$1.number().describe("Current step number"),totalSteps:z$1.number().optional().describe("Total number of steps"),output:z$1.string().describe("Progress output content"),timestamp:z$1.number().describe("Progress timestamp")}),Ae=z$1.object({taskId:z$1.string(),sessionId:z$1.string(),source:I,result:z$1.string().describe("Task result content"),duration:z$1.number().nonnegative().describe("Task duration in milliseconds"),attachments:z$1.array(z$1.unknown()).optional().describe("Task result attachments"),error:z$1.string().optional().describe("Error message if task failed"),agentType:z$1.string().optional().describe("Agent type that executed the task"),metadata:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional metadata for the task result")}),je=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["start","continue","stop"]).optional().describe("Loop result: start, continue, or stop")}),De=z$1.object({sessionId:z$1.string().describe("Session ID"),step:z$1.number().describe("Current step number"),lastUserId:z$1.string().describe("Last user message ID"),result:z$1.enum(["stop","continue"]).describe("Loop result: stop or continue")}),Re=z$1.object({requestId:z$1.string(),kind:z$1.enum(["create-skill","create-workflow","create-bundle"]),requirement:z$1.string(),hints:z$1.array(z$1.string()),origin:z$1.object({source:z$1.enum(["human","tool","scheduler","namespace"]).optional(),timestamp:z$1.number().int().nonnegative()})}),ze=z$1.object({requestId:z$1.string(),status:z$1.enum(["success","failed"]),specId:z$1.string().optional(),durationMs:z$1.number().int().nonnegative(),error:z$1.string().optional()}),Fe=z$1.object({dryRun:z$1.boolean()}),Oe=z$1.object({status:z$1.enum(["success","failed","awaiting-approval"]),applied:z$1.number().int().nonnegative().optional(),awaitingApproval:z$1.number().int().nonnegative().optional(),error:z$1.string().optional()}),h={[o.SessionStart]:O,[o.SessionEnd]:G,[o.SessionCompacting]:W,[o.SessionCompact]:B,[o.StepStart]:L,[o.StepFinish]:q,[o.StepStop]:_,[o.StepStopFailure]:U,[o.MessageReceive]:$,[o.MessageTransform]:Z,[o.SystemTransform]:V,[o.ToolBefore]:J,[o.ToolAfter]:Q,[o.ToolFailure]:X,[o.ToolDefinition]:Y,[o.CommandBefore]:ee,[o.CommandAfter]:te,[o.PermissionAsk]:re,[o.PermissionDenied]:se,[o.LlmParams]:ae,[o.LlmHeaders]:pe,[o.ShellEnv]:me,[o.TextComplete]:ce,[o.ContextBuildBefore]:ue,[o.ContextBuildAfter]:le,[o.GatewayMessageReceive]:de,[o.GatewayMessageProcess]:ge,[o.GatewayMessageComplete]:fe,[o.GatewayMessageSend]:be,[o.GatewayMessageDelivered]:ye,[o.GatewayMessageRead]:Se,[o.HeartbeatTrigger]:ke,[o.HeartbeatComplete]:Ce,[o.ScheduledTaskTrigger]:Te,[o.ScheduledTaskComplete]:ve,[o.CommandTrigger]:Me,[o.CommandComplete]:Pe,[o.TaskStart]:we,[o.TaskRunning]:He,[o.TaskProgress]:Ee,[o.TaskComplete]:Ae,[o.LoopStart]:je,[o.LoopEnd]:De,[o.CreationRequest]:Re,[o.CreationComplete]:ze,[o.EvolutionRequest]:Fe,[o.EvolutionComplete]:Oe};function rt(r){return h[r]}function st(r,d){let g=h[r];if(!g)throw new Error(`No schema found for event: ${r}`);return g.parse(d)}function it(r,d){let g=h[r];return g?g.safeParse(d):{success:false,error:new z$1.ZodError([{code:"custom",path:[],message:`No schema found for event: ${r}`}])}}var ft=z$1.enum(["command","mcp","skill"]).describe("Command source"),Ge=z$1.union([z$1.string(),z$1.record(z$1.string(),z$1.unknown())]).describe("Command arguments"),We=z$1.discriminatedUnion("type",[z$1.object({type:z$1.literal("text"),text:z$1.string().describe("Text content")}),z$1.object({type:z$1.literal("image"),source:z$1.object({type:z$1.enum(["base64","url"]),mime:z$1.string().describe("File mime type"),data:z$1.string().describe("File base64 encoding data or url")})}),z$1.object({type:z$1.literal("file"),url:z$1.string().describe("File path"),filename:z$1.string().describe("File name"),mime:z$1.string().optional().describe("File mime type")})]),bt=z$1.object({name:z$1.string().describe("Command name"),description:z$1.string().describe("Command description"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope"),agent:z$1.string().optional().describe("Specified agent name"),model:z$1.string().optional().describe("Specified model"),hints:z$1.array(z$1.string()).optional().describe("Argument hints"),commandType:z$1.enum(["prompt","local"]).optional().describe("Command type"),hidden:z$1.boolean().optional().describe("Whether hidden")}),yt=z$1.object({sessionId:z$1.string().describe("Session ID"),directory:z$1.string().describe("Working directory"),model:z$1.string().optional().describe("Model identifier"),agent:z$1.string().optional().describe("Agent name"),arguments:Ge.describe("Command arguments")}),Be=z$1.record(z$1.string(),z$1.unknown()).describe("Result metadata"),St=z$1.object({title:z$1.string().describe("Result title"),metadata:Be.describe("Result metadata"),output:z$1.string().describe("Result output"),parts:z$1.array(We).optional().describe("Result parts"),success:z$1.boolean().describe("Whether execution succeeded"),error:z$1.string().optional().describe("Error message if failed")}),It=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),ht=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var qe=z$1.enum(["subagent","primary","all"]),_e=z$1.enum(["general","coder","all"]),Ue=z$1.object({providerId:z$1.string().min(1).describe("Model provider ID"),modelId:z$1.string().min(1).describe("Model ID")}),Et=z$1.object({name:z$1.string().min(1).describe("Unique agent name"),description:z$1.string().optional().describe("When to use this agent"),mode:qe.optional().describe("Agent mode"),hidden:z$1.boolean().optional().describe("Hide from @ autocomplete menu"),scope:_e.optional().describe("Agent scope (general / coder / all)"),model:Ue.optional().describe("Default model"),variant:z$1.string().optional().describe("Default model variant"),temperature:z$1.number().min(0).max(2).optional().describe("Sampling temperature"),topP:z$1.number().min(0).max(1).optional().describe("Top-p sampling"),prompt:z$1.string().optional().describe("System prompt"),permission:AgentPermissionSchema.optional().describe("Tool permissions"),steps:z$1.number().int().positive().optional().describe("Maximum execution steps"),color:z$1.union([z$1.string().regex(/^#[0-9a-fA-F]{6}$/),z$1.enum(["primary","secondary","accent","success","warning","error","info"])]).optional().describe("UI color (hex code or theme name)"),options:z$1.record(z$1.string(),z$1.unknown()).optional().describe("Additional options")}).meta({ref:"PluginAgent"});var Ot=z$1.object({name:z$1.string().min(1).describe("Unique skill name"),description:z$1.string().min(1).describe("When to use this skill"),scope:z$1.enum(["general","coder","all"]).optional().describe("Context mode scope")}),Gt=z$1.object({agent:z$1.object({name:z$1.string().describe("Agent name"),model:z$1.string().optional().describe("Agent model")}).optional().describe("Agent context")}),Wt=z$1.object({isEnabled:z$1.boolean().optional().describe("Is enabled check result")});var l=new Map;function $t(r){if(l.has(r.id))throw new Error(`Marketplace with id "${r.id}" already registered`);l.set(r.id,r);}function Zt(r){return l.delete(r)}function Vt(){return Array.from(l.values()).map(r=>r)}function Kt(r){return l.get(r)??null}function Jt(r){return Array.from(l.values()).filter(d=>d.category===r)}export{A as AgentExecutorSchema,Et as AgentMetadataSchema,qe as AgentModeSchema,Ue as AgentModelSchema,u as AgentSchema,_e as AgentScopeSchema,f as CallIDSchema,te as CommandAfterInputSchema,Ge as CommandArgumentsSchema,ee as CommandBeforeInputSchema,Pe as CommandCompleteInputSchema,Be as CommandExecuteResultMetadataSchema,St as CommandExecuteResultSchema,yt as CommandExecutionContextSchema,w as CommandExecutorSchema,It as CommandInitContextSchema,ht as CommandInitResultSchema,bt as CommandMetadataSchema,We as CommandPromptPartSchema,ft as CommandSourceSchema,Ie as CommandTaskDefinitionSchema,Me as CommandTriggerInputSchema,C as ContentPartSchema,le as ContextBuildAfterInputSchema,ue as ContextBuildBeforeInputSchema,ze as CreationCompleteInputSchema,Re as CreationRequestInputSchema,k as CwdSchema,z as EndReasonSchema,h as EventInputSchemas,Oe as EvolutionCompleteInputSchema,Fe as EvolutionRequestInputSchema,F as FinishReasonSchema,j as FunctionExecutorSchema,fe as GatewayMessageCompleteInputSchema,ye as GatewayMessageDeliveredInputSchema,ge as GatewayMessageProcessInputSchema,Se as GatewayMessageReadInputSchema,de as GatewayMessageReceiveInputSchema,be as GatewayMessageSendInputSchema,Xe as HOOK_EVENTS,Ce as HeartbeatCompleteInputSchema,he as HeartbeatTaskDefinitionSchema,ke as HeartbeatTriggerInputSchema,o as HookEvent,D as HookExecutorSchema,R as HookMatcherSchema,c as HookType,nt as HooksConfigSchema,E as HttpExecutorSchema,pe as LlmHeadersInputSchema,ae as LlmParamsInputSchema,ie as LlmParamsSchema,v as LlmProviderSchema,De as LoopEndInputSchema,je as LoopStartInputSchema,i as MessageIDSchema,$ as MessageReceiveInputSchema,N as MessageRoleSchema,T as MessageSchema,Z as MessageTransformInputSchema,x as ModelObjectSchema,b as ModelSchema,re as PermissionAskInputSchema,se as PermissionDeniedInputSchema,oe as PermissionLevelSchema,ne as PermissionRequestSchema,H as PromptExecutorSchema,ve as ScheduledTaskCompleteInputSchema,Te as ScheduledTaskTriggerInputSchema,xe as SchedulerTaskDefinitionSchema,B as SessionCompactInputSchema,W as SessionCompactingInputSchema,G as SessionEndInputSchema,n as SessionIDSchema,O as SessionStartInputSchema,me as ShellEnvInputSchema,Gt as SkillInitContextSchema,Wt as SkillInitResultSchema,Ot as SkillMetadataSchema,q as StepFinishInputSchema,L as StepStartInputSchema,U as StepStopFailureInputSchema,_ as StepStopInputSchema,V as SystemTransformInputSchema,Ae as TaskCompleteInputSchema,Ee as TaskProgressInputSchema,He as TaskRunningInputSchema,I as TaskSourceSchema,we as TaskStartInputSchema,ce as TextCompleteInputSchema,Q as ToolAfterInputSchema,S as ToolArgsSchema,J as ToolBeforeInputSchema,Y as ToolDefinitionInputSchema,X as ToolFailureInputSchema,K as ToolResultSchema,Kt as findMarketplace,Jt as findMarketplacesByCategory,rt as getEventInputSchema,Vt as listMarketplaces,$t as registerMarketplace,it as safeValidateHookInput,P as tool,Zt as unregisterMarketplace,st as validateHookInput};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easbot/plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"description": "EASBot Plugin for client applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"zod": "^4.4.3",
|
|
42
|
-
"@easbot/
|
|
43
|
-
"@easbot/
|
|
42
|
+
"@easbot/types": "0.3.28",
|
|
43
|
+
"@easbot/sdk": "0.3.28"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^25.9.5",
|