@poncho-ai/sdk 0.5.0 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/sdk@0.5.0 build /Users/cesar/Dev/latitude/poncho-ai/packages/sdk
2
+ > @poncho-ai/sdk@1.0.0 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
- ESM dist/index.js 6.16 KB
11
- ESM ⚡️ Build success in 49ms
10
+ ESM dist/index.js 6.37 KB
11
+ ESM ⚡️ Build success in 20ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 1221ms
14
- DTS dist/index.d.ts 12.51 KB
13
+ DTS ⚡️ Build success in 1218ms
14
+ DTS dist/index.d.ts 13.27 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @poncho-ai/sdk
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`035e8b3`](https://github.com/cesr/poncho-ai/commit/035e8b300ac4de6e7cbc4e2ab6bd06cdfd0e1ae3) Thanks [@cesr](https://github.com/cesr)! - Add multimodal file support for agents — images, PDFs, and text files can be uploaded via the web UI, HTTP API, and terminal CLI. Includes pluggable upload storage (local, Vercel Blob, S3), write-behind caching, build-time dependency injection, and graceful handling of unsupported formats.
8
+
9
+ ## 0.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`a1df23f`](https://github.com/cesr/poncho-ai/commit/a1df23f339d815c30948ebcd275209366a3d2a72) Thanks [@cesr](https://github.com/cesr)! - Add cooperative run cancellation: stop active runs via Ctrl+C (CLI), stop button (Web UI), or the /stop API endpoint. Partial output is preserved and empty assistant messages are skipped to prevent conversation corruption.
14
+
3
15
  ## 0.5.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -302,9 +302,21 @@ type JsonSchema = {
302
302
  [key: string]: unknown;
303
303
  };
304
304
  type Role = "system" | "user" | "assistant" | "tool";
305
+ interface TextContentPart {
306
+ type: "text";
307
+ text: string;
308
+ }
309
+ interface FileContentPart {
310
+ type: "file";
311
+ /** base64 data, data: URI, https:// URL, or poncho-upload:// reference */
312
+ data: string;
313
+ mediaType: string;
314
+ filename?: string;
315
+ }
316
+ type ContentPart = TextContentPart | FileContentPart;
305
317
  interface Message {
306
318
  role: Role;
307
- content: string;
319
+ content: string | ContentPart[];
308
320
  metadata?: {
309
321
  id?: string;
310
322
  timestamp?: number;
@@ -317,6 +329,8 @@ interface Message {
317
329
  }>;
318
330
  };
319
331
  }
332
+ /** Extract the text content from a message, regardless of content format. */
333
+ declare const getTextContent: (message: Message) => string;
320
334
  interface ToolContext {
321
335
  runId: string;
322
336
  agentId: string;
@@ -338,10 +352,17 @@ interface ToolDefinition<TInput extends Record<string, unknown> = Record<string,
338
352
  }
339
353
  declare const defineTool: <TInput extends Record<string, unknown>, TOutput = unknown>(definition: ToolDefinition<TInput, TOutput>) => ToolDefinition<TInput, TOutput>;
340
354
 
355
+ interface FileInput {
356
+ /** base64 data, data: URI, or https:// URL */
357
+ data: string;
358
+ mediaType: string;
359
+ filename?: string;
360
+ }
341
361
  interface RunInput {
342
362
  task: string;
343
363
  parameters?: Record<string, unknown>;
344
364
  messages?: Message[];
365
+ files?: FileInput[];
345
366
  abortSignal?: AbortSignal;
346
367
  }
