@poncho-ai/harness 0.11.2 → 0.12.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 +11 -0
- package/dist/index.d.ts +53 -1
- package/dist/index.js +583 -133
- package/package.json +2 -2
- package/src/config.ts +10 -0
- package/src/harness.ts +191 -23
- package/src/index.ts +1 -0
- package/src/upload-store.ts +387 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.
|
|
2
|
+
> @poncho-ai/harness@0.12.0 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
|
|
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[32m158.98 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 59ms
|
|
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 4596ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m19.34 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor 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
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`035e8b3`](https://github.com/cesr/poncho-ai/commit/035e8b300ac4de6e7cbc4e2ab6bd06cdfd0e1ae3)]:
|
|
12
|
+
- @poncho-ai/sdk@1.0.0
|
|
13
|
+
|
|
3
14
|
## 0.11.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -216,6 +216,14 @@ interface StorageConfig {
|
|
|
216
216
|
maxRecallConversations?: number;
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
+
interface UploadsConfig {
|
|
220
|
+
provider?: "local" | "vercel-blob" | "s3";
|
|
221
|
+
/** Vercel Blob access mode. Must match the store's configuration. Defaults to "public". */
|
|
222
|
+
access?: "public" | "private";
|
|
223
|
+
bucket?: string;
|
|
224
|
+
region?: string;
|
|
225
|
+
endpoint?: string;
|
|
226
|
+
}
|
|
219
227
|
type BuiltInToolToggles = {
|
|
220
228
|
list_directory?: boolean;
|
|
221
229
|
read_file?: boolean;
|
|
@@ -259,6 +267,7 @@ interface PonchoConfig extends McpConfig {
|
|
|
259
267
|
/** Extra directories (relative to project root) to scan for skills.
|
|
260
268
|
* `skills/` and `.poncho/skills/` are always scanned. */
|
|
261
269
|
skillPaths?: string[];
|
|
270
|
+
uploads?: UploadsConfig;
|
|
262
271
|
build?: {
|
|
263
272
|
vercel?: Record<string, unknown>;
|
|
264
273
|
docker?: Record<string, unknown>;
|
|
@@ -273,6 +282,47 @@ declare const loadPonchoConfig: (workingDir: string) => Promise<PonchoConfig | u
|
|
|
273
282
|
declare const createDefaultTools: (workingDir: string) => ToolDefinition[];
|
|
274
283
|
declare const createWriteTool: (workingDir: string) => ToolDefinition;
|
|
275
284
|
|
|
285
|
+
declare const PONCHO_UPLOAD_SCHEME = "poncho-upload://";
|
|
286
|
+
interface UploadStore {
|
|
287
|
+
put(key: string, data: Buffer, mediaType: string): Promise<string>;
|
|
288
|
+
get(urlOrKey: string): Promise<Buffer>;
|
|
289
|
+
delete(urlOrKey: string): Promise<void>;
|
|
290
|
+
}
|
|
291
|
+
/** Derive a content-addressed key from file data. */
|
|
292
|
+
declare const deriveUploadKey: (data: Buffer, mediaType: string) => string;
|
|
293
|
+
declare class LocalUploadStore implements UploadStore {
|
|
294
|
+
private readonly uploadsDir;
|
|
295
|
+
constructor(workingDir: string);
|
|
296
|
+
put(_key: string, data: Buffer, mediaType: string): Promise<string>;
|
|
297
|
+
get(urlOrKey: string): Promise<Buffer>;
|
|
298
|
+
delete(urlOrKey: string): Promise<void>;
|
|
299
|
+
}
|
|
300
|
+
declare class VercelBlobUploadStore implements UploadStore {
|
|
301
|
+
private sdk;
|
|
302
|
+
private readonly workingDir?;
|
|
303
|
+
private readonly access;
|
|
304
|
+
constructor(workingDir?: string, access?: "public" | "private");
|
|
305
|
+
loadSdk(): Promise<any>;
|
|
306
|
+
put(key: string, data: Buffer, mediaType: string): Promise<string>;
|
|
307
|
+
get(urlOrKey: string): Promise<Buffer>;
|
|
308
|
+
delete(urlOrKey: string): Promise<void>;
|
|
309
|
+
}
|
|
310
|
+
declare class S3UploadStore implements UploadStore {
|
|
311
|
+
private s3Sdk;
|
|
312
|
+
private presignerSdk;
|
|
313
|
+
private client;
|
|
314
|
+
private readonly bucket;
|
|
315
|
+
private readonly region?;
|
|
316
|
+
private readonly endpoint?;
|
|
317
|
+
private readonly workingDir?;
|
|
318
|
+
constructor(bucket: string, region?: string, endpoint?: string, workingDir?: string);
|
|
319
|
+
ensureClient(): Promise<void>;
|
|
320
|
+
put(key: string, data: Buffer, mediaType: string): Promise<string>;
|
|
321
|
+
get(urlOrKey: string): Promise<Buffer>;
|
|
322
|
+
delete(urlOrKey: string): Promise<void>;
|
|
323
|
+
}
|
|
324
|
+
declare const createUploadStore: (config: UploadsConfig | undefined, workingDir: string) => Promise<UploadStore>;
|
|
325
|
+
|
|
276
326
|
type ModelProviderFactory = (modelName: string) => LanguageModel;
|
|
277
327
|
/**
|
|
278
328
|
* Creates a model provider factory for the specified AI provider
|
|
@@ -293,6 +343,7 @@ interface HarnessOptions {
|
|
|
293
343
|
approvalId: string;
|
|
294
344
|
}) => Promise<boolean> | boolean;
|
|
295
345
|
modelProvider?: ModelProviderFactory;
|
|
346
|
+
uploadStore?: UploadStore;
|
|
296
347
|
}
|
|
297
348
|
interface HarnessRunOutput {
|
|
298
349
|
runId: string;
|
|
@@ -307,6 +358,7 @@ declare class AgentHarness {
|
|
|
307
358
|
private readonly modelProviderInjected;
|
|
308
359
|
private readonly dispatcher;
|
|
309
360
|
private readonly approvalHandler?;
|
|
361
|
+
readonly uploadStore?: UploadStore;
|
|
310
362
|
private skillContextWindow;
|
|
311
363
|
private memoryStore?;
|
|
312
364
|
private loadedConfig?;
|
|
@@ -495,4 +547,4 @@ declare class ToolDispatcher {
|
|
|
495
547
|
executeBatch(calls: ToolCall[], context: ToolContext): Promise<ToolExecutionResult[]>;
|
|
496
548
|
}
|
|
497
549
|
|
|
498
|
-
export { type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, type Conversation, type ConversationState, type ConversationStore, type HarnessOptions, type HarnessRunOutput, InMemoryConversationStore, InMemoryStateStore, LatitudeCapture, type LatitudeCaptureConfig, LocalMcpBridge, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type ModelProviderFactory, type ParsedAgent, type PonchoConfig, type RemoteMcpServerConfig, type RuntimeRenderContext, STORAGE_SCHEMA_VERSION, type SkillContextEntry, type SkillMetadata, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type TelemetryConfig, TelemetryEmitter, type ToolCall, ToolDispatcher, type ToolExecutionResult, buildAgentDirectoryName, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createWriteTool, ensureAgentIdentity, generateAgentId, getAgentStoreDirectory, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent };
|
|
550
|
+
export { type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, type Conversation, type ConversationState, type ConversationStore, type HarnessOptions, type HarnessRunOutput, InMemoryConversationStore, InMemoryStateStore, LatitudeCapture, type LatitudeCaptureConfig, LocalMcpBridge, LocalUploadStore, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type ModelProviderFactory, PONCHO_UPLOAD_SCHEME, type ParsedAgent, type PonchoConfig, type RemoteMcpServerConfig, type RuntimeRenderContext, S3UploadStore, STORAGE_SCHEMA_VERSION, type SkillContextEntry, type SkillMetadata, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type TelemetryConfig, TelemetryEmitter, type ToolCall, ToolDispatcher, type ToolExecutionResult, type UploadStore, type UploadsConfig, VercelBlobUploadStore, buildAgentDirectoryName, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createUploadStore, createWriteTool, deriveUploadKey, ensureAgentIdentity, generateAgentId, getAgentStoreDirectory, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent };
|