@poncho-ai/sdk 1.0.1 → 1.0.3
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/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-lint.log +6 -0
- package/.turbo/turbo-test.log +14 -0
- package/CHANGELOG.md +20 -0
- package/dist/index.d.ts +131 -12
- package/dist/index.js +99 -12
- package/package.json +1 -1
- package/src/config-registry.ts +98 -11
- package/src/index.ts +14 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/sdk@1.0.
|
|
2
|
+
> @poncho-ai/sdk@1.0.3 build /Users/cesar/Dev/latitude/poncho-ai/packages/sdk
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
11
|
-
[32mESM[39m ⚡️ Build success in
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m10.17 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 46ms
|
|
12
12
|
[34mDTS[39m Build start
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
14
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 1504ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m18.86 KB[39m
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
> @poncho-ai/sdk@1.0.1 test /Users/cesar/Dev/latitude/poncho-ai/packages/sdk
|
|
3
|
+
> vitest
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[7m[1m[36m RUN [39m[22m[27m [36mv1.6.1[39m [90m/Users/cesar/Dev/latitude/poncho-ai/packages/sdk[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m test/sdk.test.ts [2m ([22m[2m1 test[22m[2m)[22m[90m 1[2mms[22m[39m
|
|
9
|
+
|
|
10
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
11
|
+
[2m Tests [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
|
+
[2m Start at [22m 09:39:17
|
|
13
|
+
[2m Duration [22m 477ms[2m (transform 131ms, setup 0ms, collect 143ms, tests 1ms, environment 0ms, prepare 103ms)[22m
|
|
14
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @poncho-ai/sdk
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1f47bb4`](https://github.com/cesr/poncho-ai/commit/1f47bb49e5d48dc17644172012b057190b316469) Thanks [@cesr](https://github.com/cesr)! - Add conversation rename via double-click on the title in the web UI, standardize all credential config fields to the `*Env` naming pattern, and sync the init README template with the repo README.
|
|
8
|
+
|
|
9
|
+
## 1.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`e000b96`](https://github.com/cesr/poncho-ai/commit/e000b96837cbbb8d95c868c91a614f458868c444) Thanks [@cesr](https://github.com/cesr)! - Durable approval checkpoints, email conversation improvements, and web UI fixes
|
|
14
|
+
- Simplify approval system to checkpoint-only (remove legacy blocking approvalHandler)
|
|
15
|
+
- Optimize checkpoint storage with delta messages instead of full history
|
|
16
|
+
- Add sidebar sections for conversations awaiting approval with status indicator
|
|
17
|
+
- Fix nested checkpoint missing baseMessageCount in resumeRunFromCheckpoint
|
|
18
|
+
- Improve email conversation titles (sender email + subject)
|
|
19
|
+
- Remove email threading — each incoming email creates its own conversation
|
|
20
|
+
- Fix streaming after approval to preserve existing messages (liveOnly mode)
|
|
21
|
+
- Preserve newlines in user messages in web UI
|
|
22
|
+
|
|
3
23
|
## 1.0.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -136,29 +136,47 @@ declare const ONBOARDING_FIELDS: readonly [{
|
|
|
136
136
|
readonly envVars: ["PONCHO_DYNAMODB_TABLE"];
|
|
137
137
|
}];
|
|
138
138
|
}, {
|
|
139
|
-
readonly id: "
|
|
139
|
+
readonly id: "env.REDIS_URL";
|
|
140
140
|
readonly domain: "storage";
|
|
141
|
-
readonly target: "
|
|
142
|
-
readonly path: "
|
|
141
|
+
readonly target: "env";
|
|
142
|
+
readonly path: "REDIS_URL";
|
|
143
143
|
readonly kind: "string";
|
|
144
144
|
readonly scopes: ["full"];
|
|
145
|
-
readonly label: "
|
|
146
|
-
readonly prompt: "
|
|
145
|
+
readonly label: "Redis URL";
|
|
146
|
+
readonly prompt: "Redis connection URL";
|
|
147
147
|
readonly defaultValue: "";
|
|
148
|
+
readonly placeholder: "redis://localhost:6379";
|
|
149
|
+
readonly secret: true;
|
|
148
150
|
readonly dependsOn: {
|
|
149
151
|
readonly fieldId: "storage.provider";
|
|
150
|
-
readonly
|
|
152
|
+
readonly equals: "redis";
|
|
151
153
|
};
|
|
152
154
|
}, {
|
|
153
|
-
readonly id: "
|
|
155
|
+
readonly id: "env.UPSTASH_REDIS_REST_URL";
|
|
154
156
|
readonly domain: "storage";
|
|
155
|
-
readonly target: "
|
|
156
|
-
readonly path: "
|
|
157
|
+
readonly target: "env";
|
|
158
|
+
readonly path: "UPSTASH_REDIS_REST_URL";
|
|
157
159
|
readonly kind: "string";
|
|
158
160
|
readonly scopes: ["full"];
|
|
159
|
-
readonly label: "
|
|
160
|
-
readonly prompt: "
|
|
161
|
+
readonly label: "Upstash REST URL";
|
|
162
|
+
readonly prompt: "Upstash Redis REST URL";
|
|
161
163
|
readonly defaultValue: "";
|
|
164
|
+
readonly placeholder: "https://...";
|
|
165
|
+
readonly dependsOn: {
|
|
166
|
+
readonly fieldId: "storage.provider";
|
|
167
|
+
readonly equals: "upstash";
|
|
168
|
+
};
|
|
169
|
+
}, {
|
|
170
|
+
readonly id: "env.UPSTASH_REDIS_REST_TOKEN";
|
|
171
|
+
readonly domain: "storage";
|
|
172
|
+
readonly target: "env";
|
|
173
|
+
readonly path: "UPSTASH_REDIS_REST_TOKEN";
|
|
174
|
+
readonly kind: "string";
|
|
175
|
+
readonly scopes: ["full"];
|
|
176
|
+
readonly label: "Upstash REST token";
|
|
177
|
+
readonly prompt: "Upstash Redis REST token";
|
|
178
|
+
readonly defaultValue: "";
|
|
179
|
+
readonly secret: true;
|
|
162
180
|
readonly dependsOn: {
|
|
163
181
|
readonly fieldId: "storage.provider";
|
|
164
182
|
readonly equals: "upstash";
|
|
@@ -303,6 +321,9 @@ declare const ONBOARDING_FIELDS: readonly [{
|
|
|
303
321
|
}, {
|
|
304
322
|
readonly value: "slack";
|
|
305
323
|
readonly label: "Slack";
|
|
324
|
+
}, {
|
|
325
|
+
readonly value: "resend";
|
|
326
|
+
readonly label: "Email (Resend)";
|
|
306
327
|
}];
|
|
307
328
|
}, {
|
|
308
329
|
readonly id: "env.SLACK_BOT_TOKEN";
|
|
@@ -335,6 +356,89 @@ declare const ONBOARDING_FIELDS: readonly [{
|
|
|
335
356
|
readonly fieldId: "messaging.platform";
|
|
336
357
|
readonly equals: "slack";
|
|
337
358
|
};
|
|
359
|
+
}, {
|
|
360
|
+
readonly id: "env.RESEND_API_KEY";
|
|
361
|
+
readonly domain: "messaging";
|
|
362
|
+
readonly target: "env";
|
|
363
|
+
readonly path: "RESEND_API_KEY";
|
|
364
|
+
readonly kind: "string";
|
|
365
|
+
readonly scopes: ["full"];
|
|
366
|
+
readonly label: "Resend API Key";
|
|
367
|
+
readonly prompt: "Resend API Key (from resend.com/api-keys)";
|
|
368
|
+
readonly defaultValue: "";
|
|
369
|
+
readonly placeholder: "re_...";
|
|
370
|
+
readonly secret: true;
|
|
371
|
+
readonly dependsOn: {
|
|
372
|
+
readonly fieldId: "messaging.platform";
|
|
373
|
+
readonly equals: "resend";
|
|
374
|
+
};
|
|
375
|
+
}, {
|
|
376
|
+
readonly id: "env.RESEND_WEBHOOK_SECRET";
|
|
377
|
+
readonly domain: "messaging";
|
|
378
|
+
readonly target: "env";
|
|
379
|
+
readonly path: "RESEND_WEBHOOK_SECRET";
|
|
380
|
+
readonly kind: "string";
|
|
381
|
+
readonly scopes: ["full"];
|
|
382
|
+
readonly label: "Resend Webhook Secret";
|
|
383
|
+
readonly prompt: "Resend Webhook Signing Secret (from webhook details page)";
|
|
384
|
+
readonly defaultValue: "";
|
|
385
|
+
readonly placeholder: "whsec_...";
|
|
386
|
+
readonly secret: true;
|
|
387
|
+
readonly dependsOn: {
|
|
388
|
+
readonly fieldId: "messaging.platform";
|
|
389
|
+
readonly equals: "resend";
|
|
390
|
+
};
|
|
391
|
+
}, {
|
|
392
|
+
readonly id: "env.RESEND_FROM";
|
|
393
|
+
readonly domain: "messaging";
|
|
394
|
+
readonly target: "env";
|
|
395
|
+
readonly path: "RESEND_FROM";
|
|
396
|
+
readonly kind: "string";
|
|
397
|
+
readonly scopes: ["full"];
|
|
398
|
+
readonly label: "From Address";
|
|
399
|
+
readonly prompt: "Email address the agent sends from (e.g. Agent <agent@yourdomain.com>)";
|
|
400
|
+
readonly defaultValue: "";
|
|
401
|
+
readonly placeholder: "Agent <agent@yourdomain.com>";
|
|
402
|
+
readonly dependsOn: {
|
|
403
|
+
readonly fieldId: "messaging.platform";
|
|
404
|
+
readonly equals: "resend";
|
|
405
|
+
};
|
|
406
|
+
}, {
|
|
407
|
+
readonly id: "messaging.resend.mode";
|
|
408
|
+
readonly domain: "messaging";
|
|
409
|
+
readonly target: "agent";
|
|
410
|
+
readonly path: "messaging.resend.mode";
|
|
411
|
+
readonly kind: "select";
|
|
412
|
+
readonly scopes: ["full"];
|
|
413
|
+
readonly label: "Email response mode";
|
|
414
|
+
readonly prompt: "How should the agent respond to emails?";
|
|
415
|
+
readonly defaultValue: "auto-reply";
|
|
416
|
+
readonly options: [{
|
|
417
|
+
readonly value: "auto-reply";
|
|
418
|
+
readonly label: "Auto-reply (agent response sent as email reply)";
|
|
419
|
+
}, {
|
|
420
|
+
readonly value: "tool";
|
|
421
|
+
readonly label: "Tool (agent uses send_email tool for full control)";
|
|
422
|
+
}];
|
|
423
|
+
readonly dependsOn: {
|
|
424
|
+
readonly fieldId: "messaging.platform";
|
|
425
|
+
readonly equals: "resend";
|
|
426
|
+
};
|
|
427
|
+
}, {
|
|
428
|
+
readonly id: "messaging.resend.allowedRecipients";
|
|
429
|
+
readonly domain: "messaging";
|
|
430
|
+
readonly target: "agent";
|
|
431
|
+
readonly path: "messaging.resend.allowedRecipients";
|
|
432
|
+
readonly kind: "string";
|
|
433
|
+
readonly scopes: ["full"];
|
|
434
|
+
readonly label: "Allowed recipients";
|
|
435
|
+
readonly prompt: "Allowed recipient patterns for send_email tool (comma-separated, e.g. *@mycompany.com). Leave empty for no restrictions.";
|
|
436
|
+
readonly defaultValue: "";
|
|
437
|
+
readonly placeholder: "*@mycompany.com, partner@external.com";
|
|
438
|
+
readonly dependsOn: {
|
|
439
|
+
readonly fieldId: "messaging.resend.mode";
|
|
440
|
+
readonly equals: "tool";
|
|
441
|
+
};
|
|
338
442
|
}];
|
|
339
443
|
declare const FEATURE_DOMAIN_ORDER: readonly FeatureDomain[];
|
|
340
444
|
declare const fieldsForScope: (scope: OnboardingScope) => OnboardingField[];
|
|
@@ -407,11 +511,13 @@ interface FileInput {
|
|
|
407
511
|
filename?: string;
|
|
408
512
|
}
|
|
409
513
|
interface RunInput {
|
|
410
|
-
task
|
|
514
|
+
task?: string;
|
|
411
515
|
parameters?: Record<string, unknown>;
|
|
412
516
|
messages?: Message[];
|
|
413
517
|
files?: FileInput[];
|
|
414
518
|
abortSignal?: AbortSignal;
|
|
519
|
+
/** When set, Latitude telemetry groups all turns in this conversation under a single trace. */
|
|
520
|
+
conversationId?: string;
|
|
415
521
|
}
|
|
416
522
|
interface TokenUsage {
|
|
417
523
|
input: number;
|
|
@@ -436,6 +542,7 @@ type AgentEvent = {
|
|
|
436
542
|
type: "run:started";
|
|
437
543
|
runId: string;
|
|
438
544
|
agentId: string;
|
|
545
|
+
contextWindow?: number;
|
|
439
546
|
} | {
|
|
440
547
|
type: "run:completed";
|
|
441
548
|
runId: string;
|
|
@@ -489,6 +596,18 @@ type AgentEvent = {
|
|
|
489
596
|
type: "tool:approval:denied";
|
|
490
597
|
approvalId: string;
|
|
491
598
|
reason?: string;
|
|
599
|
+
} | {
|
|
600
|
+
type: "tool:approval:checkpoint";
|
|
601
|
+
approvalId: string;
|
|
602
|
+
tool: string;
|
|
603
|
+
toolCallId: string;
|
|
604
|
+
input: Record<string, unknown>;
|
|
605
|
+
checkpointMessages: Message[];
|
|
606
|
+
pendingToolCalls: Array<{
|
|
607
|
+
id: string;
|
|
608
|
+
name: string;
|
|
609
|
+
input: Record<string, unknown>;
|
|
610
|
+
}>;
|
|
492
611
|
};
|
|
493
612
|
|
|
494
613
|
export { type AgentEvent, type AgentFailure, type ContentPart, FEATURE_DOMAIN_ORDER, type FeatureDomain, type FileContentPart, type FileInput, type JsonSchema, type Message, ONBOARDING_FIELDS, type OnboardingField, type OnboardingFieldCondition, type OnboardingFieldKind, type OnboardingFieldTarget, type OnboardingOption, type OnboardingScope, type Role, type RunInput, type RunResult, type TextContentPart, type TokenUsage, type ToolContext, type ToolDefinition, type ToolHandler, defineTool, fieldsForScope, getTextContent };
|
package/dist/index.js
CHANGED
|
@@ -88,27 +88,43 @@ var ONBOARDING_FIELDS = [
|
|
|
88
88
|
]
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
id: "
|
|
91
|
+
id: "env.REDIS_URL",
|
|
92
92
|
domain: "storage",
|
|
93
|
-
target: "
|
|
94
|
-
path: "
|
|
93
|
+
target: "env",
|
|
94
|
+
path: "REDIS_URL",
|
|
95
95
|
kind: "string",
|
|
96
96
|
scopes: ["full"],
|
|
97
|
-
label: "
|
|
98
|
-
prompt: "
|
|
97
|
+
label: "Redis URL",
|
|
98
|
+
prompt: "Redis connection URL",
|
|
99
99
|
defaultValue: "",
|
|
100
|
-
|
|
100
|
+
placeholder: "redis://localhost:6379",
|
|
101
|
+
secret: true,
|
|
102
|
+
dependsOn: { fieldId: "storage.provider", equals: "redis" }
|
|
101
103
|
},
|
|
102
104
|
{
|
|
103
|
-
id: "
|
|
105
|
+
id: "env.UPSTASH_REDIS_REST_URL",
|
|
104
106
|
domain: "storage",
|
|
105
|
-
target: "
|
|
106
|
-
path: "
|
|
107
|
+
target: "env",
|
|
108
|
+
path: "UPSTASH_REDIS_REST_URL",
|
|
109
|
+
kind: "string",
|
|
110
|
+
scopes: ["full"],
|
|
111
|
+
label: "Upstash REST URL",
|
|
112
|
+
prompt: "Upstash Redis REST URL",
|
|
113
|
+
defaultValue: "",
|
|
114
|
+
placeholder: "https://...",
|
|
115
|
+
dependsOn: { fieldId: "storage.provider", equals: "upstash" }
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "env.UPSTASH_REDIS_REST_TOKEN",
|
|
119
|
+
domain: "storage",
|
|
120
|
+
target: "env",
|
|
121
|
+
path: "UPSTASH_REDIS_REST_TOKEN",
|
|
107
122
|
kind: "string",
|
|
108
123
|
scopes: ["full"],
|
|
109
|
-
label: "
|
|
110
|
-
prompt: "
|
|
124
|
+
label: "Upstash REST token",
|
|
125
|
+
prompt: "Upstash Redis REST token",
|
|
111
126
|
defaultValue: "",
|
|
127
|
+
secret: true,
|
|
112
128
|
dependsOn: { fieldId: "storage.provider", equals: "upstash" }
|
|
113
129
|
},
|
|
114
130
|
{
|
|
@@ -233,7 +249,8 @@ var ONBOARDING_FIELDS = [
|
|
|
233
249
|
defaultValue: "none",
|
|
234
250
|
options: [
|
|
235
251
|
{ value: "none", label: "None" },
|
|
236
|
-
{ value: "slack", label: "Slack" }
|
|
252
|
+
{ value: "slack", label: "Slack" },
|
|
253
|
+
{ value: "resend", label: "Email (Resend)" }
|
|
237
254
|
]
|
|
238
255
|
},
|
|
239
256
|
{
|
|
@@ -262,6 +279,76 @@ var ONBOARDING_FIELDS = [
|
|
|
262
279
|
defaultValue: "",
|
|
263
280
|
secret: true,
|
|
264
281
|
dependsOn: { fieldId: "messaging.platform", equals: "slack" }
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
id: "env.RESEND_API_KEY",
|
|
285
|
+
domain: "messaging",
|
|
286
|
+
target: "env",
|
|
287
|
+
path: "RESEND_API_KEY",
|
|
288
|
+
kind: "string",
|
|
289
|
+
scopes: ["full"],
|
|
290
|
+
label: "Resend API Key",
|
|
291
|
+
prompt: "Resend API Key (from resend.com/api-keys)",
|
|
292
|
+
defaultValue: "",
|
|
293
|
+
placeholder: "re_...",
|
|
294
|
+
secret: true,
|
|
295
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" }
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "env.RESEND_WEBHOOK_SECRET",
|
|
299
|
+
domain: "messaging",
|
|
300
|
+
target: "env",
|
|
301
|
+
path: "RESEND_WEBHOOK_SECRET",
|
|
302
|
+
kind: "string",
|
|
303
|
+
scopes: ["full"],
|
|
304
|
+
label: "Resend Webhook Secret",
|
|
305
|
+
prompt: "Resend Webhook Signing Secret (from webhook details page)",
|
|
306
|
+
defaultValue: "",
|
|
307
|
+
placeholder: "whsec_...",
|
|
308
|
+
secret: true,
|
|
309
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" }
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
id: "env.RESEND_FROM",
|
|
313
|
+
domain: "messaging",
|
|
314
|
+
target: "env",
|
|
315
|
+
path: "RESEND_FROM",
|
|
316
|
+
kind: "string",
|
|
317
|
+
scopes: ["full"],
|
|
318
|
+
label: "From Address",
|
|
319
|
+
prompt: "Email address the agent sends from (e.g. Agent <agent@yourdomain.com>)",
|
|
320
|
+
defaultValue: "",
|
|
321
|
+
placeholder: "Agent <agent@yourdomain.com>",
|
|
322
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" }
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
id: "messaging.resend.mode",
|
|
326
|
+
domain: "messaging",
|
|
327
|
+
target: "agent",
|
|
328
|
+
path: "messaging.resend.mode",
|
|
329
|
+
kind: "select",
|
|
330
|
+
scopes: ["full"],
|
|
331
|
+
label: "Email response mode",
|
|
332
|
+
prompt: "How should the agent respond to emails?",
|
|
333
|
+
defaultValue: "auto-reply",
|
|
334
|
+
options: [
|
|
335
|
+
{ value: "auto-reply", label: "Auto-reply (agent response sent as email reply)" },
|
|
336
|
+
{ value: "tool", label: "Tool (agent uses send_email tool for full control)" }
|
|
337
|
+
],
|
|
338
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" }
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: "messaging.resend.allowedRecipients",
|
|
342
|
+
domain: "messaging",
|
|
343
|
+
target: "agent",
|
|
344
|
+
path: "messaging.resend.allowedRecipients",
|
|
345
|
+
kind: "string",
|
|
346
|
+
scopes: ["full"],
|
|
347
|
+
label: "Allowed recipients",
|
|
348
|
+
prompt: "Allowed recipient patterns for send_email tool (comma-separated, e.g. *@mycompany.com). Leave empty for no restrictions.",
|
|
349
|
+
defaultValue: "",
|
|
350
|
+
placeholder: "*@mycompany.com, partner@external.com",
|
|
351
|
+
dependsOn: { fieldId: "messaging.resend.mode", equals: "tool" }
|
|
265
352
|
}
|
|
266
353
|
];
|
|
267
354
|
var FEATURE_DOMAIN_ORDER = [
|
package/package.json
CHANGED
package/src/config-registry.ts
CHANGED
|
@@ -133,27 +133,43 @@ export const ONBOARDING_FIELDS = [
|
|
|
133
133
|
],
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
id: "
|
|
136
|
+
id: "env.REDIS_URL",
|
|
137
137
|
domain: "storage",
|
|
138
|
-
target: "
|
|
139
|
-
path: "
|
|
138
|
+
target: "env",
|
|
139
|
+
path: "REDIS_URL",
|
|
140
140
|
kind: "string",
|
|
141
141
|
scopes: ["full"],
|
|
142
|
-
label: "
|
|
143
|
-
prompt: "
|
|
142
|
+
label: "Redis URL",
|
|
143
|
+
prompt: "Redis connection URL",
|
|
144
144
|
defaultValue: "",
|
|
145
|
-
|
|
145
|
+
placeholder: "redis://localhost:6379",
|
|
146
|
+
secret: true,
|
|
147
|
+
dependsOn: { fieldId: "storage.provider", equals: "redis" },
|
|
146
148
|
},
|
|
147
149
|
{
|
|
148
|
-
id: "
|
|
150
|
+
id: "env.UPSTASH_REDIS_REST_URL",
|
|
149
151
|
domain: "storage",
|
|
150
|
-
target: "
|
|
151
|
-
path: "
|
|
152
|
+
target: "env",
|
|
153
|
+
path: "UPSTASH_REDIS_REST_URL",
|
|
154
|
+
kind: "string",
|
|
155
|
+
scopes: ["full"],
|
|
156
|
+
label: "Upstash REST URL",
|
|
157
|
+
prompt: "Upstash Redis REST URL",
|
|
158
|
+
defaultValue: "",
|
|
159
|
+
placeholder: "https://...",
|
|
160
|
+
dependsOn: { fieldId: "storage.provider", equals: "upstash" },
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: "env.UPSTASH_REDIS_REST_TOKEN",
|
|
164
|
+
domain: "storage",
|
|
165
|
+
target: "env",
|
|
166
|
+
path: "UPSTASH_REDIS_REST_TOKEN",
|
|
152
167
|
kind: "string",
|
|
153
168
|
scopes: ["full"],
|
|
154
|
-
label: "
|
|
155
|
-
prompt: "
|
|
169
|
+
label: "Upstash REST token",
|
|
170
|
+
prompt: "Upstash Redis REST token",
|
|
156
171
|
defaultValue: "",
|
|
172
|
+
secret: true,
|
|
157
173
|
dependsOn: { fieldId: "storage.provider", equals: "upstash" },
|
|
158
174
|
},
|
|
159
175
|
{
|
|
@@ -279,6 +295,7 @@ export const ONBOARDING_FIELDS = [
|
|
|
279
295
|
options: [
|
|
280
296
|
{ value: "none", label: "None" },
|
|
281
297
|
{ value: "slack", label: "Slack" },
|
|
298
|
+
{ value: "resend", label: "Email (Resend)" },
|
|
282
299
|
],
|
|
283
300
|
},
|
|
284
301
|
{
|
|
@@ -308,6 +325,76 @@ export const ONBOARDING_FIELDS = [
|
|
|
308
325
|
secret: true,
|
|
309
326
|
dependsOn: { fieldId: "messaging.platform", equals: "slack" },
|
|
310
327
|
},
|
|
328
|
+
{
|
|
329
|
+
id: "env.RESEND_API_KEY",
|
|
330
|
+
domain: "messaging",
|
|
331
|
+
target: "env",
|
|
332
|
+
path: "RESEND_API_KEY",
|
|
333
|
+
kind: "string",
|
|
334
|
+
scopes: ["full"],
|
|
335
|
+
label: "Resend API Key",
|
|
336
|
+
prompt: "Resend API Key (from resend.com/api-keys)",
|
|
337
|
+
defaultValue: "",
|
|
338
|
+
placeholder: "re_...",
|
|
339
|
+
secret: true,
|
|
340
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" },
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
id: "env.RESEND_WEBHOOK_SECRET",
|
|
344
|
+
domain: "messaging",
|
|
345
|
+
target: "env",
|
|
346
|
+
path: "RESEND_WEBHOOK_SECRET",
|
|
347
|
+
kind: "string",
|
|
348
|
+
scopes: ["full"],
|
|
349
|
+
label: "Resend Webhook Secret",
|
|
350
|
+
prompt: "Resend Webhook Signing Secret (from webhook details page)",
|
|
351
|
+
defaultValue: "",
|
|
352
|
+
placeholder: "whsec_...",
|
|
353
|
+
secret: true,
|
|
354
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" },
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
id: "env.RESEND_FROM",
|
|
358
|
+
domain: "messaging",
|
|
359
|
+
target: "env",
|
|
360
|
+
path: "RESEND_FROM",
|
|
361
|
+
kind: "string",
|
|
362
|
+
scopes: ["full"],
|
|
363
|
+
label: "From Address",
|
|
364
|
+
prompt: "Email address the agent sends from (e.g. Agent <agent@yourdomain.com>)",
|
|
365
|
+
defaultValue: "",
|
|
366
|
+
placeholder: "Agent <agent@yourdomain.com>",
|
|
367
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" },
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
id: "messaging.resend.mode",
|
|
371
|
+
domain: "messaging",
|
|
372
|
+
target: "agent",
|
|
373
|
+
path: "messaging.resend.mode",
|
|
374
|
+
kind: "select",
|
|
375
|
+
scopes: ["full"],
|
|
376
|
+
label: "Email response mode",
|
|
377
|
+
prompt: "How should the agent respond to emails?",
|
|
378
|
+
defaultValue: "auto-reply",
|
|
379
|
+
options: [
|
|
380
|
+
{ value: "auto-reply", label: "Auto-reply (agent response sent as email reply)" },
|
|
381
|
+
{ value: "tool", label: "Tool (agent uses send_email tool for full control)" },
|
|
382
|
+
],
|
|
383
|
+
dependsOn: { fieldId: "messaging.platform", equals: "resend" },
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
id: "messaging.resend.allowedRecipients",
|
|
387
|
+
domain: "messaging",
|
|
388
|
+
target: "agent",
|
|
389
|
+
path: "messaging.resend.allowedRecipients",
|
|
390
|
+
kind: "string",
|
|
391
|
+
scopes: ["full"],
|
|
392
|
+
label: "Allowed recipients",
|
|
393
|
+
prompt: "Allowed recipient patterns for send_email tool (comma-separated, e.g. *@mycompany.com). Leave empty for no restrictions.",
|
|
394
|
+
defaultValue: "",
|
|
395
|
+
placeholder: "*@mycompany.com, partner@external.com",
|
|
396
|
+
dependsOn: { fieldId: "messaging.resend.mode", equals: "tool" },
|
|
397
|
+
},
|
|
311
398
|
] as const satisfies readonly OnboardingField[];
|
|
312
399
|
|
|
313
400
|
export const FEATURE_DOMAIN_ORDER: readonly FeatureDomain[] = [
|
package/src/index.ts
CHANGED
|
@@ -93,11 +93,13 @@ export interface FileInput {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export interface RunInput {
|
|
96
|
-
task
|
|
96
|
+
task?: string;
|
|
97
97
|
parameters?: Record<string, unknown>;
|
|
98
98
|
messages?: Message[];
|
|
99
99
|
files?: FileInput[];
|
|
100
100
|
abortSignal?: AbortSignal;
|
|
101
|
+
/** When set, Latitude telemetry groups all turns in this conversation under a single trace. */
|
|
102
|
+
conversationId?: string;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
export interface TokenUsage {
|
|
@@ -123,7 +125,7 @@ export interface AgentFailure {
|
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
export type AgentEvent =
|
|
126
|
-
| { type: "run:started"; runId: string; agentId: string }
|
|
128
|
+
| { type: "run:started"; runId: string; agentId: string; contextWindow?: number }
|
|
127
129
|
| { type: "run:completed"; runId: string; result: RunResult }
|
|
128
130
|
| { type: "run:cancelled"; runId: string }
|
|
129
131
|
| { type: "run:error"; runId: string; error: AgentFailure }
|
|
@@ -142,4 +144,13 @@ export type AgentEvent =
|
|
|
142
144
|
approvalId: string;
|
|
143
145
|
}
|
|
144
146
|
| { type: "tool:approval:granted"; approvalId: string }
|
|
145
|
-
| { type: "tool:approval:denied"; approvalId: string; reason?: string }
|
|
147
|
+
| { type: "tool:approval:denied"; approvalId: string; reason?: string }
|
|
148
|
+
| {
|
|
149
|
+
type: "tool:approval:checkpoint";
|
|
150
|
+
approvalId: string;
|
|
151
|
+
tool: string;
|
|
152
|
+
toolCallId: string;
|
|
153
|
+
input: Record<string, unknown>;
|
|
154
|
+
checkpointMessages: Message[];
|
|
155
|
+
pendingToolCalls: Array<{ id: string; name: string; input: Record<string, unknown> }>;
|
|
156
|
+
};
|