diff --git a/ui/litellm-dashboard/demo-artifacts/shared-knowledge/1.png b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/1.png new file mode 100644 index 00000000000..faaa410268f Binary files /dev/null and b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/1.png differ diff --git a/ui/litellm-dashboard/demo-artifacts/shared-knowledge/2.png b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/2.png new file mode 100644 index 00000000000..75cde5c55f4 Binary files /dev/null and b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/2.png differ diff --git a/ui/litellm-dashboard/demo-artifacts/shared-knowledge/3.png b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/3.png new file mode 100644 index 00000000000..7dca8dd9f4b Binary files /dev/null and b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/3.png differ diff --git a/ui/litellm-dashboard/demo-artifacts/shared-knowledge/4.png b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/4.png new file mode 100644 index 00000000000..175ed2fe225 Binary files /dev/null and b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/4.png differ diff --git a/ui/litellm-dashboard/demo-artifacts/shared-knowledge/README.md b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/README.md new file mode 100644 index 00000000000..6a8d9048421 --- /dev/null +++ b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/README.md @@ -0,0 +1,41 @@ +# Shared knowledge demo + +A four-step prototype inside LiteLLM's existing dashboard, available to admins from **Agentic → Memory → Shared knowledge demo**. + +1. **Define scope:** enable categories for user systems and operator systems. +2. **Capture a memo:** save an agent's researched finding with a title, summary, guidance, and source evidence. +3. **Review and reuse:** review a proposed correction, publish a new version, load it in another session, and record a helpful outcome. Try an unsupported correction to see rejection preserve the published version. +4. **Learn and curate:** promote frequently useful guidance to a skill, archive a superseded workaround, and retain the rare but useful Bazel fix. + +The four numbered PNG files show this sequence in the real dashboard shell. The Memory before/after images highlight the new entry point. The before image uses the static dashboard shipped at the base revision; both use the same empty Memory fixture and URL. + +## Run locally + +Use the Node and npm versions required by `package.json`. From `ui/litellm-dashboard`: + +```sh +npm ci +npm run build -- --webpack +node scripts/shared-knowledge-preview.mjs +``` + +Open . This creates a synthetic localhost demo session and opens `/ui/memory/demo/`. The preview serves the production export and read-only fixtures; it does not require a running proxy or database. The production dashboard continues to use its normal authentication and Memory permissions. + +Step links use `?step=2`, `?step=3`, and `?step=4`. Switching steps keeps local demo state; reloading or selecting **Reset Demo** resets it. Jumping to a later step without saving a draft uses a clearly labeled published sample memo. + +## Prototype boundaries + +All sample data is synthetic. Saving, searching, judging, recording outcomes, and periodic review are simulated in browser state. Postgres persistence, vector/text indexes, service-side model review, real cross-user retrieval, and automatic scheduling are proposed behavior, not implemented services. + +Historical counts and review thresholds are illustrative. Unknown outcomes are excluded from usefulness rates. Recorded outcomes retain the memo version used, and a promoted skill retains its source version. + +## Message to accompany screenshots + +> Hey, I put this into LiteLLM's Memory UI: +> +> 1. Choose the user/operator systems we want agents to remember. +> 2. An agent saves a researched finding as a shared memo. +> 3. A judge reviews corrections; other agents retrieve the published version and report outcomes. +> 4. Periodic review promotes useful patterns to skills, archives weak guidance, and keeps useful rare fixes. +> +> This is an interactive UI demo with simulated data. Is this the flow you had in mind? diff --git a/ui/litellm-dashboard/demo-artifacts/shared-knowledge/memory-after.png b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/memory-after.png new file mode 100644 index 00000000000..273d3d3c5e0 Binary files /dev/null and b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/memory-after.png differ diff --git a/ui/litellm-dashboard/demo-artifacts/shared-knowledge/memory-before.png b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/memory-before.png new file mode 100644 index 00000000000..f242623b0dc Binary files /dev/null and b/ui/litellm-dashboard/demo-artifacts/shared-knowledge/memory-before.png differ diff --git a/ui/litellm-dashboard/package-lock.json b/ui/litellm-dashboard/package-lock.json index 7cc7415d52d..7dbdfcc1892 100644 --- a/ui/litellm-dashboard/package-lock.json +++ b/ui/litellm-dashboard/package-lock.json @@ -21,6 +21,7 @@ "@tanstack/react-table": "8.21.3", "@tanstack/react-virtual": "3.14.13", "@types/papaparse": "5.5.2", + "antd": "5.29.3", "class-variance-authority": "0.7.1", "clsx": "^2.1.1", "date-fns": "^4.4.0", @@ -121,6 +122,103 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@ant-design/colors": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-7.2.1.tgz", + "integrity": "sha512-lCHDcEzieu4GA3n8ELeZ5VQ8pKQAWcGGLRTQ50aQM2iqPpq2evTxER84jfdPvsPAtEcZ7m44NI45edFMo8oOYQ==", + "license": "MIT", + "dependencies": { + "@ant-design/fast-color": "^2.0.6" + } + }, + "node_modules/@ant-design/cssinjs": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.24.0.tgz", + "integrity": "sha512-K4cYrJBsgvL+IoozUXYjbT6LHHNt+19a9zkvpBPxLjFHas1UpPM2A5MlhROb0BT8N8WoavM5VsP9MeSeNK/3mg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "@emotion/hash": "^0.8.0", + "@emotion/unitless": "^0.7.5", + "classnames": "^2.3.1", + "csstype": "^3.1.3", + "rc-util": "^5.35.0", + "stylis": "^4.3.4" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@ant-design/cssinjs-utils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs-utils/-/cssinjs-utils-1.1.3.tgz", + "integrity": "sha512-nOoQMLW1l+xR1Co8NFVYiP8pZp3VjIIzqV6D6ShYF2ljtdwWJn5WSsH+7kvCktXL/yhEtWURKOfH5Xz/gzlwsg==", + "license": "MIT", + "dependencies": { + "@ant-design/cssinjs": "^1.21.0", + "@babel/runtime": "^7.23.2", + "rc-util": "^5.38.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@ant-design/fast-color": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@ant-design/fast-color/-/fast-color-2.0.6.tgz", + "integrity": "sha512-y2217gk4NqL35giHl72o6Zzqji9O7vHh9YmhUVkPtAOpoTCH4uWxo/pr4VE8t0+ChEPs0qo4eJRC5Q1eXWo3vA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.7" + }, + "engines": { + "node": ">=8.x" + } + }, + "node_modules/@ant-design/icons": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-5.6.1.tgz", + "integrity": "sha512-0/xS39c91WjPAZOWsvi1//zjx6kAp4kxWwctR6kuU6p133w8RU0D2dSCvZC19uQyharg/sAvYxGYWl01BbZZfg==", + "license": "MIT", + "dependencies": { + "@ant-design/colors": "^7.0.0", + "@ant-design/icons-svg": "^4.4.0", + "@babel/runtime": "^7.24.8", + "classnames": "^2.2.6", + "rc-util": "^5.31.1" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@ant-design/icons-svg": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.6.0.tgz", + "integrity": "sha512-PRomU725ABMf/lnQp5HiB7my1kjEbFY0D10N4lXYxK6TIB1gKjIVD5MRThpDaezLgw1D774J8eOeeDB0M6wHrQ==", + "license": "MIT" + }, + "node_modules/@ant-design/react-slick": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ant-design/react-slick/-/react-slick-1.1.2.tgz", + "integrity": "sha512-EzlvzE6xQUBrZuuhSAFTdsr4P2bBBHGZwKFemEfq8gIGyIQCxalYfZW/T2ORbtQx5rU69o+WycP3exY/7T1hGA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.4", + "classnames": "^2.2.5", + "json2mq": "^0.2.0", + "resize-observer-polyfill": "^1.5.1", + "throttle-debounce": "^5.0.0" + }, + "peerDependencies": { + "react": ">=16.9.0" + } + }, "node_modules/@anthropic-ai/sdk": { "version": "0.92.0", "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.92.0.tgz", @@ -711,6 +809,18 @@ "tslib": "^2.4.0" } }, + "node_modules/@emotion/hash": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", + "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==", + "license": "MIT" + }, + "node_modules/@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", + "license": "MIT" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.28.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", @@ -2647,6 +2757,153 @@ "dev": true, "license": "MIT" }, + "node_modules/@rc-component/async-validator": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@rc-component/async-validator/-/async-validator-5.1.2.tgz", + "integrity": "sha512-WYbrZSjzznU1ekD0qFq2qRxt309VoS61MTG5npnFQlKYcoy9IzU8T+ZCIhq5bGAXRbXysABFWTspicMfmWFwow==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.4" + }, + "engines": { + "node": ">=14.x" + } + }, + "node_modules/@rc-component/color-picker": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@rc-component/color-picker/-/color-picker-2.0.1.tgz", + "integrity": "sha512-WcZYwAThV/b2GISQ8F+7650r5ZZJ043E57aVBFkQ+kSY4C6wdofXgB0hBx+GPGpIU0Z81eETNoDUJMr7oy/P8Q==", + "license": "MIT", + "dependencies": { + "@ant-design/fast-color": "^2.0.6", + "@babel/runtime": "^7.23.6", + "classnames": "^2.2.6", + "rc-util": "^5.38.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/context": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@rc-component/context/-/context-1.4.0.tgz", + "integrity": "sha512-kFcNxg9oLRMoL3qki0OMxK+7g5mypjgaaJp/pkOis/6rVxma9nJBF/8kCIuTYHUQNr0ii7MxqE33wirPZLJQ2w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/mini-decimal": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rc-component/mini-decimal/-/mini-decimal-1.1.4.tgz", + "integrity": "sha512-xiuXcaCwyOWpD8a8scdExFl+bntNphAW8XeenL1ig2en0AAZY0Pcp4pC0dI22qJ+NvxKn9RoNIoRdqYU3BLH4w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.0" + }, + "engines": { + "node": ">=8.x" + } + }, + "node_modules/@rc-component/mutate-observer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rc-component/mutate-observer/-/mutate-observer-1.1.0.tgz", + "integrity": "sha512-QjrOsDXQusNwGZPf4/qRQasg7UFEj06XiCJ8iuiq/Io7CrHrgVi6Uuetw60WAMG1799v+aM8kyc+1L/GBbHSlw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.0", + "classnames": "^2.3.2", + "rc-util": "^5.24.4" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/portal": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@rc-component/portal/-/portal-1.1.2.tgz", + "integrity": "sha512-6f813C0IsasTZms08kfA8kPAGxbbkYToa8ALaiDIGGECU4i9hj8Plgbx0sNJDrey3EtHO30hmdaxtT0138xZcg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.0", + "classnames": "^2.3.2", + "rc-util": "^5.24.4" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/qrcode": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@rc-component/qrcode/-/qrcode-1.1.3.tgz", + "integrity": "sha512-aGv6alnn4HbDEsURzKP+jv13rbi1VxmAYfBNZr5GKF1iohMNWy5tAVoJ1E3cOvzMB1kbUPvCXchM6zSFlRGPhA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.7" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/tour": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@rc-component/tour/-/tour-1.15.1.tgz", + "integrity": "sha512-Tr2t7J1DKZUpfJuDZWHxyxWpfmj8EZrqSgyMZ+BCdvKZ6r1UDsfU46M/iWAAFBy961Ssfom2kv5f3UcjIL2CmQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.0", + "@rc-component/portal": "^1.0.0-9", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.3.2", + "rc-util": "^5.24.4" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/trigger": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@rc-component/trigger/-/trigger-2.3.1.tgz", + "integrity": "sha512-ORENF39PeXTzM+gQEshuk460Z8N4+6DkjpxlpE7Q3gYy1iBpLrx0FOJz3h62ryrJZ/3zCAUIkT1Pb/8hHWpb3A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.2", + "@rc-component/portal": "^1.1.0", + "classnames": "^2.3.2", + "rc-motion": "^2.0.0", + "rc-resize-observer": "^1.3.1", + "rc-util": "^5.44.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, "node_modules/@redocly/ajv": { "version": "8.11.2", "resolved": "https://registry.npmjs.org/@redocly/ajv/-/ajv-8.11.2.tgz", @@ -4741,6 +4998,71 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/antd": { + "version": "5.29.3", + "resolved": "https://registry.npmjs.org/antd/-/antd-5.29.3.tgz", + "integrity": "sha512-3DdbGCa9tWAJGcCJ6rzR8EJFsv2CtyEbkVabZE14pfgUHfCicWCj0/QzQVLDYg8CPfQk9BH7fHCoTXHTy7MP/A==", + "license": "MIT", + "dependencies": { + "@ant-design/colors": "^7.2.1", + "@ant-design/cssinjs": "^1.23.0", + "@ant-design/cssinjs-utils": "^1.1.3", + "@ant-design/fast-color": "^2.0.6", + "@ant-design/icons": "^5.6.1", + "@ant-design/react-slick": "~1.1.2", + "@babel/runtime": "^7.26.0", + "@rc-component/color-picker": "~2.0.1", + "@rc-component/mutate-observer": "^1.1.0", + "@rc-component/qrcode": "~1.1.0", + "@rc-component/tour": "~1.15.1", + "@rc-component/trigger": "^2.3.0", + "classnames": "^2.5.1", + "copy-to-clipboard": "^3.3.3", + "dayjs": "^1.11.11", + "rc-cascader": "~3.34.0", + "rc-checkbox": "~3.5.0", + "rc-collapse": "~3.9.0", + "rc-dialog": "~9.6.0", + "rc-drawer": "~7.3.0", + "rc-dropdown": "~4.2.1", + "rc-field-form": "~2.7.1", + "rc-image": "~7.12.0", + "rc-input": "~1.8.0", + "rc-input-number": "~9.5.0", + "rc-mentions": "~2.20.0", + "rc-menu": "~9.16.1", + "rc-motion": "^2.9.5", + "rc-notification": "~5.6.4", + "rc-pagination": "~5.1.0", + "rc-picker": "~4.11.3", + "rc-progress": "~4.0.0", + "rc-rate": "~2.13.1", + "rc-resize-observer": "^1.4.3", + "rc-segmented": "~2.7.0", + "rc-select": "~14.16.8", + "rc-slider": "~11.1.9", + "rc-steps": "~6.0.1", + "rc-switch": "~4.1.0", + "rc-table": "~7.54.0", + "rc-tabs": "~15.7.0", + "rc-textarea": "~1.10.2", + "rc-tooltip": "~6.4.0", + "rc-tree": "~5.13.1", + "rc-tree-select": "~5.27.0", + "rc-upload": "~4.11.0", + "rc-util": "^5.44.4", + "scroll-into-view-if-needed": "^3.1.0", + "throttle-debounce": "^5.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ant-design" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -5336,6 +5658,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/compute-scroll-into-view": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz", + "integrity": "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==", + "license": "MIT" + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -8129,6 +8457,15 @@ "dev": true, "license": "MIT" }, + "node_modules/json2mq": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz", + "integrity": "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==", + "license": "MIT", + "dependencies": { + "string-convert": "^0.2.0" + } + }, "node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", @@ -10519,6 +10856,618 @@ ], "license": "MIT" }, + "node_modules/rc-cascader": { + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/rc-cascader/-/rc-cascader-3.34.0.tgz", + "integrity": "sha512-KpXypcvju9ptjW9FaN2NFcA2QH9E9LHKq169Y0eWtH4e/wHQ5Wh5qZakAgvb8EKZ736WZ3B0zLLOBsrsja5Dag==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.7", + "classnames": "^2.3.1", + "rc-select": "~14.16.2", + "rc-tree": "~5.13.0", + "rc-util": "^5.43.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-checkbox": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/rc-checkbox/-/rc-checkbox-3.5.0.tgz", + "integrity": "sha512-aOAQc3E98HteIIsSqm6Xk2FPKIER6+5vyEFMZfo73TqM+VVAIqOkHoPjgKLqSNtVLWScoaM7vY2ZrGEheI79yg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.3.2", + "rc-util": "^5.25.2" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-collapse": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/rc-collapse/-/rc-collapse-3.9.0.tgz", + "integrity": "sha512-swDdz4QZ4dFTo4RAUMLL50qP0EY62N2kvmk2We5xYdRwcRn8WcYtuetCJpwpaCbUfUt5+huLpVxhvmnK+PHrkA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "rc-motion": "^2.3.4", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-dialog": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/rc-dialog/-/rc-dialog-9.6.0.tgz", + "integrity": "sha512-ApoVi9Z8PaCQg6FsUzS8yvBEQy0ZL2PkuvAgrmohPkN3okps5WZ5WQWPc1RNuiOKaAYv8B97ACdsFU5LizzCqg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/portal": "^1.0.0-8", + "classnames": "^2.2.6", + "rc-motion": "^2.3.0", + "rc-util": "^5.21.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-drawer": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/rc-drawer/-/rc-drawer-7.3.0.tgz", + "integrity": "sha512-DX6CIgiBWNpJIMGFO8BAISFkxiuKitoizooj4BDyee8/SnBn0zwO2FHrNDpqqepj0E/TFTDpmEBCyFuTgC7MOg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@rc-component/portal": "^1.1.1", + "classnames": "^2.2.6", + "rc-motion": "^2.6.1", + "rc-util": "^5.38.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-dropdown": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/rc-dropdown/-/rc-dropdown-4.2.1.tgz", + "integrity": "sha512-YDAlXsPv3I1n42dv1JpdM7wJ+gSUBfeyPK59ZpBD9jQhK9jVuxpjj3NmWQHOBceA1zEPVX84T2wbdb2SD0UjmA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.6", + "rc-util": "^5.44.1" + }, + "peerDependencies": { + "react": ">=16.11.0", + "react-dom": ">=16.11.0" + } + }, + "node_modules/rc-field-form": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rc-field-form/-/rc-field-form-2.7.1.tgz", + "integrity": "sha512-vKeSifSJ6HoLaAB+B8aq/Qgm8a3dyxROzCtKNCsBQgiverpc4kWDQihoUwzUj+zNWJOykwSY4dNX3QrGwtVb9A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.0", + "@rc-component/async-validator": "^5.0.3", + "rc-util": "^5.32.2" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-image": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/rc-image/-/rc-image-7.12.0.tgz", + "integrity": "sha512-cZ3HTyyckPnNnUb9/DRqduqzLfrQRyi+CdHjdqgsyDpI3Ln5UX1kXnAhPBSJj9pVRzwRFgqkN7p9b6HBDjmu/Q==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.2", + "@rc-component/portal": "^1.0.2", + "classnames": "^2.2.6", + "rc-dialog": "~9.6.0", + "rc-motion": "^2.6.2", + "rc-util": "^5.34.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-input": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/rc-input/-/rc-input-1.8.0.tgz", + "integrity": "sha512-KXvaTbX+7ha8a/k+eg6SYRVERK0NddX8QX7a7AnRvUa/rEH0CNMlpcBzBkhI0wp2C8C4HlMoYl8TImSN+fuHKA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-util": "^5.18.1" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/rc-input-number": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/rc-input-number/-/rc-input-number-9.5.0.tgz", + "integrity": "sha512-bKaEvB5tHebUURAEXw35LDcnRZLq3x1k7GxfAqBMzmpHkDGzjAtnUL8y4y5N15rIFIg5IJgwr211jInl3cipag==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/mini-decimal": "^1.0.1", + "classnames": "^2.2.5", + "rc-input": "~1.8.0", + "rc-util": "^5.40.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-mentions": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/rc-mentions/-/rc-mentions-2.20.0.tgz", + "integrity": "sha512-w8HCMZEh3f0nR8ZEd466ATqmXFCMGMN5UFCzEUL0bM/nGw/wOS2GgRzKBcm19K++jDyuWCOJOdgcKGXU3fXfbQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.22.5", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.6", + "rc-input": "~1.8.0", + "rc-menu": "~9.16.0", + "rc-textarea": "~1.10.0", + "rc-util": "^5.34.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-menu": { + "version": "9.16.1", + "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-9.16.1.tgz", + "integrity": "sha512-ghHx6/6Dvp+fw8CJhDUHFHDJ84hJE3BXNCzSgLdmNiFErWSOaZNsihDAsKq9ByTALo/xkNIwtDFGIl6r+RPXBg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/trigger": "^2.0.0", + "classnames": "2.x", + "rc-motion": "^2.4.3", + "rc-overflow": "^1.3.1", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-motion": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/rc-motion/-/rc-motion-2.9.5.tgz", + "integrity": "sha512-w+XTUrfh7ArbYEd2582uDrEhmBHwK1ZENJiSJVb7uRxdE7qJSYjbO2eksRXmndqyKqKoYPc9ClpPh5242mV1vA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-util": "^5.44.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-notification": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/rc-notification/-/rc-notification-5.6.4.tgz", + "integrity": "sha512-KcS4O6B4qzM3KH7lkwOB7ooLPZ4b6J+VMmQgT51VZCeEcmghdeR4IrMcFq0LG+RPdnbe/ArT086tGM8Snimgiw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "rc-motion": "^2.9.0", + "rc-util": "^5.20.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-overflow": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/rc-overflow/-/rc-overflow-1.5.0.tgz", + "integrity": "sha512-Lm/v9h0LymeUYJf0x39OveU52InkdRXqnn2aYXfWmo8WdOonIKB2kfau+GF0fWq6jPgtdO9yMqveGcK6aIhJmg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.37.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-pagination": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/rc-pagination/-/rc-pagination-5.1.0.tgz", + "integrity": "sha512-8416Yip/+eclTFdHXLKTxZvn70duYVGTvUUWbckCCZoIl3jagqke3GLsFrMs0bsQBikiYpZLD9206Ej4SOdOXQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.3.2", + "rc-util": "^5.38.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-picker": { + "version": "4.11.3", + "resolved": "https://registry.npmjs.org/rc-picker/-/rc-picker-4.11.3.tgz", + "integrity": "sha512-MJ5teb7FlNE0NFHTncxXQ62Y5lytq6sh5nUw0iH8OkHL/TjARSEvSHpr940pWgjGANpjCwyMdvsEV55l5tYNSg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.7", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.1", + "rc-overflow": "^1.3.2", + "rc-resize-observer": "^1.4.0", + "rc-util": "^5.43.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "date-fns": ">= 2.x", + "dayjs": ">= 1.x", + "luxon": ">= 3.x", + "moment": ">= 2.x", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + }, + "peerDependenciesMeta": { + "date-fns": { + "optional": true + }, + "dayjs": { + "optional": true + }, + "luxon": { + "optional": true + }, + "moment": { + "optional": true + } + } + }, + "node_modules/rc-progress": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rc-progress/-/rc-progress-4.0.0.tgz", + "integrity": "sha512-oofVMMafOCokIUIBnZLNcOZFsABaUw8PPrf1/y0ZBvKZNpOiu5h4AO9vv11Sw0p4Hb3D0yGWuEattcQGtNJ/aw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.6", + "rc-util": "^5.16.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-rate": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/rc-rate/-/rc-rate-2.13.1.tgz", + "integrity": "sha512-QUhQ9ivQ8Gy7mtMZPAjLbxBt5y9GRp65VcUyGUMF3N3fhiftivPHdpuDIaWIMOTEprAjZPC08bls1dQB+I1F2Q==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.5", + "rc-util": "^5.0.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-resize-observer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/rc-resize-observer/-/rc-resize-observer-1.4.3.tgz", + "integrity": "sha512-YZLjUbyIWox8E9i9C3Tm7ia+W7euPItNWSPX5sCcQTYbnwDb5uNpnLHQCG1f22oZWUhLw4Mv2tFmeWe68CDQRQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.7", + "classnames": "^2.2.1", + "rc-util": "^5.44.1", + "resize-observer-polyfill": "^1.5.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-segmented": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rc-segmented/-/rc-segmented-2.7.1.tgz", + "integrity": "sha512-izj1Nw/Dw2Vb7EVr+D/E9lUTkBe+kKC+SAFSU9zqr7WV2W5Ktaa9Gc7cB2jTqgk8GROJayltaec+DBlYKc6d+g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-motion": "^2.4.4", + "rc-util": "^5.17.0" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/rc-select": { + "version": "14.16.8", + "resolved": "https://registry.npmjs.org/rc-select/-/rc-select-14.16.8.tgz", + "integrity": "sha512-NOV5BZa1wZrsdkKaiK7LHRuo5ZjZYMDxPP6/1+09+FB4KoNi8jcG1ZqLE3AVCxEsYMBe65OBx71wFoHRTP3LRg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/trigger": "^2.1.1", + "classnames": "2.x", + "rc-motion": "^2.0.1", + "rc-overflow": "^1.3.1", + "rc-util": "^5.16.1", + "rc-virtual-list": "^3.5.2" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/rc-slider": { + "version": "11.1.9", + "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-11.1.9.tgz", + "integrity": "sha512-h8IknhzSh3FEM9u8ivkskh+Ef4Yo4JRIY2nj7MrH6GQmrwV6mcpJf5/4KgH5JaVI1H3E52yCdpOlVyGZIeph5A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.5", + "rc-util": "^5.36.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-steps": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rc-steps/-/rc-steps-6.0.1.tgz", + "integrity": "sha512-lKHL+Sny0SeHkQKKDJlAjV5oZ8DwCdS2hFhAkIjuQt1/pB81M0cA0ErVFdHq9+jmPmFw1vJB2F5NBzFXLJxV+g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.16.7", + "classnames": "^2.2.3", + "rc-util": "^5.16.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-switch": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rc-switch/-/rc-switch-4.1.0.tgz", + "integrity": "sha512-TI8ufP2Az9oEbvyCeVE4+90PDSljGyuwix3fV58p7HV2o4wBnVToEyomJRVyTaZeqNPAp+vqeo4Wnj5u0ZZQBg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.21.0", + "classnames": "^2.2.1", + "rc-util": "^5.30.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-table": { + "version": "7.54.0", + "resolved": "https://registry.npmjs.org/rc-table/-/rc-table-7.54.0.tgz", + "integrity": "sha512-/wDTkki6wBTjwylwAGjpLKYklKo9YgjZwAU77+7ME5mBoS32Q4nAwoqhA2lSge6fobLW3Tap6uc5xfwaL2p0Sw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/context": "^1.4.0", + "classnames": "^2.2.5", + "rc-resize-observer": "^1.1.0", + "rc-util": "^5.44.3", + "rc-virtual-list": "^3.14.2" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-tabs": { + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/rc-tabs/-/rc-tabs-15.7.0.tgz", + "integrity": "sha512-ZepiE+6fmozYdWf/9gVp7k56PKHB1YYoDsKeQA1CBlJ/POIhjkcYiv0AGP0w2Jhzftd3AVvZP/K+V+Lpi2ankA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.2", + "classnames": "2.x", + "rc-dropdown": "~4.2.0", + "rc-menu": "~9.16.0", + "rc-motion": "^2.6.2", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.34.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-textarea": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/rc-textarea/-/rc-textarea-1.10.2.tgz", + "integrity": "sha512-HfaeXiaSlpiSp0I/pvWpecFEHpVysZ9tpDLNkxQbMvMz6gsr7aVZ7FpWP9kt4t7DB+jJXesYS0us1uPZnlRnwQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.1", + "rc-input": "~1.8.0", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-tooltip": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/rc-tooltip/-/rc-tooltip-6.4.0.tgz", + "integrity": "sha512-kqyivim5cp8I5RkHmpsp1Nn/Wk+1oeloMv9c7LXNgDxUpGm+RbXJGL+OPvDlcRnx9DBeOe4wyOIl4OKUERyH1g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.2", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.3.1", + "rc-util": "^5.44.3" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-tree": { + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-5.13.1.tgz", + "integrity": "sha512-FNhIefhftobCdUJshO7M8uZTA9F4OPGVXqGfZkkD/5soDeOhwO06T/aKTrg0WD8gRg/pyfq+ql3aMymLHCTC4A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "rc-motion": "^2.0.1", + "rc-util": "^5.16.1", + "rc-virtual-list": "^3.5.1" + }, + "engines": { + "node": ">=10.x" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/rc-tree-select": { + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/rc-tree-select/-/rc-tree-select-5.27.0.tgz", + "integrity": "sha512-2qTBTzwIT7LRI1o7zLyrCzmo5tQanmyGbSaGTIf7sYimCklAToVVfpMC6OAldSKolcnjorBYPNSKQqJmN3TCww==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.7", + "classnames": "2.x", + "rc-select": "~14.16.2", + "rc-tree": "~5.13.0", + "rc-util": "^5.43.0" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/rc-upload": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/rc-upload/-/rc-upload-4.11.0.tgz", + "integrity": "sha512-ZUyT//2JAehfHzjWowqROcwYJKnZkIUGWaTE/VogVrepSl7AFNbQf4+zGfX4zl9Vrj/Jm8scLO0R6UlPDKK4wA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "classnames": "^2.2.5", + "rc-util": "^5.2.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-util": { + "version": "5.44.4", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.44.4.tgz", + "integrity": "sha512-resueRJzmHG9Q6rI/DfK6Kdv9/Lfls05vzMs1Sk3M2P+3cJa+MakaZyWY8IPfehVuhPJFKrIY1IK4GqbiaiY5w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "react-is": "^18.2.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-util/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/rc-virtual-list": { + "version": "3.19.2", + "resolved": "https://registry.npmjs.org/rc-virtual-list/-/rc-virtual-list-3.19.2.tgz", + "integrity": "sha512-Ys6NcjwGkuwkeaWBDqfI3xWuZ7rDiQXlH1o2zLfFzATfEgXcqpk8CkgMfbJD81McqjcJVez25a3kPxCR807evA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.0", + "classnames": "^2.2.6", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.36.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, "node_modules/react": { "version": "19.2.8", "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", @@ -11024,6 +11973,12 @@ "integrity": "sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==", "license": "MIT" }, + "node_modules/resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", + "license": "MIT" + }, "node_modules/resolve": { "version": "2.0.0-next.6", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.6.tgz", @@ -11222,6 +12177,15 @@ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", "license": "MIT" }, + "node_modules/scroll-into-view-if-needed": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz", + "integrity": "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==", + "license": "MIT", + "dependencies": { + "compute-scroll-into-view": "^3.0.2" + } + }, "node_modules/semver": { "version": "7.8.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", @@ -11538,6 +12502,12 @@ "node": ">= 0.4" } }, + "node_modules/string-convert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", + "integrity": "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==", + "license": "MIT" + }, "node_modules/string.prototype.includes": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz", @@ -11742,6 +12712,12 @@ } } }, + "node_modules/stylis": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.4.0.tgz", + "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==", + "license": "MIT" + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -11805,6 +12781,15 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/throttle-debounce": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-5.0.2.tgz", + "integrity": "sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==", + "license": "MIT", + "engines": { + "node": ">=12.22" + } + }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", diff --git a/ui/litellm-dashboard/package.json b/ui/litellm-dashboard/package.json index cd08995471f..d6b185247ff 100644 --- a/ui/litellm-dashboard/package.json +++ b/ui/litellm-dashboard/package.json @@ -38,6 +38,7 @@ "@tanstack/react-table": "8.21.3", "@tanstack/react-virtual": "3.14.13", "@types/papaparse": "5.5.2", + "antd": "5.29.3", "class-variance-authority": "0.7.1", "clsx": "^2.1.1", "date-fns": "^4.4.0", diff --git a/ui/litellm-dashboard/scripts/shared-knowledge-preview.mjs b/ui/litellm-dashboard/scripts/shared-knowledge-preview.mjs new file mode 100644 index 00000000000..d41470523f6 --- /dev/null +++ b/ui/litellm-dashboard/scripts/shared-knowledge-preview.mjs @@ -0,0 +1,272 @@ +import { createHmac, randomBytes } from "node:crypto"; +import { createReadStream } from "node:fs"; +import { stat } from "node:fs/promises"; +import { createServer, request as httpRequest } from "node:http"; +import { dirname, extname, resolve, sep } from "node:path"; +import { fileURLToPath } from "node:url"; + +const dashboardDir = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const exportDir = resolve(dashboardDir, "out"); +const publicDir = resolve(dashboardDir, "public"); +const proxyDir = resolve(dashboardDir, "../../litellm/proxy"); +const port = Number(process.env.DEMO_PORT ?? 3222); +const previewOrigin = `http://127.0.0.1:${port}`; +const nextOrigin = process.env.DEMO_NEXT_ORIGIN ? new URL(process.env.DEMO_NEXT_ORIGIN) : null; +const sessionKey = `demo-only-${randomBytes(24).toString("hex")}`; +const signingKey = randomBytes(32); +const user = { user_id: "demo-admin", user_email: "demo@example.invalid", user_role: "proxy_admin" }; +const sessionExpires = Math.floor(Date.now() / 1000) + 12 * 60 * 60; +const jwtHeader = Buffer.from(JSON.stringify({ alg: "HS256", typ: "JWT" })).toString("base64url"); +const session = { + ...user, + key: sessionKey, + exp: sessionExpires, + premium_user: false, + login_method: "demo", + password_reset_required: false, + disabled_non_admin_personal_key_creation: false, +}; +const jwtPayload = Buffer.from(JSON.stringify(session)).toString("base64url"); +const jwtBody = `${jwtHeader}.${jwtPayload}`; +const sessionToken = `${jwtBody}.${createHmac("sha256", signingKey).update(jwtBody).digest("base64url")}`; + +if (nextOrigin && (nextOrigin.protocol !== "http:" || !["127.0.0.1", "localhost"].includes(nextOrigin.hostname))) { + process.stderr.write("DEMO_NEXT_ORIGIN must be a local HTTP origin\n"); + process.exit(1); +} +if (nextOrigin?.port === String(port)) { + process.stderr.write("Next and the preview server need different ports\n"); + process.exit(1); +} + +const fixtures = { + "/litellm/.well-known/litellm-ui-config": { + server_root_path: "", + proxy_base_url: previewOrigin, + auto_redirect_to_sso: false, + admin_ui_disabled: false, + sso_configured: false, + is_control_plane: false, + workers: [], + }, + "/ui/litellm-runtime-config.json": { backend_url: previewOrigin }, + "/litellm-runtime-config.json": { backend_url: previewOrigin }, + "/get/ui_settings": { values: {} }, + "/get/ui_theme_settings": { values: {} }, + "/public/litellm_blog_posts": { posts: [] }, + "/api/plugins": [], + "/management/v1/users/me": user, + "/health/readiness": { status: "healthy" }, + "/health/readiness/details": { status: "healthy", litellm_version: "demo", log_level: "INFO" }, + "/health/deployment_warnings": { ignore_available: false, warnings: [] }, + "/health/license": { + has_license: false, + license_type: null, + expiration_date: null, + allowed_features: [], + limits: { max_users: null, max_teams: null }, + }, + "/user/available_users": { + total_users: null, + total_users_used: 0, + total_users_remaining: null, + total_teams: null, + total_teams_used: 0, + total_teams_remaining: null, + }, + "/team/list": [], + "/organization/list": [], + "/v1/memory": { memories: [], total: 0 }, + "/sso/get/ui_settings": { PROXY_BASE_URL: previewOrigin, PROXY_LOGOUT_URL: `${previewOrigin}/preview` }, + "/get/user_banner": { enabled: false, message: "", severity: "info", revision: "demo" }, + "/get/latest_release_info": { + version: "demo", + release_url: "", + new_features: 0, + bug_fixes: 0, + other_updates: 0, + }, + "/telemetry/ui_events/enabled": { enabled: false }, + "/telemetry/settings": { + available_destinations: [], + destination: null, + destination_set_by_environment: false, + editable: false, + environment_variables: [], + flush_interval_seconds: 300, + groups: [], + report: null, + report_is_sample: true, + retention_days: 0, + set_by_environment: false, + stored_destination: null, + stored_groups: [], + vetoed: false, + }, +}; +const publicFixtures = new Set([ + "/litellm/.well-known/litellm-ui-config", + "/ui/litellm-runtime-config.json", + "/litellm-runtime-config.json", + "/get/ui_settings", + "/get/ui_theme_settings", + "/public/litellm_blog_posts", + "/health/readiness", +]); +const contentTypes = { + ".html": "text/html; charset=utf-8", + ".js": "text/javascript; charset=utf-8", + ".css": "text/css; charset=utf-8", + ".json": "application/json; charset=utf-8", + ".txt": "text/plain; charset=utf-8", + ".svg": "image/svg+xml", + ".png": "image/png", + ".ico": "image/x-icon", + ".woff": "font/woff", + ".woff2": "font/woff2", + ".webp": "image/webp", +}; + +function json(response, status, value) { + response.writeHead(status, { "Content-Type": "application/json; charset=utf-8" }); + response.end(JSON.stringify(value)); +} + +function isAuthorized(request) { + return request.headers.authorization === `Bearer ${sessionKey}` && Date.now() < sessionExpires * 1000; +} + +function openPreview(response, search) { + const destination = nextOrigin ? "/memory/demo/" : "/ui/memory/demo/"; + response.writeHead(302, { + Location: `${destination}${search}`, + "Set-Cookie": `token=${sessionToken}; Path=/; SameSite=Lax; Max-Age=43200`, + }); + response.end(); +} + +async function serveFile(request, response, filename) { + const details = await stat(filename).catch(() => null); + if (!details?.isFile()) return false; + response.writeHead(200, { + "Content-Type": contentTypes[extname(filename)] ?? "application/octet-stream", + "Content-Length": details.size, + }); + if (request.method === "HEAD") response.end(); + else createReadStream(filename).pipe(response); + return true; +} + +async function serveExport(request, response, pathname) { + const uiPath = pathname.replace(/^\/ui(?=\/|$)/, "").replace(/^\/litellm-asset-prefix(?=\/)/, ""); + const relative = uiPath.replace(/^\/+/, ""); + const exported = resolve(exportDir, relative); + const publicAsset = resolve(publicDir, relative); + const candidates = [exported, `${exported}.html`, resolve(exported, "index.html"), publicAsset]; + for (const candidate of candidates) { + const insideExport = candidate.startsWith(`${exportDir}${sep}`); + const insidePublic = candidate.startsWith(`${publicDir}${sep}`); + if ((insideExport || insidePublic) && (await serveFile(request, response, candidate))) return; + } + json(response, 404, { error: "No exported page found. Build the dashboard or set DEMO_NEXT_ORIGIN." }); +} + +function proxyToNext(request, response, url) { + const target = new URL(url.pathname.replace(/^\/ui(?=\/|$)/, "") + url.search, nextOrigin); + const forwardedHeaders = Object.fromEntries( + Object.entries(request.headers).filter( + ([name]) => !["authorization", "cookie", "host", "connection"].includes(name), + ), + ); + const headers = { ...forwardedHeaders, "x-shared-knowledge-preview-proxy": "1" }; + const upstream = httpRequest(target, { method: request.method, headers }, (upstreamResponse) => { + response.writeHead(upstreamResponse.statusCode ?? 502, upstreamResponse.headers); + upstreamResponse.pipe(response); + }); + upstream.on("error", () => + json(response, 502, { error: "Next.js is not ready. Start the local dev server and reload." }), + ); + request.pipe(upstream); +} + +function isPageOrAsset(request, url) { + return ( + !request.headers.accept?.includes("application/json") && + /^\/(?:ui(?:\/|$)|memory(?:\/|$)|login(?:\/|$)|_next\/|__nextjs|litellm-asset-prefix\/|assets\/|favicon\.ico)/.test( + url.pathname, + ) + ); +} + +async function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-store"); + response.setHeader("X-Content-Type-Options", "nosniff"); + if (request.headers["x-shared-knowledge-preview-proxy"] === "1") { + json(response, 404, { error: "The requested route is missing from the local Next.js server." }); + return; + } + const url = new URL(request.url ?? "/", previewOrigin); + const hostname = (request.headers.host ?? "").split(":")[0]; + if (!["127.0.0.1", "localhost"].includes(hostname)) { + json(response, 403, { error: "This preview is local only." }); + return; + } + if (request.headers.origin) { + const allowedOrigins = [previewOrigin, `http://localhost:${port}`, nextOrigin?.origin]; + if (!allowedOrigins.includes(request.headers.origin)) { + json(response, 403, { error: "Only the local demo can use preview fixtures." }); + return; + } + response.setHeader("Access-Control-Allow-Origin", request.headers.origin); + response.setHeader("Access-Control-Allow-Headers", "Authorization, Content-Type, Accept"); + response.setHeader("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS"); + } + if (request.method === "OPTIONS") { + response.writeHead(204); + response.end(); + return; + } + if (!["GET", "HEAD"].includes(request.method ?? "")) { + json(response, 405, { error: "This preview serves read-only fixtures. Demo actions stay in the browser." }); + return; + } + if (["/", "/preview", "/preview/", "/knowledge-demo", "/knowledge-demo/"].includes(url.pathname)) { + openPreview(response, url.search); + return; + } + if (Object.hasOwn(fixtures, url.pathname)) { + const permitted = publicFixtures.has(url.pathname) || isAuthorized(request); + json( + response, + permitted ? 200 : 401, + permitted ? fixtures[url.pathname] : { error: "Open /preview to start a demo session." }, + ); + return; + } + if (url.pathname === "/get_image") { + await serveFile(request, response, resolve(proxyDir, "logo.png")); + return; + } + if (url.pathname === "/get_favicon") { + await serveFile(request, response, resolve(dashboardDir, "src/app/favicon.ico")); + return; + } + if (!isPageOrAsset(request, url)) { + json(response, 404, { + error: "No fixture exists for this endpoint. The preview never contacts a production service.", + }); + return; + } + if (nextOrigin) proxyToNext(request, response, url); + else await serveExport(request, response, decodeURIComponent(url.pathname)); +} + +const server = createServer((request, response) => { + void handleRequest(request, response).catch(() => { + if (!response.headersSent) json(response, 500, { error: "The local preview could not serve this request." }); + else response.end(); + }); +}); +server.listen(port, "127.0.0.1", () => { + process.stdout.write(`Local fixture preview ready at ${previewOrigin}/preview\n`); +}); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.test.tsx index b703df652c2..d54bcbd0ef4 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.test.tsx @@ -6,6 +6,7 @@ import React from "react"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { MemoryRow } from "@/components/networking"; +import { uiHref } from "@/utils/uiHref"; import { MemoryView } from "./MemoryView"; @@ -88,6 +89,12 @@ describe("MemoryView", () => { expect(screen.getByText(/Scoped to memories visible to your user \/ team \(admins see all\)/)).toBeInTheDocument(); }); + it("should link to the shared knowledge demo from Memory", () => { + renderView(null); + + expect(screen.getByRole("link", { name: "Shared knowledge demo" })).toHaveAttribute("href", uiHref("memory/demo")); + }); + it("opens the create modal from the New memory button", async () => { const user = userEvent.setup(); renderView(null); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.tsx index 58d4e42aa96..a2708134b1b 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.tsx @@ -4,6 +4,7 @@ import { useDebouncedValue } from "@tanstack/react-pacer/debouncer"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import type { PaginationState } from "@tanstack/react-table"; import { Plus } from "lucide-react"; +import { Button as DemoButton } from "antd"; import React, { useCallback, useMemo, useState } from "react"; import { MemoryRow, createMemory, deleteMemory, fetchMemoryList, updateMemory } from "@/components/networking"; @@ -11,6 +12,7 @@ import DeleteResourceModal from "@/components/common_components/DeleteResourceMo import { toast } from "@/lib/toast"; import { Button } from "@/components/ui/button"; import { DEBOUNCE_WAIT_MS } from "@/utils/debounceConstants"; +import { uiHref } from "@/utils/uiHref"; import { MemoryDetailDrawer } from "./MemoryDetailDrawer"; import { MemoryEditModal } from "./MemoryEditModal"; @@ -176,7 +178,7 @@ export const MemoryView: React.FC = ({ accessToken }) => { return (
-
+

