@desplega.ai/agent-swarm 1.51.2 → 1.52.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.
Files changed (38) hide show
  1. package/openapi.json +767 -4
  2. package/package.json +1 -1
  3. package/src/be/db.ts +642 -0
  4. package/src/be/migrations/019_skills.sql +65 -0
  5. package/src/be/migrations/020_approval_requests.sql +41 -0
  6. package/src/be/skill-parser.ts +70 -0
  7. package/src/be/skill-sync.ts +106 -0
  8. package/src/commands/runner.ts +136 -41
  9. package/src/http/approval-requests.ts +247 -0
  10. package/src/http/config.ts +3 -3
  11. package/src/http/index.ts +4 -0
  12. package/src/http/skills.ts +479 -0
  13. package/src/prompts/base-prompt.ts +8 -0
  14. package/src/server.ts +29 -0
  15. package/src/tests/approval-requests.test.ts +735 -0
  16. package/src/tests/skill-parser.test.ts +178 -0
  17. package/src/tests/skill-sync.test.ts +171 -0
  18. package/src/tests/tool-annotations.test.ts +2 -1
  19. package/src/tests/workflow-executors.test.ts +4 -2
  20. package/src/tools/request-human-input.ts +106 -0
  21. package/src/tools/skills/index.ts +11 -0
  22. package/src/tools/skills/skill-create.ts +105 -0
  23. package/src/tools/skills/skill-delete.ts +67 -0
  24. package/src/tools/skills/skill-get.ts +75 -0
  25. package/src/tools/skills/skill-install-remote.ts +152 -0
  26. package/src/tools/skills/skill-install.ts +101 -0
  27. package/src/tools/skills/skill-list.ts +77 -0
  28. package/src/tools/skills/skill-publish.ts +123 -0
  29. package/src/tools/skills/skill-search.ts +43 -0
  30. package/src/tools/skills/skill-sync-remote.ts +128 -0
  31. package/src/tools/skills/skill-uninstall.ts +60 -0
  32. package/src/tools/skills/skill-update.ts +128 -0
  33. package/src/tools/tool-config.ts +16 -0
  34. package/src/types.ts +54 -0
  35. package/src/workflows/executors/human-in-the-loop.ts +160 -0
  36. package/src/workflows/executors/registry.ts +2 -0
  37. package/src/workflows/recovery.ts +72 -0
  38. package/src/workflows/resume.ts +65 -1
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Swarm API",
5
- "version": "1.51.0",
5
+ "version": "1.52.0",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
@@ -606,6 +606,343 @@
606
606
  }
607
607
  }
608
608
  },
