@agentforge/core 0.18.4 → 0.18.6

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/index.cjs CHANGED
@@ -400,36 +400,28 @@ function getMissingDescriptions(schema) {
400
400
  }
401
401
 
402
402
  // src/tools/helpers.ts
403
- function createTool(metadata, schema, invoke) {
403
+ function constructTool(metadata, schema, invoke, shouldValidateSchemaDescriptions) {
404
404
  const metadataResult = validateToolMetadata(metadata);
405
405
  if (!metadataResult.success) {
406
406
  const errors = metadataResult.error.errors.map((err) => ` - ${err.path.join(".")}: ${err.message}`).join("\n");
407
407
  throw new Error(`Invalid tool metadata:
408
408
  ${errors}`);
409
409
  }
410
- validateSchemaDescriptions(schema);
411
- const tool = {
410
+ if (shouldValidateSchemaDescriptions) {
411
+ validateSchemaDescriptions(schema);
412
+ }
413
+ return {
412
414
  metadata: metadataResult.data,
413
415
  schema,
414
- invoke
416
+ invoke,
417
+ execute: invoke
415
418
  };
416
- tool.execute = invoke;
417
- return tool;
419
+ }
420
+ function createTool(metadata, schema, invoke) {
421
+ return constructTool(metadata, schema, invoke, true);
418
422
  }
419
423
  function createToolUnsafe(metadata, schema, invoke) {
420
- const metadataResult = validateToolMetadata(metadata);
421
- if (!metadataResult.success) {
422
- const errors = metadataResult.error.errors.map((err) => ` - ${err.path.join(".")}: ${err.message}`).join("\n");
423
- throw new Error(`Invalid tool metadata:
424
- ${errors}`);
425
- }
426
- const tool = {
427
- metadata: metadataResult.data,
428
- schema,
429
- invoke
430
- };
431
- tool.execute = invoke;
432
- return tool;
424
+ return constructTool(metadata, schema, invoke, false);
433
425
  }
434
426
  function validateTool(tool) {
435
427
  const errors = [];
@@ -2686,6 +2678,20 @@ function withLogging2(options) {
2686
2678
  return (node) => withLogging(options)(node);
2687
2679
  }
2688
2680
 
2681
+ // src/langgraph/middleware/preset-development.ts
2682
+ function development(node, options) {
2683
+ const { nodeName, verbose = true, logger: logger6 } = options;
2684
+ const actualLogger = logger6 || createLogger(nodeName, { level: "debug" /* DEBUG */ });
2685
+ return withLogging2({
2686
+ logger: actualLogger,
2687
+ name: nodeName,
2688
+ logInput: verbose,
2689
+ logOutput: verbose,
2690
+ logDuration: true,
2691
+ logErrors: true
2692
+ })(node);
2693
+ }
2694
+
2689
2695
  // src/langgraph/middleware/preset-production.ts
2690
2696
  function production(node, options) {
2691
2697
  const {
@@ -2751,20 +2757,6 @@ function production(node, options) {
2751
2757
  return compose(...middleware)(node);
2752
2758
  }
2753
2759
 
2754
- // src/langgraph/middleware/preset-development.ts
2755
- function development(node, options) {
2756
- const { nodeName, verbose = true, logger: logger6 } = options;
2757
- const actualLogger = logger6 || createLogger(nodeName, { level: "debug" /* DEBUG */ });
2758
- return withLogging2({
2759
- logger: actualLogger,
2760
- name: nodeName,
2761
- logInput: verbose,
2762
- logOutput: verbose,
2763
- logDuration: true,
2764
- logErrors: true
2765
- })(node);
2766
- }
2767
-
2768
2760
  // src/langgraph/middleware/preset-testing.ts
2769
2761
  function testing(node, options) {
2770
2762
  const {
@@ -2794,7 +2786,7 @@ function testing(node, options) {
2794
2786
  return testingNode;
2795
2787
  }
2796
2788
 
2797
- // src/langgraph/middleware/preset-collection.ts
2789
+ // src/langgraph/middleware/presets.ts
2798
2790
  var presets = {
2799
2791
  production,
2800
2792
  development,
package/dist/index.d.cts CHANGED
@@ -2122,20 +2122,28 @@ type TestingPresetNode<State> = NodeFunction<State> & {
2122
2122
  };
2123
2123
 
2124
2124
  /**
2125
- * Production preset with comprehensive error handling, metrics, and tracing.
2125
+ * Development preset with verbose logging and debugging.
2126
2126
  */
2127
- declare function production<State>(node: NodeFunction<State>, options: ProductionPresetOptions<State>): NodeFunction<State>;
2127
+ declare function development<State>(node: NodeFunction<State>, options: DevelopmentPresetOptions): NodeFunction<State>;
2128
2128
 
2129
2129
  /**
2130
- * Development preset with verbose logging and debugging.
2130
+ * Production preset with comprehensive error handling, metrics, and tracing.
2131
2131
  */
2132
- declare function development<State>(node: NodeFunction<State>, options: DevelopmentPresetOptions): NodeFunction<State>;
2132
+ declare function production<State>(node: NodeFunction<State>, options: ProductionPresetOptions<State>): NodeFunction<State>;
2133
2133
 
2134
2134
  /**
2135
2135
  * Testing preset for unit and integration tests.
2136
2136
  */
2137
2137
  declare function testing<State>(node: NodeFunction<State>, options: TestingPresetOptions<State>): TestingPresetNode<State>;
2138
2138
 
2139
+ /**
2140
+ * Middleware Presets
2141
+ *
2142
+ * Pre-configured middleware combinations for common use cases.
2143
+ *
2144
+ * @module langgraph/middleware/presets
2145
+ */
2146
+
2139
2147
  declare const presets: {
2140
2148
  production: typeof production;
2141
2149
  development: typeof development;
package/dist/index.d.ts CHANGED
@@ -2122,20 +2122,28 @@ type TestingPresetNode<State> = NodeFunction<State> & {
2122
2122
  };
2123
2123
 
2124
2124
  /**
2125
- * Production preset with comprehensive error handling, metrics, and tracing.
2125
+ * Development preset with verbose logging and debugging.
2126
2126
  */
2127
- declare function production<State>(node: NodeFunction<State>, options: ProductionPresetOptions<State>): NodeFunction<State>;
2127
+ declare function development<State>(node: NodeFunction<State>, options: DevelopmentPresetOptions): NodeFunction<State>;
2128
2128
 
2129
2129
  /**
2130
- * Development preset with verbose logging and debugging.
2130
+ * Production preset with comprehensive error handling, metrics, and tracing.
2131
2131
  */
2132
- declare function development<State>(node: NodeFunction<State>, options: DevelopmentPresetOptions): NodeFunction<State>;
2132
+ declare function production<State>(node: NodeFunction<State>, options: ProductionPresetOptions<State>): NodeFunction<State>;
2133
2133
 
2134
2134
  /**
2135
2135
  * Testing preset for unit and integration tests.
2136
2136
  */
2137
2137
  declare function testing<State>(node: NodeFunction<State>, options: TestingPresetOptions<State>): TestingPresetNode<State>;
2138
2138
 
2139
+ /**
2140
+ * Middleware Presets
2141
+ *
2142
+ * Pre-configured middleware combinations for common use cases.
2143
+ *
2144
+ * @module langgraph/middleware/presets
2145
+ */
2146
+
2139
2147
  declare const presets: {
2140
2148
  production: typeof production;
2141
2149
  development: typeof development;
package/dist/index.js CHANGED
@@ -224,36 +224,28 @@ function getMissingDescriptions(schema) {
224
224
  }
225
225
 
226
226
  // src/tools/helpers.ts
227
- function createTool(metadata, schema, invoke) {
227
+ function constructTool(metadata, schema, invoke, shouldValidateSchemaDescriptions) {
228
228
  const metadataResult = validateToolMetadata(metadata);
229
229
  if (!metadataResult.success) {
230
230
  const errors = metadataResult.error.errors.map((err) => ` - ${err.path.join(".")}: ${err.message}`).join("\n");
231
231
  throw new Error(`Invalid tool metadata:
232
232
  ${errors}`);
233
233
  }
234
- validateSchemaDescriptions(schema);
235
- const tool = {
234
+ if (shouldValidateSchemaDescriptions) {
235
+ validateSchemaDescriptions(schema);
236
+ }
237
+ return {
236
238
  metadata: metadataResult.data,
237
239
  schema,
238
- invoke
240
+ invoke,
241
+ execute: invoke
239
242
  };
240
- tool.execute = invoke;
241
- return tool;
243
+ }
244
+ function createTool(metadata, schema, invoke) {
245
+ return constructTool(metadata, schema, invoke, true);
242
246
  }
243
247
  function createToolUnsafe(metadata, schema, invoke) {
244
- const metadataResult = validateToolMetadata(metadata);
245
- if (!metadataResult.success) {
246
- const errors = metadataResult.error.errors.map((err) => ` - ${err.path.join(".")}: ${err.message}`).join("\n");
247
- throw new Error(`Invalid tool metadata:
248
- ${errors}`);
249
- }
250
- const tool = {
251
- metadata: metadataResult.data,
252
- schema,
253
- invoke
254
- };
255
- tool.execute = invoke;
256
- return tool;
248
+ return constructTool(metadata, schema, invoke, false);
257
249
  }
258
250
  function validateTool(tool) {
259
251
  const errors = [];
@@ -2510,6 +2502,20 @@ function withLogging2(options) {
2510
2502
  return (node) => withLogging(options)(node);
2511
2503
  }
2512
2504
 
2505
+ // src/langgraph/middleware/preset-development.ts
2506
+ function development(node, options) {
2507
+ const { nodeName, verbose = true, logger: logger6 } = options;
2508
+ const actualLogger = logger6 || createLogger(nodeName, { level: "debug" /* DEBUG */ });
2509
+ return withLogging2({
2510
+ logger: actualLogger,
2511
+ name: nodeName,
2512
+ logInput: verbose,
2513
+ logOutput: verbose,
2514
+ logDuration: true,
2515
+ logErrors: true
2516
+ })(node);
2517
+ }
2518
+
2513
2519
  // src/langgraph/middleware/preset-production.ts
2514
2520
  function production(node, options) {
2515
2521
  const {
@@ -2575,20 +2581,6 @@ function production(node, options) {
2575
2581
  return compose(...middleware)(node);
2576
2582
  }
2577
2583
 
2578
- // src/langgraph/middleware/preset-development.ts
2579
- function development(node, options) {
2580
- const { nodeName, verbose = true, logger: logger6 } = options;
2581
- const actualLogger = logger6 || createLogger(nodeName, { level: "debug" /* DEBUG */ });
2582
- return withLogging2({
2583
- logger: actualLogger,
2584
- name: nodeName,
2585
- logInput: verbose,
2586
- logOutput: verbose,
2587
- logDuration: true,
2588
- logErrors: true
2589
- })(node);
2590
- }
2591
-
2592
2584
  // src/langgraph/middleware/preset-testing.ts
2593
2585
  function testing(node, options) {
2594
2586
  const {
@@ -2618,7 +2610,7 @@ function testing(node, options) {
2618
2610
  return testingNode;
2619
2611
  }
2620
2612
 
2621
- // src/langgraph/middleware/preset-collection.ts
2613
+ // src/langgraph/middleware/presets.ts
2622
2614
  var presets = {
2623
2615
  production,
2624
2616
  development,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge/core",
3
- "version": "0.18.4",
3
+ "version": "0.18.6",
4
4
  "description": "Production-ready TypeScript agent framework built on LangGraph with orchestration, middleware, and typed abstractions.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",