@agentrix/shared 2.0.5 → 2.0.7

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
@@ -218,8 +218,11 @@ const StartTaskRequestSchema = zod.z.object({
218
218
  // Base branch for the repository
219
219
  repositorySourceType: zod.z.enum(["temporary", "directory", "git-server"]).optional(),
220
220
  // Repository source type
221
- dataEncryptionKey: zod.z.string().optional()
221
+ dataEncryptionKey: zod.z.string().optional(),
222
222
  // base64 sealed-box: app public key encrypted by machine public key
223
+ // Multi-agent collaboration fields
224
+ parentTaskId: zod.z.string().optional()
225
+ // Parent task ID (for creating child tasks)
223
226
  }).refine((data) => data.machineId || data.cloudId, {
224
227
  message: "Must provide either machineId or cloudId"
225
228
  }).refine(
@@ -292,6 +295,11 @@ const TaskItemSchema = zod.z.object({
292
295
  }).nullable(),
293
296
  totalDuration: zod.z.number().nullable(),
294
297
  // Cumulative execution time (milliseconds)
298
+ // Multi-agent collaboration fields
299
+ rootTaskId: zod.z.string().nullable(),
300
+ // Root task ID. If rootTaskId = id, this is a root task
301
+ parentTaskId: zod.z.string().nullable(),
302
+ // Direct parent task ID. Root task has parentTaskId = null
295
303
  createdAt: zod.z.string(),
296
304
  // ISO 8601 string
297
305
  updatedAt: zod.z.string()
@@ -458,6 +466,43 @@ const UpdateTaskTitleResponseSchema = zod.z.object({
458
466
  success: zod.z.boolean(),
459
467
  task: TaskItemSchema
460
468
  });
469
+ const SendTaskMessageRequestSchema = zod.z.object({
470
+ message: zod.z.custom(
471
+ (data) => {
472
+ return typeof data === "object" && data !== null && "type" in data;
473
+ },
474
+ {
475
+ message: "Invalid SDKMessage format"
476
+ }
477
+ ),
478
+ target: zod.z.enum(["agent", "user"]),
479
+ // Target: 'agent' or 'user' (required)
480
+ fromTaskId: zod.z.string().optional()
481
+ // Source task ID (for inter-task messaging)
482
+ });
483
+ const SendTaskMessageResponseSchema = zod.z.object({
484
+ success: zod.z.boolean()
485
+ });
486
+ const ShowModalRequestSchema = zod.z.object({
487
+ modalName: zod.z.string(),
488
+ // Modal identifier, e.g., "configure-env-vars"
489
+ modalData: zod.z.record(zod.z.any())
490
+ // Modal-specific data
491
+ });
492
+ const ShowModalResponseSchema = zod.z.object({
493
+ success: zod.z.boolean()
494
+ });
495
+ const GetTaskSessionResponseSchema = zod.z.object({
496
+ sessionPath: zod.z.string(),
497
+ state: zod.z.string()
498
+ });
499
+ const FindTaskByAgentRequestSchema = zod.z.object({
500
+ parentTaskId: zod.z.string(),
501
+ agentId: zod.z.string()
502
+ });
503
+ const FindTaskByAgentResponseSchema = zod.z.object({
504
+ taskId: zod.z.string().nullable()
505
+ });
461
506
 
462
507
  const ChatMemberSchema = zod.z.object({
463
508
  id: IdSchema,
@@ -476,6 +521,7 @@ const ChatSchema = zod.z.object({
476
521
  owner: IdSchema,
477
522
  // Group: userId of owner; Direct: "memberCode1:memberCode2" (sorted)
478
523
  type: ChatTypeSchema,
524
+ title: zod.z.string().nullable().optional(),
479
525
  createdAt: zod.z.string(),
480
526
  // ISO 8601 string
481
527
  updatedAt: zod.z.string()
@@ -1196,8 +1242,15 @@ const baseTaskSchema = EventBaseSchema.extend({
1196
1242
  // Existing repository ID (used to skip auto-association)
1197
1243
  repositorySourceType: zod.z.enum(["temporary", "directory", "git-server"]).optional(),
1198
1244
  // Repository source type (determines workspace mode)
1199
- environmentVariables: zod.z.record(zod.z.string(), zod.z.string()).optional()
1245
+ environmentVariables: zod.z.record(zod.z.string(), zod.z.string()).optional(),
1200
1246
  // Environment variables for task execution
1247
+ // Multi-agent collaboration fields
1248
+ rootTaskId: zod.z.string().optional(),
1249
+ // Root task ID of the task tree
1250
+ parentTaskId: zod.z.string().optional(),
1251
+ // Parent task ID (for sub tasks)
1252
+ chatAgents: zod.z.record(zod.z.string(), zod.z.string()).optional()
1253
+ // All agents in chat: { displayName: agentId }
1201
1254
  });
1202
1255
  const createTaskSchema = baseTaskSchema.extend({
1203
1256
  message: zod.z.custom(
@@ -1259,8 +1312,13 @@ const TaskMessageSchema = EventBaseSchema.extend({
1259
1312
  message: "Invalid TaskMessagePayload format"
1260
1313
  }
1261
1314
  ).optional(),
1262
- encryptedMessage: zod.z.string().optional()
1315
+ encryptedMessage: zod.z.string().optional(),
1263
1316
  // base64 sealed-box payload (local mode)
1317
+ // Multi-agent collaboration fields
1318
+ agentId: zod.z.string().optional(),
1319
+ // Agent ID for message attribution
1320
+ rootTaskId: zod.z.string().optional()
1321
+ // Root task ID for event routing
1264
1322
  }).refine(
1265
1323
  (data) => {
1266
1324
  return !!data.message !== !!data.encryptedMessage;
@@ -1401,6 +1459,25 @@ const MergeRequestEventSchema = EventBaseSchema.extend({
1401
1459
  summary: zod.z.string(),
1402
1460
  description: zod.z.string().optional()
1403
1461
  });
1462
+ const TaskStoppedEventSchema = EventBaseSchema.extend({
1463
+ taskId: zod.z.string()
1464
+ });
1465
+ const SubTaskCompletedEventSchema = EventBaseSchema.extend({
1466
+ taskId: zod.z.string(),
1467
+ // Completed sub task ID
1468
+ parentTaskId: zod.z.string(),
1469
+ // Parent task ID
1470
+ rootTaskId: zod.z.string(),
1471
+ // Root task ID
1472
+ agentName: zod.z.string(),
1473
+ // Agent display name (e.g., "Test Agent")
1474
+ taskName: zod.z.string().optional(),
1475
+ // Task title/name
1476
+ sessionPath: zod.z.string().optional(),
1477
+ // Session file path for analysis
1478
+ cwd: zod.z.string().optional()
1479
+ // Working directory containing generated results
1480
+ });
1404
1481
  const MergePullRequestEventSchema = EventBaseSchema.extend({
1405
1482
  taskId: zod.z.string(),
1406
1483
  mergeMethod: zod.z.enum(["merge", "squash", "rebase"]).optional().default("squash")
@@ -1490,6 +1567,9 @@ const EventSchemaMap = {
1490
1567
  // Merge request events
1491
1568
  "merge-request": MergeRequestEventSchema,
1492
1569
  "merge-pr": MergePullRequestEventSchema,
1570
+ // Multi-agent collaboration events
1571
+ "task-stopped": TaskStoppedEventSchema,
1572
+ "sub-task-completed": SubTaskCompletedEventSchema,
1493
1573
  // Repository association events
1494
1574
  "associate-repo": AssociateRepoEventDataSchema,
1495
1575
  // System message events
@@ -2173,6 +2253,8 @@ exports.FileItemSchema = FileItemSchema;
2173
2253
  exports.FileStatsSchema = FileStatsSchema;
2174
2254
  exports.FileVisibilitySchema = FileVisibilitySchema;
2175
2255
  exports.FillEventsRequestSchema = FillEventsRequestSchema;
2256
+ exports.FindTaskByAgentRequestSchema = FindTaskByAgentRequestSchema;
2257
+ exports.FindTaskByAgentResponseSchema = FindTaskByAgentResponseSchema;
2176
2258
  exports.FrameworkNotSupportedError = FrameworkNotSupportedError;
2177
2259
  exports.GetAgentResponseSchema = GetAgentResponseSchema;
2178
2260
  exports.GetChatResponseSchema = GetChatResponseSchema;
@@ -2183,6 +2265,7 @@ exports.GetGitUrlResponseSchema = GetGitUrlResponseSchema;
2183
2265
  exports.GetInstallUrlResponseSchema = GetInstallUrlResponseSchema;
2184
2266
  exports.GetOAuthServerResponseSchema = GetOAuthServerResponseSchema;
2185
2267
  exports.GetRepositoryResponseSchema = GetRepositoryResponseSchema;
2268
+ exports.GetTaskSessionResponseSchema = GetTaskSessionResponseSchema;
2186
2269
  exports.GetUploadUrlsRequestSchema = GetUploadUrlsRequestSchema;
2187
2270
  exports.GetUploadUrlsResponseSchema = GetUploadUrlsResponseSchema;
2188
2271
  exports.GetUserAgentsResponseSchema = GetUserAgentsResponseSchema;
@@ -2256,10 +2339,14 @@ exports.RtcIceServerSchema = RtcIceServerSchema;
2256
2339
  exports.RtcIceServersRequestSchema = RtcIceServersRequestSchema;
2257
2340
  exports.RtcIceServersResponseSchema = RtcIceServersResponseSchema;
2258
2341
  exports.RtcSignalSchema = RtcSignalSchema;
2342
+ exports.SendTaskMessageRequestSchema = SendTaskMessageRequestSchema;
2343
+ exports.SendTaskMessageResponseSchema = SendTaskMessageResponseSchema;
2259
2344
  exports.SetEnvironmentVariablesRequestSchema = SetEnvironmentVariablesRequestSchema;
2260
2345
  exports.ShareAuthQuerySchema = ShareAuthQuerySchema;
2261
2346
  exports.ShareAuthResponseSchema = ShareAuthResponseSchema;
2262
2347
  exports.ShowModalEventDataSchema = ShowModalEventDataSchema;
2348
+ exports.ShowModalRequestSchema = ShowModalRequestSchema;
2349
+ exports.ShowModalResponseSchema = ShowModalResponseSchema;
2263
2350
  exports.ShutdownMachineSchema = ShutdownMachineSchema;
2264
2351
  exports.SignatureAuthRequestSchema = SignatureAuthRequestSchema;
2265
2352
  exports.SignatureAuthResponseSchema = SignatureAuthResponseSchema;
@@ -2270,6 +2357,7 @@ exports.StatsQuerySchema = StatsQuerySchema;
2270
2357
  exports.StopTaskRequestSchema = StopTaskRequestSchema;
2271
2358
  exports.StopTaskResponseSchema = StopTaskResponseSchema;
2272
2359
  exports.StopTaskSchema = StopTaskSchema;
2360
+ exports.SubTaskCompletedEventSchema = SubTaskCompletedEventSchema;
2273
2361
  exports.SyncCloudMachineResponseSchema = SyncCloudMachineResponseSchema;
2274
2362
  exports.SyncLocalMachineResponseSchema = SyncLocalMachineResponseSchema;
2275
2363
  exports.SyncMachineRequestSchema = SyncMachineRequestSchema;
@@ -2281,6 +2369,7 @@ exports.TaskItemSchema = TaskItemSchema;
2281
2369
  exports.TaskMessageSchema = TaskMessageSchema;
2282
2370
  exports.TaskSharePermissionsSchema = TaskSharePermissionsSchema;
2283
2371
  exports.TaskStateChangeEventSchema = TaskStateChangeEventSchema;
2372
+ exports.TaskStoppedEventSchema = TaskStoppedEventSchema;
2284
2373
  exports.TaskTransactionsResponseSchema = TaskTransactionsResponseSchema;
2285
2374
  exports.ToggleOAuthServerRequestSchema = ToggleOAuthServerRequestSchema;
2286
2375
  exports.ToggleOAuthServerResponseSchema = ToggleOAuthServerResponseSchema;