@agentrix/shared 1.0.8 → 1.0.10

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
@@ -180,6 +180,22 @@ const CloudJoinApprovalRequestSchema = zod.z.object({
180
180
  userId: zod.z.string(),
181
181
  cloudId: zod.z.string()
182
182
  });
183
+ const TaskSharePermissionsSchema = zod.z.object({
184
+ canSendMessage: zod.z.boolean(),
185
+ canCreatePr: zod.z.boolean(),
186
+ canApprovePr: zod.z.boolean(),
187
+ canViewPr: zod.z.boolean(),
188
+ canMergePr: zod.z.boolean()
189
+ });
190
+ const ShareAuthQuerySchema = zod.z.object({
191
+ code: zod.z.string()
192
+ });
193
+ const ShareAuthResponseSchema = zod.z.object({
194
+ success: zod.z.literal(true),
195
+ shareToken: zod.z.string(),
196
+ taskId: zod.z.string(),
197
+ permissions: TaskSharePermissionsSchema
198
+ });
183
199
 
184
200
  const StartTaskRequestSchema = zod.z.object({
185
201
  chatId: zod.z.string(),
@@ -242,6 +258,8 @@ const TaskItemSchema = zod.z.object({
242
258
  chatId: IdSchema,
243
259
  userId: zod.z.string(),
244
260
  state: zod.z.string(),
261
+ workerStatus: zod.z.enum(["initializing", "ready", "running"]).nullable(),
262
+ // Worker execution status (null = disconnected)
245
263
  agentId: zod.z.string(),
246
264
  machineId: zod.z.string().nullable(),
247
265
  cloudId: zod.z.string().nullable(),
@@ -397,6 +415,24 @@ const CreateMergeRequestResponseSchema = zod.z.object({
397
415
  reason: zod.z.string().optional()
398
416
  // failed-reason
399
417
  });
418
+ const ApprovePrRequestSchema = zod.z.object({});
419
+ const ApprovePrResponseSchema = zod.z.object({
420
+ success: zod.z.boolean(),
421
+ taskId: zod.z.string(),
422
+ pullRequestNumber: zod.z.number()
423
+ });
424
+ const CreateTaskShareSchema = zod.z.object({
425
+ permissions: TaskSharePermissionsSchema.optional().default({
426
+ canSendMessage: false,
427
+ canCreatePr: false,
428
+ canApprovePr: false,
429
+ canViewPr: true,
430
+ canMergePr: false
431
+ })
432
+ });
433
+ const CreateTaskShareResponseSchema = zod.z.object({
434
+ shareCode: zod.z.string()
435
+ });
400
436
  const ArchiveTaskRequestSchema = zod.z.object({});
401
437
  const ArchiveTaskResponseSchema = zod.z.object({
402
438
  success: zod.z.boolean(),
@@ -464,6 +500,31 @@ const ListChatTasksResponseSchema = zod.z.object({
464
500
  });
465
501
 
466
502
  const AgentTypeSchema = zod.z.enum(["claude", "codex"]);
503
+ const DisplayConfigKeysSchema = zod.z.object({
504
+ // PR Actions
505
+ createPR: zod.z.string().optional(),
506
+ viewPR: zod.z.string().optional(),
507
+ mergePR: zod.z.string().optional(),
508
+ approvePR: zod.z.string().optional(),
509
+ merged: zod.z.string().optional(),
510
+ closed: zod.z.string().optional(),
511
+ recreatePR: zod.z.string().optional(),
512
+ // Share Permissions
513
+ permissionCanSendMessage: zod.z.string().optional(),
514
+ permissionCanSendMessageDesc: zod.z.string().optional(),
515
+ permissionCanCreatePr: zod.z.string().optional(),
516
+ permissionCanCreatePrDesc: zod.z.string().optional(),
517
+ permissionCanApprovePr: zod.z.string().optional(),
518
+ permissionCanApprovePrDesc: zod.z.string().optional(),
519
+ permissionCanViewPr: zod.z.string().optional(),
520
+ permissionCanViewPrDesc: zod.z.string().optional(),
521
+ permissionCanMergePr: zod.z.string().optional(),
522
+ permissionCanMergePrDesc: zod.z.string().optional()
523
+ });
524
+ const DisplayConfigSchema = zod.z.record(zod.z.string(), DisplayConfigKeysSchema);
525
+ const AgentCustomConfigSchema = zod.z.object({
526
+ displayConfig: DisplayConfigSchema.optional()
527
+ });
467
528
  const AgentSchema = zod.z.object({
468
529
  id: IdSchema,
469
530
  name: zod.z.string(),
@@ -478,7 +539,8 @@ const AgentSchema = zod.z.object({
478
539
  developerEmail: zod.z.string().nullable(),
479
540
  gitRepoId: zod.z.string().nullable(),
480
541
  supportLocal: zod.z.boolean(),
481
- enable: zod.z.boolean()
542
+ enable: zod.z.boolean(),
543
+ config: AgentCustomConfigSchema.nullable()
482
544
  });
483
545
  const ListAgentsResponseSchema = zod.z.object({
484
546
  agents: zod.z.array(AgentSchema)
@@ -493,7 +555,8 @@ const CreateAgentRequestSchema = zod.z.object({
493
555
  guildMsg: zod.z.string().default("what can I do for you today?"),
494
556
  placeholderMsg: zod.z.string().default("Ask me anything..."),
495
557
  gitRepoId: zod.z.string().optional(),
496
- supportLocal: zod.z.boolean().default(false)
558
+ supportLocal: zod.z.boolean().default(false),
559
+ config: AgentCustomConfigSchema.optional()
497
560
  });
498
561
  const CreateAgentResponseSchema = AgentSchema;
499
562
  const UpdateAgentRequestSchema = zod.z.object({
@@ -505,7 +568,8 @@ const UpdateAgentRequestSchema = zod.z.object({
505
568
  guildMsg: zod.z.string().optional(),
506
569
  placeholderMsg: zod.z.string().optional(),
507
570
  gitRepoId: zod.z.string().nullable().optional(),
508
- supportLocal: zod.z.boolean().optional()
571
+ supportLocal: zod.z.boolean().optional(),
572
+ config: AgentCustomConfigSchema.nullable().optional()
509
573
  });
510
574
  const UpdateAgentResponseSchema = AgentSchema;
511
575
  const DeleteAgentResponseSchema = zod.z.object({
@@ -935,7 +999,8 @@ const ShutdownMachineSchema = EventBaseSchema.extend({
935
999
  const WorkerInitializingSchema = EventBaseSchema.extend({
936
1000
  taskId: zod.z.string(),
937
1001
  machineId: zod.z.string(),
938
- timestamp: zod.z.string()
1002
+ timestamp: zod.z.string(),
1003
+ cwd: zod.z.string().optional()
939
1004
  });
940
1005
  const WorkerReadySchema = EventBaseSchema.extend({
941
1006
  taskId: zod.z.string(),
@@ -982,8 +1047,12 @@ const baseTaskSchema = EventBaseSchema.extend({
982
1047
  // Custom API base URL
983
1048
  api_key: zod.z.string().optional(),
984
1049
  // Custom API key
985
- maxTurns: zod.z.number().optional()
1050
+ maxTurns: zod.z.number().optional(),
986
1051
  // Maximum number of turns for the agent (default: 50)
1052
+ repositoryId: zod.z.string().optional(),
1053
+ // Existing repository ID (used to skip auto-association)
1054
+ repositorySourceType: zod.z.enum(["temporary", "directory", "git-server"]).optional()
1055
+ // Repository source type (determines workspace mode)
987
1056
  });
988
1057
  const createTaskSchema = baseTaskSchema.extend({
989
1058
  message: zod.z.custom(
@@ -1132,11 +1201,34 @@ const UpdateTaskAgentSessionIdEventSchema = EventBaseSchema.extend({
1132
1201
  agentSessionId: zod.z.string(),
1133
1202
  cwd: zod.z.string().optional()
1134
1203
  });
1204
+ const TaskInfoUpdateEventDataSchema = EventBaseSchema.extend({
1205
+ taskId: zod.z.string(),
1206
+ chatId: zod.z.string(),
1207
+ updates: zod.z.record(zod.z.any()),
1208
+ // Flexible updates object for any task fields
1209
+ updatedAt: zod.z.string()
1210
+ // ISO 8601 timestamp
1211
+ });
1135
1212
  const MergeRequestEventSchema = EventBaseSchema.extend({
1136
1213
  taskId: zod.z.string(),
1137
1214
  summary: zod.z.string(),
1138
1215
  description: zod.z.string().optional()
1139
1216
  });
1217
+ const MergePullRequestEventSchema = EventBaseSchema.extend({
1218
+ taskId: zod.z.string(),
1219
+ mergeMethod: zod.z.enum(["merge", "squash", "rebase"]).optional().default("squash")
1220
+ });
1221
+ const AssociateRepoEventDataSchema = EventBaseSchema.extend({
1222
+ taskId: zod.z.string(),
1223
+ gitServerHost: zod.z.string(),
1224
+ // e.g., "github.com"
1225
+ owner: zod.z.string(),
1226
+ // e.g., "xmz-ai"
1227
+ repo: zod.z.string(),
1228
+ // e.g., "agentrix"
1229
+ remoteUrl: zod.z.string()
1230
+ // Original URL for logging
1231
+ });
1140
1232
  const IdOnlySchema = zod.z.object({
1141
1233
  id: zod.z.string()
1142
1234
  });
@@ -1198,10 +1290,14 @@ const EventSchemaMap = {
1198
1290
  "change-task-title": ChangeTaskTitleEventSchema,
1199
1291
  "task-state-change": TaskStateChangeEventSchema,
1200
1292
  "update-task-agent-session-id": UpdateTaskAgentSessionIdEventSchema,
1293
+ "task-info-update": TaskInfoUpdateEventDataSchema,
1201
1294
  // Artifacts events
1202
1295
  "task-artifacts-updated": TaskArtifactsUpdatedEventSchema,
1203
1296
  // Merge request events
1204
1297
  "merge-request": MergeRequestEventSchema,
1298
+ "merge-pr": MergePullRequestEventSchema,
1299
+ // Repository association events
1300
+ "associate-repo": AssociateRepoEventDataSchema,
1205
1301
  // System message events
1206
1302
  "system-message": SystemMessageSchema,
1207
1303
  // Billing events
@@ -1220,7 +1316,9 @@ const workerTaskEvents = [
1220
1316
  "change-task-title",
1221
1317
  "update-task-agent-session-id",
1222
1318
  "task-artifacts-updated",
1223
- "merge-request"
1319
+ "merge-request",
1320
+ "merge-pr",
1321
+ "associate-repo"
1224
1322
  ];
1225
1323
 
1226
1324
  function userAuth(token) {
@@ -1750,6 +1848,7 @@ function decryptFileContent(encryptedContent, dataKey) {
1750
1848
  exports.AddChatMemberRequestSchema = AddChatMemberRequestSchema;
1751
1849
  exports.AddChatMemberResponseSchema = AddChatMemberResponseSchema;
1752
1850
  exports.AgentConfigValidationError = AgentConfigValidationError;
1851
+ exports.AgentCustomConfigSchema = AgentCustomConfigSchema;
1753
1852
  exports.AgentError = AgentError;
1754
1853
  exports.AgentLoadError = AgentLoadError;
1755
1854
  exports.AgentMetadataSchema = AgentMetadataSchema;
@@ -1760,12 +1859,15 @@ exports.ApiErrorSchema = ApiErrorSchema;
1760
1859
  exports.ApiServerAliveEventSchema = ApiServerAliveEventSchema;
1761
1860
  exports.AppAliveEventSchema = AppAliveEventSchema;
1762
1861
  exports.ApprovalStatusResponseSchema = ApprovalStatusResponseSchema;
1862
+ exports.ApprovePrRequestSchema = ApprovePrRequestSchema;
1863
+ exports.ApprovePrResponseSchema = ApprovePrResponseSchema;
1763
1864
  exports.ArchiveTaskRequestSchema = ArchiveTaskRequestSchema;
1764
1865
  exports.ArchiveTaskResponseSchema = ArchiveTaskResponseSchema;
1765
1866
  exports.AskUserMessageSchema = AskUserMessageSchema;
1766
1867
  exports.AskUserOptionSchema = AskUserOptionSchema;
1767
1868
  exports.AskUserQuestionSchema = AskUserQuestionSchema;
1768
1869
  exports.AskUserResponseMessageSchema = AskUserResponseMessageSchema;
1870
+ exports.AssociateRepoEventDataSchema = AssociateRepoEventDataSchema;
1769
1871
  exports.BillingStatsResponseSchema = BillingStatsResponseSchema;
1770
1872
  exports.BranchSchema = BranchSchema;
1771
1873
  exports.CancelTaskRequestSchema = CancelTaskRequestSchema;
@@ -1797,11 +1899,15 @@ exports.CreateMergeRequestResponseSchema = CreateMergeRequestResponseSchema;
1797
1899
  exports.CreateMergeRequestSchema = CreateMergeRequestSchema;
1798
1900
  exports.CreateOAuthServerRequestSchema = CreateOAuthServerRequestSchema;
1799
1901
  exports.CreateOAuthServerResponseSchema = CreateOAuthServerResponseSchema;
1902
+ exports.CreateTaskShareResponseSchema = CreateTaskShareResponseSchema;
1903
+ exports.CreateTaskShareSchema = CreateTaskShareSchema;
1800
1904
  exports.CreditExhaustedEventSchema = CreditExhaustedEventSchema;
1801
1905
  exports.CreditsPackageSchema = CreditsPackageSchema;
1802
1906
  exports.DateSchema = DateSchema;
1803
1907
  exports.DeleteAgentResponseSchema = DeleteAgentResponseSchema;
1804
1908
  exports.DeleteOAuthServerResponseSchema = DeleteOAuthServerResponseSchema;
1909
+ exports.DisplayConfigKeysSchema = DisplayConfigKeysSchema;
1910
+ exports.DisplayConfigSchema = DisplayConfigSchema;
1805
1911
  exports.EventAckSchema = EventAckSchema;
1806
1912
  exports.EventSchemaMap = EventSchemaMap;
1807
1913
  exports.FRAMEWORK_TYPES = FRAMEWORK_TYPES;
@@ -1852,6 +1958,7 @@ exports.MachineApprovalStatusQuerySchema = MachineApprovalStatusQuerySchema;
1852
1958
  exports.MachineAuthAuthorizedResponseSchema = MachineAuthAuthorizedResponseSchema;
1853
1959
  exports.MachineAuthRequestSchema = MachineAuthRequestSchema;
1854
1960
  exports.MachineAuthResultQuerySchema = MachineAuthResultQuerySchema;
1961
+ exports.MergePullRequestEventSchema = MergePullRequestEventSchema;
1855
1962
  exports.MergeRequestEventSchema = MergeRequestEventSchema;
1856
1963
  exports.MissingAgentFileError = MissingAgentFileError;
1857
1964
  exports.OAuthAccountInfoSchema = OAuthAccountInfoSchema;
@@ -1877,6 +1984,8 @@ exports.ResetSecretRequestSchema = ResetSecretRequestSchema;
1877
1984
  exports.ResetSecretResponseSchema = ResetSecretResponseSchema;
1878
1985
  exports.ResumeTaskRequestSchema = ResumeTaskRequestSchema;
1879
1986
  exports.ResumeTaskResponseSchema = ResumeTaskResponseSchema;
1987
+ exports.ShareAuthQuerySchema = ShareAuthQuerySchema;
1988
+ exports.ShareAuthResponseSchema = ShareAuthResponseSchema;
1880
1989
  exports.ShutdownMachineSchema = ShutdownMachineSchema;
1881
1990
  exports.SignatureAuthRequestSchema = SignatureAuthRequestSchema;
1882
1991
  exports.SignatureAuthResponseSchema = SignatureAuthResponseSchema;
@@ -1892,8 +2001,10 @@ exports.SyncLocalMachineResponseSchema = SyncLocalMachineResponseSchema;
1892
2001
  exports.SyncMachineRequestSchema = SyncMachineRequestSchema;
1893
2002
  exports.SystemMessageSchema = SystemMessageSchema;
1894
2003
  exports.TaskArtifactsUpdatedEventSchema = TaskArtifactsUpdatedEventSchema;
2004
+ exports.TaskInfoUpdateEventDataSchema = TaskInfoUpdateEventDataSchema;
1895
2005
  exports.TaskItemSchema = TaskItemSchema;
1896
2006
  exports.TaskMessageSchema = TaskMessageSchema;
2007
+ exports.TaskSharePermissionsSchema = TaskSharePermissionsSchema;
1897
2008
  exports.TaskStateChangeEventSchema = TaskStateChangeEventSchema;
1898
2009
  exports.TaskTransactionsResponseSchema = TaskTransactionsResponseSchema;
1899
2010
  exports.ToggleOAuthServerRequestSchema = ToggleOAuthServerRequestSchema;