@poncho-ai/sdk 1.4.0 → 1.5.0
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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +29 -0
- package/package.json +1 -1
- package/src/config-registry.ts +29 -0
- package/src/index.ts +12 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/sdk@1.
|
|
2
|
+
> @poncho-ai/sdk@1.5.0 build /home/runner/work/poncho-ai/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[32m11.44 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 20ms
|
|
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 1276ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m21.84 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @poncho-ai/sdk
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6f0abfd`](https://github.com/cesr/poncho-ai/commit/6f0abfd9f729b545cf293741ee813f705910aaf3) Thanks [@cesr](https://github.com/cesr)! - Add context compaction for long conversations. Automatically summarizes older messages when the context window fills up, keeping conversations going indefinitely. Includes auto-compaction in the run loop, `/compact` command, Web UI divider with expandable summary, and visual history preservation.
|
|
8
|
+
|
|
9
|
+
## 1.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`de28ef5`](https://github.com/cesr/poncho-ai/commit/de28ef5acceed921269d15816acd392f5208f03d) Thanks [@cesr](https://github.com/cesr)! - Add Telegram messaging adapter with private/group chat support, file attachments, /new command, and typing indicators.
|
|
14
|
+
|
|
3
15
|
## 1.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -321,6 +321,9 @@ declare const ONBOARDING_FIELDS: readonly [{
|
|
|
321
321
|
}, {
|
|
322
322
|
readonly value: "slack";
|
|
323
323
|
readonly label: "Slack";
|
|
324
|
+
}, {
|
|
325
|
+
readonly value: "telegram";
|
|
326
|
+
readonly label: "Telegram";
|
|
324
327
|
}, {
|
|
325
328
|
readonly value: "resend";
|
|
326
329
|
readonly label: "Email (Resend)";
|
|
@@ -356,6 +359,38 @@ declare const ONBOARDING_FIELDS: readonly [{
|
|
|
356
359
|
readonly fieldId: "messaging.platform";
|
|
357
360
|
readonly equals: "slack";
|
|
358
361
|
};
|
|
362
|
+
}, {
|
|
363
|
+
readonly id: "env.TELEGRAM_BOT_TOKEN";
|
|
364
|
+
readonly domain: "messaging";
|
|
365
|
+
readonly target: "env";
|
|
366
|
+
readonly path: "TELEGRAM_BOT_TOKEN";
|
|
367
|
+
readonly kind: "string";
|
|
368
|
+
readonly scopes: ["full"];
|
|
369
|
+
readonly label: "Telegram Bot Token";
|
|
370
|
+
readonly prompt: "Telegram Bot Token (from @BotFather)";
|
|
371
|
+
readonly defaultValue: "";
|
|
372
|
+
readonly placeholder: "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11";
|
|
373
|
+
readonly secret: true;
|
|
374
|
+
readonly dependsOn: {
|
|
375
|
+
readonly fieldId: "messaging.platform";
|
|
376
|
+
readonly equals: "telegram";
|
|
377
|
+
};
|
|
378
|
+
}, {
|
|
379
|
+
readonly id: "env.TELEGRAM_WEBHOOK_SECRET";
|
|
380
|
+
readonly domain: "messaging";
|
|
381
|
+
readonly target: "env";
|
|
382
|
+
readonly path: "TELEGRAM_WEBHOOK_SECRET";
|
|
383
|
+
readonly kind: "string";
|
|
384
|
+
readonly scopes: ["full"];
|
|
385
|
+
readonly label: "Telegram Webhook Secret";
|
|
386
|
+
readonly prompt: "Webhook secret token (optional, recommended for security)";
|
|
387
|
+
readonly defaultValue: "";
|
|
388
|
+
readonly placeholder: "my-secret-token";
|
|
389
|
+
readonly secret: true;
|
|
390
|
+
readonly dependsOn: {
|
|
391
|
+
readonly fieldId: "messaging.platform";
|
|
392
|
+
readonly equals: "telegram";
|
|
393
|
+
};
|
|
359
394
|
}, {
|
|
360
395
|
readonly id: "env.RESEND_API_KEY";
|
|
361
396
|
readonly domain: "messaging";
|
|
@@ -494,6 +529,7 @@ interface Message {
|
|
|
494
529
|
type: "text" | "tools";
|
|
495
530
|
content: string | string[];
|
|
496
531
|
}>;
|
|
532
|
+
isCompactionSummary?: boolean;
|
|
497
533
|
};
|
|
498
534
|
}
|
|
499
535
|
/** Extract the text content from a message, regardless of content format. */
|
|
@@ -666,6 +702,19 @@ type AgentEvent = {
|
|
|
666
702
|
tool: string;
|
|
667
703
|
approvalId: string;
|
|
668
704
|
input?: Record<string, unknown>;
|
|
705
|
+
} | {
|
|
706
|
+
type: "compaction:started";
|
|
707
|
+
estimatedTokens: number;
|
|
708
|
+
} | {
|
|
709
|
+
type: "compaction:completed";
|
|
710
|
+
tokensBefore: number;
|
|
711
|
+
tokensAfter: number;
|
|
712
|
+
messagesBefore: number;
|
|
713
|
+
messagesAfter: number;
|
|
714
|
+
compactedMessages?: Message[];
|
|
715
|
+
} | {
|
|
716
|
+
type: "compaction:warning";
|
|
717
|
+
reason: string;
|
|
669
718
|
};
|
|
670
719
|
|
|
671
720
|
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
|
@@ -250,6 +250,7 @@ var ONBOARDING_FIELDS = [
|
|
|
250
250
|
options: [
|
|
251
251
|
{ value: "none", label: "None" },
|
|
252
252
|
{ value: "slack", label: "Slack" },
|
|
253
|
+
{ value: "telegram", label: "Telegram" },
|
|
253
254
|
{ value: "resend", label: "Email (Resend)" }
|
|
254
255
|
]
|
|
255
256
|
},
|
|
@@ -280,6 +281,34 @@ var ONBOARDING_FIELDS = [
|
|
|
280
281
|
secret: true,
|
|
281
282
|
dependsOn: { fieldId: "messaging.platform", equals: "slack" }
|
|
282
283
|
},
|
|
284
|
+
{
|
|
285
|
+
id: "env.TELEGRAM_BOT_TOKEN",
|
|
286
|
+
domain: "messaging",
|
|
287
|
+
target: "env",
|
|
288
|
+
path: "TELEGRAM_BOT_TOKEN",
|
|
289
|
+
kind: "string",
|
|
290
|
+
scopes: ["full"],
|
|
291
|
+
label: "Telegram Bot Token",
|
|
292
|
+
prompt: "Telegram Bot Token (from @BotFather)",
|
|
293
|
+
defaultValue: "",
|
|
294
|
+
placeholder: "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
|
|
295
|
+
secret: true,
|
|
296
|
+
dependsOn: { fieldId: "messaging.platform", equals: "telegram" }
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: "env.TELEGRAM_WEBHOOK_SECRET",
|
|
300
|
+
domain: "messaging",
|
|
301
|
+
target: "env",
|
|
302
|
+
path: "TELEGRAM_WEBHOOK_SECRET",
|
|
303
|
+
kind: "string",
|
|
304
|
+
scopes: ["full"],
|
|
305
|
+
label: "Telegram Webhook Secret",
|
|
306
|
+
prompt: "Webhook secret token (optional, recommended for security)",
|
|
307
|
+
defaultValue: "",
|
|
308
|
+
placeholder: "my-secret-token",
|
|
309
|
+
secret: true,
|
|
310
|
+
dependsOn: { fieldId: "messaging.platform", equals: "telegram" }
|
|
311
|
+
},
|
|
283
312
|
{
|
|
284
313
|
id: "env.RESEND_API_KEY",
|
|
285
314
|
domain: "messaging",
|
package/package.json
CHANGED
package/src/config-registry.ts
CHANGED
|
@@ -295,6 +295,7 @@ export const ONBOARDING_FIELDS = [
|
|
|
295
295
|
options: [
|
|
296
296
|
{ value: "none", label: "None" },
|
|
297
297
|
{ value: "slack", label: "Slack" },
|
|
298
|
+
{ value: "telegram", label: "Telegram" },
|
|
298
299
|
{ value: "resend", label: "Email (Resend)" },
|
|
299
300
|
],
|
|
300
301
|
},
|
|
@@ -325,6 +326,34 @@ export const ONBOARDING_FIELDS = [
|
|
|
325
326
|
secret: true,
|
|
326
327
|
dependsOn: { fieldId: "messaging.platform", equals: "slack" },
|
|
327
328
|
},
|
|
329
|
+
{
|
|
330
|
+
id: "env.TELEGRAM_BOT_TOKEN",
|
|
331
|
+
domain: "messaging",
|
|
332
|
+
target: "env",
|
|
333
|
+
path: "TELEGRAM_BOT_TOKEN",
|
|
334
|
+
kind: "string",
|
|
335
|
+
scopes: ["full"],
|
|
336
|
+
label: "Telegram Bot Token",
|
|
337
|
+
prompt: "Telegram Bot Token (from @BotFather)",
|
|
338
|
+
defaultValue: "",
|
|
339
|
+
placeholder: "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
|
|
340
|
+
secret: true,
|
|
341
|
+
dependsOn: { fieldId: "messaging.platform", equals: "telegram" },
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "env.TELEGRAM_WEBHOOK_SECRET",
|
|
345
|
+
domain: "messaging",
|
|
346
|
+
target: "env",
|
|
347
|
+
path: "TELEGRAM_WEBHOOK_SECRET",
|
|
348
|
+
kind: "string",
|
|
349
|
+
scopes: ["full"],
|
|
350
|
+
label: "Telegram Webhook Secret",
|
|
351
|
+
prompt: "Webhook secret token (optional, recommended for security)",
|
|
352
|
+
defaultValue: "",
|
|
353
|
+
placeholder: "my-secret-token",
|
|
354
|
+
secret: true,
|
|
355
|
+
dependsOn: { fieldId: "messaging.platform", equals: "telegram" },
|
|
356
|
+
},
|
|
328
357
|
{
|
|
329
358
|
id: "env.RESEND_API_KEY",
|
|
330
359
|
domain: "messaging",
|
package/src/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export interface Message {
|
|
|
36
36
|
step?: number;
|
|
37
37
|
toolActivity?: string[];
|
|
38
38
|
sections?: Array<{ type: "text" | "tools"; content: string | string[] }>;
|
|
39
|
+
isCompactionSummary?: boolean;
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -176,4 +177,14 @@ export type AgentEvent =
|
|
|
176
177
|
tool: string;
|
|
177
178
|
approvalId: string;
|
|
178
179
|
input?: Record<string, unknown>;
|
|
179
|
-
}
|
|
180
|
+
}
|
|
181
|
+
| { type: "compaction:started"; estimatedTokens: number }
|
|
182
|
+
| {
|
|
183
|
+
type: "compaction:completed";
|
|
184
|
+
tokensBefore: number;
|
|
185
|
+
tokensAfter: number;
|
|
186
|
+
messagesBefore: number;
|
|
187
|
+
messagesAfter: number;
|
|
188
|
+
compactedMessages?: Message[];
|
|
189
|
+
}
|
|
190
|
+
| { type: "compaction:warning"; reason: string };
|