@arvo-tools/agentic 1.2.7 → 1.2.8

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.
@@ -3,8 +3,33 @@ import z from 'zod';
3
3
  import type { AgentInternalTool } from '../AgentTool/types.js';
4
4
  import type { PromiseAble } from '../types.js';
5
5
  import type { AgentContextBuilder, AgentOutputBuilder, AgentServiceContract, AnyArvoOrchestratorContract } from './types.js';
6
+ /**
7
+ * Creates a Zod schema validator for base64-encoded data URLs with MIME type restrictions.
8
+ *
9
+ * Validates that strings match the data URL format (data:mime/type;base64,encodedContent)
10
+ * and optionally restricts to specific MIME types.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const imageSchema = dataUrlString(['image/jpeg', 'image/png']);
15
+ * imageSchema.parse('data:image/jpeg;base64,/9j/4AAQ...'); // Valid
16
+ * imageSchema.parse('data:application/pdf;base64,...'); // Throws - wrong MIME type
17
+ * ```
18
+ */
6
19
  export declare const dataUrlString: (allowedMimeTypes: string[]) => z.ZodEffects<z.ZodString, string, string>;
20
+ /**
21
+ * Default schemas and builders for common agent patterns.
22
+ *
23
+ * Provides ready-to-use implementations for typical agent configurations,
24
+ * reducing boilerplate while remaining customizable. Use these defaults
25
+ * to get started quickly, then customize as needed for specific use cases.
26
+ */
7
27
  export declare const AgentDefaults: {
28
+ /**
29
+ * Default initialization schema accepting a simple text message.
30
+ *
31
+ * Use for basic conversational agents that only need text input.
32
+ */
8
33
  readonly INIT_SCHEMA: z.ZodObject<{
9
34
  message: z.ZodString;
10
35
  }, "strip", z.ZodTypeAny, {
@@ -12,6 +37,18 @@ export declare const AgentDefaults: {
12
37
  }, {
13
38
  message: string;
14
39
  }>;
40
+ /**
41
+ * Multimodal initialization schema supporting text, images, and PDFs.
42
+ *
43
+ * Accepts base64-encoded images (JPEG, PNG, GIF, WebP) and PDF documents
44
+ * alongside the text message. Media content is visible to the LLM only once
45
+ * and should be extracted into conversation history via internal tools
46
+ * if needed for later reference.
47
+ *
48
+ * @remarks
49
+ * The media masking optimization automatically replaces viewed media with
50
+ * placeholder text in subsequent LLM calls to reduce token consumption.
51
+ */
15
52
  readonly INIT_MULTIMODAL_SCHEMA: z.ZodObject<{
16
53
  message: z.ZodString;
17
54
  imageBase64: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
@@ -25,6 +62,11 @@ export declare const AgentDefaults: {
25
62
  imageBase64?: string[] | undefined;
26
63
  pdfBase64?: string[] | undefined;
27
64
  }>;
65
+ /**
66
+ * Default completion schema outputting a simple text response.
67
+ *
68
+ * Use when agents produce conversational text rather than structured data.
69
+ */
28
70
  readonly COMPLETE_SCHEMA: z.ZodObject<{
29
71
  response: z.ZodString;
30
72
  }, "strip", z.ZodTypeAny, {
@@ -32,7 +74,40 @@ export declare const AgentDefaults: {
32
74
  }, {
33
75
  response: string;
34
76
  }>;
77
+ /**
78
+ * Default context builder transforming initialization events into LLM context.
79
+ *
80
+ * Converts the message field into a user message and processes any attached
81
+ * media (images, PDFs) into the conversation history (Assumes the media
82
+ * content to be base64 - ArvoAgent always assumes this internally). Accepts an optional
83
+ * system prompt builder function that receives initialization parameters
84
+ * and available tools for dynamic prompt construction.
85
+ *
86
+ * @param systemPromptBuilder - Optional function returning the system prompt.
87
+ * Receives input event, tools catalog, and contract reference.
88
+ *
89
+ * @returns Context builder function compatible with agent handler configuration
90
+ *
91
+ * @example
92
+ * ```typescript
93
+ * context: AgentDefaults.CONTEXT_BUILDER(({ tools, input }) =>
94
+ * `You are a helpful agent. Use ${tools.tools.dateTool.name} for dates.`
95
+ * )
96
+ * ```
97
+ */
35
98
  readonly CONTEXT_BUILDER: <T extends AnyArvoOrchestratorContract, V extends ArvoSemanticVersion, TServiceContract extends Record<string, AgentServiceContract>, TTools extends Record<string, AgentInternalTool>>(systemPromptBuilder?: (param: Parameters<AgentContextBuilder<T, V, TServiceContract, TTools>>[0]) => PromiseAble<string>) => AgentContextBuilder<T, V, TServiceContract, TTools>;
99
+ /**
100
+ * Default output builder validating agent responses against contract schemas.
101
+ *
102
+ * Handles both text and JSON output modes. For text mode, wraps the LLM's
103
+ * response in the default complete schema structure. For JSON mode, validates
104
+ * parsed content against the output format schema.
105
+ *
106
+ * @remarks
107
+ * Returns either `{ data: validatedOutput }` on success or `{ error: validationError }`
108
+ * on failure. Validation errors trigger the feedback manager's self-correction loop,
109
+ * allowing the LLM to fix malformed outputs.
110
+ */
36
111
  readonly OUTPUT_BUILDER: AgentOutputBuilder;
37
112
  };
38
113
  //# sourceMappingURL=AgentDefaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgentDefaults.d.ts","sourceRoot":"","sources":["../../src/Agent/AgentDefaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EACV,mBAAmB,EAEnB,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,aAAa,GAAI,kBAAkB,MAAM,EAAE,8CAarD,CAAC;AAEJ,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAwBpB,CAAC,SAAS,2BAA2B,EACrC,CAAC,SAAS,mBAAmB,EAC7B,gBAAgB,SAAS,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC7D,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,wBAE1B,CACpB,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KACtE,WAAW,CAAC,MAAM,CAAC,KACvB,m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ty(exports, "__esModule", { value: true });
53
53
  exports.AgentDefaults = exports.dataUrlString = void 0;
54
54
  var uuid_1 = require("uuid");
55
55
  var zod_1 = __importDefault(require("zod"));
56
+ /**
57
+ * Creates a Zod schema validator for base64-encoded data URLs with MIME type restrictions.
58
+ *
59
+ * Validates that strings match the data URL format (data:mime/type;base64,encodedContent)
60
+ * and optionally restricts to specific MIME types.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * const imageSchema = dataUrlString(['image/jpeg', 'image/png']);
65
+ * imageSchema.parse('data:image/jpeg;base64,/9j/4AAQ...'); // Valid
66
+ * imageSchema.parse('data:application/pdf;base64,...'); // Throws - wrong MIME type
67
+ * ```
68
+ */
56
69
  var dataUrlString = function (allowedMimeTypes) {
57
70
  return zod_1.default.string().refine(function (val) {
58
71
  var match = val.match(/^data:([^;]+);base64,/);
@@ -68,10 +81,34 @@ var dataUrlString = function (allowedMimeTypes) {
68
81
  });
69
82
  };
70
83
  exports.dataUrlString = dataUrlString;
84
+ /**
85
+ * Default schemas and builders for common agent patterns.
86
+ *
87
+ * Provides ready-to-use implementations for typical agent configurations,
88
+ * reducing boilerplate while remaining customizable. Use these defaults
89
+ * to get started quickly, then customize as needed for specific use cases.
90
+ */
71
91
  exports.AgentDefaults = {
92
+ /**
93
+ * Default initialization schema accepting a simple text message.
94
+ *
95
+ * Use for basic conversational agents that only need text input.
96
+ */
72
97
  INIT_SCHEMA: zod_1.default.object({
73
98
  message: zod_1.default.string().describe('The input message to the agent'),
74
99
  }),
100
+ /**
101
+ * Multimodal initialization schema supporting text, images, and PDFs.
102
+ *
103
+ * Accepts base64-encoded images (JPEG, PNG, GIF, WebP) and PDF documents
104
+ * alongside the text message. Media content is visible to the LLM only once
105
+ * and should be extracted into conversation history via internal tools
106
+ * if needed for later reference.
107
+ *
108
+ * @remarks
109
+ * The media masking optimization automatically replaces viewed media with
110
+ * placeholder text in subsequent LLM calls to reduce token consumption.
111
+ */
75
112
  INIT_MULTIMODAL_SCHEMA: zod_1.default.object({
76
113
  message: zod_1.default.string().describe('The input message to the agent'),
77
114
  imageBase64: (0, exports.dataUrlString)(['image/jpeg', 'image/png', 'image/gif', 'image/webp'])
@@ -83,9 +120,35 @@ exports.AgentDefaults = {
83
120
  .optional()
84
121
  .describe('An optional list of base64 pdfs to read. An AI Agent must not send data via this field'),
85
122
  }),
123
+ /**
124
+ * Default completion schema outputting a simple text response.
125
+ *
126
+ * Use when agents produce conversational text rather than structured data.
127
+ */
86
128
  COMPLETE_SCHEMA: zod_1.default.object({
87
129
  response: zod_1.default.string().describe('The output response of the agent'),
88
130
  }),
131
+ /**
132
+ * Default context builder transforming initialization events into LLM context.
133
+ *
134
+ * Converts the message field into a user message and processes any attached
135
+ * media (images, PDFs) into the conversation history (Assumes the media
136
+ * content to be base64 - ArvoAgent always assumes this internally). Accepts an optional
137
+ * system prompt builder function that receives initialization parameters
138
+ * and available tools for dynamic prompt construction.
139
+ *
140
+ * @param systemPromptBuilder - Optional function returning the system prompt.
141
+ * Receives input event, tools catalog, and contract reference.
142
+ *
143
+ * @returns Context builder function compatible with agent handler configuration
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * context: AgentDefaults.CONTEXT_BUILDER(({ tools, input }) =>
148
+ * `You are a helpful agent. Use ${tools.tools.dateTool.name} for dates.`
149
+ * )
150
+ * ```
151
+ */
89
152
  CONTEXT_BUILDER: function (systemPromptBuilder) {
90
153
  return function (param) { return __awaiter(void 0, void 0, void 0, function () {
91
154
  var messages, _a, _b, item, _c, _d, item;
@@ -162,12 +225,32 @@ exports.AgentDefaults = {
162
225
  });
163
226
  }); };
164
227
  },
228
+ /**
229
+ * Default output builder validating agent responses against contract schemas.
230
+ *
231
+ * Handles both text and JSON output modes. For text mode, wraps the LLM's
232
+ * response in the default complete schema structure. For JSON mode, validates
233
+ * parsed content against the output format schema.
234
+ *
235
+ * @remarks
236
+ * Returns either `{ data: validatedOutput }` on success or `{ error: validationError }`
237
+ * on failure. Validation errors trigger the feedback manager's self-correction loop,
238
+ * allowing the LLM to fix malformed outputs.
239
+ */
165
240
  OUTPUT_BUILDER: (function (param) {
166
- return {
167
- data: {
168
- response: param.content,
169
- },
170
- };
241
+ var _a;
242
+ if (param.type === 'json') {
243
+ var _b = param.outputFormat.safeParse((_a = param.parsedContent) !== null && _a !== void 0 ? _a : {}), error = _b.error, data = _b.data;
244
+ return error ? { error: error } : { data: data };
245
+ }
246
+ if (param.type === 'text') {
247
+ return {
248
+ data: {
249
+ response: param.content,
250
+ },
251
+ };
252
+ }
253
+ return { error: new Error('The final output must be output format compliant only') };
171
254
  }),
172
255
  };
173
256
  //# sourceMappingURL=AgentDefaults.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgentDefaults.js","sourceRoot":"","sources":["../../src/Agent/AgentDefaults.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6BAA0B;AAC1B,4CAAoB;AAWb,IAAM,aAAa,GAAG,UAAC,gBAA0B;IACtD,OAAA,aAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CACf,UAAC,GAAG;QACF,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QACzB,IAAI,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC,EACD;QACE,OAAO,EAAE,gBAAgB;YACvB,CAAC,CAAC,iEAA0D,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE;YACzF,CAAC,CAAC,8DAA8D;KACnE,CACF;AAZD,CAYC,CAAC;AAbS,QAAA,aAAa,iBAatB;AAES,QAAA,aAAa,GAAG;IAC3B,WAAW,EAAE,aAAC,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,a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qCACF;iCACF,CAAC,CAAC;4BACL,CAAC;;;;;;;;;;wBAGU,qBAAM,CAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,KAAK,CAAC,CAAA,EAAA;4BAD7C,uBACE,SAAM,GAAE,MAAA,CAAC,SAAkC,CAAC,mCAAI,IAAI;4BACpD,WAAQ,WAAA;iCACR;;;aACH;IA/CD,CA+CC;IACH;;;;;;;;;;;OAWG;IACH,cAAc,EAAE,CAAC,UAAC,KAAK;;QACrB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACpB,IAAA,KAAkB,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,MAAA,KAAK,CAAC,aAAa,mCAAI,EAAE,CAAC,EAAvE,KAAK,WAAA,EAAE,IAAI,UAA4D,CAAC;YAChF,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC;QACtC,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,OAAO;gBACL,IAAI,EAAE;oBACJ,QAAQ,EAAE,KAAK,CAAC,OAAO;iBACxB;aACF,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,uDAAuD,CAAC,EAAE,CAAC;IACvF,CAAC,CAAuB;CAChB,CAAC"}
@@ -189,7 +189,7 @@ export type AgentContextBuilder<T extends AnyArvoOrchestratorContract = AnyArvoO
189
189
  tools: AgentLLMContext<TServiceContract, TTools>['tools'];
190
190
  /** The Otel span to add logs to */
191
191
  span: Span;
192
- }) => PromiseLike<Partial<Pick<AgentLLMContext<TServiceContract>, 'messages' | 'system'>> | void>;
192
+ }) => PromiseAble<Partial<Pick<AgentLLMContext<TServiceContract>, 'messages' | 'system'>> | void>;
193
193
  /**
194
194
  * The "Output Validation" Hook.
195
195
  *
@@ -402,7 +402,7 @@ export type CreateArvoAgentParam<TSelfContract extends AnyArvoOrchestratorContra
402
402
  *
403
403
  * @example
404
404
  * ```typescript
405
- * output: ({ content, parsedContent, outputFormat, span }) => {
405
+ * output: ({ type, content, parsedContent, outputFormat, span }) => {
406
406
  * const result = outputFormat.safeParse(
407
407
  * parsedContent ?? JSON.parse(content)
408
408
  * );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arvo-tools/agentic",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Agentic toolset for building applications using arvo-core and arvo-event-handler",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",