Memory

@@ -187,10 +189,13 @@ export const MemoryView: React.FC = ({ accessToken }) => { . Scoped to memories visible to your user / team (admins see all).

- +
+ Shared knowledge demo + +
, name: RegExp) { + const step = within(screen.getByRole("navigation", { name: "Demo steps" })).getByRole("button", { name }); + await user.click(step); + await waitFor(() => expect(step).toHaveAttribute("aria-current", "step")); +} + +describe("SharedKnowledgeDemo", () => { + it("should render the knowledge categories with a link back to Memory", () => { + renderWithProviders(); + + expect(screen.getByRole("heading", { name: "Shared knowledge", exact: true })).toBeInTheDocument(); + expect(screen.getByRole("link", { name: "Back to Memory" })).toHaveAttribute("href", uiHref("memory")); + expect(screen.getByRole("switch", { name: "Enable Account reporting" })).toBeChecked(); + expect(screen.getByText("User systems", { exact: true })).toBeInTheDocument(); + expect(screen.getByText("Operator systems", { exact: true })).toBeInTheDocument(); + }); + + it("should carry a scoped memo through publication, reuse, feedback, and skill promotion", async () => { + const user = userEvent.setup(); + const onUrlUpdate = vi.fn(); + const title = "Use active child accounts in reporting totals"; + renderWithProviders(, { searchParams: "?workspace=demo", onUrlUpdate }); + + await user.click(screen.getByRole("switch", { name: "Enable Account reporting" })); + await chooseStep(user, /Capture a memo/); + expect(screen.getByRole("button", { name: "Save Memo to Shared Knowledge" })).toBeDisabled(); + expect(screen.getByRole("alert")).toHaveTextContent("Enable Account reporting in step 1 to save this memo."); + await chooseStep(user, /Define scope/); + await user.click(screen.getByRole("switch", { name: "Enable Account reporting" })); + await chooseStep(user, /Capture a memo/); + act(() => { + fireEvent.change(screen.getByRole("textbox", { name: "Title", exact: true }), { target: { value: title } }); + fireEvent.change(screen.getByRole("textbox", { name: "Summary", exact: true }), { + target: { value: "Filter active parent and child accounts before calculating the total." }, + }); + }); + await user.click(screen.getByRole("button", { name: "Save Memo to Shared Knowledge" })); + expect(screen.getByRole("heading", { name: "Published memo", exact: true })).toBeInTheDocument(); + + await chooseStep(user, /Review & reuse/); + expect(screen.getByRole("heading", { name: title, exact: true })).toBeInTheDocument(); + expect(screen.queryByText(sampleNotice)).not.toBeInTheDocument(); + await user.click(screen.getByRole("button", { name: "Run Judge Review" })); + expect(screen.getByText("Accepted · v2 published", { exact: true })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Evidence-backed Update" })).toBeDisabled(); + await user.click(screen.getByRole("button", { name: "Load v2 into Session" })); + await user.click(screen.getByRole("button", { name: "Record Helpful Outcome" })); + expect(screen.getByRole("button", { name: "Outcome Recorded" })).toBeDisabled(); + + await chooseStep(user, /Learn & curate/); + const memoRow = screen.getByRole("row", { name: new RegExp(title) }); + expect(memoRow).toHaveTextContent("29 helpful / 31 known"); + expect(memoRow).toHaveTextContent("33 loads · 8 agents"); + await user.click(screen.getByRole("button", { name: "Run Periodic Review" })); + expect(memoRow).toHaveTextContent("Promoted to skill"); + expect(screen.getByRole("row", { name: /Legacy account-total workaround/ })).toHaveTextContent("Archived"); + expect(screen.getByRole("row", { name: /Bazel: recover from a corrupted JAR/ })).toHaveTextContent("Retained"); + await user.click(screen.getByRole("button", { name: "View Skill" })); + expect(screen.getByRole("dialog", { name: "Account reporting checks" })).toHaveTextContent( + "Derived from memo_014 · v2", + ); + await user.click(screen.getByRole("button", { name: "Close Skill" })); + + await waitFor(() => expect(onUrlUpdate.mock.calls.at(-1)?.[0].searchParams.get("step")).toBe("4")); + expect(onUrlUpdate.mock.calls.at(-1)?.[0].searchParams.get("workspace")).toBe("demo"); + expect(onUrlUpdate.mock.calls.at(-1)?.[0].options.history).toBe("push"); + }); + + it("should preserve a published version and recorded feedback when a later correction is rejected", async () => { + const user = userEvent.setup(); + renderWithProviders(, { searchParams: "?step=3" }); + await user.click(screen.getByRole("button", { name: "Run Judge Review" })); + await user.click(screen.getByRole("button", { name: "Load v2 into Session" })); + await user.click(screen.getByRole("button", { name: "Record Helpful Outcome" })); + act(() => { + fireEvent.change(screen.getByRole("textbox", { name: "Search shared knowledge" }), { + target: { value: "unrelated quantum penguins" }, + }); + }); + await user.click(screen.getByRole("button", { name: "Search", exact: true })); + expect(screen.getByText("No matching demo memos", { exact: true })).toBeInTheDocument(); + act(() => { + fireEvent.change(screen.getByRole("textbox", { name: "Search shared knowledge" }), { + target: { value: "inactive accounts" }, + }); + }); + await user.click(screen.getByRole("button", { name: "Search", exact: true })); + await user.click(screen.getByRole("button", { name: "Try Unsupported Update" })); + await user.click(screen.getByRole("button", { name: "Run Judge Review" })); + + expect(screen.getByText("Rejected · v2 remains published", { exact: true })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Load v2 into Session" })).toBeEnabled(); + expect(screen.getByRole("button", { name: "Evidence-backed Update" })).toBeDisabled(); + await chooseStep(user, /Learn & curate/); + expect(screen.getByRole("row", { name: new RegExp(initialTitle) })).toHaveTextContent("29 helpful / 31 known"); + }); + + it("should keep an unsaved draft separate and preserve the version used to promote a skill", async () => { + const user = userEvent.setup(); + const draftTitle = "Unpublished reporting investigation"; + renderWithProviders(, { searchParams: "?step=2" }); + act(() => { + fireEvent.change(screen.getByRole("textbox", { name: "Title", exact: true }), { target: { value: draftTitle } }); + }); + await chooseStep(user, /Review & reuse/); + expect(screen.getByText(sampleNotice)).toBeInTheDocument(); + expect(screen.queryByText(draftTitle)).not.toBeInTheDocument(); + expect(screen.getByRole("heading", { name: initialTitle, exact: true })).toBeInTheDocument(); + await chooseStep(user, /Learn & curate/); + await user.click(screen.getByRole("button", { name: "Run Periodic Review" })); + await chooseStep(user, /Review & reuse/); + await user.click(screen.getByRole("button", { name: "Run Judge Review" })); + await chooseStep(user, /Learn & curate/); + await user.click(screen.getByRole("button", { name: "View Skill" })); + + expect(screen.getByRole("dialog", { name: "Account reporting checks" })).toHaveTextContent( + "Derived from memo_014 · v1", + ); + expect(screen.getByRole("dialog", { name: "Account reporting checks" })).toHaveTextContent( + "Explicitly exclude inactive accounts from the total.", + ); + await user.click(screen.getByRole("button", { name: "Close Skill" })); + await chooseStep(user, /Capture a memo/); + await user.click(screen.getByRole("button", { name: "Save Memo to Shared Knowledge" })); + await chooseStep(user, /Review & reuse/); + expect(screen.getByRole("heading", { name: draftTitle, exact: true })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Load v1 into Session" })).toBeEnabled(); + }); + + it.each([ + ["2", "Turn a hard-won finding into a memo"], + ["3", "Review corrections. Share the better answer."], + ["4", "Let outcomes improve the knowledge base"], + ["99", "Define what agents should remember"], + ])("should open the valid step or fall back to scope for step=%s", (step, heading) => { + renderWithProviders(, { searchParams: `?step=${step}` }); + + expect(screen.getByRole("heading", { name: heading, exact: true })).toBeInTheDocument(); + }); +}); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgeDemo.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgeDemo.tsx new file mode 100644 index 00000000000..bffafb09dd4 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgeDemo.tsx @@ -0,0 +1,709 @@ +"use client"; + +import { useState, useSyncExternalStore, type FormEvent } from "react"; +import { Button, ConfigProvider, Input, Modal, Switch, Tag, theme } from "antd"; +import { useTheme } from "next-themes"; +import { parseAsStringLiteral, useQueryState } from "nuqs"; +import { uiHref } from "@/utils/uiHref"; +import { Eyebrow, Note, Panel } from "./SharedKnowledgePrimitives"; +import { SharedKnowledgeReview } from "./SharedKnowledgeReview"; +import { + ArrowRight, + BookOpen, + Bot, + Check, + CheckCheck, + Clock3, + Database, + FileText, + Layers3, + ListFilter, + LockKeyhole, + Sparkles, + Terminal, + Users, +} from "lucide-react"; + +const steps = ["Define scope", "Capture a memo", "Review & reuse", "Learn & curate"]; +const titles = [ + "Define what agents should remember", + "Turn a hard-won finding into a memo", + "Review corrections. Share the better answer.", + "Let outcomes improve the knowledge base", +]; +const subtitles = [ + "Organize shared knowledge by system and by the people who use it.", + "An agent resolves an unusual problem and saves the lesson for the next person.", + "Agents propose changes; a service-side LLM judge checks them before publication.", + "A periodic review promotes proven patterns and archives low-value knowledge.", +]; +const initialTitle = "Exclude inactive accounts from cross-account totals"; +const initialSummary = + "The reporting service includes inactive accounts by default. Explicitly exclude them when calculating totals."; +const categories = [ + { + name: "Account reporting", + audience: "User", + count: 18, + description: "Totals, account lifecycle, and reporting quirks", + icon: Users, + }, + { + name: "Billing", + audience: "User", + count: 12, + description: "Invoices, credits, and reconciliation", + icon: FileText, + }, + { + name: "Bazel & builds", + audience: "Operator", + count: 9, + description: "Build failures, caches, and dependency recovery", + icon: Terminal, + }, + { + name: "Deployments", + audience: "Operator", + count: 7, + description: "Rollouts, service health, and incident recovery", + icon: Layers3, + }, +]; + +const stepValues = ["1", "2", "3", "4"] as const; +const stepParser = parseAsStringLiteral(stepValues).withDefault("1").withOptions({ history: "push" }); + +function subscribeHydration() { + return () => {}; +} + +export default function SharedKnowledgeDemo() { + const [stepValue, setStepValue] = useQueryState("step", stepParser); + const step = Number(stepValue); + const { resolvedTheme } = useTheme(); + const hydrated = useSyncExternalStore( + subscribeHydration, + () => true, + () => false, + ); + const dark = hydrated && resolvedTheme === "dark"; + const [enabled, setEnabled] = useState(categories.map(() => true)); + const [selected, setSelected] = useState(0); + const [memoTitle, setMemoTitle] = useState(initialTitle); + const [summary, setSummary] = useState(initialSummary); + const [saved, setSaved] = useState(false); + const [version, setVersion] = useState(1); + const [proposalBaseVersion, setProposalBaseVersion] = useState(1); + const [judge, setJudge] = useState<"pending" | "accepted" | "rejected">("pending"); + const [proposal, setProposal] = useState<"supported" | "unsupported">("supported"); + const [loads, setLoads] = useState<{ version: number; helpful: boolean }[]>([]); + const [activeLoad, setActiveLoad] = useState(null); + const [query, setQuery] = useState("cross-account totals include inactive accounts"); + const [search, setSearch] = useState("cross-account totals include inactive accounts"); + const [skillVersion, setSkillVersion] = useState(null); + const reviewed = skillVersion !== null; + const loaded = activeLoad !== null; + const outcome = activeLoad !== null && loads[activeLoad]?.helpful; + const loadedVersion = activeLoad !== null ? loads[activeLoad]?.version : version; + const helpfulCount = loads.filter((load) => load.helpful).length; + const publishedTitle = saved ? memoTitle : initialTitle; + const [skillOpen, setSkillOpen] = useState(false); + const [evidenceOpen, setEvidenceOpen] = useState(false); + + const hasMatch = /account|total|report|inactive|sum/i.test(search); + const enabledCount = enabled.filter(Boolean).length; + const category = categories[selected]; + const canSave = enabled[0] && memoTitle.trim().length > 0 && summary.trim().length > 0; + const go = (next: number) => { + void setStepValue(stepValues[next - 1]); + }; + const chooseProposal = (next: "supported" | "unsupported") => { + if (next === "supported" && version >= 2) return; + setProposal(next); + setProposalBaseVersion(version); + setJudge("pending"); + setActiveLoad(null); + }; + const saveMemo = () => { + setSaved(true); + setVersion(1); + setProposalBaseVersion(1); + setJudge("pending"); + setProposal("supported"); + setLoads([]); + setActiveLoad(null); + setSkillVersion(null); + }; + const reviewProposal = () => { + setJudge(proposal === "supported" ? "accepted" : "rejected"); + if (proposal === "supported") setVersion((current) => current + 1); + setActiveLoad(null); + }; + const searchMemos = (event: FormEvent) => { + event.preventDefault(); + setSearch(query); + setActiveLoad(null); + }; + const loadMemo = () => { + setActiveLoad(loads.length); + setLoads((previous) => [...previous, { version, helpful: false }]); + }; + const recordHelpfulOutcome = () => { + setLoads((previous) => previous.map((load, index) => (index === activeLoad ? { ...load, helpful: true } : load))); + }; + + const reset = () => { + setEnabled(categories.map(() => true)); + setSelected(0); + setMemoTitle(initialTitle); + setSummary(initialSummary); + setSaved(false); + setVersion(1); + setProposalBaseVersion(1); + setJudge("pending"); + setProposal("supported"); + setActiveLoad(null); + setSkillVersion(null); + setLoads([]); + setQuery("cross-account totals include inactive accounts"); + setSearch("cross-account totals include inactive accounts"); + go(1); + }; + + return ( + +
+
+
+

Shared knowledge

+

Lessons from one agent. Useful to every agent.

+
+
+ Interactive demo + + + + Workspace shared + +
+
+ +
+ + {step} + +
+

{titles[step - 1]}

+

{subtitles[step - 1]}

+
+
+ + {step >= 3 && !saved && ( +

+ Using a published sample memo. Save your draft in step 2 to use it here. +

+ )} + + {step === 1 && ( + <> +
+ + + Knowledge categories + + } + extra={{enabledCount} enabled} + > +
+ {["User", "Operator"].map((audience) => ( +
+ {audience} systems + {categories.map( + (item, i) => + item.audience === audience && ( +
+ + + setEnabled((previous) => + previous.map((entry, index) => (index === i ? value : entry)), + ) + } + /> +
+ ), + )} +
+ ))} +
+
+ {category.audience}}> +
+
+ Selected category +

{category.name}

+

{category.description}

+
+
+ When should an agent write a memo? +
    +
  • + + An unexpected behavior took research to resolve +
  • +
  • + + The lesson will help someone else +
  • +
  • + A source session supports the + finding +
  • +
+
+ }> + Shared within this workspace + + User and operator are knowledge categories. Access permissions still determine who can retrieve + each memo. + + +
+
+
+ }> + One searchable memo library + ·Postgres stores the memo content, versions, and evidence. Vector + text + indexes make it discoverable across agents. + + + )} + + {step === 2 && ( +
+ + + Reporting agent + + } + extra={Session 8f2a} + > +
+
+ Alex · Finance +

+ Why is the cross-account total higher than the sum of our active accounts? +

+
+
+ + + +
+

I compared the account lifecycle rules with the reporting queries.

+
+

+ + Read reporting service documentation +

+

+ + Traced the aggregation query +

+

+ + Verified with and without inactive accounts +

+
+

The service includes inactive accounts by default. Filtering them out reconciled the total.

+
+
+
+
+ + + save_memo + + {saved ? "Saved" : "Proposed"} +
+

+ This took 14 minutes of investigation. I’ll record the behavior and the fix so other agents can + reuse it. +

+
+ +
+
+ + + {saved ? "Published memo" : "New memo"} + + } + extra={saved ? v1 · Published : Draft} + > +
+
+ Account reporting + User systems +
+
+ + setMemoTitle(e.target.value)} + /> +
+
+ + setSummary(e.target.value)} + /> +
+
+ Guidance +

