@illalabs/interfaces 0.3.0 → 0.4.0-canary-beta-52713059

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.
@@ -1,6 +1,7 @@
1
1
  import type { ChatError } from "../../errors/endpoints/chat/index.js";
2
2
  import type { IllaToolErrorJSON } from "../../internal.js";
3
3
  import type { MessageHistoryType, PendingToolCallType } from "../../types/messages.js";
4
+ import type { ExecutionPlan } from "../../types/planning.js";
4
5
  import type { BaseApiSuccessResponse } from "../base.js";
5
6
  /**
6
7
  * Success response for chat endpoint
@@ -12,6 +13,13 @@ export interface CoreApiChatSuccessResponse extends BaseApiSuccessResponse {
12
13
  readonly toolErrors?: ReadonlyArray<IllaToolErrorJSON>;
13
14
  /** Request ID for subscribing to telemetry events */
14
15
  readonly requestId?: string;
16
+ /** Planning agent output, present when the request involved plan generation or execution */
17
+ readonly planning?: {
18
+ readonly plan: ExecutionPlan;
19
+ readonly requiresApproval: boolean;
20
+ readonly replanReason?: string;
21
+ readonly dryRun?: boolean;
22
+ };
15
23
  }
16
24
  /**
17
25
  * Union type of all possible chat error responses
@@ -1 +1 @@
1
- {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/interfaces/chat/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACtE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAA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AAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACL;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC"}
@@ -195,6 +195,326 @@ export declare const ChatContextSchema: z.ZodObject<Pick<{
195
195
  channel: "text" | "voice";
196
196
  }>>>;
197
197
  requestId: z.ZodOptional<z.ZodString>;
198
+ agentPlanningConfig: z.ZodOptional<z.ZodObject<{
199
+ enabled: z.ZodOptional<z.ZodBoolean>;
200
+ cacheEnabled: z.ZodOptional<z.ZodBoolean>;
201
+ cacheTTL: z.ZodOptional<z.ZodNumber>;
202
+ forceRefresh: z.ZodOptional<z.ZodBoolean>;
203
+ planningModel: z.ZodOptional<z.ZodString>;
204
+ }, "strict", z.ZodTypeAny, {
205
+ enabled?: boolean | undefined;
206
+ cacheEnabled?: boolean | undefined;
207
+ cacheTTL?: number | undefined;
208
+ forceRefresh?: boolean | undefined;
209
+ planningModel?: string | undefined;
210
+ }, {
211
+ enabled?: boolean | undefined;
212
+ cacheEnabled?: boolean | undefined;
213
+ cacheTTL?: number | undefined;
214
+ forceRefresh?: boolean | undefined;
215
+ planningModel?: string | undefined;
216
+ }>>;
217
+ acceptedPlan: z.ZodOptional<z.ZodObject<{
218
+ planId: z.ZodString;
219
+ version: z.ZodNumber;
220
+ isExecutable: z.ZodBoolean;
221
+ autoExecutable: z.ZodBoolean;
222
+ userSummary: z.ZodObject<{
223
+ title: z.ZodString;
224
+ description: z.ZodString;
225
+ steps: z.ZodArray<z.ZodObject<{
226
+ number: z.ZodNumber;
227
+ description: z.ZodString;
228
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed", "skipped"]>;
229
+ requiresApproval: z.ZodBoolean;
230
+ }, "strict", z.ZodTypeAny, {
231
+ number: number;
232
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
233
+ description: string;
234
+ requiresApproval: boolean;
235
+ }, {
236
+ number: number;
237
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
238
+ description: string;
239
+ requiresApproval: boolean;
240
+ }>, "many">;
241
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
242
+ }, "strict", z.ZodTypeAny, {
243
+ description: string;
244
+ title: string;
245
+ steps: {
246
+ number: number;
247
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
248
+ description: string;
249
+ requiresApproval: boolean;
250
+ }[];
251
+ warnings?: string[] | undefined;
252
+ }, {
253
+ description: string;
254
+ title: string;
255
+ steps: {
256
+ number: number;
257
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
258
+ description: string;
259
+ requiresApproval: boolean;
260
+ }[];
261
+ warnings?: string[] | undefined;
262
+ }>;
263
+ executionSchema: z.ZodObject<{
264
+ steps: z.ZodArray<z.ZodObject<{
265
+ stepNumber: z.ZodNumber;
266
+ description: z.ZodString;
267
+ operationType: z.ZodEnum<["read", "write"]>;
268
+ requiresUserApproval: z.ZodBoolean;
269
+ dependsOn: z.ZodArray<z.ZodNumber, "many">;
270
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed", "skipped"]>;
271
+ result: z.ZodOptional<z.ZodUnknown>;
272
+ toolName: z.ZodOptional<z.ZodString>;
273
+ executionInstructions: z.ZodObject<{
274
+ objective: z.ZodString;
275
+ inputSource: z.ZodRecord<z.ZodString, z.ZodString>;
276
+ expectedOutput: z.ZodString;
277
+ errorHandling: z.ZodString;
278
+ constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
279
+ }, "strict", z.ZodTypeAny, {
280
+ objective: string;
281
+ inputSource: Record<string, string>;
282
+ expectedOutput: string;
283
+ errorHandling: string;
284
+ constraints?: string[] | undefined;
285
+ }, {
286
+ objective: string;
287
+ inputSource: Record<string, string>;
288
+ expectedOutput: string;
289
+ errorHandling: string;
290
+ constraints?: string[] | undefined;
291
+ }>;
292
+ }, "strict", z.ZodTypeAny, {
293
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
294
+ description: string;
295
+ stepNumber: number;
296
+ operationType: "read" | "write";
297
+ requiresUserApproval: boolean;
298
+ dependsOn: number[];
299
+ executionInstructions: {
300
+ objective: string;
301
+ inputSource: Record<string, string>;
302
+ expectedOutput: string;
303
+ errorHandling: string;
304
+ constraints?: string[] | undefined;
305
+ };
306
+ result?: unknown;
307
+ toolName?: string | undefined;
308
+ }, {
309
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
310
+ description: string;
311
+ stepNumber: number;
312
+ operationType: "read" | "write";
313
+ requiresUserApproval: boolean;
314
+ dependsOn: number[];
315
+ executionInstructions: {
316
+ objective: string;
317
+ inputSource: Record<string, string>;
318
+ expectedOutput: string;
319
+ errorHandling: string;
320
+ constraints?: string[] | undefined;
321
+ };
322
+ result?: unknown;
323
+ toolName?: string | undefined;
324
+ }>, "many">;
325
+ complexity: z.ZodEnum<["low", "medium", "high"]>;
326
+ recommendedModel: z.ZodString;
327
+ toolSequence: z.ZodArray<z.ZodString, "many">;
328
+ readOperations: z.ZodArray<z.ZodString, "many">;
329
+ writeOperations: z.ZodArray<z.ZodString, "many">;
330
+ pendingApprovals: z.ZodNumber;
331
+ availableTools: z.ZodArray<z.ZodString, "many">;
332
+ }, "strict", z.ZodTypeAny, {
333
+ steps: {
334
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
335
+ description: string;
336
+ stepNumber: number;
337
+ operationType: "read" | "write";
338
+ requiresUserApproval: boolean;
339
+ dependsOn: number[];
340
+ executionInstructions: {
341
+ objective: string;
342
+ inputSource: Record<string, string>;
343
+ expectedOutput: string;
344
+ errorHandling: string;
345
+ constraints?: string[] | undefined;
346
+ };
347
+ result?: unknown;
348
+ toolName?: string | undefined;
349
+ }[];
350
+ complexity: "low" | "medium" | "high";
351
+ recommendedModel: string;
352
+ toolSequence: string[];
353
+ readOperations: string[];
354
+ writeOperations: string[];
355
+ pendingApprovals: number;
356
+ availableTools: string[];
357
+ }, {
358
+ steps: {
359
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
360
+ description: string;
361
+ stepNumber: number;
362
+ operationType: "read" | "write";
363
+ requiresUserApproval: boolean;
364
+ dependsOn: number[];
365
+ executionInstructions: {
366
+ objective: string;
367
+ inputSource: Record<string, string>;
368
+ expectedOutput: string;
369
+ errorHandling: string;
370
+ constraints?: string[] | undefined;
371
+ };
372
+ result?: unknown;
373
+ toolName?: string | undefined;
374
+ }[];
375
+ complexity: "low" | "medium" | "high";
376
+ recommendedModel: string;
377
+ toolSequence: string[];
378
+ readOperations: string[];
379
+ writeOperations: string[];
380
+ pendingApprovals: number;
381
+ availableTools: string[];
382
+ }>;
383
+ conflicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
384
+ type: z.ZodEnum<["conflicting_intent", "impossible_task", "missing_tool", "missing_context", "unsupported_operation"]>;
385
+ message: z.ZodString;
386
+ suggestion: z.ZodOptional<z.ZodString>;
387
+ }, "strict", z.ZodTypeAny, {
388
+ message: string;
389
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
390
+ suggestion?: string | undefined;
391
+ }, {
392
+ message: string;
393
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
394
+ suggestion?: string | undefined;
395
+ }>, "many">>;
396
+ replanContext: z.ZodOptional<z.ZodObject<{
397
+ previousPlanId: z.ZodString;
398
+ replanReason: z.ZodString;
399
+ preservedSteps: z.ZodArray<z.ZodNumber, "many">;
400
+ }, "strict", z.ZodTypeAny, {
401
+ previousPlanId: string;
402
+ replanReason: string;
403
+ preservedSteps: number[];
404
+ }, {
405
+ previousPlanId: string;
406
+ replanReason: string;
407
+ preservedSteps: number[];
408
+ }>>;
409
+ createdAt: z.ZodString;
410
+ }, "strict", z.ZodTypeAny, {
411
+ planId: string;
412
+ version: number;
413
+ isExecutable: boolean;
414
+ autoExecutable: boolean;
415
+ userSummary: {
416
+ description: string;
417
+ title: string;
418
+ steps: {
419
+ number: number;
420
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
421
+ description: string;
422
+ requiresApproval: boolean;
423
+ }[];
424
+ warnings?: string[] | undefined;
425
+ };
426
+ executionSchema: {
427
+ steps: {
428
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
429
+ description: string;
430
+ stepNumber: number;
431
+ operationType: "read" | "write";
432
+ requiresUserApproval: boolean;
433
+ dependsOn: number[];
434
+ executionInstructions: {
435
+ objective: string;
436
+ inputSource: Record<string, string>;
437
+ expectedOutput: string;
438
+ errorHandling: string;
439
+ constraints?: string[] | undefined;
440
+ };
441
+ result?: unknown;
442
+ toolName?: string | undefined;
443
+ }[];
444
+ complexity: "low" | "medium" | "high";
445
+ recommendedModel: string;
446
+ toolSequence: string[];
447
+ readOperations: string[];
448
+ writeOperations: string[];
449
+ pendingApprovals: number;
450
+ availableTools: string[];
451
+ };
452
+ createdAt: string;
453
+ conflicts?: {
454
+ message: string;
455
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
456
+ suggestion?: string | undefined;
457
+ }[] | undefined;
458
+ replanContext?: {
459
+ previousPlanId: string;
460
+ replanReason: string;
461
+ preservedSteps: number[];
462
+ } | undefined;
463
+ }, {
464
+ planId: string;
465
+ version: number;
466
+ isExecutable: boolean;
467
+ autoExecutable: boolean;
468
+ userSummary: {
469
+ description: string;
470
+ title: string;
471
+ steps: {
472
+ number: number;
473
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
474
+ description: string;
475
+ requiresApproval: boolean;
476
+ }[];
477
+ warnings?: string[] | undefined;
478
+ };
479
+ executionSchema: {
480
+ steps: {
481
+ status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
482
+ description: string;
483
+ stepNumber: number;
484
+ operationType: "read" | "write";
485
+ requiresUserApproval: boolean;
486
+ dependsOn: number[];
487
+ executionInstructions: {
488
+ objective: string;
489
+ inputSource: Record<string, string>;
490
+ expectedOutput: string;
491
+ errorHandling: string;
492
+ constraints?: string[] | undefined;
493
+ };
494
+ result?: unknown;
495
+ toolName?: string | undefined;
496
+ }[];
497
+ complexity: "low" | "medium" | "high";
498
+ recommendedModel: string;
499
+ toolSequence: string[];
500
+ readOperations: string[];
501
+ writeOperations: string[];
502
+ pendingApprovals: number;
503
+ availableTools: string[];
504
+ };
505
+ createdAt: string;
506
+ conflicts?: {
507
+ message: string;
508
+ type: "conflicting_intent" | "impossible_task" | "missing_tool" | "missing_context" | "unsupported_operation";
509
+ suggestion?: string | undefined;
510
+ }[] | undefined;
511
+ replanContext?: {
512
+ previousPlanId: string;
513
+ replanReason: string;
514
+ preservedSteps: number[];
515
+ } | undefined;
516
+ }>>;
517
+ dryRun: z.ZodOptional<z.ZodBoolean>;
198
518
  }, "messages"> & {
199
519
  toolsConfig: z.ZodObject<{
200
520
  autoRouter: z.ZodOptional<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"chatContext.d.ts","sourceRoot":"","sources":["../../src/schemas/chatContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI7B,CAAC"}
1
+ {"version":3,"file":"chatContext.d.ts","sourceRoot":"","sources":["../../src/schemas/chatContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAA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