@langchain/core 0.3.22 → 0.3.24-rc.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.
Files changed (74) hide show
  1. package/dist/callbacks/base.cjs +13 -1
  2. package/dist/callbacks/base.d.ts +10 -0
  3. package/dist/callbacks/base.js +10 -0
  4. package/dist/callbacks/manager.cjs +21 -0
  5. package/dist/callbacks/manager.js +22 -1
  6. package/dist/context.cjs +13 -123
  7. package/dist/context.d.ts +2 -101
  8. package/dist/context.js +9 -119
  9. package/dist/language_models/chat_models.cjs +2 -5
  10. package/dist/language_models/chat_models.js +2 -5
  11. package/dist/language_models/llms.cjs +2 -5
  12. package/dist/language_models/llms.js +2 -5
  13. package/dist/messages/tool.cjs +14 -1
  14. package/dist/messages/tool.d.ts +13 -1
  15. package/dist/messages/tool.js +12 -0
  16. package/dist/output_parsers/transform.cjs +2 -2
  17. package/dist/output_parsers/transform.js +1 -1
  18. package/dist/singletons/async_local_storage/context.cjs +189 -0
  19. package/dist/singletons/async_local_storage/context.d.ts +155 -0
  20. package/dist/singletons/async_local_storage/context.js +182 -0
  21. package/dist/singletons/async_local_storage/globals.cjs +2 -1
  22. package/dist/singletons/async_local_storage/globals.d.ts +2 -1
  23. package/dist/singletons/async_local_storage/globals.js +1 -0
  24. package/dist/singletons/async_local_storage/index.cjs +4 -5
  25. package/dist/singletons/async_local_storage/index.d.ts +0 -1
  26. package/dist/singletons/async_local_storage/index.js +1 -2
  27. package/dist/singletons/callbacks.cjs +6 -4
  28. package/dist/singletons/callbacks.js +6 -4
  29. package/dist/singletons/index.cjs +3 -3
  30. package/dist/singletons/index.d.ts +4 -2
  31. package/dist/singletons/index.js +4 -3
  32. package/dist/tools/index.cjs +12 -10
  33. package/dist/tools/index.d.ts +11 -8
  34. package/dist/tools/index.js +13 -11
  35. package/dist/tracers/event_stream.cjs +6 -0
  36. package/dist/tracers/event_stream.d.ts +3 -2
  37. package/dist/tracers/event_stream.js +6 -0
  38. package/dist/tracers/log_stream.cjs +6 -0
  39. package/dist/tracers/log_stream.d.ts +3 -2
  40. package/dist/tracers/log_stream.js +6 -0
  41. package/dist/utils/json_schema.cjs +3 -3
  42. package/dist/utils/json_schema.d.ts +1 -1
  43. package/dist/utils/json_schema.js +1 -1
  44. package/package.json +2 -1
  45. package/dist/utils/@cfworker/json-schema/index.cjs +0 -17
  46. package/dist/utils/@cfworker/json-schema/index.d.ts +0 -1
  47. package/dist/utils/@cfworker/json-schema/index.js +0 -1
  48. package/dist/utils/@cfworker/json-schema/src/deep-compare-strict.cjs +0 -43
  49. package/dist/utils/@cfworker/json-schema/src/deep-compare-strict.d.ts +0 -1
  50. package/dist/utils/@cfworker/json-schema/src/deep-compare-strict.js +0 -39
  51. package/dist/utils/@cfworker/json-schema/src/dereference.cjs +0 -171
  52. package/dist/utils/@cfworker/json-schema/src/dereference.d.ts +0 -12
  53. package/dist/utils/@cfworker/json-schema/src/dereference.js +0 -167
  54. package/dist/utils/@cfworker/json-schema/src/format.cjs +0 -139
  55. package/dist/utils/@cfworker/json-schema/src/format.d.ts +0 -2
  56. package/dist/utils/@cfworker/json-schema/src/format.js +0 -136
  57. package/dist/utils/@cfworker/json-schema/src/index.cjs +0 -24
  58. package/dist/utils/@cfworker/json-schema/src/index.d.ts +0 -8
  59. package/dist/utils/@cfworker/json-schema/src/index.js +0 -8
  60. package/dist/utils/@cfworker/json-schema/src/pointer.cjs +0 -11
  61. package/dist/utils/@cfworker/json-schema/src/pointer.d.ts +0 -2
  62. package/dist/utils/@cfworker/json-schema/src/pointer.js +0 -6
  63. package/dist/utils/@cfworker/json-schema/src/types.cjs +0 -2
  64. package/dist/utils/@cfworker/json-schema/src/types.d.ts +0 -72
  65. package/dist/utils/@cfworker/json-schema/src/types.js +0 -1
  66. package/dist/utils/@cfworker/json-schema/src/ucs2-length.cjs +0 -28
  67. package/dist/utils/@cfworker/json-schema/src/ucs2-length.d.ts +0 -6
  68. package/dist/utils/@cfworker/json-schema/src/ucs2-length.js +0 -24
  69. package/dist/utils/@cfworker/json-schema/src/validate.cjs +0 -808
  70. package/dist/utils/@cfworker/json-schema/src/validate.d.ts +0 -3
  71. package/dist/utils/@cfworker/json-schema/src/validate.js +0 -804
  72. package/dist/utils/@cfworker/json-schema/src/validator.cjs +0 -44
  73. package/dist/utils/@cfworker/json-schema/src/validator.d.ts +0 -10
  74. package/dist/utils/@cfworker/json-schema/src/validator.js +0 -40