+ Explicitly filter to active accounts when calculating a cross-account total. Compare the result with + the active-account report. +

+
+
+ Source: session 8f2a + Author: Reporting agent +
+ {!enabled[0] && ( +

+ Enable Account reporting in step 1 to save this memo. +

+ )} + +

Demo action · stored in this page only

+
+
+
+ )} + + {step === 3 && ( + setEvidenceOpen(true)} + query={query} + onQueryChange={setQuery} + onSearch={searchMemos} + hasMatch={hasMatch} + loaded={loaded} + outcome={outcome} + loadedVersion={loadedVersion} + onLoad={loadMemo} + onHelpfulOutcome={recordHelpfulOutcome} + /> + )} + + {step === 4 && ( + <> +
+ {[ + { + label: "Memo loads", + value: 32 + loads.length, + detail: "Across 8 agents", + }, + { + label: "Helpful", + value: 28 + helpfulCount, + detail: "Task resolved after use", + }, + { + label: "Unhelpful", + value: 2, + detail: "Did not resolve the task", + }, + { + label: "Unknown", + value: 2 + loads.length - helpfulCount, + detail: "No outcome reported", + }, + ].map((stat) => ( +
+

{stat.label}

+

{stat.value}

+

{stat.detail}

+
+ ))} +
+ + + Weekly knowledge review + + } + extra={{reviewed ? "Review complete" : "Ready to run"}} + > +
+

+ Last 30 days · outcomes are attached to the memo version used +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
MemoUsefulness{reviewed ? "Decision" : "Recommendation"}
+

{publishedTitle}

+

Account reporting · User

+
+

+ {28 + helpfulCount} helpful / {30 + helpfulCount} known +

+

{32 + loads.length} loads · 8 agents

+
+ {reviewed ? "Promoted to skill" : "Promote to skill"} +

Frequent + consistently useful

+
+

Legacy account-total workaround

+

Account reporting · User

+
+

1 helpful / 10 known

+

Superseded by current guidance

+
+ {reviewed ? "Archived" : "Archive"} +

Removed from retrieval; history kept

+
+

Bazel: recover from a corrupted JAR

+

Bazel & builds · Operator

+
+

2 helpful / 2 known

+

Rare failure · last used 8 months ago

+
+ {reviewed ? "Retained" : "Keep"} +

Rare does not mean low value

+
+
+
+
+ + + {reviewed ? "Added to Skills" : "Skill preview"} + + } + extra={{reviewed ? "Available" : "Candidate"}} + > +
+

