@illalabs/interfaces 0.3.0-canary.f3dad1f7 → 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.
Files changed (76) hide show
  1. package/dist/interfaces/chat/response.d.ts +8 -0
  2. package/dist/interfaces/chat/response.d.ts.map +1 -1
  3. package/dist/schemas/chatContext.d.ts +323 -0
  4. package/dist/schemas/chatContext.d.ts.map +1 -1
  5. package/dist/schemas/chatRequestBody.d.ts +1030 -0
  6. package/dist/schemas/chatRequestBody.d.ts.map +1 -1
  7. package/dist/schemas/chatRequestBody.js +7 -0
  8. package/dist/schemas/chatRequestBody.js.map +1 -1
  9. package/dist/schemas/index.d.ts +1 -0
  10. package/dist/schemas/index.d.ts.map +1 -1
  11. package/dist/schemas/index.js +1 -0
  12. package/dist/schemas/index.js.map +1 -1
  13. package/dist/schemas/messages.d.ts +473 -0
  14. package/dist/schemas/messages.d.ts.map +1 -1
  15. package/dist/schemas/messages.js +64 -0
  16. package/dist/schemas/messages.js.map +1 -1
  17. package/dist/schemas/modelContext.d.ts +3 -3
  18. package/dist/schemas/planning.d.ts +666 -0
  19. package/dist/schemas/planning.d.ts.map +1 -0
  20. package/dist/schemas/planning.js +153 -0
  21. package/dist/schemas/planning.js.map +1 -0
  22. package/dist/schemas/telemetryEvents.d.ts +1836 -48
  23. package/dist/schemas/telemetryEvents.d.ts.map +1 -1
  24. package/dist/schemas/telemetryEvents.js +92 -18
  25. package/dist/schemas/telemetryEvents.js.map +1 -1
  26. package/dist/schemas/userContext.d.ts +3 -0
  27. package/dist/schemas/userContext.d.ts.map +1 -1
  28. package/dist/schemas/userContext.js +4 -0
  29. package/dist/schemas/userContext.js.map +1 -1
  30. package/dist/tools/IllaToolError.d.ts +6 -2
  31. package/dist/tools/IllaToolError.d.ts.map +1 -1
  32. package/dist/tools/IllaToolError.js +6 -2
  33. package/dist/tools/IllaToolError.js.map +1 -1
  34. package/dist/tools/IllaToolOutcome.js +1 -1
  35. package/dist/tools/IllaToolOutcome.js.map +1 -1
  36. package/dist/types/actions/inputs.d.ts +6 -2
  37. package/dist/types/actions/inputs.d.ts.map +1 -1
  38. package/dist/types/actions/outputs.d.ts +19 -1
  39. package/dist/types/actions/outputs.d.ts.map +1 -1
  40. package/dist/types/actions/tools/getWalletBalanceAction.d.ts +3 -1
  41. package/dist/types/actions/tools/getWalletBalanceAction.d.ts.map +1 -1
  42. package/dist/types/actions/tools/index.d.ts +12 -0
  43. package/dist/types/actions/tools/index.d.ts.map +1 -1
  44. package/dist/types/actions/tools/polymarketPostOrderAction.d.ts +81 -0
  45. package/dist/types/actions/tools/polymarketPostOrderAction.d.ts.map +1 -0
  46. package/dist/types/actions/tools/polymarketPostOrderAction.js +2 -0
  47. package/dist/types/actions/tools/polymarketPostOrderAction.js.map +1 -0
  48. package/dist/types/actions/tools/predictionMarketsBetAction.d.ts +19 -0
  49. package/dist/types/actions/tools/predictionMarketsBetAction.d.ts.map +1 -0
  50. package/dist/types/actions/tools/predictionMarketsBetAction.js +2 -0
  51. package/dist/types/actions/tools/predictionMarketsBetAction.js.map +1 -0
  52. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts +21 -0
  53. package/dist/types/actions/tools/predictionMarketsFetchAction.d.ts.map +1 -0
  54. package/dist/types/actions/tools/predictionMarketsFetchAction.js +2 -0
  55. package/dist/types/actions/tools/predictionMarketsFetchAction.js.map +1 -0
  56. package/dist/types/actions/tools/predictionMarketsPositionsAction.d.ts +25 -0
  57. package/dist/types/actions/tools/predictionMarketsPositionsAction.d.ts.map +1 -0
  58. package/dist/types/actions/tools/predictionMarketsPositionsAction.js +2 -0
  59. package/dist/types/actions/tools/predictionMarketsPositionsAction.js.map +1 -0
  60. package/dist/types/index.d.ts +1 -0
  61. package/dist/types/index.d.ts.map +1 -1
  62. package/dist/types/index.js +1 -0
  63. package/dist/types/index.js.map +1 -1
  64. package/dist/types/planning.d.ts +55 -0
  65. package/dist/types/planning.d.ts.map +1 -0
  66. package/dist/types/planning.js +2 -0
  67. package/dist/types/planning.js.map +1 -0
  68. package/dist/types/telemetry.d.ts +36 -1
  69. package/dist/types/telemetry.d.ts.map +1 -1
  70. package/dist/types/telemetry.js +2 -1
  71. package/dist/types/telemetry.js.map +1 -1
  72. package/dist/utils/constants.d.ts +5 -3
  73. package/dist/utils/constants.d.ts.map +1 -1
  74. package/dist/utils/constants.js +11 -1
  75. package/dist/utils/constants.js.map +1 -1
  76. 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
+ //# sourceMappingURL=planning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/schemas/planning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,SAAS;IACT,aAAa;IACb,WAAW;IACX,QAAQ;IACR,SAAS;CACH,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,oBAAoB;IACpB,iBAAiB;IACjB,cAAc;IACd,iBAAiB;IACjB,uBAAuB;CACjB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB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