diff --git a/package-lock.json b/package-lock.json index d9a89fb..134891f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,6 +86,448 @@ "tslib": "^2.4.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@img/colour": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", @@ -736,6 +1178,24 @@ "node": ">= 10" } }, + "node_modules/@opencode-ai/plugin": { + "version": "1.1.53", + "resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.1.53.tgz", + "integrity": "sha512-9ye7Wz2kESgt02AUDaMea4hXxj6XhWwKAG8NwFhrw09Ux54bGaMJFt1eIS8QQGIMaD+Lp11X4QdyEg96etEBJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@opencode-ai/sdk": "1.1.53", + "zod": "4.1.8" + } + }, + "node_modules/@opencode-ai/sdk": { + "version": "1.1.53", + "resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.1.53.tgz", + "integrity": "sha512-RUIVnPOP1CyyU32FrOOYuE7Ge51lOBuhaFp2NSX98ncApT7ffoNetmwzqrhOiJQgZB1KrbCHLYOCK6AZfacxag==", + "dev": true, + "license": "MIT" + }, "node_modules/@prisma/client": { "version": "6.19.2", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.19.2.tgz", @@ -821,6 +1281,356 @@ "@prisma/debug": "6.19.2" } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz", + "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz", + "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz", + "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz", + "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz", + "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz", + "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz", + "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz", + "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz", + "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz", + "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz", + "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz", + "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz", + "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz", + "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz", + "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz", + "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz", + "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz", + "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz", + "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz", + "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz", + "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz", + "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz", + "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz", + "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz", + "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@standard-schema/spec": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", @@ -1164,6 +1974,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.19.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.10.tgz", @@ -1226,6 +2043,46 @@ "d3-zoom": "^3.0.0" } }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agentlens-sdk": { + "resolved": "packages/sdk-ts", + "link": true + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/bundle-require": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", + "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.18" + } + }, "node_modules/c12": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", @@ -1255,6 +2112,16 @@ } } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001769", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", @@ -1313,6 +2180,16 @@ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", "license": "MIT" }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/confbox": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.4.tgz", @@ -1442,6 +2319,24 @@ "node": ">=12" } }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/deepmerge-ts": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", @@ -1524,6 +2419,48 @@ "node": ">=10.13.0" } }, + "node_modules/esbuild": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.3", + "@esbuild/android-arm": "0.27.3", + "@esbuild/android-arm64": "0.27.3", + "@esbuild/android-x64": "0.27.3", + "@esbuild/darwin-arm64": "0.27.3", + "@esbuild/darwin-x64": "0.27.3", + "@esbuild/freebsd-arm64": "0.27.3", + "@esbuild/freebsd-x64": "0.27.3", + "@esbuild/linux-arm": "0.27.3", + "@esbuild/linux-arm64": "0.27.3", + "@esbuild/linux-ia32": "0.27.3", + "@esbuild/linux-loong64": "0.27.3", + "@esbuild/linux-mips64el": "0.27.3", + "@esbuild/linux-ppc64": "0.27.3", + "@esbuild/linux-riscv64": "0.27.3", + "@esbuild/linux-s390x": "0.27.3", + "@esbuild/linux-x64": "0.27.3", + "@esbuild/netbsd-arm64": "0.27.3", + "@esbuild/netbsd-x64": "0.27.3", + "@esbuild/openbsd-arm64": "0.27.3", + "@esbuild/openbsd-x64": "0.27.3", + "@esbuild/openharmony-arm64": "0.27.3", + "@esbuild/sunos-x64": "0.27.3", + "@esbuild/win32-arm64": "0.27.3", + "@esbuild/win32-ia32": "0.27.3", + "@esbuild/win32-x64": "0.27.3" + } + }, "node_modules/exsolve": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", @@ -1554,6 +2491,51 @@ "node": ">=8.0.0" } }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fix-dts-default-cjs-exports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", + "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.17", + "mlly": "^1.7.4", + "rollup": "^4.34.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/giget": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", @@ -1589,6 +2571,16 @@ "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/lightningcss": { "version": "1.30.2", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.2.tgz", @@ -1850,6 +2842,36 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/lucide-react": { "version": "0.469.0", "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.469.0.tgz", @@ -1869,6 +2891,57 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, + "node_modules/mlly": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", + "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.15.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.1" + } + }, + "node_modules/mlly/node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mlly/node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", @@ -1999,6 +3072,16 @@ "devOptional": true, "license": "MIT" }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ohash": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", @@ -2006,6 +3089,10 @@ "devOptional": true, "license": "MIT" }, + "node_modules/opencode-agentlens": { + "resolved": "packages/opencode-plugin", + "link": true + }, "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -2026,6 +3113,29 @@ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/pkg-types": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", @@ -2067,6 +3177,49 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, "node_modules/prisma": { "version": "6.19.2", "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.19.2.tgz", @@ -2156,6 +3309,61 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz", + "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.57.1", + "@rollup/rollup-android-arm64": "4.57.1", + "@rollup/rollup-darwin-arm64": "4.57.1", + "@rollup/rollup-darwin-x64": "4.57.1", + "@rollup/rollup-freebsd-arm64": "4.57.1", + "@rollup/rollup-freebsd-x64": "4.57.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.57.1", + "@rollup/rollup-linux-arm-musleabihf": "4.57.1", + "@rollup/rollup-linux-arm64-gnu": "4.57.1", + "@rollup/rollup-linux-arm64-musl": "4.57.1", + "@rollup/rollup-linux-loong64-gnu": "4.57.1", + "@rollup/rollup-linux-loong64-musl": "4.57.1", + "@rollup/rollup-linux-ppc64-gnu": "4.57.1", + "@rollup/rollup-linux-ppc64-musl": "4.57.1", + "@rollup/rollup-linux-riscv64-gnu": "4.57.1", + "@rollup/rollup-linux-riscv64-musl": "4.57.1", + "@rollup/rollup-linux-s390x-gnu": "4.57.1", + "@rollup/rollup-linux-x64-gnu": "4.57.1", + "@rollup/rollup-linux-x64-musl": "4.57.1", + "@rollup/rollup-openbsd-x64": "4.57.1", + "@rollup/rollup-openharmony-arm64": "4.57.1", + "@rollup/rollup-win32-arm64-msvc": "4.57.1", + "@rollup/rollup-win32-ia32-msvc": "4.57.1", + "@rollup/rollup-win32-x64-gnu": "4.57.1", + "@rollup/rollup-win32-x64-msvc": "4.57.1", + "fsevents": "~2.3.2" + } + }, "node_modules/scheduler": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", @@ -2220,6 +3428,16 @@ "@img/sharp-win32-x64": "0.34.5" } }, + "node_modules/source-map": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -2252,6 +3470,29 @@ } } }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/tailwindcss": { "version": "4.1.18", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz", @@ -2273,6 +3514,29 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/tinyexec": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", @@ -2283,6 +3547,40 @@ "node": ">=18" } }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -2405,6 +3703,13 @@ "node": ">=14.17" } }, + "node_modules/ufo": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", + "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", + "dev": true, + "license": "MIT" + }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -2421,6 +3726,16 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/zod": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz", + "integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/zustand": { "version": "4.5.7", "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", @@ -2459,6 +3774,154 @@ "prisma": "^6.3.0", "typescript": "^5.7" } + }, + "packages/opencode-plugin": { + "name": "opencode-agentlens", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "agentlens-sdk": "*" + }, + "devDependencies": { + "@opencode-ai/plugin": "^1.1.53", + "tsup": "^8.3.0", + "typescript": "^5.7.0" + }, + "peerDependencies": { + "@opencode-ai/plugin": ">=1.1.0" + } + }, + "packages/opencode-plugin/node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "packages/opencode-plugin/node_modules/tsup": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", + "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.27.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", + "resolve-from": "^5.0.0", + "rollup": "^4.34.8", + "source-map": "^0.7.6", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.5.0" + }, + "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "packages/sdk-ts": { + "name": "agentlens-sdk", + "version": "0.1.0", + "license": "MIT", + "devDependencies": { + "tsup": "^8.3.0", + "typescript": "^5.7.0" + }, + "engines": { + "node": ">=20" + } + }, + "packages/sdk-ts/node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "packages/sdk-ts/node_modules/tsup": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", + "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.27.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", + "resolve-from": "^5.0.0", + "rollup": "^4.34.8", + "source-map": "^0.7.6", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.5.0" + }, + "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } } } } diff --git a/packages/opencode-plugin/package.json b/packages/opencode-plugin/package.json new file mode 100644 index 0000000..219789c --- /dev/null +++ b/packages/opencode-plugin/package.json @@ -0,0 +1,47 @@ +{ + "name": "opencode-agentlens", + "version": "0.1.0", + "description": "OpenCode plugin for AgentLens — trace your coding agent's decisions, tool calls, and sessions", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "files": ["dist"], + "scripts": { + "build": "tsup", + "dev": "tsup --watch", + "typecheck": "tsc --noEmit", + "clean": "rm -rf dist" + }, + "dependencies": { + "agentlens-sdk": "*" + }, + "devDependencies": { + "@opencode-ai/plugin": "^1.1.53", + "tsup": "^8.3.0", + "typescript": "^5.7.0" + }, + "peerDependencies": { + "@opencode-ai/plugin": ">=1.1.0" + }, + "keywords": [ + "opencode", + "agentlens", + "observability", + "tracing", + "coding-agent" + ], + "license": "MIT" +} diff --git a/packages/opencode-plugin/src/config.ts b/packages/opencode-plugin/src/config.ts new file mode 100644 index 0000000..572e544 --- /dev/null +++ b/packages/opencode-plugin/src/config.ts @@ -0,0 +1,41 @@ +export interface PluginConfig { + apiKey: string; + endpoint: string; + enabled: boolean; + /** Opt-in: capture full message content in traces */ + captureContent: boolean; + /** Maximum characters for tool output before truncation */ + maxOutputLength: number; + /** Milliseconds between automatic flushes */ + flushInterval: number; + /** Maximum traces per batch */ + maxBatchSize: number; +} + +export function loadConfig(): PluginConfig { + const apiKey = process.env["AGENTLENS_API_KEY"] ?? ""; + + if (!apiKey) { + console.warn( + "[agentlens] AGENTLENS_API_KEY not set — plugin will be disabled", + ); + } + + return { + apiKey, + endpoint: + process.env["AGENTLENS_ENDPOINT"] ?? "https://agentlens.vectry.tech", + enabled: (process.env["AGENTLENS_ENABLED"] ?? "true") === "true", + captureContent: + (process.env["AGENTLENS_CAPTURE_CONTENT"] ?? "false") === "true", + maxOutputLength: parseInt( + process.env["AGENTLENS_MAX_OUTPUT_LENGTH"] ?? "2000", + 10, + ), + flushInterval: parseInt( + process.env["AGENTLENS_FLUSH_INTERVAL"] ?? "5000", + 10, + ), + maxBatchSize: parseInt(process.env["AGENTLENS_BATCH_SIZE"] ?? "10", 10), + }; +} diff --git a/packages/opencode-plugin/src/index.ts b/packages/opencode-plugin/src/index.ts new file mode 100644 index 0000000..d723d60 --- /dev/null +++ b/packages/opencode-plugin/src/index.ts @@ -0,0 +1,146 @@ +import type { Plugin } from "@opencode-ai/plugin"; +import type { JsonValue } from "agentlens-sdk"; +import { init, flush, EventType as EventTypeValues } from "agentlens-sdk"; +import { loadConfig } from "./config.js"; +import { SessionState } from "./state.js"; +import { truncate, safeJsonValue } from "./utils.js"; + +const plugin: Plugin = async ({ project, directory, worktree }) => { + const config = loadConfig(); + + if (!config.enabled || !config.apiKey) { + console.log("[agentlens] Plugin disabled — missing AGENTLENS_API_KEY"); + return {}; + } + + init({ + apiKey: config.apiKey, + endpoint: config.endpoint, + flushInterval: config.flushInterval, + maxBatchSize: config.maxBatchSize, + }); + + const state = new SessionState(); + + return { + event: async ({ event }) => { + const type = event.type; + const props = (event as Record).properties as + | Record + | undefined; + + if (type === "session.created" && props?.["id"]) { + state.startSession(String(props["id"]), { + project: project.id, + directory, + worktree, + }); + } + + if (type === "session.idle") { + const sessionId = props?.["sessionID"] ?? props?.["id"]; + if (sessionId) await flush(); + } + + if (type === "session.error") { + const sessionId = String(props?.["sessionID"] ?? props?.["id"] ?? ""); + if (sessionId) { + const trace = state.getTrace(sessionId); + if (trace) { + trace.addEvent({ + type: EventTypeValues.ERROR, + name: String(props?.["error"] ?? "session error"), + metadata: safeJsonValue(props) as JsonValue, + }); + } + } + } + + if (type === "session.deleted") { + const sessionId = String(props?.["sessionID"] ?? props?.["id"] ?? ""); + if (sessionId) state.endSession(sessionId); + } + + if (type === "session.diff") { + const sessionId = String(props?.["sessionID"] ?? props?.["id"] ?? ""); + if (sessionId) { + const trace = state.getTrace(sessionId); + if (trace) { + trace.setMetadata({ + diff: truncate(String(props?.["diff"] ?? ""), 5000), + }); + } + } + } + + if (type === "file.edited") { + const sessionId = String(props?.["sessionID"] ?? props?.["id"] ?? ""); + const trace = sessionId ? state.getTrace(sessionId) : undefined; + if (trace) { + trace.addEvent({ + type: EventTypeValues.CUSTOM, + name: "file.edited", + metadata: safeJsonValue({ + filePath: props?.["filePath"], + }) as JsonValue, + }); + } + } + }, + + "tool.execute.before": async (input, output) => { + state.startToolCall( + input.callID, + input.tool, + output.args as unknown, + input.sessionID, + ); + }, + + "tool.execute.after": async (input, output) => { + state.endToolCall( + input.callID, + truncate(output.output ?? "", config.maxOutputLength), + output.title ?? input.tool, + output.metadata as unknown, + ); + }, + + "chat.message": async (input) => { + if (input.model) { + state.recordLLMCall(input.sessionID, { + model: input.model, + agent: input.agent, + messageID: input.messageID, + }); + } + }, + + "chat.params": async (input, output) => { + const trace = state.getTrace(input.sessionID); + if (trace) { + trace.addEvent({ + type: EventTypeValues.CUSTOM, + name: "chat.params", + metadata: safeJsonValue({ + agent: input.agent, + model: input.model.id, + provider: input.provider.info.id, + temperature: output.temperature, + topP: output.topP, + topK: output.topK, + }) as JsonValue, + }); + } + }, + + "permission.ask": async (input, output) => { + state.recordPermission(input.sessionID, input, output.status); + }, + }; +}; + +export default plugin; +export { plugin as AgentLensPlugin }; +export type { PluginConfig } from "./config.js"; +export { loadConfig } from "./config.js"; diff --git a/packages/opencode-plugin/src/state.ts b/packages/opencode-plugin/src/state.ts new file mode 100644 index 0000000..5040248 --- /dev/null +++ b/packages/opencode-plugin/src/state.ts @@ -0,0 +1,183 @@ +import { + TraceBuilder, + SpanType, + SpanStatus, + DecisionType, + nowISO, +} from "agentlens-sdk"; +import type { JsonValue, TraceStatus } from "agentlens-sdk"; +import { extractToolMetadata, safeJsonValue } from "./utils.js"; + +interface ToolCallState { + startTime: number; + tool: string; + args: unknown; + sessionID: string; +} + +export class SessionState { + private traces = new Map(); + private toolCalls = new Map(); + private rootSpans = new Map(); + + startSession( + sessionId: string, + metadata?: Record, + ): TraceBuilder { + const trace = new TraceBuilder("opencode-session", { + sessionId, + tags: ["opencode", "coding-agent"], + metadata: metadata ? (safeJsonValue(metadata) as JsonValue) : undefined, + }); + + const rootSpanId = trace.addSpan({ + name: "session", + type: SpanType.AGENT, + startedAt: nowISO(), + metadata: metadata ? (safeJsonValue(metadata) as JsonValue) : undefined, + }); + + this.traces.set(sessionId, trace); + this.rootSpans.set(sessionId, rootSpanId); + return trace; + } + + getTrace(sessionId: string): TraceBuilder | undefined { + return this.traces.get(sessionId); + } + + endSession(sessionId: string, status?: TraceStatus): void { + const trace = this.traces.get(sessionId); + if (!trace) return; + + const rootSpanId = this.rootSpans.get(sessionId); + if (rootSpanId) { + trace.addSpan({ + id: rootSpanId, + name: "session", + type: SpanType.AGENT, + status: status === "ERROR" ? SpanStatus.ERROR : SpanStatus.COMPLETED, + endedAt: nowISO(), + }); + } + + trace.end({ status: status ?? "COMPLETED" }); + this.traces.delete(sessionId); + this.rootSpans.delete(sessionId); + } + + startToolCall( + callID: string, + tool: string, + args: unknown, + sessionID: string, + ): void { + this.toolCalls.set(callID, { + startTime: Date.now(), + tool, + args, + sessionID, + }); + } + + endToolCall( + callID: string, + output: string, + title: string, + metadata: unknown, + ): void { + const call = this.toolCalls.get(callID); + if (!call) return; + this.toolCalls.delete(callID); + + const trace = this.traces.get(call.sessionID); + if (!trace) return; + + const durationMs = Date.now() - call.startTime; + const rootSpanId = this.rootSpans.get(call.sessionID); + const toolMeta = extractToolMetadata(call.tool, call.args); + + trace.addSpan({ + name: title, + type: SpanType.TOOL_CALL, + parentSpanId: rootSpanId, + input: safeJsonValue(call.args), + output: output as JsonValue, + durationMs, + status: SpanStatus.COMPLETED, + startedAt: new Date(call.startTime).toISOString(), + endedAt: nowISO(), + metadata: safeJsonValue({ ...toolMeta, rawMetadata: metadata }), + }); + + trace.addDecision({ + type: DecisionType.TOOL_SELECTION, + chosen: call.tool as JsonValue, + alternatives: [], + reasoning: title, + durationMs, + parentSpanId: rootSpanId, + }); + } + + recordLLMCall( + sessionId: string, + options: { + model?: { providerID: string; modelID: string }; + agent?: string; + messageID?: string; + }, + ): void { + const trace = this.traces.get(sessionId); + if (!trace) return; + + const rootSpanId = this.rootSpans.get(sessionId); + const agentName = options.agent ?? "assistant"; + const modelName = options.model?.modelID ?? "unknown"; + + trace.addSpan({ + name: `${agentName} → ${modelName}`, + type: SpanType.LLM_CALL, + parentSpanId: rootSpanId, + status: SpanStatus.COMPLETED, + startedAt: nowISO(), + endedAt: nowISO(), + metadata: safeJsonValue({ + provider: options.model?.providerID, + model: options.model?.modelID, + agent: options.agent, + messageID: options.messageID, + }), + }); + } + + recordPermission( + sessionId: string, + permission: unknown, + status: string, + ): void { + const trace = this.traces.get(sessionId); + if (!trace) return; + + const rootSpanId = this.rootSpans.get(sessionId); + const p = permission as Record | null; + const title = (p?.["title"] as string) ?? "permission"; + const permType = (p?.["type"] as string) ?? "unknown"; + + trace.addDecision({ + type: DecisionType.ESCALATION, + chosen: safeJsonValue({ action: status }), + alternatives: [ + "allow" as JsonValue, + "deny" as JsonValue, + "ask" as JsonValue, + ], + reasoning: `${permType}: ${title}`, + parentSpanId: rootSpanId, + }); + } + + getRootSpanId(sessionId: string): string | undefined { + return this.rootSpans.get(sessionId); + } +} diff --git a/packages/opencode-plugin/src/utils.ts b/packages/opencode-plugin/src/utils.ts new file mode 100644 index 0000000..c745564 --- /dev/null +++ b/packages/opencode-plugin/src/utils.ts @@ -0,0 +1,97 @@ +import type { JsonValue } from "agentlens-sdk"; + +export function truncate(str: string, maxLength: number): string { + if (str.length <= maxLength) return str; + return str.slice(0, maxLength) + "... [truncated]"; +} + +export function extractToolMetadata( + tool: string, + args: unknown, +): Record { + const a = args as Record | null | undefined; + if (!a || typeof a !== "object") return {}; + + switch (tool) { + case "read": + case "mcp_read": + return { filePath: a["filePath"] }; + + case "write": + case "mcp_write": + return { filePath: a["filePath"] }; + + case "edit": + case "mcp_edit": + return { filePath: a["filePath"] }; + + case "bash": + case "mcp_bash": + return { + command: truncate(String(a["command"] ?? ""), 200), + }; + + case "glob": + case "mcp_glob": + return { pattern: a["pattern"] }; + + case "grep": + case "mcp_grep": + return { pattern: a["pattern"], path: a["path"] }; + + case "task": + case "mcp_task": + return { + category: a["category"], + description: a["description"], + }; + + default: + return {}; + } +} + +const MODEL_COSTS: Record = { + "claude-opus-4-20250514": { input: 15, output: 75 }, + "claude-sonnet-4-20250514": { input: 3, output: 15 }, + "claude-haiku-3-20250307": { input: 0.25, output: 1.25 }, + "gpt-4o": { input: 2.5, output: 10 }, + "gpt-4o-mini": { input: 0.15, output: 0.6 }, + "gpt-4-turbo": { input: 10, output: 30 }, + "o3-mini": { input: 1.1, output: 4.4 }, +}; + +export function getModelCost( + modelId: string, +): { input: number; output: number } | undefined { + const direct = MODEL_COSTS[modelId]; + if (direct) return direct; + + for (const [key, cost] of Object.entries(MODEL_COSTS)) { + if (modelId.includes(key)) return cost; + } + return undefined; +} + +/** Coerce arbitrary values into SDK-compatible `JsonValue`, stringifying unknowns. */ +export function safeJsonValue(value: unknown): JsonValue { + if (value === null || value === undefined) return null; + if ( + typeof value === "string" || + typeof value === "number" || + typeof value === "boolean" + ) { + return value; + } + if (Array.isArray(value)) { + return value.map((v) => safeJsonValue(v)); + } + if (typeof value === "object") { + const result: Record = {}; + for (const [k, v] of Object.entries(value as Record)) { + result[k] = safeJsonValue(v); + } + return result; + } + return String(value); +} diff --git a/packages/opencode-plugin/tsconfig.json b/packages/opencode-plugin/tsconfig.json new file mode 100644 index 0000000..3a07e22 --- /dev/null +++ b/packages/opencode-plugin/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "moduleResolution": "bundler", + "lib": ["ES2022"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/opencode-plugin/tsup.config.ts b/packages/opencode-plugin/tsup.config.ts new file mode 100644 index 0000000..644948a --- /dev/null +++ b/packages/opencode-plugin/tsup.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/index.ts"], + format: ["esm", "cjs"], + dts: true, + clean: true, + sourcemap: true, +}); diff --git a/packages/sdk-ts/package.json b/packages/sdk-ts/package.json new file mode 100644 index 0000000..b373f80 --- /dev/null +++ b/packages/sdk-ts/package.json @@ -0,0 +1,38 @@ +{ + "name": "agentlens-sdk", + "version": "0.1.0", + "description": "AgentLens TypeScript SDK — Agent observability that traces decisions, not just API calls.", + "type": "module", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "build": "tsup", + "dev": "tsup --watch", + "typecheck": "tsc --noEmit", + "clean": "rm -rf dist" + }, + "engines": { + "node": ">=20" + }, + "license": "MIT", + "devDependencies": { + "tsup": "^8.3.0", + "typescript": "^5.7.0" + } +} diff --git a/packages/sdk-ts/src/_registry.ts b/packages/sdk-ts/src/_registry.ts new file mode 100644 index 0000000..f8d8a9c --- /dev/null +++ b/packages/sdk-ts/src/_registry.ts @@ -0,0 +1,11 @@ +import type { BatchTransport } from "./transport.js"; + +let _transport: BatchTransport | null = null; + +export function _setTransport(transport: BatchTransport | null): void { + _transport = transport; +} + +export function _getTransport(): BatchTransport | null { + return _transport; +} diff --git a/packages/sdk-ts/src/decision.ts b/packages/sdk-ts/src/decision.ts new file mode 100644 index 0000000..3f2820c --- /dev/null +++ b/packages/sdk-ts/src/decision.ts @@ -0,0 +1,29 @@ +import type { DecisionPointPayload, DecisionType, JsonValue } from "./models.js"; +import { generateId, nowISO } from "./models.js"; + +export interface CreateDecisionInput { + type: DecisionType; + chosen: JsonValue; + alternatives?: JsonValue[]; + reasoning?: string; + contextSnapshot?: JsonValue; + durationMs?: number; + costUsd?: number; + parentSpanId?: string; + timestamp?: string; +} + +export function createDecision(input: CreateDecisionInput): DecisionPointPayload { + return { + id: generateId(), + type: input.type, + chosen: input.chosen, + alternatives: input.alternatives ?? [], + reasoning: input.reasoning, + contextSnapshot: input.contextSnapshot, + durationMs: input.durationMs, + costUsd: input.costUsd, + parentSpanId: input.parentSpanId, + timestamp: input.timestamp ?? nowISO(), + }; +} diff --git a/packages/sdk-ts/src/index.ts b/packages/sdk-ts/src/index.ts new file mode 100644 index 0000000..7144b93 --- /dev/null +++ b/packages/sdk-ts/src/index.ts @@ -0,0 +1,76 @@ +import { BatchTransport } from "./transport.js"; +import { _setTransport, _getTransport } from "./_registry.js"; + +export interface InitOptions { + apiKey: string; + endpoint?: string; + maxBatchSize?: number; + flushInterval?: number; +} + +export function init(options: InitOptions): void { + const existing = _getTransport(); + if (existing) { + void existing.shutdown(); + } + _setTransport( + new BatchTransport({ + apiKey: options.apiKey, + endpoint: options.endpoint ?? "https://agentlens.vectry.tech", + maxBatchSize: options.maxBatchSize, + flushInterval: options.flushInterval, + }), + ); +} + +export async function shutdown(): Promise { + const transport = _getTransport(); + if (transport) { + await transport.shutdown(); + _setTransport(null); + } +} + +export function getClient(): BatchTransport | null { + return _getTransport(); +} + +export async function flush(): Promise { + const transport = _getTransport(); + if (transport) { + await transport.flush(); + } +} + +export { + TraceStatus, + DecisionType, + SpanType, + SpanStatus, + EventType, + generateId, + nowISO, +} from "./models.js"; + +export type { + JsonValue, + DecisionPointPayload, + SpanPayload, + EventPayload, + TracePayload, +} from "./models.js"; + +export { BatchTransport } from "./transport.js"; +export type { BatchTransportOptions } from "./transport.js"; + +export { TraceBuilder } from "./trace.js"; +export type { + TraceBuilderOptions, + AddSpanInput, + AddDecisionInput, + AddEventInput, + EndOptions, +} from "./trace.js"; + +export { createDecision } from "./decision.js"; +export type { CreateDecisionInput } from "./decision.js"; diff --git a/packages/sdk-ts/src/models.ts b/packages/sdk-ts/src/models.ts new file mode 100644 index 0000000..9f18359 --- /dev/null +++ b/packages/sdk-ts/src/models.ts @@ -0,0 +1,136 @@ +import { randomUUID } from "crypto"; + +// --------------------------------------------------------------------------- +// JSON value type (replaces Prisma.JsonValue for the SDK) +// --------------------------------------------------------------------------- + +export type JsonValue = + | string + | number + | boolean + | null + | JsonValue[] + | { [key: string]: JsonValue }; + +// --------------------------------------------------------------------------- +// Enums (as const + type union pattern — NO TypeScript enum keyword) +// --------------------------------------------------------------------------- + +export const TraceStatus = { + RUNNING: "RUNNING", + COMPLETED: "COMPLETED", + ERROR: "ERROR", +} as const; +export type TraceStatus = (typeof TraceStatus)[keyof typeof TraceStatus]; + +export const DecisionType = { + TOOL_SELECTION: "TOOL_SELECTION", + ROUTING: "ROUTING", + RETRY: "RETRY", + ESCALATION: "ESCALATION", + MEMORY_RETRIEVAL: "MEMORY_RETRIEVAL", + PLANNING: "PLANNING", + CUSTOM: "CUSTOM", +} as const; +export type DecisionType = (typeof DecisionType)[keyof typeof DecisionType]; + +export const SpanType = { + LLM_CALL: "LLM_CALL", + TOOL_CALL: "TOOL_CALL", + MEMORY_OP: "MEMORY_OP", + CHAIN: "CHAIN", + AGENT: "AGENT", + CUSTOM: "CUSTOM", +} as const; +export type SpanType = (typeof SpanType)[keyof typeof SpanType]; + +export const SpanStatus = { + RUNNING: "RUNNING", + COMPLETED: "COMPLETED", + ERROR: "ERROR", +} as const; +export type SpanStatus = (typeof SpanStatus)[keyof typeof SpanStatus]; + +export const EventType = { + ERROR: "ERROR", + RETRY: "RETRY", + FALLBACK: "FALLBACK", + CONTEXT_OVERFLOW: "CONTEXT_OVERFLOW", + USER_FEEDBACK: "USER_FEEDBACK", + CUSTOM: "CUSTOM", +} as const; +export type EventType = (typeof EventType)[keyof typeof EventType]; + +// --------------------------------------------------------------------------- +// Wire-format interfaces (camelCase, matching POST /api/traces contract) +// --------------------------------------------------------------------------- + +export interface DecisionPointPayload { + id: string; + type: DecisionType; + chosen: JsonValue; + alternatives: JsonValue[]; + reasoning?: string; + contextSnapshot?: JsonValue; + durationMs?: number; + costUsd?: number; + parentSpanId?: string; + timestamp: string; +} + +export interface SpanPayload { + id: string; + parentSpanId?: string; + name: string; + type: SpanType; + input?: JsonValue; + output?: JsonValue; + tokenCount?: number; + costUsd?: number; + durationMs?: number; + status: SpanStatus; + statusMessage?: string; + startedAt: string; + endedAt?: string; + metadata?: JsonValue; +} + +export interface EventPayload { + id: string; + spanId?: string; + type: EventType; + name: string; + metadata?: JsonValue; + timestamp: string; +} + +export interface TracePayload { + id: string; + name: string; + sessionId?: string; + status: TraceStatus; + tags: string[]; + metadata?: JsonValue; + totalCost?: number; + totalTokens?: number; + totalDuration?: number; + startedAt: string; + endedAt?: string; + decisionPoints: DecisionPointPayload[]; + spans: SpanPayload[]; + events: EventPayload[]; +} + +// --------------------------------------------------------------------------- +// Helper functions +// --------------------------------------------------------------------------- + +/** Generate a v4 UUID. */ +export function generateId(): string { + return randomUUID(); +} + +/** Return the current time as an ISO-8601 string. */ +export function nowISO(): string { + return new Date().toISOString(); +} diff --git a/packages/sdk-ts/src/trace.ts b/packages/sdk-ts/src/trace.ts new file mode 100644 index 0000000..e6c76d6 --- /dev/null +++ b/packages/sdk-ts/src/trace.ts @@ -0,0 +1,185 @@ +import type { + TracePayload, + SpanPayload, + DecisionPointPayload, + EventPayload, + JsonValue, + TraceStatus, + SpanType, + SpanStatus, + DecisionType, + EventType, +} from "./models.js"; +import { + generateId, + nowISO, + TraceStatus as TraceStatusValues, + SpanStatus as SpanStatusValues, +} from "./models.js"; +import { _getTransport } from "./_registry.js"; + +export interface TraceBuilderOptions { + sessionId?: string; + tags?: string[]; + metadata?: JsonValue; +} + +export interface AddSpanInput { + id?: string; + parentSpanId?: string; + name: string; + type: SpanType; + input?: JsonValue; + output?: JsonValue; + tokenCount?: number; + costUsd?: number; + durationMs?: number; + status?: SpanStatus; + statusMessage?: string; + startedAt?: string; + endedAt?: string; + metadata?: JsonValue; +} + +export interface AddDecisionInput { + id?: string; + type: DecisionType; + chosen: JsonValue; + alternatives?: JsonValue[]; + reasoning?: string; + contextSnapshot?: JsonValue; + durationMs?: number; + costUsd?: number; + parentSpanId?: string; + timestamp?: string; +} + +export interface AddEventInput { + id?: string; + spanId?: string; + type: EventType; + name: string; + metadata?: JsonValue; + timestamp?: string; +} + +export interface EndOptions { + status?: TraceStatus; + metadata?: JsonValue; + totalCost?: number; + totalTokens?: number; +} + +export class TraceBuilder { + private readonly trace: TracePayload; + private readonly startMs: number; + + constructor(name: string, options?: TraceBuilderOptions) { + this.startMs = Date.now(); + this.trace = { + id: generateId(), + name, + sessionId: options?.sessionId, + status: TraceStatusValues.RUNNING, + tags: options?.tags ?? [], + metadata: options?.metadata, + startedAt: nowISO(), + decisionPoints: [], + spans: [], + events: [], + }; + } + + addSpan(input: AddSpanInput): string { + const id = input.id ?? generateId(); + const span: SpanPayload = { + id, + parentSpanId: input.parentSpanId, + name: input.name, + type: input.type, + input: input.input, + output: input.output, + tokenCount: input.tokenCount, + costUsd: input.costUsd, + durationMs: input.durationMs, + status: input.status ?? SpanStatusValues.RUNNING, + statusMessage: input.statusMessage, + startedAt: input.startedAt ?? nowISO(), + endedAt: input.endedAt, + metadata: input.metadata, + }; + this.trace.spans.push(span); + return id; + } + + addDecision(input: AddDecisionInput): string { + const id = input.id ?? generateId(); + const decision: DecisionPointPayload = { + id, + type: input.type, + chosen: input.chosen, + alternatives: input.alternatives ?? [], + reasoning: input.reasoning, + contextSnapshot: input.contextSnapshot, + durationMs: input.durationMs, + costUsd: input.costUsd, + parentSpanId: input.parentSpanId, + timestamp: input.timestamp ?? nowISO(), + }; + this.trace.decisionPoints.push(decision); + return id; + } + + addEvent(input: AddEventInput): string { + const id = input.id ?? generateId(); + const event: EventPayload = { + id, + spanId: input.spanId, + type: input.type, + name: input.name, + metadata: input.metadata, + timestamp: input.timestamp ?? nowISO(), + }; + this.trace.events.push(event); + return id; + } + + setStatus(status: TraceStatus): this { + this.trace.status = status; + return this; + } + + setMetadata(metadata: JsonValue): this { + this.trace.metadata = metadata; + return this; + } + + toPayload(): TracePayload { + return { ...this.trace }; + } + + end(options?: EndOptions): TracePayload { + const endedAt = nowISO(); + this.trace.endedAt = endedAt; + this.trace.totalDuration = Date.now() - this.startMs; + this.trace.status = + options?.status ?? TraceStatusValues.COMPLETED; + + if (options?.metadata !== undefined) { + this.trace.metadata = options.metadata; + } + if (options?.totalCost !== undefined) { + this.trace.totalCost = options.totalCost; + } + if (options?.totalTokens !== undefined) { + this.trace.totalTokens = options.totalTokens; + } + + const transport = _getTransport(); + if (transport) { + transport.add(this.trace); + } + + return { ...this.trace }; + } +} diff --git a/packages/sdk-ts/src/transport.ts b/packages/sdk-ts/src/transport.ts new file mode 100644 index 0000000..8a75231 --- /dev/null +++ b/packages/sdk-ts/src/transport.ts @@ -0,0 +1,77 @@ +import type { TracePayload } from "./models.js"; + +export interface BatchTransportOptions { + apiKey: string; + endpoint: string; + maxBatchSize?: number; + flushInterval?: number; +} + +export class BatchTransport { + private readonly apiKey: string; + private readonly endpoint: string; + private readonly maxBatchSize: number; + private readonly flushInterval: number; + private buffer: TracePayload[] = []; + private timer: ReturnType | null = null; + + constructor(options: BatchTransportOptions) { + this.apiKey = options.apiKey; + this.endpoint = options.endpoint.replace(/\/+$/, ""); + this.maxBatchSize = options.maxBatchSize ?? 10; + this.flushInterval = options.flushInterval ?? 5_000; + + this.timer = setInterval(() => { + void this._doFlush(); + }, this.flushInterval); + } + + add(trace: TracePayload): void { + this.buffer.push(trace); + if (this.buffer.length >= this.maxBatchSize) { + void this._doFlush(); + } + } + + async flush(): Promise { + await this._doFlush(); + } + + async shutdown(): Promise { + if (this.timer !== null) { + clearInterval(this.timer); + this.timer = null; + } + await this._doFlush(); + } + + private async _doFlush(): Promise { + if (this.buffer.length === 0) { + return; + } + + const batch = this.buffer.splice(0, this.buffer.length); + + try { + const response = await fetch(`${this.endpoint}/api/traces`, { + method: "POST", + headers: { + Authorization: `Bearer ${this.apiKey}`, + "Content-Type": "application/json", + }, + body: JSON.stringify({ traces: batch }), + }); + + if (!response.ok) { + const text = await response.text().catch(() => ""); + console.warn( + `AgentLens: Failed to send traces (HTTP ${response.status}): ${text.slice(0, 200)}`, + ); + } + } catch (error: unknown) { + const message = + error instanceof Error ? error.message : String(error); + console.warn(`AgentLens: Failed to send traces: ${message}`); + } + } +} diff --git a/packages/sdk-ts/tsconfig.json b/packages/sdk-ts/tsconfig.json new file mode 100644 index 0000000..3a07e22 --- /dev/null +++ b/packages/sdk-ts/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "moduleResolution": "bundler", + "lib": ["ES2022"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/sdk-ts/tsup.config.ts b/packages/sdk-ts/tsup.config.ts new file mode 100644 index 0000000..644948a --- /dev/null +++ b/packages/sdk-ts/tsup.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/index.ts"], + format: ["esm", "cjs"], + dts: true, + clean: true, + sourcemap: true, +});