Account reporting checks

+

+ A reusable procedure: select active accounts, filter before aggregation, and reconcile the final + total. +

+
+ + Source: memo_014 · v{skillVersion ?? version} + + +
+
+
+ +
+

+ Promote after 20+ loads and at least 90% helpful + outcomes among 10+ known outcomes. +

+

+ Archive superseded guidance with less than 20% helpful + outcomes across 10+ known outcomes. +

+

+ Retain useful rare fixes. Unknown outcomes do not count + as failures. +

+
+
+
+ + )} + +
+
Demo data · actions are simulated · resets on reload
+
+ + {step > 1 && } + {step < 4 && ( + + )} +
+
+
+ setEvidenceOpen(false)} + footer={} + > +
+

The agent checked the same reporting period with three query variants:

+
    +
  1. Unfiltered total: 1,280 account units.
  2. +
  3. Parent-only active filter: 1,120 account units.
  4. +
  5. + Active parent and child accounts filtered before aggregation: 1,000 account units, matching the + active-account report. +
  6. +
+

+ Synthetic evidence for the prototype. No customer data is loaded. +

+
+
+ setSkillOpen(false)} + footer={} + > +
+ {reviewed ? "Promoted in demo" : "Preview"} +

Use when calculating or debugging totals across accounts.

+
    +
  1. Identify active accounts for the reporting period.
  2. +
  3. + {(skillVersion ?? version) >= 2 + ? "Exclude inactive parent and child accounts before aggregation." + : "Explicitly exclude inactive accounts from the total."} +
  4. +
  5. Reconcile against the active-account report.
  6. +
  7. Record whether the procedure resolved the discrepancy.
  8. +
