skedyul 1.2.44 → 1.2.48

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 (54) hide show
  1. package/dist/cli/commands/workflows.d.ts +1 -0
  2. package/dist/cli/index.js +3670 -9073
  3. package/dist/cli/utils/auth.d.ts +4 -1
  4. package/dist/cli/utils/auth.js +32 -8
  5. package/dist/cli/utils/config.d.ts +23 -0
  6. package/dist/cli/utils/env-sync.d.ts +46 -0
  7. package/dist/cli/utils/mcp-http-client.d.ts +74 -0
  8. package/dist/cli/utils/migration-approval.d.ts +39 -0
  9. package/dist/cli/utils/mock-context.d.ts +19 -9
  10. package/dist/cli/utils/sse.d.ts +33 -0
  11. package/dist/cli/utils.d.ts +5 -1
  12. package/dist/compiler/types.d.ts +11 -9
  13. package/dist/config/schema-loader.d.ts +15 -2
  14. package/dist/config/types/model.d.ts +2 -0
  15. package/dist/config/types/page.d.ts +9 -0
  16. package/dist/context/index.d.ts +2 -2
  17. package/dist/context/resolver.d.ts +29 -28
  18. package/dist/context/types.d.ts +195 -37
  19. package/dist/core/client.d.ts +189 -233
  20. package/dist/dedicated/server.js +252 -163
  21. package/dist/esm/index.mjs +1149 -7671
  22. package/dist/index.d.ts +11 -6
  23. package/dist/index.js +1194 -7669
  24. package/dist/scheduling/calculateWaitTime.d.ts +16 -0
  25. package/dist/scheduling/index.d.ts +11 -0
  26. package/dist/scheduling/index.js +334 -0
  27. package/dist/scheduling/index.mjs +305 -0
  28. package/dist/scheduling/isTimeInWindow.d.ts +15 -0
  29. package/dist/scheduling/types-workflow.d.ts +54 -0
  30. package/dist/scheduling/types.d.ts +166 -0
  31. package/dist/schemas/agent-schema-v3.d.ts +406 -60
  32. package/dist/schemas/agent-schema-v3.js +248 -75
  33. package/dist/schemas/agent-schema-v3.mjs +234 -73
  34. package/dist/schemas/agent-schema.js +3 -7295
  35. package/dist/schemas/agent-schema.mjs +3 -7323
  36. package/dist/schemas/crm-schema.d.ts +53 -19
  37. package/dist/schemas/index.d.ts +1 -1
  38. package/dist/schemas.d.ts +128 -40
  39. package/dist/server/route-handlers/handlers.d.ts +7 -0
  40. package/dist/server/utils/env.d.ts +9 -0
  41. package/dist/server/utils/index.d.ts +1 -0
  42. package/dist/server/utils/mcp-response.d.ts +11 -0
  43. package/dist/server.js +252 -163
  44. package/dist/serverless/server.mjs +252 -163
  45. package/dist/skills/index.d.ts +1 -1
  46. package/dist/skills/types.d.ts +34 -23
  47. package/dist/skills/types.js +8 -17
  48. package/dist/skills/types.mjs +7 -16
  49. package/dist/types/index.d.ts +3 -3
  50. package/dist/types/server.d.ts +1 -0
  51. package/dist/types/tool-context.d.ts +31 -4
  52. package/dist/types/tool-response.d.ts +2 -0
  53. package/dist/types/tool.d.ts +33 -1
  54. package/package.json +8 -1
@@ -9,7 +9,7 @@ export declare const CRMContextSchema: z.ZodObject<{
9
9
  }, z.core.$strip>;
10
10
  export type CRMContext = z.infer<typeof CRMContextSchema>;
11
11
  /**
12
- * Sender context - who sent the message
12
+ * Sender context - who sent the message (legacy, kept for backwards compatibility)
13
13
  */
