Merge pull request #24 from langflow-ai/eslint-fix
This commit is contained in:
commit
1096ef4cd0
9 changed files with 306 additions and 44 deletions
246
frontend/package-lock.json
generated
246
frontend/package-lock.json
generated
|
|
@ -8,6 +8,8 @@
|
|||
"name": "frontend",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@microsoft/mgt-components": "^4.6.0",
|
||||
"@microsoft/mgt-msal2-provider": "^4.6.0",
|
||||
"@radix-ui/react-avatar": "^1.1.10",
|
||||
"@radix-ui/react-checkbox": "^1.3.2",
|
||||
"@radix-ui/react-collapsible": "^1.1.11",
|
||||
|
|
@ -60,6 +62,36 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-browser": {
|
||||
"version": "2.39.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.39.0.tgz",
|
||||
"integrity": "sha512-kks/n2AJzKUk+DBqZhiD+7zeQGBl+WpSOQYzWy6hff3bU0ZrYFqr4keFLlzB5VKuKZog0X59/FGHb1RPBDZLVg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/msal-common": "13.3.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-common": {
|
||||
"version": "13.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.3.tgz",
|
||||
"integrity": "sha512-n278DdCXKeiWhLwhEL7/u9HRMyzhUXLefeajiknf6AmEedoiOiv2r5aRJ7LXdT3NGPyubkdIbthaJlVtmuEqvA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.28.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz",
|
||||
"integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/core": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.4.tgz",
|
||||
|
|
@ -285,6 +317,19 @@
|
|||
"integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@fluentui/web-components": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluentui/web-components/-/web-components-2.6.1.tgz",
|
||||
"integrity": "sha512-coyV+QZBVqcrJbncR2iyL0ZMXGFRJmP+JYUlewkYBt8bgmTMIwKBdUX0cN9S6KUp8JHoC2OSRqL8MYgT3T+YLQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@microsoft/fast-colors": "^5.3.0",
|
||||
"@microsoft/fast-element": "^1.13.0",
|
||||
"@microsoft/fast-foundation": "^2.49.6",
|
||||
"@microsoft/fast-web-utilities": "^5.4.0",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanfs/core": {
|
||||
"version": "0.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
|
||||
|
|
@ -821,6 +866,146 @@
|
|||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@lit-labs/ssr-dom-shim": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.4.0.tgz",
|
||||
"integrity": "sha512-ficsEARKnmmW5njugNYKipTm4SFnbik7CXtoencDZzmzo/dQ+2Q0bgkzJuoJP20Aj0F+izzJjOqsnkd6F/o1bw==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@lit/reactive-element": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.1.1.tgz",
|
||||
"integrity": "sha512-N+dm5PAYdQ8e6UlywyyrgI2t++wFGXfHx+dSJ1oBrg6FAxUj40jId++EaRm80MKX5JnlH1sBsyZ5h0bcZKemCg==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@lit-labs/ssr-dom-shim": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@lit/task": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@lit/task/-/task-1.0.3.tgz",
|
||||
"integrity": "sha512-1gJGJl8WON+2j0y9xfcD+XsS1rvcy3XDgsIhcdUW++yTR8ESjZW6o7dn8M8a4SZM8NnJe6ynS2cKWwsbfLOurg==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@lit/reactive-element": "^1.0.0 || ^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/fast-colors": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/fast-colors/-/fast-colors-5.3.1.tgz",
|
||||
"integrity": "sha512-72RZXVfCbwQzvo5sXXkuLXLT7rMeYaSf5r/6ewQiv/trBtqpWRm4DEH2EilHw/iWTBKOXs1qZNQndgUMa5n4LA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@microsoft/fast-element": {
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/fast-element/-/fast-element-1.14.0.tgz",
|
||||
"integrity": "sha512-zXvuSOzvsu8zDTy9eby8ix8VqLop2rwKRgp++ZN2kTCsoB3+QJVoaGD2T/Cyso2ViZQFXNpiNCVKfnmxBvmWkQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@microsoft/fast-foundation": {
|
||||
"version": "2.50.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/fast-foundation/-/fast-foundation-2.50.0.tgz",
|
||||
"integrity": "sha512-8mFYG88Xea1jZf2TI9Lm/jzZ6RWR8x29r24mGuLojNYqIR2Bl8+hnswoV6laApKdCbGMPKnsAL/O68Q0sRxeVg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@microsoft/fast-element": "^1.14.0",
|
||||
"@microsoft/fast-web-utilities": "^5.4.1",
|
||||
"tabbable": "^5.2.0",
|
||||
"tslib": "^1.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/fast-foundation/node_modules/tslib": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/@microsoft/fast-web-utilities": {
|
||||
"version": "5.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/fast-web-utilities/-/fast-web-utilities-5.4.1.tgz",
|
||||
"integrity": "sha512-ReWYncndjV3c8D8iq9tp7NcFNc1vbVHvcBFPME2nNFKNbS1XCesYZGlIlf3ot5EmuOXPlrzUHOWzQ2vFpIkqDg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"exenv-es6": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/mgt-components": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/mgt-components/-/mgt-components-4.6.0.tgz",
|
||||
"integrity": "sha512-7KC2eq+4GccNbFPwtUGTSDGJR+cVI3KI2IQpkqpyr3S9rl9d3BwEfPlVYMPdI0xI4Kpl31IyyV1ebf2FZHgqOQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fluentui/web-components": "^2.6.1",
|
||||
"@lit/task": "^1.0.0",
|
||||
"@microsoft/mgt-element": "4.6.0",
|
||||
"@microsoft/microsoft-graph-client": "3.0.2",
|
||||
"@microsoft/microsoft-graph-types": "^2.40.0",
|
||||
"@microsoft/microsoft-graph-types-beta": "^0.43.0-preview",
|
||||
"lit": "^3.1.2",
|
||||
"office-ui-fabric-core": "^11.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/mgt-element": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/mgt-element/-/mgt-element-4.6.0.tgz",
|
||||
"integrity": "sha512-h9fQqfqf4kzxjsa7zCPI9Lz7MUtBoTaHZyalwl2Q8wVqkEoMUim9OK/Y6uElsefegbtVAK0ucPkVL5y1zzqHJQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lit/task": "^1.0.0",
|
||||
"@microsoft/microsoft-graph-client": "3.0.2",
|
||||
"idb": "8.0.0",
|
||||
"lit": "^3.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/mgt-msal2-provider": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/mgt-msal2-provider/-/mgt-msal2-provider-4.6.0.tgz",
|
||||
"integrity": "sha512-Xl0qRje2jnZKIY4LKUInPgaFbpbtN4nkYShoh9n7Wy9AbTnprcaxK8VzxlxPZtpISe3pxQ78tXH0Mvc/xoeI9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/msal-browser": "^2.38.3",
|
||||
"@microsoft/mgt-element": "4.6.0",
|
||||
"@microsoft/microsoft-graph-client": "3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/microsoft-graph-client": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-client/-/microsoft-graph-client-3.0.2.tgz",
|
||||
"integrity": "sha512-eYDiApYmiGsm1s1jfAa/rhB2xQCsX4pWt0vCTd1LZmiApMQfT/c0hXj2hvpuGz5GrcLdugbu05xB79rIV57Pjw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@azure/identity": {
|
||||
"optional": true
|
||||
},
|
||||
"@azure/msal-browser": {
|
||||
"optional": true
|
||||
},
|
||||
"buffer": {
|
||||
"optional": true
|
||||
},
|
||||
"stream-browserify": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@microsoft/microsoft-graph-types": {
|
||||
"version": "2.40.0",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types/-/microsoft-graph-types-2.40.0.tgz",
|
||||
"integrity": "sha512-1fcPVrB/NkbNcGNfCy+Cgnvwxt6/sbIEEFgZHFBJ670zYLegENYJF8qMo7x3LqBjWX2/Eneq5BVVRCLTmlJN+g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@microsoft/microsoft-graph-types-beta": {
|
||||
"version": "0.43.0-preview",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types-beta/-/microsoft-graph-types-beta-0.43.0-preview.tgz",
|
||||
"integrity": "sha512-HngQCu0Mt4r+nqdBNx3OqUgFwkgw1XI1y2SOTGTJmeUBbIKZdTJbEH7X81uNGQDllEcSGtUOmLNv54yD35pORg=="
|
||||
},
|
||||
"node_modules/@napi-rs/wasm-runtime": {
|
||||
"version": "0.2.12",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",
|
||||
|
|
@ -2265,6 +2450,12 @@
|
|||
"@types/react": "^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/trusted-types": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
|
||||
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.36.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.36.0.tgz",
|
||||
|
|
@ -4378,6 +4569,12 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/exenv-es6": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/exenv-es6/-/exenv-es6-1.1.1.tgz",
|
||||
"integrity": "sha512-vlVu3N8d6yEMpMsEm+7sUBAI81aqYYuEvfK0jNqmdb/OPXzzH7QWDDnVjMvDSY47JdHEqx/dfC/q8WkfoTmpGQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
|
|
@ -4879,6 +5076,12 @@
|
|||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/idb": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/idb/-/idb-8.0.0.tgz",
|
||||
"integrity": "sha512-l//qvlAKGmQO31Qn7xdzagVPPaHTxXx199MhrAFuVBTPqydcPYBWjkrbv4Y0ktB+GmWOiwHl237UUOrLmQxLvw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
|
||||
|
|
@ -5534,6 +5737,37 @@
|
|||
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lit": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/lit/-/lit-3.3.1.tgz",
|
||||
"integrity": "sha512-Ksr/8L3PTapbdXJCk+EJVB78jDodUMaP54gD24W186zGRARvwrsPfS60wae/SSCTCNZVPd1chXqio1qHQmu4NA==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@lit/reactive-element": "^2.1.0",
|
||||
"lit-element": "^4.2.0",
|
||||
"lit-html": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lit-element": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.2.1.tgz",
|
||||
"integrity": "sha512-WGAWRGzirAgyphK2urmYOV72tlvnxw7YfyLDgQ+OZnM9vQQBQnumQ7jUJe6unEzwGU3ahFOjuz1iz1jjrpCPuw==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@lit-labs/ssr-dom-shim": "^1.4.0",
|
||||
"@lit/reactive-element": "^2.1.0",
|
||||
"lit-html": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lit-html": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.3.1.tgz",
|
||||
"integrity": "sha512-S9hbyDu/vs1qNrithiNyeyv64c9yqiW9l+DBgI18fL+MTvOtWoFR0FWiyq1TxaYef5wNlpEmzlXoBlZEO+WjoA==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@types/trusted-types": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/locate-path": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
|
||||
|
|
@ -5977,6 +6211,12 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/office-ui-fabric-core": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/office-ui-fabric-core/-/office-ui-fabric-core-11.1.0.tgz",
|
||||
"integrity": "sha512-uV7CbMBAqbHRa7ihNlgbDMIdiKb49TCamhsfuK7Yx7JXx05WdN/lZPWLmPnAALVQAFuO95ZJMAwNjyyEeXk47A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
||||
|
|
@ -7190,6 +7430,12 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/tabbable": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tabbable/-/tabbable-5.3.3.tgz",
|
||||
"integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tailwind-merge": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.1.tgz",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/mgt-components": "^4.6.0",
|
||||
"@microsoft/mgt-msal2-provider": "^4.6.0",
|
||||
"@radix-ui/react-avatar": "^1.1.10",
|
||||
"@radix-ui/react-checkbox": "^1.3.2",
|
||||
"@radix-ui/react-collapsible": "^1.1.11",
|
||||
|
|
|
|||
|
|
@ -127,7 +127,6 @@ function ChatPage() {
|
|||
const [dropdownDismissed, setDropdownDismissed] = useState(false);
|
||||
const [isUserInteracting, setIsUserInteracting] = useState(false);
|
||||
const [isForkingInProgress, setIsForkingInProgress] = useState(false);
|
||||
const [lastForkTimestamp, setLastForkTimestamp] = useState<number>(0);
|
||||
const dragCounterRef = useRef(0);
|
||||
const messagesEndRef = useRef<HTMLDivElement>(null);
|
||||
const inputRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
|
@ -454,8 +453,15 @@ function ChatPage() {
|
|||
content: string;
|
||||
timestamp?: string;
|
||||
response_id?: string;
|
||||
chunks?: any[];
|
||||
response_data?: any;
|
||||
chunks?: Array<{
|
||||
item?: { type?: string; tool_name?: string; id?: string; inputs?: unknown; results?: unknown; status?: string };
|
||||
delta?: { tool_calls?: Array<{ id?: string; function?: { name?: string; arguments?: string }; type?: string }> };
|
||||
type?: string;
|
||||
result?: unknown;
|
||||
output?: unknown;
|
||||
response?: unknown;
|
||||
}>;
|
||||
response_data?: unknown;
|
||||
}) => {
|
||||
const message: Message = {
|
||||
role: msg.role as "user" | "assistant",
|
||||
|
|
@ -480,12 +486,12 @@ function ChatPage() {
|
|||
const toolCall = chunk.item;
|
||||
console.log("Found Langflow tool call:", toolCall);
|
||||
functionCalls.push({
|
||||
id: toolCall.id,
|
||||
name: toolCall.tool_name,
|
||||
arguments: toolCall.inputs || {},
|
||||
id: toolCall.id || "",
|
||||
name: toolCall.tool_name || "unknown",
|
||||
arguments: (toolCall.inputs as Record<string, unknown>) || {},
|
||||
argumentsString: JSON.stringify(toolCall.inputs || {}),
|
||||
result: toolCall.results,
|
||||
status: toolCall.status || "completed",
|
||||
result: toolCall.results as Record<string, unknown> | ToolCallResult[],
|
||||
status: (toolCall.status as "pending" | "completed" | "error") || "completed",
|
||||
type: "tool_call",
|
||||
});
|
||||
}
|
||||
|
|
@ -494,10 +500,10 @@ function ChatPage() {
|
|||
for (const toolCall of chunk.delta.tool_calls) {
|
||||
if (toolCall.function) {
|
||||
functionCalls.push({
|
||||
id: toolCall.id,
|
||||
name: toolCall.function.name,
|
||||
id: toolCall.id || "",
|
||||
name: toolCall.function.name || "unknown",
|
||||
arguments: toolCall.function.arguments ? JSON.parse(toolCall.function.arguments) : {},
|
||||
argumentsString: toolCall.function.arguments,
|
||||
argumentsString: toolCall.function.arguments || "",
|
||||
status: "completed",
|
||||
type: toolCall.type || "function",
|
||||
});
|
||||
|
|
@ -508,7 +514,7 @@ function ChatPage() {
|
|||
if (chunk.type === "response.tool_call.result" || chunk.type === "tool_call_result") {
|
||||
const lastCall = functionCalls[functionCalls.length - 1];
|
||||
if (lastCall) {
|
||||
lastCall.result = chunk.result || chunk;
|
||||
lastCall.result = (chunk.result as Record<string, unknown> | ToolCallResult[]) || (chunk as Record<string, unknown>);
|
||||
lastCall.status = "completed";
|
||||
}
|
||||
}
|
||||
|
|
@ -562,6 +568,7 @@ function ChatPage() {
|
|||
conversationData,
|
||||
isUserInteracting,
|
||||
isForkingInProgress,
|
||||
setPreviousResponseIds,
|
||||
]);
|
||||
|
||||
// Handle new conversation creation - only reset messages when placeholderConversation is set
|
||||
|
|
@ -1536,10 +1543,8 @@ function ChatPage() {
|
|||
}
|
||||
|
||||
// Set interaction state to prevent auto-scroll interference
|
||||
const forkTimestamp = Date.now();
|
||||
setIsUserInteracting(true);
|
||||
setIsForkingInProgress(true);
|
||||
setLastForkTimestamp(forkTimestamp);
|
||||
|
||||
console.log("Fork conversation called for message index:", messageIndex);
|
||||
|
||||
|
|
@ -1552,7 +1557,6 @@ function ChatPage() {
|
|||
console.error("Fork button should only be on assistant messages");
|
||||
setIsUserInteracting(false);
|
||||
setIsForkingInProgress(false);
|
||||
setLastForkTimestamp(0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,14 @@ export default function ConnectorsPage() {
|
|||
const { addTask } = useTask()
|
||||
const [selectedFiles, setSelectedFiles] = useState<GoogleDriveFile[]>([]);
|
||||
const [isSyncing, setIsSyncing] = useState<boolean>(false);
|
||||
const [syncResult, setSyncResult] = useState<any>(null);
|
||||
const [syncResult, setSyncResult] = useState<{
|
||||
processed?: number;
|
||||
total?: number;
|
||||
status?: string;
|
||||
error?: string;
|
||||
added?: number;
|
||||
errors?: number;
|
||||
} | null>(null);
|
||||
|
||||
const handleFileSelection = (files: GoogleDriveFile[]) => {
|
||||
setSelectedFiles(files);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ interface OneDriveFile {
|
|||
webUrl?: string
|
||||
driveItem?: {
|
||||
file?: { mimeType: string }
|
||||
folder?: any
|
||||
folder?: unknown
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ interface OneDriveFile {
|
|||
webUrl?: string
|
||||
driveItem?: {
|
||||
file?: { mimeType: string }
|
||||
folder?: object
|
||||
folder?: unknown
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -157,6 +157,14 @@ export default function UploadProviderPage() {
|
|||
// You can add additional handling here like triggering sync, etc.
|
||||
}
|
||||
|
||||
const handleGoogleDriveFileSelected = (files: GoogleDriveFile[]) => {
|
||||
handleFileSelected(files)
|
||||
}
|
||||
|
||||
const handleOneDriveFileSelected = (files: OneDriveFile[]) => {
|
||||
handleFileSelected(files)
|
||||
}
|
||||
|
||||
const handleSync = async (connector: CloudConnector) => {
|
||||
if (!connector.connectionId || selectedFiles.length === 0) return
|
||||
|
||||
|
|
@ -323,7 +331,7 @@ export default function UploadProviderPage() {
|
|||
<div className="max-w-3xl mx-auto">
|
||||
{connector.type === "google_drive" && (
|
||||
<GoogleDrivePicker
|
||||
onFileSelected={handleFileSelected}
|
||||
onFileSelected={handleGoogleDriveFileSelected}
|
||||
selectedFiles={selectedFiles as GoogleDriveFile[]}
|
||||
isAuthenticated={true}
|
||||
accessToken={accessToken || undefined}
|
||||
|
|
@ -332,7 +340,7 @@ export default function UploadProviderPage() {
|
|||
|
||||
{(connector.type === "onedrive" || connector.type === "sharepoint") && (
|
||||
<OneDrivePicker
|
||||
onFileSelected={handleFileSelected}
|
||||
onFileSelected={handleOneDriveFileSelected}
|
||||
selectedFiles={selectedFiles as OneDriveFile[]}
|
||||
isAuthenticated={true}
|
||||
accessToken={accessToken || undefined}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import { useState, useEffect, useCallback } from "react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
|
|
@ -29,7 +28,7 @@ interface OneDriveFile {
|
|||
webUrl?: string
|
||||
driveItem?: {
|
||||
file?: { mimeType: string }
|
||||
folder?: any
|
||||
folder?: unknown
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +60,6 @@ export function CloudConnectorsDialog({
|
|||
const [selectedFiles, setSelectedFiles] = useState<{[connectorId: string]: GoogleDriveFile[] | OneDriveFile[]}>({})
|
||||
const [connectorAccessTokens, setConnectorAccessTokens] = useState<{[connectorType: string]: string}>({})
|
||||
const [activePickerType, setActivePickerType] = useState<string | null>(null)
|
||||
const [isGooglePickerOpen, setIsGooglePickerOpen] = useState(false)
|
||||
|
||||
const getConnectorIcon = (iconName: string) => {
|
||||
const iconMap: { [key: string]: React.ReactElement } = {
|
||||
|
|
@ -129,7 +127,7 @@ export function CloudConnectorsDialog({
|
|||
if (response.ok) {
|
||||
const data = await response.json()
|
||||
const connections = data.connections || []
|
||||
const activeConnection = connections.find((conn: any) => conn.is_active)
|
||||
const activeConnection = connections.find((conn: { connection_id: string; is_active: boolean }) => conn.is_active)
|
||||
const isConnected = activeConnection !== undefined
|
||||
|
||||
let hasAccessToken = false
|
||||
|
|
@ -152,7 +150,7 @@ export function CloudConnectorsDialog({
|
|||
const errorData = await tokenResponse.json().catch(() => ({ error: 'Token unavailable' }))
|
||||
accessTokenError = errorData.error || 'Access token unavailable'
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
accessTokenError = 'Failed to fetch access token'
|
||||
}
|
||||
}
|
||||
|
|
@ -260,12 +258,11 @@ export function CloudConnectorsDialog({
|
|||
onFileSelected={(files) => {
|
||||
handleFileSelection(connector.id, files)
|
||||
setActivePickerType(null)
|
||||
setIsGooglePickerOpen(false)
|
||||
}}
|
||||
selectedFiles={selectedFiles[connector.id] as GoogleDriveFile[] || []}
|
||||
isAuthenticated={connector.status === "connected"}
|
||||
accessToken={connectorAccessTokens[connector.type]}
|
||||
onPickerStateChange={setIsGooglePickerOpen}
|
||||
onPickerStateChange={() => {}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ interface OneDriveFile {
|
|||
webUrl?: string
|
||||
driveItem?: {
|
||||
file?: { mimeType: string }
|
||||
folder?: any
|
||||
folder?: unknown
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ interface OneDriveFile {
|
|||
webUrl?: string
|
||||
driveItem?: {
|
||||
file?: { mimeType: string }
|
||||
folder?: any
|
||||
folder?: unknown
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -32,8 +32,8 @@ interface GraphResponse {
|
|||
declare global {
|
||||
interface Window {
|
||||
mgt?: {
|
||||
Providers: {
|
||||
globalProvider: any
|
||||
Providers?: {
|
||||
globalProvider?: unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -58,21 +58,19 @@ export function OneDrivePicker({
|
|||
])
|
||||
|
||||
useEffect(() => {
|
||||
const loadMGT = async () => {
|
||||
if (typeof window !== 'undefined' && !window.mgt) {
|
||||
try {
|
||||
const mgtModule = await import('@microsoft/mgt-components')
|
||||
const mgtProvider = await import('@microsoft/mgt-msal2-provider')
|
||||
|
||||
// Initialize provider if needed
|
||||
if (!window.mgt?.Providers?.globalProvider && accessToken) {
|
||||
// For simplicity, we'll use direct Graph API calls instead of MGT components
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('MGT not available, falling back to direct API calls')
|
||||
}
|
||||
const loadMGT = async () => {
|
||||
if (typeof window !== 'undefined' && !window.mgt) {
|
||||
try {
|
||||
await import('@microsoft/mgt-components')
|
||||
await import('@microsoft/mgt-msal2-provider')
|
||||
|
||||
// For simplicity, we'll use direct Graph API calls instead of MGT components
|
||||
// MGT provider initialization would go here if needed
|
||||
} catch {
|
||||
console.warn('MGT not available, falling back to direct API calls')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadMGT()
|
||||
}, [accessToken])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue