@illalabs/interfaces 0.3.0 → 0.3.1-canary-beta-b5b9fdec

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.
@@ -4,20 +4,20 @@ import { z } from "zod";
4
4
  * Telemetry event type enum values.
5
5
  * Used to infer TelemetryEventType in types/telemetry.ts
6
6
  */
7
- export declare const telemetryEventTypes: readonly ["iteration_start", "iteration_end", "tool_call_batch", "tool_result", "scratchpad_reset", "llm_start", "llm_end", "text_delta", "finish", "error", "connected", "stream_end"];
7
+ export declare const telemetryEventTypes: readonly ["iteration_start", "iteration_end", "tool_call_batch", "tool_result", "scratchpad_reset", "llm_start", "llm_end", "text_delta", "finish", "error", "connected", "stream_end", "plan_generated", "plan_step_completed", "plan_invalidated", "replan_started", "replan_complete", "plan_execution_complete"];
8
8
  /**
9
9
  * Base telemetry event schema with common fields
10
10
  */
11
11
  export declare const baseTelemetryEventSchema: z.ZodObject<{
12
12
  requestId: z.ZodString;
13
- type: z.ZodEnum<["iteration_start", "iteration_end", "tool_call_batch", "tool_result", "scratchpad_reset", "llm_start", "llm_end", "text_delta", "finish", "error", "connected", "stream_end"]>;
13
+ type: z.ZodEnum<["iteration_start", "iteration_end", "tool_call_batch", "tool_result", "scratchpad_reset", "llm_start", "llm_end", "text_delta", "finish", "error", "connected", "stream_end", "plan_generated", "plan_step_completed", "plan_invalidated", "replan_started", "replan_complete", "plan_execution_complete"]>;
14
14
  timestamp: z.ZodOptional<z.ZodNumber>;
15
15
  }, "strip", z.ZodTypeAny, {
16
- type: "error" | "iteration_start" | "iteration_end" | "tool_call_batch" | "tool_result" | "scratchpad_reset" | "llm_start" | "llm_end" | "text_delta" | "finish" | "connected" | "stream_end";
16
+ type: "error" | "iteration_start" | "iteration_end" | "tool_call_batch" | "tool_result" | "scratchpad_reset" | "llm_start" | "llm_end" | "text_delta" | "finish" | "connected" | "stream_end" | "plan_generated" | "plan_step_completed" | "plan_invalidated" | "replan_started" | "replan_complete" | "plan_execution_complete";
17
17
  requestId: string;
18
18
  timestamp?: number | undefined;
19
19
  }, {
20
- type: "error" | "iteration_start" | "iteration_end" | "tool_call_batch" | "tool_result" | "scratchpad_reset" | "llm_start" | "llm_end" | "text_delta" | "finish" | "connected" | "stream_end";
20
+ type: "error" | "iteration_start" | "iteration_end" | "tool_call_batch" | "tool_result" | "scratchpad_reset" | "llm_start" | "llm_end" | "text_delta" | "finish" | "connected" | "stream_end" | "plan_generated" | "plan_step_completed" | "plan_invalidated" | "replan_started" | "replan_complete" | "plan_execution_complete";
21
21
  requestId: string;
22
22
  timestamp?: number | undefined;
23
23
  }>;
@@ -472,6 +472,283 @@ export declare const errorTelemetryEventSchema: z.ZodObject<{
472
472
  requestId: string;
473
473
  timestamp?: number | undefined;
474
474
  }>;
