@opencow-ai/opencow-agent-sdk 0.4.10 → 0.4.12
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/dist/capabilities/adapters/callToolResultAdapter.d.ts +8 -0
- package/dist/capabilities/tools/FileReadTool/FileReadTool.d.ts +8 -0
- package/dist/cli.mjs +213 -159
- package/dist/client.js +206 -151
- package/dist/entrypoints/sdk/runtimeTypes.d.ts +16 -0
- package/dist/providers/shared/dsmlSentinel.d.ts +5 -0
- package/dist/sdk.js +206 -151
- package/dist/session/canonical/imageSource.d.ts +37 -0
- package/dist/session/canonical/index.d.ts +2 -1
- package/dist/session/canonical/types.d.ts +5 -1
- package/dist/types/toolRuntime.d.ts +23 -0
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
*/
|
|
43
43
|
import type { ContentBlock, PromptMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
44
44
|
import type { CanonicalContentBlockParam as ContentBlockParam } from '../../session/canonical/index.js';
|
|
45
|
+
import type { UploadMediaFn } from '../../types/toolRuntime.js';
|
|
45
46
|
/** Options threaded into per-item translation. */
|
|
46
47
|
export type CallToolResultAdapterOptions = Readonly<{
|
|
47
48
|
/**
|
|
@@ -49,6 +50,13 @@ export type CallToolResultAdapterOptions = Readonly<{
|
|
|
49
50
|
* embedded resources. Example: `[Resource from <sourceName> at <uri>] ...`.
|
|
50
51
|
*/
|
|
51
52
|
sourceName: string;
|
|
53
|
+
/**
|
|
54
|
+
* Host-injected media uploader (see `ToolRuntimeContext.uploadMedia`). When
|
|
55
|
+
* present, image content is materialized to a fetchable URL so the bytes
|
|
56
|
+
* leave the per-turn request; absent / null / throw → inline base64 (zero
|
|
57
|
+
* regression for the real MCP transport path, which passes nothing).
|
|
58
|
+
*/
|
|
59
|
+
uploadMedia?: UploadMediaFn;
|
|
52
60
|
}>;
|
|
53
61
|
/**
|
|
54
62
|
* Translate ONE MCP content item into zero or more Anthropic content blocks.
|
|
@@ -37,6 +37,7 @@ declare const outputSchema: () => z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
37
37
|
"image/webp": "image/webp";
|
|
38
38
|
}>;
|
|
39
39
|
originalSize: z.ZodNumber;
|
|
40
|
+
url: z.ZodOptional<z.ZodString>;
|
|
40
41
|
dimensions: z.ZodOptional<z.ZodObject<{
|
|
41
42
|
originalWidth: z.ZodOptional<z.ZodNumber>;
|
|
42
43
|
originalHeight: z.ZodOptional<z.ZodNumber>;
|
|
@@ -92,6 +93,13 @@ type ImageResult = {
|
|
|
92
93
|
type: Base64ImageSource['media_type'];
|
|
93
94
|
originalSize: number;
|
|
94
95
|
dimensions?: ImageDimensions;
|
|
96
|
+
/**
|
|
97
|
+
* Set when a host uploader (context.uploadMedia) materialized the
|
|
98
|
+
* compressed bytes to a fetchable URL. The mapper then emits a `url`
|
|
99
|
+
* image source so the bytes leave the per-turn request; `base64` stays
|
|
100
|
+
* as the fallback field for renderers / hosts without the URL.
|
|
101
|
+
*/
|
|
102
|
+
url?: string;
|
|
95
103
|
};
|
|
96
104
|
};
|
|
97
105
|
/**
|