14
14
  export declare const SenderContextSchema: z.ZodObject<{
15
15
  kind: z.ZodEnum<{
@@ -50,66 +50,189 @@ export declare const ThreadInfoSchema: z.ZodObject<{
50
50
  }, z.core.$strip>;
51
51
  export type ThreadInfo = z.infer<typeof ThreadInfoSchema>;
52
52
  /**
53
- * Full agent context - what the agent sees
53
+ * Subscription - channel identifier for the contact
54
+ */
55
+ export declare const SubscriptionSchema: z.ZodObject<{
56
+ identifierValue: z.ZodString;
57
+ channelHandle: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>;
59
+ export type Subscription = z.infer<typeof SubscriptionSchema>;
60
+ /**
61
+ * Association - CRM instance linked to a contact
62
+ */
63
+ export declare const AssociationSchema: z.ZodObject<{
64
+ id: z.ZodOptional<z.ZodString>;
65
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
66
+ }, z.core.$strip>;
67
+ export type Association = z.infer<typeof AssociationSchema>;
68
+ /**
69
+ * Contact - mirrors production contact structure
70
+ */
71
+ export declare const ContactSchema: z.ZodObject<{
72
+ id: z.ZodOptional<z.ZodString>;
73
+ name: z.ZodOptional<z.ZodString>;
74
+ subscription: z.ZodOptional<z.ZodObject<{
75
+ identifierValue: z.ZodString;
76
+ channelHandle: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>>;
78
+ associations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
79
+ id: z.ZodOptional<z.ZodString>;
80
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
81
+ }, z.core.$strip>>>;
82
+ }, z.core.$strip>;
83
+ export type Contact = z.infer<typeof ContactSchema>;
84
+ /**
85
+ * Agent sender context - who sent the message
86
+ */
87
+ export declare const AgentSenderContextSchema: z.ZodObject<{
88
+ kind: z.ZodEnum<{
89
+ contact: "contact";
90
+ member: "member";
91
+ }>;
92
+ displayName: z.ZodOptional<z.ZodString>;
93
+ role: z.ZodOptional<z.ZodString>;
94
+ permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
+ contact: z.ZodOptional<z.ZodObject<{
96
+ id: z.ZodOptional<z.ZodString>;
97
+ name: z.ZodOptional<z.ZodString>;
98
+ subscription: z.ZodOptional<z.ZodObject<{
99
+ identifierValue: z.ZodString;
100
+ channelHandle: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>>;
102
+ associations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
103
+ id: z.ZodOptional<z.ZodString>;
104
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
105
+ }, z.core.$strip>>>;
106
+ }, z.core.$strip>>;
107
+ }, z.core.$strip>;
108
+ export type AgentSenderContext = z.infer<typeof AgentSenderContextSchema>;
109
+ /**
110
+ * Agent thread context item - a linked CRM instance
111
+ */
112
+ export declare const AgentThreadContextSchema: z.ZodObject<{
113
+ handle: z.ZodString;
114
+ model: z.ZodString;
115
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
116
+ }, z.core.$strip>;
117
+ export type AgentThreadContext = z.infer<typeof AgentThreadContextSchema>;
118
+ /**
119
+ * Agent context - unified context for both sandbox and production
120
+ *
121
+ * This is the primary context shape used by agents. It can be:
122
+ * - Built from real thread data (production mode)
123
+ * - Loaded from agent YAML mockContext (sandbox mode)
54
124
  */
55
125
  export declare const AgentContextSchema: z.ZodObject<{
56
126
  sender: z.ZodObject<{
57
127
  kind: z.ZodEnum<{
58
- CONTACT: "CONTACT";
59
- MEMBER: "MEMBER";
60
- AGENT: "AGENT";
61
- WORKFLOW: "WORKFLOW";
128
+ contact: "contact";
129
+ member: "member";
62
130
  }>;
63
131
  displayName: z.ZodOptional<z.ZodString>;
64
- email: z.ZodOptional<z.ZodString>;
65
132
  role: z.ZodOptional<z.ZodString>;
66
133
  permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
- crm: z.ZodOptional<z.ZodObject<{
68
- model: z.ZodString;
69
- instanceId: z.ZodString;
70
- data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
134
+ contact: z.ZodOptional<z.ZodObject<{
135
+ id: z.ZodOptional<z.ZodString>;
136
+ name: z.ZodOptional<z.ZodString>;
137
+ subscription: z.ZodOptional<z.ZodObject<{
138
+ identifierValue: z.ZodString;
139
+ channelHandle: z.ZodOptional<z.ZodString>;
140
+ }, z.core.$strip>>;
141
+ associations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
142
+ id: z.ZodOptional<z.ZodString>;
143
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
144
+ }, z.core.$strip>>>;
71
145
  }, z.core.$strip>>;
72
146
  }, z.core.$strip>;
73
147
  contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
148
  handle: z.ZodString;
75
149
  model: z.ZodString;
76
- instanceId: z.ZodString;
77
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
150
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
78
151
  }, z.core.$strip>>>;
79
- thread: z.ZodObject<{
80
- id: z.ZodString;
81
- title: z.ZodOptional<z.ZodString>;
82
- status: z.ZodOptional<z.ZodString>;
83
- kind: z.ZodOptional<z.ZodString>;
84
- }, z.core.$strip>;
85
- workplace: z.ZodOptional<z.ZodObject<{
86
- id: z.ZodString;
87
- name: z.ZodOptional<z.ZodString>;
88
- }, z.core.$strip>>;
89
152
  }, z.core.$strip>;
90
153
  export type AgentContext = z.infer<typeof AgentContextSchema>;
91
154
  /**
92
- * Mock context for sandbox testing
155
+ * Severity level for context validation issues.
156
+ * - ERROR: Critical issue - agent cannot run (e.g., missing required field)
157
+ * - WARNING: Non-critical issue - agent runs degraded (e.g., missing recommended field)
93
158
  */
159
+ export declare const ContextIssueSeveritySchema: z.ZodEnum<{
160
+ ERROR: "ERROR";
161
+ WARNING: "WARNING";
162
+ }>;
163
+ export type ContextIssueSeverity = z.infer<typeof ContextIssueSeveritySchema>;
94
164
  /**
95
- * Mock subscription - channel identifier for the contact
165
+ * Type of context validation issue.
96
166
  */
167
+ export declare const ContextIssueTypeSchema: z.ZodEnum<{
168
+ MISSING_ROUTING_PARTICIPANT: "MISSING_ROUTING_PARTICIPANT";
169
+ MISSING_ASSOCIATION: "MISSING_ASSOCIATION";
170
+ MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
171
+ MISSING_RECOMMENDED_FIELD: "MISSING_RECOMMENDED_FIELD";
172
+ }>;
173
+ export type ContextIssueType = z.infer<typeof ContextIssueTypeSchema>;
174
+ /**
175
+ * A single validation issue found during context validation.
176
+ */
177
+ export declare const ContextIssueSchema: z.ZodObject<{
178
+ type: z.ZodEnum<{
179
+ MISSING_ROUTING_PARTICIPANT: "MISSING_ROUTING_PARTICIPANT";
180
+ MISSING_ASSOCIATION: "MISSING_ASSOCIATION";
181
+ MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
182
+ MISSING_RECOMMENDED_FIELD: "MISSING_RECOMMENDED_FIELD";
183
+ }>;
184
+ severity: z.ZodEnum<{
185
+ ERROR: "ERROR";
186
+ WARNING: "WARNING";
187
+ }>;
188
+ model: z.ZodOptional<z.ZodString>;
189
+ field: z.ZodOptional<z.ZodString>;
190
+ message: z.ZodString;
191
+ suggestion: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strip>;
193
+ export type ContextIssue = z.infer<typeof ContextIssueSchema>;
194
+ /**
195
+ * Result of context validation.
196
+ * - valid: false if any ERROR-level issues exist (agent should not run)
197
+ * - degraded: true if any WARNING-level issues exist (agent runs with reduced performance)
198
+ * - issues: List of all validation issues found
199
+ */
200
+ export declare const ContextValidationResultSchema: z.ZodObject<{
201
+ valid: z.ZodBoolean;
202
+ degraded: z.ZodBoolean;
203
+ issues: z.ZodArray<z.ZodObject<{
204
+ type: z.ZodEnum<{
205
+ MISSING_ROUTING_PARTICIPANT: "MISSING_ROUTING_PARTICIPANT";
206
+ MISSING_ASSOCIATION: "MISSING_ASSOCIATION";
207
+ MISSING_REQUIRED_FIELD: "MISSING_REQUIRED_FIELD";
208
+ MISSING_RECOMMENDED_FIELD: "MISSING_RECOMMENDED_FIELD";
209
+ }>;
210
+ severity: z.ZodEnum<{
211
+ ERROR: "ERROR";
212
+ WARNING: "WARNING";
213
+ }>;
214
+ model: z.ZodOptional<z.ZodString>;
215
+ field: z.ZodOptional<z.ZodString>;
216
+ message: z.ZodString;
217
+ suggestion: z.ZodOptional<z.ZodString>;
218
+ }, z.core.$strip>>;
219
+ }, z.core.$strip>;
220
+ export type ContextValidationResult = z.infer<typeof ContextValidationResultSchema>;
221
+ /** @deprecated Use SubscriptionSchema instead */
97
222
  export declare const MockSubscriptionSchema: z.ZodObject<{
98
223
  identifierValue: z.ZodString;
99
224
  channelHandle: z.ZodOptional<z.ZodString>;
100
225
  }, z.core.$strip>;
101
- export type MockSubscription = z.infer<typeof MockSubscriptionSchema>;
102
- /**
103
- * Mock association - CRM instance linked to a contact
104
- */
226
+ /** @deprecated Use Subscription instead */
227
+ export type MockSubscription = Subscription;
228
+ /** @deprecated Use AssociationSchema instead */
105
229
  export declare const MockAssociationSchema: z.ZodObject<{
106
230
  id: z.ZodOptional<z.ZodString>;
107
231
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
108
232
  }, z.core.$strip>;
109
- export type MockAssociation = z.infer<typeof MockAssociationSchema>;
110
- /**
111
- * Mock contact - mirrors production contact structure
112
- */
233
+ /** @deprecated Use Association instead */
234
+ export type MockAssociation = Association;
235
+ /** @deprecated Use ContactSchema instead */
113
236
  export declare const MockContactSchema: z.ZodObject<{
114
237
  id: z.ZodOptional<z.ZodString>;
115
238
  name: z.ZodOptional<z.ZodString>;
@@ -122,7 +245,9 @@ export declare const MockContactSchema: z.ZodObject<{
122
245
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
123
246
  }, z.core.$strip>>>;
124
247
  }, z.core.$strip>;
125
- export type MockContact = z.infer<typeof MockContactSchema>;
248
+ /** @deprecated Use Contact instead */
249
+ export type MockContact = Contact;
250
+ /** @deprecated Use AgentSenderContextSchema instead */
126
251
  export declare const MockSenderContextSchema: z.ZodObject<{
127
252
  kind: z.ZodEnum<{
128
253
  contact: "contact";
@@ -144,13 +269,17 @@ export declare const MockSenderContextSchema: z.ZodObject<{
144
269
  }, z.core.$strip>>>;
145
270
  }, z.core.$strip>>;
146
271
  }, z.core.$strip>;
147
- export type MockSenderContext = z.infer<typeof MockSenderContextSchema>;
272
+ /** @deprecated Use AgentSenderContext instead */
273
+ export type MockSenderContext = AgentSenderContext;
274
+ /** @deprecated Use AgentThreadContextSchema instead */
148
275
  export declare const MockThreadContextSchema: z.ZodObject<{
149
276
  handle: z.ZodString;
150
277
  model: z.ZodString;
151
278
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
152
279
  }, z.core.$strip>;
153
- export type MockThreadContext = z.infer<typeof MockThreadContextSchema>;
280
+ /** @deprecated Use AgentThreadContext instead */
281
+ export type MockThreadContext = AgentThreadContext;
282
+ /** @deprecated Use AgentContextSchema instead */
154
283
  export declare const MockContextSchema: z.ZodObject<{
155
284
  sender: z.ZodObject<{
156
285
  kind: z.ZodEnum<{
@@ -179,7 +308,8 @@ export declare const MockContextSchema: z.ZodObject<{
179
308
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
180
309
  }, z.core.$strip>>>;
181
310
  }, z.core.$strip>;
182
- export type MockContext = z.infer<typeof MockContextSchema>;
311
+ /** @deprecated Use AgentContext instead */
312
+ export type MockContext = AgentContext;
183
313
  /**
184
314
  * Sandbox configuration in agent YAML
185
315
  */
@@ -213,5 +343,33 @@ export declare const SandboxConfigSchema: z.ZodObject<{
213
343
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
214
344
  }, z.core.$strip>>>;
215
345
  }, z.core.$strip>>;
346
+ context: z.ZodOptional<z.ZodObject<{
347
+ sender: z.ZodObject<{
348
+ kind: z.ZodEnum<{
349
+ contact: "contact";
350
+ member: "member";
351
+ }>;
352
+ displayName: z.ZodOptional<z.ZodString>;
353
+ role: z.ZodOptional<z.ZodString>;
354
+ permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
355
+ contact: z.ZodOptional<z.ZodObject<{
356
+ id: z.ZodOptional<z.ZodString>;
357
+ name: z.ZodOptional<z.ZodString>;
358
+ subscription: z.ZodOptional<z.ZodObject<{
359
+ identifierValue: z.ZodString;
360
+ channelHandle: z.ZodOptional<z.ZodString>;
361
+ }, z.core.$strip>>;
362
+ associations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
363
+ id: z.ZodOptional<z.ZodString>;
364
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
365
+ }, z.core.$strip>>>;
366
+ }, z.core.$strip>>;
367
+ }, z.core.$strip>;
368
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
369
+ handle: z.ZodString;
370
+ model: z.ZodString;
371
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
372
+ }, z.core.$strip>>>;
373
+ }, z.core.$strip>>;
216
374
  }, z.core.$strip>;
217
375
  export type SandboxConfig = z.infer<typeof SandboxConfigSchema>;