@perstack/core 0.0.53 → 0.0.55

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.
@@ -1212,13 +1212,13 @@ declare const expertBaseSchema: z.ZodObject<{
1212
1212
  instruction: z.ZodString;
1213
1213
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1214
1214
  type: z.ZodLiteral<"mcpStdioSkill">;
1215
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1216
+ command: z.ZodString;
1215
1217
  description: z.ZodOptional<z.ZodString>;
1216
1218
  rule: z.ZodOptional<z.ZodString>;
1217
1219
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1218
1220
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1219
- command: z.ZodString;
1220
1221
  packageName: z.ZodOptional<z.ZodString>;
1221
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1222
1222
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1223
1223
  }, z.core.$strip>, z.ZodObject<{
1224
1224
  type: z.ZodLiteral<"mcpSseSkill">;
@@ -1229,8 +1229,6 @@ declare const expertBaseSchema: z.ZodObject<{
1229
1229
  endpoint: z.ZodString;
1230
1230
  }, z.core.$strip>, z.ZodObject<{
1231
1231
  type: z.ZodLiteral<"interactiveSkill">;
1232
- description: z.ZodOptional<z.ZodString>;
1233
- rule: z.ZodOptional<z.ZodString>;
1234
1232
  tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
1235
1233
  description: z.ZodOptional<z.ZodString>;
1236
1234
  inputJsonSchema: z.ZodString;
@@ -1244,6 +1242,8 @@ declare const expertBaseSchema: z.ZodObject<{
1244
1242
  inputJsonSchema: string;
1245
1243
  description?: string | undefined;
1246
1244
  }>>>;
1245
+ description: z.ZodOptional<z.ZodString>;
1246
+ rule: z.ZodOptional<z.ZodString>;
1247
1247
  }, z.core.$strip>], "type">>>>, z.ZodTransform<{
1248
1248
  [k: string]: {
1249
1249
  type: "mcpStdioSkill";
@@ -1279,10 +1279,10 @@ declare const expertBaseSchema: z.ZodObject<{
1279
1279
  };
1280
1280
  }, Record<string, {
1281
1281
  type: "mcpStdioSkill";
1282
+ args: string[];
1283
+ command: string;
1282
1284
  pick: string[];
1283
1285
  omit: string[];
1284
- command: string;
1285
- args: string[];
1286
1286
  requiredEnv: string[];
1287
1287
  description?: string | undefined;
1288
1288
  rule?: string | undefined;
@@ -1349,13 +1349,13 @@ declare const expertSchema: z.ZodObject<{
1349
1349
  instruction: z.ZodString;
1350
1350
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1351
1351
  type: z.ZodLiteral<"mcpStdioSkill">;
1352
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1353
+ command: z.ZodString;
1352
1354
  description: z.ZodOptional<z.ZodString>;
1353
1355
  rule: z.ZodOptional<z.ZodString>;
1354
1356
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1355
1357
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1356
- command: z.ZodString;
1357
1358
  packageName: z.ZodOptional<z.ZodString>;
1358
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1359
1359
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1360
1360
  }, z.core.$strip>, z.ZodObject<{
1361
1361
  type: z.ZodLiteral<"mcpSseSkill">;
@@ -1366,8 +1366,6 @@ declare const expertSchema: z.ZodObject<{
1366
1366
  endpoint: z.ZodString;
1367
1367
  }, z.core.$strip>, z.ZodObject<{
1368
1368
  type: z.ZodLiteral<"interactiveSkill">;
1369
- description: z.ZodOptional<z.ZodString>;
1370
- rule: z.ZodOptional<z.ZodString>;
1371
1369
  tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
1372
1370
  description: z.ZodOptional<z.ZodString>;
1373
1371
  inputJsonSchema: z.ZodString;
@@ -1381,6 +1379,8 @@ declare const expertSchema: z.ZodObject<{
1381
1379
  inputJsonSchema: string;
1382
1380
  description?: string | undefined;
1383
1381
  }>>>;
1382
+ description: z.ZodOptional<z.ZodString>;
1383
+ rule: z.ZodOptional<z.ZodString>;
1384
1384
  }, z.core.$strip>], "type">>>>, z.ZodTransform<{
1385
1385
  [k: string]: {
1386
1386
  type: "mcpStdioSkill";
@@ -1416,10 +1416,10 @@ declare const expertSchema: z.ZodObject<{
1416
1416
  };
1417
1417
  }, Record<string, {
1418
1418
  type: "mcpStdioSkill";
1419
+ args: string[];
1420
+ command: string;
1419
1421
  pick: string[];
1420
1422
  omit: string[];
1421
- command: string;
1422
- args: string[];
1423
1423
  requiredEnv: string[];
1424
1424
  description?: string | undefined;
1425
1425
  rule?: string | undefined;
@@ -2591,13 +2591,13 @@ declare const runSettingSchema: z.ZodObject<{
2591
2591
  instruction: z.ZodString;
2592
2592
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2593
2593
  type: z.ZodLiteral<"mcpStdioSkill">;
2594
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2595
+ command: z.ZodString;
2594
2596
  description: z.ZodOptional<z.ZodString>;
2595
2597
  rule: z.ZodOptional<z.ZodString>;
2596
2598
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2597
2599
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2598
- command: z.ZodString;
2599
2600
  packageName: z.ZodOptional<z.ZodString>;
2600
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2601
2601
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2602
2602
  }, z.core.$strip>, z.ZodObject<{
2603
2603
  type: z.ZodLiteral<"mcpSseSkill">;
@@ -2608,8 +2608,6 @@ declare const runSettingSchema: z.ZodObject<{
2608
2608
  endpoint: z.ZodString;
2609
2609
  }, z.core.$strip>, z.ZodObject<{
2610
2610
  type: z.ZodLiteral<"interactiveSkill">;
2611
- description: z.ZodOptional<z.ZodString>;
2612
- rule: z.ZodOptional<z.ZodString>;
2613
2611
  tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
2614
2612
  description: z.ZodOptional<z.ZodString>;
2615
2613
  inputJsonSchema: z.ZodString;
@@ -2623,6 +2621,8 @@ declare const runSettingSchema: z.ZodObject<{
2623
2621
  inputJsonSchema: string;
2624
2622
  description?: string | undefined;
2625
2623
  }>>>;
2624
+ description: z.ZodOptional<z.ZodString>;
2625
+ rule: z.ZodOptional<z.ZodString>;
2626
2626
  }, z.core.$strip>], "type">>>>, z.ZodTransform<{
2627
2627
  [k: string]: {
2628
2628
  type: "mcpStdioSkill";
@@ -2658,10 +2658,10 @@ declare const runSettingSchema: z.ZodObject<{
2658
2658
  };
2659
2659
  }, Record<string, {
2660
2660
  type: "mcpStdioSkill";
2661
+ args: string[];
2662
+ command: string;
2661
2663
  pick: string[];
2662
2664
  omit: string[];
2663
- command: string;
2664
- args: string[];
2665
2665
  requiredEnv: string[];
2666
2666
  description?: string | undefined;
2667
2667
  rule?: string | undefined;
@@ -2798,6 +2798,9 @@ declare const runParamsSchema: z.ZodObject<{
2798
2798
  }, z.core.$strip>>;
2799
2799
  }, z.core.$strip>;
2800
2800
  experts: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2801
+ name: z.ZodString;
2802
+ version: z.ZodString;
2803
+ description: z.ZodOptional<z.ZodString>;
2801
2804
  providerToolOptions: z.ZodOptional<z.ZodObject<{
2802
2805
  webSearch: z.ZodOptional<z.ZodObject<{
2803
2806
  maxUses: z.ZodOptional<z.ZodNumber>;
@@ -2811,19 +2814,16 @@ declare const runParamsSchema: z.ZodObject<{
2811
2814
  maxNumResults: z.ZodOptional<z.ZodNumber>;
2812
2815
  }, z.core.$strip>>;
2813
2816
  }, z.core.$strip>>;
2814
- name: z.ZodString;
2815
- version: z.ZodString;
2816
- description: z.ZodOptional<z.ZodString>;
2817
2817
  instruction: z.ZodString;
2818
2818
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2819
2819
  type: z.ZodLiteral<"mcpStdioSkill">;
2820
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2821
+ command: z.ZodString;
2820
2822
  description: z.ZodOptional<z.ZodString>;
2821
2823
  rule: z.ZodOptional<z.ZodString>;
2822
2824
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2823
2825
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2824
- command: z.ZodString;
2825
2826
  packageName: z.ZodOptional<z.ZodString>;
2826
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2827
2827
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2828
2828
  }, z.core.$strip>, z.ZodObject<{
2829
2829
  type: z.ZodLiteral<"mcpSseSkill">;
@@ -2834,8 +2834,6 @@ declare const runParamsSchema: z.ZodObject<{
2834
2834
  endpoint: z.ZodString;
2835
2835
  }, z.core.$strip>, z.ZodObject<{
2836
2836
  type: z.ZodLiteral<"interactiveSkill">;
2837
- description: z.ZodOptional<z.ZodString>;
2838
- rule: z.ZodOptional<z.ZodString>;
2839
2837
  tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
2840
2838
  description: z.ZodOptional<z.ZodString>;
2841
2839
  inputJsonSchema: z.ZodString;
@@ -2849,6 +2847,8 @@ declare const runParamsSchema: z.ZodObject<{
2849
2847
  inputJsonSchema: string;
2850
2848
  description?: string | undefined;
2851
2849
  }>>>;
2850
+ description: z.ZodOptional<z.ZodString>;
2851
+ rule: z.ZodOptional<z.ZodString>;
2852
2852
  }, z.core.$strip>], "type">>>>, z.ZodTransform<{
2853
2853
  [k: string]: {
2854
2854
  type: "mcpStdioSkill";
@@ -2884,10 +2884,10 @@ declare const runParamsSchema: z.ZodObject<{
2884
2884
  };
2885
2885
  }, Record<string, {
2886
2886
  type: "mcpStdioSkill";
2887
+ args: string[];
2888
+ command: string;
2887
2889
  pick: string[];
2888
2890
  omit: string[];
2889
- command: string;
2890
- args: string[];
2891
2891
  requiredEnv: string[];
2892
2892
  description?: string | undefined;
2893
2893
  rule?: string | undefined;
@@ -3036,6 +3036,7 @@ declare const runParamsSchema: z.ZodObject<{
3036
3036
  delegates: string[];
3037
3037
  tags: string[];
3038
3038
  minRuntimeVersion: `v${number}.${number}`;
3039
+ description?: string | undefined;
3039
3040
  providerToolOptions?: {
3040
3041
  webSearch?: {
3041
3042
  maxUses?: number | undefined;
@@ -3049,7 +3050,6 @@ declare const runParamsSchema: z.ZodObject<{
3049
3050
  maxNumResults?: number | undefined;
3050
3051
  } | undefined;
3051
3052
  } | undefined;
3052
- description?: string | undefined;
3053
3053
  providerTools?: string[] | undefined;
3054
3054
  providerSkills?: ({
3055
3055
  type: "builtin";
@@ -3458,7 +3458,7 @@ declare const startRun: (setting: RunSetting, checkpoint: Checkpoint, data: Omit
3458
3458
  } & {
3459
3459
  initialCheckpoint: Checkpoint;
3460
3460
  inputMessages: (InstructionMessage | UserMessage | ToolMessage)[];
3461
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3461
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3462
3462
  type: "startRun";
3463
3463
  } & {
3464
3464
  initialCheckpoint: Checkpoint;
@@ -3468,7 +3468,7 @@ declare const resumeFromStop: (setting: RunSetting, checkpoint: Checkpoint, data
3468
3468
  type: "resumeFromStop";
3469
3469
  } & {
3470
3470
  checkpoint: Checkpoint;
3471
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3471
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3472
3472
  type: "resumeFromStop";
3473
3473
  } & {
3474
3474
  checkpoint: Checkpoint;
@@ -3478,7 +3478,7 @@ declare const proceedToInteractiveTools: (setting: RunSetting, checkpoint: Check
3478
3478
  } & {
3479
3479
  pendingToolCalls: ToolCall[];
3480
3480
  partialToolResults: ToolResult[];
3481
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3481
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3482
3482
  type: "proceedToInteractiveTools";
3483
3483
  } & {
3484
3484
  pendingToolCalls: ToolCall[];
@@ -3488,7 +3488,7 @@ declare const startGeneration: (setting: RunSetting, checkpoint: Checkpoint, dat
3488
3488
  type: "startGeneration";
3489
3489
  } & {
3490
3490
  messages: Message[];
3491
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3491
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3492
3492
  type: "startGeneration";
3493
3493
  } & {
3494
3494
  messages: Message[];
@@ -3501,7 +3501,7 @@ declare const retry: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<Ba
3501
3501
  toolCalls?: ToolCall[];
3502
3502
  toolResults?: ToolResult[];
3503
3503
  usage: Usage;
3504
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3504
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3505
3505
  type: "retry";
3506
3506
  } & {
3507
3507
  reason: string;
@@ -3516,7 +3516,7 @@ declare const callTools: (setting: RunSetting, checkpoint: Checkpoint, data: Omi
3516
3516
  newMessage: ExpertMessage;
3517
3517
  toolCalls: ToolCall[];
3518
3518
  usage: Usage;
3519
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3519
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3520
3520
  type: "callTools";
3521
3521
  } & {
3522
3522
  newMessage: ExpertMessage;
@@ -3528,7 +3528,7 @@ declare const finishMcpTools: (setting: RunSetting, checkpoint: Checkpoint, data
3528
3528
  } & {
3529
3529
  partialToolResults: ToolResult[];
3530
3530
  pendingToolCalls: ToolCall[];
3531
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3531
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3532
3532
  type: "finishMcpTools";
3533
3533
  } & {
3534
3534
  partialToolResults: ToolResult[];
@@ -3536,14 +3536,14 @@ declare const finishMcpTools: (setting: RunSetting, checkpoint: Checkpoint, data
3536
3536
  };
3537
3537
  declare const skipDelegates: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3538
3538
  type: "skipDelegates";
3539
- } & object, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3539
+ } & object, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3540
3540
  type: "skipDelegates";
3541
3541
  } & object;
3542
3542
  declare const resolveToolResults: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3543
3543
  type: "resolveToolResults";
3544
3544
  } & {
3545
3545
  toolResults: ToolResult[];
3546
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3546
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3547
3547
  type: "resolveToolResults";
3548
3548
  } & {
3549
3549
  toolResults: ToolResult[];
@@ -3552,7 +3552,7 @@ declare const finishToolCall: (setting: RunSetting, checkpoint: Checkpoint, data
3552
3552
  type: "finishToolCall";
3553
3553
  } & {
3554
3554
  newMessages: (UserMessage | ToolMessage)[];
3555
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3555
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3556
3556
  type: "finishToolCall";
3557
3557
  } & {
3558
3558
  newMessages: (UserMessage | ToolMessage)[];
@@ -3562,7 +3562,7 @@ declare const resumeToolCalls: (setting: RunSetting, checkpoint: Checkpoint, dat
3562
3562
  } & {
3563
3563
  pendingToolCalls: ToolCall[];
3564
3564
  partialToolResults: ToolResult[];
3565
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3565
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3566
3566
  type: "resumeToolCalls";
3567
3567
  } & {
3568
3568
  pendingToolCalls: ToolCall[];
@@ -3575,7 +3575,7 @@ declare const completeRun: (setting: RunSetting, checkpoint: Checkpoint, data: O
3575
3575
  step: Step;
3576
3576
  text: string;
3577
3577
  usage: Usage;
3578
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3578
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3579
3579
  type: "completeRun";
3580
3580
  } & {
3581
3581
  checkpoint: Checkpoint;
@@ -3588,7 +3588,7 @@ declare const stopRunByInteractiveTool: (setting: RunSetting, checkpoint: Checkp
3588
3588
  } & {
3589
3589
  checkpoint: Checkpoint;
3590
3590
  step: Step;
3591
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3591
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3592
3592
  type: "stopRunByInteractiveTool";
3593
3593
  } & {
3594
3594
  checkpoint: Checkpoint;
@@ -3599,7 +3599,7 @@ declare const stopRunByDelegate: (setting: RunSetting, checkpoint: Checkpoint, d
3599
3599
  } & {
3600
3600
  checkpoint: Checkpoint;
3601
3601
  step: Step;
3602
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3602
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3603
3603
  type: "stopRunByDelegate";
3604
3604
  } & {
3605
3605
  checkpoint: Checkpoint;
@@ -3616,7 +3616,7 @@ declare const stopRunByError: (setting: RunSetting, checkpoint: Checkpoint, data
3616
3616
  statusCode?: number;
3617
3617
  isRetryable: boolean;
3618
3618
  };
3619
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3619
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3620
3620
  type: "stopRunByError";
3621
3621
  } & {
3622
3622
  checkpoint: Checkpoint;
@@ -3634,7 +3634,7 @@ declare const continueToNextStep: (setting: RunSetting, checkpoint: Checkpoint,
3634
3634
  checkpoint: Checkpoint;
3635
3635
  step: Step;
3636
3636
  nextCheckpoint: Checkpoint;
3637
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3637
+ }, "id" | "jobId" | "runId" | "stepNumber" | "type" | "expertKey" | "timestamp">) => BaseEvent & {
3638
3638
  type: "continueToNextStep";
3639
3639
  } & {
3640
3640
  checkpoint: Checkpoint;
@@ -6324,14 +6324,20 @@ declare function isCoordinatorExpert(expertName: string): boolean;
6324
6324
  declare function isDelegateExpert(expertName: string): boolean;
6325
6325
  /**
6326
6326
  * Returns the scope of an expert.
6327
+ * Handles both bare names and versioned keys (with @version/@tag suffix).
6327
6328
  * - Coordinator "game-producer" -> "game-producer"
6329
+ * - Coordinator "game-producer@1.0.0" -> "game-producer"
6328
6330
  * - Delegate "@game-producer/designer" -> "game-producer"
6331
+ * - Delegate "@game-producer/designer@1.0.0" -> "game-producer"
6329
6332
  */
6330
6333
  declare function getExpertScope(expertName: string): string;
6331
6334
  /**
6332
6335
  * Returns the short name of an expert.
6336
+ * Handles both bare names and versioned keys (with @version/@tag suffix).
6333
6337
  * - Coordinator "game-producer" -> "game-producer"
6338
+ * - Coordinator "game-producer@1.0.0" -> "game-producer"
6334
6339
  * - Delegate "@game-producer/designer" -> "designer"
6340
+ * - Delegate "@game-producer/designer@1.0.0" -> "designer"
6335
6341
  */
6336
6342
  declare function getExpertShortName(expertName: string): string;
6337
6343
  /**
package/dist/src/index.js CHANGED
@@ -752,8 +752,11 @@ function isDelegateExpert(expertName) {
752
752
  }
753
753
  /**
754
754
  * Returns the scope of an expert.
755
+ * Handles both bare names and versioned keys (with @version/@tag suffix).
755
756
  * - Coordinator "game-producer" -> "game-producer"
757
+ * - Coordinator "game-producer@1.0.0" -> "game-producer"
756
758
  * - Delegate "@game-producer/designer" -> "game-producer"
759
+ * - Delegate "@game-producer/designer@1.0.0" -> "game-producer"
757
760
  */
758
761
  function getExpertScope(expertName) {
759
762
  if (isDelegateExpert(expertName)) {
@@ -761,19 +764,26 @@ function getExpertScope(expertName) {
761
764
  const slashIndex = withoutAt.indexOf("/");
762
765
  return slashIndex === -1 ? withoutAt : withoutAt.slice(0, slashIndex);
763
766
  }
764
- return expertName;
767
+ const atIndex = expertName.indexOf("@");
768
+ return atIndex === -1 ? expertName : expertName.slice(0, atIndex);
765
769
  }
766
770
  /**
767
771
  * Returns the short name of an expert.
772
+ * Handles both bare names and versioned keys (with @version/@tag suffix).
768
773
  * - Coordinator "game-producer" -> "game-producer"
774
+ * - Coordinator "game-producer@1.0.0" -> "game-producer"
769
775
  * - Delegate "@game-producer/designer" -> "designer"
776
+ * - Delegate "@game-producer/designer@1.0.0" -> "designer"
770
777
  */
771
778
  function getExpertShortName(expertName) {
772
779
  if (isDelegateExpert(expertName)) {
773
780
  const slashIndex = expertName.indexOf("/");
774
- return slashIndex === -1 ? expertName : expertName.slice(slashIndex + 1);
781
+ const shortName = slashIndex === -1 ? expertName : expertName.slice(slashIndex + 1);
782
+ const atIndex = shortName.indexOf("@");
783
+ return atIndex === -1 ? shortName : shortName.slice(0, atIndex);
775
784
  }
776
- return expertName;
785
+ const atIndex = expertName.indexOf("@");
786
+ return atIndex === -1 ? expertName : expertName.slice(0, atIndex);
777
787
  }
778
788
  /**
779
789
  * Validates whether a delegation from source to target is allowed.
@@ -790,7 +800,7 @@ function validateDelegation(source, target) {
790
800
  if (isDelegateExpert(target)) {
791
801
  if (sourceScope !== getExpertScope(target)) return `Expert "${source}" cannot delegate to out-of-scope delegate "${target}"`;
792
802
  }
793
- if (isDelegateExpert(source) && isCoordinatorExpert(target) && target === sourceScope) return `Delegate "${source}" cannot delegate to its own coordinator "${target}"`;
803
+ if (isDelegateExpert(source) && isCoordinatorExpert(target) && getExpertScope(target) === sourceScope) return `Delegate "${source}" cannot delegate to its own coordinator "${target}"`;
794
804
  return null;
795
805
  }
796
806
  /**