609
+ "/api/approval-requests": {
610
+ "post": {
611
+ "summary": "Create a new approval request",
612
+ "tags": [
613
+ "ApprovalRequests"
614
+ ],
615
+ "security": [
616
+ {
617
+ "bearerAuth": []
618
+ }
619
+ ],
620
+ "requestBody": {
621
+ "content": {
622
+ "application/json": {
623
+ "schema": {
624
+ "type": "object",
625
+ "properties": {
626
+ "title": {
627
+ "type": "string",
628
+ "minLength": 1
629
+ },
630
+ "questions": {
631
+ "type": "array",
632
+ "items": {
633
+ "type": "object",
634
+ "properties": {
635
+ "id": {
636
+ "type": "string"
637
+ },
638
+ "type": {
639
+ "type": "string",
640
+ "enum": [
641
+ "approval",
642
+ "text",
643
+ "single-select",
644
+ "multi-select",
645
+ "boolean"
646
+ ]
647
+ },
648
+ "label": {
649
+ "type": "string"
650
+ },
651
+ "required": {
652
+ "type": "boolean"
653
+ },
654
+ "description": {
655
+ "type": "string"
656
+ },
657
+ "placeholder": {
658
+ "type": "string"
659
+ },
660
+ "multiline": {
661
+ "type": "boolean"
662
+ },
663
+ "options": {
664
+ "type": "array",
665
+ "items": {
666
+ "type": "object",
667
+ "properties": {
668
+ "value": {
669
+ "type": "string"
670
+ },
671
+ "label": {
672
+ "type": "string"
673
+ },
674
+ "description": {
675
+ "type": "string"
676
+ }
677
+ },
678
+ "required": [
679
+ "value",
680
+ "label"
681
+ ]
682
+ }
683
+ },
684
+ "minSelections": {
685
+ "type": "integer",
686
+ "minimum": 0
687
+ },
688
+ "maxSelections": {
689
+ "type": "integer",
690
+ "minimum": 1
691
+ },
692
+ "defaultValue": {
693
+ "type": "boolean"
694
+ }
695
+ },
696
+ "required": [
697
+ "id",
698
+ "type",
699
+ "label"
700
+ ]
701
+ },
702
+ "minItems": 1
703
+ },
704
+ "approvers": {
705
+ "type": "object",
706
+ "properties": {
707
+ "users": {
708
+ "type": "array",
709
+ "items": {
710
+ "type": "string"
711
+ }
712
+ },
713
+ "roles": {
714
+ "type": "array",
715
+ "items": {
716
+ "type": "string"
717
+ }
718
+ },
719
+ "policy": {
720
+ "anyOf": [
721
+ {
722
+ "type": "string",
723
+ "enum": [
724
+ "any"
725
+ ]
726
+ },
727
+ {
728
+ "type": "string",
729
+ "enum": [
730
+ "all"
731
+ ]
732
+ },
733
+ {
734
+ "type": "object",
735
+ "properties": {
736
+ "min": {
737
+ "type": "integer",
738
+ "minimum": 1
739
+ }
740
+ },
741
+ "required": [
742
+ "min"
743
+ ]
744
+ }
745
+ ]
746
+ }
747
+ },
748
+ "required": [
749
+ "policy"
750
+ ]
751
+ },
752
+ "workflowRunId": {
753
+ "type": "string",
754
+ "format": "uuid"
755
+ },
756
+ "workflowRunStepId": {
757
+ "type": "string",
758
+ "format": "uuid"
759
+ },
760
+ "sourceTaskId": {
761
+ "type": "string",
762
+ "format": "uuid"
763
+ },
764
+ "timeoutSeconds": {
765
+ "type": "integer",
766
+ "minimum": 1
767
+ },
768
+ "notifications": {
769
+ "type": "array",
770
+ "items": {
771
+ "type": "object",
772
+ "properties": {
773
+ "channel": {
774
+ "type": "string",
775
+ "enum": [
776
+ "slack",
777
+ "email"
778
+ ]
779
+ },
780
+ "target": {
781
+ "type": "string"
782
+ }
783
+ },
784
+ "required": [
785
+ "channel",
786
+ "target"
787
+ ]
788
+ }
789
+ }
790
+ },
791
+ "required": [
792
+ "title",
793
+ "questions",
794
+ "approvers"
795
+ ]
796
+ }
797
+ }
798
+ }
799
+ },
800
+ "responses": {
801
+ "201": {
802
+ "description": "Approval request created"
803
+ },
804
+ "400": {
805
+ "description": "Validation error"
806
+ }
807
+ }
808
+ },
809
+ "get": {
810
+ "summary": "List approval requests with optional filters",
811
+ "tags": [
812
+ "ApprovalRequests"
813
+ ],
814
+ "security": [
815
+ {
816
+ "bearerAuth": []
817
+ }
818
+ ],
819
+ "parameters": [
820
+ {
821
+ "schema": {
822
+ "type": "string"
823
+ },
824
+ "required": false,
825
+ "name": "status",
826
+ "in": "query"
827
+ },
828
+ {
829
+ "schema": {
830
+ "type": "string"
831
+ },
832
+ "required": false,
833
+ "name": "workflowRunId",
834
+ "in": "query"
835
+ },
836
+ {
837
+ "schema": {
838
+ "type": [
839
+ "number",
840
+ "null"
841
+ ]
842
+ },
843
+ "required": false,
844
+ "name": "limit",
845
+ "in": "query"
846
+ }
847
+ ],
848
+ "responses": {
849
+ "200": {
850
+ "description": "List of approval requests"
851
+ }
852
+ }
853
+ }
854
+ },
855
+ "/api/approval-requests/{id}": {
856
+ "get": {
857
+ "summary": "Get approval request details",
858
+ "tags": [
859
+ "ApprovalRequests"
860
+ ],
861
+ "security": [
862
+ {
863
+ "bearerAuth": []
864
+ }
865
+ ],
866
+ "parameters": [
867
+ {
868
+ "schema": {
869
+ "type": "string",
870
+ "format": "uuid"
871
+ },
872
+ "required": true,
873
+ "name": "id",
874
+ "in": "path"
875
+ }
876
+ ],
877
+ "responses": {
878
+ "200": {
879
+ "description": "Approval request details"
880
+ },
881
+ "404": {
882
+ "description": "Not found"
883
+ }
884
+ }
885
+ }
886
+ },
887
+ "/api/approval-requests/{id}/respond": {
888
+ "post": {
889
+ "summary": "Submit a response to an approval request",
890
+ "tags": [
891
+ "ApprovalRequests"
892
+ ],
893
+ "security": [
894
+ {
895
+ "bearerAuth": []
896
+ }
897
+ ],
898
+ "parameters": [
899
+ {
900
+ "schema": {
901
+ "type": "string",
902
+ "format": "uuid"
903
+ },
904
+ "required": true,
905
+ "name": "id",
906
+ "in": "path"
907
+ }
908
+ ],
909
+ "requestBody": {
910
+ "content": {
911
+ "application/json": {
912
+ "schema": {
913
+ "type": "object",
914
+ "properties": {
915
+ "responses": {
916
+ "type": "object",
917
+ "additionalProperties": {}
918
+ },
919
+ "respondedBy": {
920
+ "type": "string"
921
+ }
922
+ },
923
+ "required": [
924
+ "responses"
925
+ ]
926
+ }
927
+ }
928
+ }
929
+ },
930
+ "responses": {
931
+ "200": {
932
+ "description": "Response recorded"
933
+ },
934
+ "400": {
935
+ "description": "Validation error"
936
+ },
937
+ "404": {
938
+ "description": "Not found"
939
+ },
940
+ "409": {
941
+ "description": "Already resolved"
942
+ }
943
+ }
944
+ }
945
+ },
609
946
  "/api/config/resolved": {
610
947
  "get": {
611
948
  "summary": "Get resolved config (merged global + agent + repo scopes)",
@@ -798,7 +1135,10 @@
798
1135
  ]
799
1136
  },