+

+ Derived from memo_014 · v{skillVersion ?? version}. Source evidence and version history are preserved. +

+
+
+
+ ); +} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgePrimitives.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgePrimitives.tsx new file mode 100644 index 00000000000..893b9dd44ae --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgePrimitives.tsx @@ -0,0 +1,46 @@ +import type { ReactNode } from "react"; +import { Check } from "lucide-react"; + +export function Panel({ + title, + extra, + children, + className = "", +}: { + title: ReactNode; + extra?: ReactNode; + children: ReactNode; + className?: string; +}) { + return ( +
+
+

{title}

+ {extra} +
+ {children} +
+ ); +} + +export function Eyebrow({ children }: { children: ReactNode }) { + return

{children}

; +} + +export function Success({ children }: { children: ReactNode }) { + return ( + + + {children} + + ); +} + +export function Note({ icon, children }: { icon: ReactNode; children: ReactNode }) { + return ( +
+ {icon} +
{children}
+
+ ); +} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgeReview.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgeReview.tsx new file mode 100644 index 00000000000..5d8dc2b6485 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/SharedKnowledgeReview.tsx @@ -0,0 +1,246 @@ +import type { FormEvent } from "react"; +import { Button, Input, Tag } from "antd"; +import { Check, Clock3, FileText, GitBranch, Search, ShieldCheck, ThumbsUp, X } from "lucide-react"; +import { Eyebrow, Panel, Success } from "./SharedKnowledgePrimitives"; + +type JudgeStatus = "pending" | "accepted" | "rejected"; +type Proposal = "supported" | "unsupported"; + +type SharedKnowledgeReviewProps = { + publishedTitle: string; + version: number; + proposalBaseVersion: number; + proposal: Proposal; + judge: JudgeStatus; + chooseProposal: (proposal: Proposal) => void; + onReview: () => void; + onOpenEvidence: () => void; + query: string; + onQueryChange: (query: string) => void; + onSearch: (event: FormEvent) => void; + hasMatch: boolean; + loaded: boolean; + outcome: boolean; + loadedVersion: number; + onLoad: () => void; + onHelpfulOutcome: () => void; +}; + +const judgeViews = { + accepted: { + className: "border-emerald-500/30 bg-emerald-500/5", + icon: Check, + iconClassName: "text-emerald-600 dark:text-emerald-400", + title: (version: number) => `Accepted · v${version} published`, + description: + "The query results support filtering before aggregation. The correction adds a verified child-account edge case.", + }, + rejected: { + className: "border-amber-500/30 bg-amber-500/5", + icon: X, + iconClassName: "text-amber-600 dark:text-amber-400", + title: (version: number) => `Rejected · v${version} remains published`, + description: "The proposed change contradicts the query evidence. No new version is published.", + }, + pending: { + className: "border-border bg-muted/40", + icon: Clock3, + iconClassName: "", + title: () => "Awaiting review", + description: "The published memo stays available while the proposed correction is checked.", + }, +}; + +export function SharedKnowledgeReview({ + publishedTitle, + version, + proposalBaseVersion, + proposal, + judge, + chooseProposal, + onReview, + onOpenEvidence, + query, + onQueryChange, + onSearch, + hasMatch, + loaded, + outcome, + loadedVersion, + onLoad, + onHelpfulOutcome, +}: SharedKnowledgeReviewProps) { + const judgeView = judgeViews[judge]; + const JudgeIcon = judgeView.icon; + return ( + <> +
+ + + Proposed correction + + } + extra={ + + v{proposalBaseVersion} → v{proposalBaseVersion + 1} + + } + > +
+
+

{publishedTitle}

+

Proposed by Reconciliation agent · session b71c

+
+
+ + +
+
+
+ Current · v{proposalBaseVersion} + {proposalBaseVersion === 1 + ? "Filter to active accounts when calculating the total." + : "Filter inactive parent and child accounts before aggregation."} +
+
+ Proposed · v{proposalBaseVersion + 1} + {proposal === "supported" ? ( + <> + Filter inactive accounts before aggregation, including child accounts. A + parent-only filter can still overcount. + + ) : ( + <>Remove the active-account filter. All accounts should always be included. + )} +
+
+ +
+ + Version history retained · {version > 1 ? `v1 → v${version} (current)` : "v1 remains current"} +
+
+
+ + + Service-side LLM judge + + } + extra={Simulated} + > +
+