347
368
  interface TokenUsage {
@@ -355,6 +376,8 @@ interface RunResult {
355
376
  steps: number;
356
377
  tokens: TokenUsage;
357
378
  duration: number;
379
+ continuation?: boolean;
380
+ maxSteps?: number;
358
381
  }
359
382
  interface AgentFailure {
360
383
  code: string;
@@ -420,4 +443,4 @@ type AgentEvent = {
420
443
  reason?: string;
421
444
  };
422
445
 
423
- export { type AgentEvent, type AgentFailure, FEATURE_DOMAIN_ORDER, type FeatureDomain, 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 TokenUsage, type ToolContext, type ToolDefinition, type ToolHandler, defineTool, fieldsForScope };
446
+ 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
@@ -236,10 +236,15 @@ var fieldsForScope = (scope) => ONBOARDING_FIELDS.filter(
236
236
  );
237
237
 
238
238
  // src/index.ts
239
+ var getTextContent = (message) => {
240
+ if (typeof message.content === "string") return message.content;
241
+ return message.content.filter((p) => p.type === "text").map((p) => p.text).join("");
242
+ };
239
243
  var defineTool = (definition) => definition;
240
244
  export {
241
245
  FEATURE_DOMAIN_ORDER,
242
246
  ONBOARDING_FIELDS,
243
247
  defineTool,
244
- fieldsForScope
248
+ fieldsForScope,
249
+ getTextContent
245
250
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/sdk",
3
- "version": "0.5.0",
3
+ "version": "1.0.0",
4
4
  "description": "Core types and utilities for building Poncho skills",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -11,9 +11,24 @@ export type JsonSchema = {
11
11
 
12
12
  export type Role = "system" | "user" | "assistant" | "tool";
13
13
 
14
+ export interface TextContentPart {
15
+ type: "text";
16
+ text: string;
17
+ }
18
+
19
+ export interface FileContentPart {
20
+ type: "file";
21
+ /** base64 data, data: URI, https:// URL, or poncho-upload:// reference */
22
+ data: string;
23
+ mediaType: string;
24
+ filename?: string;
25
+ }
26
+
27
+ export type ContentPart = TextContentPart | FileContentPart;
28
+
14
29
  export interface Message {
15
30
  role: Role;
16
- content: string;
31
+ content: string | ContentPart[];
17
32
  metadata?: {
18
33
  id?: string;
19
34
  timestamp?: number;
@@ -24,6 +39,15 @@ export interface Message {
24
39
  };
25
40
  }
26
41
 
42
+ /** Extract the text content from a message, regardless of content format. */
43
+ export const getTextContent = (message: Message): string => {
44
+ if (typeof message.content === "string") return message.content;
45
+ return message.content
46
+ .filter((p): p is TextContentPart => p.type === "text")
47
+ .map((p) => p.text)
48
+ .join("");
49
+ };
50
+
27
51
  export interface ToolContext {
28
52
  runId: string;
29
53
  agentId: string;
@@ -61,10 +85,18 @@ export const defineTool = <
61
85
 
62
86
  export * from "./config-registry.js";
63
87
 
88
+ export interface FileInput {
89
+ /** base64 data, data: URI, or https:// URL */
90
+ data: string;
91
+ mediaType: string;
92
+ filename?: string;
93
+ }
94
+
64
95
  export interface RunInput {
65
96
  task: string;
66
97
  parameters?: Record<string, unknown>;
67
98
  messages?: Message[];
99
+ files?: FileInput[];
68
100
  abortSignal?: AbortSignal;
69
101
  }
70
102
 
@@ -80,6 +112,8 @@ export interface RunResult {
80
112
  steps: number;
81
113
  tokens: TokenUsage;
82
114
  duration: number;
115
+ continuation?: boolean;
116
+ maxSteps?: number;
83
117
  }
84
118
 
85
119
  export interface AgentFailure {
@@ -1,14 +0,0 @@
1
-
2
- > @poncho-ai/sdk@0.1.0 test /Users/cesar/Dev/latitude/agentl/packages/sdk
3
- > vitest
4
-
5
-
6
-  RUN  v1.6.1 /Users/cesar/Dev/latitude/agentl/packages/sdk
7
-
8
- ✓ test/sdk.test.ts  (1 test) 2ms
9
-
10
-  Test Files  1 passed (1)
11
-  Tests  1 passed (1)
12
-  Start at  12:05:57
13
-  Duration  475ms (transform 97ms, setup 0ms, collect 90ms, tests 2ms, environment 0ms, prepare 102ms)
14
-