800
1137
  "scopeId": {
801
- "type": "string"
1138
+ "type": [
1139
+ "string",
1140
+ "null"
1141
+ ]
802
1142
  },
803
1143
  "key": {
804
1144
  "type": "string",
@@ -809,10 +1149,16 @@
809
1149
  "type": "boolean"
810
1150
  },
811
1151
  "envPath": {
812
- "type": "string"
1152
+ "type": [
1153
+ "string",
1154
+ "null"
1155
+ ]
813
1156
  },
814
1157
  "description": {
815
- "type": "string"
1158
+ "type": [
1159
+ "string",
1160
+ "null"
1161
+ ]
816
1162
  }
817
1163
  },
818
1164
  "required": [
@@ -3197,6 +3543,423 @@
3197
3543
  }
3198
3544
  }
3199
3545
  },
3546
+ "/api/skills": {
3547
+ "get": {
3548
+ "summary": "List skills with optional filters",
3549
+ "tags": [
3550
+ "Skills"
3551
+ ],
3552
+ "security": [
3553
+ {
3554
+ "bearerAuth": []
3555
+ }
3556
+ ],
3557
+ "parameters": [
3558
+ {
3559
+ "schema": {
3560
+ "type": "string"
3561
+ },
3562
+ "required": false,
3563
+ "name": "type",
3564
+ "in": "query"
3565
+ },
3566
+ {
3567
+ "schema": {
3568
+ "type": "string"
3569
+ },
3570
+ "required": false,
3571
+ "name": "scope",
3572
+ "in": "query"
3573
+ },
3574
+ {
3575
+ "schema": {
3576
+ "type": "string"
3577
+ },
3578
+ "required": false,
3579
+ "name": "agentId",
3580
+ "in": "query"
3581
+ },
3582
+ {
3583
+ "schema": {
3584
+ "type": "string"
3585
+ },
3586
+ "required": false,
3587
+ "name": "enabled",
3588
+ "in": "query"
3589
+ },
3590
+ {
3591
+ "schema": {
3592
+ "type": "string"
3593
+ },
3594
+ "required": false,
3595
+ "name": "search",
3596
+ "in": "query"
3597
+ }
3598
+ ],
3599
+ "responses": {
3600
+ "200": {
3601
+ "description": "Skill list"
3602
+ }
3603
+ }
3604
+ },
3605
+ "post": {
3606
+ "summary": "Create a new skill",
3607
+ "tags": [
3608
+ "Skills"
3609
+ ],
3610
+ "security": [
3611
+ {
3612
+ "bearerAuth": []
3613
+ }
3614
+ ],
3615
+ "requestBody": {
3616
+ "content": {
3617
+ "application/json": {
3618
+ "schema": {
3619
+ "type": "object",
3620
+ "properties": {
3621
+ "content": {
3622
+ "type": "string",
3623
+ "minLength": 1
3624
+ },
3625
+ "type": {
3626
+ "type": "string"
3627
+ },
3628
+ "scope": {
3629
+ "type": "string"
3630
+ },
3631
+ "ownerAgentId": {
3632
+ "type": "string"
3633
+ }
3634
+ },
3635
+ "required": [
3636
+ "content"
3637
+ ]
3638
+ }
3639
+ }
3640
+ }
3641
+ },
3642
+ "responses": {
3643
+ "201": {
3644
+ "description": "Skill created"
3645
+ },
3646
+ "400": {
3647
+ "description": "Validation error"
3648
+ }
3649
+ }
3650
+ }
3651
+ },
3652
+ "/api/skills/{id}": {
3653
+ "get": {
3654
+ "summary": "Get skill by ID",
3655
+ "tags": [
3656
+ "Skills"
3657
+ ],
3658
+ "security": [
3659
+ {
3660
+ "bearerAuth": []
3661
+ }
3662
+ ],
3663
+ "parameters": [
3664
+ {
3665
+ "schema": {
3666
+ "type": "string"
3667
+ },
3668
+ "required": true,
3669
+ "name": "id",
3670
+ "in": "path"
3671
+ }
3672
+ ],
3673
+ "responses": {
3674
+ "200": {
3675
+ "description": "Skill details"
3676
+ },
3677
+ "404": {
3678
+ "description": "Skill not found"
3679
+ }
3680
+ }
3681
+ },
3682
+ "put": {
3683
+ "summary": "Update a skill",
3684
+ "tags": [
3685
+ "Skills"
3686
+ ],
3687
+ "security": [
3688
+ {
3689
+ "bearerAuth": []
3690
+ }
3691
+ ],
3692
+ "parameters": [
3693
+ {
3694
+ "schema": {
3695
+ "type": "string"
3696
+ },
3697
+ "required": true,
3698
+ "name": "id",
3699
+ "in": "path"
3700
+ }
3701
+ ],
3702
+ "requestBody": {
3703
+ "content": {
3704
+ "application/json": {
3705
+ "schema": {
3706
+ "type": "object",
3707
+ "additionalProperties": {}
3708
+ }
3709
+ }
3710
+ }
3711
+ },
3712
+ "responses": {
3713
+ "200": {
3714
+ "description": "Skill updated"
3715
+ },
3716
+ "404": {
3717
+ "description": "Skill not found"
3718
+ }
3719
+ }
3720
+ },
3721
+ "delete": {
3722
+ "summary": "Delete a skill",
3723
+ "tags": [
3724
+ "Skills"
3725
+ ],
3726
+ "security": [
3727
+ {
3728
+ "bearerAuth": []
3729
+ }
3730
+ ],
3731
+ "parameters": [
3732
+ {
3733
+ "schema": {
3734
+ "type": "string"
3735
+ },
3736
+ "required": true,
3737
+ "name": "id",
3738
+ "in": "path"
3739
+ }
3740
+ ],
3741
+ "responses": {
3742
+ "200": {
3743
+ "description": "Skill deleted"
3744
+ },
3745
+ "404": {
3746
+ "description": "Skill not found"
3747
+ }
3748
+ }
3749
+ }
3750
+ },
3751
+ "/api/skills/{id}/install": {
3752
+ "post": {
3753
+ "summary": "Install skill for an agent",
3754
+ "tags": [
3755
+ "Skills"
3756
+ ],
3757
+ "security": [
3758
+ {
3759
+ "bearerAuth": []
3760
+ }
3761
+ ],
3762
+ "parameters": [
3763
+ {
3764
+ "schema": {
3765
+ "type": "string"
3766
+ },
3767
+ "required": true,
3768
+ "name": "id",
3769
+ "in": "path"
3770
+ }
3771
+ ],
3772
+ "requestBody": {
3773
+ "content": {
3774
+ "application/json": {
3775
+ "schema": {
3776
+ "type": "object",
3777
+ "properties": {
3778
+ "agentId": {
3779
+ "type": "string"
3780
+ }
3781
+ },
3782
+ "required": [
3783
+ "agentId"
3784
+ ]
3785
+ }
3786
+ }
3787
+ }
3788
+ },
3789
+ "responses": {
3790
+ "200": {
3791
+ "description": "Skill installed"
3792
+ },
3793
+ "404": {
3794
+ "description": "Skill not found"
3795
+ }
3796
+ }
3797
+ }
3798
+ },
3799
+ "/api/skills/{id}/install/{agentId}": {
3800
+ "delete": {
3801
+ "summary": "Uninstall skill for an agent",
3802
+ "tags": [
3803
+ "Skills"
3804
+ ],
3805
+ "security": [
3806
+ {
3807
+ "bearerAuth": []
3808
+ }
3809
+ ],
3810
+ "parameters": [
3811
+ {
3812
+ "schema": {
3813
+ "type": "string"
3814
+ },
3815
+ "required": true,
3816
+ "name": "id",
3817
+ "in": "path"
3818
+ },
3819
+ {
3820
+ "schema": {
3821
+ "type": "string"
3822
+ },
3823
+ "required": true,
3824
+ "name": "agentId",
3825
+ "in": "path"
3826
+ }
3827
+ ],
3828
+ "responses": {
3829
+ "200": {
3830
+ "description": "Skill uninstalled"
3831
+ }
3832
+ }
3833
+ }
3834
+ },
3835
+ "/api/skills/install-remote": {
3836
+ "post": {
3837
+ "summary": "Install a remote skill from GitHub",
3838
+ "tags": [
3839
+ "Skills"
3840
+ ],
3841
+ "security": [
3842
+ {
3843
+ "bearerAuth": []
3844
+ }
3845
+ ],
3846
+ "requestBody": {
3847
+ "content": {
3848
+ "application/json": {
3849
+ "schema": {
3850
+ "type": "object",
3851
+ "properties": {
3852
+ "sourceRepo": {
3853
+ "type": "string"
3854
+ },
3855
+ "sourcePath": {
3856
+ "type": "string"
3857
+ },
3858
+ "scope": {
3859
+ "type": "string"
3860
+ },
3861
+ "isComplex": {
3862
+ "type": "boolean"
3863
+ }
3864
+ },
3865
+ "required": [
3866
+ "sourceRepo"
3867
+ ]
3868
+ }
3869
+ }
3870
+ }
3871
+ },
3872
+ "responses": {
3873
+ "201": {
3874
+ "description": "Remote skill installed"
3875
+ },
3876
+ "400": {
3877
+ "description": "Fetch failed"
3878
+ }
3879
+ }
3880
+ }
3881
+ },
3882
+ "/api/skills/sync-remote": {
3883
+ "post": {
3884
+ "summary": "Trigger remote skill sync",
3885
+ "tags": [
3886
+ "Skills"
3887
+ ],
3888
+ "security": [
3889
+ {
3890
+ "bearerAuth": []
3891
+ }
3892
+ ],
3893
+ "requestBody": {
3894
+ "content": {
3895
+ "application/json": {
3896
+ "schema": {
3897
+ "type": "object",
3898
+ "properties": {
3899
+ "skillId": {
3900
+ "type": "string"
3901
+ },
3902
+ "force": {
3903
+ "type": "boolean"
3904
+ }
3905
+ }
3906
+ }
3907
+ }
3908
+ }
3909
+ },
3910
+ "responses": {
3911
+ "200": {
3912
+ "description": "Sync results"
3913
+ }
3914
+ }
3915
+ }
3916
+ },
3917
+ "/api/skills/sync-filesystem": {
3918
+ "post": {
3919
+ "summary": "Sync installed skills to agent filesystem",
3920
+ "tags": [
3921
+ "Skills"
3922
+ ],
3923
+ "security": [
3924
+ {
3925
+ "bearerAuth": []
3926
+ }
3927
+ ],
3928
+ "responses": {
3929
+ "200": {
3930
+ "description": "Filesystem sync results"
3931
+ }
3932
+ }
3933
+ }
3934
+ },
3935
+ "/api/agents/{id}/skills": {
3936
+ "get": {
3937
+ "summary": "Get all skills installed for an agent",
3938
+ "tags": [
3939
+ "Skills"
3940
+ ],
3941
+ "security": [
3942
+ {
3943
+ "bearerAuth": []
3944
+ }
3945
+ ],
3946
+ "parameters": [
3947
+ {
3948
+ "schema": {
3949
+ "type": "string"
3950
+ },
3951
+ "required": true,
3952
+ "name": "id",
3953
+ "in": "path"
3954
+ }
3955
+ ],
3956
+ "responses": {
3957
+ "200": {
3958
+ "description": "Agent skills list"
3959
+ }
3960
+ }
3961
+ }
3962
+ },
3200
3963
  "/api/logs": {
3201
3964
  "get": {
3202
3965
  "summary": "List agent logs",