475
+ /**
476
+ * Plan generated event schema - emitted when a plan is created
477
+ */
478
+ export declare const planGeneratedEventSchema: z.ZodObject<{
479
+ requestId: z.ZodString;
480
+ timestamp: z.ZodOptional<z.ZodNumber>;
481
+ } & {
482
+ type: z.ZodLiteral<"plan_generated">;
483
+ data: z.ZodObject<{
484
+ planId: z.ZodString;
485
+ version: z.ZodNumber;
486
+ complexity: z.ZodEnum<["low", "medium", "high"]>;
487
+ stepCount: z.ZodNumber;
488
+ autoExecutable: z.ZodBoolean;
489
+ recommendedModel: z.ZodString;
490
+ }, "strip", z.ZodTypeAny, {
491
+ complexity: "low" | "medium" | "high";
492
+ recommendedModel: string;
493
+ planId: string;
494
+ version: number;
495
+ autoExecutable: boolean;
496
+ stepCount: number;
497
+ }, {
498
+ complexity: "low" | "medium" | "high";
499
+ recommendedModel: string;
500
+ planId: string;
501
+ version: number;
502
+ autoExecutable: boolean;
503
+ stepCount: number;
504
+ }>;
505
+ }, "strip", z.ZodTypeAny, {
506
+ type: "plan_generated";
507
+ data: {
508
+ complexity: "low" | "medium" | "high";
509
+ recommendedModel: string;
510
+ planId: string;
511
+ version: number;
512
+ autoExecutable: boolean;
513
+ stepCount: number;
514
+ };
515
+ requestId: string;
516
+ timestamp?: number | undefined;
517
+ }, {
518
+ type: "plan_generated";
519
+ data: {
520
+ complexity: "low" | "medium" | "high";
521
+ recommendedModel: string;
522
+ planId: string;
523
+ version: number;
524
+ autoExecutable: boolean;
525
+ stepCount: number;
526
+ };
527
+ requestId: string;
528
+ timestamp?: number | undefined;
529
+ }>;
530
+ /**
531
+ * Plan step completed event schema - emitted when a plan step finishes
532
+ */
533
+ export declare const planStepCompletedEventSchema: z.ZodObject<{
534
+ requestId: z.ZodString;
535
+ timestamp: z.ZodOptional<z.ZodNumber>;
536
+ } & {
537
+ type: z.ZodLiteral<"plan_step_completed">;
538
+ data: z.ZodObject<{
539
+ planId: z.ZodString;
540
+ stepNumber: z.ZodNumber;
541
+ stepDescription: z.ZodString;
542
+ /** Step execution duration in milliseconds */
543
+ duration: z.ZodNumber;
544
+ }, "strip", z.ZodTypeAny, {
545
+ duration: number;
546
+ stepNumber: number;
547
+ planId: string;
548
+ stepDescription: string;
549
+ }, {
550
+ duration: number;
551
+ stepNumber: number;
552
+ planId: string;
553
+ stepDescription: string;
554
+ }>;
555
+ }, "strip", z.ZodTypeAny, {
556
+ type: "plan_step_completed";
557
+ data: {
558
+ duration: number;
559
+ stepNumber: number;
560
+ planId: string;
561
+ stepDescription: string;
562
+ };
563
+ requestId: string;
564
+ timestamp?: number | undefined;
565
+ }, {
566
+ type: "plan_step_completed";
567
+ data: {
568
+ duration: number;
569
+ stepNumber: number;
570
+ planId: string;
571
+ stepDescription: string;
572
+ };
573
+ requestId: string;
574
+ timestamp?: number | undefined;
575
+ }>;
576
+ /**
577
+ * Plan invalidated event schema - emitted when a plan can no longer be executed
578
+ */
579
+ export declare const planInvalidatedEventSchema: z.ZodObject<{
580
+ requestId: z.ZodString;
581
+ timestamp: z.ZodOptional<z.ZodNumber>;
582
+ } & {
583
+ type: z.ZodLiteral<"plan_invalidated">;
584
+ data: z.ZodObject<{
585
+ planId: z.ZodString;
586
+ reason: z.ZodString;
587
+ failedStep: z.ZodNumber;
588
+ completedSteps: z.ZodArray<z.ZodNumber, "many">;
589
+ }, "strip", z.ZodTypeAny, {
590
+ planId: string;
591
+ reason: string;
592
+ failedStep: number;
593
+ completedSteps: number[];
594
+ }, {
595
+ planId: string;
596
+ reason: string;
597
+ failedStep: number;
598
+ completedSteps: number[];
599
+ }>;
600
+ }, "strip", z.ZodTypeAny, {
601
+ type: "plan_invalidated";
602
+ data: {
603
+ planId: string;
604
+ reason: string;
605
+ failedStep: number;
606
+ completedSteps: number[];
607
+ };
608
+ requestId: string;
609
+ timestamp?: number | undefined;
610
+ }, {
611
+ type: "plan_invalidated";
612
+ data: {
613
+ planId: string;
614
+ reason: string;
615
+ failedStep: number;
616
+ completedSteps: number[];
617
+ };
618
+ requestId: string;
619
+ timestamp?: number | undefined;
620
+ }>;
621
+ /**
622
+ * Replan started event schema - emitted when re-planning begins
623
+ */
624
+ export declare const replanStartedEventSchema: z.ZodObject<{
625
+ requestId: z.ZodString;
626
+ timestamp: z.ZodOptional<z.ZodNumber>;
627
+ } & {
628
+ type: z.ZodLiteral<"replan_started">;
629
+ data: z.ZodObject<{
630
+ previousPlanId: z.ZodString;
631
+ reason: z.ZodString;
632
+ }, "strip", z.ZodTypeAny, {
633
+ previousPlanId: string;
634
+ reason: string;
635
+ }, {
636
+ previousPlanId: string;
637
+ reason: string;
638
+ }>;
639
+ }, "strip", z.ZodTypeAny, {
640
+ type: "replan_started";
641
+ data: {
642
+ previousPlanId: string;
643
+ reason: string;
644
+ };
645
+ requestId: string;
646
+ timestamp?: number | undefined;
647
+ }, {
648
+ type: "replan_started";
649
+ data: {
650
+ previousPlanId: string;
651
+ reason: string;
652
+ };
653
+ requestId: string;
654
+ timestamp?: number | undefined;
655
+ }>;
656
+ /**
657
+ * Replan complete event schema - emitted when re-planning finishes
658
+ */
659
+ export declare const replanCompleteEventSchema: z.ZodObject<{
660
+ requestId: z.ZodString;
661
+ timestamp: z.ZodOptional<z.ZodNumber>;
662
+ } & {
663
+ type: z.ZodLiteral<"replan_complete">;
664
+ data: z.ZodObject<{
665
+ previousPlanId: z.ZodString;
666
+ newPlanId: z.ZodString;
667
+ newVersion: z.ZodNumber;
668
+ preservedSteps: z.ZodArray<z.ZodNumber, "many">;
669
+ }, "strip", z.ZodTypeAny, {
670
+ previousPlanId: string;
671
+ preservedSteps: number[];
672
+ newPlanId: string;
673
+ newVersion: number;
674
+ }, {
675
+ previousPlanId: string;
676
+ preservedSteps: number[];
677
+ newPlanId: string;
678
+ newVersion: number;
679
+ }>;
680
+ }, "strip", z.ZodTypeAny, {
681
+ type: "replan_complete";
682
+ data: {
683
+ previousPlanId: string;
684
+ preservedSteps: number[];
685
+ newPlanId: string;
686
+ newVersion: number;
687
+ };
688
+ requestId: string;
689
+ timestamp?: number | undefined;
690
+ }, {
691
+ type: "replan_complete";
692
+ data: {
693
+ previousPlanId: string;
694
+ preservedSteps: number[];
695
+ newPlanId: string;
696
+ newVersion: number;
697
+ };
698
+ requestId: string;
699
+ timestamp?: number | undefined;
700
+ }>;
701
+ /**
702
+ * Plan execution complete event schema - emitted when plan execution finishes
703
+ */
704
+ export declare const planExecutionCompleteEventSchema: z.ZodObject<{
705
+ requestId: z.ZodString;
706
+ timestamp: z.ZodOptional<z.ZodNumber>;
707
+ } & {
708
+ type: z.ZodLiteral<"plan_execution_complete">;
709
+ data: z.ZodObject<{
710
+ planId: z.ZodString;
711
+ status: z.ZodEnum<["success", "partial", "failed"]>;
712
+ completedSteps: z.ZodNumber;
713
+ totalSteps: z.ZodNumber;
714
+ /** Total plan execution duration in milliseconds */
715
+ duration: z.ZodNumber;
716
+ }, "strip", z.ZodTypeAny, {
717
+ status: "failed" | "success" | "partial";
718
+ duration: number;
719
+ planId: string;
720
+ completedSteps: number;
721
+ totalSteps: number;
722
+ }, {
723
+ status: "failed" | "success" | "partial";
724
+ duration: number;
725
+ planId: string;
726
+ completedSteps: number;
727
+ totalSteps: number;
728
+ }>;
729
+ }, "strip", z.ZodTypeAny, {
730
+ type: "plan_execution_complete";
731
+ data: {
732
+ status: "failed" | "success" | "partial";
733
+ duration: number;
734
+ planId: string;
735
+ completedSteps: number;
736
+ totalSteps: number;
737
+ };
738
+ requestId: string;
739
+ timestamp?: number | undefined;
740
+ }, {
741
+ type: "plan_execution_complete";
742
+ data: {
743
+ status: "failed" | "success" | "partial";
744
+ duration: number;
745
+ planId: string;
746
+ completedSteps: number;
747
+ totalSteps: number;
748
+ };
749
+ requestId: string;
750
+ timestamp?: number | undefined;
751
+ }>;
475
752
  /**
476
753
  * Schema for validating telemetry events.
477
754
  * Discriminated union using the "type" field.
@@ -878,6 +1155,259 @@ export declare const telemetryEventSchema: z.ZodDiscriminatedUnion<"type", [z.Zo
878
1155
  };
879
1156
  requestId: string;
880
1157
  timestamp?: number | undefined;
1158
+ }>, z.ZodObject<{
1159
+ requestId: z.ZodString;
1160
+ timestamp: z.ZodOptional<z.ZodNumber>;
1161
+ } & {
1162
+ type: z.ZodLiteral<"plan_generated">;
1163
+ data: z.ZodObject<{
1164
+ planId: z.ZodString;
1165
+ version: z.ZodNumber;
1166
+ complexity: z.ZodEnum<["low", "medium", "high"]>;
1167
+ stepCount: z.ZodNumber;
1168
+ autoExecutable: z.ZodBoolean;
1169
+ recommendedModel: z.ZodString;
1170
+ }, "strip", z.ZodTypeAny, {
1171
+ complexity: "low" | "medium" | "high";
1172
+ recommendedModel: string;
1173
+ planId: string;
1174
+ version: number;
1175
+ autoExecutable: boolean;
1176
+ stepCount: number;
1177
+ }, {
1178
+ complexity: "low" | "medium" | "high";
1179
+ recommendedModel: string;
1180
+ planId: string;
1181
+ version: number;
1182
+ autoExecutable: boolean;
1183
+ stepCount: number;
1184
+ }>;
1185
+ }, "strip", z.ZodTypeAny, {
1186
+ type: "plan_generated";
1187
+ data: {
1188
+ complexity: "low" | "medium" | "high";
1189
+ recommendedModel: string;
1190
+ planId: string;
1191
+ version: number;
1192
+ autoExecutable: boolean;
1193
+ stepCount: number;
1194
+ };
1195
+ requestId: string;
1196
+ timestamp?: number | undefined;
1197
+ }, {
1198
+ type: "plan_generated";
1199
+ data: {
1200
+ complexity: "low" | "medium" | "high";
1201
+ recommendedModel: string;
1202
+ planId: string;
1203
+ version: number;
1204
+ autoExecutable: boolean;
1205
+ stepCount: number;
1206
+ };
1207
+ requestId: string;
1208
+ timestamp?: number | undefined;
1209
+ }>, z.ZodObject<{
1210
+ requestId: z.ZodString;
1211
+ timestamp: z.ZodOptional<z.ZodNumber>;
1212
+ } & {
1213
+ type: z.ZodLiteral<"plan_step_completed">;
1214
+ data: z.ZodObject<{
1215
+ planId: z.ZodString;
1216
+ stepNumber: z.ZodNumber;
1217
+ stepDescription: z.ZodString;
1218
+ /** Step execution duration in milliseconds */
1219
+ duration: z.ZodNumber;
1220
+ }, "strip", z.ZodTypeAny, {
1221
+ duration: number;
1222
+ stepNumber: number;
1223
+ planId: string;
1224
+ stepDescription: string;
1225
+ }, {
1226
+ duration: number;
1227
+ stepNumber: number;
1228
+ planId: string;
1229
+ stepDescription: string;
1230
+ }>;
1231
+ }, "strip", z.ZodTypeAny, {
1232
+ type: "plan_step_completed";
1233
+ data: {
1234
+ duration: number;
1235
+ stepNumber: number;
1236
+ planId: string;
1237
+ stepDescription: string;
1238
+ };
1239
+ requestId: string;
1240
+ timestamp?: number | undefined;
1241
+ }, {
1242
+ type: "plan_step_completed";
1243
+ data: {
1244
+ duration: number;
1245
+ stepNumber: number;
1246
+ planId: string;
1247
+ stepDescription: string;
1248
+ };
1249
+ requestId: string;
1250
+ timestamp?: number | undefined;
1251
+ }>, z.ZodObject<{
1252
+ requestId: z.ZodString;
1253
+ timestamp: z.ZodOptional<z.ZodNumber>;
1254
+ } & {
1255
+ type: z.ZodLiteral<"plan_invalidated">;
1256
+ data: z.ZodObject<{
1257
+ planId: z.ZodString;
1258
+ reason: z.ZodString;
1259
+ failedStep: z.ZodNumber;
1260
+ completedSteps: z.ZodArray<z.ZodNumber, "many">;
1261
+ }, "strip", z.ZodTypeAny, {
1262
+ planId: string;
1263
+ reason: string;
1264
+ failedStep: number;
1265
+ completedSteps: number[];
1266
+ }, {
1267
+ planId: string;
1268
+ reason: string;
1269
+ failedStep: number;
1270
+ completedSteps: number[];
1271
+ }>;
1272
+ }, "strip", z.ZodTypeAny, {
1273
+ type: "plan_invalidated";
1274
+ data: {
1275
+ planId: string;
1276
+ reason: string;
1277
+ failedStep: number;
1278
+ completedSteps: number[];
1279
+ };
1280
+ requestId: string;
1281
+ timestamp?: number | undefined;
1282
+ }, {
1283
+ type: "plan_invalidated";
1284
+ data: {
1285
+ planId: string;
1286
+ reason: string;
1287
+ failedStep: number;
1288
+ completedSteps: number[];
1289
+ };
1290
+ requestId: string;
1291
+ timestamp?: number | undefined;
1292
+ }>, z.ZodObject<{
1293
+ requestId: z.ZodString;
1294
+ timestamp: z.ZodOptional<z.ZodNumber>;
1295
+ } & {
1296
+ type: z.ZodLiteral<"replan_started">;
1297
+ data: z.ZodObject<{
1298
+ previousPlanId: z.ZodString;
1299
+ reason: z.ZodString;
1300
+ }, "strip", z.ZodTypeAny, {
1301
+ previousPlanId: string;
1302
+ reason: string;
1303
+ }, {
1304
+ previousPlanId: string;
1305
+ reason: string;
1306
+ }>;
1307
+ }, "strip", z.ZodTypeAny, {
1308
+ type: "replan_started";
1309
+ data: {
1310
+ previousPlanId: string;
1311
+ reason: string;
1312
+ };
1313
+ requestId: string;
1314
+ timestamp?: number | undefined;
1315
+ }, {
1316
+ type: "replan_started";
1317
+ data: {
1318
+ previousPlanId: string;
1319
+ reason: string;
1320
+ };
1321
+ requestId: string;
1322
+ timestamp?: number | undefined;
1323
+ }>, z.ZodObject<{
1324
+ requestId: z.ZodString;
1325
+ timestamp: z.ZodOptional<z.ZodNumber>;
1326
+ } & {
1327
+ type: z.ZodLiteral<"replan_complete">;
1328
+ data: z.ZodObject<{
1329
+ previousPlanId: z.ZodString;
1330
+ newPlanId: z.ZodString;
1331
+ newVersion: z.ZodNumber;
1332
+ preservedSteps: z.ZodArray<z.ZodNumber, "many">;
1333
+ }, "strip", z.ZodTypeAny, {
1334
+ previousPlanId: string;
1335
+ preservedSteps: number[];
1336
+ newPlanId: string;
1337
+ newVersion: number;
1338
+ }, {
1339
+ previousPlanId: string;
1340
+ preservedSteps: number[];
1341
+ newPlanId: string;
1342
+ newVersion: number;
1343
+ }>;
1344
+ }, "strip", z.ZodTypeAny, {
1345
+ type: "replan_complete";
1346
+ data: {
1347
+ previousPlanId: string;
1348
+ preservedSteps: number[];
1349
+ newPlanId: string;
1350
+ newVersion: number;
1351
+ };
1352
+ requestId: string;
1353
+ timestamp?: number | undefined;
1354
+ }, {
1355
+ type: "replan_complete";
1356
+ data: {
1357
+ previousPlanId: string;
1358
+ preservedSteps: number[];
1359
+ newPlanId: string;
1360
+ newVersion: number;
1361
+ };
1362
+ requestId: string;
1363
+ timestamp?: number | undefined;
1364
+ }>, z.ZodObject<{
1365
+ requestId: z.ZodString;
1366
+ timestamp: z.ZodOptional<z.ZodNumber>;
1367
+ } & {
1368
+ type: z.ZodLiteral<"plan_execution_complete">;
1369
+ data: z.ZodObject<{
1370
+ planId: z.ZodString;
1371
+ status: z.ZodEnum<["success", "partial", "failed"]>;
1372
+ completedSteps: z.ZodNumber;
1373
+ totalSteps: z.ZodNumber;
1374
+ /** Total plan execution duration in milliseconds */
1375
+ duration: z.ZodNumber;
1376
+ }, "strip", z.ZodTypeAny, {
1377
+ status: "failed" | "success" | "partial";
1378
+ duration: number;
1379
+ planId: string;
1380
+ completedSteps: number;
1381
+ totalSteps: number;
1382
+ }, {
1383
+ status: "failed" | "success" | "partial";
1384
+ duration: number;
1385
+ planId: string;
1386
+ completedSteps: number;
1387
+ totalSteps: number;
1388
+ }>;
1389
+ }, "strip", z.ZodTypeAny, {
1390
+ type: "plan_execution_complete";
1391
+ data: {
1392
+ status: "failed" | "success" | "partial";
1393
+ duration: number;
1394
+ planId: string;
1395
+ completedSteps: number;
1396
+ totalSteps: number;
1397
+ };
1398
+ requestId: string;
1399
+ timestamp?: number | undefined;
1400
+ }, {
1401
+ type: "plan_execution_complete";
1402
+ data: {
1403
+ status: "failed" | "success" | "partial";
1404
+ duration: number;
1405
+ planId: string;
1406
+ completedSteps: number;
1407
+ totalSteps: number;
1408
+ };
1409
+ requestId: string;
1410
+ timestamp?: number | undefined;
881
1411
  }>]>;