+ A small model checks the correction against the current memo and its source evidence. +

+
    +
  • + + Supported by the evidence +
  • +
  • + + Consistent with the original scope +
  • +
  • + + Specific enough to apply safely +
  • +
+
+

+ + {judgeView.title(version)} +

+

{judgeView.description}

+
+ +
+
+
+ + + The next agent finds the published memo + + } + extra={Postgres · vector + text search} + > +
+
+ } + value={query} + onChange={(e) => onQueryChange(e.target.value)} + /> + +
+ {hasMatch ? ( +
+
+

{publishedTitle}

+

+ v{version} · Semantic + keyword match · Account reporting +

+
+ +
+ ) : ( +
+ +

No matching demo memos

+

Try “inactive accounts” or “reporting totals”.

+
+ )} + {loaded && ( +
+ + {outcome + ? "Helpful outcome recorded · linked to this memo version" + : `Finance assistant loaded v${loadedVersion} into a different user’s session`} + + +
+ )} +
+
+ + ); +} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/page.integration.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/page.integration.test.tsx new file mode 100644 index 00000000000..baf3eb5b454 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/page.integration.test.tsx @@ -0,0 +1,38 @@ +import { screen } from "@testing-library/react"; +import { beforeEach, describe, expect, it, vi } from "vitest"; +import { renderWithProviders, testQueryClient } from "../../../../../tests/test-utils"; +import SharedKnowledgeDemoPage from "./page"; + +const { useAuthorizedMock } = vi.hoisted(() => ({ useAuthorizedMock: vi.fn() })); + +vi.mock("@/app/(dashboard)/hooks/useAuthorized", () => ({ default: useAuthorizedMock })); + +function renderAs(userRole: string) { + const session = { accessToken: "demo-token", userId: "demo-user", userRole, premiumUser: false }; + useAuthorizedMock.mockReturnValue(session); + return renderWithProviders(, { searchParams: "?step=3" }); +} + +describe("Shared knowledge demo page access", () => { + beforeEach(() => { + testQueryClient.clear(); + vi.clearAllMocks(); + }); + + it("should render the requested demo step for an admin", () => { + renderAs("Admin"); + + expect(screen.getByRole("heading", { name: "Shared knowledge", exact: true })).toBeInTheDocument(); + expect(screen.getByRole("heading", { name: "Review corrections. Share the better answer." })).toBeInTheDocument(); + }); + + it.each(["Internal User", "Internal Viewer", "Org Admin", "Unknown Role"])( + "should show the Memory access notice instead of the demo for %s", + (userRole) => { + renderAs(userRole); + + expect(screen.getByText("Memory is only available to admin users.")).toBeInTheDocument(); + expect(screen.queryByRole("navigation", { name: "Demo steps" })).not.toBeInTheDocument(); + }, + ); +}); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/page.tsx new file mode 100644 index 00000000000..acb5b0a6118 --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/memory/demo/page.tsx @@ -0,0 +1,15 @@ +"use client"; + +import useCan from "@/app/(dashboard)/hooks/useCan"; +import { AdminOnlyNotice } from "@/components/shared/AdminOnlyNotice"; +import SharedKnowledgeDemo from "./SharedKnowledgeDemo"; + +export default function SharedKnowledgeDemoPage() { + const canViewMemory = useCan("viewMemory"); + + if (!canViewMemory) { + return ; + } + + return ; +}