@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.
- package/dist/interfaces/chat/response.d.ts +8 -0
- package/dist/interfaces/chat/response.d.ts.map +1 -1
- package/dist/schemas/chatContext.d.ts +320 -0
- package/dist/schemas/chatContext.d.ts.map +1 -1
- package/dist/schemas/chatRequestBody.d.ts +1018 -0
- package/dist/schemas/chatRequestBody.d.ts.map +1 -1
- package/dist/schemas/chatRequestBody.js +7 -0
- package/dist/schemas/chatRequestBody.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/planning.d.ts +666 -0
- package/dist/schemas/planning.d.ts.map +1 -0
- package/dist/schemas/planning.js +153 -0
- package/dist/schemas/planning.js.map +1 -0
- package/dist/schemas/telemetryEvents.d.ts +534 -4
- package/dist/schemas/telemetryEvents.d.ts.map +1 -1
- package/dist/schemas/telemetryEvents.js +88 -0
- package/dist/schemas/telemetryEvents.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/planning.d.ts +55 -0
- package/dist/types/planning.d.ts.map +1 -0
- package/dist/types/planning.js +2 -0
- package/dist/types/planning.js.map +1 -0
- package/dist/types/telemetry.d.ts +36 -1
- package/dist/types/telemetry.d.ts.map +1 -1
- package/dist/types/telemetry.js +2 -1
- package/dist/types/telemetry.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Plan step status values
|
|
4
|
+
*/
|
|
5
|
+
export const planStepStatusValues = [
|
|
6
|
+
"pending",
|
|
7
|
+
"in_progress",
|
|
8
|
+
"completed",
|
|
9
|
+
"failed",
|
|
10
|
+
"skipped",
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Plan complexity levels
|
|
14
|
+
*/
|
|
15
|
+
export const planComplexityValues = ["low", "medium", "high"];
|
|
16
|
+
/**
|
|
17
|
+
* Operation types for plan steps
|
|
18
|
+
*/
|
|
19
|
+
export const operationTypeValues = ["read", "write"];
|
|
20
|
+
/**
|
|
21
|
+
* Conflict types for plan validation
|
|
22
|
+
*/
|
|
23
|
+
export const planConflictTypeValues = [
|
|
24
|
+
"conflicting_intent",
|
|
25
|
+
"impossible_task",
|
|
26
|
+
"missing_tool",
|
|
27
|
+
"missing_context",
|
|
28
|
+
"unsupported_operation",
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Plan execution status values
|
|
32
|
+
*/
|
|
33
|
+
export const planExecutionStatusValues = ["success", "partial", "failed"];
|
|
34
|
+
/**
|
|
35
|
+
* Schema for plan step execution instructions
|
|
36
|
+
*/
|
|
37
|
+
export const PlanStepExecutionInstructionsSchema = z
|
|
38
|
+
.object({
|
|
39
|
+
objective: z.string(),
|
|
40
|
+
/** Maps input parameter names to their source references (e.g., "from_context.userContext.address") */
|
|
41
|
+
inputSource: z.record(z.string(), z.string()),
|
|
42
|
+
expectedOutput: z.string(),
|
|
43
|
+
errorHandling: z.string(),
|
|
44
|
+
constraints: z.array(z.string()).optional(),
|
|
45
|
+
})
|
|
46
|
+
.strict();
|
|
47
|
+
/**
|
|
48
|
+
* Schema for individual plan steps
|
|
49
|
+
*/
|
|
50
|
+
export const PlanStepSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
stepNumber: z.number().int().positive(),
|
|
53
|
+
description: z.string(),
|
|
54
|
+
operationType: z.enum(operationTypeValues),
|
|
55
|
+
requiresUserApproval: z.boolean(),
|
|
56
|
+
dependsOn: z.array(z.number().int().positive()),
|
|
57
|
+
status: z.enum(planStepStatusValues),
|
|
58
|
+
/** Step execution result. Structure varies by tool - typically contains tool-specific output data. */
|
|
59
|
+
result: z.unknown().optional(),
|
|
60
|
+
toolName: z.string().optional(),
|
|
61
|
+
executionInstructions: PlanStepExecutionInstructionsSchema,
|
|
62
|
+
})
|
|
63
|
+
.strict();
|
|
64
|
+
/**
|
|
65
|
+
* Schema for user-readable summary step
|
|
66
|
+
*/
|
|
67
|
+
export const PlanUserSummaryStepSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
number: z.number().int().positive(),
|
|
70
|
+
description: z.string(),
|
|
71
|
+
status: z.enum(planStepStatusValues),
|
|
72
|
+
requiresApproval: z.boolean(),
|
|
73
|
+
})
|
|
74
|
+
.strict();
|
|
75
|
+
/**
|
|
76
|
+
* Schema for human-readable plan summary
|
|
77
|
+
*/
|
|
78
|
+
export const PlanUserSummarySchema = z
|
|
79
|
+
.object({
|
|
80
|
+
title: z.string(),
|
|
81
|
+
description: z.string(),
|
|
82
|
+
steps: z.array(PlanUserSummaryStepSchema),
|
|
83
|
+
warnings: z.array(z.string()).optional(),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
|
86
|
+
/**
|
|
87
|
+
* Schema for machine-readable execution details
|
|
88
|
+
*/
|
|
89
|
+
export const PlanExecutionDetailsSchema = z
|
|
90
|
+
.object({
|
|
91
|
+
steps: z.array(PlanStepSchema),
|
|
92
|
+
complexity: z.enum(planComplexityValues),
|
|
93
|
+
recommendedModel: z.string(),
|
|
94
|
+
/** Ordered tool names for execution — may differ from steps[].toolName when steps run in parallel or tools are reused */
|
|
95
|
+
toolSequence: z.array(z.string()),
|
|
96
|
+
/** Descriptions of read operations for quick plan summary (derived from read-type steps) */
|
|
97
|
+
readOperations: z.array(z.string()),
|
|
98
|
+
/** Descriptions of write operations for quick plan summary (derived from write-type steps) */
|
|
99
|
+
writeOperations: z.array(z.string()),
|
|
100
|
+
pendingApprovals: z.number().int().nonnegative(),
|
|
101
|
+
/** All tools the plan may invoke, including conditional/fallback tools not tied to specific steps */
|
|
102
|
+
availableTools: z.array(z.string()),
|
|
103
|
+
})
|
|
104
|
+
.strict();
|
|
105
|
+
/**
|
|
106
|
+
* Schema for plan conflicts
|
|
107
|
+
*/
|
|
108
|
+
export const PlanConflictSchema = z
|
|
109
|
+
.object({
|
|
110
|
+
type: z.enum(planConflictTypeValues),
|
|
111
|
+
message: z.string(),
|
|
112
|
+
suggestion: z.string().optional(),
|
|
113
|
+
})
|
|
114
|
+
.strict();
|
|
115
|
+
/**
|
|
116
|
+
* Schema for re-plan context
|
|
117
|
+
*/
|
|
118
|
+
export const ReplanContextSchema = z
|
|
119
|
+
.object({
|
|
120
|
+
previousPlanId: z.string().uuid(),
|
|
121
|
+
replanReason: z.string(),
|
|
122
|
+
preservedSteps: z.array(z.number().int().positive()),
|
|
123
|
+
})
|
|
124
|
+
.strict();
|
|
125
|
+
/**
|
|
126
|
+
* Schema for complete execution plan
|
|
127
|
+
*/
|
|
128
|
+
export const ExecutionPlanSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
planId: z.string().uuid(),
|
|
131
|
+
version: z.number().int().positive(),
|
|
132
|
+
isExecutable: z.boolean(),
|
|
133
|
+
autoExecutable: z.boolean(),
|
|
134
|
+
userSummary: PlanUserSummarySchema,
|
|
135
|
+
executionSchema: PlanExecutionDetailsSchema,
|
|
136
|
+
conflicts: z.array(PlanConflictSchema).optional(),
|
|
137
|
+
replanContext: ReplanContextSchema.optional(),
|
|
138
|
+
createdAt: z.string().datetime(),
|
|
139
|
+
})
|
|
140
|
+
.strict();
|
|
141
|
+
/**
|
|
142
|
+
* Schema for planning configuration
|
|
143
|
+
*/
|
|
144
|
+
export const AgentPlanningConfigSchema = z
|
|
145
|
+
.object({
|
|
146
|
+
enabled: z.boolean().optional(),
|
|
147
|
+
cacheEnabled: z.boolean().optional(),
|
|
148
|
+
cacheTTL: z.number().int().positive().optional(),
|
|
149
|
+
forceRefresh: z.boolean().optional(),
|
|
150
|
+
planningModel: z.string().optional(),
|
|
151
|
+
})
|
|
152
|
+
.strict();
|
|
153
|
+
//# sourceMapping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