@agentrix/shared 2.13.0 → 2.14.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/dist/index.cjs CHANGED
@@ -839,6 +839,9 @@ const DraftAgentSchema = zod.z.object({
839
839
  permissions: AgentPermissionsSchema.nullable(),
840
840
  publishedAgentId: zod.z.string().nullable(),
841
841
  sourceTaskId: zod.z.string().nullable(),
842
+ gitRepoUrl: zod.z.string().nullable(),
843
+ repoDir: zod.z.string().nullable(),
844
+ installedFromHiveId: zod.z.string().nullable(),
842
845
  createdAt: zod.z.string(),
843
846
  updatedAt: zod.z.string()
844
847
  });
@@ -1577,7 +1580,7 @@ const SearchContactCandidatesResponseSchema = zod.z.object({
1577
1580
  });
1578
1581
 
1579
1582
  const UserInboxSubjectTypeSchema = zod.z.enum(["issue", "reference", "task"]);
1580
- const UserInboxStatusSchema = zod.z.enum(["needs_reply", "needs_review"]);
1583
+ const UserInboxStatusSchema = zod.z.enum(["needs_reply", "needs_review", "assigned"]);
1581
1584
  const UserInboxItemSchema = zod.z.object({
1582
1585
  id: IdSchema,
1583
1586
  userId: IdSchema,
@@ -1586,7 +1589,7 @@ const UserInboxItemSchema = zod.z.object({
1586
1589
  subjectId: zod.z.string().min(1),
1587
1590
  targetSubjectType: UserInboxSubjectTypeSchema.nullable().optional(),
1588
1591
  targetSubjectId: zod.z.string().min(1).nullable().optional(),
1589
- status: UserInboxStatusSchema,
1592
+ statusFlags: zod.z.number().int().nonnegative(),
1590
1593
  title: zod.z.string(),
1591
1594
  body: zod.z.string().nullable().optional(),
1592
1595
  isResolved: zod.z.boolean(),
@@ -1773,6 +1776,191 @@ const UpdateResourceRequestSchema = zod.z.object({
1773
1776
  enabled: zod.z.boolean().optional()
1774
1777
  });
1775
1778
 
1779
+ const HiveListingTypeSchema = zod.z.enum(["agent", "skill"]);
1780
+ const HiveAuthorTypeSchema = zod.z.enum(["user", "agent"]);
1781
+ const HiveListingStatusSchema = zod.z.enum(["draft", "published", "unlisted", "suspended"]);
1782
+ const HiveSortSchema = zod.z.enum(["trending", "newest", "rating", "installs"]);
1783
+ const HiveListingSchema = zod.z.object({
1784
+ id: IdSchema,
1785
+ type: HiveListingTypeSchema,
1786
+ name: zod.z.string(),
1787
+ displayName: zod.z.string(),
1788
+ description: zod.z.string().nullable(),
1789
+ readme: zod.z.string().nullable(),
1790
+ version: zod.z.string(),
1791
+ avatar: zod.z.string().nullable(),
1792
+ authorType: HiveAuthorTypeSchema,
1793
+ authorId: zod.z.string(),
1794
+ authorName: zod.z.string(),
1795
+ authorAvatar: zod.z.string().nullable(),
1796
+ gitRepoUrl: zod.z.string(),
1797
+ repoDir: zod.z.string(),
1798
+ sourceHiveListingId: zod.z.string().nullable(),
1799
+ draftAgentId: zod.z.string().nullable(),
1800
+ category: zod.z.string().nullable(),
1801
+ tags: zod.z.array(zod.z.string()),
1802
+ featured: zod.z.boolean(),
1803
+ installCount: zod.z.number(),
1804
+ rating: zod.z.number(),
1805
+ ratingCount: zod.z.number(),
1806
+ status: HiveListingStatusSchema,
1807
+ visibility: zod.z.string(),
1808
+ createdAt: zod.z.string(),
1809
+ updatedAt: zod.z.string()
1810
+ });
1811
+ const PublishToHiveRequestSchema = zod.z.object({
1812
+ type: HiveListingTypeSchema,
1813
+ draftAgentId: zod.z.string().optional(),
1814
+ sourceDir: zod.z.string().optional(),
1815
+ name: zod.z.string().min(1).regex(/^[a-z0-9-]+$/, "Name must be lowercase with hyphens").optional(),
1816
+ displayName: zod.z.string().min(1).optional(),
1817
+ description: zod.z.string().optional(),
1818
+ readme: zod.z.string().optional(),
1819
+ category: zod.z.string().optional(),
1820
+ tags: zod.z.array(zod.z.string()).optional(),
1821
+ authorType: HiveAuthorTypeSchema,
1822
+ authorId: zod.z.string(),
1823
+ machineId: zod.z.string().optional(),
1824
+ cloudId: zod.z.string().optional()
1825
+ }).refine(
1826
+ (data) => !!data.machineId !== !!data.cloudId,
1827
+ { message: "Exactly one of machineId or cloudId must be provided" }
1828
+ ).refine(
1829
+ (data) => data.type === "agent" ? !!data.draftAgentId : !!data.sourceDir,
1830
+ { message: "Agent publish requires draftAgentId; skill publish requires sourceDir" }
1831
+ ).refine(
1832
+ (data) => data.type === "agent" ? !!data.name && !!data.displayName : true,
1833
+ { message: "Agent publish requires name and displayName" }
1834
+ );
1835
+ const PublishToHiveResponseSchema = zod.z.object({
1836
+ taskId: zod.z.string(),
1837
+ status: zod.z.string()
1838
+ });
1839
+ const HiveListQuerySchema = zod.z.object({
1840
+ type: HiveListingTypeSchema.optional(),
1841
+ category: zod.z.string().optional(),
1842
+ tags: zod.z.string().optional(),
1843
+ q: zod.z.string().optional(),
1844
+ sort: HiveSortSchema.default("trending"),
1845
+ authorId: zod.z.string().optional(),
1846
+ page: zod.z.coerce.number().int().min(1).default(1),
1847
+ pageSize: zod.z.coerce.number().int().min(1).max(50).default(20)
1848
+ });
1849
+ const HiveListResponseSchema = zod.z.object({
1850
+ listings: zod.z.array(HiveListingSchema),
1851
+ total: zod.z.number(),
1852
+ page: zod.z.number(),
1853
+ pageSize: zod.z.number()
1854
+ });
1855
+ const UpdateHiveListingRequestSchema = zod.z.object({
1856
+ displayName: zod.z.string().min(1).optional(),
1857
+ description: zod.z.string().nullable().optional(),
1858
+ readme: zod.z.string().nullable().optional(),
1859
+ category: zod.z.string().nullable().optional(),
1860
+ tags: zod.z.array(zod.z.string()).optional(),
1861
+ avatar: zod.z.string().nullable().optional(),
1862
+ visibility: zod.z.enum(["public", "private"]).optional()
1863
+ });
1864
+ const UpdateHiveVersionRequestSchema = zod.z.object({
1865
+ version: zod.z.string().min(1).optional(),
1866
+ changelog: zod.z.string().optional(),
1867
+ sourceDir: zod.z.string().optional(),
1868
+ machineId: zod.z.string().optional(),
1869
+ cloudId: zod.z.string().optional()
1870
+ }).refine(
1871
+ (data) => !!data.machineId !== !!data.cloudId,
1872
+ { message: "Exactly one of machineId or cloudId must be provided" }
1873
+ ).refine(
1874
+ (data) => data.version || data.sourceDir || data.machineId || data.cloudId,
1875
+ { message: "No update data provided" }
1876
+ );
1877
+ const HiveInstallRequestSchema = zod.z.object({
1878
+ name: zod.z.string().min(1).regex(/^[a-z0-9-]+$/, "Name must be lowercase with hyphens").optional(),
1879
+ machineId: zod.z.string().optional(),
1880
+ cloudId: zod.z.string().optional()
1881
+ }).refine(
1882
+ (data) => !!data.machineId !== !!data.cloudId,
1883
+ { message: "Exactly one of machineId or cloudId must be provided" }
1884
+ );
1885
+ const HiveInstallSchema = zod.z.object({
1886
+ id: IdSchema,
1887
+ hiveListingId: zod.z.string(),
1888
+ userId: zod.z.string(),
1889
+ machineId: zod.z.string().nullable(),
1890
+ cloudId: zod.z.string().nullable(),
1891
+ agentDir: zod.z.string(),
1892
+ installedVersion: zod.z.string(),
1893
+ draftAgentId: zod.z.string().nullable(),
1894
+ createdAt: zod.z.string(),
1895
+ updatedAt: zod.z.string()
1896
+ });
1897
+ const HiveInstallResponseSchema = zod.z.object({
1898
+ taskId: zod.z.string(),
1899
+ status: zod.z.string(),
1900
+ draftAgentId: zod.z.string().nullable().optional()
1901
+ });
1902
+ const HiveReviewSchema = zod.z.object({
1903
+ id: IdSchema,
1904
+ hiveListingId: zod.z.string(),
1905
+ authorType: HiveAuthorTypeSchema,
1906
+ authorId: zod.z.string(),
1907
+ authorName: zod.z.string(),
1908
+ authorAvatar: zod.z.string().nullable(),
1909
+ rating: zod.z.number().int().min(1).max(5),
1910
+ comment: zod.z.string().nullable(),
1911
+ createdAt: zod.z.string(),
1912
+ updatedAt: zod.z.string()
1913
+ });
1914
+ const CreateHiveReviewRequestSchema = zod.z.object({
1915
+ rating: zod.z.number().int().min(1).max(5),
1916
+ comment: zod.z.string().nullable().optional()
1917
+ });
1918
+ const UpdateHiveReviewRequestSchema = zod.z.object({
1919
+ rating: zod.z.number().int().min(1).max(5).optional(),
1920
+ comment: zod.z.string().nullable().optional()
1921
+ });
1922
+ const HiveReviewListResponseSchema = zod.z.object({
1923
+ reviews: zod.z.array(HiveReviewSchema),
1924
+ total: zod.z.number(),
1925
+ page: zod.z.number(),
1926
+ pageSize: zod.z.number()
1927
+ });
1928
+ const HiveCommentSchema = zod.z.object({
1929
+ id: IdSchema,
1930
+ hiveListingId: zod.z.string(),
1931
+ parentId: zod.z.string().nullable(),
1932
+ authorType: HiveAuthorTypeSchema,
1933
+ authorId: zod.z.string(),
1934
+ authorName: zod.z.string(),
1935
+ authorAvatar: zod.z.string().nullable(),
1936
+ content: zod.z.string(),
1937
+ createdAt: zod.z.string(),
1938
+ updatedAt: zod.z.string()
1939
+ });
1940
+ const CreateHiveCommentRequestSchema = zod.z.object({
1941
+ content: zod.z.string().min(1),
1942
+ parentId: zod.z.string().optional()
1943
+ });
1944
+ const UpdateHiveCommentRequestSchema = zod.z.object({
1945
+ content: zod.z.string().min(1)
1946
+ });
1947
+ const HiveCommentListResponseSchema = zod.z.object({
1948
+ comments: zod.z.array(HiveCommentSchema),
1949
+ total: zod.z.number(),
1950
+ page: zod.z.number(),
1951
+ pageSize: zod.z.number()
1952
+ });
1953
+ const HiveInstalledItemSchema = zod.z.object({
1954
+ install: HiveInstallSchema,
1955
+ listing: HiveListingSchema
1956
+ });
1957
+ const HiveInstalledResponseSchema = zod.z.object({
1958
+ items: zod.z.array(HiveInstalledItemSchema)
1959
+ });
1960
+ const HiveMyListingsResponseSchema = zod.z.object({
1961
+ listings: zod.z.array(HiveListingSchema)
1962
+ });
1963
+
1776
1964
  const RpcCallEventSchema = zod.z.object({
1777
1965
  eventId: zod.z.string(),
1778
1966
  taskId: zod.z.string(),
@@ -2598,6 +2786,61 @@ const DeployAgentCompleteEventSchema = EventBaseSchema.extend({
2598
2786
  supportLocal: zod.z.boolean().optional()
2599
2787
  // Support local mode
2600
2788
  });
2789
+ const HivePublishEventSchema = EventBaseSchema.extend({
2790
+ taskId: zod.z.string(),
2791
+ userId: zod.z.string(),
2792
+ machineId: zod.z.string().optional(),
2793
+ cloudId: zod.z.string().optional(),
2794
+ type: zod.z.enum(["agent", "skill"]),
2795
+ sourceDir: zod.z.string(),
2796
+ name: zod.z.string(),
2797
+ displayName: zod.z.string(),
2798
+ description: zod.z.string().optional(),
2799
+ readme: zod.z.string().optional(),
2800
+ version: zod.z.string(),
2801
+ repoDir: zod.z.string(),
2802
+ gitUrl: zod.z.string(),
2803
+ environmentVariables: zod.z.record(zod.z.string(), zod.z.string()).optional()
2804
+ }).refine(
2805
+ (data) => !!data.machineId !== !!data.cloudId,
2806
+ { message: "Exactly one of machineId or cloudId must be provided" }
2807
+ );
2808
+ const HivePublishCompleteEventSchema = EventBaseSchema.extend({
2809
+ taskId: zod.z.string(),
2810
+ success: zod.z.boolean(),
2811
+ error: zod.z.string().optional(),
2812
+ gitCommitHash: zod.z.string().optional(),
2813
+ hasChanges: zod.z.boolean().optional(),
2814
+ tags: zod.z.array(zod.z.string()).optional(),
2815
+ name: zod.z.string().optional(),
2816
+ displayName: zod.z.string().optional(),
2817
+ description: zod.z.string().optional(),
2818
+ readme: zod.z.string().optional(),
2819
+ repoDir: zod.z.string().optional(),
2820
+ reviewReasons: zod.z.array(zod.z.string()).optional()
2821
+ });
2822
+ const HiveInstallEventSchema = EventBaseSchema.extend({
2823
+ taskId: zod.z.string(),
2824
+ userId: zod.z.string(),
2825
+ machineId: zod.z.string().optional(),
2826
+ cloudId: zod.z.string().optional(),
2827
+ hiveListingId: zod.z.string(),
2828
+ name: zod.z.string(),
2829
+ sourceType: zod.z.enum(["agent", "skill"]).optional(),
2830
+ sourceRepoDir: zod.z.string(),
2831
+ gitUrl: zod.z.string(),
2832
+ draftAgentDir: zod.z.string(),
2833
+ installDir: zod.z.string().optional()
2834
+ }).refine(
2835
+ (data) => !!data.machineId !== !!data.cloudId,
2836
+ { message: "Exactly one of machineId or cloudId must be provided" }
2837
+ );
2838
+ const HiveInstallCompleteEventSchema = EventBaseSchema.extend({
2839
+ taskId: zod.z.string(),
2840
+ success: zod.z.boolean(),
2841
+ agentDir: zod.z.string().optional(),
2842
+ error: zod.z.string().optional()
2843
+ });
2601
2844
  const AssociateRepoEventDataSchema = EventBaseSchema.extend({
2602
2845
  taskId: zod.z.string(),
2603
2846
  gitServerHost: zod.z.string(),
@@ -2640,6 +2883,7 @@ const SystemMessageSchema = EventBaseSchema.extend({
2640
2883
  "chat-member-removed",
2641
2884
  "repo-added",
2642
2885
  "repo-removed",
2886
+ "repo-inbox-updated",
2643
2887
  "pr-state-changed",
2644
2888
  "draft-agent-added",
2645
2889
  "agent-updated",
@@ -2696,6 +2940,14 @@ const DaemonGitlabResponseSchema = EventBaseSchema.extend({
2696
2940
  machineId: zod.z.string(),
2697
2941
  executionTimeMs: zod.z.number()
2698
2942
  });
2943
+ const RepositoryInboxProviderSchema = zod.z.enum(["gitlab", "github"]);
2944
+ const RepositoryInboxWebhookSchema = EventBaseSchema.extend({
2945
+ provider: RepositoryInboxProviderSchema,
2946
+ gitServerId: zod.z.string(),
2947
+ deliveryId: zod.z.string().optional(),
2948
+ eventType: zod.z.string().optional(),
2949
+ payload: zod.z.record(zod.z.string(), zod.z.unknown())
2950
+ });
2699
2951
  const CompanionHeartbeatRequestSchema = EventBaseSchema.extend({
2700
2952
  machineId: zod.z.string(),
2701
2953
  agentId: zod.z.string(),
@@ -2766,6 +3018,12 @@ const EventSchemaMap = {
2766
3018
  // Deploy agent events
2767
3019
  "deploy-agent": DeployAgentEventSchema,
2768
3020
  "deploy-agent-complete": DeployAgentCompleteEventSchema,
3021
+ // Hive publish events
3022
+ "hive-publish": HivePublishEventSchema,
3023
+ "hive-publish-complete": HivePublishCompleteEventSchema,
3024
+ // Hive install events
3025
+ "hive-install": HiveInstallEventSchema,
3026
+ "hive-install-complete": HiveInstallCompleteEventSchema,
2769
3027
  // Multi-agent collaboration events
2770
3028
  "task-stopped": TaskStoppedEventSchema,
2771
3029
  "sub-task-result-updated": SubTaskResultUpdatedEventSchema,
@@ -2789,9 +3047,10 @@ const EventSchemaMap = {
2789
3047
  "workspace-file-response": WorkspaceFileResponseSchema,
2790
3048
  // RPC events
2791
3049
  "rpc-call": RpcCallEventSchema,
2792
- // Daemon GitLab proxy events
3050
+ // Daemon Git provider events
2793
3051
  "daemon-gitlab-request": DaemonGitlabRequestSchema,
2794
3052
  "daemon-gitlab-response": DaemonGitlabResponseSchema,
3053
+ "repository-inbox-webhook": RepositoryInboxWebhookSchema,
2795
3054
  // Companion heartbeat events
2796
3055
  "request-companion-heartbeat": CompanionHeartbeatRequestSchema,
2797
3056
  "companion-heartbeat-response": CompanionHeartbeatResponseSchema,
@@ -3382,6 +3641,8 @@ exports.CreateContactResponseSchema = CreateContactResponseSchema;
3382
3641
  exports.CreateDirectRechargeCheckoutRequestSchema = CreateDirectRechargeCheckoutRequestSchema;
3383
3642
  exports.CreateDirectRechargeCheckoutResponseSchema = CreateDirectRechargeCheckoutResponseSchema;
3384
3643
  exports.CreateDraftAgentRequestSchema = CreateDraftAgentRequestSchema;
3644
+ exports.CreateHiveCommentRequestSchema = CreateHiveCommentRequestSchema;
3645
+ exports.CreateHiveReviewRequestSchema = CreateHiveReviewRequestSchema;
3385
3646
  exports.CreateMergeRequestResponseSchema = CreateMergeRequestResponseSchema;
3386
3647
  exports.CreateMergeRequestSchema = CreateMergeRequestSchema;
3387
3648
  exports.CreateOAuthServerRequestSchema = CreateOAuthServerRequestSchema;
@@ -3451,6 +3712,27 @@ exports.GetUserAgentsResponseSchema = GetUserAgentsResponseSchema;
3451
3712
  exports.GitHubIssueListItemSchema = GitHubIssueListItemSchema;
3452
3713
  exports.GitHubIssueSchema = GitHubIssueSchema;
3453
3714
  exports.GitServerSchema = GitServerSchema;
3715
+ exports.HiveAuthorTypeSchema = HiveAuthorTypeSchema;
3716
+ exports.HiveCommentListResponseSchema = HiveCommentListResponseSchema;
3717
+ exports.HiveCommentSchema = HiveCommentSchema;
3718
+ exports.HiveInstallCompleteEventSchema = HiveInstallCompleteEventSchema;
3719
+ exports.HiveInstallEventSchema = HiveInstallEventSchema;
3720
+ exports.HiveInstallRequestSchema = HiveInstallRequestSchema;
3721
+ exports.HiveInstallResponseSchema = HiveInstallResponseSchema;
3722
+ exports.HiveInstallSchema = HiveInstallSchema;
3723
+ exports.HiveInstalledItemSchema = HiveInstalledItemSchema;
3724
+ exports.HiveInstalledResponseSchema = HiveInstalledResponseSchema;
3725
+ exports.HiveListQuerySchema = HiveListQuerySchema;
3726
+ exports.HiveListResponseSchema = HiveListResponseSchema;
3727
+ exports.HiveListingSchema = HiveListingSchema;
3728
+ exports.HiveListingStatusSchema = HiveListingStatusSchema;
3729
+ exports.HiveListingTypeSchema = HiveListingTypeSchema;
3730
+ exports.HiveMyListingsResponseSchema = HiveMyListingsResponseSchema;
3731
+ exports.HivePublishCompleteEventSchema = HivePublishCompleteEventSchema;
3732
+ exports.HivePublishEventSchema = HivePublishEventSchema;
3733
+ exports.HiveReviewListResponseSchema = HiveReviewListResponseSchema;
3734
+ exports.HiveReviewSchema = HiveReviewSchema;
3735
+ exports.HiveSortSchema = HiveSortSchema;
3454
3736
  exports.IGNORED_DIRECTORIES = IGNORED_DIRECTORIES;
3455
3737
  exports.IdSchema = IdSchema;
3456
3738
  exports.JsonSchemaDocumentSchema = JsonSchemaDocumentSchema;
@@ -3531,6 +3813,8 @@ exports.ProjectEntrySchema = ProjectEntrySchema;
3531
3813
  exports.PublicResourceItemSchema = PublicResourceItemSchema;
3532
3814
  exports.PublishDraftAgentRequestSchema = PublishDraftAgentRequestSchema;
3533
3815
  exports.PublishDraftAgentResponseSchema = PublishDraftAgentResponseSchema;
3816
+ exports.PublishToHiveRequestSchema = PublishToHiveRequestSchema;
3817
+ exports.PublishToHiveResponseSchema = PublishToHiveResponseSchema;
3534
3818
  exports.QueryEventsRequestSchema = QueryEventsRequestSchema;
3535
3819
  exports.RELEVANT_DEPENDENCIES = RELEVANT_DEPENDENCIES;
3536
3820
  exports.RTC_CHUNK_HEADER_SIZE = RTC_CHUNK_HEADER_SIZE;
@@ -3541,6 +3825,8 @@ exports.RegisterCompanionResponseSchema = RegisterCompanionResponseSchema;
3541
3825
  exports.RemoveChatMemberRequestSchema = RemoveChatMemberRequestSchema;
3542
3826
  exports.RemovePrivateCloudMemberResponseSchema = RemovePrivateCloudMemberResponseSchema;
3543
3827
  exports.RepositoryActorIdentitySchema = RepositoryActorIdentitySchema;
3828
+ exports.RepositoryInboxProviderSchema = RepositoryInboxProviderSchema;
3829
+ exports.RepositoryInboxWebhookSchema = RepositoryInboxWebhookSchema;
3544
3830
  exports.RepositoryReferenceCommentSchema = RepositoryReferenceCommentSchema;
3545
3831
  exports.RepositoryReferenceCommentsResponseSchema = RepositoryReferenceCommentsResponseSchema;
3546
3832
  exports.RepositoryReferenceDiffSchema = RepositoryReferenceDiffSchema;
@@ -3622,6 +3908,10 @@ exports.UpdateAgentResponseSchema = UpdateAgentResponseSchema;
3622
3908
  exports.UpdateApiKeyRequestSchema = UpdateApiKeyRequestSchema;
3623
3909
  exports.UpdateDraftAgentRequestSchema = UpdateDraftAgentRequestSchema;
3624
3910
  exports.UpdateDraftAgentResponseSchema = UpdateDraftAgentResponseSchema;
3911
+ exports.UpdateHiveCommentRequestSchema = UpdateHiveCommentRequestSchema;
3912
+ exports.UpdateHiveListingRequestSchema = UpdateHiveListingRequestSchema;
3913
+ exports.UpdateHiveReviewRequestSchema = UpdateHiveReviewRequestSchema;
3914
+ exports.UpdateHiveVersionRequestSchema = UpdateHiveVersionRequestSchema;
3625
3915
  exports.UpdateOAuthServerRequestSchema = UpdateOAuthServerRequestSchema;
3626
3916
  exports.UpdateOAuthServerResponseSchema = UpdateOAuthServerResponseSchema;
3627
3917
  exports.UpdateResourceRequestSchema = UpdateResourceRequestSchema;