882
1412
  /**
883
1413
  * Schema for validating result events from the streaming endpoint.
@@ -1432,6 +1962,427 @@ export declare const resultEventDataSchema: z.ZodObject<{
1432
1962
  };
1433
1963
  }>, "many">>;
1434
1964
  requestId: z.ZodString;
1965
+ planning: z.ZodOptional<z.ZodObject<{
1966
+ plan: z.ZodObject<{
1967
+ planId: z.ZodString;
1968
+ version: z.ZodNumber;
1969
+ isExecutable: z.ZodBoolean;
1970
+ autoExecutable: z.ZodBoolean;
1971
+ userSummary: z.ZodObject<{
1972
+ title: z.ZodString;
1973
+ description: z.ZodString;
1974
+ steps: z.ZodArray<z.ZodObject<{
1975
+ number: z.ZodNumber;
1976
+ description: z.ZodString;
1977
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed", "skipped"]>;
1978
+ requiresApproval: z.ZodBoolean;
1979
+ }, "strict", z.ZodTypeAny, {
1980
+ number: number;
1981
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
1982
+ description: string;
1983
+ requiresApproval: boolean;
1984
+ }, {
1985
+ number: number;
1986
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
1987
+ description: string;
1988
+ requiresApproval: boolean;
1989
+ }>, "many">;
1990
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1991
+ }, "strict", z.ZodTypeAny, {
1992
+ description: string;
1993
+ title: string;
1994
+ steps: {
1995
+ number: number;
1996
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
1997
+ description: string;
1998
+ requiresApproval: boolean;
1999
+ }[];
2000
+ warnings?: string[] | undefined;
2001
+ }, {
2002
+ description: string;
2003
+ title: string;
2004
+ steps: {
2005
+ number: number;
2006
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2007
+ description: string;
2008
+ requiresApproval: boolean;
2009
+ }[];
2010
+ warnings?: string[] | undefined;
2011
+ }>;
2012
+ executionSchema: z.ZodObject<{
2013
+ steps: z.ZodArray<z.ZodObject<{
2014
+ stepNumber: z.ZodNumber;
2015
+ description: z.ZodString;
2016
+ operationType: z.ZodEnum<["read", "write"]>;
2017
+ requiresUserApproval: z.ZodBoolean;
2018
+ dependsOn: z.ZodArray<z.ZodNumber, "many">;
2019
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed", "skipped"]>;
2020
+ result: z.ZodOptional<z.ZodUnknown>;
2021
+ toolName: z.ZodOptional<z.ZodString>;
2022
+ executionInstructions: z.ZodObject<{
2023
+ objective: z.ZodString;
2024
+ inputSource: z.ZodRecord<z.ZodString, z.ZodString>;
2025
+ expectedOutput: z.ZodString;
2026
+ errorHandling: z.ZodString;
2027
+ constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2028
+ }, "strict", z.ZodTypeAny, {
2029
+ objective: string;
2030
+ inputSource: Record<string, string>;
2031
+ expectedOutput: string;
2032
+ errorHandling: string;
2033
+ constraints?: string[] | undefined;
2034
+ }, {
2035
+ objective: string;
2036
+ inputSource: Record<string, string>;
2037
+ expectedOutput: string;
2038
+ errorHandling: string;
2039
+ constraints?: string[] | undefined;
2040
+ }>;
2041
+ }, "strict", z.ZodTypeAny, {
2042
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2043
+ description: string;
2044
+ stepNumber: number;
2045
+ operationType: "read" | "write";
2046
+ requiresUserApproval: boolean;
2047
+ dependsOn: number[];
2048
+ executionInstructions: {
2049
+ objective: string;
2050
+ inputSource: Record<string, string>;
2051
+ expectedOutput: string;
2052
+ errorHandling: string;
2053
+ constraints?: string[] | undefined;
2054
+ };
2055
+ result?: unknown;
2056
+ toolName?: string | undefined;
2057
+ }, {
2058
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2059
+ description: string;
2060
+ stepNumber: number;
2061
+ operationType: "read" | "write";
2062
+ requiresUserApproval: boolean;
2063
+ dependsOn: number[];
2064
+ executionInstructions: {
2065
+ objective: string;
2066
+ inputSource: Record<string, string>;
2067
+ expectedOutput: string;
2068
+ errorHandling: string;
2069
+ constraints?: string[] | undefined;
2070
+ };
2071
+ result?: unknown;
2072
+ toolName?: string | undefined;
2073
+ }>, "many">;
2074
+ complexity: z.ZodEnum<["low", "medium", "high"]>;
2075
+ recommendedModel: z.ZodString;
2076
+ toolSequence: z.ZodArray<z.ZodString, "many">;
2077
+ readOperations: z.ZodArray<z.ZodString, "many">;
2078
+ writeOperations: z.ZodArray<z.ZodString, "many">;
2079
+ pendingApprovals: z.ZodNumber;
2080
+ availableTools: z.ZodArray<z.ZodString, "many">;
2081
+ }, "strict", z.ZodTypeAny, {
2082
+ steps: {
2083
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2084
+ description: string;
2085
+ stepNumber: number;
2086
+ operationType: "read" | "write";
2087
+ requiresUserApproval: boolean;
2088
+ dependsOn: number[];
2089
+ executionInstructions: {
2090
+ objective: string;
2091
+ inputSource: Record<string, string>;
2092
+ expectedOutput: string;
2093
+ errorHandling: string;
2094
+ constraints?: string[] | undefined;
2095
+ };
2096
+ result?: unknown;
2097
+ toolName?: string | undefined;
2098
+ }[];
2099
+ complexity: "low" | "medium" | "high";
2100
+ recommendedModel: string;
2101
+ toolSequence: string[];
2102
+ readOperations: string[];
2103
+ writeOperations: string[];
2104
+ pendingApprovals: number;
2105
+ availableTools: string[];
2106
+ }, {
2107
+ steps: {
2108
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2109
+ description: string;
2110
+ stepNumber: number;
2111
+ operationType: "read" | "write";
2112
+ requiresUserApproval: boolean;
2113
+ dependsOn: number[];
2114
+ executionInstructions: {
2115
+ objective: string;
2116
+ inputSource: Record<string, string>;
2117
+ expectedOutput: string;
2118
+ errorHandling: string;
2119
+ constraints?: string[] | undefined;
2120
+ };
2121
+ result?: unknown;
2122
+ toolName?: string | undefined;
2123
+ }[];
2124
+ complexity: "low" | "medium" | "high";
2125
+ recommendedModel: string;
2126
+ toolSequence: string[];
2127
+ readOperations: string[];
2128
+ writeOperations: string[];
2129
+ pendingApprovals: number;
2130
+ availableTools: string[];
2131
+ }>;
2132
+ conflicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2133
+ type: z.ZodEnum<["conflicting_intent", "impossible_task", "missing_tool", "missing_context", "unsupported_operation"]>;
2134
+ message: z.ZodString;
2135
+ suggestion: z.ZodOptional<z.ZodString>;
2136
+ }, "strict", z.ZodTypeAny, {
2137
+ message: string;
2138
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2139
+ suggestion?: string | undefined;
2140
+ }, {
2141
+ message: string;
2142
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2143
+ suggestion?: string | undefined;
2144
+ }>, "many">>;
2145
+ replanContext: z.ZodOptional<z.ZodObject<{
2146
+ previousPlanId: z.ZodString;
2147
+ replanReason: z.ZodString;
2148
+ preservedSteps: z.ZodArray<z.ZodNumber, "many">;
2149
+ }, "strict", z.ZodTypeAny, {
2150
+ previousPlanId: string;
2151
+ replanReason: string;
2152
+ preservedSteps: number[];
2153
+ }, {
2154
+ previousPlanId: string;
2155
+ replanReason: string;
2156
+ preservedSteps: number[];
2157
+ }>>;
2158
+ createdAt: z.ZodString;
2159
+ }, "strict", z.ZodTypeAny, {
2160
+ planId: string;
2161
+ version: number;
2162
+ isExecutable: boolean;
2163
+ autoExecutable: boolean;
2164
+ userSummary: {
2165
+ description: string;
2166
+ title: string;
2167
+ steps: {
2168
+ number: number;
2169
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2170
+ description: string;
2171
+ requiresApproval: boolean;
2172
+ }[];
2173
+ warnings?: string[] | undefined;
2174
+ };
2175
+ executionSchema: {
2176
+ steps: {
2177
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2178
+ description: string;
2179
+ stepNumber: number;
2180
+ operationType: "read" | "write";
2181
+ requiresUserApproval: boolean;
2182
+ dependsOn: number[];
2183
+ executionInstructions: {
2184
+ objective: string;
2185
+ inputSource: Record<string, string>;
2186
+ expectedOutput: string;
2187
+ errorHandling: string;
2188
+ constraints?: string[] | undefined;
2189
+ };
2190
+ result?: unknown;
2191
+ toolName?: string | undefined;
2192
+ }[];
2193
+ complexity: "low" | "medium" | "high";
2194
+ recommendedModel: string;
2195
+ toolSequence: string[];
2196
+ readOperations: string[];
2197
+ writeOperations: string[];
2198
+ pendingApprovals: number;
2199
+ availableTools: string[];
2200
+ };
2201
+ createdAt: string;
2202
+ conflicts?: {
2203
+ message: string;
2204
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2205
+ suggestion?: string | undefined;
2206
+ }[] | undefined;
2207
+ replanContext?: {
2208
+ previousPlanId: string;
2209
+ replanReason: string;
2210
+ preservedSteps: number[];
2211
+ } | undefined;
2212
+ }, {
2213
+ planId: string;
2214
+ version: number;
2215
+ isExecutable: boolean;
2216
+ autoExecutable: boolean;
2217
+ userSummary: {
2218
+ description: string;
2219
+ title: string;
2220
+ steps: {
2221
+ number: number;
2222
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2223
+ description: string;
2224
+ requiresApproval: boolean;
2225
+ }[];
2226
+ warnings?: string[] | undefined;
2227
+ };
2228
+ executionSchema: {
2229
+ steps: {
2230
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2231
+ description: string;
2232
+ stepNumber: number;
2233
+ operationType: "read" | "write";
2234
+ requiresUserApproval: boolean;
2235
+ dependsOn: number[];
2236
+ executionInstructions: {
2237
+ objective: string;
2238
+ inputSource: Record<string, string>;
2239
+ expectedOutput: string;
2240
+ errorHandling: string;
2241
+ constraints?: string[] | undefined;
2242
+ };
2243
+ result?: unknown;
2244
+ toolName?: string | undefined;
2245
+ }[];
2246
+ complexity: "low" | "medium" | "high";
2247
+ recommendedModel: string;
2248
+ toolSequence: string[];
2249
+ readOperations: string[];
2250
+ writeOperations: string[];
2251
+ pendingApprovals: number;
2252
+ availableTools: string[];
2253
+ };
2254
+ createdAt: string;
2255
+ conflicts?: {
2256
+ message: string;
2257
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2258
+ suggestion?: string | undefined;
2259
+ }[] | undefined;
2260
+ replanContext?: {
2261
+ previousPlanId: string;
2262
+ replanReason: string;
2263
+ preservedSteps: number[];
2264
+ } | undefined;
2265
+ }>;
2266
+ requiresApproval: z.ZodBoolean;
2267
+ replanReason: z.ZodOptional<z.ZodString>;
2268
+ dryRun: z.ZodOptional<z.ZodBoolean>;
2269
+ }, "strip", z.ZodTypeAny, {
2270
+ requiresApproval: boolean;
2271
+ plan: {
2272
+ planId: string;
2273
+ version: number;
2274
+ isExecutable: boolean;
2275
+ autoExecutable: boolean;
2276
+ userSummary: {
2277
+ description: string;
2278
+ title: string;
2279
+ steps: {
2280
+ number: number;
2281
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2282
+ description: string;
2283
+ requiresApproval: boolean;
2284
+ }[];
2285
+ warnings?: string[] | undefined;
2286
+ };
2287
+ executionSchema: {
2288
+ steps: {
2289
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2290
+ description: string;
2291
+ stepNumber: number;
2292
+ operationType: "read" | "write";
2293
+ requiresUserApproval: boolean;
2294
+ dependsOn: number[];
2295
+ executionInstructions: {
2296
+ objective: string;
2297
+ inputSource: Record<string, string>;
2298
+ expectedOutput: string;
2299
+ errorHandling: string;
2300
+ constraints?: string[] | undefined;
2301
+ };
2302
+ result?: unknown;
2303
+ toolName?: string | undefined;
2304
+ }[];
2305
+ complexity: "low" | "medium" | "high";
2306
+ recommendedModel: string;
2307
+ toolSequence: string[];
2308
+ readOperations: string[];
2309
+ writeOperations: string[];
2310
+ pendingApprovals: number;
2311
+ availableTools: string[];
2312
+ };
2313
+ createdAt: string;
2314
+ conflicts?: {
2315
+ message: string;
2316
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2317
+ suggestion?: string | undefined;
2318
+ }[] | undefined;
2319
+ replanContext?: {
2320
+ previousPlanId: string;
2321
+ replanReason: string;
2322
+ preservedSteps: number[];
2323
+ } | undefined;
2324
+ };
2325
+ replanReason?: string | undefined;
2326
+ dryRun?: boolean | undefined;
2327
+ }, {
2328
+ requiresApproval: boolean;
2329
+ plan: {
2330
+ planId: string;
2331
+ version: number;
2332
+ isExecutable: boolean;
2333
+ autoExecutable: boolean;
2334
+ userSummary: {
2335
+ description: string;
2336
+ title: string;
2337
+ steps: {
2338
+ number: number;
2339
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2340
+ description: string;
2341
+ requiresApproval: boolean;
2342
+ }[];
2343
+ warnings?: string[] | undefined;
2344
+ };
2345
+ executionSchema: {
2346
+ steps: {
2347
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2348
+ description: string;
2349
+ stepNumber: number;
2350
+ operationType: "read" | "write";
2351
+ requiresUserApproval: boolean;
2352
+ dependsOn: number[];
2353
+ executionInstructions: {
2354
+ objective: string;
2355
+ inputSource: Record<string, string>;
2356
+ expectedOutput: string;
2357
+ errorHandling: string;
2358
+ constraints?: string[] | undefined;
2359
+ };
2360
+ result?: unknown;
2361
+ toolName?: string | undefined;
2362
+ }[];
2363
+ complexity: "low" | "medium" | "high";
2364
+ recommendedModel: string;
2365
+ toolSequence: string[];
2366
+ readOperations: string[];
2367
+ writeOperations: string[];
2368
+ pendingApprovals: number;
2369
+ availableTools: string[];
2370
+ };
2371
+ createdAt: string;
2372
+ conflicts?: {
2373
+ message: string;
2374
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2375
+ suggestion?: string | undefined;
2376
+ }[] | undefined;
2377
+ replanContext?: {
2378
+ previousPlanId: string;
2379
+ replanReason: string;
2380
+ preservedSteps: number[];
2381
+ } | undefined;
2382
+ };
2383
+ replanReason?: string | undefined;
2384
+ dryRun?: boolean | undefined;
2385
+ }>>;
1435
2386
  }, "strip", z.ZodTypeAny, {
1436
2387
  type: "result";
1437
2388
  status: 200;
@@ -1516,6 +2467,65 @@ export declare const resultEventDataSchema: z.ZodObject<{
1516
2467
  details?: unknown;
1517
2468
  };
1518
2469
  }[] | undefined;
2470
+ planning?: {
2471
+ requiresApproval: boolean;
2472
+ plan: {
2473
+ planId: string;
2474
+ version: number;
2475
+ isExecutable: boolean;
2476
+ autoExecutable: boolean;
2477
+ userSummary: {
2478
+ description: string;
2479
+ title: string;
2480
+ steps: {
2481
+ number: number;
2482
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2483
+ description: string;
2484
+ requiresApproval: boolean;
2485
+ }[];
2486
+ warnings?: string[] | undefined;
2487
+ };
2488
+ executionSchema: {
2489
+ steps: {
2490
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2491
+ description: string;
2492
+ stepNumber: number;
2493
+ operationType: "read" | "write";
2494
+ requiresUserApproval: boolean;
2495
+ dependsOn: number[];
2496
+ executionInstructions: {
2497
+ objective: string;
2498
+ inputSource: Record<string, string>;
2499
+ expectedOutput: string;
2500
+ errorHandling: string;
2501
+ constraints?: string[] | undefined;
2502
+ };
2503
+ result?: unknown;
2504
+ toolName?: string | undefined;
2505
+ }[];
2506
+ complexity: "low" | "medium" | "high";
2507
+ recommendedModel: string;
2508
+ toolSequence: string[];
2509
+ readOperations: string[];
2510
+ writeOperations: string[];
2511
+ pendingApprovals: number;
2512
+ availableTools: string[];
2513
+ };
2514
+ createdAt: string;
2515
+ conflicts?: {
2516
+ message: string;
2517
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2518
+ suggestion?: string | undefined;
2519
+ }[] | undefined;
2520
+ replanContext?: {
2521
+ previousPlanId: string;
2522
+ replanReason: string;
2523
+ preservedSteps: number[];
2524
+ } | undefined;
2525
+ };
2526
+ replanReason?: string | undefined;
2527
+ dryRun?: boolean | undefined;
2528
+ } | undefined;
1519
2529
  }, {
1520
2530
  type: "result";
1521
2531
  status: 200;
@@ -1600,6 +2610,65 @@ export declare const resultEventDataSchema: z.ZodObject<{
1600
2610
  details?: unknown;
1601
2611
  };
1602
2612
  }[] | undefined;
2613
+ planning?: {
2614
+ requiresApproval: boolean;
2615
+ plan: {
2616
+ planId: string;
2617
+ version: number;
2618
+ isExecutable: boolean;
2619
+ autoExecutable: boolean;
2620
+ userSummary: {
2621
+ description: string;
2622
+ title: string;
2623
+ steps: {
2624
+ number: number;
2625
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2626
+ description: string;
2627
+ requiresApproval: boolean;
2628
+ }[];
2629
+ warnings?: string[] | undefined;
2630
+ };
2631
+ executionSchema: {
2632
+ steps: {
2633
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
2634
+ description: string;
2635
+ stepNumber: number;
2636
+ operationType: "read" | "write";
2637
+ requiresUserApproval: boolean;
2638
+ dependsOn: number[];
2639
+ executionInstructions: {
2640
+ objective: string;
2641
+ inputSource: Record<string, string>;
2642
+ expectedOutput: string;
2643
+ errorHandling: string;
2644
+ constraints?: string[] | undefined;
2645
+ };
2646
+ result?: unknown;
2647
+ toolName?: string | undefined;
2648
+ }[];
2649
+ complexity: "low" | "medium" | "high";
2650
+ recommendedModel: string;
2651
+ toolSequence: string[];
2652
+ readOperations: string[];
2653
+ writeOperations: string[];
2654
+ pendingApprovals: number;
2655
+ availableTools: string[];
2656
+ };
2657
+ createdAt: string;
2658
+ conflicts?: {
2659
+ message: string;
2660
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
2661
+ suggestion?: string | undefined;
2662
+ }[] | undefined;
2663
+ replanContext?: {
2664
+ previousPlanId: string;
2665
+ replanReason: string;
2666
+ preservedSteps: number[];
2667
+ } | undefined;
2668
+ };
2669
+ replanReason?: string | undefined;
2670
+ dryRun?: boolean | undefined;
2671
+ } | undefined;
1603
2672
  }>;
1604
2673
  /**
1605
2674
  * Schema for validating error events from the streaming endpoint
@@ -2203,6 +3272,427 @@ export declare const streamEventDataSchema: z.ZodDiscriminatedUnion<"type", [z.Z
2203
3272
  };
2204
3273
  }>, "many">>;
2205
3274
  requestId: z.ZodString;
3275
+ planning: z.ZodOptional<z.ZodObject<{
3276
+ plan: z.ZodObject<{
3277
+ planId: z.ZodString;
3278
+ version: z.ZodNumber;
3279
+ isExecutable: z.ZodBoolean;
3280
+ autoExecutable: z.ZodBoolean;
3281
+ userSummary: z.ZodObject<{
3282
+ title: z.ZodString;
3283
+ description: z.ZodString;
3284
+ steps: z.ZodArray<z.ZodObject<{
3285
+ number: z.ZodNumber;
3286
+ description: z.ZodString;
3287
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed", "skipped"]>;
3288
+ requiresApproval: z.ZodBoolean;
3289
+ }, "strict", z.ZodTypeAny, {
3290
+ number: number;
3291
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3292
+ description: string;
3293
+ requiresApproval: boolean;
3294
+ }, {
3295
+ number: number;
3296
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3297
+ description: string;
3298
+ requiresApproval: boolean;
3299
+ }>, "many">;
3300
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3301
+ }, "strict", z.ZodTypeAny, {
3302
+ description: string;
3303
+ title: string;
3304
+ steps: {
3305
+ number: number;
3306
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3307
+ description: string;
3308
+ requiresApproval: boolean;
3309
+ }[];
3310
+ warnings?: string[] | undefined;
3311
+ }, {
3312
+ description: string;
3313
+ title: string;
3314
+ steps: {
3315
+ number: number;
3316
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3317
+ description: string;
3318
+ requiresApproval: boolean;
3319
+ }[];
3320
+ warnings?: string[] | undefined;
3321
+ }>;
3322
+ executionSchema: z.ZodObject<{
3323
+ steps: z.ZodArray<z.ZodObject<{
3324
+ stepNumber: z.ZodNumber;
3325
+ description: z.ZodString;
3326
+ operationType: z.ZodEnum<["read", "write"]>;
3327
+ requiresUserApproval: z.ZodBoolean;
3328
+ dependsOn: z.ZodArray<z.ZodNumber, "many">;
3329
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed", "skipped"]>;
3330
+ result: z.ZodOptional<z.ZodUnknown>;
3331
+ toolName: z.ZodOptional<z.ZodString>;
3332
+ executionInstructions: z.ZodObject<{
3333
+ objective: z.ZodString;
3334
+ inputSource: z.ZodRecord<z.ZodString, z.ZodString>;
3335
+ expectedOutput: z.ZodString;
3336
+ errorHandling: z.ZodString;
3337
+ constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3338
+ }, "strict", z.ZodTypeAny, {
3339
+ objective: string;
3340
+ inputSource: Record<string, string>;
3341
+ expectedOutput: string;
3342
+ errorHandling: string;
3343
+ constraints?: string[] | undefined;
3344
+ }, {
3345
+ objective: string;
3346
+ inputSource: Record<string, string>;
3347
+ expectedOutput: string;
3348
+ errorHandling: string;
3349
+ constraints?: string[] | undefined;
3350
+ }>;
3351
+ }, "strict", z.ZodTypeAny, {
3352
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3353
+ description: string;
3354
+ stepNumber: number;
3355
+ operationType: "read" | "write";
3356
+ requiresUserApproval: boolean;
3357
+ dependsOn: number[];
3358
+ executionInstructions: {
3359
+ objective: string;
3360
+ inputSource: Record<string, string>;
3361
+ expectedOutput: string;
3362
+ errorHandling: string;
3363
+ constraints?: string[] | undefined;
3364
+ };
3365
+ result?: unknown;
3366
+ toolName?: string | undefined;
3367
+ }, {
3368
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3369
+ description: string;
3370
+ stepNumber: number;
3371
+ operationType: "read" | "write";
3372
+ requiresUserApproval: boolean;
3373
+ dependsOn: number[];
3374
+ executionInstructions: {
3375
+ objective: string;
3376
+ inputSource: Record<string, string>;
3377
+ expectedOutput: string;
3378
+ errorHandling: string;
3379
+ constraints?: string[] | undefined;
3380
+ };
3381
+ result?: unknown;
3382
+ toolName?: string | undefined;
3383
+ }>, "many">;
3384
+ complexity: z.ZodEnum<["low", "medium", "high"]>;
3385
+ recommendedModel: z.ZodString;
3386
+ toolSequence: z.ZodArray<z.ZodString, "many">;
3387
+ readOperations: z.ZodArray<z.ZodString, "many">;
3388
+ writeOperations: z.ZodArray<z.ZodString, "many">;
3389
+ pendingApprovals: z.ZodNumber;
3390
+ availableTools: z.ZodArray<z.ZodString, "many">;
3391
+ }, "strict", z.ZodTypeAny, {
3392
+ steps: {
3393
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3394
+ description: string;
3395
+ stepNumber: number;
3396
+ operationType: "read" | "write";
3397
+ requiresUserApproval: boolean;
3398
+ dependsOn: number[];
3399
+ executionInstructions: {
3400
+ objective: string;
3401
+ inputSource: Record<string, string>;
3402
+ expectedOutput: string;
3403
+ errorHandling: string;
3404
+ constraints?: string[] | undefined;
3405
+ };
3406
+ result?: unknown;
3407
+ toolName?: string | undefined;
3408
+ }[];
3409
+ complexity: "low" | "medium" | "high";
3410
+ recommendedModel: string;
3411
+ toolSequence: string[];
3412
+ readOperations: string[];
3413
+ writeOperations: string[];
3414
+ pendingApprovals: number;
3415
+ availableTools: string[];
3416
+ }, {
3417
+ steps: {
3418
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3419
+ description: string;
3420
+ stepNumber: number;
3421
+ operationType: "read" | "write";
3422
+ requiresUserApproval: boolean;
3423
+ dependsOn: number[];
3424
+ executionInstructions: {
3425
+ objective: string;
3426
+ inputSource: Record<string, string>;
3427
+ expectedOutput: string;
3428
+ errorHandling: string;
3429
+ constraints?: string[] | undefined;
3430
+ };
3431
+ result?: unknown;
3432
+ toolName?: string | undefined;
3433
+ }[];
3434
+ complexity: "low" | "medium" | "high";
3435
+ recommendedModel: string;
3436
+ toolSequence: string[];
3437
+ readOperations: string[];
3438
+ writeOperations: string[];
3439
+ pendingApprovals: number;
3440
+ availableTools: string[];
3441
+ }>;
3442
+ conflicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
3443
+ type: z.ZodEnum<["conflicting_intent", "impossible_task", "missing_tool", "missing_context", "unsupported_operation"]>;
3444
+ message: z.ZodString;
3445
+ suggestion: z.ZodOptional<z.ZodString>;
3446
+ }, "strict", z.ZodTypeAny, {
3447
+ message: string;
3448
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3449
+ suggestion?: string | undefined;
3450
+ }, {
3451
+ message: string;
3452
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3453
+ suggestion?: string | undefined;
3454
+ }>, "many">>;
3455
+ replanContext: z.ZodOptional<z.ZodObject<{
3456
+ previousPlanId: z.ZodString;
3457
+ replanReason: z.ZodString;
3458
+ preservedSteps: z.ZodArray<z.ZodNumber, "many">;
3459
+ }, "strict", z.ZodTypeAny, {
3460
+ previousPlanId: string;
3461
+ replanReason: string;
3462
+ preservedSteps: number[];
3463
+ }, {
3464
+ previousPlanId: string;
3465
+ replanReason: string;
3466
+ preservedSteps: number[];
3467
+ }>>;
3468
+ createdAt: z.ZodString;
3469
+ }, "strict", z.ZodTypeAny, {
3470
+ planId: string;
3471
+ version: number;
3472
+ isExecutable: boolean;
3473
+ autoExecutable: boolean;
3474
+ userSummary: {
3475
+ description: string;
3476
+ title: string;
3477
+ steps: {
3478
+ number: number;
3479
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3480
+ description: string;
3481
+ requiresApproval: boolean;
3482
+ }[];
3483
+ warnings?: string[] | undefined;
3484
+ };
3485
+ executionSchema: {
3486
+ steps: {
3487
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3488
+ description: string;
3489
+ stepNumber: number;
3490
+ operationType: "read" | "write";
3491
+ requiresUserApproval: boolean;
3492
+ dependsOn: number[];
3493
+ executionInstructions: {
3494
+ objective: string;
3495
+ inputSource: Record<string, string>;
3496
+ expectedOutput: string;
3497
+ errorHandling: string;
3498
+ constraints?: string[] | undefined;
3499
+ };
3500
+ result?: unknown;
3501
+ toolName?: string | undefined;
3502
+ }[];
3503
+ complexity: "low" | "medium" | "high";
3504
+ recommendedModel: string;
3505
+ toolSequence: string[];
3506
+ readOperations: string[];
3507
+ writeOperations: string[];
3508
+ pendingApprovals: number;
3509
+ availableTools: string[];
3510
+ };
3511
+ createdAt: string;
3512
+ conflicts?: {
3513
+ message: string;
3514
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3515
+ suggestion?: string | undefined;
3516
+ }[] | undefined;
3517
+ replanContext?: {
3518
+ previousPlanId: string;
3519
+ replanReason: string;
3520
+ preservedSteps: number[];
3521
+ } | undefined;
3522
+ }, {
3523
+ planId: string;
3524
+ version: number;
3525
+ isExecutable: boolean;
3526
+ autoExecutable: boolean;
3527
+ userSummary: {
3528
+ description: string;
3529
+ title: string;
3530
+ steps: {
3531
+ number: number;
3532
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3533
+ description: string;
3534
+ requiresApproval: boolean;
3535
+ }[];
3536
+ warnings?: string[] | undefined;
3537
+ };
3538
+ executionSchema: {
3539
+ steps: {
3540
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3541
+ description: string;
3542
+ stepNumber: number;
3543
+ operationType: "read" | "write";
3544
+ requiresUserApproval: boolean;
3545
+ dependsOn: number[];
3546
+ executionInstructions: {
3547
+ objective: string;
3548
+ inputSource: Record<string, string>;
3549
+ expectedOutput: string;
3550
+ errorHandling: string;
3551
+ constraints?: string[] | undefined;
3552
+ };
3553
+ result?: unknown;
3554
+ toolName?: string | undefined;
3555
+ }[];
3556
+ complexity: "low" | "medium" | "high";
3557
+ recommendedModel: string;
3558
+ toolSequence: string[];
3559
+ readOperations: string[];
3560
+ writeOperations: string[];
3561
+ pendingApprovals: number;
3562
+ availableTools: string[];
3563
+ };
3564
+ createdAt: string;
3565
+ conflicts?: {
3566
+ message: string;
3567
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3568
+ suggestion?: string | undefined;
3569
+ }[] | undefined;
3570
+ replanContext?: {
3571
+ previousPlanId: string;
3572
+ replanReason: string;
3573
+ preservedSteps: number[];
3574
+ } | undefined;
3575
+ }>;
3576
+ requiresApproval: z.ZodBoolean;
3577
+ replanReason: z.ZodOptional<z.ZodString>;
3578
+ dryRun: z.ZodOptional<z.ZodBoolean>;
3579
+ }, "strip", z.ZodTypeAny, {
3580
+ requiresApproval: boolean;
3581
+ plan: {
3582
+ planId: string;
3583
+ version: number;
3584
+ isExecutable: boolean;
3585
+ autoExecutable: boolean;
3586
+ userSummary: {
3587
+ description: string;
3588
+ title: string;
3589
+ steps: {
3590
+ number: number;
3591
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3592
+ description: string;
3593
+ requiresApproval: boolean;
3594
+ }[];
3595
+ warnings?: string[] | undefined;
3596
+ };
3597
+ executionSchema: {
3598
+ steps: {
3599
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3600
+ description: string;
3601
+ stepNumber: number;
3602
+ operationType: "read" | "write";
3603
+ requiresUserApproval: boolean;
3604
+ dependsOn: number[];
3605
+ executionInstructions: {
3606
+ objective: string;
3607
+ inputSource: Record<string, string>;
3608
+ expectedOutput: string;
3609
+ errorHandling: string;
3610
+ constraints?: string[] | undefined;
3611
+ };
3612
+ result?: unknown;
3613
+ toolName?: string | undefined;
3614
+ }[];
3615
+ complexity: "low" | "medium" | "high";
3616
+ recommendedModel: string;
3617
+ toolSequence: string[];
3618
+ readOperations: string[];
3619
+ writeOperations: string[];
3620
+ pendingApprovals: number;
3621
+ availableTools: string[];
3622
+ };
3623
+ createdAt: string;
3624
+ conflicts?: {
3625
+ message: string;
3626
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3627
+ suggestion?: string | undefined;
3628
+ }[] | undefined;
3629
+ replanContext?: {
3630
+ previousPlanId: string;
3631
+ replanReason: string;
3632
+ preservedSteps: number[];
3633
+ } | undefined;
3634
+ };
3635
+ replanReason?: string | undefined;
3636
+ dryRun?: boolean | undefined;
3637
+ }, {
3638
+ requiresApproval: boolean;
3639
+ plan: {
3640
+ planId: string;
3641
+ version: number;
3642
+ isExecutable: boolean;
3643
+ autoExecutable: boolean;
3644
+ userSummary: {
3645
+ description: string;
3646
+ title: string;
3647
+ steps: {
3648
+ number: number;
3649
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3650
+ description: string;
3651
+ requiresApproval: boolean;
3652
+ }[];
3653
+ warnings?: string[] | undefined;
3654
+ };
3655
+ executionSchema: {
3656
+ steps: {
3657
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3658
+ description: string;
3659
+ stepNumber: number;
3660
+ operationType: "read" | "write";
3661
+ requiresUserApproval: boolean;
3662
+ dependsOn: number[];
3663
+ executionInstructions: {
3664
+ objective: string;
3665
+ inputSource: Record<string, string>;
3666
+ expectedOutput: string;
3667
+ errorHandling: string;
3668
+ constraints?: string[] | undefined;
3669
+ };
3670
+ result?: unknown;
3671
+ toolName?: string | undefined;
3672
+ }[];
3673
+ complexity: "low" | "medium" | "high";
3674
+ recommendedModel: string;
3675
+ toolSequence: string[];
3676
+ readOperations: string[];
3677
+ writeOperations: string[];
3678
+ pendingApprovals: number;
3679
+ availableTools: string[];
3680
+ };
3681
+ createdAt: string;
3682
+ conflicts?: {
3683
+ message: string;
3684
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3685
+ suggestion?: string | undefined;
3686
+ }[] | undefined;
3687
+ replanContext?: {
3688
+ previousPlanId: string;
3689
+ replanReason: string;
3690
+ preservedSteps: number[];
3691
+ } | undefined;
3692
+ };
3693
+ replanReason?: string | undefined;
3694
+ dryRun?: boolean | undefined;
3695
+ }>>;
2206
3696
  }, "strip", z.ZodTypeAny, {
2207
3697
  type: "result";
2208
3698
  status: 200;
@@ -2287,6 +3777,65 @@ export declare const streamEventDataSchema: z.ZodDiscriminatedUnion<"type", [z.Z
2287
3777
  details?: unknown;
2288
3778
  };
2289
3779
  }[] | undefined;
3780
+ planning?: {
3781
+ requiresApproval: boolean;
3782
+ plan: {
3783
+ planId: string;
3784
+ version: number;
3785
+ isExecutable: boolean;
3786
+ autoExecutable: boolean;
3787
+ userSummary: {
3788
+ description: string;
3789
+ title: string;
3790
+ steps: {
3791
+ number: number;
3792
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3793
+ description: string;
3794
+ requiresApproval: boolean;
3795
+ }[];
3796
+ warnings?: string[] | undefined;
3797
+ };
3798
+ executionSchema: {
3799
+ steps: {
3800
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3801
+ description: string;
3802
+ stepNumber: number;
3803
+ operationType: "read" | "write";
3804
+ requiresUserApproval: boolean;
3805
+ dependsOn: number[];
3806
+ executionInstructions: {
3807
+ objective: string;
3808
+ inputSource: Record<string, string>;
3809
+ expectedOutput: string;
3810
+ errorHandling: string;
3811
+ constraints?: string[] | undefined;
3812
+ };
3813
+ result?: unknown;
3814
+ toolName?: string | undefined;
3815
+ }[];
3816
+ complexity: "low" | "medium" | "high";
3817
+ recommendedModel: string;
3818
+ toolSequence: string[];
3819
+ readOperations: string[];
3820
+ writeOperations: string[];
3821
+ pendingApprovals: number;
3822
+ availableTools: string[];
3823
+ };
3824
+ createdAt: string;
3825
+ conflicts?: {
3826
+ message: string;
3827
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3828
+ suggestion?: string | undefined;
3829
+ }[] | undefined;
3830
+ replanContext?: {
3831
+ previousPlanId: string;
3832
+ replanReason: string;
3833
+ preservedSteps: number[];
3834
+ } | undefined;
3835
+ };
3836
+ replanReason?: string | undefined;
3837
+ dryRun?: boolean | undefined;
3838
+ } | undefined;
2290
3839
  }, {
2291
3840
  type: "result";
2292
3841
  status: 200;
@@ -2371,6 +3920,65 @@ export declare const streamEventDataSchema: z.ZodDiscriminatedUnion<"type", [z.Z
2371
3920
  details?: unknown;
2372
3921
  };
2373
3922
  }[] | undefined;
3923
+ planning?: {
3924
+ requiresApproval: boolean;
3925
+ plan: {
3926
+ planId: string;
3927
+ version: number;
3928
+ isExecutable: boolean;
3929
+ autoExecutable: boolean;
3930
+ userSummary: {
3931
+ description: string;
3932
+ title: string;
3933
+ steps: {
3934
+ number: number;
3935
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3936
+ description: string;
3937
+ requiresApproval: boolean;
3938
+ }[];
3939
+ warnings?: string[] | undefined;
3940
+ };
3941
+ executionSchema: {
3942
+ steps: {
3943
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
3944
+ description: string;
3945
+ stepNumber: number;
3946
+ operationType: "read" | "write";
3947
+ requiresUserApproval: boolean;
3948
+ dependsOn: number[];
3949
+ executionInstructions: {
3950
+ objective: string;
3951
+ inputSource: Record<string, string>;
3952
+ expectedOutput: string;
3953
+ errorHandling: string;
3954
+ constraints?: string[] | undefined;
3955
+ };
3956
+ result?: unknown;
3957
+ toolName?: string | undefined;
3958
+ }[];
3959
+ complexity: "low" | "medium" | "high";
3960
+ recommendedModel: string;
3961
+ toolSequence: string[];
3962
+ readOperations: string[];
3963
+ writeOperations: string[];
3964
+ pendingApprovals: number;
3965
+ availableTools: string[];
3966
+ };
3967
+ createdAt: string;
3968
+ conflicts?: {
3969
+ message: string;
3970
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
3971
+ suggestion?: string | undefined;
3972
+ }[] | undefined;
3973
+ replanContext?: {
3974
+ previousPlanId: string;
3975
+ replanReason: string;
3976
+ preservedSteps: number[];
3977
+ } | undefined;
3978
+ };
3979
+ replanReason?: string | undefined;
3980
+ dryRun?: boolean | undefined;
3981
+ } | undefined;
2374
3982
  }>, z.ZodObject<{
2375
3983
  type: z.ZodLiteral<"error">;
2376
3984
  requestId: z.ZodString;