@@ -1,8 +0,0 @@
1
- export * from "./deep-compare-strict.js";
2
- export * from "./dereference.js";
3
- export * from "./format.js";
4
- export * from "./pointer.js";
5
- export * from "./types.js";
6
- export * from "./ucs2-length.js";
7
- export * from "./validate.js";
8
- export * from "./validator.js";
@@ -1,8 +0,0 @@
1
- export * from "./deep-compare-strict.js";
2
- export * from "./dereference.js";
3
- export * from "./format.js";
4
- export * from "./pointer.js";
5
- export * from "./types.js";
6
- export * from "./ucs2-length.js";
7
- export * from "./validate.js";
8
- export * from "./validator.js";
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.escapePointer = exports.encodePointer = void 0;
4
- function encodePointer(p) {
5
- return encodeURI(escapePointer(p));
6
- }
7
- exports.encodePointer = encodePointer;
8
- function escapePointer(p) {
9
- return p.replace(/~/g, "~0").replace(/\//g, "~1");
10
- }
11
- exports.escapePointer = escapePointer;
@@ -1,2 +0,0 @@
1
- export declare function encodePointer(p: string): string;
2
- export declare function escapePointer(p: string): string;
@@ -1,6 +0,0 @@
1
- export function encodePointer(p) {
2
- return encodeURI(escapePointer(p));
3
- }
4
- export function escapePointer(p) {
5
- return p.replace(/~/g, "~0").replace(/\//g, "~1");
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,72 +0,0 @@
1
- export type SchemaDraft = "4" | "7" | "2019-09" | "2020-12";
2
- export declare const enum OutputFormat {
3
- Flag = 1,
4
- Basic = 2,
5
- Detailed = 4
6
- }
7
- export type InstanceType = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string";
8
- export interface Schema {
9
- $id?: string;
10
- $anchor?: string;
11
- $recursiveAnchor?: boolean;
12
- $ref?: string;
13
- $recursiveRef?: "#";
14
- $schema?: string;
15
- $comment?: string;
16
- $defs?: any;
17
- $vocabulary?: Record<string, boolean>;
18
- type?: InstanceType | InstanceType[];
19
- const?: any;
20
- enum?: any[];
21
- required?: string[];
22
- not?: Schema;
23
- anyOf?: Schema[];
24
- allOf?: Schema[];
25
- oneOf?: Schema[];
26
- if?: Schema;
27
- then?: Schema;
28
- else?: Schema;
29
- format?: string;
30
- properties?: Record<string | number, Schema | boolean>;
31
- patternProperties?: Record<string, Schema | boolean>;
32
- additionalProperties?: Schema | boolean;
33
- unevaluatedProperties?: Schema | boolean;
34
- minProperties?: number;
35
- maxProperties?: number;
36
- propertyNames?: Schema;
37
- dependentRequired?: Record<string, string[]>;
38
- dependentSchemas?: Record<string, Schema>;
39
- dependencies?: Record<string, Schema | string[]>;
40
- prefixItems?: Array<Schema | boolean>[];
41
- items?: Schema | boolean | Array<Schema | boolean>;
42
- additionalItems?: Schema | boolean;
43
- unevaluatedItems?: Schema | boolean;
44
- contains?: Schema | boolean;
45
- minContains?: number;
46
- maxContains?: number;
47
- minItems?: number;
48
- maxItems?: number;
49
- uniqueItems?: boolean;
50
- minimum?: number;
51
- maximum?: number;
52
- exclusiveMinimum?: number | boolean;
53
- exclusiveMaximum?: number | boolean;
54
- multipleOf?: number;
55
- minLength?: number;
56
- maxLength?: number;
57
- pattern?: string;
58
- __absolute_ref__?: string;
59
- __absolute_recursive_ref__?: string;
60
- __absolute_uri__?: string;
61
- [key: string]: any;
62
- }
63
- export interface OutputUnit {
64
- keyword: string;
65
- keywordLocation: string;
66
- instanceLocation: string;
67
- error: string;
68
- }
69
- export interface ValidationResult {
70
- valid: boolean;
71
- errors: OutputUnit[];
72
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ucs2length = void 0;
4
- /**
5
- * Get UCS-2 length of a string
6
- * https://mathiasbynens.be/notes/javascript-encoding
7
- * https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
8
- */
9
- function ucs2length(s) {
10
- let result = 0;
11
- let length = s.length;
12
- let index = 0;
13
- let charCode;
14
- while (index < length) {
15
- result++;
16
- charCode = s.charCodeAt(index++);
17
- if (charCode >= 0xd800 && charCode <= 0xdbff && index < length) {
18
- // high surrogate, and there is a next character
19
- charCode = s.charCodeAt(index);
20
- if ((charCode & 0xfc00) == 0xdc00) {
21
- // low surrogate
22
- index++;
23
- }
24
- }
25
- }
26
- return result;
27
- }
28
- exports.ucs2length = ucs2length;
@@ -1,6 +0,0 @@
1
- /**
2
- * Get UCS-2 length of a string
3
- * https://mathiasbynens.be/notes/javascript-encoding
4
- * https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
5
- */
6
- export declare function ucs2length(s: string): number;
@@ -1,24 +0,0 @@
1
- /**
2
- * Get UCS-2 length of a string
3
- * https://mathiasbynens.be/notes/javascript-encoding
4
- * https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
5
- */
6
- export function ucs2length(s) {
7
- let result = 0;
8
- let length = s.length;
9
- let index = 0;
10
- let charCode;
11
- while (index < length) {
12
- result++;
13
- charCode = s.charCodeAt(index++);
14
- if (charCode >= 0xd800 && charCode <= 0xdbff && index < length) {
15
- // high surrogate, and there is a next character
16
- charCode = s.charCodeAt(index);
17
- if ((charCode & 0xfc00) == 0xdc00) {
18
- // low surrogate
19
- index++;
20
- }
21
- }
22
- }
23
- return result;
24
- }