@langgraph-js/sdk 3.2.1 → 3.3.1

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.
@@ -46,6 +46,98 @@ export declare const createJSONDefineTool: <Args extends ZodRawShape>(tool: Unio
46
46
  name: string;
47
47
  description: string;
48
48
  parameters: Args | ({
49
+ anyOf: import("zod-to-json-schema").JsonSchema7DateType[];
50
+ } & {
51
+ title?: string;
52
+ default?: any;
53
+ description?: string;
54
+ markdownDescription?: string;
55
+ } & {
56
+ $schema?: string | undefined;
57
+ definitions?: {
58
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
59
+ } | undefined;
60
+ }) | ({
61
+ type: "object" | "array";
62
+ } & {
63
+ title?: string;
64
+ default?: any;
65
+ description?: string;
66
+ markdownDescription?: string;
67
+ } & {
68
+ $schema?: string | undefined;
69
+ definitions?: {
70
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
71
+ } | undefined;
72
+ }) | ({
73
+ type: ("string" | "number" | "boolean" | "integer" | "null") | ("string" | "number" | "boolean" | "integer" | "null")[];
74
+ } & {
75
+ title?: string;
76
+ default?: any;
77
+ description?: string;
78
+ markdownDescription?: string;
79
+ } & {
80
+ $schema?: string | undefined;
81
+ definitions?: {
82
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
83
+ } | undefined;
84
+ }) | ({
85
+ anyOf: import("zod-to-json-schema").JsonSchema7Type[];
86
+ } & {
87
+ title?: string;
88
+ default?: any;
89
+ description?: string;
90
+ markdownDescription?: string;
91
+ } & {
92
+ $schema?: string | undefined;
93
+ definitions?: {
94
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
95
+ } | undefined;
96
+ }) | (import("zod-to-json-schema").JsonSchema7UndefinedType & {
97
+ title?: string;
98
+ default?: any;
99
+ description?: string;
100
+ markdownDescription?: string;
101
+ } & {
102
+ $schema?: string | undefined;
103
+ definitions?: {
104
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
105
+ } | undefined;
106
+ }) | (import("zod-to-json-schema").JsonSchema7AnyType & {
107
+ title?: string;
108
+ default?: any;
109
+ description?: string;
110
+ markdownDescription?: string;
111
+ } & {
112
+ $schema?: string | undefined;
113
+ definitions?: {
114
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
115
+ } | undefined;
116
+ }) | ({
117
+ anyOf: [import("zod-to-json-schema").JsonSchema7Type, import("zod-to-json-schema").JsonSchema7NullType];
118
+ } & {
119
+ title?: string;
120
+ default?: any;
121
+ description?: string;
122
+ markdownDescription?: string;
123
+ } & {
124
+ $schema?: string | undefined;
125
+ definitions?: {
126
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
127
+ } | undefined;
128
+ }) | ({
129
+ type: [string, "null"];
130
+ } & {
131
+ title?: string;
132
+ default?: any;
133
+ description?: string;
134
+ markdownDescription?: string;
135
+ } & {
136
+ $schema?: string | undefined;
137
+ definitions?: {
138
+ [key: string]: import("zod-to-json-schema").JsonSchema7Type;
139
+ } | undefined;
140
+ }) | (import("zod-to-json-schema").JsonSchema7AllOfType & {
49
141
  title?: string;
50
142
  default?: any;
51
143
  description?: string;
@@ -9,7 +9,7 @@ import { useArtifacts } from "../artifacts/index.js";
9
9
  * @en Formats a Date object into a time string.
10
10
  */
11
11
  export const formatTime = (date) => {
12
- return date.toLocaleTimeString("en-US");
12
+ return date.toLocaleTimeString();
13
13
  };
14
14
  /**
15
15
  * @zh 格式化数字为带千位分隔符的字符串。
@@ -46,7 +46,8 @@ export const getMessageContent = (content) => {
46
46
  */
47
47
  export const getHistoryContent = (thread) => {
48
48
  var _a, _b, _c;
49
- const content = (_c = (_b = (_a = thread === null || thread === void 0 ? void 0 : thread.values) === null || _a === void 0 ? void 0 : _a.messages) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.content;
49
+ /** @ts-ignore */
50
+ const content = thread.title || thread.name || ((_c = (_b = (_a = thread === null || thread === void 0 ? void 0 : thread.values) === null || _a === void 0 ? void 0 : _a.messages) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.content);
50
51
  if (content && Array.isArray(content)) {
51
52
  return content.map((item) => {
52
53
  if (item.type === "text") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langgraph-js/sdk",
3
- "version": "3.2.1",
3
+ "version": "3.3.1",
4
4
  "description": "The UI SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -12,7 +12,7 @@ import { useArtifacts } from "../artifacts/index.js";
12
12
  * @en Formats a Date object into a time string.
13
13
  */
14
14
  export const formatTime = (date: Date) => {
15
- return date.toLocaleTimeString("en-US");
15
+ return date.toLocaleTimeString();
16
16
  };
17
17
 
18
18
  /**
@@ -47,7 +47,8 @@ export const getMessageContent = (content: any) => {
47
47
  * @en Gets the text representation of Thread content in history.
48
48
  */
49
49
  export const getHistoryContent = (thread: Thread) => {
50
- const content = (thread?.values as any)?.messages?.[0]?.content;
50
+ /** @ts-ignore */
51
+ const content: string | any[] = thread.title || thread.name || (thread?.values as any)?.messages?.[0]?.content;
51
52
  if (content && Array.isArray(content)) {
52
53
  return content.map((item: any) => {
53
54
  if (item.type === "text") {